Skip to content

feat: Extend patch command to support agent projects - #32

Merged
rdwj merged 2 commits into
mainfrom
feat/patch-agent-projects
May 4, 2026
Merged

feat: Extend patch command to support agent projects#32
rdwj merged 2 commits into
mainfrom
feat/patch-agent-projects

Conversation

@rdwj

@rdwj rdwj commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Makes fips-agents patch work for agent (and workflow) projects, not just MCP servers. Closes #12, #13, #14, #15, #16.

Per project convention, no "framework" language — base-agent code lives in fipsagents (PyPI or vendored) and has its own update path.

Test plan

  • 20 new tests in tests/test_patch.py (unit + e2e on a fake-scaffolded agent project)
  • Full suite: 231 passed
  • black + ruff clean
  • Manual smoke test: fips-agents create agent test-agent --localcd test-agentfips-agents patch check

rdwj added 2 commits May 4, 2026 12:14
Triggered by `black src tests` during Session A; unrelated to the
patch-for-agents work that follows.

Assisted-by: Claude Code (Opus 4.7)
The patch flow previously only worked for MCP server projects: it
sniffed for a fastmcp dependency to find the project root, hardcoded
MCP-shaped file categories, and cloned templates as standalone repos.
None of that fits the agent template, which lives in a monorepo subdir
and has a chart/-centric layout.

This change makes patch type-aware end-to-end:

- `.template-info` now records `template.type` (and `template.subdir`
  for monorepo templates) at scaffold time. Pre-existing projects
  default to "mcp-server" via get_project_type(). (#13)
- New find_fips_project_root() walks up to .template-info, working for
  any scaffolded project. The MCP-only find_project_root() stays for
  add/generate. (#14)
- Categories split into MCP_FILE_CATEGORIES / AGENT_FILE_CATEGORIES
  with parallel NEVER_PATCH lists. Agent categories are chart, docs,
  build, claude — matching the real agent-loop layout. No "framework"
  category: base-agent code lives in fipsagents (PyPI or vendored)
  and has its own update path. (#15)
- _clone_template_for_patch() resolves the template subdir for monorepo
  templates so glob/compare runs against templates/agent-loop/, not the
  monorepo root. (#16)
- patch.py adds `chart` and `claude` subcommands; `patch all`
  enumerates the project's actual categories. Running an MCP-only
  subcommand (e.g. `patch generators`) inside an agent project exits
  with a type-aware "available: chart, docs, build, claude" message.

Tests: new tests/test_patch.py with 20 cases covering helpers,
root-finding, subdir cloning, agent-project drift detection, and the
end-to-end patch flow including verifying user-customized files
(chart/values.yaml, src/agent.py) are never touched.

Closes #12, #13, #14, #15, #16.

Assisted-by: Claude Code (Opus 4.7)
@rdwj
rdwj merged commit 8befd7f into main May 4, 2026
@rdwj
rdwj deleted the feat/patch-agent-projects branch May 4, 2026 17:20
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.

patch: Add support for agent projects

1 participant