Skip to content

I3304 — A prompt reaches the model within a declared capture budget, and no captured record is lost

Declare a latency budget for the UserPromptSubmit and SessionStart hooks in benchmark policy, meet it by handing the capture to the running shared server (or a durable outbox) instead of a cold executable start, and prove no record is lost.

READY wave 0 · p2 · implementation profile · parallel safe

Part of a-provider-carries-the-contract-natively — Each agent client carries the contract through its own extension points, generated once and checked for drift.

Ready. Every dependency is done, so majordomus plan start I3304 will be accepted.

Objective

Declare a latency budget for the UserPromptSubmit and SessionStart hooks in benchmark policy, meet it by handing the capture to the running shared server (or a durable outbox) instead of a cold executable start, and prove no record is lost.

Why

Measured 2026-09-10: the capture hook cost about 4 s per prompt, all cold start, and backgrounding it lost every record (lib/capture.sh:2244). The owner's standing order since then is that hooks never slow the owner down. Rebound to the new intent criterion #hooks-within-budget, because the hooks this intent generates (Stop per turn, edit guard per edit) carry the same cold-start cost. Milestone development-runtime belongs to no intent, so moving this issue there would leave it unbound. It extends milestone development-runtime. Sources: chatgpt-majordomus:c099#0, chatgpt-majordomus:c099#3, chatgpt-majordomus:c099#9.

Current state

Every lifecycle event is inline (mj_lifecycle_latency prints inline); policy.yaml declares prompt-capture with no budget.

Desired state

bench --check holds the budget; a case proves every prompt of a burst is recorded.

Scope

  • lib/capture.sh
  • .claude/hooks
  • apps/majordomus-cli/src/capability/builtin/lifecycle.rs
  • .ai/repo/benchmarks/rust/policy.yaml
  • .ai/repo/benchmarks/rust/README.md
  • .ai/repo/policy.yaml
  • apps/majordomus-cli/src/bench/system.rs
  • test/cases/29_prompt_capture.sh

Dependencies

None. This issue is a root of the graph.

What waits on this

Acceptance criteria

  • The hook's p95 is under the declared budget with the server running
  • A burst of prompts yields one record each
  • With no server the hook degrades to inline capture, never to loss
  • The declared budget covers every generated hook that runs per prompt, per turn or per edit (capture, Stop report, edit guard), not only prompt capture

Validation

  • majordomus bench --check
  • bash test/run.sh 29_prompt_capture

Evidence required

  • bench_prompt_capture
  • case_no_prompt_record_is_lost

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Timeline

started
—
verified
—
completed
—

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I3304.yaml. Read it back with majordomus plan show I3304.

Searches the titles and descriptions of every page this site publishes.