Markdown Edge Cases
Pattern: test harness — exercises every markdown construct the notebook renderer must handle, mixed with [[ref]] syntax.
;; pltg — minimal facts for ref testing
(load-document "memo" "../source/series_a_memo.txt")
(fact arr 2800000
:evidence (evidence "memo"
:quotes ("Annual Recurring Revenue (ARR): $2,800,000")
:explanation "Current ARR"))
(fact nrr 180
:evidence (evidence "memo"
:quotes ("Net Revenue Retention (NRR): 180%")
:explanation "NRR"))
(fact cac 18200
:evidence (evidence "memo"
:quotes ("Customer Acquisition Cost (CAC): $18,200")
:explanation "CAC"))
(fact ltv 89400
:evidence (evidence "memo"
:quotes ("Estimated Customer Lifetime Value (LTV): $89,400")
:explanation "Customer LTV"))
(fact cash 8200000
:evidence (evidence "memo"
:quotes ("Cash on Hand: $8,200,000")
:explanation "Current cash"))
(derive ltv-to-cac (/ ltv cac) :using (ltv cac))
(axiom retention-ok (> ?n 130) :origin "NRR > 130%")
(derive retention-check retention-ok :bind ((?n nrr)) :using (nrr retention-ok))
;; defterm, diff coverage
(defterm burn-ratio (/ cac arr) :using (cac arr))
(defterm health-label (if (> ltv-to-cac 3.0) "healthy" "weak") :using (ltv-to-cac))
;; ── Coherent diff with downstreams ──
;; arr-stated matches arr (2.8M) → burn-ratio, health-label unchanged
(defterm arr-stated 2800000 :origin "memo states ARR is $2.8M")
(diff arr-vs-memo :replace arr :with arr-stated)
;; ── Divergent diff with deep downstream chain ──
;; nrr (180) vs nrr-model-estimate (155) — cascades through 5 levels:
;; nrr → growth-adjusted-arr → projected-q4-arr → annual-revenue-rate
;; → runway-months → runway-status
(defterm nrr-model-estimate 155 :origin "model predicts NRR ~155%")
(defterm growth-adjusted-arr (* arr (/ nrr 100)) :using (arr nrr))
(defterm projected-q4-arr (* growth-adjusted-arr (/ nrr 100)) :using (growth-adjusted-arr nrr))
(defterm annual-revenue-rate (+ projected-q4-arr (* growth-adjusted-arr 3)) :using (projected-q4-arr growth-adjusted-arr))
(defterm runway-months (/ cash (/ annual-revenue-rate 12)) :using (cash annual-revenue-rate))
(defterm runway-status (if (> runway-months 18) "safe" (if (> runway-months 12) "caution" "critical")) :using (runway-months))
(derive runway-is-safe (= runway-status "safe") :using (runway-status))
(diff nrr-vs-model :replace nrr :with nrr-model-estimate)
arr = 2.8Mnrr = 180cac = 18,200ltv = 89,400cash = 8.2Mltv-to-cac = 4.91retention-ok = (> ?n 130) ✖retention-check = true ⚠burn-ratio = 0.65% ✖health-label = healthy ✖arr-stated = 2.8M ✖arr-vs-memo = 2.8M = 2.8M ⚠nrr-model-estimate = 155 ✖growth-adjusted-arr = 5.0M ✖projected-q4-arr = 9.1M ✖annual-revenue-rate = 24.2M ✖runway-months = 4.07 ✖runway-status = critical ✖runway-is-safe = false ⚠nrr-vs-model = 180 ≠ 155 ⚠
All node kinds
Every kind the renderer must color correctly:
Axiom:
(> ?n 130)[2✖] threshold
2retention-ok ✖
Derive:
true[3⚠] check
3retention-check ⚠
Defterm:
0.65%[4✖] burn ratio,
healthy[5✖] label
4burn-ratio ✖
5health-label ✖
Diff (coherent):
2.8M = 2.8M[6⚠] validation
6arr-vs-memo ⚠
Diff (divergent):
180 ≠ 155[7⚠] model disagrees
7nrr-vs-model ⚠
Inline formatting
Plain text with bold, italic, bold-italic, and inline code. Also bold with code inside and italic with code inside.
Refs inside formatting: $2.8M[1] revenue, 180%[8] retention, not a ref [[fact:arr]] (code escapes refs).
1arr
8nrr
Adjacent refs: 2.8M[1]180[8]18,200[9] — these should get comma separators.
1arr
8nrr
9cac
Silent refs work too[3⚠] — just a footnote number.
3retention-check ⚠
Heading level 3
Heading level 4 with bold and 2.8M[1]
1arr
Heading level 5
Heading level 6
Lists
Unordered
First item with
2.8M[1] ref
1arr
- Second item with bold and italic
Third item with
code and a
4.91x[10] ratio
10ltv-to-cac
Ordered
Unit economics:
4.91x[10] LTV/CAC
10ltv-to-cac
Nested lists
- Top level
Nested item with
8.2M[11] cash
11cash
- Another nested
Deep nested with
bold ref 180%[8]8nrr
- Back to top
Mixed content in items
This item has
code,
bold,
italic, and
$2.8M[1] all in one line
1arr
- This one just has plain text
Tables
| Metric |
Value |
Status |
| ARR |
$2.8M[1] |
good |
| NRR |
180%[8] |
strong |
| LTV/CAC |
4.91x[10] |
excellent |
| CAC |
$18,200[9] |
ok |
1arr
8nrr
10ltv-to-cac
9cac
Table without refs
| Left |
Center |
Right |
| a |
b |
c |
| bold |
italic |
code |
Block quotes
This is a block quote with 2.8M[1] ARR.
It spans multiple lines with formatting.
1arr
Nested quote with a ref: 180%[8] NRR is well above the true[3⚠] threshold.
8nrr
3retention-check ⚠
Code blocks
Fenced with info string:
def check_metrics(arr, nrr):
"""Not parsed for [[refs]] — raw code."""
return arr > 1_000_000 and nrr > 130
Fenced without info:
plain fenced block
no highlighting, no [[ref]] parsing
Thematic breaks
Above the break.
Below the break.
Another break style.
Edge cases
Empty emphasis
Text with ** ** empty bold and * * empty italic (should render literally).
Refs at boundaries
Start of paragraph: 2.8M[1] is the ARR.
1arr
End of paragraph: the ARR is 2.8M[1]
1arr
Multiple refs in one sentence
The company has $2.8M[1] ARR with 180%[8] NRR, $89,400[12] LTV vs $18,200[9] CAC giving 4.91x[10] ratio and $8.2M[11] cash.
1arr
8nrr
12ltv
9cac
10ltv-to-cac
11cash
Prefixed and suffixed refs
$2.8M[1] with dollar prefix, 180%[8] with percent suffix, 4.91x[10] with x suffix.
1arr
8nrr
10ltv-to-cac
Silent refs in prose
All checks pass[3⚠] and metrics look healthy.
3retention-check ⚠
Summary
$2.8M[1] ARR | 180%[8] NRR | 4.91x[10] LTV/CAC — strong fundamentals with $8.2M[11] runway.
1arr
8nrr
10ltv-to-cac
11cash
Diagnostics5 errors · 4 info
[no_evidence] arr-stated @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:37:1
('arr-stated', 'memo states ARR is $2.8M')
[no_evidence] nrr-model-estimate @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:44:1
('nrr-model-estimate', 'model predicts NRR ~155%')
[no_evidence] retention-ok @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:28:1
('retention-ok', 'NRR > 130%')
[potential_fabrication] runway-is-safe @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:50:1
[diff_divergence] nrr-vs-model @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:51:1
nrr-vs-model: nrr (180) vs nrr-model-estimate (155)
annual-revenue-rate: 24192000.0 → 19747000.0
growth-adjusted-arr: 5040000.0 → 4340000.0
projected-q4-arr: 9072000.0 → 6727000.0
runway-months: 4.067460317460317 → 4.983035397781942
[dangling] burn-ratio @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:32:1
[dangling] health-label @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:33:1
[dangling] retention-check @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:29:1
[dangling] runway-is-safe @ file:///home/runner/work/parseltongue/parseltongue/parseltongue/core/demos/ai2ai_pgmd/notebooks/.md_edgecases.pgmd.pltg:50:1
System
5 facts
9 terms
1 axioms
3 theorems
9 issues