1.6 KiB
1.6 KiB
Tasks: error-spec-tightening
1. Code fix
- 1.1 Replace one-level
redactContextwith recursiveredactValueinsrc/serialize/to-json.ts. Walks objects + arrays, cycle-safe viaWeakSet. PublictoJSONsignature unchanged.
2. Spec delta
- 2.1 Author
specs/error/spec.mddelta:## MODIFIED Requirements(Zero workspace and runtime dependencies, Lossless wire serialization, Cause-chain traversal, Redaction at the serialization boundary) +## ADDED Requirements(TruncatedCause sentinel, Wire format version discriminator). - 2.2 Add
**Verified by:**line to every requirement in the live spec.
3. Conformance test
- 3.1 Add
packages/core/error/src/conformance.spec-conformance.test.tspinning:- Recursive redaction:
Sensitive<T>inside nested objects + arrays becomes"[REDACTED]". - TruncatedCause sentinel emitted when
maxDepthis exceeded. - TruncatedCause sentinel emitted when a cycle is detected during
toJSON. __suaveplanError: 1discriminator preserved throughtoJSON→fromJSON.- Cycle-safety: redaction does not loop on circular context.
- Recursive redaction:
4. Gate
- 4.1
bunx turbo lint typecheck test --filter=@suaveplan/errorgreen. - 4.2
bunx turbo test:coverage --filter=@suaveplan/error100/100/100/100. - 4.3
bun scripts/openspec-conformance.ts @suaveplan/errorexits 0.
5. Fold + archive
- 5.1 Fold delta into
openspec/specs/error/spec.md. - 5.2 Move
openspec/changes/error-spec-tightening/toopenspec/archive/2026-04-27-error-spec-tightening/. - 5.3 Re-run gates after fold.