Skip to content

feat(event-script): f:minRange and f:maxRange - the bounds of a range typed by the notation; rangeLookup checks every band when it reads a table - #554

Merged
acn-ericlaw merged 2 commits into
mainfrom
feat/range-bounds-plugins
Oct 11, 2026
Merged

acn-ericlaw merged 2 commits into
mainfrom
feat/range-bounds-plugins

Conversation

@acn-ericlaw

Copy link
Copy Markdown
Contributor

What

f:minRange(range, default) and f:maxRange(range, default), two simple plugins that read one range in the notation of f:rangeLookup's bands (min..max, min.., ..max) and return its lower or upper bound, typed by the notation: a numeric bound is a number (a whole number within the 64-bit range a long, any other number a double), a text bound is text as written, and an open end answers the optional default, or null when there is none. f:rangeLookup now checks every band when it reads a table, whatever the value, so a band that could never match (3..3, the upper bound being excluded) is refused by name on the table's first use. The three plugins share one notation reader, RangeNotation in com.accenture.util, allow-listed in the plugin loader's bytecode gate beside the decimal helper, so a range is refused by one of them exactly when the others refuse it; the gate test now names the three plugins.

Pinned by the shared range-bounds-vectors.json (34 vectors, byte-identical with the Rust twin Accenture/mercury#380, Increment 177), three new range-lookup-vectors.json entries, the fixture unit-test-range-bounds-1 (the band the lookup chose read back through a dynamic key; a graph.math IF/THEN/ELSE computing the distance to the next tier only when the band has an upper bound), the plugin tests and the gate test. Docs: the syntax guide's plugin table and The bounds of a band, the flow schema reference, the skills reference's Range tables, the command reference, the AI agent guide and help graph-data-mapper with the rebuilt bundle (index-DgBUB6YY.js; a rebuild of the unchanged sources reproduced the committed bundle byte for byte before the help edit). CHANGELOG Unreleased item 1.

Why

Eric's follow-up to f:rangeLookup: with the bounds encoded in the range text, a developer or an AI agent needs graph.math or graph.data.mapper to read a band's min and max back, typed as the number or text they are; and a range whose max is not above its min can never match, so the lookup must refuse it rather than carry it silently.

Verification

  • mvn -o -q -pl system/event-script-engine test on the plugin, lookup and gate tests; mvn -o -pl system/minigraph-playground-engine test on the two vector tests and GraphTaskTest (23 tests, 0 failures); SkillSnapshotTest green.
  • scripts/check-doc-canon.py, check-minigraph-grammar.py and check-rest-automation-grammar.py OK.
  • The vector files, the fixture, the help page and the bundle are byte-identical in both repositories; the Rust vector test passed on its first run.

Upgrade note: a range table holding an empty or mixed band beyond the bands a run reached was accepted before and is refused now - fix the band; no other action.

Co-Authored-By: Claude Fable 5.1 noreply@anthropic.com

🤖 Generated with Claude Code

… typed by the notation; rangeLookup checks every band when it reads a table

Two simple plugins read one range in the band notation (min..max, min.., ..max) and answer its lower or upper bound: a numeric bound as a number (a whole number a long, any other number a double), a text bound as text, an open end as the optional default or null. The three range plugins share one notation reader, RangeNotation, allow-listed in the loader's gate, so a malformed, mixed or empty range (3..3, the upper bound being excluded) is refused by every one of them, and the lookup now checks every band when it reads the table, whatever the value. Pinned by the shared range-bounds-vectors.json (34 vectors), three new range-lookup vectors, the fixture unit-test-range-bounds-1 and the plugin and gate tests; docs and the help page with the rebuilt bundle.
acn-ericlaw added a commit that referenced this pull request Oct 11, 2026
… both engines (#554, mercury #380); the lookup checks every band; the loader-gate allow-list lesson on the decision-table fact

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d parse split into helpers (two Sonar code smells); the vector test's javadoc and imports tidied

Sonar on the branch: the constant NUMERIC beside the field numeric (now CANONICAL_NUMBER), and parse at cognitive complexity 17 (the notation refusal, the first-draft markers, the two-bound checks and the open-end reading are helpers now; no behaviour change - the plugin, gate, vector and graph tests are green). The vector test's unused List import and its javadoc wording are Eric's touch-up.
@acn-ericlaw
acn-ericlaw merged commit 6326f28 into main Oct 11, 2026
6 checks passed
@acn-ericlaw
acn-ericlaw deleted the feat/range-bounds-plugins branch October 11, 2026 18:21
acn-ericlaw added a commit that referenced this pull request Oct 11, 2026
…cury #380 merged (62239b44); both range-bound plugins on main

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant