Repository navigation
Declare context paths on a schema, derive a node's skills from the queries it matches, and return a versioned context read - #3614
Conversation
Pragmatic Code Review: PR #3614 (issue #3557)Review Type: Initial Review Recommendation: APPROVE — no blockers. Three 🟡 items are worth folding in before merge; the rest is optional. SummaryThe change does what ADR-094 §2, §4 and §7 decide, and the design is clean: one write path for context paths ( Requirements CheckContext paths
Applicable skills
Run with context
Version
General
FindingsCritical IssuesNone. Suggested Improvements1. 🟡 A path can be validated and dead in the same call; nothing guards a relationship a context path names
More broadly, removing a relationship that any schema's context path names is accepted silently (the PR lists this as a decision, and Recommendation: at minimum validate added paths against the relationships the call leaves (close the same-call hole). Better, treat context paths as 2. 🟡 Per-read and per-item work that is repeated rather than shared
Recommendation: in 3. 🟡 The version is only comparable for the same paths, and two of the three places that teach it do not say so The digest includes each followed path, so a read with Recommendation: add "with the same 'paths'" to the 4. 🟢 The one-write-path guard covers updates, not creates (unverified)
5. 🟢 Two small gaps between the docs and the code on "declared once in a chain"
Nitpicks
TestsCoverage is strong and behaviour-led: refusals with their messages, inheritance, restart, the queue move, stored-vs-run-time evaluation, version changes and non-changes, the empty run. Missing cases follow the findings: a same-call relationship removal plus path add (1), and a generic create carrying |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Review addressed (commit af29c95)Addressed
Skipped
|
Pragmatic Code Review: PR #3614 (issue #3557)Review Type: Re-Review (commit Recommendation: APPROVE. No blockers and no regression in the new commit. One 🟡 is worth a two-line change before merge; the rest is optional. Previous Review Summary
What I checked: I read the diff and the surrounding code in How each previous finding was handled1. Path validated and dead in the same call / unguarded removal: addressed in part, and the skip is sound.
2. Repeated per-item work: addressed where it was cheapest; the rest is a fair YAGNI call.
3. Version precondition: addressed. 4. Create guard: addressed, and it reaches every service create path. The guard sits in 5. "Declared once in a chain": addressed in the docs working tree ( Findings in the new commitCritical IssuesNone. Suggested Improvements1. 🟡 A failed advisory scan reports a committed update as failed
Recommendation: on a scan error, log a warning and return the output without the list ( Nitpicks
TestsThe two cases the first review asked for are there: the combined call is refused and leaves nothing declared, the removal reports |
malibio
left a comment
There was a problem hiding this comment.
Automated pragmatic-code-review (re-review): APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.
Re-review addressed (commit fb9eebe)
Re-review decision: NO RE-REVIEW NEEDED — one error-handling change on an advisory step and two comments. |
…sioned context read and query run with context (#3557) Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…n with context and the read version Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…eters Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…re per-item reads in a run with context, state the version's precondition - A call that removes relationships or re-points extends adds no context paths - An update that takes a relationship away reports the context paths it stranded - A schema node is not created with context paths - A run with context reads each type's paths and each skill set once - The version digests a matched query's title; a path is not stored twice Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…mitted schema update Also corrects the wire comment on stranded_context_paths and the create guard's doc comment. Skipped: extends naming the current parent still refuses add_context_paths (the message says what to do). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
fb9eebe to
02b3fe9
Compare
Closes #3557. Implements ADR-094 §2 (context paths), §4 (a node's skills are derived from the node) and §7 (a read has a version).
What changes
Context paths on a schema
SchemaNodecarriescontextPaths(RelationshipPath[]), stored in the schema node's properties.update_schematakesadd_context_paths/remove_context_paths, as a list of hops or in the dotted formnode context --pathtakes. Each path is resolved from the type through the schemas before anything is written; a refusal names the path.NodeService::resolve_context_paths);schema getreports that set. A path is declared once in a chain and removed where it is declared.Applicable skills
attached_toandmatched_queries.SkillQueries), each as stored: relative dates read on the day, no run-time narrowing, sorting and limit ignored.Version
--version-only/version_onlyreturns it alone.Run with context
query run --with-contextandrun_querywithwith_contextreturn each item as a context read returns it, with each skill once. The limit applies to items; at most 50.Node type change (node type sequence)
schema(the meta-type; flat properties, no schema of its own).contextPaths. No field, relationship, structural rule or subtype of any other core type changes. No core schema is seeded with a path.schema-node.ts,update-schema-params.ts,schema-update-output.ts).components/node-types.md(theschemasheet),components/schema-management.md(Context paths),components/seeded-nodes.md,architecture/prompt-skill-system.md,architecture/relationship-paths.mdin nodespace-docs, pushed with this merge.Decisions worth a look
create_schematakes no context paths. A path is checked against stored relationships, so it is added byupdate_schemaonce they exist. For the same reason a path over a relationship the same call adds is refused.Tests
packages/core/tests/it/context_paths_test.rs: saving and refusing paths, subtype inheritance, a core schema across a restart, default and explicit paths, a stale path, moving a node between two queues by changing a field, membership asked only of queries with skills (relative date, stored limit), the version (changes and non-changes), run with context.skill_attached_to_test.rs: the task flow and the user-defined workflow fixture now include query membership.node_context_tools.rs), CLI and daemon (cli_integration.rs,get_schema_definition), wire types.🤖 Generated with Claude Code