Self-hosting phase 1: the Protocol's own specs in the ruled Markdown carrier - #10
Merged
Merged
Conversation
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Amend the carrier ruling (MD-18) transition clause so new spec IDs may be born Markdown-canonical once the product parser lands, while pre-existing IDs and the checkout-v1 worked example remain TS-canonical until the ruled flip (product parser + sdp import + migration); mirror the same interim sentence in the CONTEXT resolved entry and the AGENTS status row. Re-point the .sdp.ts extension law (MD-15) to the .sdp.md sibling, record the logical/physical relations distinction in the core-model carrier note and JS-A1, and add the self-hosting docket obligations. check-carrier-interim.mjs is the structured consistency gate for these surfaces. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
… body content Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…light Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…ing ID Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
…trix Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Vitest accepts substring, ./-prefixed, and absolute file filters, but the wrapper matched only the first, so the other spellings bypassed both the contract preflight and the dedicated test/cli.test.ts split. Filters are now normalized to the repository-relative form before matching, and every pooled run fingerprints the repository-root generated/ tree so a pooled test that mutates it fails loudly instead of racing the dedicated pass. Claude-Session: https://claude.ai/code/session_01Ep4BhdFboMXj1ZyfMXd8CN
The review-06 addendum records the live re-verification of every high and medium finding at the executed phase-1 state, the disposition of the low tail, and the two residual wrapper notes now closed by the preceding fix. Claude-Session: https://claude.ai/code/session_01Ep4BhdFboMXj1ZyfMXd8CN
Byte-for-byte copies of the two orchestrator-held execution plans (.omo state is periodically deleted): the session-1 bootstrap plan behind plan 01, and the four-session self-hosting execution plan behind plan 17. Claude-Session: https://claude.ai/code/session_01Ep4BhdFboMXj1ZyfMXd8CN
The archived orchestrator plan executes plan 01 (the phase-0 bootstrap), not the plan-17 self-hosting effort, so the letter suffix belongs to 01. Claude-Session: https://claude.ai/code/session_01Ep4BhdFboMXj1ZyfMXd8CN
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.
What this is
Until this branch, the Protocol validated an example (the checkout-v1 tracer bullet) but described itself only in prose — eight concept documents, a decision diary, a glossary. This phase turns the product's own thesis back on the product: the Protocol's delivery model is now authored as typed
Specdocuments in the ruled.sdp.mdcarrier, extracted into the same one graph, checked by the same conformance and honesty validators, and rendered by the same Design Review projection that consumers get. The repo's ownnpm run checknow fails if the Protocol's specs about the Protocol stop being honest.Getting there forced the carrier ruling (MD-18) out of the exhibit stage and into product code: a real Markdown parser, a public carrier seam, prose carried in the graph, and an executable spec whose generated contract binds a real test against the real extractor. Every syntax question the corpus forced was ruled and recorded; every one it didn't force stays an explicitly named watch item rather than speculative surface.
The work ran as four owner-gated sessions (schema freeze → corpus and readiness → executable loop → decisions, rendering, and the repository gate), each closed by a Design Review over the generated view, followed by an archived adversarial code review with a verified remediation pass. The full plan, its docket ledger, and the gate record live in
plans/17-self-hosting-v1.md.What landed
The Markdown carrier, product-grade and deliberately bounded.
.sdp.mddiscovery beside.sdp.ts; a bounded YAML frontmatter envelope (exactyaml@2.9.0pin, strict acceptance subset, resource limits, reserved derived vocabulary refused — Markdown is never an honesty bypass) and an owned line-based body grammar (ruled heading → section map,gwt/gwt-vocabularyfences reusing the one notation parser).extract/invalid-frontmatter,extract/invalid-markdown-structure,extract/unrecognized-heading,extract/unowned-prose), excluding only the offending carrier while healthy siblings continue. The grammar is corpus-scoped by design — full refusal parity with the TS carrier is explicitly not claimed and is pinned as a phase-2 obligation.CarrierReificationwithreifyTypeScriptCarrier/reifyMarkdownCarrier, andderiveGraphpromoted to the package root — verified on source, built output, and an installed tarball.Prose in the graph (the prose-ownership law, MD-19). Spec-level narrative and per-section descriptions are first-class graph content with deterministic ownership rules; unowned prose refuses loudly. Graph schema bumps to
0.4.0with fixed key positions; the only checkout-v1 golden diff is the recorded version-driven lines. The Design Review renders prose strictly from graph data.The self-hosting corpus. Fifteen Markdown-canonical specs under
specs/(carrier, extraction, validation, model, protocol, decisions domains) pluspack:self-hosting-v1— every readiness rung stated only where its floor honestly clears, with precise inline anchors on the real entrypoints soimplementedandhas-verifierare derived, never authored.The executable tracer.
spec:validation.duplicate-idsdeclares a typed example space; itsexamplechild binds one point;sdp buildgenerates the step contracts under the repo's own untrackedgenerated/; abindExampletest drives the real extractor over dual-carrier fixtures and carries a test anchor — sohas-verifieris earned in the graph, not merely claimed by a green run. Spec-side edits redden the test: the drift alarm now works for the Protocol's own specs.Extraction-root exclusions (the strict consumer-exclusion contract, MD-20). Repeatable
--excludeon every extracting CLI leg with root-relative path-prefix semantics, unioned with the fixed tooling excludes — required so the repo's root build carries its own specs without sweepingexamples/andexplorations/.The repository gate.
npm run checknow runs the full clean-clone-safe twelve-leg sequence (temporal guard → lint → format → build → generate self-hosting → generate example → typecheck ×2 → test → self-hosting--check-clean→ example check → preflight), proved on a clean snapshot, agit clone --no-localclone, and an installed package. Root generated state is isolated from parallel tests, and the temporal guard covers tracked plus non-ignored untracked durable files.Records kept honest. The carrier ruling's transition clause was amended on the record before the first Markdown-canonical ID (DECISIONS MD-18,
CONTEXT.md, andAGENTS.mdin step): new spec IDs may be born Markdown-canonical; pre-existing IDs and checkout-v1 stay TS-canonical until the ruled flip. Two new durable decisions entered the diary (MD-20, MD-21), two phase-1 decisions were born directly asdecision-kind specs, and an anti-misleading pass repaired every active "TS is the sole canonical surface" claim across the concept docs and JTBD stories. An archived code review (reviews/06) drove a remediation wave — security-boundary refusals for the frozen grammar, permutation/byte-identity coverage, and diagnostic fixes — with each finding's disposition recorded.Verification
npm run checkgreen on the full sequence above, locally, on a clean snapshot, and on a true clean clone; determinism is regenerate-and-compare (--check-clean), never committed goldens.plans/17-self-hosting-v1.md§6); the post-review remediation was re-verified end to end.npm audit: zero production vulnerabilities; five dev-chain advisories (Vitest/Vite), dispositioned in the plan.What remains for full self-hosting
Two framing notes: the ratified term is self-hosting (the repo deliberately rejects "dogfooding"), and the native format already is Markdown —
.sdp.mdwith the typed envelope, free prose, and the owned notation. So the road ahead is not "away from Markdown" but from untyped prose exposition (docs/concept/00–07) to typed, graph-carried, largely executable Specs. The north star is itself recorded as a decision spec this phase authored —spec:decisions.concept-docs-dissolve: concept documents may dissolve only after their semantic contract is carried by executable Specs and lean registries; deletion is later work, never part of phase 1.Phase 2 — end the interim carrier rule (scheduled by the owner at Gate 4 as one effort). The
sdp importemitter (spec:carrier.sdp-import, honestly authored atidea), the checkout-v1 migration, and the canonical-default flip — discharging MD-18's transition clause. The like-for-like parser-hardening baseline (the pinned "no full refusal parity" non-claim) rides in the same effort, and the table-sugar ruling is expected to fire under it — useful for multi-case rule and test material anyway. This is the precondition for the rest: the corpus can't absorb the concept docs while the repo runs a three-state carrier world (Markdown-canonical new IDs, TS-canonical old IDs, TS checkout).The decision-spec fold. Every durable row in the ratified-name registry becomes a
decision-kind spec, withDECISIONS.mdshrinking to a lean registry of pointers. Phase 1 seeded the pattern — two decision specs exist and the registry already points at them — but also left a recorded namespace divergence to resolve at the fold: the registry reservesspec:protocol.decisions.*while the authored specs were bornspec:decisions.*. This is the cheapest dissolution tranche, since diary entries map one-to-one onto thedecisionsection shape.Corpus expansion — one subsystem at a time, anchored to the real engine. Grow the pack beyond the current 15 so each concept doc's semantic contract is carried: the core model (
02) →model/behavior/rulespecs for the primitive, descriptors, sections, and relations; extraction (03) → derivation and determinism specs (started this phase); validation (05) → onerule-kind spec per validator with the floor clauses as evidence; consumers (06) → reader and projection specs. Precise anchors onto existing entrypoints keepimplementedhonest; readiness is stated only where the floor clears.The tests-to-executable-specs rewrite. The duplicate-ID tracer is the template: for each behavior worth verifying, author the parent's
gwt-vocabulary, anexamplechild binding a point, generate the contracts, and rewrite the correspondingtest/assertions asbindExamplehandlers carrying a test anchor — earninghas-verifierin the graph rather than just a green runner. This tranche is what forces the remaining syntax rulings (table sugar for truth-table material, the single-literal vocabulary form, possibly the multi-entry constraint form and the array-section prose sub-owner) — ruled under fire, as designed.Per-doc deletion, gated by the dissolution decision. Each concept doc is deleted individually, only once its content is fully carried — the criterion is the recorded decision spec, checked at a Design Review, never a bulk purge. What deliberately never dissolves:
CONTEXT.mdstays the ratified glossary,DECISIONS.mdsurvives as the lean registry, andplans/remains the process record. The end state is the thesis applied to itself completely: the spec corpus is the documentation, the graph is the read surface, and prose survives as narrative and description slots on typed owners.Greptile Summary
This PR adds the self-hosting Markdown carrier path for the Protocol's own specs. The main changes are:
.sdp.mddiscovery and Markdown carrier reification.0.4.0.--excludesupport and deterministic self-hosting check legs.Confidence Score: 5/5
This PR appears safe to merge based on the reviewed changed paths.
The carrier parsing, discovery, CLI gating, serialization, Reader, and projection changes are internally consistent in the reviewed code. No blocking findings remain.
No files require special attention.
What T-Rex did
Important Files Changed
.sdp.mdcarriers and root-relative exclude prefixes with deterministic sorting; behavior appears consistent with the CLI contract.--exclude, self-hosting generation support, artifact cleanup, and determinism checks for graph/contracts/view output; no blocking issues found..sdp.mdfiles through the Markdown carrier and keeps duplicate-ID exclusion and graph derivation shared across carriers.yamlfor the Markdown carrier.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant CLI as sdp CLI participant Discovery as discoverFiles participant TS as reifyTypeScriptCarrier participant MD as reifyMarkdownCarrier participant Graph as deriveGraph participant Contracts as generateContracts participant Reader as createReader participant View as renderDesignReview CLI->>Discovery: root + --exclude prefixes Discovery-->>CLI: .sdp.ts/.sdp.md carriers + TS anchor candidates CLI->>TS: TypeScript carriers TS-->>CLI: reified specs/packs/findings CLI->>MD: Markdown carriers MD-->>CLI: reified specs/findings with owned prose CLI->>Graph: specs + packs + anchors Graph-->>CLI: graph with delivery facts CLI->>Contracts: graph Contracts-->>CLI: generated contract files + findings CLI->>Reader: graph Reader->>View: decoded graph contexts View-->>CLI: generated Design Review pages%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant CLI as sdp CLI participant Discovery as discoverFiles participant TS as reifyTypeScriptCarrier participant MD as reifyMarkdownCarrier participant Graph as deriveGraph participant Contracts as generateContracts participant Reader as createReader participant View as renderDesignReview CLI->>Discovery: root + --exclude prefixes Discovery-->>CLI: .sdp.ts/.sdp.md carriers + TS anchor candidates CLI->>TS: TypeScript carriers TS-->>CLI: reified specs/packs/findings CLI->>MD: Markdown carriers MD-->>CLI: reified specs/findings with owned prose CLI->>Graph: specs + packs + anchors Graph-->>CLI: graph with delivery facts CLI->>Contracts: graph Contracts-->>CLI: generated contract files + findings CLI->>Reader: graph Reader->>View: decoded graph contexts View-->>CLI: generated Design Review pagesReviews (2): Last reviewed commit: "docs(plans): file the bootstrap executio..." | Re-trigger Greptile