Skip to content

chore: roll up security migration - #188

Merged
M3gA-Mind merged 70 commits into
tinyhumansai:mainfrom
senamakel:epic/8369-security-migration
Nov 3, 2026
Merged

M3gA-Mind merged 70 commits into
tinyhumansai:mainfrom
senamakel:epic/8369-security-migration

Conversation

@senamakel

@senamakel senamakel commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

This upstream roll-up carries the security migration changes from senamakel:epic/8369-security-migration. OpenHuman needs this change upstream before it can advance the corresponding gitlink in tinyhumansai/openhuman#8487.

The roll-up adds tinyflows-storage as the shared persistence adapter, replaces the older tinyflows-import path, and raises the workspace MSRV to 1.88.

The git dependencies are temporary pins to unpublished commits required to build this migration:

  • tinybus and tinybus-module use senamakel/tinybus at 34d3bd6dda099e54cee11a2f96f28a21da9e0759 for the v0.3.12 module/storage bus API used by the roll-up. The [patch] pin at 0de2d283f35cbbff08efad6fbe05537ffb74611b makes TSD's bus proxy use the same bus contract source.
  • tinytools uses senamakel/tinytools at 643df90ba25f93187249fa99f6789f9aa7f8bbc8, matching the TinyAgents pin so tinytools::Tool remains one Rust type across the workspace.
  • TinyStorageDrivers crates use senamakel/tinystoragedrivers at 2d23a6a6009fa52d1e7aa18de589bdd109a54b6a for the Storage Bus and QueueStore APIs from upstream PRs chore(deps): bump jaq-std from 3.0.1 to 3.0.2 #71 and chore(deps): bump sha2 from 0.10.9 to 0.11.0 #72, plus the post-2.1.2 workspace and lockfile fixes from feat(engine): resolve a working directory for agent and sub_workflow steps #73. The API/type crates used here have no source delta from 2.1.2.

Hosts building this migration must resolve those exact git sources; they can move to canonical release sources once the upstream module changes are published. The TinyStorageDrivers pin rationale is also recorded beside its manifest entries.

Source commit: 39d441ac5bcc1725b8476407b56a0b26f7b76cdb

Validation: cargo fmt --all -- --check, cargo test -p tinyflows-storage (18 unit tests and 3 doctests), and cargo clippy -p tinyflows-storage --all-targets -- -D warnings pass locally. The hosted Rust/module tests passed for the prior source commit; CI is rerunning for the current commit.

Summary by CodeRabbit

  • Bug Fixes

    • Scheduled runs that report an unsuccessful delivery now generate a warning with the job ID and delivery status, making these outcomes easier to identify. Errors encountered while running a task continue to be reported.
  • Tests

    • Recovery tests now wait for recovery to finish before checking that cleanup has completed, improving the reliability of these checks.

senamakel and others added 30 commits October 20, 2026 16:12
This change updates the primitives module within the storage crate to align with recent internal refactoring efforts. It ensures consistency across the storage layer's fundamental building blocks.

Auto-committed-on: dragonfly
This introduces the fundamental building blocks for storage operations, including counters, key-value storage, leases, and repository management. These primitives establish the necessary low-level abstractions for the storage layer.

Auto-committed-on: dragonfly
…lows-storage/Cargo.toml

Auto-committed-on: dragonfly
…lows-storage/src/primitives/cou

Auto-committed-on: dragonfly
The epoch-based fence functionality has been removed from the Lease struct. This simplifies the lease management by removing the dependency on the Fence mechanism for epoch checking.

Auto-committed-on: dragonfly
This change updates the import paths for types used within the storage primitives. This refactoring standardizes how types from `tinystoragedrivers_api` are brought into scope across the repository and counter modules.

Auto-committed-on: dragonfly
This update adds several new driver packages to the workspace and updates dependencies across the project. It also exposes the `Key` type from the primitives module in `lib.rs`.

Auto-committed-on: dragonfly
…crates/tinyflows-adaptive/src/d

Auto-committed-on: dragonfly
The tinyflows-storage dependency has been removed from Cargo.toml as it is no longer required by the drivers crate.

Auto-committed-on: dragonfly
This updates several dependencies to newer versions, notably upgrading `windows-sys` across multiple packages. It also introduces several new packages related to storage drivers and bus communication.

Auto-committed-on: dragonfly
This introduces a new blocking implementation for storage operations, allowing synchronous access to the storage layer. This is necessary to support environments where asynchronous operations are not available.

Auto-committed-on: dragonfly
This change exposes the schema and blocking modules from the storage crate. This allows users to interact with schema migration and blocking mechanisms directly from the library.

Auto-committed-on: dragonfly
This refactoring updates how storage schemas and migrations are invoked across the module. It removes reliance on `document_only_scope` in favor of directly using the storage schema's migration methods, simplifying the migration logic.

Auto-committed-on: dragonfly
…,crates/tinyflows-drivers/src/s

Auto-committed-on: dragonfly
…ts.rs,crates/tinyflows-adaptive

Auto-committed-on: dragonfly
…ts.rs,crates/tinyflows-adaptive

Auto-committed-on: dragonfly
Replaces direct usage of `tinyflows_storage::MemoryStorage` with `tinystoragedrivers_testkit::MemoryBackend` across various test files. This aligns tests with the current storage driver implementation.

Auto-committed-on: dragonfly
This change updates the migration process to include sorting when querying documents and refines the logic for updating and deleting records. It now filters documents based on schema version during input collection and uses version preconditions for more robust updates and deletions.

Auto-committed-on: dragonfly
…rates/tinyflows-adaptive/Cargo.

Auto-committed-on: dragonfly
Adds assertions to verify the state of documents before and after the owner migration runs. This ensures that the migration correctly preserves document metadata and handles the expected number of rows during the step execution.

Auto-committed-on: dragonfly
…-adaptive/src/drivers/ledger_te

Auto-committed-on: dragonfly
refactor(storage): move TinyFlows persistence onto TSD v2
Updates the tinystoragedrivers api, types, and testkit dependencies to
2.0.1. Adds the busproxy testkit crate and the tinybus SDK as new
dev-dependencies to support bus-backed storage tests.

Auto-committed-on: dragonfly
Update the tinystoragedrivers api, types and testkit dependencies to
v2.0.1 across the adaptive, drivers and module crates. Add a storage
schema test that runs a migration through the real TSD busproxy to
confirm the module-compatible path avoids sending host-only metadata.

Auto-committed-on: dragonfly
…atch

Add tests asserting that a cross-collection migration retry succeeds when the
target write is byte-identical, including matching schema and expiry, and that a
differing expiry is rejected as a conflict while the source record is preserved.
The tinybus dev-dependency is repointed at the tinyhumansai fork and the
"modules" feature is dropped.

Auto-committed-on: dragonfly
senamakel and others added 4 commits October 27, 2026 04:32
Pinned uuid back to 1.26.1 and switched tempfile's getrandom dependency to 0.3.4 so the lockfile resolves a single compatible getrandom version.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the tinystoragedrivers git dependencies from the v2.0.1 tag to revision 2d23a6a (2.1.2) and tinybus from 0.1.5 to 0.1.6, refreshing Cargo.lock accordingly. The new revision pulls in nix and drops the unused arbitrary and crossbeam-utils crates.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
refactor(storage): sync TinyFlows onto TSD v2
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The recovery task now releases its cleanup guard before sending test-only completion signals, and recovery tests wait for those signals before checking reconciliation. Scheduled tasks now log unsuccessful run outcomes while continuing to propagate errors.

Changes: Actor Recovery

Layer / File(s) Summary
Recovery completion and test synchronization
crates/tinyflows-module/src/run_manager/actor_recovery.rs, crates/tinyflows-module/src/run_manager_actor_recovery_tests.rs
The recovery task drops its cleanup guard before test-only notification. Recovery tests install and await a run-ID keyed signal before checking reconciliation.

Scheduled Run Outcomes

Layer / File(s) Summary
Scheduled run outcome logging
crates/tinyflows-schedule/src/runtime/mod.rs
The spawned task inspects the run outcome and logs a warning for unsuccessful outcomes with the job ID and delivery status. Run errors still propagate.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Possibly related PRs

  • tinyhumansai/tinyflows#181: Updates the same actor-recovery tests; this PR adds explicit recovery-completion signaling before cleanup assertions.

Suggested reviewers: tinysweeper

Merge Risk: Low · up to 1b9b9

Concurrent recovery tests reusing a run ID can wait indefinitely or observe the wrong completion; keying signals by recovery instance is needed before merge.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the run at dawn,
The cleanup guard is safely gone.
A signal says, “Recovery’s through,”
The tests can check the state anew.
If a run falls short, a warning hops along.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@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:38:36.125413Z
We couldn’t complete this review. Comment @codex review to try again.
39d441a 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.

@tinysweeper

tinysweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: 1b9b9b0f9ed76562e7fe919de7381236353c01be

Findings

  • high: Correct the description to cover the actual diff ((pull request description))
    Problem: The body describes a storage migration that is not in this diff: `tinyflows-storage` as the shared persistence adapter, replacement of the `tinyflows-import` path, the workspace MS
    Suggested fix:
    No concrete fix was supplied.

Advisory notes

  • medium: Move the recovery-completion helpers out of the oversized test file ((pull request description))
    Problem: The repository rules state, word for word:
    Suggested fix:
    No concrete fix was supplied.

Resolved this pass

  • Describe the storage-API swap and the fork repointing
  • Describe the storage-API swap and the fork repointing
  • Describe the storage-API swap and the fork repointing
  • Describe the storage-API swap and the fork repointing

Verdict: Changes requested · Priority: high
Coverage: Reviewed 3 of 3 files.

Diagnostics and supporting details

Full summary

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

Review snapshot

Change surface Files Review signal Count
Production 2 Active findings 1
Tests 1 Noted findings 1
Documentation 0 Resolved findings 4
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 — Scheduler warns on unsuccessful scheduled runs: `impl Scheduler` captures `job_id` before spawning, propagates the renewal/delivery result with `?` (preserving the spawned task's previous error behavior, since the JoinHandle is still dropped), and logs a `tracing::warn!` with job id and delivery status when `outcome.success` is false, giving failed deliveries a trace in the poll loop. (crates/tinyflows-schedule/src/runtime/mod.rs impl Scheduler {)

Tests

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

Before merge

  • Address Correct the description to cover the actual diff ((pull request description)).

How this fits together

flowchart LR
  n0["ActorRecoveryGuard<br/>changed"]:::changed
  n1["...admitted_actor_reconciles_its_running_row<br/>changed"]:::changed
  n2["...actor_future_reconciles_only_its_live_run<br/>changed"]:::changed
  n3["install_after_admission_gate<br/>changed"]:::changed
  n4["...rves_parked_terminal_and_replacement_runs"]:::impacted
  n5["running_fixture"]:::impacted
  n6["ActiveRun"]:::impacted
  n7["drive"]:::impacted
  n8["assert_reconciled"]:::impacted
  n9["RunningFixture"]:::impacted
  n0 -->|uses| n6
  n1 -->|calls| n3
  n1 -->|tests| n3
  n1 -->|calls| n5
  n1 -->|tests| n5
  n1 -->|calls| n7
  n1 -->|tests| n7
  n1 -->|calls| n8
  n1 -->|tests| n8
  n2 -->|calls| n5
  n2 -->|tests| n5
  n2 -->|calls| n7
  n2 -->|tests| n7
  n2 -->|calls| n8
  n2 -->|tests| n8
  n4 -->|calls| n5
  n4 -->|tests| n5
  n4 -->|calls| n7
  n4 -->|tests| n7
  n5 -->|uses| n9
  n7 -->|uses| n6
  n9 -->|uses| n6
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading
Agent review details

critique

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

security

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

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The answered tests lane reports the test-side change is sound — both recovery tests now await a completion signal instead of racing the spawned task, and the notification hook is cfg(test)-only — and that `?` in the schedule runtime preserves the spawned task's prior error behavior, so the warning addition is not a regression.
  • Lane summary: The test-side change is sound: both actor-recovery tests now await a completion signal before asserting, so they no longer race the spawned recovery task, and the notification is cfg(test)-only. The scheduling change converts a failed run into a warning instead of silently discarding the outcome, and `?` preserves the previous error behaviour of the spawned task (dropping the JoinHandle still discards it), so no regression. One gap remains: the newly added non-success warning branch has no test, and the `run_manager/actor_recovery.rs` production file gained cfg(test)-only coupling to its test module, but neither is a defect beyond a coverage note I could not anchor to a failing path. (1 earlier finding(s) still open) _The code index is behind this pull request (indexed at `c099bee408f2`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The answered commits lane reported no sensitive content in committed files, with one earlier finding still open.
  • Lane summary: No sensitive content in committed files. (1 earlier finding(s) still open) _The code index is behind this pull request (indexed at `c099bee408f2`), so retrieved context may be out of date._

description

  • Conclusion: Failure
  • Scope reviewed: all assigned evidence
  • Positive: The answered description lane's open `description-mismatch` finding stands: the body describes storage-adapter, MSRV and git-pin work absent from the three changed files, omits the test-only recovery hook and scheduler warning that are present, quotes validation for an untouched crate, and the tests file exceeds the repository's 500-line limit.
  • Lane summary: The description no longer matches the diff: the body narrates a storage-adapter migration, an MSRV raise and git pins that are absent from these three hunks, while the changes actually present — a test-only recovery-completion hook and a scheduler warning for failed deliveries — are never mentioned, and the quoted validation exercises a crate the diff does not touch. The PR also pushes `run_manager_actor_recovery_tests.rs` past the repository's 500-line limit. _The code index is behind this pull request (indexed at `c099bee408f2`), so retrieved context may be out of date._
  • Evidence: (pull request description) — Correct the description to cover the actual diff
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.002502
  • Tokens: 223603 input · 15499 output · 72320 cached · 187 embedding
  • Updated: 2026-11-03T06:36:41Z
Head State Pass summary
39d441ac5bcc incomplete 1 active finding(s), 0 resolved finding(s) (at 2026-10-30T11:39:35Z)
f64c31d14993 incomplete 2 active finding(s), 5 resolved finding(s) (at 2026-10-30T11:59:07Z)
17c881b79ea4 incomplete 1 active finding(s), 9 resolved finding(s) (at 2026-10-30T17:45:49Z)
c099bee408f2 incomplete 0 active finding(s), 14 resolved finding(s) (at 2026-10-30T17:53:17Z)
1b9b9b0f9ed7 changes requested 1 active finding(s), 4 resolved finding(s) (at 2026-11-03T06:36:41Z)

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.

Requesting changes: 1 lane(s) blocking, worst finding is high.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

Diagnostics

Total spend: $0.0229

@tinysweeper tinysweeper Bot added the priority: p1 Next. Wrong behaviour a user will hit, or a security weakness behind a condition. label Oct 30, 2026
senamakel and others added 7 commits October 30, 2026 11:54
Register a new identity_tests module under cfg(test) so the schedule types can be covered by dedicated identity tests.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Channel job origins can now carry a host-derived session identity describing the tenant, agent, provider, and conversation coordinates, with optional fields omitted from the wire format so legacy origins serialize unchanged.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Extracted ChannelSessionIdentity and ChannelConversationIdentity from the
schedule types module into a dedicated identity module, re-exporting them from
the same place so existing imports keep working. This keeps the shared
schedule types focused and gives the channel identity definitions room to grow.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Move the local ChannelSessionIdentity import above the external crates so the import grouping follows the project's convention. No behaviour change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The roundtrip test now constructs a JobOrigin::Channel value and serializes it instead of parsing a hand-written JSON literal, then asserts the nested session and conversation fields survive the roundtrip. This exercises the typed identity structures rather than only the deserializer.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Wrap the thread_id assertion in the identity roundtrip test across multiple lines so it stays within the formatter's line width. No behaviour change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Drops an unused `serde_json::json` import from the schedule identity tests, keeping the test module free of warnings.

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.

Requesting changes: 2 lane(s) blocking, worst finding is high.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

Diagnostics

Total spend: $0.0177

Comment thread crates/tinyflows-storage/Cargo.toml Resolved
Add a comment explaining that the exact git revisions bridge the storage
security migration while upstream roll-ups are pending, noting the
unreleased Storage Bus/QueueStore API and post-release security fixes
they include.

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.

Requesting changes: 1 lane(s) blocking, worst finding is high.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

Diagnostics

Total spend: $0.0135

The acquire_with, inspect and release_epoch methods were relocated into a new leases/advanced.rs submodule, wired in via a path attribute, with no change to their behaviour. This keeps the core lease primitives file focused and gives the host-level takeover semantics their own home.

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 could not complete coverage (125 unanswered item(s)), so this is not an approval.

Diagnostics

Total spend: $0.0316

@tinysweeper tinysweeper Bot added priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. and removed priority: p1 Next. Wrong behaviour a user will hit, or a security weakness behind a condition. labels Oct 30, 2026
Take main's single 0.3.6 series (tinybus 6ce06bc, tinystoragedrivers
v2.1.2 6226b94, tinytools 41cc80a) and drop the senamakel/tinybus and
0.1.6 patch tables. The fork-only tinystoragedrivers changes (fence,
secrets) are not used by tinyflows.

Conflicts: identity, schedule types and their tests take main's
superset (wire alias, contract 8); schema migrations and lease
operations take main's layout, which holds the same code; JSON
extraction lives in agent_prompt/json_extract.rs as on main.
Cargo.lock is main's and is refreshed in the next commit.
dispatch_claims dropped the ManualRunOutcome, so a run whose delivery
failed returned Ok and reap() never reported it. The run record already
persists the result; this adds the missing log line.

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

Requesting changes: 1 lane(s) blocking, worst finding is high.

Fix or reply to the findings below and push. The next review clears this automatically once they are gone — you should not need to dismiss anything by hand.

Diagnostics

Total spend: $0.0025

@tinysweeper tinysweeper Bot added priority: p1 Next. Wrong behaviour a user will hit, or a security weakness behind a condition. and removed priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. labels Nov 3, 2026
@M3gA-Mind
M3gA-Mind merged commit 83928f0 into tinyhumansai:main Nov 3, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p1 Next. Wrong behaviour a user will hit, or a security weakness behind a condition.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants