Repository navigation
refactor(agentfs): parse agent definitions with agentdef - #2864
Merged
Merged
Conversation
The harness's agentfs adapter carried its own copy of the agent definition parser, kept in step with the agentdef module by a parity test. Now that agentdef is published (agentdef/v0.1.0), agentfs parses with it and maps the result to tool.AgentDef, so the harness and the identity broker share one parser. The engine requires agentdef v0.1.0, its first same-repository dependency; agentdef adds no third-party dependency the engine did not already have. NormalizeHeaders and NormalizeHooks stay exported for the remote-driver client, and carry.go stays byte-identical to its rulesfs and skillfs twins. The parity test is gone; agentdef checks the semantic matrix's agent frontmatter case itself, and agentfs pins agentdef's caps to the port's. Closes #2861 Co-Authored-By: Claude Opus 5.5 <[email protected]>
ChrisJBurns
approved these changes
Nov 18, 2026
This was referenced Nov 18, 2026
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
The agent definition parser existed twice: in the
agentdefmodule, which the identity broker's definition loader uses (#2829), and in the engine'sengine/adapter/agentfs, which the harness uses. A parity test kept the two copies reading every file the same way. Now thatagentdefis published (agentdef/v0.1.0), the engine parses with it and the harness's copy is gone.agentfsparses withagentdef.parseAgentDefcallsagentdef.Parseand maps the result totool.AgentDef. The frontmatter types, list splitting,mcpServershandling and memory-tier handling indiscover.goare removed.AgentFileExtis nowagentdef.FileExt.NormalizeHeadersandNormalizeHooksstay exported inagentfs, becauseadapters/grpcdriverapplies them to driver definitions.carry.gois unchanged, becauserulesfsandskillfskeep byte-identical copies of it and a test enforces that.github.com/stacklok/mecatl/agentdef v0.1.0. This is its first same-repository dependency. It adds no new third-party dependency, becauseagentdefimports only the YAML library the engine already uses. The engine's standalone check resolves it from the public module proxy.agentfsis outside the engine's guarded API (engine/COMPATIBILITY.md), so there's no snapshot or changelog change.agentdef v0.1.0and keeps its localreplace, the same as before.integration/microvmgains the indirect requirement.agentfsmay importagentdef, and no longer needs the YAML library orfrontmatterdiag, whichrulesfsandskillfsstill use.internal/app/agentdef_parity_test.go) is deleted.agentdefnow checks the engine semantic matrix's agent frontmatter case itself.agentfstest pinsagentdef's caps and file extension to the port's (tool.MaxAgentDescriptionBytes,tool.MaxAgentBodyBytes).agentfs's own parse tests are unchanged and now run throughagentdef.docs/module-development.mdnow lists the engine's dependency onagentdef. Thedocs/architecture.mdsentence and the package docs no longer describe two parsers.Issue relationship
Closes #2861. Part of #2550.
Type of change
Test plan
Baseline checks
task lint)task test:engine-standalone), resolvingagentdef v0.1.0without the workspacetask test:race): see notestask docs)task site:build): no user-facing changetask api:check):agentfsis not guardedtask api:update+engine/CHANGELOG.md: not applicableThe harness parses exactly as before. All of
agentfs's parse and discovery tests pass unchanged againstagentdef, and so do therulesfs/skillfscarry parity tests and theinternal/appagent definition tests.Changes
engine/adapter/agentfs/discover.goagentdef; carried parser removedengine/adapter/agentfs/discover_test.goagentdefengine/go.mod,engine/go.sumagentdef v0.1.0go.mod,integration/microvm/go.mod.golangci.ymlagentfsdepguard ruleinternal/app/agentdef_parity_test.goagentdef/*.go,internal/identitybroker/adapter/definitionloader/loader.godocs/module-development.md,docs/architecture.mdagentdefUser-facing change
None.
Special notes for reviewers
engine/vX.Y.Ztag will carry theagentdefrequirement. Modules that pin a published engine version (the providers,adapters,authn/oidc,environment/microvm,internal/adaptersupport) are unaffected until they bump it.check-module-publication.shchecks only the persistence modules' same-repository pins. It could also checkengine/go.mod, now that the engine has one, to catch a pin to a commit that isn't onmain.🤖 Generated with Claude Code