Skip to content

fix(approval): let a person deny a request an earlier launch left waiting - #8679

Merged
senamakel merged 24 commits into
tinyhumansai:mainfrom
senamakel:approval-orphan-decide
Nov 12, 2026
Merged

senamakel merged 24 commits into
tinyhumansai:mainfrom
senamakel:approval-orphan-decide

Conversation

@senamakel

@senamakel senamakel commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #8657. That PR carried requests an earlier version left waiting into TinySecurity as pending orphans and listed them in approval_list_pending, but nothing could clear one: approval_decide answered "no pending approval ever registered", so an orphan stayed on the list until its window closed.

This PR lets a person deny (dismiss) an orphan. Approving one is still refused: nothing in this launch can run the call it was for, and TinySecurity's Decide2 accepts only a denial for a row another host instance owns.

Changes

  • Gate (security/approval/gate_orphans.rs, hooked into ApprovalGate::decide_as):
    • Runs only for a request that is not parked here, decided by the default tenant with no agent named. That is the only tenant orphans are listed for.
    • A denial dismisses the orphan, publishes ApprovalDecided and returns the row.
    • Any approve decision is refused with "can only be denied", and the orphan stays listed.
    • Everything else falls through to the existing miss handling.
  • Engine trait: new dismiss_orphan. Its default answers NotPending.
  • Native engine (native/engine_orphans.rs):
    • Re-reads the row from the import's history scope. It must be pending, carry legacy_history_json, and be inside its window.
    • Issues a deny-only ticket and calls Decide2 on that scope's audit stream.
    • Keeps the deny label, and reports a lost race as NotPending.
  • Human verification (native/callbacks.rs, native/state.rs):
    • With no request of this process behind a row, verify_human accepts only an orphan currently under review.
    • The row must match the listed one byte for byte, and the choice must be Deny.
    • Anything else fails closed.
  • Stub engine: models orphans (leave_orphan, orphans, dismiss_orphan). Its decide refuses an orphan, as the native engine does.
  • Docs: approval README.md and the native/mod.rs layout table.

Tests (RED → GREEN)

  • tests/storage_default_import_e2e.rs::a_request_an_earlier_version_left_waiting_can_be_denied_but_never_approved
    • Real binary and released module, run in the CI image.
    • Approving the carried-over request is refused and it stays listed. Denying it succeeds, and it is not listed again in this launch or the next.
    • RED before the fix: no pending approval ever registered for request_id '…'. GREEN after.
  • security/approval/gate_orphan_tests.rs (4 tests): deny dismisses; the approve decisions are refused; another profile or a named agent cannot dismiss; an expired orphan and an unknown id are not dismissed.
    • Two of them fail with the decide_as hook disabled.
  • native/callbacks_tests.rs::an_orphan_under_review_verifies_only_a_denial_of_the_listed_row

cargo test -p openhuman --lib -- security::approval passes: 223 tests, plus the new callbacks test.

Notes

  • History shows a different id. A dismissed orphan appears in recent decisions as "Recorded by an earlier version", under its earlier-version request id. The pending list showed the module's id, and the history view maps rows that carry legacy_history_json back to the id from the earlier version.

Also in this PR: CI gates that were red on main

These failed on this PR's first run, and the same way on other branches cut from current main. They are fixed here so the PR can go green.

  • static:storage-bypass. A self-update change moved the download temp file's File::create from platform/update/core.rs to download.rs, so the ratchet saw one new site and one stale baseline entry. The create is back in core.rs, matching its baseline entry exactly, and stream_to_file takes the open file. The baseline is unchanged.

  • frontend:scripts-self-tests. The E2E runner now stages the TinyEventQueues release for inbound_module_e2e, and the self-test for that block had no stub for stage_release_module (module_platform: unbound variable). The test now stubs it and checks that the released path comes after the source-built modules.

  • security_approval_characterization (flaky). list_pending merges in pending orphans, and an orphan was any pending row the host did not hold. That briefly included a request this launch had just parked, before the host registered it. A test could then pick up that copy, which has no flow context, and the decision would miss. Only the legacy import writes legacy_history_json, and dismissal already requires it, so the orphan listing now requires it too (view::orphan). New unit test: only_an_imported_pending_row_no_live_request_owns_is_an_orphan. The characterization suite passed 3 runs out of 3 in the CI image.

  • auth_e2e credential-store tests. fix(credentials): keep profile secrets out of the interactive keyring on a file-keyring core #8670 keeps profile secrets out of the interactive keyring when OPENHUMAN_KEYRING_BACKEND is file, encrypted_file or memory. These e2e tests still chose file and expected keyring behaviour: keyring hits, a purge of keyring-owned rows, and a keyring entry deleted on removal. Their assertions now pin the document-held behaviour fix(credentials): keep profile secrets out of the interactive keyring on a file-keyring core #8670 defines. The product code is unchanged, and there is no headless OS keyring in the CI image to exercise the keyring path end to end. All four pass in the CI image, each run as its own process the way nextest runs them.

  • Coverage-presence gate (--all): 8 source files produced no coverage records. They are leftovers from an older layout that no mod declaration includes, so they were never compiled. Each has a live replacement: agent_chat/simple.rs → agent_chat_simple.rs, web_chat/ops/turn_guards.rs → web_chat/turn_guards/, web_chat/run_task.rs → turn_host.rs. Two fixes from 11-06 also edited the dead copies, but both edits had landed in the live files too. This PR deletes the 8 files and the two test files only they include (sandbox/untrusted_tests.rs, web_chat/run_task_tests.rs). Those tests never compiled, so no running test is lost. It also prunes the stale entries for these paths from agent-runtime-boundary-baseline.json (-1), saas-ambient-baseline.json (-3) and check-gated-test-allowlist.sh (-1). Baselines only shrink. The presence gate is the regression check: it failed on the previous head and must pass on this one.

  • Ignored-test ratchet: the dead sandbox/untrusted_tests.rs contained one #[ignore]d test (untrusted_gate_follows_the_released_jail, which needed the released TinyBox archive). It never compiled, so deleting it lowers the openhuman-core count from 9 to 8, and ignored-test-baseline.json is tightened to match.

Summary by CodeRabbit

  • New Features
    • Pending approval requests carried over from an earlier launch can now be reviewed and denied. They cannot be approved and remain listed until denied or expired.
  • Bug Fixes
    • Approval decisions for carried-over requests are accepted only when the host verifies the exact listed request.
    • Existing security posture is preserved when handling imported approval history.
  • Removals
    • Removed support for parallel web-chat turns, simple agent chat, untrusted shell execution, and whole-tool trust management.

senamakel and others added 12 commits November 12, 2026 11:35
Add an end-to-end test asserting that a pending approval left by an earlier version cannot be approved in a later launch but can be denied, and that the denial persists across restarts.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Human verification now accepts a pending orphan from a previous launch when the choice is a denial, matching the row as listed rather than requiring it to be pending in this process. Orphan rows under review are held in a bounded map so the module can verify the denial byte for byte.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Introduce a module that detects and cleans up approval engine instances left orphaned after their owning task ends. This prevents stale engines from accumulating and holding resources.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a dismiss_orphan method to the ApprovalEngine trait that denies a pending orphan request as a person's decision, returning NotPending when the request is not one. The native engine implements it behind the legacy-import feature by delegating to its existing orphan dismissal, which was renamed to avoid clashing with the new trait method.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ovals

Decision validation now returns the parked approval so the gate can tell a missing request from an orphan, and the default tenant may resolve orphaned pending approvals that are otherwise listed but undismissable.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Wrapped long lines and collapsed a multi-line signature in the native approval callbacks and orphan engine so the files match rustfmt output. No behaviour changes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Pending requests left over from an earlier launch are now recorded as orphans so they can be listed separately and only ever denied, since no host instance owns them and a decision cannot reach them. Added an orphans listing and a dismiss path that marks such requests denied with a label.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Wire the new gate_orphan_tests.rs file into the approval gate test suite so its orphan-handling cases are compiled and run alongside the existing gate tests.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The orphan test no longer asserts on the result of naming an agent when denying an orphan, since the agent path's answer is irrelevant to the invariant that the orphan stays pending. Module declarations were also reordered alphabetically and a call was reformatted.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test asserting that an orphan row under review verifies only a denial of the exact listed row, that a second concurrent review is refused, and that verification fails before the review begins and after it ends.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Added a row to the native approval module's file table describing engine_orphans.rs, which denies pending orphans left behind by an earlier launch, so the module overview reflects the file's role.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Explain how the legacy import carries undecided requests into TinySecurity as pending orphans owned by no host instance, and note that such rows can only be denied, never approved, until they are denied or their window closes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Copilot AI balanced review requested due to automatic review settings November 12, 2026 12:01
@tinysweeper

tinysweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 92feca11bae40e8274df9999be23ed23a6dec80c

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 26 of 39 files; not reviewed: crates/openhuman…, crates/openhuman…, and 11 additional unreviewed files.
Pull request purpose (title): fix(approval): let a…

Diagnostics and supporting details

Full summary

Pull request purpose (title): fix(approval): let a person deny a request an earlier launch left waiting. Purpose (from the PR title): let a person deny a request an earlier launch left waiting. Previously the one-time legacy import carried undecided requests into TinySecurity as pending orphans listed by `approval_list_pending`, but `approval_decide` answered "no pending approval ever registered", so an orphan stayed listed until its window closed. This PR adds a deny-only dismissal path: the gate routes an orphan decision to `dismiss_orphan`, the native engine re-validates the row, issues a deny-only ticket and calls `Decide2`, and human verification accepts only a denial of the exact listed row. Approving an orphan remains refused. It additionally deletes eight never-compiled dead source files plus two test files only they include, and tightens the matching ratchet baselines. No findings were reported by any answering lane.

Unreviewed paths

  • crates/openhuman-core/src/inference/host_runtime/ops/agent_chat/simple.rs
  • crates/openhuman-core/src/sandbox/untrusted.rs
  • crates/openhuman-core/src/sandbox/untrusted_tests.rs
  • crates/openhuman-core/src/security/approval/native/tool_trust.rs
  • crates/openhuman-core/src/web_chat/ops/parallel_turn.rs
  • crates/openhuman-core/src/web_chat/ops/turn_guards.rs
  • crates/openhuman-core/src/web_chat/progress_bridge_attribution.rs
  • crates/openhuman-core/src/web_chat/progress_bridge_spawn.rs
  • crates/openhuman-core/src/web_chat/run_task.rs
  • crates/openhuman-core/src/web_chat/run_task_tests.rs
  • scripts/ci/agent-runtime-boundary-baseline.json
  • scripts/ci/check-gated-test-allowlist.sh
  • scripts/ci/saas-ambient-baseline.json

Review snapshot

Change surface Files Review signal Count
Production 24 Active findings 0
Tests 12 Noted findings 0
Documentation 1 Resolved findings 0
Configuration 2 Pending checks/questions 0

Completeness: Complete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

Features

  • Added — `dismiss_orphan` on the approval engine trait: Engines gain an opt-in path to dismiss an orphan; the default answers `NotPending`, so an engine that does not model orphans keeps rejecting such decisions. (crates/openhuman-core/src/security/approval/engine.rs pub(crate) trait ApprovalEngine: sealed::Sealed + std::fmt::Debug + Send + Sync)
  • Added — Native engine orphan dismissal through `Decide2`: The native path re-validates the row (pending, legacy-imported, unexpired), issues a deny-only ticket, calls `Decide2` on the import's scope, records the label, and treats a competing decision or expiry as `NotPending`; it only compiles under the `legacy-import` feature. (crates/openhuman-core/src/security/approval/native/engine_orphans.rs, crates/openhuman-core/src/security/approval/native/engine_impl.rs impl ApprovalEngine for NativeEngine {, crates/openhuman-core/src/security/approval/native/engine.rs impl NativeEngine {)
  • Added — Orphan review registry on the host: Tracks at most one in-flight review per request and bounded overall, so a row can only be dismissed while a matching denial review is held; the entry is removed when the decision completes. (crates/openhuman-core/src/security/approval/native/state.rs pub(super) struct Host {)
  • Modified — Orphan listing requires the legacy-import marker: The listing no longer treats a just-parked request this process has not yet registered as an orphan, so a caller cannot pick up a copy lacking flow context and then miss its decision. (crates/openhuman-core/src/security/approval/native/view.rs pub(crate) async fn orphans()
  • Added — Deny-only human verification for an orphan: With no request of this process behind a row, `verify_human` accepts only an orphan currently under review, matching the listed row byte for byte with a `Deny` choice; anything else fails closed. (crates/openhuman-core/src/security/approval/native/callbacks.rs pub(crate) async fn verify_human()
  • Added — Stub engine orphan model: Lets the gate's orphan behavior be exercised without the TinySecurity module: orphans are listed, a plain decision on one is refused, and only `dismiss_orphan` denies it. (crates/openhuman-core/src/security/approval/engine_stub.rs pub(crate) struct StubEngine {, crates/openhuman-core/src/security/approval/engine_stub.rs impl StubEngine {, crates/openhuman-core/src/security/approval/engine_stub.rs impl ApprovalEngine for StubEngine {)
  • Internal refactor — Self-update download temp-file creation moved back to `core.rs`: The temp file is created at the site the storage-bypass ratchet baseline records, and `stream_to_file` receives an already-open file; the caller still deletes it on error. (crates/openhuman-core/src/platform/update/core.rs pub async fn download_and_stage_with_version(, crates/openhuman-core/src/platform/update/download.rs pub(super) fn check_declared_length()
  • Added — Posture-free scope registration: A caller with no posture of its own (the legacy import or an orphan's dismissal) registers its fallback only on a scope the module holds nothing for, so it never makes an unrelated call prompt or pass differently. (crates/openhuman-core/src/security/approval/native/scopes.rs pub(super) async fn ensure(, crates/openhuman-core/src/security/approval/native/scopes.rs async fn ensure_with_registration(, crates/openhuman-core/src/security/approval/native/history_import.rs impl NativeEngine {)
  • 3 additional supported feature(s) omitted by the configured limit.

Tests

  • unit — Gate-level orphan tests cover dismissal by a denial (state and `deny` label, one-shot removal from the list), refusal of every approve decision with the orphan left pending, rejection of non-default profiles and named agents, and non-dismissal of expired or unknown ids.: The tests lane answered with no reportable defect, describing these as covering listing, dismissal, tenant scoping and expiry. The PR description says two of them fail with the `decide_as` hook disabled; execution was not verified by this review. (crates/openhuman-core/src/security/approval/gate_orphan_tests.rs, crates/openhuman-core/src/security/approval/gate_tests.rs mod gate_origin_class_tests;)
  • unit — Human verification of an orphan under review accepts only a denial of the listed row, refuses other choices, refuses an altered row, refuses verification before review begins and after it ends, and refuses a second concurrent review.: The tests lane answered with no reportable defect. Execution was not verified by this review. (crates/openhuman-core/src/security/approval/native/callbacks_tests.rs async fn only_the_choices_the_host_offers_are_verified() {)
  • unit — Asserts that only an imported pending row no live request owns is treated as an orphan: an imported pending row lists, a plain pending row does not, a live-held imported row does not, and a decided imported row does not.: The tests lane answered with no reportable defect. The PR description reports it as a new unit test addressing a flaky characterization suite; execution and results were not verified by this review. (crates/openhuman-core/src/security/approval/native/view_tests.rs fn an_imported_legacy_request_keeps_the_request_id_it_had_in_the_earlier_version)
  • unit — Asserts that a posture-free caller registers only on a scope the module holds nothing for, and never replaces a live scope's posture.: The tests lane answered with no reportable defect; execution was not verified by this review. (crates/openhuman-core/src/security/approval/native/scopes_tests.rs fn a_sweep_is_due_once_per_interval() {)
  • unit — The runner self-test now stubs `stage_release_module` and asserts the `OPENHUMAN_MODULE_PATH` includes the staged released module after the source-built modules.: The tests lane answered with no reportable defect. The PR description states the self-test previously failed with `module_platform: unbound variable`; execution was not verified by this review. (scripts/__tests__/rust-e2e-enumeration.test.mjs test("the E2E runner stages released search and connector fixtures, and builds o)

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The critique lane answered with no findings across the files it reviewed, noting the code index is behind this pull request.
  • Lane summary: The change tightens the `openhuman-core` bucket in the ignored-test ratchet baseline from 9 to 8. That matches the source tree: `check-ignored-tests.mjs` counts `#[ignore]`/`cfg_attr(..., ignore)` attributes with an anchored `/^\s*#\s*\[\s*ignore\b/` matcher, and `crates/openhuman-core` currently has eight such attribute lines — the ninth grep hit, `run_workflow_tests.rs` line 170, is a `//` comment that the anchored matcher does not count. Each iteration at the same count before this PR would have reddened on the `count < allowed` branch, so lowering it to the observed eight is the tightening the gate asks for, not a silent ratchet escape. I could not enumerate platform-conditional `cfg_attr(..., ignore)` attributes in core from the material provided; if any exist the gate would fail loudly with a `+1` message rather than pass silently. No defect found in this file. _The code index is behind this pull request (indexed at `0a0c17664270`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The security lane answered with no findings across the files it reviewed, noting the code index is behind this pull request.
  • Lane summary: The change lowers the `openhuman-core` ignored-test baseline from 9 to 8 in `scripts/ci/ignored-test-baseline.json`, which is consistent with a test having been un-ignored elsewhere in the branch. No code, network, or subprocess paths are touched by this file, and I found nothing reportable. _The code index is behind this pull request (indexed at `0a0c17664270`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The tests lane answered that the new orphan flow is covered by behavioural tests including listing, deny-only dismissal, tenant gating, expiry, the verify-human row match, and import-vs-live scope posture, and found no test that cannot fail and no substantiated uncovered new branch.
  • Lane summary: The diff adds a pending-orphan dismissal path (list, deny-only, byte-for-byte host verification) plus a download-streaming signature change, each backed by tests that pin the stated invariants: `gate_orphan_tests.rs` covers listing/denial/refusal of approval/non-default-tenant/expiry, `callbacks_tests.rs` covers orphan ticket verification and rejection of non-Deny choices, `view_tests.rs` covers the orphan classifier, and `storage_default_import_e2e.rs` covers the durable denial across a relaunch. The `needs_registration` helper's `keep_existing` semantics are pinned in `scopes_tests.rs`; the streaming refactor keeps the same callers and error cleanup. I found no test that cannot fail and no uncovered new branch that I can substantiate. _The code index is behind this pull request (indexed at `0a0c17664270`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The commits lane answered that no committed files contain sensitive content, noting the code index was behind the pull request.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `0a0c17664270`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The commits added since the last review only delete eight never-compiled source files and the two test files they declare, prunes the matching ratchet baselines (agent-runtime −1, saas-ambient −3, gated-test allowlist −1, ignored-test 9→8), and adjusts the two CI tests; the body's "Coverage-presence gate" and "Ignored-test ratchet" bullets account for every one of those deletions and baseline edits, and the file counts and paths it states match the diff. The approval-orphan feature itself is described accurately against its code. Nothing to fix. _The code index is behind this pull request (indexed at `0a0c17664270`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.008176
  • Tokens: 372303 input · 22003 output · 26240 cached · 756 embedding
  • Updated: 2026-11-12T16:37:37Z
  • Continuity: summary cache chain restarted at the storage ceiling.
Head State Pass summary
d931950c9f11 incomplete 0 active finding(s), 0 resolved finding(s) (at 2026-11-12T12:04:56Z)
b833fc7d4aa8 incomplete 0 active finding(s), 0 resolved finding(s) (at 2026-11-12T14:05:07Z)
5f7be3ca1f37 incomplete 0 active finding(s), 0 resolved finding(s) (at 2026-11-12T14:23:14Z)
b6d70c80f1a7 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-12T15:46:30Z)
92feca11bae4 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-11-12T16:37:37Z)

tinysweeper 0.1.2

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T15:51:43.837618Z b6d70c8 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The approval flow lists eligible imported pending approvals as orphans and supports denying them through the default-tenant process scope. The update downloader now accepts a caller-created file. The diff also updates test expectations and removes inference, sandbox, tool-trust, and web-chat runtime modules.

Changes: Legacy approval orphan denial

Layer / File(s) Summary
Orphan contract and listing
crates/openhuman-core/src/security/approval/engine.rs, crates/openhuman-core/src/security/approval/engine_stub.rs, crates/openhuman-core/src/security/approval/native/view.rs, crates/openhuman-core/src/security/approval/README.md
The engine adds a default dismiss_orphan method. StubEngine tracks, lists, and denies eligible orphans. The native view filters orphan rows, and the README describes imported orphan requests and their denial rules.
Gate routing and denial
crates/openhuman-core/src/security/approval/gate*.rs
For default-tenant process-scoped decisions without a parked route, the gate checks for an orphan. It permits denial, publishes the decision, and tests cover scope, expiry, and decision types.
Native orphan verification and denial
crates/openhuman-core/src/security/approval/native/*, tests/storage_default_import_e2e.rs
The native engine verifies the exact listed row, tracks active reviews, and submits a ticketed denial. History import preserves existing scope posture. Tests cover verification, scope posture, and the default-storage import flow.

Update download streaming

Layer / File(s) Summary
Caller-owned download file
crates/openhuman-core/src/platform/update/core.rs, crates/openhuman-core/src/platform/update/download.rs
The update path creates the temporary file and passes it to stream_to_file. The streaming function writes to that file and no longer creates it.

Test expectation updates

Layer / File(s) Summary
Module staging and OAuth expectations
scripts/__tests__/rust-e2e-enumeration.test.mjs, tests/in_process/auth_e2e.rs
The staging test expects the released TinyEventQueues module path. Auth tests expect missing-token profiles to remain hidden while retaining active pointers. They also expect imported secrets to remain in document copies rather than being supplied by the file keyring.

Runtime module removals

Layer / File(s) Summary
Inference, sandbox, and tool-trust removals
crates/openhuman-core/src/inference/host_runtime/ops/agent_chat/simple.rs, crates/openhuman-core/src/sandbox/untrusted*, crates/openhuman-core/src/security/approval/native/tool_trust.rs
The simple agent-chat operation, untrusted-shell execution module and tests, and native whole-tool trust methods are removed.
Web-chat turn processing removals
crates/openhuman-core/src/web_chat/*, scripts/ci/*
The parallel-turn, turn-guard, progress-bridge, and run-task modules and tests are removed. Related CI baseline and allowlist entries are also removed.

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant ApprovalGate
  participant NativeEngine
  participant Host
  participant Decide2
  ApprovalGate->>NativeEngine: dismiss_orphan(request_id, label)
  NativeEngine->>Host: begin_orphan_review(request_id, row)
  NativeEngine->>Decide2: submit ticketed Deny
  Decide2-->>NativeEngine: denial result
  NativeEngine->>Host: end orphan review
  NativeEngine-->>ApprovalGate: return dismissal result
Loading

Possibly related issues

  • tinyhumansai/openhuman#7455: The PR changes the ignored-test baseline, but the issue also describes gaps and Cargo resolution behavior that this change does not address.

Suggested labels: rust-core

Suggested reviewers: m3ga-mind, codeghost21

Merge Risk: Minimal · up to 92fec

The change lets pending approvals left by an earlier launch be denied but never approved. No merge-blocking issue was identified, and the ignored-test baseline matches the current source.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(approval): let a person deny a request an earlier launch left waiting" matches the main change. The PR adds a deny-only path for pending orphan approval requests carried over from an ea…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(approval): let a person deny a request an earlier launch left waiting" matches the main change. The PR adds a deny-only path for pending orphan approval requests carried over from an earlier launch, and it blocks approvals for them. The title names the fix, the approval area, and the deny-only scope. The PR also includes unrelated CI and baseline changes (auth e2e, update download, removed web_chat and sandbox modules), but these are secondary and the title does not need to cover them.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each pending row,
And lets a denial safely go.
A file streams bytes along its way,
Old paths retire from work today.
The tests record what changed in store.
Then hops away to check once more.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 66793d09-2fc7-483b-9b3b-73833096ee8d
Commits

Reviewing files that changed from the base of the PR and between b6d70c8 and 92feca1.

Files selected for processing: 1

  • scripts/ci/ignored-test-baseline.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper could not complete coverage (10 unanswered item(s)), so this is not an approval.

Diagnostics

Total spend: $0.0066

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Nov 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The orphan test reuses a request ID left in the process-wide map by another test, causing order-dependent failures; it needs a distinct request ID.

1 open issue
What changed in this PR

Following #8657, this PR lets users dismiss pending approval requests imported from an earlier launch. It preserves the deny-only restriction because the original call cannot run in the current process.

Changes:

  • Adds default-tenant orphan dismissal through the approval gate and native engine.
  • Verifies denial tickets against the exact orphan row.
  • Adds gate, callback, and restart-persistence tests, plus supporting documentation.
File Description
tests/​storage_default_import_e2e.rs Tests approval refusal and durable dismissal across restarts.
crates/​openhuman-core/​src/​security/​approval/​README.md Documents deny-only orphan handling.
crates/​openhuman-core/​src/​security/​approval/​native/​state.rs Tracks orphan rows under review.
crates/​openhuman-core/​src/​security/​approval/​native/​mod.rs Documents the orphan engine module.
crates/​openhuman-core/​src/​security/​approval/​native/​engine.rs Registers the legacy-import orphan module.
crates/​openhuman-core/​src/​security/​approval/​native/​engine_orphans.rs Implements audited, deny-only native dismissal.
crates/​openhuman-core/​src/​security/​approval/​native/​engine_impl.rs Connects the engine trait to native dismissal.
crates/​openhuman-core/​src/​security/​approval/​native/​callbacks.rs Verifies orphan denials against the reviewed row.
crates/​openhuman-core/​src/​security/​approval/​native/​callbacks_tests.rs Tests denial-only verification and row matching.
crates/​openhuman-core/​src/​security/​approval/​gate.rs Includes orphan decision handling.
crates/​openhuman-core/​src/​security/​approval/​gate_tests.rs Registers orphan gate tests.
crates/​openhuman-core/​src/​security/​approval/​gate_state.rs Routes eligible default-tenant decisions to orphan handling.
crates/​openhuman-core/​src/​security/​approval/​gate_orphans.rs Handles dismissal and publishes the decision event.
crates/​openhuman-core/​src/​security/​approval/​gate_orphan_tests.rs Tests dismissal, tenant restrictions, and expiry.
crates/​openhuman-core/​src/​security/​approval/​engine.rs Adds the orphan dismissal trait method.
crates/​openhuman-core/​src/​security/​approval/​engine_stub.rs Models orphan listing and dismissal for tests.

Review effort: Balanced

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 12, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d931950c9f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

senamakel and others added 8 commits November 12, 2026 13:18
The download helper now receives an already-created temp file instead of a path, so the caller opens the file and can flush it before streaming begins. This surfaces file creation errors earlier and keeps the streaming function focused on reading and hashing.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The download helper now borrows the destination file instead of taking ownership, so the caller keeps the handle and the redundant flush before streaming is gone. This avoids an unnecessary flush and keeps error cleanup in the caller's hands.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Dropped the unused `std::path::Path` import from the update download module to keep the imports clean.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The enumeration test now stubs the release module staging and expects the tinyeventqueues release path in OPENHUMAN_MODULE_PATH, since inbound_module_e2e loads that release in both modes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Orphan detection now requires a pending row that carries a legacy history record and is not held by the host, so requests parked by this launch are no longer surfaced as orphans during the window before the host registers them or after it releases them.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The end-to-end tests now expect a keyring-less store to keep OAuth profiles whose access token may live in the keyring, and to serve the document's own token values rather than a keyring entry seeded by another store, matching the file keyring behaviour that keeps profile secrets out of the interactive keyring.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the in-process auth end-to-end tests so they match how a file keyring stores profile secrets in the encrypted document rather than the interactive keyring. A keyring-less view now withholds a possibly keyring-held OAuth row from the view while keeping it and its active pointer persisted, and a saved profile's secret is expected to live in the document, so the assertions and their comments were corrected accordingly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The error returned when creating the download temp file now names the asset being downloaded, making it easier to tell which update failed when several are staged.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 2 commits November 12, 2026 14:01
The orphan under-review test built its row with a non-hex id, which no longer matches the expected row format. Switching it to a valid hex id keeps the test exercising the intended denial-only verification path.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
History import and orphan dismissal now register their fallback posture only when no scope exists for the subject, so they no longer overwrite the posture a live check has already registered. This keeps unrelated calls from prompting or passing differently just because an import ran.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai coderabbitai Bot added the rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. label Nov 12, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 12, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 12, 2026
Delete the simple agent chat op, the untrusted shell sandbox gate and its tests, the native tool-trust helper, and the web chat parallel turn, turn guard, progress bridge, and run task modules along with their tests. Drop the corresponding entries from the CI boundary and ambient baselines and the gated-test allowlist so the checks stay in sync with the removed code.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking. Approving.

Diagnostics

Total spend: $0.0057

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 12, 2026
The ignored test count for openhuman-core drops from 9 to 8, reflecting that one previously ignored test is now running in CI.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 99ac950 into tinyhumansai:main Nov 12, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants