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

Classes

class  ReseedReport

Functions

list[str] segments (str text)
str _iso_date (str segment)
str classify (str segment, int seq)
str _slug (str segment)
ReseedReport reseed (Path changelog_md, Path source_dir)

Variables

str _ERA = "v3"
str _SEPARATOR = "\n\n---\n\n"
 _BUMP_RE = re.compile(r"→\s*v(\d+\.\d{2})\b")
 _SEMVER_RE = re.compile(r"\bv(\d+\.\d+\.\d+)\b")
 _ISO_DATE_RE = re.compile(r"(\d{4}-\d{2}-\d{2})")
str _DEFAULT_DATE = "2026-06-02"

Detailed Description

Full changelog re-seed (byte-faithful): ROADMAP-CHANGELOG-v3.38.md ->
source/changelog/** (Plan 142 prose-preservation Phase 1, §9 completeness).

Purpose
-------
Tile the COMPLETE authoritative changelog (the WHOLE file: preamble + every
``# ▶`` era/section banner + every ``## `` block + the pre-v2.27 historical
tables + the velocity reference + the end note) into one record per top-level
segment, each record **body = the verbatim original slice**. The render
(``changelog._render_verbatim``) concatenates the bodies in ``changelog_seq``
order joined by ``\\n\\n---\\n\\n`` -> byte-identical to the original (modulo only
the generated provenance header). No frontmatter duplication (no junk
``entries``, no re-typed ``notes``) — the body is the single source of visible
prose, so the ``option_c_specs``-class transcription error cannot recur.

Keying (surfaced at the gate): one ``kind: roadmap`` record per segment, ordered
by ``extensions.changelog_seq``; ``version`` = the real ``vN.NN`` for a bumped
round (creates a ``roadmap_versions`` row for the lean/extended render), the real
product SemVer for a ``v0.7.x`` release (no store row), or a synthesized
``v0.0.<seq>`` SemVer for the framing / no-version-bump / summary segments (no
store row, unique). ``era`` = ``v3`` (metadata; the visible era banners live in
the segment bodies, so the renderer needs no era-grouping logic).

Responsibilities
----------------
- ``segments`` (split on the ``---`` rule), ``classify``, ``reseed``, ``coverage``.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - reseed lifecycle
    L3 - per-segment classification
    L4 - per-record emission

Contracts
---------
- Deterministic; never writes outside the source tree's ``changelog/``; every
  record validates; the segment bodies tile the original byte-for-byte.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.regenerate (imported for the contracts bootstrap it runs)
- option_c_registry_contracts (the Version model, SCHEMA_VERSION and ROADMAP_VERSION_RE for each changelog record)
- oc_chat.registry.source.canonical (format_record_text - writes each record's frontmatter and verbatim body)

Function Documentation

◆ _iso_date()

str seed_142_changelog_reseed._iso_date ( str segment)
protected

Definition at line 96 of file seed_142_changelog_reseed.py.

Here is the caller graph for this function:

◆ _slug()

str seed_142_changelog_reseed._slug ( str segment)
protected

Definition at line 115 of file seed_142_changelog_reseed.py.

◆ classify()

str seed_142_changelog_reseed.classify ( str segment,
int seq )
Return the ``version`` for a segment (real vN.NN/SemVer or synthesized).

Definition at line 101 of file seed_142_changelog_reseed.py.

Here is the caller graph for this function:

◆ reseed()

ReseedReport seed_142_changelog_reseed.reseed ( Path changelog_md,
Path source_dir )
Tile the legacy changelog into verbatim ``source/changelog/roadmap/*`` records.

Definition at line 121 of file seed_142_changelog_reseed.py.

Here is the call graph for this function:

◆ segments()

list[str] seed_142_changelog_reseed.segments ( str text)
Split the changelog into top-level segments on the ``---`` horizontal rule.

Every ``---`` in the file separates two top-level sections (preamble, era
banners, ``## `` blocks, the historical/velocity tables, the end note); there
are no ``---`` inside a block, so this tiling is exact + lossless.

Definition at line 85 of file seed_142_changelog_reseed.py.

Here is the caller graph for this function:

Variable Documentation

◆ _BUMP_RE

seed_142_changelog_reseed._BUMP_RE = re.compile(r"→\s*v(\d+\.\d{2})\b")
protected

Definition at line 71 of file seed_142_changelog_reseed.py.

◆ _DEFAULT_DATE

str seed_142_changelog_reseed._DEFAULT_DATE = "2026-06-02"
protected

Definition at line 74 of file seed_142_changelog_reseed.py.

◆ _ERA

str seed_142_changelog_reseed._ERA = "v3"
protected

Definition at line 69 of file seed_142_changelog_reseed.py.

◆ _ISO_DATE_RE

seed_142_changelog_reseed._ISO_DATE_RE = re.compile(r"(\d{4}-\d{2}-\d{2})")
protected

Definition at line 73 of file seed_142_changelog_reseed.py.

◆ _SEMVER_RE

seed_142_changelog_reseed._SEMVER_RE = re.compile(r"\bv(\d+\.\d+\.\d+)\b")
protected

Definition at line 72 of file seed_142_changelog_reseed.py.

◆ _SEPARATOR

str seed_142_changelog_reseed._SEPARATOR = "\n\n---\n\n"
protected

Definition at line 70 of file seed_142_changelog_reseed.py.