@terreno/mcp 57.0.0 → 57.1.0

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 (220) hide show
  1. package/dist/bootstrap.d.ts +1 -1
  2. package/dist/bootstrap.d.ts.map +1 -1
  3. package/dist/bootstrap.js +381 -191
  4. package/dist/bootstrap.js.map +1 -1
  5. package/dist/docs/guidelines/api/skills/mongoose-schema-safety/SKILL.md +8 -0
  6. package/dist/docs/resources/overview.md +6 -1
  7. package/dist/docs/resources/rtk.md +3 -1
  8. package/dist/docs/resources/syncdb.md +43 -0
  9. package/dist/docs/upgrades/56.0.0-beta.2.md +34 -0
  10. package/dist/docs/upgrades/57.1.0.md +126 -0
  11. package/dist/docs/versioned/next/README.md +15 -3
  12. package/dist/docs/versioned/next/explanation/README.md +3 -0
  13. package/dist/docs/versioned/next/explanation/admin-consent-migration.md +15 -0
  14. package/dist/docs/versioned/next/explanation/admin-plugin-frontend.md +12 -0
  15. package/dist/docs/versioned/next/explanation/announcements/rtk-deprecation.md +29 -0
  16. package/dist/docs/versioned/next/explanation/authentication.md +51 -58
  17. package/dist/docs/versioned/next/explanation/local-first-data.md +52 -0
  18. package/dist/docs/versioned/next/explanation/loop-engineering.md +117 -0
  19. package/dist/docs/versioned/next/explanation/repository-settings.md +8 -0
  20. package/dist/docs/versioned/next/explanation/roadmap-process.md +22 -9
  21. package/dist/docs/versioned/next/explanation/roadmap-seed-issues.md +39 -0
  22. package/dist/docs/versioned/next/how-to/README.md +3 -0
  23. package/dist/docs/versioned/next/how-to/admin-add-model.md +41 -0
  24. package/dist/docs/versioned/next/how-to/admin-custom-home.md +31 -0
  25. package/dist/docs/versioned/next/how-to/admin-custom-widget.md +42 -0
  26. package/dist/docs/versioned/next/how-to/admin-import-prebuilt.md +25 -0
  27. package/dist/docs/versioned/next/how-to/circleci.md +173 -0
  28. package/dist/docs/versioned/next/how-to/configure-better-auth.md +13 -10
  29. package/dist/docs/versioned/next/how-to/expose-mcp-tools.md +194 -0
  30. package/dist/docs/versioned/next/how-to/install-agent-skills.md +46 -0
  31. package/dist/docs/versioned/next/how-to/migrate-rtk-to-syncdb.md +26 -1
  32. package/dist/docs/versioned/next/how-to/websocket-integration.md +2 -1
  33. package/dist/docs/versioned/next/implementationPlans/ModularAPI.md +1 -0
  34. package/dist/docs/versioned/next/implementationPlans/README.md +31 -17
  35. package/dist/docs/versioned/next/implementationPlans/admin-improvements-research.md +136 -0
  36. package/dist/docs/versioned/next/implementationPlans/admin-improvements.md +157 -527
  37. package/dist/docs/versioned/next/implementationPlans/admin-only-research.md +4 -0
  38. package/dist/docs/versioned/next/implementationPlans/admin-only.md +3 -1
  39. package/dist/docs/versioned/next/implementationPlans/admin-script-runner.md +1 -0
  40. package/dist/docs/versioned/next/implementationPlans/admin-ui-v2-django-parity.md +1 -0
  41. package/dist/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +160 -130
  42. package/dist/docs/versioned/next/implementationPlans/apierror-standard-error-redesign.md +1 -0
  43. package/dist/docs/versioned/next/implementationPlans/b2b-platform-program.md +5 -4
  44. package/dist/docs/versioned/next/implementationPlans/comms-abstraction-research.md +48 -0
  45. package/dist/docs/versioned/next/implementationPlans/comms-abstraction.md +152 -62
  46. package/dist/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +9 -9
  47. package/dist/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +1 -1
  48. package/dist/docs/versioned/next/implementationPlans/consent-forms.md +4 -0
  49. package/dist/docs/versioned/next/implementationPlans/design-blend-skill.md +1 -0
  50. package/dist/docs/versioned/next/implementationPlans/docs-site-and-versioning.md +1 -0
  51. package/dist/docs/versioned/next/implementationPlans/feature-flags-openfeature.md +1 -0
  52. package/dist/docs/versioned/next/implementationPlans/feature-flags.md +4 -0
  53. package/dist/docs/versioned/next/implementationPlans/infra-mcp-research.md +1 -0
  54. package/dist/docs/versioned/next/implementationPlans/infra-mcp.md +3 -3
  55. package/dist/docs/versioned/next/implementationPlans/mcp-boost-parity.md +1 -0
  56. package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +1 -0
  57. package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +2 -2
  58. package/dist/docs/versioned/next/implementationPlans/model-router-actions.md +4 -0
  59. package/dist/docs/versioned/next/implementationPlans/model-router-mcp.md +5 -4
  60. package/dist/docs/versioned/next/implementationPlans/offline-mode.md +3 -1
  61. package/dist/docs/versioned/next/implementationPlans/oss-launch-program.md +11 -2
  62. package/dist/docs/versioned/next/implementationPlans/pluggable-database-sqlite-research.md +150 -0
  63. package/dist/docs/versioned/next/implementationPlans/pluggable-database-sqlite.md +247 -0
  64. package/dist/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -1
  65. package/dist/docs/versioned/next/implementationPlans/public-roadmap-github.md +2 -2
  66. package/dist/docs/versioned/next/implementationPlans/rbac-permissions.md +52 -15
  67. package/dist/docs/versioned/next/implementationPlans/rtk-to-syncdb-migration-docs.md +13 -12
  68. package/dist/docs/versioned/next/implementationPlans/syncdb-codegen-research.md +137 -0
  69. package/dist/docs/versioned/next/implementationPlans/syncdb-codegen.md +63 -59
  70. package/dist/docs/versioned/next/implementationPlans/syncdb-local-first.md +1 -0
  71. package/dist/docs/versioned/next/implementationPlans/syncdb-phase-c-design.md +1 -0
  72. package/dist/docs/versioned/next/implementationPlans/terreno-langfuse-integration.md +1 -0
  73. package/dist/docs/versioned/next/implementationPlans/terreno-syncdb-2.md +1 -0
  74. package/dist/docs/versioned/next/implementationPlans/upgrade-banner.md +4 -0
  75. package/dist/docs/versioned/next/reference/README.md +6 -1
  76. package/dist/docs/versioned/next/reference/admin-config.md +51 -0
  77. package/dist/docs/versioned/next/reference/ai.md +15 -1
  78. package/dist/docs/versioned/next/reference/api.md +18 -0
  79. package/dist/docs/versioned/next/reference/comms.md +88 -7
  80. package/dist/docs/versioned/next/reference/environment-variables.md +9 -1
  81. package/dist/docs/versioned/next/reference/{rtk.md → legacy/rtk.md} +11 -7
  82. package/dist/docs/versioned/next/reference/lifecycle-plugin.md +54 -0
  83. package/dist/docs/versioned/next/reference/mcp-server.md +7 -0
  84. package/dist/docs/versioned/next/reference/syncdb.md +30 -3
  85. package/dist/docs/versioned/next/tasks/README.md +21 -10
  86. package/dist/docs/versioned/next/tasks/admin-improvements.md +189 -353
  87. package/dist/docs/versioned/next/tasks/admin-only.md +2 -0
  88. package/dist/docs/versioned/next/tasks/agentic-sdlc-plugin.md +54 -160
  89. package/dist/docs/versioned/next/tasks/comms-abstraction.md +30 -24
  90. package/dist/docs/versioned/next/tasks/comms-adapter-sendgrid.md +4 -4
  91. package/dist/docs/versioned/next/tasks/consent-forms.md +2 -0
  92. package/dist/docs/versioned/next/tasks/feature-flags.md +2 -0
  93. package/dist/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +14 -10
  94. package/dist/docs/versioned/next/tasks/model-router-actions.md +2 -0
  95. package/dist/docs/versioned/next/tasks/model-router-mcp.md +27 -27
  96. package/dist/docs/versioned/next/tasks/offline-mode.md +2 -0
  97. package/dist/docs/versioned/next/tasks/pluggable-database-sqlite.md +44 -0
  98. package/dist/docs/versioned/next/tasks/public-roadmap-github.md +1 -1
  99. package/dist/docs/versioned/next/tasks/rtk-to-syncdb-migration-docs.md +15 -15
  100. package/dist/docs/versioned/next/tasks/syncdb-codegen.md +37 -31
  101. package/dist/docs/versioned/next/tasks/upgrade-banner.md +2 -0
  102. package/dist/index.js +24 -55
  103. package/dist/index.js.map +1 -1
  104. package/dist/local/localServer.d.ts.map +1 -1
  105. package/dist/local/localServer.js +9 -8
  106. package/dist/local/localServer.js.map +1 -1
  107. package/dist/local/localTools.d.ts +1 -1
  108. package/dist/local/localTools.d.ts.map +1 -1
  109. package/dist/prompts.d.ts.map +1 -1
  110. package/dist/prompts.js +44 -45
  111. package/dist/prompts.js.map +1 -1
  112. package/dist/resources.d.ts.map +1 -1
  113. package/dist/resources.js +9 -2
  114. package/dist/resources.js.map +1 -1
  115. package/dist/tools.d.ts +1 -1
  116. package/dist/tools.d.ts.map +1 -1
  117. package/dist/tools.js +4 -2
  118. package/dist/tools.js.map +1 -1
  119. package/package.json +7 -3
  120. package/src/docs/guidelines/api/skills/mongoose-schema-safety/SKILL.md +8 -0
  121. package/src/docs/resources/overview.md +6 -1
  122. package/src/docs/resources/rtk.md +3 -1
  123. package/src/docs/resources/syncdb.md +43 -0
  124. package/src/docs/upgrades/56.0.0-beta.2.md +34 -0
  125. package/src/docs/upgrades/57.1.0.md +126 -0
  126. package/src/docs/versioned/next/README.md +15 -3
  127. package/src/docs/versioned/next/explanation/README.md +3 -0
  128. package/src/docs/versioned/next/explanation/admin-consent-migration.md +15 -0
  129. package/src/docs/versioned/next/explanation/admin-plugin-frontend.md +12 -0
  130. package/src/docs/versioned/next/explanation/announcements/rtk-deprecation.md +29 -0
  131. package/src/docs/versioned/next/explanation/authentication.md +51 -58
  132. package/src/docs/versioned/next/explanation/local-first-data.md +52 -0
  133. package/src/docs/versioned/next/explanation/loop-engineering.md +117 -0
  134. package/src/docs/versioned/next/explanation/repository-settings.md +8 -0
  135. package/src/docs/versioned/next/explanation/roadmap-process.md +22 -9
  136. package/src/docs/versioned/next/explanation/roadmap-seed-issues.md +39 -0
  137. package/src/docs/versioned/next/how-to/README.md +3 -0
  138. package/src/docs/versioned/next/how-to/admin-add-model.md +41 -0
  139. package/src/docs/versioned/next/how-to/admin-custom-home.md +31 -0
  140. package/src/docs/versioned/next/how-to/admin-custom-widget.md +42 -0
  141. package/src/docs/versioned/next/how-to/admin-import-prebuilt.md +25 -0
  142. package/src/docs/versioned/next/how-to/circleci.md +173 -0
  143. package/src/docs/versioned/next/how-to/configure-better-auth.md +13 -10
  144. package/src/docs/versioned/next/how-to/expose-mcp-tools.md +194 -0
  145. package/src/docs/versioned/next/how-to/install-agent-skills.md +46 -0
  146. package/src/docs/versioned/next/how-to/migrate-rtk-to-syncdb.md +26 -1
  147. package/src/docs/versioned/next/how-to/websocket-integration.md +2 -1
  148. package/src/docs/versioned/next/implementationPlans/ModularAPI.md +1 -0
  149. package/src/docs/versioned/next/implementationPlans/README.md +31 -17
  150. package/src/docs/versioned/next/implementationPlans/admin-improvements-research.md +136 -0
  151. package/src/docs/versioned/next/implementationPlans/admin-improvements.md +157 -527
  152. package/src/docs/versioned/next/implementationPlans/admin-only-research.md +4 -0
  153. package/src/docs/versioned/next/implementationPlans/admin-only.md +3 -1
  154. package/src/docs/versioned/next/implementationPlans/admin-script-runner.md +1 -0
  155. package/src/docs/versioned/next/implementationPlans/admin-ui-v2-django-parity.md +1 -0
  156. package/src/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +160 -130
  157. package/src/docs/versioned/next/implementationPlans/apierror-standard-error-redesign.md +1 -0
  158. package/src/docs/versioned/next/implementationPlans/b2b-platform-program.md +5 -4
  159. package/src/docs/versioned/next/implementationPlans/comms-abstraction-research.md +48 -0
  160. package/src/docs/versioned/next/implementationPlans/comms-abstraction.md +152 -62
  161. package/src/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +9 -9
  162. package/src/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +1 -1
  163. package/src/docs/versioned/next/implementationPlans/consent-forms.md +4 -0
  164. package/src/docs/versioned/next/implementationPlans/design-blend-skill.md +1 -0
  165. package/src/docs/versioned/next/implementationPlans/docs-site-and-versioning.md +1 -0
  166. package/src/docs/versioned/next/implementationPlans/feature-flags-openfeature.md +1 -0
  167. package/src/docs/versioned/next/implementationPlans/feature-flags.md +4 -0
  168. package/src/docs/versioned/next/implementationPlans/infra-mcp-research.md +1 -0
  169. package/src/docs/versioned/next/implementationPlans/infra-mcp.md +3 -3
  170. package/src/docs/versioned/next/implementationPlans/mcp-boost-parity.md +1 -0
  171. package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +1 -0
  172. package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +2 -2
  173. package/src/docs/versioned/next/implementationPlans/model-router-actions.md +4 -0
  174. package/src/docs/versioned/next/implementationPlans/model-router-mcp.md +5 -4
  175. package/src/docs/versioned/next/implementationPlans/offline-mode.md +3 -1
  176. package/src/docs/versioned/next/implementationPlans/oss-launch-program.md +11 -2
  177. package/src/docs/versioned/next/implementationPlans/pluggable-database-sqlite-research.md +150 -0
  178. package/src/docs/versioned/next/implementationPlans/pluggable-database-sqlite.md +247 -0
  179. package/src/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -1
  180. package/src/docs/versioned/next/implementationPlans/public-roadmap-github.md +2 -2
  181. package/src/docs/versioned/next/implementationPlans/rbac-permissions.md +52 -15
  182. package/src/docs/versioned/next/implementationPlans/rtk-to-syncdb-migration-docs.md +13 -12
  183. package/src/docs/versioned/next/implementationPlans/syncdb-codegen-research.md +137 -0
  184. package/src/docs/versioned/next/implementationPlans/syncdb-codegen.md +63 -59
  185. package/src/docs/versioned/next/implementationPlans/syncdb-local-first.md +1 -0
  186. package/src/docs/versioned/next/implementationPlans/syncdb-phase-c-design.md +1 -0
  187. package/src/docs/versioned/next/implementationPlans/terreno-langfuse-integration.md +1 -0
  188. package/src/docs/versioned/next/implementationPlans/terreno-syncdb-2.md +1 -0
  189. package/src/docs/versioned/next/implementationPlans/upgrade-banner.md +4 -0
  190. package/src/docs/versioned/next/reference/README.md +6 -1
  191. package/src/docs/versioned/next/reference/admin-config.md +51 -0
  192. package/src/docs/versioned/next/reference/ai.md +15 -1
  193. package/src/docs/versioned/next/reference/api.md +18 -0
  194. package/src/docs/versioned/next/reference/comms.md +88 -7
  195. package/src/docs/versioned/next/reference/environment-variables.md +9 -1
  196. package/src/docs/versioned/next/reference/{rtk.md → legacy/rtk.md} +11 -7
  197. package/src/docs/versioned/next/reference/lifecycle-plugin.md +54 -0
  198. package/src/docs/versioned/next/reference/mcp-server.md +7 -0
  199. package/src/docs/versioned/next/reference/syncdb.md +30 -3
  200. package/src/docs/versioned/next/tasks/README.md +21 -10
  201. package/src/docs/versioned/next/tasks/admin-improvements.md +189 -353
  202. package/src/docs/versioned/next/tasks/admin-only.md +2 -0
  203. package/src/docs/versioned/next/tasks/agentic-sdlc-plugin.md +54 -160
  204. package/src/docs/versioned/next/tasks/comms-abstraction.md +30 -24
  205. package/src/docs/versioned/next/tasks/comms-adapter-sendgrid.md +4 -4
  206. package/src/docs/versioned/next/tasks/consent-forms.md +2 -0
  207. package/src/docs/versioned/next/tasks/feature-flags.md +2 -0
  208. package/src/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +14 -10
  209. package/src/docs/versioned/next/tasks/model-router-actions.md +2 -0
  210. package/src/docs/versioned/next/tasks/model-router-mcp.md +27 -27
  211. package/src/docs/versioned/next/tasks/offline-mode.md +2 -0
  212. package/src/docs/versioned/next/tasks/pluggable-database-sqlite.md +44 -0
  213. package/src/docs/versioned/next/tasks/public-roadmap-github.md +1 -1
  214. package/src/docs/versioned/next/tasks/rtk-to-syncdb-migration-docs.md +15 -15
  215. package/src/docs/versioned/next/tasks/syncdb-codegen.md +37 -31
  216. package/src/docs/versioned/next/tasks/upgrade-banner.md +2 -0
  217. package/dist/docs/versioned/next/implementationPlans/PLAN_INDEX.md +0 -73
  218. package/dist/docs/versioned/next/implementationPlans/syncdb-api-inventory.md +0 -303
  219. package/src/docs/versioned/next/implementationPlans/PLAN_INDEX.md +0 -73
  220. package/src/docs/versioned/next/implementationPlans/syncdb-api-inventory.md +0 -303
@@ -1,5 +1,9 @@
1
1
  # Research: Serving Admin from a Terreno App (Opt-In, No Separate SPA Deploy)
2
2
 
3
+ **Status:** Complete
4
+ **Closed:** 2026-08-20 — Research incorporated into [admin-only.md](admin-only.md); shipped as `@terreno/admin-spa`.
5
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1075
6
+
3
7
  ## Summary
4
8
 
5
9
  Terreno already has the building blocks for an admin UI — `@terreno/admin-backend` mounts `/admin/*` API routes (config, per-model CRUD, search, scripts, version-config) and `@terreno/admin-frontend` ships React Native components designed to be embedded in a consumer's Expo Router app. The gap is the **deploy surface**: today consumers either bundle admin into their main Expo app (bloats user bundles, requires ~7 route files) or build a separate Expo Web app and host it on GCS/Netlify (one more pipeline to maintain).
@@ -1,6 +1,8 @@
1
1
  # Admin-Only: Serve Admin SPA From a Terreno Backend (Opt-In)
2
2
 
3
- **Status:** Draft
3
+ **Status:** Complete
4
+ **Closed:** 2026-08-20 — Shipped as `@terreno/admin-spa` (`AdminSpaServeApp`, pre-built Expo web export, Better Auth same-origin). See `admin-spa/` and `admin-only-research.md`.
5
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1075
4
6
  **Branch:** `admin-only`
5
7
  **Owner:** Josh Gachnang
6
8
  **Created:** 2026-05-11
@@ -1,6 +1,7 @@
1
1
  # Admin Script Runner — Maintenance Scripts via `AdminApp`
2
2
 
3
3
  **Status:** Implemented (ships with Admin UI v2 work; documented here as its own IP)
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1077
4
5
  **Related:** [`admin-ui-v2-django-parity.md`](./admin-ui-v2-django-parity.md) (home `scriptRunner` widget, background-task patterns)
5
6
  **Primary packages:** `@terreno/api` (`BackgroundTask`, script types), `@terreno/admin-backend`, `@terreno/admin-frontend`, `admin-spa`, `example-backend`
6
7
 
@@ -1,6 +1,7 @@
1
1
  # Admin UI v2 — Django-Parity Admin (Config-Driven Shell)
2
2
 
3
3
  **Status:** Implemented (phased tasks complete; acceptance criteria verified in-repo)
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1076
4
5
  **Branch:** Landed via `cursor/admin-ui-v2-backend-a736` (PR #782)
5
6
  **Owner:** Josh Gachnang
6
7
  **Created:** 2026-06-15
@@ -1,178 +1,208 @@
1
- # Implementation Plan: Publish and Document the Agentic SDLC Plugin
1
+ # Implementation Plan: Loop-Engineering Lifecycle Plugin
2
2
 
3
- **Status:** Draft — key decisions recorded (2026-07-29)
3
+ **Status:** In Progress
4
+ **Approved:** 2026-08-22
4
5
  **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1006
5
6
  **Priority:** High
6
- **Effort:** Big batch
7
- **Owner:** unassigned
7
+ **Owner:** agent
8
8
  **Created:** 2026-07-27
9
9
  **Program:** [OSS launch](oss-launch-program.md)
10
- **Depends on:** [`positioning-django-rails-universal`](positioning-django-rails-universal.md) (shared copy blocks), [`oss-governance-baseline`](oss-governance-baseline.md) (license coverage for `plugins/`)
11
- **RTK deprecation flag:** **Partial** — the pipeline's frontend-verification gates name `rtk/` in their path lists and must be updated to name `syncdb/` after PR #869.
12
10
 
13
11
  ## Goal
14
12
 
15
- Terreno ships a five-stage agentic SDLC pipeline as an installable Cursor plugin, and **nobody outside the team knows it exists.** `.cursor-plugin/marketplace.json` declares a team marketplace; `plugins/terreno-planning/` contains five skills that take work from a raw request all the way to a mergeable PR. There is no `plugins/README.md`, no page in `docs/`, no mention in `README.md` or `AGENTS.md`, and the marketplace is scoped to the team.
13
+ Evolve Terreno's existing planning plugin into five reusable, bounded lifecycle
14
+ transitions optimized for repeated fresh agent invocations:
16
15
 
17
- This matters more than a normal documentation gap. The pipeline is the most concrete evidence for the AI-native pillar. Any framework can claim "works great with AI"; very few ship an opinionated, reviewed, test-driven delivery process as installable tooling. In the Django/Rails analogy it is the missing half of `manage.py`: not just "generate a model" but "take this ticket to a mergeable PR with tests and independent review".
18
-
19
- The audit that produced this program missed the plugin entirely. If an agent reading the whole repository missed it, every prospective user will too.
16
+ ```text
17
+ Grow (shape) → Pick (build) → Roast (prove) → Brew (submit) → Taste (react)
18
+ ```
20
19
 
21
- ## Non-Goals
20
+ The outer loop owns invocation, persistence, waiting, retry, stop, and escalation.
21
+ Lifecycle skills own how one stage is performed. Repository skills own how this codebase
22
+ works. Roast owns independent acceptance proof. State/evidence bridge fresh invocations.
23
+
24
+ This is a refactor of the existing strong workflow, not a parallel implementation.
25
+
26
+ ## Scope
27
+
28
+ - Canonical five plugin skills and migration from former names
29
+ - Explicit transition contracts for every stage
30
+ - Shared machine-readable result and execution-state schemas
31
+ - Supporting-skill discovery/composition
32
+ - Repository-specific detail removed from portable stages
33
+ - Brew exits after PR setup
34
+ - Taste performs one reactive iteration and exits
35
+ - Outer-loop reference including small-feature and CI/review scenarios
36
+ - Static validation for names, status values, transitions, portability, and loop bounds
37
+ - Documentation, metadata, and generated integrations
38
+
39
+ ## Non-scope
40
+
41
+ - A daemon/hosted scheduler implementation
42
+ - Automatic merging
43
+ - Copying Terreno's repository skills into the plugin
44
+ - Persisting chain-of-thought or conversational transcripts
45
+ - Hundreds of generic micro-skills
46
+
47
+ ## Decisions
48
+
49
+ | ID | Decision |
50
+ | --- | --- |
51
+ | AP1 | Public reusable plugin; repository-specific knowledge remains local |
52
+ | AP2 | Sensitive-data rules cover credentials, customer data, PII/PHI, and evidence media |
53
+ | AP3 | Canonical stages are Grow, Pick, Roast, Brew, Taste |
54
+ | AP4 | Stages discover supporting skills by description; exact skill names are never universal dependencies |
55
+ | AP5 | Taste is one observe/act/emit iteration; the outer loop owns waiting and reinvocation |
56
+ | AP6 | Shared results use stable YAML shaped by JSON Schema; statuses are `PASS`, `FAIL`, `BLOCKED`, `PENDING` |
57
+ | AP7 | Existing repository state convention wins; fallback reuses loop-owned `.terreno/pipeline/<slug>.json`, not committed by default |
58
+ | AP8 | Brew emits PR/head state and exits; direct Taste invocation is standalone compatibility only |
59
+ | AP9 | No deprecated command aliases: old implementation-Roast conflicts with new verification-Roast and no maintained alias mechanism exists |
60
+ | AP10 | Plugin major version is `2.0.0` because lifecycle semantics and command names are breaking |
22
61
 
23
- - Redesigning the pipeline. The five stages work; this is packaging, documentation, and positioning.
24
- - Porting the pipeline to every agent runtime. Cursor is the reference; note what would be required for others.
25
- - Replacing the repo's existing `.rulesync/skills/` (`submit`, `autobot`, `check-watcher`, `respond-to-review`) — but the overlap needs resolving, because right now two pipelines cover similar ground.
26
- - Building a plugin marketplace of our own.
62
+ ## Architecture
27
63
 
28
- ## Blocking questions
64
+ ```text
65
+ OUTER LOOP
66
+ invoke / persist / wait / retry
67
+ stop / route / escalate
68
+ |
69
+ v
70
+ GROW → PICK → ROAST → BREW → TASTE
71
+ shape build prove submit react once
72
+ |
73
+ repository skills + IP/task/state + evidence
74
+ ```
29
75
 
30
- **Recorded 2026-07-29** (see program [P11](oss-launch-program.md#blocking-questions-program-level)).
76
+ ### Ownership
31
77
 
32
- | # | Question | Decision |
33
- |---|----------|----------|
34
- | AP1 | Marketplace public or team-only? | **A** — public at launch (gated on portability) |
35
- | AP2 | PHI/HIPAA handling | **B** — generalize to "sensitive data (PHI, PII, secrets)" |
36
- | AP3 | Stage names | **Coffee theme retained.** New five-stage flow: **grow → harvest → roast → brew → taste**. Skills: `/terreno-1-grow`, `/terreno-2-harvest`, `/terreno-3-roast`, `/terreno-4-brew`, `/terreno-5-taste`. **Aliases required** in docs and skill frontmatter (see mapping below) |
37
- | AP4 | Consumer apps or monorepo only? | **B** — must work in consumer apps |
38
- | AP5 | Overlap with `submit` / `autobot` | **A** — deprecate `submit` and `autobot` in favor of the plugin. **Fold all `autobot` behavior into Taste (`/terreno-5-taste`)**. Taste should be **self-contained** (inline the full submit → CI → review loop) rather than delegating to other skills — delegation has been unreliable inside the plugin (sub-agents and cross-skill calls do not always resolve). Accept larger skill files / context cost over broken orchestration |
39
- | AP6 | Agent runtimes | **B** — Cursor + rulesync-generated variants |
40
- | AP7 | Plugin versioning | **A** — independent versioning; declare compatible Terreno versions |
78
+ | Layer | Owns |
79
+ | --- | --- |
80
+ | Outer loop | when, who, next stage, persistence, waiting, retry, stop, escalation |
81
+ | Lifecycle plugin | portable stage procedure, invariants, evidence, transitions |
82
+ | Repository skills | commands, frameworks, package conventions, safety rules, gotchas |
83
+ | Roast | requirement → method → evidence → verdict |
84
+ | State/evidence | durable facts required by a fresh invocation |
41
85
 
42
- ### Stage mapping (rename + aliases)
86
+ ### State transition table
43
87
 
44
- | # | New name | Role | Replaces | Aliases (docs + deprecated skill names) |
45
- |---|----------|------|----------|----------------------------------------|
46
- | 1 | **grow** | Plan — IP + tasks, blocking questions first | blend | `plan`, `blend`, `terreno-1-blend` |
47
- | 2 | **harvest** | Implement — strict TDD, drift detection | roast (implement) | `implement`, `terreno-2-roast` |
48
- | 3 | **roast** | Verify — independent evidence in fresh context | cupping | `verify`, `cupping`, `terreno-3-cupping` |
49
- | 4 | **brew** | Submit — checks, commit, push, draft PR, evidence | pour | `submit`, `pour`, `terreno-4-pour` |
50
- | 5 | **taste** | Review loop — CI + bot/human comments until mergeable; **includes former `autobot`** | dialin | `review`, `dialin`, `terreno-5-dialin` |
88
+ | Stage | PASS | FAIL | BLOCKED/PENDING |
89
+ | --- | --- | --- | --- |
90
+ | Grow | Pick | Grow with artifact defects | Human/external gate |
91
+ | Pick | Roast | Pick with new evidence-based hypothesis | Human/external gate |
92
+ | Roast | Brew | Pick with exact failed criteria | Classify environment/external/human |
93
+ | Brew | Taste | Pick/Roast/Brew according to evidence | Human/access gate |
94
+ | Taste | Merge-ready | Focused Taste retry only with new evidence | `PENDING`: loop waits then Taste; `BLOCKED`: named gate |
51
95
 
52
- ## Architecture
96
+ ## Shared result contract
53
97
 
54
- ### The pipeline
55
-
56
- ```mermaid
57
- flowchart LR
58
- REQ["Request<br/>ticket / spec / idea"]
59
- G["/terreno-1-grow<br/>(plan)"]
60
- H["/terreno-2-harvest<br/>(implement)"]
61
- R["/terreno-3-roast<br/>(verify)"]
62
- B["/terreno-4-brew<br/>(submit)"]
63
- T["/terreno-5-taste<br/>(review loop)"]
64
- M["Mergeable PR"]
65
- REQ --> G --> H --> R --> B --> T --> M
66
- T -.->|"blocked: needs human"| M
67
- ```
98
+ Every stage emits the same concise YAML keys: schema version, stage/status, IP/task,
99
+ attempt, branch/head/PR, supporting skills, completed work, checks, artifacts, failures,
100
+ blockers, decisions required, next stage/action, and optional next-check interval.
68
101
 
69
- | Stage | Owns | What makes it non-obvious |
70
- |-------|------|---------------------------|
71
- | **Grow** (plan) | Request → IP in `docs/implementationPlans/` + tasks in `docs/tasks/` | Question-first: refuses to write decided outcomes until blocking questions are answered. Prevents the most common agent failure, which is confidently planning the wrong thing |
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) |
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 |
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 |
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 |
102
+ Schemas:
76
103
 
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.
104
+ - `plugins/terreno-planning/references/stage-result.schema.json`
105
+ - `plugins/terreno-planning/references/execution-state.schema.json`
78
106
 
79
- ### It only works here
107
+ No reasoning transcript is persisted.
80
108
 
81
- The most serious finding. The pipeline currently assumes it is running inside the Terreno monorepo:
109
+ ## Execution state
82
110
 
83
- | Assumption | Where | Why it breaks elsewhere |
84
- |------------|-------|-------------------------|
85
- | Repo-root-relative skill paths — Brew/Taste instruct reading plugin skill paths "from the repository root" | `terreno-4-brew`, `terreno-5-taste` | In a consumer's repo that path does not exist. It works today only because the workspace *is* this repo; an installed plugin lives in the agent's plugin cache |
86
- | `verify-ui-changes` is invoked by name | Harvest, Roast, Brew, Taste | That skill lives in this repo's `.rulesync/skills/`. A consumer installing the plugin does not get it — must be bundled or inlined per AP5 |
87
- | Terreno-monorepo package paths in the frontend gates (`ui/`, `demo/`, `example-frontend/`, `admin-frontend/`, `admin-spa/`, `syncdb/`) | Harvest, Brew, Taste | A consumer app has `frontend/`, not `example-frontend/` |
88
- | Repo-specific conventions — `docs/implementationPlans/`, the project registry, the `bun run` command set | Grow, Harvest | A consumer may have none of these |
89
- | A hardcoded branch suffix (`cursor/<descriptive-name>-dcb3`) | Brew | Suffixes are per-agent-run, not fixed; a literal `dcb3` will produce wrong branch names |
111
+ The IP owns design/scope; tasks own executable slices. State stores only current
112
+ stage/attempt/head/PR, prior structured result, artifacts, attempted approaches, and next
113
+ transition. The outer loop preserves/transports it between fresh invocations.
90
114
 
91
- Fixing this is the difference between "our internal process, published" and "tooling Terreno users can adopt". It means parameterizing paths, bundling or declaring the skill dependencies, and detecting project layout instead of assuming it.
115
+ State files are excluded from Brew commits unless a repository explicitly tracks them.
116
+ After a PR exists, each Taste invocation also reconstructs current truth from the PR and
117
+ current head rather than trusting stale state.
92
118
 
93
- ### Overlap with existing repo skills
119
+ ## Stage contracts
94
120
 
95
- | Plugin stage | Repo skill (deprecated) |
96
- |--------------|-------------------------|
97
- | Brew | `.rulesync/skills/submit/`, `commit/`, `create-pr/` |
98
- | Taste | `.rulesync/skills/autobot/`, `check-watcher/`, `respond-to-review/` — **logic inlined into Taste; skills deprecated** |
99
- | Grow | `.rulesync/skills/ip/`, `design-blend/` |
100
- | Harvest | `.rulesync/skills/implement/` |
121
+ ### Grow
101
122
 
102
- Per AP5, **`submit` and `autobot` are deprecated** once Taste ships self-contained. Do not document two parallel pipelines.
123
+ Researches repository facts, distinguishes human decisions from discoverable facts and
124
+ low-risk conventional details, grills only genuine decisions, then writes approved,
125
+ implementation-ready IP/tasks. Every acceptance criterion maps to verification.
103
126
 
104
- ### Positioning
127
+ ### Pick
105
128
 
106
- The pipeline belongs in the **AI-native** pillar, alongside the MCP server. They are complementary and the distinction should be stated plainly:
129
+ Implements one slice with Specify → Encode failing test → Fulfill → Clean the Kitchen.
130
+ It consumes prior Roast/Taste evidence, preserves verified behavior, records failed
131
+ approaches, runs independent implementation and test-quality reviews, and emits evidence
132
+ for Roast.
107
133
 
108
- - **MCP server** = the *tool* layer. What an agent can see and do: search docs, generate conventional code, read merged logs, inspect client state, drive the running app.
109
- - **SDLC plugin** = the *process* layer. How an agent should sequence work: plan before coding, test-drive, review in a fresh context, verify independently, gate on evidence, then own the review loop.
134
+ ### Roast
110
135
 
111
- In the Django/Rails comparison table, this fills the row that currently reads "MCP server tools + skills — agent-driven rather than CLI-driven". Better framing: Django gives you `manage.py startapp`; Terreno gives you a reviewed path from ticket to mergeable PR.
136
+ Runs independently, preferably in fresh context. It builds a requirement/evidence matrix
137
+ and executes objective checks. It does not normally fix implementation code. `FAIL`
138
+ returns exact expected/actual evidence to Pick.
112
139
 
113
- ## Models / APIs / Notifications / UI
140
+ ### Brew
114
141
 
115
- None.
142
+ Requires Roast proof, runs repository-defined final checks/review, commits/pushes, applies
143
+ the PR template, attaches evidence, records PR/current head, and exits. It does not wait
144
+ for CI or execute Taste.
116
145
 
117
- ## Phases
146
+ ### Taste
118
147
 
119
- 1. **Decide and sanitize** — answer AP2, generalize PHI language, remove Flourish specifics, fix the hardcoded branch suffix.
120
- 2. **Rename stages** — grow/harvest/roast/brew/taste with aliases; bump plugin minor version (AP3).
121
- 3. **Make it portable** — parameterize paths, bundle `verify-ui-changes` (or equivalent), detect project layout (AP4).
122
- 4. **Consolidate Taste** — inline `autobot` + review-loop behavior; deprecate `submit`/`autobot` repo skills (AP5).
123
- 5. **Document** — `plugins/README.md`, docs-site explainer and how-to, per-stage reference with alias callouts.
124
- 6. **Position** — README, docs landing, comparison table, agent context files.
125
- 7. **Distribute** — publish the marketplace; generate non-Cursor variants via rulesync (AP6).
148
+ Reads current-head CI, mergeability, and unresolved review signals once. It classifies,
149
+ performs one bounded set of actionable fixes, verifies/pushes if changed, emits
150
+ `PASS`/`PENDING`/`BLOCKED`/`FAIL`, and exits. The outer loop schedules another invocation.
126
151
 
127
- ## Feature Flags & Migrations
152
+ ## Supporting skills
128
153
 
129
- None. Renaming or aliasing stages (AP3) is a breaking change for anyone with the plugin installed — bump the plugin minor version and note it in `plugins/README.md`.
154
+ Every stage inventories skills exposed by the harness/repository and loads those whose
155
+ descriptions match the affected domains. Useful project skills may describe APIs, UI,
156
+ data, schemas, prompts, test environments, deployment, documentation, or verification.
157
+ No exact name is hard-required globally.
130
158
 
131
- ## Not Included / Future Work
159
+ If repository policy requires a capability and it is missing, the stage returns
160
+ `BLOCKED`. If no skill applies, the stage infers conventions from repository instructions,
161
+ code, tests, scripts, and analogous changes.
132
162
 
133
- - A healthcare-specific plugin variant retaining explicit PHI handling (AP2 option C).
134
- - Additional stages (design review, release, incident response).
135
- - Telemetry on stage usage or success rates.
136
- - Publishing to a public Cursor plugin directory beyond this repo's marketplace, if one exists.
163
+ ## Retry semantics and human gates
137
164
 
138
- ## Files to Create / Modify
165
+ Engineering retries are bounded and hypothesis-driven. Each attempt retains exact failure
166
+ evidence and attempted approaches. Changing external state may be observed indefinitely
167
+ by repeated fresh Taste invocations, but no lifecycle skill waits internally.
139
168
 
140
- **Create**
169
+ Human gates include product semantics, architecture/security/data ownership, destructive
170
+ or irreversible operations, permissions, public compatibility, major scope expansion,
171
+ and policy-required approval. `BLOCKED` names the decision, evidence, options/tradeoffs,
172
+ and recommended default.
141
173
 
142
- - `plugins/README.md`
143
- - `docs/explanation/agentic-sdlc.md`
144
- - `docs/how-to/use-the-terreno-plugin.md`
145
- - `docs/reference/sdlc-plugin.md`
146
- - `plugins/terreno-planning/LICENSE`
174
+ ## Compatibility migration
147
175
 
148
- **Modify**
176
+ | Retired | Canonical |
177
+ | --- | --- |
178
+ | `terreno-1-blend` | `terreno-1-grow` |
179
+ | `terreno-2-roast` (implementation) | `terreno-2-pick` |
180
+ | `terreno-3-cupping` | `terreno-3-roast` (verification) |
181
+ | `terreno-4-pour` | `terreno-4-brew` |
182
+ | `terreno-5-dialin` | `terreno-5-taste` |
149
183
 
150
- - `plugins/terreno-planning/skills/*/SKILL.md` (all five: sanitization, portability, delegation)
151
- - `plugins/terreno-planning/.cursor-plugin/plugin.json`, `.cursor-plugin/marketplace.json`
152
- - `README.md`, `docs/README.md`, `docs/explanation/positioning.md`
153
- - `AGENTS.md` / `.rulesync/rules/00-root.md`, `CLAUDE-consumer.md`
154
- - `.rulesync/skills/submit/SKILL.md`, `autobot/SKILL.md` (cross-reference the plugin)
155
- - `scripts/check-license-coverage.ts` (cover `plugins/`)
156
- - `.rulesync/skills/build-terreno-app/SKILL.md` (use the pipeline if public)
184
+ Former Grind orchestration becomes an outer-loop feature profile. Former plugin code
185
+ review becomes a shared reference. Neither remains a sixth plugin skill.
157
186
 
158
- ## Task List
187
+ ## Acceptance criteria
159
188
 
160
- See [`docs/tasks/agentic-sdlc-plugin.md`](../tasks/agentic-sdlc-plugin.md).
189
+ - Exactly five canonical lifecycle skill directories exist.
190
+ - Every stage has explicit preconditions, inputs, procedure, supporting skills, evidence,
191
+ success/failure/blocked conditions, and next transition.
192
+ - A fresh Pick/Roast/Taste invocation can reconstruct its work from durable artifacts.
193
+ - Result/status/transition values validate against the common schema.
194
+ - Taste has no internal indefinite wait/observation loop.
195
+ - Brew does not require same-context Taste execution.
196
+ - Lifecycle skills contain no Terreno package names/commands that belong to project skills.
197
+ - Repository skills remain local and discoverable/composable.
198
+ - Backend/API, UI, and multi-invocation CI/review scenarios are documented.
199
+ - Canonical sources and rulesync-generated copies validate cleanly.
161
200
 
162
- ## Acceptance Criteria
201
+ ## Remaining assumptions / weaknesses
163
202
 
164
- - [ ] `plugins/README.md` explains the five stages, installation, and when to use each, in under 150 lines.
165
- - [ ] No plugin skill contains Flourish-specific vocabulary; sensitive-data handling is generalized per AP2.
166
- - [ ] No plugin skill contains a hardcoded branch suffix or a repo-root-relative path to a sibling skill.
167
- - [ ] The pipeline runs end to end in a **consumer app scaffolded by `terreno_bootstrap_app`**, not just in this monorepo — verified by taking one small feature from request to open PR.
168
- - [ ] Every skill dependency (`verify-ui-changes` at minimum) is either bundled with the plugin or declared with installation instructions.
169
- - [ ] Frontend path gates are derived from the project's actual layout rather than hardcoded monorepo package names.
170
- - [ ] Pour and Taste are self-contained per AP5; deprecated `submit`/`autobot` repo skills point to the plugin; no rule is stated in two places with different wording.
171
- - [ ] `docs/explanation/agentic-sdlc.md` explains the process layer versus the MCP tool layer and why fresh-context independent review matters.
172
- - [ ] `docs/how-to/use-the-terreno-plugin.md` takes a reader from installation to a merged PR.
173
- - [ ] `docs/reference/sdlc-plugin.md` documents each stage's scope, inputs, outputs, and boundaries.
174
- - [ ] `README.md` and `docs/README.md` name the pipeline under the AI-native pillar; the Django/Rails comparison table's generator row cites it.
175
- - [ ] Every public reference to a coffee-named stage gives its plain-language meaning at least once per page.
176
- - [ ] The marketplace is installable by the audience chosen in AP1, verified by a fresh install.
177
- - [ ] `plugins/` is covered by the license-coverage check.
178
- - [ ] `bun run rules:check` and `bun run check` pass.
203
+ - The plugin defines state/results but does not ship a scheduler or durable remote state
204
+ service; the outer loop must preserve the fallback artifact between machines.
205
+ - Some generated skill formats do not encode Cursor's `disable-model-invocation`
206
+ frontmatter. Enforcement of explicit invocation depends on that agent runtime.
207
+ - Repository skill quality controls how much exact domain knowledge a stage can compose.
208
+ When no skill exists, agents still infer from instructions/code/tests.
@@ -1,6 +1,7 @@
1
1
  # APIError redesign — standards-first extension of Error
2
2
 
3
3
  **Status:** Complete
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1080
4
5
  **Branch:** cursor/apierror-standard-error-redesign-e24a
5
6
  **Owner:** TBD
6
7
  **Created:** 2026-07-28
@@ -1,6 +1,7 @@
1
1
  # Program: B2B platform
2
2
 
3
3
  **Status:** Draft — roadmap items drafted; decisions D1–D7 resolved 2026-08-09; first ten IPs open
4
+ **Roadmap issue:** https://github.com/FlourishHealth/terreno/issues/1095
4
5
  **Owner:** unassigned
5
6
  **Created:** 2026-08-09
6
7
 
@@ -31,7 +32,7 @@ org switcher, dark mode).
31
32
 
32
33
  | Track | Theme | IPs / roadmap items |
33
34
  |---|---|---|
34
- | A | Tenancy & access | `orgs-and-teams`, `rbac-permissions` (existing draft), `invitations-and-seats`, `org-management-ui` |
35
+ | A | Tenancy & access | `orgs-and-teams`, `rbac-permissions` (Complete), `invitations-and-seats`, `org-management-ui` |
35
36
  | 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
37
  | B | Billing | `inbound-webhooks`, `billing-stripe` (web-first, per D1), `mobile-iap-revenuecat` (Future) |
37
38
  | D | Zero-to-deployed DX | `create-terreno-app`, `mongo-migrations` (deploy items already exist in the OSS launch program) |
@@ -92,17 +93,17 @@ All decisions resolved by the maintainer on 2026-08-09:
92
93
 
93
94
  | IP | Status | Tasks |
94
95
  |---|---|---|
95
- | [comms-abstraction](comms-abstraction.md) | Draft | [tasks](../tasks/comms-abstraction.md) |
96
+ | [comms-abstraction](comms-abstraction.md) | Approved — Phase 1 gap-fill implemented | [tasks](../tasks/comms-abstraction.md) |
96
97
  | [comms-adapter-expo-push](comms-adapter-expo-push.md) | Draft | [tasks](../tasks/comms-adapter-expo-push.md) |
97
98
  | [comms-adapter-twilio-sms](comms-adapter-twilio-sms.md) | Draft | [tasks](../tasks/comms-adapter-twilio-sms.md) |
98
99
  | [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-adapter-sendgrid](comms-adapter-sendgrid.md) | In progress (Phase 1) | [tasks](../tasks/comms-adapter-sendgrid.md) |
100
101
  | [comms-admin-dashboard](comms-admin-dashboard.md) | Draft | [tasks](../tasks/comms-admin-dashboard.md) |
101
102
  | [password-reset-and-email-verification](password-reset-and-email-verification.md) | Draft | [tasks](../tasks/password-reset-and-email-verification.md) |
102
103
  | [orgs-and-teams](orgs-and-teams.md) | Draft | [tasks](../tasks/orgs-and-teams.md) |
103
104
  | [billing-stripe](billing-stripe.md) | Draft | [tasks](../tasks/billing-stripe.md) |
104
105
  | [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
+ | [rbac-permissions](rbac-permissions.md) | Complete (PR #932) | — |
106
107
 
107
108
  Remaining items (`inbound-webhooks`, `invitations-and-seats`, `org-management-ui`,
108
109
  `notification-center`, `framework-audit-log`, `rate-limiting`, `job-queues`, …) get IPs as
@@ -0,0 +1,48 @@
1
+ # Research: comms-abstraction (finish pass)
2
+
3
+ **Date:** 2026-08-20
4
+ **Scope:** Reconcile the Draft IP with shipped `@terreno/comms` and name remaining roast work.
5
+
6
+ ## Shipped (do not re-plan)
7
+
8
+ - Package scaffold, console adapters, `CommsApp`, `getCommsService()`, `PushToken` + routes,
9
+ `GET /comms/messages`, example-backend registration, CI/publish, reference docs, rules.
10
+ - PRs: #1037 (foundation), #1050 (SendGrid adapter — owned by `comms-adapter-sendgrid`).
11
+ - `SendResult.errorCode` / `errorClass` exist; `CommsMessage` stores them.
12
+ - Mail-only inline retry on `errorClass: "transient"`.
13
+ - Partial hooks: `onSend`, `onError`, `onRetry`, `onDeliveryEvent` (the last is never invoked).
14
+ - Recipients redacted at rest (`redactRecipients`, default true).
15
+ - Push pruning uses `isPermanentFailure`, not `errorClass`.
16
+
17
+ ## Gaps vs original IP (remaining)
18
+
19
+ | Contract | IP | Code today |
20
+ |---|---|---|
21
+ | `beforeSend` mutate/cancel | specified | missing |
22
+ | `onOptOut` / `OptOutEvent` | specified | missing |
23
+ | `recordDeliveryEvent` / `recordOptOut` | implied (adapters feed events) | missing; `onDeliveryEvent` dead |
24
+ | `CommsHookContext` | message, userId, isRetry, messageId | `{channel, provider, isRetry?}` |
25
+ | `onRetry` | `(context, attempt)` | `(context, result)` — **keep shipped signature** |
26
+ | Inline retry | all send paths | mail only; SMS/push/verification rethrow |
27
+ | `attempts[]`, payload, retry links | dashboard-ready fields | missing |
28
+ | `status: cancelled` | specified | not in enum |
29
+ | Push prune | permanent failure | `isPermanentFailure` only |
30
+
31
+ ## Options considered (finish pass)
32
+
33
+ Remaining work keeps the original IP as the contract. Shrink-to-code was rejected: the
34
+ admin-dashboard IP depends on attempt history, payload retention, and `beforeSend`. A
35
+ follow-up IP was rejected: the fields were already in this plan.
36
+
37
+ Non-breaking choices for a published package:
38
+
39
+ - Keep `onRetry(context, result)`; put `attempt` on `CommsHookContext`.
40
+ - Keep `isPermanentFailure` as an adapter alias; facade also prunes on `errorClass: "permanent"`.
41
+ - Unify provider throws to `SendResult` (no rethrow) so retry can run on every channel.
42
+
43
+ ## References
44
+
45
+ - `comms/src/types.ts`, `commsService.ts`, `models/commsMessage.ts`
46
+ - [comms-admin-dashboard.md](comms-admin-dashboard.md)
47
+ - [comms-adapter-sendgrid.md](comms-adapter-sendgrid.md)
48
+ - Roadmap: https://github.com/FlourishHealth/terreno/issues/1018