Commit 7c5d312
fix(intent): require explicit title and auto-link unit inputs (#222)
* fix(intent): require explicit title and auto-link unit inputs
`haiku_intent_create` previously took only `description` and derived the
title by truncating it to 80 chars with an ellipsis — producing
mid-sentence fragments like `"Add archivable intents to H·AI·K·U. Users
need a way to soft-hide completed,…"` instead of real titles.
The tool now requires both `title` (3–8 word summary, validated single
line ≤80 chars) and `description` (full body) as distinct inputs. Lazy
titles are rejected at the schema level. Skills (`/haiku:start`,
`/haiku:quick`, `/haiku:reset`) are updated with explicit guidance and
good/bad examples so the agent writes deliberate titles.
Repair stops auto-truncating bad titles. Mechanical truncation produced
the same broken titles as the original bug, so the title fix path now
flags the issue as a remaining error with rewrite instructions, leaving
it for the agent to handle interactively.
Repair also auto-links missing unit `inputs:`. Hundreds of legacy units
were blocking execution because the scanner had already resolved
upstream artifact paths but never wrote them. The new pass parses the
fix message ("upstream paths: X, Y, Z") and writes those paths into the
unit frontmatter. First-stage units with no upstream fall back to
`intent.md` plus any existing `knowledge/*.md`.
`haiku_intent_reset` now preserves and returns title and description as
distinct fields, with a recreate-instruction message that warns the
agent to rewrite an auto-truncated preserved title rather than resave a
broken one.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(intent): address PR #222 review comments
- state-tools.ts: drop redundant `&& true` in the unit-inputs guard
clause. The extra conjunct had no effect on behavior.
- orchestrator.ts: reject newlines on raw `title` input before the
`\s+` normalization collapses them. Previously, `intentTitleNeedsRepair`'s
newline guard was dead code here because `\s+` had already flattened
the input, so a multi-line title like "short\ntitle" would silently
become "short title" instead of being rejected. Now a multi-line input
returns a dedicated "single line" error.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(intent): address PR #222 review feedback
- Drop redundant `&& true` in the inputs repair guard (state-tools.ts).
- Reject multi-line `title` before whitespace normalization so the error
is explicit instead of silently collapsing newlines to spaces
(orchestrator.ts). Split the overlong/empty error message into its
own branch now that the newline path is handled separately.
- Add handler-level tests for `haiku_intent_create`: missing title,
empty title, overlong title, multi-line title, and the happy path
asserting that frontmatter `title` and body description are distinct.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test(orchestrator): make test() wrapper async-aware so handler tests run
The sync `test()` helper silently passed async callbacks — it called
`fn()` but never awaited the returned promise, so rejected assertions
never surfaced as failures. The five `haiku_intent_create` handler
contract tests added in 2e6ace9 were therefore not actually being
verified.
Make `test()` detect thenable return values and chain pass/fail onto
the promise. Callers for async tests use `await test(...)` so the loop
sequences correctly and the cleanup block fires after all awaits.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* merge: resolve test file post-merge with main
* docs(repair): clarify fixedHere=true semantics in title branch
In the title repair block, `fixedHere = true` doesn't mean the issue was
fixed — the rewritten issue was already pushed to `remaining` above.
The flag just suppresses the end-of-loop fallthrough that would re-push
the original (unmodified) issue. All other branches in this loop
genuinely fix things. Add a comment explaining the distinction.
Addresses final nit from PR #222 review.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor(repair): remove dead deriveIntentTitle helper
The function was only used for mechanical title truncation during
repair and at intent creation. Both call sites were removed when repair
switched to flagging bad titles for agent rewrite and intent creation
started requiring an explicit title. The helper is unreferenced now
(confirmed via grep across src/ and test/), so delete it rather than
leave it as an attractive nuisance for future truncation-based fixes.
Addresses follow-up from PR #222 review.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent f5d0755 commit 7c5d312
File tree
8 files changed
+1085
-751
lines changed- packages/haiku
- src
- test
- plugin/skills
- quick
- reset
- start
- website/public
8 files changed
+1085
-751
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
3390 | 3390 | | |
3391 | 3391 | | |
3392 | 3392 | | |
3393 | | - | |
| 3393 | + | |
3394 | 3394 | | |
3395 | 3395 | | |
3396 | 3396 | | |
| 3397 | + | |
| 3398 | + | |
| 3399 | + | |
| 3400 | + | |
| 3401 | + | |
3397 | 3402 | | |
3398 | 3403 | | |
3399 | | - | |
| 3404 | + | |
| 3405 | + | |
3400 | 3406 | | |
3401 | 3407 | | |
3402 | 3408 | | |
3403 | 3409 | | |
3404 | | - | |
| 3410 | + | |
3405 | 3411 | | |
3406 | 3412 | | |
3407 | 3413 | | |
| |||
3421 | 3427 | | |
3422 | 3428 | | |
3423 | 3429 | | |
3424 | | - | |
| 3430 | + | |
3425 | 3431 | | |
3426 | 3432 | | |
3427 | 3433 | | |
| |||
4052 | 4058 | | |
4053 | 4059 | | |
4054 | 4060 | | |
| 4061 | + | |
4055 | 4062 | | |
4056 | 4063 | | |
4057 | | - | |
| 4064 | + | |
| 4065 | + | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
| 4078 | + | |
| 4079 | + | |
| 4080 | + | |
| 4081 | + | |
| 4082 | + | |
| 4083 | + | |
| 4084 | + | |
| 4085 | + | |
| 4086 | + | |
| 4087 | + | |
| 4088 | + | |
| 4089 | + | |
| 4090 | + | |
| 4091 | + | |
| 4092 | + | |
| 4093 | + | |
| 4094 | + | |
| 4095 | + | |
| 4096 | + | |
| 4097 | + | |
4058 | 4098 | | |
4059 | | - | |
| 4099 | + | |
4060 | 4100 | | |
4061 | 4101 | | |
4062 | 4102 | | |
| |||
4102 | 4142 | | |
4103 | 4143 | | |
4104 | 4144 | | |
4105 | | - | |
4106 | | - | |
| 4145 | + | |
| 4146 | + | |
| 4147 | + | |
4107 | 4148 | | |
4108 | 4149 | | |
4109 | 4150 | | |
4110 | | - | |
4111 | | - | |
4112 | | - | |
| 4151 | + | |
4113 | 4152 | | |
4114 | 4153 | | |
4115 | 4154 | | |
| |||
4124 | 4163 | | |
4125 | 4164 | | |
4126 | 4165 | | |
4127 | | - | |
| 4166 | + | |
4128 | 4167 | | |
4129 | 4168 | | |
4130 | 4169 | | |
| |||
4460 | 4499 | | |
4461 | 4500 | | |
4462 | 4501 | | |
4463 | | - | |
| 4502 | + | |
4464 | 4503 | | |
4465 | 4504 | | |
4466 | 4505 | | |
4467 | | - | |
| 4506 | + | |
| 4507 | + | |
4468 | 4508 | | |
4469 | 4509 | | |
4470 | 4510 | | |
| |||
4526 | 4566 | | |
4527 | 4567 | | |
4528 | 4568 | | |
| 4569 | + | |
4529 | 4570 | | |
4530 | 4571 | | |
4531 | | - | |
| 4572 | + | |
4532 | 4573 | | |
4533 | 4574 | | |
4534 | 4575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 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 | 50 | | |
83 | 51 | | |
84 | 52 | | |
| |||
121 | 89 | | |
122 | 90 | | |
123 | 91 | | |
124 | | - | |
| 92 | + | |
125 | 93 | | |
126 | 94 | | |
127 | 95 | | |
128 | 96 | | |
129 | 97 | | |
130 | 98 | | |
131 | 99 | | |
132 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
133 | 105 | | |
134 | 106 | | |
135 | 107 | | |
136 | 108 | | |
137 | 109 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
154 | 114 | | |
155 | 115 | | |
156 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
157 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
158 | 123 | | |
159 | | - | |
160 | 124 | | |
161 | 125 | | |
162 | 126 | | |
| |||
306 | 270 | | |
307 | 271 | | |
308 | 272 | | |
309 | | - | |
310 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
311 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
312 | 352 | | |
313 | 353 | | |
314 | 354 | | |
| |||
466 | 506 | | |
467 | 507 | | |
468 | 508 | | |
469 | | - | |
470 | 509 | | |
471 | 510 | | |
472 | 511 | | |
473 | 512 | | |
474 | 513 | | |
475 | 514 | | |
476 | | - | |
| 515 | + | |
477 | 516 | | |
478 | | - | |
| 517 | + | |
479 | 518 | | |
480 | 519 | | |
481 | 520 | | |
| |||
0 commit comments