Skip to content

Seed the spec, plan, task, review and decision procedures, their queues and task context paths (#3543) - #3656

Merged
malibio merged 1 commit into
mainfrom
issue-3543-seed-workflow-skills
Oct 5, 2026
Merged

malibio merged 1 commit into
mainfrom
issue-3543-seed-workflow-skills

Conversation

@malibio

@malibio malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Closes #3543.

Seeds the eight workflow procedures as built-in skills (Writing a Spec, Writing a Plan, Breaking a Plan into Tasks, Implementing a Task, Reviewing a Task, Completing a Task, Recording a Decision, Authoring a Skill), six saved queries (specs, plans and decisions by status; Ready tasks, In progress, Awaiting review), the seeded attached_to links from the two queue procedures, and task's context paths as a third seed aspect (reconcile, pending, keep, take through core, daemon, CLI and app).

Routing: skills gain a role (tool or procedure). find_skills ranks procedures in their own lane: the tool window is unchanged and one procedure is added after it; a procedure never leads a turn. This is the matching change the issue lists as a non-goal; it is recorded as an amendment to ADR-038 in nodespace-docs. Node type change: skill gains the closed enum field role (tool, procedure; default tool), kind: flat core type field, category unchanged. Databases need a reset (skill field, pending_seed_update CHECK).

Also: the agent's context rows carry node_version and checkbox ids; create_node strips a nodespace:// parent id.

Tests: live guard suite 44/44 and the confusion matrix (18 requests not yet won, unchanged) on the locked embedding model; Rust workspace 4981 passed; test:changed frontend tiers green. Docs in nodespace-docs (seeded-nodes, prompt-skill-system, schema-management, node-types, ADR-038) are pushed just before merge.

🤖 Generated with Claude Code

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Code Review: PR #3656 (initial review)

Review Type: Initial pragmatic code review: architecture (skill role lane, ADR-038 amendment), seeds, context-paths seed aspect, agent tools, tests. Static review only; I did not run the test suites or the live (model-backed) tests.

Requirements Check (issue #3543)

  • ✅ Eight skills seeded with fixed ids, Markdown bodies, applies_to links (skill_pipeline.rs SKILL_SEEDS, link_seeded_skills; count assertion 12 -> 20)
  • ✅ Bodies start with prose, not an H1; tool-specific steps are rule includes with agent/CLI forms (skill_rules.rs, seeds/rules/{agent,skill-md}/*)
  • ✅ Descriptions are retrieval text; golden retrieval regenerated with cases for all eight (current.tsv, skill_confusion_matrix.rs). Not re-run by me.
  • ✅ Implementing a Task is one procedure, version-conflict and rejected-write rules included (implementing-a-task.md)
  • ✅ Reviewing a Task is separate; each says the other's work is not theirs
  • ✅ Order of Implementing steps matches the criterion (take, context, checklist, evidence, PR/commits, in_review)
  • ✅ Approval is the user's; rejected write resolved at its cause (approval-ask-first, rejected-write rules)
  • ✅ Authoring a Skill: search first, description as when it applies (skill-authoring-find-first)
  • ✅ Six queries seeded under fixed UUIDs (core_queries.rs), reconciled on open through the shared seed path
  • ✅ Ready tasks filter: open, checkbox child, no unfinished blocker, no unapproved plan, priority then age; per-condition tests in core_queries_test.rs
  • ✅ attached_to: Implementing -> Ready tasks + In progress; Reviewing -> Awaiting review
  • ✅ task context paths seeded (spec, plan, decisions, spec.decisions, project)
  • ✅ Context read / stage transitions covered in workflow_seeds.rs and node_context_tools.rs; project-linked skill case covered
  • ✅ User edit survives restart; reset restores (queries/skills via existing seed path)
  • ✅ Context-paths edit survives restart; shipped change is pending, shown beside theirs, never applied (core_context_paths_seed_test.rs, daemon test)
  • ✅ Built-in agent writes spec as draft, does not approve: routing/golden coverage present
  • ⚠️ Live skill-fetch test (live_skill_guidance_fetch.rs) covers both flows by inspection; model-backed, not run here
  • ✅ Goldens regenerated; docs updated (ADR-038 amendment, node-types.md role row, seeded-nodes.md) in the docs working tree
  • ⚠️ quality:fix / test:changed results not verified by this review

Summary

Net positive and well-structured. The lane design is the right shape: role is a declared, closed schema field (not inferred from links or empty whitelists), in_lanes leaves the tool lane byte-identical, and can_lead keeps a procedure from stealing the destructive-tool leadership. The test the_tool_lane_is_the_same_with_or_without_procedures pins the invariant rather than an outcome. Node-type sequence layers are all present for role (schema field, SkillRole in nodespace-types, promoted field, ts-rs output, validation, tests). No literal node_type == comparisons, no lifecycle_status reads (the two hits are None initializers in test fixtures), no #[allow], no issue numbers in code comments, no compatibility shims. The context-paths slice, which I read line by line, is correct: the reconcile table matches ADR-072, the fingerprint is order-sensitive, _seed is exempt from the config/guidance stamping in crud.rs, core_type_shape ignores the paths and their bookkeeping, and the single-transaction write_shipped_context_paths bumps the schema version so a racing update_schema is rejected by its OCC check. No blockers.

Findings

Critical Issues

None.

Suggested Improvements

  • 🟡 packages/core/src/models/core_schemas.rs (~1797-1808) vs packages/nodespace-types/src/skill.rs:36-40: the role field hand-writes EnumValue::new("tool"...)/("procedure"...) while SkillRole::ALL is defined and unused. Every other closed enum in this file uses enum_values(&X::ALL, X::as_str). This is a second definition of the vocabulary (DRY, ADR-086 "defined once"): a third variant added to the Rust enum would not reach the schema, and SkillRole::ALL is dead. Use enum_values(&SkillRole::ALL, SkillRole::as_str), and the schema's own description text can stay.

  • 🟡 packages/core/src/schema/mod.rs (~3411-3420): the _seed stamp assigns a whole object (properties["_seed"] = {context_paths_modified: true}) and so depends on the write path merging _seed keys, to keep context_paths_version. The test a_users_change_survives_a_restart... asserts the version survives, so it works today, but the dependency is implicit. Say so in the comment, or set only the one key via the same $._seed.<flag> path crud.rs uses, so a change to property-merge semantics cannot silently drop the fingerprint (which would make every open record a pending update for unchanged shipped paths).

  • 🟡 packages/core/src/services/node_service/mod.rs (~1655-1659): reconcile_core_context_paths(...).await? is fatal on open, while the Plays and query seeds beside it are non-fatal. A failed write to one schema's paths would refuse to open the database. Justifiable (paths must settle before a context read), but state the reason, or degrade to a tracing::warn! as the neighbours do, since a stale path list is recoverable and an unopenable database is not.

  • 🟡 packages/core/src/ops/skill_ops.rs SKILL_RERANK_POOL = 40: the ADR says the pool "is sized to the registry". A constant that is 2x today's registry will silently stop ranking user skills past 40, and the procedure lane makes that more likely (lane choice happens after the pool cut). Add a test or a debug assertion that the built-in registry fits, and note the limit in the doc comment (it states "twenty skills" but not the failure mode beyond the pool).

  • 🟡 packages/core/src/services/node_service/seed_updates.rs: once a user edits a core type's paths, the aspect stays modified even if they edit back to the shipped list, and the only way to rejoin the shipped list is a pending take, which needs a shipped change first. There is no reset for this aspect (reset_seed_node covers templates). Acceptable for the stated criteria; consider a follow-up if "restore shipped paths" is wanted.

  • 🟡 packages/agent/src/local_agent/tools.rs (~4549-4556): strip_node_uri on create_node's parent_id is a behavior change on a write path that is only loosely tied to this issue (the procedures copy ids from context reads, so it is defensible). Confirm it has a test; I saw none specific to it in the diff.

Nitpicks

  • Nit: packages/agent/src/skill_pipeline.rs "Breaking a Plan into Tasks" use_for ("Split an implementation plan into tasks with acceptance checklists.") has no "Use when..." clause, unlike its siblings; presumably tuned against the golden, but worth a comment saying so.
  • Nit: core_queries.rs by_status documents "Every node of target_type" while the by-status queries carry no filters; fine, but the tasks_in_status doc says "oldest first" and the code sorts priority then age.
  • Nit: reviewing-a-task not_for: "Link or point one record at another." reads as an artifact of retrieval tuning; a short comment on why would help the next editor.
  • Nit: docs: node-types:check reads the docs remote main, so push the node-types.md and ADR-038 changes just before bun run merge (they are in the docs working tree only).

Recommendation

APPROVE (no blockers; the SkillRole::ALL duplication and the _seed stamping/fatal-reconcile items are worth fixing in this PR since they are small).

@malibio malibio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated pragmatic-code-review: APPROVE (posted as a comment — GitHub blocks self-approval). Full findings in the review comment above.

@malibio

malibio commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the review (APPROVE, no blockers).

Fixed

  • role's schema values now come from SkillRole::ALL, one definition of the vocabulary.
  • reconcile_core_context_paths warns instead of failing the open, as the plays and queries reconciles do: stale paths are recoverable, an unopenable database is not.
  • Documented that the _seed write in update_schema relies on the write path merging _seed keys.
  • Fixed the status query's doc comment; added a comment on Reviewing a Task's not_for.

Skipped

  • Test that the built-in registry fits SKILL_RERANK_POOL: the pool (40) is documented as a limit and the registry is 20; a count test would pin a number, not behaviour. Revisit if the registry nears 40.
  • Aspect stays modified after editing back to the shipped paths: acceptable for the criteria; a reset for this aspect is a follow-up.
  • Dedicated test for create_node stripping nodespace://: workflow_seeds creates the spec's checkboxes with a nodespace:// parent id, so it is exercised.
  • 'Use when' clause on Breaking a Plan into Tasks: it would change retrieval text and need the matrix and guards re-run for no measured gain.

Rust tests (core, agent, daemon, cli): 4783 passed; node-types and generated-types checks clean.

🤖 Generated with Claude Code

@malibio
malibio force-pushed the issue-3543-seed-workflow-skills branch from c5ca55a to 2502376 Compare October 5, 2026 22:16
@malibio
malibio merged commit 32ab079 into main Oct 5, 2026
@malibio
malibio deleted the issue-3543-seed-workflow-skills branch October 5, 2026 22:16
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.

Seed the spec, plan, task, review and decision procedures as built-in skills, the work queues they are attached to, and a skill-authoring skill

1 participant