Repository navigation
chore(commands): lower the command byte ceilings to the measured sizes after #472 - #514
Merged
Merged
Conversation
34 of 39 tasks
dean0x
added a commit
that referenced
this pull request
Oct 15, 2026
Merge origin/main (04f0a26, #514) into feat/474-code-review-lens-sets-per-level. #514 lowers the command byte ceilings of the other commands in numeric-floors.json and tests/guards/command-size.test.ts. Those rows take main's values. The code-review command ceilings keep this branch's values (34,981 learning-on, 32,236 learning-off) because #514 did not change them.
dean0x
added a commit
that referenced
this pull request
Oct 15, 2026
## Summary The /code-review command runs 11 to 20 lenses on every code diff, at every gate level. #472 added GATE_LEVEL. No command reads it yet. Epic #468 defined the lens sets for each level. This PR makes /code-review apply those sets. ## Changes - Add the reference file `code-review-levels.md`. It has a table of lens classes by gate level. Each cell is a `keep:` list or a `drop:` list. Both kinds of list only remove lenses. - Dependencies rule: at `standard`, a `code` diff keeps the Dependencies focus only when a listed manifest changes. A `code` diff that changes a lockfile and no manifest drops it at `standard`. This is a founder decision, by design. At `lean`, a `code` diff never keeps the Dependencies focus. A `lockfile-only` diff keeps Dependencies at every level. A lockfile alone is not a manifest change. The manifest list is in `code-review-levels.md`. It has 22 names, and it includes `go.work`, `*.csproj`, `Directory.*.props`, `Package.swift`, `Podfile`, `pubspec.yaml`, `build.sbt`, `mix.exs`, `deno.json` and `build.gradle*`. - Add Step 1.2b. It runs once for each worktree and narrows REVIEW_FOCUS_LIST. It reads the reference only at the standard or lean level, through the sanctioned resolution line. It applies the row of each class and takes the union of the results. If the reference cannot be read, or a row is malformed, the step keeps the full sets and prints a message. - Security runs at every level and in every class. The compliance trigger does not change at any level. The command keeps it as one gated line. - Synthesize receives GATE_LEVEL and FOCUSES. The review summary has a `**Gate level**:` line. A planned focus with no report is marked `(no report)`. The row for a missing security report applies in every review, not only when the planned focus list names security. A review with no security report never gets APPROVED. The Merge Rules now state that the first matching row applies. The row for a missing security report comes before both APPROVED rows. - Update the `devflow gates` help text, the README, the CLI reference, the commands doc and the CHANGELOG. - Condense the command text. Both code-review builds and the review reference are smaller. Lower these ceilings: code-review from 35,246 to 34,981; learning-off from 32,499 to 32,236; synthesize review reference from 3,940 to 3,805. Add a ceiling of 1,349 for the new level reference. No ceiling is raised. These sizes are measured on the branch after it merged main 04f0a26 (#514). The code-review build is 34,974 bytes, and the learning-off build is 32,229 bytes. Each has 7 bytes of slack under its ceiling. The code-review ceilings did not change after the merge. - Cost: a standard or lean run reads the reference one time. After the command text cut, the net context cost is about 1.6 KB. A full run reads nothing. ## Breaking Changes There is no API change. These behavior changes apply: - After `devflow init`, the default `standard` level drops the TypeScript focus. It also drops the Dependencies focus on a `code` diff that changes no listed manifest, even when that diff changes a lockfile. - The `lean` level runs the security, testing and reliability focuses. It also runs compliance on its trigger. A lean tests-only diff drops the consistency focus. - `devflow gates --set full` keeps the current focus set. - Until `devflow init` runs, the installed command keeps the current focus set. - This is the no-floor interim. A personal `lean` level narrows the review, even where compliance is declared. The compliance focus still runs on its trigger. See #488 for the compliance floor. ## Reviewer Focus Areas 1. Check the fail-closed wording. It covers every worktree and a malformed row. Check that it sits outside the learning arms. 2. Check the `keep:` and `drop:` rules and the manifest list in the reference. Check that compliance appears only as a lens name. 3. Check the guard changes in `command-reference-move` and `claude-dir`. The sanctioned resolution line is an accepted read root. Exactly one directory read is allowed. 4. Check the byte cuts, the lowered ceilings and the new reference ceiling. Only the Step 1.1 tail carried behavior. This PR does not restore that tail as text. The class limit is now in the compliance sentence, "on a `code` diff, add `compliance`", and a guard checks that sentence. Confirm that no other cut text carried behavior. The complete cut list follows. - `code-review.mds`, Principles: "Clear ownership" and "Auto-discover worktrees". - `code-review.mds`, Step 0a item 3: "(the common case)". Step 0b: "of that worktree". Step 0c: "(parallel)". Step 0e-i item 5: "(valuable for Review agent cross-cycle awareness)". - `code-review.mds`, Phase 2: "(max 20 total per worktree)" on the agent-count line. The agent-overload reason on the multi-worktree line is replaced by "so Review spawns never pile up". - `code-review.mds`, Step 1.1: the `--no-renames` reason, which the Edge Cases "moved across classes" row restates, and the tail "they add no focus, and Step 1.2 applies to the `code` class only". - `code-review.mds`, compliance sentence: "to REVIEW_FOCUS_LIST for this worktree". - `code-review.mds`, Step 3a: "(wait for completion before 3b)". Phase 4: "In multi-worktree mode, report results per worktree." - `code-review.mds`, Edge Cases: the "Concurrent sessions" row. The Docs-only, Tests-only and Lockfile-only rows now read "Its Step 1.1 set, narrowed by level". Also cut: "(docs with tests, tests with a lockfile)", "(fail-safe): the 8 core focuses on the full diff", "The count is printed;", "of about 40 lines" and "the old and the new path". - `code-review.mds`, Architecture: "if FP ratio > 70%" on the Step 0e-ii line (the threshold stays in Step 0e-ii); the eight focus names on the Phase 2 `code` line; the line that lists consistency, regression, testing and reliability; "D7 marker-dedup" and "REVIEW_PUBLICATION" on the Step 3b line. - `code-review.mds`, Backwards Compatibility: the "Single worktree" bullet. The "Legacy flat layout" bullet is replaced by a "Gate level" bullet. - `synthesize/review.md`: the intro line "Synthesize outputs from multiple Review agents. Apply strict merge rules."; "for cross-referencing recurring vs new issues,"; the sentence on agreement between agents for a compliance and security overlap, which ends "is not corroboration"; "Every bucket is reported for resolution; the bucket decides only whether an issue blocks the merge"; "using Write tool"; "3. Confirm file written in final message"; "Brief descriptions only." - Resolve round 1 also cut "applied" and "planned" from the GATE_LEVEL and FOCUSES input wording in `synthesize/review.md`. Neither word is in the final diff. - Resolve round 1 also cut these words from `code-review-levels.md`: "full-level set" to "full set"; "the named focuses the set holds" to "the named focuses"; "removes the named focuses" to "removes them"; the file-name sentence to "A path matches by file name."; and "This file never adds it" from the compliance rule. 5. Check that the simulator reads its rules from the reference. Check that the no-second-cycle collector is independent. 6. Check the Step 1.2b heading. The diff-gating guard must stay green. A reduced-class run must reach the narrowing. 7. Two QA guard gaps are fixed in resolve round 1. The Requires line of Step 1.2b now lists CHANGED_PATHS. The guard in `tests/guards/code-review-levels.test.ts` now checks that the missing-security row comes after the BLOCK MERGE row. ## Testing - The targeted suites pass at the head. These are the levels guard, the diff-gating guard (no edit), reference-move, claude-dir, command-size, agent-references, numeric floors, install snapshot, language stamp, compliance prompts and injection, convergence, synthesize, the gates CLI, ambient, disposition and build-mds. - The local full suite ran under the machine lock. Its only failures were load timeouts in files that this PR does not touch. Each of those tests passes when it runs alone. CI gives the full-suite result. ## Related Issues Closes #474 Part of epic #468. Builds on #472. Related: #473 (same guard lines and goldens), #475 (Validate lint pack), #480 (later level reader), #488 (compliance floor). Follow-up (founder decision, not this PR): #515 — the counts-only STUB review comment does not show the gate level. #473 rebases after this PR merges. It then re-runs `npm run test:golden:update -- install-snapshot`, and updates the text that names #473 as a later reader of the level: src/cli/commands/gates.ts, README.md, docs/cli-reference.md and CHANGELOG.md. <!-- devflow:test-plan --> ## Test Plan - [x] TP-1 (AC-1) At level full every class and mixed combination gets exactly the full-level set and the reference is not read — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/commands/code-review.mds] - [x] TP-2 (AC-1) The existing diff-gating guard passes with no edit on both compiled builds — method:ci [files: tests/guards/code-review-diff-gating.test.ts] - [x] TP-3 (AC-1) The Step 1.1 reduced-set lines and the Step 1.2 trigger rows equal the independent copies of today's text — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-4 (AC-2) Standard code diffs never hold typescript and keep dependencies only when a listed manifest changed, so a lockfile with code drops it — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/skills/agent-references/references/commands/code-review-levels.md] - [x] TP-5 (AC-2) Known-bad probes: a standard code cell without typescript or without dependencies in its drop list is reported — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-6 (AC-3) Lean code diffs hold only security, testing and reliability, plus compliance only when its trigger fired — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/skills/agent-references/references/commands/code-review-levels.md] - [x] TP-7 (AC-4) Each reduced class matches the per-level table and lean tests-only is testing, reliability and security — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-8 (AC-4) Known-bad probe: consistency added to the lean tests-only cell is reported — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-9 (AC-5) Mixed non-code diffs run the union of the per-class sets with no cap, from the mixed rule read from the reference: five lenses for docs plus tests at lean, six for all three — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-10 (AC-6) Compliance joins only code diffs under the full-level trigger at every level and never a reduced class — method:ci [files: tests/guards/code-review-levels.test.ts, tests/compliance-prompts.test.ts, tests/guards/compliance-injection.test.ts] - [x] TP-11 (AC-6) The reference holds no compliance trigger, framework list, directive or spawn block, and a seeded one is reported — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/skills/agent-references/references/commands/code-review-levels.md] - [x] TP-12 (AC-7) Security is in every set across the exported gate levels, every class and every mixed combination — method:ci [files: tests/guards/code-review-levels.test.ts, src/core/gate-level.ts] - [x] TP-13 (AC-7) Known-bad probes: a lean cell without security and a command without the security sentence are each reported — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-14 (AC-8) Every level set is a subset of the full-level set and a cell name outside the class set is reported — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-15 (AC-8) Both compiled builds carry the sanctioned resolution line, the Read tool phrase, the union rule, the every-worktree fallback sentence and its message, outside learning arms — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/commands/code-review.mds] - [x] TP-16 (AC-8) Known-bad probes: a pointer without the fallback sentence, or with a root form other than the sanctioned resolution line, is reported — method:ci [files: tests/guards/code-review-levels.test.ts] - [ ] TP-17 (AC-8) Manual run at standard with the installed level reference renamed prints the fallback message and spawns the full set — method:manual [files: src/assets/commands/code-review.mds] - [x] TP-18 (AC-9) Step 0b Produces, Phase 1 Requires and Step 1.2 Requires list GATE_LEVEL and the level block ends Step 1.2 before Step 1.3 — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/commands/code-review.mds] - [x] TP-19 (AC-9) The Edge Cases table says the full flag sets the diff range and never the gate level — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-20 (AC-10) Step 0e-ii only warns and continues, both continue lines exist, and nothing restarts a phase or a cycle — method:ci [files: tests/guards/code-review-levels.test.ts, tests/review/convergence-detection.test.ts] - [x] TP-21 (AC-10) Known-bad probes: continue changed to stop, a second-cycle sentence seeded into the reference, and a seeded resolve command start are each reported — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-22 (AC-11) The Synthesize spawn passes GATE_LEVEL and FOCUSES and the summary template has a line that starts with the gate level prefix — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/skills/agent-references/references/synthesize/review.md, tests/commands/synthesize-base-dir.test.ts] - [x] TP-23 (AC-11) The template marks a planned focus with no report, and a missing security report cannot give APPROVED — method:ci [files: tests/guards/code-review-levels.test.ts, src/assets/skills/agent-references/references/synthesize/review.md] - [ ] TP-24 (AC-11) Manual lean review of a sample branch shows the gate level line and three or four focuses in the summary — method:manual [files: src/assets/commands/code-review.mds] - [x] TP-25 (AC-12) After a fresh build both code-review builds and the review mode reference fit their lowered ceilings — method:ci [files: tests/guards/command-size.test.ts, tests/guards/agent-references.test.ts, tests/fixtures/numeric-floors.json, tests/guards/numeric-floor-manifest.test.ts] - [ ] TP-26 (AC-12) Full suite passes under the shared heavy-tests lock after a fresh build — method:local [files: tests/**] - [x] TP-27 (AC-13) The reference-move guard lists the new reference and the code-review host, and accepts the sanctioned resolution line as the read root — method:ci [files: tests/guards/command-reference-move.test.ts] - [x] TP-28 (AC-13) The Claude-directory guard finds exactly one sanctioned resolution line and exactly one skills path, the level reference, in each code-review build — method:ci [files: tests/guards/claude-dir.test.ts] - [x] TP-29 (AC-13) The three install goldens list the new reference file and the install snapshot test passes — method:ci [files: tests/fixtures/golden/install-snapshot-*.txt, tests/install-snapshot.test.ts] - [x] TP-30 (AC-14) The stamp line stays single, the level block restates no language list, and the language-stamp tests pass with no edit — method:ci [files: tests/installer/language-stamp.test.ts, tests/installer/language-stamp-e2e.test.ts, tests/guards/code-review-levels.test.ts] - [x] TP-31 (AC-15) The gates help text says code-review reads the level and no longer lists issue 474 as pending — method:ci [files: tests/gates-cli.test.ts, src/cli/commands/gates.ts] - [x] TP-32 (AC-15) README, CLI reference, commands doc and CHANGELOG describe the level sets, the manifest rule, the default standard effect and the set full upgrade step — method:manual [files: README.md, docs/cli-reference.md, docs/commands.md, CHANGELOG.md] - [x] TP-33 (AC-16) PR body states the no-floor interim with a pointer to issue 488 — method:manual [files: CHANGELOG.md] - [ ] TP-34 (AC-2) Manual standard review of a code diff that changes package.json spawns the dependencies focus — method:manual [files: src/assets/commands/code-review.mds] - [ ] TP-35 (AC-5) Manual lean review of a docs plus tests diff spawns five focuses — method:manual [files: src/assets/commands/code-review.mds] - [x] TP-36 (AC-2) Known-bad probes: the manifest exception removed from the standard code cell, or Gemfile removed from the reference manifest list, is reported — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-37 (AC-5) Known-bad probe: a reference mixed rule that applies each row in turn to one list is reported through the simulator — method:ci [files: tests/guards/code-review-levels.test.ts] - [x] TP-38 (AC-13) Known-bad probes: a second sanctioned line in the stamp paragraph, a language skill Read, and the read moved out of the gate level block are each reported — method:ci [files: tests/guards/claude-dir.test.ts] - [x] TP-39 (AC-12) The level reference fits its measured ceiling and a probe one byte under its size is reported — method:ci [files: tests/guards/agent-references.test.ts, tests/fixtures/numeric-floors.json, src/assets/skills/agent-references/references/commands/code-review-levels.md] <!-- /devflow:test-plan -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #508 cut 76 bytes from each command that carries the settings line. It did not change the command byte ceilings. This PR lowers the ceilings to the measured sizes on main (8875e09). The slack is now 0 for each changed row.
Only ceiling values change, in
tests/guards/command-size.test.tsandtests/fixtures/numeric-floors.json. Thedescriptionof each changed fixture row now states the new measured size. No prompt text changes.Ceilings
Sizes are in bytes.
Not changed here
code-review(on and off): open PR feat(code-review): pick the focus set by gate level #512 changes this command and its ceilings.dynamic-build(on and off): open PR fix: resolve seven HIGH re-review findings (#486) #505 changes this command and its ceilings.Those PRs set their own ceilings. Open PR #513 changes no command and no ceiling.
Evidence
npm run buildon a clean tree: exit 0, 33 compiled, 0 errors, 0 warnings.npx vitest run tests/guards/command-size.test.ts tests/guards/numeric-floor-manifest.test.ts: 2 files, 16 tests pass.npx tsc --noEmit: exit 0.Breaking Changes
None. The change is in test constants only.