P1: the books keep how they are kept
Settings, conventions (posting templates, approval rules, policies, close steps, calendar, mappings, notes), decisions, open items and entry approvals are journal events (journal format 2). Books that keep their settings never read wanderbooks.toml or config.json; the server and the viewer take the vault key from --vault-key-file instead. books.import_settings moves a settings file in once, exactly as the server reads it. Approval rules, when enforced, gate every posting path. Replay refuses what it can't read as newer, never as corrupt. Lean: a record changes no figure. Mutation on the whole diff: every survivor killed by a test but two equivalent (docs/testing.md). The Company page says a late open item is overdue in words, not colour alone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T3gXMVt7XJPi6ens1or9Dj
This commit is contained in:
1 parent
e60ecc5317
commit
c587593d78
71 files changed
+12249
-461
No files matched your search
@@ -5,7 +5,7 @@
|
||||
//! is the current version.
|
||||
|
||||
/// Current schema version.
|
||||
pub const SCHEMA_VERSION: u32 = 11;
|
||||
pub const SCHEMA_VERSION: u32 = 12;
|
||||
|
||||
/// Migrations, in order. `MIGRATIONS[i]` migrates from version `i` to `i+1`.
|
||||
pub const MIGRATIONS: &[&str] = &[
|
||||
@@ -266,5 +266,62 @@ CREATE TABLE IF NOT EXISTS reconciliation_lines(
|
||||
line_index INTEGER NOT NULL,
|
||||
PRIMARY KEY(reconciliation_id, entry_id, line_index)
|
||||
);
|
||||
"#,
|
||||
r#"
|
||||
-- v12: the books' own record of how they are kept (journal format 2,
|
||||
-- plan/served.md 5.2): settings in force (each value as canonical JSON,
|
||||
-- with the seq and source that set it), conventions (the current
|
||||
-- revision of each, and its retirement), decisions, open items, and
|
||||
-- approvals of draft entries.
|
||||
CREATE TABLE IF NOT EXISTS settings(
|
||||
key TEXT PRIMARY KEY,
|
||||
value_json TEXT NOT NULL,
|
||||
seq INTEGER NOT NULL,
|
||||
source_json TEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS conventions(
|
||||
id TEXT PRIMARY KEY,
|
||||
kind TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
body_md TEXT NOT NULL,
|
||||
structured_json TEXT NULL,
|
||||
source_json TEXT NOT NULL,
|
||||
seq INTEGER NOT NULL,
|
||||
revision INTEGER NOT NULL,
|
||||
retired_reason TEXT NULL,
|
||||
retired_source_json TEXT NULL,
|
||||
retired_seq INTEGER NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS decisions(
|
||||
id INTEGER PRIMARY KEY,
|
||||
subject TEXT NOT NULL,
|
||||
decision_md TEXT NOT NULL,
|
||||
decided_by_json TEXT NOT NULL,
|
||||
decided_on TEXT NOT NULL,
|
||||
evidence_attachment INTEGER NULL,
|
||||
supersedes INTEGER NULL,
|
||||
citation TEXT NULL,
|
||||
seq INTEGER NOT NULL,
|
||||
superseded_by INTEGER NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS open_items(
|
||||
id INTEGER PRIMARY KEY,
|
||||
title TEXT NOT NULL,
|
||||
detail_md TEXT NULL,
|
||||
due TEXT NULL,
|
||||
source_json TEXT NOT NULL,
|
||||
seq INTEGER NOT NULL,
|
||||
resolution TEXT NULL,
|
||||
resolved_source_json TEXT NULL,
|
||||
resolved_seq INTEGER NULL
|
||||
);
|
||||
CREATE TABLE IF NOT EXISTS entry_approvals(
|
||||
seq INTEGER PRIMARY KEY,
|
||||
entry_id INTEGER NOT NULL,
|
||||
approver TEXT NOT NULL,
|
||||
fingerprint TEXT NOT NULL,
|
||||
note TEXT NULL,
|
||||
source_json TEXT NOT NULL
|
||||
);
|
||||
"#,
|
||||
];
|
||||
Reference in new issue
Block a user