# H3 bus and delivery H0 audit

Inventory reconciliation for #489 H3, based on H0 and main 26a8a835d3c01838eee4ecf374b87c7666676612. H0 locations below are frozen inventory locations, not current source lines.

Reconciliation: 68 detailed markdown rows, 59 unique rows, and 59 classification JSON identities. Nine duplicate markdown display rows are counted once. Unique classifications: 21 operational, 19 safety floor, 14 contract, 5 test seam.

Implemented scope: five operational controls through the H1 fixed descriptor mechanism; preserve existing hard ceilings and all queue/lifecycle/security behavior. The keys and bounds below are approved for this group.

| Frozen H0 location | Name | Value | H0 class | Disposition | Code-read reason / proposed control |
| --- | --- | --- | --- | --- | --- |
| src/hub/bus.ts:101:7 | `SEEN_CAP` | `2048` | operational | keep replay/storage contract | SEEN_CAP=2048 is both the retained dedupe/reply_to window and delivery-journal validateBus seen-array ceiling. A lower policy forgets replay/reply context earlier; a higher one violates existing snapshot acceptance. Leave the compatibility-sensitive bound fixed. |
| src/hub/bus.ts:102:7 | `MAX_ATTEMPTS` | `3` | operational | convert | MAX_ATTEMPTS=3 is the definitive safe-failure poison-envelope retry policy. Read the current configured value once per failed() evaluation; retain existing attempt counters, quota-paused exemption, presence restoration and undeliverable handling. Proposed bus.max_attempts integer1..100/default3, live at next safe failure; journal attempt validation remains fixed1..100. |
| src/hub/bus.ts:105:7 | `DIGEST_MAX` | `10` | operational | convert within existing ceiling | DIGEST_MAX=10 limits originals in a new push delivery. Proposed bus.digest_max integer1..10/default10, live at next take(); preserve important-first ordering, poison-alone and remote-singleton rules. Do not increase the documented10-original ceiling. |
| src/hub/bus.ts:108:7 | `PULL_BUDGET_BYTES` | `64 * 1024` | operational | convert within existing ceiling | PULL_BUDGET_BYTES=65536 bounds aggregate rendered text in a new pull. Proposed bus.pull_budget_bytes integer1..65536/default65536, live at next takeBudget(); preserve oldest-first, first-item-always-goes and poison-alone behavior. Do not increase the existing64KiB ceiling. |
| src/hub/bus.ts:109:7 | `NOTES_KEPT` | `10` | operational | convert within existing ceiling | NOTES_KEPT=10 is the shared-note preface tail, not durable memory deletion. Proposed bus.notes_kept integer1..10/default10, live on next note() or restorePreface() merge. Never rewrite existing prefaces or discard queued envelopes merely on reload. |
| src/hub/bus.ts:365:17 | `delay` | `1` | operational | defer recovery polling group | Initial1ms polling delay belongs to fenceRecovery(timeoutMs), the coordinator quiescence wait. It is not delivery retry delay; defer with recovery-wait settings so its shared timeout/hold semantics remain one change. |
| src/hub/bus.ts:372:24 | `Math.min` | `delay * 2` | operational | keep derived arithmetic | delay*2 is the exponential-backoff recurrence inside the bounded recovery fence, not an independent duration default. Do not add a setting for a derived expression. |
| src/hub/bus.ts:372:35 | `Math.min` | `50` | operational | defer recovery polling group | 50ms caps polling sleeps inside fenceRecovery. Defer with the1ms initial poll and injectable overall fence timeout; keep queues/in-flight work and prior recovery hold unchanged. |
| src/hub/bus.ts:892:31 | `this.withdrawn.size > 256` | `256` | operational | keep cancellation safety bound | The256-entry withdrawn tombstone window is consulted after awaited condensation/preparation and during retry queue restoration. Configuring it downward can forget cancellation evidence and revive withdrawn originals; leave this control fence fixed. |
| src/hub/delivery-journal.ts:22:3 | `TERMINAL_CAP` | `2048` | operational | convert within existing ceiling | TERMINAL_CAP=2048 is a target for pruning eligible completed/discarded/failed history. Proposed bus.terminal_history_limit integer1..2048/default2048, live at next normal terminal-settlement prune. Do not prune on reload, touch pending/uncertain rows, remove previous_id protection or change durable consumed-retry proof. Protected rows can keep the actual count above the target. |
| src/hub/limits.ts:15:63 | `sender_per_min` | `0` | operational | already configured | No-project sender_per_min=0 deliberately disables sender limiting. Existing LimitsConfig and config.limits own it; keep this separate from the configured-project default12. |
| src/hub/limits.ts:15:80 | `pair_per_min` | `0` | operational | already configured | No-project pair_per_min=0 deliberately disables recipient limiting. Existing LimitsConfig and config.limits own it; keep this separate from the configured-project default6. |
| src/hub/limits.ts:15:123 | `repeat_window_s` | `0` | operational | already configured | No-project repeat_window_s=0 deliberately disables repeat suppression. Existing LimitsConfig and config.limits own it; preserve configured-project default120s separately. |
| src/hub/limits.ts:17:63 | `sender_per_min` | `12` | operational | already configured | PROJECT_LIMITS.sender_per_min=12 is already overridable by limits.sender_per_min and read on each admission. Preserve no-project default0 and currently shared live cfg object; no second numeric control. |
| src/hub/limits.ts:17:81 | `pair_per_min` | `6` | operational | already configured | PROJECT_LIMITS.pair_per_min=6 is already overridable by limits.pair_per_min and read per admission. Preserve the no-project default0 and recipient/group bucket semantics. |
| src/hub/limits.ts:17:104 | `important_per_hour` | `6` | operational | already configured | PROJECT_LIMITS.important_per_hour=6 is already overridable by limits.important_per_hour. Preserve important-only charging, atomic group/peer scopes and no-project default0. |
| src/hub/limits.ts:17:124 | `repeat_window_s` | `120` | operational | already configured | PROJECT_LIMITS.repeat_window_s=120 is already overridable by limits.repeat_window_s. Preserve no-project default0 and the current dedupe key including parent and sorted audience. |
| src/hub/limits.ts:47:46 | `now - last < this.cfg.repeat_window_s * 1000` | `this.cfg.repeat_window_s * 1000` | operational | keep derived arithmetic | repeat_window_s*1000 converts the configured seconds into milliseconds for repeat admission. It already follows the operator value; no independent setting. |
| src/hub/limits.ts:51:30 | `this.recent.size > 1000` | `1000` | operational | keep implementation scan trigger | recent.size>1000 triggers deletion of EXPIRED entries only. It is not a retention cap and does not evict fresh duplicate evidence. A new cache-cap setting would misdescribe/change semantics; leave the maintenance trigger fixed. |
| src/hub/limits.ts:51:87 | `now - at >= this.cfg.repeat_window_s * 1000` | `this.cfg.repeat_window_s * 1000` | operational | keep derived arithmetic | repeat_window_s*1000 is the same configured-window expiry comparison used for cleanup. Keep the arithmetic coupled to limits.repeat_window_s. |
| src/hub/peers.ts:54:14 | `DEFAULT_WATCHDOG_MS` | `300000` | operational | already configured | DEFAULT_WATCHDOG_MS=300000 is already daemon watchdog_ms and constructor-injectable. Reload reaches BasePeer.configureWatchdog and takes effect on the next busy turn, never rearming the running watchdog. |
| src/hub/bus.ts:78:51 | `retryMs` | `1000` | test seam | existing test seam | DEFAULT_BUS.retryMs=1000 is already a constructor option used by arm() after a failure. H0 marks it test seam rather than operational; leave the injectable API, and do not introduce a second retry-delay control in this operational-only conversion. |
| src/hub/bus.ts:78:67 | `batchMax` | `3` | test seam | already configured/test seam | batchMax=3 is BusOptions plus daemon batch_max. Bus.configureScheduling already applies future scheduling only; no new default conversion needed. |
| src/hub/bus.ts:78:79 | `batchMs` | `15_000` | test seam | already configured/test seam | batchMs=15000 is BusOptions plus daemon batch_ms. Preserve the oldest original ts-based deadline and no reload re-arm. |
| src/hub/bus.ts:78:97 | `queueCap` | `200` | test seam | already configured/test seam | queueCap=200 is BusOptions plus daemon queue_cap. Preserve later admission only; reload never trims existing queues. |
| src/hub/bus.ts:185:55 | `batchMax < 1` | `1` | contract | keep contract | batchMax minimum1 is the positive delivery-count contract checked by configureScheduling; settings metadata must fit inside it. |
| src/hub/bus.ts:185:71 | `batchMax > 2_147_483_647` | `2_147_483_647` | contract | keep contract | batchMax upper2147483647 is the existing numeric scheduling contract; do not replace it with an operator-controlled bound. |
| src/hub/bus.ts:186:63 | `batchMs > 2_147_483_647` | `2_147_483_647` | contract | keep contract | batchMs upper2147483647 is the JavaScript timer-domain ceiling; retained as a fixed validator. |
| src/hub/bus.ts:187:55 | `queueCap < 1` | `1` | contract | keep contract | queueCap minimum1 forbids nonsensical zero-cap scheduling; retained as a fixed validator. |
| src/hub/bus.ts:187:71 | `queueCap > 2_147_483_647` | `2_147_483_647` | contract | keep contract | queueCap upper2147483647 is the existing Bus scheduling numeric contract; retained as a fixed validator. |
| src/hub/bus.ts:361:35 | `timeoutMs` | `5_000` | test seam | existing test seam | fenceRecovery timeoutMs=5000 is already an injectable overall quiescence deadline. Do not add per-call or environment overrides; leave H3 delivery configuration separate. |
| src/hub/bus.ts:616:98 | `backlog.length > 64` | `64` | safety floor | keep safety floor | backlog length64 bounds untrusted/persisted task-id metadata decoded from one envelope before queue observation; do not expose it as a work policy. |
| src/hub/bus.ts:1222:67 | `reason.replace(/\s+/g, ).slice` | `300` | safety floor | keep safety floor | Failure reason slice300 is a sanitized public diagnostic-size ceiling. Keep fixed independently of retry settings. |
| src/hub/deferred-hub.ts:4:14 | `MAX_DEFERRED_HUB` | `2048` | safety floor | keep safety floor | MAX_DEFERRED_HUB2048 is the bounded recovery outbox admission/restore contract. A full outbox refuses new publication without dropping accepted notices; larger support requires the documented paged durable outbox. |
| src/hub/deferred-hub.ts:21:21 | `text` | `256` | safety floor | keep safety floor | id text256 bounds a restored deferred envelope identifier before trust. |
| src/hub/deferred-hub.ts:21:46 | `text` | `256` | safety floor | keep safety floor | trace text256 bounds the restored trace identifier before trust. |
| src/hub/deferred-hub.ts:22:57 | `env.body.length > 1_000_000` | `1_000_000` | safety floor | keep safety floor | body1000000 is the deferred envelope untrusted text ceiling and must remain compatible with the journal envelope validator. |
| src/hub/deferred-hub.ts:27:50 | `env.to.length > 256` | `256` | safety floor | keep safety floor | Recipient count256 bounds restored deferred fan-out metadata; not an operator audience policy. |
| src/hub/deferred-hub.ts:27:90 | `text` | `256` | safety floor | keep safety floor | Per-recipient text256 bounds restored peer identifiers independently of count. |
| src/hub/deferred-hub.ts:35:88 | `refs.paths.length > 256` | `256` | safety floor | keep safety floor | refs.paths count256 bounds restored path metadata before downstream policy checks. |
| src/hub/delivery-hints.ts:13:31 | `result.rows.length >= 32` | `32` | safety floor | keep safety floor | Producer hint rows32 is the bounded body-free advisory projection; count/truncated still report omitted rows. |
| src/hub/delivery-hints.ts:23:112 | `held.rows.length > 32` | `32` | safety floor | keep safety floor | Consumer hint rows32 validates untrusted hint payload and matches the producer ceiling. |
| src/hub/delivery-hints.ts:23:240 | `Buffer.byteLength(JSON.stringify(held), utf8) > 4096` | `4096` | safety floor | keep safety floor | Consumer hint JSON4096 bytes is the closed metadata budget; do not tie it to user-configured retention. |
| src/hub/delivery-hints.ts:24:130 | `row.id.length > 256` | `256` | safety floor | keep safety floor | Held delivery id256 bounds untrusted identifier text in recipient-visible hints. |
| src/hub/delivery-hints.ts:24:305 | `sender.length > 256` | `256` | safety floor | keep safety floor | Held sender256 bounds untrusted sender text in recipient-visible hints. |
| src/hub/delivery-journal.ts:20:14 | `MAX_ENVELOPE_BODY` | `1000000` | contract | keep contract | MAX_ENVELOPE_BODY1000000 is a wire/storage acceptance ceiling also used by retry-warning decoration and deferred validation. Keep byte/path/protocol compatibility unchanged. |
| src/hub/delivery-journal.ts:21:7 | `SCHEMA_VERSION` | `1` | contract | keep contract | SCHEMA_VERSION1 identifies the journal storage/import format, never a setting. |
| src/hub/delivery-journal.ts:23:3 | `MAX_ROWS` | `100000` | safety floor | keep safety floor | MAX_ROWS100000 bounds imported lists/serialized history and protects restore resources. Terminal-history target cannot raise it. |
| src/hub/delivery-journal.ts:24:3 | `MAX_JSON` | `20 * 1024 * 1024` | contract | keep contract | MAX_JSON20MiB is the whole serialized journal acceptance contract. Keep unchanged across retention conversion. |
| src/hub/delivery-journal.ts:75:51 | `max` | `4096` | safety floor | keep safety floor | Generic journal text maximum4096 bounds untrusted persisted/imported string fields before use. |
| src/hub/delivery-journal.ts:76:51 | `value.length < 1` | `1` | contract | keep contract | text minimum length1 is the nonempty identifier/string shape contract. |
| src/hub/delivery-journal.ts:83:9 | `min` | `0` | contract | keep contract | integer default minimum0 encodes nonnegative counters/timestamps; per-field overrides remain fixed. |
| src/hub/delivery-journal.ts:144:36 | `Object.keys(queues).length > 4096` | `4096` | safety floor | keep safety floor | Queue peer-map count4096 bounds imported bus state, not configured capacity per peer. |
| src/hub/delivery-journal.ts:147:43 | `list` | `2048` | safety floor | keep safety floor | Queue list2048 bounds imported envelopes for one peer; preserve compatibility even if normal live queue_cap differs. |
| src/hub/delivery-journal.ts:608:53 | `Math.max` | `1` | contract | keep contract | attempt Math.max1 records a positive attempt number in normalized delivery history; it is not a retry-budget default. |
| src/hub/envelope.ts:23:14 | `MAX_HOP` | `3` | contract | keep contract | MAX_HOP3 is the cross-peer loop-prevention/wire hop cap. No configurable retry budget may alter it. |
| src/hub/envelope.ts:45:52 | `hop` | `0` | contract | keep contract | Initial hop0 starts a new trace; not a duration or retry policy. |
| src/hub/envelope.ts:121:98 | `Array.from(note from ${from} [${kind}]: ${text.replace(/\s+/g, ).trim()}).slice` | `300` | safety floor | keep safety floor | Public note-line300 codepoints is the sanitized rendering ceiling. NOTES_KEPT can only affect count, never this per-note bound. |
| src/hub/peers.ts:78:49 | `ms > 2_147_483_647` | `2_147_483_647` | contract | keep contract | Watchdog maximum2147483647 is the JavaScript timer-domain ceiling, not the configurable watchdog interval itself. |

## Runtime boundaries and verification

- The five values follow the existing accepted configuration and H1 publication path. Each is read at its documented next operation; reload itself does not replay work, re-arm deadlines, trim queues, mutate attempts or rewrite prefaces.
- Journal retention is read in the existing `pruneTerminal` path. The `previous_id` protection and separate consumed-retry proof are unchanged, so protected parents and the current mutation receipt can keep history above the configured target.
- Existing limits retain separate no-project-off and configured-project defaults. This conversion adds no limits UI rows or duplicate controls, and leaves `configureScheduling` and `configureWatchdog` timing unchanged.
- No safety floor, wire/storage constant, imported-state bound, sanitizer limit, unknown/PII gate, receipt rule or remote queue contract changes.
- Tests cover independent legacy pins, schema/row/apply parity, next-operation configuration reads, poison-alone and paused-quota retries, oversized first-pull progress, and history protection. Their execution result belongs to the exact-head PR receipt; live console/dashboard editing and native delivery performance remain unverified.
