Skip to content

chore: roll up security migration changes - #319

Merged
senamakel merged 15 commits into
tinyhumansai:mainfrom
senamakel:epic/8369-security-migration
Oct 30, 2026
Merged

senamakel merged 15 commits into
tinyhumansai:mainfrom
senamakel:epic/8369-security-migration

Conversation

@senamakel

@senamakel senamakel commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Upstream roll-up required before OpenHuman can advance its gitlink. Carries commit 4ee5d0c referenced by tinyhumansai/openhuman#8487. Validation: source commit verified; tests were not run for this roll-up.

Summary by CodeRabbit

  • Bug Fixes
    • Queued deletions now wait for the engine’s reachability check and remain paused if the engine is unavailable.
    • Turn processing and layout migration checks now wait for engine and legacy-claim results before continuing. Existing error handling and outcomes are unchanged.

senamakel and others added 14 commits October 27, 2026 02:47
The EngineResolver trait now exposes an async resolve method, and all
call sites await it. This lets resolvers perform asynchronous work such
as I/O when locating the configured engine and identity instead of
blocking the caller.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a DeferredResolver test double whose resolve future stays pending until
released, and a test asserting that pre_turn does not complete while engine
resolution is still in flight. This pins down the ordering guarantee that
citations are not recorded before the engine memory is available.

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

The StaticResolver implementation of EngineResolver was missing the
async_trait attribute, so it now matches the trait's async signature. The
DeferredResolver resolve method also drops its mutex guard before awaiting
the release, avoiding holding the lock across an await point.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Track resolver invocations with an atomic counter so the pre-turn test can
verify the async engine resolution is awaited exactly once before proceeding.
The fixture now clones the resolver handle to keep it accessible after the
turn completes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test now clones the resolver before passing it to TurnHooks so the original binding stays available for later assertions.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The fixture builder cloned the resolver before moving it into the struct, which was unnecessary since the value is not used afterwards. Removing the clone keeps the test setup free of a needless allocation.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Bumps tokio from 1.53.1 to 1.53.3 and downgrades the windows-sys dependency
pulled in by several crates from 0.61.2 to 0.52.0. The lockfile was regenerated
to reflect the resolved dependency graph.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Sync active TinyMemory pin with async resolver
The reachability probe is now an async method so executors can await a real
backend check instead of blocking, and the drain path awaits it before running
anything. A test with a deferred reachability future covers the new behaviour.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The engines accessor on the LayoutHost trait is now async, and its call
sites in the migration job and scan service await it. This lets hosts
resolve engines through asynchronous work instead of blocking, and the
test hosts were updated to match the new signature.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The LayoutHost::legacy_claim method is now async, and its callers in the
migration job and scan service await it. This lets host implementations
perform asynchronous work when acquiring the legacy claim instead of
blocking the caller.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
refactor(deletion): make reachability async
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-30T11:37:57.433536Z
We couldn’t complete this review. Comment @codex review to try again.
4ee5d0c PR opened
ℹ️ 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 Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

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: a081c4f3-6639-480e-8069-3fd0c34fc08d
Commits

Reviewing files that changed from the base of the PR and between d1800ba and 4ee5d0c.

Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
Files selected for processing: 8
  • crates/tinymemory-tools/src/deletion/mod.rs
  • crates/tinymemory-tools/src/deletion/mod_tests.rs
  • crates/tinymemory-tools/src/layout_migration/job.rs
  • crates/tinymemory-tools/src/layout_migration/service.rs
  • crates/tinymemory-tools/src/layout_migration/service_tests.rs
  • crates/tinymemory-tools/src/layout_migration/test_host.rs
  • crates/tinymemory-tools/src/lifecycle/turn.rs
  • crates/tinymemory-tools/src/lifecycle/turn_runtime_tests.rs

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

Walkthrough

Deletion reachability, layout migration host lookups, and lifecycle engine resolution now use asynchronous methods. Their callers await the results. Tests cover deletion and pre-turn operations that remain pending while resolution is deferred.

Changes: Deletion Reachability

Layer / File(s) Summary
Await reachability before deletion
crates/tinymemory-tools/src/deletion/mod.rs, crates/tinymemory-tools/src/deletion/mod_tests.rs
DeletionExecutor::is_reachable is asynchronous, and DeletionQueue::drain awaits it before running queued deletions. The test executor and tests cover a deferred reachability check.

Layout Migration

Layer / File(s) Summary
Await layout host lookups
crates/tinymemory-tools/src/layout_migration/job.rs, crates/tinymemory-tools/src/layout_migration/service.rs, crates/tinymemory-tools/src/layout_migration/service_tests.rs, crates/tinymemory-tools/src/layout_migration/test_host.rs
LayoutHost::engines and LayoutHost::legacy_claim are asynchronous. Migration jobs, scans, and host implementations await or implement these methods.

Turn Lifecycle Resolution

Layer / File(s) Summary
Await engine resolution in lifecycle hooks
crates/tinymemory-tools/src/lifecycle/turn.rs, crates/tinymemory-tools/src/lifecycle/turn_runtime_tests.rs
EngineResolver::resolve is asynchronous. Pre-turn, post-turn, and compaction hooks await resolution. Tests cover deferred pre-turn resolution.

Priority: Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Suggested reviewers: m3ga-mind

Merge Risk: Minimal · up to 4ee5d

No blocking issue is established. Verify downstream host compatibility when advancing the gitlink.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title identifies the pull request as a roll-up of migration-related changes. It does not name the main asynchronous API updates, but it remains related to the changeset.
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: Docstring Coverage

Explanation

Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 10 functions across 8 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
⚔️ Resolve merge conflicts: 💡
  • Resolve merge conflict in branch epic/8369-security-migration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the queue at dawn,
Then waits until the pause is gone.
The engines answer, calm and clear,
The turn resumes when they appear.
Soft paws mark each awaited hop,
And queued deletions wait, then pop.

Comment @coderabbitai help to get the list of available commands.

@tinysweeper

tinysweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: d4c734a30dc13ceddd095fdb6abb973f84855544

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 8 of 8 files.
Pull request purpose (title): chore: roll up secur…

Diagnostics and supporting details

Full summary

Pull request purpose (title): chore: roll up security migration changes. Tiny Sweeper completed its review; deterministic results follow.

Review snapshot

Change surface Files Review signal Count
Production 4 Active findings 0
Tests 4 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 0

Completeness: Complete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

Features

  • Modified — Async deletion reachability check: Draining the pending deletion queue now awaits `is_reachable()` before running deletions, so an unreachable engine pauses the drain and queued deletions wait rather than being attempted. (crates/tinymemory-tools/src/deletion/mod.rs impl<S: ListStore<PendingDeletion>> DeletionQueue<S> {)
  • Modified — Async layout migration host lookups: `engines()` and `legacy_claim()` on LayoutHost become async and are awaited in the migration run path and in `scan`, keeping the memory-off/signed-out and claim-elsewhere branches unchanged while allowing hosts to resolve engines asynchronously. (crates/tinymemory-tools/src/layout_migration/job.rs pub trait LayoutHost: Send + Sync {, crates/tinymemory-tools/src/layout_migration/service.rs pub async fn scan(host: &dyn LayoutHost) -> Result<ScanView> {)
  • Internal refactor — Async test doubles and implementors for the migrated traits: Test implementations of the affected traits are updated to the async signatures and await their inner calls, so they compile against the new trait shapes; all in-tree callers are updated accordingly. (crates/tinymemory-tools/src/layout_migration/service_tests.rs impl LayoutHost for CountingHost {, crates/tinymemory-tools/src/layout_migration/test_host.rs impl LayoutHost for FakeHost {, crates/tinymemory-tools/src/lifecycle/turn_runtime_tests.rs struct StaticResolver {)

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Before merge

None.

Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Critique reviewed all 8 files and reported 0 findings, noting the code index is behind this pull request.
  • Lane summary: Reviewed 8 files; 0 findings. _The code index is behind this pull request (indexed at `4ee5d0ce3a19`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Security reviewed all 8 files and reported 0 findings.
  • Lane summary: Reviewed 8 files; 0 findings. _The code index is behind this pull request (indexed at `4ee5d0ce3a19`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change converts three host-port methods (`DeletionExecutor::is_reachable`, `LayoutHost::engines`, `LayoutHost::legacy_claim` and `EngineResolver::resolve`) from synchronous to async and awaits them at every call site; all in-tree implementors and the test doubles are updated. Each new behaviour is pinned by a failing-before test (`drain_awaits_async_reachability_before_running_deletions` and `pre_turn_awaits_async_engine_resolution` both assert the future stays pending until the host releases, and that no work ran while pending), and the `layout_migration` await sites keep their error handling intact. I found no defect worth reporting; the only thing I could not fully verify from the diff alone is whether a downstream (out-of-repo) host implements these traits synchronously, which is not this repository's concern. _The code index is behind this pull request (indexed at `4ee5d0ce3a19`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Commits lane reported no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `4ee5d0ce3a19`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Description lane found no defect in the diff, treating the roll-up framing that omits the trait signature changes as not worth a finding since they are internal call-site edits; the code looks consistent and sound.
  • Lane summary: The change converts three host-facing traits (DeletionExecutor::is_reachable, LayoutHost::engines/legacy_claim, EngineResolver::resolve) to async and awaits them at every call site, updating all in-repo implementors and adding tests that assert the drain and pre-turn paths do not complete before resolution. The description's dependency-update framing omits the trait signature changes, but those are internal call-site edits with no behaviour change, so this is not worth a finding; the code itself looks consistent and sound. _The code index is behind this pull request (indexed at `4ee5d0ce3a19`), so retrieved context may be out of date._
Evidence and run details
  • Models: deepseek-v4.1-flash, ladder/vectors-oai3
  • Spend: $0.003825
  • Tokens: 351383 input · 6391 output · 100352 cached · 384 embedding
  • Updated: 2026-10-30T16:21:59Z
Head State Pass summary
4ee5d0ce3a19 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-30T11:39:40Z)
d4c734a30dc1 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-30T16:21:59Z)

tinysweeper 0.1.2

@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.0040

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Oct 30, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper tinysweeper Bot added priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. and removed priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. labels Oct 30, 2026
@senamakel
senamakel merged commit cc480fa into tinyhumansai:main Oct 30, 2026
23 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant