Repository navigation
Commit 222a973
authored
fix(vibe): keep user comments that follow a managed hook block (#5109)
* fix(vibe): keep user comments that follow a managed hook block
A managed [[hooks]] block ran until the next table header or the end
of the file, so the comments after it were removed with it on every
events refresh and teardown. A comment there usually introduces the
user hook that follows it.
End the block after its last line of TOML and the blank lines right
after it. Lines inside a multiline string or array still belong to the
value.
Refs #5079
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)
* test(vibe): cover the comment boundaries of a managed hook block
The exact-byte removal test covered one comment right after a managed
block. Add the two boundaries the comment-state logic decides: blank
lines after a kept comment stay with it, and a comment followed by
more keys of the managed block is removed with the block.
Refs #5079
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)
* test(vibe): end the multiline-value control on the string; document cleanup
The control passed even without the multiline-string guard, because the
array after the string extended the managed block anyway. Put the string
last so a missing guard leaves its closing lines behind and the test
fails.
Add a Runtime Events note to the Vibe guide: cleanup touches only the
entries Spec Kit wrote, an entry ends after its last TOML line and the
blank lines after it, and the file is deleted when only comments and
blank lines remain.
Refs #5079
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)
* test(vibe): run the comment-boundary cases with CRLF too
The exact-byte removal cases ran only with LF. Run them with CRLF as
well; they fail if the scanner keeps the CR in a line's content. The
refresh test now tears down with the integration and manifest returned
by the refresh call.
Refs #5079
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)
* docs(vibe): say that comments go with a deleted hooks file
The Runtime Events note said cleanup deletes .vibe/hooks.toml when only
comments and blank lines remain, but not that those comments are lost
with it, or that Codex's config.toml follows the same rule.
Refs #5079
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)
* test(vibe): pin teardown when only a trailing comment remains
The trailing-comment case always kept a user hook in the file, so no
test covered the documented comments-only case. Add one: the comment
survives a refresh, and teardown deletes .vibe/hooks.toml.
Refs #5079
Assisted-by: Claude Code (model: claude-opus-5-5, autonomous)1 parent 7b61682 commit 222a973
3 files changed
Lines changed: 140 additions & 2 deletions
File tree
- docs/integrations
- src/specify_cli/integrations/vibe
- tests/integrations
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
70 | 78 | | |
71 | 79 | | |
72 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
398 | 402 | | |
399 | 403 | | |
400 | 404 | | |
| |||
403 | 407 | | |
404 | 408 | | |
405 | 409 | | |
| 410 | + | |
| 411 | + | |
406 | 412 | | |
407 | 413 | | |
408 | 414 | | |
| |||
486 | 492 | | |
487 | 493 | | |
488 | 494 | | |
489 | | - | |
| 495 | + | |
490 | 496 | | |
491 | 497 | | |
492 | 498 | | |
| |||
515 | 521 | | |
516 | 522 | | |
517 | 523 | | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
518 | 534 | | |
519 | 535 | | |
520 | 536 | | |
521 | 537 | | |
522 | 538 | | |
523 | | - | |
| 539 | + | |
524 | 540 | | |
525 | 541 | | |
526 | 542 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
337 | 370 | | |
338 | 371 | | |
339 | 372 | | |
| |||
484 | 517 | | |
485 | 518 | | |
486 | 519 | | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
487 | 534 | | |
488 | 535 | | |
489 | 536 | | |
| |||
569 | 616 | | |
570 | 617 | | |
571 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
572 | 686 | | |
573 | 687 | | |
574 | 688 | | |
| |||
0 commit comments