JIT: Parse-once /
unknown/ brands at the edge. Unresolved → this file only.
SSOT for untrusted → trusted domain values. Code: config/eslint/plugin-harness/boundary.ts · brands: lib/types/branded/README.md · thesis: parse, don’t validate.
wire / CLI / env / JSON / HTTP
→ BOUNDARY (parse* · decode* · is* · unknown OK)
→ INTERIOR (brands / domain types only — no unknown args, no re-decode)
unknown / decode OK)| Kind | SSOT |
|---|---|
| Paths | BOUNDARY_PATH_RE — lib/types/branded/**, **/boundary|wire|ingress/**, *boundary|wire|ingress*.ts, lib/security/r2-credentials.ts |
| Names | BOUNDARY_FN_NAME_RE — parse* · decode* · assert* · is* · from* · *FromUnknown|Wire|Json|Env |
| Guards | (v: unknown) => v is T |
| Ban | Prefer |
|---|---|
function f(x: unknown) |
brands / concrete types |
decodeUnknown* mid-stack |
call named parse* at the edge |
bare sessionId: string |
SessionId + parse* / as* / try* |
| Rule | Severity |
|---|---|
harness/no-decode-unknown-outside-boundary |
error |
harness/no-unknown-function-param |
warn harness · error types/security/core/boundary |
branded-id-check --staged --strict |
error on new bare *Id / opaque id without // brand-ok |
bun run lint:harness
bun tools/branded-id-check.ts --staged --strict
bun tools/harness-violations.ts --path lib --rule unknown
Suppress only with reason: // brand-ok or targeted eslint-disable on a true edge.
unknown/JSON only on parse* / boundary path / type guarddecodeUnknownSync outside the edgeSpine parse examples: parseImageEvidenceMeta / isImageEvidenceMeta in lib/image-metadata.ts — wire JSON → ImageEvidenceMeta (TEST-003 evidence) via parse* / is* name rules; no extra path allowlist.
Package imports ≠ wire: IMPORT_BOUNDARIES.md. Install ≠ wire: UNIFIED.md.