Repository navigation
refactor: share dispatch/catalog/candidate seams across CLI and policy - #73
Merged
Merged
Conversation
Post-release smell cleanup — no behavior change, no new deps.
- OfferedAction::key() is the one KEY:<id>:<key> parser (was key_of x2)
- KeybindingInfo::catalog_from + AgentClient::keybinding_catalog own
the {"keybindings":[...]} envelope parse (runner keeps self.rpc so
the M6.4 call budget still counts it)
- op_for_decision is the single decision→Op table for `run --goal`
and MCP `act`, fingerprint gating included
- top_candidates builds the shared abstain row; receipts and the MCP
envelope keep their own key names
- dispatch::is_stale_dispatch_error + STALE_TARGET/TARGET_GONE consts
replace prefix literals at all three classification sites
- RunReceipt carries outcome_kind so exit codes reuse
RunOutcome::exit_code instead of re-matching labels
- ActionKind::is_control delegates to OperationKind::is_control;
OperationKind's Select/ScrollDown/ScrollUp documented as goal-side
vocabulary (no ActionKind maps to them)
- HistoryEntry::to_json is the shared {op,id,effect} wire row for
choose + jev state
- resolve_intent collapses its cfg-split duplicate doc blocks
- tests/common::Todo shared by the four CLI integration tests
Verified: fmt clean, clippy -D warnings clean, workspace tests pass in
default/instinct/jev configs.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.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
Post-release smell cleanup (the deferred P2 items from the M2–M8 review). No behavior change, no new dependencies, all opt-in feature boundaries unchanged.
OfferedAction::key()— the singleKEY:<id>:<key>parser (waskey_ofduplicated in runner + MCP)KeybindingInfo::catalog_from+AgentClient::keybinding_catalogown the{"keybindings":[…]}envelope parse; the runner still fetches viaself.rpcso the M6.4 call budget keeps counting itop_for_decision— one decision→Optable (fingerprint gating included) shared byrun --goaland MCPacttop_candidates— one abstain-row builder; receipts and the MCP envelope keep their own serialized key namesdispatch::{STALE_TARGET, TARGET_GONE, is_stale_dispatch_error}— the two wire prefixes + classifier replace three separate string-prefix matchesRunReceipt.outcome_kind(serde(skip)) so the CLI reusesRunOutcome::exit_codeinstead of re-matching the label stringActionKind::is_controldelegates toOperationKind::is_control;Select/ScrollDown/ScrollUpdocumented as goal-side verb vocabulary (they score and cap but are never offerable — wiring them up is feature work, deferred)HistoryEntry::to_json— the shared{op,id,effect}row for the choose request and jevstate.recent_actionsresolve_intent— cfg-split doc duplicate collapsed into one fntests/common::Todo— the headless-todo harness shared byrun_goal/run_escalate/run_jev/mcp_instinct(was copied 4x)Net: −141 lines; the two dispatch tables can no longer drift apart.
Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets— clean (default,instinct,jev)cargo test --workspace— green in all three configsreceipts_are_byte_identical_across_runsand the call-budget tripwire still passGenerated with Devin