SPEC-05: knowledge service & encoding discipline (Stage 1 build)#15
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements SPEC-05 (build-plan Stage 1) by executing
specs/005-knowledge-service/tasks.mdTDD-first, on a fresh branch frommainafter PR #13 (the register batch 3 + Stage-1 planning) merged. Closes #10.What's built
src/seam.tsRefusal/Delta/WriteResult/LintWarning— refusals are first-class values, not thrown errors (seam §1)src/deltas.tsDeltaLog— exactly one delta per act; injected clock (theatfield is display-only, never hashed — DEC-17/G1)src/encoding.tsassumption+hard_constraint→encoding_violation;reported/assessed+hard_constraint→waiver_required;scenario_weightnever a constraint/costsrc/lint.tssrc/knowledge.tsKnowledgeService: create / supersede / contest / resolve / exposure;effectiveStatus+isCompilablesrc/components/refusalBanner.ts,s1Table.tsStage-1 exits demonstrated on Meridian
encoding_violation— nothing persisted (0 objects / 0 edges / 0 deltas). The demo moment: "the system declines laundered judgement."waiver_required.{K5}staled, cross-lineage edge, one delta.isCompilablefalse untilresolvenames 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)effectiveStatus) rather than mutated onto immutable content-addressed objects — asupersedesedge stales the prior, acontestsedge makes both contested (DEC-21: "staleness is a trace walk").waivesedge is a compile-time artefact (seam §4);createrecords the waiver inline and retrievable rather than fabricating a self-referential edge.Contract-defect correction (DEC-22 discipline)
K10 was
assessedin the fixture and vignette §5, yet refusedencoding_violation— impossible under the §9 firewall (assessed→waiver_required; onlyassumption→encoding_violation). §9's own "K10, K8, K12, K5 respectively" note already pairs K10 with theencoding_violationrow. Corrected K10 toassumptioninfixtures/knowledge.jsonanddocs/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 typecheckclean ·npm test89 passed ·npm run galleryregenerated ·npm run benchunaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_015AJq2cV6gzdbKRAEQHNeuJ
Generated by Claude Code