Skip to content

feat: audited trigger-label lift in the a2ui surface emitter (ADR-M3-1 amendment)#14

Merged
ryandmonk merged 2 commits into
mainfrom
feat/audited-label-lift
Jul 4, 2026
Merged

feat: audited trigger-label lift in the a2ui surface emitter (ADR-M3-1 amendment)#14
ryandmonk merged 2 commits into
mainfrom
feat/audited-label-lift

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

What

The dspack-emit leg of the ADR-M3-1 amendment (dspack#13): the a2ui target's documented projection now lifts a subButtonText label from the first direct text under the sub when no label-bearing component carries it — the 20 'liftable' runs from PR-15's corrected decomposition (trigger > button > badge{text}, the original 2026-07-03 signature shape).

The honesty line, drawn precisely

  • Lift = relocation of existing text, deterministic (document order), and audited: every lift emits a surface-label-lifted warning naming the source component, exactly like the flattening/synthesis casualties. Audit reports can count lifts.
  • Synthesis remains forbidden: a trigger with no text anywhere emits without triggerLabel and A3 refuses it byte-for-byte as before — locked by a dedicated test. The 117 no-text runs stay governance's job, matched exactly by the amended rule (textScope: subtree).
  • Precedence unchanged: a labeled label-bearing component always wins (the existing incidental-text test passes untouched — no lift warning fires on the happy path).

Acceptance

  • npx vitest run — 51/51 (2 new: lift-with-audit passes A1–A3 on both catalog versions; relocation-never-synthesis keeps A3 red)
  • check:sync note: the input/ contract copy moves to 2.2.0 when dspack#13 merges — I'll push that sync commit onto this branch after the merge so both land together (same PR, not a stack).

🤖 Generated with Claude Code

…1 amendment)

When no label-bearing component inside a subButtonText sub carries direct
text, lift the FIRST direct text under that sub (document order, the sub's
own text included) into the mapped prop — recorded as a
'surface-label-lifted' warning like every other documented casualty.

Lift, never synthesis: relocation of existing text only. A trigger with no
text anywhere still emits without triggerLabel and gate A3 refuses it,
byte-for-byte as before — the 117 no-text-anywhere runs from the PR-15
decomposition remain governance's job, now matched exactly by the amended
rule (textScope: subtree, dspack#13).

Existing precedence unchanged: a labeled label-bearing component always
wins; the incidental-text test still passes untouched. 51 tests green
(49 + 2: lift-with-audit + relocation-never-synthesis).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 4, 2026 04:52
Local editor config swept in by git add -A; not part of the change. The
file remains untracked on disk.

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

This PR updates the A2UI surface emitter’s compound flattening rules for subButtonText so that, when no label-bearing component provides the label, the emitter lifts the first available direct text within the relevant sub-tree into the expected label prop and audits that lift via a dedicated warning. It also adds tests to ensure the lift is relocation-only (never synthesis) and that instance validation behavior (A3) remains consistent.

Changes:

  • Extend applySubContent to lift the first direct text under each subButtonText sub-component when the target label prop is otherwise missing, and emit a surface-label-lifted warning.
  • Update emitter documentation comment to describe the audited lift rule and its “never synthesis” constraint.
  • Add vitest coverage for the new lift-with-audit behavior and for the “no text anywhere still fails A3” invariant.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/targets/a2ui/surface.ts Implements audited label lifting for missing subButtonText labels and documents the amended behavior.
src/surface-emit.test.ts Adds tests covering lift-with-audit success and “relocation, never synthesis” failure behavior.

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

@ryandmonk ryandmonk merged commit 8d4f54a into main Jul 4, 2026
1 check passed
ryandmonk added a commit that referenced this pull request Jul 4, 2026
The 2.2.0 sync commit (1c8df39) was pushed to feat/audited-label-lift after
PR #14 had already merged — it never reached main and was orphaned when the
branch was deleted per the hygiene rule. Re-landed here on the release
branch, where the current copies belong. Process note: verify a PR is still
OPEN before pushing follow-up commits to its branch.

json-render goldens regenerated (no diff — governance-side change).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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