|
| 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) |
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)
| 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.