Architectural significance rides existing primitives - #25
Open
darko-mijic wants to merge 57 commits into
Open
Conversation
Recipe 17 now returns null member metadata when a memberOf edge outlives its CodeNode, matching recipe 19, and the catalog test locks that contract. Co-authored-by: Cursor <cursoragent@cursor.com>
Make the authored uses layer and recipes 17–19 match the import graph and the ruling's relations, so agents reading the architecture map see the same dependencies the code has. Uses declarations now track real value and type imports; anchor-machinery imports confer no edge. Bind the remaining public units (reify, carrier, sdp new spec), move the import command onto CLI, and pin the join fields plus dangling-component and unresolved-uses contracts. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Too many files changed for review (161 files, 100 file limit). Bypass the limit by tagging |
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 PR delivers
PR #24 closed with two questions open. Does architectural significance need vocabulary beyond
componentanduses? And what happens when design law lives in source comments instead of Specs? This branch answers both, in two waves that share one theme: knowledge belongs on the Spec, because the Spec is what has readiness, review, relations, and honesty checks.Wave 1, architecture as graph structure. The ruling (MD-34) is that architectural significance rides existing kinds and relations: decision- and model-kind Specs, the
satisfies→decidedByjoin, derived grouping. Nopatternkind, no new relation types, no new reader methods. The engine's own map becomes real.component:protocol.importandcomponent:protocol.testingjoin the accepted set, and three recipes indocs/agent-surface/recipes.mdturn architecture questions intosdp qcalls.The first version of that map failed review: trustworthy in shape, not in content. The declared
useslayer understated real imports. Notation's true fan-in was 6; the map said 1. Significant units likereify.tsandnew-spec-command.tscarried no membership at all, contradicting the universal this PR itself matured. Recipe field names collided with ratified relations (constrainingDecisionsvsconstrainedBy,blastRadiusEntryPointsvs the realg.blastRadius). Every claimed gap was re-measured against the actual import graph, never inherited from a reviewer's list, and fixed ined77ee7: tenusesedges added, three machinery-only edges removed under a stated convention (value and type imports count, anchor machinery never does), three units bound, recipes renamed and hardened against dangling structure, and tests that now pin the joins directly.Wave 2, design-law transfer. The probe was one file,
src/graph/delivery-facts.ts. The graph knew its identity, its component, and its realization target. Ask what the unit guarantees and the graph had one line. The real law, ten conferral rules that the extractor, the honesty check, and the reader all depend on, lived only in the file's JSDoc. An agent reading the architecture map still had to open the file to learn the design. That is the failure mode this system exists to remove.The lineage docs had already adjudicated this fork. v0 authoring-surfaces §2.4: markers are read-only pointers from code to spec, never the reverse. So the ruling (MD-35) refuses comment extraction outright. JSDoc and doc comments author no graph content: no nodes, no relations, no membership, no delivery facts, no intent. The statically reified anchor constant stays the only write path from code. When a comment states rules other surfaces depend on, those rules promote into a Spec, and the comment demotes to local commentary plus a pointer. The ten rules moved into
spec:extraction.delivery-facts, bornreadyand test-bound. It is the only promotion. The rest of the flagged comments became graph-visible backlog: one[non-blocking]question on each of six carrier Specs, queryable instead of buried in session history.Wave 2 also gave the self-binding universal its teeth.
spec:protocol.structural-self-bindingstated that every architecturally significant unit is bound, with no verifier, so the claim was unevaluable. The v0 design had the answer: an owner-accepted significant-unit list checked mechanically. That shape is back as oracle state. A roster intest/self-hosting-oracle/structural-edges.tsdrives a census assertion in the self-hosting suite; remove a roster row and the suite fails, naming the unit. The check polices conformance of the accepted set. It never classifies significance from imports or exports, and acceptance stays a human act.The gen-1 comparison is worth stating plainly, because this branch is where the resemblance became real. Gen 1 put pattern knowledge in the annotation: roles, statuses, free-text uses lists. Same read spine here, annotations to one graph to projections. The inversion is in who may assert truth. The anchor says only which intent the code binds to. Status is derived. Law lives in Specs. Comments explain, and confer nothing.
Remediation after the failed merge review. Review at
5584ed91cf2c3efbf31ad83c28054febd0ec62b7failed on recipe family-map totality, coarse-grain helper consumption, lost OmO ledger history, trailing-space hygiene, and publication claims. This follow-through keeps the two-wave product story and repairs those seams without changing the engine, corpus, or graph contract. Recipes 1, 11, and 18 now group lawful families (constructor,toString,valueOf,hasOwnProperty) withObject.create(null). Recipe 19 has a non-empty bidirectional dependency characterization onspec:decisions.structural-anchor-semantics. The accepted-set census now proves each rosteredpath#symbolis a runtime export value-consumed by its covering source. Three ledger snapshots (135 + 20 + 12) live under durable evidence. The 13 proven trailing spaces are gone.Final-review remediation. The structural audit now treats type-only named exports and type-only export stars as erased, rejects ambiguous runtime origins, and fails closed on candidate-relevant export-star cycles. It is deliberately conservative certification rather than a TypeScript linker: direct declarations, non-type named paths, and acyclic value stars may certify one callable origin; explicit named value exports retain precedence over unrelated cyclic stars. This is test-only audit logic and changes no product graph contract. The stale-main Try-it diagnosis was also corrected to the exact published query failure on
c.statedReadiness.The new surfaces
Two ratified rulings.
spec:decisions.architectural-significance-rides-primitives(MD-34) keeps architectural significance on existing primitives.spec:decisions.jsdoc-graph-extraction-refused(MD-35) refuses comment prose as graph input. Both are answerable by graph query from now on.Two matured architecture Specs.
spec:model.structural-patternsandspec:protocol.structural-self-bindingmoved fromideato stateddefined.readystays a human statement, and this PR does not make it.The delivery-facts tracer. Born
ready, ten rules, one implementation (impl:protocol.delivery-facts), one enabled verifier (test:protocol.delivery-facts), holdingimplemented+has-verifier. The engine JSDoc demoted to a pointer under exclusive promotion (MD-10). Wave 2's onlysrc/change, measured fromed77ee7to the reviewed head, is that onesatisfiesretarget plus the demoted comment insrc/graph/delivery-facts.ts. The whole branch still carries the Wave 1codeAnchorwidening undersrc/; that is not a Wave-2 or remediation delta.The accepted-set census.
test/self-hosting-graph.test.tscensus-checks every owner-reviewed significant unit against its declared membership, with coarse-grain coverage rows for the helper files that have no honestsatisfiestarget. After remediation, each rostered unit must resolve as a runtime function export and be value-consumed by its covering source.spec:protocol.structural-self-bindinggained the realization-grain rule and the census-check rule, and carrieshas-verifierwhile stayingdefined.Architecture as graph queries. Recipes 17 (architecture map), 18 (decision map), and 19 (planning slice) are derived on demand. The MD-32 projections freeze stays intact; nothing pre-rendered is committed. A worked planning-slice fixture is
spec:decisions.structural-anchor-semantics.Shaping decisions on the map. Four
decidedByfills survived a verify-first pass and now render on recipe 17's component rows:derive-graph→ one-validation-path (extract),authored-honesty→ binding-not-liveness (validate),reader→ agent-surface-scripts-graph (reader),executable-contracts→ point-per-example (codegen, graph). A fifth candidate, example-runner → MD-7, was dropped with its reason recorded: the ruling shaped the binding's placement, not the Spec's law.Glossary registration.
CONTEXT.mdnow defines "architecturally significant unit" in the ratified vocabulary.Ratified decisions
Review on this branch
Wave 1 had an independent hostile-review pass before the
ed77ee7fix. Bugbot then found one medium defect: recipe 17 threw on a danglingmemberOf, the same class recipe 19 used to have. The catalog body now returns null member metadata andtest/recipes.test.tslocks both the live roster and the dirty-graph case. Security review found no medium-or-higher issues.Wave 2 ran under per-todo failing-first evidence with independent adversarial verification of every commit, then four final reviews: plan compliance, code and corpus quality, real manual QA, and scope fidelity. All confirmed. Two plan sentences were found factually wrong during verification (one readiness expectation, one anchor-site expectation) and were corrected against evidence rather than silently satisfied. Evidence is committed under
.omo/evidence/.The later merge review at
5584ed91failed. Durable mapping lives in.omo/evidence/pr-25-review-remediation/review-findings.md. Integrated close evidence is.omo/evidence/pr-25-review-remediation/final-verification.md. This body does not claim named-model review transcripts that are not in git or GitHub review artifacts.Try it
These commands only produce these results on the branch. Check out
feature/architectural-patterns-viewsand build first:git fetch origin git checkout -B feature/architectural-patterns-views origin/feature/architectural-patterns-views git merge-base --is-ancestor 6a35bd29fe8d4e236d1290529f045fcbc5875e71 HEAD npm ci && npm run buildgit checkout -Bmatters: a plaingit checkoutreuses a stale local branch and stays behind the PR head, which makes every query below fail or return old values.npm cimay report audit findings andtsupprints animport.metaCJS warning; both predate this branch.Expected outputs below were re-confirmed at the authoritative post-F2/F3 gated head
6a35bd29fe8d4e236d1290529f045fcbc5875e71. The initial Todo-7 full gate succeeded but its raw receipt was lost; a fresh recovery gate retained its receipt. In the final-integration worktree, one pre-install attempt exited 127 before lint because dependencies were absent and is preserved honestly as a setup probe; afternpm ci, one environment-corrected actual final gate ran once and its complete output is the current durable receipt. If yours differ, checkgit rev-parse HEADand ancestry first.Three stale signals from the same try-it queries against
origin/main(bb97d829eea7b3689d5d8569d307e1bb5e77fd0d): the readiness query returnsundefinedfor the two decision Specs, there are nocomponent:nodes, andg.specContext("spec:extraction.delivery-facts")returnsundefined; the published delivery-facts query then dereferencesc.statedReadinessand fails withCannot read properties of undefined (reading 'statedReadiness'). That ismain, not this branch.Conformance and honesty over the one graph:
pnpm --silent sdp validate . --exclude explorations --exclude examples --exclude test/fixtures/import/parityBetween those two lines the CLI writes
generated/graph.jsonand contracts, then lists the five pinned honesty/gaps warnings (spec:carrier.markdown-authoring,spec:extraction.claim-taxonomy,spec:model.pack-aggregate,spec:model.relations,spec:model.spec-sections).The two rulings and the two matured Specs:
pnpm --silent sdp:q 'return ["spec:decisions.architectural-significance-rides-primitives","spec:decisions.jsdoc-graph-extraction-refused","spec:model.structural-patterns","spec:protocol.structural-self-binding"].map((id) => { const s = g.specs().find((x) => x.id === id); return { id, stated: s && s.statedReadiness, derived: s && s.derivedReadiness }; })'The delivery-facts tracer, ready and bound:
pnpm --silent sdp:q 'const c = g.specContext("spec:extraction.delivery-facts"); return { readiness: c.statedReadiness, facts: c.deliveryFacts, implementations: c.implementations.length, verifiers: c.verifiers.length }'The accepted component set, now thirteen with import and testing:
pnpm --silent sdp:q 'return graph.nodes.filter((n) => n.nodeType === "CodeNode" && n.id.startsWith("component:")).map((n) => n.id).sort()'Paste recipes 17, 18, and 19 from
docs/agent-surface/recipes.mdintopnpm --silent sdp:q '<body>' --json. For recipe 19, setidtospec:extraction.delivery-factsto see the tracer's implementation, verifier, and parent neighborhood, or tospec:decisions.structural-anchor-semanticsfor a non-empty bidirectionaldependsOn/dependedOnByslice.Feedback is most wanted on four points: whether the inter-decision
dependsOnedges survive the "genuinely needs the other" bar, whether the twodefinedarchitecture Specs should be statedreadyafter human review, whether the census roster's owner-reviewed acceptance is the right long-term home for significance, and whether recipe family maps should stay catalog-localObject.create(null)rather than grow a shared helper.Numbers
Re-derived on the integrated tree from the worktree-local CLI during the authoritative post-F2/F3 gate at
6a35bd29fe8d4e236d1290529f045fcbc5875e71; re-run the commands above rather than inheriting these. The retained history is the initial successful run whose raw receipt was lost, the authorized recovery run, one exit-127 setup probe before dependencies existed in the final worktree, and one environment-corrected actual final gate. 164 Specs · 1 Pack · 177 anchors → 342 nodes · 760 edges; 13 components · 76memberOf· 35uses; 35 decision Specs · 14 inter-decisiondependsOn· 0supersedes· 46decidedBy; readiness 148ready/ 11defined/ 4idea/ 1scoped. Validate reports 0 errors, the 5 pinned honesty-gap warnings, and the one intentionalverifies-linkageexample warning. Recipe 1 operational backlog is empty (66 ready examples and 35 ready decisions excluded).npm testfrom the final gate: 874 passed, 1 skipped; CLI suite 80 passed.Upcoming work
The arc's backlog stays a graph query. Recipe 1 is empty; recipe 11 still shows
spec:consumers.graph-first-planningatideawith the arc-boundary question open. Re-entry: a human writes that Spec's next rung, or recipe 1 stops being empty.The two architecture Specs stay at stated
defineduntil a human writesready. Re-entry: a readiness statement after review of the accepted-set census.The six comment-promotion questions remain non-blocking backlog; each is a candidate promotion review, not committed work. Re-entry: a reviewer promotes one question into a Spec the way delivery-facts was promoted.
spec:consumers.projections-modelremainsdefinedpending its own maturation.Durable refused list:
patternterm, kind, orpattern:namespace (MD-34)supersedesedgesreadypromotion of the two enriched architecture Specs from this PR[blocking]comment-promotion questions on the six carriers.omo/start-work/ledger.jsonlas workflow state