Repository navigation
ADR-B3 amendment 2: corpus v2 and a binding add and remove check - #100
Merged
Merged
Conversation
Tests only; they fail on main (eee21c1), whose corpus is v1 alone and whose add and remove check stands beside the pass. - applicability.test.ts: a static audit of every refinement template finds the three defects named for correction (records-table add: a ticket's values in tables without those columns; auth-form remove: provider buttons the form does not have; guide-steps structural: an accordion, timer and photo no component renders), and the same rules' other findings; corpus v2 applies everywhere but those; an unaudited template is refused; the scripted block arm still falls back on every add, remove and structural template. - corpus.test.ts: v1 keeps its file, pin and digest; v2 has its own version, freeze date, pin and digest; each version is held to its own pin; v2 differs from v1 only in its header and the amended templates; each version declares its scoring. - methodology.test.ts: under v2 a passing add or remove that missed its operation is a failure in every arm alike, in the pass rate and in tokens per success; a mixed change passes; an unchecked one fails closed; the readings bracket the verdict; v1's scoring is unchanged. The v1 report tests name corpus v1 explicitly. - run.test.ts: --corpus 1 or 2, default 2, anything else refused; each version is held to its own pin; a corpus is never run under the other version's flag. - dry-run.test.ts: the v1 mechanics run on v1 explicitly; a v2 dry run records v2 and scores the check binding in every arm; a v1 run is never resumed on v2. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
… remove check
Proposed, not adopted (docs/blocks/ADR-B3-AMENDMENT-2.md). Corpus v1, its
pin and its digest are unchanged; both smokes measured v1 and stay
systems evidence only.
- corpora/blocks.v2.json, frozen.v2.json: blocks-1b v2, frozen 2026-10-12,
its own pin and digest. Every v1 prompt, intent, label and checklist,
and every template that applies everywhere, is v1's. Three templates a
static audit found cannot apply everywhere are corrected:
- C1, records-table add: a row any table can take, not a ticket's values;
- C2, auth-form remove: the provider buttons, or the first field where a
form has none (never the password the block keeps);
- C3, guide-steps structural: cards, a badge and a comments field, which
every design system renders, in place of an accordion, a timer and a
photo, which none does.
- applicability.ts: the static audit, from the corpus text and each
reference's generation view alone, the same for every arm.
- corpus.ts, run.ts: versions side by side; a run measures v2 unless it
passes --corpus 1, and each version is held to its own pin.
- metrics.ts, report.ts, evaluate.ts: under v2 a passing add or remove
that missed its operation is a failure in every arm, in the pass rate
and in tokens per success; a mixed change passes and is read strictly
as a sensitivity row; the readings bracket the verdict with the
pipeline's pass alone. v1's scoring is unchanged.
- docs: the amendment record, BLOCKS.md, the harness README.
No threshold, budget, arm, condition, block contract, model prompt,
request golden or production path changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
Tests only; they fail on 84eddda. Outside the three corrections the owner named, the same two audit rules find four more templates that cannot apply everywhere; these tests ask v2 to have none left. - applicability.test.ts: v2 has no target or element issue at all. - corpus.test.ts: v2 also amends auth-form add (af-12 already offers Microsoft) and the records-table, auth-form and null structural templates (tabs, a checkbox, a progress indicator and a column layout, which Astryx, or neither design system, renders; and a split by ticket status in tables of other things). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
Outside the three corrections the owner named, and kept separable: dropping this commit and its tests leaves v2 with C1 to C3 only. - C4, auth-form add: Apple where the form already offers Microsoft (af-12, outside Stage 3), so a binding check never fails a correct no-op. - D1, records-table structural: two tables in cards and a search field and filter button, in place of tabs (absent from Astryx) split by a ticket's status (only rt-01 has one). - D2, auth-form structural: two cards with step badges and an "I agree" button, in place of a progress indicator and a checkbox (both absent from Astryx). - D3, null structural: two cards and link buttons, in place of a column layout (no component in either design system) and a sidebar. - frozen.v2.json: v2 re-pinned; the amendment record gives both digests. Each structural change stays one the blocks cannot express, so the block arm still falls back. Since an impossible request weighs most on the block arm's shorter fallback, these can only help it, if they change anything; they follow from the static audit alone, before any refinement result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
dspack-studio-composer | e129472 | Oct 12 2026, 09:50 PM |
Tests only; 5 fail on 529c96c. - methodology.test.ts: an add or remove the check never read, which the binding rule fails closed, is counted and named in the decision's bullet and the refinement table, and the report never says the check failed none when it failed every one (review minor 6). A summary scored otherwise than its corpus's own rule is refused, so a v2 run is never reported with v1's scoring (review minor 7). - metrics.test.ts: the operation counts carry the unchecked ones. - applicability.test.ts: v1's Open and Closed split fits the tables whose items open and close, bugs and incidents as well as tickets (review minor 9). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
…se a mis-scored summary - The report counts a passing add or remove that carries no operation record as unchecked: under binding it fails closed, and the counts, the by-block table and Changed now include it - renderReport refuses a summary scored otherwise than its corpus declares, so a v2 run is never reported with v1 scoring - The audit's split into Open and Closed fits tables of tickets, bugs and incidents (rt-01, rt-07, rt-21), and its header says each template's needs are recorded judgments - Text that described v1 scoring only now names both versions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
- v2 corrects every add and remove template (C1, C2, C4) and the guide-steps structural one (C3); its only remaining audit findings are v1's other structural templates - D1 to D3, if the owner adopts them, leave no finding and still send the scripted block arm to its fallback Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
…wner - v2 keeps v1's records-table, auth-form and null structural templates; D1 to D3 stay audited and are offered for the owner's decision, with their digest - v2 is re-pinned: sha256 0e4e4706...61ae9 (with D1 to D3 it would be 8212e223...38e0); v1 is unchanged - The amendment is decided whole before any refinement cell runs live, and merging it adopts it - The ADR states the soundness on net, where the remaining error runs, that M also binds tokens per success for the owner to confirm, C2's uneven detection, and the audit's judgment calls Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
- Summarizing without the corpus's scoring is refused: no default, in the summary or the readings - Under binding, the report defines unchecked as a failure in its scoring line, its bullet, its refinement note and its by-block note - Under corpus v1, the report never says every add and remove changed its lists while some were never read - Every test names the scoring it summarizes under Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
…, the ADR's claims narrowed - summarize and the readings take the corpus's scoring with no default, and scoreRecords refuses any other value - Under binding, the report says the missed and unchecked ones fail, in its scoring line, bullet, refinement note and by-block note; under v1 it no longer says every add and remove changed its lists when some went unread - The ADR's adoption clause covers every provider and says the amendment lapses if a refinement cell runs first - The ADR names both ways a wrong change can pass, including the block's compact path (af-05), and corrects the field-order evidence, the fresh prompts the element rule would flag, the trap C4 closes and the reason for a new baseline Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
- Corpus v1's decision is the one read on the records as they are, restored as an assertion - Under v1, the report says the check cannot confirm the adds and removes it never read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
- Under v1, the report says the check cannot confirm the adds and removes it never read - The ADR says an ignored instruction passes mostly, not only, on surfaces regenerated in full, since a compact refinement re-emits its whole call - The ADR says only the block's compact path has no compliant way to pass af-12 without C4, and that the scoring guarantee covers the summary and the report, not the lower-level helpers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi
ryandmonk
marked this pull request as ready for review
October 12, 2026 22:23
There was a problem hiding this comment.
🟢 Approval recommended
The implementation is coherent and well tested; the only finding is a non-blocking test-title grammar correction.
1 open finding
What changed in this PR
Introduces corpus v2 and binding add/remove operation scoring for ADR-B3 while preserving corpus v1 compatibility.
Changes:
- Adds separately pinned corpus v2 with corrected refinement templates.
- Applies binding operation scoring to pass rates and tokens per success.
- Adds CLI selection, reporting, static applicability checks, and comprehensive tests.
| File | Description |
|---|---|
packages/block-bench/live/types.ts |
Defines operation-scoring types. |
packages/block-bench/live/run.ts |
Adds version-aware corpus CLI handling. |
packages/block-bench/live/run.test.ts |
Tests corpus selection and pinning. |
packages/block-bench/live/report.ts |
Reports binding scoring and sensitivity. |
packages/block-bench/live/README.md |
Documents corpus selection. |
packages/block-bench/live/operation.ts |
Documents versioned scoring behavior. |
packages/block-bench/live/metrics.ts |
Implements binding scoring and unchecked counts. |
packages/block-bench/live/metrics.test.ts |
Updates metrics tests for explicit scoring. |
packages/block-bench/live/methodology.test.ts |
Tests binding methodology and reports. |
packages/block-bench/live/evaluate.ts |
Scores summaries according to their corpus. |
packages/block-bench/live/dry-run.test.ts |
Exercises v2 end-to-end. |
packages/block-bench/live/corpus.ts |
Supports versioned corpora and pins. |
packages/block-bench/live/corpus.test.ts |
Verifies v1 preservation and v2 integrity. |
packages/block-bench/live/corpora/frozen.v2.json |
Pins the v2 digest. |
packages/block-bench/live/corpora/blocks.v2.json |
Defines corpus v2. |
packages/block-bench/live/applicability.ts |
Implements static template applicability auditing. |
packages/block-bench/live/applicability.test.ts |
Tests applicability findings and corrections. |
docs/blocks/ADR-B3-AMENDMENT-2.md |
Records the amendment rationale and rules. |
docs/BLOCKS.md |
Documents versioned corpus behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| }; | ||
|
|
||
| describe("corpus v2's refinement templates", () => { | ||
| it("correct every add and remove template, so the binding check never fails a correct no-op, and the guide-steps structural one; the rest are v1's", () => { |
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.

Adopted by the owner on 2026-10-12, at this exact head (
e129472), before any refinement cell ran on any provider. It is a pre-data amendment of ADR-B3, made before Stage 3; the 160-cell pilot stays skipped. No paid or provider call was made. The full record isdocs/blocks/ADR-B3-AMENDMENT-2.md.The owner's decisions:
0e4e4706e19ec92565fea2019258cd5d83f6bef0eca424a0634ccf4749b61ae9. Merging makes it the corpus a run measures by default.What it adopts
M: the add and remove check becomes binding under corpus v2
refine-addorrefine-removethat the pipeline passed, but whose operation was missed, counts as a failure. Missed means no list changed, or lists changed only the other way (live/operation.ts).C1 to C4: the template corrections
Found by a static audit of the corpus text against each design system's generation view (
live/applicability.ts), the same for every arm:D1 to D3: offered, excluded by the owner
The same rules flag three more structural templates the owner did not name: records-table (tabs and an Open/Closed split), auth-form (a progress indicator and a checkbox) and null (a column layout and a sidebar).
Corpus v1 and v2 side by side
live/corpora/blocks.json,frozen.json180f4480284b720e22a279a1147d95c6ae1132ff1fdcc03d8cddb1235a5e4231live/corpora/blocks.v2.json,frozen.v2.json0e4e4706e19ec92565fea2019258cd5d83f6bef0eca424a0634ccf4749b61ae98212e223c8fa9a2ac4223286b55eecba60f0df3c2560fbedbae9f1ac022138e0--corpus 1. Each version is held to its own pin, and a v1 run is never resumed on v2.What does not change
DEFAULT_DECISION).git diff origin/mainis empty for these paths:apps/,packages/composer-core,packages/contracts;packages/block-bench/src,goldens,results.json,RESULTS.md;live/arms.ts,live/providers,live/pacing.ts,live/parity.ts;live/corpora/blocks.jsonandfrozen.json;live/operation.tschanges only its doc comment; it is identical to main with comments stripped.live/types.tsadds theOperationScoringtype.Evidence
Fail-first, one commit of tests before each implementation:
90de74aeee21c1: 26 fail, in 5 files84eddda8a7665b84eddda: 2 fail529c96cdf344c8529c96c: 5 failae2ab762cb9f0dae2ab76: 2 faild2dc8c8e01e2cfd2dc8c8: 4 fail6b0237496e21816b02374: 1 failse129472tscis clean. The rootpnpm typecheckis clean.hosted-build.test.ts(43) and the block ratchet (22) pass. The goldens use a fixed instruction, not the corpus.Stage-3 plan and cost on v2 (offline, no provider)
--corpus 2 --max-requests 825validates offline with the harness's own parser: 480 cells, v2 pinned, scoring binding.Independent review
An independent reviewer checked each head offline, in fresh exports, for four things:
529c96cd2dc8c86b02374e129472decideandarmStatsas helpers that read records as given. It should say "such as", sincecompareEncodingsandthreadSumsdo too.df344c8toe129472, fail-first wherever code changed.scoringfield and zerouncheckedcounts.🤖 Generated with Claude Code
https://claude.ai/code/session_01R6Ax8qvfN3gYUC85oSGnoi