diff --git a/.agents/routines/context-refresh-prompt.md b/.agents/routines/context-refresh-prompt.md index c06ac4ca2f..139af1264c 100644 --- a/.agents/routines/context-refresh-prompt.md +++ b/.agents/routines/context-refresh-prompt.md @@ -70,6 +70,13 @@ routine's context. - Link every entry (`#1234`, `PR adcp-client#456`) - Status values: `active`, `blocked`, `review`, `shipped`, `deferred` - Drop stale entries — staleness is a feature +- **Bullet labels must be factual nouns.** Not "**X gaps**", + "**X risks**", "**X concerns**", "**Tier-N X**", or + "**Stakeholder X**". Say what the work *is*, not how it's + framed. Example: "**Compliance storyboard remediation**", not + "**Compliance storyboard gaps**". The lint flags these, and + any gap/risk/concern/tier framing belongs in + `internal-context.md` instead. ## Open a PR diff --git a/.agents/routines/triage-prompt.md b/.agents/routines/triage-prompt.md index 83410a259b..57a17a8d5b 100644 --- a/.agents/routines/triage-prompt.md +++ b/.agents/routines/triage-prompt.md @@ -424,9 +424,35 @@ A single cohesive PR of 200 non-breaking lines is easier to review than three PRs of 60 lines with dependencies and cross-links. The bot's job is to reduce maintainer clicks, not multiply them. +## Pre-PR build + test gate — mandatory before expert review + +The expert review is expensive; don't run it on broken code. Before +spawning experts, make sure the diff actually compiles and the +unit tests pass. + +1. Run the repo's build + fast test tier: + - `npm run precommit` — prefer this (bundled build + typecheck + + unit tests); falls back to `npm run build && npm test` if not + defined + - If the diff touches only `docs/**` or `static/**`, skip build + and run the relevant doc check instead (e.g., `npm run + docs:check` or `mintlify broken-links`) +2. **If build or tests fail:** read the errors, fix the code, + re-run. Cap at **2 build→fix iterations.** If still failing, + abandon the PR and Flag for human review with the build log + in the comment. +3. Do **not** skip tests locally because "CI will run them." The + point of this gate is to not ship known-broken code even as a + draft, because (a) review noise, (b) a human reviewer may + admin-merge a draft that looks fine, (c) a green CI on push + is the baseline for the auto-fix loop — a red PR at push time + is indistinguishable from drift after the fact. +4. Only once build + tests pass on the final diff: proceed to + pre-PR expert review. + ## Pre-PR expert review — mandatory before `gh pr create` -After the branch is pushed but **before** opening the PR, run a +After build + tests are green but **before** opening the PR, run a second expert pass on the actual diff. The Step 4 synthesis reviewed the plan; this step reviews the code. They catch different things — protocol drift, broken tests, overlong files, diff --git a/.changeset/triage-build-test-gate.md b/.changeset/triage-build-test-gate.md new file mode 100644 index 0000000000..7ce30b081b --- /dev/null +++ b/.changeset/triage-build-test-gate.md @@ -0,0 +1,4 @@ +--- +--- + +Triage routine now runs a mandatory pre-PR build + test gate (npm run precommit or equivalent) before expert review, with 2 build→fix iterations. Also elevates bullet-label boundary framing ("**X gaps**") from CI warning to hard error in the current-context lint, and adds an explicit rule to the context-refresh prompt. diff --git a/server/tests/unit/rules-loader.test.ts b/server/tests/unit/rules-loader.test.ts index 8e7986cac3..e097d7435c 100644 --- a/server/tests/unit/rules-loader.test.ts +++ b/server/tests/unit/rules-loader.test.ts @@ -38,7 +38,6 @@ describe('Rules Loader', () => { expect(rules).toContain('## Partner Directory'); // Knowledge - expect(rules).toContain('## AdCP Agent Types'); expect(rules).toContain('## Prebid Expertise'); expect(rules).toContain('## Trusted Match Protocol (TMP)');