| 1 | # Paused job contract clock |
| 2 | |
| 3 | 2026-11-26. Separate branch `fix/paused-job-clock`, based on plain main |
| 4 | `eb36731524663399e39a543080413d0dda0716ae`. No native task-view changes. |
| 5 | |
| 6 | ## Reproduction and cause |
| 7 | |
| 8 | At 02:48 UTC, on an unmodified checkout of main: |
| 9 | |
| 10 | ```sh |
| 11 | GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test -tags testbuild \ |
| 12 | ./internal/thintest -run '^TestContractPausedJob$' -count=1 |
| 13 | ``` |
| 14 | |
| 15 | FAIL at `assistant_paused_contract_test.go:175`: HTTP 409 |
| 16 | `carry_on_unavailable`, with a reset at 11:49. This is the same failure as |
| 17 | slice 3's Linux CI, so the Step projection is not responsible. |
| 18 | |
| 19 | `newTeamRigAt` sets housekeeping to today's noon, while the paused fixture |
| 20 | previously used the wall clock. At this hour, housekeeping sees newly running |
| 21 | work as hours old. A diagnostic overlay of the original test observed a |
| 22 | completed `triage_stall` housekeeping action before Carry on. The offer is no |
| 23 | longer available after that unrelated sweep. |
| 24 | |
| 25 | ## Change |
| 26 | |
| 27 | Only the paused contracts use a fixed chat clock, with housekeeping following |
| 28 | that same clock. Connection timestamps and allowance resets use it too. The |
| 29 | full contract runs at 02:30, 12:30 and 23:30 UTC on 2026-11-24; the unavailable |
| 30 | case uses 02:30. These resets avoid local midnight in Dublin and Tokyo, where |
| 31 | the reviewed words intentionally say midnight instead of a numeric time. |
| 32 | The response's started-at timestamp is checked against the injected clock. |
| 33 | |
| 34 | The real transport and stream quiet timers still use elapsed time. No |
| 35 | production behavior, copy, route, schema or native code changes. The thintest |
| 36 | line allowance increases by 13 to its measured 35085 lines for this fixture |
| 37 | and the three clock cases. |
| 38 | |
| 39 | ## Test first and mutations |
| 40 | |
| 41 | Before injection, the fixed-clock cases failed against the wall clock. After |
| 42 | injection, the public paused words, timestamp, time-zone changes, stream |
| 43 | compatibility, stale revision rejection, release and idempotency assertions |
| 44 | pass. |
| 45 | |
| 46 | ```sh |
| 47 | GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test -tags testbuild \ |
| 48 | ./internal/thintest -run '^TestContractPausedJob' -count=5 |
| 49 | ``` |
| 50 | |
| 51 | PASS: all three clock cases and the unavailable case, five times (15.236s). |
| 52 | |
| 53 | Each mutation used `go test -overlay=<mutation.json> -tags testbuild |
| 54 | ./internal/thintest -run '^TestContractPausedJob$/2$' -count=1`, leaving the |
| 55 | checkout intact. That regex selects both the 2 and 12 suffixes. |
| 56 | |
| 57 | | Mutation | Result | |
| 58 | | --- | --- | |
| 59 | | Remove chat `SetClock` injection | KILLED: paused words/timestamp no longer match the fixed reset. | |
| 60 | | Remove `SetHousekeepingClock(nil)` | KILLED: Carry on returns HTTP 409 `carry_on_unavailable`, reproducing the original regression. | |
| 61 | |
| 62 | ## Gates |
| 63 | |
| 64 | All commands use `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0`. |
| 65 | |
| 66 | - `make test-lane LANE=thintest-contract`: PASS. |
| 67 | - `GOOS=linux GOARCH=amd64 make build vet`: PASS, including the Makefile's Darwin runner checks. Linux targeting avoids the known Darwin `unix.O_PATH` toolproxy compile error. |
| 68 | - `make fmt-check lanes-check budget copy-release-check`: PASS. `fmt-check` uses the pinned toolchain's bin directory on PATH. |
| 69 | - staticcheck v0.7.0, `GOOS=linux GOARCH=amd64`, `-tags testbuild ./internal/thintest`: PASS. |
| 70 | - `make migration-check gitleaks`: PASS. |
| 71 | - Post-commit dead references and Linux CI are recorded with the handoff results. |
| 72 | |
| 73 | Linux hub CI is the full gate; the native gate is unchanged by this test-only |
| 74 | branch. Slice 3 remains separate at `dc5e8d8c`. Its `TestDependencyStage` |
| 75 | telemetry TempDir cleanup race is the known main flake the controller approved |
| 76 | rerunning; no changes for that race are included here. |
| 77 | |
| 78 | ## Second infrastructure commit: dependency fixture telemetry |
| 79 | |
| 80 | The first Linux CI run at `cf517c83` passed the paused contract and 28 of 29 |
| 81 | check shards. Only `TestDependencyStage` failed, twice, in TempDir cleanup; |
| 82 | perf was consequently skipped. The controller requested this separate second |
| 83 | commit on the same branch because the race also blocks main. |
| 84 | |
| 85 | The fixture already set `GOTELEMETRY=off`, but that environment variable does |
| 86 | not configure the Go tool's telemetry mode. A test-first assertion running |
| 87 | `go env GOTELEMETRY` with the exact child environment failed with `local`. |
| 88 | Go 1.26.11's `cmd/internal/telemetry` and vendored telemetry `start.go` read a |
| 89 | mode file and can start a sidecar that outlives the Go command. The shell runs |
| 90 | its Go command synchronously and `CombinedOutput` waits for the shell; there |
| 91 | is no un-awaited application child in this test. |
| 92 | |
| 93 | A Linux `strace -ff -ttt -e trace=process,file` of the original test confirmed |
| 94 | the writer: `go mod download` exited at timestamp `1795662290.018607`, but its |
| 95 | `** telemetry **` sidecar created the fixture HOME's |
| 96 | `.config/go/telemetry/upload` at `1795662290.024016`. Thus command completion |
| 97 | does not guarantee that the fixture HOME has no writers. |
| 98 | |
| 99 | The test now reuses `telemetryOffConfig` to write the off mode, and supplies |
| 100 | Go's `TEST_TELEMETRY_DIR` override so the same configuration works on Linux |
| 101 | and macOS. It keeps `GOTELEMETRY=off` too and asserts Go's effective mode is |
| 102 | actually off. Its child HOME, TMPDIR, GOMODCACHE and GOCACHE live in a dedicated |
| 103 | TempDir created before the source tree, so it is removed last. A failed child |
| 104 | also logs its execution error. Production code is unchanged; no retries, |
| 105 | cleanup suppression, global environment changes or sleeps were added. |
| 106 | |
| 107 | Validation: |
| 108 | |
| 109 | - Linux arm64 container, pinned Go 1.26.11 on PATH, CGO disabled. Four concurrent |
| 110 | `yes >/dev/null` processes provided CPU load and were killed on exit. |
| 111 | `go test ./internal/runner/checks -run '^TestDependencyStage$' -count=50`: |
| 112 | **PASS, 1.239s**. The unmodified fixture also passed 50 runs locally under |
| 113 | that load; the CI failure remains the observed cleanup reproduction. |
| 114 | - Fixed Linux strace: **zero telemetry sidecar execs**, versus three in the |
| 115 | original trace. Only the fixture itself creates the configured directory. |
| 116 | - Mutations, each through a Go overlay with `-count=1`: remove the telemetry |
| 117 | directory override, and change the off-mode file to local. **Both KILLED** |
| 118 | by the effective-mode assertion (`local`, wanted `off`). |
| 119 | - macOS catches the same original effective-mode failure. Its stress run |
| 120 | cannot exercise the stage because the existing command uses `/usr/bin/bash`, |
| 121 | absent on this Mac; the execution diagnostic records that limitation. |
| 122 | - The full checks package was attempted in the minimal Linux container; its |
| 123 | sandbox integration tests require the Codex binary and fail because it is |
| 124 | absent there. Full integration remains the equipped Linux CI gate. |
| 125 | - Linux-target staticcheck v0.7.0 for `./internal/runner/checks`: PASS. |
| 126 | - `make fmt-check lanes-check budget`: PASS. The existing checks directory |
| 127 | allowance covers the added fixture assertions. |
| 128 | - Evidence (logs, overlays and original/fixed strace archive) is retained in |
| 129 | `site/build/slice3/delta-validation/paused-job-clock/` in the audit checkout. |
| 130 | |