Dependency-direction corrections (Plan 142 prose-preservation Phase 4, GATE4 Part A).
Purpose
-------
The proper render exposed INVERTED ``depends_on`` edges in the P1.7-ingested seed
(a dependent "blocked by" a *later / not-started* predecessor โ chronologically
impossible). This tool FIXES the clearly-inverted edges (each evidence-backed,
see ``tools/142_dependency_direction_audit.md``); the genuinely-ambiguous ones are
left untouched and FLAGGED in the audit for an operator decision.
The final, operator-confirmed edge set (GATE4 direction fixes + the GATE4 ADDENDUM
cleanup bundle). ``FIXES`` re-points ``depends_on``; ``STATUS_FIXES`` corrects a
stale status:
- ``M2.depends_on -> [M1]`` (was [M3,M7.4] inverted; + legacy "M2 Depends on: M1").
- ``M3.depends_on -> [M2]`` RETIRED at Plan 151 T0 (operator M2->M3 gate waiver).
- ``M7.depends_on -> [M2, M5]`` (legacy "M7 Depends on: M2 + M5"; M7.4 nested -> phase-level).
- ``G.4a.depends_on -> []`` + ``G.5a.depends_on -> [G.4a]`` (inverted vs G.5a's prose).
- ``B.depends_on -> []`` ยท ``C.depends_on -> []`` ยท ``M11-GATE.depends_on -> []``
(3 spurious chronologically-impossible edges removed).
- ``M11-GATE.status blocked -> done`` (legacy shows M11-GATE โ
done at Round 24).
Edge ``kind`` stays ``gates`` (``gates``/``blocks`` render identically as a ๐
blocker). No item is added or removed (fidelity preserved); only ``depends_on`` +
the one status are re-pointed. Deterministic + idempotent.
Responsibilities
----------------
- ``apply(source_dir)`` โ load each affected record, re-point ``depends_on``,
re-emit canonically; ``FIXES`` is the declarative edit set.
Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
L2 - fix lifecycle
L3 - per-record edit
L4 - per-edge detail
Contracts
---------
- Deterministic + idempotent; writes only the 5 affected ``source`` records;
never touches the live legacy roadmap; every record re-validates + canonicalises.
Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.regenerate (imported for the contracts bootstrap it runs)
- option_c_registry_contracts (DependencyEdge - the corrected depends_on edges)
- oc_chat.registry.source.canonical (load_record and format_record_text - reads each affected record and re-emits it canonically)
- oc_chat.registry.source.scanner (scan_source_tree - finds the phase and roadmap item records by stem)