← Back to Pull requests

feat(agent): hard steps run on their rail or are refused, never parked (0.1177 slice 5) #2525

Closed
unknown closed this pull request without merging on Dec 02, 2026 21:37 UTC
View on GitHub
unknown unknown commented on Dec 02, 2026 21:36 UTC
Author

Card 0.1177 (no approvals), slice 5. Goal: no hard step waits on a person; each runs on its rail, runs behind AutoBackup, or is refused with a plain reason.

Why

Before: a hard-class step (a delete, a reset, a raw disk command, a click on Delete) parked on a hard card and waited for someone to approve it. Unattended runs refused it with "nobody is here to approve it".

After: decide returns the rail's verdict. If no rail answers, a step AutoBackup covers runs behind a backup. Raw disk and boot commands are refused (DISK_RAIL), a runs-later file edit after outside text is refused (RUNS_LATER_RAIL), and a step no backup can cover (a GUI key, click or drag, another server's tool, a non-self delete) is refused (BACKUP_RAIL). Credentials and grokhub-self tools still run.

How

  • harness/approval.rs: hard-class branch rewritten; resolve_park, hard_card_key, HardAnswer, HardPark deleted.

  • episode/kernel.rs, gate.rs, harness/cua.rs, self_manage/mcp.rs: their hard-park paths and strings are gone.

  • repair: Action::Park, Phase::AwaitCard, answer_hard and the approved field are gone; a hard repair step goes to Grok Build after the restore point; a step a rail refuses is skipped (HardFloor).

  • Audit: a refusal's deny span keeps the step's hard class (it read "soft" before). grokhub-desktop harness_gate.rs gets the same small fix.

  • Kept: rails.rs, send_hold.rs, spend_log.rs, backup.rs, after-action check and undo, hard.rs classification.

  • changelog.d/no-approvals-hard-park.md.
  • Decisions (each can be undone): BACKUP_RAIL and RUNS_LATER_RAIL refuse instead of running, because running would strip the only safeguard. Provider and egress parks stay (hub_send.rs depends on them and is off-limits). PermMode/AccessMode reduction comes in a later slice. Two tests drop a typed rm -rf ~/Documents step, since under AutoBackup it would really delete that folder on the test machine.

    Left for later slices: the episode park machinery (now unreachable), desktop Precheck::Park, egress/park.rs, workflow risky-command parks, the mcp/mod.rs destructive string, the "Waiting for your OK" strings in slash_ops.rs and pulse_live.rs, and the UI.

    Starting beta: 7d216b8. Merged latest beta (bb6fedf) as 03ba72f, which merged cleanly.

    What was run and seen

    On 03ba72f:

  • cargo build --workspace: Finished, exit 0

  • cargo fmt --all -- --check: exit 0

  • cargo clippy -p grokhub-core -p grokhub-agent --lib --bins -- -D warnings: exit 0

  • cargo clippy -p grokhub-desktop --lib --tests -- -D warnings: exit 0

  • src-tauri cargo clippy --lib --tests -- -D warnings (pkg-config stubs): exit 0

  • cargo test -p grokhub-core --lib: ok. 3032 passed; 0 failed

  • cargo test -p grokhub-desktop --lib: ok. 78 passed; 0 failed

  • cargo test -p grokhub-agent --lib: 3722 passed; 1 failed. The one failure, route::score::tests::quota_states_bar_the_routes_they_close, already fails on clean beta (it came in with #2508), so it is not from this PR.
  • GitHub CI is off for Loadout, so the checks were run here instead. The src-tauri tests (9 rewritten in agent_episode_tests.rs), the GTK desktop build and the desktop UI tests are queued for the Beast live-checks session.

    Rewritten tests

    No test was deleted. Each row is: file, old name -> new name, and what the test asserts now. A row shows "(kept)" when the name did not change.

    crates/grokhub-agent

    | File | Old -> new | Asserts now |
    |---|---|---|
    | harness/approval.rs | hard_card_enter_never_approves -> a_hard_step_no_backup_can_cover_is_refused_by_the_backup_rail | Desk click Delete, Tool click Delete and grokhub__skill_delete give Refuse(BACKUP_RAIL). grokhub-self__skill_delete gives Allow (it keeps versions). connection_add with a token gives Allow. |
    | harness/approval.rs | ttl_fail_closed -> a_raw_disk_or_boot_step_is_refused_by_the_disk_rail | A shred Tool step, a Repair grub-install step and decide_harness under Always/Full each give Refuse(DISK_RAIL). needs_user is false. |
    | harness/approval.rs | a_premium_route_is_allowed_without_any_money_grant_or_card (kept) | The route is Allow. The HardPark/hard_card asserts are gone. |
    | harness/approval.rs | desk_type_routes_raw_disk_commands_to_park_and_registry_edits_to_registry_backup -> desk_type_refuses_raw_disk_commands_and_routes_registry_edits_to_registry_backup | A typed shred gives Refuse(DISK_RAIL). A registry edit still gives AutoBackup. |
    | harness/backup.rs | os_classes_are_covered_with_specific_strategies_while_raw_boot_blocks_park -> os_classes_are_covered_with_specific_strategies_while_raw_boot_is_refused | The boot gate gives Refuse(DISK_RAIL). |
    | harness/mindcheck.rs | a_hundred_send_approvals_never_soften_the_send_rail (kept) | The hard_card_key assert is removed. The rest is unchanged. |
    | harness/provenance.rs | an_unattended_refusal_says_to_ask_not_reroute -> an_outside_value_refusal_says_to_ask_not_reroute | cal__create_event to drop@evil.example gives the exact outside-value rail text plus UNATTENDED_NOTE. |
    | harness/cua.rs | session_ending_keys_park_and_halt_or_ttl_send_nothing -> session_ending_keys_are_refused_by_the_backup_rail_and_send_nothing | ctrl+alt+backspace and ctrl+alt+delete reply BACKUP_RAIL. No parks are made, the child gets nothing, and the spans are [("key","deny","irreversible_os") x2]. |
    | harness/cua.rs | deny_sends_nothing_approve_forwards_once_and_the_password_slot_is_never_typed -> a_soft_key_forwards_once_and_the_password_slot_is_never_typed | press_key tab gives "press_key done". The password slot is never typed. |
    | harness/cua.rs | hermes_clicks_are_read_by_their_ax_label_before_the_click_is_sent (kept) | Reset (#7) gives BACKUP_RAIL. The park span row is gone, and the deny row irreversible_os:Reset stays. |
    | harness/cua.rs | typing_logs_only_the_length_and_a_credential_field_is_refused_before_forwarding (kept) | The credential refusal's deny span now has class "credentials" instead of "soft", because a refusal span keeps its hard class. |
    | gate.rs | a_hard_send_runs_on_its_rail_under_always (kept) | drive__delete_file gives Decision::Refuse(BACKUP_RAIL). |
    | perm/tests.rs | always_allow_loop_asks_only_for_the_hard_step -> always_allow_loop_refuses_only_the_hard_step_and_never_asks | asks == 0, chmod and sudo run, and outputs[2] == DISK_RAIL. |
    | perm/tests.rs | always_allow_stops_only_for_hard_classes (kept) | Raw grub/efibootmgr/... commands give Decision::Refuse(DISK_RAIL) in Always and Ask. |
    | auto_review/mod.rs | loop_deny_and_dangerous_still_win (kept) | The efibootmgr step gives asks 0, no Permission event, and output == DISK_RAIL. |
    | run.rs | a_resumed_chat_that_holds_outside_text_asks_before_a_runs_later_edit -> a_resumed_chat_that_holds_outside_text_refuses_a_runs_later_edit | (true, 0, false) for fetched and for passed_on: no ask and no write. |
    | run.rs | a_hard_class_still_asks_on_the_next_turn -> a_hard_click_no_backup_covers_is_refused_on_every_turn_and_never_asks | On two turns (Always, then Deny answers) a Delete click gives 0 asks, a FunctionCallOutput holding BACKUP_RAIL and no Permission event. The desktop spy gets 0 calls and no session grant is saved. |
    | subagent.rs (sibling PR file, 7+/7-) | six tests, names kept: a_background_helper_that_read_a_page_marks_the_later_run_that_reads_its_result; a_background_helpers_finish_notice_marks_the_parent_run; a_background_helpers_result_read_with_the_output_tool_marks_the_parent_run; a_helper_of_a_run_that_read_outside_text_keeps_the_mark; a_helpers_fenced_result_marks_the_parent_run; a_running_helper_takes_the_mark_when_its_parent_reads_outside_text | The runs-later write's output contains RUNS_LATER_RAIL instead of gate::user_rejected("write"). |
    | self_manage/mcp/tests.rs | delete_tools_park_a_hard_card_and_deny_leaves_files_byte_identical -> delete_tools_run_with_no_card_and_keep_the_last_version | The reply is (true, "deleted skill board (change #2; its last version is kept)"), the skill is gone, and the spans are allow/soft then allow/delete. |
    | self_manage/mcp/tests.rs | a_token_connection_parks_a_credentials_card_and_the_token_never_shows -> a_token_connection_runs_with_no_park_and_the_token_never_shows | The connection is added with no park, and the token never shows. |
    | self_manage/mcp/tests.rs | connection_remove_and_automation_delete_park_and_deny_leaves_files_byte_identical -> connection_remove_and_automation_delete_run_with_no_card | The replies are (true, "removed connection files (version 2 kept). The user can undo it.") and (true, "deleted {id}"). Both delete-class spans are allow. |
    | self_manage/mcp/tests.rs | skill_create_under_always..., policy_targets_are_refused_before_the_ledger, and FakeIo users (kept) | FakeIo::answering(..) -> FakeIo::default(). The io.parks.is_empty() asserts are dropped because FakeIo has no park. |
    | self_manage/tests.rs | every_path_sees_the_same_classes (kept) | MCP self deletes give Allow. grokhub-self connection_add with a token gives Allow. Native connection_add with a token under Always gives Decision::Run. grokhub-self automation_create gives Allow. |
    | tools/connections.rs | a_token_connection_is_a_credentials_card_and_the_token_stays_out_of_everything -> a_token_connection_runs_with_no_card_and_the_token_stays_out_of_everything | The credentials verdict is GateOutcome::Allow, and the token stays out of the config, spans and replies. |
    | tools/connections.rs | agent_deletes_are_hard_cards_even_under_always_and_full -> agent_deletes_run_behind_autobackup_or_are_refused_under_always_and_full | grokhub__skill_delete gives Refuse(BACKUP_RAIL). |
    | tools/connections.rs | a_catalog_key_decline_leaves_no_config (kept) | Park -> Allow. |
    | repair/fix_tests.rs | a_hard_step_parks_under_always_and_full -> a_hard_step_runs_after_the_restore_point_with_no_card_under_always_and_full | The card line is "...It runs after the restore point I take first." Action::Gb "pkexec apt-get clean". The spans are restore then allow. approval_class is "delete" and hard_approved is false. Then Verify(DiskUsage). |
    | repair/fix_tests.rs | the_apps_own_windows_restore_point_goes_out_but_a_drafted_admin_step_asks -> the_apps_own_windows_restore_point_goes_out_and_a_drafted_admin_step_runs_after_it | Checkpoint-Computer goes first, then the drafted Set-MpPreference step goes to Grok Build with span allow, class system_admin and hard_approved false. |
    | repair/fix_tests.rs | steps_are_classified_by_rules_soft_hard_and_floor (kept) | "pkexec grub-mkconfig -o /boot/grub/grub.cfg" is HardFloor (the disk rail), not Hard(IrreversibleOs). |
    | repair/fix_tests.rs | the_live_checklist_shows_each_step_as_it_runs (kept) | The hard part is that the apt-get clean step shows Running (never NeedsOk), and a failed step gives Failed with the check Skipped. |
    | repair/fix_tests.rs | apply_writes_the_restore_point_span_before_the_first_mutating_span, a_hard_floor_step_is_guidance_and_never_runs (kept) | The Action::Gb approved field and Action::Park arm are removed. The asserts are otherwise unchanged. |
    | episode/tests.rs | an_unanswered_hard_step_parks_only_itself_and_the_episode_waits_instead_of_ending -> a_hard_step_no_backup_covers_is_refused_and_the_episode_finishes_without_it | Ended(Verified), no card, and no park span. There is one deny span (click, delete, BACKUP_RAIL, "episode step 8"). 19 clicks run, 0 deletes, the check runs, and no "Waiting on the user" line appears. |
    | episode/tests.rs | a_late_approve_runs_the_parked_step_once_and_the_episode_finishes -> an_approve_after_a_refused_step_runs_nothing | A late answer runs nothing: 0 deletes, no approve span and no hard_approved. |
    | episode/tests.rs | a_late_deny_never_runs_the_parked_step -> a_refused_step_writes_one_deny_span_with_the_rail_reason | The deny results are exactly [BACKUP_RAIL]. |
    | episode/tests.rs | halt_while_a_step_waits_past_its_ttl_denies_it -> halt_after_a_refused_step_ends_the_episode_and_withdraws_nothing | Halt after 11 clicks gives Ended(Halt). The denies are [(click, BACKUP_RAIL)], nothing is withdrawn, and a later approve runs nothing. |
    | episode/tests.rs | halt_at_step_10_denies_every_park_and_the_desktop_gets_nothing_more -> halt_at_step_10_leaves_no_card_and_the_desktop_gets_nothing_more | 2 deny spans, each with BACKUP_RAIL. Nothing is posted or withdrawn, and the backend gets 0 calls after Halt. |
    | episode/tests.rs | steer_at_step_5_keeps_the_episode_id_and_the_parks -> steer_at_step_5_keeps_the_episode_id_and_the_refusal | The deny is [(click, original goal, BACKUP_RAIL)], with no approve and 0 deletes. |
    | episode/tests.rs | a_hard_park_approved_after_the_turn_ended_runs_once_on_the_resume_prompt -> a_refused_hard_step_leaves_no_card_and_the_next_call_keeps_the_goal | Waiting comes from the worker's own question, not a card. There are 0 clicks and the deny is [(click, goal, BACKUP_RAIL)]. Worker call 2 starts "Step 2 of this episode.\nGoal step: Reply to the thread\n". |
    | episode/tests.rs | stop_during_a_worker_call_ends_the_episode_and_denies_its_parks -> stop_during_a_worker_call_ends_the_episode_with_no_card_to_withdraw | Ended(Stop), nothing withdrawn, deny [(click, BACKUP_RAIL)] and 0 clicks. |
    | episode/tests.rs | a_stuck_episode_denies_its_waiting_card_and_never_runs_it -> a_stuck_episode_has_no_waiting_card_and_never_runs_the_refused_step | Unconfirmed with the same reply, and nothing withdrawn. The deny is [(click, delete, BACKUP_RAIL)]. There are 14 still clicks (the refusal is the 15th still step). |
    | episode/tests.rs | an_approved_park_does_not_run_once_the_desktop_is_halted_or_locked -> a_refused_step_never_runs_on_a_later_turn_whether_the_desktop_is_halted_or_locked | For both the halted and the locked desktop: Verified, 0 delete clicks, no approve, and the deny is [(click, delete, BACKUP_RAIL)]. |
    | episode/tests.rs | a_hard_card_names_the_control_a_click_lands_on_and_the_command_typed -> a_hard_click_is_refused_with_no_card_and_its_span_keeps_only_the_redacted_args | A hinted bare click at Delete gives Verified, no card and no waiting line. The deny span is ({"x":900,"y":40}, delete, BACKUP_RAIL), and 0 clicks run. The typed rm -rf ~/Documents step is dropped: under AutoBackup it would delete $HOME/Documents natively. |
    | episode/tests.rs | pause_returns_before_the_next_step_and_keeps_the_episode_its_goal_and_its_cards -> pause_returns_before_the_next_step_and_keeps_the_episode_and_its_goal | Pause gives Waiting with an empty reply, 1 click, no card and nothing withdrawn. The next run gives Verified with 0 deletes and begin/end markers. |
    | episode/tests.rs | an_allow_given_during_the_workers_last_call_runs_the_step_in_that_turn -> an_allow_given_during_the_workers_last_call_runs_nothing | 0 deletes, and the click spans are [(deny, goal)]. |
    | episode/tests.rs | a_deny_given_during_the_workers_last_call_settles_in_that_turn -> a_refused_step_is_answered_in_the_same_turn_and_the_worker_goes_on | Verified, 0 deletes and 2 worker calls. |
    | episode/tests.rs | an_allow_older_than_the_approval_ttl_is_refused_not_run -> an_allow_of_any_age_runs_nothing_for_a_refused_step | Answers aged 300 s and 299 s both give 0 deletes and deny [BACKUP_RAIL]. |
    | episode/tests.rs | a_parked_steps_later_spans_carry_its_own_step_number -> a_refused_steps_span_carries_its_own_step_number | The delete-class spans are exactly [(deny, "episode step 8")]. |
    | episode/tests.rs | helper delete_parked_past_ttl (doc only) | The doc now says nothing waits. |

    crates/grokhub-desktop

    | File | Old -> new | Asserts now |
    |---|---|---|
    | harness_gate.rs | delete_key_parks_only_on_a_file_manager -> delete_key_is_refused_by_the_backup_rail_only_on_a_file_manager | Delete is "keyed" with GrokHub in focus. On Dolphin, it and 3 other spellings reply "backup rail:..." with no card and 1 key pressed in total. There are 4 deny spans with class delete. |
    | harness_gate.rs | hermes_clicks_park_by_the_control_under_the_point_and_deny_never_clicks -> hermes_clicks_are_read_by_the_control_under_the_point_and_refused_ones_never_click | Reset replies "backup rail:" with no card. The span rows drop the park row and keep deny irreversible_os:Reset. The hard_card_key assert is removed. |
    | harness_gate.rs | typing_is_soft_keeps_only_the_length_and_the_pin_field_still_parks -> typing_is_soft_keeps_only_the_length_and_the_pin_field_is_refused | The PIN refusal span class is "credentials" instead of "soft". |

    src-tauri (compiled by clippy --tests; NOT run here: no GTK libs to link)

    | File | Old -> new | Asserts now |
    |---|---|---|
    | agent_episode_tests.rs | allow_with_nothing_running_resumes_and_runs_the_step_once_with_the_goal_kept -> a_hard_step_is_refused_with_no_card_and_the_goal_is_kept | Click, Delete, Done gives episode_verified, no "click Delete" and no park files. The goal_steps are [click allow, click deny] and the deny result is [BACKUP_RAIL], with begin/end verified markers. |
    | agent_episode_tests.rs | after_an_allow_a_message_that_is_not_the_resume_still_steers -> after_a_refused_step_the_next_message_is_its_own_goal | Episode 1 is verified and disarms. After re-arming, episode 2 is verified. The click spans are [(deny, GOAL), (allow, "Open the Bluetooth page instead")]. |
    | agent_episode_tests.rs | allow_then_idle_halt_then_a_message_sends_nothing (cfg desktop) -> a_refused_step_then_an_idle_halt_then_a_message_sends_nothing | Verified with no park files. An idle Halt gives [] and disarms. The next message gives end_turn, and no click reaches the desktop. |
    | agent_episode_tests.rs | an_allow_after_halt_is_refused_and_a_deny_still_answers (cfg desktop) -> a_session_armed_after_halt_refuses_its_hard_step_with_no_card | Armed after Halt: verified, no park files, and the deny is [(click, BACKUP_RAIL)]. |
    | agent_episode_tests.rs | pause_then_continue_keeps_the_goal_and_the_cards -> pause_then_continue_keeps_the_goal_after_a_refused_step | The pause gives cancelled with 0 parks. Continue gives episode_verified. The goal_steps are [deny, allow] under GOAL, with 1 check. |
    | agent_episode_tests.rs | a_card_names_the_control_or_the_typed_command -> a_hinted_delete_click_is_refused_with_no_card_and_no_waiting_line | BareDelete then Done gives episode_verified, with no "Waiting on you" or "Approve its card" in the text. The deny is (click, delete, BACKUP_RAIL), and no click runs. The Act::TypeRm variant is removed for the $HOME reason above. |
    | agent_episode_tests.rs | an_allow_during_the_last_model_call_runs_the_step_in_that_turn -> a_refused_step_leaves_no_card_for_the_last_model_call_to_settle | The panel shows 0 parks during the last call. episode_verified, no resume owed and no click Delete. |
    | agent_episode_tests.rs | an_allow_after_the_loops_last_look_is_owed_a_resume_when_the_reply_ends -> a_refused_step_owes_no_resume_when_the_reply_ends | episode_verified, no resume owed, and goal_steps [(click, deny, GOAL)]. |
    | agent_episode_tests.rs | a_paused_session_with_an_allowed_step_waits_for_the_person -> a_paused_session_after_a_refused_step_waits_for_the_person | The pause gives cancelled with 0 parks and no resume owed. Continue gives episode_verified with 0 deletes. |

    ---
    _Generated by Claude Code_

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: cursor[bot] Review duration: 1m
    All Vouch review confidence checks passed
    Residual risk 0.37 = Change Risk (0.52) × (1 − Review Confidence (0.29)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 9% · Reviewer familiarity: 35%
    29%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #2525"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: medium confidence: 29% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 29% · Lower = rushed or shallow review
    29%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 36.9% · Moderate risk
    36.9%