Repository navigation
Classify legacy late-effort refusals from structured RPC errors - #9155
Merged
Merged
Conversation
…quals the candidate commit, base 5f665fe is an ancestor of HEAD, and required_validation_commands is present and empty. Acceptance criteria: AC1 holds, since the legacy -32602 unknown-operation reply reaches refused_outcome as a RemoteTool with typed rpc_code and rpc_message fields and the new branch classifies it by field equality; AC2 holds, since the public late_effort scenarios cover multiple owner_unsupported claims, a -32603 refusal counted as refused, and a connection failure counted as owner_unreachable, and the legacy wire test passes. Finding F1 (medium): preserving the JSON-RPC answer as RemoteTool changed owner-transport classification for every caller, not only the effort backfill. A -32602 answer now counts as an owner refusal in pull-drain bind, settle and request handling through is_owner_refusal, and every JSON-RPC answer stops counting as an unreachable owner in worktree GC. I restored the prior classification with two guards. The existing suites pass with the guards, but none of them reaches those branches with a JSON-RPC answer, so the guards are verified by reading the classifiers, not by a test. Finding F2 (nit): docs/design-patterns/test_strategy.md still said the -32602 reply stays UnreachableDestination; corrected. Not filed as a finding: the error codes that routed calls, host probe rows, CLI and web report for JSON-RPC answers move from unreachable_destination to the RemoteTool code (invalid_input or json_rpc_<n>). That follows from the plan's RemoteTool choice, and the orchestrator should confirm it is acceptable. Baseline commands make ci-lint and make ci-test-affected were excluded, as the workspace guide forbids them as blanket pre-handoff gates. [ORB-24163] Findings: F1, F2 Paths: crates/orbit-core/src/application/distributed/settlement/runtime.rs, crates/orbit-core/src/application/gc/worktrees.rs, docs/design-patterns/test_strategy.md Orbit-Review-Attempt: rvw-155c721ddf9f-1 Orbit-Review-Crew: haiku@xhigh
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.
Task
ORB-24163 — Classify legacy late-effort refusals from structured RPC errors
Description
Confirmed standards defect at frozen commit
5f63ef8fd8602398905ed9011bd5033bbe1b1cff, introduced by ORB-24139 (PR #9142), during ORB-24162.crates/orbit-core/src/application/agents/effort_backfill.rs:231-235adds classification ofOwnerUnsupportedby searching anUnreachableDestination(String)for both"code":-32602andunknown internal drain operation. Matching the outer error variant does not make those two inner substring checks structured classification. This directly violates STD-02 §R10 (classify from structured data; MUST NOT match message substrings). The source already had other substring branches before this delivery; this finding attributes only the newly added legacy-RPC branch to ORB-24139.The producer still has the JSON-RPC error as a
serde_json::Valueincrates/orbit-mcp/src/federated/probe/session.rs:559-563, then formats it into a string. Preserve a typed refusal or structured RPC code across that boundary and classify it structurally in the backfill. Keep diagnostic text as detail, preserve the legacy owner's existing wire format, and keep genuine connection failures distinct. This is a repository-standards finding; the expected legacy reply is recognized today, and no live owner malfunction was reproduced. Severity: nit (no demonstrated current behavior impact).Tests/gates inspected at the culprit: the public
late_effort_report_scenariosinjects one exact compact RPC message and a connection failure; the newly added private session test asserts its text survives. Neither establishes a structured classification contract. Escape: unclassified, because these tests cover the intended reply but the evidence does not establish why standards enforcement accepted the string classifier. No applicable STD-02 §R10 deviation was found in the distributed-drain or agent-scorecards decisions.Duplicate checks:
orbit.search, kind task, all true, queryUNKNOWN_DRAIN_OPERATION_REFUSALreturned no results. Querylate effort structured RPC refusal substringreturned the original ORB-24139 repair and older unrelated work; no existing task repairs this new classification violation.Acceptance Criteria
Execution Summary
Click to expand
Outcome: success
Criteria:
Implementation: orbit-common adds OrbitError::json_rpc_refusal/json_rpc_code/is_json_rpc_refusal/is_unknown_internal_drain_operation + JSON_RPC_INVALID_PARAMS_CODE export; orbit-mcp session uses it; orbit-core classifier uses it and returns Refused for other structured RPC refusals before transport-failure check; Wire harness emits the structured refusal.
Validation (passed): cargo test -p orbit-core --test runtime late_effort_report_scenarios (9 rows incl. new); cargo test -p orbit-core --test runtime distributed_drain:: (132 passed); cargo test -p orbit-mcp --test boundary unknown_internal_drain_operation_preserves_the_legacy_rpc_refusal; cargo test -p orbit-mcp --lib federated::probe::tests::session (8); cargo test -p orbit-common --lib (35); cargo test -p orbit-mcp --test boundary (61); make ci-guards; cargo fmt --all -- --check + rustfmt on changed test files; clippy lib/bins + all-targets and cargo doc for orbit-common, orbit-mcp, orbit-core (all -D warnings). task.final_validation_commands: not_run (pipeline final validation, final_validation=true).
Reconciliation: baseline ff4327b clean; final git status shows only the 9 deliverable files listed in context_files widening (original 3 selectors retained, 6 added); git diff --check clean; no scratch leftovers outside .orbit/tmp; no unrelated edits. Risks/deviations: none; pre-existing substring branches for other refusals (tool refusal, effort/model conflict) unchanged per task attribution scope.
Validation
Branch Freshness
origin/agent-mainorbit/ORB-24163-9167c5a8