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

Namespaces

namespace  _common
namespace  changelog
namespace  exec_order
namespace  notes
namespace  render_sections
namespace  roadmap_main
namespace  sections
namespace  store_read
namespace  todo

Classes

class  CheckResult

Functions

dict[str, str] render_living_set (Path db_path, Path source_dir, *, Optional[str] published=None)
dict[str, Path] artifact_paths (*, Path roadmap_dir, Path root_dir)
list[Path] write_living_set (Path db_path, Path source_dir, *, Path roadmap_dir, Path root_dir, Optional[str] published=None)
list[CheckResult] render_check (Path db_path, Path source_dir, *, Path roadmap_dir, Path root_dir)
Optional[CheckResult] _source_tree_drift (Path db_path, Path source_dir)
CheckResult _check_one (str key, Path path, str renderer, str filename, str fresh)
dict[str, str] render_roadmap_artifacts (*object _args, **object _kwargs)
str artifact_filename (str _kind, str _version_id)

Variables

str E_ROADMAP_UNTRACKED_EDIT = "E_ROADMAP_UNTRACKED_EDIT"
str SOURCE_TREE_KEY = "source_tree"
dict ARTIFACTS
tuple RETIRED_OUTPUTS = ("ROADMAP-TODO.md", "ROADMAP-EXEC-ORDER.md")
tuple ROADMAP_ARTIFACTS = ()

Detailed Description

The living roadmap GeneratedView orchestration (Plan 142 P1.6, §6).

Purpose
-------
Render + atomically write the **living set** — ``ROADMAP.md`` (lean V4),
``ROADMAP-EXTENDED.md`` (comprehensive V3), ``ROADMAP-CHANGELOG.md``, and the
verbatim, content-faithful root ``CHANGELOG.md`` — from the verified authored projection (lean /
EXTENDED) + the ``source/changelog`` records (the two changelogs), each carrying
the §6 generated header. ``render --check`` re-renders, parses the on-disk header
+ compares bytes, and reports a hand-edit as ``E_ROADMAP_UNTRACKED_EDIT`` drift.

Responsibilities
----------------
- ``render_living_set(db_path, source_dir, *, published)`` — render all four
  views (keyed by artifact key) without writing.
- ``write_living_set(...)`` — atomic-write each view to its path.
- ``render_check(...)`` — drift gate (parse header + compare bytes).

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - orchestration lifecycle
    L3 - per-artifact render/write/check
    L4 - drift details

Contracts
---------
- ``ROADMAP-TODO.md`` / ``ROADMAP-EXEC-ORDER.md`` are NOT outputs (AC §8.24);
  the artifact set is exactly the four living files.
- Writes go through the §6 shared atomic writer (crash-safe).

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.render.roadmap.roadmap_main (lean ROADMAP.md renderer)
- oc_chat.registry.render.roadmap.todo (ROADMAP-EXTENDED.md renderer)
- oc_chat.registry.render.roadmap.changelog (changelog record loaders and the two changelog renderers)
- oc_chat.registry.render.roadmap.store_read (verified store open, projection hashes and selected version)
- oc_chat.registry.render.roadmap._common (living-set filenames, renderer ids, atomic writer and header parser)
- oc_chat.registry.render.roadmap.notes (framing-note sections for the EXTENDED view)
- oc_chat.registry.regenerate.verified_projection (stamped source_hash of an authored projection store)
- oc_chat.registry.source.canonical (format gate over the scanned source tree)
- oc_chat.registry.source.hashing (whole-tree source_hash recompute)
- oc_chat.registry.source.scanner (source tree scan for the drift check)

Function Documentation

◆ _check_one()

CheckResult oc_chat.registry.render.roadmap._check_one ( str key,
Path path,
str renderer,
str filename,
str fresh )
protected

Definition at line 249 of file __init__.py.

Here is the caller graph for this function:

◆ _source_tree_drift()

Optional[CheckResult] oc_chat.registry.render.roadmap._source_tree_drift ( Path db_path,
Path source_dir )
protected
R2(b): the stamp-conditional whole-tree ``source_hash`` recompute — the
``render --check`` O(N) slow-path drift detector (plain ``render`` stays O(1)).

Runs only for an ``authored_projection`` store carrying a ``passed`` stamp
(``stamp_source_hash_if_authored``); a stampless legacy live store is skipped
wholesale (returns ``None`` — no false drift, no traceback). Replicates the
``regenerate`` step-1..5 helpers on the same tree: ``scan_source_tree`` →
the format gate (``format_source_tree(check=True)`` — a canonical-equivalent
on-disk byte edit raises ``SRC_NOT_CANONICAL``, surfaced by the N1 CLI
envelope as exit 1, never as hash drift) → canonical ``source_hash`` compared
to the stamp. A canonical-but-changed edit (incl. an [OP-5] promoted-file
edit, now in ``source_hash``) drifts the recomputed hash from the stamp → a
synthesized ``artifact_key='source_tree'`` drift entry, exit 1 through the
existing drift path (no new typed code; not ``E_ROADMAP_UNTRACKED_EDIT``).

Definition at line 209 of file __init__.py.

Here is the caller graph for this function:

◆ artifact_filename()

str oc_chat.registry.render.roadmap.artifact_filename ( str _kind,
str _version_id )
Retired (Plan 142 P1.6) — living views use fixed names (no version stamp).

Definition at line 305 of file __init__.py.

◆ artifact_paths()

dict[str, Path] oc_chat.registry.render.roadmap.artifact_paths ( * ,
Path roadmap_dir,
Path root_dir )
Map each artifact key to its on-disk path (root CHANGELOG at ``root_dir``).

Definition at line 157 of file __init__.py.

Here is the caller graph for this function:

◆ render_check()

list[CheckResult] oc_chat.registry.render.roadmap.render_check ( Path db_path,
Path source_dir,
* ,
Path roadmap_dir,
Path root_dir )
Re-render + compare against the on-disk views; report hand-edit drift.

Definition at line 188 of file __init__.py.

Here is the call graph for this function:

◆ render_living_set()

dict[str, str] oc_chat.registry.render.roadmap.render_living_set ( Path db_path,
Path source_dir,
* ,
Optional[str] published = None )
Render all four living views from the verified projection + source.

Definition at line 121 of file __init__.py.

Here is the caller graph for this function:

◆ render_roadmap_artifacts()

dict[str, str] oc_chat.registry.render.roadmap.render_roadmap_artifacts ( *object _args,
**object _kwargs )
Retired (Plan 142 P1.6) — use ``render_living_set`` / ``oct agent roadmap render``.

Definition at line 297 of file __init__.py.

◆ write_living_set()

list[Path] oc_chat.registry.render.roadmap.write_living_set ( Path db_path,
Path source_dir,
* ,
Path roadmap_dir,
Path root_dir,
Optional[str] published = None )
Atomic-write each living view to its path (the §6 shared writer).

Definition at line 169 of file __init__.py.

Here is the call graph for this function:

Variable Documentation

◆ ARTIFACTS

dict oc_chat.registry.render.roadmap.ARTIFACTS
Initial value:
1= {
2 "roadmap": (LIVING_SET_FILENAMES["roadmap"], RENDERER_LEAN),
3 "roadmap_extended": (LIVING_SET_FILENAMES["roadmap_extended"], RENDERER_EXTENDED),
4 "roadmap_changelog": (LIVING_SET_FILENAMES["roadmap_changelog"], RENDERER_CHANGELOG),
5 "root_changelog": (LIVING_SET_FILENAMES["root_changelog"], RENDERER_ROOT_CHANGELOG),
6}

Definition at line 90 of file __init__.py.

◆ E_ROADMAP_UNTRACKED_EDIT

str oc_chat.registry.render.roadmap.E_ROADMAP_UNTRACKED_EDIT = "E_ROADMAP_UNTRACKED_EDIT"

Definition at line 82 of file __init__.py.

◆ RETIRED_OUTPUTS

tuple oc_chat.registry.render.roadmap.RETIRED_OUTPUTS = ("ROADMAP-TODO.md", "ROADMAP-EXEC-ORDER.md")

Definition at line 98 of file __init__.py.

◆ ROADMAP_ARTIFACTS

tuple oc_chat.registry.render.roadmap.ROADMAP_ARTIFACTS = ()

Definition at line 294 of file __init__.py.

◆ SOURCE_TREE_KEY

str oc_chat.registry.render.roadmap.SOURCE_TREE_KEY = "source_tree"

Definition at line 86 of file __init__.py.