Codify Nemo's strategies as skills with Strategy Registry seeding#169
Merged
seamus-brady merged 1 commit intomainfrom Apr 26, 2026
Merged
Conversation
… 3 of sub-agent-resilience) Final PR of the sub-agent-resilience plan (Fix 5). Closes the loop: fixes 1-4 gave us runtime resilience; this fix codifies the orchestration patterns Nemo registered locally as skill content + Strategy Registry seeding so every fresh instance has the floor strategies at boot rather than re-discovering them through CBR. Two new skills, four floor strategies seeded automatically. Skills: - .springdrift_example/skills/orchestration-large-inputs/SKILL.md covers reconnaissance-first, search-then-read, parallel-after- reconnaissance. Targets the cog loop for orchestration decisions on large inputs (long documents, multi-document comparisons). - .springdrift_example/skills/when-to-use-writer/SKILL.md covers synthesise-in-root judgment. "If you can imagine writing the response yourself in 200-500 words of structured points, do it" — explicit anti-overuse criteria for the writer agent. Strategy Registry seeding: - New SkillSeeded variant on StrategySource (with encode/decode pair updates in strategy/log.gleam). Distinguished from the existing Observed/Proposed/OperatorDefined for telemetry. - New src/strategy/seed.gleam: floor_strategies() returns the four (name, description, tags) triples; build_seed_events() turns them into StrategyCreated events; seed_if_empty(dir) writes the events ONLY when the registry has zero events. - Idempotent: never overwrites an already-populated registry. Operator-curated and CBR-mined strategies are never disturbed. - Wired into springdrift.gleam boot path next to librarian.init_captures so it runs early in instance startup. Sub-agent-resilience plan moved from docs/roadmap/planned/sub-agent-resilience.md to docs/roadmap/implemented/ with a "What Shipped" preamble documenting all five fixes across PRs #166, #167, and this one. Tests: 9 new in test/strategy/seed_test.gleam covering: - floor_strategies returns all four with descriptions and orchestration tags - seed_if_empty writes four to an empty registry - seeded strategies carry SkillSeeded source variant - seed_if_empty is no-op on populated registry (operator strategies preserved) - repeated seed_if_empty calls are idempotent (no double-seed) - skill files exist on disk Suite at 2083 passing (24 new across the three sub-agent-resilience PRs on top of the 2059 baseline before PR #166). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Final PR of the sub-agent-resilience plan. Implements Fix 5: codifies the four orchestration strategies Nemo registered locally as skill content + Strategy Registry seeding, so every fresh instance has the floor patterns at boot rather than re-discovering them through CBR.
Together with PR #166 (truncation guard + auto-save) and PR #167 (referenced_artifacts + checkpoint), this closes the loop on the 2026-04-26 incident.
What changed
Two new skills
.springdrift_example/skills/orchestration-large-inputs/SKILL.md— covers reconnaissance-first, search-then-read, and parallel-after-reconnaissance. Targets the cog loop (agents: cognitive) for orchestration decisions on large inputs..springdrift_example/skills/when-to-use-writer/SKILL.md— covers synthesise-in-root judgment. Explicit "use writer when" / "synthesise directly when" criteria with the 2026-04-26 lesson written in.SkillSeededstrategy source variantStrategySourcedistinguishes skill-derived floor strategies from operator-curated (OperatorDefined), CBR-mined (Proposed), and agent-observed (Observed) ones.strategy/log.gleamupdated.Boot-time seeding
src/strategy/seed.gleammodule:floor_strategies()— pure function returning the four(name, description, tags)triplesbuild_seed_events(now)— turns the triples intoStrategyCreatedeventsseed_if_empty(dir)— writes the events to disk only when the registry has zero events; idempotent across bootsspringdrift.gleamboot path next tolibrarian.init_captures.Proposedstrategies are never overwritten — the seed only fires on a genuinely empty registry.Plan moved to implemented
docs/roadmap/planned/sub-agent-resilience.md→docs/roadmap/implemented/sub-agent-resilience.mdwith a "What Shipped" preamble that documents all five fixes across the three PRs.Test plan
gleam buildclean, no warningsgleam test— 2083 passed (9 new), no failuresfloor_strategiesincludes all four expected strategiesorchestrationtagseed_if_emptywrites 4 strategies to an empty registry; the resolved registry contains them withsource: SkillSeededseed_if_emptyon a populated registry returns 0 and does NOT overwrite existing entries (regression test seeds anOperatorDefinedentry first, then asserts it survives)seed_if_emptycalls are idempotent — second call returns 0, total entries stays at 4.springdrift/memory/strategies/on a fresh deployment, restart, verify the four floor strategies show up in<strategies>block of the sensorium on the first cycleNotes for review
SkillSeededsource vs.OperatorDefinedis a deliberate distinction. An operator who reads.springdrift_example/skills/and copies the patterns into their own config still createsOperatorDefinedentries (different intent, different telemetry). The codebase-shipped floor stays asSkillSeededso the provenance is clear.seed_if_emptyruns at boot regardless of whether the strategy registry is configured-enabled — it's idempotent and cheap, and registries that remain disabled won't surface the strategies in the sensorium anyway. Keeps the boot path simple.🤖 Generated with Claude Code