Repository navigation
feat(view): executor supplies declared input roles (RS-W2-3 PR-A) - #552
Merged
Merged
Conversation
An analytic routine's leading arguments are now its declared `inputs`, supplied in declared order by the environment's RoleSupply; the executor no longer reads parameter names (mgr/ce/expert/client) to decide what to pass. - role_supply.py: RoleSupply protocol, Viewer/Subject, RoleRefused / NoSuchReader / CallerTokenExpired, PlainSupply, supply_inputs(). PlainSupply hands back the caller's one EgeriaTech for EgeriaTech and every class it proxies (no subclients: Wave 2 is byte-identical), built lazily so a routine with no client never connects (ISSUE-137). - exec_report_spec / _exec_analytic_chart / _run_analytic_function / run_analytic_action take an optional `supply=`; _count_client_params and _bind_client_args are removed. - Check 5 refuses: spec_resolver.declared_inputs() is the one function the resolver (at load) and the executor (at run) both call; a binding whose leading client arguments differ from the declared egeria_client inputs is refused with the same words in both places. A role the supply cannot provide refuses before the first stage. - The 28 built-ins declare inputs by the class each argument calls (MetadataExpert, ClassificationExplorer, SecurityOfficer; EgeriaTech for asset_composition and metric_trend's first slot). Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
trellis-analytics 0.4's routine_declaration(manifest, **extra) does not read `inputs` from a manifest; its docstring lists inputs among what `extra` adds. Now that every built-in declares inputs (RS-W2-3), the mirror test passes them the documented way. Library follow-up: read manifest.inputs directly. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
This was referenced Nov 8, 2026
dwolfson
added a commit
that referenced
this pull request
Nov 8, 2026
mandy-chessell
pushed a commit
to odpi/egeria-workspaces
that referenced
this pull request
Nov 8, 2026
PortalSupply(request) in egeria_auth.py is the Portal's pyegeria RoleSupply. Clients are built by class with the request token through use_token (no password, so no identity switch on a 401); an expired token is refused with CallerTokenExpired before any Egeria call; every client is built inside the request's forLineage setting; the viewer is read from the existing report_viewer contextvar. execute_spec passes the supply to exec_report_spec and maps CallerTokenExpired to HTTP 401 with the existing 401 words. Needs a pyegeria release carrying odpi/egeria-python#552 (6.2.26); the pyegeria-web image must be rebuilt on it. Signed-off-by: Dan Wolfson <dan.wolfson@pdr-associates.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RS-W2-3 PR-A: the executor supplies declared input roles (no more parameter-name introspection)
Brief:
BRIEF-RS-W2-3-inputs-by-role-2026-11-07.md(STATUS + §A, A0–A7). Base: upstream/main8ce7f02e(pyegeria 6.2.25).What changes
pyegeria/view/role_supply.py. It holds theRoleSupplyprotocol (client(cls),viewer(),reader(source),subject(),refusal_words(kind)),ViewerandSubject, and the refusalsRoleRefused/NoSuchReader/CallerTokenExpired(ValueErrorsubclasses that carry.words,.role,.routine,.reason). It also hasPlainSupplyandsupply_inputs(routine, inputs, supply).inputs, in declared order, to the leading positional slots. Declared parameters then follow by name._ANALYTIC_CLIENT_PARAM_NAMES,_count_client_paramsand_bind_client_argsare deleted._run_analytic_functionandrun_analytic_action(fetch + analytic) both go throughsupply_inputs.exec_report_specand_exec_analytic_charttake a new optionalsupply=, which is the hook the Portal adapter will use. When it is omitted, aPlainSupplyis built from today's arguments (view_server/view_url/user/user_pass/token).PlainSupplykeeps Wave 2 byte-identical.client(cls)returns the caller's oneEgeriaTechforEgeriaTechand for every class in its_subclient_map, and never a subclient (ruling A3). The client is built lazily, at most once per run, and only when anegeria_clientinput is declared, so ISSUE-137 (no client means no connection and no token) still holds. Readers, viewer and subject are refused with plain pyegeria's words.subject()returns None, whichsupply_inputsrefuses.spec_resolver.declared_inputs(func_decl, func=None)is the one function that both the resolver's check 5 (at load) and the executor (at run, before binding) call. That satisfies rule 1: the same words at load and at run. It refuses in three cases: an unregistered routine, an input that is not a role word or is repeated, and a binding whose leading client-argument count differs from the declaration'segeria_clientcount: "routine X's binding takes N leading client argument(s) and its declaration lists M egeria_client input(s)". The signature count (_binding_client_slots) lives only in the resolver module and is a consistency check, never a binding. At run time, a role the supply cannot provide raises before stage 1, with the supply'srefusal_words.inputs(table below). Each slot is declared by the class whose methods that argument actually calls (A3). I found the classes by running each function with one recording fake per slot and mapping each called method to theEgeriaTechsubclient class that defines it.EgeriaTechis used only for an argument that calls across classes._resolve_action_target_client(find-method specs) is unchanged. It picks a client class from the spec'sClass.method, not from parameter names. Replacing it with the supply would hand out subclients, a behaviour change that belongs to Wave 3.The 28
inputsdeclarationscount_metadata_elements/find_metadata_elementsfind_metadata_elementsfind_metadata_elementsget_relationshipsget_relationships(theexpertkwarg is not a slot; unchanged)get_relationshipsget_relationshipsget_relationshipsfind_metadata_elementsget_relationshipsrun_analytic_action)get_relationships(theexpertkwarg is not a slot)get_relationshipsfind_metadata_elementsget_relationshipsper weekget_relationshipsmgr(incl. asset_composition, which also calls ValidMetadata); ce only to targets'ceslots, all ClassificationExplorerget_sub_types(ValidMetadata*) throughvm=mgr;vmis not an executor slot (A1)get_control_implementation_summaryGates (§A7)
uv run -p 3.13 pytest tests/micro-tests/, Python 3.13, counts from JUnit XML): without the library, 2257 tests: 2254 passed, 3 skipped, 0 failed (on 872dd83; the second commit changes only a test that is skipped without the library). With egeria-trellis-analytics 0.4.0 (throwaway venv,--no-depsover this tree): 2380 tests: 2379 passed, 1 skipped, 0 failed on 81642a4.test_routine_declarations_match_librarycomparestrellis_analytics.routine.routine_declaration(spec)withspec.routine(). Library 0.4.0'sroutine_declaration(manifest, **extra)does not readinputsfrom a manifest; its docstring listsinputsamong whatextraadds. With inputs now declared on all 28 built-ins, the test passes them that documented way (65/0 with the library). Library follow-up (0.4.x): readmanifest.inputsdirectly.exec_report_specresults, plus the client-construction/auth call log, are identical underPlainSupplyand a clean 6.2.25 (8ce7f02) install. The harness fakes only the Egeria client. The baseline was run twice first to prove it is deterministic.curation_coverage_tiletakes no client and declares no inputs, so it passes check 5 (A5).tests/micro-tests/test_rs_w2_3_inputs_by_role.py):viewerunder PlainSupply refuses with "Routine 'who_is_looking' cannot run: its declared input 'viewer' is not supplied (Plain pyegeria does not know who is viewing; …)". No stage runs.CallerTokenExpiredrefuses before stage 1, with the environment's words.declared_inputs.Notes
base_report_formats.py,analytic_demo_specs.pyor library 0.4.0 setsanalytic_binders. Only the executor,_output_format_models.py,spec_resolver.pyand three test files touch it. That PR is the deprecation shim plus tests; no spec rewrite is needed. Binders still run unchanged in this PR.overview_metrics.metric_trendstill binds its target routine'smgr/ceby name inside the routine (its own_CLIENT_PARAM_NAMES). That code is outside the executor and this PR's files, and since both values are the caller's one EgeriaTech, the behaviour is identical. Follow-up: let it bind by the target's declaredinputs.tests/micro-tests/test_issue_169_analytic_resolver.py::test_allowed_dotted_path_resolves_and_logs_at_debug_onlyfails when run after certain other test files in a partial selection. This is pre-existing: the same selection fails on 8ce7f02. It passes alone and in the full suite order.Compatibility (R1, Architect read-back): put this in the next release notes. A config-tier, entry-point or runtime-registered routine that takes
mgr/ce/expert/clientbut declares noinputsis now refused by check 5, at load and at run, with words. The fix is to declare its inputs. Checked: the Portal'sre_analyticsregistration and the egeria-trellis-analytics 0.4.0 manifests take no client argument, so neither is affected.Read-back: PASS (Architect,
~/.re-gate/READBACK-RS-W2-3-PR-A-2026-11-08.md). Coordinator gate: full micro-suite 3.13, 2257 tests / 0 failed / 3 skipped.🤖 Generated with Claude Code