Skip to content

feat: add Every Inside bootstrap contract#45

Open
JannikJung wants to merge 1 commit into
mainfrom
codex/every-inside-bootstrap
Open

feat: add Every Inside bootstrap contract#45
JannikJung wants to merge 1 commit into
mainfrom
codex/every-inside-bootstrap

Conversation

@JannikJung

Copy link
Copy Markdown
Collaborator

Summary

Plus One can now install the current Every Inside defaults during a connection's one-time bootstrap, then move to incremental feed processing without a synchronization gap. The designation is stored independently from featured, so editorial distribution and marketplace promotion can evolve separately.

Design

Concern Contract
Editorial state every_inside_default is a separate persisted toggle with an explicit all-connected-users installation warning.
Initial sync skills.bootstrap returns published public defaults in deterministic order with package, resource, and version metadata.
Handoff The snapshot returns a watermark captured before its query, making overlap possible while preventing missed feed changes.
Incremental changes Added and removed membership transitions remain standalone, ordered feed items instead of merging into publish or featured events.
Removal policy Removing the designation excludes future snapshots and emits contract groundwork only; it does not uninstall existing copies.

Publication metadata and membership edges are committed in one D1 batch. Same-version republication uses an in-place version upsert so existing event references survive, and the branch preserves the newly landed retirement of organization-scoped submissions from main.

The producer contract is documented in docs/runtime-storage.md and the public MCP usage guide.

Validation

  • npm test -- --maxWorkers=1 — 27 files, 132 tests passed
  • npm run build — production Astro/Cloudflare build passed
  • Browser pipeline reached the changed admin route and verified its sign-in gate; the authenticated editor form could not be exercised unattended without credentials

New concepts

Snapshot-to-stream handoff with overlap

A consumer that starts from a snapshot and then follows a change feed needs a boundary that cannot lose events. Here, the producer captures watermark W before reading the defaults and returns W with the snapshot:

flowchart LR
  A["Capture watermark W"] --> B["Read current defaults"]
  B --> C["Install snapshot"]
  C --> D["Read feed after W"]
  A -. "Changes after W" .-> D
Loading

Capturing the watermark first deliberately permits overlap: a change concurrent with the snapshot can appear in both the snapshot and the later feed, but it cannot fall between them. This is preferable here because installation is idempotent and avoiding a gap matters more than avoiding a duplicate notification. Do not use this shape when replay is not idempotent or when the cursor cannot define a stable ordering boundary.


Compound Engineering
Codex

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