thinkwork-cli 0.13.2 → 1.0.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 (231) hide show
  1. package/README.md +3 -14
  2. package/dist/{api-client-JYZXYQJR.js → api-client-4P4JZOBX.js} +1 -1
  3. package/dist/{chunk-Z2F6RJFR.js → chunk-4OMDWYZQ.js} +4 -5
  4. package/dist/{chunk-ILZKG5WV.js → chunk-AD2NIWB5.js} +434 -69
  5. package/dist/chunk-MWQ7RO76.js +137 -0
  6. package/dist/{chunk-DVPBI5HM.js → chunk-OLUQ4U2Z.js} +26 -26
  7. package/dist/{chunk-QOERT44A.js → chunk-YQCYD6NE.js} +57 -44
  8. package/dist/cli.js +4400 -16431
  9. package/dist/commands/enterprise/templates/deploy-repo/scripts/apply-release.mjs +0 -1
  10. package/dist/commands/enterprise/templates/deploy-repo/scripts/smoke.mjs +0 -1
  11. package/dist/commands/enterprise/templates/deploy-repo/terraform/main.tf +0 -14
  12. package/dist/{dist-es-CRV46D5B.js → dist-es-2OTNTL4N.js} +4 -4
  13. package/dist/{dist-es-ENBUC3JP.js → dist-es-2XVAH4BQ.js} +2 -2
  14. package/dist/{dist-es-DCY4IC3Y.js → dist-es-3DPDUJAH.js} +2 -2
  15. package/dist/{dist-es-G7PTG75M.js → dist-es-BNZTBBVC.js} +1 -1
  16. package/dist/{dist-es-GKDBE7E6.js → dist-es-CD2RBDAC.js} +1 -1
  17. package/dist/{dist-es-R7FGL2IB.js → dist-es-I4FW57PS.js} +1 -1
  18. package/dist/{dist-es-USORBXZ5.js → dist-es-KVFWJNDY.js} +4 -4
  19. package/dist/{dist-es-HY3535OI.js → dist-es-PS73DWNL.js} +2 -2
  20. package/dist/{dist-es-LDE437AM.js → dist-es-S3NZQFGT.js} +1 -1
  21. package/dist/{dist-es-G54LBMRN.js → dist-es-SGCA4P32.js} +1 -1
  22. package/dist/{dist-es-Q57SZXZ7.js → dist-es-WBM6J4RA.js} +2 -2
  23. package/dist/{dist-es-P26FWFLT.js → dist-es-ZGVADYIF.js} +8 -8
  24. package/dist/drizzle/0227_analyst_reader_role.sql +17 -26
  25. package/dist/drizzle/0230_analyst_rls.sql +28 -45
  26. package/dist/drizzle/0261_native_auth_control_plane.sql +7 -3
  27. package/dist/drizzle/0270_tool_execution_ledger.sql +115 -0
  28. package/dist/drizzle/0271_ontology_twin_declarations.sql +47 -0
  29. package/dist/drizzle/0272_identity_graph_projection_cursor.sql +23 -0
  30. package/dist/drizzle/0273_twin_materialization_suggestions.sql +29 -0
  31. package/dist/drizzle/0274_tenant_mcp_twin_keys.sql +59 -0
  32. package/dist/drizzle/0275_identity_bulk_rebuild_fence.sql +30 -0
  33. package/dist/drizzle/0276_tool_execution_ledger_allow_cascade_delete.sql +18 -0
  34. package/dist/drizzle/0277_knowledge_base_sources.sql +107 -0
  35. package/dist/drizzle/0278_kb_page_transcription.sql +55 -0
  36. package/dist/drizzle/0279_mcp_servers_off_plugin_provenance.sql +93 -0
  37. package/dist/drizzle/0280_work_item_external_refs_drop_plane_provider.sql +46 -0
  38. package/dist/drizzle/0281_tenant_mcp_twin_keys_expiry_suffix.sql +9 -0
  39. package/dist/drizzle/0282_tenant_mcp_twin_keys_grants.sql +24 -0
  40. package/dist/drizzle/0283_agents_agentcore_runtime_dispatch.sql +13 -0
  41. package/dist/drizzle/0284_user_brain_claims.sql +69 -0
  42. package/dist/drizzle/0285_tenant_mcp_twin_keys_trusted_subsystem.sql +30 -0
  43. package/dist/drizzle/0286_brain_analytics_key.sql +26 -0
  44. package/dist/drizzle/0287_brain_subject.sql +25 -0
  45. package/dist/drizzle/0288_multi_lane_identities.sql +25 -0
  46. package/dist/{loadSso-DJVB7BXE.js → loadSso-ETCXTR4I.js} +2 -2
  47. package/dist/{loadSso-JAMNA3WY.js → loadSso-UBD7KUHE.js} +2 -2
  48. package/dist/plugins/README.md +2 -2
  49. package/dist/plugins/catalog/package.json +0 -3
  50. package/dist/plugins/catalog/src/__tests__/build-catalog.test.ts +6 -3
  51. package/dist/plugins/catalog/src/__tests__/catalog.test.ts +21 -21
  52. package/dist/plugins/catalog/src/__tests__/contracts.test.ts +102 -25
  53. package/dist/plugins/catalog/src/__tests__/plugin-package.test.ts +7 -6
  54. package/dist/plugins/catalog/src/__tests__/plugin-registry.test.ts +0 -15
  55. package/dist/plugins/catalog/src/contracts.ts +15 -0
  56. package/dist/plugins/catalog/src/registry/generated-first-party.ts +0 -18
  57. package/dist/plugins/n8n/test/integrated-app-contract.test.ts +1 -1
  58. package/dist/plugins/twenty/package.json +2 -1
  59. package/dist/plugins/twenty/scripts/LAMBDA_DEPLOY.md +114 -0
  60. package/dist/plugins/twenty/scripts/build-lambda.sh +29 -0
  61. package/dist/plugins/twenty/scripts/configure-product-views.ts +195 -0
  62. package/dist/plugins/twenty/scripts/lambda-handler.ts +49 -0
  63. package/dist/plugins/twenty/scripts/lib/__tests__/load-attachments.test.ts +38 -0
  64. package/dist/plugins/twenty/scripts/lib/__tests__/load-records.test.ts +145 -2
  65. package/dist/plugins/twenty/scripts/lib/__tests__/mappers.test.ts +397 -151
  66. package/dist/plugins/twenty/scripts/lib/__tests__/members-ensure.test.ts +28 -129
  67. package/dist/plugins/twenty/scripts/lib/__tests__/provision-members-db.test.ts +10 -0
  68. package/dist/plugins/twenty/scripts/lib/__tests__/schema-ensure.test.ts +13 -8
  69. package/dist/plugins/twenty/scripts/lib/lastmile-reader.ts +222 -2
  70. package/dist/plugins/twenty/scripts/lib/load-attachments.ts +29 -0
  71. package/dist/plugins/twenty/scripts/lib/load-records.ts +160 -43
  72. package/dist/plugins/twenty/scripts/lib/mappers.ts +368 -152
  73. package/dist/plugins/twenty/scripts/lib/members-ensure.ts +43 -268
  74. package/dist/plugins/twenty/scripts/lib/provision-members-db.ts +57 -0
  75. package/dist/plugins/twenty/scripts/lib/schema-ensure.ts +136 -31
  76. package/dist/plugins/twenty/scripts/migrate-lastmile.ts +254 -152
  77. package/dist/plugins/twenty/scripts/provision-twenty-members.ts +44 -1
  78. package/dist/plugins/twenty/scripts/purge-lastmile-import.ts +178 -0
  79. package/dist/plugins/twenty/scripts/restructure-products.ts +312 -0
  80. package/dist/plugins/twenty/scripts/retag-stage-values.ts +362 -0
  81. package/dist/plugins/twenty/test/manifest.test.ts +2 -4
  82. package/dist/scripts/post-deploy.sh +79 -1
  83. package/dist/{signin-UGDWTGS4.js → signin-5QZNRSOO.js} +2 -2
  84. package/dist/{sso-oidc-Q4VXANXY.js → sso-oidc-XK673P54.js} +2 -2
  85. package/dist/{sts-CWLSE3GH.js → sts-OXI2UALF.js} +6 -134
  86. package/dist/{sts-DNZLNVOV.js → sts-SQW4NBK3.js} +6 -134
  87. package/dist/terraform/examples/greenfield/main.tf +233 -175
  88. package/dist/terraform/examples/greenfield/terraform.tfvars.example +12 -8
  89. package/dist/terraform/modules/app/agentcore-admin/main.tf +47 -0
  90. package/dist/terraform/modules/app/agentcore-code-interpreter/README.md +39 -47
  91. package/dist/terraform/modules/app/agentcore-code-interpreter/main.tf +13 -66
  92. package/dist/terraform/modules/app/agentcore-identity/main.tf +106 -26
  93. package/dist/terraform/modules/app/agentcore-identity/outputs.tf +6 -6
  94. package/dist/terraform/modules/app/agentcore-identity/scripts/bootstrap_twenty_oauth_client.sh +216 -99
  95. package/dist/terraform/modules/app/agentcore-identity/scripts/delete_identity.sh +6 -9
  96. package/dist/terraform/modules/app/agentcore-identity/scripts/delete_workload_identity.sh +19 -0
  97. package/dist/terraform/modules/app/agentcore-identity/scripts/ensure_workload_identity.sh +29 -0
  98. package/dist/terraform/modules/app/agentcore-identity/scripts/read_identity.sh +22 -7
  99. package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_identity.sh +17 -46
  100. package/dist/terraform/modules/app/agentcore-identity/scripts/reconcile_twenty_provider.mjs +65 -3
  101. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/after.tf +15 -0
  102. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/before.tf +7 -0
  103. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-after.tf +8 -0
  104. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/identity-before.tf +9 -0
  105. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-after.tf +3 -0
  106. package/dist/terraform/modules/app/agentcore-identity/tests/tainted-marker/thinkwork-before.tf +3 -0
  107. package/dist/terraform/modules/app/agentcore-identity/variables.tf +6 -0
  108. package/dist/terraform/modules/app/agentcore-memory/README.md +46 -9
  109. package/dist/terraform/modules/app/agentcore-memory/main.tf +27 -10
  110. package/dist/terraform/modules/app/agentcore-memory/scripts/create_or_find_memory.sh +156 -24
  111. package/dist/terraform/modules/app/agentcore-pi/README.md +1 -3
  112. package/dist/terraform/modules/app/agentcore-pi/main.tf +42 -52
  113. package/dist/terraform/modules/app/agentcore-pi/outputs.tf +3 -3
  114. package/dist/terraform/modules/app/agentcore-pi/scripts/reconcile_pi_runtime.mjs +175 -0
  115. package/dist/terraform/modules/app/agentcore-pi/variables.tf +35 -28
  116. package/dist/terraform/modules/app/agentcore-platform/main.tf +68 -0
  117. package/dist/terraform/modules/app/agentcore-runtime/main.tf +4 -20
  118. package/dist/terraform/modules/app/capability-broker/main.tf +2 -2
  119. package/dist/terraform/modules/app/capability-broker/variables.tf +11 -0
  120. package/dist/terraform/modules/app/deployment-control-plane/README.md +264 -0
  121. package/dist/terraform/modules/app/deployment-control-plane/buildspec.yml +4 -1
  122. package/dist/terraform/modules/app/deployment-control-plane/main.tf +94 -0
  123. package/dist/terraform/modules/app/deployment-control-plane/outputs.tf +5 -0
  124. package/dist/terraform/modules/app/deployment-control-plane/runner.py +2641 -124
  125. package/dist/terraform/modules/app/deployment-control-plane/test_runner_bundle.py +2034 -154
  126. package/dist/terraform/modules/app/deployment-control-plane/variables.tf +33 -0
  127. package/dist/terraform/modules/app/lambda-api/auth-state.tf +72 -0
  128. package/dist/terraform/modules/app/lambda-api/chat-latency-observability.tf +466 -0
  129. package/dist/terraform/modules/app/lambda-api/dispatch-dlq.tf +55 -0
  130. package/dist/terraform/modules/app/lambda-api/handlers.tf +411 -723
  131. package/dist/terraform/modules/app/lambda-api/iam-grouped.tf +262 -198
  132. package/dist/terraform/modules/app/lambda-api/main.tf +51 -13
  133. package/dist/terraform/modules/app/lambda-api/mcp-oauth.tf +4 -181
  134. package/dist/terraform/modules/app/lambda-api/memory-alarms.tf +3 -28
  135. package/dist/terraform/modules/app/lambda-api/oauth-secrets.tf +1 -2
  136. package/dist/terraform/modules/app/lambda-api/outputs.tf +17 -45
  137. package/dist/terraform/modules/app/lambda-api/turn-assertion.tf +45 -0
  138. package/dist/terraform/modules/app/lambda-api/variables.tf +219 -126
  139. package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/README.md +1 -1
  140. package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/main.tf +18 -18
  141. package/dist/terraform/modules/app/sandbox-log-scrubber/README.md +11 -10
  142. package/dist/terraform/modules/app/sandbox-log-scrubber/main.tf +5 -5
  143. package/dist/terraform/modules/app/static-site/main.tf +1 -1
  144. package/dist/terraform/modules/app/www-dns/main.tf +9 -27
  145. package/dist/terraform/modules/app/www-dns/variables.tf +4 -10
  146. package/dist/terraform/modules/data/aurora-postgres/README.md +34 -0
  147. package/dist/terraform/modules/data/aurora-postgres/alarms.tf +82 -0
  148. package/dist/terraform/modules/data/aurora-postgres/main.tf +27 -57
  149. package/dist/terraform/modules/data/aurora-postgres/outputs.tf +0 -9
  150. package/dist/terraform/modules/data/aurora-postgres/variables.tf +41 -0
  151. package/dist/terraform/modules/data/s3-buckets/main.tf +5 -6
  152. package/dist/terraform/modules/foundation/cognito/main.tf +81 -8
  153. package/dist/terraform/modules/foundation/cognito/outputs.tf +5 -0
  154. package/dist/terraform/modules/foundation/cognito/variables.tf +24 -12
  155. package/dist/terraform/modules/thinkwork/README.md +5 -1
  156. package/dist/terraform/modules/thinkwork/main.tf +376 -374
  157. package/dist/terraform/modules/thinkwork/outputs.tf +12 -158
  158. package/dist/terraform/modules/thinkwork/variables.tf +246 -89
  159. package/dist/workspace-defaults/files/INSTRUCTIONS.md +9 -11
  160. package/dist/workspace-defaults/files/MEMORY_GUIDE.md +38 -35
  161. package/dist/workspace-defaults/files/ROUTER.md +1 -1
  162. package/dist/workspace-defaults/files/TOOLS.md +9 -39
  163. package/dist/workspace-defaults/files/agents/analyst/INSTRUCTIONS.md +6 -3
  164. package/dist/workspace-defaults/files/catalog-skills/brain-brief-builder/SKILL.md +165 -0
  165. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/SKILL.md +75 -0
  166. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/mcp-tooling.md +40 -0
  167. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/validation-and-handoff.md +40 -0
  168. package/dist/workspace-defaults/files/catalog-skills/n8n-workflow-operator/references/workflow-authoring.md +46 -0
  169. package/dist/workspace-defaults/files/skills/artifact-builder/references/crm-dashboard.md +1 -1
  170. package/dist/workspace-defaults/files/skills/document-composer/SKILL.md +22 -3
  171. package/package.json +1 -1
  172. package/dist/drizzle/0261_managed_harness_multiplayer.sql +0 -313
  173. package/dist/drizzle/0262_parallel_harness_threads.sql +0 -9
  174. package/dist/drizzle/0264_harness_tool_execution_ledger.sql +0 -113
  175. package/dist/plugins/company-data/README.md +0 -49
  176. package/dist/plugins/company-data/package.json +0 -21
  177. package/dist/plugins/company-data/src/index.ts +0 -30
  178. package/dist/plugins/company-data/src/manifest.ts +0 -26
  179. package/dist/plugins/company-data/test/manifest.test.ts +0 -116
  180. package/dist/plugins/company-data/tsconfig.json +0 -8
  181. package/dist/plugins/company-etl/README.md +0 -46
  182. package/dist/plugins/company-etl/package.json +0 -21
  183. package/dist/plugins/company-etl/src/index.ts +0 -29
  184. package/dist/plugins/company-etl/src/manifest.ts +0 -26
  185. package/dist/plugins/company-etl/test/manifest.test.ts +0 -108
  186. package/dist/plugins/company-etl/tsconfig.json +0 -8
  187. package/dist/plugins/lastmile/README.md +0 -50
  188. package/dist/plugins/lastmile/package.json +0 -23
  189. package/dist/plugins/lastmile/smoke/lastmile-plugin-smoke.mjs +0 -661
  190. package/dist/plugins/lastmile/src/api/tasks-adapter.ts +0 -572
  191. package/dist/plugins/lastmile/src/discovery.fixture.ts +0 -64
  192. package/dist/plugins/lastmile/src/index.ts +0 -46
  193. package/dist/plugins/lastmile/src/manifest.ts +0 -139
  194. package/dist/plugins/lastmile/test/api/tasks-adapter.test.ts +0 -266
  195. package/dist/plugins/lastmile/test/discovery.test.ts +0 -88
  196. package/dist/plugins/lastmile/tsconfig.json +0 -8
  197. package/dist/plugins/n8n/smoke/n8n-managed-app-smoke.mjs +0 -409
  198. package/dist/plugins/twenty/smoke/twenty-managed-app-smoke.mjs +0 -359
  199. package/dist/terraform/modules/app/agentcore-code-interpreter/Dockerfile.sandbox-base +0 -61
  200. package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/sitecustomize.py +0 -227
  201. package/dist/terraform/modules/app/agentcore-code-interpreter/sandbox/test_sitecustomize.py +0 -277
  202. package/dist/terraform/modules/app/agentcore-code-interpreter/scripts/build_and_push_sandbox_base.sh +0 -70
  203. package/dist/terraform/modules/app/agentcore-gateway/main.tf +0 -305
  204. package/dist/terraform/modules/app/agentcore-gateway/outputs.tf +0 -44
  205. package/dist/terraform/modules/app/agentcore-gateway/scripts/delete_gateway.sh +0 -93
  206. package/dist/terraform/modules/app/agentcore-gateway/scripts/read_gateway.sh +0 -33
  207. package/dist/terraform/modules/app/agentcore-gateway/scripts/reconcile_gateway.sh +0 -543
  208. package/dist/terraform/modules/app/agentcore-gateway/variables.tf +0 -70
  209. package/dist/terraform/modules/app/agentcore-harness/main.tf +0 -330
  210. package/dist/terraform/modules/app/agentcore-harness/outputs.tf +0 -72
  211. package/dist/terraform/modules/app/agentcore-harness/scripts/delete_harness.sh +0 -5
  212. package/dist/terraform/modules/app/agentcore-harness/scripts/harness-lifecycle.mjs +0 -430
  213. package/dist/terraform/modules/app/agentcore-harness/scripts/harness-readback.mjs +0 -180
  214. package/dist/terraform/modules/app/agentcore-harness/scripts/harness-tool-contract.mjs +0 -193
  215. package/dist/terraform/modules/app/agentcore-harness/scripts/prune_harness.sh +0 -5
  216. package/dist/terraform/modules/app/agentcore-harness/scripts/read_harness.sh +0 -5
  217. package/dist/terraform/modules/app/agentcore-harness/scripts/reconcile_harness.sh +0 -5
  218. package/dist/terraform/modules/app/agentcore-harness/variables.tf +0 -96
  219. package/dist/terraform/modules/app/hindsight-memory/README.md +0 -89
  220. package/dist/terraform/modules/app/hindsight-memory/main.tf +0 -411
  221. package/dist/terraform/modules/app/lambda-api/agentcore-harness-alarms.tf +0 -88
  222. package/dist/terraform/modules/app/lambda-api/agentcore-identity-alarms.tf +0 -91
  223. package/dist/terraform/modules/data/bedrock-knowledge-base/main.tf +0 -102
  224. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/outputs.tf +0 -0
  225. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/sync-database.py +0 -0
  226. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/scripts/test_sync_database.py +0 -0
  227. /package/dist/{plugins/n8n/terraform → terraform/modules/app}/n8n/variables.tf +0 -0
  228. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/README.md +0 -0
  229. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/main.tf +0 -0
  230. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/outputs.tf +0 -0
  231. /package/dist/{plugins/twenty/terraform → terraform/modules/app}/twenty/variables.tf +0 -0
@@ -116,6 +116,24 @@ variable "plugin_catalog_github_token_secret_arn" {
116
116
  default = ""
117
117
  }
118
118
 
119
+ variable "brain_m2m_platform_agent_secret_arn" {
120
+ description = "Optional Secrets Manager ARN of the Company Brain platform-agent machine-lane secret (Cognito client-credentials blob, THINK-628). When set, the shared API Lambda role may read it so MCP config build can mint short-lived bearers for the Brain connector. Empty leaves the tkt_ lane untouched."
121
+ type = string
122
+ default = ""
123
+ }
124
+
125
+ variable "brain_ops_api_url" {
126
+ description = "Optional Company Brain ops-api base URL (the API Gateway endpoint the Brain console uses, e.g. https://xxxx.execute-api.us-east-1.amazonaws.com). When set alongside brain_ops_m2m_secret_arn, the flagThreadToBrain mutation can POST /flags (THINK-781). Empty disables the Send-to-the-Brain action."
127
+ type = string
128
+ default = ""
129
+ }
130
+
131
+ variable "brain_ops_m2m_secret_arn" {
132
+ description = "Optional Secrets Manager ARN of the Brain agent-identity m2m secret (Cognito client-credentials blob for the ops-api operator pool, scope etl-agent/tasks — e.g. etl-platform/agent/cognito-m2m-brain). When set, the shared API Lambda role may read it so flagThreadToBrain can mint bearers for POST /flags (THINK-781)."
133
+ type = string
134
+ default = ""
135
+ }
136
+
119
137
  variable "brain_artifacts_kms_key_arn" {
120
138
  description = "Optional KMS key ARN used to encrypt canonical ThinkWork Brain artifacts. AES256 encryption is used when unset."
121
139
  type = string
@@ -148,6 +166,12 @@ variable "mobile_client_id" {
148
166
  type = string
149
167
  }
150
168
 
169
+ variable "console_client_id" {
170
+ description = "Optional Company Brain console client ID (U13). Empty when the console client is disabled — kept out of COGNITO_APP_CLIENT_IDS via compact()."
171
+ type = string
172
+ default = ""
173
+ }
174
+
151
175
  variable "cognito_auth_domain" {
152
176
  description = "Cognito hosted UI domain prefix, e.g. thinkwork-dev. Empty disables MCP OAuth login."
153
177
  type = string
@@ -164,11 +188,6 @@ variable "appsync_api_id" {
164
188
  type = string
165
189
  }
166
190
 
167
- variable "kb_service_role_arn" {
168
- description = "Bedrock Knowledge Base service role ARN"
169
- type = string
170
- }
171
-
172
191
  variable "agentcore_harness_execution_role_arn" {
173
192
  description = "Legacy Harness execution-role input retained for module compatibility. Request-path PassRole/control-plane grants were removed by THINK-316 U2."
174
193
  type = string
@@ -208,9 +227,14 @@ variable "agentcore_turn_assertion_active_key_version" {
208
227
  type = string
209
228
  default = "v1"
210
229
 
230
+ # Membership in agentcore_turn_assertion_key_versions is enforced by a
231
+ # precondition on aws_kms_key.agentcore_turn_assertion — variable validations
232
+ # cannot reference other variables until Terraform 1.9, and this module
233
+ # supports the repo floor of Terraform 1.5 (the customer deployment runner
234
+ # pins 1.8.5).
211
235
  validation {
212
- condition = contains(var.agentcore_turn_assertion_key_versions, var.agentcore_turn_assertion_active_key_version)
213
- error_message = "agentcore_turn_assertion_active_key_version must be present in agentcore_turn_assertion_key_versions."
236
+ condition = can(regex("^[a-z0-9][a-z0-9-]{0,15}$", var.agentcore_turn_assertion_active_key_version))
237
+ error_message = "agentcore_turn_assertion_active_key_version must be a lowercase version label."
214
238
  }
215
239
  }
216
240
 
@@ -332,78 +356,44 @@ variable "extension_proxy_signing_secret" {
332
356
  default = ""
333
357
  }
334
358
 
335
- variable "hindsight_endpoint" {
336
- description = "Hindsight API endpoint (empty when enable_hindsight = false)"
337
- type = string
338
- default = ""
339
- }
340
-
341
- variable "hindsight_database_name" {
342
- description = "Dedicated Hindsight database name (THINK-220 cutover flag). Empty = Hindsight tables live in the `hindsight` schema of the primary database; set = the api reads them from this database's `public` schema. Rides the SSM runtime-config document (getConfig), not Lambda env."
343
- type = string
344
- default = ""
345
- }
346
-
347
359
  variable "agentcore_memory_id" {
348
360
  description = "Bedrock AgentCore Memory resource ID — used by the GraphQL memory resolvers to list records across tenant agents."
349
361
  type = string
350
362
  default = ""
351
363
  }
352
364
 
353
- variable "memory_engine" {
354
- description = "Active long-term memory engine for this deployment. Exactly one engine is canonical for recall/inspect/export."
355
- type = string
356
- default = "hindsight"
357
- validation {
358
- condition = contains(["hindsight", "agentcore"], var.memory_engine)
359
- error_message = "memory_engine must be 'hindsight' or 'agentcore'."
360
- }
361
- }
362
-
363
- variable "analyst_egress_subnet_ids" {
364
- description = "Private (NAT-routed) subnet IDs for VPC-attaching the analyst data-path handlers (graphql-http, analyst-query-broker, analyst-connection-reconciler) so external Postgres sources can allowlist the stack's stable NAT egress IP. Leave empty to keep the handlers outside any VPC."
365
- type = list(string)
366
- default = []
367
- }
368
-
369
- variable "analyst_egress_security_group_ids" {
370
- description = "Security group IDs for the VPC-attached analyst data-path handlers. Leave empty to keep the handlers outside any VPC."
371
- type = list(string)
372
- default = []
373
- }
374
-
375
365
  variable "okf_efs_subnet_ids" {
376
- description = "Subnet IDs for the OKF EFS hydrator Lambda VPC attachment. Leave empty to deploy the hydrator without an EFS mount."
366
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
377
367
  type = list(string)
378
368
  default = []
379
369
  }
380
370
 
381
371
  variable "okf_efs_security_group_ids" {
382
- description = "Security group IDs for the OKF EFS hydrator Lambda VPC attachment. Leave empty to deploy the hydrator without an EFS mount."
372
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
383
373
  type = list(string)
384
374
  default = []
385
375
  }
386
376
 
387
377
  variable "okf_efs_mount_target_ids" {
388
- description = "EFS mount target IDs that must exist before creating the OKF EFS hydrator Lambda."
378
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
389
379
  type = list(string)
390
380
  default = []
391
381
  }
392
382
 
393
383
  variable "okf_efs_file_system_arn" {
394
- description = "EFS file system ARN for the OKF wiki current view. Empty disables EFS IAM grants."
384
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
395
385
  type = string
396
386
  default = ""
397
387
  }
398
388
 
399
389
  variable "okf_efs_refresh_access_point_arn" {
400
- description = "EFS access point ARN mounted by the okf-efs-refresh Lambda. Empty disables the mount."
390
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
401
391
  type = string
402
392
  default = ""
403
393
  }
404
394
 
405
395
  variable "okf_efs_mount_path" {
406
- description = "Local Lambda mount path for the OKF wiki EFS view. Must be under /mnt."
396
+ description = "DEPRECATED (THINK-589): no-op, removal pending. The OKF wiki EFS feature (okf-efs-refresh hydrator mount) is dead and this module no longer consumes the input. Declaration retained so existing passthroughs keep working until the follow-up PR deletes it."
407
397
  type = string
408
398
  default = "/mnt/thinkwork-okf"
409
399
  }
@@ -498,12 +488,6 @@ variable "admin_url" {
498
488
  default = ""
499
489
  }
500
490
 
501
- variable "docs_url" {
502
- description = "Docs site URL (e.g. https://d2grg1uavrp7lx.cloudfront.net)"
503
- type = string
504
- default = ""
505
- }
506
-
507
491
  variable "www_url" {
508
492
  description = "Marketing site URL (e.g. https://thinkwork.ai). Used for Stripe Checkout cancel_url and CORS origin."
509
493
  type = string
@@ -576,24 +560,12 @@ variable "job_scheduler_role_arn" {
576
560
  default = ""
577
561
  }
578
562
 
579
- variable "wiki_compile_model_id" {
580
- description = "Bedrock model id the wiki-compile Lambda uses for the leaf planner, aggregation planner, and section writer. Any Converse-compatible model works. Override per-env if you want to spike a different model without re-deploying code."
581
- type = string
582
- default = "openai.gpt-oss-120b-1:0"
583
- }
584
-
585
563
  variable "brain_source_agent_model_id" {
586
564
  description = "Bedrock model id the GraphQL context-engine Brain source-agent runtime uses for JSON tool/action turns. Kept separate from the high-throughput wiki compiler model so source agents can use a model tuned for reliable action JSON."
587
565
  type = string
588
566
  default = "us.anthropic.claude-haiku-4-5-20251001-v1:0"
589
567
  }
590
568
 
591
- variable "kg_obs_max_candidates_per_run" {
592
- description = "Per-run candidate cap for the observations → Knowledge Graph ingest worker (KG_OBS_MAX_CANDIDATES_PER_RUN). Bounds the layered-gate classifier cost and lets truncated runs self-invoke to drain the remaining backlog. Stored as a string because the Lambda reads it verbatim from env."
593
- type = string
594
- default = "10"
595
- }
596
-
597
569
  variable "wiki_aggregation_pass_enabled" {
598
570
  description = "Feature flag for the wiki aggregation pass (parent section rollups + section promotion). Pipeline stops after leaf compile when this is off and never populates hub rollups. Stored as a string because the Lambda reads it verbatim from env; must be 'true' / '1' / 'yes' to enable."
599
571
  type = string
@@ -606,26 +578,14 @@ variable "wiki_deterministic_linking_enabled" {
606
578
  default = "true"
607
579
  }
608
580
 
609
- variable "kg_extraction_model_id" {
610
- description = "Bedrock model id for knowledge-graph entity/relationship extraction from observations (plan 2026-07-03-005). Defaults to a gpt-oss high-quota model; overridable per stage."
611
- type = string
612
- default = "openai.gpt-oss-120b-1:0"
613
- }
614
-
615
- variable "knowledge_graph_observations_ingest_enabled" {
616
- description = "Enable the recurring Brain distillation schedule (Hindsight observations -> knowledge graph). Ships disabled; dev flips on after a golden-set-validated manual run (plan 2026-07-03-005 U4)."
617
- type = bool
618
- default = false
619
- }
620
-
621
- variable "ontology_scan_sweep_enabled" {
622
- description = "Enable the recurring per-tenant ontology suggestion scan sweep (THINK-320 U4/KTD-3). Ships disabled; enabled per stage once the Living Map review surfaces land."
581
+ variable "identity_drift_match_enabled" {
582
+ description = "Enable the recurring per-tenant identity drift match sweep (THINK-321 U7/KTD-7 — R10). Ships disabled; enabled per stage once bootstrap matching has been proven there."
623
583
  type = bool
624
584
  default = false
625
585
  }
626
586
 
627
587
  variable "wiki_source" {
628
- description = "Wiki pipeline source dispatch (plan 2026-06-09-004 U10). 'planner' (default) runs the original LLM compile path; 'graph' runs the deterministic graph→wiki materializer over the knowledge-graph mirror and makes successful observation-ingest runs the compile trigger. Variable-ized (not hardcoded) per the wiki-compile env precedent so unrelated deploys don't reset the flag; the Lambda reads it verbatim from env and treats any value other than 'graph' as 'planner'."
588
+ description = "Wiki pipeline source dispatch (plan 2026-06-09-004 U10). 'planner' (default) runs the original LLM compile path; 'graph' runs the deterministic graph→wiki materializer. Variable-ized (not hardcoded) per the wiki-compile env precedent so unrelated deploys don't reset the flag; the Lambda reads it verbatim from env and treats any value other than 'graph' as 'planner'."
629
589
  type = string
630
590
  default = "planner"
631
591
 
@@ -635,12 +595,6 @@ variable "wiki_source" {
635
595
  }
636
596
  }
637
597
 
638
- variable "google_places_api_key" {
639
- description = "Google Places API (New) key used by wiki-compile for POI → city/state/country hierarchy enrichment. Stored as a SecureString SSM parameter at /thinkwork/<stage>/google-places/api-key. Empty default creates the parameter with a placeholder value; operator populates via `aws ssm put-parameter --overwrite`. The parameter's value has lifecycle.ignore_changes set so CLI rotation sticks across terraform applies. Compile gracefully degrades when the key is absent (metadata-only place rows) — never fails compile."
640
- type = string
641
- default = ""
642
- sensitive = true
643
- }
644
598
 
645
599
  # ---------------------------------------------------------------------------
646
600
  # Per-user OAuth client credentials
@@ -851,8 +805,19 @@ variable "compliance_exports_runner_role_name" {
851
805
  default = ""
852
806
  }
853
807
 
854
- variable "knowledge_graph_tool_enabled" {
855
- description = "Stage gate for the Pi knowledge_graph_search tool (plan 2026-06-09-004 U8). Per-agent tool policy gates on top."
808
+ variable "agentcore_session_scope" {
809
+ description = "THINK-909/THINK-946 AgentCore runtime session scope for agentcore-runtime-dispatch. \"thread\" (default) keys the session per thread; \"user\" keys it per (tenant, agent, user) so a new thread reuses the user's warm microVM — and, per THINK-946, its retained MCP connections and toolset — falling back to the per-thread session on a 409. Set \"user\" only after the stage's Pi runtime image dual-accepts both session ids. mcpherson runs \"user\"; every other stage keeps the default."
810
+ type = string
811
+ default = "thread"
812
+
813
+ validation {
814
+ condition = contains(["thread", "user"], var.agentcore_session_scope)
815
+ error_message = "agentcore_session_scope must be \"thread\" or \"user\"."
816
+ }
817
+ }
818
+
819
+ variable "identity_resolution_tool_enabled" {
820
+ description = "Stage gate for the Pi identity-resolution tools (resolve_entities / propose_mapping_candidates / confirm_mapping, THINK-321 U5). Per-agent tool policy gates on top."
856
821
  type = bool
857
822
  default = true
858
823
  }
@@ -893,44 +858,6 @@ variable "subscription_ticket_private_key_secret" {
893
858
  default = ""
894
859
  }
895
860
 
896
- # ---------------------------------------------------------------------------
897
- # THINK-228 U3 — analyst query broker runtime config
898
- # ---------------------------------------------------------------------------
899
-
900
- variable "analyst_reader_secret_arn" {
901
- description = "ARN of the Secrets Manager secret holding the `analyst_reader` Aurora role credentials (THINK-228 U2). Wired from `module.database.analyst_reader_secret_arn`. The analyst-query-broker Lambda executes model-authored SQL exclusively under this role."
902
- type = string
903
- default = ""
904
- }
905
-
906
- variable "analyst_broker_secret_arn" {
907
- description = "ARN of the Secrets Manager secret holding the analyst query-broker caller credential (JSON {token, tenantId}; THINK-228 U3). Wired from `module.database.analyst_broker_secret_arn`. The broker validates incoming Bearer tokens against it; the seeded connector row references it as auth_config.secretRef."
908
- type = string
909
- default = ""
910
- }
911
-
912
- variable "analyst_policy_source" {
913
- description = "THINK-229 KTD5 enforcement flip: 'row' (default — sidecar policy is shadow-only) or 'sidecar' (the signed sidecar policy block is authoritative: budgets + retain_sql flow into dispatch and the broker). Flip only after clean analyst-policy-shadow parity on live traffic AND a provision refresh so every connection sidecar carries a policy block."
914
- type = string
915
- default = "row"
916
- validation {
917
- condition = contains(["row", "sidecar"], var.analyst_policy_source)
918
- error_message = "analyst_policy_source must be 'row' or 'sidecar'."
919
- }
920
- }
921
-
922
- variable "capability_self_extension_tenants" {
923
- description = "Governed autonomy opt-in: comma/space-separated tenant ids allowed to autonomously self-extend capabilities (self_admit_connection / self_approve_routine). Empty (default) = NO tenant enabled; self-extension ships inert and fail-closed. Read via getConfig() in capability-control-service."
924
- type = string
925
- default = ""
926
- }
927
-
928
- variable "analyst_db_cluster_resource_id" {
929
- description = "Immutable RDS cluster resource ID (cluster-XXXX / db-XXXX) for the stage database (THINK-229 U1). Wired from `module.database.cluster_resource_id`. Keys the broker's `rds-db:connect` IAM grant — the rds-db ARN format requires the resource ID, not the cluster ARN — and gates the IAM connect env on the broker Lambda: when empty, the broker stays on the password path."
930
- type = string
931
- default = ""
932
- }
933
-
934
861
  variable "artifact_delivery_from_email" {
935
862
  description = "Default SES from-address for artifact email delivery. Empty keeps the code fallback (noreply@agents.thinkwork.ai — only verified in the ThinkWork dev account, so customer stages MUST set this)."
936
863
  type = string
@@ -986,3 +913,169 @@ variable "capability_broker_vpce_dns" {
986
913
  type = string
987
914
  default = ""
988
915
  }
916
+
917
+ # ---------------------------------------------------------------------------
918
+ # Company Brain twin (plan 2026-07-21-001 U5): Neptune wiring for the
919
+ # identity-graph-projector. All default-empty — the projector deploys inert
920
+ # (no VPC, no endpoint) until the stage's neptune outputs are supplied.
921
+ # ---------------------------------------------------------------------------
922
+
923
+ variable "neptune_endpoint" {
924
+ type = string
925
+ default = ""
926
+ description = "Neptune twin cluster writer endpoint (from the etl-platform neptune stack; empty = twin disabled)"
927
+ }
928
+
929
+ variable "brain_mcp_url" {
930
+ type = string
931
+ default = ""
932
+ description = "Platform-served Brain MCP endpoint (e.g. https://mcp.brain.thinkwork.ai/mcp). When set, twin-connector provisioning registers agents against it instead of the product /mcp/twin route (consolidation U14). Empty = legacy product-served default."
933
+ }
934
+
935
+ variable "neptune_cluster_resource_id" {
936
+ type = string
937
+ default = ""
938
+ description = "Neptune cluster resource id for neptune-db IAM ARNs (empty = no data-access grant)"
939
+ }
940
+
941
+ variable "neptune_subnet_ids" {
942
+ type = list(string)
943
+ default = []
944
+ description = "Private subnets for the identity-graph-projector's vpc_config (Neptune is VPC-only)"
945
+ }
946
+
947
+ variable "neptune_security_group_ids" {
948
+ type = list(string)
949
+ default = []
950
+ description = "SGs for the projector (the etl neptune stack's neptune-client SG)"
951
+ }
952
+
953
+ # ---------------------------------------------------------------------------
954
+ # THINK-1082: every handler inside the VPC. Each handler carries DATABASE_URL
955
+ # (common_env) and, with no vpc_config, reaches Aurora only over the cluster's
956
+ # PUBLIC endpoint through the world-open 0.0.0.0/0 -> 5432 rule the
957
+ # aurora-postgres module seeds. Revoking that rule took the whole app down
958
+ # (auth-me -> DB timeout -> 401 "No tenant assigned"). With lambdas_in_vpc the
959
+ # functions attach to the VPC's private subnets behind a security group the
960
+ # database security group admits, so the public rule can be closed. All
961
+ # default-off — the module deploys byte-identical until the caller opts in.
962
+ # ---------------------------------------------------------------------------
963
+
964
+ variable "lambdas_in_vpc" {
965
+ type = bool
966
+ default = false
967
+ description = "Attach every DB-connected Lambda in this module (all api handlers, compliance-anchor, compliance-export-runner) to the VPC via vpc_subnet_ids + vpc_security_group_ids so Aurora is reached by security group instead of the public endpoint. The subnets must be NAT-routed (handlers call AWS APIs, Bedrock, Slack, GitHub, ...). Requires non-empty vpc_subnet_ids and vpc_security_group_ids."
968
+ }
969
+
970
+ variable "vpc_subnet_ids" {
971
+ type = list(string)
972
+ default = []
973
+ description = "Private (NAT-routed) subnet IDs the handlers attach to when lambdas_in_vpc is true."
974
+ }
975
+
976
+ variable "vpc_security_group_ids" {
977
+ type = list(string)
978
+ default = []
979
+ description = "Security groups for the handlers when lambdas_in_vpc is true (the thinkwork module passes its api-lambda SG, which the database SG admits on tcp/5432). Merged with neptune_security_group_ids on the identity-graph-projector."
980
+ }
981
+
982
+ # Bulk-rebuild lane (THINK-331 U4): Neptune bulk-loader staging. Both
983
+ # default-empty — bulk-rebuild returns a structured "not configured" error
984
+ # until the etl-platform neptune stack's load bucket + loader role are
985
+ # supplied.
986
+
987
+ variable "neptune_load_bucket" {
988
+ type = string
989
+ default = ""
990
+ description = "Neptune bulk-load staging bucket name (etl-platform neptune stack; empty = bulk-rebuild disabled)"
991
+ }
992
+
993
+ variable "neptune_loader_role_arn" {
994
+ type = string
995
+ default = ""
996
+ description = "IAM role ARN the Neptune cluster assumes to read the load bucket (etl-platform neptune stack; empty = bulk-rebuild disabled)"
997
+ }
998
+
999
+ variable "lambda_max_memory_mb" {
1000
+ type = number
1001
+ default = 10240
1002
+ description = "Account-level Lambda memory ceiling. Legacy AWS accounts cap function memory at 3008 MB (raised only via support case); handlers that request more are clamped to this value so deploys on capped accounts don't fail mid-apply."
1003
+ }
1004
+
1005
+ # THINK-583 U3 — provisioned concurrency for the two chat-critical zip
1006
+ # Lambdas (chat-agent-invoke, workspace-renderer) ONLY (KTD5: never the Pi
1007
+ # Lambda). 0 (the default) disables the provisioned-concurrency config but
1008
+ # STILL creates the published version + `live` alias, so alias-qualified
1009
+ # invokers keep working on every stage; customer stages opt in on their own
1010
+ # release cadence. Dev is enabled via scripts/deploy/terraform-vars.sh
1011
+ # (deploy.yml is dev-only — same pattern as enable_capability_broker).
1012
+
1013
+ variable "chat_agent_invoke_provisioned_concurrency" {
1014
+ type = number
1015
+ default = 0
1016
+ description = "Provisioned concurrency on chat-agent-invoke's `live` alias. 0 = disabled (alias still exists)."
1017
+ }
1018
+
1019
+ variable "workspace_renderer_provisioned_concurrency" {
1020
+ type = number
1021
+ default = 0
1022
+ description = "Provisioned concurrency on workspace-renderer's `live` alias. 0 = disabled (alias still exists)."
1023
+ }
1024
+
1025
+ variable "agentcore_runtime_dispatch_enabled" {
1026
+ description = "THINK-585 U6 (KTD3): stage kill-switch for chat dispatch through the Bedrock AgentCore Runtime (per-thread sessions). The per-agent agents.agentcore_runtime_dispatch flag gates on top. Default off; dev opts in via the deploy workflow, customer stages via runner-secrets on their own cadence."
1027
+ type = bool
1028
+ default = false
1029
+ }
1030
+
1031
+ variable "auth_state_store" {
1032
+ description = "THINK-643: backing store for short-lived auth-flow state (AppSync subscription tickets + the per-principal connect rate-limit counter). \"postgres\" (default) keeps the Aurora `auth_subscription_tickets` path. \"dynamo\" provisions thinkwork-<stage>-auth-state and points the auth handlers at it; the authorizer still falls back to a Postgres read for tickets minted just before the flip."
1033
+ type = string
1034
+ default = "postgres"
1035
+
1036
+ validation {
1037
+ condition = contains(["postgres", "dynamo"], var.auth_state_store)
1038
+ error_message = "auth_state_store must be \"postgres\" or \"dynamo\"."
1039
+ }
1040
+ }
1041
+
1042
+ ################################################################################
1043
+ # THINK-915 — chat turn-latency observability
1044
+ # (see chat-latency-observability.tf for the constraints behind each of these)
1045
+ ################################################################################
1046
+
1047
+ variable "enable_chat_turn_latency_observability" {
1048
+ description = "THINK-915: create the per-stage chat turn-latency dashboard, the saved thinkwork-<stage>-turn-timeline Logs Insights query, and the Lambda-native dispatch p95 alarm. On by default — none of these depend on a log group already existing."
1049
+ type = bool
1050
+ default = true
1051
+ }
1052
+
1053
+ variable "enable_chat_turn_latency_metric_filters" {
1054
+ description = "THINK-915: create the agentcore_phase log metric filters (TurnRuntimeInvokeMs, AgentLoopMs) and the metric-filter-backed p95 alarm. OFF by default: the Lambda log groups are created implicitly on first invocation and are not Terraform-managed, so PutMetricFilter fails with ResourceNotFoundException on a greenfield stage (see memory-alarms.tf). Turn on for a stage that has already served chat traffic."
1055
+ type = bool
1056
+ default = false
1057
+ }
1058
+
1059
+ variable "chat_turn_latency_metric_namespace" {
1060
+ description = "THINK-915: CloudWatch namespace prefix for the chat phase metrics. The stage is appended (Thinkwork/Chat/<stage>) because metric-filter dimensions may only reference JSON fields of the matched log event, and the agentcore_phase record carries no stage field."
1061
+ type = string
1062
+ default = "Thinkwork/Chat"
1063
+ }
1064
+
1065
+ variable "chat_turn_runtime_log_group_name" {
1066
+ description = "THINK-915: explicit AgentCore Pi runtime log group (/aws/bedrock-agentcore/runtimes/thinkwork_<stage>_pi-<runtimeId>-DEFAULT). Empty (default) skips the runtime-sourced metric, widgets, and query leg — plan-time prefix discovery was removed because it defers to apply in customer deployment-runner plans and breaks them."
1067
+ type = string
1068
+ default = ""
1069
+ }
1070
+
1071
+ variable "chat_turn_p95_alarm_threshold_ms" {
1072
+ description = "THINK-915: p95 threshold (ms) for the whole AgentCore runtime call, breaching on 2 of 3 five-minute periods."
1073
+ type = number
1074
+ default = 30000
1075
+ }
1076
+
1077
+ variable "chat_turn_latency_alarm_actions" {
1078
+ description = "THINK-915: SNS topic ARNs notified by the chat turn-latency alarms (also used as OK actions). Empty by default — the only topic in this module is the cost-alert channel, and latency pages do not belong there."
1079
+ type = list(string)
1080
+ default = []
1081
+ }
@@ -89,7 +89,7 @@ packages.
89
89
 
90
90
  ```hcl
91
91
  module "n8n" {
92
- source = "../../../plugins/n8n/terraform/n8n"
92
+ source = "../app/n8n"
93
93
 
94
94
  stage = var.stage
95
95
  vpc_id = module.vpc.vpc_id
@@ -292,24 +292,24 @@ resource "terraform_data" "database_lifecycle" {
292
292
 
293
293
  resource "terraform_data" "configuration_guardrails" {
294
294
  input = {
295
- runtime_enabled = var.runtime_enabled
296
- main_desired_count = var.main_desired_count
297
- worker_desired_count = var.worker_desired_count
298
- image_uri = var.image_uri
299
- public_url = var.public_url
300
- certificate_arn = var.certificate_arn
301
- database_host = var.database_host
302
- database_name = var.database_name
303
- database_username = var.database_username
304
- database_url_secret_arn = local.effective_database_url_secret_arn
305
- encryption_key_secret_arn = local.effective_encryption_key_secret_arn
306
- operator_secret_arn = local.effective_operator_secret_arn
307
- service_credential_secret_arn = local.effective_service_credential_secret_arn
308
- storage_bucket_name = var.storage_bucket_name
309
- storage_prefix = local.storage_prefix
310
- queue_mode = var.queue_mode
311
- cache_engine = var.cache_engine
312
- cache_subnet_ids = local.effective_cache_subnet_ids
295
+ runtime_enabled = var.runtime_enabled
296
+ main_desired_count = var.main_desired_count
297
+ worker_desired_count = var.worker_desired_count
298
+ image_uri = var.image_uri
299
+ public_url = var.public_url
300
+ certificate_arn = var.certificate_arn
301
+ database_host = var.database_host
302
+ database_name = var.database_name
303
+ database_username = var.database_username
304
+ database_url_secret_arn = local.effective_database_url_secret_arn
305
+ encryption_key_secret_arn = local.effective_encryption_key_secret_arn
306
+ operator_secret_arn = local.effective_operator_secret_arn
307
+ service_credential_secret_arn = local.effective_service_credential_secret_arn
308
+ storage_bucket_name = var.storage_bucket_name
309
+ storage_prefix = local.storage_prefix
310
+ queue_mode = var.queue_mode
311
+ cache_engine = var.cache_engine
312
+ cache_subnet_ids = local.effective_cache_subnet_ids
313
313
  }
314
314
 
315
315
  lifecycle {
@@ -5,17 +5,18 @@ redacts known-shape OAuth tokens in AgentCore `APPLICATION_LOGS` before they
5
5
  land in the long-term CloudWatch tier. See plan Unit 12 +
6
6
  `docs/brainstorms/2026-04-22-agentcore-code-sandbox-requirements.md` R13.
7
7
 
8
- ## Relationship to the primary scrubber
8
+ ## The only scrubbing layer (THINK-617)
9
9
 
10
- The primary layer is the base-image `sitecustomize.py` stdio wrapper shipped
11
- by [`terraform/modules/app/agentcore-code-interpreter`](../agentcore-code-interpreter/)
12
- (plan Unit 4). That layer redacts by **value** session-scoped token
13
- strings registered by the preamble — and can therefore catch any token the
14
- agent's own preamble has handled.
10
+ The plan's primary layer was a base-image `sitecustomize.py` stdio wrapper
11
+ redacting by **value** (plan Unit 4). It never ran: AgentCore Code Interpreter
12
+ has no custom-image parameter, so the blessed image was unattachable and the
13
+ [`agentcore-code-interpreter`](../agentcore-code-interpreter/) image substrate
14
+ has been retired. Sandboxes run the AWS-managed image, so this filter is the
15
+ only scrubbing in force.
15
16
 
16
- This backstop redacts by **pattern**: it has no access to session values,
17
- only to the bytes that reach CloudWatch. It exists to mitigate *stdio-bypass
18
- classes* named in R13's residual list:
17
+ It redacts by **pattern**: it has no access to session values, only to the
18
+ bytes that reach CloudWatch. It covers the _stdio-bypass_ classes named in
19
+ R13's residual list
19
20
 
20
21
  - `subprocess.run(['env'])`, `subprocess.run(['cat', '/proc/self/environ'])`
21
22
  - `os.write(fd, ...)` at the file-descriptor level
@@ -25,7 +26,7 @@ classes* named in R13's residual list:
25
26
  - Adversarial split-writes that fragment a token across more bytes than the
26
27
  rolling-buffer window
27
28
 
28
- When those bytes carry a token whose *shape* is recognizable, this backstop
29
+ When those bytes carry a token whose _shape_ is recognizable, this backstop
29
30
  catches it. When they don't (bespoke token formats, high-entropy opaque
30
31
  strings with no prefix), only the v2 in-process credential proxy can help.
31
32
 
@@ -5,11 +5,11 @@
5
5
  # (plan Unit 12). Pattern-redacts known-shape OAuth tokens in AgentCore
6
6
  # APPLICATION_LOGS before they land in the long-term CloudWatch tier.
7
7
  #
8
- # **This is not the primary R13 layer.** The primary layer is the base-image
9
- # sitecustomize.py stdio wrapper (plan Unit 4, terraform/modules/app/
10
- # agentcore-code-interpreter) which redacts by *value* using the session-
11
- # scoped token set. That layer can catch any token the preamble registered,
12
- # regardless of shape.
8
+ # **This is the only scrubbing layer that actually runs (THINK-617).** The plan
9
+ # called for a primary value-based layer in a blessed base image's
10
+ # sitecustomize.py (Unit 4), but AgentCore Code Interpreter has no custom-image
11
+ # parameter, so that image was never attachable and has been retired. Sandboxes
12
+ # run the AWS-managed image; only this pattern backstop is in force.
13
13
  #
14
14
  # This backstop redacts by *pattern* — Authorization: Bearer, JWTs, and
15
15
  # known OAuth prefixes (gh[opsru]_, xox[abep]-, ya29.). It does not have
@@ -55,7 +55,7 @@ variable "viewer_request_function_code" {
55
55
  # Response-headers policy (optional, plan-012 U3)
56
56
  #
57
57
  # Two opt-in forms, both backwards compatible — existing callers
58
- # (computer_site, docs_site, www_site) leave both unset and the
58
+ # (computer_site, www_site) leave both unset and the
59
59
  # distribution is created with no response-headers policy attached:
60
60
  #
61
61
  # - Pass `response_headers_policy_id` to attach an existing policy by id.