Skip to content

feat(iid, iid-spec): floor weak account handles below anchor eligibility, with the spec amendment and conformance rule (P16g) - #35

Merged
kamescg merged 4 commits into
update/v1.1.0-alphafrom
codex/p16g-weak-account-floor
Oct 20, 2026
Merged

kamescg merged 4 commits into
update/v1.1.0-alphafrom
codex/p16g-weak-account-floor

Conversation

@jonathanprozzi

@jonathanprozzi jonathanprozzi commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Important

@kamescg — review ready. Base is #36 (fix/pr15-integration-gates); retarget to update/v1.1.0-alpha once #36 lands. Suggested order across the series: #36 → #37 → #35 → #39 → #40 → #41.

To ratify here: the weak acct form (<platform>:@<handle>) is valid and unambiguously typed but never anchor-eligible (P1 floor), recorded under §9.7 as a pre-publication amendment rather than an additive extension. Everything else is mechanical.

Receipt: four conformance ledger entries retired because both sides now agree; harness 1029 pass / 0 fail on this diff.

Child PR of the v1.1.0-alpha umbrella (#15). Part of the parity series: each PR in the series makes a train package behave exactly as the reference implementation's in-tree copy does today, so the published packages can replace those copies without a behaviour change.

Current (train)

@0xintuition/iid treats both acct forms as anchor-eligible: the strong form <platform>:<immutable id> and the weak form <platform>:@<handle>. The reference implementation floors the weak form: it stays valid and unambiguously typed, but it never anchors at P0 and sits one rung below the strong form, because handles can be renamed or recycled. The spec text and the conformance corpus in @0xintuition/iid-spec said nothing about the weak form's eligibility, and the corpus validator never computed eligibility itself, so a vector carrying the wrong expectation would have passed.

Need

Weak handles reported as valid, typed and not anchor-eligible, with the spec, the corpus and the validator all stating and checking the same rule.

Reconciliation

  • packages/iid/src/parse.ts: the canonical weak form <platform>:@<handle> gets anchorIneligibilityReason: 'weak-account' and anchorEligible: false. The new reason joins the exported union in types.ts. Canonicalization and canonical bytes are unchanged (twitter:@Jack → twitter:@jack, GitHub:MonaLisa → github:MonaLisa, as before).
  • packages/iid-spec/schemes/acct.md and spec/07-representation-profiles.md: the eligibility rule, stated once in each place. spec/09-registry-governance.md gains §9.7 "Pre-publication amendments" with a dated record of this change, because §9.3.1 does not allow changing the eligibility of an existing valid form after publication.
  • Conformance corpus: two vectors, valid-acct-strong (int:acct:github:MonaLisa, eligible) and valid-acct-weak (int:acct:twitter:@jack, valid, typed, ineligible).
  • Corpus schema: an optional anchorIneligibleValuePattern per scheme, a regular expression applied to the value after the scheme. acct declares ^[^:]+:@; wd declares its eight dormant binding slugs so the existing dormant-binding vector keeps its expectation under the exact comparison.
  • Validator (test/validate-fixtures.mjs): exported as validateCorpus; computes the expected eligibility of every vector (valid, registered non-Class-C scheme, unambiguous effective typing, no exclusion-pattern match) and compares it with the declared value in both directions, naming the vector on a mismatch. No acct special case in code. The new test/validate-fixtures.test.mjs keeps the two rejections permanently red-first, and the package test script runs it.

Parity

Matches the reference implementation's iid package (the weak-account rule in its parser) and its conformance rule for acct. One difference is left outside this PR: the reference's parser accepts a non-ASCII handle (twitter:@jäck) where the train rejects it as malformed; both treat it as ineligible. That is the pre-existing grammar difference between the two parsers and is tracked on its own.

Conformance ledger: the four weak-handle entries in conformance/known-divergences.ts (the anchor envelope case and three ladder cases for social-media-account) now agree with the reference and are retired; the README enumeration moves to 33/25 for the anchor proof and 388/66 for the ladder proof. Harness on top of #36: 1029 pass, 23 todo, 0 fail.

Held out

  • No version bump; the release PR freezes versions for the whole family at once.
  • The non-ASCII handle grammar difference above.

Evidence

  • packages/iid: typecheck and lint green; 282 tests pass, including nine new weak-account cases (weak forms ineligible with the reason; strong forms eligible, including an embedded :@ after the id starts; canonical bytes preserved; a noncanonical weak handle invalid with its repair) and the two corpus vectors. Red-first: four cases failed before the parser change.
  • packages/iid-spec: corpus validation OK (170 vectors, 26 schemes); the three validator tests pass, two of which failed before the eligibility comparison existed. schema:validate, root registry:check (14 packages) and guard:supply-chain pass.
  • Independent review: the conformance pass found every item conforming except the validator gap, which the second commit closes. The adversarial re-review confirmed the gap closed (flipping either new vector's eligibility now fails naming the vector; a different-platform weak vector declared eligible fails; a strong vector declared ineligible fails), pre-existing validator checks intact, no new findings.

Review notes

Base fix/pr15-integration-gates (#36) so the conformance gate runs on this diff; retarget to the train branch once #36 lands. Read packages/iid/src/parse.ts and weak-account.test.ts first, then the §9.7 record in 09-registry-governance.md, then the validator. The one judgement call is the §9.7 route (a pre-publication amendment rather than an additive extension); it is in effect by default and open to ratification in this review.

…the spec amendment and vectors (P16g)

The weak form of the acct scheme (<platform>:@<handle>) stays a valid,
unambiguously typed identifier but is no longer anchor-eligible: handles
are renamed and recycled, so it ranks one rung below the strong form, as
the reference implementation already enforces.

- iid: isAnchorEligible returns false for the weak form; the inspect
  result carries a reason for it. Canonical bytes are unchanged.
- iid-spec: schemes/acct.md and the representation-profiles section state
  the rule; recorded as a pre-publication correction in a new
  "Pre-publication amendments" subsection of the governance section, not
  as an additive extension, since it changes eligibility of an existing
  valid form before first publication.
- Conformance corpus: strong-form and weak-form acct vectors with
  explicit eligibility (170 vectors validate).
- Tests: weak-account cases in iid (282 tests), corpus validator green;
  ladder, registry and classifications suites unchanged and green.
…eligibility exactly (P16g fix round)

Review found that the standalone corpus validator only checked that a
vector declared eligible was valid, outside Class C and unambiguously
typed, so a weak account vector declared eligible passed. The rule is now
data-driven and enforced both ways:

- schema.json: optional anchorIneligibleValuePattern on a scheme entry,
  a value pattern that is valid but never anchor-eligible; schemes.json
  sets it on acct to the weak form.
- validate-fixtures.mjs: expected eligibility is computed for every
  validation vector (valid, not Class C, unambiguous typing, value does
  not match the scheme's ineligible pattern) and must equal the declared
  flag; a mismatch names the vector. The validator is exported as a
  function and keeps its CLI behaviour.
- validate-fixtures.test.mjs: the shipped corpus passes; the weak vector
  declared eligible and the strong vector declared ineligible both fail
  by name. Wired into the package test script.
@jonathanprozzi
jonathanprozzi changed the base branch from codex/p16-typed-wd to update/v1.1.0-alpha October 19, 2026 19:44
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