Repository navigation
refactor(discovery): graduate agent-def + skills discovery into engine/adapter (#328) - #333
Merged
Merged
Conversation
…e/adapter (#328) Move the two filesystem discovery adapters into the importable engine module, following the fstools (#269) graduation pattern: - engine/adapter/agentfs — the whole of internal/adapter/agents (.claude/agents discovery, frontmatter parser, FSSource, MultiSource, registry). engine/adapter/skillfs — the READ-ONLY skills core (.claude/skills discovery, FSSource, the Skill tool body, activator, injection scanner). The writable SkillDraft half stays in root and reaches the core through the alias. - Carried helpers live in per-package carry.go files, pinned byte-identical to their internal/adapter/{toolkit,xdgconfig,osfs} origins (the engine module must not import the root module). - The one osfs edge (read-root canonicalisation) is broken by carrying osfs.resolveRoot verbatim into skillfs — no osfs import. - skillfs.NewSourceActivator now takes an unexported consumer-side assetProvisioner interface; root *AssetMaterializer satisfies it implicitly. skillfs exports ParseSkill for the root promotion gate. - Root internal/adapter/{agents,skills} become thin alias shims (the internal/adapter/tools pattern); no second copy to drift. - engine/go.mod gains a direct require on go.yaml.in/yaml/v3 (both frontmatter parsers use it; operator-approved). ADR 0036 + AGENTS.md closure sentences updated (also picking up robfig/cron). - New depguard blocks allow os (discovery is filesystem-walking) and deny os/exec. COMPATIBILITY.md lists both under the engine/adapter/* exclusion; no CHANGELOG entry per the fstools precedent. - Panel review fix: the four hand-rolled UTF8RuneStart copies were byte-identical to stdlib utf8.RuneStart — deleted in toolkit, fstools, agentfs, skillfs. Verified: task lint, task test (incl. GOWORK=off engine-standalone), task api:check, cmd/mecademo, task site:build, plus a throwaway GOWORK=off consumer module in .scratch resolving both .claude/agents and .claude/skills fixtures through the new packages. Co-Authored-By: mecatl <[email protected]>
…def (#328) The live suite exercised skill activation and generic subagents but never a NAMED agent definition — the agentfs half of the graduation. Add a fixture def (e2e/fixtures/agents/fruit-reader.md, scoped tools: Read) laid out at <workspace>/.claude/agents/ by the harness, and a spec that delegates Subagent(agent="fruit-reader") and asserts on EVENTS: the call names the def, the result succeeds with the agentId trailer and carries the FRUIT.txt fact, the child ends stop=end_turn, and no approval surfaces. The child's own Read is deliberately not asserted — child tool calls stay on the child stream (gauntlet #7). Verified live against OpenRouter (focused run, incl. the two pre-existing skills specs as a fixture-change smoke check). Co-Authored-By: mecatl <[email protected]>
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.
Closes #328.
What
Graduates the two filesystem discovery adapters into the importable engine module, following the
fstools(#269 / #277) pattern, so an engine importer gets.claude/agents+.claude/skillsdiscovery — and a workingSubagent(agent=…)/Skilltool — without depending on the root module:engine/adapter/agentfs— the whole ofinternal/adapter/agents(agent-def discovery, frontmatter parser,FSSource, precedenceMultiSource, registry).engine/adapter/skillfs— the READ-ONLY skills core (resolve/source/fssource/skill/tool/activator/discover/sanitize). The writable SkillDraft half (drafter/drafttool/novelty/promote/assetcache) stays in root and reaches the core through the alias.How
carry.go, pinned byte-identical to theirinternal/adapter/{toolkit,xdgconfig,osfs}origins (the engine module must not import the root module — fstools precedent).osfsedge (read-root canonicalisation infssource.go) is broken by carryingosfs.resolveRootverbatim intoskillfs— noosfsimport.skillfs.NewSourceActivatornow takes an unexported consumer-sideassetProvisionerinterface; root*AssetMaterializersatisfies it implicitly (root alias re-exports the constructor as avarsince a wrapper can't name the unexported param).skillfs.ParseSkillexported for the root promotion gate.internal/adapter/{agents,skills}are now thin alias shims (theinternal/adapter/tools/alias.gopattern) — every existing caller keeps compiling; no second copy to drift.engine/go.modgains a direct require ongo.yaml.in/yaml/v3(both frontmatter parsers already used it; the issue's "no new non-stdlib module" line was amended by maintainer decision). ADR 0036 + AGENTS.md closure sentences updated (also picking uprobfig/cron, which the scheduler already added).engine/adapter/*blocks allowos(discovery is inherently filesystem-walking) and denyos/exec.engine/COMPATIBILITY.md: both packages listed under theengine/adapter/*"excluded, may change without notice" clause; no CHANGELOG entry per the fstools precedent.agent-definitions,tool-catalog) updated in the same PR.Review
Ran the full dev-pipeline: separate architect → 3 implementer waves → panel review (Spec / Security / Architecture / library-reuse / code-duplication) + independent QA test-adequacy review. Zero ship-blockers. One applied finding: the four hand-rolled
UTF8RuneStartcopies were byte-identical to stdlibutf8.RuneStart— deleted intoolkit,fstools,agentfs,skillfs. The "extract a shared engine helper package" suggestion was deliberated and rejected (would couple two independent bounded contexts and force every adapter's depguard allowlist to widen; the N=3 pin-comment discipline holds).Verification
task lint(both modules) — 0 issuestask test— full suite green, incl.-raceand the GOWORK=off engine-standalone hygiene prooftask api:check— green (no core API drift;engine/adapter/*is outside the gate)go run ./cmd/mecademo— full offline sessiontask site:build— user-docs build green.scratch/consumer-328) importing onlyengine/adapter/{agentfs,skillfs}resolved.claude/agents/*.mdand.claude/skills/*/SKILL.mdfixtures; its module graph pulls only the engine's small closure + yaml.