eco-helpers 3.3.1 → 3.3.3
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 +37 -10
- data/lib/eco/api/usecases/graphql/compat/ooze_redirect.rb +2 -13
- data/lib/eco/api/usecases/graphql/helpers/pages.rb +1 -1
- data/lib/eco/api/usecases/graphql/samples/pages/template/command_emitter.rb +9 -2
- data/lib/eco/api/usecases/graphql/samples/pages/template/csv_build/builder.rb +1 -1
- data/lib/eco/api/usecases/graphql/samples/pages/template/csv_build/format_map.rb +46 -7
- data/lib/eco/api/usecases/graphql/samples/pages/template.rb +1 -1
- data/lib/eco/version.rb +1 -1
- metadata +1 -6
- data/lib/eco/api/usecases/CLAUDE.md +0 -78
- data/lib/eco/api/usecases/graphql/CLAUDE.md +0 -120
- data/lib/eco/api/usecases/graphql/helpers/CLAUDE.md +0 -79
- data/lib/eco/api/usecases/graphql/samples/CLAUDE.md +0 -76
- data/lib/eco/api/usecases/graphql/samples/pages/CLAUDE.md +0 -59
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c5e64bb2f9a25359774eb01482180a7efdbade0e2b6e4d02a56a4c9dbb1d91f
|
|
4
|
+
data.tar.gz: ea2fd73dc9709ca1710e9aff527f0ae856a55fe0638a7c3862b71bfd9ce5270c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 37dfa8178019e8a4854f3b98386682def2ff8f51b1f7c9dcf95dff4947eea662f14145ab93434ceb8f749acc7981d6904114bc8ad8f4f6d251ed217a28a43ce5
|
|
7
|
+
data.tar.gz: 4653193b58ac2f88bb76b06c4ee094331b2f034ccae4929d5722398105e2035a982e136fd6fda78d207c33e5ddc4aff9f5c489a11abd155382607d94bca8105d
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
## [3.3.3] - 2026-09-30
|
|
8
|
+
|
|
9
|
+
Security republish of 3.3.2. **Backwards-compatible; no code change**: same dependencies, same
|
|
10
|
+
behaviour. Supersedes the published versions of this line, which are to be yanked.
|
|
11
|
+
|
|
12
|
+
### Security
|
|
13
|
+
|
|
14
|
+
- Removed customer and internal identifiers from shipped code comments and this changelog (a
|
|
15
|
+
comment listing customer organisations and their case names; internal repository names and
|
|
16
|
+
internal documentation paths). Comments and changelog only.
|
|
17
|
+
- Packaging: the three runtime JSON files are declared in `.release-smoke-allow`, and the release
|
|
18
|
+
tasks accept `release/*` maintenance branches.
|
|
19
|
+
|
|
20
|
+
## [3.3.2] - 2026-09-02
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Gemspec `spec.files` allowlisted by ROOT DIRECTORY (`lib/`, `exe/`) rather than by full path,
|
|
25
|
+
so any non-`.rb` file added under `lib/` shipped silently. As of 3.3.1 that was five `CLAUDE.md`
|
|
26
|
+
agent-instruction files under `lib/eco/api/usecases/`. `spec.files` is now a full-path
|
|
27
|
+
allowlist — `lib/**/*.rb`, three named JSON files genuinely read at runtime
|
|
28
|
+
(`preferences_reference.json`, `presets_integrity.json`, `presets_values.json`), and
|
|
29
|
+
`README.md` / `CHANGELOG.md` / `LICENSE` at the root — intersected with `git ls-files`.
|
|
30
|
+
`spec/packaging_spec.rb` pins the allowlist so this cannot regress silently again.
|
|
31
|
+
|
|
5
32
|
## [3.3.1] - 2026-08-13
|
|
6
33
|
|
|
7
34
|
### Fixed
|
|
@@ -11,7 +38,7 @@ All notable changes to this project will be documented in this file.
|
|
|
11
38
|
actual bytes. Both read branches (BOM and plain) now use binary mode (`mode: 'rb'`), preserving
|
|
12
39
|
the bytes exactly; BOM stripping is unchanged. Linux behaviour is identical before and after
|
|
13
40
|
(text mode never translated anything there) — this makes Windows match Linux. Surfaced by Travis
|
|
14
|
-
on
|
|
41
|
+
on a customer's tooltip CSV (reported from a downstream script repo).
|
|
15
42
|
|
|
16
43
|
**Precision note (2026-08-13, verified against the motivating file before this version was
|
|
17
44
|
tagged):** the earlier draft of this entry claimed `Eco::CSV.read` raised
|
|
@@ -51,7 +78,7 @@ depends on whether the consumer also declares graphql directly:
|
|
|
51
78
|
- A consumer declaring **only** `eco-helpers '~> 3.2'` adopts 3.3.0 on its next `bundle update`,
|
|
52
79
|
and reaches **graphql 2.0.0 transitively**.
|
|
53
80
|
- A consumer declaring **both** `eco-helpers '~> 3.2'` and `ecoportal-api-graphql '~> 1.3'` (which
|
|
54
|
-
is the case for
|
|
81
|
+
is the case for two internal script repos) does **not** silently adopt — it **fails to
|
|
55
82
|
resolve**, because 3.3.0 requires graphql `~> 2.0`.
|
|
56
83
|
|
|
57
84
|
So the "2.0.0 gates adoption for free" argument only ever covered **direct** graphql dependencies.
|
|
@@ -60,7 +87,7 @@ Both consumers were pinned deliberately on 2026-08-13 rather than left to discov
|
|
|
60
87
|
★ **`3.2.20` was tagged but deliberately NEVER PUBLISHED.** rubygems goes 3.2.19 → 3.3.0. The tag
|
|
61
88
|
marks real history (the point where the 3.2.19 hotfix line rejoined master) but the gem was not
|
|
62
89
|
pushed, and **must not be**: it predates the `spec.files` allowlist fix below and would ship
|
|
63
|
-
internal
|
|
90
|
+
internal AI-tooling and `docs/` content to rubygems. Its content is not lost — 3.3.0
|
|
64
91
|
descends from it. Anything needing the `Eco::API::Custom::Cli` reunification must use **3.3.0**,
|
|
65
92
|
not a `~> 3.2.0` pin.
|
|
66
93
|
|
|
@@ -75,7 +102,7 @@ check.
|
|
|
75
102
|
recorded, treat any `OozeRedirect` run against customer data as unproven — dry-run first.
|
|
76
103
|
|
|
77
104
|
★ **The published gem is now `lib/` only.** `spec.files` excluded just `test|spec|features`, so
|
|
78
|
-
every top-level directory added since shipped by default —
|
|
105
|
+
every top-level directory added since shipped by default — internal AI-tooling notes,
|
|
79
106
|
`docs/` (including the rolling worklog) and `.claude/`. `spec.files` is now an allowlist
|
|
80
107
|
(`lib/`, `exe/`, README, LICENSE, CHANGELOG). All `lib/` files are unchanged; nothing outside
|
|
81
108
|
`lib/` was ever loaded at runtime. Same fix as `ecoportal-api-graphql` 2.0.0.
|
|
@@ -84,7 +111,7 @@ every top-level directory added since shipped by default — `.ai-assistance/` i
|
|
|
84
111
|
|
|
85
112
|
Reunites the released `3.2.19` hotfix line with `master`. `3.2.19` was cut from the `v3.2.18` tag
|
|
86
113
|
and **never merged back**, so two halves were split across branches: `master` carried
|
|
87
|
-
`Eco::API::Custom::Cli` (unreleased since 2026-07-25, and the reason
|
|
114
|
+
`Eco::API::Custom::Cli` (unreleased since 2026-07-25, and the reason a downstream CLI could not
|
|
88
115
|
load on any published gem) while `3.2.19` carried the ooze KPI counter fix and the graphql floor.
|
|
89
116
|
This release carries both. Dependency floors are the max of each side.
|
|
90
117
|
|
|
@@ -145,7 +172,7 @@ replaces on release.
|
|
|
145
172
|
|
|
146
173
|
## [3.2.19] - 2026-07-16
|
|
147
174
|
|
|
148
|
-
|
|
175
|
+
A customer's `cans-upsert` reliability adoption + an ooze KPI counter fix. **Backwards-compatible.**
|
|
149
176
|
Cut from the `v3.2.18` tag (not `master`, which carries the native GraphQL activity/dashboard
|
|
150
177
|
readers depending on the unreleased gem `1.4.0`), so this ships needing only the published
|
|
151
178
|
`ecoportal-api-graphql 1.3.14`.
|
|
@@ -178,7 +205,7 @@ guard so the dead-fragment class of bug can't reach production again.
|
|
|
178
205
|
on 2026-07-04 (`243822b9`), then the live-crash fix `352a9657` (LocationDraft dead-fragment
|
|
179
206
|
convention) landed on 2026-07-05 — keeping the same `3.2.17` label. Because `3.2.17` is installed
|
|
180
207
|
from git/path (unpublished), a consumer bundled in that ~26h window reports `3.2.17` yet lacks the
|
|
181
|
-
fix. This crashed the **live
|
|
208
|
+
fix. This crashed the **live customer** org-structure sync again on 2026-07-09 with the exact
|
|
182
209
|
`uninitialized constant …Fragment::LocationDraft (NameError)`. Bumping to `3.2.18` makes the fixed
|
|
183
210
|
build unambiguously identifiable: any consumer on `>= 3.2.18` provably has the fix.
|
|
184
211
|
|
|
@@ -187,7 +214,7 @@ build unambiguously identifiable: any consumer on `>= 3.2.18` provably has the f
|
|
|
187
214
|
- **Regression-guard spec for the dead-fragment convention.**
|
|
188
215
|
`spec/…/helpers/location/command/end_points/optimizations_spec.rb` scans every file under
|
|
189
216
|
`usecases/graphql/` and fails if any references a fragment via the removed `___Const__Fragment` /
|
|
190
|
-
`::Fragment::<Name>` constant convention (the exact NameError that crashed
|
|
217
|
+
`::Fragment::<Name>` constant convention (the exact NameError that crashed a customer sync), and asserts
|
|
191
218
|
the three Location command payload procs still route fragments through the `spread :Name` registry
|
|
192
219
|
DSL. It is a SOURCE lint, not a full offline render: rendering needs the graphlient fork's
|
|
193
220
|
`to_query_string`/`spread` DSL, but eco-helpers' own bundle resolves stock graphlient `0.8.0` (the
|
|
@@ -212,7 +239,7 @@ to the gem's `Diff` module (gem v1.3.11), which is tagged but unpublished.
|
|
|
212
239
|
`___Const__Fragment` constant convention (`___Ecoportal__API__GraphQL__Fragment__LocationDraft` /
|
|
213
240
|
`…__LocationsError`), which the gem's registry-based fragments no longer expose as Ruby constants →
|
|
214
241
|
`uninitialized constant … Fragment::LocationDraft (NameError)` when building a locations-draft
|
|
215
|
-
`addCommands`/`create`/`publish` request. Crashed
|
|
242
|
+
`addCommands`/`create`/`publish` request. Crashed a customer's live tagtree / org-structure sync.
|
|
216
243
|
Now `spread :LocationDraft` / `spread :LocationsError`, matching the gem.
|
|
217
244
|
|
|
218
245
|
### Dependencies
|
|
@@ -220,7 +247,7 @@ to the gem's `Diff` module (gem v1.3.11), which is tagged but unpublished.
|
|
|
220
247
|
- **Raised floors to the fixed stack: `ecoportal-api-graphql >= 1.3.11`, `ecoportal-api-v2 >= 3.3.3`.**
|
|
221
248
|
Stops the stale gem 1.3.9 (missing the LocationStructure `updatedAt`/`createdAt` selection fixes from
|
|
222
249
|
1.3.10) and the buggy v2 3.3.2 (Ruby-3.x `DoubleModel` cascade `TypeError`) from resolving on
|
|
223
|
-
consumers — both crashed
|
|
250
|
+
consumers — both crashed a customer's live integration.
|
|
224
251
|
|
|
225
252
|
### Added
|
|
226
253
|
|
|
@@ -62,19 +62,8 @@ module Eco::API::UseCases::GraphQL::Compat
|
|
|
62
62
|
# force.custom_script = new_script → write the LISP script
|
|
63
63
|
# force.script → raw script content (alias)
|
|
64
64
|
#
|
|
65
|
-
# Affected cases currently blocked
|
|
66
|
-
#
|
|
67
|
-
# act-gov: 5 x 20240130_act_*_case, rearrage_page_sites_case
|
|
68
|
-
# briscoes: remove_induction_sections, 310524_Briscoes_Remove_Tasks
|
|
69
|
-
# chorus: 4 x audit_update cases
|
|
70
|
-
# hcc: update_enterprise_risk_case
|
|
71
|
-
# lic: update_life_cycle_force_case
|
|
72
|
-
# mitre10: rich_text_update, update_location_force, updating_template
|
|
73
|
-
# npdc: contractor_title_force, risk_titile_force, fix_title_syncing,
|
|
74
|
-
# reminder_date_fields, 10092024_NPDC_CP_Add_Force
|
|
75
|
-
# profile-group: int_training_review, 20231026_profile_wellness
|
|
76
|
-
# turners-growers: event_changes, inj_cost_calc, remove_line_force
|
|
77
|
-
# twg: hide_attached_risks, add_new_force
|
|
65
|
+
# Affected cases currently blocked: roughly half of all ooze cases in the internal script repos'
|
|
66
|
+
# survey (per-customer breakdown kept in the internal migration notes, not in this gem).
|
|
78
67
|
#
|
|
79
68
|
# Implementation sketch (to be built when the endpoint lands):
|
|
80
69
|
#
|
|
@@ -7,7 +7,7 @@ module Eco::API::UseCases::GraphQL::Helpers
|
|
|
7
7
|
# with duck-typing so they work against the GraphQL page/section/field models.
|
|
8
8
|
#
|
|
9
9
|
# This is Phase 1 of the ooze -> native GraphQL migration (build the shared substrate before
|
|
10
|
-
# any case). See ecoportal-api-graphql
|
|
10
|
+
# any case). See the ecoportal-api-graphql repo's internal docs.
|
|
11
11
|
module Pages
|
|
12
12
|
end
|
|
13
13
|
end
|
|
@@ -115,8 +115,15 @@ module Eco::API::UseCases::GraphQL::Samples::Pages
|
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
# Select-field option. dataFieldId threads the (placeholder) field id.
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
#
|
|
119
|
+
# `value:` is a REQUIRED keyword -- the backend's AddSelectFieldOptionInput declares
|
|
120
|
+
# `argument :value, String, required: true`, and it is the option's unique key (cast to a
|
|
121
|
+
# number for numeric select fields). There is no default and it is never derived here from
|
|
122
|
+
# label/weight/position: a plausible-looking derived value would silently store WRONG data on
|
|
123
|
+
# exactly the scored fields this feature is used for. Callers must supply an explicit value.
|
|
124
|
+
def option(label:, value:, weight: nil)
|
|
125
|
+
@emitter.emit(:addSelectFieldOption, data_field_id: @field_id, label: label, value: value,
|
|
126
|
+
weight: weight)
|
|
120
127
|
@field_id
|
|
121
128
|
end
|
|
122
129
|
end
|
|
@@ -111,7 +111,7 @@ module Eco::API::UseCases::GraphQL::Samples::Pages::Template
|
|
|
111
111
|
description: field.description
|
|
112
112
|
) do |field_builder|
|
|
113
113
|
Array(field.options).each do |opt|
|
|
114
|
-
field_builder.option(label: opt[:label], weight: opt[:weight])
|
|
114
|
+
field_builder.option(label: opt[:label], value: opt[:value], weight: opt[:weight])
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
end
|
|
@@ -15,8 +15,17 @@ module Eco::API::UseCases::GraphQL::Samples::Pages::Template
|
|
|
15
15
|
#
|
|
16
16
|
# * `field_type` — a template field type accepted by addField (e.g. plain_text, select,
|
|
17
17
|
# date, number, gauge, rich_text, people, ...). Passed through verbatim.
|
|
18
|
-
# * `field_options` — for select-type fields: pipe-separated `label:weight`
|
|
19
|
-
# e.g. "High:10|Medium:5|Low:0".
|
|
18
|
+
# * `field_options` — for select-type fields: pipe-separated `label:value:weight`
|
|
19
|
+
# triples, e.g. "High:10:10|Medium:5:5|Low:0:0". `value` is the
|
|
20
|
+
# backend's unique, REQUIRED select-option key (cast to a number for
|
|
21
|
+
# numeric select fields) -- NEVER derived from label/weight/position
|
|
22
|
+
# here, because a derived value can collide (duplicates are rejected
|
|
23
|
+
# server-side) or silently store the WRONG number on a scored field.
|
|
24
|
+
# Weight optional via a trailing empty part, e.g. "High:H:|Low:L:". A
|
|
25
|
+
# cell resolving to exactly two parts (the OLD `label:weight`
|
|
26
|
+
# shorthand -- now ambiguous with a value-only `label:value`) or a
|
|
27
|
+
# bare label RAISES ArgumentError naming the field, option label, and
|
|
28
|
+
# offending cell -- see `#options` below.
|
|
20
29
|
# * `field_description` — carries the SECTION/FIELD IDENTITY convention (see below).
|
|
21
30
|
#
|
|
22
31
|
# SECTION / FIELD IDENTITY CONVENTION (per the CSV-pipeline project notes): stable identity for a
|
|
@@ -68,20 +77,50 @@ module Eco::API::UseCases::GraphQL::Samples::Pages::Template
|
|
|
68
77
|
field_required: truthy?(row, :field_required),
|
|
69
78
|
field_column: integer(row, :field_column) || 0,
|
|
70
79
|
field_description: value(row, :field_description),
|
|
71
|
-
field_options: options(value(row, :field_options))
|
|
80
|
+
field_options: options(value(row, :field_options), field_label: value(row, :field_label))
|
|
72
81
|
)
|
|
73
82
|
end
|
|
74
83
|
|
|
75
|
-
# Parse the options cell into [ { label:, weight: }, ... ]. Empty → [].
|
|
76
|
-
|
|
84
|
+
# Parse the options cell into [ { label:, value:, weight: }, ... ]. Empty → [].
|
|
85
|
+
#
|
|
86
|
+
# `field_label:` is ONLY used for the ArgumentError message below -- it identifies which field's
|
|
87
|
+
# options cell is malformed, since a builder raising mid-batch on a 500-row CSV is otherwise
|
|
88
|
+
# nearly impossible to trace back to the offending row.
|
|
89
|
+
def options(cell, field_label: nil)
|
|
77
90
|
return [] if cell.nil? || cell.to_s.strip.empty?
|
|
78
91
|
|
|
79
92
|
cell.to_s.split(OPTIONS_DELIMITER).map do |token|
|
|
80
|
-
|
|
81
|
-
{ label: label, weight: (weight && !weight.empty? ? Integer(weight, exception: false) : nil) }
|
|
93
|
+
option_from_token(token, field_label: field_label, cell: cell)
|
|
82
94
|
end
|
|
83
95
|
end
|
|
84
96
|
|
|
97
|
+
# A token must resolve to exactly `label:value` or `label:value:weight` (weight optional, via a
|
|
98
|
+
# present-but-empty third part). Anything else -- a bare label, or exactly two parts -- means no
|
|
99
|
+
# explicit `value` was given. Because a `label:X` two-part cell is indistinguishable from the OLD
|
|
100
|
+
# `label:weight` shorthand, it is REJECTED rather than guessed at: see the module doc for why a
|
|
101
|
+
# derived value is worse than a loud failure.
|
|
102
|
+
def option_from_token(token, field_label:, cell:)
|
|
103
|
+
parts = token.split(OPTION_WEIGHT_SEPARATOR, 3).map(&:strip)
|
|
104
|
+
label = parts[0].to_s.empty? ? nil : parts[0]
|
|
105
|
+
value = parts[1]
|
|
106
|
+
|
|
107
|
+
if parts.size < 3 || value.nil? || value.empty?
|
|
108
|
+
raise ArgumentError, missing_option_value_message(field_label, label || token, cell)
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
weight_raw = parts[2]
|
|
112
|
+
{ label: label, value: value,
|
|
113
|
+
weight: (weight_raw && !weight_raw.empty? ? Integer(weight_raw, exception: false) : nil) }
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def missing_option_value_message(field_label, option_label, cell)
|
|
117
|
+
"select option is missing an explicit `value` (field: #{field_label.inspect}, " \
|
|
118
|
+
"option: #{option_label.inspect}, cell: #{cell.to_s.inspect}). The old `label:weight` " \
|
|
119
|
+
'two-part shorthand is no longer accepted -- addSelectFieldOption requires a unique, ' \
|
|
120
|
+
'non-derived `value` per option. Add one explicitly, e.g. ' \
|
|
121
|
+
"\"#{option_label}:VALUE\" or \"#{option_label}:VALUE:WEIGHT\"."
|
|
122
|
+
end
|
|
123
|
+
|
|
85
124
|
def value(row, logical)
|
|
86
125
|
header = COLUMNS.fetch(logical)
|
|
87
126
|
raw = row[header]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module Eco::API::UseCases::GraphQL::Samples::Pages
|
|
2
2
|
# Template (workflow) build-from-scratch + (later) diff-and-update samples.
|
|
3
|
-
# See ecoportal-api-graphql
|
|
3
|
+
# See the ecoportal-api-graphql repo's internal docs.
|
|
4
4
|
module Template
|
|
5
5
|
end
|
|
6
6
|
end
|
data/lib/eco/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eco-helpers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.3.
|
|
4
|
+
version: 3.3.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oscar Segura
|
|
@@ -731,7 +731,6 @@ files:
|
|
|
731
731
|
- lib/eco/api/session/config/tagtree.rb
|
|
732
732
|
- lib/eco/api/session/config/workflow.rb
|
|
733
733
|
- lib/eco/api/usecases.rb
|
|
734
|
-
- lib/eco/api/usecases/CLAUDE.md
|
|
735
734
|
- lib/eco/api/usecases/base_case.rb
|
|
736
735
|
- lib/eco/api/usecases/base_case/model.rb
|
|
737
736
|
- lib/eco/api/usecases/base_case/type.rb
|
|
@@ -818,7 +817,6 @@ files:
|
|
|
818
817
|
- lib/eco/api/usecases/default_cases/update_case.rb
|
|
819
818
|
- lib/eco/api/usecases/default_cases/upsert_case.rb
|
|
820
819
|
- lib/eco/api/usecases/graphql.rb
|
|
821
|
-
- lib/eco/api/usecases/graphql/CLAUDE.md
|
|
822
820
|
- lib/eco/api/usecases/graphql/base.rb
|
|
823
821
|
- lib/eco/api/usecases/graphql/compat.rb
|
|
824
822
|
- lib/eco/api/usecases/graphql/compat/ooze_redirect.rb
|
|
@@ -829,7 +827,6 @@ files:
|
|
|
829
827
|
- lib/eco/api/usecases/graphql/compat/parity/harness.rb
|
|
830
828
|
- lib/eco/api/usecases/graphql/compat/parity/run_result.rb
|
|
831
829
|
- lib/eco/api/usecases/graphql/helpers.rb
|
|
832
|
-
- lib/eco/api/usecases/graphql/helpers/CLAUDE.md
|
|
833
830
|
- lib/eco/api/usecases/graphql/helpers/access_logs.rb
|
|
834
831
|
- lib/eco/api/usecases/graphql/helpers/access_logs/base.rb
|
|
835
832
|
- lib/eco/api/usecases/graphql/helpers/access_logs/base/reader.rb
|
|
@@ -879,7 +876,6 @@ files:
|
|
|
879
876
|
- lib/eco/api/usecases/graphql/helpers/pages/shortcuts.rb
|
|
880
877
|
- lib/eco/api/usecases/graphql/helpers/pages/typed_fields_pairing.rb
|
|
881
878
|
- lib/eco/api/usecases/graphql/samples.rb
|
|
882
|
-
- lib/eco/api/usecases/graphql/samples/CLAUDE.md
|
|
883
879
|
- lib/eco/api/usecases/graphql/samples/contractors.rb
|
|
884
880
|
- lib/eco/api/usecases/graphql/samples/contractors/dsl.rb
|
|
885
881
|
- lib/eco/api/usecases/graphql/samples/location.rb
|
|
@@ -907,7 +903,6 @@ files:
|
|
|
907
903
|
- lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/converter/parser.rb
|
|
908
904
|
- lib/eco/api/usecases/graphql/samples/location/service/tree_to_list/output.rb
|
|
909
905
|
- lib/eco/api/usecases/graphql/samples/pages.rb
|
|
910
|
-
- lib/eco/api/usecases/graphql/samples/pages/CLAUDE.md
|
|
911
906
|
- lib/eco/api/usecases/graphql/samples/pages/org_page.rb
|
|
912
907
|
- lib/eco/api/usecases/graphql/samples/pages/org_page/base.rb
|
|
913
908
|
- lib/eco/api/usecases/graphql/samples/pages/org_page/dsl.rb
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# usecases
|
|
2
|
-
|
|
3
|
-
The use-case registry and all built-in case base classes for scripting against EcoPortal.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## What a use case is
|
|
8
|
-
|
|
9
|
-
A use case is a self-contained, named, runnable unit of work. It registers itself with
|
|
10
|
-
the CLI framework, receives `session`, `options`, and `usecase` from the runner, and
|
|
11
|
-
executes its `process` (or `process_ooze` / `process_page`) method.
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
CLI invokes rake → rake finds registered case → UseCase#launch → main() → process()
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Directory structure
|
|
20
|
-
|
|
21
|
-
| Path | What lives there |
|
|
22
|
-
|------|-----------------|
|
|
23
|
-
| `graphql/` | GraphQL-native base cases + samples (see `graphql/CLAUDE.md`) |
|
|
24
|
-
| `ooze_samples/` | APIv2/REST base cases: `OozeBaseCase`, `RegisterUpdateCase` |
|
|
25
|
-
| `ooze_cases/` | Concrete built-in ooze cases (export register, etc.) |
|
|
26
|
-
| `default/` | Built-in people, location, and utility cases |
|
|
27
|
-
| `default_cases/` | Loader and samples for default cases |
|
|
28
|
-
| `samples/` | Misc driver samples |
|
|
29
|
-
| `graphql.rb` | GraphQL use case loader |
|
|
30
|
-
| `ooze_samples.rb` | Ooze/REST use case loader |
|
|
31
|
-
| `default.rb` | Default use case loader |
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Adding a new use case
|
|
36
|
-
|
|
37
|
-
1. Subclass the appropriate base:
|
|
38
|
-
|
|
39
|
-
| Your use case | Inherit from |
|
|
40
|
-
|---|---|
|
|
41
|
-
| Process pages in a register (update workflow) | `Eco::API::UseCases::GraphQL::PageCase` |
|
|
42
|
-
| Process pages org-wide (cross-register, audit) | `Eco::API::UseCases::GraphQL::OrgPageCase` |
|
|
43
|
-
| Custom GraphQL script (export, report, one-off) | `Eco::API::UseCases::GraphQL::Base` |
|
|
44
|
-
| Legacy APIv2 register update | `Eco::API::UseCases::OozeSamples::RegisterUpdateCase` |
|
|
45
|
-
|
|
46
|
-
2. Set `name` and `type`:
|
|
47
|
-
```ruby
|
|
48
|
-
name 'my-case-name' # CLI identifier: called with -my-case-name
|
|
49
|
-
type :other # :people | :contractors | :other
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
3. Override the entry point (`process_page`, `process`, or `process_ooze`).
|
|
53
|
-
|
|
54
|
-
4. Register in the org's `config/cli.rb`:
|
|
55
|
-
```ruby
|
|
56
|
-
cases.add('-my-case-name', :other, 'Description')
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## How cases are launched
|
|
62
|
-
|
|
63
|
-
`Eco::API::UseCases::UseCase#launch` calls `callback.call(*uio.params)` where the
|
|
64
|
-
callback is bound to `method(:main)`. Before launch, `@session` and `@options` are
|
|
65
|
-
injected into the instance — subclasses access them via the `attr_reader` in `CaseEnv`.
|
|
66
|
-
|
|
67
|
-
The `:other` type passes `(session, options, usecase)` positionally to `main`.
|
|
68
|
-
For `GraphQL::Base` subclasses the signature is `main(*_args)` — `session` and
|
|
69
|
-
`options` are already available via the helpers module before `main` is called.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Related
|
|
74
|
-
|
|
75
|
-
- `graphql/CLAUDE.md` — GraphQL case hierarchy, PageCase/OrgPageCase
|
|
76
|
-
- `ooze_samples/` — legacy v2 cases (RegisterUpdateCase, OozeBaseCase)
|
|
77
|
-
- `eco-helpers/CLAUDE.md` — top-level gem context
|
|
78
|
-
- `ecoportal-api-graphql` — upstream gem providing `SearchConf`, `Compat::Pages`, etc.
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
# usecases/graphql
|
|
2
|
-
|
|
3
|
-
GraphQL-native use case base classes and helpers. All cases here work directly with
|
|
4
|
-
`ecoportal-api-graphql` — no v2 REST layer, no ooze objects.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Class hierarchy
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
Eco::API::Common::Loaders::UseCase (registration + launch)
|
|
12
|
-
↓
|
|
13
|
-
Eco::API::UseCases::GraphQL::Base ← universal GraphQL env
|
|
14
|
-
├── GraphQL::Samples::Pages::Page::Base ← register-scoped pages
|
|
15
|
-
│ ├── GraphQL::Samples::Pages::OrgPage::Base ← org-wide pages
|
|
16
|
-
│ └── your subclass (process_page, search_conf)
|
|
17
|
-
└── your subclass directly (custom scripts: exports, reports, one-offs)
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Samples live under `samples/pages/` — NOT in the `graphql/` root. The root only
|
|
21
|
-
has `base.rb`, `helpers.rb`, `utils.rb`, and `samples.rb`.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Base — `graphql/base.rb`
|
|
26
|
-
|
|
27
|
-
Universal GraphQL environment. Provides `graphql`, `session`, `options`, `config`,
|
|
28
|
-
`simulate?`, `log`, `backup` via `Helpers::Base` (see `helpers/CLAUDE.md`).
|
|
29
|
-
|
|
30
|
-
Override `process` to write your script:
|
|
31
|
-
```ruby
|
|
32
|
-
class MyCase < Eco::API::UseCases::GraphQL::Base
|
|
33
|
-
name 'my-case'
|
|
34
|
-
def process
|
|
35
|
-
graphql.currentOrganization.contractorEntities.each { |c| puts c.name }
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Pages — `samples/pages/`
|
|
43
|
-
|
|
44
|
-
Page processing base cases. Follow the hierarchy: `page/base` → `org_page/base`.
|
|
45
|
-
|
|
46
|
-
### `samples/pages/page/base.rb` — `Samples::Pages::Page::Base`
|
|
47
|
-
|
|
48
|
-
For **register-scoped** page update workflows.
|
|
49
|
-
|
|
50
|
-
**Class methods:** `register_id 'REG_ID'`, `batch_size 50` (default)
|
|
51
|
-
|
|
52
|
-
**Override points:**
|
|
53
|
-
- `process_page(page)` — **required** — transformation for one page
|
|
54
|
-
- `search_conf` — optional — call `super` to keep register scope, then add filters
|
|
55
|
-
|
|
56
|
-
**Protected helpers:** `update_page`, `skip(reason)`, `each_page`
|
|
57
|
-
|
|
58
|
-
**KPI readers:** `total_pages`, `processed_pages`, `updated_pages`, `skipped_pages`, `failed_pages`
|
|
59
|
-
|
|
60
|
-
**DSL (via `samples/pages/page/dsl.rb`):** `sc`, `in_register`, `state_is`, `external_id_eq`, `updated_since`
|
|
61
|
-
|
|
62
|
-
```ruby
|
|
63
|
-
class Custom::UseCase::UpdateStatus < Eco::API::UseCases::GraphQL::Samples::Pages::Page::Base
|
|
64
|
-
name 'update-status'
|
|
65
|
-
register_id 'REG_ABC'
|
|
66
|
-
|
|
67
|
-
def search_conf
|
|
68
|
-
super.filter(state_is(:active))
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
def process_page(page)
|
|
72
|
-
page.name = page.name.upcase
|
|
73
|
-
update_page(page)
|
|
74
|
-
end
|
|
75
|
-
end
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
### `samples/pages/org_page/base.rb` — `Samples::Pages::OrgPage::Base`
|
|
79
|
-
|
|
80
|
-
Inherits `Page::Base`. `search_conf` starts empty (org-wide, no register scope).
|
|
81
|
-
Use for: archive sweeps, cross-register audits, bulk org operations.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Samples — `graphql/samples/`
|
|
86
|
-
|
|
87
|
-
Built-in ready-to-use case implementations:
|
|
88
|
-
- `samples/location.rb` — location structure management cases
|
|
89
|
-
- `samples/contractors.rb` — contractor entity cases
|
|
90
|
-
|
|
91
|
-
See `samples/CLAUDE.md` for details.
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## Helpers — `graphql/helpers/`
|
|
96
|
-
|
|
97
|
-
Mixins providing domain-specific access patterns. See `helpers/CLAUDE.md`.
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
|
|
101
|
-
## Loader order in `graphql.rb`
|
|
102
|
-
|
|
103
|
-
```ruby
|
|
104
|
-
require 'graphql/helpers' # environment mixins (graphql, session, simulate? etc.)
|
|
105
|
-
require 'graphql/utils' # utility modules (SFTP etc.)
|
|
106
|
-
require 'graphql/base' # GraphQL::Base — universal foundation
|
|
107
|
-
require 'graphql/samples' # sample cases: location, contractors, pages, ...
|
|
108
|
-
# └─ graphql/samples/pages.rb
|
|
109
|
-
# └─ pages/page.rb → page/dsl.rb, page/base.rb
|
|
110
|
-
# └─ pages/org_page.rb → org_page/dsl.rb, org_page/base.rb
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Page base cases are in `samples/pages/` — NOT in the `graphql/` root.
|
|
114
|
-
Custom org cases are NOT loaded here — they live in the implementation repo.
|
|
115
|
-
|
|
116
|
-
## default/pages/
|
|
117
|
-
|
|
118
|
-
CLI-integrated page use cases go in `default/pages/` (mirroring `default/locations/`
|
|
119
|
-
and `default/people/`). Currently empty — add cases there when a pattern is common
|
|
120
|
-
enough to expose to all org environments. See `default/pages.rb` for the convention.
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
# usecases/graphql/helpers
|
|
2
|
-
|
|
3
|
-
Mixin modules providing domain-specific helper methods for GraphQL use cases.
|
|
4
|
-
All modules are ultimately included via `Helpers::Base` into `GraphQL::Base`.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Include chain
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
GraphQL::Base
|
|
12
|
-
includes Helpers::Base
|
|
13
|
-
includes CaseEnv → session, options, config, simulate?, log, ErrorHandling
|
|
14
|
-
includes GraphQLEnv → graphql (lazy, memoized)
|
|
15
|
-
includes Helpers (loader)
|
|
16
|
-
includes Helpers::Location → location tree helpers
|
|
17
|
-
includes Helpers::Contractors → contractor entity helpers
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Helpers::Base (`helpers/base.rb`)
|
|
23
|
-
|
|
24
|
-
Core environment — included in every GraphQL use case.
|
|
25
|
-
|
|
26
|
-
| Method | Source | Description |
|
|
27
|
-
|--------|--------|-------------|
|
|
28
|
-
| `session` | `CaseEnv` | Current `Eco::API::Session` |
|
|
29
|
-
| `options` | `CaseEnv` | Options hash from CLI/runner |
|
|
30
|
-
| `config` | `CaseEnv` | `session.config` shortcut |
|
|
31
|
-
| `simulate?` | `CaseEnv` | `options[:simulate] \|\| options[:dry_run]` |
|
|
32
|
-
| `log(level)` | `CaseEnv` | Logger proxy |
|
|
33
|
-
| `graphql` | `GraphQLEnv` | Lazy-loaded `Ecoportal::API::GraphQL` instance |
|
|
34
|
-
| `backup(data, type:)` | `Helpers::Base` | Save JSON to requests folder |
|
|
35
|
-
| `exit_error(msg)` | `Helpers::Base` | Log error and `exit(1)` |
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Helpers::Location (`helpers/location/`)
|
|
40
|
-
|
|
41
|
-
Location tree access, tag remapping, classification parsing.
|
|
42
|
-
|
|
43
|
-
- `helpers/location/base.rb` — `Location::Base` mixin
|
|
44
|
-
- `helpers/location/base/tree_tracking.rb` — track tree mutations
|
|
45
|
-
- `helpers/location/base/classifications_parser.rb` — parse location classifications
|
|
46
|
-
- `helpers/location/tags_remap/` — remapping tags across location changes
|
|
47
|
-
- `helpers/location/command/` — apply/diff location structure commands
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## Helpers::Contractors (`helpers/contractors/`)
|
|
52
|
-
|
|
53
|
-
Contractor entity loading helpers.
|
|
54
|
-
|
|
55
|
-
- `helpers/contractors/base.rb` — base contractor helpers
|
|
56
|
-
- `helpers/contractors/base/load.rb` — batch load contractor entities
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## Adding a new helper
|
|
61
|
-
|
|
62
|
-
1. Create `helpers/my_domain/base.rb`:
|
|
63
|
-
```ruby
|
|
64
|
-
module Eco::API::UseCases::GraphQL::Helpers
|
|
65
|
-
module MyDomain
|
|
66
|
-
module Base
|
|
67
|
-
private
|
|
68
|
-
def my_helper_method
|
|
69
|
-
graphql.myDomainQuery(...)
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
```
|
|
75
|
-
2. Create `helpers/my_domain.rb` as a loader that includes `Base`
|
|
76
|
-
3. Add `require_relative 'my_domain'` to `helpers.rb`
|
|
77
|
-
|
|
78
|
-
The helper is then available in all cases that include `Helpers::Base` (i.e., all
|
|
79
|
-
subclasses of `GraphQL::Base` including `PageCase` and `OrgPageCase`).
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# usecases/graphql/samples
|
|
2
|
-
|
|
3
|
-
Built-in GraphQL sample base classes shipped with the gem.
|
|
4
|
-
These are abstract/semi-abstract classes that org scripts inherit from.
|
|
5
|
-
Concrete, CLI-integrated cases go in `usecases/default/` instead.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Hierarchy convention
|
|
10
|
-
|
|
11
|
-
Each domain follows:
|
|
12
|
-
```
|
|
13
|
-
samples/<domain>.rb ← namespace loader (may also BE the base class)
|
|
14
|
-
samples/<domain>/
|
|
15
|
-
<level>/
|
|
16
|
-
dsl.rb ← DSL concern — include in base, available to subclasses
|
|
17
|
-
base.rb ← Base class (inherits from GraphQL::Base or parent level)
|
|
18
|
-
<functional_level>.rb ← Optional: opinionated subclass, inherit directly
|
|
19
|
-
<functional_level>/
|
|
20
|
-
dsl.rb ← Further DSL for that functional level
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
DSLs are always **concerns (modules)** to include — never classes.
|
|
24
|
-
Bases are **classes** with the scaffolding logic.
|
|
25
|
-
Functional levels add opinionated defaults on top of base.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Contents
|
|
30
|
-
|
|
31
|
-
| File | Class | Purpose |
|
|
32
|
-
|------|-------|---------|
|
|
33
|
-
| `samples/location.rb` | `Samples::Location` | Location structure management |
|
|
34
|
-
| `samples/location/command.rb` | `Samples::Location::Command` | Apply location tree commands |
|
|
35
|
-
| `samples/location/service.rb` | `Samples::Location::Service` | Tree diffing and conversion service |
|
|
36
|
-
| `samples/contractors.rb` | `Samples::Contractors` | Contractor entity base case |
|
|
37
|
-
| `samples/contractors/dsl.rb` | `Contractors::DSL` | Contractor helper mixin |
|
|
38
|
-
| `samples/pages.rb` | `Samples::Pages` (namespace) | Page processing cases loader |
|
|
39
|
-
| `samples/pages/page/dsl.rb` | `Pages::Page::DSL` | SearchConf helpers mixin |
|
|
40
|
-
| `samples/pages/page/base.rb` | `Pages::Page::Base` | Register-scoped page iteration |
|
|
41
|
-
| `samples/pages/org_page/dsl.rb` | `Pages::OrgPage::DSL` | Org-page DSL (extends Page::DSL) |
|
|
42
|
-
| `samples/pages/org_page/base.rb` | `Pages::OrgPage::Base` | Org-wide page iteration |
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Difference: samples vs org-specific cases vs default
|
|
47
|
-
|
|
48
|
-
| Layer | Location | Purpose |
|
|
49
|
-
|---|---|---|
|
|
50
|
-
| **samples** (here) | `eco-helpers/lib/.../graphql/samples/` | Abstract base classes — org scripts inherit |
|
|
51
|
-
| **default** | `eco-helpers/lib/.../usecases/default/` | Concrete CLI-integrated cases for ALL orgs |
|
|
52
|
-
| **org-specific** | `multi_org_api/{org}/config/graphql_cases/` | Org-specific implementations |
|
|
53
|
-
|
|
54
|
-
Org scripts inherit from `samples/`, optionally via `default/` as an intermediate layer.
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Adding a new built-in sample
|
|
59
|
-
|
|
60
|
-
1. Create the case file in `samples/`:
|
|
61
|
-
```ruby
|
|
62
|
-
# lib/eco/api/usecases/graphql/samples/my_domain.rb
|
|
63
|
-
class Eco::API::UseCases::GraphQL::Samples::MyDomain < Eco::API::UseCases::GraphQL::Base
|
|
64
|
-
name 'my-domain-case'
|
|
65
|
-
type :other
|
|
66
|
-
|
|
67
|
-
def process
|
|
68
|
-
# ...
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
2. Add `require_relative 'samples/my_domain'` to `samples.rb`.
|
|
74
|
-
|
|
75
|
-
If the case is page-centric, inherit from `PageCase` instead of `Base` to get
|
|
76
|
-
pagination, KPI tracking, and `update_page` for free.
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# samples/pages
|
|
2
|
-
|
|
3
|
-
Base classes for GraphQL-native page processing use cases.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Structure
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
pages/
|
|
11
|
-
page/
|
|
12
|
-
dsl.rb ← Page::DSL — SearchConf helpers mixin (sc, in_register, state_is, ...)
|
|
13
|
-
base.rb ← Page::Base — register-scoped page iteration + KPI scaffolding
|
|
14
|
-
org_page/
|
|
15
|
-
dsl.rb ← OrgPage::DSL — extends Page::DSL (org-wide helpers)
|
|
16
|
-
base.rb ← OrgPage::Base — org-wide iteration (no default register scope)
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
## Inheritance
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
GraphQL::Base
|
|
25
|
-
↓
|
|
26
|
-
Samples::Pages::Page::Base (register-scoped, inherits Page::DSL)
|
|
27
|
-
↓
|
|
28
|
-
Samples::Pages::OrgPage::Base (org-wide, overrides search_conf)
|
|
29
|
-
↓
|
|
30
|
-
your org subclass
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Page::Base — register-scoped scripts
|
|
36
|
-
|
|
37
|
-
Override `process_page(page)` and optionally `search_conf`.
|
|
38
|
-
Set `register_id` and `batch_size` on the class.
|
|
39
|
-
|
|
40
|
-
## OrgPage::Base — org-wide scripts
|
|
41
|
-
|
|
42
|
-
Same as Page::Base but `search_conf` starts empty.
|
|
43
|
-
Add your own filters via `super.filter(state_is(:active))` etc.
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Adding a functional level
|
|
48
|
-
|
|
49
|
-
If a common pattern emerges (e.g., "stage-submit scripts"), add:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
pages/page/
|
|
53
|
-
stage_submitter.rb ← Page::StageSubmitter < Page::Base
|
|
54
|
-
stage_submitter/
|
|
55
|
-
dsl.rb ← StageSubmitter::DSL
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Keep base.rb for the pure iteration scaffolding; put opinionated defaults in
|
|
59
|
-
the functional level so scripts can choose their entry point.
|