Skip to content

docs: check in CLAUDE.md, refreshed against the current tree - #100

Merged
stormer78 merged 1 commit into
mainfrom
docs/refresh-claude-md
Jul 19, 2026
Merged

docs: check in CLAUDE.md, refreshed against the current tree#100
stormer78 merged 1 commit into
mainfrom
docs/refresh-claude-md

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

CLAUDE.md was untracked — every contributor had their own copy, or none. This checks it in and corrects what had gone stale.

Why it needed correcting

Its named defects are the parts most likely to be trusted verbatim, and all three had been fixed:

Rule Said Reality
R3.7 consentRequiredFrom matches a code the VTA never emits Fixed — matches details.reason
R1.5 inbound session schedules one 2s retry from onClose Fixed on the worker path (#88) and the approver inbox (#97)
R1.2 handleApiGet/handleApiPost hangs the page for minutes Fixed in #88; it is now the compliant reference

A doc that points at already-fixed bugs sends the next person hunting for them, and — worse — implies the remaining problems are covered.

Each stale example is replaced with the invariant that actually bites now:

The one genuinely open defect

Promoted R1.6 persist-before-ack to its own section, since it is the only live one and is not fixable from this repo: vti-didcomm-js acks before dispatching to onMessage, and the wallet persists only the message id — so an offscreen teardown mid-prompt loses a task-consent/request permanently. Needs a library change or disabling auto-ack, and affects pnm-relay too (R4.1).

New: repo mechanics

The traps that actually cost time this week, so they cost the next person nothing:

  • build core before typechecking dependents — each workspace typechecks against gitignored dist, and a stale one produces phantom errors in correct source
  • lint is tsc -b, never tsc -b --noEmit (TS6310 when a referenced composite project must emit)
  • no cross-workspace import without the matching references entry
  • what CI asserts, including the MV3 single-bundle / no-import() invariant
  • stub with real Response objects, not { ok, json } literals
  • Node unrefs the AbortSignal.timeout timer — passes locally, fails in CI as "Promise resolution is still pending"

Verification

Docs only — no code changed. CI runs anyway; lint/build/test are unaffected.

Worth a read rather than a rubber-stamp: it now asserts things about the codebase, and I'd rather you catch anything I've overstated.

CLAUDE.md was untracked, so every contributor had their own copy or none.
Checks it in, and corrects the parts that had gone stale — its named defects
were the ones most likely to be trusted verbatim, and all three were fixed:

- R3.7's `consentRequiredFrom` example was fixed (it now matches
  `details.reason`). Replaced with the rule that actually bites now: a
  Response body reads once, so an already-parsed body must use
  `errorFromBody`, not a re-read of the spent Response (#99).
- R1.5's "one 2s retry from onClose" applied to the worker inbound path
  (fixed in #88) and then to the approver inbox (fixed in #97). Replaced with
  the invariant — cap the delay not the attempt count, re-arm on every
  failure including first-connect — and a pointer to `ReconnectScheduler`.
- R1.2's `handleApiGet`/`handleApiPost` example was fixed in #88 and is now
  the compliant reference. Replaced with the thing that actually hides these:
  fetch is injected, so `grep "fetch("` finds almost nothing and the timeout
  belongs at the injection point (#98).

Promotes the one genuinely open defect to its own section: R1.6
persist-before-ack, which is not fixable from this repo — vti-didcomm-js acks
before dispatching to `onMessage`, and the wallet persists only the message
id, so an offscreen teardown mid-prompt loses a task-consent request for good.

Adds a repo-mechanics section for the traps that cost time this week: build
`core` before typechecking dependents, lint is `tsc -b` (never `-b --noEmit`,
TS6310), cross-workspace imports need a `references` entry, what CI asserts,
stub with real `Response` objects, and Node unreffing the `AbortSignal.timeout`
timer (passes locally, fails in CI).

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 merged commit 4586a7f into main Jul 19, 2026
3 checks passed
@stormer78
stormer78 deleted the docs/refresh-claude-md branch July 19, 2026 05:22
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.

1 participant