Description
Theopenwiki_emulator.py script replaces external Node.js binaries and cloud APIs with localised, offline execution. It compiles 9 markdown wiki pages, repairs Mermaid schemas, and exports an interactive graph visualiser.
Script path
tools/openwiki_emulator.py
CLI options
Inputs
- Git status: System porcelain variables used to determine modified workspace files.
- Planned pages map: Hardcoded schemas defining initial wiki content and layouts.
Outputs
All workspace files created inside./openwiki/:
- INSTRUCTIONS.md: Standard CLI operating procedures and rules.
- _skeleton.md: Ranking matrices and structural subsystems mapping.
- graph.html: Interactive standalone knowledge visualization layout.
- quickstart.md / architecture / automation / memory: Structured markdown documents.
- .last-update.json: Dynamic JSON execution tracker log.
Dependencies
- Python: 3.12+ (standard
uvenvironment). - pyyaml: YAML data loading engine.
Internal Python API
validate_mermaid_diagram(code)
Validates Mermaid diagram layout syntax, bracket matches, and unescaped quotes.
- Arguments:
code(raw string of the diagram block). - Returns:
(bool, reason)tuple representing valid status and description.
process_markdown_file(filepath)
Scans a markdown file, detects corrupted or plain code fences, and repairs them.
- Arguments:
filepath(absolute target filepathlib.Path). - Mechanism: Degrades blocks in place with errors; heals corrected blocks back to active schemas.
Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-08-14 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0