Repository navigation
Description
Problem
After child 14 the merge briefing is still the frozen preflight.sh. This child makes agentrepo merge preflight the implementation behind preflight.sh and behind the unattended agent-merge-pr entry point preflight.sh, which today re-runs the merge-pr script under DEVTOOLS_UNATTENDED. The frozen behavior stays reachable as the fallback for the N-2 window with no new logic; child 20 makes it unreachable and child 22 deletes it. Agents read this report as their picture of the pull request, so it cuts over on its own.
preflight.sh holds 164 code lines in packages/agents/source/skills/merge-pr/shared/scripts/ and its unattended counterpart 4. It runs the worktree readiness check (worktree-ready.sh), whose behavior is retained as it is; its port is owned by child 02 of the commit skill area (#322). No file on the owner-tier or constitutional lists of .agents/agent-skills.conf is edited here.
Part of #324, within #588. Child 27 in #324's Children list. Replaces the logic in preflight.sh and its agent-merge-pr counterpart.
Acceptance criteria
- AC1: Given a deployed
merge-prskill, whenpreflight.shruns, then it runsagentrepo merge preflightwith the same arguments and returns its exit status and streams, with no logic of its own. - AC2: Given the installed
agentrepolacks themergesubcommand, when the wrapper runs, then the frozen behavior ofpreflight.shruns with no new logic added to it, a deprecation warning names the release in which the fallback ends, and a consumer configuration that release N-2 accepted is still accepted. - AC3: Given the
agent-merge-prentry pointpreflight.sh, when it runs, then it runsagentrepo merge preflightin unattended mode and preserves the unattended behavior of the shell entry point. - AC4: Given
DEVTOOLS_UNATTENDEDor the deprecatedDT_UNATTENDEDset, when the wrapper runs, then the Go command honors them withDEVTOOLS_UNATTENDEDtaking precedence. - AC5: Given the complete regeneration sequence of
mise.toml(regen-generated, followed bycheck-generated-skills), when it runs, then both harness packages and both deployments contain the wrappers,tokens.jsonis re-measured, the deployments andapm.lock.yamlare current, and the check is clean afterwards. - AC6: Given parity fixtures recorded from the frozen script before its body changes, when the wrapper runs against the Go command, then the report sections, exit codes, streams and files written match.
- AC7: Given the release that ships the wrapper, when it is published, then its notes carry the consumer deprecation warning for the fallback, and the release that is the earliest end of the two-release window is recorded in the pull request.
- AC8: Non-functional: CI passes on macOS, Linux and Windows, the pull request stays within the size limits with only generated output under
packages/agents/claude/.apm/skills/,packages/agents/codex/.apm/skills/,.claude/skills/,.agents/skills/andtokens.jsonexcluded from the count, and no path matched byconstitutional_pathsorowner_pathsin.agents/agent-skills.confis changed.
Scope and non-goals
Scope: the preflight.sh wrappers, the frozen fallback of preflight.sh, the deprecation warning and the parity record.
Non-goal: the other merge-pr scripts (children 14 and 26). Non-goal: porting worktree-ready.sh (#322). Non-goal: deleting any frozen shell (children 20 and 22). Non-goal: new fallback logic.
Approach
Meet AC1 to AC8: record parity against the frozen script, replace the entry points, regenerate. Where the fallback behavior is kept is the implementer's choice, within AC2 and AC8.
Dependencies
Blocked by: #874, #333, #753, #1010 (and through #874, #866).
Prerequisites: #333 (binary distribution), #1010 (refusal of a missing or below-floor pinned agentrepo, which precedes the frozen fallback) and #753 (protection patterns for Go enforcement). Under #753 AC3, this pull request cites the merged commit of #753 as evidence that the protections are merged before the caller switches to Go enforcement, and keeps the golden-only classification #753 establishes.
Size
S. One pull request. Measured on origin/main with a physical-line code count: 168 code lines in the two scripts, 336 if counted twice, plus tests and documentation, under 800. Only generated output on the paths named in AC8 is excluded; the source copy always counts.
Verify plan
- AC1, AC3, AC4: wrapper tests with a stub
agentreporecording arguments, environment and exit status. - AC2: a Bats case with a binary stub lacking the subcommand, asserting the warning text and the unchanged fallback behavior.
- AC5:
mise run regen-generatedfollowed bymise run check-generated-skills, with the tokens, deployments and lock diff cited. - AC6: the recorded parity run over the report fixtures.
- AC7: the release notes text and the recorded window.
- AC8: the CI matrix run, the counted line total with the excluded paths listed, and the protected-path scan output on the pull request's file list.
- Definition of done: D1 each AC is verified at the merged head, with the commands and results cited in the pull request's Verification. D2 an independent review approves the exact merged head, and every finding has a recorded disposition. D3 required checks pass with no gate loosened. D4 the leak scans the repository specifies are clean, and every post made for this work passes the per-post leak review before it is posted. D5 every commit is signed. D6 the documentation matches the change or the Verification says why there is no impact. D7 every commit has an
Assisted-bytrailer and the pull request has theprovenance:agent-assistedlabel. D8 the pull request stays within the size limits. D9 follow-ups are filed as issues and listed under Related. D10 the merge closes the issue through a closing reference, the board shows Done, and the finalStatus:comment names the merge commit.
Risks
A changed report line could mislead an agent reading it; the parity run is the control. Undo: revert; the previous shell body returns and the Go command stays unused.
Operator authority
None. AC8 holds that no owner-tier or constitutional path is touched.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Work type
Projects
- StatusShow more project fieldsBacklog
Activity
tbhb-agent commentedon Oct 27, 2026
Refinement: READY — The preflight scripts become wrappers over agentrepo merge
Model: gpt-6-astra
Child 27 The preflight scripts become wrappers over agentrepo merge
Verdict: READY
Checked: Dependencies now explicitly name #753 and require merged-protection evidence before rollout. This covers the enforcement switch represented by
packages/agents/source/skills/merge-pr/shared/scripts/preflight.sh:95. Unattended forwarding remains consistent withpackages/agents/source/skills/agent-merge-pr/shared/scripts/preflight.sh:3, and readiness ownership remains unchanged atpackages/agents/source/skills/merge-pr/shared/scripts/preflight.sh:42.Gaps: None.
Split: None needed.
Definition of done
The definition of done for this issue (Feature). Tick each item and give its evidence.
check-leaks.shwith the repository's private-strings list, and the leak review of each post.docs/, CHANGELOG or help text), or the Verification section says "No doc impact" and why.provenance:agent-assistedlabel.Status:comment names the merge commit.mise run checkis green, and so are the coverage floorsmise run cover-go-checkandmise run cover-py-check, whichcheckdoesn't run.packages/agents/source/commits whatmise run generate-skills, thenmise run skill-tokens, thenapm installrewrite, in that order, andcheck-generated-skills(part oflint) passes.docs/agent-skills-migration.mdor the adoption docs, or the PR's Verification says "No consumer impact" and why.Round: 1 of 3