Skip to content

feat: add a secure durable packet inbox - #7

Merged
coldlogicAI merged 3 commits into
mainfrom
agent/2026-08-04-durable-inbox
Aug 7, 2026
Merged

coldlogicAI merged 3 commits into
mainfrom
agent/2026-08-04-durable-inbox

Conversation

@coldlogicAI

Copy link
Copy Markdown
Owner

Summary

  • add an explicit local filesystem durable inbox around existing immutable .notchpkt packets
  • add simple CLI flow: inbox init, send, list, pull/import, and ack
  • add matching vendor-neutral MCP tools and Grok setup instructions for cross-model clients
  • preserve typed reply lineage and normal 3Notch import/check behavior

Usability and simplicity

  • one shared root, one local address per store, one-purpose commands
  • no daemon, database, account, hosted relay, polling loop, chat layer, or model invocation
  • deterministic retry identity and retained acknowledgements make failures inspectable
  • a small transport adapter boundary and stable MCP schemas prepare a later authenticated remote/plugin layer without vendor branches in the core

Security and traces

  • registered recipients only; typo addresses fail
  • sender-side archive, schema, artifact hash, size, and credential-pattern checks before shared writes
  • private and seed packets are blocked
  • hash verification before pull/import; corruption is retained and marked rejected
  • bounded compressed/unpacked archive work plus strict tar checksum, numeric field, padding, duplicate path, traversal, and trailing-data rejection
  • local lifecycle audit events contain IDs, hashes, routing labels, byte counts, states, actor/source, and error codes, never packet content
  • addresses are documented honestly as routing labels, not authentication or encryption

Verification

  • clean npm ci
  • lint, type-check, and production build
  • 234/234 tests across 78 files
  • 23/23 e2e tests across 11 files
  • 20-way simultaneous send and 10-way simultaneous import tests
  • packed @3notch/cli@0.6.0 installed into an empty prefix and completed request -> import -> typed reply -> import -> ack with both stores passing notch check
  • npm audit: 0 source vulnerabilities and 0 installed-package vulnerabilities

Not included

Hosted transport, OAuth, signatures, encryption, team ACLs, delete/retention, background delivery, distributed sync guarantees, or automatic model-to-model calls.

@coldlogicAI

Copy link
Copy Markdown
Owner Author

Fixed both merge blockers in commit de09211.

1. Rejected delivery recovery

  • Receiver-side size-policy failures now remain retryable instead of becoming terminal rejections.
  • After the receiver raises its configured limit, the existing delivery can be pulled and imported normally.
  • Legacy deliveries already rejected with NOTCH_ARCHIVE_TOO_LARGE or NOTCH_PACKET_TOO_LARGE recover after successful revalidation and clear their stale rejection metadata.
  • A genuinely rejected delivery can no longer return a false-success idempotent resend. The sender receives NOTCH_INBOX_STATE_INVALID and must send a corrected packet with a new packet ID.

2. Mailbox clutter tolerance

  • Inbox listing now ignores entries outside the managed delivery_<24 hex> namespace, including sync-conflict copies and stray files.
  • Entries that claim a valid managed delivery ID still fail closed when malformed.

Regression coverage

Added tests for:

  • low receiver limit → failed pull remains pending;
  • raised receiver limit → same delivery imports successfully;
  • legacy size-rejection recovery and rejection-field cleanup;
  • rejected resend returning an explicit error instead of success;
  • adapter and CLI listing with sync-conflict clutter;
  • malformed managed delivery entries still failing closed.

Verification

  • lint: passed
  • type-check: passed
  • production build: passed
  • tests: 235 passed across 78 files
  • e2e: 23 passed across 11 files
  • built CLI smoke check: passed
  • GitHub CI: passed on Ubuntu and macOS with Node 20 and 22

PR #7 is currently clean and mergeable.

@coldlogicAI
coldlogicAI merged commit 15d15de into main Aug 7, 2026
4 checks passed
@coldlogicAI
coldlogicAI deleted the agent/2026-08-04-durable-inbox branch August 7, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant