Skip to content

template-mgr-store: add a store that owns template-manager's node_dirty_ref_revision - #1429

Merged
ac-pplx merged 1 commit into
mainfrom
ac/template-mgr-store-crate
Nov 5, 2026
Merged

ac-pplx merged 1 commit into
mainfrom
ac/template-mgr-store-crate

Conversation

@ac-pplx

@ac-pplx ac-pplx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds pplx-space-template-mgr-store (crates/l30_storage/template/mgr/store), a storage-layer crate whose [package.metadata.space.state] declares sqlite.template-manager = ["node_dirty_ref_revision"]. archcheck requires every live table to have an owning store, and a new table can't be added to [layers.unowned]. So the migration that creates this counter (#1235) needs the declaration to merge first.

The crate owns only that table; template-manager's other tables stay baselined. It has no functions or SQL yet. Its first statements arrive with their first caller in #1235, which also adds template-manager's dependency and the [rules.layers.store_users] entry.

Validation

At this head:

  • ci/scripts/run-archcheck.sh origin/main "": 0 required. 1 advisory layers.state.pending for the declared table, expected until template-manager: ack node dirty refs by revision so a re-enqueue during a send survives #1235's migration lands.
  • cargo fmt --check, and workspace cargo check and cargo clippy -D warnings with all targets and features: clean.
  • SPACE_CI_REQUIRE_TEST_DEPS=1 cargo nextest run --all-features for this crate, pplx-space-template-mgr and pplx-space-sqlite: 324/326 pass. The two failures are template-mgr's NoCoW tests, which need CI's btrfs fixture (ci/scripts/with-nocow-test-filesystem.sh); the validation host has no btrfs. They were not validated here.

Severity and risk

Severity: does not apply; no runtime change.
Risk: none at runtime, since nothing depends on the crate yet. Roll back by reverting, as long as #1235 has not merged on top.

Stack

  1. template-manager: reverse the next release's node_dirty_ref_revisions migration so its rollback stays image-only #1277
  2. This PR, on template-manager: reverse the next release's node_dirty_ref_revisions migration so its rollback stays image-only #1277
  3. template-manager: ack node dirty refs by revision so a re-enqueue during a send survives #1235, on this PR

Merge in that order.

AI assistance: Claude Code drafted the crate, the commit message and this description.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The workspace now includes the pplx-space-template-mgr-store crate and defines it as a workspace dependency. Its manifest declares SQLite template-manager state. Crate documentation describes node_dirty_ref_revision, its use by node_dirty_refs triggers and acknowledgement, and notes that the crate has no statements. The crate also forbids unsafe code.

Possibly related PRs

  • perplexityai/SPACE#1235: Adds the migration and revision-based outbox reads and acknowledgements to this store.
  • perplexityai/SPACE#1277: Adds rollback metadata and down SQL for the migration that creates the node_dirty_ref_revision table.

Unblocks: 1 PR

Merge Risk: Minimal · up to fa1dc

This registration-only change adds no runtime behavior or merge-blocking risk.

Security architecture risk: Minimal · up to fa1dc

The change registers a dependency-free storage crate without adding executable storage operations or runtime callers. The existing acknowledgement behavior is unchanged; no material security risk was found to be introduced or worsened.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The introduced scope is workspace registration and declared ownership of one node-local SQLite counter. The complete comparison shows no added service caller, external dependency, credential handling, or deployment configuration that would expand runtime exposure.

Security Findings and Attack Paths

  • inferred — The existing worker can delete a newer obligation if the same reference is re-enqueued after selection but before successful acknowledgement, because deletion matches only the reference key. This race predates the PR and is not worsened by registration. The scoped evidence does not establish an attacker-controlled exploit or privilege gain.

Resilience and Maintainability Implications

  • observed — The unchanged worker retains persisted obligations on send failure and retries with backoff. A successful send followed by failed deletion or interruption can result in a repeat send. These recovery paths remain outside the new store; remote endpoint idempotency was not established by this inspection.
Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title does not follow the required format. It starts with "template-mgr-store:", which lowercase area prefix and colon match the rule. The summary after the colon starts with the lowercase word "a…
Description Follows The Pr Template Passed The PR description contains all required sections with real content: “## Summary” explains the change; “## Validation” lists commands and results; “## Severity and risk” states that severity does not …
Bug Fixes Name A Regression Test Passed The pull request is not an application bug fix. Its diff adds a workspace crate, Cargo metadata, lockfile registration, and crate documentation only; it adds no application behavior under crates/, `…
Weakened Safeguards Are Justified Passed The pull request adds a workspace member, a package manifest, metadata, and crate documentation. The diff does not remove, disable, narrow, or weaken tests, assertions, lints, CI checks, or repository…
Public-Safe Content Passed The reviewed diff adds only public package metadata, a crate manifest, and documentation. Added lines contain no credentials, private keys, internal URLs or hostnames, cloud identifiers, personal abso…
Full details: Title check

Explanation

The title does not follow the required format. It starts with "template-mgr-store:", which lowercase area prefix and colon match the rule. The summary after the colon starts with the lowercase word "add". It names the store and the owned counter, node_dirty_ref_revision, which the changeset defines. No trailing period, ticket ID, or link appears. The title meets the area-prefix requirement and describes the main change accurately.

Full details: Description Follows The Pr Template

Explanation

The PR description contains all required sections with real content: “## Summary” explains the change; “## Validation” lists commands and results; “## Severity and risk” states that severity does not apply and gives the runtime risk; and “AI assistance:” identifies Claude Code and the drafted content.

Full details: Bug Fixes Name A Regression Test

Explanation

The pull request is not an application bug fix. Its diff adds a workspace crate, Cargo metadata, lockfile registration, and crate documentation only; it adds no application behavior under crates/, shim/, or ui/. The regression-test requirement does not apply.

Full details: Weakened Safeguards Are Justified

Explanation

The pull request adds a workspace member, a package manifest, metadata, and crate documentation. The diff does not remove, disable, narrow, or weaken tests, assertions, lints, CI checks, or repository guards. The new [lints] workspace = true setting inherits existing workspace lints.

Full details: Public-Safe Content

Explanation

The reviewed diff adds only public package metadata, a crate manifest, and documentation. Added lines contain no credentials, private keys, internal URLs or hostnames, cloud identifiers, personal absolute paths, production data, incident details, or undisclosed vulnerability details. The title and description contain no prohibited sensitive content; issue references are ordinary public references.

Recent review info

Automatic approval policy

Commit: fa1dc7fe43f2.

Setting Effective value Source
Automatic approvals Enabled Global configuration
Merge risk Low Override 2
Security risk Not set Global configuration

Matching overrides (numbered as in the resolved configuration):

  • Override 2 — any author; paths: **, !ui/**; merge risk: Low.

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 a466def and fa1dc7f.

Files ignored due to path filters: 1

  • Cargo.lock is excluded by !**/*.lock, !**/Cargo.lock
Files selected for processing: 3

  • Cargo.toml
  • crates/l30_storage/template/mgr/store/Cargo.toml
  • crates/l30_storage/template/mgr/store/src/lib.rs

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

@github-actions github-actions Bot added the triage:pending Waiting for a maintainer to triage label Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

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

CONTRIBUTING.md explains how we review outside contributions.

@ac-pplx

ac-pplx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Action not completed

Pull request base or head changed.

Base automatically changed from ac/template-mgr-reverse-dirty-ref-revisions to main November 4, 2026 20:08
@ac-pplx
ac-pplx force-pushed the ac/template-mgr-store-crate branch from 57c4020 to bc6dc4a Compare November 4, 2026 20:08
@ac-pplx

ac-pplx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

@CodeRabbit full review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Nov 4, 2026
…ty_ref_revision

template-manager's next migration creates node_dirty_ref_revision, the
node-wide counter its node_dirty_refs triggers stamp onto each enqueued row.
archcheck's table-ownership rule requires every live table to have an owning
store or a [layers.unowned] baseline entry, and a new table may not be
baselined, so that migration needs a store that declares the table first.

Add pplx-space-template-mgr-store under crates/l30_storage/template/mgr/store.
Its [package.metadata.space.state] declares
sqlite.template-manager = ["node_dirty_ref_revision"] and nothing else; the
other template-manager tables stay baselined. The crate has no functions or
SQL yet: its first statements arrive with their first caller, together with
the migration, so template-manager neither depends on it nor is listed in
[rules.layers.store_users] until then.

archcheck reports the declaration as the advisory layers.state.pending
finding until the migration lands, and no required findings.
@ac-pplx
ac-pplx force-pushed the ac/template-mgr-store-crate branch from bc6dc4a to fa1dc7f Compare November 5, 2026 02:04
@github-actions
github-actions Bot dismissed coderabbitai[bot]’s stale review November 5, 2026 02:04

The pull request changed after this approval. CodeRabbit approves again after it reviews the current head.

@ac-pplx

ac-pplx commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@ac-pplx
ac-pplx added this pull request to the merge queue Nov 5, 2026
Merged via the queue into main with commit a88cc8f Nov 5, 2026
26 checks passed
@ac-pplx
ac-pplx deleted the ac/template-mgr-store-crate branch November 5, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:pending Waiting for a maintainer to triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant