Spec: first-class claim + authority model (#113) - #117
Conversation
Phase 0/1/2 artifacts: research (10 decisions), data-model (two relations, derived conflict group), contracts, quickstart, 42 tasks. Datalog contradictions rule and the read-time rank join validated against an in-memory CozoDB before implementation. Docs: CLAUDE.md spec-machine section, README vision pointer, MEMORY.md invariants, ROADMAP status. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Plan + tasks pushed. PR now carries the full pre-implementation package. Added
De-risked before writing code: the built-in Docs updated: CLAUDE.md gains a Spec Machine section with the #113–#116 table and the two governing principles; README links the vision doc; ai/MEMORY.md records the invariants later features must not break (notably the 8-column arity coupling #114 will hit); ROADMAP reflects status. Blocked at T023: the |
Blockers: fixture reconciliation for the new builtin rule + version bump is now an explicit human-approved task; concept deletion cascades claims on the edges it removes. Also: trim at write time so conflicts and Datalog agree on what a contradiction is; cascade_claims() covers prune and re-extraction, not just the delete handlers; contradictions rule flags all contradictions, not only unresolved ones; corrected the false claim that builtin rules are syntax-validated at init; claims is an all-key relation, so delete is read-then-rm; tasks reordered tests-first per constitution IV. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Self-review pass (Fable, adversarial) — findings appliedRan an independent adversarial review of the whole package against the codebase. It found real problems. Verified each against the tree before acting; all confirmed. Fixes pushed. Blockers (fixed)B1 — SC-005 was unachievable and the task list dead-ended. A third built-in rule and a schema bump break locked fixtures that pin exact values: B2 — concept deletion would orphan edge-claims. Should-fix (all applied)
Nits (fixed)
VerdictReviewer's call: sound core (schema fits repo precedent, rule matches the |
Constitution 1.0.0 -> 1.1.0. Principle IV unchanged in substance; the review agent is now a Claude subagent (model: fable) instead of the Gemini CLI. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
52 new cases: claims (32), authorities (12), migration (4), rules/query (3), verify (1). Red until Phase 2 - tests first, per constitution IV. Also updates locked fixtures that a third builtin rule and the schema bump necessarily break (verify, rules/list, init, concepts/delete). Flagged for human approval, not folded in silently. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Blockers: pr-verify and edges/delete fixtures were missed in the fixture sweep (both go red on a correct implementation); the prune cascade case could never pass, since prune only removes concepts whose provenance is entirely stale and the setup created none. Adds the coverage that let a wrong implementation through: resolve-tie, resolve across multiple groups, agreement retained, source as part of the identity tuple, conflict filters and group ordering, builtin protection for the new rule, edge-subject validation, trim-before-empty, a numeric pin on claims_removed, and per-relation migration preservation. Contract now pins conflict group ordering and resolve-tie list shape. 19 new claims cases, 3 authorities, 4 migration, 1 rules/query, 3 rules protection/parity. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Round-2 antagonist catch: provenance/create validates the file against body.db, so the stale-provenance setup needs the prune suite's add-then-delete pattern. Without it set -e killed the case outright. Also pins concept-before-edge conflict group ordering. T009 done, tests locked. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Antagonist review done (Fable, two rounds) — tests LOCKEDConstitution amended to 1.1.0 first: the antagonist is now Fable, run as a subagent, not the Gemini CLI. Principle IV is unchanged in substance. Swapped across constitution, Round 1 — 3 blockers, 11 should-fixes
Should-fixes were the holes a wrong implementation slides through: resolve-tie (an implementation breaking ties by lowest id passed everything), resolve treated as a global max instead of per-group, agreement silently deduplicated, Round 2 — one blocker survivedThe prune fix was still wrong: Round 2 otherwise verified every new case: pinned ids match the setup order, orderings match the newly pinned contract rules, key sets satisfy State82 tc cases across claims (52), authorities (15), migration (8), rules (5), verify (2) — red until Phase 2, as intended. Contract now pins conflict group ordering ( Needs your approvalThe locked-fixture updates (research D11): Next: Phase 2 (schema + migration) → Phase 3 (lib) → handlers → CLI → green. |
Schema v1.13.0: claims and authorities relations, five seeded tiers, and a contradictions builtin rule that feeds the existing verify/pr-verify arm. Eight sys.call paths, brane claim / brane authority CLI. Rank is joined at read time so re-ranking a tier never rewrites a claim. Resolution is a projection; ties do not resolve. cascade_claims() is the one deletion seam, called from concepts/delete, edges/delete, prune, and re-extraction so a claim cannot outlive its subject. Fixes a latent bug found on the way: Cozo string literals use backslash escapes, not SQL doubling, so rules/create silently rejected any rule body containing an apostrophe. esc_cozo() in lib/mind.ts now does it correctly. 432 tests pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Implemented. 432/432 tests pass.Phases 2–8 complete against the locked suite. No test was changed after the lock. Schema v1.13.0 — Eight paths:
One bug found on the way, fixed
This surfaced because a locked test asserted a user-defined rule joining Verified live, not just greenThe full quickstart round-trips: 30/14/45 written → all three listed → one conflict group with DocsCLAUDE.md gains a Claims section with the invariants and the Cozo gotcha; ROADMAP marks 067 complete; ai/MEMORY.md records four findings worth keeping (the arity coupling, the escaping rule, provenance validation in tests, and prune's all-stale requirement). |
Closes the spec side of #113. Umbrella: #112. Vision:
dna/product/vision-spec-machine.md(v4.0), principles 1–2.Spec only — no implementation. Human checkpoint #1: review and salt to taste.
What it specifies
A first-class claim: an assertion about a concept or edge, made under a registered authority tier, from a source. Competing claims coexist; resolution is a read-time projection, never a write-time deletion.
The refund scenario from the vision doc is the acceptance test: product=30d, legal=14d, implementation=45d → three claims, one conflict group,
legalas the resolution, all three still present afterward.Design decisions worth arguing about
resolution: null,unresolved: true. No tiebreak by recency or ID.contradictionsrule wires claims into the existing Datalog validator arm soverify/pr-verifycan fail on unresolved contradiction.Deliberately out of scope (kept foundational per constitution VI)
Also in this PR
ROADMAP gains a Spec Machine section tracking #113–#116 as
067–070.Next in the flow
Human approval →
/speckit.plan→/speckit.tasks→ Gemini antagonist review of the tc tests → implement.Note: the
geminiCLI is not installed on this machine; the antagonist review will need it available (or a human stand-in) before implementation starts.🤖 Generated with Claude Code