#2614

sqlite stores: state the rules the node-local stores share once

Openac-pplxwants to merge intofrom

Summary

Seven store crates each own one node service's SQLite database, and each has an instruction file. Most of each file was rules written out again with only the service name swapped, and the copies had drifted: the database migrator was described three ways, and the exception to "no public rusqlite value" differed from file to file.

This change states the shared rules once, in a new reference in the data-store skill, .agents/plugins/pplx-space/skills/space-data-store-development/references/node-local-sqlite-stores.md, and leaves each store's file with what is true of that store alone. Each file opens with the public-surface rule in one sentence and a pointer to the reference, so that rule is still loaded with the file. The skill's SKILL.md points to the reference. .coderabbit.yaml gives the reference to reviewers for the seven store directories, which until now got these rules from the stores' own files.

The reference's nine rules:

RuleWas inWhat changes
Outside tests a service opens, migrates and queries its database only through its storeall sevenone wording
The database migrator also opens each database, to apply, revert, reset or report its migrations; which migrations it embeds and which it takes from a storeall seven, in three wordingsone wording
Tests may seed and inspect the database directlyall sevenone sentence; the old text restated archcheck's dependency check crate by crate
Outside test-support no public item returns, exposes or re-exports a rusqlite connection, transaction, statement, row or error; the exception is the errors FromSql and ToSql impls return by designall seven; the exception differedsee below
Callers name the store's own handle types and its Error; Error keeps rusqlite's Display and sourcehandle types in six, Display and source in fourstated for all seven; it is true of each store's Error
No sqlx type in the public surface, except the migration catalognonenew; see below
Additions arrive with their first callersixSKILL.md says it for verbs and record columns. The reference extends it to handle methods, constructors, worker methods and re-exports, as the six files did; it is new for sandbox-manager
The service reaches the job queue's worker only through the store's JobWorker; never re-export BackgroundWorkerthe five stores with a jobs tableone wording
Which job items a jobs module may re-exportfourone wording; "that the service names" is now explicit for runtime-manager

What each store file keeps, word for word: database::open's settings and how the service shares the connection, and its own rules for transactions, read paths, state writes, child tables and fixtures. Each also keeps its tables, its db/ directories and how the migrator gets its migrations, in a shorter sentence. The four stores whose migrations the migrator copies (node-ctl, node-manager, template-manager, volume-manager) keep "a change to how this crate migrates the database needs the same change there". The runtime-manager file gains the db/ directories it never named.

What the store files drop, with no copy in the reference: "not the control-plane Postgres"; each crate's list of the dependencies archcheck's storage_access keeps out (ARCHITECTURE.toml has it); each store's list of its handle type names and the name of its worker factory.

Wording that changes for one store, and why:

  • sandbox-manager's exception named only FromSql errors. Its JobWorker returns JobId, which implements ToSql as well, so the shared wording is the accurate one.
  • The node-ctl, node-manager and runtime-manager files named no exception; runtime-manager returns JobId too.
  • The skill's SKILL.md allows no sqlx type in a store's public surface. Five of these stores have a public migration catalog (sqlx::migrate::Migrator) for the database migrator and for tests that build a schema. The reference names it as the existing exception, not precedent.
  • The sandbox-manager file drops a narrated history of one column and shortens its restatement of a CI check to a pointer. Its state-write, cleanup-state and child-table rules are untouched.

Citations of the old files. Five jobs modules said "As this crate's AGENTS.md says" about the job-worker rule; they now cite the reference. Six crate docs, and crates/l40_api/volmgr/server/AGENTS.md, said the store's file "states", "lists" or "has" the rules and now say it "points to" them. The sandbox-manager store's crate doc said it is "the only code that opens, migrates or queries that database"; it now names the database migrator, as its instruction file has since #2536. The skill's README said agent instructions are limited to SKILL.md; it now names references/ too. No other code changes.

The seven files go from 15,915 to 10,478 bytes; the reference is 2,629. The largest chain among them, sandbox-manager's, goes from 17,774 to 17,142 bytes.

Validation

Documentation, doc comments and one review-configuration entry. Each rule in the reference was compared with the seven old texts and checked against the code at this head: the migrator's subcommands and migration sources in crates/l30_storage/db/migrate/src/lib.rs, each store's Error type and jobs module, and the public Migrator statics. .coderabbit.yaml still parses and the new entry names the seven store directories; how CodeRabbit applies it shows only on a later pull request. CI on this head.

The Kind smoke runs in Pull CI for this change, because ci/kind-pull-paths.txt selects crates/l30_storage/**. No behaviour changes: the Rust edits are doc comments.

Severity and risk

Severity: does not apply.

Risk: instruction text, doc comments and one entry in .coderabbit.yaml, which a person approves. Reverting the commit restores the old files.

Local review: round 1 (Codex + Claude), READY after fixes.

AI assistance: Claude Code drafted the edits and this description, and checked each rule against the old text and the code.

Activity

5
coderabbitai[bot]19h ago

Automatic approval withheld

Automatic approval is disabled by the configured approval policy for this pull request. Review comments and requests for changes continue normally.

Commit: 0a5689ff141d.

No actionable comments were generated in the recent review.

Walkthrough

Adds a shared reference for node-local SQLite store development and directs contributors to read it. Updates store-specific guidance and crate documentation across several storage services. The CodeRabbit configuration applies the reference to listed storage-store directories.

Possibly related PRs

  • perplexityai/SPACE#2192: Moves node-manager’s SQLite connection, transaction, and error types into its store crate, matching the public API rules documented here.
  • perplexityai/SPACE#2161: Moves runtime-manager’s connection, error, and job-worker types into its store crate, matching the documented job-queue boundary.
  • perplexityai/SPACE#2185: Moves node-ctl’s connection, transaction, shared connection, and error types into its store crate, matching the documented store-owned API contract.
Merge Risk: Minimal · up to 0a568

This PR consolidates shared SQLite store guidance into one reference and repoints documentation to it. It does not change runtime behavior, so merge risk is minimal.

Architecture risk: Low · up to 0a568

Authoritative cross-store SQLite guidance moved from individual store instructions into a shared reference, while local guidance and review matching now route readers to it.

Changed areas: crates

Review details

Systems and components

  • observed — 20 changed files mapped to crates.
Pre-merge checks: 7

Check nameStatusExplanation
Title checkThe title "sqlite stores: state the rules the node-local stores share once" uses the required lowercase area prefix followed by a colon, and the summary starts with a lowercase word. It matches the PR…
Description Follows The Pr TemplateThe PR description (PR #2614, author login ac-pplx) contains all four required items with real content: 1. "## Summary" is present. It states that the change moves shared rules for seven node-loca…
Bug Fixes Name A Regression TestThe check applies only when the PR fixes a defect in application behavior under crates/, shim/, or ui/. This PR does not fix a defect. - The PR description and objectives state that the change consoli…
Weakened Safeguards Are JustifiedThe PR changes documentation only. No test, assertion, lint, CI step, allowlist, baseline, nextest, deny/clippy, ARCHITECTURE.toml, or ci/*-paths file changed. Every changed .rs line is a doc commen…
Agent Tooling Runs No New CommandsNo change in this PR adds an agent-run command, server, or hook. Evidence: - Changed files: 23 files. Only one agent-facing file is a skill file, SKILL.md, plus a new reference file and a README. No p…
External Code Sources Need A PersonThe check fails only when the diff adds or changes where external code comes from. I reviewed the full changed-file list for PR #2614 (base refs/coderabbit/pre-merge-check/base, head `refs/coderabbi…
Public-Safe ContentChecked the full added-line set of the PR range (179 added lines across 23 files, including .coderabbit.yaml) and the title and description. The scan found none of the listed sensitive categories: -…
Full details: Title check

Explanation

The title "sqlite stores: state the rules the node-local stores share once" uses the required lowercase area prefix followed by a colon, and the summary starts with a lowercase word. It matches the PR, which consolidates shared rules for seven node-local SQLite stores into one reference. No trailing period, ticket ID, or internal link is present.

Full details: Description Follows The Pr Template

Explanation

The PR description (PR #2614, author login ac-pplx) contains all four required items with real content: 1. "## Summary" is present. It states that the change moves shared rules for seven node-local SQLite stores into one new reference, and that each store file keeps only its own rules. 2. "## Validation" is present. It names what was checked: the reference rules were compared with the old texts and the code, .coderabbit.yaml was checked for parsing, and "CI on this head" is stated. 3. "## Severity and risk" is present. It gives "Severity: does not apply." and a risk: "instruction text, doc comments and one entry in .coderabbit.yaml, which a person approves." 4. "AI assistance:" line is present. It names Claude Code and the parts it drafted: "Claude Code drafted the edits and this description, and checked each rule against the old text and the code." The check judges presence only, so the quality of the content is not assessed. No item is missing or empty. No code evidence was needed for this check.

Full details: Bug Fixes Name A Regression Test

Explanation

The check applies only when the PR fixes a defect in application behavior under crates/, shim/, or ui/. This PR does not fix a defect. - The PR description and objectives state that the change consolidates instruction text and doc comments. The author also states "No behaviour changes." - The changed-file inventory covers instruction files (AGENTS.md, SKILL.md, README.md, a new reference markdown), .coderabbit.yaml, and .rs files under crates/l30_storage/. - I checked every changed .rs line in the diff. Each added or removed line is a doc comment (//!, ///, or //) or a blank line. No executable Rust code changed. Because the PR is not an application bug fix, the regression-test requirement does not apply.

Full details: Weakened Safeguards Are Justified

Explanation

The PR changes documentation only. No test, assertion, lint, CI step, allowlist, baseline, nextest, deny/clippy, ARCHITECTURE.toml, or ci/*-paths file changed. Every changed .rs line is a doc comment, so no #[allow]/#[expect] was added. The check therefore turns on whether rules in AGENTS.md files and the .agents/ skill were weakened. Rules were moved, not dropped. The new references/node-local-sqlite-stores.md states them for all seven stores: - The public-surface rule. - Migrator ownership and dev-dependency test access. - The first-caller rule, extended to handle methods, constructors, worker methods and re-exports. - The job-worker rule, including "never re-export BackgroundWorker". - The re-export limits for the build, runtime, template and volume jobs modules. Dropped text that describes enforced guards (ARCHITECTURE.toml storage_access, the run_sbxmgr_production_checks CI script) still exists unchanged. Three points widen an exception. Each has a reason in the PR description: 1. The sqlx exception. SKILL.md still says "No sqlx type in a store's public signatures". The reference now excepts sqlx::migrate::Migrator for five stores. The description says it documents existing practice, "not precedent". 2. sandbox-manager's exception changes from FromSqlError to FromSql/ToSql. The description gives the reason: its JobWorker returns JobId, which implements ToSql. 3. node-ctl and node-manager gain the FromSql/ToSql exception. They named no exception before. The description gives only the shared-wording reason for these two stores. This is the thinnest justification. No changed guideline text describes how reviews, merge-risk ratings, or approvals treat a change. The .coderabbit.yaml change only adds a knowledge-base entry for the reference, applied to the seven store paths. It does not weaken any review rule. Overall, every loosening has a stated reason in the description. The check passes. Item 3 is the best candidate for a follow-up wording review, but it does not meet a failure condition.

Full details: Agent Tooling Runs No New Commands

Explanation

No change in this PR adds an agent-run command, server, or hook. Evidence: - Changed files: 23 files. Only one agent-facing file is a skill file, SKILL.md, plus a new reference file and a README. No plugin.json, plugin.yaml, MCP, LSP, or hooks file changed (checked by filename). - SKILL.md: the only change is a 3-line prose addition in the body, at lines 19-21 of the diff (a sentence that links to references/node-local-sqlite-stores.md). The frontmatter (name, description) is unchanged. - Inline shell substitution: no added line contains ! followed by a backtick. The new sql!-style Rust macro references in the Rust doc comments are not substitutions anyway. - Added content in the new reference and AGENTS.md files is prose and rule text. No fenced code block contains a command that agent tools run. - .coderabbit.yaml adds a knowledge_base.code_guidelines entry (files and applyTo paths). This is review configuration. It does not run a command or start a server. No check failure condition is met.

Full details: External Code Sources Need A Person

Explanation

The check fails only when the diff adds or changes where external code comes from. I reviewed the full changed-file list for PR #2614 (base refs/coderabbit/pre-merge-check/base, head refs/coderabbit/pre-merge-check/head). - The PR changes 23 files: Markdown guidance (AGENTS.md, SKILL.md, README, a new reference file), Rust doc comments in src/lib.rs and src/jobs.rs files, and one .coderabbit.yaml entry. No file is a Cargo.toml, Cargo.lock, Dockerfile, Helm Chart.yaml/Chart.lock, or download script. - I searched the added lines for dependency source keys (git, rev, branch, tag, registry, path), [patch]/[replace], FROM, image:, curl/wget, checksums, digests, and chart keys. Every hit was English prose (for example, "from those stores" or "from their own copy"). None changes a dependency source, image reference, download, or chart. - The .coderabbit.yaml change adds a knowledge_base filePatterns entry that points reviewers to the new reference file. It does not add an external code source. No item in the custom check applies, so the check passes.

Full details: Public-Safe Content

Explanation

Checked the full added-line set of the PR range (179 added lines across 23 files, including .coderabbit.yaml) and the title and description. The scan found none of the listed sensitive categories: - No credentials, tokens, keys, or secret-looking values. - No URLs or links to private trackers, chats, or documents. The description links only to the repository's own files and to PR #2614 and #2536 by number. - No cloud account IDs or ARNs. - No personal workstation paths such as /Users/ or /home/. - No cluster or environment names, production logs, measurements, or incident details. - No security vulnerability description. - No "Created with" line, so the AI-credit exemption is not needed. One keyword hit needed a check. Line 402 of the crates/l30_storage/sbx/mgr/store/AGENTS.md diff names the CI check run_sbxmgr_production_checks in ci/scripts/run-rust-checks.sh. This is a CI function name, not a production log, measurement, or environment name, so it does not trigger the check. The description's mentions of "Kind smoke runs" and "Pull CI" are generic CI references with no internal hostnames.

Recent review info

Automatic approval policy

Commit: 0a5689ff141d.

SettingEffective valueSource
Automatic approvalsDisabledOverride 1, Override 3
Merge riskModerateGlobal configuration
Security riskNot setGlobal configuration

Matching overrides (numbered as in the resolved configuration):

  • Override 1 — any author; paths: .coderabbit.yaml, .coderabbit.yml, coderabbit.yaml, coderabbit.yml, .coderabbit.config.ts; automatic approvals: disabled.
  • Override 3 — any author; paths: .coderabbit.yaml, .coderabbit.yml, coderabbit.yaml, coderabbit.yml, .coderabbit.config.ts, .github/**, ci/scripts/ci-image.sh, ci/scripts/mirror-images.sh, ci/scripts/lib/test-deps.sh, ci/scripts/run-space-bundle-builds.py, ci/scripts/ensure-uv.sh, ci/scripts/tfswitch-lite.sh, ci/scripts/notify-main-ci-failure.sh, templates/firecracker/kernel/ci.sh, ci/Dockerfile.ci, ci/mirrored-images.txt, ci/scripts/pull-ci-reuse.py, .claude/settings*.json, **/.mcp.json, **/hooks.json, .agents/plugins/**/hooks/**, .agents/plugins/**/scripts/**, .agents/plugins/**/commands/**, .agents/plugins/**/agents/**, **/skills/**/hooks/**, **/skills/**/scripts/**, **/skills/**/commands/**, **/skills/**/agents/**, .claude/commands/**, .claude/agents/**, **/marketplace.json, .pre-commit-config.yaml, lefthook.yaml, .cargo/**, rust-toolchain.toml, supply-chain/**, **/pyproject.toml, **/uv.lock, **/package.json, **/package-lock.json, **/go.mod, **/go.sum, **/requirements*.txt, **/requirements*.in, db/**, !db/README.md, proto/**, docs/versioning.md, ci/guest-update-required-since, crates/l40_api/api/src/auth.rs, crates/l40_api/api/src/auth/**, crates/l40_api/api/src/middleware/auth*, crates/l40_api/api/src/middleware/auth/**, crates/l40_api/api/src/routes/authz.rs, crates/l10_foundation/bearer/**, crates/l10_foundation/rustls/**, crates/l10_foundation/guest/**, crates/l10_foundation/pii/**, infra/space/aws/**, infra/space/cluster/**, infra/space/identity/**, infra/space/observability/**, infra/space/packer/**, LICENSE, SECURITY.md; automatic approvals: disabled.

Any matching disabled override withholds approval, regardless of risk. Otherwise, the strictest explicitly set limit wins for each score. Limits omitted by all matching overrides inherit the global configuration.

Not set means no limit was configured after inheritance. Use @coderabbitai configuration to inspect the resolved settings and their sources.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a9358f8d5044e61afe4ab36cf20b338b07fb106e and 0a5689ff141d1a14b7e655a9806711db34bd74c4.

Files selected for processing: 24

  • .agents/plugins/pplx-space/skills/space-data-store-development/README.md
  • .agents/plugins/pplx-space/skills/space-data-store-development/SKILL.md
  • .agents/plugins/pplx-space/skills/space-data-store-development/references/node-local-sqlite-stores.md
  • .coderabbit.yaml
  • crates/l30_storage/build/mgr/store/AGENTS.md
  • crates/l30_storage/build/mgr/store/src/jobs.rs
  • crates/l30_storage/build/mgr/store/src/lib.rs
  • crates/l30_storage/node/ctl/store/AGENTS.md
  • crates/l30_storage/node/ctl/store/src/lib.rs
  • crates/l30_storage/node/mgr/store/AGENTS.md
  • crates/l30_storage/node/mgr/store/src/lib.rs
  • crates/l30_storage/node/runtime/manager/store/AGENTS.md
  • crates/l30_storage/node/runtime/manager/store/src/jobs.rs
  • crates/l30_storage/node/runtime/manager/store/src/lib.rs
  • crates/l30_storage/sbx/mgr/store/AGENTS.md
  • crates/l30_storage/sbx/mgr/store/src/db/jobs.rs
  • crates/l30_storage/sbx/mgr/store/src/lib.rs
  • crates/l30_storage/template/mgr/store/AGENTS.md
  • crates/l30_storage/template/mgr/store/src/jobs.rs
  • crates/l30_storage/template/mgr/store/src/lib.rs
  • crates/l30_storage/volmgr/store/AGENTS.md
  • crates/l30_storage/volmgr/store/src/jobs.rs
  • crates/l30_storage/volmgr/store/src/lib.rs
  • crates/l40_api/volmgr/server/AGENTS.md

Limit details: You’ve used all 10 included reviews currently available. Your 18 included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.

github-actions[bot]19h ago

Thanks for opening this pull request! A SPACE maintainer will take a look.

CONTRIBUTING.md explains how we review outside contributions.

ac-pplx17h ago

@coderabbitai full review

coderabbitai[bot]17h ago
Action performed

Full review finished.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your current included review allowance is based on your included PR review attempts over the past 7 days. Usage-based billing is enabled for your organization, so this review is expected to continue as a usage-based review. Final billing checks, including your spending cap and usage spend policies, run when the review starts. Your next included review will be available in 36 minutes.