Skip to content

fix(compliance): pin capability-resolution reprobe to the run target version - #7683

Merged
andybevan-scope3 merged 2 commits into
mainfrom
branch-item-1-and-todos
Sep 30, 2026
Merged

andybevan-scope3 merged 2 commits into
mainfrom
branch-item-1-and-todos

Conversation

@andybevan-scope3

@andybevan-scope3 andybevan-scope3 commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Follow-up to #7682. That PR pinned the hosted auth pre-discovery probe to the run target. #7356 stayed open because one more evaluate_agent_quality path still called the agent without a version.

When a run fails with a specialism_parent_protocol_missing capability-resolution error, classifyCapabilityResolutionErrorWithDeclaredProtocols reprobes get_adcp_capabilities to refine the error classification. That reprobe passed only auth, so the SDK test client used its built-in ADCP_VERSION (currently 3.2.0-rc.3). An agent evaluated at an explicit stable target like 3.1.20 would get a prerelease request it rejects with VERSION_UNSUPPORTED, and the classification then fell back to the unrefined result.

What changed

  • classifyCapabilityResolutionErrorWithDeclaredProtocols moves from server/src/addie/mcp/member-tools.ts into server/src/addie/services/compliance-testing.ts, next to classifyCapabilityResolutionError and the other hosted discovery helpers. It now takes the run target and reprobes with withHostedTestOptions(..., target), the same pinning explicitTargetSupportErrorFromAgent and inferHostedAuthProbeTask use.
  • evaluate_agent_quality passes its runTarget into the reprobe.
  • New regression test in compliance-target-discovery.test.ts. With a 3.1.20 target, the reprobe must send adcpVersion: '3.1.20'. The test was written first and failed (no adcpVersion), then passed after the fix.

The move is there so the helper can be tested with the existing discovery mocks. The alternative was a new handler-level harness for the lease, rate-limit, and DB layers.

No changeset: server/Addie-only.

Review follow-ups (second commit)

From a review pass by the repo's code-review, SDK-protocol, spec, and testing agents:

  • The reprobe runs through discoverCapabilitiesWithDeadline (30s), so a hung agent can't stall the error response.
  • The log message no longer names evaluate_agent_quality, since the helper is now a shared service export.
  • Tests cover pinning across the no-auth, bearer, and static-fixture branches; the probe-task early return; the specialism_parent_protocol_missing gate; the refined classification; the reprobe failure fallback; and the deadline. The CapabilityResolutionError mock now uses the real object-param constructor, and the withHostedTestOptions mock keeps a caller-supplied adcpVersion like the real helper does.
  • Mutation-checked: six deliberate breakages (unpinned pre-discovery, no early return, widened gate, ignored reprobe result, dropped auth, propagated reprobe failure) each fail at least one test.

Out of scope, tracked separately: probes pinned via withHostedTestOptions throw before sending for prerelease targets the SDK doesn't bundle a schema for (for example 3.2.0-rc.6). Wrapping them in withExternalSchemaRoot fixes this. It affects pre-existing probes too, so it gets its own issue.

Testing

  • New test failed before the fix and passes after.
  • Pre-commit hook on Node 24.19.0: full server unit suite (693 files) and typecheck, on both commits.

Fixes #7356

🤖 Generated with Claude Code

aao-secretariat[bot]
aao-secretariat Bot previously approved these changes Sep 24, 2026

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve — clean, well-scoped fix with no blocking or medium findings.

Checked:

  • Refactor moves classifyCapabilityResolutionErrorWithDeclaredProtocols into compliance-testing.ts and pins the capability-resolution reprobe to the run target via withHostedTestOptions, matching sibling probe pinning. Fail-closed behavior preserved; no dangling imports; call-site runTarget is the resolved target.
  • TDD regression test is sound.
  • Changeset correctly omitted: Addie/server-only change, no published protocol surface (static/schemas/source/**, task defs, normative reference docs, release scripts, dist artifacts) touched.
  • No schema↔docs, oneOf, released-artifact, 3.1.x patch-eligibility, or governance-precedent concerns apply.

High-risk flag is true only via (modified) matches under server/src/addie/** with no medium-or-higher finding, so the modification is presumed safe (no escalation on the flag alone). No no-auto-approve team match; gated_paths is false. Rows 1–8 do not fire → row 9 approve.

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approval: no reviewable delta since the prior approval; re-submitting after stale-review dismissal.

andybevan-scope3 and others added 2 commits September 30, 2026 14:09
…version

When an evaluate_agent_quality run fails with a specialism parent-protocol
error, Addie reprobes the agent's capabilities to classify the failure.
That reprobe ran without the run target's adcpVersion, so the SDK sent its
own prerelease default to agents evaluated at an explicit stable target.

The reprobe helper moves next to the other hosted discovery helpers in the
compliance-testing service and pins discovery to the run target.

Fixes #7356

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… deadline

The reprobe now runs through discoverCapabilitiesWithDeadline, so a hung
agent cannot stall the evaluate_agent_quality error response, and its
warning no longer names a single caller.

Tests cover pinning across auth branches, the probe-task early return,
the reprobe gate, the refined classification, the failure fallback, and
the deadline. The SDK error mock now matches the real object-param
constructor, and the pinning mock preserves a caller-supplied version.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@aao-secretariat aao-secretariat Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ladon verdict: Approve

Approve.

Clean pass. This PR moves classifyCapabilityResolutionErrorWithDeclaredProtocols from member-tools.ts into compliance-testing.ts, routing the capability reprobe through discoverCapabilitiesWithDeadline (30s deadline + safe transport) and pinning it to the failed run target via withHostedTestOptions — an operational-readiness improvement over the previously unbounded reprobe, with matching test coverage. No schema/wire changes, so no changeset required for the Addie surface.

Checked against the decision table:

  • No critical/high findings (row 1 n/a).
  • gated_paths is false; review_decision is APPROVED (rows 2 satisfied regardless).
  • high_risk is true but both reasons are (modified) with no medium-or-higher findings, so the modifications are presumed safe (rows 3, 5 n/a).
  • No medium findings in data-loss/schema/infra (row 4 n/a).
  • Prior decision was approve, not escalate (row 6 n/a).
  • No no-auto-approve team match (row 7 n/a).
  • Zero medium findings (row 8 n/a).

Falls through to row 9 → approve.

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.

evaluate_agent_quality silently resolves stable version request to a pre-release tag

1 participant