Repository navigation
feat(runtime)!: load scoped workspace instructions - #5
Merged
Merged
Conversation
Load AGENTS.md with an absence-only CLAUDE.md fallback before provider work, strengthen the shared completion prompt, and persist prompt provenance on each run. Advance the wire protocol to version 6 for the new RunSnapshot prompt identity fields. Refs DEV-729
lg2m
added a commit
that referenced
this pull request
Sep 9, 2026
…across store lanes (H20) (#9) * chore(config): default the project model to xai/grok-4.6 * perf(session): wait for control admission instead of spinning on Overloaded Run-lifecycle store calls made on behalf of already-admitted work (cancellation reads, reserved starts, compaction load/start/commit, reserved reloads, history search, every settlement path, the scheduler's claim, prompt-identity, review-context and final-text reads) now use `Priority::AwaitControl`, which waits for a `control_slots` permit. The thirteen `sleep(1 ms)` retry loops that polled `Overloaded` from those calls in `execution.rs`, `scheduler.rs`, and `subagents.rs` are deleted, along with the 64-attempt history-search cap. `Overloaded` remains the immediate answer for new client commands, feed attachment, replay pages, snapshots, and child creation, so admission control at the boundary is unchanged. The scheduler's `reserve_next_run_at_depth` previously failed the whole runtime when the control lane was full during a claim; it now waits. Regression: `saturated_cancellation_read_and_start_wait_without_failing_ the_runtime`, `saturated_prepared_rejection_settles_and_keeps_priced_ accounting_known_zero`, and `saturated_reserved_reload_waits_after_auto_ compaction` saturate the real control lane (256 slots behind a held worker) instead of injecting `Overloaded`; `lifecycle_store_calls_wait_ for_capacity_while_client_commands_are_rejected` pins the lane split at the store. The injected-`Overloaded` test hooks that can no longer fire are removed. Part of H20 (speed-first plan, D8). No protocol, descriptor, or schema change. * perf(session): share the group commit with control writes and scheduler wakeups Attribution of the eight-stream output service gap showed it is fsync bound, not admission bound: each service round paid one group commit plus one fsync per interleaved control write (`command`, `start_reserved_run`, ~3 ms each on ext4/NVMe), and the scheduler's claim read (`reserve_next_run_at_depth`, issued after every settlement) closed almost every forming group at one or two jobs. Control-lane jobs now declare how they relate to a forming output group (`worker::Joins`): - `OutputGroup` (writes: commands, child creation/cancellation, run starts, settlements, prompt identity, recovery) join the group as savepoints and settle on its single commit. A control write dequeued when no group is open opens one, so consecutive writes share an fsync. The reply still waits for durability; persist-before-publish is unchanged. - `Never` (client reads: snapshots, replay pages, cancellation reads) runs alone and closes a forming group, so it is answered right after that commit and never observes uncommitted state. - `AfterGroup` (the scheduler's claim read) runs alone after the group commits but does not cut the group short; it is a wakeup, not a waiting client. At most one read is held per group and no further control message is dequeued once one is, so control-lane FIFO order is preserved. Interleaved A/B, 30 pairs, eight-streams focused fixture, medians / p95: completion 283.7/310.1 -> 209.8/228.4 ms; control latency upper bound 19.7/24.2 -> 15.9/18.4 ms; cancellation 25.9/29.8 -> 23.1/27.2 ms; output service gap 24/28 -> 20/33 ms (27 of 30 samples 18-22 ms; three outliers 33-38 ms; a 15-pair same-binary A/A shows 20/21-23 ms). RSS unchanged. Regression: `a_waiting_control_write_joins_the_output_group_and_a_read_ does_not`. Part of H20 (speed-first plan, D8). No protocol, descriptor, or schema change. * docs(plans): record H20 receipt, ADR-0011, and the fsync attribution - ADR-0011: one commit discipline across store lanes; wakeups do not close groups. Supersedes D8's admission-only framing. - architecture.md § Persistence: describe `Joins`, the two admission modes, and that commands, starts, and settlements share the stream's fsync. - speed-first plan: status block, D8 collapsed to its receipt and remaining acceptance, task index (H20 in review, H21 next), Phase 6 acceptance progress, cancel polls moved to H22. - Ledger: baseline, slice 1 A/B, the two probe attributions (fsync per control write; scheduler claim closing groups), and the H20 receipt with A/B and A/A tables. decisions-needed #5 resolved; root ADR allocation updated.
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AGENTS.mdinstructions before provider work, withCLAUDE.mdas an absence-only compatibility fallbackDesign
Workspace opening and root instruction loading share one bounded blocking hop. Instruction paths are resolved through the workspace capability, and the selected file is limited to 64 KiB. Nested scopes remain model-driven through the existing tools, so clients and adapters do not acquire competing instruction semantics.
Prompt identity is stored atomically as one validated object and exposed in run snapshots. Protocol version 6 and schema version 13 preserve legacy rows as an absent identity instead of guessing historical provenance.
Verification
cargo test --workspacecargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo build --workspaceCompatibility
This intentionally bumps the externally visible protocol from version 5 to 6 because run snapshots gain prompt provenance. Existing schema-v12 databases migrate to schema 13 with historical prompt identity left absent.
Linear: https://linear.app/lg2m/issue/DEV-729/runtime-load-scoped-workspace-instructions