Skip to content

fix(#4718)!: remove inline pre-script calls and scaffold script copies - #5739

Merged
waynesun09 merged 1 commit into
mainfrom
4718-remove-inline-prescript-calls
Jul 30, 2026
Merged

fix(#4718)!: remove inline pre-script calls and scaffold script copies#5739
waynesun09 merged 1 commit into
mainfrom
4718-remove-inline-prescript-calls

Conversation

@waynesun09

@waynesun09 waynesun09 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase 2 of the #4718 plan: with the pre-script output protocol in fullsend run (#5737), the inline Validate inputs steps are redundant — and they were the last consumer of the scaffold copies of pre-code.sh/pre-fix.sh. This PR removes the inline calls and gates from all three reusable workflows and deletes the scaffold script copies, making fullsend-ai/agents the single source (the #5667 scope, closed as duplicate into #4718).

#5737 has merged (306acf0a), so this now targets main directly.

⛔ Merge/release gates

The binding constraint is the release cut, not the merge. The CLI resolves agents content from fullsend-ai/agents at tags/v0 (tryAgentsRepoFallback). fullsend's release.yml moves only fullsend's own v0 and pushes the release tag to the agents repo at its main HEAD; agents v0 is then moved by the agents repo's own release.yml in a separate, asynchronous run triggered by that tag push (which skips pre-releases). fullsend neither performs nor verifies that second move, so the ordering must be enforced by process:

  1. The agents-repo recut must be on fullsend-ai/agents@main before the fullsend release carrying this commit is tagged. Merging it to agents main afterwards changes nothing at runtime until the next release.
  2. Scripts must write skipped=true/reason via FULLSEND_PRESCRIPT_OUTPUT per the v1 contract, and remove their existing direct skipped= writes to $GITHUB_OUTPUTprescript.Relay now writes to that same file, so leaving both in place makes the two collide (last-write-wins).

If a release ships this commit while agents v0 still points at the old scripts, the in-run skip is a no-op for every @v0 install until the following release — not a merge window measured in hours.

Post-release verification: gh api repos/fullsend-ai/agents/git/ref/tags/v0 must resolve to a commit whose scripts/pre-code.sh contains FULLSEND_PRESCRIPT_OUTPUT; then re-run one code dispatch on an issue with an open human PR.

Current state: latest release v0.32.0 (2026-07-20) predates the protocol. fullsend-ai/agents#536 — the protocol adoption in pre-code.sh (shared-lib composed, with the --force override anchored to the command's flag token) — is approved and enqueued to agents main; the next full release's tag push then recuts agents v0 with it. fullsend-ai/agents#175 is still open with the withdrawn skip-flag design and should be closed rather than rebased.

Scope of the interim regression

Narrower than "no duplicate-PR gating", but contradictory rather than silent. The route job's own Check for existing PRs step (reusable-dispatch.yml) and the per-org dispatcher both run an equivalent search before the code stage and are untouched here. On the cases that do reach the pre-script (search-index timing, non-routed paths): the pre-protocol agents v0 script still runs authenticated inside fullsend run (mint sets GH_TOKEN before the pre-script), so it does post the "an open PR already addresses this issue" comment and apply the pr-open label — but its skipped=true goes to $GITHUB_OUTPUT, which nothing consumes, and prescript.Relay then writes skipped=false last (last-write-wins). The run proceeds and opens a duplicate bot PR immediately after commenting that it would skip. The recut delivers the skip itself; the label and comment were never the gap.

Fix-side enforcement is unaffected either way: input validation, the 10,000-byte HUMAN_INSTRUCTION cap, and the bot-5/human-10 iteration caps all terminate with exit 1 in the agents-repo pre-fix.sh, and a non-zero pre-script exit is a hard failure on every CLI version.

Related Issue

Part of #4718. Closes the #5667 scope. Continues #5588's scaffold cleanup.

Changes

  • reusable-code.yml + reusable-dispatch.yml (inlined code stage): remove Validate inputs and all four steps.validate.outputs.skipped gates; add COMMENT_BODY to the run step env (env-quoted) so the in-run pre-script can read it.
  • reusable-fix.yml + reusable-dispatch.yml (inlined fix stage): remove Validate inputs.
  • Delete internal/scaffold/fullsend-repo/scripts/{pre-code.sh,pre-fix.sh,pre-code-test.sh}; drop the executableFiles entry and the Makefile script-test line. Companion scripts (install-precommit-tools.sh, resolve-precommit-tools.py) intentionally remain — the agents-repo pre-fix.sh resolves them via the workspace fallback.
  • GH_TOKEN needs no workflow wiring: fullsend run mints the agent token (os.Setenv) before the pre-script executes, so the existing-PR check inside fullsend run is authenticated — which the old inline step wasn't (its env: had no GH_TOKEN, so it always short-circuited and emitted skipped=false; the gates it fed were effectively dead code, which is the silent breakage fix(#4718): wire GH_TOKEN and re-add fail-fast validation for pre-code/pre-fix #5013 tried to patch).
  • Docs: drop the deleted executableFiles entry from cli-internals.md, and note in customizing-agents.md that pre_script paths resolve against the harness's own repo — a locally defined harness must ship its own copies.

Known gaps, deliberately not addressed here

  • Test coverage. pre-code-test.sh (26 cases) is deleted and has no counterpart in the agents repo, which has no pre-code-test.sh/pre-fix-test.sh. The recut should port it and extend it to assert the FULLSEND_PRESCRIPT_OUTPUT writes.
  • Fail-fast position. Validation and the iteration cap now run inside fullsend run, after GCP setup and token mint, rather than before them. A capped-out fix loop therefore burns WIF auth plus a mint per attempt and surfaces as an agent-run ❌ rather than a cheap step failure.
  • --force is not end-to-end. The route job's Check for existing PRs gate does not honor --force, so /fs-code --force is still stopped before the pre-script sees COMMENT_BODY. The wiring here is correct but only helps on non-routing-gated paths.
  • No version floor. action.yml exposes outputs.skipped (empty ⇒ CLI predates the protocol) but nothing consumes it. A repo whose uses: ref contains this commit while fullsend_version resolves to a pre-protocol release loses the code skip silently.

Testing

  • make lint passes, including actionlint on all three workflows
  • All three workflows re-parse; zero remaining steps.validate references anywhere in .github/, internal/, e2e/
  • go build ./..., go test ./internal/scaffold/ (embed/file-mode sync tests pass post-deletion)
  • Capability parity audited against fullsend-ai/agents: the agents copies of pre-code.sh/pre-fix.sh are line-for-line equivalent to the deleted scaffold copies apart from comments and an added GITHUB_WORKSPACE guard; PATH/pre-commit-tool install is re-done independently by post-code.sh/post-fix.sh, so no regression there
  • make script-test: only pre-existing local failures in pre-fetch-prior-review-test.sh (reproduced identically on the base commit; untouched by this PR)
  • End-to-end skip behavior requires the gates above; validate in the behaviour suite after the agents-repo recut lands

Checklist

  • PR title follows Conventional Commits (correct type, ! for breaking changes)
  • Commits are signed off (DCO) — human and human-directed agent sessions only
  • I wrote this contribution myself and can explain all changes in it

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:06 PM UTC · Completed 9:22 PM UTC
Commit: 6301ca4 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review

Findings

Medium

  • [behavioral regression] .github/workflows/reusable-fix.yml, .github/workflows/reusable-dispatch.yml — The deleted scaffold pre-fix.sh enforced iteration caps (bot: 5, human: 10) and a 10KB HUMAN_INSTRUCTION length cap. These inline workflow steps are removed. The PR body claims the agents-repo pre-fix.sh already enforces equivalent caps via exit 1; this claim cannot be independently verified from this repo. The iteration value is still computed and passed as FIX_ITERATION, so the infrastructure for enforcement exists; only the blocking step is removed.
    Remediation: Before releasing, verify the agents-repo pre-fix.sh enforces equivalent iteration caps and instruction length caps.

  • [input validation] .github/workflows/reusable-code.yml — The deleted pre-code.sh validated ISSUE_NUMBER (positive integer), REPO_FULL_NAME (owner/repo format), and GITHUB_ISSUE_URL (valid GitHub URL). These defense-in-depth validations are removed from the workflow without visible replacement in this repo.
    Remediation: Verify the agents-repo pre-code.sh includes equivalent input validation.

  • [stale-doc] docs/architecture.md:660 — The architecture diagram describes the pre-script as "validates ISSUE_NUMBER, REPO_FULL_NAME, URL consistency." This described the scaffold's pre-code.sh, which is deleted by this PR. The description no longer matches what the pre-script does.
    Remediation: Update lines 660–661 to describe the current pre-script behavior.

  • [protected-path] .github/workflows/reusable-code.yml, .github/workflows/reusable-dispatch.yml, .github/workflows/reusable-fix.yml — This PR modifies files under .github/, which is a protected path. The PR links to issue Remove redundant pre-code.sh / pre-fix.sh calls from reusable workflows #4718 and provides rationale. Human approval is always required for protected-path changes regardless of context.

Low

  • [scope-creep] docs/guides/user/customizing-agents.md — The new documentation block adds guidance about script path resolution semantics. Reasonable migration guidance given the ! breaking change.

  • [test coverage loss] internal/scaffold/fullsend-repo/scripts/pre-code-test.sh — 26 test cases deleted with no counterpart in the agents repo verified. Acknowledged in the PR body as a known gap.

  • [stale-doc] docs/plans/agent-extraction-to-agents-repo.md:282 — The agent-extraction plan lists scripts/pre-code.sh and scripts/pre-fix.sh as scaffold files to be extracted. Both have been deleted from the scaffold by this PR.
    Remediation: Update the file-mapping tables to note these scripts have been removed.

Previous run

Review

Findings

Medium

  • [behavioral regression] .github/workflows/reusable-dispatch.yml — The deleted scaffold pre-fix.sh enforced iteration caps (bot: 5, human: 10) and a 10KB HUMAN_INSTRUCTION length cap. The CLI (internal/cli/run.go) does not replicate these caps — FIX_ITERATION is passed as an env var but nothing in the CLI stops the run when the cap is exceeded. These must be enforced by the replacement pre-fix.sh in fullsend-ai/agents via the pre-script output protocol before the release carrying this commit. The PR body documents this as a release gate dependency.
    Remediation: Before tagging a release, verify the agents-repo pre-fix.sh enforces equivalent iteration caps and the 10KB instruction length cap.

  • [commit-convention] PR title uses fix(#4718)!: but COMMITS.md line 59 explicitly forbids fix(ci) — CI changes should use the ci(<subsystem>) prefix. Using fix places this in the "Bug Fixes" section of GoReleaser-generated release notes, misleading for a CI-internal change. The ! breaking-change indicator is correctly applied.
    Remediation: Retitle to ci(#4718)!: remove inline pre-script calls and scaffold script copies.

  • [stale-doc] docs/architecture.md:660 — The architecture diagram describes the pre-script as "validates ISSUE_NUMBER, REPO_FULL_NAME, URL consistency." This input-validation behavior is removed by this PR (the scaffold pre-code.sh is deleted and the inline Validate inputs steps are removed). The description no longer matches what the pre-script does.
    Remediation: Update lines 660–661 to describe the current pre-script behavior.

  • [protected-path] .github/workflows/reusable-code.yml, .github/workflows/reusable-dispatch.yml, .github/workflows/reusable-fix.yml — This PR modifies files under .github/, which is a protected path. The PR links to issue Remove redundant pre-code.sh / pre-fix.sh calls from reusable workflows #4718 and provides rationale. Human approval is always required for protected-path changes regardless of context.

Low

Previous run (2)

Review

Reason: stale-head

The review agent reviewed commit 1a5a2272f53326c7325a688f665677e57ed67bdc but the PR HEAD is now 841a6708ad14135257347d8d35720b2f0b88bd02. This review was discarded to avoid approving unreviewed code.

Previous run (3)

Review

Findings

High

  • [behavioral regression] .github/workflows/reusable-code.yml — The deleted pre-code.sh signaled skipped=true via GITHUB_OUTPUT when an existing PR was found for an issue. All downstream step gates (if: steps.validate.outputs.skipped != 'true') are removed. internal/cli/run.go currently does not parse pre-script structured output — it only checks the exit code (lines 896–909 pipe stdout/stderr directly; FULLSEND_PRESCRIPT_OUTPUT appears nowhere in the codebase). If this PR merges before feat(#4718): add pre-script output protocol to fullsend run #5737, the duplicate-PR guard is silently lost.
    Remediation: Confirm feat(#4718): add pre-script output protocol to fullsend run #5737 is merged and released before this PR. Verify fullsend run respects the skipped=true pre-script output via the new protocol.

  • [behavioral regression] .github/workflows/reusable-dispatch.yml — The deleted pre-fix.sh enforced iteration caps (bot: 5, human: 10) to prevent unbounded fix loops. This validation is removed from both reusable-dispatch.yml (inlined fix job) and reusable-fix.yml (standalone). If the replacement pre-script in fullsend-ai/agents does not replicate the caps, fix iterations become unbounded.
    Remediation: Verify the agents-repo pre-fix.sh enforces equivalent iteration caps via the pre-script output protocol.

Medium

  • [Removed security control — input validation] .github/workflows/reusable-code.yml — The removed pre-code.sh validated input format (ISSUE_NUMBER as positive integer, REPO_FULL_NAME as owner/repo, GITHUB_ISSUE_URL format with cross-field consistency checks). These defense-in-depth checks are removed. While inputs originate from GitHub's event payload, the cross-field consistency checks guard against event_payload tampering.

  • [Removed security control — instruction length cap] .github/workflows/reusable-fix.yml — The removed pre-fix.sh enforced a 10,000-byte cap on HUMAN_INSTRUCTION as DoS defense. This control is now absent from both fix workflow paths.

  • [protected-path] .github/workflows/reusable-code.yml, .github/workflows/reusable-dispatch.yml, .github/workflows/reusable-fix.yml — This PR modifies files under .github/, which is a protected path. The PR links to issue Remove redundant pre-code.sh / pre-fix.sh calls from reusable workflows #4718 and provides rationale. Human approval is always required for protected-path changes regardless of context.

Low

  • [stale-reference] docs/guides/dev/cli-internals.md:616 — Documentation shows scripts/pre-code.sh in the executableFiles map example, but this entry is removed from scaffold.go in this PR.

Labels: PR modifies CI workflow files under .github/workflows/ and scaffold scripts


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added the component/ci CI pipelines and checks label Jul 29, 2026
Base automatically changed from 4718-prescript-skip-protocol to main July 29, 2026 21:28
@waynesun09
waynesun09 marked this pull request as ready for review July 29, 2026 21:30
@waynesun09
waynesun09 force-pushed the 4718-remove-inline-prescript-calls branch from 6301ca4 to 1a5a227 Compare July 29, 2026 21:30
@waynesun09
waynesun09 requested review from a team as code owners July 29, 2026 21:30
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Remove inline pre-script validation and scaffolded pre-code/pre-fix scripts

⚙️ Configuration changes ✨ Enhancement 🕐 20-40 Minutes

Grey Divider

AI Description

• Remove inline Validate inputs pre-script steps from reusable code/fix workflows.
• Rely on fullsend run pre-script output protocol for skip decisions and --force handling.
• Delete scaffolded pre-code.sh/pre-fix.sh copies and their test, making agents repo
 authoritative.
Diagram

graph TD
  A["Reusable workflows"] --> B["Token + checkout"] --> C["Setup GCP"] --> D["fullsend run"] --> E["Agents repo pre-script"] --> F["Code/Fix agent"]
  A -. "removed inline call" .-> G["scaffold pre-*.sh (deleted)"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Keep a minimal inline gate step
  • ➕ Preserves early-exit behavior (skip before GCP setup)
  • ➕ Defense-in-depth input sanity checks at workflow boundary
  • ➖ Reintroduces duplicated logic/ownership split between workflows and CLI pre-script
  • ➖ Risk of drift between inline gate and harness behavior (the problem this PR addresses)
2. Ship stub scaffold scripts that delegate to agents repo
  • ➕ Avoids breaking installations that reference scripts/pre-code.sh or scripts/pre-fix.sh
  • ➕ Provides a transition path with deprecation warnings
  • ➖ Still maintains extra surface area in the scaffold and embedding tests
  • ➖ Can mask misconfigurations by silently falling back, prolonging cleanup

Recommendation: The PR’s approach is the right convergence point given the new fullsend run pre-script output protocol: a single authoritative pre-script (agents repo) and no workflow-level skip gating. The main risk is rollout timing—ensure the merge gates described in the PR (released CLI + agents script writing skipped/reason) are satisfied to avoid a window where duplicate-PR gating disappears.

Files changed (5) +8 / -50

Refactor (1) +0 / -1
scaffold.goDrop executable mode tracking for removed pre-code script +0/-1

Drop executable mode tracking for removed pre-code script

• Removes 'scripts/pre-code.sh' from the 'executableFiles' set, keeping embed/file-mode synchronization consistent after deleting the scaffolded script copy.

internal/scaffold/scaffold.go

Other (4) +8 / -49
reusable-code.ymlRemove inline pre-code validation and pass comment body to harness +4/-14

Remove inline pre-code validation and pass comment body to harness

• Deletes the 'Validate inputs' step and the downstream 'steps.validate.outputs.skipped' conditionals. Adds 'COMMENT_BODY' to the Run step environment so the harness pre-script can honor '--force' overrides during the existing-PR check.

.github/workflows/reusable-code.yml

reusable-dispatch.ymlRemove inline pre-code/pre-fix validation in dispatch pipeline +4/-24

Remove inline pre-code/pre-fix validation in dispatch pipeline

• Removes the inline 'Validate inputs' steps for both the inlined code stage and fix stage, along with all skip-output gates tied to that step. Adds 'COMMENT_BODY' to the code agent Run step env so the in-harness pre-script can detect '--force'.

.github/workflows/reusable-dispatch.yml

reusable-fix.ymlRemove inline pre-fix validation step +0/-10

Remove inline pre-fix validation step

• Deletes the 'Validate inputs' step that previously ran 'scripts/pre-fix.sh' before the fix agent. The workflow now relies on the harness/agents pre-script for validation and iteration gating.

.github/workflows/reusable-fix.yml

MakefileStop running scaffold pre-code script test +0/-1

Stop running scaffold pre-code script test

• Removes 'internal/scaffold/fullsend-repo/scripts/pre-code-test.sh' from the 'script-test' target to match the deleted scaffold script copies.

Makefile

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:32 PM UTC · Completed 9:47 PM UTC
Commit: 6301ca4 · View workflow run →

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@qodo-code-review

qodo-code-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Context used
✅ Compliance rules (platform): 61 rules

Grey Divider


Remediation recommended

1. Docs cite removed pre-code ✓ Resolved 🐞 Bug ⚙ Maintainability
Description
Several docs/diagrams still present pre_script: scripts/pre-code.sh as the default harness
configuration and list it as a scaffold executable, but this PR deletes the scaffold pre-code.sh
copy and removes the workflow’s direct call, so users following the docs will reference a script
that is no longer provided by the scaffold/workflows.
Code

internal/scaffold/fullsend-repo/scripts/pre-code.sh[L1-12]

-#!/usr/bin/env bash
-# Pre-script: validate workflow_dispatch inputs before the agent runs.
-#
-# Prevents malformed or malicious event_payload from reaching the sandbox.
-# Runs on the GitHub Actions runner BEFORE sandbox creation.
-#
-# Required environment variables (set by the workflow):
-#   ISSUE_NUMBER       — must be a positive integer
-#   REPO_FULL_NAME     — must be owner/repo format
-#   GITHUB_ISSUE_URL   — must be a valid GitHub issue URL
-set -euo pipefail
-
Relevance

●●● Strong

Team historically fixes stale docs after removals/renames (accepted doc-sync fixes in PRs #2120,
#4654).

PR-#2120
PR-#4654
PR-#1039

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The scaffold’s pre-code.sh file is removed by this PR, but documentation still describes
scripts/pre-code.sh as the harness pre_script and even as part of the scaffold’s executable file
set; additionally, the code reusable workflow no longer directly invokes the script inline, so these
docs are now out of sync with the repo’s behavior/contents.

docs/guides/user/customizing-agents.md[7-53]
docs/architecture.md[639-662]
docs/guides/dev/cli-internals.md[609-626]
docs/ADRs/0032-safe-push-wrapper-for-sandboxed-agents.md[182-194]
internal/scaffold/scaffold.go[23-34]
.github/workflows/reusable-code.yml[149-166]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The scaffold copies of `scripts/pre-code.sh`/`scripts/pre-fix.sh` are deleted and the reusable workflows no longer run them inline, but multiple docs still describe `scripts/pre-code.sh` as a local/default harness `pre_script` and show it in the scaffold executable list. This is now misleading and can cause broken copy/paste harness configs or incorrect mental models.

## Issue Context
The codebase now supports the pre-script output protocol (via `FULLSEND_PRESCRIPT_OUTPUT`) and intends to make the agents-repo scripts the single source of truth. Documentation should reflect that (and should not imply the scaffold ships `scripts/pre-code.sh` anymore).

## Fix Focus Areas
- docs/guides/user/customizing-agents.md[7-55]
- docs/architecture.md[639-662]
- docs/guides/dev/cli-internals.md[609-628]
- docs/ADRs/0032-safe-push-wrapper-for-sandboxed-agents.md[182-194]

(Also do a repo-wide search for `pre-code.sh`/`pre-fix.sh` and update any remaining references that imply these scripts are scaffolded locally.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Qodo Logo

Comment thread internal/scaffold/fullsend-repo/scripts/pre-code.sh
@waynesun09
waynesun09 force-pushed the 4718-remove-inline-prescript-calls branch from 1a5a227 to 841a670 Compare July 29, 2026 21:46
@fullsend-ai-review

Copy link
Copy Markdown

/fs-review

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Site preview

Preview: https://3548bf17-site.fullsend-ai.workers.dev

Commit: fe88c040f2c8fd8aa3eed463f044d3726d326bd6

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Started 9:49 PM UTC · Ended 9:58 PM UTC
Commit: 841a670 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Jul 29, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:59 PM UTC · Completed 10:20 PM UTC
Commit: 0b5579c · View workflow run →

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review July 29, 2026 22:20

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Jul 29, 2026
The inline Validate inputs steps ran pre-code.sh/pre-fix.sh on the bare
runner while the harness pre_script ran the agents-repo copy inside
fullsend run — two executions per run from two independently maintained
copies (#4718, #5667). With the pre-script output protocol in fullsend
run, the CLI owns the skip decision, so:

- reusable-code.yml, reusable-fix.yml, and both inlined stages in
  reusable-dispatch.yml lose their Validate inputs steps and every
  steps.validate.outputs.skipped gate, converging toward the generic
  harness-run job shape (ADR 0061). That job does not yet carry the
  code/fix pre-script env contract, so the shapes are not yet
  interchangeable.
- COMMENT_BODY moves onto the Run code agent step env so the pre-script
  inside fullsend run can read it (env-quoted, never interpolated into
  run: blocks). Its --force override is not end-to-end yet: the route
  job's own Check for existing PRs step gates stage=code first and does
  not honor --force.
- The scaffold copies of pre-code.sh, pre-fix.sh, and pre-code-test.sh
  are deleted; fullsend-ai/agents becomes the single source (closes the
  #5667 scope). Companion scripts (install-precommit-tools.sh,
  resolve-precommit-tools.py) stay — the agents-repo pre-fix.sh resolves
  them via the workspace fallback.

Fix-side enforcement (input validation, the 10,000-byte HUMAN_INSTRUCTION
cap, and the bot-5/human-10 iteration caps) is exit-code-based in the
agents-repo pre-fix.sh, so it is version-independent and unaffected by
the protocol rollout. It does lose its fail-fast position: those checks
now run inside fullsend run, after GCP setup and token mint, rather than
before them.

BREAKING CHANGE: the scaffold embed no longer ships scripts/pre-code.sh
or scripts/pre-fix.sh. Installations referencing these paths directly
must use the fullsend-ai/agents copies via harness pre_script.

Assisted-by: Claude (fix, review), Grok (review)
Signed-off-by: Wayne Sun <gsun@redhat.com>
@waynesun09
waynesun09 force-pushed the 4718-remove-inline-prescript-calls branch from 0b5579c to fe88c04 Compare July 30, 2026 17:29
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 30, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 5:30 PM UTC · Completed 5:51 PM UTC
Commit: fe88c04 · View workflow run →

waynesun09 added a commit to fullsend-ai/agents that referenced this pull request Jul 30, 2026
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>
@waynesun09
waynesun09 added this pull request to the merge queue Jul 30, 2026
Merged via the queue into main with commit 831a9ec Jul 30, 2026
17 checks passed
@waynesun09
waynesun09 deleted the 4718-remove-inline-prescript-calls branch July 30, 2026 18:46
@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 30, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 6:49 PM UTC · Completed 7:07 PM UTC
Commit: fe88c04 · View workflow run →

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #5739 — Remove inline pre-script calls and scaffold script copies

Timeline

  1. 2026-07-14 09:58 — Triage agent classified issue #4718 (success).
  2. 2026-07-14 10:02 — Code agent (run 29323872387) completed 14 minutes of correct implementation, modifying .github/workflows/ files. Push was rejected: "refusing to allow a GitHub App to create or update workflow without workflows permission." The agent's work was preserved in artifact fullsend-code (323 KB) but no notification was posted to the issue.
  3. 15-day gap — No agent or human activity on the issue.
  4. 2026-07-29 21:04 — Human (waynesun09) manually created PR #5739 as a draft, reimplementing the code agent's work.
  5. 2026-07-29 21:06–21:22 — Review run docs: Add agent-compatible code problem document #1 (run 30490963585) on commit 6301ca4: found 2 High findings (behavioral regression if merged before PR feat(#4718): add pre-script output protocol to fullsend run #5737, unbounded fix iterations) and 3 Medium findings.
  6. 2026-07-29 21:28automatic_base_change_succeeded retargeted PR from predecessor branch to main, triggering simultaneous synchronize + ready_for_review events.
  7. 2026-07-29 21:32 — Review run Add problem areas: Tekton pipeline review, migration path, multi-tenancy #2 (run 30492648667) dispatched for same effective commit — redundant dispatch from simultaneous events. Eventually cancelled by a later force push.
  8. 2026-07-29 21:49 — Review run docs: Add codebase context problem document and trim CLAUDE.md #3 (run 30493694266) cancelled (stale-head).
  9. 2026-07-29 21:59 — Review run Use AI to help formalise intent after rapid local prototyping #4 (run 30494372752) on 0b5579c: found commit convention issue (fix vs ci prefix), iteration cap delegation, stale docs.
  10. 2026-07-30 17:30 — Review run docs: add agent infrastructure problem document #5 (run 30566190616) on fe88c04 (final): Medium findings persisted (behavioral regression, input validation removal, stale docs). Commit convention finding silently dropped despite PR title being unchanged.
  11. 2026-07-30 17:34 — Human (ifireball) approved — clean approval with no comments, accepting the known gaps documented in the PR body.
  12. 2026-07-30 18:46 — PR merged. Issue Remove redundant pre-code.sh / pre-fix.sh calls from reusable workflows #4718 remains OPEN — PR title uses fix(#4718)!: in conventional commit scope but lacks a Closes #4718 keyword.

Workflow Assessment

Review quality was strong. All findings across 5 review runs were valid and well-calibrated. Severity appropriately decreased from High to Medium as the PR evolved (dependency on #5737 was documented as a release gate). The review agent correctly identified removed security controls (input validation, iteration caps, instruction length caps) and stale documentation.

Main waste areas:

Evidence for Existing Issues

No Novel Proposals

All improvement opportunities identified in this retro are covered by existing open issues. The workflow performed well overall — the review agent produced valid, actionable findings, severity calibration was appropriate, and the human reviewer made an informed approval decision accepting documented known gaps.

maruiz93 pushed a commit to maruiz93/agents that referenced this pull request Jul 31, 2026
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 fullsend-ai#175.

Assisted-by: Claude
Signed-off-by: Wayne Sun <gsun@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ci CI pipelines and checks requires-manual-review Review requires human judgment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants