Template Pipeline
Templates define both the structure of a note and the rules it has to follow. Rosetta loads templates from a registry, applies them at workspace or note scope, enforces anchors in the editor, and can save edited variants back to the template library.
Template Sources
| Source | What it contains |
|---|---|
| built in templates | Templates shipped with the app |
| user templates | Templates saved in versioned local storage |
| workspace template | Default template selected for the current workspace session |
| local note template | A local override of the template anchor set |
Apply Order
Template application resolves in this order:
- load the template registry
- choose the workspace default
- open the note
- resolve shared or local template mode
- render anchors and fields
- enforce lock rules
Pipeline Steps
- Select template: load the structure and its anchor and field definitions.
- Bind field values: resolve
SELECT,MULTISELECT, andDYNAMIC_SELECTinputs and insert them at their anchors. - Run agent transforms: agents propose edits against the bound document.
- Validate locked regions: any proposed change that overlaps a locked anchor is dropped before it reaches the review queue.
- Queue pending edits: remaining suggestions wait for the user to accept or reject them.
Global Vs Local Template Modes
| Mode | What it means |
|---|---|
global | The note follows a shared template definition |
local | The note stores its own anchor list and optional custom name |
Local mode is useful when a note needs custom headings but you do not want to change the shared template for every future note.
Template Inference
Rosetta can infer template state from the note content itself. If the note headings match a known template anchor sequence, the app can attach that template state. If headings no longer match, the app can clear or replace the template association.
This keeps template behavior aligned with the actual note text.
Template Editor
The template editor supports two formats:
| Format | What Rosetta stores |
|---|---|
natural | Template content with readable headings |
smartphrase | SmartPhrase content with a reusable trigger |
When you save template edits, Rosetta can:
- overwrite the current template
- save a new template
- store SmartPhrase metadata alongside the template
- save the SmartPhrase into the SmartPhrase registry
Structured Fields
Templates can include field metadata such as:
textselectmultiselectdynamic_select
These fields are rendered by the editor and can be extended while editing a template.
Guardrails
- Agents cannot write to locked regions at any step.
- Required fields are checked at export. You can fill sections in any order.
Promotion Path
Rosetta supports a practical upgrade path:
- start with a shared template
- customize one note locally
- save the local template as a reusable global template later
That is the main reason the app distinguishes between global template state and local note template overrides.