Skip to content

refactor(agentfs): parse agent definitions with agentdef - #2864

Merged
rdimitrov merged 1 commit into
mainfrom
feat/agentfs-on-agentdef
Nov 18, 2026
Merged

rdimitrov merged 1 commit into
mainfrom
feat/agentfs-on-agentdef

Conversation

@rdimitrov

Copy link
Copy Markdown
Member

Summary

The agent definition parser existed twice: in the agentdef module, which the identity broker's definition loader uses (#2829), and in the engine's engine/adapter/agentfs, which the harness uses. A parity test kept the two copies reading every file the same way. Now that agentdef is published (agentdef/v0.1.0), the engine parses with it and the harness's copy is gone.

  • agentfs parses with agentdef. parseAgentDef calls agentdef.Parse and maps the result to tool.AgentDef. The frontmatter types, list splitting, mcpServers handling and memory-tier handling in discover.go are removed. AgentFileExt is now agentdef.FileExt.
  • Kept on purpose:
    • NormalizeHeaders and NormalizeHooks stay exported in agentfs, because adapters/grpcdriver applies them to driver definitions.
    • carry.go is unchanged, because rulesfs and skillfs keep byte-identical copies of it and a test enforces that.
  • The engine requires github.com/stacklok/mecatl/agentdef v0.1.0. This is its first same-repository dependency. It adds no new third-party dependency, because agentdef imports only the YAML library the engine already uses. The engine's standalone check resolves it from the public module proxy. agentfs is outside the engine's guarded API (engine/COMPATIBILITY.md), so there's no snapshot or changelog change.
  • Root and microVM integration manifests: the root module requires agentdef v0.1.0 and keeps its local replace, the same as before. integration/microvm gains the indirect requirement.
  • Depguard: agentfs may import agentdef, and no longer needs the YAML library or frontmatterdiag, which rulesfs and skillfs still use.
  • Tests:
    • The parity test (internal/app/agentdef_parity_test.go) is deleted.
    • agentdef now checks the engine semantic matrix's agent frontmatter case itself.
    • A new agentfs test pins agentdef's caps and file extension to the port's (tool.MaxAgentDescriptionBytes, tool.MaxAgentBodyBytes).
    • agentfs's own parse tests are unchanged and now run through agentdef.
  • Docs: docs/module-development.md now lists the engine's dependency on agentdef. The docs/architecture.md sentence and the package docs no longer describe two parsers.

Issue relationship

Closes #2861. Part of #2550.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

Baseline checks

  • Linting (task lint)
  • Engine standalone suite (task test:engine-standalone), resolving agentdef v0.1.0 without the workspace
  • Pre-review race suite (task test:race): see notes
  • Markdown changed: docs generation/link checks (task docs)
  • User docs/user-facing behavior changed: site build (task site:build): no user-facing change
  • Guarded engine API affected: compatibility check (task api:check): agentfs is not guarded
  • Intentional engine API change: task api:update + engine/CHANGELOG.md: not applicable

The harness parses exactly as before. All of agentfs's parse and discovery tests pass unchanged against agentdef, and so do the rulesfs/skillfs carry parity tests and the internal/app agent definition tests.

Changes

File Change
engine/adapter/agentfs/discover.go Parse with agentdef; carried parser removed
engine/adapter/agentfs/discover_test.go Cap and extension parity with agentdef
engine/go.mod, engine/go.sum Require agentdef v0.1.0
go.mod, integration/microvm/go.mod Requirement bumped by tidy
.golangci.yml agentfs depguard rule
internal/app/agentdef_parity_test.go Deleted
agentdef/*.go, internal/identitybroker/adapter/definitionloader/loader.go Docs; semantic matrix case
docs/module-development.md, docs/architecture.md The engine's dependency on agentdef

User-facing change

None.

Special notes for reviewers

  • Engine release. The next engine/vX.Y.Z tag will carry the agentdef requirement. Modules that pin a published engine version (the providers, adapters, authn/oidc, environment/microvm, internal/adaptersupport) are unaffected until they bump it.
  • Publication guard (possible follow-up). check-module-publication.sh checks only the persistence modules' same-repository pins. It could also check engine/go.mod, now that the engine has one, to catch a pin to a commit that isn't on main.

🤖 Generated with Claude Code

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]>
@rdimitrov
rdimitrov merged commit fe18ebf into main Nov 18, 2026
55 of 57 checks passed
@rdimitrov
rdimitrov deleted the feat/agentfs-on-agentdef branch November 18, 2026 15:50
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.

Build the engine's agentfs parser on agentdef

2 participants