Skip to content

handle-agy-tasks.sh lands the branch into the main clone for every repo — landing should be UI-repos-only - #687

Merged
JoshuaVSherman merged 2 commits into
devfrom
agy/686-handle-agy-tasks-sh-lands-the-branch-int
Aug 21, 2026
Merged

handle-agy-tasks.sh lands the branch into the main clone for every repo — landing should be UI-repos-only#687
JoshuaVSherman merged 2 commits into
devfrom
agy/686-handle-agy-tasks-sh-lands-the-branch-int

Conversation

@JoshuaVSherman

Copy link
Copy Markdown
Contributor

Summary

What changed

  • Made the end-of-run branch checkout into the main clone in scripts/handle-agy-tasks.sh conditional on the target repo being a UI repo.
  • Defined UI_REPOS list in scripts/handle-agy-tasks.sh: JaMmusic, CollegeLutheran, AppersonAuto, TimShermanMusic, HenricksonForSalem.
  • Non-UI repos (web-jam-tools, web-jam-back, WebJamSocketCluster) now skip landing by default, leaving the worktree in place at /tmp/agy-worktrees/<Repo>-<branch> and printing its path.
  • Added --land flag to force landing on non-UI repos; --no-land continues to suppress landing on UI repos and takes precedence if both flags are passed.
  • Updated script header comments and usage/help strings to document the repo-conditional default and --land flag.
  • Extended test/handle_agy_tasks_no_land.test.ts with test cases covering non-UI default skipping, non-UI with --land, UI repo default landing, UI repo with --no-land, and both flags passed.
  • Bumped version in deno.json to 1.30.58.

Closes #686

How to test locally

Test Plan

Run all commands from /home/joshua/WebJamApps/web-jam-tools:

  1. Run format check and ensure clean formatting:
    deno task fmt:check
  2. Run linter and type checker:
    deno task lint && deno task check
  3. Run the specific no-land and landing test suite:
    deno test --allow-env --allow-run --allow-read --allow-write test/handle_agy_tasks_no_land.test.ts
    Verify all 6 tests pass:
    • Non-UI repo without flags skips checkout into main clone and leaves worktree in place.
    • Non-UI repo with --land checks out branch into main clone.
    • UI repo (JaMmusic) without flags checks out branch into main clone.
    • UI repo (JaMmusic) with --no-land skips checkout into main clone.
    • Non-UI repo with both --land and --no-land skips checkout (--no-land wins).
    • UI repo with both --land and --no-land skips checkout (--no-land wins).
  4. Run full test suite:
    deno task test
    Verify 1312+ tests pass with 0 failures.
  5. Run line coverage check:
    deno task coverage:check
    Verify line coverage remains >= 90% threshold across all files.

Test evidence

Test Evidence

  1. deno task fmt:check:
Task fmt:check deno fmt --check src/ test/
Checked 121 files
  1. deno task lint && deno task check:
Task lint deno lint src/ test/
Checked 114 files
Task check deno check src/ test/
  1. deno test --allow-env --allow-run --allow-read --allow-write test/handle_agy_tasks_no_land.test.ts:
running 6 tests from ./test/handle_agy_tasks_no_land.test.ts
headless run targeting non-UI repo without flags skips main clone branch checkout ... ok (121ms)
headless run targeting non-UI repo with --land checks out branch into main clone ... ok (120ms)
headless run targeting UI repo without flags checks out branch into main clone ... ok (122ms)
headless run targeting UI repo with --no-land skips main clone branch checkout ... ok (105ms)
headless run targeting non-UI repo with both --land and --no-land skips checkout (--no-land wins) ... ok (106ms)
headless run targeting UI repo with both --land and --no-land skips checkout (--no-land wins) ... ok (105ms)

ok | 6 passed | 0 failed (688ms)
  1. deno task test:
ok | 1312 passed | 0 failed (46s)
  1. deno task coverage:check:
| File                                               | Branch % | Function % | Line % |
| -------------------------------------------------- | -------- | ---------- | ------ |
| All files                                          |     86.7 |       98.5 |   91.5 |
[coverage] OK: all-files line coverage 91.5% >= 90% threshold

🤖 Work by Antigravity — Gemini Flash (High)

@JoshuaVSherman
JoshuaVSherman marked this pull request as ready for review August 20, 2026 13:03

@JoshuaVSherman JoshuaVSherman left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

🛑 Changes Requested

Reviewed as the cross-model reviewer (Sonnet reviewing a Flash-High-authored PR) per skills/pr-review. The implementation correctly satisfies nearly every acceptance criterion in web-jam-tools#686 "handle-agy-tasks.sh lands the branch into the main clone for every repo — landing should be UI-repos-only", but the header-comment edit clobbers a pre-existing, unrelated sentence and leaves a broken/nonsensical paragraph behind — that must be fixed before merge.

🛑 Must Fix Items

  • 🛑 scripts/handle-agy-tasks.sh header comment (around line 104) — deleted unrelated content and left a garbled sentence. The pre-existing paragraph read:

    ...is enforced via the prompt instruction only — the design explicitly rejects a new create-draft-pr.sh guard for this (a brittle "is this ordered human steps?" regex would false-positive-reject).

    This PR deletes the second half of that sentence (the design explicitly rejects a new create-draft-pr.sh guard...) — content unrelated to #686 and still true/relevant to the local-testing-recipe feature it documents — and grafts the new web-jam-tools#686 — repo-conditional landing: block directly onto the dangling clause, producing:

    ...is enforced via the prompt instruction only — the web-jam-tools#686 — repo-conditional landing: ...

    This is both a content-loss bug (an unrelated, still-valid design-rationale sentence about create-draft-pr.sh format enforcement is gone with no replacement) and a broken/nonsensical sentence fragment left in the file. Fix: restore the original sentence intact, and add the new #686 landing-behavior comment block as its own new paragraph (with a blank # line or clear separation) rather than splicing it into the middle of the existing one.

Checklist Verification

  • Mergeability: ✅ mergeable: MERGEABLE, no conflicts with dev. (mergeStateStatus: BLOCKED reflects the draft/no-review gate, not a conflict.)
  • CircleCI: ✅ ci/circleci: gate — SUCCESS (https://circleci.com/gh/WebJamApps/web-jam-tools/853).
  • Snyk: ✅ No separate Snyk check surfaced on this PR; nothing failing.
  • Scope: ✅ Touches only scripts/handle-agy-tasks.sh, test/handle_agy_tasks_no_land.test.ts, deno.json — matches the issue's declared file list exactly.
  • Acceptance criteria vs. web-jam-tools#686:
    1. UI_REPOS=("JaMmusic" "CollegeLutheran" "AppersonAuto" "TimShermanMusic" "HenricksonForSalem") — exact match to spec.
    2. ✅ Non-UI repos never land, including under --headless — the is_ui_repo gate (script line ~941) runs unconditionally before the HEADLESS/prompt branch is ever reached, so headless can't bypass it.
    3. ✅ Non-UI default path prints the worktree path and does not call git worktree remove — confirmed by reading the landing block; git worktree remove only happens inside the later DO_LAND branch, which the non-UI early-exit never reaches.
    4. ✅ UI-repo path is provably unchanged: is_ui_repo true skips the new gate entirely, falling through to the original interactive Y/n prompt, --headless auto-land (NEEDS-CONFIRM marker), and the pre-existing dirty-main-clone refusal.
    5. --land forces landing on a non-UI repo; NO_LAND is checked before the UI-repo gate, so --no-land suppresses landing on both UI and non-UI repos, and passing both flags together suppresses (no-land wins) regardless of repo type — matches spec.
    6. 🛑 Header comment updated but garbled (see Must Fix above); usage/help string (--land added, --no-land documented) is correct and clean.
    7. test/handle_agy_tasks_no_land.test.ts gains exactly the three required cases (non-UI default skip, UI default land, --land forces non-UI land) plus two extra combinations (--no-land on UI, both flags on both repo types) — good coverage, no gaps found.
      • 🟡 No red/green evidence pasted in the PR body — the issue's AC explicitly asks for each new test to be "verified to FAIL against the unmodified script before the fix, then pass after." The PR's "Test evidence" section only shows post-fix passing runs. (Per skills/pr-review's own Test Plan Integrity policy, a missing/thin test-evidence paste is not itself a defect, so this is not a blocker — flagging per the issue's specific AC wording, not as a generic evidence nit.)
    8. ✅ Single version bump, deno.json 1.30.571.30.58, strictly ahead of origin/dev's current 1.30.57.
    9. ✅ (duplicate of Scope above) — no stray files.
    10. ✅ AGENTS.md frontend guardrails (TS any, required-asterisk wrap, mobile floating buttons, mobile OAuth redirect, footer logo flex, Cloudflare _headers, Mongoose sort stripping) — none apply; this is a bash script + Deno test change with no TS any introduced.
  • Package-lock engine alignment: N/A — no engines/Node version change in this PR.
  • Test evidence integrity: ✅ Pasted deno task fmt:check / lint / check / targeted-suite / full-suite (1312 passed) / coverage:check (91.5% ≥ 90%) outputs look internally consistent with the diff; no fabrication signals.

🟡 Actionable Feedback & Suggestions

  • 🟡 See the red/green test-evidence note above (item 7) — not a merge blocker per the skill's test-evidence policy, but worth a one-line note in the PR body if convenient.
  • 🟡 scripts/handle-agy-tasks.sh line ~104: once the header comment is fixed, double check the paragraph still reads coherently end-to-end (the original sentence + the new #686 block as a clearly separated addition).

🤖 Cross-model review by Claude Code — Sonnet 5, per skills/pr-review.

@JoshuaVSherman JoshuaVSherman left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review Summary

✅ Approved

Re-review of the delta since the prior automated review (commit a4fb320 → head a2a529a). This evaluates only the new commit "docs: restore header comment rationale and fold /learn updates into AGENTS.md," which was pushed specifically to fix the sole Must Fix item from the previous review.

🛑 Must Fix Items

✅ None

The previously-flagged garbled header comment in scripts/handle-agy-tasks.sh (around line 104) is now fixed correctly:

  • The original pre-existing sentence (...is enforced via the prompt instruction only — the design explicitly rejects a new create-draft-pr.sh guard for this (a brittle "is this ordered human steps?" regex would false-positive-reject).) is restored intact and unmodified.
  • The new web-jam-tools#686 — repo-conditional landing: block is added as its own clearly separated paragraph (blank # line, then a distinct bulleted block), not spliced into the middle of the existing sentence.
  • The paragraph now reads coherently end-to-end.

Checklist Verification

  • Mergeability: ✅ mergeable: MERGEABLE, no conflicts with dev. (mergeStateStatus: BLOCKED reflects the outstanding approving-review gate, not a conflict — the prior automated review was COMMENTED, not APPROVED.)
  • CircleCI: ✅ ci/circleci: gate — PASS on the new commit (https://circleci.com/gh/WebJamApps/web-jam-tools/854).
  • Snyk: ✅ No separate Snyk check surfaced on this PR; nothing failing.
  • Scope: ✅ This commit touches scripts/handle-agy-tasks.sh (comment-only fix), AGENTS.md (new /learn-sourced lesson, explicitly exempt from scope review per skills/pr-review), and test/handle_agy_tasks_no_land.test.ts/deno.json are unchanged in this delta (verified against the fetched diff — the diff shown reflects the full PR, and the test/version changes were already reviewed and approved-of-content in the prior pass).
  • AGENTS.md addition: ✅ "Header & Inline Comment Integrity" lesson is accurate, does not duplicate or contradict any adjacent entry, and is properly scoped as a /learn guardrail exempt from the issue-scope check.
  • Semver: ✅ deno.json remains 1.30.58, strictly ahead of origin/dev's current 1.30.57; this follow-up commit correctly does NOT re-bump since dev did not move.
  • Package-lock engine alignment: N/A — no engines/Node version change in this PR.
  • Test evidence: ✅ No new test-evidence claims in this delta; prior evidence already verified consistent with the diff.
  • Prior 🟡 note (red/green test evidence): Not addressed in this commit and remains non-blocking per the skill's Test Plan Integrity policy — carried forward as a suggestion only, not a defect.

🟡 Actionable Feedback & Suggestions

✅ None


🤖 Cross-model review by Claude Code — Sonnet 5, per skills/pr-review.

@JoshuaVSherman
JoshuaVSherman merged commit 7bee153 into dev Aug 21, 2026
1 check passed
@JoshuaVSherman
JoshuaVSherman deleted the agy/686-handle-agy-tasks-sh-lands-the-branch-int branch August 21, 2026 18:06
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.

handle-agy-tasks.sh lands the branch into the main clone for every repo — landing should be UI-repos-only

1 participant