Summary
Allow schema field definitions to declare local_only: true, so that field values are stored locally but never synced to peers via delta bundles or snapshots. Each peer sees the same schema but stores their own independent values for local-only fields.
Use Cases
- Personal annotations on shared notes (e.g.
my_notes, my_rating)
- Draft/scratch fields that aren't ready for peers to see
- Private metadata on shared data structures
Rhai Schema Example
schema("SharedDocument", #{
version: 1,
fields: [
#{ name: "content", type: "textarea" },
#{ name: "status", type: "select", options: ["Draft", "Review", "Final"] },
#{ name: "my_notes", type: "textarea", local_only: true },
#{ name: "my_rating", type: "rating", max: 5, local_only: true },
]
});
Design Decisions
- Schema-defined —
local_only: true on a field def. Owner defines it, all peers see the field exists
- Each peer stores their own values — field exists for everyone, values never leave the device
- Sync filtering —
UpdateField ops targeting local-only fields excluded from delta bundles and snapshots. CreateNote ops have local-only field values stripped before sync
- Undo/redo — works normally locally (ops still in local log)
- Export — user chooses whether to include local-only field data (checkbox in export dialog)
- Import — if local-only data is present in archive, import it; if absent, fields start empty
- RBAC interaction — orthogonal. Schema owner defines which fields are local-only; RBAC controls note visibility
Implementation Plan
docs/superpowers/plans/2026-04-29-local-only-fields.md
10 tasks:
- Add
local_only to FieldDefinition + Rhai parsing
- Helper method
is_field_local_only
- Filter
UpdateField ops from operations_since / operations_since_with_verified_by
- Strip local-only fields from
CreateNote ops in sync
- Strip local-only fields from workspace snapshots
- Add
include_local_only option to export (Rust + Tauri command)
- Frontend: TS type + UI indicator on local-only fields
- Frontend: export dialog checkbox for including local-only data
- Update SCRIPTING.md documentation
- Full round-trip integration test
Files Touched
Rust core: schema.rs, sync.rs, export.rs, lib.rs, tests.rs
Tauri: commands/workspace.rs
Frontend: types.ts, InfoPanel.tsx, App.tsx, all 7 locale files
Docs: SCRIPTING.md
Summary
Allow schema field definitions to declare
local_only: true, so that field values are stored locally but never synced to peers via delta bundles or snapshots. Each peer sees the same schema but stores their own independent values for local-only fields.Use Cases
my_notes,my_rating)Rhai Schema Example
Design Decisions
local_only: trueon a field def. Owner defines it, all peers see the field existsUpdateFieldops targeting local-only fields excluded from delta bundles and snapshots.CreateNoteops have local-only field values stripped before syncImplementation Plan
docs/superpowers/plans/2026-04-29-local-only-fields.md10 tasks:
local_onlytoFieldDefinition+ Rhai parsingis_field_local_onlyUpdateFieldops fromoperations_since/operations_since_with_verified_byCreateNoteops in syncinclude_local_onlyoption to export (Rust + Tauri command)Files Touched
Rust core:
schema.rs,sync.rs,export.rs,lib.rs,tests.rsTauri:
commands/workspace.rsFrontend:
types.ts,InfoPanel.tsx,App.tsx, all 7 locale filesDocs:
SCRIPTING.md