oc_chat
Loading...
Searching...
No Matches
verify_142_seed_fidelity Namespace Reference

Classes

class  FidelityResult

Functions

str _sanitize_id (str raw)
set[str] _store_item_ids (Path db_path)
FidelityResult verify (Path roadmap_dir=_DEFAULT_ROADMAP, Path source_dir=_DEFAULT_SOURCE)
int main (list[str]|None argv=None)

Variables

 _DEFAULT_ROADMAP = Path("oc_chat/roadmap")
 _DEFAULT_SOURCE = Path("oc_chat/roadmap/source")

Detailed Description

The one-time seed-fidelity verifier (Plan 142 P1.7, §9 — CI-runnable).

Purpose
-------
Verify the committed ``oc_chat/roadmap/source/**`` seed against the live v3.38
oracle (Registry Source & Storage Spec V0.22 §9): the source is canonical
(``format --check``); ``regenerate`` is deterministic + idempotent (the
byte-stable source->store property — §9.2); the migration is **lossless** (every
v3.38 item_id appears in the regenerated store, modulo the classified dedup —
zero unclassified drops, §9.4); and it quantifies the §5.6 sub-phase promotions
(§9 3c). The render-based 4-tuple (§9.3) + the §9 (1) renderer-diff + (3b)
ordering are operator-staged precursors (flagged, not self-attested).

Run from the worktree root, preferably as ``python -m tools.verify_142_seed_fidelity``
[roadmap_dir] [source_dir]; the direct ``python tools/verify_142_seed_fidelity.py``
also works via the ``sys.path`` bootstrap below.

Responsibilities
----------------
- ``verify(roadmap_dir, source_dir)`` -> a structured result (CI exit 0/1).

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - verification lifecycle
    L3 - per-check results
    L4 - per-record comparison

Contracts
---------
- Read-only over the committed seed; the oracle + regenerated stores are
  worktree-local temporaries; never touches the shared registry.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- tools.seed_142_ingest (ingest_oracle and emit_source - builds the v3.38 oracle store and re-emits it for the promotion and dropped-dependency counts)
- oc_chat.registry.regenerate (imported for the contracts bootstrap it runs)
- oc_chat.registry.regenerate.pipeline (regenerate - rebuilds the store twice for the idempotence check)
- oc_chat.registry.source.canonical (format_source_tree - the canonical-source check in report mode)
- oc_chat.registry.source.scanner (scan_source_tree - lists the committed source records)

Function Documentation

◆ _sanitize_id()

str verify_142_seed_fidelity._sanitize_id ( str raw)
protected

Definition at line 97 of file verify_142_seed_fidelity.py.

Here is the caller graph for this function:

◆ _store_item_ids()

set[str] verify_142_seed_fidelity._store_item_ids ( Path db_path)
protected

Definition at line 103 of file verify_142_seed_fidelity.py.

Here is the caller graph for this function:

◆ main()

int verify_142_seed_fidelity.main ( list[str] | None argv = None)
CI entry point: exit 0 if all gates pass, 1 otherwise.

Definition at line 173 of file verify_142_seed_fidelity.py.

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

◆ verify()

FidelityResult verify_142_seed_fidelity.verify ( Path roadmap_dir = _DEFAULT_ROADMAP,
Path source_dir = _DEFAULT_SOURCE )
Run the §9 CI fidelity checks against the committed seed.

Definition at line 111 of file verify_142_seed_fidelity.py.

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

Variable Documentation

◆ _DEFAULT_ROADMAP

verify_142_seed_fidelity._DEFAULT_ROADMAP = Path("oc_chat/roadmap")
protected

Definition at line 76 of file verify_142_seed_fidelity.py.

◆ _DEFAULT_SOURCE

verify_142_seed_fidelity._DEFAULT_SOURCE = Path("oc_chat/roadmap/source")
protected

Definition at line 77 of file verify_142_seed_fidelity.py.