Skip to content

fix(compiler): implement monospace semantic badging, restore ASCII tree alignment, and add Gate 14 audit - #5

Merged
vadde merged 1 commit into
mainfrom
feat/semantic-monospace-block-badging
Oct 29, 2026
Merged

vadde merged 1 commit into
mainfrom
feat/semantic-monospace-block-badging

Conversation

@vadde

@vadde vadde commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Summary of Changes

1. Abolition of ⚡ TEXT Implementation

  • Diagnosed the root cause in scripts/build-docs.py where untagged or text-tagged preformatted blocks were unconditionally stamped as ⚡ TEXT Implementation.
  • Implemented classify_code_block() to semantically inspect each monospace block and stamp content-aware cybernetic badges:
    • ⚡ Executable code: ⚡ Python 3.12+ Implementation, ⚡ C99 Implementation, ⚡ x86-64 Assembly Implementation (.dna-label-code)
    • 📐 Reference tables & complexity matrices: 📐 Monospace Reference Matrix (.dna-label-matrix)
    • 🧬 Memory topologies & RAM byte buffers: 🧬 Memory Architecture & Layout (.dna-label-memory)
    • ⏱️ State transitions & timelines: ⏱️ Execution Trace & State Simulation (.dna-label-trace)
    • 🌳 Tree topologies & ASCII branches: 🌳 Structural Hierarchy & Tree Topology (.dna-label-tree)
    • 📜 Algorithmic blueprints & pseudocode: 📜 Algorithmic Blueprint (.dna-label-blueprint)
    • 📋 Technical specifications & mathematical proofs: 📋 Technical Specification & Proof (.dna-label-spec)
  • 100% elimination of ⚡ TEXT Implementation and ⚡ NONE Implementation across all 632 code blocks in the portal.

2. Forensic Discovery & Fix for Tree Root Node Snapping

  • Root Cause: The compiler previously called html.escape(code.strip()). Because Python's str.strip() strips whitespace from both ends of the entire string, line 1 of every monospace block had all its leading spaces stripped, violently snapping the root node (e.g. [ 50 ], [ Root: X ], 12) to column 0 on the far left while line 2+ retained indentation, leaving the child branch slashes (/ \) hanging in space.
  • Fix: Replaced code.strip() with clean_code_content(), which strictly strips leading/trailing empty lines while preserving 100% of the horizontal indentation on all content lines.
  • Root nodes are now verified mathematically centered above their child branch slashes ($\le 0.5$ character cell diff).

3. Automated Verification & Gate 14 Audit Suite

  • Created scripts/audit_monospace_badging_and_trees.py verifying:
    • Zero occurrences of ⚡ TEXT Implementation or ⚡ NONE Implementation
    • Semantic badge distribution across all required classes
    • Mathematical geometric centering of ASCII tree root nodes ($\le 1.0$ character cell diff)
  • Elevated headless verification to a 14-Gate Automated Audit Suite integrated into:
    • scripts/test-docs.sh
    • Makefile (make docs-test, make test-trees, make ci)
    • .github/workflows/ci.yml (14-Gate Living Docs Verification Suite job)
    • specs/SPEC-001-dsa-futuristic-docs-portal.md (Phase 18)
    • .agents/skills/dsa-docs-portal/SKILL.md

@vadde
vadde merged commit e232789 into main Oct 29, 2026
10 checks passed
@vadde
vadde deleted the feat/semantic-monospace-block-badging branch October 29, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant