Repository navigation
Conversation
Design Review (Opus 5.5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS About 1,300 lines of hardened file-store machinery are packed into the in-memory window class to fix what is roughly a 40-line count-and-rename bug. Watch
Suggestions
[DESIGN-REVIEWED] 3eb4621 Description read[DESCRIPTION-READ] d76e63ca89f56f28452eabeb66604f191a1ecf5dfe7dbc1fbf0cde5159faa597 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5, fork) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK The fix needs only Not justified as shipped
What this change shipsInventory (9 items) — 3 justifiedIntent: keep an observed channel's history file from growing until the disk fills. FIX.
BlockersSecond spelling of the existing rotation helper [FIRST-PRINCIPLES-REVIEWED] 3eb4621 Description read[DESCRIPTION-READ] 6f675b04927fd825ffc3870136538f803c840331f7e03d7eb4894b80bb35edd0 That sha256 names the PR description this verdict read. Recompute it with |
GPT 6.1 Review (fork) — 🔴 changes requested (blocking)Reviewed Adjudication upheld 1 of 1 blocking finding(s); those must be resolved before merging. BLOCKING -- test/test_channel_history.py:2633 -- Snapshot check fails on scheduler delays
[BLOCK-MERGE] 3eb4621 Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1: I'm upholding it. The new test (diff line 4193, file |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed Review detailsAdvisory only. Nothing blocks the merge, but CI's line-cap lint will fail on the test file. FINDING — test/test_channel_history.py:1 — this PR grows the file from 366 to 3,622 lines, and [OPUS-REVIEWED] 3eb4621 |
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author. Assessment: All CI shards and 3 of 4 AI review lanes are green; the sole blocker is one GPT blocking finding at If you'd prefer I don't touch this PR, add the |
3182b69 to
d862511
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]
self-added: no
|
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca] Drive-to-green round 1 pushed: d862511 (rebase onto current main + fix for the GPT blocking finding). What changed on top of Leon's original diff, and why:
Leon's authorship and commit are preserved (fix amended into the single commit, |
d862511 to
3472909
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]
self-added: yes
|
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]
self-added: yes
For the maintainer, after independent verification: |
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca] Round 2 pushed: 3472909 (rebase onto current main + the GPT advisory fix).
Leon's authorship and the single-commit shape are preserved. |
3472909 to
357c1ba
Compare
|
🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]
self-added: yes
|
|
|
|
|
Rebased onto
Checks on b2d815a: 951 scoped (including the ratchet) and 9,165 related tests pass; black, isort, flake8, mypy, comment-history, sync-IO, loop-bound-locks and docs-lint all pass. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PR triage (automated, 2026-10-05): REBASE needed. No duplicate found.
|
|
|
Rebased on main
Also in this push, to fit main as it is now:
Local: |
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
|
bolichen97
left a comment
There was a problem hiding this comment.
[operator: bolichen97] My earlier change request is addressed on 3eb4621. Approving to clear it; other open gates on this PR still apply.
…entries Rewrites the observed channel's on-disk history to the newest observe_max_entries whenever appends double the cap, publishing only complete views; suppression is OSError-only; cap/TTL are read apply-time on the loop thread; load tightens legacy file modes and marks any non-clean disk line for republish.
…unded-read probe kirodotdev#26774 made jsonl_util frame records from fixed 1 MiB reads, so one read in the history load can now be _FRAME_CHUNK bytes even though the record cap is ~240 KB. The probe still asserted every read stayed under the record cap. Bound it by the larger of the two, and size the oversized line at four times that bound, so materialising the whole line still fails the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Rebased onto current main (
|
Problem / Motivation
Goal: An observed channel's history file stays bounded by
observe_max_entries, so a busy channel can no longer fill the disk.A channel with observe mode on writes every message to a per-channel history file (
channel_history.py) that nothing ever shrinks.Why it matters
A busy observed channel grows its history file without bound until the disk fills; the gateway then fails on unrelated writes.
Not a goal
What changed (motivation → approach → change)
An observed channel's history is now a pair of files,
<channel>.jsonl(live) and<channel>.jsonl.1(older), and once any inherited oversized file has been replaced, the pair never holds more than about twiceobserve_max_entriesrecords. Once the live file holds the cap, the next append renames it over.1and starts a fresh file. That is the same rotationjsonl_util.rotate_jsonl_atgives the repo's other append-only logs, counted in records instead of bytes..1then the live file into a deque bounded to the cap throughjsonl_util.bounded_raw_recordswith a per-record byte cap derived from the field caps (an oversized line is skipped with one warning and still counts toward the bound), skips malformed, undecodable, ts-less and non-finite lines, drops expired entries from memory, never writes a record, and logs only the record counts it read, naming any generation it could not readobserve_ttl_hours, and moves a live file whose oldest record has expired aside when no.1exists, so an expired record leaves the disk once its generation's newest record is past the TTL at a load, or a rotation replaces that generation; nothing is rewritten, and a generation still holding a fresh record is never replaced.1exists); whenever a rotation would replace history whose read failed (an unreadable.1, however full the live file is, or an unreadable live file beside the only readable.1), that channel's disk appends pause with one warning, while the in-memory window keeps every message; a paused channel re-reads its generations on a schedule (first after 60 s, backing off to an hour) and resumes as soon as every one reads, and a load also clears it; an inherited single file over the cap is renamed aside whole, never trimmed, and only into an empty.1slotexecutors.py); appends are admission-bounded at 64 queued jobs.1is left in place, and pauses that channel's disk appends until it is removedThe rename replaces a rewrite because a rewrite rebuilds the file from an in-memory window that can be stale or partial, which is how a live limit change could delete records on disk. A rename moves records without recomputing them, so the window and the file need no reconciliation. Rotation needs no cross-process lock: one gateway runs per home (
gateway_lock's flock), and inside it every history file operation runs on the single-worker lane. Turning observe off removes both files, each independently, so a failure on one never leaves the other; inside the data home each append on POSIX tightens the file to best-effort owner-only0o600and the folder is created0700(owner_only_files); a history folder configured elsewhere keeps the umask default, as main's #17629 decided for every configurable-location writer (on Windows the file keeps the history directory's inherited ACL). The Windows append opens through main'splatform_compat.open_create_no_reparse, soplatform_compat.pyis unchanged. The sensitive-path screen matches the canonical root plus the lexical leaf (is_sensitive_resolved_path) and never resolves the leaf, so a planted UNC reparse point is not followed before the no-follow open refuses it.docs/system-specs/modules/channel-history.mdanddocs/system-specs/modules/slack-gateway.mddescribe the pair, and.github/black-baseline.txttracks the formatting baseline.Backwards compatibility
Compatible: existing history files load unchanged; one already over the cap is renamed to
<channel>.jsonl.1on first load and replaced at the channel's next rotation. A saturated lane (64 queued appends on a stalled disk) drops the disk write for that message while memory keeps it.Tests
test/test_channel_history.pylocks in: a busy channel rotates without a rewrite; the pair stays within twice the cap at every drain; a cap raised while a load is queued keeps every record within it; an inherited oversized file is rotated aside, not rewritten; a load never writes a record; fully expired generations are removed on load while a generation with one fresh record is kept whole, a slow channel's live file with an expired oldest record is moved aside, and a TTL raised during the read is honoured; a live file that fails to read still rotates before the next append, and pauses disk appends instead of replacing a readable.1; a paused channel resumes once a scheduled re-read finds every generation readable, and backs off while one stays unreadable; an unreadable.1is never replaced, at load or by later appends, however full the live file is; an oversized line is skipped with bounded reads while a maximum-size record round-trips; the load log names an unreadable generation instead of counting it; a generation holding no parsable record is removed and logged for that reason; a history folder missing at rotation never resets the count; failed and partly landed writes never let the live file pass the cap; zero-byte write failures on a full disk never rotate a short live file over a full.1, and a live file that cannot be measured blocks rotation until it can; the record count survives a restart; a persistent rotation failure never grows the live file past the cap and appends resume once rotation works; torn tails never swallow the next append or make rotation fire early; field caps; link, hard link, FIFO and swapped-parent refusal at both generations, with a link or hard link at.1left in place; observe off removes both files; and an append still lands when the owner-only tightening is refused.test/test_channel_history_containment_428.pykeeps.1beside the live file, proves the screen never hands the leaf to a resolver (fails on the oldis_sensitive_pathcall) and still refuses a root inside~/.ssh.test/test_owner_only_files.py's two history tests now drain the disk lane before they look at the files.Manual verification
N/A -- unit coverage sufficient: every mechanism has a direct pytest exercising the real file system in a temp dir.
Screenshots / video
N/A -- backend-only change, no rendered surface.
Related Issues
no linked issue: the cap gap was found in review of observe mode, no tracked issue exists.
Pattern harvest
Not generalizable: the bounded-file cap pattern is specific to the observe history lane; no repo-wide rule candidate.
Checklist
docs/system-specs/modules/channel-history.md)