@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
@@ -0,0 +1,108 @@
1
+ # @terreno/test
2
+
3
+ Shared Bun test helpers for Terreno backend packages: in-memory MongoDB lifecycle, auth env defaults, HTTP fixtures, and log silencing.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ bun add -d @terreno/test mongoose
9
+ ```
10
+
11
+ `mongoose` is a peer dependency (>= 8.0.0).
12
+
13
+ ## Commands
14
+
15
+ From the `@terreno/test` package directory:
16
+
17
+ ```bash
18
+ bun run compile # Compile TypeScript
19
+ bun run test # Run package tests
20
+ bun run lint # Lint code
21
+ ```
22
+
23
+ Consumers typically run `bun test` in their own package with a `bunfig.toml` preload (see below).
24
+
25
+ ## Preload pattern
26
+
27
+ Add a `bunfig.toml` preload that wires MongoDB and test env before any test file runs. Example from `admin-backend/bunfig.toml`:
28
+
29
+ ```toml
30
+ [test]
31
+ preload = ["./src/tests/bunSetup.ts"]
32
+ root = "./src"
33
+ ```
34
+
35
+ Example preload (`admin-backend/src/tests/bunSetup.ts`):
36
+
37
+ ```typescript
38
+ import {registerSimpleMongoPreload} from "@terreno/test";
39
+
40
+ process.env.TERRENO_TEST_USE_MEMORY_MONGO = "true";
41
+
42
+ registerSimpleMongoPreload({
43
+ testEnv: {
44
+ tokenIssuer: "terreno-admin-backend.test",
45
+ },
46
+ });
47
+ ```
48
+
49
+ The `@terreno/api` package uses a two-file preload (`api/bunfig.toml`): `./src/tests/testEnv.ts` then `./src/tests/bunSetup.ts`, which calls `registerBackendPreload` or `registerSimpleMongoPreload` depending on fixture-cache settings.
50
+
51
+ Import the memory-Mongo flag alone when you only need the env var:
52
+
53
+ ```typescript
54
+ import "@terreno/test/preload/memoryMongo";
55
+ ```
56
+
57
+ That sets `TERRENO_TEST_USE_MEMORY_MONGO=true` before other preload logic runs.
58
+
59
+ ## Test environment
60
+
61
+ Call `setTerrenoTestEnv()` from a preload or `beforeEach` to apply canonical auth secrets and validate required vars (via internal `setupTestEnvironment()`):
62
+
63
+ ```typescript
64
+ import {setTerrenoTestEnv} from "@terreno/test";
65
+
66
+ setTerrenoTestEnv({
67
+ tokenIssuer: "my-package.test",
68
+ tokenSecret: "secret",
69
+ refreshTokenSecret: "refresh",
70
+ sessionSecret: "session",
71
+ });
72
+ ```
73
+
74
+ Defaults: `TOKEN_SECRET`, `TOKEN_ISSUER`, `REFRESH_TOKEN_SECRET`, `SESSION_SECRET`, `NODE_ENV=test`, `TZ=UTC`.
75
+
76
+ ## Environment variables
77
+
78
+ | Variable | Effect |
79
+ |----------|--------|
80
+ | `TERRENO_TEST_USE_MEMORY_MONGO` | When `"true"`, `registerSimpleMongoPreload` starts `mongodb-memory-server` if `TERRENO_TEST_MONGODB_URI` is unset. |
81
+ | `TERRENO_TEST_MONGODB_URI` | External MongoDB URI. Takes priority over in-memory server in `startMongoServer` and `registerSimpleMongoPreload`. |
82
+ | `BUN_TEST_DISABLE_DB` | When `"true"`, `registerBackendPreload` skips all Mongo `beforeAll`/`afterAll` hooks (no DB startup). |
83
+
84
+ `startMongoServer` also publishes the resolved URI to `TERRENO_TEST_MONGO_URI` and honors `TERRENO_TEST_USE_REPLSET=true` for replica-set memory servers.
85
+
86
+ ## Exported helpers
87
+
88
+ | Export | Description |
89
+ |--------|-------------|
90
+ | `registerBackendPreload` | Full lifecycle: memory/external Mongo, optional transactions, Sentry mock, log silencing. |
91
+ | `registerSimpleMongoPreload` | Lightweight connect-once pattern (used by most packages). |
92
+ | `setTerrenoTestEnv` | Apply and validate auth test env vars. |
93
+ | `startMongoServer` / `stopMongoServer` | Start or stop shared in-memory Mongo and connect mongoose. |
94
+ | `getMongoServerUri` | Resolved URI after `startMongoServer`. |
95
+ | `getBaseServer` | Build an Express app for supertest from route registrars. |
96
+ | `authAsUser` | Login helper returning auth headers for supertest. |
97
+ | `createMongoTestCache` | Fixture-cache controller for fast `@terreno/api` tests. |
98
+ | `registerLogSilencing` / `createLogSilencer` | Suppress Winston noise in tests. |
99
+ | `registerSentryBunMock` | Mock `@sentry/bun` in preload. |
100
+ | `ensureTestMongooseConnected` | Connect mongoose to test URI with retries. |
101
+ | `waitForDocument` / `waitForDocuments` | Poll until documents match a query. |
102
+ | `startTestTransaction` / `abortTestTransaction` | Per-test mongoose transactions when enabled. |
103
+
104
+ ## Conventions
105
+
106
+ - Preload once per package via `bunfig.toml`; do not start Mongo in individual test files.
107
+ - Prefer `registerSimpleMongoPreload` unless you need transactions or fixture caching (`registerBackendPreload`).
108
+ - Never mock `@terreno/api` or Mongoose models in package tests — use the real stack against memory Mongo.
@@ -0,0 +1,9 @@
1
+ # Roadmap
2
+
3
+ Terreno's public roadmap lives on GitHub:
4
+
5
+ - **[ROADMAP.md](https://github.com/FlourishHealth/terreno/blob/master/ROADMAP.md)** — generated from the Terreno Roadmap project board (also in the repo root)
6
+ - **[Roadmap process](explanation/roadmap-process.md)** — Discussions, triage, Linear bridge, maintainer setup
7
+ - **[GitHub Discussions](https://github.com/FlourishHealth/terreno/discussions)** — Ideas, Q&A, RFCs
8
+
9
+ To propose work, start an [Ideas discussion](https://github.com/FlourishHealth/terreno/discussions/new?category=ideas) rather than opening a tracking issue directly.
@@ -0,0 +1,42 @@
1
+ # Task lists
2
+
3
+ Bot-consumable execution checklists, one per implementation plan (IP). A task file is
4
+ the second half of the pair described in
5
+ [`docs/implementationPlans/README.md`](../implementationPlans/README.md):
6
+
7
+ - **IP** (`docs/implementationPlans/<slug>.md`) — the design: what and why.
8
+ - **Task list** (`docs/tasks/<slug>.md`) — the steps: the concrete, ordered work.
9
+
10
+ The filename slug matches the IP it belongs to.
11
+
12
+ ## Task shape
13
+
14
+ Each task is a checkbox with four fields so it can be picked up and verified independently:
15
+
16
+ ```markdown
17
+ - [ ] **Task 1.1**: Short title
18
+ - Description: what to implement
19
+ - Files: expected files to create or modify
20
+ - Depends on: none | other task IDs
21
+ - Acceptance: how to verify it is done
22
+ ```
23
+
24
+ Group tasks by phase (`### Phase 1: …`). Order them by dependency — models first, then
25
+ APIs, then UI. Blend-style runs may append a **Plan vs Actual** log to the same file after
26
+ each task.
27
+
28
+ ## What lives here vs elsewhere
29
+
30
+ | Concern | Home |
31
+ | ------- | ---- |
32
+ | Design, scope, acceptance criteria | the IP (`docs/implementationPlans/`) |
33
+ | Concrete task steps and their status | this directory |
34
+ | Public status and target | GitHub roadmap issue / Project (roadmap-enabled repos) |
35
+ | Sprint estimates and assignees | Linear |
36
+
37
+ Do not copy the full checklist into a GitHub issue or Linear. Create linked GitHub child
38
+ issues only for tasks that outside contributors should be able to claim independently; the
39
+ task file stays the source of truth for scope and acceptance.
40
+
41
+ The docs site excludes this directory, so link to task files with full GitHub URLs from
42
+ pages that render on the site.
@@ -14,25 +14,25 @@ See: [`docs/implementationPlans/agentic-sdlc-plugin.md`](../implementationPlans/
14
14
 
15
15
  ## Phase 1: Decide and sanitize
16
16
 
17
- - [ ] **Task 1.1**: Audit the plugin for repo- and org-specific content
17
+ - [x] **Task 1.1**: Audit the plugin for repo- and org-specific content
18
18
  - Description: Grep all five skills for Flourish-specific and monorepo-specific content: `rg -n -i "phi|hipaa|flourish|dcb3|example-frontend|admin-spa|bun run|docs/implementationPlans"` across `plugins/`. Produce a table: file, line, category (org-specific / repo-path / hardcoded value / tool assumption), and the proposed replacement. Include the `.cursor-plugin/*.json` files (owner email, marketplace description). Do not change anything yet.
19
19
  - Files: none (findings in the PR body)
20
20
  - Depends on: none
21
21
  - Acceptance: every hit is categorized with a proposed replacement; the table covers all five skills plus both JSON files.
22
22
 
23
- - [ ] **Task 1.2**: Generalize sensitive-data handling
23
+ - [x] **Task 1.2**: Generalize sensitive-data handling
24
24
  - Description: Per IP question AP2, replace PHI/HIPAA-specific language with generalized sensitive-data language across `terreno-1-blend`, `terreno-4-pour`, and `terreno-5-dialin`. The rule must survive the rewrite: PR text, review replies, and attached evidence media must not contain sensitive data (PHI, PII, credentials, customer data). Keep it concrete — a vague "be careful with data" is not a usable instruction for an agent.
25
25
  - Files: `plugins/terreno-planning/skills/terreno-1-blend/SKILL.md`, `terreno-4-pour/SKILL.md`, `terreno-5-dialin/SKILL.md`
26
26
  - Depends on: Task 1.1
27
27
  - Acceptance: `rg -n -i "phi|hipaa" plugins/` returns nothing; each rewritten rule names the specific artifacts it applies to (PR body, comments, screenshots, recordings) and the data categories.
28
28
 
29
- - [ ] **Task 1.3**: Fix the hardcoded branch suffix
29
+ - [x] **Task 1.3**: Fix the hardcoded branch suffix
30
30
  - Description: `terreno-4-pour` documents the branch convention as `cursor/<descriptive-name>-dcb3`. The suffix is per-agent-run, not a fixed literal, so this will produce wrong branch names. Replace it with a description of the convention (a `cursor/` prefix plus the run-specific suffix the agent was given) and instruct the agent to use the suffix from its own run instructions rather than any literal in the skill.
31
31
  - Files: `plugins/terreno-planning/skills/terreno-4-pour/SKILL.md`
32
32
  - Depends on: Task 1.1
33
33
  - Acceptance: no literal run suffix appears anywhere in `plugins/`; the convention is described such that an agent in any run produces a correctly-suffixed branch.
34
34
 
35
- - [ ] **Task 1.4**: Clean up plugin metadata
35
+ - [x] **Task 1.4**: Clean up plugin metadata
36
36
  - Description: Update `.cursor-plugin/marketplace.json` and `plugins/terreno-planning/.cursor-plugin/plugin.json`: adjust the marketplace description per the AP1 decision (it currently says "Team marketplace"), review whether a personal email is the right contact for a public plugin versus a role address, and add a field or README note declaring which Terreno versions the plugin targets (IP question AP7). Add `plugins/terreno-planning/LICENSE` matching the root license.
37
37
  - Files: `.cursor-plugin/marketplace.json`, `plugins/terreno-planning/.cursor-plugin/plugin.json`, `plugins/terreno-planning/LICENSE` (new)
38
38
  - Depends on: Task 1.1
@@ -99,7 +99,7 @@ See: [`docs/implementationPlans/agentic-sdlc-plugin.md`](../implementationPlans/
99
99
  - Acceptance: under 150 lines; every coffee name is glossed; the installation steps were performed from a fresh state; the quickstart matches a run you completed.
100
100
 
101
101
  - [ ] **Task 4.2**: Write `docs/explanation/agentic-sdlc.md`
102
- - Description: The conceptual case, no commands. Cover: the process layer versus the MCP tool layer, and why both are needed; why planning is a separate stage with a question-first gate (agents confidently plan the wrong thing); why review happens in a **fresh context** rather than by asking the implementing agent to check its own work; why verification is a separate stage from implementation; why the frontend gate demands evidence rather than a claim; and why flaky CI must be classified rather than guessed at. Then an honest limits section: what the pipeline does not do, where a human must decide, and the 15-minute review timeout. Reuse the mermaid diagram from the IP.
102
+ - Description: The conceptual case, no commands. Cover: the process layer versus the MCP tool layer, and why both are needed; why planning is a separate stage with a question-first gate (agents confidently plan the wrong thing); why review happens in a **fresh context** rather than by asking the implementing agent to check its own work; why verification is a separate stage from implementation; why the frontend gate demands evidence rather than a claim; and why flaky CI must be classified rather than guessed at. Then an honest limits section: what the pipeline does not do, where a human must decide, and why the review loop persists through slow CI but stops when no autonomous action can advance a terminal failure. Reuse the mermaid diagram from the IP.
103
103
  - Files: `docs/explanation/agentic-sdlc.md` (new), `docs/explanation/README.md`
104
104
  - Depends on: Task 4.1
105
105
  - Acceptance: no commands; all six design rationales explained; a limits section naming at least three things the pipeline will not do; linked from the explanation index.
@@ -0,0 +1,75 @@
1
+ # Tasks: Stripe billing and subscriptions
2
+
3
+ IP: [billing-stripe](../implementationPlans/billing-stripe.md)
4
+
5
+ ## Phase 1 — Package + models
6
+
7
+ - [ ] **Task 1.1**: Scaffold `@terreno/billing` package
8
+ - Description: workspace package mirroring `feature-flags/`; root scripts
9
+ - Files: `billing/package.json`, `billing/tsconfig.json`, root `package.json`
10
+ - Depends on: none
11
+ - Acceptance: compile + lint pass
12
+ - [ ] **Task 1.2**: Models (BillingCustomer, BillingSubscription, BillingEvent)
13
+ - Description: per IP with unique indexes and descriptions
14
+ - Files: `billing/src/models/*`
15
+ - Depends on: 1.1
16
+ - Acceptance: unit tests incl. unique-index violations
17
+ - [ ] **Task 1.3**: Plan config validation
18
+ - Description: `plans` option schema (Zod), duplicate/missing price detection at startup
19
+ - Files: `billing/src/billingApp.ts`
20
+ - Depends on: 1.1
21
+ - Acceptance: bad config fails fast with clear error
22
+
23
+ ## Phase 2 — Checkout + portal + entitlements
24
+
25
+ - [ ] **Task 2.1**: Customer creation + checkout/portal session routes
26
+ - Description: `POST /billing/checkoutSession` (IsOrgAdmin), `POST /billing/portalSession`, `GET /billing/plans`
27
+ - Files: `billing/src/billingApp.ts`
28
+ - Depends on: 1.2, orgs-and-teams Phase 3
29
+ - Acceptance: mocked-Stripe supertest incl. permission denials
30
+ - [ ] **Task 2.2**: `getEntitlements` + `planSegment` + `RequiresPlan`
31
+ - Description: cache-backed entitlement service; feature-flag segment factory; permission
32
+ - Files: `billing/src/billingService.ts`
33
+ - Depends on: 1.2
34
+ - Acceptance: zero inline Stripe calls asserted; flag targeting test with FeatureFlagsApp
35
+ - [ ] **Task 2.3**: `GET /billing/subscription`
36
+ - Description: org subscription + entitlements for members
37
+ - Files: `billing/src/billingApp.ts`
38
+ - Depends on: 2.2
39
+ - Acceptance: supertest member/non-member
40
+
41
+ ## Phase 3 — Webhook sync (gated on inbound-webhooks)
42
+
43
+ - [ ] **Task 3.1**: Stripe webhook route with signature verification
44
+ - Description: raw-body route via inbound-webhooks; reject unsigned
45
+ - Files: `billing/src/stripeSync.ts`
46
+ - Depends on: inbound-webhooks IP
47
+ - Acceptance: signed/unsigned fixture tests
48
+ - [ ] **Task 3.2**: Idempotent event handlers
49
+ - Description: checkout.session.completed, subscription created/updated/deleted, invoice paid/payment_failed → model sync via `BillingEvent`
50
+ - Files: `billing/src/stripeSync.ts`
51
+ - Depends on: 3.1
52
+ - Acceptance: replay of same event id is a no-op; cancellation downgrades after webhook
53
+ - [ ] **Task 3.3**: Dunning email
54
+ - Description: `paymentFailed` template through comms when configured
55
+ - Files: `billing/src/stripeSync.ts`, `comms/src/templates.ts`
56
+ - Depends on: 3.2, comms-abstraction
57
+ - Acceptance: template send asserted on payment_failed fixture
58
+
59
+ ## Phase 4 — UI + example + docs
60
+
61
+ - [ ] **Task 4.1**: Plan picker + billing settings screens
62
+ - Description: example-frontend screens per IP; SDK regen
63
+ - Files: `example-frontend/app/**`, `store/openApiSdk.ts`
64
+ - Depends on: Phase 2
65
+ - Acceptance: UI verification evidence per verify-ui-changes (Stripe test mode)
66
+ - [ ] **Task 4.2**: example-backend registration + seeds + docs
67
+ - Description: env-gated BillingApp; test-mode setup guide; how-to + reference docs
68
+ - Files: `example-backend/src/server.ts`, `docs/how-to/add-billing.md`, `docs/reference/billing.md`
69
+ - Depends on: Phase 2
70
+ - Acceptance: docs build + `bun run rules:check` pass
71
+ - [ ] **Task 4.3**: CI + publish wiring
72
+ - Description: billing-ci workflow; publish-on-tag entry
73
+ - Files: `.github/workflows/*`
74
+ - Depends on: 1.1
75
+ - Acceptance: CI green
@@ -0,0 +1,90 @@
1
+ # Tasks: Pluggable communications layer (@terreno/comms)
2
+
3
+ IP: [comms-abstraction](../implementationPlans/comms-abstraction.md)
4
+
5
+ ## Phase 1 — Package + contracts
6
+
7
+ - [x] **Task 1.1**: Scaffold `@terreno/comms` workspace package
8
+ - Description: `comms/` package with tsconfig/biome/bun test setup mirroring `feature-flags/`; root workspace entry + `comms:*` scripts
9
+ - Files: `comms/package.json`, `comms/tsconfig.json`, `comms/biome.jsonc`, root `package.json`
10
+ - Depends on: none
11
+ - Acceptance: `bun run comms:compile` and `bun run comms:lint` pass
12
+ - [ ] **Task 1.2**: Provider interfaces and message types
13
+ - Description: `MailProvider`, `SmsProvider`, `PushProvider`, `VerificationProvider`, `SendResult` (incl. `errorCode`/`errorClass`), `DeliveryEvent`, `CommsHookContext`, `OptOutEvent` per IP
14
+ - Status: base provider/message contracts shipped; `errorCode`/`errorClass`, `CommsHookContext`, and `OptOutEvent` remain
15
+ - Files: `comms/src/types.ts`
16
+ - Depends on: 1.1
17
+ - Acceptance: types compile and are exported
18
+ - [x] **Task 1.3**: Console adapters
19
+ - Description: dev adapters for all four channels logging via `logger.info`
20
+ - Files: `comms/src/adapters/console.ts` + tests
21
+ - Depends on: 1.2
22
+ - Acceptance: each adapter returns `accepted: true` and logs
23
+ - [ ] **Task 1.4**: `CommsMessage` model + `logSend`
24
+ - Description: delivery log model with five-type pattern, `description` on every field, plugins, static `logSend` that never throws; dashboard-ready fields (`errorCode`, `errorClass`, `attempts[]`, `attemptCount`, `lastAttemptAt`, `retriedFromId`/`retriedById`, `templateId`, retained `payload`)
25
+ - Files: `comms/src/models/commsMessage.ts` + tests
26
+ - Depends on: 1.1
27
+ - Acceptance: send logging survives a forced model error (logged, not thrown); attempts append per attempt
28
+ - Status: model and non-throwing `logSend` shipped; dashboard-ready fields remain
29
+ - [ ] **Task 1.5**: `commsService` send facade
30
+ - Description: `sendMail`/`sendSms`/`sendPushToUser`/`startVerification`/`checkVerification`; template render helper; unconfigured-channel behavior (501 in prod, console fallback in dev); inline retry on `errorClass: "transient"` only
31
+ - Status: send facade, templates, and unconfigured-channel behavior shipped; inline transient retry remains
32
+ - Files: `comms/src/commsService.ts`, `comms/src/templates.ts` + tests
33
+ - Depends on: 1.2, 1.3, 1.4
34
+ - Acceptance: unit tests cover happy path + unconfigured channel in both env modes; permanent failures do not retry
35
+ - [ ] **Task 1.6**: Lifecycle hooks
36
+ - Description: `beforeSend` (mutate/cancel), `onSend`, `onError`, `onRetry`, `onOptOut`, `onDeliveryEvent` wiring in the facade; every hook wrapped so a throw is logged and never changes the send outcome
37
+ - Files: `comms/src/commsService.ts` + tests
38
+ - Depends on: 1.5
39
+ - Acceptance: one test per hook (fires with correct context) plus one throwing-hook test per hook
40
+ - [ ] **Task 1.7**: Payload retention + redaction
41
+ - Description: `retainPayloadDays` (default 30) storage of rendered payload post-`redactPayload`; expiry cleanup clears `payload` without touching the log row
42
+ - Files: `comms/src/commsService.ts`, `comms/src/models/commsMessage.ts` + tests
43
+ - Depends on: 1.4, 1.5
44
+ - Acceptance: payload stored redacted; expired payload cleared; `retainPayloadDays: 0` stores nothing
45
+
46
+ ## Phase 2 — CommsApp + routes
47
+
48
+ - [x] **Task 2.1**: `PushToken` model
49
+ - Description: model per IP with unique token upsert semantics
50
+ - Files: `comms/src/models/pushToken.ts` + tests
51
+ - Depends on: 1.1
52
+ - Acceptance: duplicate token registration updates the existing row
53
+ - [x] **Task 2.2**: `CommsApp` TerrenoPlugin
54
+ - Description: options wiring, `getCommsService()` accessor, route mounting on `register()`
55
+ - Files: `comms/src/commsApp.ts` + tests
56
+ - Depends on: 1.5, 2.1
57
+ - Acceptance: plugin registers on `TerrenoApp` and service accessor returns configured providers
58
+ - [x] **Task 2.3**: Push token routes
59
+ - Description: custom idempotent registration/list/deactivation endpoints plus modelRouter owner read; persisted `userId` scoping
60
+ - Files: `comms/src/routes/pushTokens.ts` + supertest
61
+ - Depends on: 2.2
62
+ - Acceptance: acceptance criteria bullets 2 pass under supertest
63
+ - [x] **Task 2.4**: Admin delivery explorer
64
+ - Description: `GET /comms/messages` admin-only, paginated, filtered; OpenAPI builder
65
+ - Files: `comms/src/routes/commsExplorer.ts` + supertest
66
+ - Depends on: 2.2
67
+ - Acceptance: non-admin gets 403; filters work
68
+ - [x] **Task 2.5**: `sendPushToUser` token resolution + pruning
69
+ - Description: resolve active tokens per user; deactivate tokens whose `SendResult` reports permanent failure
70
+ - Files: `comms/src/commsService.ts` + tests
71
+ - Depends on: 2.1, 1.5
72
+ - Acceptance: dead token is `active: false` after a failed send
73
+
74
+ ## Phase 3 — Integration + docs
75
+
76
+ - [x] **Task 3.1**: example-backend registration
77
+ - Description: register `CommsApp` with console adapters; env-gated
78
+ - Files: `example-backend/src/server.ts`
79
+ - Depends on: 2.2
80
+ - Acceptance: backend boots; `/comms/pushTokens` in `/openapi.json`
81
+ - [x] **Task 3.2**: Reference docs + rules
82
+ - Description: `docs/reference/comms.md`, rulesync source rule, `bun run rules`
83
+ - Files: `docs/reference/comms.md`, `.rulesync/**`
84
+ - Depends on: 2.x
85
+ - Acceptance: `bun run rules:check` passes
86
+ - [x] **Task 3.3**: CI + publish wiring
87
+ - Description: `comms-ci` workflow; add `@terreno/comms` to `publish-on-tag.yml`
88
+ - Files: `.github/workflows/comms-ci.yml`, `.github/workflows/publish-on-tag.yml`
89
+ - Depends on: 1.x
90
+ - Acceptance: CI green on the PR
@@ -0,0 +1,29 @@
1
+ # Tasks: Comms adapter — Expo push notifications
2
+
3
+ IP: [comms-adapter-expo-push](../implementationPlans/comms-adapter-expo-push.md)
4
+
5
+ - [ ] **Task 1**: `ExpoPushProvider` implementation
6
+ - Description: token validation, chunked send, ticket collection per IP
7
+ - Files: `comms/src/adapters/expoPush.ts`
8
+ - Depends on: comms-abstraction Phase 1
9
+ - Acceptance: mocked-client tests pass, one `SendResult` per token
10
+ - [ ] **Task 2**: Receipt polling → `DeliveryEvent` + dead-token marking
11
+ - Description: poll receipts after configurable delay; map `DeviceNotRegistered` to permanent failure
12
+ - Files: `comms/src/adapters/expoPush.ts`
13
+ - Depends on: Task 1
14
+ - Acceptance: dead token deactivated in test
15
+ - [ ] **Task 3**: Dependency moves
16
+ - Description: optional peer `expo-server-sdk` on comms; remove from `@terreno/api`
17
+ - Files: `comms/package.json`, `api/package.json`, root catalog if needed
18
+ - Depends on: Task 1
19
+ - Acceptance: `bun install` + full compile pass; api tests unaffected
20
+ - [ ] **Task 4**: example-frontend token registration + dev test-send
21
+ - Description: register token on login via `POST /comms/pushTokens`; profile dev row triggers `sendPushToUser`
22
+ - Files: `example-frontend/app/_layout.tsx` or profile screen, `example-backend` dev route
23
+ - Depends on: Task 1, comms-abstraction Phase 2
24
+ - Acceptance: UI verification per verify-ui-changes with screenshots
25
+ - [ ] **Task 5**: Docs
26
+ - Description: adapter section in `docs/reference/comms.md` with env/config table
27
+ - Files: `docs/reference/comms.md`
28
+ - Depends on: Task 1
29
+ - Acceptance: docs build passes
@@ -0,0 +1,39 @@
1
+ # Tasks: Comms adapter — transactional email (SendGrid)
2
+
3
+ IP: [comms-adapter-sendgrid](../implementationPlans/comms-adapter-sendgrid.md)
4
+
5
+ ## Phase 1 — Send path
6
+
7
+ - [ ] **Task 1.1**: `SendGridMailProvider` with config + sandbox mode
8
+ - Description: constructor/env config, from-address fallback chain, sandbox default under test
9
+ - Files: `comms/src/adapters/sendgrid.ts`
10
+ - Depends on: comms-abstraction Phase 1
11
+ - Acceptance: mocked-client tests for text/html/template sends
12
+ - [ ] **Task 1.2**: Error classification
13
+ - Description: HTTP status → `errorCode`/`errorClass` per the IP table (400 permanent, 401/403 config, 429/5xx transient); full response body into `CommsMessage.metadata`; never throws
14
+ - Files: `comms/src/adapters/sendgrid.ts`
15
+ - Depends on: 1.1
16
+ - Acceptance: unverified-sender (config), bad-address (permanent), and 429 (transient) fixtures assert `errorClass`; permanent skips the inline retry
17
+ - [ ] **Task 1.3**: Dashboard metadata + hooks coverage
18
+ - Description: capture `x-message-id`; `metadata.consoleUrl` Email Activity deep link; `onError` fires with the classified `SendResult`
19
+ - Files: `comms/src/adapters/sendgrid.ts` + tests
20
+ - Depends on: 1.2
21
+ - Acceptance: accepted-send test asserts message id + consoleUrl; failed-send test asserts onError invocation
22
+ - [ ] **Task 1.4**: Peer dep + registration + docs
23
+ - Description: optional peer `@sendgrid/mail`; env-gated example-backend registration with fail-fast; reference + env docs incl. sender-verification checklist
24
+ - Files: `comms/package.json`, `example-backend/src/server.ts`, `docs/reference/comms.md`, `docs/reference/environment-variables.md`
25
+ - Depends on: 1.1
26
+ - Acceptance: boot without key skips registration; compile passes without the SDK installed
27
+
28
+ ## Phase 2 — Delivery events + opt-outs (gated on inbound-webhooks)
29
+
30
+ - [ ] **Task 2.1**: Event Webhook route
31
+ - Description: ECDSA signature verification via inbound-webhooks; event mapping per the IP table → `DeliveryEvent`; `x-message-id` prefix correlation
32
+ - Files: `comms/src/adapters/sendgrid.ts`, webhook registration
33
+ - Depends on: inbound-webhooks IP
34
+ - Acceptance: signed fixtures per event type update `CommsMessage.status` (+ `errorCode` for bounce/dropped); unsigned rejected 401
35
+ - [ ] **Task 2.2**: Opt-out events
36
+ - Description: `spamreport`/`unsubscribe`/`group_unsubscribe` → `OptOutEvent` → consumer `onOptOut`
37
+ - Files: `comms/src/adapters/sendgrid.ts` + tests
38
+ - Depends on: 2.1
39
+ - Acceptance: spamreport fixture fires `onOptOut`; subsequent `dropped` classified `permanent`
@@ -0,0 +1,39 @@
1
+ # Tasks: Comms adapter — Twilio SMS
2
+
3
+ IP: [comms-adapter-twilio-sms](../implementationPlans/comms-adapter-twilio-sms.md)
4
+
5
+ ## Phase 1 — Send path
6
+
7
+ - [ ] **Task 1.1**: `TwilioSmsProvider` with config resolution
8
+ - Description: constructor/env config, messaging-service-first sender selection
9
+ - Files: `comms/src/adapters/twilioSms.ts`
10
+ - Depends on: comms-abstraction Phase 1
11
+ - Acceptance: mocked-client tests cover both sender configs
12
+ - [ ] **Task 1.2**: E.164 validation + error classification
13
+ - Description: `libphonenumber-js` normalization; Twilio error-code → `errorCode`/`errorClass` map per the IP table (unknown codes → `transient`); full error payload into `CommsMessage.metadata`; Twilio SDK calls wrapped with `withApiErrorHandling`
14
+ - Files: `comms/src/adapters/twilioSms.ts`
15
+ - Depends on: 1.1
16
+ - Acceptance: invalid number → 400 before API call; fixtures for at least one code per class (e.g. 21610 permanent, 20429 transient, 20003 config) assert `errorClass`; permanent failures skip the inline retry
17
+ - [ ] **Task 1.3**: Dashboard metadata + hooks coverage
18
+ - Description: `metadata.consoleUrl` deep link per message SID; `onError` fires with the classified `SendResult`
19
+ - Files: `comms/src/adapters/twilioSms.ts` + tests
20
+ - Depends on: 1.2
21
+ - Acceptance: failed-send test asserts consoleUrl and onError invocation
22
+ - [ ] **Task 1.4**: Peer dep + example-backend registration + docs
23
+ - Description: optional peer `twilio`; env-gated registration; reference + env-var docs
24
+ - Files: `comms/package.json`, `example-backend/src/server.ts`, `docs/reference/comms.md`, `docs/reference/environment-variables.md`
25
+ - Depends on: 1.1
26
+ - Acceptance: compile + boot without twilio installed when unconfigured
27
+
28
+ ## Phase 2 — Delivery callbacks + opt-outs (gated on inbound-webhooks)
29
+
30
+ - [ ] **Task 2.1**: Status callback route
31
+ - Description: webhook endpoint with Twilio signature verification via inbound-webhooks framework; status mapping per IP table incl. `ErrorCode` propagation
32
+ - Files: `comms/src/adapters/twilioSms.ts`, webhook registration
33
+ - Depends on: inbound-webhooks IP
34
+ - Acceptance: signed payload updates `CommsMessage.status` (+ `errorCode` on failure); unsigned rejected 401
35
+ - [ ] **Task 2.2**: STOP/START opt-out handling
36
+ - Description: inbound keyword webhook → `OptOutEvent` → consumer `onOptOut`; opt-in (START) emitted symmetrically
37
+ - Files: `comms/src/adapters/twilioSms.ts`, webhook registration + tests
38
+ - Depends on: 2.1
39
+ - Acceptance: STOP fixture fires `onOptOut` with `reason: "sms-stop"`; 21610 on later sends classified `permanent`
@@ -0,0 +1,19 @@
1
+ # Tasks: Comms adapter — Twilio Verify (OTP)
2
+
3
+ IP: [comms-adapter-twilio-verify](../implementationPlans/comms-adapter-twilio-verify.md)
4
+
5
+ - [ ] **Task 1**: `TwilioVerifyProvider` start/check
6
+ - Description: provider per IP with config resolution and status mapping
7
+ - Files: `comms/src/adapters/twilioVerify.ts`
8
+ - Depends on: comms-abstraction Phase 1
9
+ - Acceptance: mocked-client tests for approved/pending/expired/max-attempts
10
+ - [ ] **Task 2**: Redacted logging + error classification
11
+ - Description: `CommsMessage` rows with channel `verification`, fully redacted destination, no codes, and verification channel metadata on start; `errorCode`/`errorClass` mapping (rate-limit transient, expired/max-attempts permanent, bad SID config); rows flagged non-retryable; `onError` fires on failures
12
+ - Files: `comms/src/adapters/twilioVerify.ts`
13
+ - Depends on: Task 1
14
+ - Acceptance: log assertion tests prove no code/full destination in any row; failure fixtures assert class + onError
15
+ - [ ] **Task 3**: Registration + docs
16
+ - Description: env-gated example-backend registration; fail-fast on missing service SID; reference + env docs
17
+ - Files: `example-backend/src/server.ts`, `docs/reference/comms.md`, `docs/reference/environment-variables.md`
18
+ - Depends on: Task 1
19
+ - Acceptance: boot without config skips registration; with partial config throws at startup
@@ -0,0 +1,52 @@
1
+ # Tasks: Comms admin dashboard (errors, retries, log digging)
2
+
3
+ IP: [comms-admin-dashboard](../implementationPlans/comms-admin-dashboard.md)
4
+
5
+ ## Phase 1 — Backend routes
6
+
7
+ - [ ] **Task 1.1**: Upgrade explorer to `commsDashboard.ts` list + detail
8
+ - Description: rich filters (channel/provider/status/errorClass/errorCode/userId/to/templateId/dates/`q`), pagination, `GET /comms/messages/:id` with attempts + metadata + retained payload
9
+ - Files: `comms/src/routes/commsDashboard.ts` + supertest
10
+ - Depends on: comms-abstraction Phase 2 (incl. hooks/error-taxonomy additions)
11
+ - Acceptance: every filter covered by a supertest case; non-admin 403
12
+ - [ ] **Task 1.2**: `retryMessage` facade + retry route
13
+ - Description: retryability validation (status, errorClass, payload retention, channel configured, not verification), linked rows via `retriedFromId`/`retriedById`, hooks fire with `isRetry: true`, acting admin recorded
14
+ - Files: `comms/src/commsService.ts`, `comms/src/routes/commsDashboard.ts` + tests
15
+ - Depends on: 1.1
16
+ - Acceptance: each non-retryable reason returns 400 with its stable `code`; successful retry creates a linked row
17
+ - [ ] **Task 1.3**: `retryMany` + `/comms/stats`
18
+ - Description: bulk retry with cap + skipped reasons; aggregation by channel × provider × status with day buckets and failure rate
19
+ - Files: `comms/src/routes/commsDashboard.ts` + tests
20
+ - Depends on: 1.2
21
+ - Acceptance: stats counts match list totals for the same filter/range; cap enforced
22
+
23
+ ## Phase 2 — Admin screens
24
+
25
+ - [ ] **Task 2.1**: `CommsDashboardScreen`
26
+ - Description: stats cards, filter bar (URL-persisted), DataTable with status badges + inline retry
27
+ - Files: `admin-frontend/src/comms/CommsDashboardScreen.tsx`, `CommsStatusBadge.tsx`, `useCommsDashboardApi.tsx` + tests
28
+ - Depends on: 1.1, 1.3
29
+ - Acceptance: loading/error/empty states; filters round-trip through the URL
30
+ - [ ] **Task 2.2**: `CommsMessageDetail`
31
+ - Description: attempt timeline, provider console links, JSON viewer for payload/metadata, confirmed retry button with disabled-reason tooltips
32
+ - Files: `admin-frontend/src/comms/CommsMessageDetail.tsx` + tests
33
+ - Depends on: 1.2, 2.1
34
+ - Acceptance: non-retryable rows show the specific reason; retry navigates to the new row
35
+ - [ ] **Task 2.3**: Example app + admin-spa wiring
36
+ - Description: expo-router screens under `app/admin/comms/`, admin-spa nav entry, `bun run sdk`
37
+ - Files: `example-frontend/app/admin/comms/*`, `example-frontend/store/openApiSdk.ts`, admin-spa nav
38
+ - Depends on: 2.1, 2.2
39
+ - Acceptance: frontend verification in the running example app with screenshots on the PR
40
+
41
+ ## Phase 3 — Bulk retry UI + docs
42
+
43
+ - [ ] **Task 3.1**: "Retry all failed" flow
44
+ - Description: filtered bulk retry with count confirmation modal; skipped-reason summary toast
45
+ - Files: `admin-frontend/src/comms/CommsDashboardScreen.tsx` + tests
46
+ - Depends on: 1.3, 2.1
47
+ - Acceptance: confirmation shows the exact count; result summarizes retried/skipped
48
+ - [ ] **Task 3.2**: Docs + rules
49
+ - Description: dashboard section in comms reference, admin reference update, rulesync
50
+ - Files: `docs/reference/comms.md`, `docs/reference/admin.md`, `.rulesync/**`
51
+ - Depends on: 2.x
52
+ - Acceptance: `bun run rules:check` passes
@@ -14,31 +14,31 @@ See: [`docs/implementationPlans/deploy-to-gcp.md`](../implementationPlans/deploy
14
14
 
15
15
  ## Phase 1: Generalize the how-to guides
16
16
 
17
- - [ ] **Task 1.1**: Write `docs/how-to/deploy-backend-to-cloud-run.md`
17
+ - [x] **Task 1.1**: Write `docs/how-to/deploy-backend-to-cloud-run.md`
18
18
  - Description: New guide covering: prerequisites (gcloud installed and authenticated, billing enabled, required APIs — `run`, `artifactregistry`, `secretmanager`, `compute`); creating an Artifact Registry repo; building and pushing the backend image; creating Secret Manager secrets for `MONGO_URI`, `TOKEN_SECRET`, `TOKEN_ISSUER`, `REFRESH_TOKEN_SECRET`, `SESSION_SECRET`, and `BETTER_AUTH_SECRET`; creating the runtime service account with least-privilege roles; the `gcloud run deploy` invocation with `--session-affinity`, `--timeout`, `--min-instances`, `--set-secrets`, and `--set-env-vars`; and verification via `curl $SERVICE_URL/health`. Use placeholder variables throughout. Read `example-backend/src/server.ts` and `docs/reference/environment-variables.md` to get the env var list right — do not copy it from this task description without checking.
19
19
  - Files: `docs/how-to/deploy-backend-to-cloud-run.md` (new)
20
20
  - Depends on: none
21
21
  - Acceptance: `rg -i flourish docs/how-to/deploy-backend-to-cloud-run.md` returns nothing; every env var named exists in `docs/reference/environment-variables.md` or the backend source; every `gcloud` flag used appears in `gcloud run deploy --help`.
22
22
 
23
- - [ ] **Task 1.2**: Add the production constraints section
23
+ - [x] **Task 1.2**: Add the production constraints section
24
24
  - Description: Add a "Production constraints" section to the backend guide as a symptom → cause → fix table covering at minimum: (a) websockets disconnect every few requests → no session affinity → add `--session-affinity`; (b) long-lived socket connections drop at 5 minutes → default request timeout → raise `--timeout`; (c) realtime and live feature flags stop working → MongoDB is not a replica set → use Atlas or a replica set, because change streams require one; (d) first request after idle is slow and sockets churn → scaled to zero → `--min-instances=1`; (e) browser requests fail CORS → `corsOrigin` in `setupServer` and Better Auth `trustedOrigins` do not include the web origin. Verify claim (c) against `feature-flags` live-update code before writing it.
25
25
  - Files: `docs/how-to/deploy-backend-to-cloud-run.md`
26
26
  - Depends on: Task 1.1
27
27
  - Acceptance: all five rows present with a concrete symptom; the change-streams claim is verified against the source and the source path is cited in the guide.
28
28
 
29
- - [ ] **Task 1.3**: Write `docs/how-to/deploy-web-to-gcs-cdn.md`
29
+ - [x] **Task 1.3**: Write `docs/how-to/deploy-web-to-gcs-cdn.md`
30
30
  - Description: New guide covering: building the web bundle (`bunx expo export -p web` — confirm the exact command against `example-frontend/package.json` scripts), the requirement to set `EXPO_PUBLIC_API_URL` at build time because it is inlined into the bundle, creating and configuring the GCS bucket with public read and `notFoundPage=index.html` for client-side routing, the five CDN resources (backend bucket, URL map, static IP, HTTP(S) proxy, forwarding rule), pointing DNS at the IP, and cache invalidation after each deploy. Include a note that this is a static-only path and link [`web-ssr-and-admin-spa`](../implementationPlans/web-ssr-and-admin-spa.md) for the SSR future.
31
31
  - Files: `docs/how-to/deploy-web-to-gcs-cdn.md` (new)
32
32
  - Depends on: none
33
33
  - Acceptance: no Flourish strings; the export command matches an actual script in `example-frontend/package.json`; the guide explains why `EXPO_PUBLIC_API_URL` must be set before building, not after.
34
34
 
35
- - [ ] **Task 1.4**: Write the architecture explainer
35
+ - [x] **Task 1.4**: Write the architecture explainer
36
36
  - Description: Create `docs/explanation/deployment-architecture-gcp.md` explaining the reference topology (reuse the mermaid diagram from the IP), what each component is responsible for, why Cloud Run rather than App Engine or GKE, why Atlas rather than self-hosted Mongo, and the tradeoffs of static web hosting versus a server-rendered deployment. Keep it conceptual — no commands.
37
37
  - Files: `docs/explanation/deployment-architecture-gcp.md` (new)
38
38
  - Depends on: Task 1.1, Task 1.3
39
39
  - Acceptance: contains the topology diagram; contains no shell commands; explains at least three explicit tradeoffs.
40
40
 
41
- - [ ] **Task 1.5**: Rewire the existing GCP how-to and index
41
+ - [x] **Task 1.5**: Rewire the existing GCP how-to and index
42
42
  - Description: Replace `docs/how-to/deploy-to-gcp.md` with a short index page linking the two new guides and the explainer, preserving the old anchor names where practical so existing links do not break. Update `docs/how-to/README.md` to list the new guides. Check `website/` for any hardcoded reference to the old page path and update it.
43
43
  - Files: `docs/how-to/deploy-to-gcp.md`, `docs/how-to/README.md`, `website/` (as needed)
44
44
  - Depends on: Task 1.1, Task 1.3, Task 1.4
@@ -58,27 +58,27 @@ See: [`docs/implementationPlans/deploy-to-gcp.md`](../implementationPlans/deploy
58
58
  - Depends on: Task 2.1
59
59
  - Acceptance: `rg -n "terraform/" --glob '!infra/**' --glob '!terraform/**'` shows no stale paths pointing at moved files; the `cd.yml` workflow references the new location; `bun run rules:check` exits 0 after regenerating rules.
60
60
 
61
- - [ ] **Task 2.3**: Parameterize the GCS hosting script
62
- - Description: Rewrite `scripts/setup-gcs-hosting.sh` to require `--project`, `--site-name`, and `--bucket` arguments (or positional equivalents) with a usage message and a check that all are present. Remove every hardcoded Flourish project, bucket, and service-account value. Keep the resource-creation logic intact. Add a `--dry-run` flag that prints commands without executing them.
61
+ - [x] **Task 2.3**: Parameterize the GCS hosting script
62
+ - Description: Rewrite `scripts/setup-gcs-hosting.sh` to require `--project`, `--site-name`, `--bucket`, and `--domain` arguments (or positional equivalents) with a usage message and a check that all are present. Remove every hardcoded Flourish project, bucket, and service-account value. Keep the resource-creation logic intact, with HTTPS as the only public serving path. Add a `--dry-run` flag that prints commands without executing them.
63
63
  - Files: `scripts/setup-gcs-hosting.sh`
64
64
  - Depends on: Task 1.3
65
- - Acceptance: running with no arguments prints usage and exits non-zero; `--dry-run` produces commands containing the supplied values and no Flourish strings; `rg -i flourish scripts/setup-gcs-hosting.sh` returns nothing.
65
+ - Acceptance: running with no arguments prints usage and exits non-zero; `--dry-run` produces HTTPS commands containing the supplied values, no port 80 forwarding rule, and no Flourish strings; `rg -i flourish scripts/setup-gcs-hosting.sh` returns nothing.
66
66
 
67
67
  ## Phase 3: The `deploy-gcp` skill
68
68
 
69
- - [ ] **Task 3.1**: Author the skill
69
+ - [x] **Task 3.1**: Author the skill
70
70
  - Description: Create `.rulesync/skills/deploy-gcp/SKILL.md` with frontmatter (`name: deploy-gcp`, a `description` that names the trigger phrases "deploy to GCP", "deploy to Cloud Run", "ship the backend", and `targets: ['*']`). Body sections in this order: When to use / When not to use; Preflight checks (project layout detection, `gcloud config get-value project`, required APIs, replica-set verification of `MONGO_URI`); **Plan and confirm** — print target project, region, service name, and every resource to be created or updated, then stop and require explicit user confirmation before any mutating command; Backend deploy steps; Frontend deploy steps; Verification (`curl $SERVICE_URL/health` expecting `"healthy":true`, fetch web root); Troubleshooting (link the reference file). Include an explicit prohibition: never deploy to a project the user did not name in the request, and never create or modify secrets without echoing which secret names will change.
71
71
  - Files: `.rulesync/skills/deploy-gcp/SKILL.md` (new)
72
72
  - Depends on: Task 1.1, Task 1.3
73
73
  - Acceptance: frontmatter has `name`, `description`, and `targets`; the confirmation gate appears before the first mutating command; every command in the skill also appears in the how-to guides (no skill-only knowledge).
74
74
 
75
- - [ ] **Task 3.2**: Add the troubleshooting reference
75
+ - [x] **Task 3.2**: Add the troubleshooting reference
76
76
  - Description: Create `.rulesync/skills/deploy-gcp/references/troubleshooting.md` containing the symptom → cause → fix table from Task 1.2 plus deploy-time failures: image push permission denied, secret access denied at cold start, Cloud Run revision failing health checks because `PORT` is not read from the environment, and CDN serving a stale bundle after deploy. For each, give the exact log line or error message the user will see.
77
77
  - Files: `.rulesync/skills/deploy-gcp/references/troubleshooting.md` (new)
78
78
  - Depends on: Task 3.1
79
79
  - Acceptance: at least nine rows; each row quotes an actual error string rather than paraphrasing.
80
80
 
81
- - [ ] **Task 3.3**: Generate skill mirrors
81
+ - [x] **Task 3.3**: Generate skill mirrors
82
82
  - Description: Run `bun run rules` and commit every generated file under `.cursor/skills/`, `.claude/skills/`, `.devin/skills/`, `.github/skills/`, and `.agents/skills/`. Do not hand-edit generated files.
83
83
  - Files: generated skill mirrors
84
84
  - Depends on: Task 3.1, Task 3.2