Skip to content

records(export): stream installation exports without buffering them - #69

Merged
TusanHomichi merged 9 commits into
mainfrom
codex/47-stream-installation-exports
Oct 7, 2026
Merged

TusanHomichi merged 9 commits into
mainfrom
codex/47-stream-installation-exports

Conversation

@TusanHomichi

@TusanHomichi TusanHomichi commented Sep 12, 2026 •

Copy link
Copy Markdown
Member

Primary Issue

Closes #47

Problem And Outcome

An installation export read every finalized version with fetch_all and assembled the whole ZIP in memory before the handler answered, so its memory cost was proportional to the installation's history. It now streams: the same documented bytes, bounded memory, and an incomplete transfer that can never be mistaken for a complete export.

Changes

  • crates/consolebook-server/src/export_stream.rs — EntryBuffer, a Write + Seek view of an append-only destination that holds one entry and applies the zip writer's patches to it. A patch is classified by position (inside the held entry), so the CRC-32/size patch that seeks backwards and the ZIP64 extra-field update that seeks forwards both land correctly. This is what keeps a non-seekable destination byte-identical: no data descriptors, real CRC-32 and sizes in the local header, unchanged central directory.
  • crates/consolebook-server/src/record_export.rs — export_to writes the container into any seekable sink: a metadata-only pass for the manifest (which must be the container's first entry) in one short read transaction committed before the response starts, then a pass that streams each unit's stored bytes and unit manifest — one autocommit point read per unit on a pooled connection acquired for that read and returned before the bytes are written, checked against the manifest's stored fingerprints, so a stalled download holds no connection and no transaction. The audit event is its own committed statement before either pass, so an export reserves no writer while it streams (ADR 0019), pins no WAL reader, and a scope with nothing to export is never audited. An abandoned request stops before authorization, the audit, and the metadata pass, and at most four exports are produced per process — a fifth is refused 503 export_busy to retry, never queued. export_at keeps the buffered API the packet and the tests use.
  • crates/consolebook-server/src/exports_http.rs — the handler produces the archive on a blocking thread into a bounded-channel body: a slow client bounds the producer, a disconnect ends it and releases its connection, and a stall or any production failure after the response starts ends the transfer without its final chunk. The failure sentinel is actually sent (a dropped send future was a silent no-op) and a Drop guard covers a producer panic.
  • crates/consolebook-server/tests/export_stream_bytes.rs — byte identity, a real socket, memory, backpressure, stall, and the write-reservation proof; unit tests in exports_http.rs for the failure signal.
  • docs/decisions/0014-record-export-format.md, docs/formats/record-export.md, docs/development.md, web/src/lib/api.ts.
  • New dependencies: futures-util (stream rows one at a time) and http-body (the incremental response body). Cargo.lock changes only the dependency list.

Scope

  • In scope: producing and delivering installation and scoped record exports without buffering them, with unchanged bytes.
  • Out of scope: the container format itself (no version bump; docs/formats/record-export.md is unchanged in its normative claims); the browser download helper, which still reads the whole response into a Blob and is documented as such.

Verification

  • Listed the exact verification commands run below
  • Added or updated tests when behavior changed
  • Added or updated an ADR when a durable decision changed
  • All fixtures and examples are invented; no real agency data
- cargo fmt --check
- cargo clippy --workspace --all-targets -- -D warnings
- cargo test --workspace — 27 test binaries, 0 failures, 0 panics
- cargo build -p consolebook-server
- web/: npm ci, npm run check (0 errors, 0 warnings), npm run build
- web/: npm run e2e (system Chromium at /usr/bin/google-chrome; CI uses Playwright's bundled chromium)
  → 9 passed

Byte identity: streamed bytes equal an independent ZipWriter<Cursor<Vec<u8>>> reference across eight entry-size shapes (including 0/1/13/14/15/1024/65536/300000), a byte-level walk checks the descriptor flag, the patched CRC-32, the patched sizes, and every local header against the reference, and a live socket response is re-exported at the exported_at its own manifest states and compared with assert_eq!.

Memory, peak growth measured in a fresh process against a pre-seeded database with the sink discarding every byte: 500 units / 8.7 MB archive → 5.2 MiB; the same 500 units at 4x payload / 33.3 MB archive → 7.5 MiB; 4,000 units / 69.7 MB archive → 13.6 MiB. The corpus's bytes do not drive the peak; the remaining linear term is the unit metadata and its JSON manifest, which ADR 0014 states.

Reservation: an export observed mid-stream while the installation's own writer commits in well under a second — this fails against the audit-inside-the-transaction design. Failure: a stalled client's transfer carries no terminal chunk and is shorter than the complete archive; a destination that stops accepting ends the export. export verify, API byte delivery, determinism, packet bytes, and packet pin-history verification are unchanged and green.

Review And Merge Notes

  • Review focus: EntryBuffer's patch invariant, the audit's new commit point, and the failure path after the response has started.
  • User or operator impact: a large installation export no longer costs memory in proportion to the history, and a truncated download is visibly incomplete rather than a file that only export verify would reject.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T20:33:30.929548Z 2870c93 New commits
ℹ️ 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: c1eae2fe25

ℹ️ 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".

@TusanHomichi TusanHomichi left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Merge review at c1eae2f: hold this PR. I inspected the export transaction/audit lifecycle, EntryBuffer, response producer/body, and failure tests, and independently agree with both existing unresolved Codex findings. pr-gate run 34661990490 is green; these are uncovered boundary cases, not a claim that CI failed.

  1. Pool ownership: export_to() holds a pooled read transaction while audit_export(pool, ...) waits for another pooled connection. The production pool has five connections. Coordinated exports can occupy all five and then each wait for the audit connection, starving exports and unrelated requests until acquisition timeouts. Repair the reservation/admission/connection lifecycle rather than merely increasing the pool or moving an audit write into a transaction held for the full download. Add a deterministic concurrency regression that holds all competing requests at the relevant boundary; prove unrelated ordinary work still progresses, and exercise a one-connection pool or explicitly prove the supported admission contract. Preserve one snapshot for manifest and payload, the intended authorization boundary, and honest audit semantics.

  2. Terminal outcome: failure is sent through the same bounded queue that just stalled. If both send windows expire, signal_failure() only logs, the producer disarms its guard and drops all senders, and ExportBody treats channel closure as successful EOF. A late reader can therefore receive a truncated prefix with a clean HTTP completion. Give success/failure an explicit reliable terminal state independent of queue capacity; only an explicitly successful, finalized producer may permit clean EOF. A channel closing without that success must fail closed. Cover ordinary producer error, panic, full queue, disconnect, and finalization failure.

The decisive new stall regression should leave the data queue full beyond BOTH send deadlines, then resume reading and assert a body/transport error rather than clean EOF. Existing tests that inject a failure while there is queue space, or only test one timed-out send, cannot establish that guarantee. Keep short injectable test deadlines and add a real transport-level check as appropriate; do not weaken timeouts or retry until green.

Keep the existing byte-identity/CRC/header, verifier, snapshot, cancellation, and writer-progress proof. State memory cost precisely: streaming removes whole-corpus payload buffering, but unit metadata, the serialized manifest, and ZIP central-directory state still scale with unit count; browser Blob buffering also remains a documented separate limitation. Do not claim constant memory or end-to-end browser streaming.

Revalidate against current main (now containing #68) and rerun the full gates. No merge or deployment was performed for this PR. This review is source inspection plus GitHub CI/review verification, not an independently executed Rust or browser reproduction.

Export read every finalized version with `fetch_all` and assembled the
whole ZIP in memory before the handler answered, so an installation
export cost memory in proportion to its history (#47).

`record_export::export_to` now writes the container into any seekable
sink as it produces it: one read transaction, a metadata-only pass for
the manifest (which must be the container's first entry), then a pass
that streams each unit's stored bytes and unit manifest.
`export_stream::EntryBuffer` holds one entry and applies the `zip`
writer's patches to it, so the destination sees an append-only stream and
the bytes stay identical to the buffered archive: no data descriptors,
real CRC-32 and sizes in the local header, the same central directory. A
patch is classified by position — inside the held entry — so the CRC and
size patch that seeks backwards and the ZIP64 extra-field update that
seeks forwards both land correctly.

The export holds one pooled connection at a time, which is what the
review's first blocker needed. Its audit event is written in its own
short write transaction, committed before the read snapshot that both
content passes share, and that snapshot is a reader only (ADR 0019): an
export never reserves the writer while it streams, and exports sharing a
pool never hold one connection while waiting for another. A scope that
holds nothing to export is refused before anything is recorded, so the
audit still attests exactly what it says it does.

Delivery ends only on an explicit success. Whether a transfer was
complete is a flag the producer sets when the archive was produced *and*
its tail flushed — not the channel closing, which a client that outlasted
the failure signal would otherwise read as a complete download. Every
other ending fails the body: a production failure, a producer that
panicked (a drop guard covers it), a stalled client, and a client that
stayed away past both send windows.

Proof: streamed and buffered bytes compared across entry sizes including
the patch boundary, and the bytes a live socket delivers compared against
the buffered export at the instant the delivered manifest states; the
installation's peak memory measured in a fresh process against
pre-seeded databases (500 units / 8.7 MB archive at 5.1 MiB, the same
units at four times the payload at 7.4 MiB, 4,000 units / 69.7 MB at
14.1 MiB), so the payload volume does not drive it while the unit count
does; a whole export on a one-connection pool; two exports overlapping on
a two-connection pool with ordinary work still progressing; an export
observed mid-stream while the installation's own writer commits; a client
that outlasts both stall windows and still cannot receive a complete
transfer; and unit tests for each terminal case (success, closed channel
without success, failure item, guard on drop, stall, departed client).
Each of these was falsified against the design it replaces before it was
kept. ADR 0014 and the format document state the connection ownership,
the memory terms, and what an interrupted transfer means.
@TusanHomichi
TusanHomichi force-pushed the codex/47-stream-installation-exports branch from c1eae2f to 4755731 Compare September 12, 2026 01:37
@TusanHomichi

Copy link
Copy Markdown
Member Author

Repairs at 4755731, rebased onto main (7936a4e, which contains #68)

Both merge blockers are fixed, with regressions that fail against the design they replace.

1. Connection ownership: one connection at a time, no admission limit. export_to no longer holds a pooled connection while acquiring another. The audit is written first, in its own short storage::write_tx transaction that commits before anything else happens; only then is the read snapshot taken, and that snapshot is a reader from beginning to end. The SELECT 1 … LIMIT 1 scope check sits inside the audit's transaction, so "nothing to export" is still decided before any record is written, and the audit still attests exactly what it says it does. Consequences: an export works on a one-connection pool, exports sharing a pool never wait for a connection another holds, and the writer is never reserved for a download (ADR 0019). I chose ownership over admission deliberately — a slot limit would have to be re-tuned against the pool and would still be a cliff; this cannot enter the state at all.

Regressions (all fail against the old design): a whole export on a one-connection pool; two exports overlapping on a two-connection pool, both reaching their stream; and ordinary work (an audit write and a read) completing in under a second while an export streams mid-flight. Against the old design these fail with pool acquisition timeouts and database is locked respectively, which is exactly the reported failure mode.

2. Terminal outcome independent of queue space. Whether a transfer was complete is now an explicit fact — a flag the producer sets only when the archive was produced and its tail flushed — carried beside the channel rather than through it. ExportBody treats channel closure without that flag as an error, so losing the failure detail to a full queue costs the log line and never the outcome. A drop guard covers a producer panic.

Regressions: unit tests for every terminal case (success ends cleanly; a closed channel without success errors; a failure item errors; the guard fires on drop and stays silent when disarmed; a stall is not a departed client); and the decisive transport test — the client reads nothing past both send windows, then resumes and must receive an incomplete transfer rather than a clean end of body. Falsified by making channel closure authoritative again: the transport test passes a truncated prefix as complete.

3. Wording. The claim is now stated precisely, in the code, ADR 0014, and the format document: streaming removes whole-corpus payload buffering; unit metadata, the serialized manifest, and the ZIP central directory still scale with unit count, the driver buffers a bounded number of rows per query, and the browser's own download helper buffers the response it saves. No constant-memory or end-to-end-browser-streaming claim is made anywhere.

pr-gate is running on this head; the full local sequence is green (fmt, clippy, cargo test --workspace 28 binaries with 0 failures, npm run check, and 10/10 browser scenarios).

@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: 4755731cb3

ℹ️ 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".

Address the third review round on #69.

- The metadata pass is one short read transaction committed before the
  response starts. The payload pass holds one pooled connection but no
  transaction: each unit is one autocommit point read, completed before
  its bytes reach the client and checked against the manifest's stored
  fingerprints. Finalized versions are immutable and undeletable
  (migration 0010), so that check — not a snapshot held for the length
  of the download — ties payload to manifest, and a paused download
  pins no WAL reader.
- `export_to` takes a cancellation probe checked before the audit,
  before and during the metadata pass, and before the response starts;
  the handler's probe is the body channel's closure, so an abandoned
  request records and reads nothing.
- `ChunkSink` hands on at most 64 KiB per queued item, bounding the
  response queue in bytes (8 × 64 KiB).

Each fix has a test that fails against the behaviour it replaces. ADR
0014 and the format document state the new boundary.

Refs #47.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@TusanHomichi

TusanHomichi commented Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

Round 3 at 732c566 (via 151fcd6, d4e60f7, 88adb09, 9bb0cc2, 096530e, 2870c93) — the three open findings, the hold, and two follow-up findings

origin/main (03cc8c7) is merged in (c631b6b, clean; the only overlap was docs/development.md). The branch is appended to, not rewritten, so the earlier review anchors still resolve.

Threads. The two older P1s (audit connection acquired while holding the read connection; failure marker lost to a full queue) were fixed at 4755731 and are unchanged; replied and resolved with their tests. The three findings from the review of 4755731 were real and are fixed here, each with a test that fails against the behaviour it replaces:

  • Read snapshot ≠ download lifetime (record_export.rs). The metadata pass is one short read transaction committed before the response starts. Each unit is then one autocommit point read on a pooled connection acquired for that read and returned before its bytes reach the client, checked against the manifest's record_schema/content_hash/chain_hash (mismatch or missing row → incomplete transfer). Finalized versions are immutable and undeletable by trigger (migration 0010), so that check — not transaction isolation — ties payload to manifest. This is a change to the earlier reviewed "one snapshot for manifest and payload" design, stated as such in ADR 0014. Control: a_download_in_flight_pins_no_wal_reader, gated on the first write beyond three payloads' worth of bytes (d4e60f7 corrects an earlier write-count gate that landed after one version, not three), fails with busy = 1, log = 385, checkpointed = 384 when the pass runs inside a transaction.
  • Abandonment before the audit (exports_http.rs). export_to takes a cancellation probe checked before the audit, before and during the metadata pass, and before the response starts; the handler's probe is the body channel's is_closed(). Controls: with the probe forced false, an_export_abandoned_before_it_starts_is_neither_audited_nor_read records an audit row (1 vs 0) and an_export_abandoned_after_its_audit_stops_before_the_metadata_pass writes 348,478 bytes (vs 0).
  • Queue bounded in bytes (exports_http.rs). ChunkSink::write hands on ≤ 64 KiB per item; the queue holds ≤ 8 × 64 KiB. Control: a_large_entry_is_queued_in_bounded_pieces — the whole-entry write queues 1 MiB as one item and write_all succeeds.

The hold. The "hold this PR" review at c1eae2f is this account's own. Its two items were repaired at 4755731; the hold itself never cleared and is closed by this round. One reviewer-visible correction along the way, and a second round on it. The first candidate (d02a8e0) leased a pooled connection per point read; the memory proof failed on it at 23,484 KiB peak for the 4,000-unit corpus, four runs in a row. I attributed that to page caches on several pooled connections and switched to one connection held for the payload pass (151fcd6, a steady 14,808 KiB). Codex then correctly flagged the held lease as a starvation vector (five slow downloads hold every pool connection), so 88adb09 returns to a lease per point read, and the same per-read code now measures 15.0–17.7 MiB across runs, with one run over the old bound. The honest model is that the peak depends on how many distinct pooled connections the reads land on, each with its own SQLite page cache: a bounded constant (pool size × PRAGMA cache_size = 10,000 KiB here), not a corpus term. The proof now reads that ceiling from the pool at run time and bounds against it, ADR 0014 names it, and a new test (ordinary_work_progresses_while_every_client_stalls_mid_payload) fails against the held-connection design. The failed receipts are preserved.

Second follow-up (Codex on 88adb09): unbounded export producers. Each producer is a blocking thread for the length of its download, and a client reading one chunk per stall window keeps it indefinitely, so parallel requests from one authorized caller could grow the blocking pool to its limit and queue closures that still run authorization when scheduled. 9bb0cc2 + 096530e bound admission at EXPORT_SLOTS = 4 per server (a semaphore owned by AppState, built by AppState::new; the first cut was a process-wide static, which made parallel test servers in one binary share slots and was corrected before pushing) — a slot is taken before any work and held until the producer returns; beyond it the request is refused 503 export_busy to retry, never queued — and asks the abandonment probe before authorization. Control: exports_beyond_the_slot_bound_are_refused_until_a_slot_returns (four held live-socket downloads, fifth refused, served again once they leave) is served 200 on the fifth request when admission is unconditional. ADR 0014 names the bound and the refusal. Codex's P2 on 096530e (the memory proof's intended non-Linux skip failed instead) is fixed at 2870c93, test-only.

Verification at 096530e (local, /data/dev/src/consolebook-worktrees/47-stream-installation-exports, 2026-10-07 19:48–19:57 UTC): npm ci / npm run check (289 files, 0 errors, 0 warnings) / npm run build on the unchanged web/ tree; cargo fmt --check clean; cargo clippy --workspace --all-targets -- -D warnings clean; cargo test --workspace 27 binaries, 199 passed, 0 failed, 1 ignored (157 s; the ignored test is the memory probe's child process); cargo build -p consolebook-server; npm run e2e 56 passed (5.4 min) against that binary with the system Google Chrome (CONSOLEBOOK_E2E_CHROMIUM=/usr/bin/google-chrome), not Playwright's bundled Chromium. The same full sequence passed on 151fcd6 and 88adb09; a process-wide-static cut of the slot bound (9bb0cc2) failed the full suite by sharing slots across the parallel test servers in one binary and was corrected before pushing — that receipt is preserved. Module sizes: record_export.rs 914, exports_http.rs 821. Hosted pr-gate: green on 88adb09 (run 37674688625) and on d4e60f7; cancelled on 151fcd6 by the next push. On 096530e (run 37678442926) the web, format, clippy and Test steps all passed — the hosted workspace suite is green on that head — and the job then hung for 25 minutes in Install browser (npx playwright install --with-deps chromium, an apt fetch of archive.ubuntu.com noble-updates InRelease that never returned) until the 30-minute job timeout, so the browser step never started; that is runner infrastructure in a step this diff does not touch, not a test failure. Its one re-run, on 2870c93 (test-only; identical server binary), is green (run 37682401715): the full hosted sequence including the browser suite passed on this code. 732c566 then changes only ADR 0014's wording (Codex P2: post-audit abandonment leaves its audit event, which the ADR now states); its run is green too (run 37684726494). The browser suite itself never has more than one download in flight against a server (its two downloads are sequential awaits in one drafts.spec.ts test), so EXPORT_SLOTS = 4 is not exercised by it; the server-side tests carry that proof.

(local, /data/dev/src/consolebook-worktrees/47-stream-installation-exports, 2026-10-07 19:18–19:27 UTC): npm ci / npm run check (289 files, 0 errors, 0 warnings) / npm run build on the unchanged web/ tree; cargo fmt --check clean; cargo clippy --workspace --all-targets -- -D warnings clean; cargo test --workspace 27 binaries, 198 passed, 0 failed, 1 ignored (116 s; the ignored test is the memory probe's child process); cargo build -p consolebook-server; npm run e2e 56 passed (6.0 min) against that binary with the system Google Chrome (CONSOLEBOOK_E2E_CHROMIUM=/usr/bin/google-chrome), not Playwright's bundled Chromium. The same full sequence had passed on 151fcd6 (197 tests, 56 browser); d4e60f7 was test-only. Module sizes: record_export.rs 911, exports_http.rs 790. Hosted pr-gate: the 151fcd6 run was cancelled by the next push and the d4e60f7 run superseded; the 88adb09 run is not yet observed and I will record it when it lands.

Unchanged limits, stated as before: the browser's downloadExport buffers the response into a Blob; unit metadata, the serialized manifest and the ZIP central directory are O(units). No merge or deployment was performed; the merge decision remains the maintainer's.


Generated by Claude Code

@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: 151fcd6c78

ℹ️ 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".

TusanHomichi and others added 2 commits October 7, 2026 21:12
The zip writer issues six writes per entry, so the seventh write began
the first version's record rather than the fourth version the comment
claimed. Hold the first write landing beyond three payloads' worth of
bytes instead: at least three versions have then passed through the
held connection, whatever an entry costs in writes.

Refs #47.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A payload connection held while the client is waited on is a lease the
pool cannot give to anyone else: enough slow downloads hold every lease
and starve ordinary work. Acquire a pooled connection for each version's
point read and return it before the bytes are written, so a stalled
download holds no connection and no transaction.

The point reads then pass through whichever connections the pool hands
out, and their SQLite page caches — at most the pool's size times the
per-connection cache limit — count toward the export's memory. The
memory proof reads that ceiling from the pool and bounds against it;
ADR 0014 names the term. A new test holds two downloads mid-payload on a
two-connection pool and requires ordinary work to proceed.

Refs #47.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@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: 88adb0967e

ℹ️ 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".

TusanHomichi and others added 2 commits October 7, 2026 21:41
Each export producer is a blocking thread for the length of its
download, and a client reading one chunk per stall window keeps it as
long as it likes, so unbounded admission lets one authorized caller
grow the blocking pool to its limit and queue closures behind it. Admit
at most four exports per process: a slot is taken before any work and
held until the producer returns; beyond that a request is refused with
a typed `503 export_busy` to retry, never queued. The abandonment probe
is also asked before authorization, so a request that is gone does no
work at all.

Refs #47.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
A process-wide semaphore made every server in one process — including
the parallel test servers in one test binary — share one set of slots.
The slots now live on `AppState`, built by `AppState::new`, so each
server bounds its own producers. The abandoned-after-audit test's probe
stays present through both checks that precede the audit.

Refs #47.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@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: 096530e258

ℹ️ 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".

`measured` returns `None` on a platform without `/proc/self/status`,
meaning to skip; the proof's `expect` turned that skip into a failure.
Return early instead, so the workspace suite can pass there.

Refs #47.

Co-Authored-By: Claude Fable 5.1 <[email protected]>

@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: 2870c93b9c

ℹ️ 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".

The costs note said an abandoned request records nothing; that holds
only for abandonment noticed before the audit commits. After it, the
`record_exported` event stands as the attested attempt, which the
abandoned-after-audit test proves. State both cases.

Refs #47.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@TusanHomichi
TusanHomichi merged commit 6c4c477 into main Oct 7, 2026
1 check passed
@TusanHomichi
TusanHomichi deleted the codex/47-stream-installation-exports branch October 7, 2026 23:43
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.

Stream installation exports instead of assembling the archive in memory

1 participant