Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c00b11f
Deliver bound scheduling clients on qualified backend
codex Nov 18, 2026
b37cf3e
Carry reviewed administration fixes through scheduling clients
benhook1013 Nov 18, 2026
3f2d146
Merge branch 'dot/pr84-parent-carry-20261118' into dot/pr102-parent-c…
benhook1013 Nov 18, 2026
c01564b
Merge commit '79e6bb2ea22366d69928f5fd55b8cc231f07f71b' into dot/pr10…
benhook1013 Nov 18, 2026
03aae9f
Merge updated scheduling backend parent after dependency merge
benhook1013 Nov 18, 2026
103e62c
Document per-PR scheduling tool authority
benhook1013 Nov 19, 2026
432955f
Prove scheduling help stays offline with a valid binding
benhook1013 Nov 19, 2026
25227c3
Synchronize the optional CLI response test fixture
benhook1013 Nov 19, 2026
b213e71
Refresh scheduling clients against the qualified backend parent
benhook1013 Nov 19, 2026
66fb4a8
Decode restarted scheduling pause into a fresh fixture
benhook1013 Nov 19, 2026
4e1752b
Merge commit 'c2928f751ddf83749547aec12835bf4ed554557e' into HEAD
benhook1013 Nov 19, 2026
b0e32c1
Exercise competing queued diagnostics in held-state test
benhook1013 Nov 19, 2026
4e8072b
Carry scheduling clients onto reviewed queue parent
benhook1013 Nov 19, 2026
ce9e5b5
Carry scheduling clients onto current reviewed parent
benhook1013 Nov 19, 2026
61a7b9d
Carry the current scheduling parent forward
benhook1013 Nov 20, 2026
3efb1da
Carry the qualified retirement-note parent into scheduling clients
benhook1013 Nov 20, 2026
7c67efb
Clarify scheduling client contracts
benhook1013 Nov 20, 2026
8ef11f2
Merge commit 'fcde591c21a5f1c8a6d9229fc9eb747249c6b05e' into HEAD
benhook1013 Nov 20, 2026
bab8ab3
Carry consistent startup test snapshot into scheduling clients
benhook1013 Nov 20, 2026
36fbc82
Carry qualified scheduling parent and clarify scheduling diagnostics
benhook1013 Nov 21, 2026
73a4ff5
Carry scheduling parent and correct client diagnostics
benhook1013 Nov 21, 2026
80520af
Carry scheduling snapshot format validation into review clients
benhook1013 Nov 21, 2026
a808372
Carry verified scheduling backend into FireController #102
benhook1013 Nov 22, 2026
4331304
Carry the verified front-snapshot ancestry into FireController #102
benhook1013 Nov 22, 2026
9f3adf3
Carry current #84 scheduling source into #102
benhook1013 Nov 22, 2026
63639c6
Carry the verified #84 parent into the #102 client stack
benhook1013 Nov 23, 2026
6749d2d
Carry the reviewed parent update into #102
benhook1013 Nov 24, 2026
ac28837
Carry scheduling review fixture and bound daemon test startup
benhook1013 Nov 24, 2026
b58e41a
Carry the latest guarded FireController parent without changing owned…
benhook1013 Nov 25, 2026
1e83e10
Carry the scheduler fixture correction without reopening review
benhook1013 Nov 25, 2026
0f8855c
Carry the durable automatic acceptance guard without changing owned s…
benhook1013 Nov 25, 2026
3af01ef
Carry detached wait custody without changing owned paths
benhook1013 Nov 25, 2026
f094ad8
Carry the historical wait test fixture correction
benhook1013 Nov 25, 2026
e0668eb
Carry scheduling evidence parent without changing reviewed scope
benhook1013 Nov 25, 2026
e74b85d
Carry bounded selection response diagnostics without scheduling changes
benhook1013 Nov 25, 2026
61c5f79
Carry typed selection finish rollback without lane changes
benhook1013 Nov 25, 2026
f2770eb
Carry typed unused-preparation handling without changing downstream b…
benhook1013 Nov 25, 2026
7bf107d
Carry reviewed scheduling behavior into scheduling clients
benhook1013 Nov 25, 2026
238a7ec
Carry scheduling review corrections through #102
benhook1013 Nov 25, 2026
4243a70
Carry scheduling review corrections through client slice
benhook1013 Nov 25, 2026
5bb6a7c
Carry no-child review settlement fix through client slice
benhook1013 Nov 25, 2026
1001459
Carry parent scheduling review fixes without changing this PR's own s…
benhook1013 Nov 27, 2026
05dd303
Align scheduling clients with automatic scheduling branch
benhook1013 Nov 28, 2026
49386ab
Carry atomic selection hold handling through review stack
benhook1013 Nov 28, 2026
475f7fe
Carry updated FireController parent into #102
benhook1013 Nov 29, 2026
be47b96
Carry parent review fixes into #102
benhook1013 Nov 29, 2026
595029d
Carry the updated FireController parent into PR #102
benhook1013 Nov 29, 2026
bb0e9cd
Carry updated FireController parent into PR #102
benhook1013 Nov 29, 2026
87c9772
Carry FireController stack changes
benhook1013 Nov 29, 2026
d5a5c7c
Carry scheduling fixture corrections from parent
benhook1013 Nov 29, 2026
742aaed
Carry reviewed scheduling recovery from parent
benhook1013 Nov 29, 2026
4c35671
Carry reviewed scheduler fixes into client stack
benhook1013 Nov 29, 2026
557e2ca
Carry scheduling qualification through client stack
benhook1013 Nov 29, 2026
5928558
Carry expanded qualification through client stack
benhook1013 Nov 29, 2026
b6d9ac5
Carry #115 batched review fixes into #102
benhook1013 Nov 29, 2026
342d7b1
Carry #84 source history proof into #102
benhook1013 Nov 29, 2026
c5e8aa3
Carry #115 review fixes into #102
benhook1013 Nov 29, 2026
ac8eabe
Carry #115 final review fixes into #102
benhook1013 Nov 29, 2026
e081d0e
Carry #115 review fixes into #102
benhook1013 Nov 29, 2026
2ae466e
Preserve combined tree after #115 test split on #102
benhook1013 Nov 29, 2026
aa614b0
Carry current main through #102
benhook1013 Nov 29, 2026
2167b5f
Carry #84 cooldown retention proof through #102
benhook1013 Nov 29, 2026
23df83f
Carry #123 qualification correction through #102
benhook1013 Nov 29, 2026
9e5c146
Carry shutdown test correction through the review stack
benhook1013 Nov 29, 2026
aedf854
Carry retained review fixes through FireController stack
benhook1013 Nov 29, 2026
c46706b
Carry confirmed CLI predecessor hold fix
benhook1013 Nov 29, 2026
016d4da
Align with #84 custody and cooldown verification
benhook1013 Nov 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmd/fcd/reviews_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ func TestDaemonExplicitCLICatalogStartsAndStopsWithoutProviderWork(t *testing.T)
case <-stdout.ready:
case code := <-done:
t.Fatalf("native startup failed: %d %s", code, stderr.String())
case <-time.After(5 * time.Second):
// Cold SQLite schema initialization can exceed five seconds under -race.
case <-time.After(20 * time.Second):
t.Fatal("native startup deadline")
}
var started map[string]string
Expand Down
6 changes: 5 additions & 1 deletion docs/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ Startup validates configuration without opening the credential or contacting the
| `inbox_events` | Required event cursor; optional limit and wait_ms 0–4000; one bounded incoming-event page. |
| `wait_for_messages` | Required event cursor; optional limit 1–100 and wait_seconds 1–50, default 20/25. One new-message event page or quiet timeout over a call-owned persistent stream. |
| `review_execution_read` | No fields; stored execution configuration and revision, without provider work. |
| `review_scheduling_read` | No fields; stored project scheduling settings, revision and paused queued PRs, without provider work. |
| `review_scheduling_configure` | Required idempotency_key/expected_revision/automatic_hosted; optional automatic_cli preserves its existing value when omitted. Project management capability configures [default-off automatic scheduling](review-scheduling.md), including authorization for later provider work within existing review limits. |
| `review_pull_scheduling_read` | Required pull_number; reads the per-PR pause for new and undispatched explicit and automatic reviews, and its revision. |
| `review_pull_scheduling_update` | Required idempotency_key/pull_number/expected_revision/paused; optional reason is accepted only when pausing. Changes the [per-PR scheduling pause](review-scheduling.md#pause-a-pr) while preserving review limits and retained request controls. |
| `review_operations_list` | Optional pull_number/channel/status/limit/cursor; one bounded page of retained operations, default five pending. No provider work or automatic continuation. |
| `review_operation_read` | Required operation_id; optional wait_seconds (0–50/default 0) and diagnostics (default false). Compact retained status and original Hosted observer freshness, or explicit full detail, without provider polling. |
| `review_operation_control` | Required operation_id/expected_revision/action/idempotency_key; action pause, resume or cancel applies guarded [retained request controls](retained-review-quota-controls.md#reading-state), preserving original authorization and attempt history. |
Expand Down Expand Up @@ -144,7 +148,7 @@ Review queue/run/attempt lists default to five entries; other limits use the API

[Job progress](job-progress.md) owns update/checklist content limits, independent revisions, explicit archives and integration proof. Checklist replacement can remove or replace effective items and is annotated destructive; its immutable history remains available. Job updates and checklist operations perform no provider work.

Mutations require the caller to retain an explicit key and request; the adapter never generates a replacement key or automatically retries. Job edits require the current expected revision; empty brief or worker clears that field. A dispatched write with a lost, canceled or invalid response returns `outcome_unknown` when a tool result can be delivered. Host cancellation may suppress that result, so absence of a reply is never proof of rollback. Recover using the original request, key and binding. The [MCP annotations](https://modelcontextprotocol.io/specification/2025-11-25/schema#toolannotations) distinguish reads from writes. Repeating identical arguments retains the same explicit key and has no additional effect; job edits and review decision/fix corrections can replace effective fields while retained history remains; creation/checkpoint/send/receipt transitions add records or handling state. Job, message and evidence controls operate within the configured service. `review_start`, `review_request`, `review_source_refresh`, `review_checkpoint_publish` and `review_checkpoint_recover` are annotated open-world because they authorize external provider work; a queued receipt does not establish started or completed execution. The [CLI recovery rules](development.md#explicit-agent-mutations) also apply.
Mutations require the caller to retain an explicit key and request; the adapter never generates a replacement key or automatically retries. Job edits require the current expected revision; empty brief or worker clears that field. A dispatched write with a lost, canceled or invalid response returns `outcome_unknown` when a tool result can be delivered. Host cancellation may suppress that result, so absence of a reply is never proof of rollback. Recover using the original request, key and binding. The [MCP annotations](https://modelcontextprotocol.io/specification/2025-11-25/schema#toolannotations) distinguish reads from writes. Repeating identical arguments retains the same explicit key and has no additional effect; job edits and review decision/fix corrections can replace effective fields while retained history remains; creation/checkpoint/send/receipt transitions add records or handling state. Job, message and evidence controls operate within the configured service. `review_scheduling_configure`, `review_start`, `review_request`, `review_source_refresh`, `review_checkpoint_publish` and `review_checkpoint_recover` are annotated open-world because they authorize external provider work; a queued receipt does not establish started or completed execution. `review_pull_scheduling_update` is also annotated open-world: resuming a PR can make it eligible for later automatic provider work within existing controls, but the update itself does not dispatch a review. The [CLI recovery rules](development.md#explicit-agent-mutations) also apply.

Explicit message, review-result, source-refresh and checkpoint waits are capped at 50 seconds in both discovery and argument validation. With the five-second service budget, these calls leave at least five seconds below a 60-second host tool deadline. Hosts with shorter configured limits need shorter requested waits. This MCP cap does not narrow CLI or typed-client limits. `wait_for_ci` accepts 0–900 seconds and is exempt from this 50-second cap. For waits over two seconds, its call budget is the selected wait plus fifteen seconds; shorter waits use fifteen seconds. Both are subject to an earlier host deadline. Configure the host tool deadline to cover that budget; the adapter shortens the forwarded wait to leave response time within any earlier deadline. See [CI waits](ci-wait.md) for reconnect and pinned-comparison behavior.

Expand Down
8 changes: 3 additions & 5 deletions docs/review-scheduling.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Source-slice boundary

This slice includes the scheduling engine, retained-state guards and HTTP API. Bound Go client, CLI and MCP controls and their packaged administration smoke are delivered in the dependent client slice. The current-review-progress browser consumer, its scoped live-event additions, generated assets and browser smoke workload are delivered in the dependent browser slice. Browser behavior and historical validation described below apply to that combined stack, not this intermediate scheduling tree.
This slice includes the scheduling engine, retained-state guards, HTTP API and CLI/MCP controls. The current-review-progress browser consumer, its scoped live-event additions, generated assets and browser smoke workload are delivered in the dependent browser slice. Browser behavior and historical validation described below apply to that combined stack, not this intermediate scheduling tree.

Projects can independently opt in to automatic new Hosted or CLI requests. Both default to off. Explicit CLI requests continue to work without enabling automatic selection; a proven quota refusal retains any accepted request through [durable CLI waiting](retained-review-quota-controls.md), without replacing that operation. Automatic GitHub observation and timer-backed retries of explicit requests are independent of this setting. Retries of automatically selected requests still require their channel to be continuously enabled. See [observation](github-observation.md) and [timer-backed waiting](retained-review-quota-controls.md).

## Automatic Hosted requests

A project manager enables scheduling through the HTTP API; bound CLI and MCP delivery follows in the dependent client slice. The separate browser scheduling control is not included in this source slice. Enabling binds authorization to that manager's exact credential and an active project worker. This project scheduling write requires bearer authentication and active project worker attribution. Browser sessions do not authorize this route. The controller rechecks that authorization before selection and dispatch. New selections use the current configured authorizer. An already selected automatic operation retains its original principal, worker and credential when a later manager changes settings. Any later scheduling revision requires complete durable history proving that the intent's own channel stayed enabled in every intervening revision, including when the authorizer is unchanged. Missing history or any disable/re-enable blocks continuation. An unchanged authorizer can finish a queued or selecting intent across a continuously enabled history, including unrelated-channel changes. When the current authorizer differs from the original authorizer, only an already selected operation can continue, and both authorizers must remain valid. An unselected CLI intent crossing a scheduling revision additionally needs the same explicit, writer-owned CLI basis in every revision. An unrelated-channel edit can preserve that basis; a missing basis or an authorizer change followed by a change back cannot prove CLI continuity. This preserves the existing operation and any quota timer rather than creating a replacement. A blocked queued operation reports `automation_authorization_changed` as a current diagnostic for manager investigation. Revoked credentials, lost management access, retired workers and restored-provider holds cannot authorize new work. The acceptance event records whether a new selection is explicit or automatic. Automatic selections and their children require matching retained scheduling attribution before selection, recovery or dispatch. Missing or conflicting attribution holds those requests. For older selections, a caller-supplied PR pin, an exact retained explicit mutation receipt, or complete retained history showing acceptance before automatic scheduling for that channel can establish explicit origin. An ambiguous legacy selection stays held. Current explicit authorization still applies.
A project manager enables scheduling through CLI, MCP or the HTTP API. The separate browser scheduling control is not included in this source slice. Enabling binds authorization to that manager's exact credential and an active project worker. This project scheduling write requires bearer authentication and active project worker attribution. Browser sessions do not authorize this route. The controller rechecks that authorization before selection and dispatch. New selections use the current configured authorizer. An already selected automatic operation retains its original principal, worker and credential when a later manager changes settings. Any later scheduling revision requires complete durable history proving that the intent's own channel stayed enabled in every intervening revision, including when the authorizer is unchanged. Missing history or any disable/re-enable blocks continuation. An unchanged authorizer can finish a queued or selecting intent across a continuously enabled history, including unrelated-channel changes. When the current authorizer differs from the original authorizer, only an already selected operation can continue, and both authorizers must remain valid. An unselected CLI intent crossing a scheduling revision additionally needs the same explicit, writer-owned CLI basis in every revision. An unrelated-channel edit can preserve that basis; a missing basis or an authorizer change followed by a change back cannot prove CLI continuity. This preserves the existing operation and any quota timer rather than creating a replacement. A blocked queued operation reports `automation_authorization_changed` as a current diagnostic for manager investigation. Revoked credentials, lost management access, retired workers and restored-provider holds cannot authorize new work. The acceptance event records whether a new selection is explicit or automatic. Automatic selections and their children require matching retained scheduling attribution before selection, recovery or dispatch. Missing or conflicting attribution holds those requests. For older selections, a caller-supplied PR pin, an exact retained explicit mutation receipt, or complete retained history showing acceptance before automatic scheduling for that channel can establish explicit origin. An ambiguous legacy selection stays held. Current explicit authorization still applies.

The scheduler uses the existing configured queue and ordinary durable selection/operation path. It checks eligible work at most once per five-second coordinator interval; this is not a promised start time or another GitHub polling loop. Source, dependency, publication, findings, routes, imported obligations, round limits, taper and provider guards still apply. Independent PRs can proceed while another awaits fixes; real dependencies retain predecessor guards. Retained scheduling validation failures prevent planning for the affected project; malformed shared scheduling state or unavailable shared authorization can affect both channels. Channel-front and source-retry selection validation failures, a retained parent cycle, or a planning basis above its row limit remain local to the affected project and channel. Independent projects continue, and channel-specific failures do not block the other channel. The execution supervisor skips these typed project-local refusals, and a damaged competing priority candidate cannot block a healthy project’s account claim. A deterministic basis refusal during selection settlement rolls back source and child writes and holds the original selection as `automatic_scheduling_unavailable`; it is not transient contention and does not enter the writer retry loop. The accepted basis remains available for duplicate suppression across ticks and restart. Startup validates the shared front-cache table definition without scanning optional cache rows. Damaged rows remain isolated by project/channel readers; backup and restore still validate the complete retained snapshot. Shared storage and transaction failures remain errors rather than being suppressed; arbitrary SQL failures are not classified as project-local corruption. Automatic requests never inherit out-of-order or file-limit overrides. Each project first plans in a bounded read-only snapshot. Only a candidate for a new intent or a due retained source retry enters the writer, which repeats authorization, configuration, policy, pause, busy and basis checks before ordinary atomic acceptance or retry. A changed plan waits for a later pass.

Expand All @@ -22,7 +22,7 @@ Results still require normal adjudication, finalization and fix evidence. Automa

## Automatic CLI requests

A project manager can explicitly enable `automatic_cli` through CLI, MCP or the project scheduling API. A future browser editor must preserve the CLI setting when editing Hosted configuration. Both settings use the retained manager credential and active worker, with the same authorization rechecks before selection and dispatch. Changing either setting uses the shared scheduling revision. Older Hosted-only writes omit `automatic_cli` and preserve its current value; explicit `false` disables new CLI automation.
A project manager can explicitly enable `automatic_cli` through CLI, MCP or the project scheduling API. A future browser editor must preserve the CLI setting when editing Hosted configuration. Both settings use the retained manager credential and active worker, with the same authorization rechecks before selection and dispatch. Changing either setting uses the shared scheduling revision. Older Hosted-only writes omit `automatic_cli` and preserve its current value; explicit `false` disables new CLI automation. Omission preserves the setting, not the shared authorizer: a successful write leaving either channel enabled records the acting manager credential and active worker for new automation, even if the write disables only the other channel.

Automatic CLI uses the ordinary durable channel-front selection and execution path, without out-of-order or file-limit overrides. Existing grants, maxima, taper, channel closure, exact current-head checks, source-owned predecessor dependencies, publication and adjudication requirements remain in force. No setting increases grants or adjudicates findings. A meaningful completed result or source/control change can authorize another selection; ticks, restart, failed attempts and cancellation alone cannot. CLI and Hosted results have separate intent digests, so a clean completion in the other channel does not recreate a cancelled request.

Expand All @@ -48,8 +48,6 @@ The existing queue and PR detail views show current round allowance, closure or

## CLI and MCP

These scheduling commands and tools require the dependent client slice. The backend slice exposes the scheduling HTTP API.

Read the current scheduling revision before changing settings. Keep the exact request and key after an uncertain mutation outcome; replaying the same key cannot enable or pause twice.

```sh
Expand Down
36 changes: 35 additions & 1 deletion internal/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type options struct {
}

type invocation struct {
reviewScheduling *reviewSchedulingInvocation
ownerManagement *ownerManagementInvocation
includeRetired bool
ciWatch *ciWatchInvocation
Expand Down Expand Up @@ -359,7 +360,7 @@ func RunContext(ctx context.Context, args []string, env map[string]string, stdou
if err != nil {
return reportClientError(stderr, err, ctx)
}
if call.reviewOperationControl != nil {
if call.reviewOperationControl != nil || call.reviewScheduling != nil && call.reviewScheduling.action != "read" {
encoded, err := json.Marshal(value)
if err == nil {
encoded = append(encoded, '\n')
Expand All @@ -382,6 +383,18 @@ func parseInvocation(args []string) (invocation, bool) {
remaining := make([]string, 0, len(args))
for i := 0; i < len(args); i++ {
argument := args[i]
// In scheduling pause, --reason owns its next token even when the
// literal reason resembles a global option. Profile selection is
// otherwise still processed in its normal positions.
if argument == "--reason" && len(remaining) >= 3 &&
remaining[0] == "reviews" && remaining[1] == "scheduling" && remaining[2] == "pause" {
remaining = append(remaining, argument)
if i+1 < len(args) {
i++
remaining = append(remaining, args[i])
}
continue
}
flag, value, assigned := strings.Cut(argument, "=")
if flag != "--profile" && flag != "--profiles-file" {
remaining = append(remaining, argument)
Expand Down Expand Up @@ -413,6 +426,27 @@ func parseInvocation(args []string) (invocation, bool) {
return call, false
}
call.command = remaining[0]
// Scheduling help is entirely local and has exact leaf grammar.
if len(remaining) >= 3 {
words := remaining
if words[0] == "help" {
words = words[1:]
} else if words[len(words)-1] == "--help" {
words = words[:len(words)-1]
} else {
words = nil
}
if len(words) == 2 || len(words) == 3 {
if words[0] == "reviews" && words[1] == "scheduling" {
name := strings.Join(words, " ")
if _, ok := operationHelp(name); ok {
call.operationHelp = name
return call, true
}
}
}
}

if len(remaining) == 2 && (remaining[1] == "help" || remaining[1] == "--help") && (call.command == "credentials" || call.command == "workers" || call.command == "reviews") {
call.operationHelp = call.command + " help"
return call, true
Expand Down
Loading
Loading