Skip to content

feat(ci): carry the read runner's leg transcript to a clean upload job - #16805

Merged
kyle-sexton merged 4 commits into
mainfrom
feat/implement-lane-sealed-transcripts
Nov 17, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
feat/implement-lane-sealed-transcripts

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Closes #16809

This carries out the owner's 2026-11-17 decision on lane transcripts for the read runner's agent legs; the earlier exemption decision is recorded on #7676.

Summary

The read runner's run job (act-key, act-token, act-fallback, which the implement lane and the other read-runner activities use) uploaded no transcript, because an upload there would run after code the model can rewrite while it holds the runtime token. The run job still uploads nothing. It now seals each leg's transcript to the lane transcript key and passes it out as job outputs. A new transcript job, with no checkout, no secret and permissions: {}, uploads that record under the artifact name the puller lists.

Measured before building (basis: the repository's actions/artifacts?name= listing and downloaded skill-reply-* act-turns.json files, read 2026-11-17):

  • Sealed transcript artifacts from comparable coding legs: tidy-upkeep model-subscription p50 266,826 B, max 373,121 B (n=5); sweep-areas-subscription 206,960 to 242,070 B (n=2); code-review subscription p50 37,766 B, p90 132,073 B, max 277,677 B (n=100).
  • resolve-issue turn counts over the last 40 runs: p50 63, p90 99, max 137.
  • Estimated gzip size per turn, from 5 local sessions: 1.7 to 3.6 KB. That puts the median implement leg at about 110 to 225 KB, and the tail above the cap. This is an estimate.

Fix

  • Run job. Gzips the leg's execution file, scans it with the publish-gate copy, and seals it with the .lane-seal sealer to vars.LANE_TRANSCRIPT_PUBLIC_KEY. Every file the seal trusts comes from the base and is checked right before use:
    • publish-gate.mjs is copied in seal-copy before the head checkout, with its SHA-256 recorded. It is checked before the scan, and again inside the scan process right before the import.
    • .lane-seal/action.yml and seal.mjs are checked against their seal-copy hashes at the end of the stage step, immediately before the seal.
    • The key file is written from the variable after the scan, then compared to the variable.
    • A mismatch carries nothing. The record is bound to the run id and to the job-id <activity>[-subscription|-fallback][-rung-up], and leaves as four job-output chunks. Both new steps are continue-on-error. Neither touches act-outcome or the carry to the scan job.
  • Cap: at most 286,720 gzipped bytes (280 KiB), sized at run time. GitHub allows "Outputs can be a maximum of 1 MB per job" (workflow syntax) but does not say how it counts characters. The runner's TemplateMemory.CalculateBytes counts value.Length * sizeof(Char), so the budget assumes two bytes a character: 500,000 characters, less the carry's actual sealed length, 65,600 for api-failures and 8,192 for the other outputs. The transcript gets only what is left, so the carry to the scan job is never reduced. When nothing is left, not even a marker is carried. A transcript over the cap, or one the scan blocks, is sealed as a one-message transcript_omitted marker carrying its reason, size and cap. It is never truncated. The puller stores a marker as an omitted row with omitted_reason and omitted_bytes. A leg that hands off still has its transcript uploaded, because the transcript job does not depend on the scan job.
  • Transcript job, puller, contract and checks. The transcript job checks the bundle framing (one transcript.json.gz record) and uploads the bare record, kept 7 days, uncompressed, with no overwrite. TRANSCRIPT_JOB_IDS lists each read-runner activity and leg, with -rung-up for address-feedback and fix-ci. The lane-transcripts contract and the puller README document the marker. check-artifact-retention gains a sealed-upstream list, the exemption Artifact-retention check rejects an upload sealed and scanned in an upstream job #16809 specifies. A plaintext family can then be uploaded with no scan step only by a listed job that holds no checkout, no secret, no environment and permissions: {}. Every other job is checked as before. Tests cover the listed pass, the unlisted fail, and listed jobs with a checkout, a secret or a token permission failing.

Verification

  • node --test --test-concurrency=4 on callers.test.mjs and pull.test.mjs: 327/327 pass, including the new tests listed here.
    • A leg's record opens with the puller's openRecord under the job-id each leg produces, and the artifact name matches that job-id.
    • The over-cap and credential cases arrive as markers.
    • A record at the cap fits four chunks, and one past them fails.
    • The output budget fits under 1,000,000.
    • The record step refuses a malformed bundle.
    • The run job has no upload step, and the transcript job has no checkout, secret, environment or token.
    • A test checks every read-runner caller's activity against the puller list. It caught that address-feedback passes model-rung.
  • Other suites that read the changed files: 17 more .mjs test files, 1,468/1,468 pass. check-artifact-retention.test.sh 41/41 pass, and 7 workflow shell suites all pass. check-artifact-retention.sh --check is clean. actionlint and zizmor --offline on pr-run-activity-read.yml report no findings.
  • One sabotage run: dropping the leg suffix from the upload name failed 2 of the new tests.
  • Left out:
    • The full .github suite. CI runs it, and the machine allows one at a time.
    • A live lane run. The new path first runs on the next implement-lane dispatch.
    • pr-run-activity-write.yml#run, which stays exempt and is out of scope.

Related

🤖 Generated with Claude Code

The read runner's run job stays exempt from uploading. It now gzips the
leg's execution file, scans it, and seals it with the checked sealer copy
(.lane-seal) to the lane transcript key, carried as four job-output chunks.
A new transcript job, with no checkout, no secret, no environment and
permissions {}, checks the bundle framing and uploads the bare record as
lane-transcript-<activity>[-subscription|-fallback][-rung-up]-<attempt>,
the name the puller lists.

A transcript over 286720 gzipped bytes, or one the credential scan blocks,
is carried as a transcript_omitted marker, never cut; the puller stores it
as an `omitted` row with its reason and size. The cap keeps the run job's
outputs, with the five carry chunks and api-failures, under GitHub's 1 MB
per job.

The artifact retention check gains a sealed-upstream list for a plaintext
family whose upload job receives ciphertext an earlier job scanned and
sealed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 17, 2026 15:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T15:15:55.695369Z e4b2c9d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e4b2c9d998

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

GitHub caps a job's outputs at 1 MB without saying how a character is
counted, and the runner's TemplateMemory counts strings at two bytes a
character. The transcript stage step now budgets that worst case at run
time: 500,000 characters less the carry's actual sealed length, the
api-failures bound (65,600) and 8,192 for the other outputs. It seals the
transcript only within that room, capped at 286,720 gzipped bytes, seals a
too-large marker naming the smaller cap when the transcript does not fit,
and carries nothing when the room cannot hold even a marker. The carry to
the scan job is never reduced.

The budget test now counts two bytes a character and runs the stage step
across carry sizes from empty to the five-chunk maximum.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-refine/fix-docs
Model rung 0
Leg handoff
Run job success
Activity step skipped
Commits pushed none (read lane)
Run 44112059087

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-security-review: 1 inline finding(s) on 6dcec9e95dd661107532cf8a9cc76794d2ee78f4; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 415e4d3b6d1292b5b6c2b48ac52448b2c6f3ffe1: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #16805, incremental (da3c67b → 415e4d3)

This review covers only the changes since da3c67b. This lane already reviewed an earlier head, so it reports only CRITICAL and IMPORTANT findings (blocking only: yes).

I read every hunk of both files in .claude-lane/incremental.diff: scripts/check-artifact-retention.mjs and scripts/check-artifact-retention.test.sh.

I found no security issues in this push.

The isolation check is now stricter

The earlier finding on check-artifact-retention.mjs L153 was that /\bsecrets\./ missed index access and reads of the whole context. That is fixed, and the owner settled the thread with its lines unchanged.

A listed sealed-upstream job is now treated as holding a secret in either of two cases:

  • It sets a secrets: key, for example secrets: inherit.
  • Any ${{ … }} expression in it names the secrets context, checked per expression with /\bsecrets\b/. This covers secrets.X, secrets['X'], toJSON(secrets) and a bare secrets.

This push only narrows what passes.

The one place the expression scope accepts something the old whole-job match rejected is a secrets. reference outside ${{ }}. In a workflow, the only such spot is a bare step or job if:. GitHub does not make the secrets context available in if:, so this opens no path.

The new tests match the code:

  • every new form fails: index access, toJSON, a bare secrets, a with: value and secrets: inherit;
  • the word "secrets" in a run: script still passes.

Below the blocking-only bar (not counted)

The non-greedy match stops at the first }}. So a }} inside a string literal in an expression could hide a later secrets reference from the check. Exploiting that takes a deliberate, obfuscated workflow edit by someone who can already edit this checker and .github/artifact-retention.json. Under the owner threat model (owner, bots, agents and Apps only), that is a hardening suggestion, not a finding.

Other checks

  • Trust controls: this push widens no trusted-actor check, token scope or kill switch, and weakens no merge hold.
  • Embedded text: none in the PR context or the settled threads.
  • Manifests and instructions: no plugin manifests changed and no instructions were deleted.
  • Spend: none new.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 6dcec9e95dd661107532cf8a9cc76794d2ee78f4; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread scripts/check-artifact-retention.mjs Resolved
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 415e4d3b6d1292b5b6c2b48ac52448b2c6f3ffe1: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): 415e4d3 counts every secrets reference against a sealed-upstream job

I read every hunk of the 2 files in .claude-lane/incremental.diff (scripts/check-artifact-retention.mjs and scripts/check-artifact-retention.test.sh). For context I also read the head file around the isolation predicate and the test harness (run_case, add_sealed_job), plus the closing issue #16809, the settled threads and the prior findings. This lane already reviewed an earlier head, so this review reports blocking findings only.

Blocking: none.

Checked against the earlier finding. The secrets-syntax gap I raised at da3c67b (/\bsecrets\./ missed index access and toJSON(secrets)) is fixed. This is my own reading; I ran nothing.

  • New predicate. check-artifact-retention.mjs:153 now treats a job as holding a secret in two cases:
    • it has a top-level secrets: key;
    • any ${{ … }} expression in the serialized job contains secrets as a whole word. That covers dot access, index access, toJSON(secrets) and a bare secrets.
  • Null jobs. job is either a plain object or null, so JSON.stringify(job) always returns a string. A null job gives "null", and .match is never called on undefined.
  • JSON escaping. Escaping (\" inside secrets["TOKEN"]) does not stop \bsecrets\b from matching.
  • Narrower scope is safe. Matching only inside expressions is no looser than before for real secret reads, because GitHub exposes the secrets context only through ${{ }} (it cannot be used in a bare if:).
  • New tests. The cases build valid fixtures:
    • SECRET_LINE and SECRET_PERMS are exported and expanded inside run_case's eval.
    • secrets: inherit lands at job indentation.
    • Each failing case asserts the isolation message, not just a non-zero exit.
  • Closing issue Artifact-retention check rejects an upload sealed and scanned in an upstream job #16809. Its criterion "a listed job with a checkout or secret failing" is now covered for every secret form listed above.

The PR body's and the owner reply's pass counts (52/52) are their claims; I have not verified them.

This push adds no new spend.

I found no embedded instructions in the PR context, settled-threads or prior-findings files.

Loosened-check verdict: fail (default: the wrapper wrote no loosened_check_verdict: line); patterns: 0 (no loosened_check_patterns: line).

Verifier dropped 0 of 0 candidates.

@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 17, 2026
Head code shares RUNNER_TEMP, so the transcript stage step trusted a
publish-gate.mjs copy it could rewrite, and wrote the key file before
that copy ran. The copy step now records the gate's SHA-256 from the base
before the head checkout. The stage step checks the gate copy against that
hash before the scan, and again inside the scan process right before it
imports it. It writes the key file from LANE_TRANSCRIPT_PUBLIC_KEY only
after the scan, then re-checks the .lane-seal action.yml and seal.mjs
against their base hashes and the key file against the variable, right
before the seal step. A mismatch carries nothing.

check-artifact-retention accepts an unscanned plaintext upload only from a
job listed in sealed-upstream that holds no checkout, no secret, no
environment and permissions {}; every other job is checked as before.

Closes #16809

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on da3c67b9002f618d3278dd13164e32c837f9dbe2; the summary is in this lane's pull request comment.

claude-lane: claude-review

Comment thread scripts/check-artifact-retention.mjs Resolved
The isolation check matched only `secrets.` dot access, so index access
(`secrets['X']`, `secrets["X"]`) and the whole context (`toJSON(secrets)`,
a bare `secrets`) let a listed job pass as holding no secret. A listed job
now holds a secret when any `${{ }}` expression in it names the secrets
context, in env, with or anywhere else, or when it sets a `secrets:` key
such as `secrets: inherit`. The word outside an expression is not a
reference.

Refs: #16809

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 17, 2026
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 69c4c98 Nov 17, 2026
79 checks passed
@kyle-sexton
kyle-sexton deleted the feat/implement-lane-sealed-transcripts branch November 17, 2026 16:07
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Artifact-retention check rejects an upload sealed and scanned in an upstream job

1 participant