You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Step 3 of #42. Larger lift than steps 1 and 2 — touches every template repo and changes the source of truth for patch metadata. Filing for design discussion before code.
Problem
Today the patch category lists live in src/fips_agents_cli/tools/patching.py as hardcoded constants:
MCP_FILE_CATEGORIES, AGENT_FILE_CATEGORIES
MCP_NEVER_PATCH, AGENT_NEVER_PATCH
get_categories_for_type() raises ValueError for gateway, ui, sandbox
Adding patch support for gateway / ui / sandbox means more constants and more branching in get_categories_for_type().
AGENT_NEVER_PATCH / MCP_NEVER_PATCH are easy to forget when the template grows. Files like prompts/system.md (now safely in AGENT_NEVER_PATCH after patch: Fix coverage gaps in template categories (step 1 of #42) #43) had to be discovered by audit, not declared by the template that owns them.
Proposal
Each template repo ships a manifest at the comparison root declaring its own patch metadata:
_clone_template_for_patch already returns the comparison root. The patcher reads <root>/.fips-template.yaml after clone and uses it to drive check_for_updates and patch_category. When the manifest is absent (legacy templates, projects pinned to old commits), fall back to the current hardcoded constants.
Net effect
Each template owns the truth about what is patchable. Agent template adds a file → next patch check surfaces it without a CLI release.
gateway-template, ui-template, code-sandbox opt in by shipping a manifest. No new constants in the CLI.
MCP_FILE_CATEGORIES / AGENT_FILE_CATEGORIES become fallbacks, not source of truth.
Open design questions
Where does the manifest live for monorepo templates? Inside the subdir (e.g. templates/agent-loop/.fips-template.yaml) is the obvious answer — it travels with the comparison root.
Schema validation. Pydantic? jsonschema? tomlkit? YAML-based is consistent with agent.yaml and Helm values.yaml so YAML feels right.
Versioning. Should the manifest declare a schema_version: 1 so the CLI can reject unfamiliar future schemas?
Migration. Land the loader in a release that still ships the hardcoded fallbacks. Then update each template repo to ship the manifest. Then in a later major release we could drop the fallbacks — though there's no urgency.
add integration. Should fips-agents add <modality> consult the manifest's never_patch to decide where it can write? Probably not — modality target paths are part of the modality spec, not the manifest. But worth thinking about.
fips-agents/gateway-template, fips-agents/ui-template, fips-agents/code-sandbox — ship manifest if/when patch support is added for those project types.
Step 3 of #42. Larger lift than steps 1 and 2 — touches every template repo and changes the source of truth for patch metadata. Filing for design discussion before code.
Problem
Today the patch category lists live in
src/fips_agents_cli/tools/patching.pyas hardcoded constants:MCP_FILE_CATEGORIES,AGENT_FILE_CATEGORIESMCP_NEVER_PATCH,AGENT_NEVER_PATCHget_categories_for_type()raisesValueErrorforgateway,ui,sandboxConsequences:
patch checkuntil someone updates the CLI and ships a release. (patch: Coverage gaps vs. current templates; consider per-template manifest #42 is the visible result of that drift.)gateway/ui/sandboxmeans more constants and more branching inget_categories_for_type().AGENT_NEVER_PATCH/MCP_NEVER_PATCHare easy to forget when the template grows. Files likeprompts/system.md(now safely inAGENT_NEVER_PATCHafter patch: Fix coverage gaps in template categories (step 1 of #42) #43) had to be discovered by audit, not declared by the template that owns them.Proposal
Each template repo ships a manifest at the comparison root declaring its own patch metadata:
Loader behavior
_clone_template_for_patchalready returns the comparison root. The patcher reads<root>/.fips-template.yamlafter clone and uses it to drivecheck_for_updatesandpatch_category. When the manifest is absent (legacy templates, projects pinned to old commits), fall back to the current hardcoded constants.Net effect
patch checksurfaces it without a CLI release.gateway-template,ui-template,code-sandboxopt in by shipping a manifest. No new constants in the CLI.MCP_FILE_CATEGORIES/AGENT_FILE_CATEGORIESbecome fallbacks, not source of truth.Open design questions
templates/agent-loop/.fips-template.yaml) is the obvious answer — it travels with the comparison root.agent.yamland Helmvalues.yamlso YAML feels right.schema_version: 1so the CLI can reject unfamiliar future schemas?addintegration. Shouldfips-agents add <modality>consult the manifest'snever_patchto decide where it can write? Probably not — modality target paths are part of the modality spec, not the manifest. But worth thinking about.Affected repos
fips-agents/fips-agents-cli— loader change, fallback retention, tests.fips-agents/agent-template— ship.fips-template.yamlfor bothtemplates/agent-loop/andtemplates/workflow/.fips-agents/mcp-server-template— ship.fips-template.yaml.fips-agents/gateway-template,fips-agents/ui-template,fips-agents/code-sandbox— ship manifest if/when patch support is added for those project types.Suggested rollout
tools/patching.pyare technically dead — remove them in a major release.