@bendyline/gilde 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/craftbook-templates/ab/ab-test-readout/versions/1.0.5/craftbook.json +418 -0
- package/data/craftbook-templates/ab/ab-test-readout/versions/1.0.5/test.json +196 -0
- package/data/craftbook-templates/ab/ab-test-readout/versions/1.0.6/craftbook.json +432 -0
- package/data/craftbook-templates/ab/ab-test-readout/versions/1.0.6/test.json +192 -0
- package/data/craftbook-templates/al/alert-rules/versions/1.0.5/craftbook.json +384 -0
- package/data/craftbook-templates/al/alert-rules/versions/1.0.5/test.json +145 -0
- package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.7/craftbook.json +799 -0
- package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.7/test.json +221 -0
- package/data/craftbook-templates/ch/changelog-writeup/versions/1.0.3/craftbook.json +119 -0
- package/data/craftbook-templates/ch/changelog-writeup/versions/1.0.3/test.json +128 -0
- package/data/craftbook-templates/co/codemod-sweep/versions/1.0.6/craftbook.json +661 -0
- package/data/craftbook-templates/co/codemod-sweep/versions/1.0.6/test.json +252 -0
- package/data/craftbook-templates/co/cohort-analysis/versions/1.0.5/craftbook.json +416 -0
- package/data/craftbook-templates/co/cohort-analysis/versions/1.0.5/test.json +238 -0
- package/data/craftbook-templates/co/content-accuracy-review/versions/1.1.2/craftbook.json +494 -0
- package/data/craftbook-templates/co/content-accuracy-review/versions/1.1.2/test.json +167 -0
- package/data/craftbook-templates/co/corpus-synthesis/versions/1.0.5/craftbook.json +419 -0
- package/data/craftbook-templates/co/corpus-synthesis/versions/1.0.5/test.json +172 -0
- package/data/craftbook-templates/cs/csv-transformer/versions/1.2.6/craftbook.json +285 -0
- package/data/craftbook-templates/cs/csv-transformer/versions/1.2.6/test.json +102 -0
- package/data/craftbook-templates/da/data-quality-audit/versions/1.0.5/craftbook.json +431 -0
- package/data/craftbook-templates/da/data-quality-audit/versions/1.0.5/test.json +348 -0
- package/data/craftbook-templates/de/deep-security-review/versions/1.1.5/craftbook.json +452 -0
- package/data/craftbook-templates/de/deep-security-review/versions/1.1.5/test.json +184 -0
- package/data/craftbook-templates/di/digest-from-feeds/versions/1.0.6/craftbook.json +312 -0
- package/data/craftbook-templates/di/digest-from-feeds/versions/1.0.6/test.json +87 -0
- package/data/craftbook-templates/en/engineering-retrospective/versions/2.0.18/craftbook.json +702 -0
- package/data/craftbook-templates/en/engineering-retrospective/versions/2.0.18/test.json +191 -0
- package/data/craftbook-templates/ht/html-arcade-game/versions/1.2.5/craftbook.json +480 -0
- package/data/craftbook-templates/ht/html-arcade-game/versions/1.2.5/test.json +176 -0
- package/data/craftbook-templates/in/investigate/versions/1.1.1/craftbook.json +85 -0
- package/data/craftbook-templates/in/investigate/versions/1.1.1/test.json +118 -0
- package/data/craftbook-templates/in/invoice-run/versions/1.1.9/craftbook.json +515 -0
- package/data/craftbook-templates/in/invoice-run/versions/1.1.9/test.json +140 -0
- package/data/craftbook-templates/index.json +1 -1
- package/data/craftbook-templates/ma/market-scan/versions/1.0.5/craftbook.json +480 -0
- package/data/craftbook-templates/ma/market-scan/versions/1.0.5/test.json +223 -0
- package/data/craftbook-templates/me/meeting-prep-brief/versions/1.0.5/craftbook.json +255 -0
- package/data/craftbook-templates/me/meeting-prep-brief/versions/1.0.5/test.json +140 -0
- package/data/craftbook-templates/mo/morning-brief/versions/1.0.6/craftbook.json +270 -0
- package/data/craftbook-templates/mo/morning-brief/versions/1.0.6/test.json +105 -0
- package/data/craftbook-templates/pe/perf-audit/versions/1.1.3/craftbook.json +320 -0
- package/data/craftbook-templates/pe/perf-audit/versions/1.1.3/test.json +94 -0
- package/data/craftbook-templates/po/powerpoint-deck/versions/1.7.19/craftbook.json +603 -0
- package/data/craftbook-templates/po/powerpoint-deck/versions/1.7.19/test.json +266 -0
- package/data/craftbook-templates/pr/press-release/versions/1.0.6/craftbook.json +450 -0
- package/data/craftbook-templates/pr/press-release/versions/1.0.6/test.json +356 -0
- package/data/craftbook-templates/raw-index.json +1 -1
- package/data/craftbook-templates/re/refactor-module/versions/2.0.7/craftbook.json +753 -0
- package/data/craftbook-templates/re/refactor-module/versions/2.0.7/test.json +241 -0
- package/data/craftbook-templates/re/release-notes/versions/1.0.6/craftbook.json +339 -0
- package/data/craftbook-templates/re/release-notes/versions/1.0.6/test.json +107 -0
- package/data/craftbook-templates/re/research-report/versions/1.0.6/craftbook.json +417 -0
- package/data/craftbook-templates/re/research-report/versions/1.0.6/test.json +183 -0
- package/data/craftbook-templates/ro/rollback-plan/versions/1.0.6/craftbook.json +319 -0
- package/data/craftbook-templates/ro/rollback-plan/versions/1.0.6/test.json +87 -0
- package/data/craftbook-templates/ru/runbook/versions/1.0.5/craftbook.json +491 -0
- package/data/craftbook-templates/ru/runbook/versions/1.0.5/test.json +118 -0
- package/data/craftbook-templates/we/week-plan/versions/1.0.5/craftbook.json +313 -0
- package/data/craftbook-templates/we/week-plan/versions/1.0.5/test.json +175 -0
- package/data/gezel-templates/im/image-editor/manifest.json +21 -0
- package/data/gezel-templates/im/image-editor/versions/1.0.0/about.md +17 -0
- package/data/gezel-templates/im/image-editor/versions/1.0.0/manifest.json +14 -0
- package/data/gezel-templates/index.json +1 -1
- package/data/gezel-templates/raw-index.json +1 -1
- package/data/image-models/fl/flux-2-klein-4b-q4/manifest.json +3 -0
- package/data/image-models/index.json +1 -1
- package/data/image-models/qw/qwen-image-edit-2511-q4/manifest.json +44 -0
- package/data/image-models/qw/qwen-image-edit-2511-q4/versions/1.0.0/manifest.json +36 -0
- package/data/image-models/raw-index.json +1 -1
- package/package.json +1 -1
- package/schemas/image-model-identity.schema.json +16 -0
- package/schemas/image-model-version.schema.json +1 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"title": "Playable single-file arcade-game workflow",
|
|
4
|
+
"objective": "Run the HTML Arcade Game craftbook and verify concrete game/visual design artifacts precede a complete playable canvas game with end state and restart behavior.",
|
|
5
|
+
"tags": [
|
|
6
|
+
"html-game",
|
|
7
|
+
"workflow"
|
|
8
|
+
],
|
|
9
|
+
"prompt": "Use the HTML Arcade Game craftbook. Read workspace `source/game-brief.md`, then build workspace `index.html` as a self-contained canvas game called Returns Rush. The player moves a sorting cart left/right, catches accepted parcels for points, avoids exception parcels that cost a life, wins at 10 points, loses at zero lives, and can restart in-page after either end state. Use keyboard controls, a visible score/lives HUD, inline CSS/JS, and no external assets. Complete game-design and visual-design artifacts before implementation.",
|
|
10
|
+
"setup": {
|
|
11
|
+
"projectName": "HTML Arcade Game Eval",
|
|
12
|
+
"about": "Self-contained workflow eval for the HTML Arcade Game craftbook. The brief is in the workspace, design deliverables belong in artifacts, and the playable game belongs at workspace/index.html.",
|
|
13
|
+
"missionObjectives": "Ship a playable Returns Rush canvas game with real input, score/lives state, win and lose states, restart behavior, visual feedback, and no external dependencies.",
|
|
14
|
+
"files": [
|
|
15
|
+
{
|
|
16
|
+
"path": "source/game-brief.md",
|
|
17
|
+
"content": "# Returns Rush Game Brief\n\nTheme: a busy returns desk sorting accepted parcels from exception parcels.\n\nRequired mechanics:\n- Move a sorting cart left and right with ArrowLeft/ArrowRight (A/D may also work).\n- Accepted parcels add one point.\n- Exception parcels remove one life.\n- Start with three lives.\n- Win at 10 points and lose at zero lives.\n- Show score, lives, controls, and current state on screen.\n- After win or game over, an in-page control restarts a fresh round.\n- Keep the game self-contained in one index.html with no network assets.\n"
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"worker": {
|
|
21
|
+
"name": "Jules",
|
|
22
|
+
"role": "Developer"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"mocks": [],
|
|
26
|
+
"success": {
|
|
27
|
+
"summary": "A craftbook task records game/visual designs and ships a parseable, substantial Returns Rush game with input, end states, and restart behavior.",
|
|
28
|
+
"deliverables": [
|
|
29
|
+
{
|
|
30
|
+
"path": "index.html",
|
|
31
|
+
"kind": "html-game",
|
|
32
|
+
"minBytes": 4200,
|
|
33
|
+
"checks": [
|
|
34
|
+
{
|
|
35
|
+
"kind": "cssMinBytes",
|
|
36
|
+
"bytes": 600,
|
|
37
|
+
"file": "index.html"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"kind": "jsParses",
|
|
41
|
+
"file": "index.html"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"kind": "contains",
|
|
45
|
+
"file": "index.html",
|
|
46
|
+
"pattern": "<canvas\\b",
|
|
47
|
+
"flags": "i"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"kind": "contains",
|
|
51
|
+
"file": "index.html",
|
|
52
|
+
"pattern": "Returns Rush|returns desk",
|
|
53
|
+
"flags": "i"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"kind": "contains",
|
|
57
|
+
"file": "index.html",
|
|
58
|
+
"pattern": "ArrowLeft|ArrowRight|keydown"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"kind": "contains",
|
|
62
|
+
"file": "index.html",
|
|
63
|
+
"pattern": "score[\\s\\S]*lives|lives[\\s\\S]*score",
|
|
64
|
+
"flags": "i"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"kind": "contains",
|
|
68
|
+
"file": "index.html",
|
|
69
|
+
"pattern": "game\\s*-?\\s*over|you\\s+(?:win|lose)|victory|defeat",
|
|
70
|
+
"flags": "i"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"kind": "contains",
|
|
74
|
+
"file": "index.html",
|
|
75
|
+
"pattern": "restart|play\\s*again|new\\s*game|try\\s*again",
|
|
76
|
+
"flags": "i"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"kind": "contains",
|
|
80
|
+
"file": "index.html",
|
|
81
|
+
"pattern": "requestAnimationFrame"
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
"checks": [
|
|
87
|
+
{
|
|
88
|
+
"kind": "minBytes",
|
|
89
|
+
"file": "design/game-design.md",
|
|
90
|
+
"bytes": 600,
|
|
91
|
+
"artifact": true
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"kind": "contains",
|
|
95
|
+
"file": "design/game-design.md",
|
|
96
|
+
"pattern": "(?:acceptance|criteria)[\\s\\S]*(?:control|input)[\\s\\S]*(?:win|lose|game over)",
|
|
97
|
+
"flags": "i",
|
|
98
|
+
"artifact": true
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"kind": "minBytes",
|
|
102
|
+
"file": "design/visual-design.md",
|
|
103
|
+
"bytes": 450,
|
|
104
|
+
"artifact": true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"kind": "contains",
|
|
108
|
+
"file": "design/visual-design.md",
|
|
109
|
+
"pattern": "#[0-9a-f]{3,8}[\\s\\S]*(?:HUD|score|lives)",
|
|
110
|
+
"flags": "i",
|
|
111
|
+
"artifact": true
|
|
112
|
+
}
|
|
113
|
+
],
|
|
114
|
+
"taskNotes": {
|
|
115
|
+
"minBytes": 160,
|
|
116
|
+
"checks": [
|
|
117
|
+
{
|
|
118
|
+
"kind": "contains",
|
|
119
|
+
"file": "task-notes.md",
|
|
120
|
+
"pattern": "game-design\\.md",
|
|
121
|
+
"flags": "i"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"kind": "contains",
|
|
125
|
+
"file": "task-notes.md",
|
|
126
|
+
"pattern": "visual-design\\.md",
|
|
127
|
+
"flags": "i"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"kind": "contains",
|
|
131
|
+
"file": "task-notes.md",
|
|
132
|
+
"pattern": "index\\.html",
|
|
133
|
+
"flags": "i"
|
|
134
|
+
}
|
|
135
|
+
],
|
|
136
|
+
"requireCraftbookTask": true
|
|
137
|
+
},
|
|
138
|
+
"taskGraph": {
|
|
139
|
+
"requireCraftbookTask": true,
|
|
140
|
+
"requireTerminalStep": true
|
|
141
|
+
},
|
|
142
|
+
"unchangedFixtures": [
|
|
143
|
+
"source/game-brief.md"
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
"rubric": {
|
|
147
|
+
"artifact": {
|
|
148
|
+
"path": "index.html",
|
|
149
|
+
"kind": "html"
|
|
150
|
+
},
|
|
151
|
+
"axes": [
|
|
152
|
+
{
|
|
153
|
+
"name": "playability",
|
|
154
|
+
"description": "Keyboard input moves the player, collisions change score/lives, and a round can reach both win and lose states."
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"name": "completeness",
|
|
158
|
+
"description": "The game includes a real loop, visible HUD, end-state feedback, and a reliable fresh-round restart."
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"name": "visual feedback",
|
|
162
|
+
"description": "The locked palette, readable game objects, HUD hierarchy, and collision/end-state feedback are applied intentionally."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "workflow evidence",
|
|
166
|
+
"description": "The game and visual design artifacts are concrete and agree with the implementation."
|
|
167
|
+
}
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
"qualityFocus": [
|
|
171
|
+
"craftbook attribution",
|
|
172
|
+
"design-before-build ordering",
|
|
173
|
+
"runtime playability",
|
|
174
|
+
"end-state and restart behavior"
|
|
175
|
+
]
|
|
176
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "investigate",
|
|
3
|
+
"name": "Investigate",
|
|
4
|
+
"description": "Systematic root-cause debugging procedure. Six steps:\n\n1. **Gather symptoms** — observable signals, no theorizing yet\n2. **Search prior** — has this project seen this before? (memory)\n3. **Reproduce** — deterministic repro before any tracing\n4. **Trace to root cause** — keep asking 'and why is THAT?'\n5. **Propose fix** — state it; don't apply unless asked\n6. **Save learning** — stamp (symptom → root cause → fix) into memory\n\nThe principle is the Iron Law:\n**no fixes without investigation**. Jumping to a fix without root cause\neither ships a coincidence (the bug comes back), papers over the real\ncause (introduces tech debt), or fixes a symptom you didn't actually\nunderstand.\n\nWhere the upstream procedure used a per-project `learnings.jsonl` file,\nthis craftbook uses the per-gezel/project memory subsystem. The\n`search-prior.ts` script wraps `search_memory` with the symptom-shape\nquery; `save-learning.ts` wraps `save_memory` with structured metadata\nso future `search-prior` queries find the match.\n\nThe Iron Law is not literal: sometimes a one-line typo fix is the right\nmove. The principle is \"if you can't say *why* this fix works, you're\nguessing.\" The craftbook's structure makes that guessing visible.\n",
|
|
5
|
+
"basedOn": {
|
|
6
|
+
"name": "gstack",
|
|
7
|
+
"url": "https://github.com/garrytan/gstack"
|
|
8
|
+
},
|
|
9
|
+
"entryStepId": "gather-symptoms",
|
|
10
|
+
"triggers": [
|
|
11
|
+
"investigate this",
|
|
12
|
+
"debug this",
|
|
13
|
+
"why is this broken",
|
|
14
|
+
"find the bug",
|
|
15
|
+
"root cause"
|
|
16
|
+
],
|
|
17
|
+
"steps": [
|
|
18
|
+
{
|
|
19
|
+
"id": "gather-symptoms",
|
|
20
|
+
"name": "Gather symptoms",
|
|
21
|
+
"description": "Pull together every observable signal: error messages, stack traces, logs, repro steps, when it started.",
|
|
22
|
+
"prompt": "**For this task you are an investigator, not an author.** The Iron Law: no fixes without investigation. Resist the urge to `write_file` a fix — even if your default persona is a developer, this craftbook is about *understanding what broke* and the fix comes later (separate task).\n\n**Your first action this turn:** call `ask_user_question` with the four bullets below if any signal is missing from the chat. If the user already supplied the symptom in their message, skip to `write_task_note`.\n\nElicit (if missing):\n- What's the observable failure? (exact error message, screenshot, stack trace, log line)\n- When did it start? (recent commit? deploy? environment change?)\n- Is it reproducible? (every time? intermittent? specific input?)\n- What's the smallest input that triggers it?\n\nThen `write_task_note({ ref, content: <3-5 line symptom summary> })`. Do NOT theorize yet. Do NOT propose causes — that's the next step. Do NOT call `read_task_notes` to find the procedure; it's right here.",
|
|
23
|
+
"suggestedRole": "developer",
|
|
24
|
+
"next": "search-prior"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"id": "search-prior",
|
|
28
|
+
"name": "Search prior",
|
|
29
|
+
"description": "Have we seen this before? Search memory for prior investigations in this project.",
|
|
30
|
+
"prompt": "Run the `search-prior` script. It searches project memory for prior investigations matching the symptom signature. If we've seen this before, the model returns the prior learning + the fix that landed.\n\nIf there's a match: state what the prior investigation found, and ask the user if this looks like the same bug (with `ask_user_question`). If yes, jump straight to the fix. If no, proceed to fresh investigation.\n\nIf there's no match: note 'no prior matches' to task notes and advance.",
|
|
31
|
+
"suggestedRole": "developer",
|
|
32
|
+
"onExit": {
|
|
33
|
+
"name": "search-prior",
|
|
34
|
+
"autoAdvanceWhen": {
|
|
35
|
+
"op": "ok"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"next": "reproduce"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "reproduce",
|
|
42
|
+
"name": "Reproduce",
|
|
43
|
+
"description": "Get a deterministic repro. Often the longest step. Cannot fix what can't be reproduced.",
|
|
44
|
+
"prompt": "Get the bug to fire on demand. Strategies:\n\n1. **Read the failing path** — find the function/route from the stack trace (use `read_file` / `search_files`).\n2. **Walk inputs backward** — what user action triggered this? What's the request shape?\n3. **Try the minimal trigger** — strip the user's repro down. Half the bugs disappear when you isolate.\n4. **Run a small script if needed** — `run_nodejs_script` against a synthetic input.\n5. **If it won't reproduce**: state that explicitly. Either get more info from the user (`ask_user_question`) or escalate.\n\nWhen you have a repro, write the minimal trigger to task notes. Do not move on without one.",
|
|
45
|
+
"suggestedRole": "developer",
|
|
46
|
+
"next": "trace"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"id": "trace",
|
|
50
|
+
"name": "Trace to root cause",
|
|
51
|
+
"description": "Follow the data from the failure point back to the smallest 'this is the thing that's wrong.'",
|
|
52
|
+
"prompt": "Trace backward from the failure. Read the code path. The Iron Law: **the cause is not 'the function returned the wrong thing,' it's WHY the function returned the wrong thing.** Keep asking 'and why is THAT?' until you hit one of:\n\n- A coding bug (assignment swapped, condition inverted, type mismatch)\n- A bad invariant (assumed X but the data has Y)\n- A wrong assumption about a dependency (the API returns null in this case)\n- An environment / config issue (the staging DB doesn't have this column)\n\nDocument the chain in task notes. Bullet form is fine. End with: 'Root cause: <one sentence>.'",
|
|
53
|
+
"suggestedRole": "developer",
|
|
54
|
+
"next": "propose-fix"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"id": "propose-fix",
|
|
58
|
+
"name": "Propose fix",
|
|
59
|
+
"description": "State the fix. Don't apply it yet — let the user (or a separate craftbook) decide.",
|
|
60
|
+
"prompt": "Now the easy part. State the fix in plain language:\n\n- What file/function changes?\n- What's the new behavior?\n- What did NOT change (so the user knows you didn't gold-plate)?\n- What test would catch this regressing?\n\nDo NOT apply the fix unless the user explicitly asks. Investigation lives separate from edit-the-code so the diff stays minimal and reviewable. Advance.",
|
|
61
|
+
"suggestedRole": "developer",
|
|
62
|
+
"next": "save-learning"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "save-learning",
|
|
66
|
+
"name": "Save learning",
|
|
67
|
+
"description": "Stamp the (symptom → root cause → fix) triple into project memory so future investigations find it.",
|
|
68
|
+
"prompt": "Run the `save-learning` script with the symptom, root cause, and proposed fix. It saves them to project memory with appropriate tags so `search-prior` finds them next time.\n\nThen report DONE with a one-line summary: 'Investigated <symptom>; root cause: <cause>; fix proposed: <fix>.'",
|
|
69
|
+
"suggestedRole": "developer",
|
|
70
|
+
"onExit": {
|
|
71
|
+
"name": "save-learning",
|
|
72
|
+
"autoAdvanceWhen": {
|
|
73
|
+
"op": "ok"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"terminal": true
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"scripts": {
|
|
80
|
+
"search-prior": "import { defineScript, gezel } from '@bendyline/gezel-sdk';\n\nexport const meta = defineScript({\n name: 'search-prior',\n description:\n 'Search project memory for prior investigations matching a symptom signature. Stamps {matches: number, hits: [{text, score}]}.',\n inputs: {\n symptom: {\n type: 'string',\n description: 'Short symptom description (1-3 sentences). Used as the search query.',\n required: true,\n },\n },\n outputs: {\n matches: { type: 'number', description: 'Number of memory hits returned.' },\n hits: {\n type: 'array',\n description: 'Top matches, each with text + score.',\n itemType: 'object',\n },\n },\n requires: ['memory.read'],\n});\n\ninterface MemoryHit {\n text: string;\n score: number;\n}\n\nasync function main(): Promise<void> {\n const input = gezel.input as { symptom: string };\n const query = `investigation: ${input.symptom}`;\n const results = (await gezel.memory.search(query)) as MemoryHit[];\n const filtered = (results ?? []).filter(\n (r): r is MemoryHit => Boolean(r) && typeof r.text === 'string' && typeof r.score === 'number',\n );\n gezel.log(`Memory search for \"${query}\" returned ${filtered.length} hit(s)`);\n gezel.output({ matches: filtered.length, hits: filtered.slice(0, 5) });\n}\n\nawait main();\n",
|
|
81
|
+
"save-learning": "import { defineScript, gezel } from '@bendyline/gezel-sdk';\n\nexport const meta = defineScript({\n name: 'save-learning',\n description:\n 'Stamp a (symptom → root cause → fix) investigation triple into project memory so future `search-prior` queries find it.',\n inputs: {\n symptom: { type: 'string', description: 'Observable failure.', required: true },\n rootCause: { type: 'string', description: 'Root cause in one sentence.', required: true },\n fix: { type: 'string', description: 'Proposed fix.', required: true },\n files: {\n type: 'string',\n description: 'Comma-separated list of files touched (or expected to be touched).',\n },\n },\n outputs: {\n ok: { type: 'boolean', description: 'True on successful save.' },\n },\n requires: ['memory.write'],\n});\n\nasync function main(): Promise<void> {\n const input = gezel.input as {\n symptom: string;\n rootCause: string;\n fix: string;\n files?: string;\n };\n const text = [\n 'investigation:',\n `symptom: ${input.symptom}`,\n `root cause: ${input.rootCause}`,\n `fix: ${input.fix}`,\n ...(input.files ? [`files: ${input.files}`] : []),\n ].join('\\n');\n await gezel.memory.save(text, {\n kind: 'investigation',\n ...(input.files ? { files: input.files } : {}),\n });\n gezel.log('Saved investigation to memory.');\n gezel.output({ ok: true });\n}\n\nawait main();\n"
|
|
82
|
+
},
|
|
83
|
+
"version": "1.1.1",
|
|
84
|
+
"releasedAt": "2026-10-31T00:00:00Z"
|
|
85
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": 1,
|
|
3
|
+
"title": "Root-cause investigation notes",
|
|
4
|
+
"objective": "Measure whether the investigate craftbook keeps a local model in diagnosis mode: gather symptoms, inspect a seeded failing path, identify root cause, propose a fix, and write durable task notes without requiring a code edit.",
|
|
5
|
+
"tags": [
|
|
6
|
+
"investigation"
|
|
7
|
+
],
|
|
8
|
+
"prompt": "In the `Investigate Eval` project, investigate this failure without applying a code fix: `npm run accept` fails because cursor pagination skips records at page boundaries. The smallest repro is walking `lib/paginate.mjs` with limit 3 over the seeded 10-item fixture in `accept.mjs`; the acceptance script prints CASE failures. Read the code and acceptance script, find the root cause, and write task notes with Symptom, Minimal repro, Root cause, Proposed fix, and Regression test. Do not modify source files for this eval.",
|
|
9
|
+
"setup": {
|
|
10
|
+
"projectName": "Investigate Eval",
|
|
11
|
+
"about": "Self-contained eval project for the investigate craftbook. The target output is task notes, not a code change.",
|
|
12
|
+
"missionObjectives": "Investigate the seeded pagination failure, identify the exact root cause, propose a minimal fix and regression test, and leave source files unchanged.",
|
|
13
|
+
"files": [
|
|
14
|
+
{
|
|
15
|
+
"path": "package.json",
|
|
16
|
+
"content": "{\n \"name\": \"investigate-eval\",\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": { \"accept\": \"node accept.mjs\" }\n}\n"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "lib/paginate.mjs",
|
|
20
|
+
"content": "export function encodeCursor(index) {\n return Buffer.from(`idx:${index}`, 'utf8').toString('base64url');\n}\n\nexport function decodeCursor(cursor) {\n const raw = Buffer.from(cursor, 'base64url').toString('utf8');\n if (!raw.startsWith('idx:')) throw new Error(`malformed cursor: ${cursor}`);\n const index = Number(raw.slice(4));\n if (!Number.isInteger(index) || index < 0) throw new Error(`malformed cursor: ${cursor}`);\n return index;\n}\n\nexport function paginate(items, options = {}) {\n const limit = options.limit ?? 3;\n if (!Number.isInteger(limit) || limit < 1) throw new Error(`limit must be a positive integer, got ${limit}`);\n const start = options.cursor == null ? 0 : decodeCursor(options.cursor) + 1;\n const page = items.slice(start, start + limit);\n const nextIndex = start + page.length;\n const nextCursor = nextIndex < items.length ? encodeCursor(nextIndex) : null;\n return { items: page, nextCursor };\n}\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"path": "accept.mjs",
|
|
24
|
+
"content": "import { paginate } from './lib/paginate.mjs';\n\nconst ITEMS = Array.from({ length: 10 }, (_, i) => ({ id: `item-${i + 1}` }));\n\nfunction walk(limit) {\n const seen = [];\n let cursor = null;\n for (let hops = 0; hops < 10; hops += 1) {\n const page = paginate(ITEMS, { limit, cursor });\n seen.push(...page.items.map((item) => item.id));\n cursor = page.nextCursor;\n if (!cursor) break;\n }\n return seen;\n}\n\nconst expected = ITEMS.map((item) => item.id);\nconst got = walk(3);\nif (JSON.stringify(got) !== JSON.stringify(expected)) {\n console.log(`CASE boundary: expected ${JSON.stringify(expected)} got ${JSON.stringify(got)}`);\n process.exit(1);\n}\nconsole.log('ALL CASES PASS');\n"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"worker": {
|
|
28
|
+
"name": "Theo",
|
|
29
|
+
"role": "Developer"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"mocks": [],
|
|
33
|
+
"success": {
|
|
34
|
+
"summary": "A task created from investigate has notes naming the symptom, minimal repro, root cause, proposed fix, and regression test.",
|
|
35
|
+
"taskNotes": {
|
|
36
|
+
"minBytes": 400,
|
|
37
|
+
"checks": [
|
|
38
|
+
{
|
|
39
|
+
"kind": "contains",
|
|
40
|
+
"file": "task-notes.md",
|
|
41
|
+
"pattern": "symptom",
|
|
42
|
+
"flags": "i"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"kind": "contains",
|
|
46
|
+
"file": "task-notes.md",
|
|
47
|
+
"pattern": "minimal repro|repro",
|
|
48
|
+
"flags": "i"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "contains",
|
|
52
|
+
"file": "task-notes.md",
|
|
53
|
+
"pattern": "root cause",
|
|
54
|
+
"flags": "i"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"kind": "contains",
|
|
58
|
+
"file": "task-notes.md",
|
|
59
|
+
"pattern": "decodeCursor|cursor",
|
|
60
|
+
"flags": "i"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"kind": "contains",
|
|
64
|
+
"file": "task-notes.md",
|
|
65
|
+
"pattern": "\\+\\s*1|one item",
|
|
66
|
+
"flags": "i"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"kind": "contains",
|
|
70
|
+
"file": "task-notes.md",
|
|
71
|
+
"pattern": "proposed fix|remove",
|
|
72
|
+
"flags": "i"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"kind": "contains",
|
|
76
|
+
"file": "task-notes.md",
|
|
77
|
+
"pattern": "regression test|accept",
|
|
78
|
+
"flags": "i"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"rubric": {
|
|
84
|
+
"artifact": {
|
|
85
|
+
"path": "task-notes.md",
|
|
86
|
+
"kind": "markdown"
|
|
87
|
+
},
|
|
88
|
+
"axes": [
|
|
89
|
+
{
|
|
90
|
+
"name": "root cause",
|
|
91
|
+
"description": "The notes name the actual defect at the page boundary with file and line evidence, not a restated symptom."
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"name": "evidence",
|
|
95
|
+
"description": "The diagnosis rests on code that was read and the acceptance output, and the minimal repro reproduces the failure."
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"name": "fix and regression test",
|
|
99
|
+
"description": "The proposed fix is concrete and minimal, no source was changed, and the regression test would fail before the fix and pass after it."
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
"qualityFocus": [
|
|
104
|
+
"no-fix-before-root-cause",
|
|
105
|
+
"task-note deliverable",
|
|
106
|
+
"seeded repro"
|
|
107
|
+
],
|
|
108
|
+
"extensions": {
|
|
109
|
+
"legacySimulators": [
|
|
110
|
+
{
|
|
111
|
+
"id": "investigate-fake-service-fixture",
|
|
112
|
+
"kind": "data-source",
|
|
113
|
+
"status": "implemented",
|
|
114
|
+
"description": "Seeded local fake service contract replacing live CLIs, HTTP APIs, credentials, and side effects."
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
}
|