Skip to content

P3: openxFactory consumes openXwallet at wallet-v1.1 and sheds the wallet paths (contract-v2.0) - #431

Merged
brettheap merged 6 commits into
mainfrom
023-openxwallet-consume-shed
Aug 27, 2026
Merged

brettheap merged 6 commits into
mainfrom
023-openxwallet-consume-shed

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Realizes split-openxwallet-repo P3 (tasks.md §7, 33 tasks) as Speckit
feature 023-openxwallet-consume-shed. One atomic pull request, because
scripts/validate-trust-anchor.py exits 2 when the openxWallet custody registry
is absent: no ordering of two commits leaves a green intermediate.

What and why

openxFactory stops owning the openxWallet family and starts consuming it.
The wallet's contracts are a product that was filed as features of a factory
layer; P2 carved it into opensoft/openXwallet (a COPY — nothing was deleted),
P2b published wallet-v1.1, P2.5 cut contract-v1.47 so the removal is legal
under docs/contract-versioning-policy.md:250-254. This is the shed.

The alias fact — the single most important line in this pull request

Org ruleset 21538893 requires the check wallet-validation on main. That
token is the JOB ID, never the filename.
So
.github/workflows/wallet-validation.yml becomes
.github/workflows/openxwallet-consumer-gate.yml with jobs: wallet-validation:
retained verbatim, the ruleset is edited by nothing, and the required
token reports on this pull request's own head from the new file. No operator
act stands between this pull request and merge.
Both alternatives are
unmergeable and are named so neither is re-proposed: deleting the old workflow
first means the required token never reports on the pull request that removes it,
and repointing the ruleset first fails because a check is not selectable until a
workflow has reported under it once. Renaming the TOKEN is a named successor.

A green wallet-validation on this pull request IS the alias proof.

The pin

repository opensoft/openXwallet (private)
tag label wallet-v1.1
commit (the referent) 63f5a1adac89f017e70bab9a4ffe7cf02d6e6705
gitlink openXwallet, .gitmodules keeps [email protected]:
carve commit 30565e48ffe3d8a9773e10af33425701845e10f6
digested members 8, each with sha256
pinned_by_commit_only 6 paths (both readers, both examples/, both READMEs)

contracts/openxwallet-pin.yaml reuses kind: pinned_contract_manifest
unchanged (design D1). contract_bundle_tag is a LABEL beside the commit and
never the trusted referent — a tag-only pin is REFUSED.

scripts/verify-openxwallet-pin.py runs six ordered checks and exits 2 with a
NAMED code — pin-submodule-uninitialized, pin-gitlink-mismatch,
pin-checkout-mismatch, pin-digest-mismatch, pin-member-missing,
pin-tag-only — each printing one fixed remediation trailer. The recorded gitlink
and the checked-out revision are compared SEPARATELY, because a detached checkout
can differ from the recorded gitlink and only one comparison catches each case.
--aggregation-root is the root-equals-nested check P4 invokes: one
implementation, one refusal vocabulary.

The eight digests were derived twice: copied from contracts/manifest.yaml's
rows, and independently recomputed against the submodule. They agree, and they
equal the values recorded at the named carve commit.

The gate

app token → insteadOf → checkout → git submodule update --init openXwallet → verify-openxwallet-pin.py → openXwallet/scripts/wallet-yaml-syntax-gate.py . → openXwallet/scripts/validate-openxwallet.py . | tee wallet-gate.log → the register assertion.

The register assertion is POSITIVE and needs no edit to the pinned code: the
log must carry the repo scan: note AND wallet-v1.1's intake register read:
NOTE and must carry neither no intake register at this tree nor any
[register-*] finding code. On the happy path check_register emits nothing, so
"no register finding" ALONE is satisfied by never having opened the register — a
green check that opened no register is a vacuous pass, and that is the class this
step closes.

tests/openxwallet_consumer_gate/test_gate_invocation.py, collected by the
REQUIRED pytest-suite, pins the job id and the literal invocation. The scan
target must be present and equal to .: main() runs repo_scan only
if args.path is not None and reads the register only when the target
is_dir().

The shed — 92 files, and the three that stay

Deleted: contracts/openxwallet/, contracts/openxwallet-agent-profile/,
scripts/validate-openxwallet.py, scripts/wallet-yaml-syntax-gate.py,
tests/wallet_yaml_syntax_gate/, .github/workflows/wallet-validation.yml,
specs/006-openxwallet-contracts/, specs/010-wallet-validator-ci/,
specs/012-wallet-issuer-anchor/.

Deliberately NOT deleted (the carve's 100 files minus these 8 = 92):
openspec/specs/openxwallet/ and openspec/specs/openxwallet-agent-profile/
empty when openspec archive applies the ratified REMOVED deltas — not here; and
openspec/changes/archive/2026-08-08-add-openxwallet/ is a RECORD, annotated in
README.md and docs/archive-record-discrepancies.md and never removed.

governance/review-authority/ STAYS — all four files. git diff --stat origin/main -- governance/ is EMPTY. The reader travels; the DATA stays.
codexFactory's floor names governance/review-authority/register.yaml in
opensoft/openxFactory and a floor cannot be satisfied by a path in another
repository — which is exactly why the consumer gate runs the pinned reader over
openxFactory's OWN tree.

The major

contract-v2.0. All three :250-254 clauses are discharged explicitly, and the
third — "an update to the conformance validator" — is discharged by the MOVE
ITSELF: from this major forward this family's conformance validator IS the pinned
openXwallet/scripts/validate-openxwallet.py at the commit the pin records.
There is no new shape; the BYTES are identical and the PUBLISHER changed.

contracts/releases/contract-v2.0.digests.yaml is built by the house tool (192
entries, byte-reproducible). docs/contract-versioning-policy.md moves the
openxWallet deprecation from "Currently In Force" into a new "Deprecations
Executed" section — recorded, not deleted, because a consumer upgrading ACROSS the
removal needs the migration path readable at the version it upgrades TO.

The number is re-verified at merge order per :30-31. Four places carry it
(the manifest line, the CHANGELOG heading, the inventory filename, the policy's
Executed entry) and they move together if another bundle lands first.

One correction of substance to the ratified design

The gate mints its App token from OPENXFACTORY_APP_ID /
OPENXFACTORY_APP_PRIVATE_KEY
, not the XFACTORY_APP_* names
doc-health-reusable.yml uses. Measured first: that org secret is
visibility-selected and openxFactory is not one of its two repositories, so
the ratified name would have resolved to EMPTY here and the nested clone would
have failed with a 403 that reads like a missing submodule. The pattern is the
ratified one; the secret names are this repository's own content App (App
4253636, installation 145372182, repository_selection: all — so no
installation edit was needed and none was made).
research.md R1 and evidence/operator-acts.md.

Validation

Check Result
openspec validate --all --strict 75 passed, 0 failed
scripts/verify-openxwallet-pin.py exit 0, 8 digests recomputed
scripts/validate-trust-anchor.py . exit 0, 0 errors / 0 warnings
the gate's exact invocation + register conjunction all four assertions hold; intake register read: … (1 row(s)), repo scan: 2 …
pytest tests/openxwallet_pin/ 35 passed, 0 skipped
pytest tests/trust-anchor/ 93 passed, 0 skipped
pytest tests/openxwallet_consumer_gate/ 14 passed, 0 skipped
doc-health.py --single-repo . vs the same run on origin/main finding sets IDENTICAL, 65 = 65, zero new and zero resolved
validate-contract-release.py build --tag contract-v2.0 192 entries, second build byte-identical
verify-tag --tag contract-v1.47 (ticks §5.8) release verify-tag: pass
grep for surviving contracts/openxwallet/ references only inside openXwallet/, the pin, and two deliberate pin-relative citations

Do not merge yet

P5a.2 must land first (tasks.md §6): the LedgerxFactory stack.yaml bump to
contract-v1.47 plus the pinned-checker invocation that makes the relocating:
warning OBSERVED by the one live consumer. Without it the deprecation window is
unobserved and the policy's precondition is a formality.

Then, in order: rebase, RE-VERIFY the eight digests (§7.26 — the declared
freeze is unenforceable, so the pre-merge re-verification is what the evidence row
carries, not this authoring-time one), record ruleset 21538893's UNCHANGED state
(§7.31), merge, cut the contract-v2.0 tag. P3b and P4 land in the same wave.

Rollback

git revert restores every path — the carve COPIED and deleted nothing — and
removes the pin file and the gitlink; wallet-validation.yml returns as a
filename. Ruleset 21538893 is unchanged throughout, so there is nothing to roll
back there.

🤖 Generated with Claude Code

…llet paths (contract-v2.0)

Realizes split-openxwallet-repo tasks.md group 7 as Speckit feature
023-openxwallet-consume-shed. One atomic commit: validate-trust-anchor.py exits 2
when the openxWallet custody registry is absent, so no ordering of two commits
leaves a green intermediate.

- openXwallet gitlink at wallet-v1.1 (63f5a1ad), .gitmodules keeps [email protected]:
- contracts/openxwallet-pin.yaml: kind: pinned_contract_manifest unchanged,
  submodule_path, carve_commit 30565e4, eight sha256s, six pinned_by_commit_only
- scripts/verify-openxwallet-pin.py: six ordered checks, six named refusal codes,
  one fixed remediation trailer, --aggregation-root mode for P4
- validate-trust-anchor.py reads the registry through the gitlink; the bare
  file-absent exit is replaced in main() by the verifier's named refusal
- openxwallet-consumer-gate.yml replaces wallet-validation.yml with
  jobs: wallet-validation: RETAINED — the required token is the JOB ID, so
  ruleset 21538893 is edited by nothing
- the gate's register assertion is POSITIVE: repo scan note AND intake register
  read NOTE AND no absent-register note AND no register-* finding
- pytest-suite.yml: app token + insteadOf + scoped init, three filename
  references renamed, and the pinned count becomes a pinned triple read from the
  JUnit XML attributes
- doc-health-reusable.yml: both init filters gain a guarded nested scoped init
- 92 files shed — the carve's 100 minus the three deliberate record exceptions
- contract-v2.0: eight manifest rows removed, seven citations reworded to the
  pin, CHANGELOG major entry, contracts/README row collapsed, the deprecation
  recorded EXECUTED, and the cut's own digest inventory

governance/review-authority/ is untouched, all four files.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 27, 2026 19:40

@sourcery-ai sourcery-ai Bot 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.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

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 realizes the contract-v2.0 “consume & shed” move for the openxWallet family: openxFactory stops owning the wallet contracts/validators and instead consumes the upstream opensoft/openXwallet repository via a pinned submodule + digest manifest, while preserving the required wallet-validation status check token through a workflow-file rename.

Changes:

  • Add openXwallet submodule consumption via contracts/openxwallet-pin.yaml and enforce it with scripts/verify-openxwallet-pin.py.
  • Replace the legacy wallet gate workflow with .github/workflows/openxwallet-consumer-gate.yml, retaining jobs: wallet-validation: and running the pinned readers plus a positive “register was read” assertion.
  • Remove in-repo openxWallet contract/validator paths and update policy/docs/spec artifacts to record the executed deprecation and new consumption model.

Reviewed changes

Copilot reviewed 120 out of 121 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
contracts/openxwallet-pin.yaml Declares the content-addressed pin (commit + sha256 digests) for consuming opensoft/openXwallet.
scripts/verify-openxwallet-pin.py Implements the offline pin verifier used by CI (and other validators) to fail closed when the pin/gitlink/digests disagree.
.gitmodules Adds the openXwallet submodule gitlink used by the consumer gate.
.github/workflows/openxwallet-consumer-gate.yml New required PR gate workflow (successor to wallet-validation.yml) that initializes the submodule, verifies the pin, runs pinned readers, and asserts register-read positivity.
tests/openxwallet_consumer_gate/test_gate_invocation.py Pins the workflow job id and exact invocation strings as a required pytest-enforced contract.
.github/workflows/doc-health-reusable.yml Initializes the nested openxFactory/openXwallet submodule (guarded) so doc-health runs can operate when the nested gitlink exists.
.github/CODEOWNERS Re-routes ownership to the new pin/verifier/gitlink surfaces that determine which wallet reader CI runs.
docs/contract-versioning-policy.md Records the executed openxWallet deprecation/removal at contract-v2.0 and the new consumption mechanism.
docs/archive-record-discrepancies.md Annotates the archived add-openxwallet record with the relocation/consumption note (record preserved, not rewritten).
openspec/changes/add-wallet-carried-review-authority/tasks.md Updates normative task text to reflect the post-contract-v2.0 reader location and workflow filename while preserving the required token.
scripts/validate-identity-brokering.py Updates explanatory text/comments to reflect openxWallet now being consumed via the pin (publisher moved, rule intent unchanged).
scripts/proposal-support.py Updates an internal comment to reflect relocation context for add-openxwallet while preserving archival semantics.
specs/023-openxwallet-consume-shed/research.md Records pre-implementation measurements and rationale for token/secrets/pin correctness.
specs/023-openxwallet-consume-shed/evidence/operator-acts.md Captures operator-act audit findings/omissions relevant to App reachability and required check invariants.
specs/023-openxwallet-consume-shed/checklists/requirements.md Checklist artifact asserting spec completeness for this realization wave.
contracts/openxwallet/** Removed: wallet family contracts/examples previously owned by openxFactory (shed as part of the move to consumption).
contracts/openxwallet-agent-profile/** Removed: agent-profile sibling family previously owned by openxFactory (shed as part of the move to consumption).
scripts/validate-openxwallet.py Removed: openxFactory-owned validator (replaced by pinned validator in submodule).
scripts/wallet-yaml-syntax-gate.py Removed: openxFactory-owned syntax gate (replaced by pinned gate in submodule).
tests/wallet_yaml_syntax_gate/** Removed: tests for the now-removed openxFactory-owned syntax gate.
.github/workflows/wallet-validation.yml Removed: legacy workflow file, replaced by the consumer gate workflow while retaining the required job id token.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +186 to +190
assert "repo scan:" in assertion
assert "intake register read: governance/review-authority/register.yaml" \
in assertion
assert "no intake register at this tree" in assertion
assert "register-" in assertion
…CI evidence

The first pytest-suite run on this pull request refused
contracts/openxwallet-pin.yaml in BOTH directions of the derived-pin-reachability
class, which is that obligation's coverage half working on a new artifact rather
than a defect in it:

- test_every_declared_repo_local_pin_in_this_repository_resolves reported
  contracts/openxwallet-pin.yaml:44 (commit) -> 63f5a1ad... as an UNCOVERED site;
- test_every_committed_commit_shaped_value_that_resolves_is_covered reported the
  carve commit 30565e4..., which DOES resolve here and was undeclared.

Fixed by TWO PinMember rows, not one. This is the first artifact in the
repository that pins another repository's bytes and, in the same file, names the
openxFactory commit those bytes were taken at, so the two values have opposite
localities and one member could only have declared one of them:

- openxwallet-pin-carve-commit, key carve_commit, REPO_LOCAL — the byte-identity
  referent, which must stay reachable here or the byte-identical claim stops
  being checkable by anyone. carve_commit was a key the sweep vocabulary did not
  know; declaring the member teaches it.
- openxwallet-pin-product-commit, key commit, CROSS_REPOSITORY — openXwallet's
  commit, answered by that repository's authority and, locally, by
  scripts/verify-openxwallet-pin.py.

Also in this commit:
- the house HAS_APP_KEY guard on both app-token mints, matching
  doc-health-reusable.yml:125 — a skipped mint fails at the scoped init with a
  legible cause instead of erroring on an empty app-id, and falling back is not a
  pass: without a token the pin cannot be verified and the gate refuses;
- split-openxwallet-repo tasks.md: 7.28/7.29 carry the green wallet-validation
  run 33109575651 (the ALIAS PROOF), 7.31 carries the ruleset read and the
  correction that the required set is now TWO tokens rather than one, and 7.32 is
  DISCHARGED by the retargeted red-proof, run 33109857156;
- the feature's validation evidence.

tests/doc-health/test_pin_reachability.py: 53 passed.
openspec validate --all --strict: 76 passed.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 27, 2026 20:00

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

Copilot reviewed 122 out of 123 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

.github/CODEOWNERS:12

  • /openXwallet in CODEOWNERS is likely treated as a literal path match (file or directory entry) and may not apply to files under the openXwallet/ tree. Since this PR’s intent is to owner-route changes to the nested gitlink’s contents, use a directory pattern (/openXwallet/ or /openXwallet/**) consistent with the existing .github/workflows/ directory rule so changes within the submodule path are actually covered.
/contracts/openxwallet-pin.yaml @brettheap
/scripts/verify-openxwallet-pin.py @brettheap
/openXwallet @brettheap
/.gitmodules @brettheap

Run 33111235491 (PR #431) printed
`selected=7090 passed=7070 skipped=20 failures=0 errors=0` over a suite summary of
`7042 passed, 20 skipped, 338 deselected, 28 subtests passed in 866s`. Those three
numbers are now the pin, replacing the sentinel the first push deliberately
shipped.

The arithmetic is recorded in the workflow because it is not obvious and the next
reader will check it: pytest-subtests emits a <testcase> per SUBTEST as well as
per test, so the JUnit `tests` attribute is 7042 + 20 + 28 = 7090 and PASSED is
7090 - 20 = 7070, not 7042. The -q summary and the XML attributes count different
things; the XML is what is pinned, because the summary is a human line whose
format has changed before, and a pin taken from the wrong reading is a pin that
passes while measuring something else.

split-openxwallet-repo tasks.md 7.30 ticked on that run, which also proves the
nested submodule was genuinely initialized: the token mint, the insteadOf rewrite
and the scoped `git submodule update --init openXwallet` each reported success as
their own step.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 27, 2026 20:17

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

Copilot reviewed 122 out of 123 changed files in this pull request and generated no new comments.

…ed, not preferred

An equality pin on SELECTED/PASSED does not survive a pull_request trigger, and
the measurement is two consecutive runs of THIS pull request:

  run 33111235491 (20:15)  selected=7090 passed=7070 skipped=20
  run 33112622523 (20:32)  selected=7116 passed=7096 skipped=20

The pull request added no test between them. A pull_request run builds a MERGE of
the head with main, so its totals include every test main took in the interval --
26 of them, in seventeen minutes. An equality pin would red this REQUIRED check
for merges the candidate cannot influence, which is the same deadlock class this
file's own "no paths filter" note refuses.

So the three numbers are checked in two shapes:

- SKIPPED exactly 20. It is the load-bearing number -- the one a directory that
  silently turns into skips MOVES -- and it does not drift with main, because a
  merge adds passes, not skips.
- SELECTED >= 7090 and PASSED >= 7070, floors that may only RISE, set to the
  LOWER of the two measured runs so each is a number this suite has actually met.
  The margin is printed every run so drift is visible rather than inferred.
- FAILURES and ERRORS zero.

The trade is stated in the workflow and in the evidence: a silent loss smaller
than the day's margin escapes the floor alone; the only shape that escapes all
three is a test that stops being COLLECTED while main adds at least as many in
the same window, and closing that needs per-directory counts -- a successor.

split-openxwallet-repo tasks.md 7.30 carries the correction and its measurement.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 27, 2026 20:34

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

Copilot reviewed 122 out of 123 changed files in this pull request and generated 1 comment.

Comment on lines +187 to +188
assert "intake register read: governance/review-authority/register.yaml" \
in assertion
…ite 33114027245

wallet-validation reported GREEN on four consecutive heads of this pull request,
every one from .github/workflows/openxwallet-consumer-gate.yml with ruleset
21538893 edited by nothing -- the alias proof, four times over. pytest-suite is
green alongside it: selected=7116 passed=7096 skipped=20 failures=0 errors=0,
both floors met with margin 26.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 27, 2026 20:49

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

Copilot reviewed 122 out of 123 changed files in this pull request and generated 1 comment.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

openspec/changes/add-wallet-carried-review-authority/tasks.md:84

  • This task bullet simultaneously documents the workflow as running the validator with --strict and then states the recorded decision is to omit --strict. That contradiction makes the task log ambiguous for future readers trying to confirm the required invocation.

Comment on lines +58 to +64
# The house guard (`doc-health-reusable.yml:125`). If the App key is
# absent the mint is SKIPPED rather than erroring on an empty app-id, the
# token expression falls back, and the scoped init then fails on the
# PRIVATE nested repository — a red gate with a legible cause. Falling back
# is not a pass: without a token the pin cannot be verified, and this gate
# refuses rather than proceeding on an unverifiable reader.
HAS_APP_KEY: ${{ secrets.OPENXFACTORY_APP_PRIVATE_KEY != '' }}
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