Repository navigation
Server parity: accept PHP operator metrics read across its redispatch steps - #708
Conversation
PHP's repair pass raises the task's repair count and projects the run in one transaction, then stamps the dispatch and projects the run again in a separate step. Operator metrics reads runs, tasks and backlog without a shared snapshot, so one response can straddle those steps. Model the four PHP states and accept reads that never go backwards in read order; native must still report one consistent state.
Security review finding — blocking on exact head
|
Published Workflow aca7928484 reads each operator metrics value with its own query, so one section can straddle a repair. The PHP-only model now matches eight state-dependent reads in their real order, including the timestamps read before their counts, and reads each health warning from its own field. Native stays strict.
|
Security follow-up on corrected head 6b6757e: the exact pinned-image comparator command passes 2,031/2,031 tests, including all 63 corrected operator-metrics cases; the next isolated commands pass 10/10 and 7/7. Hosted run 40017239524 nevertheless has one later failure in execution-and-codec job 120644918290, with five database cells still active, so this head is not accepted or merge-ready. It is also now five non-overlapping commits behind main f67f281. Preserve the current run for its decisive evidence, classify the exact failed command when logs release, then integrate current main and return a fresh exact head for required checks. |
|
Security follow-up on Shared Server fixtures run 40017239524, attempt 1:
Attempt 2 is repeatability evidence and does not erase either original. This head also cannot be the final merge candidate: main is now 0667ba7 and 13 commits ahead. Integrate current main, retain/link the two owning corrections, and run a fresh exact head before merge. |
|
Security terminal disposition for retry run 40017239524: both selectively rerun jobs passed on unchanged stale head
This establishes that both original observations are nondeterministic; it does not erase or supersede them. The query teardown race still requires accepted #720, and the SQLite typed poll refusal remains owned by #721 / Python SDK #218. This #708 head is also behind current main. Do not merge or treat retry success as publication qualification: integrate the owning corrections and current main, re-review the exact combined head, then run a fresh complete hosted matrix. Original failed jobs 120644918290 and 120644918636 remain evidence. |
|



Part of #325.
Problem
On #673's parity run 39995620421, the Shared Server fixtures failed on PostgreSQL 17 and MySQL 8.0. Published PHP 2.11.1 failed the
operator-metricscontract atwaiting_after_redispatch; the diff came before any PHP pass line.PHP's repair pass redispatches the overdue task in two steps:
TaskWatchdog::recoverExistingTaskraises the repair count and projects the run asrepair_needed, in one transaction.TaskDispatcher::markDispatchedstamps the dispatch, andrefreshRunSummaryprojects the run again, separately.Published Workflow
aca7928484'sOperatorMetrics::snapshotreads each value with its own query, with no shared snapshot, even inside one section. So one response can straddle the steps. The contract refused two such shapes from CI:repair_needed;Security's review of the first head (
3fa5cd5288, comment 6373392835) found that a section-level model was not enough. A forward-only change can split thetaskssection itself, and a timestamp read before its count can outlive it.Change
The contract models PHP's four states: overdue, repairing, dispatched, and redispatched.
For published PHP only, the stage follows the actual query order of the eight values that depend on the state:
oldest_repair_needed_at, thenrepair_needed;oldest_dispatch_overdue_sinceandoldest_unhealthy_at, thendispatch_overdue,max_repair_count, and theunhealthyrecount;unhealthy_tasks, thenrepair_needed_runs.A response passes when a sequence of states that never goes backwards in that order produces exactly its counts and timestamps.
Health reads its own snapshot after the metrics. Each warning follows the field it reads:
task_transportfollowstasks.unhealthy,routing_healthfollowstasks.dispatch_overdue, anddurable_resume_pathsfollowsbacklog.repair_needed_runs.Native must still report one consistent state, with each timestamp present exactly when its count is.
The contract header now names published Server 2.11.1.
The decision and the review correction are recorded in
docs/rust-server-port-checkpoints/2026-10-23-operator-metrics-redispatch-states.md.Checks
6b6757e7e: 5,504 tests, 5,502 pass, 1 intended skip. The one failure (PhpImageContextTest) runs Docker and cannot run inside the plain Node container; it is unrelated to this change.