Skip to content

Commit 81bfeb2

Browse files
docs(permissions): state each read-audit degradation's real reporting granularity (#19817)
Fixes #19216 Clause-②: no ## What `content/docs/permissions/record-view-auditing.mdx`, section "Failure posture": the lead-in said **both** read-audit degradations are reported **once per process**. That was true of one and false of the other, measured on `origin/main` `502f179cc`: | degradation | implementation (`packages/plugins/plugin-audit/src/read-audit.ts`) | real granularity | |---|---|---| | buffer overflow | `:240` `let overflowReported = false;` (one boolean in the batcher closure; repeats go to `debug`) | once per process | | failed ledger write | `:542` `const reportedReadAuditFailureCauses = new Set<string>();`, keyed by `auditFailureCauseKey('sys_audit_log', err)` (the error `code`, uncoded errors collapse to one bucket); docblock at `:499` says once per CAUSE | once per distinct cause | The lead-in now says only what holds for both (neither is retried; each is reported once), and each bullet states its own granularity. The ledger-write bullet uses the same definition of "cause" as the sibling page `content/docs/kernel/runtime-services/audit-service.mdx` (`recordAuthEvent`), so the two pages agree. The implementation matches its own docblock, so no code changed. Frontmatter and headings are untouched. ## Changeset Docs-only. The one changed path is under `content/docs/**`, and no published package source or `files[]` entry is touched, so this is `skip-changeset` territory. ## Verification Gates derived with `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands` (change set from merge base `502f179cc`: 1 path). All **44** derived families ran on head `ceefc645` and every one exited 0, including `pnpm check:doc-authoring`, `pnpm check:doc-anchors` and `pnpm check:nul-bytes`. Reconciliation with `--ran` (exit codes recorded): "44 derived, 44 run, 0 NOT-MEASURED, 0 UNRUN". Two gates first answered PREREQUISITE NOT MET (exit 3: `check:docs-transcript-drift`, which needs `@objectstack/lint` dist, and `spec check:skill-examples`, which needs `@objectstack/client-react` dist). After those closures were built under the verify lock, both were re-run and exited 0. The control-byte self-scan of the changed file found nothing. ## Acceptance notes - "Once per process" for overflow means once per batcher instance, and `installReadAuditWriter` creates one batcher per install. In practice that is one per process, so the page keeps the wording the card accepted. --- _Generated by [Claude Code](https://claude.ai/code/session_01VDtqoecgES7ScQYGbFVDRv)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 28ce612 commit 81bfeb2

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

‎content/docs/permissions/record-view-auditing.mdx‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,19 @@ whichever comes first: `maxBatchSize` views buffered, or `flushIntervalMs` since
218218
the batch's first view. The plugin's `destroy()` drains the tail, so a clean
219219
shutdown does not take the last batch with it.
220220

221-
Both degradations are reported **once per process** and never retried — a retry
222-
storm against an unreachable table turns a degradation into an outage:
221+
Neither degradation is retried — a retry storm against an unreachable table
222+
turns a degradation into an outage — and each is reported once, though not at the
223+
same granularity:
223224

224225
- **Buffer overflow.** Past a fixed ceiling of 10,000 buffered views the
225-
**oldest** are dropped and a `warn` is logged once.
226-
- **A failed ledger write.** The batch is lost and the failure is reported once,
227-
at `error` where the host's logger provides one and at `warn` where it does
228-
not — never dropped into silence.
226+
**oldest** are dropped and a `warn` is logged **once per process**; later
227+
overflows drop to `debug`.
228+
- **A failed ledger write.** The batch is lost and the failure is reported
229+
**once per cause**, at `error` where the host's logger provides one and at
230+
`warn` where it does not — never dropped into silence. A cause is the error's
231+
`code` (every uncoded failure collapses into one bucket), so a repeat of an
232+
already-reported cause drops to `debug` while a **new** cause gets its own
233+
line, once.
229234

230235
<Callout type="warn">
231236
**Both failures are invisible from everywhere else.** The reads themselves

0 commit comments

Comments
 (0)