Skip to content

fix: agent autonomous execution + project-context recovery - #3

Merged
sm-me-dev merged 2 commits into
mainfrom
fix/agent-autonomy-and-context
Jul 17, 2026
Merged

fix: agent autonomous execution + project-context recovery#3
sm-me-dev merged 2 commits into
mainfrom
fix/agent-autonomy-and-context

Conversation

@sm-me-dev

Copy link
Copy Markdown
Owner

Problem

pm-agent was delegating repository analysis, documentation, and MVP planning back to the user ("you should inspect the repo and write the docs yourself"), and repeatedly asked "what is the project?" because it only retrieved context via full-text search of prior messages — any input unrelated to past text surfaced nothing.

Changes

  • Autonomy / less hand-holding: prompts/system.md now instructs the agent to perform analysis, docs, issue breakdown, and MVP scaffolding autonomously, to stop asking for information it can derive, and to clearly label assumptions. New canonical ops documented: write_document, create_issue_comment, create_sub_issue.
  • Sandboxed doc writing: domain/policies.py now allows MCP write_document with a repo-relative path + extension allowlist (.md,.txt,.json,.yaml,.yml,.rst); integrations.py adds a strict _execute_mcp_write_document dispatch that sandbox-checks and redacts secrets before writing.
  • New GitHub ops: create_issue_comment and create_sub_issue added to the action registry with payload validation in the policy layer.
  • Project-context recovery: store.retrieve() always includes project summaries, notes, and proposed decisions (even on an unrelated query), so the agent recovers identity instead of asking again. PromptBuilder injects project memory + configured name; cli.py forwards memory/name into the loop.
  • Guardrail: new application/decision_policy.py classifies the task (TaskClass), detects offloading, validates execution needs, and categorizes blocked ops (external-access vs approval) for precise user messaging in conversation_service.py.

Verification

  • Full suite passes (pytest -q, unit + contract + integration).
  • ruff check clean on changed files; mypy src/pm_agent → no issues.
  • Updated tests/integration/test_store.py (proposed decisions are now retrieved as identity context) and added test_autonomy.py, test_decision_policy.py, test_store_identity.py, plus test_policy.py/test_builder.py coverage.

🤖 Generated with opencode

- Stop delegating repository analysis, docs, and MVP planning back to the
  user: add Autonomy, Clarification, and Project-identity guidance to the
  system prompt and document the new canonical ops (write_document,
  create_issue_comment, create_sub_issue).
- Relax the read-only policy for sandboxed write_document (repo-relative path
  + extension allowlist) and validate the new GitHub ops.
- Recover project identity from memory/repo/integration context instead of
  asking 'what is the project?': store.retrieve() now always includes summaries,
  notes, and proposed decisions; PromptBuilder injects project memory + name.
- Add lightweight execution-needs schema + DecisionPolicy guardrail
  (task classification, offloading detection, precise blocked-op messaging).
- Add/extend tests; full suite, ruff, and mypy pass.
@sm-me-dev
sm-me-dev force-pushed the fix/agent-autonomy-and-context branch from bac029f to 380b56f Compare July 17, 2026 17:32
@sm-me-dev
sm-me-dev merged commit 1685005 into main Jul 17, 2026
2 checks passed
@sm-me-dev
sm-me-dev deleted the fix/agent-autonomy-and-context branch July 17, 2026 17:47
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.

1 participant