Skip to content

[Docs] One deployable: describe the current architecture in README, DEPLOYMENT.md, and a new ADR - #293

Merged
vedanshujain merged 2 commits into
feat/in-process-commercefrom
docs/one-deployable
Sep 20, 2026
Merged

vedanshujain merged 2 commits into
feat/in-process-commercefrom
docs/one-deployable

Conversation

@vedanshujain

Copy link
Copy Markdown
Contributor

Summary

Updates README, DEPLOYMENT.md, and the ADR set to describe the actual current architecture — one deployable, the plugin owns commerce truth in-process — now that the prior increments in this work order deleted @otta-sh/service and @otta-sh/store-postgres.

  • README.md: deleted the "Why two parts" section; rewrote the "three parts" intro, architecture bullets, repository-layout table, and status paragraphs to describe the current one-deployable shape (plugin + @otta-sh/store-emdash on D1/ctx.storage, no separate service, no Postgres/Hyperdrive in the deployed path); corrected the "separate databases" line — commerce documents and CMS content share one D1 database in this build (different table prefixes: _plugin_storage vs ec_*); fixed a broken DEPLOYMENT.md section cross-reference.
  • DEPLOYMENT.md: dropped the old Node+Postgres service deployment section entirely, renumbered the remaining sections, retargeted the secrets/env sections to the real current secret set, added a section on the build-time allowedHosts egress perimeter (with a caveat noting payments-stripe's transport doesn't yet route through it), rewrote the cron section to match the real site-cron/plugin-task-cron split, and corrected an oversold claim about the Stripe secret key ("to take real payments and to refund") to accurately describe it as stored-but-not-yet-consumed latent infrastructure.
  • New adr/0020-one-deployable-plugin-owns-commerce-truth.md: answers ADR-0002's five "a service may remain" reasons as explicitly rejected (pre-launch, no users); states it supersedes ADR-0002 in part while the ports-and-adapters discipline ADR-0002 established still stands and is what makes the deletion safe; records the Stripe-secret trust widening honestly, including that it's latent, not yet exploited; records that the webhook settle route is intentionally public: true (grounded in the actual code, correcting a stale assumption in the original plan document that assumed it should be non-public) and flags that this isn't yet pinned by any test/lint/CI check as an owed follow-up; states the site-owned webhook endpoint is permanent; states a future service would be re-derived from the unchanged domain ports, never resurrected; explicitly does not deprecate ADR-0001.
  • adr/0002-*.md: header marked "partially superseded" by ADR-0020, matching the repo's existing convention.
  • adr/0018-*.md, adr/0019-*.md: resolved stale forward-references that previously said "ADR-0020 is still to be written."
  • adr/README.md: index updated with ADR-0020, resolved forward-refs, struck the now-resolved "separate commerce database" queued item.
  • sites/staging/README.md: fixed stale section-number cross-references and removed a reference to a SERVICE_API_TOKEN env var that no longer exists.
  • sites/staging/src/lib/hold.ts: doc-comment-only fix removing a dead citation and stale "the service applies" wording.

Verification

  • Two independent reviews were carried out, each going through one revision round before approving. Round 1 findings on both sides: an incomplete README sweep of split-architecture language elsewhere in the file, a broken DEPLOYMENT.md section cross-reference introduced by this increment's own renumbering, stale forward-references inside ADR-0018/0019's bodies contradicting the newly-written ADR-0020, and an oversold DEPLOYMENT.md claim about Stripe payments actually working that contradicted ADR-0020's own honest caveat. All were fixed and independently re-verified against the actual files in a closure pass; both reviews landed on APPROVE.
  • QA: pnpm lint, pnpm typecheck, pnpm format:check all pass; changeset status exits 0 (docs-only, zero package bumps); sites/staging's vitest suite (40 files, 1081 tests) passes, confirming the one code-comment touch didn't affect behavior; no browser/Playwright pass needed since no rendered markup/styles/behavior changed.

Notes

Two load-bearing factual corrections this increment made to the plan document's original assumptions (not bugs, but worth surfacing):

  1. The webhook settle route is actually public: true, not non-public as an earlier draft of the plan assumed — grounded in packages/plugin/src/plugin.ts and the route's own unconditional HMAC verification.
  2. Commerce documents and CMS content share one D1 database, not separate databases as the README previously claimed.

Follow-up items surfaced but deliberately deferred as out of this increment's scope:

  • Pinning the settle route's public: true flag with a test/lint rule (recorded as owed in ADR-0020 itself).
  • A stale adr/0013 cross-reference to a "DEPLOYMENT.md §4 'Posture'" section that no longer exists under that name.
  • A few remaining CART_HOLD_TTL_MS references in sites/staging's product page/tests and docs/theme/TEMPERED.md that repeat the same dead-citation pattern already fixed in hold.ts.

Test plan

  • pnpm lint
  • pnpm typecheck
  • pnpm format:check
  • changeset status (docs-only, zero package bumps)
  • sites/staging vitest suite (40 files, 1081 tests)

🤖 Generated with Claude Code

https://claude.ai/code/session_01CQbJYWWm8tf8owshm7XRp8

vedanshujain and others added 2 commits September 20, 2026 15:10
…EPLOYMENT

The commerce service is gone from the tree; these are the documents that still
described it.

- README: delete "Why two parts" outright rather than rewriting it — there is no
  split left to explain, and the surrounding sections already say what the
  architecture is. Correct the "separate databases" architecture line: commerce
  truth and CMS content share the site's single D1 database, commerce in the
  host's per-plugin document store namespaced by plugin id and collection.
- DEPLOYMENT: drop the Node + Postgres service shape entirely and renumber; there
  is one deployable and one database, so no shape table, no service secrets or
  env vars, and no asymmetric-rollback caveat (already removed with the mode
  plumbing — nothing left to drop). Retarget the secrets and operations sections
  at what actually exists: two Worker secrets, payment/email credentials in
  write-only plugin kv, the build-time allowedHosts perimeter, and the
  site-cron-drives-executor / plugin-task-every-15m cron split.
- ADR-0020 (accepted): one deployable. Answers ADR-0002's five "a service may
  remain preferable" reasons one by one as rejected, pre-launch, with no users;
  records the Stripe-secret trust widening and what bounds it; fixes the
  settle-route requirement as public-and-must-stay-public with the unconditional
  Stripe HMAC as the trust anchor (correcting the planning note that called for a
  non-public route, which cannot receive a webhook on this stack) and names that
  no test pins the flag yet; states the site-owned webhook endpoint is permanent;
  states a future service is re-derived from the unchanged domain ports, never
  kept on standby. It does not deprecate ADR-0001, and says so.
- ADR-0002 marked superseded in part: the split is undone, the ports-and-adapters
  discipline stands and is what made the deletion safe.
- adr/README: the 0002 supersession, the 0018/0019 forward references resolved,
  the 0020 entry, and the now-reversed "separate commerce database" queued item.

Docs only. pnpm lint, typecheck and format:check green; changeset status exit 0
with no new changeset (no published package changed).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQbJYWWm8tf8owshm7XRp8
…references, and stop overselling Stripe

Close the review findings on INC-D4.

- README: rewrite the "three parts" intro as one deployable (the plugin owns
  commerce truth in-process via @otta-sh/store-emdash on ctx.storage), and fix
  the screenshot caption, the quick-start comment, the product-model line, the
  ports-and-adapters bullet, the deployment bullet, the repository-layout table
  (drop the two deleted packages, add the two admin ones) and the Status
  section. The Postgres-required concurrency line is left alone: it is a true
  statement about the domain contract suite, not about the deleted service.
- README: the Workers deploy guide is DEPLOYMENT.md §2, not §3.
- sites/staging/README: re-point every DEPLOYMENT.md citation at the new
  numbering and describe the real secret set; SERVICE_API_TOKEN is gone.
- ADR-0018/ADR-0019: resolve the ADR-0020 forward-references in the bodies, not
  just in the index.
- DEPLOYMENT.md: the Stripe secret key is stored but consumed by no live payment
  path — say so instead of promising payable checkout and refunds, and note in
  the egress section that payments-stripe does not yet route through
  ctx.http.fetch, matching ADR-0020 §2's caveat.
- hold.ts: DEFAULT_HOLD_TTL_MS is both default and effective value; drop the
  CART_HOLD_TTL_MS citation into a deleted section.
- Normalize ADR-0002's supersession wording to the repo's "partially
  superseded" precedent.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CQbJYWWm8tf8owshm7XRp8
@vedanshujain
vedanshujain merged commit 22de0bb into feat/in-process-commerce Sep 20, 2026
2 checks passed
@vedanshujain
vedanshujain deleted the docs/one-deployable branch September 20, 2026 15:28
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