Skip to content

agent: remove the deterministic project-facts prompt section#417

Merged
FMXExpress merged 1 commit into
mainfrom
claude/keen-einstein-kPEMj
Jul 2, 2026
Merged

agent: remove the deterministic project-facts prompt section#417
FMXExpress merged 1 commit into
mainfrom
claude/keen-einstein-kPEMj

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

Removes the ## Project facts 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-unittest project Test: pytest <- run this to verify after code edits; the model obeyed, hit a misleading ImportError, 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/completions without 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 in BuildSystemPrompt (and the now-dead PromptWorkDir helper)
  • src/tests/project_facts_tests.pas + its test-project-facts Makefile target
  • The build-site bench fixture (workspace Makefile/.git) and the three assertions pinning the block

Verification

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_bytes 17,780 → 17,566; realtask unchanged at 11 provider calls with the same deliverable.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LGQKz579j1ZnDRwmr6h1V6


Generated by Claude Code

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
@FMXExpress FMXExpress merged commit 67dc368 into main Jul 2, 2026
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.

2 participants