merge: sync Rongsong's scheduler-framework into chatbot

Full merge of origin/scheduler-framework (scheduler-core restructure,
failover-adoption, WAL_JOB_DISPATCH, apiserver backend health/heartbeat,
build-time versioning, bug-1673/1676/1678/1679/1680).

Conflict resolution:
- scheduler: adopt Rongsong's scheduler-core architecture (driver loop,
  queue project/picker fields, resource bug-1569 fix)
- worker/controller_connector.c: keep Rongsong's reconnect/rejoin
  structure, PORT our bug-1509 resend_job_status onto the rejoin success
  path (his reconnect didn't re-report job state)
- apiserver backend: take Rongsong's health/heartbeat (supersedes our
  e505066 circuit breaker)
- group.c: keep our bug-1513 comment
- misc: take theirs for additive fixes (go_build versioning,
  test_group.c, persist.c RUSAGE_UPDATE, FilterRows bug-1680)

NOTE: our scheduler fixes (bug-1494 family dispatch-fail requeue,
PEND-reason classification) are NOT in Rongsong's branch — needs
verification/porting onto scheduler-core (separate follow-up).

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
lei.chen 2026-08-25 12:33:16 +00:00
commit 4e894d2184
395 changed files with 88517 additions and 5742 deletions

View file

@ -66,7 +66,7 @@ OpenWolf's value comes from learning across sessions. You MUST update `.wolf/cer
**Before fixing:** Read `.wolf/buglog.json` first — the fix may already be known.
**After fixing:** ALWAYS append to `.wolf/buglog.json` with this structure:
**Before appending a new entry:** search existing bugs for the same `file` + overlapping `root_cause`/`error_message`. If a match exists, update THAT entry (`occurrences += 1`, `last_seen = now`, append context to `fix` if the resolution differs) instead of creating a new `bug-NNN`. Never create a second entry under an id that already exists — assign the next unused number after the current max `bug-NNN` in the file (never restart from `bug-001`; a restarted counter collides with existing history and is unrecoverable without a git-history merge). If you fixed something genuinely new, append with this structure:
```json
{
"id": "bug-NNN",
@ -81,9 +81,12 @@ OpenWolf's value comes from learning across sessions. You MUST update `.wolf/cer
"last_seen": "ISO date"
}
```
Always preserve the top-level `{"version": 1, "bugs": [...]}` wrapper — never write a bare array.
**The threshold is LOW.** When in doubt, log it. A false positive in the bug log costs nothing. A missed bug means repeating the same mistake later.
**Integrity is automated, not optional:** a Stop hook (`.wolf/hooks/stop.js`) validates `.wolf/buglog.json` (JSON validity, wrapper format, duplicate IDs, ID count/max going backwards vs. the last commit) after every turn and, if it's valid and grew, commits it standalone (`chore(wolf): checkpoint buglog.json (N bugs)`) so git history is always a recoverable backup. If it shrank or fails validation, the hook refuses to commit and prints why — treat that warning as a stop-and-investigate signal, not noise to scroll past.
## Token Discipline
- Never re-read a file already read this session unless it was modified since.
@ -133,3 +136,4 @@ Before ending or when asked to wrap up:
1. Write a session summary to `.wolf/memory.md`.
2. Review the session: did you learn anything? Did the user correct you? Did you fix a bug? If yes, update `.wolf/cerebrum.md` and/or `.wolf/buglog.json`.
3. Do NOT manually `git add`/commit `.wolf/buglog.json` yourself as part of a feature/task commit — the Stop hook checkpoints it standalone once it validates cleanly (see Bug Logging above). Mixing it into a feature commit just duplicates that history under an unrelated message.

5
.wolf/_scan-state.json Normal file
View file

@ -0,0 +1,5 @@
{
"last_scanned": "2026-08-17T01:00:00.081Z",
"git_head": "397d8e7f9c760ffc8c51df73948ee03aa5f7dfff",
"file_count": 504
}

5358
.wolf/anatomy-index.json Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
{
"last_heartbeat": "2026-06-27T15:46:46.219Z",
"last_heartbeat": "2026-08-17T15:18:42.178Z",
"engine_status": "running",
"execution_log": [
{
@ -472,6 +472,97 @@
"status": "success",
"timestamp": "2026-06-27T13:00:00.671Z",
"duration_ms": 45
},
{
"task_id": "project-suggestions",
"status": "success",
"timestamp": "2026-08-15T13:04:20.520Z",
"duration_ms": 74147
},
{
"task_id": "project-suggestions",
"status": "success",
"timestamp": "2026-08-15T13:06:46.442Z",
"duration_ms": 145921
},
{
"task_id": "project-suggestions",
"status": "success",
"timestamp": "2026-08-15T13:06:46.442Z",
"duration_ms": 81092
},
{
"task_id": "cerebrum-reflection",
"status": "failed",
"timestamp": "2026-08-15T13:18:59.222Z",
"duration_ms": 122567,
"error": "claude -p failed: spawnSync claude ETIMEDOUT"
},
{
"task_id": "token-audit",
"status": "success",
"timestamp": "2026-08-15T13:18:59.603Z",
"duration_ms": 376
},
{
"task_id": "memory-consolidation",
"status": "success",
"timestamp": "2026-08-15T13:18:59.621Z",
"duration_ms": 10
},
{
"task_id": "anatomy-rescan",
"status": "success",
"timestamp": "2026-08-15T13:18:59.749Z",
"duration_ms": 123
},
{
"task_id": "anatomy-rescan",
"status": "success",
"timestamp": "2026-08-15T19:00:00.088Z",
"duration_ms": 71
},
{
"task_id": "anatomy-rescan",
"status": "success",
"timestamp": "2026-08-16T01:00:00.099Z",
"duration_ms": 72
},
{
"task_id": "anatomy-rescan",
"status": "success",
"timestamp": "2026-08-16T07:00:00.069Z",
"duration_ms": 58
},
{
"task_id": "memory-consolidation",
"status": "success",
"timestamp": "2026-08-16T09:00:00.009Z",
"duration_ms": 3
},
{
"task_id": "cerebrum-reflection",
"status": "success",
"timestamp": "2026-08-16T10:01:48.349Z",
"duration_ms": 108347
},
{
"task_id": "anatomy-rescan",
"status": "success",
"timestamp": "2026-08-16T13:00:00.063Z",
"duration_ms": 59
},
{
"task_id": "anatomy-rescan",
"status": "success",
"timestamp": "2026-08-16T19:00:00.061Z",
"duration_ms": 50
},
{
"task_id": "anatomy-rescan",
"status": "success",
"timestamp": "2026-08-17T01:00:00.082Z",
"duration_ms": 52
}
],
"dead_letter_queue": [],

View file

@ -231,3 +231,215 @@
[2026-06-27T11:21:07.515Z] [INFO] Task Consolidate old memory completed in 7ms
[2026-06-27T13:00:00.626Z] [INFO] Executing task: Full anatomy rescan
[2026-06-27T13:00:00.671Z] [INFO] Task Full anatomy rescan completed in 45ms
[2026-08-15T13:01:28.414Z] [INFO] Scheduled task: Full anatomy rescan (0 */6 * * *)
[2026-08-15T13:01:28.415Z] [INFO] Scheduled task: Consolidate old memory (0 2 * * *)
[2026-08-15T13:01:28.415Z] [INFO] Scheduled task: Token audit report (0 0 * * 1)
[2026-08-15T13:01:28.415Z] [INFO] Scheduled task: Cerebrum reflection (0 3 * * 0)
[2026-08-15T13:01:28.416Z] [INFO] Scheduled task: AI suggestions (0 4 * * 1)
[2026-08-15T13:01:28.417Z] [INFO] File watcher started on .wolf/
[2026-08-15T13:01:28.417Z] [INFO] OpenWolf daemon started
[2026-08-15T13:01:28.420Z] [INFO] Dashboard server listening on 127.0.0.1:18791
[2026-08-15T13:01:34.596Z] [INFO] WebSocket client connected
[2026-08-15T13:03:06.373Z] [INFO] Executing task: AI suggestions
[2026-08-15T13:04:20.520Z] [INFO] Task AI suggestions completed in 74147ms
[2026-08-15T13:04:20.521Z] [INFO] Executing task: AI suggestions
[2026-08-15T13:05:25.350Z] [INFO] Executing task: AI suggestions
[2026-08-15T13:06:46.442Z] [INFO] Task AI suggestions completed in 145921ms
[2026-08-15T13:06:46.443Z] [INFO] Task AI suggestions completed in 81092ms
[2026-08-15T13:06:46.956Z] [WARN] Skipping broadcast for large file: token-ledger.json (24571127 bytes)
[2026-08-15T13:07:28.520Z] [WARN] Skipping broadcast for large file: token-ledger.json (24573304 bytes)
[2026-08-15T13:16:56.654Z] [INFO] Executing task: Cerebrum reflection
[2026-08-15T13:18:59.222Z] [ERROR] Task Cerebrum reflection failed (attempt 1): claude -p failed: spawnSync claude ETIMEDOUT
[2026-08-15T13:18:59.227Z] [INFO] Executing task: Token audit report
[2026-08-15T13:18:59.604Z] [INFO] Task Token audit report completed in 376ms
[2026-08-15T13:18:59.611Z] [INFO] Executing task: Consolidate old memory
[2026-08-15T13:18:59.624Z] [INFO] Task Consolidate old memory completed in 10ms
[2026-08-15T13:18:59.626Z] [INFO] Executing task: Full anatomy rescan
[2026-08-15T13:18:59.749Z] [INFO] Task Full anatomy rescan completed in 123ms
[2026-08-15T13:19:00.152Z] [WARN] Skipping broadcast for large file: token-ledger.json (24876869 bytes)
[2026-08-15T13:24:12.596Z] [WARN] Skipping broadcast for large file: token-ledger.json (24877689 bytes)
[2026-08-15T13:27:58.605Z] [WARN] Skipping broadcast for large file: token-ledger.json (24878754 bytes)
[2026-08-15T13:52:33.306Z] [WARN] Skipping broadcast for large file: token-ledger.json (24879819 bytes)
[2026-08-15T13:54:11.597Z] [WARN] Skipping broadcast for large file: token-ledger.json (24880884 bytes)
[2026-08-15T14:21:47.572Z] [WARN] Skipping broadcast for large file: token-ledger.json (24883043 bytes)
[2026-08-15T14:26:25.189Z] [WARN] Skipping broadcast for large file: token-ledger.json (24885202 bytes)
[2026-08-15T14:27:54.858Z] [WARN] Skipping broadcast for large file: token-ledger.json (24887622 bytes)
[2026-08-15T14:30:14.219Z] [WARN] Skipping broadcast for large file: token-ledger.json (24887622 bytes)
[2026-08-15T14:54:01.006Z] [WARN] Skipping broadcast for large file: token-ledger.json (24888193 bytes)
[2026-08-15T14:57:34.473Z] [WARN] Skipping broadcast for large file: token-ledger.json (24888931 bytes)
[2026-08-15T15:00:38.569Z] [WARN] Skipping broadcast for large file: token-ledger.json (24889669 bytes)
[2026-08-15T19:00:00.017Z] [INFO] Executing task: Full anatomy rescan
[2026-08-15T19:00:00.089Z] [INFO] Task Full anatomy rescan completed in 71ms
[2026-08-15T22:07:02.636Z] [WARN] Skipping broadcast for large file: token-ledger.json (24890666 bytes)
[2026-08-15T22:09:00.084Z] [WARN] Skipping broadcast for large file: token-ledger.json (24891663 bytes)
[2026-08-15T22:11:38.636Z] [WARN] Skipping broadcast for large file: token-ledger.json (24891663 bytes)
[2026-08-15T22:58:39.561Z] [WARN] Skipping broadcast for large file: token-ledger.json (24892786 bytes)
[2026-08-16T01:00:00.027Z] [INFO] Executing task: Full anatomy rescan
[2026-08-16T01:00:00.100Z] [INFO] Task Full anatomy rescan completed in 72ms
[2026-08-16T03:09:42.740Z] [WARN] Skipping broadcast for large file: token-ledger.json (24892786 bytes)
[2026-08-16T03:10:29.533Z] [WARN] Skipping broadcast for large file: token-ledger.json (24892786 bytes)
[2026-08-16T03:25:49.699Z] [WARN] Skipping broadcast for large file: token-ledger.json (24892786 bytes)
[2026-08-16T03:29:20.075Z] [WARN] Skipping broadcast for large file: token-ledger.json (24894217 bytes)
[2026-08-16T03:33:25.395Z] [WARN] Skipping broadcast for large file: token-ledger.json (24896084 bytes)
[2026-08-16T03:42:22.230Z] [WARN] Skipping broadcast for large file: token-ledger.json (24898138 bytes)
[2026-08-16T03:57:37.555Z] [WARN] Skipping broadcast for large file: token-ledger.json (24901175 bytes)
[2026-08-16T04:03:04.277Z] [WARN] Skipping broadcast for large file: token-ledger.json (24904212 bytes)
[2026-08-16T04:07:33.891Z] [WARN] Skipping broadcast for large file: token-ledger.json (24907249 bytes)
[2026-08-16T04:13:37.260Z] [WARN] Skipping broadcast for large file: token-ledger.json (24911570 bytes)
[2026-08-16T04:29:52.676Z] [WARN] Skipping broadcast for large file: token-ledger.json (24917616 bytes)
[2026-08-16T04:30:32.246Z] [WARN] Skipping broadcast for large file: token-ledger.json (24923662 bytes)
[2026-08-16T07:00:00.011Z] [INFO] Executing task: Full anatomy rescan
[2026-08-16T07:00:00.069Z] [INFO] Task Full anatomy rescan completed in 58ms
[2026-08-16T07:54:39.750Z] [WARN] Skipping broadcast for large file: buglog.json (1051264 bytes)
[2026-08-16T07:55:39.821Z] [WARN] Skipping broadcast for large file: token-ledger.json (24945063 bytes)
[2026-08-16T07:56:19.583Z] [WARN] Skipping broadcast for large file: token-ledger.json (24966464 bytes)
[2026-08-16T09:00:00.005Z] [INFO] Executing task: Consolidate old memory
[2026-08-16T09:00:00.009Z] [INFO] Task Consolidate old memory completed in 3ms
[2026-08-16T09:39:05.129Z] [WARN] Skipping broadcast for large file: token-ledger.json (24966464 bytes)
[2026-08-16T09:43:06.232Z] [WARN] Skipping broadcast for large file: token-ledger.json (24969223 bytes)
[2026-08-16T09:44:26.295Z] [WARN] Skipping broadcast for large file: token-ledger.json (24973180 bytes)
[2026-08-16T09:48:34.756Z] [WARN] Skipping broadcast for large file: token-ledger.json (24978982 bytes)
[2026-08-16T09:50:30.590Z] [WARN] Skipping broadcast for large file: token-ledger.json (24985073 bytes)
[2026-08-16T09:54:06.633Z] [WARN] Skipping broadcast for large file: buglog.json (1051719 bytes)
[2026-08-16T09:54:32.541Z] [WARN] Skipping broadcast for large file: token-ledger.json (24991760 bytes)
[2026-08-16T09:57:57.949Z] [WARN] Skipping broadcast for large file: token-ledger.json (24998447 bytes)
[2026-08-16T10:00:00.002Z] [INFO] Executing task: Cerebrum reflection
[2026-08-16T10:01:48.349Z] [INFO] Task Cerebrum reflection completed in 108347ms
[2026-08-16T10:01:48.855Z] [WARN] Skipping broadcast for large file: token-ledger.json (24998447 bytes)
[2026-08-16T10:26:56.030Z] [WARN] Skipping broadcast for large file: buglog.json (1052041 bytes)
[2026-08-16T10:44:47.597Z] [WARN] Skipping broadcast for large file: buglog.json (1055323 bytes)
[2026-08-16T10:48:37.601Z] [WARN] Skipping broadcast for large file: token-ledger.json (25001929 bytes)
[2026-08-16T10:54:14.787Z] [WARN] Skipping broadcast for large file: token-ledger.json (25005801 bytes)
[2026-08-16T10:55:56.197Z] [WARN] Skipping broadcast for large file: token-ledger.json (25009673 bytes)
[2026-08-16T11:02:23.822Z] [WARN] Skipping broadcast for large file: token-ledger.json (25013545 bytes)
[2026-08-16T11:06:33.554Z] [WARN] Skipping broadcast for large file: token-ledger.json (25017417 bytes)
[2026-08-16T11:09:16.737Z] [WARN] Skipping broadcast for large file: token-ledger.json (25021289 bytes)
[2026-08-16T11:11:16.095Z] [WARN] Skipping broadcast for large file: token-ledger.json (25025161 bytes)
[2026-08-16T11:12:54.330Z] [WARN] Skipping broadcast for large file: buglog.json (1055840 bytes)
[2026-08-16T11:13:46.190Z] [WARN] Skipping broadcast for large file: token-ledger.json (25030520 bytes)
[2026-08-16T11:16:45.229Z] [WARN] Skipping broadcast for large file: token-ledger.json (25036905 bytes)
[2026-08-16T11:19:18.137Z] [WARN] Skipping broadcast for large file: token-ledger.json (25044773 bytes)
[2026-08-16T12:12:34.901Z] [WARN] Skipping broadcast for large file: buglog.json (1056374 bytes)
[2026-08-16T12:12:47.529Z] [WARN] Skipping broadcast for large file: buglog.json (1056374 bytes)
[2026-08-16T12:12:58.126Z] [WARN] Skipping broadcast for large file: buglog.json (1056852 bytes)
[2026-08-16T12:13:24.334Z] [WARN] Skipping broadcast for large file: token-ledger.json (25054423 bytes)
[2026-08-16T13:00:00.003Z] [INFO] Executing task: Full anatomy rescan
[2026-08-16T13:00:00.063Z] [INFO] Task Full anatomy rescan completed in 59ms
[2026-08-16T19:00:00.011Z] [INFO] Executing task: Full anatomy rescan
[2026-08-16T19:00:00.062Z] [INFO] Task Full anatomy rescan completed in 50ms
[2026-08-17T01:00:00.030Z] [INFO] Executing task: Full anatomy rescan
[2026-08-17T01:00:00.082Z] [INFO] Task Full anatomy rescan completed in 52ms
[2026-08-17T03:12:49.332Z] [WARN] Skipping broadcast for large file: token-ledger.json (25054423 bytes)
[2026-08-17T03:24:41.458Z] [WARN] Skipping broadcast for large file: token-ledger.json (25055744 bytes)
[2026-08-17T03:32:41.910Z] [WARN] Skipping broadcast for large file: token-ledger.json (25057534 bytes)
[2026-08-17T03:39:11.757Z] [WARN] Skipping broadcast for large file: buglog.json (1063044 bytes)
[2026-08-17T03:39:56.974Z] [WARN] Skipping broadcast for large file: token-ledger.json (25060120 bytes)
[2026-08-17T03:40:20.550Z] [WARN] Skipping broadcast for large file: token-ledger.json (25062706 bytes)
[2026-08-17T03:45:49.920Z] [WARN] Skipping broadcast for large file: buglog.json (1061406 bytes)
[2026-08-17T03:48:12.843Z] [WARN] Skipping broadcast for large file: token-ledger.json (25066131 bytes)
[2026-08-17T03:49:55.640Z] [WARN] Skipping broadcast for large file: buglog.json (1065275 bytes)
[2026-08-17T03:50:20.223Z] [WARN] Skipping broadcast for large file: token-ledger.json (25069839 bytes)
[2026-08-17T03:59:28.024Z] [WARN] Skipping broadcast for large file: token-ledger.json (25073547 bytes)
[2026-08-17T04:15:01.342Z] [WARN] Skipping broadcast for large file: token-ledger.json (25077733 bytes)
[2026-08-17T04:16:57.886Z] [WARN] Skipping broadcast for large file: token-ledger.json (25081919 bytes)
[2026-08-17T04:20:46.730Z] [WARN] Skipping broadcast for large file: token-ledger.json (25086105 bytes)
[2026-08-17T04:21:14.128Z] [WARN] Skipping broadcast for large file: token-ledger.json (25090291 bytes)
[2026-08-17T04:24:03.241Z] [WARN] Skipping broadcast for large file: token-ledger.json (25094477 bytes)
[2026-08-17T04:28:50.732Z] [WARN] Skipping broadcast for large file: token-ledger.json (25098663 bytes)
[2026-08-17T04:34:02.459Z] [WARN] Skipping broadcast for large file: token-ledger.json (25102849 bytes)
[2026-08-17T04:39:49.985Z] [WARN] Skipping broadcast for large file: token-ledger.json (25107035 bytes)
[2026-08-17T04:40:55.933Z] [WARN] Skipping broadcast for large file: token-ledger.json (25111221 bytes)
[2026-08-17T04:59:40.319Z] [WARN] Skipping broadcast for large file: buglog.json (1063673 bytes)
[2026-08-17T05:01:34.303Z] [WARN] Skipping broadcast for large file: buglog.json (1064135 bytes)
[2026-08-17T05:03:43.681Z] [WARN] Skipping broadcast for large file: buglog.json (1070435 bytes)
[2026-08-17T05:04:02.941Z] [WARN] Skipping broadcast for large file: token-ledger.json (25116887 bytes)
[2026-08-17T05:06:32.564Z] [WARN] Skipping broadcast for large file: token-ledger.json (25122553 bytes)
[2026-08-17T05:09:21.444Z] [WARN] Skipping broadcast for large file: token-ledger.json (25128219 bytes)
[2026-08-17T05:12:24.303Z] [WARN] Skipping broadcast for large file: token-ledger.json (25133885 bytes)
[2026-08-17T05:15:58.232Z] [WARN] Skipping broadcast for large file: token-ledger.json (25139551 bytes)
[2026-08-17T05:16:46.024Z] [WARN] Skipping broadcast for large file: token-ledger.json (25145217 bytes)
[2026-08-17T05:20:18.750Z] [WARN] Skipping broadcast for large file: token-ledger.json (25150883 bytes)
[2026-08-17T05:24:51.506Z] [WARN] Skipping broadcast for large file: token-ledger.json (25156549 bytes)
[2026-08-17T05:30:07.822Z] [WARN] Skipping broadcast for large file: token-ledger.json (25162215 bytes)
[2026-08-17T05:35:53.930Z] [WARN] Skipping broadcast for large file: token-ledger.json (25167881 bytes)
[2026-08-17T05:36:48.520Z] [WARN] Skipping broadcast for large file: buglog.json (1070838 bytes)
[2026-08-17T05:37:23.462Z] [WARN] Skipping broadcast for large file: token-ledger.json (25173547 bytes)
[2026-08-17T06:35:15.163Z] [WARN] Skipping broadcast for large file: token-ledger.json (25179213 bytes)
[2026-08-17T06:41:49.133Z] [WARN] Skipping broadcast for large file: buglog.json (1069203 bytes)
[2026-08-17T06:44:51.542Z] [WARN] Skipping broadcast for large file: buglog.json (1069675 bytes)
[2026-08-17T06:45:18.377Z] [WARN] Skipping broadcast for large file: buglog.json (1069747 bytes)
[2026-08-17T06:46:32.073Z] [WARN] Skipping broadcast for large file: token-ledger.json (25187054 bytes)
[2026-08-17T06:51:14.293Z] [WARN] Skipping broadcast for large file: buglog.json (1070213 bytes)
[2026-08-17T06:52:22.301Z] [WARN] Skipping broadcast for large file: buglog.json (1070674 bytes)
[2026-08-17T06:53:24.185Z] [WARN] Skipping broadcast for large file: buglog.json (1070785 bytes)
[2026-08-17T06:53:42.080Z] [WARN] Skipping broadcast for large file: buglog.json (1070888 bytes)
[2026-08-17T06:54:46.689Z] [WARN] Skipping broadcast for large file: token-ledger.json (25197814 bytes)
[2026-08-17T07:00:05.799Z] [WARN] Skipping broadcast for large file: buglog.json (1071346 bytes)
[2026-08-17T07:00:21.583Z] [WARN] Skipping broadcast for large file: buglog.json (1071859 bytes)
[2026-08-17T07:01:07.462Z] [WARN] Skipping broadcast for large file: token-ledger.json (25209540 bytes)
[2026-08-17T07:15:26.751Z] [WARN] Skipping broadcast for large file: buglog.json (1072346 bytes)
[2026-08-17T07:15:59.445Z] [WARN] Skipping broadcast for large file: buglog.json (1072929 bytes)
[2026-08-17T07:20:40.296Z] [WARN] Skipping broadcast for large file: buglog.json (1080799 bytes)
[2026-08-17T07:23:09.680Z] [WARN] Skipping broadcast for large file: token-ledger.json (25222829 bytes)
[2026-08-17T07:24:31.538Z] [WARN] Skipping broadcast for large file: token-ledger.json (25236118 bytes)
[2026-08-17T07:25:25.121Z] [WARN] Skipping broadcast for large file: token-ledger.json (25249690 bytes)
[2026-08-17T07:28:49.540Z] [WARN] Skipping broadcast for large file: token-ledger.json (25263262 bytes)
[2026-08-17T07:33:33.866Z] [WARN] Skipping broadcast for large file: token-ledger.json (25276834 bytes)
[2026-08-17T07:38:51.141Z] [WARN] Skipping broadcast for large file: token-ledger.json (25290406 bytes)
[2026-08-17T07:44:30.081Z] [WARN] Skipping broadcast for large file: token-ledger.json (25303978 bytes)
[2026-08-17T07:45:26.246Z] [WARN] Skipping broadcast for large file: token-ledger.json (25317550 bytes)
[2026-08-17T07:47:54.626Z] [WARN] Skipping broadcast for large file: token-ledger.json (25331122 bytes)
[2026-08-17T07:49:21.007Z] [WARN] Skipping broadcast for large file: token-ledger.json (25344694 bytes)
[2026-08-17T07:50:37.592Z] [WARN] Skipping broadcast for large file: token-ledger.json (25358266 bytes)
[2026-08-17T07:53:59.415Z] [WARN] Skipping broadcast for large file: token-ledger.json (25371838 bytes)
[2026-08-17T07:57:26.795Z] [WARN] Skipping broadcast for large file: token-ledger.json (25385410 bytes)
[2026-08-17T07:59:35.036Z] [WARN] Skipping broadcast for large file: token-ledger.json (25398982 bytes)
[2026-08-17T08:02:07.627Z] [WARN] Skipping broadcast for large file: buglog.json (1079144 bytes)
[2026-08-17T08:02:16.190Z] [WARN] Skipping broadcast for large file: buglog.json (1079144 bytes)
[2026-08-17T08:02:23.187Z] [WARN] Skipping broadcast for large file: buglog.json (1079144 bytes)
[2026-08-17T08:03:27.512Z] [WARN] Skipping broadcast for large file: buglog.json (1079612 bytes)
[2026-08-17T08:04:41.883Z] [WARN] Skipping broadcast for large file: token-ledger.json (25414806 bytes)
[2026-08-17T08:06:41.587Z] [WARN] Skipping broadcast for large file: token-ledger.json (25430630 bytes)
[2026-08-17T08:07:19.858Z] [WARN] Skipping broadcast for large file: token-ledger.json (25446454 bytes)
[2026-08-17T08:09:29.541Z] [WARN] Skipping broadcast for large file: token-ledger.json (25462278 bytes)
[2026-08-17T08:17:55.298Z] [WARN] Skipping broadcast for large file: buglog.json (1083228 bytes)
[2026-08-17T08:18:40.853Z] [WARN] Skipping broadcast for large file: buglog.json (1081583 bytes)
[2026-08-17T08:19:13.835Z] [WARN] Skipping broadcast for large file: buglog.json (1082054 bytes)
[2026-08-17T08:19:31.320Z] [WARN] Skipping broadcast for large file: buglog.json (1082577 bytes)
[2026-08-17T08:21:06.888Z] [WARN] Skipping broadcast for large file: token-ledger.json (25479243 bytes)
[2026-08-17T08:24:49.636Z] [WARN] Skipping broadcast for large file: buglog.json (1083102 bytes)
[2026-08-17T08:28:11.278Z] [WARN] Skipping broadcast for large file: token-ledger.json (25497387 bytes)
[2026-08-17T08:29:19.790Z] [WARN] Skipping broadcast for large file: buglog.json (1088405 bytes)
[2026-08-17T08:31:31.095Z] [WARN] Skipping broadcast for large file: token-ledger.json (25516688 bytes)
[2026-08-17T08:34:43.697Z] [WARN] Skipping broadcast for large file: token-ledger.json (25516688 bytes)
[2026-08-17T08:57:37.363Z] [WARN] Skipping broadcast for large file: buglog.json (1093741 bytes)
[2026-08-17T08:58:03.456Z] [WARN] Skipping broadcast for large file: token-ledger.json (25517562 bytes)
[2026-08-17T09:02:04.430Z] [WARN] Skipping broadcast for large file: token-ledger.json (25518436 bytes)
[2026-08-17T09:14:32.289Z] [WARN] Skipping broadcast for large file: buglog.json (1092086 bytes)
[2026-08-17T09:14:36.236Z] [WARN] Skipping broadcast for large file: buglog.json (1092675 bytes)
[2026-08-17T09:45:13.845Z] [WARN] Skipping broadcast for large file: buglog.json (1098429 bytes)
[2026-08-17T09:46:28.111Z] [WARN] Skipping broadcast for large file: token-ledger.json (25527422 bytes)
[2026-08-17T10:03:41.154Z] [WARN] Skipping broadcast for large file: buglog.json (1097133 bytes)
[2026-08-17T10:04:00.430Z] [WARN] Skipping broadcast for large file: token-ledger.json (25537430 bytes)
[2026-08-17T10:14:50.744Z] [WARN] Skipping broadcast for large file: buglog.json (1095780 bytes)
[2026-08-17T10:16:21.747Z] [WARN] Skipping broadcast for large file: buglog.json (1096245 bytes)
[2026-08-17T10:16:40.562Z] [WARN] Skipping broadcast for large file: buglog.json (1096332 bytes)
[2026-08-17T10:16:56.772Z] [WARN] Skipping broadcast for large file: buglog.json (1096443 bytes)
[2026-08-17T10:31:46.868Z] [WARN] Skipping broadcast for large file: buglog.json (1096903 bytes)
[2026-08-17T10:34:06.915Z] [WARN] Skipping broadcast for large file: buglog.json (1101568 bytes)
[2026-08-17T10:35:48.230Z] [WARN] Skipping broadcast for large file: token-ledger.json (25550565 bytes)
[2026-08-17T10:38:08.101Z] [WARN] Skipping broadcast for large file: token-ledger.json (25563700 bytes)
[2026-08-17T10:42:24.689Z] [WARN] Skipping broadcast for large file: token-ledger.json (25576835 bytes)
[2026-08-17T10:51:01.356Z] [WARN] Skipping broadcast for large file: buglog.json (1107851 bytes)
[2026-08-17T11:03:03.751Z] [WARN] Skipping broadcast for large file: token-ledger.json (25576835 bytes)
[2026-08-17T12:00:29.788Z] [WARN] Skipping broadcast for large file: buglog.json (1107482 bytes)
[2026-08-17T12:00:40.773Z] [WARN] Skipping broadcast for large file: buglog.json (1107538 bytes)
[2026-08-17T12:02:57.737Z] [WARN] Skipping broadcast for large file: token-ledger.json (25578195 bytes)
[2026-08-17T12:36:45.126Z] [WARN] Skipping broadcast for large file: buglog.json (1111201 bytes)
[2026-08-17T12:36:55.172Z] [WARN] Skipping broadcast for large file: buglog.json (1111248 bytes)
[2026-08-17T12:38:44.269Z] [WARN] Skipping broadcast for large file: token-ledger.json (25583333 bytes)
[2026-08-17T14:44:08.311Z] [WARN] Skipping broadcast for large file: token-ledger.json (25592840 bytes)
[2026-08-17T14:50:00.084Z] [WARN] Skipping broadcast for large file: token-ledger.json (25603695 bytes)
[2026-08-17T14:53:37.553Z] [WARN] Skipping broadcast for large file: token-ledger.json (25615433 bytes)
[2026-08-17T15:00:29.231Z] [WARN] Skipping broadcast for large file: token-ledger.json (25627432 bytes)
[2026-08-17T15:13:14.029Z] [WARN] Skipping broadcast for large file: token-ledger.json (25641990 bytes)

View file

@ -1,11 +1,18 @@
import * as fs from "node:fs";
import * as path from "node:path";
import { execFileSync } from "node:child_process";
import { getWolfDir, ensureWolfDir, readJSON, writeJSON, appendMarkdown, timeShort } from "./shared.js";
async function main() {
ensureWolfDir();
const wolfDir = getWolfDir();
const hooksDir = path.join(wolfDir, "hooks");
const sessionFile = path.join(hooksDir, "_session.json");
const projectRoot = process.env.CLAUDE_PROJECT_DIR || process.cwd();
// Runs every stop regardless of read/write activity this turn, and
// regardless of whether buglog.json was edited via the Write/Edit tool
// or via a raw script (the common path for a file this large) — this
// is the only guard that can't be bypassed by which tool touched it.
checkAndCheckpointBuglog(wolfDir, projectRoot);
const session = readJSON(sessionFile, {
session_id: "",
started: "",
@ -143,5 +150,87 @@ function checkCerebrumFreshness(wolfDir, session) {
// cerebrum.md doesn't exist, that's ok
}
}
/**
* Validate .wolf/buglog.json on disk and, if it's well-formed and grew
* (or stayed the same) relative to the last commit, checkpoint it as its
* own standalone commit. Never commits a shrinking or malformed file —
* that would enshrine data loss (or corruption) into git history, which
* is exactly the failure mode this guard exists to catch before it repeats.
*/
function checkAndCheckpointBuglog(wolfDir, projectRoot) {
const buglogPath = path.join(wolfDir, "buglog.json");
if (!fs.existsSync(buglogPath))
return;
let raw;
try {
raw = fs.readFileSync(buglogPath, "utf-8");
}
catch {
return;
}
let parsed;
try {
parsed = JSON.parse(raw);
}
catch (e) {
process.stderr.write(`🛑 OpenWolf: .wolf/buglog.json is not valid JSON (${e.message}). NOT checkpointing — fix this before it's lost for good.\n`);
return;
}
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed) || !Array.isArray(parsed.bugs)) {
process.stderr.write(`🛑 OpenWolf: .wolf/buglog.json must be {"version":1,"bugs":[...]}, not a bare array or other shape. NOT checkpointing.\n`);
return;
}
const bugs = parsed.bugs;
const idNum = (id) => {
const m = /^bug-(\d+)$/.exec(id || "");
return m ? parseInt(m[1], 10) : 0;
};
const currentMaxId = bugs.reduce((max, b) => Math.max(max, idNum(b.id)), 0);
const idCounts = {};
for (const b of bugs)
idCounts[b.id] = (idCounts[b.id] || 0) + 1;
const dupes = Object.keys(idCounts).filter((id) => idCounts[id] > 1);
if (dupes.length > 0) {
process.stderr.write(`⚠️ OpenWolf: buglog.json has duplicate ids (${dupes.slice(0, 5).join(", ")}${dupes.length > 5 ? ", ..." : ""}). Before adding a new bug, search for an existing entry with the same file+root_cause and bump its occurrences instead of appending a new one under a colliding or fresh id.\n`);
}
let lastCount = null;
let lastMaxId = null;
try {
const committed = execFileSync("git", ["show", "HEAD:.wolf/buglog.json"], {
cwd: projectRoot,
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
});
const lastParsed = JSON.parse(committed);
const lastBugs = Array.isArray(lastParsed) ? lastParsed : (lastParsed.bugs || []);
lastCount = lastBugs.length;
lastMaxId = lastBugs.reduce((max, b) => Math.max(max, idNum(b.id)), 0);
}
catch {
// No committed version yet (or git unavailable) — nothing to compare against.
}
if (lastCount !== null && bugs.length < lastCount) {
process.stderr.write(`🛑 OpenWolf: buglog.json SHRANK from ${lastCount} to ${bugs.length} bugs since the last commit. NOT auto-committing — this looks like data loss, investigate (check git history / other worktrees) before committing manually.\n`);
return;
}
if (lastMaxId !== null && currentMaxId < lastMaxId && bugs.length > 0) {
process.stderr.write(`🛑 OpenWolf: buglog.json's highest id (bug-${currentMaxId}) is lower than the last commit's (bug-${lastMaxId}) — looks like the id counter was reset. NOT auto-committing.\n`);
return;
}
try {
const status = execFileSync("git", ["status", "--porcelain", "--", ".wolf/buglog.json"], {
cwd: projectRoot,
encoding: "utf-8",
});
if (!status.trim())
return; // nothing changed since last commit
execFileSync("git", ["add", ".wolf/buglog.json"], { cwd: projectRoot });
execFileSync("git", ["commit", "-m", `chore(wolf): checkpoint buglog.json (${bugs.length} bugs)`], { cwd: projectRoot });
process.stderr.write(`✅ OpenWolf: checkpointed buglog.json (${bugs.length} bugs) to git.\n`);
}
catch (e) {
process.stderr.write(`⚠️ OpenWolf: buglog.json is valid but the checkpoint commit failed: ${e.message}\n`);
}
}
main().catch(() => process.exit(0));
//# sourceMappingURL=stop.js.map

View file

@ -1,4 +1,30 @@
{
"suggestions": [],
"generated_at": null
"generated_at": "2026-08-15T13:06:46.441Z",
"achievements": [
"scheduler-core spec: extracted xce_sched_core_t as a controller-I/O-free scheduling engine, implemented the builtin_fcfs picker plugin behind a stable xce_job_picker_iface_t, and wired it through 15+ rounds of TDD with a link-time isolation test (test_core_isolation.c) proving zero controller coupling",
"scheduler-core: built a full session-replay subsystem (recording.c/recording_events.c/recording_session.c) with hardened path validation that closed two real CWE-59 symlink/hardlink-alias vulnerabilities (found and fixed across 3 review rounds), plus a simulation-mode replay engine (sim.c/sim_loop.c/sim_verify.c) and an interactive REPL debugger (repl.c/repl_break.c/repl_info.c/repl_params.c) with breakpoints and equivalence testing against real recorded sessions",
"scheduler-core: added OPCode_schedAdmin end-to-end — scheduler-side handler, controller-side dispatch/timeout, and xceadmin CLI (`scheduler record start/stop/status`, `scheduler dump`) — closing the loop for remote recording control",
"component-failover-adoption: unified the scheduler's multi-candidate connect/rejoin pipeline (decision-publish retry-until-success, decision redelivery, backpressure handling) and rewrote the apiserver's Go-side candidate/reconnect logic (candidates.go, clib.go, reconnect.go, heartbeat.go) with 100+ new Go unit tests, all verified against real xce-build.sh ASAN builds",
"Documentation integrity sweep (Aug 8): audited and fixed 40+ drifted claims across deployment.md, api-standards.md, ha-async-io.md, and ~15 closed HA-spec design.md files (stale line citations, missing 'superseded by' notes tying old specs to raft-drive-async/ha-commit-durability/config-upgrade-snapshot)",
"Landed and live-soak-verified several concrete bug fixes: bug-1462 (config-replication commit-tag clamp), bug-1454/1456 (scheduler --peers dangling-pointer regression), and multiple xceadmin config-tool correctness fixes (resource-unit mapping, config dump/build round-trip)",
"Caught a real production-blocking gap before shipping: /kiro-validate-impl on component-failover-adoption returned NO-GO because the apiserver never re-issues its application-level rejoin after the transport layer recovers from a controller failover (bug-1547/1548) — validation process worked as intended"
],
"improvements": [
"Fix bug-1548: wire apiserver's heartbeat/health-check loop to call checkAndPerformRejoin() on transport-reconnect, not only on candidate-generation change — this is the sole blocker for component-failover-adoption's GO",
"Environment fragility is now a repeat offender: bug-1439 (concurrent xce-build.sh runs clobbering the shared xce.build dir) and bug-918 (nix capnpc hash-pin drift) have each recurred 3+ times across sessions — worth a durable fix (per-invocation build dirs or a build lockfile) instead of continuing to manually retry",
"Apply the Unity nested-BEGIN/END fix (UnitySetTestFile) as a lint/CI check rather than a one-off sweep, since it was masking real test failures across ~80 controller test files until caught",
"scheduler-core's REPL/sim modules (repl_info.c, repl_break.c, sim_loop.c) are growing fast under the 800-line-per-file convention — worth a periodic split-check as the spec approaches closure"
],
"next_tasks": [
"Land the apiserver rejoin-after-reconnect fix for bug-1548 and re-run /kiro-validate-impl on component-failover-adoption to flip it to GO",
"Continue scheduler-core to closure — remaining REPL/sim equivalence coverage and a final full-suite + live-HA-soak validation pass before marking implementation-complete",
"Resume the scaffolded-but-not-started specs: ha-client-multimaster and admin-config-tool (both have requirements.md but no design/tasks yet)",
"Check status of clusterconfig-schema-split (tasks.md exists) — confirm whether it's still blocked or ready for implementation given recent config-replication changes"
],
"risks": [
"component-failover-adoption is currently NO-GO in production terms: shipping without the apiserver rejoin fix leaves a real HA failover gap (apiserver silently stops recovering after a controller election)",
"Repeated build/toolchain fragility (nix capnpc pinning, concurrent xce-build.sh races) has cost multiple sessions of lost time and produced false negatives in validation runs — this is now a recurring operational risk, not a one-off",
"The buglog has grown very large (1500+ entries) with a number of items explicitly logged as 'not fixed, out of scope, needs owner' — worth confirming these aren't silently accumulating into an unaddressed backlog",
"scheduler-core is one of the largest specs run (30+ tasks across many subagent sessions); integration risk is high where it intersects with the concurrently-evolving component-failover-adoption and HA specs — needs a dedicated cross-spec regression pass before both are declared done"
]
}