Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b536754
docs(plans): draft plan 20 — self-hosting phase 3
darko-mijic Jul 26, 2026
4871f11
feat(specs): convert the warn-level-signals law to bound executable p…
darko-mijic Jul 26, 2026
fdd501a
feat(specs): convert the referential-integrity and authored-honesty l…
darko-mijic Jul 26, 2026
8a20ed9
feat(specs): convert the claim-separation, verification-linkage, and …
darko-mijic Jul 26, 2026
8aef576
docs(plans): record the S1 validation-family conversions and their ru…
darko-mijic Jul 26, 2026
e2eec7c
feat(specs): convert the excludes, schema-version, ID, and parity law…
darko-mijic Jul 26, 2026
120bea9
docs(plans): record the S2 extraction, model, and carrier conversions
darko-mijic Jul 26, 2026
cee0cf1
feat(specs): convert the codegen, runner, and slot-notation laws to b…
darko-mijic Jul 26, 2026
8ef030e
docs(plans): record the S3 conversions, rulings, and gate in the phas…
darko-mijic Jul 26, 2026
2309c27
feat(specs): mature readiness where a resolving verifier honestly ear…
darko-mijic Jul 26, 2026
a989b14
docs(plans): record the S4 readiness-sweep ledger and close its docke…
darko-mijic Jul 26, 2026
42f008d
docs(decisions): re-point D1 and D2 at their carrying specs
darko-mijic Jul 26, 2026
d5af001
docs(concept): dissolve `03 — The One Graph` into its carrying Specs
darko-mijic Jul 26, 2026
fb1a14a
docs(concept): dissolve `02 — Core Model` into its carrying Specs
darko-mijic Jul 26, 2026
0ff991c
docs(plans): record the five per-doc dissolution audits and the S5 close
darko-mijic Jul 26, 2026
45b031b
docs(reviews): archive the phase-3 pre-close adversarial review
darko-mijic Jul 26, 2026
3d7e7ff
fix(specs): make the concreteness point discriminate and land the car…
darko-mijic Jul 26, 2026
c8a3175
docs(reviews,plans): disposition every review-09 finding and correct …
darko-mijic Jul 26, 2026
11b57af
docs(plans,repo): close self-hosting phase 3 with its done-record and…
darko-mijic Jul 26, 2026
268d1cb
fix(lint): extend the clean-room contract exemption to every bound se…
darko-mijic Jul 26, 2026
42ee038
docs(plans): record the clean-clone proof in the phase-3 close evidence
darko-mijic Jul 26, 2026
b495811
docs(records,glossary): repair the phase-3 close records from externa…
darko-mijic Jul 26, 2026
979a4dd
docs(specs,tests): land the pre-PR review repairs across the phase-3 …
darko-mijic Jul 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ claims; **`src/` and tests** are authoritative evidence of current realization.
> machinery landed (plan 13) · authoring **carrier ruled** as `.sdp.md` (the carrier ruling, MD-18;
> plan 16) — product Markdown parser and self-hosting landed · **canonical-default carrier
> rule:** Specs default to Markdown; Packs remain TS until a Pack syntax ruling; the TS DSL survives
> as import source and a lawful per-ID option. · **what now:** ✅ EXECUTED — phase-2 implementation complete; final audit passed. The prior `EXECUTED — phase-1 implementation complete; final audit passed` status remains historic context. The remaining work is the systematic tests-to-executable-specs rewrite and per-doc concept deletion. Build state lives in
> as import source and a lawful per-ID option. · **what now:** ✅ EXECUTED — phase-3 implementation complete; the pre-close adversarial review is archived with every finding dispositioned. The prior `EXECUTED — phase-1 implementation complete; final audit passed` and phase-2 statuses remain historic context. The systematic tests-to-executable-specs rewrite ran across the cheap laws and the core model dissolved into Specs; the remaining work is the recorded corpus gaps (the lower readiness-floor clause tables, the derived-readiness banner, and the rest) and the concept docs still standing on their own audits. Build state lives in
> **`plans/`** — read the highest
> **primary-numbered** plan's status header, plus any **active subplans it (or its parent family)
> explicitly designates as current**; ignore unnumbered files and letter-suffixed plans only when
Expand Down Expand Up @@ -53,9 +53,9 @@ Progressive disclosure — start at the top, follow the pointers down.

| Look here | What you get | Read |
|---|---|---|
| `CONTEXT.md` (repo root) | **the vocabulary** — the ratified lean glossary (terms · relations · a worked dialogue · flagged ambiguities); sole source of truth for terminology; the model exposition lives in `00`–`07` | **first, always** |
| `CONTEXT.md` (repo root) | **the vocabulary** — the ratified lean glossary (terms · relations · a worked dialogue · flagged ambiguities); sole source of truth for terminology; the model exposition lives in the Specs under `specs/` and in the surviving concept docs | **first, always** |
| `jtbd-stories/` | **the jobs (functional spec)** — stable `When / I want / so I can` stories (themes A–H); no personas, because consumers are heterogeneous (humans, CI, CLIs, **AI agents**) | to know *what* we serve |
| `docs/concept/00`–`07` (+ README) | **the technical design and the model** — 9 principle-led docs: vision & MVP boundary, founding principles (P1–P10), core model (`02` — the primitive, descriptors, sections, relations), the one graph, authoring & binding, validation & honesty, consumers, roadmap | to know *how* it is designed |
| `docs/concept/` (+ README) | **the technical design** — the surviving principle-led docs: vision & MVP boundary, founding principles (P1–P10), authoring & binding, validation & honesty, consumers, roadmap; the core model dissolved into the model Specs (`spec:model.core-model`, `spec:model.spec-sections`, `spec:model.relations`, `spec:model.stable-ids`, `spec:model.pack-aggregate`) and the one graph into the extraction Specs (`spec:extraction.derive-graph`, `spec:extraction.determinism`, `spec:extraction.claim-taxonomy`, `spec:extraction.regenerability`, `spec:extraction.schema-versioning`) | to know *how* it is designed |
| `docs/concept/DECISIONS.md` | **the lean decision registry** — ratified names, one-line glosses, carrying Specs, and the D1–D6 lookup; historical rationale lives in git, plans, and the Specs themselves | when resolving a decision name or following its canonical pointer |
| `src/` | **the engine** — `model` (Spec/descriptors/pack/anchors) · `extract` · `graph` · `validate` · `reader` (agent surface) · `projections` (Design Review) · `cli` (`sdp`) · `runner` / `codegen` / `notation` / `adapters` | when implementing or verifying **current engine** behavior |
| `examples/checkout-v1` | **the worked MVP example** (TS DSL tracer bullet) — specs, anchors, untracked `generated/` (regenerated in-pipeline); walkthrough in its README | when proving the loop end-to-end |
Expand Down
27 changes: 15 additions & 12 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
> **Status: RATIFIED · LEAN GLOSSARY.** The terminology base of the Libar Software Delivery Protocol — our
> bounded context's vocabulary: **one concept → one word**; the rest are *aliases to avoid*.
>
> This document carries **terms only**; the model exposition lives in the design docs
> (`docs/concept/00`–`07`). The lean decision registry points to carrying Specs; historical
> rationale lives in git, plans, and those Specs.
> This document carries **terms only**; the model exposition lives in the authored Specs under
> `specs/` and in the surviving design docs under `docs/concept/`. The lean decision registry
> points to carrying Specs; historical rationale lives in git, plans, and those Specs.

## Governing rubric [SETTLED]

Expand All @@ -28,7 +28,7 @@
Self-hosting — the Protocol's own repo conforming to its own meta-model — is a later milestone, never a
Phase-0 claim (`00` §3).

## The primitive & its descriptors (→ `02` §1–§2)
## The primitive & its descriptors (→ `spec:model.core-model`)

| Term | Definition | Aliases to avoid |
|---|---|---|
Expand All @@ -51,14 +51,14 @@ The familiar delivery nouns are **named coordinates on the one primitive, never
| **Executable Spec** | an `example` that **has a verifier** (a delivery fact) | a readiness rung |
| **capability / domain** | a **projection** (Capability Map over high-altitude `behavior` `Spec`s) and/or a **`Pack` grouping** | a kind or an altitude |

## Sections (→ `02` §3)
## Sections (→ `spec:model.spec-sections`)

| Term | Definition | Aliases to avoid |
|---|---|---|
| **section** | the typed, optional detail-slice of a `Spec` — the **extension surface**; one concern each: `intent` · `behavior` · `constraints` · `model` · `design` · `decision` · `verification` · `ui` | "Facet" · "aspect" |
| **section ⟷ kind duality** | `constraints`/`model`/`decision` — and `behavior.rules`/`behavior.examples` vs the `rule`/`example` kinds — have a `kind` twin: keep **inline** when local detail; **promote** to a standalone `Spec` when shared or needing its own identity/lifecycle/review. **Sections carry content, relations carry linkage** (never a ref inside a section); **promotion is exclusive** (inline XOR promoted — content moves out, MD-10) | — |

## The other authored things (no system truth — → `02` §4, `04` §2)
## The other authored things (no system truth — → `spec:model.pack-aggregate`, `04` §2)

| Term | Definition | Aliases to avoid |
|---|---|---|
Expand All @@ -68,7 +68,7 @@ The familiar delivery nouns are **named coordinates on the one primitive, never
**Two grouping mechanisms, kept distinct:** *refinement* (parent `Spec` → children — authored truth with
descendants) vs *the aggregate* (the `Pack` — a cross-cutting review collection, no truth of its own).

## Claims & the authored/derived split (→ `01`, `03` §3)
## Claims & the authored/derived split (→ `01`, `spec:extraction.claim-taxonomy`)

| Term | Definition | Aliases to avoid |
|---|---|---|
Expand All @@ -81,7 +81,7 @@ descendants) vs *the aggregate* (the `Pack` — a cross-cutting review collectio
No 4th `claim`: an edge computed deterministically from an authored source is a derivation **mechanism, not a
claim category** — it **inherits** its source's `claim` (so `belongsTo` carries `declared`).

## Delivery facts (derived realization signals — → `02` §2)
## Delivery facts (derived realization signals — → `spec:model.core-model`)

| Term | Definition | Aliases to avoid |
|---|---|---|
Expand All @@ -94,7 +94,7 @@ claim category** — it **inherits** its source's `claim` (so `belongsTo` carrie
The payoff queries: `ready ∧ ¬implemented` = the **build backlog**; `implemented ∧ ¬ready` = the **drift
alarm**.

## The graph & extraction (→ `03`)
## The graph & extraction (→ `spec:extraction.derive-graph`)

| Term | Definition | Aliases to avoid |
|---|---|---|
Expand Down Expand Up @@ -141,13 +141,15 @@ validated," never "provably correct."**
| Term | Definition | Aliases to avoid |
|---|---|---|
| **step contract** | a derived, regenerable typed module emitted per `example` spec from the graph (the generated-union pattern): the union of the example's literal step strings; tests bind handlers against it, so spec-side drift is a compile error — derived, never authored, importable *because* it is a projection | importing the authored spec |
| **example space** | the typed parameter vocabulary a parent `behavior` spec's steps declare; the space its child examples bind points in — the sibling set shares one vocabulary | "variables" |
| **example space** | the typed parameter vocabulary a parent spec's steps declare — typically a `behavior` spec; any kind may own the space when the vocabulary parameterizes its own law (`rule` and `model` parents are lawful); the space its child examples bind points in — the sibling set shares one vocabulary | "variables" |
| **parameter slot** (short: **slot**) | one typed placeholder in a step's text | — |
| **bound point** | the concrete slot values an `example` child binds for the steps it uses; partial points are honest — an unbound slot in a *used* step caps the example below `defined` (the **concreteness law**, one structural floor clause) | — |
| **space contract** | the per-parent derived sibling of the step contract: the typed dimensions of the example space, every child's bound point, and the Outcome union derived from the parent's Then vocabulary | — |
| **oracle** | the authored expected-outcome semantics for a parent's example space — implementation-side, beside the tests, bound by the space's zero-or-one resolving `specOracle` anchor, never extracted; typed against the space contract on input and the derived Outcome union on output (`unspecified` is a first-class answer); rendered surfaces say **"expected outcome"** | a `model`-kind spec · a derived fact |
| **witness** | an example whose bound point falls in an outcome class — the evidence that class is covered | — |
| **coverage gap** | a region of the example space with no witness (or where the oracle answers `unspecified`) — an informative absence, never a gate | — |
| **world** | the state a bound point's handlers construct and assert against — built by the Given steps, exercised by the When, read by the Then; created fresh per example by the test adapter (the runner core plans and runs steps, never owns world lifecycle) | "fixture" · "test context" |
| **probe** | a synthetic spec, graph, or repository a world constructs so the law under test is the only thing that can refuse (`spec:probe.*` by convention); probes live inside bound suites and never enter the shipped corpus | "dummy" · "mock" |
| **`sdp import`** | one import verb with many source adapters, sharing the document emitter authored once in the winning carrier; the TS→`.sdp.md` adapter landed, the gen-1 `.feature` adapter designed-in and deferred | round-trip sync |

**Structural law (point-per-example, MD-17):** an `example` binds exactly **one** point; a table of cases is
Expand All @@ -161,7 +163,7 @@ a sibling set back as a table — the graph never holds a multi-point example.
| **carrier** | the text format that carries the authored `Spec` document — the envelope, the prose, and the owned notation; **ruled: Markdown (`.sdp.md`) for all eight kinds**, the TS DSL remaining the import source and a lawful per-ID option (one canonical surface per ID, `04` §1) | "format"/"file type" (say which layer) · a carrier is never a second store |
| **notation** | the Protocol-**owned** typed step language inside the carrier's fenced blocks — Given/When/Then step text and the slot vocabulary; owned by the Protocol whatever the carrier | "grammar" (the dismissed own-language direction) · "DSL" (reserved for the TS DSL) |

## Relations (authored, typed, directed `Spec`→`Spec` edges — → `02` §6)
## Relations (authored, typed, directed `Spec`→`Spec` edges — → `spec:model.relations`)

| Relation | Direction | Means | Industry anchor |
|---|---|---|---|
Expand Down Expand Up @@ -202,7 +204,8 @@ artifact** — approval remains outside the model, never an authored primitive).
division (`01`); a friendlier Studio-facing name is a minor open item.
- **`ref()`** in the DSL is a **spec-only** reference builder wearing a generic name (it rejects
`pack:`/`doc:` targets) — documented on the export (`src/ids.ts`). Consequently `decidedBy` → an
external `doc:` ADR is a **named deferral** (MD-16, stated in `02` §6); revisit when `doc:`-target
external `doc:` ADR is a **named deferral** (MD-16, stated in `spec:decisions.carried-evidence`);
revisit when `doc:`-target
relations or pack-targeting arrive.
- ~~Candidate vocabulary from the executable-spec exploration: *notation* · *carrier*~~ — **ratified
by the carrier ruling (MD-18)**; see **The authoring carrier** above. The rest
Expand Down
28 changes: 17 additions & 11 deletions check-carrier-rule.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@ import { fileURLToPath } from "node:url";
// 2. the obsolete sole-canonical-TS wording gone from the diary and the glossary, and the
// surviving law (one canonical surface per ID, no mixing) still present in the diary;
// 3. the extension-law re-point (the `.sdp.ts` extension law, MD-15) present in the diary;
// 4. the SAME logical/physical relations distinction in the core-model doc and JS-A1:
// relations stay OPTIONAL in the logical Spec; the physical Markdown envelope writes
// `relations: {}` when the logical set is empty — honest carrier syntax, never a new
// logical relation requirement.
// 4. the logical/physical relations distinction present on BOTH surviving surfaces, each in its
// own words — the carrying Spec (the Markdown envelope contract) and JS-A1: relations stay
// OPTIONAL in the logical Spec; the physical Markdown envelope writes `relations: {}` when the
// logical set is empty — honest carrier syntax, never a new logical relation requirement. The
// concept doc that used to hold the JS-A1-verbatim twin dissolved into its carrying Specs, so
// this leg proves co-presence of the law, not verbatim sameness across the two surfaces:
// JS-A1 keeps the verbatim sentence, the Spec states the same law as it authored it.
//
// Usage: node check-carrier-rule.mjs [rootDir]
// rootDir — tree holding the operative surfaces; defaults to this repo root. QA passes a
Expand All @@ -27,7 +30,7 @@ const SURFACES = {
decisions: "docs/concept/DECISIONS.md",
glossary: "CONTEXT.md",
agents: "AGENTS.md",
coreModel: "docs/concept/02-core-model.md",
envelopeContract: "specs/carrier/envelope-contract.sdp.md",
jsA1: "jtbd-stories/01-capture-and-evolve-intent.md",
};

Expand All @@ -37,18 +40,21 @@ const SURFACES = {
const CARRIER_RULE =
"Specs default to Markdown; Packs remain TS until a Pack syntax ruling; the TS DSL survives as import source and a lawful per-ID option";

// The owner-confirmed logical/physical relations distinction. Verbatim in the core-model doc
// and JS-A1.
// The owner-confirmed logical/physical relations distinction. Verbatim in JS-A1.
const RELATIONS_DISTINCTION =
"Relations are optional in the logical `Spec` model. A physical Markdown envelope writes `relations: {}` when the logical set is empty: honest carrier syntax, not a new logical relation requirement.";

// The same law in the carrying Spec's own authored words.
const ENVELOPE_RELATIONS_CLAUSE =
"`relations: {}` is written explicitly when the logical relation set is empty — honest carrier syntax, not a new logical requirement: the physical key catches a truncated envelope at reification while the model itself stays relation-optional.";

const SURVIVING_LAW = "one canonical surface per ID, no mixing";
const OBSOLETE_SOLE_CANONICAL = "stays sole-canonical";
const EXTENSION_LAW_REPAIR = "re-pointed, not repealed";

// Sameness is about WORDS, so markdown quoting furniture is stripped before whitespace
// normalization: a sentence wrapped inside a `>` blockquote (the AGENTS status row, the
// core-model carrier note) must read identically to its plain-paragraph twins.
// normalization: a sentence wrapped inside a `>` blockquote (the AGENTS status row) must read
// identically to its plain-paragraph twins.
const norm = (text) => text.replace(/^>\s?/gm, "").replace(/\s+/g, " ");
const read = (rel) => norm(readFileSync(join(rootDir, rel), "utf8"));

Expand Down Expand Up @@ -88,8 +94,8 @@ expectContains(
"missing the extension-law re-point (the `.sdp.ts` extension law, MD-15)",
);
expectContains(
SURFACES.coreModel,
RELATIONS_DISTINCTION,
SURFACES.envelopeContract,
ENVELOPE_RELATIONS_CLAUSE,
"missing the logical/physical relations distinction",
);
expectContains(
Expand Down
45 changes: 0 additions & 45 deletions check-carrier-truth.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,6 @@ const CLAIMS = [
present: ["The carrier extractors — `ts-morph` (the TS carrier) and the ruled Markdown parser"],
absent: ["| `ts-morph` as the extractor |"],
},
{
file: "docs/concept/03-the-one-graph.md",
label: "derivation diagram names the carrier extractors",
present: ["carrier extractors"],
absent: ["ts-morph extractor"],
},
{
file: "docs/concept/03-the-one-graph.md",
label: "spec discovery covers both carrier suffixes",
present: ["every `*.sdp.ts` and `*.sdp.md` under the extraction root"],
absent: ["every `*.sdp.ts` under the extraction root"],
},
{
file: "docs/concept/03-the-one-graph.md",
label: "the two-tier echo points at the per-carrier asymmetry",
present: ["the per-carrier asymmetry is named at `04` §1"],
absent: [],
},
{
file: "docs/concept/04-authoring-and-binding.md",
label: "intro names two ruled carriers, not exactly two surfaces with an open competition",
Expand Down Expand Up @@ -482,33 +464,6 @@ const RULES = [
category: PLURAL,
},

// 03 — the one graph.
{
file: "docs/concept/03-the-one-graph.md",
includes: "ts-morph for .sdp.ts · the ruled Markdown parser for .sdp.md",
category: PLURAL,
},
{
file: "docs/concept/03-the-one-graph.md",
includes: "every `*.sdp.ts` and `*.sdp.md` under the extraction root",
category: PLURAL,
},
{
file: "docs/concept/03-the-one-graph.md",
includes: '"file": "specs/orders/create-order.sdp.ts"',
category: CHECKOUT_HISTORY,
},
{
file: "docs/concept/03-the-one-graph.md",
includes: "the TS carrier's granularity",
category: STILL_SUPPORTED,
},
{
file: "docs/concept/03-the-one-graph.md",
includes: "(from `ts-morph`)",
category: CODE_LINKAGE,
},

// 04 — authoring & binding.
{
file: "docs/concept/04-authoring-and-binding.md",
Expand Down
Loading
Loading