oficina / equipo Public
READY AFTER FIXES
All findings are Important, ordered by impact. Hub citations refer to the locally inspected origin/main.
- Hosted enablement does not prove that a verdict came from hosted execution. Rule 2 checks only
on, but that field isDesiredOn(Hubinternal/hub/hosted_optin.go:152). Enabling hosted CI leaves existing verdicts intact (internal/repod/store_ci_hosted.go:102). The status endpoint returns the general commit verdict without execution provenance (internal/hub/ci_status_api.go:215). An earlier ordinary runner’s success can therefore becomeSandboxHosted, enabling automatic merge through gate.go:225. The claimed backup is also conditional: Hubinternal/repod/git_merge.go:443bypasses the green check when disabled, andinternal/repod/store_merge.go:38defaults it off.
Fix: Require trustworthy hosted-run provenance before granting sandboxed-check treatment; otherwise require confirmation. Add a contract covering an ordinary green result followed by hosted enablement, with the hub merge gate disabled.
- The response-to-report binding and second-read consistency rules are incomplete. Rules 4 and 7 require matching SHA and report metadata, but never explicitly require comparing the hub response’s namespace, repository and branch with the request before constructing that metadata. The hub supplies those fields (
internal/hub/ci_status_api.go:215). Rule 6’s secondlogs=failedrequest resolves the branch tip again (internal/hub/ci_status_api.go:191), so a branch move or rerun can attach another result’s names and logs to the first failure.reported_atis carried but has no validation rule.
Fix: Validate response identity before constructing Hosted; define and validate the timestamp. Build verdict, binding, names and logs from one validated response snapshot. If enrichment fails or changes identity, retain only evidence from the original snapshot or continue polling. Test wrong-response identity, branch movement, same-SHA reruns and failed enrichment. Validate bindings for hosted skipped, lost and stale reports too, rather than conditioning validation solely on a nonempty gate.
- Downgrading only the new fields can silently discard the authority evidence. A v5 runner may already hold a hosted dispatch or completed report when it reconnects to a v4 instance. Clearing
hostedpreservespassed, exit zero and gatehosted CI. The old judgement validator at tasks.go:1125 accepts that result without binding validation. The compatibility table covers fresh dispatches only.
Fix: Specify a semantic downgrade for existing hosted results, such as cannot_run/checks_unavailable, rather than stripping their evidence alone. Test queued and completed v5 work reconnecting at v4, plus strict decoding at every supported lower protocol. Preserve the accumulated downgrade-change flag when modifying runners.go:377.
- Runner state rollback is not transparent. Although dispatch bodies use
json.Unmarshal, startup recovery marks checks attemptsrunner_restarted; it does not execute the local gate (step.go:380). Completed reports pose another problem: unacknowledged outbox bodies remain raw JSON (state.go:194). An old runner sending to a v4 peer returns those frames unchanged from Encode at runners.go:366; the old receiver rejectshostedthrough frames.go:174.
Fix: Define a tested drain or conversion procedure before reusing v5 state with an old binary, or explicitly prohibit that rollback. Correct the recovery promise. Cover both persisted dispatches and unacknowledged hosted reports using the actual old reader.
- An hour-long polling call would monopolize the runner’s step queue. Engineering, review and specialist questions execute serially (step.go:553). Existing CI merge waits deliberately defer and release that queue (mergestep.go:106).
Fix: Specify deferred hosted polling with a persistent start/deadline, bounded requests and cancellation-aware waits. Define status-read error behavior after opting into hosted checks. Add tests proving unrelated work proceeds, cancellation and withdrawal stop polling, and reconnects do not reset the timeout. Explicitly test the chosen restart behavior.
- The new binding has no size budget. Bounding
Outputdoes not boundHosted.failed[]. A permitted 4 MiB response can produce a report exceeding the 256 KiB frame limit (api.go:452), causing repeated rejection of a durable report.
Fix: Bound failed-unit count, individual names and total serialized binding size before enqueueing and when accepting reports. Reserve frame space for existing fields. Test oversized names/lists and verify truncated feedback still identifies failures without breaking delivery.