ecoportal-api-graphql 1.3.13 → 1.3.16
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +87 -0
- data/lib/ecoportal/api/common/graphql/client.rb +0 -2
- data/lib/ecoportal/api/common/graphql/http_client.rb +6 -0
- data/lib/ecoportal/api/graphql/base/ai_summary_version.rb +17 -17
- data/lib/ecoportal/api/graphql/base/file_container.rb +14 -14
- data/lib/ecoportal/api/graphql/base/location_classification_type.rb +15 -15
- data/lib/ecoportal/api/graphql/base/location_structure.rb +27 -27
- data/lib/ecoportal/api/graphql/base/organization.rb +15 -15
- data/lib/ecoportal/api/graphql/base/page/task.rb +24 -0
- data/lib/ecoportal/api/graphql/base/page.rb +17 -16
- data/lib/ecoportal/api/graphql/base/template.rb +35 -0
- data/lib/ecoportal/api/graphql/base.rb +37 -35
- data/lib/ecoportal/api/graphql/builder/contractor_entity.rb +41 -41
- data/lib/ecoportal/api/graphql/compat/response.rb +35 -35
- data/lib/ecoportal/api/graphql/connection/action.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/action_category.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/contractor_entity.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/page.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/person_member.rb +11 -11
- data/lib/ecoportal/api/graphql/connection/preview_page.rb +11 -11
- data/lib/ecoportal/api/graphql/connection.rb +17 -17
- data/lib/ecoportal/api/graphql/file_upload/client.rb +21 -10
- data/lib/ecoportal/api/graphql/fragment/field_configuration.rb +38 -0
- data/lib/ecoportal/api/graphql/fragment/force.rb +14 -10
- data/lib/ecoportal/api/graphql/fragment/location_node.rb +26 -26
- data/lib/ecoportal/api/graphql/fragment/page_task.rb +39 -0
- data/lib/ecoportal/api/graphql/fragment/template.rb +51 -0
- data/lib/ecoportal/api/graphql/fragment.rb +3 -0
- data/lib/ecoportal/api/graphql/input/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/input/preset_view/update.rb +16 -16
- data/lib/ecoportal/api/graphql/input/workflow_command/add_stage.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_field_configuration.rb +21 -21
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page.rb +28 -28
- data/lib/ecoportal/api/graphql/input/workflow_command/edit_page_creator_permissions.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/cross_reference.rb +23 -23
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/date.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/image_gallery.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/people.rb +24 -24
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/plain_text.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/rich_text.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/field_config/select.rb +20 -20
- data/lib/ecoportal/api/graphql/input/workflow_command/move_field.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_forces.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command/reorder_section.rb +18 -18
- data/lib/ecoportal/api/graphql/input/workflow_command.rb +251 -251
- data/lib/ecoportal/api/graphql/input.rb +24 -24
- data/lib/ecoportal/api/graphql/logic/connection.rb +34 -34
- data/lib/ecoportal/api/graphql/model/page/task.rb +16 -0
- data/lib/ecoportal/api/graphql/model/page.rb +16 -15
- data/lib/ecoportal/api/graphql/model/person_member.rb +15 -15
- data/lib/ecoportal/api/graphql/model/template.rb +15 -0
- data/lib/ecoportal/api/graphql/model.rb +32 -30
- data/lib/ecoportal/api/graphql/mutation/ai_summary/generate.rb +45 -45
- data/lib/ecoportal/api/graphql/mutation/ai_summary/submit_feedback.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/mutation/page/approve_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/batch_update_review_task.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/create_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/delete_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/execute_force_commands.rb +7 -7
- data/lib/ecoportal/api/graphql/mutation/page/execute_workflow_commands.rb +8 -7
- data/lib/ecoportal/api/graphql/mutation/page/publish_draft.rb +38 -40
- data/lib/ecoportal/api/graphql/mutation/page/reject_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/restart_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/page/undo_review_task.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/preset_view/destroy.rb +34 -35
- data/lib/ecoportal/api/graphql/mutation/register/destroy.rb +35 -35
- data/lib/ecoportal/api/graphql/mutation/smart_fill/generate.rb +36 -36
- data/lib/ecoportal/api/graphql/mutation/smart_fill/submit_feedback.rb +40 -40
- data/lib/ecoportal/api/graphql/mutation/smart_fill.rb +13 -13
- data/lib/ecoportal/api/graphql/mutation/template/create_related_page.rb +46 -46
- data/lib/ecoportal/api/graphql/mutation/template/destroy_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation/template/update_information.rb +1 -1
- data/lib/ecoportal/api/graphql/mutation.rb +20 -20
- data/lib/ecoportal/api/graphql/payload/contractor_entity.rb +14 -14
- data/lib/ecoportal/api/graphql/payload/ok_payload.rb +36 -21
- data/lib/ecoportal/api/graphql/payload/page/draft.rb +26 -13
- data/lib/ecoportal/api/graphql/payload/page/review_task.rb +13 -13
- data/lib/ecoportal/api/graphql/payload/page/review_task_batch.rb +23 -0
- data/lib/ecoportal/api/graphql/payload/page.rb +20 -19
- data/lib/ecoportal/api/graphql/payload/preset_view.rb +15 -11
- data/lib/ecoportal/api/graphql/payload/register.rb +15 -11
- data/lib/ecoportal/api/graphql/payload/template/create_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/template/destroy_related_page.rb +1 -1
- data/lib/ecoportal/api/graphql/payload/template/update_information.rb +1 -1
- data/lib/ecoportal/api/graphql/payload.rb +23 -23
- data/lib/ecoportal/api/graphql/query/location_structures.rb +57 -57
- data/lib/ecoportal/api/graphql/query/page.rb +45 -45
- data/lib/ecoportal/api/graphql/query/page_with_forces.rb +9 -3
- data/lib/ecoportal/api/graphql/query/pages_workflow_commands.rb +9 -3
- data/lib/ecoportal/api/graphql/query/register_preset_views.rb +78 -78
- data/lib/ecoportal/api/graphql/query.rb +27 -27
- data/lib/ecoportal/api/graphql.rb +9 -5
- data/lib/ecoportal/api/graphql_version.rb +1 -1
- metadata +9 -180
- data/.ai-assistance/bridge/CLAUDE.md +0 -338
- data/.ai-assistance/bridge/archive/.gitkeep +0 -0
- data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.inbox.md +0 -29
- data/.ai-assistance/bridge/archive/oscar-a1b2c3d-gitlab-mcp-doc-update.outbox.md +0 -18
- data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.inbox.md +0 -42
- data/.ai-assistance/bridge/archive/oscar-c912c25-gemini-design-review.outbox.md +0 -115
- data/.ai-assistance/bridge/context/gemini-review-prompt.txt +0 -48
- data/.ai-assistance/bridge/context/gemini-review-response.md +0 -104
- data/.ai-assistance/bridge/context/project.md +0 -42
- data/.ai-assistance/bridge/inbox/.gitkeep +0 -0
- data/.ai-assistance/bridge/outbox/.gitkeep +0 -0
- data/.ai-assistance/bridge/outbox/request-for-standards-discovery.md +0 -48
- data/.ai-assistance/bridge/queue/.gitkeep +0 -1
- data/.ai-assistance/capabilities/CLAUDE.md +0 -27
- data/.ai-assistance/capabilities/assumptions-log.md +0 -80
- data/.ai-assistance/capabilities/code.md +0 -47
- data/.ai-assistance/capabilities/connectors.md +0 -37
- data/.ai-assistance/capabilities/cowork.md +0 -55
- data/.ai-assistance/code/OVERVIEW.md +0 -155
- data/.ai-assistance/code/data_fields.md +0 -242
- data/.ai-assistance/code/dependencies.md +0 -151
- data/.ai-assistance/code/diff_as_input.md +0 -234
- data/.ai-assistance/code/diff_pairing_engine.md +0 -243
- data/.ai-assistance/code/diff_service_deep_dive.md +0 -192
- data/.ai-assistance/code/ecoPortal_architecture/00_overview_and_index.md +0 -55
- data/.ai-assistance/code/ecoPortal_architecture/01_terminology_dictionary.md +0 -181
- data/.ai-assistance/code/ecoPortal_architecture/02_data_model.md +0 -192
- data/.ai-assistance/code/ecoPortal_architecture/03_api_layers.md +0 -147
- data/.ai-assistance/code/ecoPortal_architecture/04_graphql_queries_mutations.md +0 -277
- data/.ai-assistance/code/ecoPortal_architecture/05_page_workflows.md +0 -200
- data/.ai-assistance/code/ecoPortal_architecture/06_search_and_filters.md +0 -228
- data/.ai-assistance/code/ecoPortal_architecture/07_data_fields.md +0 -197
- data/.ai-assistance/code/ecoPortal_architecture/08_stages_sections.md +0 -243
- data/.ai-assistance/code/ecoPortal_architecture/09_people_contractors_locations.md +0 -196
- data/.ai-assistance/code/ecoPortal_architecture/10_forces_workflow_builder.md +0 -132
- data/.ai-assistance/code/ecoPortal_architecture/11_integration_gems.md +0 -187
- data/.ai-assistance/code/ecoPortal_architecture/12_ai_documentation_sources_gaps.md +0 -236
- data/.ai-assistance/code/ecoPortal_architecture/13_ai_infrastructure.md +0 -183
- data/.ai-assistance/code/ecoportal_schema_reference.md +0 -240
- data/.ai-assistance/code/filter_contract_matrix.md +0 -177
- data/.ai-assistance/code/graphql_domain_knowledge.md +0 -240
- data/.ai-assistance/code/refactoring/datafield-readwrite-shape-asymmetry.md +0 -71
- data/.ai-assistance/code/refactoring/opportunities.md +0 -251
- data/.ai-assistance/code/schema_analysis.md +0 -321
- data/.ai-assistance/code/search_filters.md +0 -868
- data/.ai-assistance/code/spec_coverage.md +0 -73
- data/.ai-assistance/code/template_diff_pairing_domain.md +0 -175
- data/.ai-assistance/code/workflow-command-guide.md +0 -466
- data/.ai-assistance/code/workflow-space.md +0 -353
- data/.ai-assistance/conventions/CLAUDE.md +0 -30
- data/.ai-assistance/conventions/code-working-tree-protocol.md +0 -199
- data/.ai-assistance/conventions/gitignore-rules.md +0 -42
- data/.ai-assistance/conventions/permission-guidance.md +0 -120
- data/.ai-assistance/integrations/README.md +0 -70
- data/.ai-assistance/integrations/gitkraken-mcp.md +0 -107
- data/.ai-assistance/integrations/gitlab-mcp.md +0 -123
- data/.ai-assistance/integrations/local-git.md +0 -60
- data/.ai-assistance/local_paths.example.md +0 -17
- data/.ai-assistance/projects/TODO.md +0 -118
- data/.ai-assistance/projects/api-v2-to-graphql-migration/DECISIONS.md +0 -168
- data/.ai-assistance/projects/api-v2-to-graphql-migration/INTENT.md +0 -60
- data/.ai-assistance/projects/api-v2-to-graphql-migration/TODO.md +0 -267
- data/.ai-assistance/projects/api-v2-to-graphql-migration/UPSTREAM.md +0 -53
- data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/csv-template-pipeline-design.md +0 -102
- data/.ai-assistance/projects/api-v2-to-graphql-migration/notes/cutover-usecase-gap-audit.md +0 -139
- data/.ai-assistance/projects/compat-layer-audit/COMPAT_AUDIT.md +0 -244
- data/.ai-assistance/projects/dynamic-model-generation/INTENT.md +0 -93
- data/.ai-assistance/projects/eco-helpers-compat/INTENT.md +0 -244
- data/.ai-assistance/projects/eco-helpers-compat/MIGRATION_GUIDE.md +0 -266
- data/.ai-assistance/projects/eco-helpers-compat/TODO.md +0 -86
- data/.ai-assistance/projects/ecoportal-api-v2-doublemodel-review/INTENT.md +0 -101
- data/.ai-assistance/projects/graphql-agent/GAP_ANALYSIS.md +0 -177
- data/.ai-assistance/projects/ooze-graphql-native-migration/DECISIONS.md +0 -161
- data/.ai-assistance/projects/ooze-graphql-native-migration/INTENT.md +0 -125
- data/.ai-assistance/projects/ooze-graphql-native-migration/INVENTORY.md +0 -136
- data/.ai-assistance/projects/ooze-graphql-native-migration/RISKS.md +0 -126
- data/.ai-assistance/projects/ooze-graphql-native-migration/TODO.md +0 -261
- data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-06-30-cutover-workflow-deep-review.md +0 -122
- data/.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-07-01-forces-via-workflow-commands-miss-rca.md +0 -148
- data/.ai-assistance/projects/page-model/DECISIONS.md +0 -245
- data/.ai-assistance/projects/page-model/TODO.md +0 -190
- data/.ai-assistance/projects/qa-services-delivery/DECISIONS.md +0 -93
- data/.ai-assistance/projects/qa-services-delivery/INTENT.md +0 -76
- data/.ai-assistance/projects/qa-services-delivery/PHASE3-SCOPE.md +0 -115
- data/.ai-assistance/projects/qa-services-delivery/ROADMAP.md +0 -99
- data/.ai-assistance/projects/qa-services-delivery/TODO.md +0 -81
- data/.ai-assistance/projects/search-filter-builder/INTENT.md +0 -107
- data/.ai-assistance/projects/search-filter-builder/TODO.md +0 -131
- data/.ai-assistance/projects/template-automatic-build-maintenance/INTENT.md +0 -87
- data/.ai-assistance/projects/template-automatic-build-maintenance/TODO.md +0 -108
- data/.ai-assistance/projects/template-diff-deploy/INTENT.md +0 -12
- data/.ai-assistance/projects/template-diff-deploy/TODO.md +0 -9
- data/.ai-assistance/projects/template-maintenance/DESIGN.md +0 -134
- data/.ai-assistance/projects/template-maintenance/PHASE0-FINDINGS.md +0 -93
- data/.ai-assistance/projects/template-maintenance/README.md +0 -14
- data/.ai-assistance/projects/template-model-logic/CATEGORY_CATALOG.md +0 -236
- data/.ai-assistance/projects/template-model-logic/CLASSIFICATION_SPIKE.md +0 -243
- data/.ai-assistance/projects/template-model-logic/DESIGN_NOTE.md +0 -154
- data/.ai-assistance/projects/workflow-space/TODO.md +0 -213
- data/.ai-assistance/reinstall-claude-desktop-windows.md +0 -136
- data/.ai-assistance/scripts/CLAUDE.md +0 -150
- data/.ai-assistance/scripts/bridge-inbox-check.sh +0 -75
- data/.ai-assistance/scripts/bridge-init.sh +0 -86
- data/.ai-assistance/scripts/bridge-status.sh +0 -44
- data/.ai-assistance/scripts/capabilities-check.ts +0 -104
- data/.ai-assistance/scripts/check-outbox.sh +0 -43
- data/.ai-assistance/scripts/dep_graph.rb +0 -91
- data/.ai-assistance/scripts/lock-acquire.sh +0 -103
- data/.ai-assistance/scripts/lock-multi.sh +0 -124
- data/.ai-assistance/scripts/lock-queue.sh +0 -94
- data/.ai-assistance/scripts/setup-mcps.test.ts +0 -188
- data/.ai-assistance/scripts/setup-mcps.ts +0 -234
- data/.ai-assistance/scripts/task-complete.ts +0 -74
- data/.ai-assistance/scripts/task-create.ts +0 -75
- data/.ai-assistance/scripts/task-read.ts +0 -125
- data/.ai-assistance/scripts/token-logger.js +0 -220
- data/.ai-assistance/scripts/token-report.ts +0 -158
- data/.ai-assistance/scripts/token-session-start.js +0 -66
- data/.ai-assistance/skills/ai-instructions/SKILL.md +0 -48
- data/.ai-assistance/skills/code-specs/SKILL.md +0 -69
- data/.ai-assistance/skills/corporate-policies/SKILL.md +0 -201
- data/.ai-assistance/skills/dep-graph/SKILL.md +0 -139
- data/.ai-assistance/skills/ep-ai-manager/SKILL.md +0 -417
- data/.ai-assistance/skills/gemini-assist/SKILL.md +0 -63
- data/.ai-assistance/skills/gemini-assist/gemini-mcp-server.js +0 -205
- data/.ai-assistance/skills/gemini-assist/gemini_ask.py +0 -1
- data/.ai-assistance/skills/gemini-assist/gemini_ask.rb +0 -240
- data/.ai-assistance/skills/gemini-assist/prompts/cycle_end_review.txt +0 -25
- data/.ai-assistance/skills/graphql-schema-analysis/SKILL.md +0 -261
- data/.ai-assistance/skills/procedural-memory/SKILL.md +0 -319
- data/.ai-assistance/skills/project-cycle/SKILL.md +0 -177
- data/.ai-assistance/skills/project-self-docs/SKILL.md +0 -181
- data/.ai-assistance/skills/project-self-docs/scripts/self_docs_scan.py +0 -378
- data/.ai-assistance/skills/refactor/SKILL.md +0 -62
- data/.ai-assistance/skills/rubocop/SKILL.md +0 -93
- data/.ai-assistance/skills/ruby-scripting/SKILL.md +0 -215
- data/.ai-assistance/skills/spec-generation/SKILL.md +0 -72
- data/.ai-assistance/standards-version.json +0 -22
- data/.ai-assistance/token-budget.json +0 -32
- data/.ai-assistance/version.json +0 -39
- data/.claude/settings.json +0 -150
- data/.env.example +0 -18
- data/.gitattributes +0 -15
- data/.gitignore +0 -37
- data/.gitlab-ci.yml +0 -45
- data/.markdownlint.json +0 -4
- data/.rspec +0 -3
- data/.rubocop.yml +0 -121
- data/.ruby-version +0 -1
- data/.yardopts +0 -10
- data/CLAUDE.md +0 -243
- data/Gemfile +0 -30
- data/Rakefile +0 -90
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/bin/setup.ps1 +0 -6
- data/docs/self-docs/ARCHITECTURE.md +0 -88
- data/docs/self-docs/CHANGES.jsonl +0 -12
- data/docs/self-docs/COMPLIANCE.md +0 -79
- data/docs/self-docs/CONVENTIONS.md +0 -74
- data/docs/self-docs/INTEGRATIONS.md +0 -65
- data/docs/self-docs/OPERATIONS.md +0 -76
- data/docs/self-docs/OVERVIEW.md +0 -64
- data/docs/self-docs/STATUS.md +0 -73
- data/docs/self-docs/self-docs-index.json +0 -51
- data/docs/worklog.md +0 -977
- data/ecoportal-api-graphql.gemspec +0 -40
- data/scripts/auto-worker-scheduler.sh +0 -386
- data/tests/actions_get.rb +0 -7
- data/tests/contractor_entities_get.rb +0 -20
- data/tests/contractor_entity_create.rb +0 -19
- data/tests/contractor_entity_udpate.rb +0 -20
- data/tests/dump_page_model.rb +0 -74
- data/tests/dump_template_model.rb +0 -90
- data/tests/loc_structure_get.rb +0 -10
- data/tests/loc_structure_update.rb +0 -51
- data/tests/loc_structures_get.rb +0 -15
- data/tests/local_libs.rb +0 -20
- data/tests/validate_queries.rb +0 -127
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# EcoPortal Forces and Workflow Builder
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Forces (Legacy Front-End Snippets — Being Replaced)
|
|
6
|
-
|
|
7
|
-
### What They Are
|
|
8
|
-
|
|
9
|
-
Forces are AngularJS embedded code snippets that are attached to pages and stages.
|
|
10
|
-
They implement **conditional field behaviour** — things like:
|
|
11
|
-
- Show/hide sections based on field values
|
|
12
|
-
- Compute risk ratings (e.g. `likelihood × severity = risk_score`)
|
|
13
|
-
- Fill gauge values based on select field selections
|
|
14
|
-
- Conditional required field logic
|
|
15
|
-
|
|
16
|
-
### How They Attach
|
|
17
|
-
|
|
18
|
-
Forces have **bindings** — connections to specific fields and sections within a stage.
|
|
19
|
-
A force appears in the front-end on a specific stage only if ALL its bindings are
|
|
20
|
-
present in that stage (the bound fields and sections exist in that stage).
|
|
21
|
-
|
|
22
|
-
### Technical Details
|
|
23
|
-
|
|
24
|
-
- Backend: `Force` type in GraphQL (`id`, `name`, `script`, `bindings`, `globalBindings`)
|
|
25
|
-
- Front-end: AngularJS components embedded in the stage view
|
|
26
|
-
|
|
27
|
-
### Forces on GraphQL — CORRECTED (verified, Oscar + code, 2026-07-01)
|
|
28
|
-
|
|
29
|
-
> ⚠️ An earlier version of this doc (2026-06-09) claimed forces were "not yet scriptable —
|
|
30
|
-
> blocked until a dedicated legacy-forces GraphQL endpoint lands." **That was wrong**, and it
|
|
31
|
-
> persisted because the fact below was only ever captured in machine-local memory. There is no
|
|
32
|
-
> separate "forces endpoint" — forces are managed through the **WorkflowCommandInput command-bus**,
|
|
33
|
-
> the same imperative mechanism used for all template/workflow edits. Full root-cause:
|
|
34
|
-
> `.ai-assistance/projects/ooze-graphql-native-migration/analysis/2026-07-01-forces-via-workflow-commands-miss-rca.md`.
|
|
35
|
-
|
|
36
|
-
**MUTATING forces — AVAILABLE NOW.** Done via `Workflow*` commands (`WorkflowAddForceInput`,
|
|
37
|
-
`WorkflowEditForceInput`, `WorkflowRemoveForceInput`, `reorderForces`, `addBinding`/`editBinding`/
|
|
38
|
-
`removeBinding`) submitted through `executeWorkflowCommands`. The gem already ships this:
|
|
39
|
-
- Inputs: `lib/ecoportal/api/graphql/input/workflow_command/{add_force,edit_force,remove_force,reorder_forces,add_binding}.rb`
|
|
40
|
-
- Wiring: `input/workflow_command.rb`; mutation `mutation/page/execute_workflow_commands.rb`
|
|
41
|
-
- Model: `base/force.rb` queues `editForce` / `addBinding` commands
|
|
42
|
-
- eco-helpers: `OozeRedirect::ForceCompat#save_force_changes!` already submits them via
|
|
43
|
-
`graphql.page.execute_force_commands` → `executeWorkflowCommands` (the "to-be-built" sketch was
|
|
44
|
-
already built).
|
|
45
|
-
|
|
46
|
-
**READING forces on a page — the only WIP part.** `Query::PageWithForces` (used by
|
|
47
|
-
`ForceCompat#with_each_entry`) currently fails client-side schema validation (PageUnion selections,
|
|
48
|
-
`id` on binding types). This is the genuinely-blocked piece.
|
|
49
|
-
|
|
50
|
-
**Why scripts still appear "blocked":** `OozeRedirect.force_support?` hard-returns `false`, gating
|
|
51
|
-
read AND write together — so the broken READ disables the working WRITE as collateral. Correcting
|
|
52
|
-
it means splitting the gate (enable writes; gate only the `PageWithForces` fetch) and/or fixing the
|
|
53
|
-
read query. Until then the ~20 force-dependent ooze scripts stay off, but they are **not**
|
|
54
|
-
fundamentally blocked — the write path exists.
|
|
55
|
-
|
|
56
|
-
**Scripts interact with forces as in v2** (the compat API is real, not a sketch):
|
|
57
|
-
`force.custom_script = new_script` (→ `editForce`), `force.bindings.add(...)` (→ `addBinding`),
|
|
58
|
-
`force.bindings.delete!(...)` (→ `removeBinding`); commands accumulate and submit in one
|
|
59
|
-
`executeWorkflowCommands` call after `process_ooze`.
|
|
60
|
-
|
|
61
|
-
### Status
|
|
62
|
-
|
|
63
|
-
**Forces are being replaced** by the Workflow Builder. New templates should use Workflow Builder
|
|
64
|
-
instead of Forces. Existing templates with Forces continue to work and are now editable via the
|
|
65
|
-
command-bus (above).
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Workflow Builder (`PagesWorkflow`)
|
|
70
|
-
|
|
71
|
-
### What It Is
|
|
72
|
-
|
|
73
|
-
The Workflow Builder is the replacement for Forces. It provides server-side (and
|
|
74
|
-
eventually client-side via React) automation configuration for pages.
|
|
75
|
-
|
|
76
|
-
### Currently Deployed Features
|
|
77
|
-
|
|
78
|
-
| Feature | Status |
|
|
79
|
-
|---------|--------|
|
|
80
|
-
| Automated notifications | ✅ Deployed |
|
|
81
|
-
| Automated page creation | ✅ Deployed (from workflow triggers) |
|
|
82
|
-
| Task assignments | ✅ Deployed (per workflow rules) |
|
|
83
|
-
| Conditional field/section workflows | 🔄 In development |
|
|
84
|
-
| Custom computed values (risk matrices) | 🔄 In development |
|
|
85
|
-
|
|
86
|
-
### Conditional Field Workflows (Not Yet Deployed)
|
|
87
|
-
|
|
88
|
-
This is the AngularJS Forces replacement. Will enable:
|
|
89
|
-
- Show/hide sections based on field values
|
|
90
|
-
- Computed gauge values from select + number field matrices
|
|
91
|
-
- Conditional required fields
|
|
92
|
-
- Section visibility rules
|
|
93
|
-
|
|
94
|
-
**Why it matters for scripting:** Once deployed, the server may automatically
|
|
95
|
-
update field values or show/hide sections when a page is updated. Scripts that
|
|
96
|
-
update a field may trigger downstream Workflow Builder effects server-side.
|
|
97
|
-
|
|
98
|
-
### Recent Status (2026-06-07)
|
|
99
|
-
|
|
100
|
-
The Workflow Builder was recently refactored. New customers have it deployed for
|
|
101
|
-
their templates. Engineering is doing quick fixes via CI/CD. The Workflow Builder
|
|
102
|
-
API is **not stable enough for scripting against its internals** — use the standard
|
|
103
|
-
`updatePage` mutation and let the server trigger workflow effects as side effects.
|
|
104
|
-
|
|
105
|
-
### GraphQL Access
|
|
106
|
-
|
|
107
|
-
The `PagesWorkflow` type is queryable, and its mutations **ARE covered in this gem** — via the
|
|
108
|
-
`WorkflowCommandInput` command-bus (~80 command types under `input/workflow_command/`, applied by
|
|
109
|
-
`executeWorkflowCommands`). This is the imperative mechanism for editing workflows, forces, stages,
|
|
110
|
-
sections, fields, strategies, operations, recipients, etc. (NOT a diff-based update). Key types:
|
|
111
|
-
|
|
112
|
-
- `PagesWorkflow` — the workflow configuration attached to a register
|
|
113
|
-
- `PagesWorkflowCallbackType` — triggers and operations
|
|
114
|
-
- `PagesWorkflowCommandInterface` — commands that were executed
|
|
115
|
-
- `PagesWorkflowOperationsCreatePage` — auto-create operation
|
|
116
|
-
- `PagesWorkflowOperationsAssignTo` — task assignment operation
|
|
117
|
-
- `PagesWorkflowOperationsSendNotification` — notification operation
|
|
118
|
-
|
|
119
|
-
The command-bus (`input/workflow_command/*.rb` + `mutation/page/execute_workflow_commands.rb`) is
|
|
120
|
-
the same machinery the templates-maintenance project builds on. The API is volatile — design for
|
|
121
|
-
change. (Earlier "not covered in this gem" was wrong — corrected 2026-07-01 alongside the forces fix.)
|
|
122
|
-
|
|
123
|
-
### Task Side Effects of `updatePage`
|
|
124
|
-
|
|
125
|
-
When submitting a stage (`submit: true` in `updatePage`), the server may:
|
|
126
|
-
1. Create/assign a `ReviewPage` or `CompletePage` task for the next stage
|
|
127
|
-
2. Create related pages (if workflow has auto-create configured)
|
|
128
|
-
3. Send notifications to relevant users
|
|
129
|
-
4. Trigger time-delay operations for future tasks
|
|
130
|
-
|
|
131
|
-
Scripts should check mutation payloads for errors but should NOT attempt to manually
|
|
132
|
-
manage workflow state — the server handles it.
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
# EcoPortal Integration Gem Stack
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Dependency Chain
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
[graphql-ruby] [graphql-client] [graphlient (forked)] (upstream, external/forked)
|
|
9
|
-
↓
|
|
10
|
-
ecoportal-api / ecoportal-api-v2 (upstream, team-managed)
|
|
11
|
-
↓
|
|
12
|
-
ecoportal-api-graphql ← THIS REPO
|
|
13
|
-
↓
|
|
14
|
-
eco-helpers (downstream, team-managed)
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## graphlient (Forked)
|
|
20
|
-
|
|
21
|
-
**Purpose:** GraphQL DSL for building and executing queries.
|
|
22
|
-
**Fork:** `C:\ruby_scripts\git\graphlient` (Oscar's fork of `ashkan18/graphlient`)
|
|
23
|
-
**Branch:** `feature/dsl-only-mode`
|
|
24
|
-
|
|
25
|
-
**Custom additions to the fork:**
|
|
26
|
-
- `Client#to_query_string(&block)` — builds a full query document from the DSL block
|
|
27
|
-
and returns a `String` WITHOUT touching Faraday/HTTP. Keystone for the schema-less
|
|
28
|
-
dispatch mode.
|
|
29
|
-
- `Query#spread(name)` — DSL helper that emits `...FragmentName` in the query string.
|
|
30
|
-
Replaced the `___Ecoportal__API__GraphQL__Fragment__X` convention from graphql-client.
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## ecoportal-api (Upstream)
|
|
35
|
-
|
|
36
|
-
**Purpose:** Core base models, auth, content model, base HTTP client.
|
|
37
|
-
**Local path:** `C:\ruby_scripts\git\ecoportal-api`
|
|
38
|
-
|
|
39
|
-
Provides:
|
|
40
|
-
- `Ecoportal::API::Common::BaseModel` — base model with passthrough, passkey, etc.
|
|
41
|
-
- `Ecoportal::API::Common::Content::DoubleModel` — dirty tracking base
|
|
42
|
-
- `Ecoportal::API::Common::BaseClass` — class_resolver, resolve_class DSL
|
|
43
|
-
- `Ecoportal::API::Common::GraphQL::AuthService` — OAuth authentication
|
|
44
|
-
- `Ecoportal::API::Common::GraphQL::HashHelpers` — deep_dup, etc.
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## ecoportal-api-v2 (Upstream, Being Retired)
|
|
49
|
-
|
|
50
|
-
**Purpose:** REST API v2 client gem (Page, Register, PersonMember, etc.)
|
|
51
|
-
**Local path:** `C:\ruby_scripts\git\ecoportal-api-v2`
|
|
52
|
-
|
|
53
|
-
Key things to look for in the source:
|
|
54
|
-
- `Ecoportal::API::Common::Content::StringDigest` — Field ID / ref formula
|
|
55
|
-
- `HashDiffPatch` — the diff algorithm the GraphQL gem adapted
|
|
56
|
-
- `passthrough`, `passarray`, `passboolean`, `passdate` DSL macros
|
|
57
|
-
- Page model with `.as_update` and dirty tracking
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## ecoportal-api-graphql (THIS GEM)
|
|
62
|
-
|
|
63
|
-
**Local path:** `C:\ruby_scripts\git\ecoportal-api-graphql`
|
|
64
|
-
**Branch:** `pages` (primary development branch)
|
|
65
|
-
|
|
66
|
-
### Namespace Structure
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
Ecoportal::API::GraphQL::
|
|
70
|
-
Logic:: Base classes (BaseModel, BaseQuery, Query, Mutation, etc.)
|
|
71
|
-
Common:: Shared utilities (DiffService, HashHelpers, etc.)
|
|
72
|
-
Interface:: GraphQL interfaces (BasePage, LocationStructure)
|
|
73
|
-
Base:: Concrete base model classes (Page::Basic, Page::Phased, DataField::*)
|
|
74
|
-
Model:: Domain model classes (inherits from Base::, adds resolvers)
|
|
75
|
-
Fragment:: GraphQL fragment definitions
|
|
76
|
-
Fragment::Pages Sub-namespace for customer-facing fragments (CommonPageUnion)
|
|
77
|
-
Connection:: Connection classes for paginated results
|
|
78
|
-
Query:: Query classes (Page, Pages, Templates, RegisterPreviewPages, etc.)
|
|
79
|
-
Mutation:: Mutation classes (Page::Update, Page::Archive, etc.)
|
|
80
|
-
Payload:: Mutation payload classes
|
|
81
|
-
Input:: Input object classes (Page::Update, SearchConf, DeltaInput, etc.)
|
|
82
|
-
Builder:: Builder pattern (Page, Action, ContractorEntity, LocationStructure)
|
|
83
|
-
Compat:: v2 compatibility layer (Pages, Registers, StageView, StageCollection, etc.)
|
|
84
|
-
Concerns:: Shared modules (PageCompat, DataFieldAccess, SnakeCamelAccess, etc.)
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
### Key Conventions
|
|
88
|
-
|
|
89
|
-
**passthrough vs passboolean vs passdate vs passarray:**
|
|
90
|
-
All macros from ecoportal-api that create read/write accessors:
|
|
91
|
-
- `passthrough :externalId` → `def externalId; doc['externalId']; end` + setter
|
|
92
|
-
- `passboolean :archived` → same but returns `true/false` cast
|
|
93
|
-
- `passdate :createdAt` → same but wraps in DateTime model
|
|
94
|
-
- `passarray :stages` → returns Array from doc
|
|
95
|
-
|
|
96
|
-
**SnakeCamelAccess concern:** Included in `Logic::BaseModel`. All GraphQL model objects
|
|
97
|
-
respond to snake_case versions of camelCase methods via `method_missing`:
|
|
98
|
-
- `page.external_id` → `page.externalId`
|
|
99
|
-
- `page.patch_ver` → `page.patchVer`
|
|
100
|
-
- `page.source_template_id` → `page.sourceTemplateId`
|
|
101
|
-
- `page.time_zone = 'UTC'` → `page.timeZone = 'UTC'`
|
|
102
|
-
|
|
103
|
-
**class_resolver pattern:** Used to lazily resolve class references (avoids circular
|
|
104
|
-
requires):
|
|
105
|
-
```ruby
|
|
106
|
-
class_resolver :item_class, 'Ecoportal::API::GraphQL::Model::PageUnion'
|
|
107
|
-
```
|
|
108
|
-
`resolve_class` accepts String (const_get), Symbol (send), or Class.
|
|
109
|
-
|
|
110
|
-
**Fragment assembly:** `BaseQuery#assemble_fragments` recursively scans query strings
|
|
111
|
-
for `...FragmentName` spreads and appends all needed fragment definitions. Fragment
|
|
112
|
-
sub-namespaces registered via `Fragment.register_namespace(klass)`.
|
|
113
|
-
|
|
114
|
-
### eco-helpers Compat Layer
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
Compat::Pages — graphql.pages (matches apiv2.pages interface)
|
|
118
|
-
Compat::Registers — graphql.registers (matches apiv2.registers interface)
|
|
119
|
-
Compat::StageView — page view filtered to one stage (matches v2 stage fetch)
|
|
120
|
-
Compat::StageCollection — stages[name], get_by_name, ordered
|
|
121
|
-
Compat::SearchResults — .total, .total_before_filtering
|
|
122
|
-
Compat::PageReference — .page_id, .active_stage_id
|
|
123
|
-
Compat::Response — .success?, .status, .body
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
**Concerns included in Interface::BasePage (all page models):**
|
|
127
|
-
- `PageCompat` — v2 method aliases (external_id, template_id, components, stages?, consolidate!, dirty?, validate)
|
|
128
|
-
- `DataFieldAccess` — components, sections, field_collection, section_collection, data_fields_updates, data_fields_additions
|
|
129
|
-
- `SnakeCamelAccess` — camelCase→snake_case method delegation
|
|
130
|
-
|
|
131
|
-
**Data field types with full read/write:**
|
|
132
|
-
PlainText, RichText, DateField, Number, Gauge, People, Select, Checklist, TagField, Geo
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## eco-helpers (Downstream)
|
|
137
|
-
|
|
138
|
-
**Purpose:** Integration script framework for the ecoPortal Integrations Team.
|
|
139
|
-
**Local path:** `C:\ruby_scripts\git\eco-helpers`
|
|
140
|
-
|
|
141
|
-
Key patterns:
|
|
142
|
-
- Script use case classes inherit from `OozeBase` or `RegisterUpdate`
|
|
143
|
-
- `RegisterUpdate` manages a loop: search register → fetch page → modify → save
|
|
144
|
-
- `RegisterUpdate` tracks changes: if `dirty?(page)`, triggers `pages.update(page)`
|
|
145
|
-
- `RegisterUpdate` tracks stage changes: if stage changes, fetches new stage view
|
|
146
|
-
|
|
147
|
-
**Stage iteration pattern:**
|
|
148
|
-
```ruby
|
|
149
|
-
# In RegisterUpdate
|
|
150
|
-
apiv2.registers.search(register_id, search_options) do |page_result|
|
|
151
|
-
ooze = apiv2.pages.get(page_result.id)
|
|
152
|
-
stage = ooze.stages.get_by_name('Risk Assessment')
|
|
153
|
-
apiv2.pages.get(ooze.id, stage_id: stage.id).tap do |stage_view|
|
|
154
|
-
with_fields(stage_view, type: :plain_text) { |f| f.value = 'Updated' }
|
|
155
|
-
apiv2.pages.update(stage_view)
|
|
156
|
-
end
|
|
157
|
-
end
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
With GraphQL compat, `apiv2` is replaced by `graphql` and the pattern works unchanged.
|
|
161
|
-
|
|
162
|
-
### Filter helpers (eco-helpers)
|
|
163
|
-
|
|
164
|
-
```ruby
|
|
165
|
-
date_range_filter(from: Date.today - 7, to: Date.today, key: :updated_at)
|
|
166
|
-
# → { type: "date_filter", key: "updated_at", lbound: "ISO8601", ubound: "ISO8601", time_zone: "..." }
|
|
167
|
-
|
|
168
|
-
tags_filter(['Auckland', 'Wellington'], any: true)
|
|
169
|
-
# → { type: "tag_filter", tags: [...], mode: "any", negate: false, key: "tags" }
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
The GraphQL compat layer translates `date_filter` lbound/ubound → gte/lte.
|
|
173
|
-
Other filter types pass through to the ES backend unchanged.
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## Backend Source (ecoPortal Rails)
|
|
178
|
-
|
|
179
|
-
**Local path:** `C:\docker\ecoPortal_master\`
|
|
180
|
-
|
|
181
|
-
Key namespaces and files to look up:
|
|
182
|
-
- `Enzyme::` — old Rails models (AngularJS era, being replaced)
|
|
183
|
-
- `NewEp::` — current Rails models (React era)
|
|
184
|
-
- `NewEp::DataField` — current data field model (was `Enzyme::Membrane`)
|
|
185
|
-
- `Ecoportal::API::Common::Content::StringDigest` (actually in ecoportal-api-v2) — Field ID formula
|
|
186
|
-
- Rails `services/` loadable path — Migrator and other background services
|
|
187
|
-
- `.graphql` files — front-end React component GraphQL queries/fragments
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
# AI Documentation Sources, Gaps, and Improvement Opportunities
|
|
2
|
-
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
## Knowledge Sources for AI Agents
|
|
6
|
-
|
|
7
|
-
### 1. GraphQL Schema (Live — Auto-Generated)
|
|
8
|
-
|
|
9
|
-
**URL:** `https://live.ecoportal.com/api-docs/graphql` (requires login)
|
|
10
|
-
**Corpus location:** `C:\claude\Projects\Claude AWS Platform\tmp\corpus\staging\success\graphql\schema_graphql-schema.md`
|
|
11
|
-
**Type:** Auto-generated from GraphQL SDL on each deployment
|
|
12
|
-
**Quality:** Authoritative — always reflects the current API
|
|
13
|
-
**Limitations:** No explanations, no examples, field descriptions sparse
|
|
14
|
-
|
|
15
|
-
### 2. Confluence APIDOCS Space
|
|
16
|
-
|
|
17
|
-
**URL:** `https://ecoportal-projects.atlassian.net/wiki/spaces/APIDOCS`
|
|
18
|
-
**Corpus location:** `C:\claude\Projects\Claude AWS Platform\tmp\corpus\staging\success\graphql\`
|
|
19
|
-
**Type:** Team-maintained documentation, customer-facing guidance
|
|
20
|
-
|
|
21
|
-
**Key pages:**
|
|
22
|
-
- `2254077960_graphql-api-docs.md` — GraphQL API introduction
|
|
23
|
-
- `2235662347_graphql-pages-technical-guide.md` — Pages technical guide
|
|
24
|
-
- `2262892608_registers-searches-and-templates.md` — **EMPTY — critical gap**
|
|
25
|
-
- `2262696008_pageunion-common-fragment-definition.md` — CommonPageUnion reference
|
|
26
|
-
- `1933639695_searching-pages.md` — Search/filter guide
|
|
27
|
-
- `1931542534_createpagefromtemplate.md` — Create workflow
|
|
28
|
-
- `1931575325_updatepage.md` — Update workflow
|
|
29
|
-
- `1959788614_authentication-flow.md` — Auth guide
|
|
30
|
-
- `2261450758_schema-introspection.md` — Schema introspection
|
|
31
|
-
- `2261614596_fetch-by-system-id.md` — Fetch by system ID
|
|
32
|
-
- `2262499334_search-by-external-id.md` — **BROKEN — placeholder content**
|
|
33
|
-
- `2289958954_list-all-templates.md`, `2290122761_list-register-templates.md`, `2290089995_list-registers.md`
|
|
34
|
-
- `1928855618_createaction.md`, `1928921220_updateaction.md`, `1933901853_loadactions.md`
|
|
35
|
-
|
|
36
|
-
### 3. Confluence Engineering Projects (High Level Requirements)
|
|
37
|
-
|
|
38
|
-
**URL:** Engineering Confluence space (separate from APIDOCS)
|
|
39
|
-
**Status:** EXISTS but not yet in the corpus
|
|
40
|
-
**Contains:** HLRs for new features, architectural decisions, roadmap items
|
|
41
|
-
**Gap:** Not yet available to AI agents. Would provide: planned features, architectural
|
|
42
|
-
constraints, why certain decisions were made, what's coming next.
|
|
43
|
-
|
|
44
|
-
**Recommended action:** Add Engineering HLR pages to the corpus. Particularly valuable:
|
|
45
|
-
- Workflow Builder HLR and design docs
|
|
46
|
-
- Field ID / System ID project spec
|
|
47
|
-
- APIv3 page render spec
|
|
48
|
-
- Template editing via GraphQL (when Engineering unblocks it)
|
|
49
|
-
|
|
50
|
-
### 4. Confluence Knowledge Base (Customer-Facing Articles)
|
|
51
|
-
|
|
52
|
-
**URL:** Separate Confluence space — customer-facing how-to articles
|
|
53
|
-
**Status:** NOT YET in the corpus
|
|
54
|
-
**Contains:** End-user instructions for using ecoPortal features (not API)
|
|
55
|
-
**Value for AI:** Understanding what customers call things, common support tickets,
|
|
56
|
-
feature explanations at a non-technical level
|
|
57
|
-
|
|
58
|
-
**Gap:** An AI agent helping customers reference both KB articles and API docs would
|
|
59
|
-
be much more effective.
|
|
60
|
-
|
|
61
|
-
### 5. Production Insomnia Queries (Verified Examples)
|
|
62
|
-
|
|
63
|
-
**Location:** `C:\claude\Projects\Claude AWS Platform\tmp\corpus\success\graphql\examples\Insomnia_2026-06-07.yaml`
|
|
64
|
-
**Corpus extraction:** `C:\ruby_scripts\git\ecoportal-api-graphql\.ai-assistance\code\search_filters.md`
|
|
65
|
-
**Contains:** 17+ production queries verified against live.ecoportal.com
|
|
66
|
-
|
|
67
|
-
Key confirmed patterns:
|
|
68
|
-
- Org search with register + date filters
|
|
69
|
-
- Register search (`previewPages`)
|
|
70
|
-
- Find by externalId (exact_filter)
|
|
71
|
-
- OR filter for multiple externalIds
|
|
72
|
-
- buildFromTemplate + createFromTemplate
|
|
73
|
-
- updatePage with field values
|
|
74
|
-
- archivePage compound mutation
|
|
75
|
-
|
|
76
|
-
### 6. Front-End GraphQL Queries (React components)
|
|
77
|
-
|
|
78
|
-
**Location:** `C:\docker\ecoPortal_master\` — `.graphql` files distributed throughout
|
|
79
|
-
the React codebase
|
|
80
|
-
**Status:** Not yet systematically catalogued
|
|
81
|
-
**Contains:** Every query/mutation used in the React UI — ground truth for what's
|
|
82
|
-
actually supported and used
|
|
83
|
-
|
|
84
|
-
**Recommended action:** Run a grep for `*.graphql` files across the ecoPortal codebase,
|
|
85
|
-
extract all query/mutation names, and add them to the corpus. The `graphql-schema-analysis`
|
|
86
|
-
skill has guidance for this.
|
|
87
|
-
|
|
88
|
-
### 7. eco-helpers Source Code
|
|
89
|
-
|
|
90
|
-
**Location:** `C:\ruby_scripts\git\eco-helpers`
|
|
91
|
-
**Contains:** All integration patterns used by the Integrations Team
|
|
92
|
-
**Audited:** 2026-06-07 (see eco-helpers-compat INTENT.md)
|
|
93
|
-
**Key files:** `ooze_base_case.rb`, `register_export_case.rb`, `register_update_case.rb`,
|
|
94
|
-
`helpers/filters.rb`
|
|
95
|
-
|
|
96
|
-
### 8. ecoportal-api-v2 Source Code
|
|
97
|
-
|
|
98
|
-
**Location:** `C:\ruby_scripts\git\ecoportal-api-v2`
|
|
99
|
-
**Contains:** REST API client, data models, diff/patch logic
|
|
100
|
-
**Key:** `StringDigest` for Field ID formula, `HashDiffPatch` for diff algorithm
|
|
101
|
-
|
|
102
|
-
### 9. APIv3 Page Render (Custom Exports)
|
|
103
|
-
|
|
104
|
-
**Status:** In development. Not yet available for scripting.
|
|
105
|
-
**Purpose:** Custom page rendering for PDF exports and other format-specific outputs.
|
|
106
|
-
**Gap:** Not yet documented in any corpus. When deployed, this will be important for
|
|
107
|
-
customers who need custom report generation.
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Critical Gaps in Current Documentation
|
|
112
|
-
|
|
113
|
-
### Gaps That Break AI Agent Reliability
|
|
114
|
-
|
|
115
|
-
| Gap | Impact | Recommended Fix |
|
|
116
|
-
|-----|--------|-----------------|
|
|
117
|
-
| `2262892608` (registers/search/templates) is EMPTY | Agent has NO guidance on register search | Write comprehensive page: register structure, previewPages, search, preset views |
|
|
118
|
-
| `2262499334` (search by externalId) has placeholder content | Agent will make up contractor search syntax | Replace with real query + variables |
|
|
119
|
-
| Error taxonomy completely missing | Agent invents error codes/names | Document 20+ error codes: patchVer conflict, invalid field ID, permission denied, stale cursor, etc. |
|
|
120
|
-
| State machines not documented | Agent suggests invalid state changes | Add state diagrams: Page (active→archived→active), Stage (pending→inprogress→complete), Task |
|
|
121
|
-
| `updateMode` on actions undocumented | Agent omits or guesses this param | Document enum: single/series/future/all |
|
|
122
|
-
| Authorization (`canXXX` fields) unexplained | Agent doesn't know what to do on `canUpdate: false` | Document each `canXXX` field's meaning and correct response |
|
|
123
|
-
| Filter `key` vs `fieldName` inconsistency | Agent uses wrong key name | Document that sorters use `key:`, filters use `key:` in params |
|
|
124
|
-
|
|
125
|
-
### Gaps That Reduce Usefulness
|
|
126
|
-
|
|
127
|
-
| Gap | Impact |
|
|
128
|
-
|-----|--------|
|
|
129
|
-
| No field type reference (all 20 types) | Agent doesn't know what fields are available or how to update them |
|
|
130
|
-
| Pagination edge cases undocumented | Agent doesn't know cursor invalidation policy |
|
|
131
|
-
| CommonPageUnion variables not explained in human terms | Agent can't tell customer what `$content`, `$fields`, `$only_content` do |
|
|
132
|
-
| Archive/unarchive compound pattern not in corpus | Agent misses the externalId blanking step |
|
|
133
|
-
| `previewPages` vs `pages` distinction not documented | Agent uses wrong query for register search |
|
|
134
|
-
| No contractor CRUD guide | Agent makes up create/update/delete syntax |
|
|
135
|
-
| File upload mechanics missing | Agent can't guide file/image field updates |
|
|
136
|
-
|
|
137
|
-
---
|
|
138
|
-
|
|
139
|
-
## Recommended Agent Instructions (System Prompt Additions)
|
|
140
|
-
|
|
141
|
-
An AI agent deployed to assist ecoPortal customers or integrations should include:
|
|
142
|
-
|
|
143
|
-
```
|
|
144
|
-
Key invariants for the ecoPortal GraphQL API:
|
|
145
|
-
|
|
146
|
-
1. GraphQL queries are client-defined. Variability in examples is intentional.
|
|
147
|
-
Multiple mutations in one request is valid and used for stateless middleware clients.
|
|
148
|
-
|
|
149
|
-
2. Filter operations are snake_case strings. CamelCase silently returns no results.
|
|
150
|
-
Always use: exact_filter, date_filter, and_filter, or_filter, register_filter.
|
|
151
|
-
The `filters` value should always be an Array.
|
|
152
|
-
|
|
153
|
-
3. Sorters use the key `key:` (not `fieldName:`) pointing to the Elasticsearch index
|
|
154
|
-
key (field ref), not the MongoDB field id.
|
|
155
|
-
|
|
156
|
-
4. Page creation requires a 2-step sequence:
|
|
157
|
-
(a) buildFromTemplate → get server-assigned field IDs from the built draft
|
|
158
|
-
(b) createFromTemplate → use those field IDs in dataFields.updates
|
|
159
|
-
|
|
160
|
-
5. Page update requires:
|
|
161
|
-
(a) Fetch current page → get patchVer + current field IDs and values
|
|
162
|
-
(b) updatePage → include patchVer (required for concurrency control)
|
|
163
|
-
Stale patchVer = mutation rejection.
|
|
164
|
-
|
|
165
|
-
6. The CommonPageUnion fragment ($fields/$content/$only_content variables) is the
|
|
166
|
-
standard pattern for fetching full page data.
|
|
167
|
-
|
|
168
|
-
7. Register search (`previewPages`) is Elasticsearch — fast but no field IDs.
|
|
169
|
-
Org search (`pages`) is DB — slow (~3s/page) but complete data including field IDs.
|
|
170
|
-
For pre-mutation fetch, always use org search.
|
|
171
|
-
|
|
172
|
-
8. Stage-specific operations (submit, sign-off, people field permissions) require
|
|
173
|
-
`stageId` in UpdatePageInput. Without it, server-side workflow may not trigger.
|
|
174
|
-
|
|
175
|
-
9. Engineering does NOT want templates updated via GraphQL. Read-only template access
|
|
176
|
-
is fine. Template mutations exist but are not approved for scripting.
|
|
177
|
-
|
|
178
|
-
10. patchVer is mandatory on all updatePage calls. Scripts MUST fetch the page first.
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## Improvement Opportunities for AI-Assisted Integration
|
|
184
|
-
|
|
185
|
-
### Near-Term (Within Corpus)
|
|
186
|
-
|
|
187
|
-
1. **Fill the two broken/empty docs** (2262892608, 2262499334)
|
|
188
|
-
2. **Write error taxonomy** — agents desperately need this
|
|
189
|
-
3. **Write state machine docs** — Page, Stage, Action, Task states
|
|
190
|
-
4. **Document all 20 field types** — types, what values they accept, DataFieldInput keys
|
|
191
|
-
5. **Write CommonPageUnion explanation** — what `$content/$fields/$only_content` do with examples
|
|
192
|
-
|
|
193
|
-
### Medium-Term (New Sources)
|
|
194
|
-
|
|
195
|
-
6. **Add Engineering HLRs** to corpus — Workflow Builder, Field ID project, APIv3
|
|
196
|
-
7. **Add customer-facing KB articles** — align technical + customer vocabulary
|
|
197
|
-
8. **Catalogue front-end `.graphql` files** — ground truth for what's used in production
|
|
198
|
-
9. **Add Insomnia collection systematically** — more coverage of edge cases
|
|
199
|
-
|
|
200
|
-
### Long-Term (AI-Driven Features)
|
|
201
|
-
|
|
202
|
-
10. **AI-assisted filter builder** — customer describes "find all active pages in region X
|
|
203
|
-
updated in the last 7 days" → AI generates `SearchConf` objects
|
|
204
|
-
(Foundation exists in `search-filter-builder/` project, see `TODO.md` Step 5)
|
|
205
|
-
|
|
206
|
-
11. **AI-assisted query builder** — customer describes what they need, AI generates
|
|
207
|
-
the full GraphQL query + fragment combination
|
|
208
|
-
|
|
209
|
-
12. **Automatic schema-corpus sync** — on each deployment, re-generate the corpus
|
|
210
|
-
from live schema introspection and flag what changed
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
## Things to Remind Oscar (Noted from Session 2026-06-07)
|
|
215
|
-
|
|
216
|
-
- **Confluence Engineering Projects:** Get HLR pages added to corpus. Key projects:
|
|
217
|
-
Workflow Builder, Field ID / System ID, APIv3 page render, template editing unblock.
|
|
218
|
-
|
|
219
|
-
- **Confluence Knowledge Base:** Customer-facing how-to articles — add to corpus to
|
|
220
|
-
bridge technical ↔ customer language gap.
|
|
221
|
-
|
|
222
|
-
- **APIv3 page render:** New endpoint for custom exports. Not yet documented or stable.
|
|
223
|
-
Add to corpus when deployed.
|
|
224
|
-
|
|
225
|
-
- **Front-end `.graphql` files:** Run a systematic sweep of `C:\docker\ecoPortal_master\`
|
|
226
|
-
for `.graphql` files. Add to corpus. These are the ground-truth queries the React UI uses.
|
|
227
|
-
|
|
228
|
-
- **Genome signature:** Will come back to this. Currently broken on many instances.
|
|
229
|
-
Potentially the basis for the Field ID project. `Migrator` service in Rails (abandoned).
|
|
230
|
-
|
|
231
|
-
- **Filter builder DSL:** Operator-based `Search[:field].eq('X') & Search.in_register('R')`
|
|
232
|
-
is the planned API. AI generation hook is step 5 in `search-filter-builder/TODO.md`.
|
|
233
|
-
|
|
234
|
-
- **Comprehensive Confluence review:** The gap analysis (`graphql-agent/GAP_ANALYSIS.md`)
|
|
235
|
-
has the full list of 10+ items to fix before the GraphQL agent can be deployed to customers.
|
|
236
|
-
Two docs are critically broken (empty/placeholder). Fix these first.
|