0%

Section 11B — Strip Structural Markdown Parsers (Now-Dead Provider)

SUPERSEDED by decisions/05-three-plan-types.md (INV-22, user directive 2026-05-31). The markdown-parser strip is CANCELLED. The structural markdown parsers (read.py md branches, write.py legacy-body writers, content_hash.py md funcs, _frontmatter.py, plan_io.py md surface, checkbox_scan.py) are RETAINED — they serve the permanently-supported legacy-markdown plan type + the json-dynamic grow path. This section’s strip deliverables below are HISTORICAL — do not execute them. JSON-native content surfaces stay as already specified; nothing is deleted.

Cites §01 north star (invariant 9, 18); gated on §10 (corpus uniformly JSON-first) + §11A (skill markdown-walk consumers removed) — the end-stage debt removal. Under v7 (§07A) status left markdown entirely (work_items[].status, engine-written), so the §01 refinement-5 checkbox-scanner carve-out no longer retains a status reader — the v6 scanner is deleted here, not retained.

Goal

See frontmatter. Strip STRUCTURAL parsing; the carve-out specifics:

  • v7 status = work_items[].status (engine-written JSON, read by serve_next), NOT a markdown checkbox scan.
  • The v6 checkbox scanner (scripts/plan_corpus/checkbox_scan.py) is DELETED here, not retained — the §01 refinement-5 line-level-vs-structural carve-out applied to the v6 status scanner and is moot under v7 (status left markdown entirely).
  • JSON-native surfaces (update_sidecar, render --view, get_sidecar) survive.

Ordering — provider after consumer (ABSOLUTE)

  • These plan_corpus markdown parsers are the PROVIDER; the §11A skill markdown-walk was the CONSUMER.
  • §11A removed the consumer first (eager Python imports would otherwise break on a deleted parser); §11B removes the now-dead provider. Linear chain: §10 -> §11A -> §11B -> §12.
  • The success criterion “no structural-markdown-parse call site remains in scripts/plan_orchestrator/” is satisfiable ONLY because §11A already stripped the orchestrator markdown-walk.

11B.1 — Delete read.py + write.py + plan_io.py md-parse surfaces

  • read.py: delete _load_plan_markdown (:355), the format=="markdown" branches in body_text (:163)/raw_frontmatter (:203), legacy_md_path (:148), the elif md_sections: fallback in load_plan (:427+), the md branch in _populate_content_hash_drift (:506).
  • write.py: delete _append_checklist_row_to_section_body (:693, incl. ^#{1,6}\s heading regex) + _locate_section_file (:639); append_finding_checklist_item phase-(b) call. RETAIN update_sidecar + check_item (JSON-native).
  • plan_io.py: delete the md-parse surface (parse_plan/extract_section_info/_parse_frontmatter) once _load_plan_markdown is gone.
  • Delete scripts/plan_corpus/checkbox_scan.py — the §03.2 v6 id-keyed checkbox scanner (the v6 INV-10 SOLE status-derivation path), DEPRECATED by §07A.3 (deprecation marker cites §11B as hard-deletion owner). Obsoleted by v7 work_items[].status (engine-written JSON, read by serve_next) — there is NO retained checkbox status scanner under v7. Deletion gated on §10 (no v6 plan.json relies on the v6 status contract) + §11A (no skill consumer). Grep-verify zero live callers before deleting.
  • Subsection close (11B.1) — all [x]; status: complete.

11B.2 — Delete content_hash.py + _frontmatter.py md funcs

  • content_hash.py: delete compute_section_hash (:174), _split_frontmatter (:58), _strip_excluded_frontmatter (:81), detect_drift (:205), read_recorded_hash (:222), compute_full_section_hash (:248), assert_read_base_fresh (:260) — all designed for .md files; JSON gets flock arbitration via write.py.
  • _frontmatter.py: delete split_frontmatter_strict/lenient + _FRONTMATTER_RE once no production consumer remains (006 retained only as archive-restore).
  • Subsection close (11B.2) — all [x]; status: complete.

11B.3 — Grep-verify + test-all

  • Grep-verify zero structural-parse call sites remain in scripts/plan_corpus/ + scripts/plan_orchestrator/: no split_frontmatter, no ^#{1,6}\s heading regex, no yaml.safe_load on .md, no _load_plan_markdown, no extract_section_info / section_info fragment-builder feeding the next_action payload (INV-18; pairs with §11A.3 orchestrator-side removal).
  • Confirm the v7 status path intact: work_items[].status (engine-written via the §07A.3 work_item status API + serve_next) is the sole status mechanism; the v6 checkbox_scan.py is gone. Confirm JSON-native survivors: render.py --view, read.py:get_sidecar, write.py:update_sidecar.
  • ./test-all.sh green (timeout 150); dead-import sweep clean.
  • Subsection close (11B.3) — all [x]; status: complete.

Absorbed defects (bug-tracker triage 2026-05-26)

Subsumed by §11B.2, which DELETES compute_section_hash (content_hash.py) along with the .md hash funcs — the read_text-vs-STRICT-no-normalization contradiction is moot once the function is gone (JSON gets flock arbitration, no .md hashing). Deliverable MUST resolve; tracker entry closed obe-via-absorb pointing here.

BugSymptom subsumed
BUG-07-125compute_section_hash normalizes body line-endings, contradicting its STRICT no-normalization docstring (function deleted §11B.2) — low-confidence absorb (cheap one-line read_bytes fix if §11B is far off)

11B.R Third Party Review Findings

  • None.

11B.N Completion Checklist

  • 11B.1-11B.3 [x] and status: complete.
  • All success criteria have [x] checkboxes.
  • Grep confirms zero structural-markdown-parse call sites; v6 checkbox_scan.py deleted; v7 work_items[].status is the sole status path.
  • ./test-all.sh green; python -m scripts.plan_corpus check plans/scripts-first-restructure/section-11B-*.md exit 0.
  • /tpr-review passed (final, full-section).

References

  • §11A (strip-skills) — the consumer strip that MUST precede this provider strip.
  • Pass 1C strip list (file:line): read.py :148/:163/:203/:355/:427/:506; write.py :639/:693; content_hash.py :58/:81/:174/:205/:222/:248/:260; _frontmatter.py :42/:47/:77; plan_io.py md surface.
  • §03.2 retained scanner; refinement 5 (structural-vs-line-level carve-out); §01 invariant 9.