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

Classes

class  RoadmapDrift
class  RoadmapAuditResult

Functions

RoadmapAuditResult audit_corpus (Registry registry, str|Path roadmap_dir, *, str|None version_id=None)
RoadmapAuditResult verify_roadmap_files_unchanged (Registry registry, str|Path roadmap_dir, *, str|None version_id=None)
RoadmapAuditResult audit_living_set (str|Path db_path, str|Path source_dir, *, str|Path roadmap_dir, str|Path root_dir)
SQLiteBackend _sqlite_backend (Registry registry)
str|None _latest_version (list[Path] files)

Detailed Description

Roadmap registry-vs-markdown audit helpers.

Purpose
-------
Detect drift between registry roadmap state and parsed ROADMAP markdown.

Responsibilities
----------------
- Select the requested or latest roadmap version artifacts.
- Compare parsed item titles and statuses to registry rows.
- Return structured drift entries for CLI and tests.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - audit lifecycle
    L3 - drift summaries
    L4 - per-item comparisons

Contracts
---------
- Audits are read-only and never mutate registry or markdown files.
- Default audits target the latest available roadmap version only.

Dependencies
------------
- oc_chat.registry.roadmap.parser (artifact parsing)
- oc_chat.registry.api (Registry facade whose backend the audit reads)
- oc_chat.registry.backends.sqlite (SQLiteBackend connection for the item lookups)
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.render.roadmap (lazy; render_check for the living-set drift audit)

Function Documentation

◆ _latest_version()

str | None oc_chat.registry.roadmap.audit._latest_version ( list[Path] files)
protected

Definition at line 197 of file audit.py.

Here is the caller graph for this function:

◆ _sqlite_backend()

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

Definition at line 190 of file audit.py.

Here is the caller graph for this function:

◆ audit_corpus()

RoadmapAuditResult oc_chat.registry.roadmap.audit.audit_corpus ( Registry registry,
str | Path roadmap_dir,
* ,
str | None version_id = None )
Compare parsed roadmap markdown against registry item state.

Definition at line 84 of file audit.py.

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

◆ audit_living_set()

RoadmapAuditResult oc_chat.registry.roadmap.audit.audit_living_set ( str | Path db_path,
str | Path source_dir,
* ,
str | Path roadmap_dir,
str | Path root_dir )
Audit the living GeneratedView set for hand-edit drift (Plan 142 P1.6, §6).

Delegates to the render-side ``render --check`` gate (re-render + header parse
+ byte compare); a drifted/hand-edited living file is ``E_ROADMAP_UNTRACKED_EDIT``
(AC §8.8). This is the new round-close drift gate for the un-versioned living
files; the legacy ``audit_corpus`` above stays for historical versioned files.

Definition at line 157 of file audit.py.

◆ verify_roadmap_files_unchanged()

RoadmapAuditResult oc_chat.registry.roadmap.audit.verify_roadmap_files_unchanged ( Registry registry,
str | Path roadmap_dir,
* ,
str | None version_id = None )
Verify on-disk ROADMAP markdown still matches the registry projection.

The activated v0.3 schema records structured roadmap state rather than raw
per-file hashes, so the cutover gate checks the semantic fields the registry
owns: item identity, title, and status.

Definition at line 141 of file audit.py.

Here is the call graph for this function: