fix: agent autonomous execution + project-context recovery - #3
Merged
Conversation
- 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
force-pushed
the
fix/agent-autonomy-and-context
branch
from
July 17, 2026 17:32
bac029f to
380b56f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pm-agentwas 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
prompts/system.mdnow 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.domain/policies.pynow allows MCPwrite_documentwith a repo-relative path + extension allowlist (.md,.txt,.json,.yaml,.yml,.rst);integrations.pyadds a strict_execute_mcp_write_documentdispatch that sandbox-checks and redacts secrets before writing.create_issue_commentandcreate_sub_issueadded to the action registry with payload validation in the policy layer.store.retrieve()always includes project summaries, notes, and proposed decisions (even on an unrelated query), so the agent recovers identity instead of asking again.PromptBuilderinjects project memory + configured name;cli.pyforwards memory/name into the loop.application/decision_policy.pyclassifies the task (TaskClass), detects offloading, validates execution needs, and categorizes blocked ops (external-access vs approval) for precise user messaging inconversation_service.py.Verification
pytest -q, unit + contract + integration).ruff checkclean on changed files;mypy src/pm_agent→ no issues.tests/integration/test_store.py(proposed decisions are now retrieved as identity context) and addedtest_autonomy.py,test_decision_policy.py,test_store_identity.py, plustest_policy.py/test_builder.pycoverage.🤖 Generated with opencode