fix(pre-code): signal skip via the pre-script output protocol - #536
Conversation
When an open human PR already addresses the issue, pre-code.sh now writes skipped=true plus a reason to the file named by FULLSEND_PRESCRIPT_OUTPUT (fullsend docs/normative/prescript-output/v1), so fullsend run stops before creating the sandbox instead of posting the "skipping" comment and then running the agent anyway. The GITHUB_OUTPUT skip writes are removed — they served the reusable workflows' inline invocation, which fullsend-ai/fullsend#5739 deletes. The write is guarded on the variable being present: under a CLI that predates the protocol the script behaves exactly as before (fails open, per the protocol's version-skew contract). Proceed paths write nothing — an absent skipped key means proceed. pre-fix.sh needs no protocol change: the fix agent has no skip semantics, and its double tool-install disappears when the inline invocation is removed (fullsend-ai/fullsend#5739). Adds pre-code-test.sh (ported from the fullsend scaffold copy that fullsend-ai/fullsend#5739 deletes, adapted to assert the protocol file instead of GITHUB_OUTPUT) and wires it into make script-test. Part of fullsend-ai/fullsend#4718. Supersedes #175. Assisted-by: Claude Signed-off-by: Wayne Sun <gsun@redhat.com>
PR Summary by QodoSignal pre-code skip via pre-script output protocol
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
|
🤖 Finished Review · ✅ Success · Started 9:40 PM UTC · Completed 9:56 PM UTC |
Code Review by Qodo
Context used✅ Compliance rules (platform):
55 rules 1. Protected scripts/ files modified
|
ReviewFindingsMedium
Low
Previous runReviewFindingsMedium
Low
Labels: PR modifies scripts/pre-code.sh, the pre-script for the code agent pipeline |
The force override matched --force as a substring anywhere in the
comment body, so a comment merely mentioning it ("please don't use
--force here", --forceful, or a pasted log line) silently disabled the
existing-PR check. Parse the first line and honor --force only as the
command's flag token (/fs-code --force), mirroring the dispatch
router's first-line tokenization. fullsend-ai/fullsend#5739 wires
COMMENT_BODY into the in-run pre-script for the first time, so this
branch is about to become reachable in production.
Test hardening:
- Assert GITHUB_OUTPUT stays empty on every path, locking in the
removal of the legacy skipped= writes that would collide with
fullsend run's protocol relay (last-write-wins).
- Run the script with FULLSEND_PRESCRIPT_OUTPUT, CODE_FORCE and
COMMENT_BODY explicitly unset so the caller's environment cannot
leak into the cases that depend on their absence.
- Add three regression tests for the --force anchoring; verified by
mutation (substring match fails exactly those three, legacy
GITHUB_OUTPUT writes fail the new assertion on all paths).
Assisted-by: Claude (review and fix)
Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Review · |
Move the prescript_output() helper into scripts/lib/prescript-output.lib.sh and compose it into pre-code via the existing bundle mechanism, per review: pre-code.sh becomes a generated artifact bundled from pre-code.src.sh by make script-build, like post-code/post-fix/post-prioritize. The committed scripts/pre-code.sh path and its self-contained behavior are unchanged, so CLI-side resolution (tryAgentsRepoFallback) is unaffected. pre-code-test.sh now resolves the script under test via resolve_agent_script, so CI exercises both source and bundled forms and check-bundle guards artifact freshness. All 27 tests pass in both modes. The library carries the protocol doc and load guard, ready for pre-fix.sh to source when the fix pipeline adopts the protocol. Assisted-by: Claude (review and fix) Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Review · |
…hellcheck The bundler inlines the lib at the source line, leaving the top-level dir variable unreferenced in the generated pre-code.sh — SC2034 in the pre-commit shellcheck hook. Use one SCRIPT_DIR definition for both the lib source line and the precommit-tools resolution, the same reuse pattern that keeps the other bundled scripts clean. Assisted-by: Claude (review and fix) Signed-off-by: Wayne Sun <gsun@redhat.com>
|
🤖 Finished Review · ✅ Success · Started 6:22 PM UTC · Completed 6:33 PM UTC |
|
🤖 Finished Retro · ✅ Success · Started 6:37 PM UTC · Completed 6:52 PM UTC |
Retro: PR #536 — fix(pre-code): signal skip via the pre-script output protocolWorkflow overview: Human-authored PR by waynesun09, reviewed by two bot reviewers (qodo-code-review, fullsend-ai-review) and two humans (ifireball, ralphbean). Merged after one round of human feedback across 4 commits over ~21 hours. Timeline
What went well
Review gapThe review agent's intent-coherence sub-agent flagged Observations covered by existing issues
Proposals filed
|
Summary
Phase 3 of the fullsend-ai/fullsend#4718 plan (acked direction):
pre-code.shsignals the existing-PR skip through the pre-script output protocol (normative contract, shipped in fullsend-ai/fullsend#5737) instead ofGITHUB_OUTPUT.Supersedes #175 — the skip-flag approach (
CODE_SKIP_EXISTING_PR_CHECK/FIX_SKIP_TOOL_INSTALL) was withdrawn after review; no flags, no harness env changes, and localfullsend runbehavior is unchanged by construction (@rh-hemartin's concern on #175).Changes
pre-code.sh— on finding an open human PR, writesskipped=true+ areasonnaming the PR to$FULLSEND_PRESCRIPT_OUTPUT, sofullsend runstops before sandbox creation instead of posting the "skipping" comment and then running the agent anyway (the current in-run behavior). The write is guarded on the variable being set: under an older CLI the script behaves exactly as today (fails open, per the protocol's version-skew contract). Proceed paths (no PRs, bot-only PRs,--force, noGH_TOKEN) write nothing — absentskippedmeans proceed. TheGITHUB_OUTPUTwrites are removed; they served the inline workflow invocation that fix(#4718)!: remove inline pre-script calls and scaffold script copies fullsend#5739 deletes.pre-fix.sh— intentionally untouched. The fix agent has no skip semantics (validation failures and the iteration cap remain hard errors), and its double tool-install disappears with the inline invocation in fix(#4718)!: remove inline pre-script calls and scaffold script copies fullsend#5739.scripts/pre-code-test.sh(new) +make script-testwiring — ported from the fullsend scaffold copy that #5739 deletes (so the mock-ghcoverage of the existing-PR check survives the single-sourcing), with theGITHUB_OUTPUTassertions replaced by exact-content assertions on the protocol file, plus an explicit old-CLI fails-open case.Sequencing
Safe to merge now: under the released CLI the guard makes this a no-op (current behavior preserved). It becomes load-bearing once a fullsend release contains #5737 — and it is a merge gate for fullsend-ai/fullsend#5739, which removes the workflows' inline gating.
Testing
bash scripts/pre-code-test.sh— all 25 cases pass (existing-PR check, bot filtering, force override, protocol writes, old-CLI guard)make test— only pre-existing failure ispost-scribe-test.shlive-mode-uses-paginate-for-idempotency, which reproduces identically on pristinemain(untouched by this PR)shellcheckclean on both changed scripts