docs(memory): BDR-012 + LRN-013 + 2026-05-07 journal append
- BDR-012 — `/client-handover` cover: white bg + green-forest accents + PNG logo default. Captures iteration (cream → green-dark rejected → white-pure final). Why: light theme matches zenquality.fr without overpowering long client-facing text. Solid green-dark reserved for marketing covers, not deliverables. - LRN-013 — marked CLI 16.x ignores stdin and dumps own cli.js source. Pattern: do not assume marked CLI accepts stdin like awk/jq/sed. Always pass `-i FILE`. Smoke-test MD→HTML output for known content. - Journal — appends bugfix subsection under 2026-05-07 with the three bugs, root causes, fixes, verified output (164 KB / 19 pages). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
b447a892b1
commit
17ef213548
@@ -177,4 +177,14 @@ rules:
|
||||
- When in doubt: pass data via env vars (small payloads), file paths (large payloads), or argv. Reserve stdin for cases where the interpreter has NO heredoc.
|
||||
- Add post-write size check (`test -s "$FILE"` or `wc -l`) for any generated artifact in a shell pipeline — surfaces silent-failure modes immediately.
|
||||
- When debugging "script ran but file empty", run `bash -x script.sh` and look for the `+ python3 -` line — if you see no upstream data being consumed, you have the heredoc-pipe collision.
|
||||
- **Reference**: `skills/client-handover/scripts/handover-to-pdf.sh` `render_template()` (env-var-based, current); BDR-011 caveat list; commit `e06b52a` (final fix shipped with the renderer).
|
||||
- **Reference**: `skills/client-handover/scripts/handover-to-pdf.sh` `render_template()` (env-var-based, current); BDR-011 caveat list; commit `e06b52a` (final fix shipped with the renderer).
|
||||
---
|
||||
|
||||
## LRN-013 — marked CLI 16.x ignore stdin, dump own cli.js source
|
||||
|
||||
- **Date**: 2026-05-07
|
||||
- **Context**: `/client-handover` PDF rendering. `handover-to-pdf.sh` fallback chain pandoc → python-markdown → npx marked. On host with only npx, pipeline ran `npx --yes marked < "$src"` and produced 2-page PDF where body = marked package's `cli.js` source (`#!/usr/bin/env node`, `Marked CLI`, copyright, `import { main } from './main.js'`). Real MD content (30 KB) entirely lost.
|
||||
- **Pattern**: marked 16.x CLI regression — stdin path broken, ignores piped input, prints its own binary source. Only `-i FILE` flag works. Verified: `echo "test" | npx marked` → marked source. `npx marked -i FILE` → correct HTML.
|
||||
- **Why**: do not assume marked CLI accepts stdin like awk/jq/sed. Check actual conversion output before shipping any MD→HTML renderer.
|
||||
- **How to apply**: any shell md→html using marked CLI must call `npx --yes marked --gfm -i "$src"`. Keep pandoc + python-markdown ahead in fallback chain — more stable. Smoke-test: render small MD, grep output for known content; fail loudly if mismatch.
|
||||
- **Reference**: `skills/client-handover/scripts/handover-to-pdf.sh` line ~140 (npx fallback fixed). Commit fixing bug.
|
||||
|
||||
Reference in New Issue
Block a user