@rubytech/create-maxy 1.0.889 → 1.0.890

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.
Files changed (30) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/PLUGIN.md +5 -1
  3. package/payload/platform/plugins/docs/references/troubleshooting.md +4 -2
  4. package/payload/platform/scripts/log-adherence-check.sh +28 -3
  5. package/payload/server/chunk-FBTNBSB4.js +2282 -0
  6. package/payload/server/chunk-O7DTMDJM.js +759 -0
  7. package/payload/server/chunk-OD4LSAB2.js +9770 -0
  8. package/payload/server/chunk-TUCK5CI2.js +3566 -0
  9. package/payload/server/client-pool-E3OU5NYU.js +34 -0
  10. package/payload/server/cloudflare-task-tracker-KCIUQYB5.js +22 -0
  11. package/payload/server/maxy-edge.js +4 -4
  12. package/payload/server/public/assets/{Checkbox-CeujDRv0.js → Checkbox-ebZSKvw2.js} +1 -1
  13. package/payload/server/public/assets/{admin-BN_z-2Bm.js → admin-Ewxzru2U.js} +31 -31
  14. package/payload/server/public/assets/data-pOc8b2rA.js +1 -0
  15. package/payload/server/public/assets/graph-DeG4HsDI.js +1 -0
  16. package/payload/server/public/assets/{graph-labels-Co03qEv5.js → graph-labels-DHQuVOgO.js} +1 -1
  17. package/payload/server/public/assets/jsx-runtime-CqFGUuze.css +1 -0
  18. package/payload/server/public/assets/{page-DGLz4ozf.js → page-DJiTa_Y_.js} +1 -1
  19. package/payload/server/public/assets/{page-C4E0CWHe.js → page-DL8yJkUn.js} +1 -1
  20. package/payload/server/public/assets/{public-rILg7e8-.js → public-BS-tmbAu.js} +1 -1
  21. package/payload/server/public/assets/{useVoiceRecorder-D3Upd7Q3.js → useVoiceRecorder-COlUADaA.js} +1 -1
  22. package/payload/server/public/data.html +5 -5
  23. package/payload/server/public/graph.html +6 -6
  24. package/payload/server/public/index.html +8 -8
  25. package/payload/server/public/public.html +5 -5
  26. package/payload/server/server.js +450 -314
  27. package/payload/server/public/assets/data-LYciLZK9.js +0 -1
  28. package/payload/server/public/assets/graph-C-SKAbGX.js +0 -1
  29. package/payload/server/public/assets/jsx-runtime-BcZkJOEw.css +0 -1
  30. /package/payload/server/public/assets/{jsx-runtime-BWYXu1CT.js → jsx-runtime-BCHoQyWP.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-maxy",
3
- "version": "1.0.889",
3
+ "version": "1.0.890",
4
4
  "description": "Install Maxy — AI for Productive People",
5
5
  "bin": {
6
6
  "create-maxy": "./dist/index.js"
@@ -52,7 +52,7 @@ Tools are available via the `admin` MCP server.
52
52
 
53
53
  `logs-read { type: "agent-stream" }` is the canonical name for the per-conversation tool-use/tool-result archive previously called `system`; both names work and the legacy alias is preserved.
54
54
 
55
- **Stream log is the primary diagnostic surface for an in-progress session.** Every stream log is named by sessionKey and the stream-log file exists from the first token. The first-token invariant is bound by `platform/scripts/__tests__/first-token-creates-stream-log.test.sh`: one operator turn, one token, `claude-agent-stream-<sessionKey>.log` exists and contains the token bytes after the byte returns to the operator. The parent-process console fan-out tee in [`platform/ui/app/lib/claude-agent/logging.ts`](../../ui/app/lib/claude-agent/logging.ts) appends every `[<tag>]`-prefixed `console.error` / `console.log` line to every active session's stream log alongside `server.log`. For diagnosing an in-session issue (WhatsApp inbound, Cloudflare action, persist write, baileys error), call `logs-read { sessionKey: "<…>" }` first — the stream log carries both the agent lifecycle AND the parent-process events that occurred during the session window. The `conversationId` parameter remains a legacy alias resolving to the same sessionKey-named file. `logs-read { type: "server" }` is the cross-session escape hatch for events outside any single session window.
55
+ **Stream log is the primary diagnostic surface for an in-progress session.** Every stream log is named by sessionKey and the stream-log file exists from the first token. The single-writer mandate (2026-05-14) mechanically enforces this contract: the single writer module at [`platform/ui/app/lib/claude-agent/stream-log-writer.ts`](../../ui/app/lib/claude-agent/stream-log-writer.ts) owns every open of `claude-agent-stream-*.log`, opens the file lazily on the first SDK token byte (via `streamLog.writeToken`), and buffers pre-token markers in memory while duplicating them to `server.log` via `console.error` so zero-token sessions retain observability. The build gate `platform/ui/scripts/check-stream-log-writer.mjs` rejects any external `appendFileSync`/`createWriteStream` against the `claude-agent-stream-*` pattern outside the writer module, plus any `claude-agent-stream-${conversationId}` literal (the pre-1013 wrong-identifier signature that produced two files for one session on the Beacons Pi 2026-05-14). The first-token invariant is bound by `platform/scripts/__tests__/first-token-creates-stream-log.test.sh`: one operator turn, one token, `claude-agent-stream-<sessionKey>.log` exists and contains the token bytes after the byte returns to the operator. The parent-process console fan-out tee in [`platform/ui/app/lib/claude-agent/logging.ts`](../../ui/app/lib/claude-agent/logging.ts) appends every `[<tag>]`-prefixed `console.error` / `console.log` line to every active session's stream log alongside `server.log`. For diagnosing an in-session issue (WhatsApp inbound, Cloudflare action, persist write, baileys error), call `logs-read { sessionKey: "<…>" }` first — the stream log carries both the agent lifecycle AND the parent-process events that occurred during the session window. The `conversationId` parameter remains a legacy alias resolving to the same sessionKey-named file. `logs-read { type: "server" }` is the cross-session escape hatch for events outside any single session window.
56
56
 
57
57
  ## Skills
58
58
 
@@ -75,3 +75,7 @@ Tools are available via the `admin` MCP server.
75
75
  - `hooks/pre-tool-use.sh` — enforces admin agent write boundaries
76
76
  - `hooks/playwright-file-guard.sh` — rewrites file:// URLs to a backgrounded loopback http.server before Playwright sees them
77
77
  - `hooks/webfetch-preflight.mjs` — short-circuits WebFetch on JS-SPA shells with a structured `WEBFETCH_CANNOT_READ_JS_SPA` error so the agent surfaces a loud failure to the owner instead of paying the 60s extraction timeout. Fail-open on any internal error.
78
+
79
+ ## Failure-report breadcrumbs
80
+
81
+ `POST /api/admin/sse-telemetry` and `POST /api/admin/failure-report` write `[sse-client]` and `[failure-report]` lines to `claude-agent-stream-<sessionKey>.log` so one grep against that file reconstructs the failing turn. The admin agent reads these via `logs-read`; the operator surfaces them by clicking "Report this turn" in the chat menu.
@@ -4,9 +4,9 @@
4
4
 
5
5
  **Symptom:** Operator opens a new admin session, sends one turn, sees the agent reply, then `logs-read sessionKey=<…>` returns `file-not-found` or zero bytes.
6
6
 
7
- **Invariant:** For every new session, the stream-log file exists on disk and contains the token bytes from the moment the first token returns to the operator. The first-token invariant is bound by `platform/scripts/__tests__/first-token-creates-stream-log.test.sh`: one operator turn, one token, `claude-agent-stream-<sessionKey>.log` exists and contains the token bytes — pass iff file present and bytes present.
7
+ **Invariant:** For every new session, the stream-log file exists on disk iff at least one token byte has been emitted, and contains the token bytes from the moment the first token returns to the operator. The single-writer mandate (2026-05-14) mechanically enforces both halves of the contract: the single writer module at `platform/ui/app/lib/claude-agent/stream-log-writer.ts` opens the file lazily on `streamLog.writeToken` (the SDK first-byte site at [`stream-parser.ts:296`](../../../ui/app/lib/claude-agent/stream-parser.ts#L296)), and the build gate `platform/ui/scripts/check-stream-log-writer.mjs` rejects every external `appendFileSync`/`createWriteStream` against the `claude-agent-stream-*` pattern at CI time. The first-token invariant is bound by `platform/scripts/__tests__/first-token-creates-stream-log.test.sh`: one operator turn, one token, `claude-agent-stream-<sessionKey>.log` exists and contains the token bytes — pass iff file present and bytes present. The hourly adherence runner `platform/scripts/log-adherence-check.sh` extends the device-side check with a duplicate-basename diagnostic (`dup-basenames=N` in the `[log-tee] adherence-check` line); `dup>0` is a P0 page meaning the writer collapse regressed.
8
8
 
9
- **Diagnose if it ever recurs:** run `bash platform/scripts/__tests__/first-token-creates-stream-log.test.sh` from the install. Pass = invariant holds; any other exit = the writer-side existence contract is broken and one `[log-tee] missing-on-resolve sessionKey=<8> surface=<…>` line on `server.log` is the operator-visible signal (P0).
9
+ **Diagnose if it ever recurs:** run `bash platform/scripts/__tests__/first-token-creates-stream-log.test.sh` from the install. Pass = invariant holds; any other exit = the writer-side existence contract is broken and one `[log-tee] missing-on-resolve sessionKey=<8> surface=<…>` line on `server.log` is the operator-visible signal (P0). For the duplicate-file class specifically (the 2026-05-14 recurrence trigger), `bash platform/scripts/log-adherence-check.sh` returns non-zero whenever any sessionKey has more than one `claude-agent-stream-<sk>.log` across account dirs.
10
10
 
11
11
  ## Browser navigation to a local file (`file://`) used to time out for two minutes
12
12
 
@@ -524,3 +524,5 @@ sudo systemctl --user start maxy-ui
524
524
  **`.trash/` retention:** Archived directories are kept indefinitely. The platform never auto-empties `.trash/`. When you're confident the archived orphans are truly obsolete, remove the directory manually: `rm -rf ~/maxy/data/accounts/.trash/<uuid>-<ts>/`.
525
525
 
526
526
  **Installer aborted with "identity-match FAILED":** Multi-account installs where no sibling matches `users.json[0].userId` abort loud — the installer refuses to pick one and refuses to sweep. Resolution: inspect `account.json` in each candidate dir (listed in the abort output), identify the correct owner, move the other(s) aside manually, then re-run the installer.
527
+
528
+ **A chat turn looks broken — assistant bubble never rendered:** Open `claude-agent-stream-<sessionKey>.log` and grep for `[sse-client]`. The five phases (`connected`, `event_received`, `render_complete`, `error`, `close`) tell the story in order. Missing `connected` = the chat fetch never returned 200; missing `event_received` = the server emitted nothing or the client lost the stream before the first frame; missing `render_complete` = the reducer never committed the assistant bubble (persist_ack never arrived). The operator can also click "Report this turn" in the chat menu to append a `[failure-report]` line carrying the same sessionKey + conversationId + clientSnapshot, plus copy the payload to the clipboard.
@@ -91,10 +91,35 @@ for k in "${UNIQUE[@]:-}"; do
91
91
  fi
92
92
  done
93
93
 
94
- echo "${TS} [log-tee] adherence-check window=${WINDOW_HOURS}h sessions=${SESSIONS} misses=${MISSES} surface=script ts=${TS}" >> "$SERVER_LOG" 2>/dev/null || true
95
- echo "[log-adherence-check] sessions=${SESSIONS} misses=${MISSES} window=${WINDOW_HOURS}h"
94
+ # Task 1013 — duplicate-basename check. Two stream-log files for one
95
+ # sessionKey across account dirs is the structural-failure signature this
96
+ # task exists to make impossible. The build gate prevents the writer-side
97
+ # regression that produces it (sessions.ts:568 wrong-identifier path); this
98
+ # diagnostic is the runtime backstop on every device, every hour. `dup=0`
99
+ # is the steady state; `dup>0` is a P0 page (the writer collapse regressed).
100
+ declare -A BASENAME_COUNT=()
101
+ for log_dir in "$ACCOUNTS_DIR"/*/logs; do
102
+ for f in "$log_dir"/claude-agent-stream-*.log; do
103
+ if [[ -f "$f" ]]; then
104
+ base=$(basename "$f")
105
+ key="${base#claude-agent-stream-}"
106
+ key="${key%.log}"
107
+ BASENAME_COUNT[$key]=$(( ${BASENAME_COUNT[$key]:-0} + 1 ))
108
+ fi
109
+ done
110
+ done
111
+ DUP_BASENAMES=0
112
+ for k in "${!BASENAME_COUNT[@]}"; do
113
+ if [[ ${BASENAME_COUNT[$k]} -gt 1 ]]; then
114
+ DUP_BASENAMES=$((DUP_BASENAMES + 1))
115
+ echo "${TS} [log-tee] dup-basename sessionKey=${k:0:8} count=${BASENAME_COUNT[$k]} surface=adherence-script — Task 1013 P0: writer collapse regressed" >> "$SERVER_LOG" 2>/dev/null || true
116
+ fi
117
+ done
118
+
119
+ echo "${TS} [log-tee] adherence-check window=${WINDOW_HOURS}h sessions=${SESSIONS} misses=${MISSES} dup-basenames=${DUP_BASENAMES} surface=script ts=${TS}" >> "$SERVER_LOG" 2>/dev/null || true
120
+ echo "[log-adherence-check] sessions=${SESSIONS} misses=${MISSES} dup-basenames=${DUP_BASENAMES} window=${WINDOW_HOURS}h"
96
121
 
97
- if [[ $MISSES -gt 0 ]]; then
122
+ if [[ $MISSES -gt 0 || $DUP_BASENAMES -gt 0 ]]; then
98
123
  exit 1
99
124
  fi
100
125
  exit 0