Repository navigation
Realize S2 of add-wallet-carried-review-authority: the wallet issuer anchor (012) - #299
Conversation
Feature 012-wallet-issuer-anchor. First enforcement of grant issued_by, scoped to the review-authority class: REVIEW_ACT_TOKEN constant decides class from scope.acts content alone; missing issuer on a review-class grant fails issuer-unrecorded; a ROOT review-class grant names no issuer but Brett Heap (exact match, citing the Human Escalation Contract at docs/roles-and-authority.md:103-140) or fails root-issuer-unanchored with machine-named / legacy / generic detail wording. Legacy opensoft values do not grandfather. Three negative specimens join the packaged corpus under OXWR-R1/R2; REQUIREMENTS coverage closes 11/11 -> 13/13 (33 -> 36 negatives); self-test boundary guard proves non-review grants validate clean without issued_by. No schema edit, manifest entry, CHANGELOG line, or bundle cut (ratified tasks 3.1 scope). Gates: sweep exit 0 both trees; pytest wallet_yaml_syntax_gate 4 passed; openspec validate --all --strict 73 passed.
…thorized issuer widening Round 2 on 012-wallet-issuer-anchor. QA's BLOCKER fixed: a schema-invalid non-string issued_by reached 'in ctx.wallets' unhashable and crashed the run exit-2; guarded to report findings like every other malformed input. Reviewer MAJOR addressed: SC-002 corrected to actual counts. QA's six surviving mutants killed by an anchor-assertion block in self_test: anchored-root positive, whitespace/case drift refused without normalization, machine and legacy refusal wordings pinned, synthetic parent+child pair proving root-only scoping, named-probe presence + mandatory detail pins for the three S2 fixtures. Material discovery those assertions surfaced: the grant identifier grammar could carry NO operator identity - no spaces (Brett Heap) and no @ (even an email). Convener re-ruled 2026-08-24 twice: anchor token is [email protected], and a surgical schema widening is authorized - issued_by moves to a new issuer_identifier def (identifier grammar plus @); every other identifier field keeps the strict machine-id grammar. Landed per Contract Versioning Policy: manifest sha256 refreshed, CHANGELOG Unreleased additive bullet, bundle cut still deferred. Gates: sweep exit 0 (17/36 across 13/13); blocker regression probe exits 1 with named findings; pytest wallet_yaml_syntax_gate 4 passed; openspec validate --all --strict 73 passed.
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
Pull request overview
This PR realizes S2 by enforcing issuer recording and anchored root issuers for review-authority wallet grants.
Changes:
- Adds validator rules, self-tests, and three negative fixtures.
- Widens only the
issued_byschema grammar for the email anchor. - Updates contract metadata and supporting specification artifacts.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Summary | Final review findings |
|---|---|---|
specs/012-wallet-issuer-anchor/tasks.md |
Task tracking | Nit (4 votes): Update the superseded schema-change prohibition to reflect the authorized changes. |
specs/012-wallet-issuer-anchor/spec.md |
Requirements and scenarios | Moderate (3 votes): Use a schema-valid case-drift issuer such as [email protected]. |
specs/012-wallet-issuer-anchor/research.md |
Validator and corpus research | No final comments. |
specs/012-wallet-issuer-anchor/quickstart.md |
Validation guidance | No final comments. |
specs/012-wallet-issuer-anchor/plan.md |
Implementation plan | Nit (4 votes): Update stale Round 1 anchor and schema/metadata decisions, including line 20. |
specs/012-wallet-issuer-anchor/implementation-notes.md |
Implementation evidence | Nits (3, 4 votes): Correct the corpus grounding fact and update the current anchor to [email protected]. |
specs/012-wallet-issuer-anchor/data-model.md |
Rule and data-model definitions | No final comments. |
specs/012-wallet-issuer-anchor/clarify-questions.md |
Clarification history | No final comments. |
specs/012-wallet-issuer-anchor/checklists/requirements.md |
Requirements checklist | No final comments. |
scripts/validate-openxwallet.py |
Issuer enforcement and self-tests | Moderates (4, 2 votes): Make the child assertion review-class, and pin the literal anchor rather than deriving both expected and actual values from the constant. Nit (3 votes): Correct the contradictory root-grant docstring. |
contracts/openxwallet/openxwallet-grant.schema.yaml |
Issuer identifier schema widening | No final comments. |
contracts/openxwallet/examples/negative/grant-review-root-issuer-says-opensoft.yaml |
Legacy issuer fixture | No final comments. |
contracts/openxwallet/examples/negative/grant-review-root-issuer-is-a-machine.yaml |
Machine issuer fixture | No final comments. |
contracts/openxwallet/examples/negative/grant-review-authority-omits-issued-by.yaml |
Missing issuer fixture | No final comments. |
contracts/manifest.yaml |
Schema digest refresh | No final comments. |
contracts/CHANGELOG.md |
Unreleased contract change entry | No final comments. |
Suppressed comments (7)
contracts/openxwallet/examples/negative/grant-review-root-issuer-is-a-machine.yaml:7
- Pinning only
sub-8f2c41d60a974d3bdoes not prove the MACHINE branch: every branch interpolates the issuer value intowhy, so the generic branch would contain the same token. Pin a branch-only substring such asMACHINE-named issuer(matching the synthetic self-test) so this packaged probe cannot pass after machine classification is removed.
# expected_failure_detail: sub-8f2c41d60a974d3b
contracts/openxwallet/openxwallet-grant.schema.yaml:98
- This contract change is not yet reflected in the authoritative governing OpenSpec record:
openspec/changes/add-wallet-carried-review-authority/design.md:256-263andtasks.md:101-104still require no contracts edit, no manifest entry, and no CHANGELOG line. The feature artifacts describe a convener re-ruling, but leaving the ratified record unchanged makes the repository's governance say this implementation is out of scope. Record the override in that governing change (or keep S2 schema-free) before merging.
issued_by:
# The issuer identity. Review-authority roots anchor to the responsible
# OPERATOR, whose standing is recorded outside this register (Human
# Escalation Contract), so this field must be able to carry an operator's
# email address — hence its own def rather than the machine-id grammar
# every other identifier keeps. Convener-authorized widening 2026-08-24
# (S2, 012-wallet-issuer-anchor), overriding that change's initial
# no-schema-edit posture.
$ref: '#/$defs/issuer_identifier'
scripts/validate-openxwallet.py:1494
- This drift probe uses
issued_by: ' brett heap', but the newissuer_identifierpattern rejects spaces.validate_recordstill reaches the rule after reporting the schema error, so the expected code can pass without proving exact-match/no-normalization. Use a schema-valid near miss such as[email protected]so this assertion exercises the anchor comparison itself.
"issued_by": " brett heap", "state": "active",
scripts/validate-openxwallet.py:1495
- The generic refusal branch is not detail-pinned: this probe checks only that
root-issuer-unanchoredfires, unlike the machine and legacy probes. A mutation that routes this non-anchor value through either special wording would remain green. Assert the generic substringnot the anchored responsible operatorhere.
}, expect_code="root-issuer-unanchored")
specs/012-wallet-issuer-anchor/plan.md:21
- The summary still says no schema/manifest/CHANGELOG files are touched, but those files are part of this diff and T009 records the explicit exception. Update this and the matching Constitution Check/avoid-list statements; otherwise the plan contradicts the delivered release surface.
untouched. No schema file, manifest entry, CHANGELOG line, or bundle version is
touched — a composing-capability restriction enforced in the validator only.
specs/012-wallet-issuer-anchor/spec.md:103
- This edge case claims a child with no
issued_byinherits the issuer, but FR-003 andcheck_grant()reportissuer-unrecordedfor every review-class grant; S2 implements no issuer inheritance. Rewrite the edge case to state that a missing child issuer still fails, while a recorded child issuer only skips the root anchor check.
- A review-class grant WITH `parent_grant_ref` and no `issued_by`: child grants
inherit issuer context from their parent chain — requiredness applies to the class,
but the root check only fires on roots; child behavior follows attenuation rules
(surfaced at clarify if the ratified text demands more).
specs/012-wallet-issuer-anchor/tasks.md:14
- T002 is marked complete with the superseded display-name token
Brett Heap, but the realized constant is[email protected]. This leaves the task record inconsistent with the implementation and with T009's re-ruling; update the task's acceptance text to the email anchor.
- [x] T002 [US1] Add named constants beside `CUSTODY_REGISTRY_PATH`: `REVIEW_ACT_TOKEN = "review"` (cited to review-authority-intake requirement 1), `ROOT_ISSUER_OPERATOR_TOKEN = "Brett Heap"` (comment cites HEC `docs/roles-and-authority.md:103-140`), machine-shape regex. Class detection in `check_grant()`: REVIEW-CLASS iff token ∈ `scope.acts`; no other trigger.
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "audience": {"wallet_ref": "wal-agent-poster-0001", | ||
| "holder_ref": "agent:ledger-poster"}, | ||
| "scope": { | ||
| "acts": ["post_transaction"], "authority_tier": "act", |
| (t) THE ISSUER IS RECORDED AND ROOTS ARE ANCHORED. A REVIEW-class grant — | ||
| membership decided by scope content alone: the canonical review act | ||
| token appearing in scope.acts — names issued_by, and a ROOT such grant | ||
| (no parent_grant_ref) names no issuer but the responsible operator, |
| "scope": dict(review_scope), | ||
| "expires_at": "2027-12-31T23:59:59Z", | ||
| "issued_at": "2026-08-24T00:00:00Z", | ||
| "issued_by": ROOT_ISSUER_OPERATOR_TOKEN, "state": "active", |
| - Packaged corpus exposure: five grant positives, all transaction-act class, | ||
| none carrying `issued_by`; the widening must cost them nothing (US3 boundary | ||
| guard, FR-008). |
| confirmed against ratified vocabulary). | ||
| - Anchor: validator constant citing the Human Escalation Contract at | ||
| `docs/roles-and-authority.md:103-140`; machine tokens and legacy `opensoft` | ||
| refused at roots; exact-match `Brett Heap` accepted (convener). |
| the canonical review act token (`review`) decides class membership from | ||
| `scope.acts` content alone; a review-class grant with no `issued_by` fails | ||
| `issuer-unrecorded`; a ROOT review-class grant whose issuer is not exactly the | ||
| anchored operator token (`Brett Heap`, citing the Human Escalation Contract) fails |
| - An `issued_by` value with whitespace/case drift (` brett heap`) — exact match | ||
| against the anchored token, fail-closed; no normalization (identity strings do not | ||
| get fuzzy). |
| **Feature**: 012-wallet-issuer-anchor | **Branch**: `012-wallet-issuer-anchor` | **Date**: 2026-08-24 | ||
| **Input**: [spec.md](./spec.md) · [plan.md](./plan.md) · [research.md](./research.md) · [data-model.md](./data-model.md) · [quickstart.md](./quickstart.md) | ||
|
|
||
| Scope guard (ratified tasks §3.1): NO schema edit, NO manifest entry, NO CHANGELOG line, NO bundle cut. Validator + packaged specimens + spec artifacts only. |
The Active row for add-wallet-carried-review-authority still read "NOT YET RATIFIED (Status: draft)" while the proposal has carried Status: ratified and a full "Ratification record, 2026-08-23" section since Brett's in-session ruling that day. The row now states the ratification in the shape its add-substantive-review-lane sibling uses, naming the three rulings the proposal records and the two questions that stay carried. Two further claims in the same row had gone stale and are corrected from the tree rather than from memory. The parenthetical on S1 asserted in the present tense that validate-openxwallet "runs in no workflow today"; it now runs on every pull request to main from .github/workflows/wallet-validation.yml, so the sentence is respelled to record what was true at authoring instead of asserting something the repository contradicts. And four successors have landed since the row was written - S1 (PR #275), S2 (PR #299), the first-wallet cold start (PR #308) and S4 (PR #341, which put governance/review-authority/register.yaml and its reader in one change) - so the row names them, and names S3 and S5 as the ones still outstanding. The change's own ledger is deliberately not ticked from any of them: its tasks file says a successor carries its own code_surface and archives on its own evidence. Co-Authored-By: Claude Fable 5 <[email protected]>
Feature: 012-wallet-issuer-anchor · Spec artifacts:
specs/012-wallet-issuer-anchor/· Substrate item S2 of the ratifiedadd-wallet-carried-review-authorityWhat this lands
First real enforcement of grant
issued_by, scoped to the review-authority class:REVIEW_ACT_TOKEN = "review"beside the custody registry path — class membership decided byscope.actscontent alone, nothing elseissued_by→issuer-unrecorded[email protected]→root-issuer-unanchored, with machine-named / legacy / generic detail wording; exact match, fail-closed, no normalization; legacyopensoftdoes NOT grandfatherOXWR-R1,OXWR-R2); coverage closes 11/11 → 13/13 (33 → 36 negatives); self-test boundary guard + anchor-assertion block pin every rule edgeConvener rulings encoded
Brett Heap(2026-08-23), re-ruled 2026-08-24 to[email protected]: implementation's anchored-root assertion proved the identifier grammar could carry neither a display name nor an email.issued_bymoves to a new $defs/issuer_identifier (identifier grammar +@); all other identifier fields keep the strict machine-id grammar. This explicitly overrides substrate §3.1's initial no-schema-edit posture for exactly one field, and rides the Contract Versioning Policy (manifest sha256 refreshed, CHANGELOG Unreleased additive bullet, bundle cut still deferred).Independent verdicts (round 1 on 9e85277, addressed in 38f7b6b)
Gates (current head)
validate-openxwallet: exit 0 — 17 positives unchanged / 36 negatives / 13 of 13 requirements · unhashable-issuer regression probe exits 1 with named findings ·pytest tests/wallet_yaml_syntax_gate/4 passed ·openspec validate --all --strict73 passed