Skip to content

fix(store): derive current-schema column expectations from the applied schema - #283

Open
rodboev wants to merge 4 commits into
kenn-io:mainfrom
rodboev:derive-current-schema-columns
Open

fix(store): derive current-schema column expectations from the applied schema#283
rodboev wants to merge 4 commits into
kenn-io:mainfrom
rodboev:derive-current-schema-columns

Conversation

@rodboev

@rodboev rodboev commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Docbank now derives current-vault column validation from the same embedded schema that creates the vault. Adding a column to one of the six guarded tables no longer requires a second expected-column list, so a fresh vault can reopen without losing the exact layout guard.

The check still rejects foreign columns, and released schema adapters, JSONL cutovers, schema versions, and future-version refusal remain unchanged. Each validation derives the current layout through the SQLite driver used for the vault, so drivers with the same display name cannot reuse another driver's expectations.

@roborev-ci

roborev-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown

roborev: Combined Review (e7d0a2a)

Verdict: One medium-severity cache-keying issue was identified; otherwise, the changes appear sound.

Medium

  • internal/store/upgrade.go:264 — The schema cache is keyed only by driver.Name() and schemaSQL. Custom drivers with the same name but different schema-affecting behavior may incorrectly reuse cached expectations, causing valid vaults to be rejected. Avoid the global cache or include a stable identity/configuration capturing the driver’s behavior.

Reviewers: 2 done | Synthesis: codex, 6s | Total: 4m12s

@rodboev rodboev changed the title Derive current-schema column expectations from the applied schema fix(store): derive current-schema column expectations from the applied schema Sep 4, 2026
@rodboev
rodboev force-pushed the derive-current-schema-columns branch from e7d0a2a to 86f3888 Compare September 4, 2026 22:28
@roborev-ci

roborev-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown

roborev: Combined Review (86f3888)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 3m47s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant