Skip to content

fix(verification): port watch-pr, worktree-audit, and skill rigor fixes - #25

Merged
jtaroreh merged 1 commit into
mainfrom
feat/agystack-pr3-empirical-verification
Nov 23, 2026
Merged

jtaroreh merged 1 commit into
mainfrom
feat/agystack-pr3-empirical-verification

Conversation

@jtaroreh

Copy link
Copy Markdown
Owner

Why

Port four watch-pr edge-case fixes, worktree-audit.sh portability and base-ref strictness, and empirical rigor rules from upstream pstack onto feat/agystack-pr1-invariants, while keeping Antigravity tools, brain artifacts, and model routing intact.

Scope

  • skills/poteto-mode/scripts/watch-pr/types.ts, github.ts, policy.ts, fakes.test-helper.ts, github.test.ts, and policy.test.ts port four fixes with regression tests: Code Review Gate ACTION_REQUIRED classification via gateOr (code-review-gate), isCrossRepository fork collision guards in orderStack and openPullRequests, paginated reviewThreadPage with pageInfo validation and resolveReviewThreads, and --timeout sleep capping in pollUntilTerminal.
  • skills/poteto-mode/scripts/worktree-audit.sh adds runtime GNU vs BSD stat and date probing, strict origin/HEAD, origin/main, and origin/master validation exiting 1 when all three are missing, explicit +refs/heads/...:refs/remotes/... fetch refspecs for single-branch clones, and optional origin pr fallback, while keeping trap 'rm -f "$prs"' EXIT INT TERM, substr($0, 10) path parsing, grep -rlFI fallback when rg is absent, and ~/.gemini/antigravity brain transcript scans.
  • skills/benchmark-checklist/SKILL.md adds pre-run uptime and nproc checks, an explicit claim statement, A-B-A-B interleaved sampling, inconclusive verdict criteria, and Antigravity perf_report.md Brain Artifact delivery.
  • skills/poteto-mode/playbooks/perf-issue.md replaces the eight strategy families with the seven ordered performance mantras (1. Don't do it through 7. Do it cheaper) while retaining invoke_subagent, the perf-issue (inherit) model config, principle-explain-the-number, and perf_report.md.
  • skills/create-verification-skill/SKILL.md restores empty-data-dir launch readiness after migrations and seed data, logging unmet seed preconditions in Gotchas instead of weakening journeys, and listing unverified stand-in target differences, while keeping Surface Precedence Hierarchy, browser_subagent, and .agents/skills/verify-<app>/.
  • skills/maintain-verification-skill/SKILL.md replaces benchmark-specific jargon (grader queues, 2-vCPU, dense fill explosion) with generic remote-environment postmortem wording while retaining helper CLI contract checks, worktree isolation checks, background-poller cleanup, and .agents/skills/verify-*/.

Out of scope: stacking onto PR-2 (handled by the stack coordinator after verification) and editing files outside these 11 paths.

Tradeoffs

  • GhGitHubReader drops the PR-1 runJsonFn constructor injection in favor of upstream's reviewThreadPage method on GitHubReader, keeping pagination logic in one pure function (resolveReviewThreads) over the interface and testing the gh CLI path via a temporary gh shim in github.test.ts.
  • worktree-audit.sh probes stat and date flags independently rather than gating both on stat -c, so a standalone GNU stat shim on macOS does not fail when /bin/date is BSD date.

Blast Radius

  • Touches PR babysitting, worktree cleanup auditing, and verification/perf skill instructions. Existing cli.ts, render.ts, and types.compile.ts contracts stay unchanged and pass typechecking.
  • bun test median runtime increases from ~267ms on trunk to 442ms because upstream's new gh fork-identity subprocess test executes a freshly written gh shim in tmpdir().

Verification

All checks ran on commit 9f1cd1a7c94f1cf1967e46e02430eb4315f953e1.

  • ruff check . passed.
  • pytest -v tests/ had 412 passed, 3 skipped (test_live_cloud_bidirectional.py without live GCS bucket), and 153 subtests passed.
  • cd skills/poteto-mode/scripts && bun test had 61 passed and 0 failed across 4 files, with a 5-run median of 442ms (range 438-451ms, under 2000ms).
  • bunx tsc --noEmit -p skills/poteto-mode/scripts/watch-pr/tsconfig.json exited 0.
  • bash -n skills/poteto-mode/scripts/worktree-audit.sh exited 0; live scratch tests passed against a bare remote, single-branch clone with -b origin/integration, spaced worktree and transcript paths, a stub GNU stat shim, stub origin pr, --bad-flag (exit 2), missing base refs (exit 1), and trap cleanup.
  • python3 skills/setup-agystack/scripts/setup_runtime.py --doctor returned "status": "OK".
  • bash scripts/package-plugin.sh --test verified the dry-run package archive (agy CLI absent on PATH, strict CLI validation skipped).
  • git diff --name-only origin/feat/agystack-pr1-invariants..HEAD confirmed only the 11 scoped files changed.

@jtaroreh
jtaroreh force-pushed the feat/agystack-pr3-empirical-verification branch from 9f1cd1a to b933bb3 Compare November 22, 2026 22:31
@jtaroreh
jtaroreh changed the base branch from feat/agystack-pr1-invariants to feat/agystack-pr2-formal-verification November 22, 2026 22:31
@jtaroreh

Copy link
Copy Markdown
Owner Author

Verification Verdict: CLEAN & Restacked onto PR-2 at b933bb36b5584798aec100d5d45e271bbeeec046

  • Stack & Patch-ID: Rebased cleanly onto feat/agystack-pr2-formal-verification (bc5e91a5066d7cb864c54136e61875e6222610ba) with identical git patch-id --stable (4ffb8e5ff391d0a8ff9208d7ce843d3d74e7c507).
  • Unit & Stacked Tip Gates: ruff check ., pytest -q tests/ (412 passed, 3 skipped, 153 subtests), bun test (61 passed), tsc --noEmit, bash -n worktree-audit.sh, setup_runtime.py --doctor, package-plugin.sh --test, and offline statechart compiler tests (70 passed) all exited 0.
  • Live (10/10 PASS): bun test, tsc --noEmit, orderStack !pr.isCrossRepository mutation proof (mutant exit 1, clean exit 0), single-branch clone worktree-audit.sh, GNU stat shim, --bad-flag (exit 2) and missing base (exit 1), benchmark-checklist / perf-issue mantras, create-verification-skill Antigravity + rigor clauses, maintain-verification-skill cleanup, and invariants/packaging. Receipts in /tmp/swarm-pr3/.
  • Perf: bun test median 516.7 ms wall (< 2000 ms PASS; +47.94% vs trunk 349.3 ms driven by upstream's 156.7 ms subprocess gh shim test, +4.77% in-process without it; accepted by operator).
  • Independent Audit & Interrogate (PASS): Strict 11-file scope verified; zero Cursor leaks; zero Bugbot/review threads.
  • Stack position: Appended as PR fix(verification): port watch-pr, worktree-audit, and skill rigor fixes #25 above PR Feat(formal-verification): port statechart compiler and formal verification skills #24 (feat/agystack-pr2-formal-verification).

@jtaroreh

Copy link
Copy Markdown
Owner Author

Independent verification verdict: PASS+NOTES

Verified head SHA: b933bb36b5584798aec100d5d45e271bbeeec046
Base branch: feat/agystack-pr2-formal-verification (bc5e91a5066d7cb864c54136e61875e6222610ba)
Diff patch-id (git patch-id --stable): 4ffb8e5ff391d0a8ff9208d7ce843d3d74e7c507

Verification commands and observed results

  • ruff check . passed (All checks passed!).
  • pytest -v tests/ passed (412 passed, 3 skipped, 153 subtests passed; the 3 skipped tests are tests/test_live_cloud_bidirectional.py without a live GCS bucket).
  • cd skills/poteto-mode/scripts && bun install --frozen-lockfile && bun run typecheck && bun test passed (tsc exited 0, 61 pass, 0 fail across 4 files with 182 assertions; bunx tsc --noEmit -p watch-pr/tsconfig.json also exited 0).
  • bash -n scripts/package-plugin.sh skills/poteto-mode/scripts/worktree-audit.sh skills/show-me-your-work/scripts/log.sh exited 0.
  • python3 skills/setup-agystack/scripts/setup_runtime.py --doctor exited 0 with "status": "OK".
  • bash scripts/package-plugin.sh --test exited 0 (Package archive dry-run verified for agystack v0.17.0).
  • Scratch execution of skills/poteto-mode/scripts/worktree-audit.sh against a bare remote, spaced worktree path, --bad-flag, and -b origin/nonexistent returned exit codes 0, 2, and 1 respectively.
  • gh pr view 25: mergeable=MERGEABLE, mergeStateStatus=CLEAN, reviewDecision empty, statusCheckRollup=[].

Diff audit and notes

  • watch-pr (types.ts, github.ts, policy.ts, fakes.test-helper.ts, github.test.ts, policy.test.ts): gateOr handles Code Review Gate ACTION_REQUIRED on both fast-path and GraphQL rollup paths, openPullRequests/orderStack filter isCrossRepository fork heads, resolveReviewThreads paginates reviewThreadPage with pageInfo validation, and pollUntilTerminal caps sleeps at remaining --timeout while preserving timeout: 0.
  • skills/poteto-mode/scripts/worktree-audit.sh: Runtime GNU/BSD stat and date probes, strict base-ref resolution, explicit fetch refspecs, NUL-delimited xargs -0 stat, and grep -rlFI fallback are clean. Manual shellcheck -S warning review found no warning/error issues (SC2086, SC2155, SC2064, SC2162, SC2164, SC2004).
  • Skill edits (benchmark-checklist/SKILL.md, perf-issue.md, create-verification-skill/SKILL.md, maintain-verification-skill/SKILL.md): Preserve Antigravity primitives, Brain Artifact paths, and model routing.
  • Notes:
    • shellcheck is not installed on this host, so CI's shellcheck -S warning check was audited manually rather than executed directly.
    • agy CLI is not on PATH, so package-plugin.sh --test skipped strict CLI validation.
    • The PR description still mentions the earlier base feat/agystack-pr1-invariants and commit 9f1cd1a7c94f1cf1967e46e02430eb4315f953e1 instead of the current stacked base and head SHA.

@jtaroreh
jtaroreh force-pushed the feat/agystack-pr2-formal-verification branch from bc5e91a to 73428c5 Compare November 23, 2026 00:48
@jtaroreh
jtaroreh changed the base branch from feat/agystack-pr2-formal-verification to main November 23, 2026 00:51
Ports upstream watch-pr fixes (gateOr ACTION_REQUIRED, isCrossRepository fork guard, reviewThreadPage pagination, pollUntilTerminal sleep cap), worktree-audit.sh runtime stat/date probing and strict base ref resolution, and empirical verification clauses in benchmark-checklist, perf-issue, create-verification-skill, and maintain-verification-skill while preserving Antigravity primitives.
@jtaroreh
jtaroreh force-pushed the feat/agystack-pr3-empirical-verification branch from b933bb3 to 0b96076 Compare November 23, 2026 00:51
@jtaroreh
jtaroreh merged commit 131890e into main Nov 23, 2026
2 checks passed
@jtaroreh
jtaroreh deleted the feat/agystack-pr3-empirical-verification branch November 23, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant