Skip to content

Classify legacy late-effort refusals from structured RPC errors - #9155

Merged
orbit-agent-01 merged 2 commits into
agent-mainfrom
orbit/ORB-24163-9167c5a8
Nov 12, 2026
Merged

orbit-agent-01 merged 2 commits into
agent-mainfrom
orbit/ORB-24163-9167c5a8

Conversation

@orbit-agent-01

Copy link
Copy Markdown
Contributor

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-235 adds classification of OwnerUnsupported by searching an UnreachableDestination(String) for both "code":-32602 and unknown 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::Value in crates/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_scenarios injects 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, query UNKNOWN_DRAIN_OPERATION_REFUSAL returned no results. Query late effort structured RPC refusal substring returned the original ORB-24139 repair and older unrelated work; no existing task repairs this new classification violation.

Acceptance Criteria

  • The legacy unknown-internal-operation JSON-RPC reply reaches the late-effort classifier as structured data and is counted as owner_unsupported without message-substring matching in the new branch.
  • Public-boundary evidence preserves unsupported-owner counts for multiple claims and keeps connection failure and other RPC refusals distinct; the legacy wire response remains compatible.

Execution Summary

Click to expand

Outcome: success

Criteria:

  1. Legacy unknown-internal-operation JSON-RPC reply reaches classifier as structured data and counted owner_unsupported without message-substring matching in the new branch — PASS. DestinationSession::await_response now returns OrbitError::json_rpc_refusal (RemoteTool with typed rpc_code=-32602 / rpc_message fields in payload, RemoteToolCode::InvalidInput); effort_backfill::refused_outcome classifies via error.is_unknown_internal_drain_operation() (structured field equality in orbit-common), removing the UnreachableDestination substring branch. Diagnostic formatted text kept only as detail.
  2. Public-boundary evidence preserves unsupported counts for multiple claims and keeps connection/other RPC refusals distinct; legacy wire compatible — PASS. late_effort_report_scenarios: predates-owner scenario still 2 claims owner_unsupported with detail containing -32602/unknown operation; new another_rpc_refusal_is_refused_without_changing_state (-32603) counts refused=1, unsupported/unreachable=0; connection failure still owner_unreachable. Legacy peer in orbit-mcp oversized_lines still sends exact {code:-32602,message:unknown internal drain operation} wire reply (server wire unchanged) and now asserts structured payload/code preserved through the public SSH route.

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

  • Not reported

Branch Freshness

  • Base ref: origin/agent-main
  • Head ref: orbit/ORB-24163-9167c5a8
  • Behind base: 0
  • Ahead of base: 1

…[ORB-24163]

Fixes: 5f63ef8 ("fix: [delivery-code-review] Recognize an older owner's actual late-effo… [ORB-24139] (#9142)")
Regression-From: ORB-24139
Regression: defect_in_new; escape=unclassified; severity=nit
@orbit-agent-01 orbit-agent-01 added the orbit orbit related label Nov 12, 2026
…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
@orbit-agent-01
orbit-agent-01 merged commit f9a040c into agent-main Nov 12, 2026
20 checks passed
@orbit-agent-01
orbit-agent-01 deleted the orbit/ORB-24163-9167c5a8 branch November 12, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

orbit orbit related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant