Skip to content

feat: make self-hosting the standing delivery practice (phases 6–7) - #15

Open
darko-mijic wants to merge 20 commits into
mainfrom
feature/protocol-self-application-phase-6
Open

feat: make self-hosting the standing delivery practice (phases 6–7)#15
darko-mijic wants to merge 20 commits into
mainfrom
feature/protocol-self-application-phase-6

Conversation

@darko-mijic

@darko-mijic darko-mijic commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

What this is

Phases 6–7 make the Protocol usable as a delivery practice in both directions:

  • Phase 6 — outward adoption: ship the graph-first authoring/reader surface, package it for an adopter, and measure it on the origin project.
  • Phase 7 — inward standing practice: use that same surface on the Protocol itself, turn forward work into Specs, deliberately bind current realization, add inward expected-outcome oracles, and complete one intent → readiness → implementation → verification → slimming loop.

The origin checkout was not modified during phase 7. Its phase-6 working-copy changes remain reverted and survive only in libar-ai/convex-event-sourcing#181.

Phase 6 — outward usage and adoption

  • Ratifies verification posture (MD-23): authored verification mode is intent; realization remains derived.
  • Generalizes and wires the records gate into the thirteen-leg repository check.
  • Ships both agent skills and eleven executable sdp q recipes in the adopter package.
  • Teaches the complete graph-first authoring loop and uses all four readiness rungs honestly.
  • Adds the package-surface smoke proof and the first second-caller measurements.
  • Records the origin adoption evidence: 57 Specs across all four rungs, zero findings, 73.1% fewer gross completion-event tokens, 38.0% fewer non-cached input-plus-output tokens, and 432.27 ms median fresh query derivation.

Phase 7 — inward self-hosting practice

  • Ratifies the example realization posture (MD-24): examples normally carry verification evidence, while implemented stays direct and anchor-derived.
  • Makes recipe 1 the operational backlog definition: ready ∧ kind≠example ∧ ¬implemented, with excluded-example counts and verifier-health reporting. The raw-query caveat remains explicit.
  • Authors forward intent for runtime observation, impact-graph support, Markdown Pack authoring, and kind-neutral oracle eligibility at the rungs their evidence earns.
  • Audits all 13 non-example backlog laws and records a named disposition for each; 20 concrete implementation anchors close them honestly.
  • Re-measures and re-argues all eight implemented-but-not-stated-ready rows; each remains individually at defined.
  • Adds the first inward oracle over spec:consumers.reader, consuming three existing points with three distinct expected outcomes. The technically eligible duplicate-ID target is explicitly refused as vacuous.
  • Changes the shared oracle predicate from behavior-only eligibility to any Spec that owns an example space; validator and reader consumers continue to fail closed through the same predicate.
  • Adds two ready executable points plus a self-referential rule-kind oracle for spec:validation.oracle-target-eligibility.
  • Mutation-probes the behavior-only predicate, the reader expected branch, and the self-referential expected outcome; each targeted suite turns red before restoration.
  • Captures a genuine enrichment datum across 019d063 (implementing Design), 341ead6 (implementation), and 7ae8087 (post-green slimming) without generalizing from one case.
  • Ignores user-local .vscode/ state, closes the four-column friction ledger without repeated friction, marks plan 24 EXECUTED, and removes the explicitly authorized superseded phase-6 plan file.

Closing graph

  • 128 Specs · 1 Pack · 116 anchors → 245 nodes · 462 edges
  • Readiness: ready 86 / defined 37 / scoped 1 / idea 4
  • Delivery facts: implemented 41 / has-verifier 87 / observed 0
  • Operational backlog: 0
  • Excluded ready examples: 53, none missing a verifier
  • Drift rows: 8, all freshly argued
  • Inward models edges: 2
  • Validation: 0 errors / 0 warnings

Verification

  • Full thirteen-leg npm run check passes in the normal tree and independently at committed checkpoints in a detached clean worktree.
  • Vitest 2→4 is isolated in f8a50bb: installed Vitest 4.1.10, replaced removed singleFork with forks + one worker + isolation disabled, and migrated five deprecated matcher aliases without changing assertions.
  • Vitest 4 results: 48 files / 602 tests, followed by the dedicated 55-test CLI pass.
  • Dependency advisories moved from 8 (3 moderate / 4 high / 1 critical) to 3 (1 low / 2 high / 0 critical).
  • Both derived graph hashes are byte-identical before and after the Vitest migration:
    • self-hosting: de3589892d25f40fe38af3b6be638514bc1d9f263b15811853e9770c86168232
    • checkout example: 17a03acf584ebebdf20051f75ed774a1deac5ba3b7f578c3d59bba9ffa7aa790

Deliberate boundaries

  • No graph-schema or exported TypeScript API change.
  • No Markdown Pack syntax ruling or implementation.
  • No runtime-observation producer or impact graph implementation.
  • No batch promotion of the eight drift rows.
  • No phase-7 work in the origin checkout and no reapplication of its reverted changes.

Post-review follow-up (454e9e9, 4079825)

A full review pass over the branch diff (engine changes read directly; test, spec, doc, and gate
surfaces swept independently) confirmed the kind-neutral oracle predicate is correct and
fail-closed and found four issues, all fixed:

  • Recipe portability (the outstanding review finding): recipes 3, 4, 6, and 9 open with a
    subject const naming this repository's corpus. The catalog intro now states the
    parameterization contract explicitly, and recipe 9 names its id line as the parameter — every
    body still runs verbatim here, and an absent id returns { found: false } rather than failing.
  • Tautological skill test: the "no colliding global binary" check collected only
    pnpm-prefixed lines and then asserted the pnpm prefix — true by construction. It now scans
    every shell-fenced line and fails on any bare sdp / npx sdp invocation.
  • Latent false alarm in the recipe 10 check: its completeness expectation used
    verifiers.length > 0 while the recipe emits rows only for example-declared or enabled
    bindings; the predicates now mirror each other exactly.
  • Gate plan selector: zero-padded primary plans (01-09-) silently never entered the
    highest-primary-plan selection; they now do, while letter-suffixed plans stay excluded.

A second polish pass (4079825) closed the remaining low-severity items and a real usability
failure: the source checkout now has a working full-CLI entry (pnpm --silent sdp --help via a
new sdp package script) and the README documents the exact pnpm exec sdp failure signature on
macOS (Apple's unrelated /usr/bin/sdp demands Xcode); the temporal guard anchors its sweep to
its own directory instead of the caller's cwd, and skips tracked file symlinks whose canonical
file is independently enumerated — CLAUDE.md → AGENTS.md was being swept twice on every run.

Full thirteen-leg npm run check re-run green after the fixes.

https://claude.ai/code/session_0158eQyLnKGzNZTPYcTehw5M

Greptile Summary

The PR establishes graph-first self-hosting as the standing delivery practice.

  • Ships adopter-facing authoring skills and eleven executable query recipes.
  • Generalizes self-hosting gates and adds inward Specs, anchors, verifier oracles, and readiness evidence.
  • Makes oracle target eligibility kind-neutral while retaining fail-closed validation.
  • Migrates the test suite to Vitest 4 and adds source-checkout CLI scripts and documentation.
  • Completes the prior portability fix by explicitly identifying repository-specific recipe parameters.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains, and the recipe portability issue is resolved by explicitly documenting each repository-specific subject parameter and the required adopter substitution.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex attempted to run npm run check and observed an ENOENT error for .agents/skills/sdp-agent-surface/SKILL.md, marking a checkout/setup blocker.
  • T-Rex noted that no tracked source files were altered, reinforcing that the issue is a setup blocker rather than a changed-behavior defect.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
docs/agent-surface/recipes.md Adds the expanded recipe catalog and now clearly identifies the subject constants adopters must replace.
src/graph/oracle-bindings.ts Generalizes oracle eligibility to Specs owning an example space.
src/validate/validators.ts Applies the shared oracle-eligibility predicate in validation.
check-self-hosting-gates.mjs Generalizes self-hosting checks and corrects primary-plan selection.
check-temporal.mjs Anchors temporal checks to the repository root and safely handles tracked symlinks.
package.json Adds source-checkout CLI access and upgrades the testing dependency configuration.

Reviews (8): Last reviewed commit: "fix(cli,temporal): give the source check..." | Re-trigger Greptile

…c, generalized gates probe, portable skill

Close the implementation-review findings on the phase-6 usage layer. The AGENTS.md
repo map and the reading skill now name all eleven recipes and the sdp-authoring
skill; the gates mutation test discovers the highest primary-numbered plan with the
same convention as the guard instead of pinning plan 23; the reading skill separates
the Protocol-checkout invocation (three mandatory exclusions) from the adopter form
and is held to the recipes check's two-form contract; and the test-file impl:
anchors for the two document-realized consumer Specs are relabeled under a recorded
document-realization binding clause on spec:model.anchors — vocabulary only, no
node, edge, or readiness change (121 specs, 213 nodes, 416 edges, zero findings).
Plan 23 gains the post-close corrections section and the origin measurement
addendum record (73.1% gross / 38.0% non-cached).

Claude-Session: https://claude.ai/code/session_0158eQyLnKGzNZTPYcTehw5M
Comment thread docs/agent-surface/recipes.md
… as working guidance

Plan 24 revision 2 re-derives every ground-truth number by graph query and
restructures the phase around what the re-measurement found: the 64-row
backlog is 51 example spaces + 13 laws (all verifier-bound), so S1 becomes
one kind-level ruling on example implemented-semantics plus thirteen law
dispositions; the 8 drift rows all derive ready, so their disposition is
refusal re-argument, never enrichment. Names PR #15 as the delivery
vehicle, states the self-hosted-setup milestone once, and carries the
Vitest 2->4 debt as a named non-Spec chore.

Plan 23 gains a supersession note: EXECUTED history only; origin-repo
S1-S4 changes were reverted locally and survive solely in
libar-ai/convex-event-sourcing#181. AGENTS.md status line moves with
plan 24 (records gate green).

Claude-Session: https://claude.ai/code/session_0158eQyLnKGzNZTPYcTehw5M
@darko-mijic darko-mijic changed the title Phase 6: the usage turn — authoring on-ramp, records gate, and origin-adoption support feat: make self-hosting the standing delivery practice (phases 6–7) Jul 28, 2026
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown

Want your agent to iterate on Greptile's feedback? Try greploops.

…, and the plan selector

- Document the recipe parameterization contract: recipes 3, 4, 6, and 9 open
  with a subject const naming this repository's corpus; the intro and recipe 9
  now say so, closing the reported portability gap without breaking the
  run-verbatim recipe check.
- Replace the tautological colliding-global-binary skill test: the collector
  only ever gathered pnpm-prefixed lines, so the assertion could not fail. The
  check now scans every shell-fenced line and reddens on any bare sdp or
  npx sdp invocation.
- Mirror recipe 10's row predicate in its completeness expectation: a spec
  whose only binding is an off-contract, not-enabled verify edge lawfully
  produces no row, so the broader verifiers.length > 0 predicate was a latent
  false alarm.
- Let zero-padded primary plans enter the gate's plan selector; letter-suffixed
  plans stay excluded because the hyphen must follow the digits directly.

Full thirteen-leg npm run check green.

Claude-Session: https://claude.ai/code/session_0158eQyLnKGzNZTPYcTehw5M
…en the temporal guard

- Add the sdp package script so the full CLI resolves inside the source
  checkout (pnpm --silent sdp --help); document it in the README beside the
  exact failure signature pnpm exec sdp produces here (macOS resolves Apple's
  unrelated /usr/bin/sdp, which demands Xcode), and retitle the pnpm exec
  section as adopter-repository usage where the binary really is linked.
- Anchor the temporal guard's repository root to the script's own directory
  instead of the caller's working directory, so the sweep reaches the same
  files from any cwd; enumeration and reads now go through that root.
- Skip a tracked file symlink whose canonical file git enumerates on its own:
  CLAUDE.md -> AGENTS.md was being swept twice, and a link into an excluded
  genre would have been un-exempted by reading through the link.

Full thirteen-leg npm run check green.

Claude-Session: https://claude.ai/code/session_0158eQyLnKGzNZTPYcTehw5M
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant