feat(bug): breadd on-disk log/event store and bug.* IPC methods #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/breadbug-store"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes BREAD-14
Stacked on #21 (bread-scrub); retarget to main after #21 merges. Part of ECO-EP1, spec ECO-66.
What
bread-bugcrate:Store(single writer),Reader(works with breadd down),BugConfig(~/.config/bread/breadbug.toml: upload toggle default OFF, excluded apps, endpoint, store limits) and well-known paths (~/.local/state/bread/bugstore).log.jsonl,events.jsonl,markers.jsonl, each with one rotated generation. Per-file cap, global cap (oldest first), app cap (least recent evicted), long lines truncated on a char boundary. Dirs 0700, files 0600. App ids are validated, which is also the path-traversal guard.breadd, mirrors its own tracing output through atracinglayer.bug.log,bug.logs,bug.marker,bug.status,bug.wipe. App must be a registered app id orbreadd.bug.markerpublishesbread.bug.<panic|crash|freeze|recovered>; thebugdomain is now reserved so apps cannot forge it.bread doctorshows store health viahealth.bugstore.xtask check-docspasses.Tests
bread.bug.*, wipe).-D warningsclean for the touched crates.Notes
Independent prerequisite assessment: changes requested
BREAD-14 exact live head
d970e8f8a1, base feature/breadbug-scrubber at39ff3130583485dada208fe3c470954cacb56317. Full16-file list exhausted; complete diff read (new config/store source and all changed integration/docs/schema/lock/tests). Immutable detached feature/review-pr22-d970e8f. This defect assessment does not bypass blocked prerequisite PR21 or approve stacked integration. No merge/retarget or implementation.Acceptance mapping:
Actionable coordinator checklist on existing PR22:
Independent cargo test --locked -p bread-bug PASS23; crate all-target clippy -D warnings PASS; full workspace fmt PASS; check-docs PASS. No independent full workspace PR22 test/clippy pass claimed. Exact-head check / check (push) remains PENDING Actions132/job0; branch protections empty and authenticated reviews API[]. CI is not the reason for code rejection. Logs/probe /tmp/opencode/review-bread15/{tests22,clippy22,fmt22,docs22,probe22-results}.log or .txt.
Move BREAD-14 todo for coordinator repair, preserve PR and all stacked branches. No merge or done. PR21 remains blocked on integration acceptance and CI, evidence4307. Coordinator must verify integrated behavior before done.
BREAD-40 independent review: changes requested
Reviewed exact PR22 head
5741945d3dagainst base39ff313058(feature/breadbug-scrubber), both Breadway/bread. Suppliedb3f763fresolves tob3f763f438and is stale. Current immutable detached review worktree: ~/.worktrees/bread/fix/review-bread40-5741945. All 16 changed files and full 2331-line diff read; PR/file lists exhausted. Actual BREAD-40/bread#39 and BREAD-14/BREAD-15 comments read. This is a BREAD-40-only verdict, not acceptance of BREAD-14 or PR21.Criterion evidence:
Actionable checklist on existing PR22:
Independent commands at this head: cargo test --locked -p bread-bug PASS26; cargo clippy --locked -p bread-bug --all-targets -- -D warnings PASS; cargo fmt --all --check PASS; cargo run --locked -p xtask -- check-docs PASS. Original and permission probes compiled with rustc against this worktree's exact rlibs. Evidence: /tmp/opencode/review-bread40/{pr22.diff,tests.log,clippy.log,fmt.log,docs.log,prior-probe.txt,error-probe.rs,error-probe.txt}. Full workspace410 tests/all-target clippy are coordinator claims for the prior SHA, not independently reproduced here.
CI: actual .forgejo/workflows/check.yml requires work-branch push clippy/build/test. Current exact-head statuses are empty and no current-head run is observable in Actions list: check / check (push) MISSING, not success. Previous run132 belongs to
d970e8fand is failure, not current-head evidence. Branch protections empty. Authenticated reviews API[]; existing PR comment4309 retains broader unresolved BREAD-14 acceptance.PR21 still open/unmerged at39ff313; BREAD-15 remains review with blocked integration assessment4307. BREAD-14 client/settings/doctor acceptance reconciliation remains outside this scoped review. No merge/retarget/close/done or implementation. Preserve all branches and graph/user files. BREAD-40 to todo for coordinator repair, then fresh exact-SHA review and CI. Integration verification is still required before done.
BREAD-40 exact-SHA re-review: blocked on CI/integration
Reviewed head
a3e1854e53, base39ff3130583485dada208fe3c470954cacb56317, both Breadway/bread. Current API head/base match inputs. Detached immutable worktree ~/.worktrees/bread/fix/review-bread40-a3e1854. PR and changed-file lists exhausted (22 PRs,16 files); complete prior diff review carried forward only after reading all changes since5741945 (3 files,136 additions/32 deletions). No unrelated repair churn. BREAD-40 comments read; earlier issue/dependency acceptance and review4309 are not waived.BREAD-40 criteria locally verified:
Independent commands: cargo test --locked -p bread-bug PASS28; cargo test --locked -p breadd health_exposes_accounting_failure_without_false_byte_count PASS1; cargo clippy --locked --workspace --all-targets -- -D warnings PASS; cargo fmt --all --check PASS; cargo run --locked -p xtask -- check-docs PASS. No independent full workspace test pass claimed for this SHA. Probe sources/output/logs and diffs: /tmp/opencode/review-bread40-a3e1854/.
Required exact-head check / check (push) FAILURE at /Breadway/bread/actions/runs/134/jobs/0, run134 API id2406 workflow check.yml commit
a3e1854e53. Status API says Failing after13m33s. Workflow runs work-branch clippy, workspace build and test via ci/build.sh. Failure cause not established here; local passes cannot waive it. All134 Actions runs paginated and exact SHA matched. Branch protection API[]; authenticated reviews API[], previous broader changes-request comment4309 still not resolved by this scoped assessment.Verdict BLOCKED, not pass: scoped code criteria now pass, required CI fails and PR21 prerequisite remains open/unmerged/blocked; BREAD-14 broader client/settings/doctor acceptance remains unresolved. Leave BREAD-40 review. Coordinator: inspect run134 job0 logs, repair/re-run exact-head CI, retain accepted cap/error regressions, obtain fresh SHA-bound review if code changes. Resolve prerequisite and broader acceptance separately before integration. No merge/retarget/done, implementation, remote-host/live-desktop access or graph/user-file modifications.
BREAD-40 independent rerun: BLOCKED
Exact reviewed and freshly re-read live head
a3e1854e53; base39ff3130583485dada208fe3c470954cacb56317, both Breadway/bread. Expected head matches. Existing cancelled-session review4344/card1893 was actually persisted; this rerun independently confirms the scoped result rather than assuming its tests passed. BREAD-40/bread#39, BREAD-14 and BREAD-15 actual bodies/comments read. Paginated lists exhausted:22 PRs,16 changed files,134 Actions runs, reviews[]. Full2435-line actual base/head diff read in clean detached ~/.worktrees/bread/fix/review-bread40-a3e1854. Preserve broader changes-request4309; this is not BREAD-14/PR21 approval.Criterion mapping:
Independent commands all succeeded: cargo test --locked -p bread-bug (28 tests); cargo test --locked -p breadd health_exposes_accounting_failure_without_false_byte_count (1); cargo clippy --locked --workspace --all-targets -- -D warnings; cargo fmt --all --check; cargo run --locked -p xtask -- check-docs. No full workspace test pass claimed. No additional scoped BREAD-40 code defect found. Fresh logs/probe sources/results/full diff: /tmp/opencode/review-bread40-rerun/. No implementation, graph/user-file changes or remote-host/live-desktop access.
CI BLOCKER freshly observed for this exact head: check / check (push) FAILURE, Actions134/job0, run API id2406, commit_sha matches reviewed SHA; description Failing after13m33s. check.yml requires workspace clippy, build and test via ci/build.sh. Branch protections[]. Local successes do not waive CI. Cause is not established; coordinator must inspect run134 job0 logs and repair/re-run. Do not assume permission tests or any pre-existing failure caused it without logs.
Integration BLOCKER: PR21 remains open/unmerged at39ff313 and BREAD-15 acceptance remains blocked; BREAD-14 broader client/settings/doctor acceptance is unresolved separately. Leave BREAD-40 review. No merge/retarget/done or approval submitted. Next: repair exact-head CI, fresh review if SHA changes, resolve prerequisites and broader consumer acceptance before integration.
BREAD-40/BREAD-41 exact-SHA follow-up
Reviewed live head2b641bb4213c6ae1631f414953a9dd7783afd28c, base39ff3130583485dada208fe3c470954cacb56317, both Breadway/bread; matches expected head. Clean detached ~/.worktrees/bread/fix/review-bread40-41-2b641bb. Paginated22 PRs,17 changed files,135 runs; reviews[] and branch protections[]. Full prior actual PR diff independently reviewed in4391; independently verified the complete delta is ONLY ci/bread-ecosystem.rev:1 from147cfbbf96ae4b171027defa1130d2caddb934b1 to25bf3af49a3de240f64ed90e6eebd2958e672d10. Store, daemon and regressions byte-identical to reviewed
a3e1854. Actual BREAD40/41 bodies/comments read.BREAD40: changes_requested for a reproducibility defect in the failed-eviction regression, not a newly reproduced cap bypass. Existing functional criteria remain locally verified: serialized strict caps/oversized drop/reopen at store.rs:238-241,425-467,491-523; fail-closed errors471-487,494-500,519,550-568; truthful health bugstore.rs:426-434. Original independently measured flood966 <=1000 and permission probe restored482 <=1000 at identical source, PR4391. Fresh current-head cargo test --locked -p bread-bug passes28 locally. Prior workspace clippy/fmt/docs independent evidence remains source-identical except pin; coordinator414 workspace pass is not an independent claim here.
NEW observable verification FAIL at exact head: Actions135/job0 runs unprivileged sufficiently for unreadable_app_fails_closed_and_usage_reports_error to PASS, but failed_eviction_does_not_allow_append FAILS store/tests.rs:214: snapshot clip.logs.len left0 right1;27 pass1 fail. This is not the old root assertion. store.rs:510-515 sorts eviction tuples by rotation,mtime,path. tests.rs:204-209 writes pad then clip without establishing distinct mtimes; on equal mtimes path ordering can remove clip seed before attempting unwritable pad. append still errors and cap remains bounded, but the regression assumes pad is chosen first without establishing it.
Actionable checklist on existingPR22:
BREAD41: BLOCKED pending successful actual runner validation. Pin implementation inspected at immutable integrated25bf3af ci/build.sh: host-created writable registry/git/target bind mounts, per-product flock held through copy, docker --user id-u:id-g, read-only passwd/group, no root cache paths. bash -n PASS. Actual shared PR55 API merged=true mergeSHA25bf3af; independent review comment2789 read. Pin is integrated, not an unmerged mock. Retrieved run134 logs independently: clippy/build pass; both permission tests fail explicit unprivileged assertions; finally unlinkat src/target/.rustc_info.json permission denied. Old147cfbb script indeed lacks --user. New run135 clippy/build pass, unreadable permission test passes, no final cleanup error observed in retrieved complete log; full workflow still FAILS due to BREAD40 test above. Future owner cleanliness is not proven solely by script inspection; required exact-head workflow success remains unmet. No remote cleanup or host access.
Fresh exact-head status: check / check (push) FAILURE, Actions135/job0 run id2415, Failing after2m21s. Not pending anymore. Logs obtained once, no polling loop. Evidence /tmp/opencode/review-bread40-41-2b641bb/{run134.log,run135.txt,status-final.json,tests.log,shared-build.sh}. PR21 open/unmerged at39ff313 and BREAD14 broader consumer acceptance unresolved. No merge/retarget/done, implementation or graph/user modifications. BREAD40 todo for regression repair; BREAD41 review blocked on successful validation. Preserve existing stack.
BREAD-40/BREAD-41 re-review: BLOCKED pending current-head CI
Exact reviewed/live head74d436e098603bf451b6f60fcdb7bfef8b07948f matches expected; base39ff3130583485dada208fe3c470954cacb56317, both Breadway/bread. Clean immutable detached ~/.worktrees/bread/fix/review-bread40-41-74d436e. Actual card bodies/comments read. Lists exhausted22 PRs,17 files,136 runs, reviews[]; branch protections[]. Prior full diff reviewed4391, pin review4399; entire new delta independently read:14 added test lines only, no implementation/pin changes.
BREAD40 local criteria PASS: strict serialized per-file/global reservation, intact oversized rejection, lowered reopen caps, fail-closed enumeration/eviction and truthful health remain identical to independently verified store
a3e1854(PR4391 flood966 <=1000, permission result482 <=1000). Current-head cargo test --locked -p bread-bug PASS28 as uid1000; cargo clippy --locked -p bread-bug --all-targets -- -D warnings PASS; cargo fmt --all --check PASS. No new scoped defect.Prior eviction-test rejection repaired: bread-bug/src/store/tests.rs:206-220 opens pad/log.jsonl, sets modified time explicitly to UNIX_EPOCH via FileTimes, then asserts actual read-back pad mtime strictly older than clip before chmod0500. store.rs:510-515 uses those mtimes before path tie-break, so the unwritable victim is now deterministically first even when initial consecutive writes tie. No sleep, skipped test, softened error assertion or relaxed cap/no-new-record check. Filesystem refusing timestamp update fails the test explicitly. Permission restored before result assertions. Local regression passes. Previous left0/right1 timestamp-order assumption is resolved in source.
BREAD41 pin criterion remains PASS: unchanged ci/bread-ecosystem.rev:1 integrated25bf3af sharedPR55, inspected unprivileged invoking uid/gid, writable bind caches, passwd/group and per-product locks (4399). Successful complete runner/cache-copy/cleanup validation remains UNVERIFIED until exact-head workflow completes; no remote cleanup authorized or performed.
Required current-head check / check (push) PENDING at Actions136/job0, run id2416 commit_sha74d436e. One current status/log snapshot retrieved, not a polling loop. Available log shows clippy and workspace build completed; workflow/test completion and final cleanup not yet observed. Old run135 failure is not this head outcome. No independent full-workspace test pass claimed.
Both verdicts BLOCKED, not pass, because current-head required CI is incomplete and PR21 remains open/unmerged/blocked; broader BREAD14 acceptance remains unresolved separately. Leave both cards review. Next coordinator action: obtain completed run136 result/logs, repair genuine failures if any without weakening permission coverage, fresh SHA review if changed; resolve prerequisites and broader consumer acceptance before integration. No merge/retarget/done, implementation, remote-host access or graph/user modifications. Fresh evidence /tmp/opencode/review-bread40-41-74d436e/{delta.diff,tests.log,clippy.log,fmt.log,status.txt,run136.txt}.
Independent exact-head review: pass
Reviewed live head
1505b0d445against base4a164fd98a. Expected head matched. The only change since74d436eis the main merge, and the only main-side file change is the BREAD-36ramregistry line in bread-shared/src/apps.rs. Prior change requests atd970e8f(4309),5741945(4327), and2b641bb(4399) are addressed at this head. CI blocks ata3e1854and74d436eare resolved.BREAD-14
cargo test -p bread-bug --locked: 28 passed.cargo test -p breadd --locked --bin breadd journal_tests: 3 passed.BREAD-40
BREAD-41
--user $(id -u):$(id -g), host-writable cache binds, passwd/group mounts, and per-product flock. Exact-head check.yml job 2446 (Actions run 141) succeeded in 20m58s: checkout, clippy, build --workspace, test, Complete job all success. No cleanup permission failure.Checks
check / check (push)success for1505b0d. No branch protection rules. Reviews API empty. No outstanding formal review to dismiss.cargo clippy -p bread-bug --locked --all-targets -- -D warningsclean.Scratch worktree: ~/.worktrees/bread/review-pr22-1505b0d. Primary checkout and feature/breadbug-* worktrees were not modified.
Merged
Pass comment: #22 (comment)
Re-read immediately before merge: head
1505b0d445, base4a164fd98a, mergeable, required check / check (push) success (Actions run 141, job 2446, all steps success). Merge API Do=merge, delete_branch_after_merge false. Confirmed merged=true, merge SHAaea9879d61. feature/breadbug-store still exists for stacked PR23.Cards stay in review. Two-pass consumer verification is on main after PR23, not done on this merge.