Repository navigation
store session snapshots in custom git refs - #206
CNSeniorious000 wants to merge 4 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
Found that a ref advancing between lookup and restore could drop a completed review’s checkpoint, and that a runner’s global ignore rules could produce a successful save with no manifest. Fixed both in ee0d21e. The save now uses the commit it actually restored, preserves the snapshot’s exact bytes, and rejects branch and tag namespaces. |
|
Found that a runner’s Git settings could send plaintext snapshots to a different repository after the visibility check passed. Fixed it in 4b79fc1. The action now checks the URLs Git will use for fetch and push and stops before transferring data if either differs from the verified repository’s HTTPS URL. |
Problem
The org's Free artifact allowance ran out: 396.74 GB-h accrued in November, 93.8% from
promplate/platform. Session snapshots were the driver — the sameref-mainsession uploaded 88.5 MiB and 101 MiB on consecutive days. The obvious fix (prune tool output before the newest compaction checkpoint) is unacceptable: the reviewer greps its own earlier session JSONL to reuse previous tool-call results, so clearing tool output removes context it relies on (#202 was closed for this reason).Change
session-ref-prefix(empty keeps artifacts; for exampleagent-sessions) moves snapshots to custom git refs in the same repository:refs/<prefix>/<sha256(model + NUL + session-key)>.SESSION_REF_BASE); if the ref moved meanwhile, the run keeps the newer snapshot instead of overwriting it.sessions/**,last-thread-idandcheck-runs.jsonl; config, auth and hooks cannot be injected through a snapshot.finddistinguishes "no such ref" (git status 2) from network/permission errors and fails on the latter, so a transient error cannot silently fall back to stale state.encrypt-snapshotsis rejected early in this mode (per-file encryption would defeat CAS and is not implemented yet).GH_CONFIG_DIR, not the job'sGITHUB_TOKEN.Verification
on: pushdid not run for the custom ref;ls-remoteandgit/matching-refscan read it;git fetch --depth 1works; a shallow client can append and push back.bun test scripts/session-ref.test.ts: 7 pass (round trip, multi-chunk, empty file, append history, idempotent save, missing ref, path traversal, corrupt manifest, stale-writer refusal).bun test scripts/recovery.test.ts: 66 pass; snapshot tests: 101 pass.main.Reviews
ls-remotefilter), lost snapshots after a failed push (fixed with expected/candidate logic), partial restore receipts (fixed with staging and verification), find-versus-error fallback (fixed), fork gate (fixed),GH_TOKENprecedence (fixed), prefix validation (fixed), autocrlf (fixed).Limits / follow-ups
encrypt-snapshotssupport (per-chunk AEAD with reuse) is a follow-up.