Skip to content

test(storage_import): give the tinybox fixture the registry's real index shape - #8337

Merged
M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:fix/tinybox-import-test-records-key
Oct 23, 2026
Merged

M3gA-Mind merged 1 commit into
tinyhumansai:mainfrom
M3gA-Mind:fix/tinybox-import-test-records-key

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes modules::storage_import_tinybox::tests::the_jail_index_moves_into_one_document_with_the_same_shape, which fails on main. The stored body keeps created_at_unix and updated_at_unix where the test expects created_ms and updated_ms.

Cause: the test fixture, not the importer.

  • tinybox-jail's registry writes index.json as {"records": {<id>: JailRecord}} (crates/tinybox-jail/src/registry.rs, struct Index { records }).
  • The importer converts the file with tinybox_bus::storage::jail_index::to_body, which turns each record's seconds fields into the body's millisecond fields. It does that for the records under "records" (tinybox-bus jail_index.rs, records_mut).
  • The fixture keyed its records under "jails", so to_body found none to convert.

Fix. The fixture's index and the expected body now use the "records" key. The document id stays "jails", the base directory name.

Tests

  • The test itself. It isn't in a CI lane; cuttlefish runs it with cargo test -p openhuman --lib and product features.

Summary by CodeRabbit

  • Tests
    • Updated import test coverage to use documents with a top-level records structure. Expected results continue to preserve the records key and its existing fields. This change updates validation scenarios only; it does not alter user-facing import behavior.

…dex shape

The jail registry's index.json keys its records under "records"
(tinybox-jail `Index { records }`), and `tinybox_bus::storage::jail_index::
to_body` converts the seconds fields of exactly those records to the
body's millisecond fields. The fixture used a "jails" key, so to_body had
no records to convert and the stored body kept created_at_unix and
updated_at_unix while the assertion expected created_ms and updated_ms.
The importer is correct; the fixture is not.
@tinysweeper

tinysweeper Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Reviewed head: ca4b956dcf4719a2145528884df8846f1d2a1f14

Verdict: Ready for maintainer review · Priority: none
Coverage: Reviewed 1 of 1 files.
No actionable findings were reported in the available review results.

Diagnostics and supporting details

Full summary

Pull request purpose (title): test(storage_import): give the tinybox fixture the registry's real index shape. This pull request repairs the failing tinybox storage-import test by correcting its fixture rather than the importer: the legacy index fixture and the expected stored body now key records under "records", matching the registry's real index shape, while the document id stays "jails". Note that the code index is behind this pull request (indexed at 7ac71fc), so retrieved context may be stale.

Review snapshot

Change surface Files Review signal Count
Production 0 Active findings 0
Tests 1 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.

What changed

The fixture constant INDEX and the expected document in the round-trip test are edited from the "jails" key to "records", a two-line, two-file-line change with no broader behavior change. The change is confined to a test file; no input path, new calls, or production behavior is altered.

Features

  • Modified — Legacy tinybox index fixture uses the registry's "records" key: The fixture now mirrors the shape tinybox-jail's registry writes, so the importer's per-record seconds-to-millisecond conversion is exercised as intended instead of finding no records to convert. (crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs)
  • Modified — Expected stored document in the round-trip test matches the new fixture shape: The round-trip assertion now compares against a body keyed under "records", keeping the test aligned with the fixture and the importer's conversion behavior. (crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs async fn the_jail_index_moves_into_one_document_with_the_same_shape() {)

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: The critique lane is answered with no findings: the inline fixture, expected document, and helper that writes the file are mutually consistent, and nothing contradicts the importer's behavior visible in the repository.
  • Lane summary: This change updates the tinybox import test fixtures so the legacy index uses the `records` key instead of `jails`, matching the shape the importer now converts to. The inline fixture, the expected document in the round-trip test, and the helper that writes the file are consistent with each other and with the unchanged assertions in the remaining tests; nothing in the diff contradicts the importer's behavior visible in the repository. No defects found. _The code index is behind this pull request (indexed at `7ac71fc07cdd`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The security lane is answered with no findings; the change is a test-fixture key rename with no input path or new calls.
  • Lane summary: The change only renames the legacy index fixture's top-level key from `jails` to `records`, consistently in the fixture constant and the expected stored body, matching the field rename in the importer. This is a test fixture edit with no input path, no new calls, and no rule violation visible; I found nothing reportable. _The code index is behind this pull request (indexed at `7ac71fc07cdd`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The tests lane is answered with no findings and confirms the assertion still targets the stored document body, so a conversion regression would fail the test.
  • Lane summary: The diff only updates the fixture and the expected document in an existing tinybox import test from the `jails` key to `records`, tracking the module's current index shape. The test still asserts on the stored document body, so a regression in the conversion would fail it. No new branch or behaviour is added, and the test file's name and location follow the repository's `#[path]` sibling-file rule. _The code index is behind this pull request (indexed at `7ac71fc07cdd`), so retrieved context may be out of date._

commits

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

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description lane is answered with no findings: the description accurately states the fixture key change, distinguishes fixture from importer, and notes the document id stays "jails"; the vendored tinybox-bus and tinybox-jail behavior could not be independently verified because those crates are not checked out.
  • Lane summary: The change rewrites the tinybox fixture's index and expected body key from `"jails"` to `"records"`, matching the claimed `{"records": {...}}` shape of the registry index; the description accurately states this, correctly distinguishes fixture from importer, and leaves the document id `"jails"` untouched as the base directory name. I could not independently verify the tinybox-bus `to_body`/`records_mut` behaviour or the tinybox-jail `struct Index` because those vendored crates are not checked out, but nothing in the visible diff contradicts the description. _The code index is behind this pull request (indexed at `7ac71fc07cdd`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.000147
  • Tokens: 114889 input · 2581 output · 29696 cached · 74 embedding
  • Updated: 2026-10-23T20:58:26Z
Head State Pass summary
ca4b956dcf47 ready for maintainer review 0 active finding(s), 0 resolved finding(s) (at 2026-10-23T20:58:26Z)

tinysweeper 0.1.2

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-23T21:00:06.404475Z ca4b956 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 23, 2026 •

Copy link
Copy Markdown
Contributor

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: 239fd2f5-2ce0-4b05-ba28-f9fd53695305
📥 Commits

Reviewing files that changed from the base of the PR and between da6cec5 and ca4b956.

📒 Files selected for processing: 1
  • crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs

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

📝 Walkthrough

The TinyBox storage-import test fixture and its expected stored document now use a top-level records key instead of jails. The record contents remain unchanged.

Changes: TinyBox storage import test

Layer / File(s) Summary
Update import fixture and expected document
crates/openhuman-core/src/modules/storage_import_tinybox_tests.rs
The fixture and expected stored document use the top-level records key. Record contents remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Possibly related PRs

  • tinyhumansai/openhuman#8320: Updates the TinyBox registry pin to contract 2.0, which is related to the records fixture shape in this change.

Suggested reviewers: senamakel

Merge Risk: ⚪ Minimal · up to ca4b9

The focused test-fixture update is mergeable.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. 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 accurately identifies the test fixture update and explains that it now matches the registry's real index shape.
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.
✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the records key,
The test now matches what it sees.
The fields stay just the same,
No changes to their name.
It hops away with tests in tune.

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

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

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 23, 2026
@M3gA-Mind
M3gA-Mind merged commit 6d470a2 into tinyhumansai:main Oct 23, 2026
28 of 33 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