Skip to content

refactor(agents): privatize system prompt helpers - #106965

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/system-prompt-private-helpers
Jul 14, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/system-prompt-private-helpers

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Removes three system-prompt implementation helpers from the repository's unused-export baseline. Production only calls them inside buildAgentSystemPrompt, while direct test imports made internal prompt assembly look like a supported module API.

Why This Change Was Made

Make the bootstrap context, bootstrap section, and runtime-line builders module-private. Their behavioral assertions now run through buildAgentSystemPrompt, preserving full/limited/none bootstrap wording, context de-duplication, runtime identity, and isolated-cron cache stability at the public owner boundary.

User Impact

No prompt output changes. The public prompt builder keeps the same behavior while the internal API surface and duplicated test seams are smaller.

Evidence

  • Exact source search leaves only owner-local production calls; a fresh codebase-memory graph resolves the same three internal edges.
  • Codebase-memory index: 313,819 nodes / 1,302,087 edges.
  • pnpm test:serial src/agents/system-prompt.test.ts: 93/93 passed on Linux.
  • pnpm deadcode:exports: baseline matched 1,164 entries.
  • pnpm plugin-sdk:api:check: generated SDK baseline unchanged.
  • pnpm check:changed -- scripts/deadcode-exports.baseline.mjs src/agents/system-prompt.ts src/agents/system-prompt.test.ts: passed.
  • Blacksmith Testbox: tbx_01kxf36gajn6ebafpna8gset3y.
  • Fresh gpt-5.6-sol medium branch review: 0.99, no findings.

AI-assisted: yes. No transcript attached.

@vincentkoc vincentkoc self-assigned this Jul 14, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Jul 14, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review July 14, 2026 01:26
@vincentkoc

Copy link
Copy Markdown
Member Author

Land-ready proof for b6c0a90a59776fc96c1310b3f724d3d1ce44dcf4:

  • Exact codebase-memory graph: 313,819 nodes / 1,302,087 edges; the three helpers have only owner-module callers after the patch.
  • Testbox tbx_01kxf36gajn6ebafpna8gset3y: pnpm test:serial src/agents/system-prompt.test.ts passed 93/93.
  • Testbox: pnpm deadcode:exports passed with baseline 1,164.
  • Testbox: pnpm plugin-sdk:api:check passed.
  • Testbox: exact pnpm check:changed for all three touched paths passed.
  • Fresh gpt-5.6-sol medium autoreview completed clean at 0.99.
  • scripts/pr review-validate-artifacts 106965 passed with zero findings and a best-fix verdict.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 106965 passed in hosted_exact_or_recent_rebase mode and verified the remote PR tree matches the prepared head.

No docs or changelog change is required; this narrows internal exports without changing prompt behavior.

@vincentkoc
vincentkoc merged commit e330e4a into main Jul 14, 2026
125 of 129 checks passed
@vincentkoc
vincentkoc deleted the refactor/system-prompt-private-helpers branch July 14, 2026 01:27
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant