Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
ebe7571
prepare brief for self-hosting phase 2
darko-mijic Jul 18, 2026
47a1ed1
docs(plan): draft self-hosting phase 2 execution plan
darko-mijic Jul 18, 2026
6cbc4fc
build(check): validate phase 2 gate ledger
darko-mijic Jul 18, 2026
fb686b3
docs(plans): correct fold-target map and coverage ledger in phase-2 plan
darko-mijic Jul 18, 2026
7915b25
docs(plans): confirm the checkout grammar matrix and hardening skelet…
darko-mijic Jul 18, 2026
ed31de6
feat(import): add the pure Markdown document emitter core (envelope +…
darko-mijic Jul 18, 2026
f19ea55
feat(import): emit every ruled section form with prose ownership
darko-mijic Jul 18, 2026
52f94ee
feat(import): add the fs-free TS→Markdown orchestration with import f…
darko-mijic Jul 18, 2026
2f6ceb3
style(import): apply prettier formatting to import test
darko-mijic Jul 18, 2026
b86eb76
feat(import): export the emit/import surface from the package barrel
darko-mijic Jul 18, 2026
f9123f4
feat(cli): add the durable sdp import verb (write-beside, --dry-run) …
darko-mijic Jul 18, 2026
ec0c19f
test(import): add the two-layer round-trip harness under the delta ca…
darko-mijic Jul 18, 2026
53efbcf
fix(cli): loud exclude diagnostics + matcher boundary coverage (revie…
darko-mijic Jul 18, 2026
be64d8f
test(cli): prove the installed package carries sdp import and the bar…
darko-mijic Jul 18, 2026
f06f14d
feat(specs): enrich spec:carrier.sdp-import with its round-trip verif…
darko-mijic Jul 18, 2026
599a5bb
docs(plans): session 1 close — gate G1 accepted (emitter surface)
darko-mijic Jul 18, 2026
566321f
feat(examples): migrate checkout-v1 to the Markdown carrier via sdp i…
darko-mijic Jul 18, 2026
7bab560
style: fix prettier formatting in check-self-hosting-gates.mjs
darko-mijic Jul 18, 2026
36b4f96
docs(examples): rewrite the checkout-v1 walkthrough for the Markdown …
darko-mijic Jul 18, 2026
6093e56
fix(projections): rule and land the Design Review ordering/escaping d…
darko-mijic Jul 18, 2026
df444f2
docs(plans): record session-2 watch-item dispositions and rulings und…
darko-mijic Jul 18, 2026
68cce0a
docs(plans): session 2 close — gate G2 accepted (migration under fire)
darko-mijic Jul 18, 2026
fcd5cef
fix(extract): land the grammar-hardening cluster (review-06)
darko-mijic Jul 18, 2026
f19694d
test(extract): execute the bounded TS↔Markdown refusal-parity matrix
darko-mijic Jul 18, 2026
f71616d
feat(specs): resolve the parser hardening non-claim with pinned parit…
darko-mijic Jul 18, 2026
0bb200a
fix(check-temporal): exclude .omo workspace plans from temporal-token…
darko-mijic Jul 18, 2026
0127d0d
docs(plans): session 3 close — gate G3 accepted (hardening baseline)
darko-mijic Jul 18, 2026
0a06882
feat(carrier): the canonical-default flip — Markdown by default, TS a…
darko-mijic Jul 18, 2026
28896cf
feat(specs): corpus wave 1a — the model subsystem (refine-target mini…
darko-mijic Jul 18, 2026
5a0e6c3
feat(specs): corpus wave 1b — validation parent + consumers (refine-t…
darko-mijic Jul 18, 2026
fef216f
docs(plans): verify fold targets; shed the pack's phase-1 framing
darko-mijic Jul 18, 2026
abd62fd
docs(decisions): amend the reserved decision-spec namespace to spec:d…
darko-mijic Jul 18, 2026
3bcfa45
feat(specs): the decision fold — carrier/extraction cluster (MD-14/15…
darko-mijic Jul 18, 2026
99df672
feat(specs): the decision fold — model/phase cluster (MD-1/2/4/5/7/10…
darko-mijic Jul 18, 2026
2e9d5a6
docs(decisions): remove the nine folded diary bodies from DECISIONS.md
darko-mijic Jul 18, 2026
095f4bf
feat(specs): the decision fold — D3/D5/D6 + verification dispositions
darko-mijic Jul 18, 2026
b471189
docs(decisions): shrink DECISIONS.md to the lean registry; land the r…
darko-mijic Jul 18, 2026
8f5aabe
feat(specs): land corpus waves 2-4, fold completion, and docket recon…
darko-mijic Jul 18, 2026
67cfda7
docs(reviews): archive the phase-2 adversarial review with verified r…
darko-mijic Jul 18, 2026
ea783ce
docs(plans): whole-phase close — gate G8 accepted; plan 18 executed
darko-mijic Jul 19, 2026
2a91888
docs(plans): reconcile canonical plan 18 with executed state and upda…
darko-mijic Jul 19, 2026
f8648c4
docs(plans): mark final verification wave F1–F4 complete
darko-mijic Jul 19, 2026
1a28b5b
docs(plans): archive the phase-2 execution plan durably; clear tempor…
darko-mijic Jul 19, 2026
e45e52e
docs(reviews): archive the pre-merge branch review (08) and index rev…
darko-mijic Jul 19, 2026
9268adf
fix(cli): dedupe import sources by physical dev+ino identity
darko-mijic Jul 19, 2026
53b5e04
docs(evidence): record import dedupe remediation
darko-mijic Jul 19, 2026
d737935
fix(extract): define author-controlled keys as own properties (Markdo…
darko-mijic Jul 19, 2026
9394b33
fix(cli): fail the import batch only on error-severity findings
darko-mijic Jul 19, 2026
516e700
fix(cli): preserve successful imports when temp cleanup fails; docume…
darko-mijic Jul 19, 2026
db07f7a
fix(projections): escape pipes and collapse whitespace in findings-ta…
darko-mijic Jul 19, 2026
f2fd3f4
docs(notepad): record findings-table rendering learning
darko-mijic Jul 19, 2026
d224b5c
fix(extract): define author-controlled keys as own properties (TS car…
darko-mijic Jul 19, 2026
e50cb16
docs(model): align anchors Spec with the builder-trust ruling; honest…
darko-mijic Jul 19, 2026
8f951c5
fix(extract): reserve camel hasVerifier in the TS carrier (R-6 parity)
darko-mijic Jul 19, 2026
eadbfb0
chore: land remaining plan-19 product surface for a clean preflight gate
darko-mijic Jul 19, 2026
2013b26
docs(plans): record that plan-19's gate ran with remediation files st…
darko-mijic Jul 19, 2026
292901a
fix(check): exclude ignored agent workspace from temporal guard
darko-mijic Jul 19, 2026
c9fd007
style(check): format ignored-workspace temporal guard
darko-mijic Jul 19, 2026
329dbe5
fix(preflight): rerender generated trees at trusted package identity
darko-mijic Jul 19, 2026
8c8e4bd
fix(extract): retain author-controlled keys through graph serializati…
darko-mijic Jul 19, 2026
b022468
docs(evidence): append full GREEN vitest transcripts for Momus audit
darko-mijic Jul 19, 2026
e8b7b47
chore(repo): untrack the ignored agent workspace and drop its guard e…
darko-mijic Jul 25, 2026
d469b24
fix(preflight): restore the relocation-independent clean room
darko-mijic Jul 25, 2026
34e588d
docs(reviews,plans): record the review-08 docket as closed on this br…
darko-mijic Jul 25, 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
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ generated/
# The ruled carrier grammar owns these bytes; Prettier rewrites can break its grammar
# and fixture↔live byte-parity
*.sdp.md

# Refusal-parity carriers are intentionally malformed inputs read as text by the reifiers.
test/fixtures/import/parity/
12 changes: 5 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ claims; **`src/` and tests** are authoritative evidence of current realization.

> **Status:** concept ratified · MVP slices 0–5 landed on `main` (plan 10) · post-MVP executable
> machinery landed (plan 13) · authoring **carrier ruled** as `.sdp.md` (the carrier ruling, MD-18;
> plan 16) — product Markdown parser and self-hosting landed · **interim carrier
> rule** (the carrier ruling (MD-18), transition clause amended by plan 17): New spec IDs may be
> born Markdown-canonical once the product parser lands; pre-existing IDs and the worked example
> remain TS-canonical until the ruled flip (the product parser, `sdp import`, and the checkout-v1
> migration) · **what now:** ✅ EXECUTED — phase-1 implementation complete; final audit passed. Build state lives in
> 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
> **`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 @@ -58,7 +56,7 @@ Progressive disclosure — start at the top, follow the pointers down.
| `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** |
| `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/DECISIONS.md` | **the why-log** for building the Protocol itself (the ratified-name registry + the MD-series, the R-series, the legacy D1–D6 shorthand, measured evidence) — rationale + open tensions | when a choice looks arbitrary |
| `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 |
| `explorations/` | **evidence only** (carrier exhibits, executable-example findings) — mapping evidence for design; **never promote spike code into product** | when judging design evidence; not a source tree to ship |
Expand Down Expand Up @@ -95,7 +93,7 @@ live work is the highest primary-numbered plan under `plans/` (currently the sel
| **5** | Polish: the CLI surface resolved (`build` · `validate` · `view`; `explain`/`search` below the second-caller bar), one diagnostic rendering rule, the documented example walkthrough, the clean-repo determinism test. |

> **Tracer-bullet discipline.** Author the example specs and anchored code *first*, so the DSL and extractor are
> forced to be usable before they are finished. If the example doesn't typecheck, fix the DSL — not the example.
> forced to be usable before they are finished. If the example stops extracting or validating, fix the carrier or extractor — not the example.

## Two reading conventions

Expand Down
23 changes: 11 additions & 12 deletions CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
> 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`), rationale in `docs/concept/DECISIONS.md`.
> (`docs/concept/00`–`07`). The lean decision registry points to carrying Specs; historical
> rationale lives in git, plans, and those Specs.

## Governing rubric [SETTLED]

Expand Down Expand Up @@ -147,7 +148,7 @@ validated," never "provably correct."**
| **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 | — |
| **`sdp import`** | the one-way gen-1 `.feature` converter: parser half carrier-neutral, document emitter authored once in the winning carrier | round-trip sync |
| **`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
authoring-surface sugar that statically expands to N sibling examples at extraction, and renderers may project
Expand Down Expand Up @@ -179,7 +180,7 @@ manifest). **Dropped:** `exemplifies` (= `example` kind + `refines` + `verifies`
**discipline** (a lens/filter over the graph, not a phase you pass through) · **phase / iteration /
milestone** (descriptive vocabulary, optional roadmap projections, never gates) · **release** (a tagged set —
a git-tag projection) · **baseline** (a named approved snapshot; the **signed git tag is the approval
artifact** — approval provenance is git-native, never an authored primitive).
artifact** — approval remains outside the model, never an authored primitive).

## A worked dialogue (the language in use)

Expand Down Expand Up @@ -232,15 +233,13 @@ artifact** — approval provenance is git-native, never an authored primitive).
checks are **conformance checks + honesty checks** · **pre-graph** = upstream of graph derivation in the
one validation path (the authored layer before the extractor runs) — a layer checks never live in:
validators consume the one graph only, never a second validation path (one validation path, MD-14).
- **Resolved (MD-15):** authored Spec files carry the **`.sdp.ts`** extension (never `.spec.ts`, which every
JS test-runner default glob executes); the model name `Spec` itself was always settled — only the file
serialization changed.
- **Resolved (the carrier ruling, MD-18; transition clause amended by plan 17):** the authored `Spec`
document is **`.sdp.md`** — the Markdown carrier, all eight kinds. New spec IDs may be born
Markdown-canonical once the product parser lands; pre-existing IDs and the worked example remain
TS-canonical until the ruled flip (the product parser, `sdp import`, and the checkout-v1 migration).
The surviving law is **one canonical surface per ID, no mixing** (`04` §1); the `.sdp.ts` extension
law (MD-15) is re-pointed, not repealed — its rationale carries to the `.sdp.md` sibling.
- **Resolved (MD-15):** Markdown Spec files use the **`.sdp.md`** extension by default; **`.sdp.ts`**
identifies the lawful TypeScript carrier without colliding with every JS test-runner's default glob.
The model name `Spec` itself was always settled — only the file serialization changed.
- **Resolved (the carrier ruling, MD-18):** 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 surviving law
is **one canonical surface per ID, no mixing** (`04` §1); the `.sdp.ts` extension law (MD-15) is
re-pointed, not repealed — its rationale carries to the `.sdp.md` sibling.
- **Resolved (the prose-ownership law, MD-19):** free prose enters the graph as **description values on
typed owners** — the owning section or the `Spec` itself (the spec-level narrative slot); never a
heading-path store, never a file-only pointer; the edge-text ownership rule is the surface-design
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Libar Software Delivery Protocol

Libar Software Delivery Protocol is a typed, executable, self-validating meta-model of software
delivery: author `Spec` documents in the repository, derive one graph, and check conformance and
honesty.

**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.

Read the [concept](docs/concept/README.md), the [ubiquitous language](CONTEXT.md), and the
[checkout-v1 walkthrough](examples/checkout-v1/README.md).
48 changes: 14 additions & 34 deletions check-carrier-interim.mjs → check-carrier-rule.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,26 @@ import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

// check-carrier-interim — the structured consistency gate for the interim carrier rule (the
// carrier ruling (MD-18), transition clause amended by the self-hosting plan).
// check-carrier-rule — the structured consistency gate for the canonical-default carrier rule
// (the carrier ruling, MD-18).
//
// Asserts, and NAMES each disagreeing surface on failure:
// 1. the SAME interim-rule sentence in the three current-rule surfaces (the decision diary,
// the glossary, the agent handbook): new IDs may be born Markdown-canonical once the
// product parser lands, while pre-existing IDs and the worked example stay TS-canonical
// until the ruled flip — the canonical flip/import/migration is NOT claimed complete;
// 1. the SAME post-flip rule sentence in the three current-rule surfaces (the decision diary,
// the glossary, the agent handbook): 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;
// 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;
// 5. every obligation row the self-hosting phase added to its docket.
// logical relation requirement.
//
// Usage: node check-carrier-interim.mjs [rootDir] [planFile]
// Usage: node check-carrier-rule.mjs [rootDir]
// rootDir — tree holding the operative surfaces; defaults to this repo root. QA passes a
// temp tree of mutated copies to prove disagreeing surfaces are named.
// planFile — the docket file, relative to rootDir. The default is assembled in parts so this
// durable tracked file carries no numbered plan-path token (check-temporal bans
// those from tracked files).

const rootDir = process.argv[2] ?? dirname(fileURLToPath(import.meta.url));
const planFile = process.argv[3] ?? ["plans", "17-self-hosting-v1.md"].join("/");

const SURFACES = {
decisions: "docs/concept/DECISIONS.md",
Expand All @@ -37,11 +31,11 @@ const SURFACES = {
jsA1: "jtbd-stories/01-capture-and-evolve-intent.md",
};

// The one interim carrier rule. Verbatim (modulo whitespace) in the diary, the glossary, and
// the agent handbook — never paraphrased per surface. The trailing period is surface-local
// The canonical-default rule. Verbatim (modulo whitespace) in the diary, the glossary, and the
// agent handbook — never paraphrased per surface. The trailing period is surface-local
// punctuation (the AGENTS status row continues with its `·` separator), so it is not asserted.
const INTERIM_RULE =
"New spec IDs may be born Markdown-canonical once the product parser lands; pre-existing IDs and the worked example remain TS-canonical until the ruled flip (the product parser, `sdp import`, and the checkout-v1 migration)";
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.
Expand All @@ -52,16 +46,6 @@ 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";

const DOCKET_ROWS = [
"Public/package API proof",
"Temporal-scan coverage",
"Root generated-state isolation",
"Clean-clone proof",
"JTBD carrier repair",
"MD-15 wording repair",
"Four-gate review ledger",
];

// 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.
Expand All @@ -81,7 +65,7 @@ const expectOmits = (surface, needle, why) => {
};

for (const surface of [SURFACES.decisions, SURFACES.glossary, SURFACES.agents]) {
expectContains(surface, INTERIM_RULE, "missing the interim carrier-rule sentence");
expectContains(surface, CARRIER_RULE, "missing the canonical-default carrier-rule sentence");
}
expectContains(
SURFACES.decisions,
Expand Down Expand Up @@ -113,17 +97,13 @@ expectContains(
RELATIONS_DISTINCTION,
"missing the logical/physical relations distinction",
);
for (const row of DOCKET_ROWS) {
expectContains(planFile, row, `docket obligation missing: ${row}`);
}

if (failures.length > 0) {
console.error("check-carrier-interim — disagreeing surfaces:\n");
console.error("check-carrier-rule — disagreeing surfaces:\n");
console.error(failures.join("\n"));
process.exit(1);
}

console.log(
"check-carrier-interim — all surfaces agree: interim carrier rule, relations distinction, docket obligations.",
"check-carrier-rule — all surfaces agree: canonical-default carrier rule and relations distinction.",
);
process.exit(0);
Loading
Loading