Skip to content

[Docs] Work order 02: fold the commerce service into the plugin - #245

Merged
vedanshujain merged 2 commits into
mainfrom
docs/work-order-02-fold-service-into-plugin
Sep 13, 2026
Merged

vedanshujain merged 2 commits into
mainfrom
docs/work-order-02-fold-service-into-plugin

Conversation

@vedanshujain

@vedanshujain vedanshujain commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

What

Adds plans/work-order-02-fold-service-into-plugin.md: the work order for adopting EmDash's plugin-storage conditional-write primitives (updateIf from emdash-cms/emdash#2169, now merged upstream; compareAndSet from #2980, still open) so the plugin owns commerce truth in-process on ctx.storage, and for removing @otta-sh/service and @otta-sh/store-postgres once the cut-over is green.

Shape

  • Decision record D0–D7: upstream posture (no upstream engagement; a vendored build of upstream main with #2980 merged onto it), all-or-nothing semantics without a batch primitive (one storage document per aggregate + intent-claim/sweeper for cross-aggregate edges), the ctx.storage collection layout, the plugin boundary amendment (ADR-0018), what cannot fold in (raw-body Stripe webhook → site-owned endpoint), cut-over, and test tiers.
  • 33 increments across four phases, each one-PR-sized with the failing contract test named first, a gate, dependencies, and rollback. Work lands on feat/in-process-commerce; that branch merges to main only after an emdash release carrying #2980 exists (INC-D6).
  • Three new ADRs (0018 plugin owns commerce truth; 0019 aggregate-per-document; 0020 one deployable), ranked risks, and a definition of done.

All three decisions ratified 2026-09-13

Ratified as recommended: D1 accepted (the design binds compareAndSet's create-if-absent semantics, with no put() + unique-index workaround), D3 no data migration (staging is re-seeded), and D3 the admin Orders search narrows to a prefix-only searchKey. Nothing in the document is open for decision.

v6 amendments

  • The binding rebases onto merged #2169: base is upstream main, only #2980 is merged on, and the migration-number collision is the one known conflict. The earlier build evidence was gathered pre-merge, so INC-A0 now re-verifies every claim and records the new numbers.
  • updateIf turns out to be wired through the sandbox bridge on upstream main, closing the gap v5 recorded; the merge-to-main gate narrows to a release carrying #2980.
  • Stale paths, line citations and counts fixed; the depcruise clause reading, INC-A7's file list, the Phase-D CI/deploy scope and the .changeset/ cleanup corrected.

Not in this PR

No code. PR #102 collides with the boundary changes this plan makes and duplicates the accepted ADR-0012's number; it is being closed, which resolves both.

🤖 Generated with Claude Code

https://claude.ai/code/session_019JhAGQnVa2G9PmsMDmswjy

vedanshujain and others added 2 commits September 13, 2026 09:55
Plans the adoption of EmDash's conditional-write storage primitives
(updateIf, compareAndSet) so the plugin owns commerce truth in-process on
ctx.storage, and the removal of @otta-sh/service and @otta-sh/store-postgres.

Resolved: no upstream engagement; the feature branch binds a vendored build
of the two upstream PRs; work proceeds on feat/in-process-commerce and merges
to main once an emdash release carrying both lands. The service is deleted at
the end rather than kept as a mode (pre-launch, no users).

Three decisions still need ratification before Phase B and are marked in the
document.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019JhAGQnVa2G9PmsMDmswjy
…he three decisions, fix stale citations

#2169 is merged upstream, so the binding becomes upstream main plus #2980 alone,
with the migration-number collision as the only known conflict; the earlier
build evidence is re-labelled pre-merge and INC-A0 must re-verify it. The
merge-to-main gate narrows to a release carrying #2980. updateIf turns out to be
wired through the sandbox bridge on main, closing that gap. All three remaining
user decisions are ratified. Stale paths, line citations, counts, the depcruise
clause reading, INC-A7's file list, the Phase-D CI/deploy scope and the
changeset cleanup are corrected.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011NjdC8awspUte5wML6eY2X
@vedanshujain
vedanshujain merged commit 61f47d3 into main Sep 13, 2026
3 checks passed
@vedanshujain
vedanshujain deleted the docs/work-order-02-fold-service-into-plugin branch September 13, 2026 10:30
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