@@ -111,7 +111,23 @@ jobs:
111111
112112 test-sqlite :
113113 needs : [changes, lint]
114- if : github.event_name != 'schedule' && (github.event_name != 'pull_request' || needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' || needs.changes.outputs.workflows == 'true')
114+ # `docs` is in this condition and NOT in the other test jobs' on purpose.
115+ # Part of the suite this job runs takes documentation as its INPUT and
116+ # asserts on its content — tests_py/scripts/test_codex_plugin_contract.py
117+ # reads README.md and checks the canonical published identities (the
118+ # hypermnesia-mcp-viz anchor, the viz/spec migration strings). Excluding
119+ # '*.md' from the `code` filter therefore switched those guards OFF exactly
120+ # when their subject changed: PR #509 was a README-only diff, every test job
121+ # was skipped, it merged green, and the push to main went red on that test
122+ # across five jobs (run 34238410970, 2026-09-08 — 7663 passed, 1 failed;
123+ # fixed by #510).
124+ #
125+ # This job, not the 3.10-3.13 matrix, because it already runs THE FULL SUITE
126+ # (see the "Scope" note on its pytest step) in one ~5-minute job, so it
127+ # covers the doc-contract tests at the smallest cost that still closes the
128+ # gap. Waking the whole matrix on every prose edit would undo the CI work in
129+ # #475-#481.
130+ if : github.event_name != 'schedule' && (github.event_name != 'pull_request' || needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' || needs.changes.outputs.workflows == 'true' || needs.changes.outputs.docs == 'true')
115131 name : Test (SQLite backend)
116132 runs-on : ubuntu-latest
117133 # source: run 33806380625 (2026-09-03), max 292s; ceil(2 * 292 / 60).
@@ -262,8 +278,25 @@ jobs:
262278 # untrusted fork; same-repository PRs and main/workflow_dispatch remain
263279 # covered by this vendor-parser contract.
264280 runs-on : ubuntu-latest
265- # source: run 33951959734 (2026-09-05), max 61s; ceil(2 * 61 / 60).
266- timeout-minutes : 3
281+ # source: run 34217620888 job 102033099129 (2026-09-08), whole job 52s;
282+ # run 34210128951 job 102009142706 (2026-09-08), whole job 194s.
283+ # ceil(2 * 194 / 60) = 7.
284+ #
285+ # The former bound was ceil(2 * 61 / 60) = 3 from run 33951959734
286+ # (2026-09-05, max 61s). That 2x margin was computed against a sample
287+ # that never saw this job's real tail, and 180s sits INSIDE the range
288+ # of a legitimate passing run: the dominant cost is the last step's
289+ # `scripts/verify_mcp_hosts.py`, which boots the plugin through `uvx`
290+ # against a deliberately COLD uv cache (UV_CACHE_DIR/UV_TOOL_DIR under
291+ # RUNNER_TEMP, --allow-bootstrap-network), so it pays a full network
292+ # package resolve+build every run. Both samples above PASS the same
293+ # assertions and differ only in that bootstrap: 23.98s vs 179.86s
294+ # ("PASS codex-cli/lean: initialize + discovery + memory_stats
295+ # (10 tools, …)"), a 7.5x spread. The coldness is the point of the
296+ # test — it is the path a first-time user hits — so the variance
297+ # cannot be engineered away without destroying what the job asserts;
298+ # the bound has to cover the measured tail instead.
299+ timeout-minutes : 7
267300 permissions :
268301 contents : read
269302
@@ -889,7 +922,16 @@ jobs:
889922 if : github.event_name != 'pull_request' || needs.changes.outputs.code == 'true' || needs.changes.outputs.deps == 'true' || needs.changes.outputs.workflows == 'true' || needs.changes.outputs.docker == 'true'
890923 name : Docker Smoke (bare-container DB-less contract)
891924 runs-on : ubuntu-latest
892- # source: run 33951959734 (2026-09-05), max 369s; ceil(2 * 369 / 60).
925+ # source: run 34217523633 job 102032799571 (2026-09-08, push to main,
926+ # warm cache): whole job 242s, of which the build step 225s — the steady
927+ # state this bound is sized against; ceil(2 * 242 / 60) = 9, kept at 13
928+ # for headroom over the 369s tail measured on run 33951959734
929+ # (2026-09-05). The bound is NOT sized against a cold `mode=max` cache
930+ # EXPORT: run 34225008423 job 102057139452 (2026-09-08, PR #492) finished
931+ # building at 70.8s and was still in `exporting to GitHub Actions Cache`
932+ # when the 13-minute bound fired at 827s, so the smoke-test body never
933+ # ran. That export is removed from pull_request runs below rather than
934+ # budgeted for — see the cache-to comment.
893935 timeout-minutes : 13
894936 # BLOCKING: this job asserts the exact contract that silently broke for
895937 # two months (fix/bare-container-contract, commit 5d71069c) — third-party
@@ -922,7 +964,25 @@ jobs:
922964 tags : cortex-smoke:local
923965 load : true
924966 cache-from : type=gha
925- cache-to : type=gha,mode=max
967+ # Write the layer cache only on pushes to a branch, never on a
968+ # pull_request run. GitHub Actions scopes a cache entry to the ref
969+ # that created it: the default branch's entries are readable from
970+ # every branch, but an entry a PR run writes is readable only by
971+ # that same PR's later runs. This job runs once per head commit, so
972+ # a PR-written entry is exported and then never read — pure cost on
973+ # the critical path. `cache-from` is unconditional, so PRs keep
974+ # reading main's warm cache and the torch CPU-wheel layer is still
975+ # not re-downloaded.
976+ # source: GitHub Actions cache "Restrictions for accessing a cache"
977+ # (docs.github.com/actions/writing-workflows/choosing-what-your-
978+ # workflow-does/caching-dependencies-to-speed-up-workflows), and
979+ # the measurement below.
980+ # The condition is written as `!= 'pull_request' && <value> || ''`
981+ # and not `== 'pull_request' && '' || <value>`: GitHub expressions
982+ # return the operand, not a boolean, and the empty string is
983+ # falsy, so the latter form would fall through to <value> on
984+ # every event and disable nothing.
985+ cache-to : ${{ github.event_name != 'pull_request' && 'type=gha,mode=max' || '' }}
926986
927987 # Reuses the build above (load: true made it visible to the local
928988 # docker daemon) instead of rebuilding — scripts/docker_smoke.sh is the
0 commit comments