T-SS60-vault-config-note-export-fields
State: planning/draft · Impact: medium · Complexity: small
Give the vault export the configuration surface
D-PVNF-pumice-vault-note-format needs, additively, so every later task
reads one struct. Retire the whole-file Tera template in favour of a
body-only body_template. Fix two stale comments found in the survey.
| Location | Role today |
|---|---|
apps/pumice/crates/pumice-config/src/vault.rs | VaultConfig { enabled, vault_path, template }; enabled is written by set_path and read nowhere |
apps/pumice/crates/pumice-config/src/defaults.rs | seeds template from pumice::vault::DEFAULT_TEMPLATE |
apps/pumice/crates/pumice/src/vault.rs | SessionData carries title; DEFAULT_TEMPLATE quotes profile and title through a yaml_str Tera filter, so two default spellings exist in the wild |
apps/pumice/src-tauri/tests/config_upgrades.rs | fixture-driven upgrade regression; asserts the three vault fields |
apps/pumice/src-tauri/src/store/hooks/timer_session.rs | doc comment references a deleted resolve_journal |
apps/pumice/src-tauri/src/runner/mod.rs | HandlerCtx doc names a handler that does not exist |
Proposed
Section titled “Proposed”VaultConfig carries every field in the decision’s config table with #[serde(default)] and the
stated defaults, including write_mode, properties (rows of key, value, as_text, enabled,
defaulting to the decision’s frontmatter table), tags_enabled, cssclasses_enabled and
entry_template. template deserializes but is not serialized; at upgrade a body-only remnant
becomes body_template and a template_migrated_notice: bool is set for the UI. AppConfig stays
at V1. A new fixture proves an old config with a custom template loads and migrates.
Approach
Section titled “Approach”- Add the fields and a
VaultFlavorandTrackerBlockenum tovault.rs; derivespecta::Typeandschemars::JsonSchemawhere sibling config types do. - Add
DEFAULT_BODY_TEMPLATEtopumice-config(the crate that owns the default, socrates/pumicecan losevault.rslater without a cycle). - Implement the one-shot
templatemigration inAppConfigV1’s upgrade path with a unit test. Atemplateequal to either shippedDEFAULT_TEMPLATEspelling is dropped without notice; anything else is the remnant that migrates. The default body includes{{title}}. - Add
05-custom-tera-template-v1.jsonundertests/fixtures/configs/and assertions inconfig_upgrades.rs. - Rewrite the two stale comments.
| Area | Note |
|---|---|
apps/pumice/crates/pumice-config/src/vault.rs | new fields, enums, migration hook |
apps/pumice/crates/pumice-config/src/defaults.rs | new defaults |
apps/pumice/src-tauri/tests/config_upgrades.rs | new fixture + assertions |
apps/pumice/src-tauri/tests/fixtures/configs/ | one new fixture |
apps/pumice/src-tauri/src/store/hooks/timer_session.rs | comment |
apps/pumice/src-tauri/src/runner/mod.rs | comment |
Acceptance criteria
Section titled “Acceptance criteria”-
cargo test -p pumice-configand theconfig_upgradessuite pass with the new fixture. -
propertiesholding a row whose value names a token the build does not know loads without error; the row renders empty and is omitted. - A config saved by the current build round-trips without
templatein the JSON. -
moon run pumice:checkis green.
Out of scope
Section titled “Out of scope”- Reading the new fields anywhere: the writer (T-C4B1-vault-writer-task-exports-sessions) and the ops (T-985N-vault-ontogen-ops) consume them.
- Deleting
crates/pumice/src/vault.rsor theteradependency; that lands with the writer. - An
AppConfig::V2; every field is additive.