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

Classes

class  IngestResult

Functions

IngestResult ingest_corpus (Registry registry, str|Path roadmap_dir, *, str|None actor_slot=None, str actor_type="human_operator", bool dry_run=False)
list[Path] _roadmap_files (Path path)
None _upsert_static_metadata (sqlite3.Connection conn, list[ParsedRoadmap] roadmaps, str now)
None _upsert_era (sqlite3.Connection conn, ParsedRoadmap roadmap, str now)
None _upsert_version (sqlite3.Connection conn, ParsedRoadmap roadmap, str status)
None _upsert_track (sqlite3.Connection conn, ParsedTrack track)
None _upsert_phase (sqlite3.Connection conn, ParsedPhase phase, str version_id, str now)
None _upsert_render_section (sqlite3.Connection conn, ParsedRenderSection section, str version_id)
None _upsert_item_tracks (sqlite3.Connection conn, list[ParsedRoadmap] roadmaps, str now)
str _item_action (sqlite3.Connection conn, ParsedItem item)
str _canonical_hash (Mapping[str, object] value)
str _track_code_for_item (ParsedItem item)
int _era_sort_order (str era_id)
SQLiteBackend _sqlite_backend (Registry registry)

Detailed Description

Idempotent ROADMAP corpus ingest into the registry.

Purpose
-------
Populate the roadmap v0.3 registry tables from the on-disk ROADMAP corpus.

Responsibilities
----------------
- Walk and parse the four ROADMAP artifact families.
- Seed static version, phase, track, and render-section metadata.
- Emit roadmap item and dependency operations only for semantic changes.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - ingest lifecycle
    L3 - file and row counts
    L4 - per-record idempotence decisions

Contracts
---------
- Re-running against unchanged inputs creates no new operation_log rows.
- Dry-run reports pending changes without writing registry rows.

Dependencies
------------
- oc_chat.registry.roadmap.parser (markdown parsing)
- oc_chat.registry.roadmap.operations (mutating seam helpers)
- oc_chat.registry.api (Registry facade the operations are executed through)
- oc_chat.registry.backends.sqlite (SQLiteBackend connections and transactions for the metadata upserts)
- oc_chat.registry.canonical (canonical JSON for the idempotence hash)
- oc_diagnostics (structured debug logging via _dbg)

Function Documentation

◆ _canonical_hash()

str oc_chat.registry.roadmap.ingest._canonical_hash ( Mapping[str, object] value)
protected

Definition at line 461 of file ingest.py.

Here is the caller graph for this function:

◆ _era_sort_order()

int oc_chat.registry.roadmap.ingest._era_sort_order ( str era_id)
protected

Definition at line 477 of file ingest.py.

Here is the caller graph for this function:

◆ _item_action()

str oc_chat.registry.roadmap.ingest._item_action ( sqlite3.Connection conn,
ParsedItem item )
protected

Definition at line 424 of file ingest.py.

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

◆ _roadmap_files()

list[Path] oc_chat.registry.roadmap.ingest._roadmap_files ( Path path)
protected

Definition at line 231 of file ingest.py.

Here is the caller graph for this function:

◆ _sqlite_backend()

SQLiteBackend oc_chat.registry.roadmap.ingest._sqlite_backend ( Registry registry)
protected

Definition at line 482 of file ingest.py.

Here is the caller graph for this function:

◆ _track_code_for_item()

str oc_chat.registry.roadmap.ingest._track_code_for_item ( ParsedItem item)
protected

Definition at line 467 of file ingest.py.

Here is the caller graph for this function:

◆ _upsert_era()

None oc_chat.registry.roadmap.ingest._upsert_era ( sqlite3.Connection conn,
ParsedRoadmap roadmap,
str now )
protected

Definition at line 271 of file ingest.py.

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

◆ _upsert_item_tracks()

None oc_chat.registry.roadmap.ingest._upsert_item_tracks ( sqlite3.Connection conn,
list[ParsedRoadmap] roadmaps,
str now )
protected

Definition at line 402 of file ingest.py.

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

◆ _upsert_phase()

None oc_chat.registry.roadmap.ingest._upsert_phase ( sqlite3.Connection conn,
ParsedPhase phase,
str version_id,
str now )
protected

Definition at line 332 of file ingest.py.

Here is the caller graph for this function:

◆ _upsert_render_section()

None oc_chat.registry.roadmap.ingest._upsert_render_section ( sqlite3.Connection conn,
ParsedRenderSection section,
str version_id )
protected

Definition at line 375 of file ingest.py.

Here is the caller graph for this function:

◆ _upsert_static_metadata()

None oc_chat.registry.roadmap.ingest._upsert_static_metadata ( sqlite3.Connection conn,
list[ParsedRoadmap] roadmaps,
str now )
protected

Definition at line 241 of file ingest.py.

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

◆ _upsert_track()

None oc_chat.registry.roadmap.ingest._upsert_track ( sqlite3.Connection conn,
ParsedTrack track )
protected

Definition at line 318 of file ingest.py.

Here is the caller graph for this function:

◆ _upsert_version()

None oc_chat.registry.roadmap.ingest._upsert_version ( sqlite3.Connection conn,
ParsedRoadmap roadmap,
str status )
protected

Definition at line 289 of file ingest.py.

Here is the caller graph for this function:

◆ ingest_corpus()

IngestResult oc_chat.registry.roadmap.ingest.ingest_corpus ( Registry registry,
str | Path roadmap_dir,
* ,
str | None actor_slot = None,
str actor_type = "human_operator",
bool dry_run = False )
Parse and ingest every ROADMAP artifact under *roadmap_dir*.

Definition at line 93 of file ingest.py.

Here is the call graph for this function: