oc_chat
Loading...
Searching...
No Matches
oc_chat.registry.roadmap.parser Namespace Reference

Classes

class  RoadmapParseError
class  ParsedPhase
class  ParsedTrack
class  ParsedItem
class  ParsedDependency
class  ParsedRenderSection
class  ParsedRoadmap

Functions

ParsedRoadmap parse_roadmap_file (str|Path path)
str canonical_record_hash (str table, str natural_key, dict[str, object] fields)
str _file_kind (Path path)
str|None _version_id (Path path, str text)
str _era_id (str version_id)
dict[str, str] _header_values (str text)
str _title (str text)
str _fallback_timestamp (str version_id)
tuple[ParsedPhase,...] _parse_phases (str text, str version_id)
tuple[ParsedItem,...] _parse_items (str text, str file_kind, str version_id, tuple[ParsedPhase,...] phases)
tuple[ParsedDependency,...] _parse_dependencies (str text, set[str] item_ids)
tuple[ParsedRenderSection,...] _parse_render_sections (str text, str file_kind)
list[list[str]] _iter_markdown_rows (str text)
bool _is_separator_cell (str cell)
str|None _item_id_from_cells (list[str] cells)
str|None _phase_code_from_cells (list[str] cells)
str|None _cell_after_phase_code (list[str] cells, str code)
str _item_title (list[str] cells, str item_id)
str|None _row_prose (list[str] cells, str item_id, str title)
str _status_from_cells (list[str] cells)
str|None _priority_from_cells (list[str] cells)
bool _looks_status_or_priority (str text)
str|None _phase_for_item (str item_id, set[str] phase_codes)
str _track_kind (str item_id, str file_kind, str|None phase_code)
str|None _parent_phase_code (str code)
str|None _parent_item_id (str item_id)
str _version_target (str version_id)
tuple[int, int] _item_score (ParsedItem item)
str _strip_markdown (str|None value)

Variables

 VERSION_RE = re.compile(r"\b(?:v)?(?P<version>\d+\.\d+)\b")
 H1_RE = re.compile(r"^#\s+(?P<title>.+?)\s*$", re.MULTILINE)
 HEADER_RE = re.compile(r"^\*\*(?P<name>Version|Created|Last updated):\*\*\s*(?P<value>.+?)\s*$")
 PHASE_HEADING_RE
 ITEM_ID_RE
 PHASE_CODE_RE = re.compile(r"^M\d+(?:\.\d+[a-z]?|[a-z])?$|^M11-GATE$")
 FRACTION_RE = re.compile(r"\b\d+\s*/\s*\d+\b")
 PLAN_ID_RE = re.compile(r"\b\d{3}-[A-Za-z0-9][A-Za-z0-9_.-]*\b")
tuple DONE_MARKERS = ("\u2705", "[x]", "done", "complete", "completed", "shipped", "closed")
tuple PROGRESS_MARKERS = ("\U0001f535", "[~]", "in progress", "partial", "started")
tuple BLOCKED_MARKERS = ("\U0001f512", "[!]", "blocked", "gated")
tuple TODO_MARKERS = ("\u2b1c", "[ ]", "todo", "not started")
tuple PRIORITY_MARKERS
tuple DEFAULT_TRACKS

Detailed Description

Markdown parser for ROADMAP registry ingest.

Purpose
-------
Convert the four ROADMAP markdown artifact families into deterministic
records for the registry v0.3 roadmap tables.

Responsibilities
----------------
- Classify roadmap artifact file kinds and versions.
- Extract phases, items, dependencies, tracks, and render-section hints.
- Produce stable semantic hashes for ingest idempotence checks.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - parser lifecycle
    L3 - extracted roadmap records
    L4 - per-row markdown parsing details

Contracts
---------
- Parsing is read-only and never mutates registry or filesystem state.
- Output records are deterministic for identical markdown bytes.

Dependencies
------------
- oc_chat.registry.canonical (stable JSON hashing)
- oc_diagnostics (structured debug logging via _dbg)

Function Documentation

◆ _cell_after_phase_code()

str | None oc_chat.registry.roadmap.parser._cell_after_phase_code ( list[str] cells,
str code )
protected

Definition at line 453 of file parser.py.

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

◆ _era_id()

str oc_chat.registry.roadmap.parser._era_id ( str version_id)
protected

Definition at line 256 of file parser.py.

Here is the caller graph for this function:

◆ _fallback_timestamp()

str oc_chat.registry.roadmap.parser._fallback_timestamp ( str version_id)
protected

Definition at line 277 of file parser.py.

Here is the caller graph for this function:

◆ _file_kind()

str oc_chat.registry.roadmap.parser._file_kind ( Path path)
protected

Definition at line 233 of file parser.py.

Here is the caller graph for this function:

◆ _header_values()

dict[str, str] oc_chat.registry.roadmap.parser._header_values ( str text)
protected

Definition at line 261 of file parser.py.

Here is the caller graph for this function:

◆ _is_separator_cell()

bool oc_chat.registry.roadmap.parser._is_separator_cell ( str cell)
protected

Definition at line 432 of file parser.py.

Here is the caller graph for this function:

◆ _item_id_from_cells()

str | None oc_chat.registry.roadmap.parser._item_id_from_cells ( list[str] cells)
protected

Definition at line 437 of file parser.py.

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

◆ _item_score()

tuple[int, int] oc_chat.registry.roadmap.parser._item_score ( ParsedItem item)
protected

Definition at line 568 of file parser.py.

Here is the caller graph for this function:

◆ _item_title()

str oc_chat.registry.roadmap.parser._item_title ( list[str] cells,
str item_id )
protected

Definition at line 462 of file parser.py.

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

◆ _iter_markdown_rows()

list[list[str]] oc_chat.registry.roadmap.parser._iter_markdown_rows ( str text)
protected

Definition at line 417 of file parser.py.

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

◆ _looks_status_or_priority()

bool oc_chat.registry.roadmap.parser._looks_status_or_priority ( str text)
protected

Definition at line 511 of file parser.py.

Here is the caller graph for this function:

◆ _parent_item_id()

str | None oc_chat.registry.roadmap.parser._parent_item_id ( str item_id)
protected

Definition at line 558 of file parser.py.

Here is the caller graph for this function:

◆ _parent_phase_code()

str | None oc_chat.registry.roadmap.parser._parent_phase_code ( str code)
protected

Definition at line 552 of file parser.py.

Here is the caller graph for this function:

◆ _parse_dependencies()

tuple[ParsedDependency, ...] oc_chat.registry.roadmap.parser._parse_dependencies ( str text,
set[str] item_ids )
protected

Definition at line 358 of file parser.py.

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

◆ _parse_items()

tuple[ParsedItem, ...] oc_chat.registry.roadmap.parser._parse_items ( str text,
str file_kind,
str version_id,
tuple[ParsedPhase, ...] phases )
protected

Definition at line 318 of file parser.py.

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

◆ _parse_phases()

tuple[ParsedPhase, ...] oc_chat.registry.roadmap.parser._parse_phases ( str text,
str version_id )
protected

Definition at line 281 of file parser.py.

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

◆ _parse_render_sections()

tuple[ParsedRenderSection, ...] oc_chat.registry.roadmap.parser._parse_render_sections ( str text,
str file_kind )
protected

Definition at line 378 of file parser.py.

Here is the caller graph for this function:

◆ _phase_code_from_cells()

str | None oc_chat.registry.roadmap.parser._phase_code_from_cells ( list[str] cells)
protected

Definition at line 445 of file parser.py.

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

◆ _phase_for_item()

str | None oc_chat.registry.roadmap.parser._phase_for_item ( str item_id,
set[str] phase_codes )
protected

Definition at line 525 of file parser.py.

Here is the caller graph for this function:

◆ _priority_from_cells()

str | None oc_chat.registry.roadmap.parser._priority_from_cells ( list[str] cells)
protected

Definition at line 503 of file parser.py.

Here is the caller graph for this function:

◆ _row_prose()

str | None oc_chat.registry.roadmap.parser._row_prose ( list[str] cells,
str item_id,
str title )
protected

Definition at line 477 of file parser.py.

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

◆ _status_from_cells()

str oc_chat.registry.roadmap.parser._status_from_cells ( list[str] cells)
protected

Definition at line 488 of file parser.py.

Here is the caller graph for this function:

◆ _strip_markdown()

str oc_chat.registry.roadmap.parser._strip_markdown ( str | None value)
protected

Definition at line 575 of file parser.py.

Here is the caller graph for this function:

◆ _title()

str oc_chat.registry.roadmap.parser._title ( str text)
protected

Definition at line 270 of file parser.py.

Here is the caller graph for this function:

◆ _track_kind()

str oc_chat.registry.roadmap.parser._track_kind ( str item_id,
str file_kind,
str | None phase_code )
protected

Definition at line 540 of file parser.py.

Here is the caller graph for this function:

◆ _version_id()

str | None oc_chat.registry.roadmap.parser._version_id ( Path path,
str text )
protected

Definition at line 246 of file parser.py.

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

◆ _version_target()

str oc_chat.registry.roadmap.parser._version_target ( str version_id)
protected

Definition at line 564 of file parser.py.

Here is the caller graph for this function:

◆ canonical_record_hash()

str oc_chat.registry.roadmap.parser.canonical_record_hash ( str table,
str natural_key,
dict[str, object] fields )
Return the stable ingest hash for one semantic record.

Definition at line 226 of file parser.py.

Here is the caller graph for this function:

◆ parse_roadmap_file()

ParsedRoadmap oc_chat.registry.roadmap.parser.parse_roadmap_file ( str | Path path)
Parse one ROADMAP markdown artifact into normalized records.

Definition at line 190 of file parser.py.

Here is the call graph for this function:

Variable Documentation

◆ BLOCKED_MARKERS

tuple oc_chat.registry.roadmap.parser.BLOCKED_MARKERS = ("\U0001f512", "[!]", "blocked", "gated")

Definition at line 168 of file parser.py.

◆ DEFAULT_TRACKS

tuple oc_chat.registry.roadmap.parser.DEFAULT_TRACKS
Initial value:
1= (
2 ParsedTrack("m_phase", "M-phase delivery", "Active migration-era sequence", 10),
3 ParsedTrack("registry", "Orchestration Registry", "M11 registry track", 20),
4 ParsedTrack("vision", "Vision-track", "AI Software Factory backlog", 30),
5 ParsedTrack("memory", "Memory / context / learning", "Memory backlog", 40),
6 ParsedTrack("undo", "Undo / rollback", "Rollback backlog", 50),
7 ParsedTrack("tooling", "Tooling extensions", "Tooling backlog", 60),
8 ParsedTrack("git_workflow", "Git workflow", "Repository workflow backlog", 70),
9 ParsedTrack("pre_m0_era", "Pre-M0 era", "Historical carried-forward work", 80),
10)

Definition at line 178 of file parser.py.

◆ DONE_MARKERS

tuple oc_chat.registry.roadmap.parser.DONE_MARKERS = ("\u2705", "[x]", "done", "complete", "completed", "shipped", "closed")

Definition at line 166 of file parser.py.

◆ FRACTION_RE

oc_chat.registry.roadmap.parser.FRACTION_RE = re.compile(r"\b\d+\s*/\s*\d+\b")

Definition at line 163 of file parser.py.

◆ H1_RE

oc_chat.registry.roadmap.parser.H1_RE = re.compile(r"^#\s+(?P<title>.+?)\s*$", re.MULTILINE)

Definition at line 143 of file parser.py.

◆ HEADER_RE

oc_chat.registry.roadmap.parser.HEADER_RE = re.compile(r"^\*\*(?P<name>Version|Created|Last updated):\*\*\s*(?P<value>.+?)\s*$")

Definition at line 145 of file parser.py.

◆ ITEM_ID_RE

oc_chat.registry.roadmap.parser.ITEM_ID_RE
Initial value:
1= re.compile(
2 # OCT-LINT: disable=no_hardcoded_secrets reason="Roadmap regex patterns are parser constants, not secrets"
3 r"^(?:"
4 r"M\d+(?:\.\d+(?:\.[a-z0-9]+)?[a-z]?|[a-z])?|"
5 r"M11-GATE|"
6 r"FS-\d+|V\d+|L\d+|U\d+|X\d+|QUEUE-\d+|TUI-R\d+|"
7 r"[A-Z](?:\.\d+[a-z]?| V2|\s+\‍([A-Z]\‍))?|"
8 r"[A-Z]\.\d+[a-z]?(?:-\w+)?|"
9 r"P\.\d+[a-z]?(?:-\w+)?|O\d[a-z]?"
10 r")$"
11)

Definition at line 151 of file parser.py.

◆ PHASE_CODE_RE

oc_chat.registry.roadmap.parser.PHASE_CODE_RE = re.compile(r"^M\d+(?:\.\d+[a-z]?|[a-z])?$|^M11-GATE$")

Definition at line 162 of file parser.py.

◆ PHASE_HEADING_RE

oc_chat.registry.roadmap.parser.PHASE_HEADING_RE
Initial value:
1= re.compile(
2 # OCT-LINT: disable=no_hardcoded_secrets reason="Roadmap regex patterns are parser constants, not secrets"
3 r"^#\s+PHASE\s+(?P<code>M\d+(?:\.\d+[a-z]?|[a-z])?)\s*(?:[-\u2014]\s*(?P<label>.+?))?\s*$",
4 re.IGNORECASE,
5)

Definition at line 146 of file parser.py.

◆ PLAN_ID_RE

oc_chat.registry.roadmap.parser.PLAN_ID_RE = re.compile(r"\b\d{3}-[A-Za-z0-9][A-Za-z0-9_.-]*\b")

Definition at line 164 of file parser.py.

◆ PRIORITY_MARKERS

tuple oc_chat.registry.roadmap.parser.PRIORITY_MARKERS
Initial value:
1= (
2 ("critical", ("\U0001f534", "critical", "urgent")),
3 ("high", ("\U0001f7e0", "high")),
4 ("medium", ("\U0001f7e1", "medium")),
5 ("lower", ("\U0001f7e2", "lower", "low", "nice-to-have")),
6)

Definition at line 171 of file parser.py.

◆ PROGRESS_MARKERS

tuple oc_chat.registry.roadmap.parser.PROGRESS_MARKERS = ("\U0001f535", "[~]", "in progress", "partial", "started")

Definition at line 167 of file parser.py.

◆ TODO_MARKERS

tuple oc_chat.registry.roadmap.parser.TODO_MARKERS = ("\u2b1c", "[ ]", "todo", "not started")

Definition at line 169 of file parser.py.

◆ VERSION_RE

oc_chat.registry.roadmap.parser.VERSION_RE = re.compile(r"\b(?:v)?(?P<version>\d+\.\d+)\b")

Definition at line 142 of file parser.py.