Skip to content

(MOT-4187) feat(iii-directory): pre-generate skills-index guidance hook - #574

Open
rohitg00 wants to merge 4 commits into
mainfrom
feat/directory-guidance-hook
Open

(MOT-4187) feat(iii-directory): pre-generate skills-index guidance hook#574
rohitg00 wants to merge 4 commits into
mainfrom
feat/directory-guidance-hook

Conversation

@rohitg00

@rohitg00 rohitg00 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Problem

Harness agents discover functions live (engine::functions::list/info) but nothing tells them the skills layer exists. directory::skills::index renders a token-light per-worker map, yet an agent only reaches for it by luck: asked "what can each connected worker do", a test agent dumped the raw functions list and answered from ids alone.

Change

New src/guidance.rs, mirroring the fp worker's guidance hook: register directory::inject-guidance and bind it to harness::hook::pre-generate with on_error: fail_open (mandatory: pre_generate defaults fail-closed, and a missing pointer must never block a turn). While iii-directory is connected and inject_guidance: true is set, a short pointer to directory::skills::index is appended to the system prompt.

The hook is gated behind a new inject_guidance config field, default false: iii-directory sits in the default harness stack (including the harness integration e2e), and mutating every deployment's prompts is an operator decision, not a side effect of installing the worker. The first push had it always-on and the harness e2e correctly failed on the changed prompts; default-off keeps a stock deployment byte-identical.

Pointer, not content: roughly 120 tokens per generation, and the index body (~1k tokens) is paid only when the agent actually calls the function. No-op when the base prompt is empty (schema-drift safety, preserves the harness's assembled prompt) or when it already mentions the index function.

Proven on a live rig: with the pointer injected, the same question produced exactly one call, directory::skills::index, and a grounded per-worker answer.

Tests

Five unit tests: no-op on empty base, no-op on already-covered base, pointer append, empty-mutations wire shape, and the registry publish-gate schema test (response_schema_passes_the_publish_typed_gate) that fp and web carry. cargo fmt --check, clippy --all-targets --all-features -D warnings, cargo test --lib (254) pass.

Refs MOT-4187

Agents discover functions live but nothing tells them the skills layer
exists. Bind a harness::hook::pre-generate trigger (fail_open, mandatory:
pre_generate defaults fail-closed) that appends a short pointer to
directory::skills::index to the system prompt while this worker is
connected. Pointer only, not content: the index body costs context only
when an agent actually calls the function. No-op when the base prompt is
empty or already mentions the index. Mirrors the fp worker's guidance
hook, including the registry publish-gate schema test.
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment Jul 24, 2026 10:46am
workers-tech-spec Ready Ready Preview, Comment Jul 24, 2026 10:46am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@rohitg00, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d0474821-1f07-49c2-83b7-f36e2308e87e

📥 Commits

Reviewing files that changed from the base of the PR and between fd99b20 and f974f6d.

📒 Files selected for processing (6)
  • iii-directory/README.md
  • iii-directory/src/config.rs
  • iii-directory/src/configuration.rs
  • iii-directory/src/guidance.rs
  • iii-directory/src/lib.rs
  • iii-directory/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/directory-guidance-hook

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 48 skipped (no docs/).

Layer Result
structure
vale
ai
render

Four for four. Nicely done.

@rohitg00 rohitg00 changed the title feat(iii-directory): pre-generate skills-index guidance hook (MOT-4187) feat(iii-directory): pre-generate skills-index guidance hook Jul 23, 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.

1 participant