Skip to content

A green CI run still counts when the repository's artifact storage is full (GST-3231) - #4536

Merged
capy-ai[bot] merged 5 commits into
mainfrom
ci-results-count-when-artifact-storage-is-full
Nov 19, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
ci-results-count-when-artifact-storage-is-full

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

When a private repository's GitHub Actions artifact storage is full, a green run uploads no tree.json, so /ship and the merge checks could not reuse it and refused it as artifact_missing.
A run profile can now set tree_log_step, and gstack reads tree.json from the one GSTACK_TREE_JSON line that step printed in the job log, only when the run has no artifact and only when GitHub's own log timestamp puts the line inside that step.
To use it, add the one-line workflow step described under tree_log_step in the docs, and raise min_gstack_version to the release that ships this.

What changed
  • lib/run-evidence.ts: ghRunDeps().artifact throws NoArtifactError when the run has no unexpired artifact by that name. verifyRun then reads the profile jobs' logs at the attempt that ran (gh api --allow-escape-sequences repos/<repo>/actions/jobs/<id>/logs, new RunDeps.jobLog), and only for a profile with tree_log_step. An artifact always wins.
  • Exactly one line matching ^\S+Z GSTACK_TREE_JSON (\S+) ([A-Za-z0-9+/]+={0,2})\r?$ that names the profile's artifact must exist across those jobs. Zero, or two or more, refuse as artifact_missing with the count.
  • The line is bound by the timestamp GitHub's runner stamps on it, which a step's output cannot set. It must fall between the named step's start and finish, at least one second after every earlier step that ran ended and one second before every later step started, because the jobs API gives step times only to the second (the step runs sleep 1 before the line and sleep 2 after it). The job and the step must both have succeeded. A line a test prints, even a well-formed one, is either a second line or falls outside the step, so it refuses: tree_log_unbound / CI_CARRY_TREE_LOG_UNBOUND.
  • The decoded tree.json is capped at 8 MiB, must be canonical base64 that decodes to JSON, and then goes through every existing tree.json check unchanged.
  • Every line that reports a reused run now says tree_source=job-log when tree.json came from the log, and so does the saved CI record. /ship's final record stores it in its ci_carried entry, checked by its schema.
  • Docs: a new tree_log_step section with the workflow step to add, the key in the run_profiles key list, and a troubleshooting entry for CI_CARRY_TREE_LOG_UNBOUND. Changelog fragment marked important: blocker.
Tests
  • bun --no-env-file test --timeout=30000 test/run-evidence-job-log.test.ts: 15 pass, 0 fail
  • bun --no-env-file test --timeout=120000 test/ship-ci-carry.test.ts -t HARN-118: 2 pass, 0 fail
  • Free Tests run 44602104679 (workflow_dispatch) at e783895: green, 1713 files, 38387 tests
  • macOS and Windows jobs at e783895: cso-macos-launcher and macos-named-regressions (run 44602104679), windows-smoke (run 44600251339), all green
Why

A private repository's upload step failed with "Artifact storage quota has been hit", so its green CI run left no tree.json and every check that reuses CI results refused it. Those repositories can now opt in to reading the same record from the job log, bound to one step by GitHub's own timestamps, so a full artifact quota no longer forces the whole test suite to run again on the agent's machine.

Blast radius

The change touches the shared CI-run reader that the merge checks, accept, record-ci and /ship use, and the output lines and saved records that report a reused run. It is safe because the log is read only for a profile that sets tree_log_step and only when the run holds zero artifacts by that name; every other path returns the same refusal as before (lib/run-evidence.ts verifyRun, read at file:line, and the no-key test in test/run-evidence-job-log.test.ts, script ran).

Test Coverage

Coverage: 87% value-weighted (13 of 15 new code paths; no weakly covered paths). Tests: 1832 → 1832 files tracked before this branch's new file (+0 written by this audit). Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered.

Remaining gaps, proposed but not added (below the value bar): the dry-run "would reuse" line in lib/ship-preflight.ts naming a job-log source is not asserted; the safe-integer job-id guard in ghRunDeps.jobLog has no test (job ids come from the API as numbers).

Tests ran: test 1713 (files, from CI run 44602104679 at e783895)

Pre-Landing Review

No issues found by the checklist, specialist (testing, security, state-machines), red-team or second-model reviews. The adversarial review raised five low findings, all below the blocking floor and listed under Review notes; each one makes the run refuse and the tests run locally, and none lets a run count that should not.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL lib/run-evidence.ts:469 a rerun whose earlier attempt uploaded the artifact never falls back to the log; refuses as artifact_missing
  • INFORMATIONAL docs/pregate.md:858 docs do not say the upload step must not fail the job (continue-on-error)
  • INFORMATIONAL lib/run-evidence.ts:301 an ~11 MiB single log line may be split by the runner; would refuse
  • INFORMATIONAL lib/run-evidence.ts:496 serial log reads across many shard jobs can pass ci_record_timeout_s; the tests then run locally
  • INFORMATIONAL lib/run-evidence.ts:496 old gh without --allow-escape-sequences refuses with a generic log-read message
Exploratory QA

Functional smoke, two probes, verdict pass: bun --no-env-file test --timeout=30000 test/run-evidence-job-log.test.ts (15 pass) and bun --no-env-file test --timeout=120000 test/ship-ci-carry.test.ts -t HARN-118 (2 pass, 53 filtered). Not probed: a live GitHub run with a full artifact quota, and gh's --allow-escape-sequences against the real API.

Scope Drift

Scope Check: CLEAN. Intent: count a green CI run whose artifact upload hit the storage quota (GST-3231). Delivered: an opt-in job-log fallback bound by runner timestamps, with its refusal code, docs and tests.

Verification Results

No plan file: 0 plan-specific checks. Automatic diff-scoped QA above.

TODOS

No TODO items completed in this PR.

Documentation

Status: updated: one factual fix; the new tree_log_step fallback and CI_CARRY_TREE_LOG_UNBOUND code are documented and match the code.

Scope: base a0534ce..head 6025338 (4 commits, 15 files; no staged, unstaged or new files). Compared docs/pregate.md, docs/troubleshooting.md and the changelog.d fragment against lib/run-evidence.ts, lib/ci-carry.ts, lib/ship-bin-common.ts, lib/ship-receipt.ts, lib/result-codes-release.ts and lib/headless-artifacts.ts.

Documentation health:

  • docs/pregate.md: Updated (added tree_log_step? to the run_profiles key list in the config table; the new #tree-log-step section matches the code)
  • docs/troubleshooting.md: Current (#ci-carry-tree-log-unbound matches the result-code summary and fix)
  • changelog.d/ci-results-count-when-artifact-storage-is-full.md: Current (reviewed only)
  • README.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md: Current (not affected)

Coverage debt: tree_log_step has reference and how-to coverage in pregate.md and troubleshooting.md; it has no tutorial or explanation coverage (a common gap, acceptable for a niche opt-in). No architecture-diagram drift.

Agent notes

HARN-118 / GST-3230 / GST-3231, thread GSTA-659. gstack's own CI is not affected: gstack is public (no artifact quota), and run 44586540932 uploaded 24 artifacts. harness-evals is private and has 0 artifacts on run 44577938128. Out of scope: release assets, and any change to how artifacts are uploaded. Lines printed: CI_CARRY, LANE, CI_CARRIED, SHIP_RECEIPT; receipt ci_carried[].tree_source; record-ci ledger row tree_source. Main (a0534ce, v1.102.0.0) was merged in before review bound, on the lane brief.

Approvals

No approvals recorded for branch ci-results-count-when-artifact-storage-is-full.
Plan: exempt: bug fix with a failing-first test on main (GST-3231)
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=5 fixed=0 scope=frozen unbound=1 ledgers_read=2 dispatches=4
Gate edits: none detected (5 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4536,
  "head": "e78389509d84a093c9ebd55d381a13fc44707ff8",
  "version": "1.102.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1713,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44602104679,
      "attempt": 1,
      "tree": "c1a0db6a3c38320448e56e3625650e4c4cc0519a"
    }
  ],
  "calls": 25,
  "session_kind": "unattended",
  "run": "ship-4536",
  "head_tree": "c1a0db6a3c38320448e56e3625650e4c4cc0519a",
  "product_patch_id": "a1283d6e7adb41faec00438a1d8669274e4ca8a0",
  "gstack_version": "1.102.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 187,
    "rules": "1afa38a4be3b5eef",
    "base": "ab6a38b76753a3aebf948781ca065745ab1213da",
    "registry": "ab6a38b76753a3aebf948781ca065745ab1213da",
    "gate_scan": {
      "tagged": 0,
      "head": "e78389509d84a093c9ebd55d381a13fc44707ff8"
    },
    "reasons": [
      "gate-class",
      "runtime=187"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @c1a0db6a3c38 (8 checks, current for e78389509d84)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44602104679/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44602104679/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44600251339/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=c1a0db6a3c38 tests=38387 skipped=105 runs=44602104679/1 profiles=ci-reuse/free-tests heads=e78389509d84 verified=2026-11-19T19:57:29.582Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, CLAUDE.md, AGENTS.md, CONTRIBUTING.md"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 5,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "unbound": 1,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  },
  "gate_dispositions": []
}

Open in Capy

… full (GST-3231)

A run profile with tree_log_step reads tree.json from the one GSTACK_TREE_JSON line its named step
logged when the run holds no artifact, bound by the runner's own log timestamp; a forged line refuses.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits November 19, 2026 19:03
…GST-3231)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…erun and unreadable-artifact controls (GST-3231)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…T-3231)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit dab7549 into main Nov 19, 2026
82 checks passed
@garrytan garrytan mentioned this pull request Nov 20, 2026
capy-ai Bot added a commit that referenced this pull request Nov 20, 2026
- Two /ship approval records stop needing workarounds. (#4549)
- For contributors: the paid auto-decide check counts a start step that ran while the skill loaded. (#4543)
- The destructive-command check closes three ways past its disk-wipe and force-push blocks. (#4534)
- A green CI run still counts when the repository's artifact storage is full. (#4536)
- `/cso` now audits repositories that track symlinks. (#4567)
- A doc-sync eval stops failing when the audit child drops one field from its result line. (#4555)
- The browse daemon no longer picks port 10080, which Chromium refuses to open. (#4554)
- Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked. (#4542)
- A preregistration with only its write-up and plain data now gets the write-up review: one reviewer, one round. (#4544)
- When owner rulings don't clear a stopped review, `gstack-review-read` now says which findings are left. (#4553)
- The prompt-routing hook now names your installed bug-fix skill on bug reports, alone, and never puts /verify ahead of it. (#4539)
- Owner rulings now close a stopped review whose findings were logged in a findings file. (#4568)
- /ship can finish after the owner accepts a stopped review's findings as open notes. (#4552)
- /ship no longer starts the full test suite on your machine when CI's earlier run can't be reused (GST-3277). (#4565)
- The prompt-routing hook no longer acts on words inside backticks. (#4566)
- In Claude Code, a gstack skill's start step now runs when the skill loads, so the model can't skip it. (#4509)
- gstack's telemetry backend only accepts writes through its own validated endpoint, and the community dashboard now counts real use. (#4537)
- gstack now says what it's adding before it adds a background job or a browser extension. (#4538)
- For contributors: every flaky pass in Free Tests is now recorded. (#4572)
- For contributors: Free Tests on pull requests starts its test shards one round of small jobs sooner. (#4570)
- Secret values written as `name=value` at the end of a path are now hidden. (#4571)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant