Skip to content

feat(prompts): portable command conventions and first-load tool surface slimming - #2036

Open
chris-beckman wants to merge 9 commits into
mainfrom
feat/portable-command-prompts
Open

chris-beckman wants to merge 9 commits into
mainfrom
feat/portable-command-prompts

Conversation

@chris-beckman

@chris-beckman chris-beckman commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Updates shared units, partials, personas, playbooks, and guidance (command-surface.md, tool-turn-batch.md, coordinator-text-and-citations.md, large-file-write-discipline.md, native-edit-tool.md, survey-first-pass.md, worker-tool-check.md, find-specifics.md, coordinator-mode-implement-dispatch.md, implement-spawn.md, implementer-scoped-file.md, continuation-record.md, rewrite-structurally.md, path-explorer.md, research-addenda.yaml, security-survey-addenda.yaml, _persona-contract.yaml) to teach expressive multi-statement portable command programs (repo-map, replace-lines, code-rewrite, jq-edit, rg -n, sed -n, pipes, chains, and loops) without pre-portable single-file/no-pipe restrictions.
  • Guards summarize in command-surface.md ({% if profile_has_summarize %}) and guards edit --path / replace-lines in native-edit-tool.md and large-file-write-discipline.md ({% if profile_command_mutation %}) so read-only command profiles never name mutation subcommands.
  • Removes retired http_request, process_list, and process_signal keys from CommandGuidanceFactKeys(), httpActionTools, and registeredCoordinatorBooleanGates.
  • Defers terminal_open, terminal_send, terminal_read, terminal_snapshot, and terminal_close on implement.yaml and secret_generate, secret_list, and secret_revoke on plan_write_only.yaml from sticky to true (loadable), and moves the same 8 tools from floor to loadable on implement_overlay_promote (coordinator-surfaces.yaml), detaching terminal-no-secrets-over-pty.md and managed-secret-tools.md from Turn 1 until requested via request_tools.
  • Removes the worker_tool_surfaces.implement exception (46000 -> fits default 40000 cap at 34,352 B) and tightens coordinator_tool_surfaces.implement_overlay_promote (82000 -> 44000, 41,148 B) in prompt-budgets.yaml while keeping all rendered personas and tripartite surfaces within default caps (plan-writer 18,386 B, widest coordinator turn 29,846 static tokens / 25.7% headroom, widest worker turn 23,635 static tokens / 41.1% headroom).
  • Adds retired_tool_ban_contract_test.go (TestRenderedStockCopyNeverNamesFullyRetiredTools, TestReadOnlyCommandProfilesNeverNameMutationSubcommands, TestRenderedPhaseKicksNeverNameFullyRetiredTools).

Testing

  • ./task budgets (0 violations, 0 exception_added)
  • LYCAON_DEV=1 go test -count=1 ./internal/prompts/... ./test/contract/agentcontext/... ./test/contract/prompts/...

CI fix (head 8b48074)

Both fast-tier failures fixed in two commits:

  1. 2c359b1f2f — the sessions contract requires terminal_open and terminal_close eager (allowed + sticky) on worker profiles; the first-load slimming had moved them to on-demand. Restored sticky for those two core tools (terminal_send, terminal_read, terminal_snapshot stay on demand), taught the mixed surface in visual-show-the-design.md (open with terminal_open, then load the rest with request_tools), and re-admitted the implement render with a worker_tool_surfaces.implement exception (cap 44000; renders at 40,195 B) since the two eager schemas exceed the default 40000 ceiling.
  2. 8b480744fb — the TestForegroundCancelsTitleAcrossAliases/stream=true deadlock is a pre-existing load-sensitive flake, not a PR regression: reproduced deterministically on pristine main (999afdfc1) by holding the cross-process extension lock. Mechanism: a cold guidance-catalog render inside the synctest bubble contends on the extension lock, whose five-second real-clock retry deadline collapses on the bubble's fake clock; the render fails, the summarizer returns before starting the provider, and the bubble deadlocks. Stabilized test-side: each subtest gets a private config root (catalog resolution never contends on the shared lock), and the body selects on the summarizer result so an early return fails with the real error instead of deadlocking.

Validation (m1 runner):

  • ./task test:digest -- ./test/contract/sessions/... ./internal/llm/... ./internal/prompts/... — passed, 24 packages, 2556 tests (receipt bd85eaa14aba41d58675d7462c1a06a7/00000000000000000001-320186474c2346739e0d08b996f28a39.json)
  • ./task budgets — passed (receipt 0dd505e763a94e57afb42268e6b5c535/00000000000000000001-b0dd83f6ffee480889c5a169cfeab506.json)
  • ./task lint:full -- --scope ./internal/prompts/... --scope ./internal/llm/... — scope stage 0 issues; the whole-program deadcode stage shows only the ~41 pre-existing linux-tagged darwin findings, none in touched packages
  • scripts/ci_policy/static-checks.sh — passed with the repo-pinned go1.26.10 toolchain (m1's default 1.27.3 gofmt flags two pre-existing files CI does not)
  • Deterministic probes: deadlock reproduced at the PR head and at main with the lock held; with the fix, the targeted test passes under the held lock, at -count=300, and under load at -count=150

…ls (PC04)

Implement the PC01 findings located in shared partials, shared units, and
survey guidance: teach multi-statement command programs (pipes, chains,
loops, multi-file edits) in tool-turn-batch and command-surface, replace
the false one-file-at-a-time and no-pipe restrictions in
coordinator-text-and-citations, name the whole-document replacement edits
behind the native edit limit in large-file-write-discipline, add rg -n and
the search-then-slice pattern to survey-first-pass, state that any
delivered source read establishes the edit base in native-edit-tool, fix
the worker-tool-check grammar seam, and repair the dangling offered-schema
sentence in find-specifics.

The clarified copy grows the widest coordinator tripartite artifact and
the plan-writer persona past their per-artifact caps, so
prompt-budgets.yaml admits both with reviewer-weighable exceptions.

Gates: go test ./test/contract/prompts/... ./test/contract/agentcontext/...
and the budgets suites (maintainability + prompts) pass.

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
…d guidance (PC05)

Update coordinator-mode-implement-dispatch, implement-spawn,
implementer-scoped-file, continuation-record, rewrite-structurally,
path-explorer, research-addenda, security-survey-addenda, and persona
contracts to use portable command registers (repo-map/survey_repo,
code-rewrite, must_substrings). Remove retired http_request,
process_list, and process_signal guidance fact keys from
CommandGuidanceFactKeys and httpActionTools.

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
…ening (PC10)

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
…s (PC10)

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
Move the five terminal_* tools on the implement worker profile and the
three secret_* tools on plan_write_only from sticky to true, and move the
same eight tools from the implement_overlay_promote floor to its loadable
list, matching implement_investigate. Their schemas and the attached
terminal-no-secrets-over-pty and managed-secret-tools units now load on
demand through request_tools, while the visual-show unit's
visual_show_terminal_needs_request branch teaches the held-terminal load.

worker_tool_surfaces.implement renders at 34,352 B, under the 40,000
default, so its exception is removed. implement_overlay_promote renders
at 41,148 B, so its exception cap tightens from 82,000 to 44,000 and its
reason no longer claims terminal and secret tools sit on the floor.

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
… tool ban contracts (PC10)

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
…profile

The sessions contract requires terminal_open and terminal_close to be
eager (allowed and sticky) on worker profiles; the first-load slimming
moved them to on-demand, failing
TestWorkerProfilesKeepCoreEagerAndOptionalCapabilitiesReachable.

Restore sticky for those two core tools, keeping terminal_send,
terminal_read, and terminal_snapshot on demand. Teach the mixed surface
in the visual evidence unit: open with terminal_open, then load the
remaining terminal tools with request_tools. The two eager schemas push
the implement render past the default worker ceiling, so re-admit it
with an exception stating the contract requirement.

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>
TestForegroundCancelsTitleAcrossAliases renders the title summarizer
inside a synctest bubble. When the guidance catalog is cold, that render
resolves the extension catalog and contends on the cross-process
extension lock, whose five-second real-clock retry deadline collapses on
the bubble's fake clock; the render fails, the summarizer returns before
starting the provider, and the bubble deadlocks. Reproduced
deterministically on pristine main by holding the lock file, so this is
a pre-existing load-sensitive flake, not a regression.

Give the subtest a private config root so catalog resolution never
contends on the shared lock, and select on the summarizer result so an
early return fails with the real error instead of deadlocking.

Signed-off-by: Chris Beckman <chris@paintedwolf.ai>

This branch has not been deployed

No deployments
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