What happened
The agent-context extension's Python port (extensions/agent-context/scripts/python/update_agent_context.py) uses a one-level scan in its plan-path mtime fallback:
plans = sorted(
(root / "specs").glob("*/plan.md"), # line ~176
key=lambda p: p.stat().st_mtime,
reverse=True,
)
This does not match nested scoped layouts such as specs/<scope>/<feature>/plan.md. As a result, when no explicit plan_path is given and feature.json is absent, the managed context section is written without the plan link.
Why this is a regression
The Bash and PowerShell ports already search recursively for exactly this case, explicitly referencing #3024:
- Bash:
specs.rglob("plan.md")
- PowerShell:
Get-ChildItem ... -Recurse
The command documentation (speckit.agent-context.update.md) also promises recursive discovery. Issue #3024 fixed Bash/PowerShell, but the later Python port (#3387) reintroduced the one-level glob, so the three ports are no longer in parity and the Python one violates the documented contract.
Expected
The Python port discovers the most recently modified plan.md anywhere under specs/, matching the Bash/PowerShell ports and the documented behavior.
Fix
(root / "specs").rglob("plan.md"). PR incoming with a parity regression test (fails on the one-level glob, passes with the recursive scan).
Version
Reproduced on main (0.14.2 / 0.14.3.dev0).
What happened
The
agent-contextextension's Python port (extensions/agent-context/scripts/python/update_agent_context.py) uses a one-level scan in its plan-path mtime fallback:This does not match nested scoped layouts such as
specs/<scope>/<feature>/plan.md. As a result, when no explicitplan_pathis given andfeature.jsonis absent, the managed context section is written without the plan link.Why this is a regression
The Bash and PowerShell ports already search recursively for exactly this case, explicitly referencing #3024:
specs.rglob("plan.md")Get-ChildItem ... -RecurseThe command documentation (
speckit.agent-context.update.md) also promises recursive discovery. Issue #3024 fixed Bash/PowerShell, but the later Python port (#3387) reintroduced the one-level glob, so the three ports are no longer in parity and the Python one violates the documented contract.Expected
The Python port discovers the most recently modified
plan.mdanywhere underspecs/, matching the Bash/PowerShell ports and the documented behavior.Fix
(root / "specs").rglob("plan.md"). PR incoming with a parity regression test (fails on the one-level glob, passes with the recursive scan).Version
Reproduced on
main(0.14.2 / 0.14.3.dev0).