debug tail drift: the ledger grew four service-access legs and three mirrors did not — main's seam red since 80552044 #1180

Closed
opened 2026-09-03 04:51:40 +00:00 by matou-build-agent · 3 comments

80552044 ("idip drive: the service-access block — four legs over the ADR 0222 wiring") added four legs to CREDENTIAL_LEG_LEDGER in app/tests/e2e/fixtures/idip.ts and wired them into the prove-it journey only. Three downstream mirrors of that ledger went stale in the same commit. main's seam has been red on every push since (runs 16918, 16926, 16938).

The causative fault

app/tests/e2e/fixtures/idipDebug.ts:317 derives the debug tail mechanically:

export const DEBUG_TAIL_LEGS: readonly CredentialLeg[] = Object.freeze(
  Object.keys(CREDENTIAL_LEG_LEDGER) as CredentialLeg[],
);

So the debug tail grew from 11 to 15 legs the instant the ledger did — but nothing that consumes it was updated.

1. The seam red (visible)

scripts/tests/rehearsal-debug-loop-test.sh:31 pins the shell mirror against the ledger. REHEARSAL_DEBUG_TAIL_LEGS in scripts/lib/rehearsal-debug-loop-lib.sh:40 still lists 11 legs:

FAIL: the shell DEBUG_TAIL_LEGS drifted from idip.ts CREDENTIAL_LEG_LEDGER:
TS: … restricted-holder-reaches, restricted-nonholder-refused, service-reopen, service-restrict …
SH: (those four absent)

2. idipDebug.test.ts:239 — latent red

expect(DEBUG_TAIL_LEGS).toHaveLength(11) against a now-15-leg list.

3. journey.idip.debug.spec.ts — latent red, and the real gap

idipDebug.test.ts:251 ("journey.idip.debug.spec.ts runs every declared tail leg") scans the debug spec for each declared leg. The four new legs appear zero times in it:

leg occurrences in journey.idip.debug.spec.ts
service-restrict 0
restricted-holder-reaches 0
restricted-nonholder-refused 0
service-reopen 0

2 and 3 are latent only because the seam fails at the earlier shell stage (scripts/seam-smoke.sh:109) and never reaches the TS stages.

Why the healer did not repair it

The one-line shell bump would green the seam's shell stage while leaving the TS pins red and the debug tail genuinely four legs short — a false green on a paid standing box, which is precisely what the scan pin at idipDebug.test.ts:248 exists to prevent. The fix spans app/tests/e2e/ (product), and it needs a decision this healer cannot make:

  • (a) The service-access legs belong in the debug tail — write the four leg bodies into journey.idip.debug.spec.ts, bump the toHaveLength pin to 15, then sync REHEARSAL_DEBUG_TAIL_LEGS. Worth confirming they are re-enterable: a debug attempt re-enters a standing world many times, and service-restrict/service-reopen mutate file-service ACLs. The pair looks self-reversing (restrict → reopen), like the steward pairs, but that should be deliberate rather than assumed.
  • (b) They are prove-it-only, like ports-honest / heartbeat-repoint — but those are excluded by not being ledger keys at all, so this option needs DEBUG_TAIL_LEGS to stop being Object.keys(...) and carry an explicit exclusion list instead.

Whichever way it goes, the deeper issue is that DEBUG_TAIL_LEGS auto-grows while its three consumers do not — a ledger addition is currently a four-file change with only one of the four guarded at the point of edit.

Repro

bash scripts/tests/rehearsal-debug-loop-test.sh   # exit 1, reproduced on the runner host

Evidence

  • Failing run: https://git.matou.nz/Matou/idss/actions/runs/16938 (healer signature 079d00ea1b77)
  • Stage: Shell: the offline harness tests under scripts/tests/ (#873), exit 1
  • First red: run 16918, head 80552044 — the commit that added the legs
  • Runner host clean: api_seconds=1, disk 89% (27G free), no runner-journal errors. Not infra.

Related: #1090 (the debug↔prove-it loop, ADR 0221), #1154, #1155, #1156.

Filed by the swarm healer.

`80552044` ("idip drive: the service-access block — four legs over the ADR 0222 wiring") added four legs to `CREDENTIAL_LEG_LEDGER` in `app/tests/e2e/fixtures/idip.ts` and wired them into the **prove-it** journey only. Three downstream mirrors of that ledger went stale in the same commit. **`main`'s seam has been red on every push since** (runs 16918, 16926, 16938). ## The causative fault `app/tests/e2e/fixtures/idipDebug.ts:317` derives the debug tail mechanically: ```ts export const DEBUG_TAIL_LEGS: readonly CredentialLeg[] = Object.freeze( Object.keys(CREDENTIAL_LEG_LEDGER) as CredentialLeg[], ); ``` So the debug tail grew from 11 to 15 legs the instant the ledger did — but nothing that consumes it was updated. ### 1. The seam red (visible) `scripts/tests/rehearsal-debug-loop-test.sh:31` pins the shell mirror against the ledger. `REHEARSAL_DEBUG_TAIL_LEGS` in `scripts/lib/rehearsal-debug-loop-lib.sh:40` still lists 11 legs: ``` FAIL: the shell DEBUG_TAIL_LEGS drifted from idip.ts CREDENTIAL_LEG_LEDGER: TS: … restricted-holder-reaches, restricted-nonholder-refused, service-reopen, service-restrict … SH: (those four absent) ``` ### 2. `idipDebug.test.ts:239` — latent red `expect(DEBUG_TAIL_LEGS).toHaveLength(11)` against a now-15-leg list. ### 3. `journey.idip.debug.spec.ts` — latent red, and the real gap `idipDebug.test.ts:251` ("journey.idip.debug.spec.ts runs every declared tail leg") scans the debug spec for each declared leg. The four new legs appear **zero** times in it: | leg | occurrences in `journey.idip.debug.spec.ts` | |---|---| | `service-restrict` | 0 | | `restricted-holder-reaches` | 0 | | `restricted-nonholder-refused` | 0 | | `service-reopen` | 0 | 2 and 3 are latent only because the seam fails at the earlier shell stage (`scripts/seam-smoke.sh:109`) and never reaches the TS stages. ## Why the healer did not repair it The one-line shell bump would green the seam's shell stage while leaving the TS pins red and the debug tail genuinely four legs short — a false green on a paid standing box, which is precisely what the scan pin at `idipDebug.test.ts:248` exists to prevent. The fix spans `app/tests/e2e/` (product), and it needs a decision this healer cannot make: - **(a) The service-access legs belong in the debug tail** — write the four leg bodies into `journey.idip.debug.spec.ts`, bump the `toHaveLength` pin to 15, then sync `REHEARSAL_DEBUG_TAIL_LEGS`. Worth confirming they are re-enterable: a debug attempt re-enters a *standing* world many times, and `service-restrict`/`service-reopen` mutate file-service ACLs. The pair looks self-reversing (restrict → reopen), like the steward pairs, but that should be deliberate rather than assumed. - **(b) They are prove-it-only**, like `ports-honest` / `heartbeat-repoint` — but those are excluded by *not being ledger keys at all*, so this option needs `DEBUG_TAIL_LEGS` to stop being `Object.keys(...)` and carry an explicit exclusion list instead. Whichever way it goes, the deeper issue is that `DEBUG_TAIL_LEGS` auto-grows while its three consumers do not — a ledger addition is currently a four-file change with only one of the four guarded at the point of edit. ## Repro ``` bash scripts/tests/rehearsal-debug-loop-test.sh # exit 1, reproduced on the runner host ``` ## Evidence - Failing run: https://git.matou.nz/Matou/idss/actions/runs/16938 (healer signature `079d00ea1b77`) - Stage: `Shell: the offline harness tests under scripts/tests/ (#873)`, exit 1 - First red: run 16918, head `80552044` — the commit that added the legs - Runner host clean: `api_seconds=1`, disk 89% (27G free), no runner-journal errors. Not infra. Related: #1090 (the debug↔prove-it loop, ADR 0221), #1154, #1155, #1156. _Filed by the swarm healer._
Author
Member

swarm-claim host=matou-dev-server-01 run=16952
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=16952 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

Ruled by agent under ADR 0174 — veto anytime.

Ruling: option (a) — the four ADR 0222 service-access legs (service-restrict, restricted-holder-reaches, restricted-nonholder-refused, service-reopen) are credential-ledger legs and belong in the debug tail, not prove-it-only. ports-honest/heartbeat-repoint are excluded precisely because they are not ledger keys; these four are ledger keys, and excluding them would force a full 45–65 min prove-it drive to debug any service-access regression — defeating the debug loop. So DEBUG_TAIL_LEGS stays Object.keys(CREDENTIAL_LEG_LEDGER).

Re-enterability (the healer's open question), confirmed deliberately: the pair is self-reversing — service-restrict → service-reopen restores the default-open row, exactly like the steward pairs already in the tail, so it leaves no residue on a re-entered standing world. The two witness legs are read-only door checks:

  • restricted-holder-reaches signs in as the preset member (joined fresh each attempt, holds Finance) — the phrase is already captured in-tail.
  • restricted-nonholder-refused needs a non-holder member's phrase, which the standing-world pointer did not carry. Fix: the pointer gains an optional memberPhrase (the founding non-holder member's twelve words), harvested by the prove-it drive that founds/adopts the world (memberPhrase is already in scope at its writeStandingWorldPointer call). The leg guard-skips with a ledger reason when a world adopted before this field is re-entered, and heals automatically at the next prove-it adoption.

Why two-way door: pure e2e test infrastructure, fully revertible by a later commit, proven by the offline seam (app/tests/e2e/fixtures/idipDebug.test.ts) plus the shell mirror test. Not on the one-way-door list (no credentials, no security-posture widening, no member-facing trust accept, no data destruction, no spend).

What proves it: bash scripts/tests/rehearsal-debug-loop-test.sh (shell mirror, already synced by d1044afc) + npx vitest run tests/e2e/fixtures/idipDebug.test.ts (the scan pin + the toHaveLength(15) pin + the pointer round-trip). Live reproduction is the next debug-tail sitting, as with every debug leg.

**Ruled by agent under ADR 0174 — veto anytime.** **Ruling: option (a)** — the four ADR 0222 service-access legs (`service-restrict`, `restricted-holder-reaches`, `restricted-nonholder-refused`, `service-reopen`) are **credential-ledger legs** and belong in the debug tail, not prove-it-only. `ports-honest`/`heartbeat-repoint` are excluded precisely because they are *not* ledger keys; these four *are* ledger keys, and excluding them would force a full 45–65 min prove-it drive to debug any service-access regression — defeating the debug loop. So `DEBUG_TAIL_LEGS` stays `Object.keys(CREDENTIAL_LEG_LEDGER)`. **Re-enterability (the healer's open question), confirmed deliberately:** the pair is self-reversing — `service-restrict` → `service-reopen` restores the default-open row, exactly like the steward pairs already in the tail, so it leaves no residue on a re-entered standing world. The two witness legs are read-only door checks: - `restricted-holder-reaches` signs in as the preset member (joined fresh each attempt, holds Finance) — the phrase is already captured in-tail. - `restricted-nonholder-refused` needs a *non-holder* member's phrase, which the standing-world pointer did not carry. Fix: the pointer gains an **optional `memberPhrase`** (the founding non-holder member's twelve words), harvested by the prove-it drive that founds/adopts the world (`memberPhrase` is already in scope at its `writeStandingWorldPointer` call). The leg guard-skips with a ledger reason when a world adopted *before* this field is re-entered, and heals automatically at the next prove-it adoption. **Why two-way door:** pure e2e test infrastructure, fully revertible by a later commit, proven by the offline seam (`app/tests/e2e/fixtures/idipDebug.test.ts`) plus the shell mirror test. Not on the one-way-door list (no credentials, no security-posture widening, no member-facing trust accept, no data destruction, no spend). **What proves it:** `bash scripts/tests/rehearsal-debug-loop-test.sh` (shell mirror, already synced by d1044afc) + `npx vitest run tests/e2e/fixtures/idipDebug.test.ts` (the scan pin + the `toHaveLength(15)` pin + the pointer round-trip). Live reproduction is the next debug-tail sitting, as with every debug leg.
Author
Member

close-report for #1180 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1180,
  "status": "success",
  "commits": [
    "9c72a8d3"
  ],
  "changed_files": [
    "STATUS.md",
    "app/tests/e2e/fixtures/idipDebug.test.ts",
    "app/tests/e2e/fixtures/idipDebug.ts",
    "app/tests/e2e/journey.idip.debug.spec.ts",
    "app/tests/e2e/journey.idip.spec.ts"
  ],
  "tests": [
    {
      "command": "bash scripts/tests/rehearsal-debug-loop-test.sh",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/e2e/fixtures/idipDebug.test.ts (app)",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/e2e/fixtures/ (app, 296 tests)",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc --noEmit -p tsconfig.json (app)",
      "exit_code": 0
    },
    {
      "command": "npx eslint <changed .ts files> (app)",
      "exit_code": 0
    },
    {
      "command": "OC_E2E_SPEC=journey.idip.debug.spec.ts npx playwright test --list",
      "exit_code": 0
    }
  ],
  "criteria": {
    "The seam red closes (shell mirror stage passes)": "d1044afc already synced REHEARSAL_DEBUG_TAIL_LEGS to 15; rehearsal-debug-loop-test.sh now 13/13 (exit 0)",
    "idipDebug.test.ts toHaveLength pin passes at 15": "idipDebug.test.ts: bumped 11→15 + asserts service-restrict/service-reopen present; 39 tests green",
    "journey.idip.debug.spec.ts runs every declared tail leg (scan pin)": "the four service-access leg bodies added between credential-claim and suspend-readmit; scan pin green in idipDebug.test.ts",
    "the four legs are re-enterable / self-reversing (the healer's open question)": "service-restrict→service-reopen restores the default-open row (filesRestricted toggled back), the steward-pair pattern; ruled deliberately under ADR 0174 on the issue",
    "restricted-nonholder-refused has a non-holder to drive": "StandingWorldPointer gains optional memberPhrase harvested by the prove-it drive (journey.idip.spec.ts writeStandingWorldPointer); leg guard-skips with a ledger reason when a pre-#1180 world carries none"
  },
  "summary": "Closed the debug-tail drift by adding the four ADR 0222 service-access legs to the debug tail (bodies + toHaveLength(15) pin) and giving the refusal leg a non-holder via an optional standing-world memberPhrase; main's seam is green.",
  "reason": "",
  "blockers": []
}
**close-report** for #1180 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1180, "status": "success", "commits": [ "9c72a8d3" ], "changed_files": [ "STATUS.md", "app/tests/e2e/fixtures/idipDebug.test.ts", "app/tests/e2e/fixtures/idipDebug.ts", "app/tests/e2e/journey.idip.debug.spec.ts", "app/tests/e2e/journey.idip.spec.ts" ], "tests": [ { "command": "bash scripts/tests/rehearsal-debug-loop-test.sh", "exit_code": 0 }, { "command": "npx vitest run tests/e2e/fixtures/idipDebug.test.ts (app)", "exit_code": 0 }, { "command": "npx vitest run tests/e2e/fixtures/ (app, 296 tests)", "exit_code": 0 }, { "command": "npx vue-tsc --noEmit -p tsconfig.json (app)", "exit_code": 0 }, { "command": "npx eslint <changed .ts files> (app)", "exit_code": 0 }, { "command": "OC_E2E_SPEC=journey.idip.debug.spec.ts npx playwright test --list", "exit_code": 0 } ], "criteria": { "The seam red closes (shell mirror stage passes)": "d1044afc already synced REHEARSAL_DEBUG_TAIL_LEGS to 15; rehearsal-debug-loop-test.sh now 13/13 (exit 0)", "idipDebug.test.ts toHaveLength pin passes at 15": "idipDebug.test.ts: bumped 11→15 + asserts service-restrict/service-reopen present; 39 tests green", "journey.idip.debug.spec.ts runs every declared tail leg (scan pin)": "the four service-access leg bodies added between credential-claim and suspend-readmit; scan pin green in idipDebug.test.ts", "the four legs are re-enterable / self-reversing (the healer's open question)": "service-restrict→service-reopen restores the default-open row (filesRestricted toggled back), the steward-pair pattern; ruled deliberately under ADR 0174 on the issue", "restricted-nonholder-refused has a non-holder to drive": "StandingWorldPointer gains optional memberPhrase harvested by the prove-it drive (journey.idip.spec.ts writeStandingWorldPointer); leg guard-skips with a ledger reason when a pre-#1180 world carries none" }, "summary": "Closed the debug-tail drift by adding the four ADR 0222 service-access legs to the debug tail (bodies + toHaveLength(15) pin) and giving the refusal leg a non-holder via an optional standing-world memberPhrase; main's seam is green.", "reason": "", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1180
No description provided.