Skip to content

feat: ADR-M3-1 amendment — textScope subtree, ∃-within, fixture rework, findings correction#25

Merged
ryandmonk merged 3 commits into
mainfrom
feat/v0.4-amendment
Jul 4, 2026
Merged

feat: ADR-M3-1 amendment — textScope subtree, ∃-within, fixture rework, findings correction#25
ryandmonk merged 3 commits into
mainfrom
feat/v0.4-amendment

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

What

The dspack-gen leg of the ADR-M3-1 amendment (dspack#13; emitter leg dspack-emit#14).

Changes

  • Evaluator (rules.ts): requiredText honors textScope: self|subtree; within is ∃-quantified — one satisfying descendant clears the scope, a finding lands at the scope node only when every matching descendant violates; the existence clause is unchanged. Compiler steering phrased accordingly ("At least one … inside each …").
  • Fixtures re-tell the story: the nested-label shape (old F6a — the 2026-07-03 signature) moves to the clean goldens: under the amended rule it lints clean, and its emission is the audited lift's test case in dspack-emit#14. F6b (no text anywhere — the irreducible 117-class) stays violating with the finding now AT the trigger. New ∃-within unit test pins mixed-siblings-clear / all-violate-fires-at-scope / existence-unchanged.
  • Findings correction, on the record: the merged decomposition's projectable-but-stricter: 73 counted trigger-own-text as projectable-today; the pre-amendment projection does not consume it. Corrected 67 / 20 / 117 — v2 script + output committed beside the originals; correction note added to the findings addendum; conclusions unchanged in direction.
  • Contract copy staged at 2.2.0 (bytes identical to dspack#13's head).

Merge order

dspack#13 first — until then this PR's check:sync step is red by design (the copy is ahead of dspack main). Not a stack; just sequencing, same as the Phase 1 pattern.

Acceptance

  • npx vitest run — 83/83 (goldens regenerated: context steering, fake-eval contract sha, F6b expected + repair)
  • check:sync — green after dspack#13 merges
  • Next: amendment-effect rerun (predicted: the 67+20 no longer violate the label rule; the 117 remain; e2e partially restores)

🤖 Generated with Claude Code

…k, findings correction

The dspack-gen leg of the amendment (dspack#13):

- evaluator: requiredText honors textScope self|subtree; within scoping is
  ∃-quantified (one satisfying descendant clears the scope; a finding at the
  scope only when all matching descendants violate). Steering updated.
- contract copy staged at 2.2.0 (bytes == dspack#13 head; check:sync goes
  green when it merges).
- fixtures: the nested-label shape (old F6a) MOVED to the clean goldens —
  under the amended rule it lints clean (its emission-with-lift is covered
  in dspack-emit#14); F6b (no text anywhere) stays violating, finding now at
  the trigger with the subtree message; repair golden retargeted to F6b;
  ∃-within unit test (mixed siblings clear; all-violate fires at scope;
  existence clause unchanged).
- findings CORRECTION note: the merged decomposition counted trigger-own-
  text as projectable-today; the pre-amendment projection does not consume
  it. Corrected: 67 projectable / 20 liftable / 117 unmappable — v2 script +
  output committed beside the original; conclusions unchanged in direction.

83 tests + build green. check:sync pends dspack#13's merge (noted in PR).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 4, 2026 04:57
…by a stale edit)

The prior commit message claimed the correction note; the edit had failed
silently against a stale read and only the evidence-dir v2 script/output
landed. This adds the note itself: corrected decomposition 67/20/117 with
links to the corrected script and output; conclusions unchanged in
direction.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates dspack-gen’s v0.4 governance evaluation and associated fixtures to match the ADR-M3-1 amendment: required-props now supports textScope: self|subtree and changes within evaluation to existential (“∃-within”), plus regenerates/retells goldens and adds corrected findings-evidence artifacts.

Changes:

  • Update required-props evaluation semantics: requiredText can scan self vs subtree, and within scopes now pass if at least one matching descendant satisfies.
  • Refresh fixtures/goldens and tests to reflect the amended trigger-label rule and the clean/violating fixture reshuffle.
  • Add corrected decomposition evidence artifacts (script + output) for the findings addendum.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/repair/render.test.ts Updates repair-message golden selection/assertions to use the amended F6b case and subtree wording.
src/core/lint/rules.ts Implements textScope and ∃-within behavior in evaluateRequiredProps.
src/core/lint/lint.test.ts Updates golden counts and adds unit coverage pinning ∃-within semantics; moves old F6a shape to clean.
src/core/contract.ts Extends RequiredPropsRule with textScope?: "self" | "subtree".
src/core/compiler.ts Updates steering phrasing for required-props, including subtree wording and ∃-within framing.
fixtures/shadcn.v0_4.dspack.json Bumps contract version and amends rule.trigger-carries-label to target alert-dialog-trigger with textScope: subtree.
fixtures/golden/violating/F6b-trigger-label-missing.expected.json Updates expected finding message/location/rationale to match the amended rule.
fixtures/golden/violating/F6a-trigger-label-nested.expected.json Removes the formerly-violating expected report (fixture now treated as clean under amendment).
fixtures/golden/repair/F6b.repair.txt Updates repair golden to point at the trigger node and use subtree wording.
fixtures/golden/eval/results.fake.json Updates embedded contract sha256 to match the amended contract artifact.
fixtures/golden/context/shadcn.destructive-action.json Updates embedded governance rule text to match amended trigger-label requirement.
fixtures/golden/clean/nested-trigger-label.dsurface.json Adds clean golden representing the nested-label shape that now passes.
docs/evidence/2026-07-04-v04-effect/decomposition-corrected.txt Adds corrected bucket counts for the findings correction record.
docs/evidence/2026-07-04-v04-effect/decompose-trigger-label-v2.py Adds v2 decomposition script supporting the corrected evidence.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/evidence/2026-07-04-v04-effect/decompose-trigger-label-v2.py Outdated
…pilot)

The v2 script was derived from v1 by patching the bucketing logic; the
module docstring still described v1's two buckets and named v1's filename
in the reproduce command. Now documents the three corrected buckets and the
right filename. Script output byte-unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryandmonk ryandmonk merged commit f651433 into main Jul 4, 2026
2 checks passed
@ryandmonk ryandmonk deleted the feat/v0.4-amendment branch July 4, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants