Skip to content

Build the engine's agentfs parser on agentdef #2861

Closed

Description

@rdimitrov

Depends on: #2829 merged, then the agentdef module tagged

Problem

The agent definition parser exists twice: in the new agentdef module, which the identity broker's definition loader uses (#2829), and in the engine's engine/adapter/agentfs, which the harness uses. The engine is a separately published module and its standalone check builds without the workspace, so it cannot import agentdef until agentdef has a published version. Until then a parity test (internal/app/agentdef_parity_test.go) keeps the two copies reading every file the same way, but any parser change has to be made twice.

What

  1. Tag the agentdef module (agentdef/vX.Y.Z) through the release process, from the merged commit on main (docs/module-development.md, "Merge and release dependencies first").
  2. Add the published agentdef version to engine/go.mod; it becomes the engine's first same-repository dependency. Update docs/module-development.md's module table, and the root go.mod to the published version if the local replace is dropped.
  3. Build agentfs on agentdef: parseAgentDef calls agentdef.Parse and maps the result to tool.AgentDef; the frontmatter types, list splitting, mcpServers handling, and the carried helpers in discover.go and carry.go go away. tool.MaxAgentDescriptionBytes and tool.MaxAgentBodyBytes stay equal to agentdef's limits, with a test.
  4. Delete the parity test, and move the engine semantic matrix's accept/reject check for agent frontmatter into agentdef, so agentdef keeps that coverage on its own.
  5. Allow github.com/stacklok/mecatl/agentdef in the agentfs depguard rule (and engine/arch/layering_test.go if it applies).

Follow the cross-module workflow in docs/module-development.md: the engine change waits for the published agentdef version, and its standalone checks must pass against it.

How it fits

One parser for agent definitions, shared by the broker and the harness, so the definition the broker records and the one the harness runs cannot be read differently.

Done when

  • agentfs parses with agentdef, and engine/adapter/agentfs no longer has its own frontmatter parser.
  • The parity test is gone, and agentdef checks the semantic matrix's agent frontmatter cases itself.
  • task test:engine-standalone passes against the published agentdef version.

Activity

  1. added a commit that references this issue on Nov 18, 2026
    6755b5e
  2. rdimitrov commented on Nov 18, 2026

    @rdimitrov
    MemberAuthor

    What landed differs from "What" in three places, all on purpose (#2864):

    • carry.go stays. rulesfs and skillfs keep byte-identical copies of it, and a test enforces that.
    • NormalizeHeaders and NormalizeHooks stay exported in agentfs, because adapters/grpcdriver applies them to driver definitions.
    • The root module keeps its local replace for agentdef, so its requirement moved to v0.1.0 but it still builds from the checkout.

    The next engine/vX.Y.Z tag is the first to require agentdef. Modules that pin a published engine version pick it up when they bump.

  3. self-assigned this
    on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions