Skip to content

test(storage): delegation checkpointer and SQLite fallback coverage; flows kernel floor for tinyflows-drivers - #7196

Merged
senamakel merged 5 commits into
tinyhumansai:mainfrom
senamakel:storage-cron-flows-followup
Oct 9, 2026
Merged

senamakel merged 5 commits into
tinyhumansai:mainfrom
senamakel:storage-cron-flows-followup

Conversation

@senamakel

@senamakel senamakel commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #7187, which merged before these landed.

  • Extracts the delegation checkpointer choice into open_delegation_checkpointer (re-exported from agent::orchestration) and exercises both branches in storage_flows_e2e (backend installed: no graph_checkpoints.db; after clear(): SQLite file created).
  • without_a_backend_the_flow_state_is_sqlite asserts unconditionally; the e2e also asserts FlowState::Sqlite after storage::clear().
  • Raises the flows kernel floor 337/315 -> 338/316 (one first-party package: tinyflows-drivers); rust-gates-off:kernel-floor and dep-sim-calibration failed on feat(storage): cron and flows on the storage ports #7187's head without it.

Validated: cargo test -p openhuman-cli --test storage_flows_e2e, cargo test -p openhuman --lib -- flows::tinyflows orchestration::delegation, pnpm rust:layout, pnpm rust:clippy, scripts/check-kernel-floor.sh.

Note: main's import_open.rs calls LegacyWorkspace::skip_connector_syncs, which the pinned tinymemory does not have in my checkout; unrelated to this change.

Summary by CodeRabbit

  • Improvements
    • Delegation graph checkpoints now use the configured storage backend when available, or workspace storage otherwise.
    • Flow state continues to use SQLite when no storage backend is configured.

senamakel and others added 3 commits October 9, 2026 16:55
The checkpointer setup moved out of the delegation entry point into a
reusable `open_delegation_checkpointer` helper so the storage-backed and
SQLite fallback paths can be exercised directly. The e2e test now covers
the delegation graph checkpoint on the backend and its fallback to the
workspace database, and the kernel floor limits were bumped for the new
first-party tinyflows-drivers crate.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Pulls in the image crate along with its transitive dependencies (png, tiff, moxcms, zune-jpeg and others) to support image decoding. The workspace crate versions are also rolled back to 0.9.1.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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 ✅ Completed 2026-10-09T14:05:40.918612Z f8c2601 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.

senamakel and others added 2 commits October 9, 2026 16:58
Update the vendored tinycomputer and tinymemory submodules to their latest
commits.

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

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 02b7a23e-01d8-4667-8609-2203c05d3b48

📥 Commits

Reviewing files that changed from the base of the PR and between d468179 and 8bba9b0.


📒 Files selected for processing (6)
  • crates/openhuman-core/src/agent/orchestration/delegation.rs
  • crates/openhuman-core/src/agent/orchestration/mod.rs
  • crates/openhuman-core/src/flows/tinyflows/state_tests.rs
  • scripts/ci/check-dep-sim-calibration.sh
  • scripts/kernel-floor.limits
  • tests/storage_flows_e2e.rs

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



📝 Walkthrough

Walkthrough

The orchestration module now exposes a helper that selects a scoped delegation checkpointer or a workspace SQLite checkpointer. Tests cover both storage paths and FlowState selection. Dependency calibration records the tinyflows-drivers addition.

Changes

Delegation Checkpointer Storage

Layer / File(s) Summary
Checkpointer selection and public API
crates/openhuman-core/src/agent/orchestration/delegation.rs, crates/openhuman-core/src/agent/orchestration/mod.rs
The orchestration entrypoint calls open_delegation_checkpointer. The helper uses a scoped DriverCheckpointer with the delegation_graph prefix when scoped storage is available. Otherwise, it opens graph_checkpoints.db in the workspace. The orchestration module re-exports the helper.
Storage tests and dependency calibration
crates/openhuman-core/src/flows/tinyflows/state_tests.rs, tests/storage_flows_e2e.rs, scripts/ci/check-dep-sim-calibration.sh, scripts/kernel-floor.limits
Tests assert SQLite selection without a backend and verify whether graph_checkpoints.db is written with or without a backend. Dependency calibration updates the flows count to 338 packages and 316 crate names.

Priority: ⬇️ Low

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

Change: Other

Suggested reviewers: codeghost21


Merge Risk

Merge Risk: 🔵 Low · up to 8bba9

The scoped-backend checkpointer behavior lacks a persistence assertion, so a regression could escape the tests. This is a bounded follow-up rather than evidence that current checkpointing is broken.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 8bba9

The existing delegation path retains its storage selection and error handling. No new attacker-reachable path or privilege increase was demonstrated. Risk is low rather than minimal because isolation and recovery behavior of returned checkpoint handles could not be fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The selector addresses the acting agent's scoped document store when configured, or graph_checkpoints.db beneath the supplied workspace otherwise. External native callers can choose that fallback directory, but already possessed public backend-management and scoped-storage capabilities; this does not demonstrate newly gained authority over another tenant or filesystem.

Trust Boundaries and Controls

  • observed — The inspected production delegation tool accepts agent, task, and revision arguments, requires a live parent context, and obtains Config through load_or_init. Its workspace descriptor is passed separately for stage execution, not substituted into the checkpoint directory.

Resilience and Maintainability Implications

  • observed — The process-global backend slot locks individual install, snapshot, and clear operations. The selector clones the scoped document-store handle into the returned checkpointer; clearing the global slot is not itself a revocation mechanism for that cloned handle. This construction pattern predates the PR, while downstream handle isolation remains unverified.

Hardening Proposals

  • proposed — Clarify the public helper's trusted embedding context, workspace ownership expectations, and returned-handle behavior across identity changes or backend removal before adopting it in additional callers.



🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the delegation checkpointer and SQLite fallback coverage, and it also names the related flows kernel-floor update for tinyflows-drivers.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. (1 skipped: 1 …
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.


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

A rabbit checks the graph by moonlit light
Scoped paths keep checkpoints tucked from sight
When no backend rests within the burrow
SQLite writes the file by tomorrow
Tinyflows adds one name to the count
Then hops away, pleased with the amount

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

@tinysweeper

tinysweeper Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper completed its review; deterministic results follow.

State: Reviewing pending checks
Priority: medium
Reviewed head: 8bba9b0ffa2f
Updated: 1791554696 (Unix time)

Review snapshot

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

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

What changed

No supported behavioral explanation was produced.

Features

  • Internal refactor — open_delegation_checkpointer: Delegation graph checkpoint selection (backend-scoped driver checkpointer vs workspace SQLite fallback) becomes a reusable public function; behavior is unchanged for the existing caller and the function is exercised from e2e tests. (crates/openhuman-core/src/agent/orchestration/delegation.rs#pub(crate) async fn run_subagent_delegation_with_parent_context(, crates/openhuman-core/src/agent/orchestration/delegation.rs#fn delegation_subagent_options(, crates/openhuman-core/src/agent/orchestration/mod.rs#pub mod command_center;)
  • Modified — Kernel-floor limit bump to flows:338:316:2: Accounts for the first-party tinyflows-drivers crate (one package, one name; no new external crate) added by cron and flows on the storage ports; calibration script expectation raised from 315 to 316. (scripts/kernel-floor.limits, scripts/ci/check-dep-sim-calibration.sh#cd "$(dirname "$0")/../..")

Tests

  • unit — Asserts unconditionally that no storage backend is installed in this binary and that FlowState::open returns a Sqlite state for 'flow:a'.: The prior conditional guard around the global storage assertion was removed; critique (global-test-state) and security (test-isolation) lanes flagged that asserting process-global state in a parallel test is fragile. (crates/openhuman-core/src/flows/tinyflows/state_tests.rs#fn without_a_backend_the_flow_state_is_sqlite() {)

Findings

  • medium · critique · Preserve the guard around the global storage assertion — `crate::storage::installed()` reads process-wide storage state, not state owned by this test. Another test running in the same test binary can install a backend concurrently or bef (crates/openhuman\-core/src/flows/tinyflows/state\_tests\.rs:69)
  • medium · security · Avoid asserting process-global state in a parallel test — `crate::storage::installed()` is process-wide state, so this test can fail depending on whether another test has installed a backend. The previous conditional assertion correctly s (crates/openhuman\-core/src/flows/tinyflows/state\_tests\.rs:69)
  • medium · tests · Backend path of the delegation checkpointer is opened but never verified — This call constructs a DriverCheckpointer and immediately drops it; the only assertion afterwards is that `graph_checkpoints.db` does not exist in the workspace, which would also p (tests/storage\_flows\_e2e\.rs:79)

Pending checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)

Before merge

  • Wait for Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS).
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Review covered all 6 changed files with one finding on the removed guard around the global storage assertion.
  • Lane summary: Reviewed 6 files; 1 finding. (1 observation(s) grouped into shared inline comments) _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._
  • Evidence: crates/openhuman\-core/src/flows/tinyflows/state\_tests\.rs — Preserve the guard around the global storage assertion

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 6 files; 1 finding. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._
  • Evidence: crates/openhuman\-core/src/flows/tinyflows/state\_tests\.rs — Avoid asserting process-global state in a parallel test

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The refactor extracts open_delegation_checkpointer and exposes it for tests; the fallback (workspace SQLite) path is pinned by an assertion that graph_checkpoints.db appears after storage::clear(). The backend path, however, is only exercised by calling the function and discarding the result, so the comment's claim that the checkpointer 'lives on the backend too' is not actually pinned. Otherwise the change looks safe to merge. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._
  • Evidence: tests/storage\_flows\_e2e\.rs — Backend path of the delegation checkpointer is opened but never verified

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The description accurately covers the diff: the checkpointer extraction into `open_delegation_checkpointer` with both branches exercised in the e2e, the unconditional SQLite-fallback assertion, and the kernel-floor bump with its calibration comment. The change looks sound and safe to merge. _Code retrieval was unavailable (model: ladder embeddings returned 400 Bad Request: {"error":{"message":"unknown ladder vectors; known ladders are flash (also chat-v1, flash-v1), instant (also no-think, instant-v1), reasoning (also deepseek), max-reasoning (also max-reasoning-v1), deepseek-flash (also reasoning-v1, agentic-v1), deep (also luna), scribe, uncensored, vectors-oai3 (also embeddings-oai3-v1), vision (also vision-v1, multimodal-v1), image (also images-v1, image-v1), vi), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: The PR extracts `open_delegation_checkpointer` and extends `tests/storage_flows_e2e.rs` to drive both of its branches end to end: with a backend installed it asserts `graph_checkpoints.db` is not written to the workspace, and after `storage::clear()` it opens the checkpointer again and asserts the SQLite file appears. Both behavioural surfaces of the refactor are exercised; the orchestration/limit-script changes are internal bookkeeping. Looks sound to merge. Waiting on end-to-end jobs: `Rust E2E (mock backend)`, `Build Playwright E2E Artifact`, `E2E (Playwright / web lane)`, `Desktop E2E (full suite, 3 OS)`.
  • Unresolved questions/checks: Rust E2E (mock backend), Build Playwright E2E Artifact, E2E (Playwright / web lane), Desktop E2E (full suite, 3 OS)
Evidence and run details
  • Models: gpt-5.6-luna, glm-5.3-flash
  • Spend: $0.003192
  • Tokens: 161935 input · 10307 output · 14313 cached · 0 embedding
Head State Pass summary
8bba9b0ffa2f pending 3 active finding(s), 0 resolved finding(s) (at 1791554696)

tinysweeper 0.1.0

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

             $0.0032 · 161,935 in / 10,307 out · 14,313 cached (9%) · gpt-5.6-luna, glm-5.3-flash
critique:    $0.0008 · 62,672 in  / 3,277 out  · 8,114 cached (13%) · gpt-5.6-luna, glm-5.3-flash
security:    $0.0021 · 61,227 in  / 2,721 out  · 3,575 cached (6%)  · gpt-5.6-luna
tests:       $0.0002 · 21,048 in  / 2,612 out  · 2,624 cached (12%) · glm-5.3-flash
description: $0.0000 · 5,484 in   / 174 out    · 0 cached (0%)      · glm-5.3-flash
e2e:         $0.0001 · 7,133 in   / 323 out    · 0 cached (0%)      · glm-5.3-flash

));
}
// Nothing in this binary installs a backend, so the slot is empty.
assert!(crate::storage::installed().is_none());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

priority medium security confident

Avoid asserting process-global state in a parallel test

crate::storage::installed() is process-wide state, so this test can fail depending on whether another test has installed a backend. The previous conditional assertion correctly skipped the SQLite check when a backend was present; preserve that isolation or explicitly control and restore the global storage state for this test.


Additional critique observation

priority medium confident

Preserve the guard around the global storage assertion

[RULE] global-test-state

crate::storage::installed() reads process-wide storage state, not state owned by this test. Another test running in the same test binary can install a backend concurrently or before this test, making this assertion fail even though FlowState::open should correctly select Documents. The previous conditional avoided coupling this test to global test order; restore that guard or otherwise isolate and serialize the global storage state.

Suggested change for the opening observation

Suggested change
assert!(crate::storage::installed().is_none());
if crate::storage::installed().is_none() {

[RULE] test-isolation ·


for path in ["cron/jobs.db", "flows/flows.db"] {
// The delegation graph's checkpointer lives on the backend too.
let delegation_config = config.clone();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

priority medium tests uncertain

Backend path of the delegation checkpointer is opened but never verified

This call constructs a DriverCheckpointer and immediately drops it; the only assertion afterwards is that graph_checkpoints.db does not exist in the workspace, which would also pass if the function silently did nothing with the backend. The invariant the comment claims — "The delegation graph's checkpointer lives on the backend too" — needs a test that would fail if the scoped-backend branch regressed to something else: write a checkpoint through the returned checkpointer (or at least confirm the driver-backed prefix is reachable via crate::storage::current_scoped()), and read it back. As written, the backend branch of open_delegation_checkpointer has no failing assertion.

[RULE] test-asserts-nothing ·

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Oct 9, 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: f8c260187d

ℹ️ 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".

Comment thread vendor/tinymemory Outdated
@@ -1 +1 @@
Subproject commit 439cce2a7cfa42916852b24978a17c2567f45a2f
Subproject commit 004763036e8ac6af36059ef5bcefed537d55a888

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore the TinyMemory pin required by import_open

On a fresh recursive checkout, this rewinds TinyMemory from 439cce2a7 to 004763036, the older pin that does not expose LegacyWorkspace::skip_connector_syncs; crates/openhuman-core/src/memory/import_open.rs:11 calls that method in an unconditionally compiled module. Root and desktop builds therefore fail while type-checking the memory import code, so retain the newer pin that introduced the API.

AGENTS.md reference: AGENTS.md:L616-L620

Useful? React with 👍 / 👎.

Comment thread Cargo.lock Outdated
[[package]]
name = "tinycomputer-accessibility"
version = "0.10.0"
version = "0.9.1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep TinyComputer aligned with the compiled registry

Relative to parent d46817993, this entry reflects a rewind of vendor/tinycomputer from the published v0.10.0 pin to v0.9.1, while crates/openhuman-core/src/modules/registry/records_computer.rs:11-13 still selects and verifies v0.10.0 artifacts. Linux/Docker builds compile the module from this exact gitlink, so they silently lose the v0.10 fixes, while packaged hosts compile against a 0.9.1 bus but load the 0.10.0 module; restore 489421c and the v0.10.0 lock entries.

AGENTS.md reference: AGENTS.md:L607-L610

Useful? React with 👍 / 👎.

@senamakel
senamakel merged commit 26c6234 into tinyhumansai:main Oct 9, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant