(MOT-4164) iii-directory: pre-generate hook injecting a compact skills index - #561
(MOT-4164) iii-directory: pre-generate hook injecting a compact skills index#561rohitg00 wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
skill-check — worker0 verified, 47 skipped (no docs/).
Four for four. Nicely done. |
|
Warning Review limit reached
Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 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 |
…d in the index hook
What
A
harness::hook::pre-generatebinding that appends a compact installed-skills index to the agent system prompt on every generation:src/inject_index.rs, modeled line-for-line onfp/src/guidance.rs: engine parks the binding until the harness registers the trigger type,on_error: fail_openso a failure can never block a turn, empty-base guard so schema drift preserves the assembled prompt.scan_skills_merged(one row per worker overview, teaser from frontmatterdescription), 10 s cache, per-line and whole-section caps with an explicit truncation pointer. No engine calls in the hook path.inject_indexconfig knob, defaultfalse(opt-in). Read on every fire, so the configuration worker toggle takes effect without a restart or rebind.Why
Agents currently learn what exists either from a hardcoded prompt (grows forever, drifts) or a discovery call (a turn and a round trip). With this hook the capability map arrives with the prompt, always current, and its cost scales with what is actually installed instead of with what the prompt author anticipated. fp proved the pattern for usage guidance; this generalizes it to discovery.
Pairs with #558 and #560: the minimal core stays static, per-worker guidance rides presence-gated hooks, deep playbooks are pulled on demand.
Status: live-validated on a rig
Ran the branch build as a second directory worker against a live engine (0.21.6, harness 1.4.2) and walked the full checklist:
{"mutations": {}}whileinject_indexis false.fail_openplus the binding dying with the worker connection).The live run caught one real bug the unit tests could not: the scanner aliases
<worker>/SKILL.mdto the on-disk id<worker>/index, so the original single-segment overview filter matched nothing and the index was always empty. Fixed with an explicitoverview_workermatcher plus a regression test.Two operational observations from the same run, for reviewers: with two instances of the worker connected, the configuration-update event load-balances to one of them, so the other keeps the old snapshot until reboot (inherent to duplicate instances, not this hook); and the hook function is invisible to
engine::functions::listsearch because it registers withinternal: truemetadata, which is intended.Draft: design review wanted, especially default-off vs default-on and the index format.
Linear
Closes MOT-4164. Part of MOT-4157.
Post-review simplification (applied)
A structured cleanup pass reworked the hook onto the canonical machinery: the injected text is now exactly
directory::skills::index, built by a sharedskills::build_indexused by both the function handler and the hook, so overview classification (type: indexclause included), teaser resolution, and the never-drop-a-worker budget policy cannot drift between the two surfaces. The cache rebuild moved outside the lock (concurrent generations are never serialized behind it) and the worker filter runs through the stale-tolerant registered-workers cache. Live re-validated: 19 installed workers injected, config gate and restore verified.