agent: remove the deterministic project-facts prompt section#417
Merged
Conversation
The ## Project block guessed build/test commands from marker files (bare tests/ dir => "pytest") and stated them as instructions, and a live run showed the model obeying a wrong guess into a misleading ImportError. Heuristic facts that are occasionally confidently wrong are worse than none: the model trusts prompt content over its own exploration. AGENTS.md (## Project Rules) remains the way to hand the agent per-project build/test truth. Removes PasClaw.Agent.ProjectFacts + its tests, the prompt injection, and the bench fixture/assertions that pinned the block. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LGQKz579j1ZnDRwmr6h1V6
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.
Removes the
## Projectfacts block (B1, shipped in #415) entirely, per review of how it behaves in practice.Why remove instead of fix
The block guessed build/test commands from marker files and stated them as instructions. In a live coder run it told a stdlib-
unittestprojectTest: pytest <- run this to verify after code edits; the model obeyed, hit a misleadingImportError, and wasted a turn recovering. A prompt line that is occasionally confidently wrong is worse than no line — the model trusts prompt content over its own exploration. The same block also leaks into embedded clients calling/v1/chat/completionswithout a system message (e.g. SweetConsole), where it described the gateway workspace rather than the client's project directory.The supported way to hand the agent per-project build/test truth remains AGENTS.md (
## Project Rules), which is operator-authored and never guesses.What's removed
src/pkg/agent/PasClaw.Agent.ProjectFacts.pas+ its injection inBuildSystemPrompt(and the now-deadPromptWorkDirhelper)src/tests/project_facts_tests.pas+ itstest-project-factsMakefile targetVerification
Clean rebuild,
make smoke,test-agents-md,test-progress-ledger, and the full 7-scenario agent-loop bench all green. Metrics after removal:build-site.first_request_bytes17,780 → 17,566;realtaskunchanged at 11 provider calls with the same deliverable.🤖 Generated with Claude Code
https://claude.ai/code/session_01LGQKz579j1ZnDRwmr6h1V6
Generated by Claude Code