|
oc_chat
|
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) |
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)
|
protected |
|
protected |
| RoadmapAuditResult oc_chat.registry.roadmap.audit.audit_corpus | ( | Registry | registry, |
| str | Path | roadmap_dir, | ||
| * | , | ||
| str | None | version_id = None ) |
| 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.
| 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.