flightcheck: re-point ENV-004 to Declarative Agent components API - #314
Open
Dawn Jeong (daeunJe0ng) wants to merge 11 commits into
Open
Dawn Jeong (daeunJe0ng) wants to merge 11 commits into
Dawn Jeong (daeunJe0ng) wants to merge 11 commits into
Conversation
This was referenced Sep 23, 2026
…test (AB#7852506, AB#7852495, AB#7852511) Extract the shared minimalBots components connection-reference reader into checks/_da_connection_refs.py as the single source that DV-CONN-001 (active agent), ENV-004 (environment-wide, de-duped by logical name) and the Workday shared-parameter checks (WD-ENV-001/WD-REST-001) all read through, so the per-check re-point PRs stop adding divergent copies of it. The module is the superset of PR microsoft#317's reader plus a public read_all_agents_connection_references() that de-dupes by connection-reference logical name for ENV-004. Brings the validated/documented mock builders the checks need and a direct pure-logic contract test (18 cases) covering normalization, None-gating (SKIP), fail-loudly ValueError, JSON-string sharedConnectionParameters parsing, and the Workday shared-parameter sweep. Foundation for the 6 DA re-point PRs to rebase onto (single shared reader, no add/add collision). Full flightcheck suite: 1142 passed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e25cf992-09c9-49b8-9971-2a19cb2fcb05
… (7852506) Read the Workday SOAP connection reference from the Declarative Agent minimalBots components API (runner.agentbuilder.fetch_components) instead of the Custom Agent Dataverse connectionreferences query, so DV-CONN-001 works against DA-GA agents that no longer expose Dataverse. Verdict simplifies to found + bound (connectionId present); the Dataverse-only statuscode and multiple-ref branches are dropped since the components shape carries neither. BAP owner echo is unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Distinguish a genuinely-absent connectionReferenceChanges (missing key -> no references -> FAILED not-found) from a present-but-non-list payload (a shape we do not understand -> raise ValueError so the dispatcher degrades DV-CONN-001 to a WARNING). Mirrors native_agent._connection_references, the shipped precedent this check re-uses; the prior code collapsed both to [] and could report a confident "reference not found" on an unparseable 200 response. Adds a malformed-changeset test. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…list) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8246cd2c-37d0-4000-8fe3-fa9b082669e0
Dawn Jeong (daeunJe0ng)
force-pushed
the
users/dawnjeong/flightcheck-da-env-004-7852495
branch
from
September 24, 2026 00:10
47a4575 to
c4b8f31
Compare
…52495) Re-points ENV-004 (connections & connection references) off the Dataverse connectionreference table onto the Declarative Agent minimalBots components API, the same validated surface DV-CONN-001 reads, so the check runs on a DA-GA install where the agent's authored state no longer lives in Dataverse. The DA components changeset IS each agent's declared reference set, so the env-wide orphan / missing-reference / unbound-connection branches (which needed a Dataverse connection inventory) are dropped; each reference is classified bound (PASS) or unbound (FAIL). Adds an opt-in GRS commit-pin sub-check ENV-004-GRS that verifies the deployed agent's minimalBots ALM commit matches an expected SHA when one is recorded in config. Extracts the shared fetch/normalize/fail-loudly reader into _da_connection_refs.py (single source for DV-CONN-001 and ENV-004) and retires the Dataverse agent-scoping module _agent_connection_refs.py. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8246cd2c-37d0-4000-8fe3-fa9b082669e0
…eview nit) Removes a stray multi-space run left by an earlier reflow in the _query_connection_references docstring. Cosmetic only; no behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8246cd2c-37d0-4000-8fe3-fa9b082669e0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8246cd2c-37d0-4000-8fe3-fa9b082669e0
This was referenced Sep 24, 2026
# Conflicts: # tests/mocks/agentbuilder_connectivity.py
…ghtcheck-da-env-004-7852495 # Conflicts: # solutions/ess-maker-skills/scripts/flightcheck/checks/workday_extension.py
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.
Summary
Re-points the FlightCheck check ENV-004 (connections & connection references) from the Custom Agent Dataverse
connectionreferencesquery to the Declarative Agent (DA) minimalBots components API.Dependencies: the shared
_da_connection_refs.pyreader is provided by #326 (merge first). This PR is also stacked on #304 (DV-CONN-001 re-point), so merge order is #326 -> #304 -> this PR. Until #326 and #304 merge, this PR's diff also shows their commits; it reduces to the ENV-004-only diff once they land. This PR targetsmain.FlightCheck is the ESS (Employee Self-Service) pre-flight validator a maker runs before shipping the agent. ENV-004 reports whether the agent's connection references are bound to real connections. On a Declarative Agent General Availability (DA-GA) install the agent's authored state no longer lives in Dataverse, so the old Dataverse read returned nothing and the check could not run. This change reads the same connection-reference data from the API the DA actually exposes, the same validated surface DV-CONN-001 now uses.
Work items: AB#7852495 (ENV-004 re-point), parent AB#7865450 (ESS DA GA FlightCheck).
What changed
checks/_da_connection_refs.pyreader (provided by flightcheck: add canonical DA connection-reference reader + contract test #326): fetches and normalizes the minimalBots componentsconnectionReferenceChangesblock into{connectionreferencelogicalname, connectorid, connectionid}rows. Single source for both DV-CONN-001 (single active agent) and ENV-004 (every configured agent, unioned and de-duped by logical name) so the two checks cannot drift. Fail-loudly: missing changeset key ->[](genuine absence); present-but-not-a-list ->ValueError(dispatcher degrades to WARNING); no AgentBuilder client or no configured botId ->None(SKIP).checks/workday_extension.py: DV-CONN-001's_query_connection_referencesnow delegates to the shared reader (behavior-preserving; theValueErrormessage and WARNING degrade path are unchanged).checks/environment.py:_check_connections_and_refs(ENV-004) rewritten to the DA model. Reads every configured agent's references via the shared reader; classifies eachconnectionIdpresent = bound (PASS), absent = unbound (FAIL). Emits a summary row plus oneENV-004-UR-{i:03d}detail row per unbound reference. The env-wide orphan-reference / missing-reference / unbound-connection branches are dropped, because the DA components changeset carries no environment-wide connection inventory to compute them from. Removed the dead Dataverse helpers (_resolve_ref_solutions,_solution_link_parts) and their imports._env004_grs_commit_pin_result): opt-in commit pin that verifies the deployed agent's minimalBots ALM commit (GET .../alm/{id}/configure?realm={int}->commitSha) matches an expected GRS commit SHA recorded in config. SKIP when no expected SHA is configured (inert until an operator opts in). Its verdict folds into the ENV-004 summary status so a targeted--check ENV-004run (which filters detail rows out) still surfaces a GRS failure.registry.py: added the ENV-004CheckpointSpec(a standalone checkpoint, not part of a checkpoint group),clients {AGENTBUILDER},requires_dataverse_endpoint False,requires_config True, roles Power Platform admin + ESS maker. ENV-004 is deliberately not added toOWNED_PREFIXES, so itsENV-004-GRS/ENV-004-UR-*detail rows do not resolve as standalone checkpoints.checks/_agent_connection_refs.py(the Dataverse topic->flow->reference scoper) and its test; updated the three cassette-catalog (INDEX.md) clauses that referenced it.agentbuilder_connectivitymock with acommitShabuilder; added a registry assertion.Design rationale
connectionReferenceChangesfromPOST /copilotstudio/minimalBots/api/{agent_id}/components, the exact validated-tier surface the shipped nativeDA-CONN-001and the stacked DV-CONN-001 read. The GRS pin reads.../alm/{id}/configure, whosecommitShais captured in the validated cassetteagentbuilder_readiness.yaml(line 82). Perscripts/flightcheck/AGENTS.mdno new cassette is required.connectionReferenceshape has nostatuscodeand no env-wide connection list, so the inactive-status, orphan, missing, and unbound-connection verdicts were dropped rather than faked. ENV-004 now asserts only what the API returns: is each declared reference bound.expectedGrsCommitSha(or an alias) is recorded in.local/config.json, so it never blocks a run that does not use commit pinning. It is a new local config key (see validation checklist).Testing
python -m pytest tests/flightcheck-> 1091 passed.python -m ruff checkon all changed files -> clean.resultandremediation): all references bound (PASSED); one/more unbound (FAILED +ENV-004-UR-001detail row); references unioned + de-duped across multiple configured agents; no AgentBuilder client (SKIPPED); no configured botId (SKIPPED); malformed changeset (WARNING); failed summary deep-links to the Power Apps solutions pane + connection-reference doc; unbound without env id falls back to prose. GRS pin: no expected SHA (SKIPPED + omitted from summary); matching commit (PASSED + folded into summary); mismatch (FAILED, forces summary FAIL); missingcommitShain configure (FAILED); configure read error (WARNING); invalid realm (FAILED); Dev realm = 0 regression guard (PASSED).Risks
--check ENV-004run; a broad scope run does not yet build it, so ENV-004 SKIPs there. Documented as a known limitation, mirroring DV-CONN-001.expectedGrsCommitShais a new opt-in local config key. Absent it, the GRS pin is inert (SKIP).Live DA-environment validation (partially complete)
Executed live against real test-ring Declarative Agent (DA) agents on 2026-09-22, authenticating as
lmoulet@employeehub.onmicrosoft.comwith the cached AgentBuilder token. This does NOT depend on the TIP2 (Test-In-Production ring 2) auth issue: ENV-004 reads the minimalBots components + ALM configure APIs, which the prod-audience token reaches. TIP2 only gates the separate Workday live "litmus" active probe (WD-RUN-001), which is not part of this PR. The check ran against the "ESS GA Sep15" env (env id258bd301-3bcc-ef24-b832-867283451031) configured with all three of its agents.Validated live:
fetch_componentson a real DA agent returnsconnectionReferenceChanges, withconnectionIdpresent for bound references. Confirmed: the Sep15 HR agent returned a boundshared_service-nowreference.agents[]; the summary collapsed to the 2 distinct bound references.--checkpoint ENV-004run:cli.pybuiltrunner.agentbuilderand read the configured agent botIds with no false SKIP.Not yet validated:
ENV-004-UR-001detail row. No reachable test-ring agent currently has an unbound reference (all observed references were bound).env_idopens the Objects -> Connection references pane.botId/ no AgentBuilder client -> SKIPPED, no crash.expectedGrsCommitShain.local/config.json; confirm.../alm/{id}/configure?realm={int}returns acommitSha; ENV-004-GRS -> PASSED on match, FAILED on a deliberately wrong SHA.To reproduce the unbound-reference FAIL and the Workday-specific cases, a Workday DA agent must be provisioned in the dedicated Workday test env
lmoulet-2026-09-21-da-ga-workday(env ida53fe556-24e9-e3ae-a008-9e8e82974f47, owner Laurent Moulet), which currently exposes no published DA agent.Sync update (2026-09-24)
upstream/maininto this branch (no rebase, no force-push).checks/workday_extension.py: main independently added a Dataversequery_all-based_query_connection_referenceshelper; this branch (stacked on the DV-CONN-001 re-point, PR flightcheck: fail loud on malformed DA connection-ref payloads (reader hardening) #304) supersedes it with the reader-basedread_active_agent_connection_references, so the now-deadquery_allimport was dropped. Kept main'sagent_scopeimports.ruffclean; targeted tests (test_workday_extension.py,test_da_connection_refs.py) 50 passed; fulltests/flightchecksuite 1175 passed.