Expand description
P6 — the ** Active Comments subtree: human-facing TODO/DONE headings,
one per pulled Google comment, keyed by :COMMENT_ID:.
Under * GDOC_METADATA, this section sits after ** Sync State. Each comment
is a level-3 heading carrying its id, author, date, and anchored section in a
property drawer, plus the quoted document text and any replies in the body.
Three operations back the sync flows:
- parse (
parse_entries) extracts(id, state, section)from existing headings — push readsDONEto resolve in Google; pull reads the known ids to avoid re-inserting. - render/merge (
render_section) appends new comments asTODOheadings. Merge-by-id (A3): existing headings are preserved byte-for-byte and never reordered, so operator notes and clocking survive. - clean (
clean_section) drops theDONEsubtrees and keeps the rest verbatim.
Line scanning is org-block-aware: lines inside a #+begin_…/#+end_…
block (e.g. a quoted snippet that happens to start with ***) are never
mistaken for headings. Parsing is total (EI-4) — non-conforming headings are
skipped, never panicked on.
Structs§
- Comment
Entry - The machine-relevant fields parsed from one comment heading.
- Pending
Reply - An operator-authored reply (
**** REPLYsubheading) under a comment that has not yet been posted to Google.
Enums§
- Comment
State - The TODO/DONE state of a comment heading.
Functions§
- clean_
section - Render the
** Active Commentssubtree with everyDONEcomment subtree removed; non-DONEblocks and any preamble are kept verbatim. - parse_
entries - Parse every comment heading in the
** Active Commentssection ofregion. - pending_
replies - Extract every operator-authored
**** REPLYsubheading from the comments inregion, paired with the id of the comment it answers. - render_
comment - Render a single new comment as a
TODOheading (used by pull-merge). - render_
section - Render the full
** Active Commentssubtree: the heading, the existing body preserved verbatim (A3), then eachnewcomment whose id is not already present appended as aTODOheading.