1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
|
{
"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"
]
}
]
}
|