• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 47403350973
78%
main: 81%

Build:
Build:
LAST BUILD BRANCH: rewrite/main
DEFAULT BRANCH: main
Ran 04 Dec 2026 07:02PM UTC
Jobs 2
Files 322
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Dec 2026 06:58PM UTC coverage: 77.855% (-0.005%) from 77.86%
47403350973

push

github

web-flow
fix(admin): keep the admin audit log bounded across restarts and retry a failed compaction (#1378)

Cherry-picks `d94a907` from @saket0187's fork
([saket0187/nostream#8](https://github.com/saket0187/nostream/pull/8)),
with attribution preserved — the author and date are the contributor's.
Applied cleanly to `rewrite/main` at `7019957a`.

Closes #1191 (by hand: `Closes` is inert against a non-default base).

`<config>/admin-audit.jsonl` was compacted once an **in-process
counter** reached 2,000 appends, which made three promises it could not
keep:

- a restart reset the counter, so a relay restarted more often than that
never compacted;
- the counter was reset *before* the attempt, so a compaction that
failed bought another 2,000 appends before retrying;
- every compaction staged through one shared name,
`admin-audit.jsonl.compact`, although `nostreamd --mcp-stdio` composes a
second writer over the same directory.

An append now counts the file itself — once per process, and again
whenever the file is not the length this process left it — and compacts
at 4,000 entries to the newest 2,000, parsing from the end. A failed
compaction is logged and retried by the next append, which still reports
its entry as written. Each compaction stages through an exclusive
`.admin-audit.<pid>.<n>.tmp`, and an append that finds the last line cut
short by an interrupted write starts a new line rather than appending
into it. The 4,000-line bound is stated in the code and in ADR 0014
(D16).

Test coverage: `crates/nostream-admin/tests/audit.rs` +207/−26.

The changeset body sits under an empty frontmatter, matching the repo's
release-plan convention.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Admin audit logs are compacted at 4,000 entries, retaining the newest
2,000 valid entries.
* Malformed or incomplete log entries are skipped when reading or
compacting aud... (continued)

4634 of 6495 branches covered (71.35%)

Branch coverage included in aggregate %.

10012 of 12317 relevant lines covered (81.29%)

749.2 hits per line

Jobs
ID Job ID Ran Files Coverage
1 Unit - 47403350973.1 04 Dec 2026 07:03PM UTC 322
75.36
GitHub Action Run
2 Integration - 47403350973.2 04 Dec 2026 07:02PM UTC 322
32.46
GitHub Action Run
Source Files on build 47403350973
  • Tree
  • List 322
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #47403350973
  • 40906159 on github
  • Prev Build on rewrite/main (#47369831496)
  • Next Build on rewrite/main (#47405706570)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc