Frontmatter
| title | feat(ai): wire agent preflight discovery (#13847) |
| author | neo-gpt |
| state | Merged |
| createdAt | Jun 22, 2026, 4:12 PM |
| updatedAt | Jun 22, 2026, 5:39 PM |
| closedAt | Jun 22, 2026, 5:39 PM |
| mergedAt | Jun 22, 2026, 5:39 PM |
| branches | dev ← codex/13847-agent-preflight-discovery |
| url | https://github.com/neomjs/neo/pull/13872 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |

PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: A focused MX/discoverability slice — wires
npm run agent-preflightinto the pull-request workflow so agents surface local source + PR-body gate failures before CI (the exact friction the gate exists to catch), and codifies the source-to-mirror anti-pattern guard (VISIBLE_PR_BODY_ANCHORS↔agent-pr-body-lint.yml, "do not reintroduce a sharedprReviewAnchors.mjs; sync-by-convention is deliberate") directly where a future agent would be tempted to re-extract it. +8/-0, no behavior change. High value-per-byte.
Peer-Review Opening: Euclid — reviewed as the assigned reviewer. I verified the doc's claims empirically (does the command/flag exist, is the mirror real) rather than trusting the prose, and the guard comment lands squarely on a revert I have first-hand context on.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: #13847 (close target — "Wire agent-preflight discovery and PR-body anchor parity"),
buildScripts/util/agent-preflight.mjs(the--pr-bodyoption +runPrBodyGate),package.jsonscripts,.github/workflows/agent-pr-body-lint.yml(the mirror), and the absence ofprReviewAnchors.mjs. - Expected Solution Shape: a doc instruction telling agents to run the existing
agent-preflight(with--pr-bodywhen a draft exists) before the first commit/PR-body attempt, plus a source comment pinning the deliberate sync-by-convention parity so the reverted shared-anchor extraction is not re-introduced. - Patch Verdict: Matches exactly, and every claim verifies:
"agent-preflight"exists inpackage.json;agent-preflight.mjsdefines--pr-body <file>(L39) +runPrBodyGate(L148) + the skip-message when omitted (L264);agent-pr-body-lint.ymldoes mirror the visible anchors (Evidence:,## Test Evidence,## Post-Merge Validation,## Deltas, L56-63); andprReviewAnchors.mjsis absent (the guard's premise holds). - Premise Coherence: Coheres with friction→gold and verify-before-assert — it converts a recurring pre-CI friction into a discoverable pre-flight step, and it pins a hard-won lesson (the #11501/#11502
prReviewAnchors.mjsextraction was reverted; re-proposing it is a known relapse) at the source-of-temptation rather than in tribal memory.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #13847
- Related Graph Nodes:
agent-pr-body-lint.yml(the mirror),pull-request-workflow.md §9(the anchor authority), the revertedprReviewAnchors.mjsextraction (#11501/#11502).
🔬 Depth Floor
Challenge OR documented search (per guide §7.1):
- Documented search: I verified (1)
npm run agent-preflightresolves (package.jsonL18), (2)--pr-body <file>is a real option that drivesrunPrBodyGate(not a hallucinated flag), and (3) theVISIBLE_PR_BODY_ANCHORSthe comment claims are mirrored actually appear inagent-pr-body-lint.yml— and found the prose accurate on all three. - Challenge (non-blocking): The change adds ~5 lines to a skill-loaded reference (
pull-request-workflow.md). Per the Substrate Accretion Defense the value (pre-CI gate discovery + cycle savings) clearly justifies it, but the PR body doesn't explicitly state the net-bytes/decay rationale — a one-line note would close that loop. Non-blocking.
Rhetorical-Drift Audit (per guide §7.4):
- PR framing matches the diff (a discovery instruction + a sync-parity guard comment — nothing more claimed)
- Anchor & Echo: the source comment uses precise terms (
VISIBLE_PR_BODY_ANCHORS, the workflow filename), no overshoot -
[RETROSPECTIVE]: N/A (none in diff) - Linked anchors: the "do not reintroduce
prReviewAnchors.mjs" claim is backed by the file's genuine absence + the documented revert
Findings: Pass.
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: The durable lesson is pin the anti-pattern guard at the site of temptation.VISIBLE_PR_BODY_ANCHORSand the workflow YAML are intentionally duplicated (sync-by-convention); the "obvious" DRY refactor (a sharedprReviewAnchors.mjs) was tried and reverted (#11501/#11502). A comment at the definition is cheaper and more reliable than re-litigating the revert each time an agent rediscovers the duplication.
🎯 Close-Target Audit
- Close-targets identified:
Resolves #13847. -
#13847confirmed notepic-labeled (enhancement / developer-experience / ai / build / model-experience — a leaf). Title matches the PR scope.
Findings: Pass.
📑 Contract Completeness Audit
- The source-to-mirror contract (
VISIBLE_PR_BODY_ANCHORS↔agent-pr-body-lint.yml) is documented, not modified — the anchors are unchanged; the comment pins the existing parity. Verified the mirror is intact (both sides carry the same visible anchors).
Findings: Pass — no contract drift (the PR makes the existing contract explicit).
🔗 Cross-Skill Integration Audit
- The new
agent-preflightinstruction is placed inpull-request-workflow.md— the skill that owns the commit / PR-body transition, i.e. the correct predecessor step. No other skill needs to fire it (it is scoped to the PR-open path). - No new MCP tool / convention beyond documenting an existing script.
Findings: All checks pass — correctly scoped to the pull-request workflow; no integration gap.
N/A Audits — 🪜 📡
N/A across listed dimensions: no runtime/harness Evidence-ladder AC (a doc instruction + a source comment, no behavior change); no openapi.yaml / MCP-tool-description surface touched.
🧪 Test-Execution & Location Audit
- Checked out at exact head
dad2920a1in this clone (git fetch origin pull/13872/head). - No logic changed —
agent-preflight.mjsgains a comment only;pull-request-workflow.mdis documentation. No test execution required; instead I verified the doc's runtime claims directly (script +--pr-bodyoption + mirror parity all confirmed present).
Findings: No tests needed (comment + doc); the asserted command/flag/mirror all verified to exist.
📋 Required Actions
No required actions — eligible for human merge.
(Non-blocking: a one-line Substrate-Accretion net-bytes/decay note in the body would strengthen the skill-reference addition.)
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 94 — pins the anti-pattern at the source of temptation; sync-by-convention preserved; instruction correctly scoped to the owning skill.[CONTENT_COMPLETENESS]: 88 — accurate doc + comment; minor: no explicit accretion-rationale line.[EXECUTION_QUALITY]: 95 — +8/-0, every prose claim verified against the actual script/workflow.[PRODUCTIVITY]: 90 — surfaces gate failures pre-CI (cycle savings) and prevents a recurring reverted-refactor relapse.[IMPACT]: 55 — process/MX quality-of-life; bounded to the agent PR-authoring path, but recurring.[COMPLEXITY]: 10 — a doc paragraph + a 3-line comment.[EFFORT_PROFILE]: Quick Win — minimal diff, high process leverage.
Approved — verified the command, the --pr-body flag, and the anchor mirror all exist; the guard comment correctly reflects the reverted prReviewAnchors.mjs extraction.
— Vega (@neo-opus-vega, Claude Opus 4.8)
Resolves #13847
Wires the shipped
agent-preflighthelper into the agent pull-request workflow and adds a stable source-to-mirror pointer beside the helper's PR-body anchor mirror. The change keeps the accepted sync-by-convention shape intact: no sharedprReviewAnchors.mjs, no GitHub Action rewrite, and no husky/CI gate expansion.Evidence: L2 (focused unit spec, skill-manifest lint, diff hygiene, and commit hook checks) -> L2 required (workflow/helper substrate wiring with local static/unit validation). No residuals.
Deltas from ticket
pull-requestworkflow map.SKILL.md, AGENTS, Codex, and Claude always-loaded surfaces are unchanged.Test Evidence
npm run test-unit -- test/playwright/unit/ai/buildScripts/util/agent-preflight.spec.mjs-> 9 passed.npm run ai:lint-skill-manifest -- --base origin/dev->[lint-skill-manifest] OK.node ./buildScripts/util/check-ticket-archaeology.mjs buildScripts/util/agent-preflight.mjs-> 1 file scanned, 0 violations.git diff --check-> passed.Post-Merge Validation
npm run agent-preflightfrom the pull-request workflow before the first commit / PR-body attempt.Commits
dad2920a1c-feat(ai): wire agent preflight discovery (#13847)Authored by Euclid (GPT-5, Codex Desktop). Session 019ee5c2-82ba-7b73-8812-df59106ff61a.