Repository navigation
Seed built-ins from fixed-UUID tables with Markdown bodies, order agent guidance, and link skills to their schemas (closes #3418) - #3495
Conversation
Pragmatic Code Review — PR #3495Review Type: Initial Review SummaryNo blocking defects found. The seeding, assembly and What needs attention before merge is small: one new test does not discriminate the bug it is named for, the PR body understates the model-facing changes, and the companion docs still describe a function this PR deletes. What I ran (all pass, 170 tests):
I did not run Requirements Check
Node type sequence ( Code Review Findings🟡 1. The table-order test passes against the bug it is named for📁
assert!(
created.windows(2).all(|pair| pair[0] > pair[1]),
"the fixture must create the sections in reverse table order: {created:?}"
);The pre-fix read was newest-first ( The regression is still caught, but by a different test: Recommendation: create the sections in an order that is neither ascending nor descending (for example table indices Principle: a regression test should fail on the code it guards against; this is also the issue's own stated purpose for the test. 🟡 2. Two model-facing changes ship unmeasured, and the PR body names one📁 The PR body says the spec-driven On the first change, the linked branch is uncapped and follows Recommendation: correct the PR body, and run the matrix (several reps, given how noisy single runs are) before and after on a purged database with a rebuilt daemon. If the multi-playbook case is a concern, measure it before deciding whether a linked core type should bring its subtypes. Principle: prompt changes are behaviour changes; a claim about what is model-facing should be complete so the reviewer knows what was and was not measured. 🟡 3. Companion docs and one comment still describe
|
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
|
…nt guidance, and link skills to their schemas (closes #3418) Every seeded node comes from a const seed table with a fixed literal UUID: agent guidance, the built-in skills and tools, and each bundled playbook's skills. Guidance and skill bodies are plain .md files, and the shared rules are .md fragments a body includes by id. - Seeding reconciles by the root's id. A deleted seed is created again under the same id, an archived one stays archived, and a retitled seed renames its node in place. _seed.key stays as the handle `skill reset` takes. - The resident prompt is assembled from the guidance table's ids in table order. A guidance node outside the table is not in the prompt, and an archived section is left out. - skill declares applies_to (skill -> schema, Many/Many, reverse skills), replacing SkillFields.node_types. find_skills carries a linked skill's schemas and their subtypes, read in one query for all candidates. - Bundled playbook skills drop their frontmatter and link to their schemas at install. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…read, and fix stale comments - The table-order test created the sections last-first, which a newest-first read also assembles in table order. It now creates them in an order that is neither the table's nor its reverse. - The assembler reads the guidance sections in one query. - The reinstall test pins a skill's links after a second install. - Comments on declaration storage cover a schema-targeted declaration, and comments that named assemble_static, the seed key and the retired prompt type are corrected. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
6eb915a to
28dee33
Compare
Closes #3418.
Every built-in seeded node now comes from a
constseed table with a fixed literal UUID, its text lives in plain.mdfiles, seeding reconciles by id, the resident prompt is assembled in table order, and a skill links to the schemas it is about through a declaredapplies_torelationship.What changed
Seed tables and Markdown bodies
GUIDANCE_SEEDS(prompt_assembler.rs),SKILL_SEEDS(skill_pipeline.rs),Tool::seed_id()(tools.rs) and each playbook'sSKILLS/OVERVIEWtables hold the fixed ids and metadata. Core and playbook plays already had fixed UUIDs on main;CORE_PLAY_IDSnames the core play table.packages/agent/src/seeds/{guidance,skills}/*.md. The bundled playbook skill files lost their frontmatter, and the frontmatter parser is deleted.NodeTemplatestays as the one input to seeding. It gainedidand lostcontentandchild_properties, which nothing but tests used.Rule fragments
skill_rulesconstant now reads its text from.mdfragments, and a body includes a rule by id with<!-- include: <rule-id> -->.schema-rulesregion of the shipped skill is laid out byseeds/skill-md/schema-rules.md, using the same markers.Identity and reconciliation
seed_nodes_from_templatesmatches a seed by its root id, in one batched read. A deleted seed is created again under the same id; an archived one stays archived._seed.keystays as the handlenodespace skill reset <key>takes. The daemon resolves the key to the table row and the row's id to the node.Agent guidance
PromptAssemblerfetches the table's ids in table order. It no longer queries by type, so a user-createdagent-guidancenode is not in the prompt and an archived section is left out.prompt_assembly_snapshotbuilds the resident prompt throughPromptAssembler::assemble()over a freshly seeded database.applies_toskilldeclaresapplies_to(skill → schema node, Many/Many, reverseskills).SkillFields.node_types,with_node_types, theSkillNodeUpdatefield and its flat-key read are deleted, and the generated TypeScript is regenerated.find_skillsreads every candidate's links in one query (get_edge_targets_by_source) and carries the linked schemas plus every schema extending them, core schemas included. An unlinked skill keeps the old fallback.references/cli.mdhas a new "Authoring a skill" section, and each generated playbook reference lists the link commands.Node type change (node type sequence)
skill, a flat core type in the agent category.node_types.applies_to→schema, direction out, Many/Many, optional, reverseskills.skillsheet incomponents/node-types.mdalready describes this shape. Companion changes in nodespace-docs (commits4b683c3,8e133ab): ADR-072 amended for id-keyed reconciliation, andcomponents/seeded-nodes.mdandcomponents/typed-relationships.mdupdated.Things a reviewer should know
update_schema), the shipped skill's names CLI commands (schema update). They areseeds/rules/agent/<id>.mdandseeds/rules/skill-md/<id>.md, and the existing anchor and JSON-example tests still tie them together.applies_totargetsschema, which has no schema node. The declaration is stored as a self-edge on theskillschema, the same way an untyped declaration is, and the edge check lets aschema-targeted relationship reach a schema node. A link to any other node is refused.task. With that playbook installed, those skills carrytask's definition inschema_metadatainstead of the custom-type fallback. A linked type brings every type extending it, so in a workspace that also has the Linear or Jira playbook they carryissue, orepic,storyandbug, as well.skill:checkreports the shipped skill up to date apart from the new section and link commands.reject, and no two rules that write share a trigger, so no play depends on running before another.Tests
linked_schemas,skill_applies_to_test(both directions, non-schema target refused, per-playbook install links, re-keyed schema),find_skillswith a linked custom type, a linked core type, a subtype of a linked type and the unlinked fallback.seed_tables(every id a UUID, unique across all tables).🤖 Generated with Claude Code