{ "id": "08-build", "title": "Build & extend", "icon": "🔧", "level": "advanced", "lessons": [ { "id": "8.1", "title": "Add a command safely", "objective": "Follow the edit → syntax → test → rebuild → version-bump loop.", "minutes": 12, "commands": [ "load-local", "status", "help" ], "blocks": [ { "type": "text", "text": "Edit the source, run `node --check`, run the relevant test harness, rebuild bundles for tiers 1–2, then bump BOTH `main.html` and `LATEST_VER`." }, { "type": "cmd", "text": "status" }, { "type": "cmd", "text": "help load-local" }, { "type": "warn", "text": "Editing a tier-3 module without bumping `LATEST_VER` means users keep the stale cached file indefinitely." } ], "exercise": { "instruction": "Load the test suite, then run it: `load-local modules/test/test-suite.js` then `test auto`.", "accept": [ "test auto", "test *", "load-local *test-suite*" ], "check": { "type": "command" }, "hint": "Type: load-local modules/test/test-suite.js, then test auto" }, "quiz": { "q": "Which two places carry the version?", "options": [ "main.html and LATEST_VER", "package.json only", "localStorage" ], "answer": 0 }, "sources": [ "scripts/rebuild-bundles.py", "modules/core/module-loader.js" ] }, { "id": "8.2", "title": "Debug and observe", "objective": "Use the debug panel, console and health checks when something breaks.", "minutes": 8, "commands": [ "debug", "health-check", "js" ], "blocks": [ { "type": "text", "text": "`debug` toggles the runtime debug panel; `console` opens a JS console in the terminal; `health-check` audits VFS, modules, logs and skills." }, { "type": "cmd", "text": "health-check" }, { "type": "cmd", "text": "debug" }, { "type": "tip", "text": "Errors are posted to `/spaces/newos4/api/debug/ingest.php` and clustered in the debug dashboard." }, { "type": "cmd", "text": "js 1+1" } ], "exercise": { "instruction": "Run a health check.", "accept": [ "health-check" ], "check": { "type": "command" }, "hint": "Type: health-check" }, "quiz": { "q": "Where do runtime errors get ingested?", "options": [ "/api/debug/ingest.php", "/dev/null", "localStorage" ], "answer": 0 }, "sources": [ "modules/ext/debug-panel.js", "modules/core/module-debug-supervisor.js", "api/debug/ingest.php" ] } ] }