Runtime Behavior of MarkdownDataStore

This chapter explains read/write semantics, section selection rules, and metadata access at runtime.

Read Semantics

getFile returns all sections when no selector is provided. When sections is provided, it accepts an array of section names or section indices and returns only matching sections in file order.

getSectionMap returns the same file as a name-to-content object for direct keyed access by section label.

Write Semantics

updateFile upserts section content by section name. replaceFile rewrites the full section set and reindexes headings from 1. appendToFile appends to existing sections and can optionally deduplicate appended lines.

deleteFile deletes selected sections when selectors are provided, or removes the whole markdown file when selectors are omitted.

Metadata and Listing

listFiles returns the current markdown file names (without extension) for a type folder. getFileStats exposes filesystem metadata required for timestamp-based workflows.