oc_chat
Loading...
Searching...
No Matches
oc_chat.registry.regenerate.build Namespace Reference

Functions

tuple[str, str] _edge_parts (Any edge)
None _insert_eras (sqlite3.Connection conn, list eras)
dict[str, int] _insert_tracks (sqlite3.Connection conn, list tracks)
None _insert_versions (sqlite3.Connection conn, list versions, dict derived)
None _insert_item (sqlite3.Connection conn, *, str item_id, str track_kind, Any phase_id, Any parent_item_id, str title, Any prose, str status, Any priority, int sort_order, Any target_version, Any introduced_in_version_id, Any closed_in_version_id, Any superseded_by_item_id, Any successor_item_id, str purpose)
dict[str, int] _insert_phases (sqlite3.Connection conn, list phases)
None _insert_roadmap_items (sqlite3.Connection conn, list items)
None _insert_promoted (sqlite3.Connection conn, list promoted, dict phase_id_by_code)
None _insert_dependencies (sqlite3.Connection conn, list owners)
None _insert_item_tracks (sqlite3.Connection conn, list owners, dict track_id_by_code)
None build_roadmap (sqlite3.Connection conn, dict[str, list] categorized, dict derived_versions)

Variables

str SOURCE_EPOCH = "1970-01-01T00:00:00Z"
str SOURCE_SLOT = "source"

Detailed Description

The source -> RuntimeStore row builder (Plan 142 P1.4, §3.3 fan-outs).

Purpose
-------
Build the worktree-local temp DB by **direct insert** (NOT
``execute_domain_command`` — §5.3.1) from the loaded source models, applying the
§3.3 phase / sub_phase / non-phase / promoted fan-outs, the §3.2 dependency
direction (predecessor->dependent), ``track_codes`` membership, and the Option A
runtime-reference relaxation (``source_round_no`` provenance, ``created_by_slot``
= ``'source'`` placeholder, byte-stable ``created_at``/``updated_at`` sentinels).

Responsibilities
----------------
- ``build_roadmap(conn, loaded, derived_versions)`` — insert every roadmap row.
- Resolve surrogate phase_id / track_id maps for the fan-outs.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - build lifecycle
    L3 - per-entity fan-out
    L4 - per-row insert tracing

Contracts
---------
- Inserts are deterministic + byte-stable (no wall-clock); §3.2-EXCLUDED columns
  use fixed sentinels so they never perturb the logical hash.
- The build assumes step-6 cross-record validation already passed (it is a
  backstop: an unknown track_code raises SRC_BAD_TRACK_CODES).

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- option_c_registry_contracts (DependencyEdge, read for a depends_on entry's predecessor id and kind)
- oc_chat.registry.regenerate.envelope (SRC_BAD_TRACK_CODES error code for the track-code backstop)
- oc_chat.registry.source.errors (SourceValidationError raised on an unknown track code)
- oc_chat.registry.render.roadmap.render_sections (lazy; seed_render_sections seeds the render-section rows)

Function Documentation

◆ _edge_parts()

tuple[str, str] oc_chat.registry.regenerate.build._edge_parts ( Any edge)
protected
Return (predecessor_id, kind) for a ``depends_on`` entry.

Definition at line 65 of file build.py.

Here is the caller graph for this function:

◆ _insert_dependencies()

None oc_chat.registry.regenerate.build._insert_dependencies ( sqlite3.Connection conn,
list owners )
protected
``depends_on`` -> roadmap_item_dependencies(from=predecessor, to=dependent).

Definition at line 215 of file build.py.

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

◆ _insert_eras()

None oc_chat.registry.regenerate.build._insert_eras ( sqlite3.Connection conn,
list eras )
protected

Definition at line 72 of file build.py.

Here is the caller graph for this function:

◆ _insert_item()

None oc_chat.registry.regenerate.build._insert_item ( sqlite3.Connection conn,
* ,
str item_id,
str track_kind,
Any phase_id,
Any parent_item_id,
str title,
Any prose,
str status,
Any priority,
int sort_order,
Any target_version,
Any introduced_in_version_id,
Any closed_in_version_id,
Any superseded_by_item_id,
Any successor_item_id,
str purpose )
protected

Definition at line 114 of file build.py.

Here is the caller graph for this function:

◆ _insert_item_tracks()

None oc_chat.registry.regenerate.build._insert_item_tracks ( sqlite3.Connection conn,
list owners,
dict track_id_by_code )
protected

Definition at line 228 of file build.py.

Here is the caller graph for this function:

◆ _insert_phases()

dict[str, int] oc_chat.registry.regenerate.build._insert_phases ( sqlite3.Connection conn,
list phases )
protected
Phase fan-out: roadmap_phases row + parent m_phase item + sub-item children.

Definition at line 146 of file build.py.

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

◆ _insert_promoted()

None oc_chat.registry.regenerate.build._insert_promoted ( sqlite3.Connection conn,
list promoted,
dict phase_id_by_code )
protected

Definition at line 200 of file build.py.

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

◆ _insert_roadmap_items()

None oc_chat.registry.regenerate.build._insert_roadmap_items ( sqlite3.Connection conn,
list items )
protected

Definition at line 186 of file build.py.

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

◆ _insert_tracks()

dict[str, int] oc_chat.registry.regenerate.build._insert_tracks ( sqlite3.Connection conn,
list tracks )
protected

Definition at line 83 of file build.py.

Here is the caller graph for this function:

◆ _insert_versions()

None oc_chat.registry.regenerate.build._insert_versions ( sqlite3.Connection conn,
list versions,
dict derived )
protected

Definition at line 96 of file build.py.

Here is the caller graph for this function:

◆ build_roadmap()

None oc_chat.registry.regenerate.build.build_roadmap ( sqlite3.Connection conn,
dict[str, list] categorized,
dict derived_versions )
Insert every roadmap row from the categorized source models (§3.3 fan-outs).

``categorized`` keys: ``eras``, ``tracks``, ``versions`` (model lists);
``phases`` (list of (phase, body)); ``items`` (list of (item, body));
``promoted`` (list of (scanned, item, body)).

Definition at line 247 of file build.py.

Here is the call graph for this function:

Variable Documentation

◆ SOURCE_EPOCH

str oc_chat.registry.regenerate.build.SOURCE_EPOCH = "1970-01-01T00:00:00Z"

Definition at line 61 of file build.py.

◆ SOURCE_SLOT

str oc_chat.registry.regenerate.build.SOURCE_SLOT = "source"

Definition at line 62 of file build.py.