python
Technical notes on web development, DevOps, and AI integration.
51 articles
- 17:17tooling
Binding Mirrored Pages by Content, Not Names
Name-based bindings fork silently under renames; pagesync moves page identity into a hidden HTML marker plus a normalized sha256 drift hash.
TL;DR: The doc-sync tool mirrors markdown files from the docs folder to Plane Pages using content-shaped identity rather than names. A hidden HTML comment holding the source path sits as the first line and Plane preserves it verbatim as the sync authority. Strict tiers, sha256 drift checks on normalized markdown, and hard config validation keep sync reliable through renames and edits.
#plane#python#markdown - 17:04tooling
All Unit Tests Green, Yet the Converter Still Broke
Three pull-side bugs slipped past unit tests that were green on each side; only the round-trip property test caught the unsynchronized two-sided contract.
TL;DR: A round-trip property test over real docs failed despite green unit tests, showing the push and pull sides followed different contracts. Fixes addressed nested bold links via a wrap stack, a regex stash leak fixed by looping, and empty quote markers needing canonicalization. The lesson is unit tests only prove local specs, so you need cross-boundary property tests.
#plane#python#markdown - 16:20tooling
Two-way converter: conservative on push, tolerant on pull
A horizontal rule that vanished without a trace exposed a healthy two-way converter design: canonical push, tolerant pull that still refuses loudly.
TL;DR: My horizontal rule vanished on pull because the parser only handled <hr /> and silently ignored plain <hr>. The fix now throws a clear error for the bare tag instead of quietly dropping it. The tool now pushes conservative canonical HTML but only tolerates its known dialect on pull, backed by round-trip property tests.
#plane#python#markdown - 15:26tooling
The Markdown converter I trust is the one that refuses
A two-way repo-to-Plane converter that rejects anything outside a closed subset, line number included, instead of guessing.
TL;DR: The doc-sync converter rejects unsupported Markdown with an exact line number instead of silently truncating content. It only handles a strict subset like headings to h4, lists, tables and code blocks while frontmatter stays repo-side and images become pointers. This strict grammar and repo-side normalization makes round-trip conversions predictable and errors easy to fix.
#plane#python#markdown - 23:25backend
Two-way document sync: the trustworthy tool refuses precisely
A pull returned different content than my push, with no error. The fix was not a smarter parser but a precise map of what the sync refuses to do.
TL;DR: My Markdown quietly broke after a pull because Plane sanitizes HTML and drops unsupported formatting without warning. Instead of forcing acceptance, I built a sync engine that refuses risky work, storing Markdown safely and using stripped text as the stable identity. It classifies every outcome into six explicit statuses and fails loudly rather than guessing, prioritizing data integrity over convenience.
#plane#self-hosting#sync - 23:32devops
Why Selftest R97 Failed While the Audit Was Running
The audit re-hashed after render ran, and the selftest failed. Derived artifacts must stay out of the canonical digest, and execution order defines what a hash means.
TL;DR: R97 failed because the audit hashed the canonical digest after render ran, and render's output mutated the very directory being hashed. Fix: hash only sources of truth, excluding derived artifacts like nav.json and pages.json, with render now check-first and stdout silenced. Flaky fixture string substitution was replaced with path-based mutation and a re-frozen checksum.
#python#testing#ci - 23:30devops
The Validator Vanished, CI Stayed Green
A mirror sync deleted a validation script and CI stayed green. Three validator failure classes and two cheap fences: mandatory anchors plus a frozen checksum.
TL;DR: A git mirror sync silently deleted our validation script, yet CI stayed green because nothing verified the checker's existence. The postmortem surfaced three silent failure modes: missing, broken, and environment-brittle validators. The fix adds two cheap fences, a missing-anchor rule and a frozen checksum, so green finally means something.
#git#bash#python - 12:57testing
Fake implementations must fail: the selftest that tests itself
A green suite proves nothing if a fake can pass it. I fed three fake implementations into my 32-test selftest to prove the grader works.
TL;DR: After my 32-test suite went green, I worried it might be vacuous, so I built three fake validators (always pass, always fail, always emit every error code) that must each score zero passes. This is manual mutation testing, a known technique. I also pinned the selftest's sha256 so silent grader edits get caught.
#testing#bash#python - 12:07testing
Freezing a CLI contract with 32 red tests
How commit 6f5ae82 turned a deliberately failing selftest into a frozen CLI contract: red tests first, implementation later, no silent drift.
TL;DR: The author's selftest showed 32 failures, all intentional: that's the red step of TDD, freezing the CLI contract before any implementation exists. It's a batch-freeze variant rather than Canon TDD, accepting rework risk since a stable spec beats iteration rhythm for a CLI. Synthetic fixtures keep tests honest, and next comes implementing until green.
#testing#bash#cli