fix(training-agent): drop non-spec 'escalated' check_governance status#2354
Merged
Conversation
AdCP v3 governance has three terminal check_governance statuses (approved | denied | conditions). The training agent was still emitting a fourth 'escalated' status on human-review paths (human_review_required, reallocation threshold exceeded), which is rejected by spec-compliant buyer validators. Human review is now signalled via a critical-severity human_review finding on a denied decision. The buyer resolves review off-protocol and re-calls check_governance with human_approval to proceed. The audit-log summary keeps its escalations[] and escalation_rate — now derived from checks that carry a human_review finding — and adds the spec-standard statuses.human_reviewed supplementary count. - GovernanceCheckState.status: drop 'escalated'; remove `escalation` field - check_governance handler: replace shouldEscalate branch with humanReviewRequired → critical human_review finding → denied - buildCheckResponse: no longer emits top-level escalation object (removed from check-governance-response.json schema) - get_plan_audit_logs: derive escalations / escalation_rate / statuses.human_reviewed from the human_review finding category - tool description + unit tests updated Paired with SDK cleanup in adcontextprotocol/adcp-client#592. Partial fix for adcontextprotocol/adcp-client#589. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Summary
GovernanceCheckState.statusto the AdCP v3 terminal set (approved|denied|conditions); remove theescalationfield (no longer in the spec response).shouldEscalate → status = 'escalated'branch incheck_governancewithhumanReviewRequired → critical human_review finding → denied. Works identically for the two current triggers:plan.human_review_requiredandpayloadBudget > plan.budget.reallocation_threshold.buildCheckResponseto stop emitting the top-levelescalationobject (removed fromcheck-governance-response.json).escalations[],drift_metrics.escalation_rate, and the spec-standardstatuses.human_reviewedsupplementary count from thehuman_reviewfinding category.Paired with the SDK cleanup in adcontextprotocol/adcp-client#592.
Partial fix for adcontextprotocol/adcp-client#589.
Why
static/schemas/source/governance/check-governance-response.jsonalready validatesstatusto the three-value enum, and the governance simplification changeset on this repo explicitly calls out dropping'escalated'. The training agent was the lagging implementation: spec-compliant buyer validators reject itsstatus: 'escalated'responses outright. Migrating to thecritical human_review finding → deniedshape aligns the training agent with the v3 spec without changing semantics — a human still has to approve before the buy proceeds; the signal just moves from a fourth status into the findings array.Test plan
npm run typecheckcleannpx vitest run server/tests/unit/training-agent.test.ts— 323/323 passnpx vitest run server/tests/unit/— 1513/1513 pass (34 pre-existing skips)🤖 Generated with Claude Code