ecoportal-api-graphql 1.3.5 → 1.3.9

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 (499) hide show
  1. checksums.yaml +4 -4
  2. data/.ai-assistance/bridge/CLAUDE.md +338 -0
  3. data/.ai-assistance/bridge/archive/.gitkeep +0 -0
  4. data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.inbox.md +29 -0
  5. data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.outbox.md +18 -0
  6. data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.inbox.md +42 -0
  7. data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.outbox.md +115 -0
  8. data/.ai-assistance/bridge/context/gemini-review-prompt.txt +48 -0
  9. data/.ai-assistance/bridge/context/gemini-review-response.md +104 -0
  10. data/.ai-assistance/bridge/context/project.md +42 -0
  11. data/.ai-assistance/bridge/inbox/.gitkeep +0 -0
  12. data/.ai-assistance/bridge/outbox/.gitkeep +0 -0
  13. data/.ai-assistance/bridge/outbox/request-for-standards-discovery.md +48 -0
  14. data/.ai-assistance/bridge/queue/.gitkeep +1 -0
  15. data/.ai-assistance/capabilities/CLAUDE.md +27 -0
  16. data/.ai-assistance/capabilities/assumptions-log.md +80 -0
  17. data/.ai-assistance/capabilities/code.md +47 -0
  18. data/.ai-assistance/capabilities/connectors.md +37 -0
  19. data/.ai-assistance/capabilities/cowork.md +55 -0
  20. data/.ai-assistance/code/OVERVIEW.md +155 -0
  21. data/.ai-assistance/code/data_fields.md +242 -0
  22. data/.ai-assistance/code/dependencies.md +151 -0
  23. data/.ai-assistance/code/diff_as_input.md +234 -0
  24. data/.ai-assistance/code/diff_service_deep_dive.md +192 -0
  25. data/.ai-assistance/code/ecoPortal_architecture/00_overview_and_index.md +55 -0
  26. data/.ai-assistance/code/ecoPortal_architecture/01_terminology_dictionary.md +181 -0
  27. data/.ai-assistance/code/ecoPortal_architecture/02_data_model.md +192 -0
  28. data/.ai-assistance/code/ecoPortal_architecture/03_api_layers.md +147 -0
  29. data/.ai-assistance/code/ecoPortal_architecture/04_graphql_queries_mutations.md +277 -0
  30. data/.ai-assistance/code/ecoPortal_architecture/05_page_workflows.md +200 -0
  31. data/.ai-assistance/code/ecoPortal_architecture/06_search_and_filters.md +228 -0
  32. data/.ai-assistance/code/ecoPortal_architecture/07_data_fields.md +197 -0
  33. data/.ai-assistance/code/ecoPortal_architecture/08_stages_sections.md +243 -0
  34. data/.ai-assistance/code/ecoPortal_architecture/09_people_contractors_locations.md +196 -0
  35. data/.ai-assistance/code/ecoPortal_architecture/10_forces_workflow_builder.md +132 -0
  36. data/.ai-assistance/code/ecoPortal_architecture/11_integration_gems.md +187 -0
  37. data/.ai-assistance/code/ecoPortal_architecture/12_ai_documentation_sources_gaps.md +236 -0
  38. data/.ai-assistance/code/ecoPortal_architecture/13_ai_infrastructure.md +183 -0
  39. data/.ai-assistance/code/ecoportal_schema_reference.md +240 -0
  40. data/.ai-assistance/code/graphql_domain_knowledge.md +230 -0
  41. data/.ai-assistance/code/refactoring/datafield-readwrite-shape-asymmetry.md +71 -0
  42. data/.ai-assistance/code/refactoring/opportunities.md +251 -0
  43. data/.ai-assistance/code/schema_analysis.md +321 -0
  44. data/.ai-assistance/code/search_filters.md +868 -0
  45. data/.ai-assistance/code/spec_coverage.md +73 -0
  46. data/.ai-assistance/code/workflow-command-guide.md +438 -0
  47. data/.ai-assistance/code/workflow-space.md +353 -0
  48. data/.ai-assistance/conventions/CLAUDE.md +30 -0
  49. data/.ai-assistance/conventions/code-working-tree-protocol.md +199 -0
  50. data/.ai-assistance/conventions/gitignore-rules.md +42 -0
  51. data/.ai-assistance/conventions/permission-guidance.md +120 -0
  52. data/.ai-assistance/integrations/README.md +70 -0
  53. data/.ai-assistance/integrations/gitkraken-mcp.md +107 -0
  54. data/.ai-assistance/integrations/gitlab-mcp.md +123 -0
  55. data/.ai-assistance/integrations/local-git.md +60 -0
  56. data/.ai-assistance/local_paths.example.md +17 -0
  57. data/.ai-assistance/projects/TODO.md +97 -0
  58. data/.ai-assistance/projects/api-v2-to-graphql-migration/DECISIONS.md +168 -0
  59. data/.ai-assistance/projects/api-v2-to-graphql-migration/INTENT.md +60 -0
  60. data/.ai-assistance/projects/api-v2-to-graphql-migration/TODO.md +267 -0
  61. data/.ai-assistance/projects/api-v2-to-graphql-migration/UPSTREAM.md +53 -0
  62. data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/csv-template-pipeline-design.md +102 -0
  63. data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/cutover-usecase-gap-audit.md +139 -0
  64. data/.ai-assistance/projects/dynamic-model-generation/INTENT.md +93 -0
  65. data/.ai-assistance/projects/eco-helpers-compat/INTENT.md +244 -0
  66. data/.ai-assistance/projects/eco-helpers-compat/MIGRATION_GUIDE.md +266 -0
  67. data/.ai-assistance/projects/eco-helpers-compat/TODO.md +86 -0
  68. data/.ai-assistance/projects/ecoportal-api-v2-doublemodel-review/INTENT.md +101 -0
  69. data/.ai-assistance/projects/graphql-agent/GAP_ANALYSIS.md +177 -0
  70. data/.ai-assistance/projects/ooze-graphql-native-migration/DECISIONS.md +161 -0
  71. data/.ai-assistance/projects/ooze-graphql-native-migration/INTENT.md +125 -0
  72. data/.ai-assistance/projects/ooze-graphql-native-migration/RISKS.md +126 -0
  73. data/.ai-assistance/projects/ooze-graphql-native-migration/TODO.md +256 -0
  74. data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-06-30-cutover-workflow-deep-review.md +122 -0
  75. data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-07-01-forces-via-workflow-commands-miss-rca.md +148 -0
  76. data/.ai-assistance/projects/page-model/DECISIONS.md +245 -0
  77. data/.ai-assistance/projects/page-model/TODO.md +190 -0
  78. data/.ai-assistance/projects/search-filter-builder/INTENT.md +107 -0
  79. data/.ai-assistance/projects/search-filter-builder/TODO.md +131 -0
  80. data/.ai-assistance/projects/template-maintenance/DESIGN.md +134 -0
  81. data/.ai-assistance/projects/workflow-space/TODO.md +213 -0
  82. data/.ai-assistance/reinstall-claude-desktop-windows.md +136 -0
  83. data/.ai-assistance/scripts/CLAUDE.md +150 -0
  84. data/.ai-assistance/scripts/bridge-init.sh +86 -0
  85. data/.ai-assistance/scripts/bridge-status.sh +44 -0
  86. data/.ai-assistance/scripts/capabilities-check.ts +104 -0
  87. data/.ai-assistance/scripts/check-outbox.sh +43 -0
  88. data/.ai-assistance/scripts/dep_graph.rb +91 -0
  89. data/.ai-assistance/scripts/lock-acquire.sh +103 -0
  90. data/.ai-assistance/scripts/lock-multi.sh +124 -0
  91. data/.ai-assistance/scripts/lock-queue.sh +94 -0
  92. data/.ai-assistance/scripts/setup-mcps.test.ts +188 -0
  93. data/.ai-assistance/scripts/setup-mcps.ts +234 -0
  94. data/.ai-assistance/scripts/task-complete.ts +74 -0
  95. data/.ai-assistance/scripts/task-create.ts +75 -0
  96. data/.ai-assistance/scripts/task-read.ts +125 -0
  97. data/.ai-assistance/scripts/token-logger.js +220 -0
  98. data/.ai-assistance/scripts/token-report.ts +158 -0
  99. data/.ai-assistance/scripts/token-session-start.js +66 -0
  100. data/.ai-assistance/skills/ai-instructions/SKILL.md +48 -0
  101. data/.ai-assistance/skills/code-specs/SKILL.md +69 -0
  102. data/.ai-assistance/skills/corporate-policies/SKILL.md +201 -0
  103. data/.ai-assistance/skills/dep-graph/SKILL.md +139 -0
  104. data/.ai-assistance/skills/ep-ai-manager/SKILL.md +417 -0
  105. data/.ai-assistance/skills/gemini-assist/SKILL.md +63 -0
  106. data/.ai-assistance/skills/gemini-assist/gemini-mcp-server.js +205 -0
  107. data/.ai-assistance/skills/gemini-assist/gemini_ask.py +1 -0
  108. data/.ai-assistance/skills/gemini-assist/gemini_ask.rb +240 -0
  109. data/.ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt +25 -0
  110. data/.ai-assistance/skills/graphql-schema-analysis/SKILL.md +261 -0
  111. data/.ai-assistance/skills/project-cycle/SKILL.md +177 -0
  112. data/.ai-assistance/skills/refactor/SKILL.md +62 -0
  113. data/.ai-assistance/skills/rubocop/SKILL.md +93 -0
  114. data/.ai-assistance/skills/ruby-scripting/SKILL.md +215 -0
  115. data/.ai-assistance/skills/spec-generation/SKILL.md +72 -0
  116. data/.ai-assistance/standards-version.json +21 -0
  117. data/.ai-assistance/token-budget.json +32 -0
  118. data/.ai-assistance/version.json +39 -0
  119. data/.claude/settings.json +146 -0
  120. data/.env.example +18 -0
  121. data/.gitattributes +15 -0
  122. data/.gitignore +13 -0
  123. data/.rubocop.yml +121 -97
  124. data/CHANGELOG.md +673 -477
  125. data/CLAUDE.md +232 -0
  126. data/Gemfile +30 -6
  127. data/Rakefile +90 -38
  128. data/docs/worklog.md +574 -0
  129. data/ecoportal-api-graphql.gemspec +40 -40
  130. data/lib/ecoportal/api/common/graphql/CLAUDE.md +36 -0
  131. data/lib/ecoportal/api/common/graphql/client.rb +1 -1
  132. data/lib/ecoportal/api/common/graphql/http_client.rb +35 -3
  133. data/lib/ecoportal/api/common/graphql/model/CLAUDE.md +28 -0
  134. data/lib/ecoportal/api/common/graphql/model/as_input.rb +8 -5
  135. data/lib/ecoportal/api/common/graphql/model/diffable/classic_diff_service.rb +3 -1
  136. data/lib/ecoportal/api/common/graphql/model/diffable/diff_service.rb +31 -23
  137. data/lib/ecoportal/api/common/graphql/model/diffable/hash_diff_nesting.rb +54 -1
  138. data/lib/ecoportal/api/graphql/CLAUDE.md +37 -0
  139. data/lib/ecoportal/api/graphql/base/CLAUDE.md +50 -0
  140. data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +17 -0
  141. data/lib/ecoportal/api/graphql/base/delta_result.rb +16 -0
  142. data/lib/ecoportal/api/graphql/base/force/binding.rb +19 -0
  143. data/lib/ecoportal/api/graphql/base/force/binding_collection.rb +62 -0
  144. data/lib/ecoportal/api/graphql/base/force/collection.rb +47 -0
  145. data/lib/ecoportal/api/graphql/base/force.rb +65 -0
  146. data/lib/ecoportal/api/graphql/base/kickstand/job.rb +17 -0
  147. data/lib/ecoportal/api/graphql/base/kickstand/workflow.rb +18 -0
  148. data/lib/ecoportal/api/graphql/base/kickstand.rb +13 -0
  149. data/lib/ecoportal/api/graphql/base/page/basic.rb +38 -0
  150. data/lib/ecoportal/api/graphql/base/page/data_field/actions_list.rb +9 -0
  151. data/lib/ecoportal/api/graphql/base/page/data_field/ai_summary.rb +18 -0
  152. data/lib/ecoportal/api/graphql/base/page/data_field/checklist.rb +29 -0
  153. data/lib/ecoportal/api/graphql/base/page/data_field/collection.rb +112 -0
  154. data/lib/ecoportal/api/graphql/base/page/data_field/contractor_entities.rb +28 -0
  155. data/lib/ecoportal/api/graphql/base/page/data_field/cross_reference.rb +54 -0
  156. data/lib/ecoportal/api/graphql/base/page/data_field/date_field.rb +23 -0
  157. data/lib/ecoportal/api/graphql/base/page/data_field/file_field.rb +25 -0
  158. data/lib/ecoportal/api/graphql/base/page/data_field/gauge.rb +19 -0
  159. data/lib/ecoportal/api/graphql/base/page/data_field/geo.rb +24 -0
  160. data/lib/ecoportal/api/graphql/base/page/data_field/image_gallery.rb +24 -0
  161. data/lib/ecoportal/api/graphql/base/page/data_field/law.rb +8 -0
  162. data/lib/ecoportal/api/graphql/base/page/data_field/mailbox.rb +9 -0
  163. data/lib/ecoportal/api/graphql/base/page/data_field/number.rb +20 -0
  164. data/lib/ecoportal/api/graphql/base/page/data_field/people.rb +35 -0
  165. data/lib/ecoportal/api/graphql/base/page/data_field/plain_text.rb +17 -0
  166. data/lib/ecoportal/api/graphql/base/page/data_field/rich_text.rb +26 -0
  167. data/lib/ecoportal/api/graphql/base/page/data_field/select.rb +41 -0
  168. data/lib/ecoportal/api/graphql/base/page/data_field/signature.rb +9 -0
  169. data/lib/ecoportal/api/graphql/base/page/data_field/smart_fill.rb +17 -0
  170. data/lib/ecoportal/api/graphql/base/page/data_field/table.rb +9 -0
  171. data/lib/ecoportal/api/graphql/base/page/data_field/tag_field.rb +21 -0
  172. data/lib/ecoportal/api/graphql/base/page/data_field.rb +137 -12
  173. data/lib/ecoportal/api/graphql/base/page/phased/stage.rb +68 -14
  174. data/lib/ecoportal/api/graphql/base/page/phased.rb +1 -0
  175. data/lib/ecoportal/api/graphql/base/page/section.rb +36 -0
  176. data/lib/ecoportal/api/graphql/base/page/section_collection.rb +79 -0
  177. data/lib/ecoportal/api/graphql/base/page.rb +2 -0
  178. data/lib/ecoportal/api/graphql/base/pages_workflow/action_type_selection.rb +17 -0
  179. data/lib/ecoportal/api/graphql/base/pages_workflow/callback_type.rb +28 -0
  180. data/lib/ecoportal/api/graphql/base/pages_workflow/command_change.rb +17 -0
  181. data/lib/ecoportal/api/graphql/base/pages_workflow/command_change_message.rb +15 -0
  182. data/lib/ecoportal/api/graphql/base/pages_workflow/command_es_change.rb +17 -0
  183. data/lib/ecoportal/api/graphql/base/pages_workflow/command_interface.rb +36 -0
  184. data/lib/ecoportal/api/graphql/base/pages_workflow/email_config.rb +18 -0
  185. data/lib/ecoportal/api/graphql/base/pages_workflow/escalation_level.rb +19 -0
  186. data/lib/ecoportal/api/graphql/base/pages_workflow/in_system_config.rb +16 -0
  187. data/lib/ecoportal/api/graphql/base/pages_workflow/mailbox_field_selection.rb +17 -0
  188. data/lib/ecoportal/api/graphql/base/pages_workflow/operation_interface.rb +39 -0
  189. data/lib/ecoportal/api/graphql/base/pages_workflow/operations/assign_to.rb +27 -0
  190. data/lib/ecoportal/api/graphql/base/pages_workflow/operations/create_page.rb +21 -0
  191. data/lib/ecoportal/api/graphql/base/pages_workflow/operations/send_notification.rb +30 -0
  192. data/lib/ecoportal/api/graphql/base/pages_workflow/people_field_selection.rb +17 -0
  193. data/lib/ecoportal/api/graphql/base/pages_workflow/recipient_config.rb +34 -0
  194. data/lib/ecoportal/api/graphql/base/pages_workflow/register_field.rb +17 -0
  195. data/lib/ecoportal/api/graphql/base/pages_workflow/task_config_selection.rb +17 -0
  196. data/lib/ecoportal/api/graphql/base/pages_workflow/time_delay_config.rb +16 -0
  197. data/lib/ecoportal/api/graphql/base/pages_workflow/trigger_interface.rb +26 -0
  198. data/lib/ecoportal/api/graphql/base/pages_workflow/triggers/conditional_logic.rb +17 -0
  199. data/lib/ecoportal/api/graphql/base/pages_workflow/user_selection.rb +16 -0
  200. data/lib/ecoportal/api/graphql/base/pages_workflow.rb +35 -0
  201. data/lib/ecoportal/api/graphql/base/preset_view.rb +17 -0
  202. data/lib/ecoportal/api/graphql/base/preview_page.rb +23 -0
  203. data/lib/ecoportal/api/graphql/base/register.rb +18 -0
  204. data/lib/ecoportal/api/graphql/base.rb +11 -0
  205. data/lib/ecoportal/api/graphql/builder/CLAUDE.md +65 -0
  206. data/lib/ecoportal/api/graphql/builder/kickstand.rb +73 -0
  207. data/lib/ecoportal/api/graphql/builder/page.rb +210 -41
  208. data/lib/ecoportal/api/graphql/builder/register/preset_view.rb +84 -0
  209. data/lib/ecoportal/api/graphql/builder/register.rb +27 -19
  210. data/lib/ecoportal/api/graphql/builder/template.rb +80 -0
  211. data/lib/ecoportal/api/graphql/builder.rb +2 -0
  212. data/lib/ecoportal/api/graphql/compat/filter_translator.rb +107 -0
  213. data/lib/ecoportal/api/graphql/compat/page_reference.rb +23 -0
  214. data/lib/ecoportal/api/graphql/compat/pages.rb +212 -0
  215. data/lib/ecoportal/api/graphql/compat/registers.rb +84 -0
  216. data/lib/ecoportal/api/graphql/compat/response.rb +35 -0
  217. data/lib/ecoportal/api/graphql/compat/search_results.rb +33 -0
  218. data/lib/ecoportal/api/graphql/compat/stage_collection.rb +70 -0
  219. data/lib/ecoportal/api/graphql/compat/stage_view.rb +76 -0
  220. data/lib/ecoportal/api/graphql/compat.rb +17 -0
  221. data/lib/ecoportal/api/graphql/concerns/data_field_access.rb +71 -0
  222. data/lib/ecoportal/api/graphql/concerns/deprecation.rb +20 -0
  223. data/lib/ecoportal/api/graphql/concerns/fragment_definitions.rb +21 -28
  224. data/lib/ecoportal/api/graphql/concerns/page_compat.rb +51 -0
  225. data/lib/ecoportal/api/graphql/concerns/snake_camel_access.rb +60 -0
  226. data/lib/ecoportal/api/graphql/concerns.rb +4 -0
  227. data/lib/ecoportal/api/graphql/connection/page.rb +11 -0
  228. data/lib/ecoportal/api/graphql/connection/pages_workflow_command.rb +13 -0
  229. data/lib/ecoportal/api/graphql/connection/preset_view.rb +11 -0
  230. data/lib/ecoportal/api/graphql/connection/preview_page.rb +11 -0
  231. data/lib/ecoportal/api/graphql/connection.rb +4 -0
  232. data/lib/ecoportal/api/graphql/file_upload/client.rb +181 -0
  233. data/lib/ecoportal/api/graphql/file_upload.rb +10 -0
  234. data/lib/ecoportal/api/graphql/fragment/action.rb +1 -1
  235. data/lib/ecoportal/api/graphql/fragment/action_category.rb +1 -1
  236. data/lib/ecoportal/api/graphql/fragment/contractor_entity.rb +1 -1
  237. data/lib/ecoportal/api/graphql/fragment/force.rb +30 -0
  238. data/lib/ecoportal/api/graphql/fragment/location_draft.rb +2 -2
  239. data/lib/ecoportal/api/graphql/fragment/location_node.rb +1 -1
  240. data/lib/ecoportal/api/graphql/fragment/locations_error.rb +1 -1
  241. data/lib/ecoportal/api/graphql/fragment/page.rb +85 -0
  242. data/lib/ecoportal/api/graphql/fragment/pages/common_page_union.rb +395 -0
  243. data/lib/ecoportal/api/graphql/fragment/pages.rb +15 -0
  244. data/lib/ecoportal/api/graphql/fragment/pages_workflow.rb +172 -0
  245. data/lib/ecoportal/api/graphql/fragment/pagination.rb +1 -1
  246. data/lib/ecoportal/api/graphql/fragment.rb +37 -27
  247. data/lib/ecoportal/api/graphql/input/contractor_entity/update.rb +25 -0
  248. data/lib/ecoportal/api/graphql/input/delta_input.rb +16 -0
  249. data/lib/ecoportal/api/graphql/input/page/archive.rb +14 -0
  250. data/lib/ecoportal/api/graphql/input/page/build_from_template.rb +13 -0
  251. data/lib/ecoportal/api/graphql/input/page/create_draft.rb +13 -0
  252. data/lib/ecoportal/api/graphql/input/page/create_from_template.rb +18 -0
  253. data/lib/ecoportal/api/graphql/input/page/delete_draft.rb +13 -0
  254. data/lib/ecoportal/api/graphql/input/page/publish_draft.rb +13 -0
  255. data/lib/ecoportal/api/graphql/input/page/review_task.rb +14 -0
  256. data/lib/ecoportal/api/graphql/input/page/unarchive.rb +14 -0
  257. data/lib/ecoportal/api/graphql/input/page/update.rb +140 -0
  258. data/lib/ecoportal/api/graphql/input/page.rb +26 -0
  259. data/lib/ecoportal/api/graphql/input/preset_view/create.rb +18 -0
  260. data/lib/ecoportal/api/graphql/input/preset_view/permission.rb +16 -0
  261. data/lib/ecoportal/api/graphql/input/preset_view/update.rb +16 -0
  262. data/lib/ecoportal/api/graphql/input/preset_view.rb +14 -0
  263. data/lib/ecoportal/api/graphql/input/register/create.rb +18 -0
  264. data/lib/ecoportal/api/graphql/input/register/update.rb +15 -0
  265. data/lib/ecoportal/api/graphql/input/register.rb +13 -0
  266. data/lib/ecoportal/api/graphql/input/search_conf/ai_generator.rb +234 -0
  267. data/lib/ecoportal/api/graphql/input/search_conf.rb +367 -0
  268. data/lib/ecoportal/api/graphql/input/variable_binding.rb +20 -0
  269. data/lib/ecoportal/api/graphql/input/workflow_command/add_action_tag.rb +18 -0
  270. data/lib/ecoportal/api/graphql/input/workflow_command/add_binding.rb +18 -0
  271. data/lib/ecoportal/api/graphql/input/workflow_command/add_comment_tagging_user_group.rb +18 -0
  272. data/lib/ecoportal/api/graphql/input/workflow_command/add_default_direct_strategy_user.rb +18 -0
  273. data/lib/ecoportal/api/graphql/input/workflow_command/add_default_strategy.rb +18 -0
  274. data/lib/ecoportal/api/graphql/input/workflow_command/add_direct_strategy_user.rb +18 -0
  275. data/lib/ecoportal/api/graphql/input/workflow_command/add_field.rb +18 -0
  276. data/lib/ecoportal/api/graphql/input/workflow_command/add_force.rb +18 -0
  277. data/lib/ecoportal/api/graphql/input/workflow_command/add_gauge_field_stop.rb +19 -0
  278. data/lib/ecoportal/api/graphql/input/workflow_command/add_linked_field_config.rb +23 -0
  279. data/lib/ecoportal/api/graphql/input/workflow_command/add_linked_helper.rb +18 -0
  280. data/lib/ecoportal/api/graphql/input/workflow_command/add_operation.rb +18 -0
  281. data/lib/ecoportal/api/graphql/input/workflow_command/add_operation_direct_strategy_user.rb +18 -0
  282. data/lib/ecoportal/api/graphql/input/workflow_command/add_operation_strategy.rb +18 -0
  283. data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_action_type.rb +18 -0
  284. data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_filter.rb +18 -0
  285. data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_people_field.rb +18 -0
  286. data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_task_config.rb +18 -0
  287. data/lib/ecoportal/api/graphql/input/workflow_command/add_recipient_user.rb +18 -0
  288. data/lib/ecoportal/api/graphql/input/workflow_command/add_scheduled_callback.rb +23 -0
  289. data/lib/ecoportal/api/graphql/input/workflow_command/add_scheduled_callback_action.rb +18 -0
  290. data/lib/ecoportal/api/graphql/input/workflow_command/add_section.rb +18 -0
  291. data/lib/ecoportal/api/graphql/input/workflow_command/add_select_field_option.rb +19 -0
  292. data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +18 -0
  293. data/lib/ecoportal/api/graphql/input/workflow_command/add_stage_section.rb +18 -0
  294. data/lib/ecoportal/api/graphql/input/workflow_command/add_stage_tag.rb +18 -0
  295. data/lib/ecoportal/api/graphql/input/workflow_command/add_strategy.rb +18 -0
  296. data/lib/ecoportal/api/graphql/input/workflow_command/add_task.rb +18 -0
  297. data/lib/ecoportal/api/graphql/input/workflow_command/add_task_assignment_user_group.rb +18 -0
  298. data/lib/ecoportal/api/graphql/input/workflow_command/add_workflow_callback.rb +18 -0
  299. data/lib/ecoportal/api/graphql/input/workflow_command/collapse_section.rb +18 -0
  300. data/lib/ecoportal/api/graphql/input/workflow_command/edit_binding.rb +18 -0
  301. data/lib/ecoportal/api/graphql/input/workflow_command/edit_creator_permissions.rb +18 -0
  302. data/lib/ecoportal/api/graphql/input/workflow_command/edit_default_strategy.rb +18 -0
  303. data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +21 -0
  304. data/lib/ecoportal/api/graphql/input/workflow_command/edit_force.rb +18 -0
  305. data/lib/ecoportal/api/graphql/input/workflow_command/edit_gauge_field_stop.rb +19 -0
  306. data/lib/ecoportal/api/graphql/input/workflow_command/edit_linked_field_config.rb +19 -0
  307. data/lib/ecoportal/api/graphql/input/workflow_command/edit_linked_helper.rb +18 -0
  308. data/lib/ecoportal/api/graphql/input/workflow_command/edit_operation.rb +18 -0
  309. data/lib/ecoportal/api/graphql/input/workflow_command/edit_operation_strategy.rb +18 -0
  310. data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +28 -0
  311. data/lib/ecoportal/api/graphql/input/workflow_command/edit_page_creator_permissions.rb +18 -0
  312. data/lib/ecoportal/api/graphql/input/workflow_command/edit_reminder.rb +18 -0
  313. data/lib/ecoportal/api/graphql/input/workflow_command/edit_required_sign_offs.rb +18 -0
  314. data/lib/ecoportal/api/graphql/input/workflow_command/edit_restrict_comment_tagging.rb +18 -0
  315. data/lib/ecoportal/api/graphql/input/workflow_command/edit_restrict_task_assignment.rb +18 -0
  316. data/lib/ecoportal/api/graphql/input/workflow_command/edit_scheduled_callback.rb +22 -0
  317. data/lib/ecoportal/api/graphql/input/workflow_command/edit_section_header.rb +18 -0
  318. data/lib/ecoportal/api/graphql/input/workflow_command/edit_select_field_option.rb +19 -0
  319. data/lib/ecoportal/api/graphql/input/workflow_command/edit_stage.rb +18 -0
  320. data/lib/ecoportal/api/graphql/input/workflow_command/edit_strategy.rb +18 -0
  321. data/lib/ecoportal/api/graphql/input/workflow_command/edit_task_due.rb +18 -0
  322. data/lib/ecoportal/api/graphql/input/workflow_command/edit_trigger.rb +18 -0
  323. data/lib/ecoportal/api/graphql/input/workflow_command/expand_section.rb +18 -0
  324. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/contractor_entities.rb +24 -0
  325. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +23 -0
  326. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +20 -0
  327. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/gauge.rb +20 -0
  328. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +20 -0
  329. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/location_field.rb +24 -0
  330. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb +24 -0
  331. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +20 -0
  332. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +20 -0
  333. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +20 -0
  334. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/signature.rb +20 -0
  335. data/lib/ecoportal/api/graphql/input/workflow_command/field_config/table.rb +25 -0
  336. data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +18 -0
  337. data/lib/ecoportal/api/graphql/input/workflow_command/move_stage.rb +18 -0
  338. data/lib/ecoportal/api/graphql/input/workflow_command/remove_action_tag.rb +18 -0
  339. data/lib/ecoportal/api/graphql/input/workflow_command/remove_binding.rb +18 -0
  340. data/lib/ecoportal/api/graphql/input/workflow_command/remove_callback.rb +18 -0
  341. data/lib/ecoportal/api/graphql/input/workflow_command/remove_comment_tagging_user_group.rb +18 -0
  342. data/lib/ecoportal/api/graphql/input/workflow_command/remove_default_direct_strategy_user.rb +18 -0
  343. data/lib/ecoportal/api/graphql/input/workflow_command/remove_default_strategy.rb +18 -0
  344. data/lib/ecoportal/api/graphql/input/workflow_command/remove_direct_strategy_user.rb +18 -0
  345. data/lib/ecoportal/api/graphql/input/workflow_command/remove_field.rb +18 -0
  346. data/lib/ecoportal/api/graphql/input/workflow_command/remove_force.rb +18 -0
  347. data/lib/ecoportal/api/graphql/input/workflow_command/remove_gauge_field_stop.rb +17 -0
  348. data/lib/ecoportal/api/graphql/input/workflow_command/remove_linked_field_config.rb +17 -0
  349. data/lib/ecoportal/api/graphql/input/workflow_command/remove_linked_helper.rb +18 -0
  350. data/lib/ecoportal/api/graphql/input/workflow_command/remove_operation.rb +18 -0
  351. data/lib/ecoportal/api/graphql/input/workflow_command/remove_operation_direct_strategy_user.rb +18 -0
  352. data/lib/ecoportal/api/graphql/input/workflow_command/remove_operation_strategy.rb +18 -0
  353. data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_action_type.rb +18 -0
  354. data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_filter.rb +18 -0
  355. data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_people_field.rb +18 -0
  356. data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_task_config.rb +18 -0
  357. data/lib/ecoportal/api/graphql/input/workflow_command/remove_recipient_user.rb +18 -0
  358. data/lib/ecoportal/api/graphql/input/workflow_command/remove_scheduled_callback.rb +18 -0
  359. data/lib/ecoportal/api/graphql/input/workflow_command/remove_section.rb +18 -0
  360. data/lib/ecoportal/api/graphql/input/workflow_command/remove_select_field_option.rb +17 -0
  361. data/lib/ecoportal/api/graphql/input/workflow_command/remove_stage.rb +18 -0
  362. data/lib/ecoportal/api/graphql/input/workflow_command/remove_stage_section.rb +18 -0
  363. data/lib/ecoportal/api/graphql/input/workflow_command/remove_stage_tag.rb +18 -0
  364. data/lib/ecoportal/api/graphql/input/workflow_command/remove_strategy.rb +18 -0
  365. data/lib/ecoportal/api/graphql/input/workflow_command/remove_task.rb +18 -0
  366. data/lib/ecoportal/api/graphql/input/workflow_command/remove_task_assignment_user_group.rb +18 -0
  367. data/lib/ecoportal/api/graphql/input/workflow_command/remove_task_due.rb +18 -0
  368. data/lib/ecoportal/api/graphql/input/workflow_command/remove_task_priority_level.rb +18 -0
  369. data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +18 -0
  370. data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +18 -0
  371. data/lib/ecoportal/api/graphql/input/workflow_command.rb +251 -0
  372. data/lib/ecoportal/api/graphql/input.rb +8 -0
  373. data/lib/ecoportal/api/graphql/interface/base_page.rb +100 -58
  374. data/lib/ecoportal/api/graphql/interface/location_structure/nodes.rb +27 -28
  375. data/lib/ecoportal/api/graphql/logic/base_model.rb +2 -0
  376. data/lib/ecoportal/api/graphql/logic/base_query.rb +45 -2
  377. data/lib/ecoportal/api/graphql/logic/input.rb +15 -0
  378. data/lib/ecoportal/api/graphql/model/ai_summary_version.rb +10 -0
  379. data/lib/ecoportal/api/graphql/model/organization.rb +65 -55
  380. data/lib/ecoportal/api/graphql/model/page/basic.rb +14 -0
  381. data/lib/ecoportal/api/graphql/model/page/phased.rb +82 -20
  382. data/lib/ecoportal/api/graphql/model/page.rb +1 -0
  383. data/lib/ecoportal/api/graphql/model/page_union.rb +21 -0
  384. data/lib/ecoportal/api/graphql/model/pages_workflow.rb +20 -0
  385. data/lib/ecoportal/api/graphql/model/preset_view.rb +10 -0
  386. data/lib/ecoportal/api/graphql/model/preview_page.rb +10 -0
  387. data/lib/ecoportal/api/graphql/model/register.rb +10 -0
  388. data/lib/ecoportal/api/graphql/model.rb +8 -0
  389. data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +45 -0
  390. data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +40 -0
  391. data/lib/ecoportal/api/graphql/mutation/ai_summary.rb +13 -0
  392. data/lib/ecoportal/api/graphql/mutation/kickstand/bulk_update_jobs.rb +43 -0
  393. data/lib/ecoportal/api/graphql/mutation/kickstand/bulk_update_workflows.rb +43 -0
  394. data/lib/ecoportal/api/graphql/mutation/kickstand/fail_job.rb +39 -0
  395. data/lib/ecoportal/api/graphql/mutation/kickstand/fail_workflow.rb +39 -0
  396. data/lib/ecoportal/api/graphql/mutation/kickstand/start_job.rb +39 -0
  397. data/lib/ecoportal/api/graphql/mutation/kickstand/start_workflow.rb +39 -0
  398. data/lib/ecoportal/api/graphql/mutation/kickstand/stop_workflow.rb +39 -0
  399. data/lib/ecoportal/api/graphql/mutation/kickstand.rb +18 -0
  400. data/lib/ecoportal/api/graphql/mutation/location_structure/apply_commands.rb +3 -3
  401. data/lib/ecoportal/api/graphql/mutation/location_structure/draft/add_commands.rb +2 -2
  402. data/lib/ecoportal/api/graphql/mutation/location_structure/draft/create.rb +2 -2
  403. data/lib/ecoportal/api/graphql/mutation/location_structure/draft/drop_bad_commands.rb +3 -3
  404. data/lib/ecoportal/api/graphql/mutation/location_structure/draft/publish.rb +3 -3
  405. data/lib/ecoportal/api/graphql/mutation/page/approve_review_task.rb +40 -0
  406. data/lib/ecoportal/api/graphql/mutation/page/archive.rb +40 -0
  407. data/lib/ecoportal/api/graphql/mutation/page/batch_update_review_task.rb +40 -0
  408. data/lib/ecoportal/api/graphql/mutation/page/build_from_template.rb +50 -0
  409. data/lib/ecoportal/api/graphql/mutation/page/create_draft.rb +40 -0
  410. data/lib/ecoportal/api/graphql/mutation/page/create_from_template.rb +43 -0
  411. data/lib/ecoportal/api/graphql/mutation/page/delete_draft.rb +40 -0
  412. data/lib/ecoportal/api/graphql/mutation/page/execute_force_commands.rb +69 -0
  413. data/lib/ecoportal/api/graphql/mutation/page/execute_workflow_commands.rb +51 -0
  414. data/lib/ecoportal/api/graphql/mutation/page/publish_draft.rb +40 -0
  415. data/lib/ecoportal/api/graphql/mutation/page/reject_review_task.rb +40 -0
  416. data/lib/ecoportal/api/graphql/mutation/page/restart_review_task.rb +40 -0
  417. data/lib/ecoportal/api/graphql/mutation/page/unarchive.rb +40 -0
  418. data/lib/ecoportal/api/graphql/mutation/page/undo_review_task.rb +40 -0
  419. data/lib/ecoportal/api/graphql/mutation/page/update.rb +40 -0
  420. data/lib/ecoportal/api/graphql/mutation/page/update_variable_bindings.rb +44 -0
  421. data/lib/ecoportal/api/graphql/mutation/page.rb +28 -0
  422. data/lib/ecoportal/api/graphql/mutation/preset_view/create.rb +35 -0
  423. data/lib/ecoportal/api/graphql/mutation/preset_view/destroy.rb +35 -0
  424. data/lib/ecoportal/api/graphql/mutation/preset_view/permission.rb +37 -0
  425. data/lib/ecoportal/api/graphql/mutation/preset_view/update.rb +35 -0
  426. data/lib/ecoportal/api/graphql/mutation/preset_view.rb +15 -0
  427. data/lib/ecoportal/api/graphql/mutation/register/create.rb +35 -0
  428. data/lib/ecoportal/api/graphql/mutation/register/destroy.rb +35 -0
  429. data/lib/ecoportal/api/graphql/mutation/register/update.rb +35 -0
  430. data/lib/ecoportal/api/graphql/mutation/register.rb +14 -0
  431. data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +36 -0
  432. data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +40 -0
  433. data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +13 -0
  434. data/lib/ecoportal/api/graphql/mutation/template/create.rb +39 -0
  435. data/lib/ecoportal/api/graphql/mutation/template/create_related_page.rb +46 -0
  436. data/lib/ecoportal/api/graphql/mutation/template/destroy_related_page.rb +43 -0
  437. data/lib/ecoportal/api/graphql/mutation/template/publish.rb +39 -0
  438. data/lib/ecoportal/api/graphql/mutation/template/unpublish.rb +39 -0
  439. data/lib/ecoportal/api/graphql/mutation/template/update.rb +43 -0
  440. data/lib/ecoportal/api/graphql/mutation/template/update_information.rb +43 -0
  441. data/lib/ecoportal/api/graphql/mutation/template.rb +18 -0
  442. data/lib/ecoportal/api/graphql/mutation.rb +8 -0
  443. data/lib/ecoportal/api/graphql/payload/ai_summary_generate.rb +12 -0
  444. data/lib/ecoportal/api/graphql/payload/execute_workflow_commands.rb +36 -0
  445. data/lib/ecoportal/api/graphql/payload/force_commands.rb +31 -0
  446. data/lib/ecoportal/api/graphql/payload/kickstand/bulk_update_jobs.rb +36 -0
  447. data/lib/ecoportal/api/graphql/payload/kickstand/bulk_update_workflows.rb +36 -0
  448. data/lib/ecoportal/api/graphql/payload/kickstand/job.rb +13 -0
  449. data/lib/ecoportal/api/graphql/payload/kickstand/workflow.rb +13 -0
  450. data/lib/ecoportal/api/graphql/payload/kickstand.rb +15 -0
  451. data/lib/ecoportal/api/graphql/payload/location_structure/draft/create.rb +33 -34
  452. data/lib/ecoportal/api/graphql/payload/ok_payload.rb +21 -0
  453. data/lib/ecoportal/api/graphql/payload/page/archive.rb +13 -0
  454. data/lib/ecoportal/api/graphql/payload/page/build_from_template.rb +13 -0
  455. data/lib/ecoportal/api/graphql/payload/page/create_from_template.rb +13 -0
  456. data/lib/ecoportal/api/graphql/payload/page/draft.rb +13 -0
  457. data/lib/ecoportal/api/graphql/payload/page/review_task.rb +13 -0
  458. data/lib/ecoportal/api/graphql/payload/page/unarchive.rb +13 -0
  459. data/lib/ecoportal/api/graphql/payload/page/update.rb +13 -0
  460. data/lib/ecoportal/api/graphql/payload/page/update_variable_bindings.rb +13 -0
  461. data/lib/ecoportal/api/graphql/payload/page.rb +19 -0
  462. data/lib/ecoportal/api/graphql/payload/preset_view.rb +11 -0
  463. data/lib/ecoportal/api/graphql/payload/register.rb +11 -0
  464. data/lib/ecoportal/api/graphql/payload/template/create.rb +13 -0
  465. data/lib/ecoportal/api/graphql/payload/template/create_related_page.rb +13 -0
  466. data/lib/ecoportal/api/graphql/payload/template/destroy_related_page.rb +13 -0
  467. data/lib/ecoportal/api/graphql/payload/template/publish.rb +13 -0
  468. data/lib/ecoportal/api/graphql/payload/template/unpublish.rb +13 -0
  469. data/lib/ecoportal/api/graphql/payload/template/update.rb +13 -0
  470. data/lib/ecoportal/api/graphql/payload/template/update_information.rb +13 -0
  471. data/lib/ecoportal/api/graphql/payload/template.rb +18 -0
  472. data/lib/ecoportal/api/graphql/payload.rb +11 -0
  473. data/lib/ecoportal/api/graphql/query/action.rb +1 -1
  474. data/lib/ecoportal/api/graphql/query/action_categories.rb +1 -1
  475. data/lib/ecoportal/api/graphql/query/actions.rb +2 -2
  476. data/lib/ecoportal/api/graphql/query/contractor_entities.rb +1 -1
  477. data/lib/ecoportal/api/graphql/query/file_upload_signature.rb +76 -0
  478. data/lib/ecoportal/api/graphql/query/location_structure/draft.rb +2 -2
  479. data/lib/ecoportal/api/graphql/query/location_structure.rb +1 -1
  480. data/lib/ecoportal/api/graphql/query/location_structures.rb +1 -1
  481. data/lib/ecoportal/api/graphql/query/page.rb +45 -0
  482. data/lib/ecoportal/api/graphql/query/page_delta.rb +47 -0
  483. data/lib/ecoportal/api/graphql/query/page_with_forces.rb +43 -0
  484. data/lib/ecoportal/api/graphql/query/pages.rb +59 -0
  485. data/lib/ecoportal/api/graphql/query/pages_workflow_commands.rb +59 -0
  486. data/lib/ecoportal/api/graphql/query/register_preset_views.rb +78 -0
  487. data/lib/ecoportal/api/graphql/query/register_preview_pages.rb +83 -0
  488. data/lib/ecoportal/api/graphql/query/templates.rb +53 -0
  489. data/lib/ecoportal/api/graphql/query.rb +11 -0
  490. data/lib/ecoportal/api/graphql.rb +60 -2
  491. data/lib/ecoportal/api/graphql_version.rb +5 -5
  492. data/scripts/auto-worker-scheduler.sh +386 -0
  493. data/tests/contractor_entity_create.rb +19 -19
  494. data/tests/contractor_entity_udpate.rb +20 -20
  495. data/tests/dump_page_model.rb +74 -0
  496. data/tests/loc_structure_get.rb +1 -2
  497. data/tests/loc_structure_update.rb +51 -51
  498. data/tests/loc_structures_get.rb +15 -15
  499. metadata +436 -5
@@ -0,0 +1,104 @@
1
+ Here's a detailed review of the bridge protocol design:
2
+
3
+ ## 1. Weaknesses and Failure Modes
4
+
5
+ 1. **Race Condition / Partial Write during `IN_PROGRESS` Status Update:**
6
+ * **Description:** The bridge protocol states, "Code picks it up, updates STATUS to IN_PROGRESS in the inbox file." If two Code instances (e.g., from the same user) concurrently pick up the same task, or if an agent crashes during this update, the `inbox` file could be partially written or overwritten, leading to a corrupted status or lost task. The `LOCK` file only applies to *working tree changes*, not bridge task processing.
7
+ * **Likelihood:** Medium.
8
+ * **Mitigation:** The status update (PENDING to IN_PROGRESS) should be made atomic. This could be achieved by modifying `task-complete.ts` to *also* handle the `IN_PROGRESS` status update (writing to a temp file and renaming), or by having Code *first* rename the task file to `inbox/[username]-[uuid7]-[slug].IN_PROGRESS.md` (atomic file system operation), then read its content, process, and finally call `task-complete.ts`.
9
+
10
+ 2. **Stale `IN_PROGRESS` Tasks:**
11
+ * **Description:** If Code updates a task to `IN_PROGRESS` but then crashes or gets interrupted before completing it and writing the `outbox` file, the task will remain stuck in `IN_PROGRESS` indefinitely, preventing it from being re-processed.
12
+ * **Likelihood:** Medium.
13
+ * **Mitigation:** Enhance `bridge-init.sh` or `bridge-status.sh` to detect `IN_PROGRESS` tasks whose `CREATED` or `LAST_MODIFIED` timestamp is older than a defined threshold (e.g., 1 hour). The script should flag these as `STALE_IN_PROGRESS` in its output, prompting the user to manually review, reset to `PENDING`, or fail the task.
14
+
15
+ 3. **Non-atomic `LOCK` File Acquisition:**
16
+ * **Description:** The `LOCK` file acquisition (`cat > .ai-assistance/bridge/LOCK`) is not atomic. If two agents attempt to acquire the lock simultaneously, they could both believe they've succeeded, or one could overwrite the other's lock with a partial or incorrect state.
17
+ * **Likelihood:** Medium.
18
+ * **Mitigation:** Use a more robust, atomic locking mechanism. On Linux/macOS, `flock -xn .ai-assistance/bridge/LOCK_FILE_LOCK_HELPER -c "cat > .ai-assistance/bridge/LOCK << EOF..."` could be used. This ensures only one process obtains the exclusive lock to write the `LOCK` file.
19
+
20
+ 4. **Agent Misinterpretation of Git Diff for `wip:` Commit:**
21
+ * **Description:** The `code-working-tree-protocol.md` instructs Code to derive a `wip:` commit message by summarizing `git diff` output. This summarization is an AI task prone to hallucinations or misinterpretation, potentially leading to a generic, incorrect, or misleading `wip:` commit message.
22
+ * **Likelihood:** High.
23
+ * **Mitigation:** Provide a simpler default for the `wip:` commit message (e.g., "wip: in-progress changes by CoWork before Code took over") or instruct Code to be highly verbose in these summaries to reduce the risk of critical information loss. Alternatively, a script could simply list affected files for the `wip:` commit rather than attempting summarization.
24
+
25
+ 5. **Stale `bridge/STATUS` File:**
26
+ * **Description:** Although `bridge-init.sh` runs on `SessionStart`, if a task is created or completed *between* `SessionStart` and Code's first action, the `bridge/STATUS` file might be slightly stale. Code's prompt mentions running `bridge-init.sh` manually *if missing*, but not if potentially stale.
27
+ * **Likelihood:** Low, due to `SessionStart` hook.
28
+ * **Mitigation:** Instruct Code to explicitly check the timestamp of `bridge/STATUS` after reading it. If it's older than a very short threshold (e.g., 1 minute), Code should re-run `bridge-init.sh` to ensure it has the freshest information before responding to the user about pending tasks.
29
+
30
+ ## 2. Token-Offloading Assessment
31
+
32
+ The token-offloading strategy is largely **correct and effective**. The choice to offload deterministic, repetitive, and format-specific tasks to scripts (Bash/TypeScript) is well-justified and saves significant AI tokens.
33
+
34
+ **Areas where scripts effectively offload tokens:**
35
+ * **UUID Generation and File Naming:** Completely eliminates AI overhead for unique identifiers and consistent file paths.
36
+ * **Boilerplate File Creation and Archiving:** `task-create.ts` and `task-complete.ts` ensure correct Markdown formatting, status updates, and file movement, preventing AI from generating or validating these structures.
37
+ * **Environment and User Detection:** `bridge-init.sh` handles dynamic environment variables and git config lookups, which would be tedious for an AI.
38
+ * **Status Counting and Last Activity:** `bridge-status.sh` uses efficient shell commands to quantify bridge state, avoiding AI parsing of file contents for simple counts.
39
+ * **Automated Capability Checks:** `capabilities-check.ts` leverages a cheaper Haiku model for periodic, low-stakes verification, which is an excellent token-saving measure for the main agent.
40
+ * **Date/Time Formatting:** Ensures consistent ISO 8601 timestamps without AI effort.
41
+
42
+ **Gaps – Things still consuming unnecessary AI tokens:**
43
+
44
+ 1. **Parsing Markdown Content for Context/Request/Result:** While scripts create the structured Markdown, when CoWork needs to read the `Result` from an `outbox` or Code needs to read the `Context` and `Request` from an `inbox`, the AI still has to parse and interpret the free-form Markdown sections. This requires significant reasoning tokens.
45
+ * **Mitigation:** Create a new script, e.g., `task-read.ts`, which takes a task filename and outputs its sections (title, status, context, request, result, notes) in a structured format like JSON. Agents would then call this script and consume the JSON, reducing parsing and interpretation tokens.
46
+
47
+ 2. **Interpreting `LOCK` file `INTENT` and `FILES`:** When an agent encounters an active `LOCK` file, it must parse the `INTENT` and `FILES` fields from the Markdown to understand what the other agent is doing.
48
+ * **Mitigation:** A dedicated script, e.g., `lock-read.ts`, could parse the `LOCK` file and output its contents as JSON for easier consumption by the AI.
49
+
50
+ 3. **Summarizing `git diff` for `wip:` Commits:** As noted in Q1, the AI is explicitly instructed to summarize `git diff` output to create `wip:` commit messages. This is a complex natural language generation task that directly consumes tokens.
51
+ * **Mitigation:** A script could provide a more structured input to the AI (e.g., a list of changed files and line counts, rather than raw diff) or offer a fallback to a generic, less descriptive `wip:` message if summarization is too costly or complex.
52
+
53
+ **Over-automation (Things better left to AI):**
54
+ There are no apparent instances of over-automation. All scripted tasks are deterministic and non-creative, fitting well within the current offloading strategy.
55
+
56
+ ## 3. Simpler/More Robust Alternatives
57
+
58
+ The current file-based approach is a **pragmatic balance** between simplicity, git-friendliness, and robustness for a two-agent system within a shared git repository. Significant changes would introduce new complexities or trade-offs.
59
+
60
+ * **Replacing file-based with git notes:**
61
+ * **Trade-offs:** Would be *less simple* for agents to directly inspect (requiring `git notes show`), and `git notes` is not designed for complex, structured, and rapidly changing data like task queues. While potentially more robust regarding git's atomicity for data storage, concurrency management (e.g., multiple agents trying to modify the same note concurrently) would still be an issue. It would also likely *increase* AI token usage as agents would need to parse git command output.
62
+ * **Conclusion:** Not recommended. The current file-based approach is more transparent and easier for agents to handle.
63
+
64
+ * **Using a single `TASKS.md` instead of individual files:**
65
+ * **Trade-offs:** This would be **significantly less robust**. A single file would be a massive concurrency bottleneck, leading to constant git merge conflicts, race conditions, and corrupted data if multiple agents tried to update it simultaneously. Parsing a large, dynamically changing Markdown file to find and update specific task entries would be complex and token-intensive for the AI.
66
+ * **Conclusion:** Strongly discouraged. Individual files are crucial for minimizing conflicts and simplifying task management.
67
+
68
+ * **Using a shared SQLite DB:**
69
+ * **Trade-offs:**
70
+ * **More Robust:** **Highly robust** for concurrent reads/writes and atomic updates at the database level. Solves many of the concurrency issues inherent in file-based systems.
71
+ * **Less Simple (for integration):** Requires database access logic in scripts, and the `.db` file would either need to be `gitignored` (making it local-only, not shared across environments/machines) or committed to git. If committed, merging `.db` files in git is impractical, necessitating careful external tooling or a "last writer wins" approach which is generally unsafe for shared state.
72
+ * **Conclusion:** While technically more robust for concurrency, it introduces significant friction for sharing the state via git. For a bridge that must exist *within* a git repository and be shareable across distinct environments/machines via git, the file-based approach is generally more suitable than a committed SQLite DB. If the bridge was purely local to a single Code instance, SQLite would be a strong contender.
73
+
74
+ **Recommended Small Improvement:**
75
+
76
+ * **Enhance existing scripts for JSON output:** Instead of a wholesale replacement, invest in the `task-read.ts` (as suggested in Q2) and `lock-read.ts` scripts to provide structured (JSON) output of task and lock data. This improves AI efficiency without abandoning the git-friendly file-based approach.
77
+
78
+ ## 4. Blind Spots
79
+
80
+ 1. **Git Workflows (Rebasing, Force-push, Stash, Bisect):**
81
+ * **Severity:** High.
82
+ * **Notes:** The `archive/` folder, containing the history of bridge interactions, is committed to git. Advanced git operations like `rebase`, `bisect`, `cherry-pick`, or `force-push` can rewrite or alter git history. This could lead to a non-linear, broken, or misleading audit trail of bridge tasks. `bisect` would jump to states where tasks might be incomplete or not yet created. `git stash` might hide bridge files from agents. There are no instructions on how agents should interact with these scenarios to maintain bridge history integrity.
83
+
84
+ 2. **Long-running or Multi-step Tasks Spanning Multiple Sessions:**
85
+ * **Severity:** Medium.
86
+ * **Notes:** The current bridge task lifecycle (PENDING → IN_PROGRESS → DONE/FAILED) is atomic for single requests. However, it doesn't explicitly support a larger, multi-session, multi-step workflow for a complex feature or project. If a task requires multiple human interventions or distinct phases of execution (e.g., "Build X, get feedback, refine Y, deploy Z"), the agent would need to create multiple, disconnected bridge tasks, losing the overarching context. The 30-minute lock expiry also indicates short-lived operations.
87
+
88
+ 3. **Multi-Agent Coordination Beyond Two Environments:**
89
+ * **Severity:** Low (not in scope, but a future blind spot).
90
+ * **Notes:** The design is tightly coupled to CoWork ↔ Code. Expanding to three or more distinct AI agents (e.g., a dedicated "Reviewer" agent, or an external specialized service) would require extending the `FROM`/`TO` fields, the `username` prefixing convention, and potentially the `LOCK` mechanism to handle more complex concurrency.
91
+
92
+ 4. **Long-term Maintenance and Scalability of `archive/`:**
93
+ * **Severity:** Medium.
94
+ * **Notes:** The `archive/` folder is designed to grow indefinitely as an audit trail. Over time, it could become very large, increasing repository size, `git clone` times, and making it harder to search or parse the history effectively. There's no mechanism or convention for pruning old archived tasks.
95
+
96
+ 5. **Security (Unrestricted Shell & Trust Model):**
97
+ * **Severity:** High.
98
+ * **Notes:** Code has "unrestricted shell" access, and `task-complete.ts` can run `--dangerously-skip-permissions`. This makes the `Request` field in an `inbox` task a critical security vulnerability. An attacker gaining write access to the git repository (or a compromised CoWork session) could submit a malicious task requesting arbitrary shell commands (e.g., `rm -rf /`, exfiltrate sensitive files, install malware). While the user is conceptually in the loop, an agent operating `--dangerously-skip-permissions` could bypass human review. The trust model assumes bridge tasks are always benign.
99
+
100
+ ## Overall Assessment
101
+
102
+ This design is **sound and highly practical** for its stated purpose as a file-based, git-backed connector delegation service between Claude CoWork and Claude Code. It effectively leverages scripting to offload token-heavy, deterministic tasks and provides clear communication conventions.
103
+
104
+ The single most important thing to fix is addressing the **security implications of Code's unrestricted shell access** in combination with potentially unverified bridge tasks. This necessitates explicit rules for Code to *always* prompt the user before executing any command requested via a bridge task, or to strictly whitelist command types. Concurrently, making the `IN_PROGRESS` status update and `LOCK` acquisition atomic would significantly improve robustness against internal failure modes.
@@ -0,0 +1,42 @@
1
+ # Project Context
2
+
3
+ Last updated: 2026-06-03
4
+ Maintained by: both CoWork and Code — update when you learn something new
5
+
6
+ ---
7
+
8
+ ## Repositories
9
+
10
+ | Repo | Location |
11
+ |------|----------|
12
+ | ecoportal-api-graphql | GitLab: `oscar/ecoportal-api-graphql` |
13
+
14
+ ---
15
+
16
+ ## Team
17
+
18
+ | Username | Environment preference |
19
+ |----------|----------------------|
20
+ | oscar | CoWork for planning/docs, Code for git/GitLab |
21
+
22
+ ---
23
+
24
+ ## Tool boundaries
25
+
26
+ | Task | Use |
27
+ |------|-----|
28
+ | GitLab MRs, branches, pipelines, issues | Code + GitLab plugin |
29
+ | Git operations on local repo | Code |
30
+ | Documents, spreadsheets, research, planning | CoWork |
31
+ | Scheduling, file organisation, briefs | CoWork |
32
+ | Anything requiring machine-level access | Code |
33
+
34
+ ---
35
+
36
+ ## Key architectural decisions
37
+
38
+ - Bridge lives in `.claude/bridge/` — tracked in git, co-located with code
39
+ - Task files are UUID + username prefixed — no merge conflicts on pull
40
+ - Scripts handle file ops and env detection — agents consume structured output, not raw files
41
+ - `capabilities/assumptions-log.md` tracks stale knowledge — review periodically
42
+ - Archive is committed — it's the audit trail of AI-assisted work
File without changes
File without changes
@@ -0,0 +1,48 @@
1
+ # Request for ep-ai-standards: Cross-Repo Skill Discovery
2
+ STATUS: DONE
3
+ COMPLETED: 2026-06-11
4
+ FROM: code (ep-ai-standards session)
5
+ TO: cowork / ecoportal-api-graphql session
6
+
7
+ ## Result
8
+
9
+ All three components implemented and pushed to ep-ai-standards main.
10
+
11
+ ### skills-library/discovery-manifest.yaml
12
+ Machine-readable index mapping 6 repo types to relevant skills + conventions:
13
+ - `org-integration` → ruby-scripting, code-specs, project-cycle + cross-platform + PII conventions
14
+ - `ruby-gem` → ruby-scripting, code-specs, refactor, dep-graph
15
+ - `ruby-scripts` → ruby-scripting, code-specs, project-cycle
16
+ - `rails-app` → code-specs, refactor, spec-generation, dep-graph
17
+ - `typescript-lib` → code-specs, refactor
18
+ - `aws-cdk` → code-specs, refactor
19
+
20
+ Detection signals Claude can evaluate: `file_exists`, `file_not_exists`, `file_any`,
21
+ `gemfile_includes`, `directory_any`. eP_AI_Manager always proposed regardless of type.
22
+
23
+ ### templates/CLAUDE.thin-client.md.template
24
+ Minimal stub CLAUDE.md. Fill in: repo name, ep-ai-standards path, type, description.
25
+ The session-start instructions tell Claude to read the manifest, verify detection signals,
26
+ and propose skills with one-line reasons — never auto-apply.
27
+
28
+ ### docs/guides/thin-client-repos.md
29
+ Full setup guide covering:
30
+ - Thin-client vs full scaffold decision table
31
+ - 3-step setup (copy template, declare type, verify at first session)
32
+ - multi_org_api worked example (type: org-integration)
33
+ - Reference-over-sync model explained
34
+ - Upgrade path to full scaffold via install.sh --mode retrofit
35
+
36
+ ## Next steps (in TODO.md)
37
+
38
+ 1. Deploy thin-client CLAUDE.md to `multi_org_api`
39
+ (C:/ruby_scripts/implementation/orgs/multi_org_api, type: org-integration)
40
+ 2. Deploy to `training/` as second test case
41
+ 3. Add thin-client detection to check-alignment.sh (avoids false MISSING for thin-client repos)
42
+
43
+ ## Notes
44
+
45
+ The mechanism is entirely instruction-driven — the stub CLAUDE.md itself tells Claude what
46
+ to do at session start. No new script or skill install needed for the initial discovery phase.
47
+ The reference-over-sync model means multi_org_api will always see the latest skills as long
48
+ as ep-ai-standards is at the declared path.
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,27 @@
1
+ # Capabilities
2
+
3
+ These files describe what each environment can do natively.
4
+ Before writing a bridge task, check your environment's file — if you can do it yourself, do it.
5
+
6
+ ## Files
7
+
8
+ | File | Purpose |
9
+ |------|---------|
10
+ | `cowork.md` | What Claude in CoWork can do natively |
11
+ | `code.md` | What Claude Code can do natively |
12
+ | `connectors.md` | Connector registry — which env, auth status, last verified |
13
+ | `assumptions-log.md` | Dated log of assumptions and their verification status |
14
+
15
+ ## Keeping these current
16
+
17
+ Capabilities change. The `capabilities-check.ts` script runs periodically and updates
18
+ `assumptions-log.md` with verification results.
19
+
20
+ If you notice a capability is wrong or stale during normal work:
21
+ 1. Note it in `assumptions-log.md` with today's date and STATUS: NEEDS_REVIEW
22
+ 2. Do not silently act on stale information
23
+
24
+ ## Last full review
25
+
26
+ 2026-06-04 — revised bridge scope (connector delegation only, not working tree changes);
27
+ updated cowork.md, code.md, connectors.md with confirmed auth status for GitLab/Gemini/GitKraken
@@ -0,0 +1,80 @@
1
+ # Assumptions Log
2
+
3
+ Tracks assumptions baked into this setup and their verification status.
4
+ Updated by `scripts/capabilities-check.ts` and manually by any agent.
5
+
6
+ ## Statuses
7
+
8
+ - `CONFIRMED` — verified against a live source, date noted
9
+ - `NEEDS_REVIEW` — time has passed or something seems off, check it
10
+ - `RESOLVED` — was a limitation, now fixed (note how)
11
+ - `INVALIDATED` — assumption was wrong, note what's actually true
12
+
13
+ ---
14
+
15
+ ## Log
16
+
17
+ ### 2026-06-03 — GitLab plugin is Code-only
18
+ STATUS: CONFIRMED
19
+ Last checked: 2026-06-03
20
+ Source: claude.com/plugins/gitlab ("Install in Claude Code" label)
21
+ Notes: Plugin page explicitly states Code-only. CoWork must bridge to Code for all GitLab operations.
22
+
23
+ ### 2026-06-03 — Model knowledge cutoff is May 2025
24
+ STATUS: CONFIRMED
25
+ Last checked: 2026-06-03
26
+ Source: claude-sonnet-4-6 system context
27
+ Notes: ~13 months behind current date (June 2026). Product features, connector availability,
28
+ and plugin ecosystem may have changed significantly. Always verify product claims against
29
+ live sources (claude.com/plugins, docs.claude.ai) rather than training data.
30
+ ACTION: When current model names, API versions, or library releases are needed, ask Gemini
31
+ via the gemini-assist skill or ask the user to run a live API check. Do NOT guess at current
32
+ model IDs (e.g. Gemini model strings) from training data — they change frequently.
33
+
34
+ ### 2026-06-03 — CoWork sandbox has allowlisted (not open) network access
35
+ STATUS: CONFIRMED — CAUSE IDENTIFIED, BEING RESOLVED
36
+ Last checked: 2026-06-03
37
+ Source: CoWork system prompt + Gemini research (2026-06-03)
38
+ Notes: Sandbox restrictions are compounded by MSIX packaging (see entry below).
39
+ After switching to winget install, standard sandbox behaviour should apply.
40
+ GitLab API still not reachable without credentials regardless of install method.
41
+
42
+ ### 2026-06-03 — Claude Desktop installed as MSIX causes silently virtualised AppData paths
43
+ STATUS: CONFIRMED — BEING RESOLVED
44
+ Last checked: 2026-06-03
45
+ Source: Gemini research citing github.com/anthropics/claude-code/issues/58421,
46
+ linkedin.com/pulse/windows-has-two-completely-different-install-claude-desktop-morrison
47
+ Notes: Anthropic ships the Windows desktop app as an MSIX package. Windows silently
48
+ redirects all AppData writes to a sandboxed container at:
49
+ AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude\
50
+ instead of the documented AppData\Roaming\Claude\. This causes:
51
+ - MCP config "Edit Config" button opening the wrong path (silently ignored)
52
+ - Claude Code sandbox running inside an extra layer of Windows MSIX isolation
53
+ - Plugin skills loaded from wrong paths (GitHub issue 10 Feb 2026)
54
+ - CoWork VM bundle (claudevm.bundle / rootfs.vhdx) stored under LocalCache
55
+ FIX: Uninstall MSIX version, reinstall via winget (Anthropic.Claude) or standalone
56
+ .exe with "Choose where to get apps" set to Anywhere in Windows settings.
57
+ After fix, config lives at the documented path: AppData\Roaming\Claude\
58
+ Session data migration: copy LocalCache\Roaming\Claude\ → AppData\Roaming\Claude\
59
+ Resolution confirmed by user oscar@ecoportal.co.nz on 2026-06-03.
60
+
61
+ ### 2026-06-03 — CoWork and Code sessions share no automatic context
62
+ STATUS: CONFIRMED
63
+ Last checked: 2026-06-03
64
+ Source: Architecture — separate processes, separate auth
65
+ Notes: The bridge folder is the only reliable shared context mechanism.
66
+ Account-level "Access your Claude Code sessions" permission scope not confirmed
67
+ to provide cross-session history access.
68
+
69
+ ### 2026-06-03 — Gemini connector is available in Code (not CoWork)
70
+ STATUS: NEEDS_REVIEW
71
+ Last checked: 2026-06-03
72
+ Source: Plugin search — not definitively confirmed
73
+ Notes: Assumed based on Code's broader plugin ecosystem. Verify at claude.com/plugins.
74
+
75
+ ---
76
+
77
+ ## Review schedule
78
+
79
+ Run `scripts/capabilities-check.ts` monthly, or whenever a task fails due to a
80
+ capability assumption. The script flags entries older than 30 days as NEEDS_REVIEW.
@@ -0,0 +1,47 @@
1
+ # Code Native Capabilities
2
+
3
+ Last verified: 2026-06-04
4
+ Environment: Claude Code CLI (terminal / VS Code / desktop app Code mode)
5
+
6
+ ## Can do natively
7
+
8
+ - Full local machine access (read/write any file, run any command)
9
+ - Git operations (clone, pull, push, branch, merge, diff, log)
10
+ - Install software and packages
11
+ - Run scripts in any language (Ruby, TypeScript, Python, Bash, etc.)
12
+ - Spawn parallel subagents (fan-out tasks)
13
+ - Scheduled via /schedule, /loop, or Routines (run on Anthropic infra, laptop off)
14
+ - Remote control via mobile app
15
+ - Claude SDK (TypeScript) for programmatic agent creation
16
+
17
+ ## Connectors available in Code
18
+
19
+ See `connectors.md` for the full registry.
20
+
21
+ Confirmed available (2026-06-04):
22
+ - GitLab (`gitlab-mr-mcp` via PAT — expiry April 2027, rotation enabled)
23
+ - GitKraken (via `gk mcp` CLI — requires `gk auth login`)
24
+ - Gemini (via `gemini-mcp-server.js` + `GEMINI_API_KEY` in `.env`)
25
+ - GitHub (if installed)
26
+ - Playwright (browser automation, if installed)
27
+
28
+ ## Cannot do
29
+
30
+ - CoWork-specific artifacts (live HTML widgets persisted in CoWork UI)
31
+ - CoWork scheduled tasks (require desktop app UI)
32
+ - Access CoWork conversation history directly
33
+
34
+ ## Role in the bridge
35
+
36
+ Code is the **bridge execution environment** — it receives connector delegation tasks
37
+ from CoWork and calls the required external service. When Code picks up a bridge task:
38
+
39
+ 1. Check `connectors.md` — confirm the required connector is available and authenticated
40
+ 2. If connector is missing or needs-setup: write a FAILED outbox immediately, explain what's needed
41
+ 3. If connector is available: call it, write the result to outbox
42
+ 4. Do not make working tree changes as part of a bridge task unless the task explicitly requests it
43
+
44
+ ## When to bridge to CoWork
45
+
46
+ Write a bridge task to CoWork only when the task requires CoWork-specific features
47
+ (artifacts, scheduled tasks, CoWork-only connectors). This is rare — Code can do most things directly.
@@ -0,0 +1,37 @@
1
+ # Connector Registry
2
+
3
+ Each row is a connector/plugin. Update `last-verified` when you confirm its status.
4
+ Run `scripts/capabilities-check.ts` to automate verification.
5
+
6
+ ## Format
7
+
8
+ | Connector | CoWork | Code | Auth status | Last verified |
9
+ |-----------|--------|------|-------------|---------------|
10
+ | name | ✓/✗ | ✓/✗ | ok / needs-setup / unknown | YYYY-MM-DD |
11
+
12
+ ---
13
+
14
+ ## Registry
15
+
16
+ | Connector | CoWork | Code | Auth status | Notes | Last verified |
17
+ |-----------|--------|------|-------------|-------|---------------|
18
+ | GitLab | ✗ | ✓ | ok | PAT configured in `.env` + `claude_desktop_config.json`. Expiry April 2027, rotation enabled. Scopes: read_api, read_repository, create_runner, ai_features. CoWork ✗ confirmed — even with config entry, gitlab-mr-mcp does not connect in CoWork. Bridge to Code. | 2026-06-04 |
19
+ | GitKraken | ✗ | ✓ | ok | `gk mcp` confirmed working in Code (branch lookup verified). Config written to `claude_desktop_config.json` but CoWork ✗ — MCP servers in Desktop config do not surface as CoWork connectors. Bridge to Code for git context. | 2026-06-04 |
20
+ | Gemini | ✗ | ✓ | ok | `gemini-mcp-server.js` + `GEMINI_API_KEY` in `.env`. Model: gemini-2.5-flash. **Note:** `gemini_ask.rb` fails on Windows (SSL cert issue) — use PowerShell `Invoke-RestMethod` or the MCP server instead. MCP server path in global settings may point to `.ai-assistance/skills/` — verify if MCP tool becomes unavailable. | 2026-06-04 |
21
+ | GitHub | ✗ | ✓ | unknown | Not tested in this project | 2026-06-03 |
22
+ | Slack | ✓ | ✗ | unknown | Not authenticated in this project | 2026-06-03 |
23
+ | Notion | ✓ | ✗ | unknown | Not authenticated in this project | 2026-06-03 |
24
+ | Google Drive | ✓ | ✗ | unknown | Not authenticated in this project | 2026-06-03 |
25
+ | Gmail | ✓ | ✗ | unknown | Not authenticated in this project | 2026-06-03 |
26
+ | HubSpot | ✓ | ✗ | unknown | Not authenticated in this project | 2026-06-03 |
27
+ | Asana | ✓ | ✗ | unknown | Not authenticated in this project | 2026-06-03 |
28
+ | Linear | ✓ | ✓ | unknown | Not authenticated in this project | 2026-06-03 |
29
+
30
+ ## Notes
31
+
32
+ - ✗ does not mean permanently unavailable — check claude.com/plugins for current availability
33
+ - Auth status `unknown` = not tested in this project yet
34
+ - Auth status `needs-setup` = connector present but credentials missing — write a bridge task to Code to complete setup (Code handles OAuth flows; CoWork cannot)
35
+ - Auth status `ok` = confirmed working in at least one session
36
+ - Bridge-eligible connectors (CoWork ✗, Code ✓) are the ones CoWork delegates to via the bridge
37
+ - Source for CoWork vs Code availability: claude.com/plugins/[name] → "Install in" label
@@ -0,0 +1,55 @@
1
+ # CoWork Native Capabilities
2
+
3
+ Last verified: 2026-06-04
4
+ Environment: Claude desktop app — CoWork mode
5
+
6
+ ## Can do natively
7
+
8
+ - Read, write, edit files in connected folders (including all of `.ai-assistance/`)
9
+ - Web search and page fetch
10
+ - Bash sandbox (Ubuntu 22, Python/Node preinstalled, allowlisted network)
11
+ - Create documents: .docx, .pptx, .xlsx, .pdf, .md, .html
12
+ - Render live HTML/React artifacts (persist across sessions)
13
+ - Scheduled tasks (while desktop app is open)
14
+ - Skills: docx, pptx, xlsx, pdf, and all installed plugin skills
15
+
16
+ ## Cannot do
17
+
18
+ - Write or edit files under `.ai-assistance/` (application-layer guard on that path)
19
+ - Direct git operations (clone, push, pull, branch, commit)
20
+ - Install software on host machine
21
+ - Run commands outside the bash sandbox
22
+ - Access Code sessions or terminal history
23
+ - Use MCP servers defined in `claude_desktop_config.json` — those do not surface as
24
+ CoWork connectors. CoWork connectors are installed via Settings → Plugins only.
25
+ Verified 2026-06-04: GitLab and GitKraken written to Desktop config, neither
26
+ appeared as available connectors in CoWork.
27
+
28
+ ## Connectors available in CoWork
29
+
30
+ See `connectors.md` for the full registry. Install via Settings → Plugins.
31
+
32
+ Confirmed available (2026-06-04):
33
+ - Google Workspace (Drive, Gmail, Calendar) — if authenticated
34
+ - Slack — if authenticated
35
+ - Notion — if authenticated
36
+ - HubSpot, Intercom, Asana, Linear, etc. — if plugin installed + authenticated
37
+
38
+ ## When to use the bridge
39
+
40
+ The bridge is a **connector delegation service** — use it only when you need to call
41
+ a service that CoWork cannot reach. Do not bridge for working tree edits, documentation,
42
+ or anything in the "Can do natively" list above.
43
+
44
+ Bridge to Code when you need:
45
+
46
+ | Connector / service | Why Code has it |
47
+ |---------------------|-----------------|
48
+ | Gemini | Gemini MCP configured in Code |
49
+ | GitLab (MRs, pipelines, issues) | GitLab MCP configured in Code |
50
+ | GitKraken (git history, branches) | GitKraken MCP configured in Code |
51
+ | Unrestricted shell (host-level) | Code runs outside the sandbox |
52
+
53
+ Before writing a bridge task, check `connectors.md` to confirm the connector is
54
+ available and authenticated in Code. If status is `unknown` or `needs-setup`, note
55
+ that in the bridge task so Code can surface the issue.
@@ -0,0 +1,155 @@
1
+ # Code Spec: ecoportal-api-graphql — Gem Overview
2
+
3
+ **Scope:** High-level structure, entry points, key patterns, and namespace conventions for the whole gem. Does NOT cover per-area implementation detail — see area-specific docs in `.ai-assistance/code/` for those.
4
+ **Last updated:** 2026-06-02
5
+ **Key files:**
6
+ - `lib/ecoportal/api-graphql.rb` — gem entry point (requires upstream, boots namespace)
7
+ - `lib/ecoportal/api/graphql.rb` — main `Ecoportal::API::GraphQL` class
8
+ - `lib/ecoportal/api/common/graphql/client.rb` — GraphQL HTTP client (wraps graphlient)
9
+ - `ecoportal-api-graphql.gemspec` — gem spec and dependencies
10
+
11
+ ---
12
+
13
+ ## Overview
14
+
15
+ `ecoportal-api-graphql` provides a Ruby client for EcoPortal's GraphQL API. It wraps `graphlient` (which wraps `graphql-client`) and builds a structured layer of models, queries, mutations, fragments, inputs, payloads, and builders on top of it.
16
+
17
+ The gem is used primarily by `eco-helpers` (downstream). Backwards compatibility with `eco-helpers` must be preserved unless explicitly broken.
18
+
19
+ ---
20
+
21
+ ## Dependency Chain
22
+
23
+ ```
24
+ graphql-ruby (rmosolgo) — schema definition side (not directly used as a dep)
25
+ graphql-client — low-level HTTP+parsing
26
+ graphlient — friendlier wrapper around graphql-client (~> 0.8)
27
+ ecoportal-api (~> 0.10) — REST API base (auth, org context)
28
+ ecoportal-api-v2 (~> 3.3) — REST API v2 (required by entry point)
29
+
30
+ ecoportal-api-graphql ← THIS GEM
31
+
32
+ eco-helpers — downstream consumer
33
+ ```
34
+
35
+ ---
36
+
37
+ ## Entry Point
38
+
39
+ `require 'ecoportal/api-graphql'` loads:
40
+ 1. `ecoportal-api-v2` (and transitively `ecoportal-api`)
41
+ 2. `ecoportal/api/graphql_version`
42
+ 3. `ecoportal/api/common.graphql` — shared common GraphQL utilities
43
+ 4. `ecoportal/api/graphql` — the main class + all sub-requires
44
+
45
+ Load order within `graphql.rb`:
46
+ `helpers` → `concerns` → `logic/base_model` → `error` → `interface` → `base` → `model` → `logic` → `connection` → `payload` → `input` → `fragment` → `query` → `mutation` → `builder`
47
+
48
+ ---
49
+
50
+ ## Main Class: `Ecoportal::API::GraphQL`
51
+
52
+ The public entry point. Instantiated with credentials:
53
+
54
+ ```ruby
55
+ api = Ecoportal::API::GraphQL.new(email: "...", pass: "...", org_id: "...", host: "live.ecoportal.com")
56
+ ```
57
+
58
+ Key public methods:
59
+ - `#currentOrganization` / `#currentOrganizationClass` — returns `Model::Organization` with client set
60
+ - `#contractorEntity` → `Builder::ContractorEntity`
61
+ - `#locationStructure` → `Builder::LocationStructure`
62
+ - `#action` → `Builder::Action`
63
+ - `#createContractorEntity(input:)` — convenience shortcut (delegates to mutation)
64
+
65
+ Includes `Common::GraphQL::ClassHelpers` for `class_resolver` — allows subclasses to override `client_class`.
66
+
67
+ ---
68
+
69
+ ## Namespace Convention
70
+
71
+ **IMPORTANT:** The module is `Ecoportal::API::GraphQL` (capital Q, capital L) but Ruby casing — NOT `Ecoportal::API::GraphQl`. File paths use lowercase: `graphql/`.
72
+
73
+ Class nesting mirrors folder structure exactly:
74
+
75
+ | Folder | Module/Class |
76
+ |--------|-------------|
77
+ | `graphql/model/` | `GraphQL::Model::*` |
78
+ | `graphql/input/` | `GraphQL::Input::*` |
79
+ | `graphql/mutation/` | `GraphQL::Mutation::*` |
80
+ | `graphql/query/` | `GraphQL::Query::*` |
81
+ | `graphql/builder/` | `GraphQL::Builder::*` |
82
+ | `graphql/fragment/` | `GraphQL::Fragment::*` |
83
+ | `graphql/payload/` | `GraphQL::Payload::*` |
84
+ | `graphql/connection/` | `GraphQL::Connection::*` |
85
+ | `graphql/logic/` | `GraphQL::Logic::*` |
86
+ | `graphql/base/` | `GraphQL::Base::*` |
87
+ | `graphql/interface/` | `GraphQL::Interface::*` |
88
+ | `graphql/error/` | `GraphQL::Error::*` |
89
+
90
+ ---
91
+
92
+ ## Architectural Layers
93
+
94
+ ```
95
+ Builder High-level façade — developer-facing API per domain
96
+
97
+ Query / Mutation GraphQL operation definitions
98
+
99
+ Logic Execution layer (base_query, base_model, query, mutation, payload, input, connection)
100
+
101
+ Fragment GraphQL fragment strings
102
+
103
+ Model Response data models (read side)
104
+ Input / Payload Mutation arguments (write side) and mutation responses
105
+
106
+ Base Shared base classes for models
107
+ Interface GraphQL interface type definitions
108
+
109
+ Common::GraphQL::Client HTTP layer (graphlient wrapper with auth)
110
+ ```
111
+
112
+ ---
113
+
114
+ ## Common::GraphQL Layer
115
+
116
+ Lives in `lib/ecoportal/api/common/graphql/`. Key classes:
117
+
118
+ - `Client` — extends `Graphlient::Client`. Handles auth (`AuthService`), org_id, timeouts (90s read/write). `no_schema: true` skips schema introspection.
119
+ - `Model` — base model class for response parsing.
120
+ - `ClassHelpers` — `class_resolver` macro for dependency injection of class references.
121
+ - `HashHelpers` — hash utility methods.
122
+ - `QueryIntegration` — mixin for query execution.
123
+ - `Patches` — monkey-patches to upstream libs (review carefully before changing).
124
+
125
+ ---
126
+
127
+ ## Domain Objects
128
+
129
+ The gem covers these EcoPortal GraphQL domains:
130
+
131
+ | Domain | Builder | Key Model | Key Mutations |
132
+ |--------|---------|-----------|--------------|
133
+ | Location Structure | `Builder::LocationStructure` | `Model::LocationStructure` | draft create/delete/publish, apply_commands |
134
+ | Contractor Entity | `Builder::ContractorEntity` | `Model::ContractorEntity` | create, update, destroy |
135
+ | Action | `Builder::Action` | `Model::Action` | create, update, archive |
136
+ | Organization | — (direct on GraphQL class) | `Model::Organization` | — |
137
+ | Page | — | `Model::Page` | — |
138
+
139
+ ---
140
+
141
+ ## Gotchas / Non-Obvious Behaviours
142
+
143
+ - `no_schema: true` is always passed — schema introspection is disabled. Queries are not validated against a schema at build time.
144
+ - `GraphQL::Fragment` is instantiated at GraphQL init and passed around — it's a container for fragment string definitions.
145
+ - `Builder` classes take a `client` directly, not a `GraphQL` instance.
146
+ - `Logic::BaseModel` inherits from `Common::GraphQL::Model` and adds a class-level `client` accessor. Most model/query classes inherit from this.
147
+ - `class_resolver` (from `ClassHelpers`) allows subclasses to override which concrete class is used — important for testing and extension.
148
+
149
+ ---
150
+
151
+ ## TODOs / Open Questions
152
+
153
+ - [ ] Per-area code spec docs need to be created as analysis progresses.
154
+ - [ ] `Common::GraphQL::Patches` contents not yet reviewed — may contain important behavioural notes.
155
+ - [ ] Spec coverage is minimal — `spec/ecoportal/api_spec.rb` exists but subdirectory coverage is sparse.