The studio activity-rail mode (label 스튜디오 / Studio) is a 7-step authoring
wizard that folds ad-hoc dialogs into one guided flow, backed by the M3 template
and M4 export subsystems. Shipped in Phase 4 W11–W12.
- Source — start from an existing document or a blank draft.
- Template — pick a Hub/workspace template (reuses
src/lib/hubLibrary.ts). - Guideline — attach writing guidelines (multi-select).
- Sections — edit section drafts in Rich or Source mode. Runs a debounced
(350 ms) 개조식 (gaejosik) lint: violations underline via CodeMirror
decorations (source) or a BlockNote
gaejosikLintmark (rich). Dismissals persist under workspace-statecomposer.lintDismissalswith a per-document Studio fallback. - HWP fields — HWPX
{{field}}placeholder map. Legacyhwpx_skilltemplates continue throughtemplate_get_fields/template_fill_hwpx. Hub records withsource: hwp_cli_skillkeep the compatibilityhwpx_template_keyfield, but its value is one of the six released Korean aliases. They resolve only throughhwp new --template, then native slot scan/fill andhwp validate; output is staged and validated before it is published to.maru/studio/filled/. - Export — wraps
export_plan+ the M4 dispatch pipeline (docx / hwpx / pdf with a sha256 manifest; see below). - Package — applies the local body and freezes a version snapshot.
studio_apply_bodyreplaces only the markdown body and preserves the frontmatter bytes exactly.
Per-document Studio state persists at
<workspace>/.maru/studio/<doc-id>/state.json via src-tauri/src/studio/mod.rs:
studio_state_list, studio_state_read, studio_state_save,
studio_state_delete, studio_apply_body. This directory is disposable runtime
data (gitignored) — canonical content stays in the source markdown.
Frontend: src/components/studio/StudioMode.tsx +
src/components/studio/MarkdownSourceEditor.tsx.
Studio Step 6 drives the same pipeline exposed by the export_* Tauri commands
and the command palette (src-tauri/src/export/):
export/manifest.rs—manifest.yamlnext to a<source-stem>.exports/bundle. The manifest is the SSOT for export state and the only place output sha256s live.export/validate.rs— format-specific structure checks (docx / hwpx / pdf) pluskordoc_liteHWPX/form checks.export/dispatch.rs— a single "Export bundle" command drivespending → ready/failedusing deterministic local converters (pandoc,hwpx, LibreOffice-backed PDF fallback). Missing converters, missing outputs, and source-hash drift surface as partial failures rather than silent success.
- Frontmatter byte-identity — every field mutation goes through
src-tauri/src/frontmatter/ops.rs; unrelated fields, comments, ordering, and quoting are preserved. - Provenance —
create_documentemitsmaru:template/maru:business_unit/maru:guidelinesas proper frontmatter (the W5 HTML-comment trailer is deprecated).
Rust: cargo test --lib filters template_fill, kordoc_lite, validate
(and the Studio state module). HWPX slot extraction is exercised against the
bundled 사업계획서_기본.hwpx.