ADR Detail Phase D — PR Table Separation + Lessons/Carryover Callouts

SummaryExecute Phase D split-carried from Sprint 161 — separate PR table from ADR detail prose to block duplication with PhaseStrip cards

Date
ImpactCritical

Key Decisions

sections-level chunk render + in-place callout insertion

traverse body markdown by sections, accumulate prose, flush on lessons/carryover H2 → insert callout wrapper at that position. Zero ordering regression

callout = wrapper, 100% content preservation

discard list-entry transform (sprint chip etc.) as auxiliary value, render lessons/carryover group raw markdown (H2 heading removed + H3 included) as prose inside the wrapper. Zero H2/H3 mixed prose loss

drop terminal check

chunk render's in-place insertion handles ordering, so terminal check is unnecessary. callout shown on all ADRs

tolerant heading matching

CARRYOVER_RE + LESSONS_RE cover KR/EN/numbered prefix (9.)/plus suffix (137+)/variant headings (주요 교훈, Carry-Over Seeds)

PR table strip only within implementation H2

precise table-line removal only when PhaseStrip visualizes phases. Graceful degradation

Goals

  • Execute Phase D split-carried from Sprint 161 — separate PR table from ADR detail prose to block duplication with PhaseStrip cards
  • Visually emphasize lessons/carryover sections via callout boxes (💡 / 📋) — improve visibility of key information previously rendered as plain H2 headings
  • Resolve Sprint 162 Critic R1 P3 carryover: expand Mermaid diagrams in existing ADRs (sprint-157 P1~P10 + hotfix cycle visualization)

Decisions

  • sections-level chunk render + in-place callout insertion: traverse body markdown by sections, accumulate prose, flush on lessons/carryover H2 → insert callout wrapper at that position. Zero ordering regression
  • callout = wrapper, 100% content preservation: discard list-entry transform (sprint chip etc.) as auxiliary value, render lessons/carryover group raw markdown (H2 heading removed + H3 included) as prose inside the wrapper. Zero H2/H3 mixed prose loss
  • drop terminal check: chunk render's in-place insertion handles ordering, so terminal check is unnecessary. callout shown on all ADRs
  • tolerant heading matching: CARRYOVER_RE + LESSONS_RE cover KR/EN/numbered prefix (9.)/plus suffix (137+)/variant headings (주요 교훈, Carry-Over Seeds)
  • PR table strip only within implementation H2: precise table-line removal only when PhaseStrip visualizes phases. Graceful degradation

Implementation (single PR, branch feat/sprint-163-adr-pr-table-callouts, 12 commits)

PhaseOwnerChangesLines
A — PR table strip infra (parser/types)architectparser.ts + types.ts+269 +27
B — Lessons/Carryover extraction + i18narchitectparser.ts + i18n.ts + section-aliases.ts+10 +20
C — callout components + detail-view integrationarchitectnew adr-lessons-callout.tsx + new adr-carryover-callout.tsx + adr-detail-view.tsx+57 +73 +(±)
D — sprint-157 Mermaid diagramarchitectsprint-157.md KR+EN+22 ×2
R1 P2 — EN carryover headingarchitectsection-aliases.ts+20 −4
R2 P2 — terminal check + TOC anchorarchitectparser.ts + 2 callout components + adr-detail-view.tsx+99 −5
R3 P2 — TOC H2 preservation (H3 strip only)architectadr-detail-view.tsx+12 −9
R4 P2/P3 — chunks render + numbered prefixarchitectparser.ts + section-aliases.ts + adr-detail-view.tsx+150 −53
R5 P2 — preamble seedarchitectadr-detail-view.tsx+19
R6 P2 — prose-only H3 preservationarchitectparser.ts + adr-detail-view.tsx+46 −12
R7 P2 — callout to wrapper conversionarchitect2 callouts + adr-detail-view.tsx+78 −118
R8 P2 — plus-suffixed sprint headingarchitectsection-aliases.ts+1 −1
R9 P2 — lessons tolerant matchingarchitectsection-aliases.ts+11

Detailed changes

  1. parser.ts: extractLessons/extractCarryover/buildBodyMarkdownForProse/stripPrTableLines/getCanonicalSectionIndices/isCanonicalTerminal/hasTopLevelListItem added. H3 sub-section unification (collectCanonicalSectionMarkdown), dash + numbered list + em-dash separator recognition
  2. types.ts: AdrLessonEntry / AdrCarryoverEntry / AdrDoc.bodyMarkdownForProse|lessons|carryover fields added
  3. section-aliases.ts: CARRYOVER_RE (numbered/plus/EN/parenthetical) + LESSONS_RE added, numbered prefix normalization
  4. i18n.ts: lessonsTitle/carryoverTitle/carryoverSprintPrefix KR+EN
  5. adr-lessons-callout.tsx new: 💡 + callout-warn tone wrapper, prose-headings/p/li/strong fg color mapping
  6. adr-carryover-callout.tsx new: 📋 + callout-info tone wrapper
  7. adr-detail-view.tsx: introduced renderSectionChunks — preamble seed + sections H2-level chunks + lessons/carryover wrapper in-place + implementation PR table strip + TOC filter
  8. docs/adr/sprints/sprint-157.md + EN: P1~P10 + hotfix cycle flowchart Mermaid added (phase/hotfix/realfix 3-color branch)

Verification

ItemResult
tsc --noEmitclean (0 errors)
npm run build247 pages static export successful
check-adr-links blog/out/adr1246 links 0 broken
check-adr-en-coverage --strict111/111 (100.0%) PASS
Critic R1 (Codex gpt-5)P2 1 EN carryover heading miss → resolved
Critic R2P2 2 TOC out-of-sync + section ordering → resolved
Critic R3P2 1 TOC H2 missing → resolved
Critic R4P2 callout order regression + P3 numbered heading → chunks render + numbered prefix normalization
Critic R5P2 1 preamble drop → seed added
Critic R6P2 1 prose-only H3 drop → list-bearing H3 only absorbed
Critic R7P2 2 H2/H3 mixed prose drop → callout wrapper conversion (list-entry transform discarded, 100% content preservation)
Critic R8P2 1 plus-suffixed sprint → regex fix
Critic R9P2 1 lessons tolerant heading → LESSONS_RE added
Critic R10PASS — "no discrete regression"

Branch Discipline ✅ 31 consecutive sprints

  • New branch feat/sprint-163-adr-pr-table-callouts + Squash merge planned
  • main direct commit 0, --no-verify 0

New Patterns

  1. sections-level chunk render + in-place callout insertion — split body markdown into H2-level chunks to insert callout at original position. Blocks ordering regression and achieves visual emphasis simultaneously
  2. callout = wrapper, 100% content preservation — list-entry transform is auxiliary, content preservation is core. Wrapper renders raw markdown group inside prose, naturally displaying all H2/H3 prose/list/separator content
  3. tolerant heading matching (CARRYOVER_RE + LESSONS_RE) — exact alias matching + regex fallback dual layer. Covers numbered prefix, plus suffix, parenthetical suffix, KR/EN variants
  4. preamble seed pattern — solve sections-external limitation of frontmatter-less ADR's dash-list meta below first H2 by body prefix slice seed. Includes H1 deduplication regex with detail-view's top H1
  5. Critic 10-round regression detection pattern — R1~R9 all P2 findings. Progressive exposure from simple regex variations to fundamental ordering/content preservation. R7 reached essential decision to discard list-entry transform itself
  6. callout 4-token utilization branching — reuse existing callout-warn (lessons, yellow tone) / callout-info (carryover, blue tone) tokens, 0 new Palette mappings. prose-headings:text-* prose color mapping consistent with callout fg
  • sprint-162.md — Previous sprint, Mermaid activation + Critic P3 carryover inheritance
  • sprint-161.md — Phase D split origin, sections-level visualization pattern
  • sprint-157.md — Target of this sprint's Phase D Mermaid diagram