Commit 0ba1aed
endolinbot
feat(driver): per-tick capture + agent self-improvement loop, CI job (#3)
Per kriskowal CHANGES_REQUESTED review on PR #3:
1. CI workflow at .github/workflows/driver-tests.yml runs
`bash tests/driver/run.sh` and `bash skills/cleaner/test-cleaner.sh`
on push to main and design/driver, and on PR to main. Uses the
ubuntu-latest runner; configures a git identity since the driver
tests build a mock journal that commits.
2. roles/driver/driver.sh wraps each loop iteration's stdout+stderr in
a per-tick capture file, hashes it via `git hash-object -w --stdin`
into the journal object database, and invokes an agent (the
PATH-stubbed `claude` shim in tests, or real `claude` in production)
with a four-slot prompt naming the capture SHA. The agent's analysis
is appended to journal/drivers/<host>/<lane>.improvements.md so a
gardener can review it later.
The capture-and-analyze step runs after the state transition (so the
transcript reflects what the tick actually did) and the agent
invocation forks to a background subshell so it does not block the
next tick. SELF_IMPROVE_SYNC=1 makes the test harness join
synchronously; SELF_IMPROVE_CLAUDE_STUB lets tests inject a
deterministic stub agent.
3. New test tests/driver/test_loop_capture_and_self_improve.sh covers:
- the per-tick blob lands in the journal object DB
(verified via `git cat-file -e <sha>` and a content assertion that
the blob carries the `+ run_once` -x trace);
- the agent is invoked (the stub records the SHA; in the stubless
run the PATH-stubbed claude's log records `claude invoked with -p`);
- the per-lane improvements file accumulates a new section per tick
(file size grows; section count grows).
.gitignore adds explicit negation rules so `.github/` is tracked
despite the root-level dotfile-detritus blanket. The blanket exists
to keep bot SSH/oauth tokens out of the repo; CI workflows are the
one tracked exception today.
Existing tests (test_skeleton, test_design_only_happy_path,
test_trap_fires_on_error) continue passing; the cleaner skeleton
self-test continues passing.
Refs: garden#31 parent 48afa74 commit 0ba1aed
4 files changed
Lines changed: 378 additions & 3 deletions
File tree
- .github/workflows
- roles/driver
- tests/driver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
370 | 494 | | |
371 | 495 | | |
372 | 496 | | |
| |||
455 | 579 | | |
456 | 580 | | |
457 | 581 | | |
458 | | - | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
459 | 585 | | |
460 | 586 | | |
461 | 587 | | |
462 | | - | |
463 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
464 | 594 | | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
465 | 605 | | |
466 | 606 | | |
467 | 607 | | |
| |||
0 commit comments