oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

1READY AFTER FIXES
2
3All findings are **Important**, ordered by impact. Hub citations refer to the locally inspected `origin/main`.
4
51. **Hosted enablement does not prove that a verdict came from hosted execution.** Rule 2 checks only `on`, but that field is `DesiredOn` (Hub `internal/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 become `SandboxHosted`, enabling automatic merge through [gate.go:225](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/equipo/mergegate/gate.go:225). The claimed backup is also conditional: Hub `internal/repod/git_merge.go:443` bypasses the green check when disabled, and `internal/repod/store_merge.go:38` defaults it off.
6
7 **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.
8
92. **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 second `logs=failed` request 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_at` is carried but has no validation rule.
10
11 **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.
12
133. **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 `hosted` preserves `passed`, exit zero and gate `hosted CI`. The old [judgement validator at tasks.go:1125](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/equipo/chat/tasks.go:1125) accepts that result without binding validation. The compatibility table covers fresh dispatches only.
14
15 **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](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/wire/runners.go:377).
16
174. **Runner state rollback is not transparent.** Although dispatch bodies use `json.Unmarshal`, startup recovery marks checks attempts `runner_restarted`; it does not execute the local gate ([step.go:380](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/runner/thin/step.go:380)). Completed reports pose another problem: unacknowledged outbox bodies remain raw JSON ([state.go:194](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/runner/thin/state.go:194)). An old runner sending to a v4 peer returns those frames unchanged from [Encode at runners.go:366](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/wire/runners.go:366); the old receiver rejects `hosted` through [frames.go:174](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/wire/frames.go:174).
18
19 **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.
20
215. **An hour-long polling call would monopolize the runner’s step queue.** Engineering, review and specialist questions execute serially ([step.go:553](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/runner/thin/step.go:553)). Existing CI merge waits deliberately defer and release that queue ([mergestep.go:106](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/runner/thin/mergestep.go:106)).
22
23 **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.
24
256. **The new binding has no size budget.** Bounding `Output` does not bound `Hosted.failed[]`. A permitted 4 MiB response can produce a report exceeding the 256 KiB frame limit ([api.go:452](/home/paulca/amadan.net/oficina/equipo-release-s1/internal/wire/api.go:452)), causing repeated rejection of a durable report.
26
27 **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.