3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-20 15:15:44 +01:00

Answer architecture round 1: 2 🔴, 6 🟡 (0 misread); one escaping path refusing null characters, block writers returning their pieces, the HTML writer split, shared entry checks, lint between formats

This commit is contained in:
2026-10-23 14:51:15 +02:00
committed by Lillem4n
parent cc029b0bc9
commit e234905c27
19 changed files with 324 additions and 269 deletions
+14 -8
View File
@@ -9,26 +9,32 @@ leg "lint ($node_image)" in_image "$node_image" npm run lint
# The boundaries pass by finding nothing, so probe that each still fires: oxlint bumps automerge on green.
boundaries_fire() {
local allowed=src/markdown/parse/boundary-probe-allowed.ts directive=src/markdown/directive/boundary-probe.ts directive_emit=src/markdown/directive/boundary-probe-emit.ts emit=src/markdown/emit/boundary-probe.ts lint_log parse=src/markdown/parse/boundary-probe.ts parse_portable=src/markdown/parse/boundary-probe-portable.ts
local adf=src/adf/boundary-probe.ts adf_html=src/adf/boundary-probe-html.ts allowed=src/markdown/parse/boundary-probe-allowed.ts directive=src/markdown/directive/boundary-probe.ts directive_emit=src/markdown/directive/boundary-probe-emit.ts directive_html=src/markdown/directive/boundary-probe-html.ts emit=src/markdown/emit/boundary-probe.ts emit_html=src/markdown/emit/boundary-probe-html.ts html=src/html/boundary-probe.ts lint_log markdown=src/markdown/boundary-probe-html.ts parse=src/markdown/parse/boundary-probe.ts parse_html=src/markdown/parse/boundary-probe-html.ts parse_portable=src/markdown/parse/boundary-probe-portable.ts
local probes="$adf $adf_html $allowed $directive $directive_emit $directive_html $emit $emit_html $html $markdown $parse $parse_html $parse_portable"
lint_log=$(mktemp) &&
# The paths are baked in: the trap fires after this function's locals are gone.
trap "rm -f $allowed $directive $directive_emit $emit $lint_log $parse $parse_portable" EXIT &&
trap "rm -f $probes $lint_log" EXIT &&
trap 'exit 130' INT &&
trap 'exit 143' TERM &&
echo "import '../emit/spelling-questions.ts';" > "$allowed" &&
in_image "$node_image" npm run lint &&
echo "import '../markdown/flavour.ts';" > "$adf" &&
echo "import '../html/emit/adf-to-html.ts';" > "$adf_html" &&
echo "import '../parse/blocks.ts';" > "$directive" &&
echo "import '../emit/image.ts';" > "$directive_emit" &&
echo "import '../../html/emit/adf-to-html.ts';" > "$directive_html" &&
echo "import '../portable/conventions.ts';" > "$emit" &&
echo "import '../../html/emit/adf-to-html.ts';" > "$emit_html" &&
echo "import '../markdown/flavour.ts';" > "$html" &&
echo "import '../html/emit/adf-to-html.ts';" > "$markdown" &&
echo "import '../emit/adf-to-markdown.ts';" > "$parse" &&
echo "import '../../html/emit/adf-to-html.ts';" > "$parse_html" &&
echo "import '../portable/conventions.ts';" > "$parse_portable" &&
! in_image "$node_image" npm run lint -- --format unix 2>&1 | tee "$lint_log" &&
grep -q "^$directive:.*eslint(no-restricted-imports)" "$lint_log" &&
grep -q "^$directive_emit:.*eslint(no-restricted-imports)" "$lint_log" &&
grep -q "^$emit:.*eslint(no-restricted-imports)" "$lint_log" &&
grep -q "^$parse:.*eslint(no-restricted-imports)" "$lint_log" &&
grep -q "^$parse_portable:.*eslint(no-restricted-imports)" "$lint_log" &&
rm -f "$allowed" "$directive" "$directive_emit" "$emit" "$lint_log" "$parse" "$parse_portable"
for probe in $probes; do
[ "$probe" = "$allowed" ] || grep -q "^$probe:.*eslint(no-restricted-imports)" "$lint_log" || return 1
done &&
rm -f $probes "$lint_log"
}
leg "import boundaries fire ($node_image)" boundaries_fire