Problem
find_project_root() in tools/validation.py only recognizes MCP server projects by checking for a fastmcp dependency in pyproject.toml. Agent projects (which depend on fipsagents), Go-based projects (gateway/ui), and sandbox projects all return None, causing every patch subcommand to fail with "Not in a project directory."
Proposed change
Instead of detecting the project type from pyproject.toml dependencies, look for the .template-info file. Any project scaffolded by fips-agents create writes this file, so it's a universal marker.
Options (pick one):
Option A — New function for patch context: Add find_fips_project_root() that walks up the directory tree looking for .template-info. Leave the existing find_project_root() for MCP-specific commands (add, generate) that genuinely need to confirm the project is an MCP server.
Option B — Generalize find_project_root(): Add an optional project_type parameter. Default behavior checks for .template-info. Pass project_type="mcp-server" from add/generate commands to keep the fastmcp check.
Option A is simpler and avoids breaking existing callers.
Part of
Tracking issue: #12
Depends on: #13 (.template-info needs template.type for the patch system to select the right behavior, but the root-finding itself just needs the file to exist)
Problem
find_project_root()intools/validation.pyonly recognizes MCP server projects by checking for afastmcpdependency inpyproject.toml. Agent projects (which depend onfipsagents), Go-based projects (gateway/ui), and sandbox projects all returnNone, causing everypatchsubcommand to fail with "Not in a project directory."Proposed change
Instead of detecting the project type from
pyproject.tomldependencies, look for the.template-infofile. Any project scaffolded byfips-agents createwrites this file, so it's a universal marker.Options (pick one):
Option A — New function for patch context: Add
find_fips_project_root()that walks up the directory tree looking for.template-info. Leave the existingfind_project_root()for MCP-specific commands (add, generate) that genuinely need to confirm the project is an MCP server.Option B — Generalize
find_project_root(): Add an optionalproject_typeparameter. Default behavior checks for.template-info. Passproject_type="mcp-server"from add/generate commands to keep thefastmcpcheck.Option A is simpler and avoids breaking existing callers.
Part of
Tracking issue: #12
Depends on: #13 (
.template-infoneedstemplate.typefor the patch system to select the right behavior, but the root-finding itself just needs the file to exist)