(MOT-4162) harness: minimal identity prompt + on-demand agent playbook skills - #558
(MOT-4162) harness: minimal identity prompt + on-demand agent playbook skills#558rohitg00 wants to merge 6 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe default harness prompt now enforces contract-first function calls and delegates orchestration, finishing, and building guidance to on-demand skill playbooks. Prompt tests load these playbooks directly and validate their key invariants. ChangesHarness playbook extraction
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
skill-check — worker0 verified, 49 skipped (no docs/).
Four for four. Nicely done. |
The docs moved SDK references from /docs/api-reference/sdk-* to /docs/reference/sdk-*, and the engine wire protocol page lives at /docs/reference/engine-protocol; the old paths 404. Verified live: old paths return 404, new paths return 200 and serve markdown with the .md suffix. Updated the playbook and the prompt invariants that pin the URLs.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@harness/prompts/default.txt`:
- Around line 21-35: Update the discovery and contract-retrieval instructions in
Steps 1–2 to apply only to undocumented function ids. Explicitly exempt
documented calls such as directory::skills::get, registry calls, and
harness::react trigger targets, while preserving the existing discovery
requirements for all other functions and the documented batching and re-fetch
exceptions.
In `@harness/skills/finishing.md`:
- Around line 21-26: Update Step 3 in the validator registration guidance to
limit parent_session_id filters to children spawned within the current turn. For
trigger-fired or direct-spawn fan-outs without parent links, require per-child
session_id subscriptions or state-key joins so completions reach the validator
and turn_complete is written.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99bdfe6e-1087-42d2-8041-d3ab40a3180f
📒 Files selected for processing (6)
harness/prompts/default.txtharness/skills/SKILL.mdharness/skills/building.mdharness/skills/finishing.mdharness/skills/orchestration.mdharness/src/prompt/tests.rs
…caveat Step 2 now states explicitly that functions documented in the prompt (the discovery functions and directory::skills::get) skip the find-id and get-contract steps; everything else keeps the full discipline. finishing.md Step 3 documents the parent_session_id boundary: the filter only matches children that carry the parent link (direct spawns from the session, or reaction spawns whose metadata names it). Reaction- or wave-dispatched children without the link need the run-scope state keys or an explicit per-child join, otherwise their completions never reach the validator and turn_complete is never written.
Resolves against the prompt-evaluation work that landed in #595, which edited the same sections this branch moves out of the identity prompt. - `default.txt` keeps this branch's trimmed identity. The `curl` prohibition is dropped with it: the web worker has injected that rule through its own pre-generate hook since #385, so the line was a stale duplicate that also fired on rigs without the web worker installed. - #595's dispatch doctrine (audit every resolved resource selector before dispatching; derive a per-run namespace suffix and confirm the namespace is absent) moves into `harness/skills/orchestration.md`, which now owns spawn and reaction mechanics. - #595 also corrected the reaction session semantics: an ordinary event reaction MUST omit `metadata.session_id`, and every event then creates a fresh distinct child under the resolved console root. The playbook still carried the older rule, that omitting it delivers back into the registering chat, so it was describing behaviour the runtime no longer has. Same for `once`, which is a top-level registration field and is standing by default on join predecessor edges. - The three tests #595 added assert that doctrine against the identity prompt. They now assert it against the orchestration playbook, which is where the text lives after this branch.
What
prompts/default.txtshrinks from ~9,450 to 1,676 tokens (tokenizer-measured viacontext::count-tokens). The universal call loop, discovery surface, payload and error rules, security, and conventions stay.skills/orchestration.md(3,686 tok),skills/finishing.md(2,362 tok), andskills/building.md(1,172 tok). iii-directory already serves worker-shipped skills, so agents pull them asharness/orchestration,harness/finishing,harness/building. The prompt instructs: pull the matching playbook BEFORE the first action of that kind, once per session.prompt/tests.rskeeps every content invariant. Tests for moved sections now pin the skill files viainclude_str!, so the doctrine stays test-locked exactly as before; two new tests pin the skill pointers and playbook contents.metadata.session_id, and every event then creates a fresh distinct child under the resolved console root.Why
Test evidence
Live A/B on a rig (engine 0.21.6, harness 1.4.2, claude-sonnet-5, 13 sessions): identical task set, baseline identity prompt vs this minimal core via the router operator override.
harness/orchestrationbefore its firstengine::register_triggerandharness::spawn, unpromptedFAILED:first line,@fnpills)Note: the rig ran harness 1.4.2, where an in-turn spawn still parks and returns the child result; the playbook text intentionally keeps the 1.5.x fire-and-forget doctrine and was not weakened by that observation.
Rollout
default.txtis the router-absent fallback, so this PR alone changes behavior only on rigs without a provider identity prompt.auto_downloadcovers new adds).Draft: direction review wanted before the provider prompts move.
Linear
Closes MOT-4162. Part of MOT-4157.
Coordination
shell::*/coder::*steps insidefp::pipeunder the forwarded fs_scope; the finishing playbook paragraph listing them as refused in a pipe gets updated once that lands.Update: merged main (2026-07-27)
mainmoved under this branch while it sat open, so it is merged in rather than left conflicting. Three things came out of that:curlprohibition is gone from the identity prompt. The web worker has injected that rule through its own presence-gated pre-generate hook since feat(web): self-inject web::fetch guidance via pre-generate hook #385, so the line indefault.txtwas a stale duplicate. It also fired on rigs without the web worker installed, where it names a capability that is not there.skills/orchestration.mdalongside the spawn mechanics they belong to.metadata.session_iddelivers back into the registering chat. The runtime no longer behaves that way, so the playbook was describing behaviour that had already changed.onceis likewise documented as a top-level registration field that is standing by default on join predecessor edges.The three tests #595 added assert that doctrine against the identity prompt. They now assert it against the orchestration playbook, which is where the text lives after this branch.
cargo test --all-featuresis green at 295 lib tests, andcargo fmt --checkandcargo clippy --all-targets --all-features -- -D warningsboth pass.Summary by CodeRabbit
Documentation
Tests