@terreno/mcp 56.0.0-beta.0 → 57.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bootstrap.d.ts.map +1 -1
  3. package/dist/bootstrap.js +10 -11
  4. package/dist/bootstrap.js.map +1 -1
  5. package/dist/docs/templates/bootstrap/backend/types/models/userTypes.template.md +5 -4
  6. package/dist/docs/templates/tools/model.template.md +4 -2
  7. package/dist/docs/upgrades/0.31.0.md +60 -0
  8. package/dist/docs/upgrades/56.0.0-beta.2.md +59 -0
  9. package/dist/docs/upgrades/57.0.0-beta.1.md +41 -0
  10. package/dist/docs/versioned/next/README.md +1 -0
  11. package/dist/docs/versioned/next/explanation/README.md +7 -1
  12. package/dist/docs/versioned/next/explanation/deployment-architecture-gcp.md +65 -0
  13. package/dist/docs/versioned/next/explanation/deployment-baseline.md +78 -0
  14. package/dist/docs/versioned/next/explanation/positioning.md +164 -0
  15. package/dist/docs/versioned/next/explanation/repository-settings.md +44 -0
  16. package/dist/docs/versioned/next/explanation/roadmap-process.md +330 -0
  17. package/dist/docs/versioned/next/explanation/roadmap-seed-issues.md +887 -0
  18. package/dist/docs/versioned/next/how-to/README.md +8 -0
  19. package/dist/docs/versioned/next/how-to/build-for-web.md +69 -0
  20. package/dist/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +115 -0
  21. package/dist/docs/versioned/next/how-to/deploy-to-gcp.md +20 -228
  22. package/dist/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +183 -0
  23. package/dist/docs/versioned/next/implementationPlans/PLAN_INDEX.md +31 -0
  24. package/dist/docs/versioned/next/implementationPlans/README.md +56 -30
  25. package/dist/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +2 -1
  26. package/dist/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +1 -0
  27. package/dist/docs/versioned/next/implementationPlans/b2b-platform-program.md +115 -0
  28. package/dist/docs/versioned/next/implementationPlans/billing-stripe.md +158 -0
  29. package/dist/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +1 -0
  30. package/dist/docs/versioned/next/implementationPlans/comms-abstraction.md +323 -0
  31. package/dist/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +107 -0
  32. package/dist/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +157 -0
  33. package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +155 -0
  34. package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +99 -0
  35. package/dist/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +180 -0
  36. package/dist/docs/versioned/next/implementationPlans/deploy-to-gcp.md +1 -0
  37. package/dist/docs/versioned/next/implementationPlans/deploy-to-vercel.md +1 -0
  38. package/dist/docs/versioned/next/implementationPlans/deployment-foundation.md +1 -0
  39. package/dist/docs/versioned/next/implementationPlans/docs-reference-coverage.md +1 -0
  40. package/dist/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +1 -0
  41. package/dist/docs/versioned/next/implementationPlans/examples-demo-coverage.md +1 -0
  42. package/dist/docs/versioned/next/implementationPlans/infra-mcp-research.md +188 -0
  43. package/dist/docs/versioned/next/implementationPlans/infra-mcp.md +269 -0
  44. package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +126 -0
  45. package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +269 -0
  46. package/dist/docs/versioned/next/implementationPlans/native-module-baseline.md +105 -0
  47. package/dist/docs/versioned/next/implementationPlans/orgs-and-teams.md +158 -0
  48. package/dist/docs/versioned/next/implementationPlans/oss-governance-baseline.md +1 -0
  49. package/dist/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +147 -0
  50. package/dist/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -0
  51. package/dist/docs/versioned/next/implementationPlans/public-roadmap-github.md +1 -0
  52. package/dist/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +1 -0
  53. package/dist/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +1 -0
  54. package/dist/docs/versioned/next/reference/README.md +5 -0
  55. package/dist/docs/versioned/next/reference/admin-spa.md +130 -0
  56. package/dist/docs/versioned/next/reference/ai.md +519 -0
  57. package/dist/docs/versioned/next/reference/comms.md +132 -0
  58. package/dist/docs/versioned/next/reference/environment-variables.md +229 -382
  59. package/dist/docs/versioned/next/reference/test.md +108 -0
  60. package/dist/docs/versioned/next/roadmap.md +9 -0
  61. package/dist/docs/versioned/next/tasks/README.md +42 -0
  62. package/dist/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
  63. package/dist/docs/versioned/next/tasks/billing-stripe.md +75 -0
  64. package/dist/docs/versioned/next/tasks/comms-abstraction.md +90 -0
  65. package/dist/docs/versioned/next/tasks/comms-adapter-expo-push.md +29 -0
  66. package/dist/docs/versioned/next/tasks/comms-adapter-sendgrid.md +39 -0
  67. package/dist/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +39 -0
  68. package/dist/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +19 -0
  69. package/dist/docs/versioned/next/tasks/comms-admin-dashboard.md +52 -0
  70. package/dist/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
  71. package/dist/docs/versioned/next/tasks/deployment-foundation.md +12 -12
  72. package/dist/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
  73. package/dist/docs/versioned/next/tasks/infra-mcp.md +43 -0
  74. package/dist/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +215 -0
  75. package/dist/docs/versioned/next/tasks/native-module-baseline.md +42 -0
  76. package/dist/docs/versioned/next/tasks/orgs-and-teams.md +70 -0
  77. package/dist/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
  78. package/dist/docs/versioned/next/tasks/password-reset-and-email-verification.md +60 -0
  79. package/dist/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
  80. package/dist/docs/versioned/next/tasks/public-roadmap-github.md +15 -15
  81. package/package.json +4 -3
  82. package/src/docs/templates/bootstrap/backend/types/models/userTypes.template.md +5 -4
  83. package/src/docs/templates/tools/model.template.md +4 -2
  84. package/src/docs/upgrades/0.31.0.md +60 -0
  85. package/src/docs/upgrades/56.0.0-beta.2.md +59 -0
  86. package/src/docs/upgrades/57.0.0-beta.1.md +41 -0
  87. package/src/docs/versioned/next/README.md +1 -0
  88. package/src/docs/versioned/next/explanation/README.md +7 -1
  89. package/src/docs/versioned/next/explanation/deployment-architecture-gcp.md +65 -0
  90. package/src/docs/versioned/next/explanation/deployment-baseline.md +78 -0
  91. package/src/docs/versioned/next/explanation/positioning.md +164 -0
  92. package/src/docs/versioned/next/explanation/repository-settings.md +44 -0
  93. package/src/docs/versioned/next/explanation/roadmap-process.md +330 -0
  94. package/src/docs/versioned/next/explanation/roadmap-seed-issues.md +887 -0
  95. package/src/docs/versioned/next/how-to/README.md +8 -0
  96. package/src/docs/versioned/next/how-to/build-for-web.md +69 -0
  97. package/src/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +115 -0
  98. package/src/docs/versioned/next/how-to/deploy-to-gcp.md +20 -228
  99. package/src/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +183 -0
  100. package/src/docs/versioned/next/implementationPlans/PLAN_INDEX.md +31 -0
  101. package/src/docs/versioned/next/implementationPlans/README.md +56 -30
  102. package/src/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +2 -1
  103. package/src/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +1 -0
  104. package/src/docs/versioned/next/implementationPlans/b2b-platform-program.md +115 -0
  105. package/src/docs/versioned/next/implementationPlans/billing-stripe.md +158 -0
  106. package/src/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +1 -0
  107. package/src/docs/versioned/next/implementationPlans/comms-abstraction.md +323 -0
  108. package/src/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +107 -0
  109. package/src/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +157 -0
  110. package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +155 -0
  111. package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +99 -0
  112. package/src/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +180 -0
  113. package/src/docs/versioned/next/implementationPlans/deploy-to-gcp.md +1 -0
  114. package/src/docs/versioned/next/implementationPlans/deploy-to-vercel.md +1 -0
  115. package/src/docs/versioned/next/implementationPlans/deployment-foundation.md +1 -0
  116. package/src/docs/versioned/next/implementationPlans/docs-reference-coverage.md +1 -0
  117. package/src/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +1 -0
  118. package/src/docs/versioned/next/implementationPlans/examples-demo-coverage.md +1 -0
  119. package/src/docs/versioned/next/implementationPlans/infra-mcp-research.md +188 -0
  120. package/src/docs/versioned/next/implementationPlans/infra-mcp.md +269 -0
  121. package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +126 -0
  122. package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +269 -0
  123. package/src/docs/versioned/next/implementationPlans/native-module-baseline.md +105 -0
  124. package/src/docs/versioned/next/implementationPlans/orgs-and-teams.md +158 -0
  125. package/src/docs/versioned/next/implementationPlans/oss-governance-baseline.md +1 -0
  126. package/src/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +147 -0
  127. package/src/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -0
  128. package/src/docs/versioned/next/implementationPlans/public-roadmap-github.md +1 -0
  129. package/src/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +1 -0
  130. package/src/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +1 -0
  131. package/src/docs/versioned/next/reference/README.md +5 -0
  132. package/src/docs/versioned/next/reference/admin-spa.md +130 -0
  133. package/src/docs/versioned/next/reference/ai.md +519 -0
  134. package/src/docs/versioned/next/reference/comms.md +132 -0
  135. package/src/docs/versioned/next/reference/environment-variables.md +229 -382
  136. package/src/docs/versioned/next/reference/test.md +108 -0
  137. package/src/docs/versioned/next/roadmap.md +9 -0
  138. package/src/docs/versioned/next/tasks/README.md +42 -0
  139. package/src/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
  140. package/src/docs/versioned/next/tasks/billing-stripe.md +75 -0
  141. package/src/docs/versioned/next/tasks/comms-abstraction.md +90 -0
  142. package/src/docs/versioned/next/tasks/comms-adapter-expo-push.md +29 -0
  143. package/src/docs/versioned/next/tasks/comms-adapter-sendgrid.md +39 -0
  144. package/src/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +39 -0
  145. package/src/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +19 -0
  146. package/src/docs/versioned/next/tasks/comms-admin-dashboard.md +52 -0
  147. package/src/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
  148. package/src/docs/versioned/next/tasks/deployment-foundation.md +12 -12
  149. package/src/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
  150. package/src/docs/versioned/next/tasks/infra-mcp.md +43 -0
  151. package/src/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +215 -0
  152. package/src/docs/versioned/next/tasks/native-module-baseline.md +42 -0
  153. package/src/docs/versioned/next/tasks/orgs-and-teams.md +70 -0
  154. package/src/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
  155. package/src/docs/versioned/next/tasks/password-reset-and-email-verification.md +60 -0
  156. package/src/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
  157. package/src/docs/versioned/next/tasks/public-roadmap-github.md +15 -15
@@ -14,6 +14,7 @@ Umbrella plans that coordinate several IPs.
14
14
 
15
15
  | Plan | Status | Created | Tasks |
16
16
  |------|--------|---------|-------|
17
+ | [Migrate CI/CD to CircleCI](migrate-cicd-to-circleci.md) | Draft — decisions recorded | 2026-08-17 | [tasks](../tasks/migrate-cicd-to-circleci.md) |
17
18
  | [Admin UI v2 — Django-parity admin](admin-ui-v2-django-parity.md) | Approved | 2026-06-15 | [tasks](../tasks/admin-ui-v2-django-parity.md) |
18
19
  | [@terreno/syncdb-codegen](syncdb-codegen.md) | Draft | 2026-07-08 | [tasks](../tasks/syncdb-codegen.md) |
19
20
  | [SyncDB local-first data layer (v2)](syncdb-local-first.md) | In progress — Phases 1–8 landed, Phase 9 follow-ups open | 2026-06-23 | [tasks](../tasks/syncdb-local-first.md) |
@@ -40,3 +41,33 @@ Umbrella plans that coordinate several IPs.
40
41
  | [modelRouter MCP tools](model-router-mcp.md) | MCP surface for consumer app APIs |
41
42
  | [Offline mode](offline-mode.md) | Superseded in large part by [syncdb](syncdb-local-first.md) — confirm and close |
42
43
  | [modelRouter actions](model-router-actions.md) | — |
44
+ | [B2B platform](b2b-platform-program.md) | Draft — decisions D1–D7 resolved | 2026-08-09 | 10 written (+ [rbac-permissions](rbac-permissions.md)); 30 roadmap items seeded |
45
+ | [RBAC Permissions](rbac-permissions.md) | Draft (API design) | 2026-07-08 | TBD |
46
+ | [SyncDB Local-First Data Layer](syncdb-local-first.md) | In progress ([PR #869](https://github.com/flourishhealth/terreno/pull/869)) | 2026-07-13 | [tasks](../tasks/syncdb-local-first.md) |
47
+ | [MCP Boost parity](mcp-boost-parity.md) | In progress ([PR #802](https://github.com/flourishhealth/terreno/pull/802)) | 2026-06-21 | TBD |
48
+ | [Infrastructure MCP server](infra-mcp.md) | Draft — blocked on [RBAC](rbac-permissions.md) | 2026-08-09 | [tasks](../tasks/infra-mcp.md) |
49
+ | [OSS governance baseline](oss-governance-baseline.md) | Draft | None | [tasks](../tasks/oss-governance-baseline.md) |
50
+ | [Public roadmap on GitHub](public-roadmap-github.md) | Draft | None | [tasks](../tasks/public-roadmap-github.md) |
51
+ | [Deploy to GCP (generalized)](deploy-to-gcp.md) | Draft | None | [tasks](../tasks/deploy-to-gcp.md) |
52
+ | [Agentic SDLC plugin (`/terreno-*`)](agentic-sdlc-plugin.md) | Draft | Partial | [tasks](../tasks/agentic-sdlc-plugin.md) |
53
+ | [RTK deprecation and syncdb migration docs](rtk-to-syncdb-migration-docs.md) | Draft | **Blocked** (gating IP) | [tasks](../tasks/rtk-to-syncdb-migration-docs.md) |
54
+ | [Positioning — Django/Rails for TypeScript](positioning-django-rails-universal.md) | Draft | Partial | [tasks](../tasks/positioning-django-rails-universal.md) |
55
+ | [Reference documentation coverage](docs-reference-coverage.md) | Draft | Blocked | [tasks](../tasks/docs-reference-coverage.md) |
56
+ | [AI-first tutorials](docs-tutorials-ai-first.md) | Draft | Blocked | [tasks](../tasks/docs-tutorials-ai-first.md) |
57
+ | [Deployment foundation](deployment-foundation.md) | Draft | Partial | [tasks](../tasks/deployment-foundation.md) |
58
+ | [Deploy to Vercel](deploy-to-vercel.md) | Draft | Partial | [tasks](../tasks/deploy-to-vercel.md) |
59
+ | [Upgrade guides and skill](upgrade-guides-and-skill.md) | Draft | Blocked | [tasks](../tasks/upgrade-guides-and-skill.md) |
60
+ | [The AI development loop (Boost)](ai-dev-loop-boost.md) | Draft | Partial | [tasks](../tasks/ai-dev-loop-boost.md) |
61
+ | [Dogfooding run and launch blog post](build-terreno-app-validation.md) | Draft | Blocked | [tasks](../tasks/build-terreno-app-validation.md) |
62
+ | [Examples, demo, and test coverage](examples-demo-coverage.md) | Draft | Partial | [tasks](../tasks/examples-demo-coverage.md) |
63
+ | [Web SSR and admin SPA](web-ssr-and-admin-spa.md) | Draft | Partial | [tasks](../tasks/web-ssr-and-admin-spa.md) |
64
+ | [Pluggable communications layer (@terreno/comms)](comms-abstraction.md) | Draft | None | [tasks](../tasks/comms-abstraction.md) |
65
+ | [Comms adapter — Expo push](comms-adapter-expo-push.md) | Draft | None | [tasks](../tasks/comms-adapter-expo-push.md) |
66
+ | [Comms adapter — Twilio SMS](comms-adapter-twilio-sms.md) | Draft | None | [tasks](../tasks/comms-adapter-twilio-sms.md) |
67
+ | [Comms adapter — Twilio Verify (OTP)](comms-adapter-twilio-verify.md) | Draft | None | [tasks](../tasks/comms-adapter-twilio-verify.md) |
68
+ | [Comms adapter — SendGrid email](comms-adapter-sendgrid.md) | Draft | None | [tasks](../tasks/comms-adapter-sendgrid.md) |
69
+ | [Comms admin dashboard (errors, retries, log digging)](comms-admin-dashboard.md) | Draft | Partial | [tasks](../tasks/comms-admin-dashboard.md) |
70
+ | [Password reset and email verification](password-reset-and-email-verification.md) | Draft | None | [tasks](../tasks/password-reset-and-email-verification.md) |
71
+ | [Organizations, teams, and multi-tenant scoping](orgs-and-teams.md) | Draft | None | [tasks](../tasks/orgs-and-teams.md) |
72
+ | [Stripe billing and subscriptions](billing-stripe.md) | Draft | None | [tasks](../tasks/billing-stripe.md) |
73
+ | [Native module baseline (next major)](native-module-baseline.md) | Draft | None | [tasks](../tasks/native-module-baseline.md) |
@@ -1,42 +1,68 @@
1
1
  # Implementation Plans
2
2
 
3
- Forward-looking implementation plans for significant features and architectural changes to Terreno packages.
3
+ Forward-looking design docs for significant features and architectural changes to
4
+ Terreno packages, written **before implementation**.
4
5
 
5
- ## Purpose
6
+ An implementation plan (IP) is one half of a two-file pair:
6
7
 
7
- This directory contains detailed technical plans for major features **before implementation**. Each plan documents:
8
+ | File | Holds | Path |
9
+ | ---- | ----- | ---- |
10
+ | **IP** | Design goals, architecture, models/APIs, phases, acceptance criteria | `docs/implementationPlans/<slug>.md` |
11
+ | **Task list** | The bot-consumable execution checklist for that IP | `docs/tasks/<slug>.md` |
8
12
 
9
- - Design goals and rationale
10
- - Architecture and file structure
11
- - Configuration interfaces
12
- - Usage examples
13
- - Breaking changes and migration paths
14
- - Implementation tasks and phases
13
+ The IP is the source of truth for *what and why*; the task list is the source of truth
14
+ for *the concrete steps*. External trackers (a GitHub roadmap issue, a Linear issue, a
15
+ discussion thread) link **to** these files — they never replace them. See
16
+ [`docs/tasks/README.md`](../tasks/README.md) for the task-file shape.
15
17
 
16
- ## Current Plans
18
+ ## The live index
17
19
 
18
- - **[Admin UI v2 — Django-parity admin](admin-ui-v2-django-parity.md)** — Config-driven admin shell (sidebar, home widgets, changelist, forms, bulk + background actions); tasks in [`docs/tasks/admin-ui-v2-django-parity.md`](../tasks/admin-ui-v2-django-parity.md)
19
- - **[Modular API (TerrenoApp)](ModularAPI.md)** — New fluent builder API to replace `setupServer` in `@terreno/api`
20
- - **[Offline Mode](offline-mode.md)** — Placeholder plan for offline queueing, replay, conflict handling, and UI surfaces
21
- - **[MCP Boost Parity](mcp-boost-parity.md)** — Docs search tools, local stdio MCP with runtime introspection, browser log capture, per-package guidelines, and upgrade prompts (inspired by laravel/boost)
22
- - **[Docs Site & Versioning](docs-site-and-versioning.md)** — Docusaurus site, versioned docs per release, UI demo embeds, and docs-maintenance skills
20
+ [`PLAN_INDEX.md`](PLAN_INDEX.md) is the authoritative list of active, completed, and
21
+ deferred plans — read it, not this page, to see what is current. This README explains the
22
+ process; `PLAN_INDEX.md` tracks the state.
23
23
 
24
- ## Status Tracking
24
+ ## When to write an IP
25
25
 
26
- | Plan | Status | Target Version | Discussion |
27
- |------|--------|----------------|------------|
28
- | Admin UI v2 (Django parity) | ✅ Approved | TBD | — |
29
- | Modular API | 📝 Planning | 2.0.0 | [#149](https://github.com/FlourishHealth/terreno/pull/149) |
30
- | Offline Mode | Placeholder | TBD | TBD |
31
- | MCP Boost Parity | 📝 Planning | TBD | TBD |
32
- | Docs Site & Versioning | 📝 Planning | TBD | TBD |
26
+ Substantial work is planned before coding. Quick rule (full table in
27
+ [CONTRIBUTING.md](../../CONTRIBUTING.md#when-to-write-an-implementation-plan-ip)):
33
28
 
34
- ## Process
29
+ | Needs an IP | Does not need an IP |
30
+ | ----------- | ------------------- |
31
+ | New published package | Bug fix in one package |
32
+ | New public API surface | Documentation-only change |
33
+ | Cross-package architectural change | Small internal refactor |
34
+ | Breaking change | Test or CI fix |
35
35
 
36
- 1. **Planning**: Implementation plan merged to master
37
- 2. **Discussion**: Community feedback in linked PR/issue
38
- 3. **Implementation**: Feature developed in feature branch with tests
39
- 4. **Documentation**: How-to guides and migration docs updated
40
- 5. **Release**: Plan moves to `docs/explanation/` as architectural documentation
36
+ ## How a plan gets written and built
41
37
 
42
- Plans that are fully implemented should be moved to `docs/explanation/` and updated to reflect the actual implementation.
38
+ The [`terreno-planning` plugin](../../plugins/README.md) drives the pipeline:
39
+
40
+ 1. **Blend** (`terreno-1-blend`) — write the IP + task list, questions first.
41
+ 2. **Roast** (`terreno-2-roast`) — implement via TDD from the approved IP.
42
+ 3. **Cupping** (`terreno-3-cupping`) — independently verify against the IP.
43
+ 4. **Pour** (`terreno-4-pour`) — commit, push, open the PR.
44
+ 5. **Dial In** (`terreno-5-dialin`) — drive CI and review until mergeable.
45
+
46
+ You can also author an IP directly with the `ip` skill; both produce the same two files.
47
+
48
+ ### Roadmap handoff (roadmap-enabled repos only)
49
+
50
+ In repos that run a public roadmap (Discussions + a roadmap Project — currently Terreno),
51
+ Blend hands off to `roadmap-item` once the IP is **Approved** to create or update the
52
+ public tracking issue, and the IP header records the `Discussion:` and `Roadmap issue:`
53
+ links. See [`docs/explanation/roadmap-process.md`](../explanation/roadmap-process.md) for
54
+ the full IP ↔ roadmap lifecycle.
55
+
56
+ In repos with **no** roadmap board (Flourish, most consumer apps), the pipeline is
57
+ identical minus that handoff: the IP + task list plus `PLAN_INDEX.md` are the source of
58
+ truth, and Linear tracks execution via the IP header `Linear:` link.
59
+
60
+ ## Lifecycle
61
+
62
+ 1. **Draft** → **Approved** — IP written and reviewed (status lives in the IP header and
63
+ `PLAN_INDEX.md`).
64
+ 2. **In progress** → **Complete** — implemented, verified, merged.
65
+ 3. **Archive** — completed IPs move to `docs/implementationPlans/archive/` and the index is updated.
66
+
67
+ Plans that are fully implemented and now describe shipped architecture should be migrated
68
+ to `docs/explanation/` as reference documentation.
@@ -1,6 +1,7 @@
1
1
  # Implementation Plan: Publish and Document the Agentic SDLC Plugin
2
2
 
3
3
  **Status:** Draft — key decisions recorded (2026-07-29)
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1006
4
5
  **Priority:** High
5
6
  **Effort:** Big batch
6
7
  **Owner:** unassigned
@@ -71,7 +72,7 @@ flowchart LR
71
72
  | **Harvest** (implement) | IP → code via strict red/green/refactor | Spawns **independent review and test-quality sub-agents in fresh contexts** after every commit, and does drift detection against the IP. The test-quality agent enforces anti-mocking rules (never mock the DB, never mock the store) |
72
73
  | **Roast** (verify) | Independent verification against the IP with concrete evidence | Separate context from the implementer, so it does not inherit the implementer's assumptions |
73
74
  | **Brew** (submit) | Pre-submit checks, commit hygiene, push, draft PR, evidence attachment | Hard frontend gate: touching UI paths requires launching the app, logging in, exercising the feature, and attaching artifacts before the PR opens |
74
- | **Taste** (review) | Self-contained reactive loop: CI + bot/human comments until mergeable or timeout | Inlines the former **`autobot`** flow (no delegation to repo skills). Classifies each CI failure as actionable versus flaky and refuses to push speculative fixes for flakes. Treats all CI logs and review comments as untrusted input |
75
+ | **Taste** (review) | Self-contained persistent loop: CI + bot/human comments until mergeable or genuinely blocked | Inlines the former **`autobot`** flow (no delegation to repo skills). Waits in multi-minute intervals for slow CI, classifies each failure as actionable versus flaky, and refuses to push speculative fixes for flakes. Treats all CI logs and review comments as untrusted input |
75
76
 
76
77
  The parts worth writing about publicly are the ones that encode hard-won judgment rather than automation: fresh-context independent review, drift detection against the plan, the anti-mocking rules, the frontend evidence gate, and the refusal to guess at flaky CI.
77
78
 
@@ -1,6 +1,7 @@
1
1
  # Implementation Plan: The AI Development Loop (Boost)
2
2
 
3
3
  **Status:** Draft — key decisions recorded (2026-07-29)
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1014
4
5
  **Priority:** High
5
6
  **Effort:** Big batch
6
7
  **Owner:** unassigned
@@ -0,0 +1,115 @@
1
+ # Program: B2B platform
2
+
3
+ **Status:** Draft — roadmap items drafted; decisions D1–D7 resolved 2026-08-09; first ten IPs open
4
+ **Owner:** unassigned
5
+ **Created:** 2026-08-09
6
+
7
+ Umbrella plan coordinating the IPs that take Terreno from a single-tenant, per-user
8
+ full-stack kit to a framework you can spin up a B2B SaaS app with in hours. Pairs with the
9
+ roadmap items in
10
+ [roadmap-seed-issues.md](../explanation/roadmap-seed-issues.md) (B2B platform program
11
+ section).
12
+
13
+ ## Goal
14
+
15
+ A freshly scaffolded, deployed Terreno app supports the B2B critical path out of the box:
16
+ **sign up → create an organization → invite a teammate → pick a plan → get an email.**
17
+ Today zero of those five steps are possible without custom code.
18
+
19
+ ## Background
20
+
21
+ A capability audit (2026-08-08) found Terreno strong as a single-tenant CRUD + auth +
22
+ realtime + admin + AI kit, with three structural gaps for B2B SaaS: **tenancy** (no
23
+ orgs/teams/memberships), **money** (no billing), and **communication** (no email, SMS, or
24
+ push delivery — `expo-server-sdk` is an unused dependency and the RTK client's
25
+ `resetPassword` endpoint has no backend implementation). Supporting gaps: no invitations,
26
+ no durable jobs, no inbound-webhook framework, no rate limiting, no framework-level audit
27
+ log, no enterprise SSO/MFA, and missing B2B UI surfaces (server-filtered data grid, charts,
28
+ org switcher, dark mode).
29
+
30
+ ## Tracks
31
+
32
+ | Track | Theme | IPs / roadmap items |
33
+ |---|---|---|
34
+ | A | Tenancy & access | `orgs-and-teams`, `rbac-permissions` (existing draft), `invitations-and-seats`, `org-management-ui` |
35
+ | C | Communications (pluggable) | `comms-abstraction`, one item **per adapter**: `comms-adapter-expo-push` (first push adapter, per D4), `comms-adapter-twilio-sms`, `comms-adapter-twilio-verify`, `comms-adapter-sendgrid` (first mail adapter, per D2); operations: `comms-admin-dashboard`; consumers: `password-reset-and-email-verification`, `notification-center` |
36
+ | B | Billing | `inbound-webhooks`, `billing-stripe` (web-first, per D1), `mobile-iap-revenuecat` (Future) |
37
+ | D | Zero-to-deployed DX | `create-terreno-app`, `mongo-migrations` (deploy items already exist in the OSS launch program) |
38
+ | E | B2B UI surfaces | `data-grid-server-filters`, `charts-and-dashboards`, `dark-mode-theme`, `command-palette`, `wizard-stepper`, `wysiwyg-editor` (markdown stays for now, per D3), `global-search` |
39
+ | F | Enterprise & scale | `framework-audit-log` (Next), `rate-limiting` (Next), `job-queues` (Next), `enterprise-sso`, `mfa-step-up-auth` |
40
+ | — | Native baseline | `native-module-baseline` — all new native modules land in one major release |
41
+
42
+ ## Sequencing
43
+
44
+ 1. **Foundations first:** `comms-abstraction` and `orgs-and-teams` are independent and both
45
+ unblock most of the program. `inbound-webhooks` lands before billing and before comms
46
+ delivery callbacks.
47
+ 2. **Close the auth hole early:** `password-reset-and-email-verification` ships as soon as
48
+ the abstraction plus one mail adapter exist — the client already calls `POST
49
+ /resetPassword`.
50
+ 3. **Billing after orgs + webhooks.**
51
+ 4. **Native baseline rides the next major release** so every later feature ships as
52
+ JS/OTA against the same binary.
53
+ 5. Track E/F items are independent and can be scheduled opportunistically.
54
+
55
+ ## Native module baseline (next major release)
56
+
57
+ Adding a native module to `@terreno/ui` or the example apps forces consumers to cut a new
58
+ dev-client/store build, so all additions land together in the next major:
59
+
60
+ | Package | Enables | Notes |
61
+ |---|---|---|
62
+ | `@stripe/stripe-react-native` | Billing (payment sheet, Apple/Google Pay) | Config plugin; Kotlin 2.x + compileSdk 36 via `expo-build-properties` |
63
+ | `react-native-purchases` (+ `-ui`) | Mobile IAP (RevenueCat) | Feature ships later (D1: Stripe web-first) — SDK included now so IAP lands without another major |
64
+ | `expo-device` | Push registration guards | trivial |
65
+ | `expo-crypto` | PKCE for SSO, invite tokens | trivial |
66
+ | `expo-local-authentication` | Biometric step-up (MFA) | `NSFaceIDUsageDescription` |
67
+ | `expo-system-ui` | Dark mode root/system chrome | trivial |
68
+ | `react-native-otp-verify` | Android SMS OTP autofill | Included (D7) for the Twilio Verify flows |
69
+
70
+ Excluded by decision: `@10play/tentap-editor` (D3 — markdown stays; revisit in a later
71
+ major if WYSIWYG is adopted).
72
+
73
+ Already linked, no action: skia, reanimated, gesture-handler, svg, webview,
74
+ expo-notifications, expo-secure-store, expo-document-picker/image-picker, blur,
75
+ permissions, expo-network. Charts (`victory-native`) is JS-only on existing peers.
76
+
77
+ ## Decision log
78
+
79
+ All decisions resolved by the maintainer on 2026-08-09:
80
+
81
+ | # | Decision | Resolution |
82
+ |---|---|---|
83
+ | D1 | Billing vendor strategy | **Stripe web-first.** RevenueCat mobile IAP stays `Future`; `react-native-purchases` still ships in the native baseline |
84
+ | D2 | First mail adapter | **SendGrid (Twilio SendGrid)** — pairs with the Twilio SMS/Verify credentials story; other providers get items when demand appears |
85
+ | D3 | WYSIWYG editor | **Markdown-only for now.** TenTap excluded from the native baseline; revisit in a later major |
86
+ | D4 | First push adapter | **Expo push.** |
87
+ | D5 | Targets | **Twilio push adapter dropped entirely** (item removed). Promoted to `Next`: `notification-center`, `framework-audit-log`, `rate-limiting`, `job-queues`. Everything else stays as drafted |
88
+ | D6 | Orgs data model | **Native Terreno Mongoose models** (works for JWT + Better Auth), optional Better Auth sync later |
89
+ | D7 | Final native manifest | **Confirmed:** six core packages + `react-native-purchases` + `react-native-otp-verify`; no TenTap |
90
+
91
+ ## IPs in this program
92
+
93
+ | IP | Status | Tasks |
94
+ |---|---|---|
95
+ | [comms-abstraction](comms-abstraction.md) | Draft | [tasks](../tasks/comms-abstraction.md) |
96
+ | [comms-adapter-expo-push](comms-adapter-expo-push.md) | Draft | [tasks](../tasks/comms-adapter-expo-push.md) |
97
+ | [comms-adapter-twilio-sms](comms-adapter-twilio-sms.md) | Draft | [tasks](../tasks/comms-adapter-twilio-sms.md) |
98
+ | [comms-adapter-twilio-verify](comms-adapter-twilio-verify.md) | Draft | [tasks](../tasks/comms-adapter-twilio-verify.md) |
99
+ | [comms-adapter-sendgrid](comms-adapter-sendgrid.md) | Draft | [tasks](../tasks/comms-adapter-sendgrid.md) |
100
+ | [comms-admin-dashboard](comms-admin-dashboard.md) | Draft | [tasks](../tasks/comms-admin-dashboard.md) |
101
+ | [password-reset-and-email-verification](password-reset-and-email-verification.md) | Draft | [tasks](../tasks/password-reset-and-email-verification.md) |
102
+ | [orgs-and-teams](orgs-and-teams.md) | Draft | [tasks](../tasks/orgs-and-teams.md) |
103
+ | [billing-stripe](billing-stripe.md) | Draft | [tasks](../tasks/billing-stripe.md) |
104
+ | [native-module-baseline](native-module-baseline.md) | Draft | [tasks](../tasks/native-module-baseline.md) |
105
+ | [rbac-permissions](rbac-permissions.md) | Draft (pre-existing API design) | TBD |
106
+
107
+ Remaining items (`inbound-webhooks`, `invitations-and-seats`, `org-management-ui`,
108
+ `notification-center`, `framework-audit-log`, `rate-limiting`, `job-queues`, …) get IPs as
109
+ they approach the top of the queue.
110
+
111
+ ## Not Included
112
+
113
+ - Deploy guides and deployment foundation (OSS launch program).
114
+ - `@terreno/syncdb` migration work (PR #869 track).
115
+ - Marketing/positioning for the B2B pitch.
@@ -0,0 +1,158 @@
1
+ # Implementation Plan: Stripe billing and subscriptions
2
+
3
+ **Status:** Draft
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1025
5
+ **Priority:** High
6
+ **Effort:** Epic
7
+ **Owner:** unassigned
8
+ **Created:** 2026-08-09
9
+ **Program:** [B2B platform](b2b-platform-program.md)
10
+ **Depends on:** [orgs-and-teams](orgs-and-teams.md), inbound-webhooks (IP pending — hard dependency for Phase 3)
11
+ **RTK deprecation flag:** None for the backend; the two screens in Phase 4 follow whatever
12
+ data layer example-frontend uses at that time
13
+
14
+ ## Goal
15
+
16
+ Terreno has no way to charge customers. This IP adds `@terreno/billing`, a Stripe-backed
17
+ (decision D1: web-first) billing plugin: Stripe customers mapped to organizations,
18
+ code-defined plans mapped to Stripe prices, Checkout and Billing Portal session routes,
19
+ webhook-driven subscription/entitlement sync, and plan gating that plugs into the existing
20
+ feature-flag layer — so `plan: "pro"` can gate features the same way segments do today.
21
+
22
+ ## Non-Goals
23
+
24
+ - Mobile in-app purchases (`mobile-iap-revenuecat`, Future — the RevenueCat SDK ships in
25
+ the native baseline so it can land without another major).
26
+ - Usage-based/metered billing, invoicing customization, tax configuration (Stripe Tax is
27
+ configured in Stripe, not by Terreno).
28
+ - Payment methods beyond what Stripe Checkout/Portal handle.
29
+ - Seat-count enforcement (lands with `invitations-and-seats` integration, Phase 5/future).
30
+
31
+ ## Decisions
32
+
33
+ | Question | Decision |
34
+ |----------|----------|
35
+ | Package | New workspace package `@terreno/billing` with `stripe` as a real dependency (vendor-specific by design per D1; a provider abstraction is not warranted for one vendor) |
36
+ | Billing subject | The **organization** (B2B); optional `subject: "user"` mode for consumer apps |
37
+ | Plan definition | Code-defined `plans: [{id, name, stripePriceId, features: string[]}]` passed to `BillingApp` — plans are reviewed code, prices live in Stripe |
38
+ | Checkout UX | Stripe-hosted Checkout + Billing Portal (web-first per D1); no custom card forms; `@stripe/stripe-react-native` payment sheet arrives with the IAP item if ever needed |
39
+ | Source of truth | Stripe is authoritative; local `BillingSubscription` is a webhook-synced cache — no entitlement decision ever calls Stripe inline |
40
+ | Entitlements | `getEntitlements(orgId)` service + a feature-flag segment factory (`planSegment("pro")`) plugging into `FeatureFlagsApp` segments; optional `RequiresPlan("pro")` permission |
41
+ | Webhooks | Consumed through the inbound-webhooks framework with Stripe signature verification and event idempotency (`stripeEventId` unique index) |
42
+
43
+ ## Architecture
44
+
45
+ ```
46
+ billing/
47
+ src/
48
+ billingApp.ts # BillingApp TerrenoPlugin (routes, webhook registration)
49
+ billingService.ts # getEntitlements, planSegment, RequiresPlan
50
+ stripeSync.ts # webhook event handlers → model sync
51
+ models/
52
+ billingCustomer.ts # orgId ↔ stripeCustomerId
53
+ billingSubscription.ts
54
+ billingEvent.ts # processed webhook events (idempotency)
55
+ ```
56
+
57
+ ```typescript
58
+ new BillingApp({
59
+ stripeSecretKey: env,
60
+ webhookSecret: env,
61
+ plans: [{id: "pro", name: "Pro", stripePriceId: "price_...", features: ["ai", "sso"]}],
62
+ subject: "organization", // default
63
+ onSubscriptionChange?: (sub) => Promise<void>;
64
+ })
65
+ ```
66
+
67
+ Webhook events handled: `checkout.session.completed`,
68
+ `customer.subscription.created|updated|deleted`, `invoice.payment_failed`,
69
+ `invoice.paid`. Each handler is idempotent via `BillingEvent`.
70
+
71
+ ## Models
72
+
73
+ Five-type pattern, descriptions, `createdUpdatedPlugin` + `isDeletedPlugin`.
74
+
75
+ **BillingCustomer** — `organizationId` (ref, required, unique indexed),
76
+ `stripeCustomerId` (string, unique indexed), `email` (string).
77
+
78
+ **BillingSubscription** — `organizationId` (ref, required, indexed), `planId` (string —
79
+ Terreno plan id), `stripeSubscriptionId` (string, unique), `status` (Stripe status enum:
80
+ active/trialing/past_due/canceled/…), `currentPeriodEnd` (date), `cancelAtPeriodEnd`
81
+ (boolean), `seats` (number, optional).
82
+
83
+ **BillingEvent** — `stripeEventId` (string, unique), `type` (string), `processedAt`
84
+ (date), `error` (string, optional).
85
+
86
+ ## APIs
87
+
88
+ | Method | Path | Permissions | Notes |
89
+ |---|---|---|---|
90
+ | GET | `/billing/plans` | IsAuthenticated | Code-defined plans (no Stripe call) |
91
+ | GET | `/billing/subscription` | IsOrgMember | Current org's subscription + entitlements |
92
+ | POST | `/billing/checkoutSession` | IsOrgAdmin | `{planId}` → Stripe Checkout URL; creates customer on first use |
93
+ | POST | `/billing/portalSession` | IsOrgAdmin | Stripe Billing Portal URL |
94
+ | POST | `/billing/webhooks/stripe` | signature-verified | Via inbound-webhooks framework; raw body |
95
+
96
+ ## Notifications
97
+
98
+ `invoice.payment_failed` fires `onSubscriptionChange` and sends a dunning email through
99
+ `@terreno/comms` when a mail provider is configured (template `paymentFailed`).
100
+
101
+ ## UI
102
+
103
+ Phase 4, kept deliberately thin: a plan-picker screen (`GET /billing/plans` + checkout
104
+ redirect) and a billing settings card (current plan, status, portal link) in
105
+ example-frontend; org-management surfaces integrate later via `org-management-ui`.
106
+
107
+ ## Phases
108
+
109
+ 1. **Package + models:** `@terreno/billing` scaffold, three models, plan config
110
+ validation, unit tests.
111
+ 2. **Checkout + portal:** customer creation, session routes, `getEntitlements`,
112
+ `planSegment`, `RequiresPlan`, tests with mocked Stripe SDK.
113
+ 3. **Webhook sync** *(gated on inbound-webhooks)*: signature-verified event routes,
114
+ idempotent handlers, dunning email, `stripe-mock`/fixture tests.
115
+ 4. **UI + example + docs:** plan picker + billing settings in example-frontend, seeds
116
+ with Stripe test-mode instructions, `docs/how-to/add-billing.md`, SDK regen.
117
+
118
+ ## Feature Flags & Migrations
119
+
120
+ New collections only. Entitlement gating composes with existing feature flags — a flag can
121
+ target `planSegment("pro")` exactly like today's `pro-users` segment example.
122
+
123
+ ## Activity Log & User Updates
124
+
125
+ Subscription lifecycle changes logged via `logger` + `BillingEvent`; org-facing billing
126
+ history is the Stripe Portal's job, not Terreno's.
127
+
128
+ ## Not Included / Future Work
129
+
130
+ - RevenueCat entitlement merge (`mobile-iap-revenuecat`).
131
+ - Seat enforcement against Membership counts (`invitations-and-seats` follow-up).
132
+ - Metered usage, coupons/promotions management, multi-currency handling beyond Stripe
133
+ defaults.
134
+
135
+ ## Files to Create / Modify
136
+
137
+ - `billing/` (new workspace package), root `package.json` workspace + scripts
138
+ - `example-backend/src/server.ts` — env-gated `BillingApp` registration
139
+ - `example-frontend` — two screens + SDK regen
140
+ - `docs/how-to/add-billing.md`, `docs/reference/billing.md`, env reference
141
+ - `.github/workflows/billing-ci.yml`, `publish-on-tag.yml`
142
+
143
+ ## Task List
144
+
145
+ See [docs/tasks/billing-stripe.md](../tasks/billing-stripe.md).
146
+
147
+ ## Acceptance Criteria
148
+
149
+ - [ ] An org admin can create a Checkout session for a plan and, after the (test-mode)
150
+ webhook lands, `GET /billing/subscription` reports the active plan and entitlements.
151
+ - [ ] Webhook events are signature-verified and idempotent: replaying the same
152
+ `stripeEventId` is a no-op.
153
+ - [ ] A feature flag targeting `planSegment("pro")` evaluates true only for members of a
154
+ subscribed org; `RequiresPlan("pro")` returns 403 otherwise.
155
+ - [ ] Subscription cancellation (portal) downgrades entitlements after the webhook, not
156
+ before.
157
+ - [ ] Non-admin org members cannot create checkout/portal sessions.
158
+ - [ ] Entitlement checks perform zero inline Stripe API calls.
@@ -1,6 +1,7 @@
1
1
  # Implementation Plan: Dogfooding Run and Launch Blog Post
2
2
 
3
3
  **Status:** Draft — key decisions recorded (2026-07-29)
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1015
4
5
  **Priority:** High (this is the program's acceptance test)
5
6
  **Effort:** Big batch
6
7
  **Owner:** unassigned