oc_chat
Loading...
Searching...
No Matches
seed_142_framing_notes Namespace Reference

Classes

class  FramingReport

Functions

dict[str, tuple[str, str]] parse_framing_sections (str roadmap_text)
FramingReport backfill (Path roadmap_md, Path source_dir)
int _main ()

Variables

tuple _SECTIONS
 _BOUNDARY_RE = re.compile(r"^(# PHASE |## |\*End of )", re.MULTILINE)
 _TRAILING_RULE_RE = re.compile(r"\n*-{3,}\s*$")

Detailed Description

Framing-section -> note records (Plan 142 prose-preservation Phase 3, GATE3 Part 2).

Purpose
-------
Migrate the FIVE roadmap-level framing sections of the legacy
``oc_chat/roadmap/ROADMAP-v3.38.md`` — rationale / decision content that must live
in the registry before cutover — into ``source/notes/<id>.md`` records, mirroring
the Phase-1 changelog-framing pattern (verbatim body, no prose in the renderer):

  ``## Sources Referenced`` · ``## Reconciliation notes`` · ``## Execution Order``
  · ``## Out Of Scope (v3.00)`` · ``## Git Workflow & Version Convention``

Each becomes a ``Note`` record (``id`` + ``title``, §3.5 — EXTENDED-only, never a
``roadmap_items_v3`` row) whose **body is the verbatim section** (heading + content,
trailing ``---`` rule stripped). The EXTENDED render (``render.roadmap.notes``)
emits the bodies as their own sections; the lean ROADMAP stays lean.

No contract change: ``Note`` is a pre-existing P1.1 model; the scanner + pipeline
already classify ``notes/``. Idempotent; canonical-stable.

Responsibilities
----------------
- ``parse_framing_sections`` (slice the 5 ``## `` sections), ``backfill`` (write
  the note records), ``coverage`` (the section -> record map for the audit).

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - seed lifecycle
    L3 - per-section extraction
    L4 - per-record emission

Contracts
---------
- Deterministic; writes only ``source/notes/<id>.md``; never touches the live
  legacy roadmap; every record validates + re-canonicalises.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.regenerate (imported for the contracts bootstrap it runs)
- option_c_registry_contracts (the Note model and SCHEMA_VERSION for each framing note record)
- oc_chat.registry.source.canonical (format_record_text - writes each note's frontmatter and verbatim body)

Function Documentation

◆ _main()

int seed_142_framing_notes._main ( )
protected

Definition at line 127 of file seed_142_framing_notes.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ backfill()

FramingReport seed_142_framing_notes.backfill ( Path roadmap_md,
Path source_dir )
Write each framing section to ``source/notes/<id>.md`` (verbatim body).

Definition at line 108 of file seed_142_framing_notes.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_framing_sections()

dict[str, tuple[str, str]] seed_142_framing_notes.parse_framing_sections ( str roadmap_text)
Return ``{note_id: (title, verbatim_body)}`` for the 5 framing sections.

Definition at line 91 of file seed_142_framing_notes.py.

Here is the caller graph for this function:

Variable Documentation

◆ _BOUNDARY_RE

seed_142_framing_notes._BOUNDARY_RE = re.compile(r"^(# PHASE |## |\*End of )", re.MULTILINE)
protected

Definition at line 81 of file seed_142_framing_notes.py.

◆ _SECTIONS

tuple seed_142_framing_notes._SECTIONS
protected
Initial value:
1= (
2 ("## Sources Referenced", "sources-referenced"),
3 ("## Reconciliation notes", "reconciliation-notes"),
4 ("## Execution Order", "execution-order"),
5 ("## Out Of Scope", "out-of-scope"),
6 ("## Git Workflow", "git-workflow"),
7)

Definition at line 73 of file seed_142_framing_notes.py.

◆ _TRAILING_RULE_RE

seed_142_framing_notes._TRAILING_RULE_RE = re.compile(r"\n*-{3,}\s*$")
protected

Definition at line 82 of file seed_142_framing_notes.py.