Skip to content

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.

LocationRole today
apps/pumice/crates/pumice-config/src/vault.rsVaultConfig { enabled, vault_path, template }; enabled is written by set_path and read nowhere
apps/pumice/crates/pumice-config/src/defaults.rsseeds template from pumice::vault::DEFAULT_TEMPLATE
apps/pumice/crates/pumice/src/vault.rsSessionData 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.rsfixture-driven upgrade regression; asserts the three vault fields
apps/pumice/src-tauri/src/store/hooks/timer_session.rsdoc comment references a deleted resolve_journal
apps/pumice/src-tauri/src/runner/mod.rsHandlerCtx doc names a handler that does not exist

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.

  1. Add the fields and a VaultFlavor and TrackerBlock enum to vault.rs; derive specta::Type and schemars::JsonSchema where sibling config types do.
  2. Add DEFAULT_BODY_TEMPLATE to pumice-config (the crate that owns the default, so crates/pumice can lose vault.rs later without a cycle).
  3. Implement the one-shot template migration in AppConfigV1’s upgrade path with a unit test. A template equal to either shipped DEFAULT_TEMPLATE spelling is dropped without notice; anything else is the remnant that migrates. The default body includes {{title}}.
  4. Add 05-custom-tera-template-v1.json under tests/fixtures/configs/ and assertions in config_upgrades.rs.
  5. Rewrite the two stale comments.
AreaNote
apps/pumice/crates/pumice-config/src/vault.rsnew fields, enums, migration hook
apps/pumice/crates/pumice-config/src/defaults.rsnew defaults
apps/pumice/src-tauri/tests/config_upgrades.rsnew fixture + assertions
apps/pumice/src-tauri/tests/fixtures/configs/one new fixture
apps/pumice/src-tauri/src/store/hooks/timer_session.rscomment
apps/pumice/src-tauri/src/runner/mod.rscomment
  • cargo test -p pumice-config and the config_upgrades suite pass with the new fixture.
  • properties holding 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 template in the JSON.
  • moon run pumice:check is green.

← Back to Tasks