Skip to content

SPEC-05: knowledge service & encoding discipline (Stage 1 build)#15

Merged
IanMayo merged 2 commits into
mainfrom
claude/specs-review-3yxirx
Jul 12, 2026
Merged

SPEC-05: knowledge service & encoding discipline (Stage 1 build)#15
IanMayo merged 2 commits into
mainfrom
claude/specs-review-3yxirx

Conversation

@IanMayo

@IanMayo IanMayo commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Implements SPEC-05 (build-plan Stage 1) by executing specs/005-knowledge-service/tasks.md TDD-first, on a fresh branch from main after PR #13 (the register batch 3 + Stage-1 planning) merged. Closes #10.

What's built

Module Role
src/seam.ts Refusal / Delta / WriteResult / LintWarning — refusals are first-class values, not thrown errors (seam §1)
src/deltas.ts DeltaLog — exactly one delta per act; injected clock (the at field is display-only, never hashed — DEC-17/G1)
src/encoding.ts the §9 firewall (pure): assumption+hard_constraintencoding_violation; reported/assessed+hard_constraintwaiver_required; scenario_weight never a constraint/cost
src/lint.ts confidence→band-width floor from research note 01 (low 0.25 / moderate 0.10 / high 0), warning-level, midpoint-free
src/knowledge.ts KnowledgeService: create / supersede / contest / resolve / exposure; effectiveStatus + isCompilable
src/components/refusalBanner.ts, s1Table.ts pure projection renderers; band pill + provenance chip reused; no bare assessed scalar (G2)

Stage-1 exits demonstrated on Meridian

  • K10 refused encoding_violation — nothing persisted (0 objects / 0 edges / 0 deltas). The demo moment: "the system declines laundered judgement."
  • K8 waiver visible with single-source marking; drop the waiver → waiver_required.
  • K9 supersedes K5 — exactly {K5} staled, cross-lineage edge, one delta.
  • K12a/K12b contestedisCompilable false until resolve names a survivor (Stage-1 half of G5).

Rendered live in the fixture-backed gallery (npm run gallery) — the S1 table with the refusal banner, blocking flag, waiver chip, and lint cautions.

Two build refinements from the plan (documented in tasks.md/spec)

  • Lifecycle status is edge-derived (effectiveStatus) rather than mutated onto immutable content-addressed objects — a supersedes edge stales the prior, a contests edge makes both contested (DEC-21: "staleness is a trace walk").
  • The waives edge is a compile-time artefact (seam §4); create records the waiver inline and retrievable rather than fabricating a self-referential edge.

Contract-defect correction (DEC-22 discipline)

K10 was assessed in the fixture and vignette §5, yet refused encoding_violation — impossible under the §9 firewall (assessed→waiver_required; only assumptionencoding_violation). §9's own "K10, K8, K12, K5 respectively" note already pairs K10 with the encoding_violation row. Corrected K10 to assumption in fixtures/knowledge.json and docs/assay-vignette.md, keeping the demo intact and K8 as the sole waiver exemplar. Confirmed with you before changing the frozen vignette.

Validation

npm run typecheck clean · npm test 89 passed · npm run gallery regenerated · npm run bench unaffected.

🤖 Generated with Claude Code

https://claude.ai/code/session_015AJq2cV6gzdbKRAEQHNeuJ


Generated by Claude Code

claude added 2 commits July 12, 2026 09:57
…age 1)

Executes specs/005-knowledge-service/tasks.md TDD-first. All four Stage-1
exits demonstrated on Meridian; 89 tests pass, typecheck clean.

Service & discipline:
- src/seam.ts — Refusal/Delta/WriteResult/LintWarning (first-class refusals)
- src/deltas.ts — DeltaLog: one delta per act, injected clock (at is display-only)
- src/encoding.ts — §9 firewall: assumption+hard_constraint→encoding_violation,
  reported/assessed+hard_constraint→waiver_required, scenario_weight firewall
- src/lint.ts — confidence→band-width floor (research note 01), warning-level
- src/knowledge.ts — create/supersede/contest/resolve/exposure; lifecycle status
  is edge-derived (effectiveStatus) over immutable objects (DEC-21); isCompilable
  is the single G5 truth
- src/components/{refusalBanner,s1Table}.ts — pure projection renderers; band pill
  + provenance chip reused; no bare assessed scalar (G2)

Stage-1 exits: K10 refused encoding_violation (nothing persisted); K8 waiver +
single-source visible, waiver-less → waiver_required; K9 supersedes K5 (exactly
{K5} staled, cross-lineage); K12a/K12b contested → isCompilable false until resolve.
The demo moment renders in the fixture-backed gallery (npm run gallery).

Two build refinements from the plan, documented in tasks.md/spec:
- lifecycle status edge-derived, not mutated onto content-addressed objects
- the waives edge is a compile-time artefact (seam §4); create records the
  waiver inline and retrievable rather than fabricating a self-edge

Contract-defect fix (DEC-22 discipline): K10 was fixture/vignette `assessed` yet
refused `encoding_violation` — impossible under §9 (assessed→waiver_required).
Corrected K10 to `assumption` in fixtures + vignette §5 so encoding_violation is
correct and K8 remains the sole waiver exemplar (per the §9 "respectively" mapping).

Closes #10

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015AJq2cV6gzdbKRAEQHNeuJ
@IanMayo IanMayo merged commit 6b4c095 into main Jul 12, 2026
2 checks passed
@IanMayo IanMayo deleted the claude/specs-review-3yxirx branch July 13, 2026 06: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.

Stage 1: research note 01-knowledge.md, then SPEC-05 via spec-kit

2 participants