From 585c3bc89d4e9e6c7eae0a597c229a155cc83c66 Mon Sep 17 00:00:00 2001 From: Federico Jaramillo Martinez Date: Fri, 17 Jul 2026 20:36:05 +0200 Subject: [PATCH] docs(issue-62): record relay leg 1 (bootstrap) in packet --- relays/issue-62-authstorage/log.md | 42 +++++++++++++++++ relays/issue-62-authstorage/status.md | 67 ++++++++++++++++----------- 2 files changed, 82 insertions(+), 27 deletions(-) diff --git a/relays/issue-62-authstorage/log.md b/relays/issue-62-authstorage/log.md index f65bfee..6effecc 100644 --- a/relays/issue-62-authstorage/log.md +++ b/relays/issue-62-authstorage/log.md @@ -45,3 +45,45 @@ pending sessiond restart for later daemon-path slices. **Handoff:** Planning only — NOT auto-spawning the first implementation leg. Assessment + relay plan are laid out ready to be kicked off by the user. + +--- + +## Leg 1 — Slice 0 Bootstrap (deps + range correction) + +**Did:** +- Corrected `package.json`: three `@earendil-works/*` devDependencies + `^0.80.6` → `^0.80.8`; peerDependencies `>=0.80.0 <1` → `>=0.80.8 <0.81`. +- `npm install` in the worktree. The default `/tmp`-based node-gyp build of + `node-pty` failed with "Disk quota exceeded" (/tmp is a 5.8G tmpfs at ~81%). + Re-ran with `TMPDIR="$PWD/.tmp-build" npm install`, which succeeded (618 + packages, 0 vulnerabilities). Removed `.tmp-build` after. +- Confirmed installed versions: all three packages resolve to **0.80.10** + (lockfile updated). +- Verified the new export surface via a node ESM check: `ModelRuntime` ✓, + `readStoredCredential` ✓, `ModelRegistry` ✓, `AuthStorage` absent ✓, pi-ai + `InMemoryCredentialStore` ✓. +- Ran `npx tsc --noEmit`: 24 errors, all in `src/server/sessions/` at the + expected migration sites (removed `AuthStorage`, `ModelRegistry.create/inMemory`, + `authStorage` on session-services options, `PiAgentSession.modelRegistry`). + This matches assessment §2/§3 — the new surface resolves; only Pi Web's old + usage is broken. + +**Decisions:** +- Committed with `git commit --no-verify`: the pre-commit hook runs a + whole-project typecheck which cannot pass until the migration lands. Charter + explicitly permits non-verify-green legs. Documented this + the `TMPDIR` + workaround in `status.md` so future legs don't rediscover them. +- Did not touch any `src/` migration code — kept strictly to slice 0 scope. + +**Artifacts changed:** `package.json`, `package-lock.json` (commit `0fa9d0e`); +`relays/issue-62-authstorage/{status,log}.md`. `node_modules/` installed +(gitignored, not committed). + +**Status update:** last completed leg 1, next leg 2 = charter slice 1 +(`authService.ts` core migration → propagate async construction to `sessiond.ts`). + +**Blockers:** none. Sessiond restart still pending (becomes relevant from leg 2 +onward once `sessiond.ts` changes land). + +**Handoff:** spawning leg 2 (slice 1). + diff --git a/relays/issue-62-authstorage/status.md b/relays/issue-62-authstorage/status.md index 4cc88d7..e04a387 100644 --- a/relays/issue-62-authstorage/status.md +++ b/relays/issue-62-authstorage/status.md @@ -1,33 +1,44 @@ # Relay status — issue-62-authstorage ## Current position -Relay planned and packet created. Assessment complete and committed -(`ASSESSMENT-issue-62.md`). No fix work has started. The worktree has **no -`node_modules` installed yet** — the first implementation leg must install deps -(pinned to Pi 0.80.8+) before anything typechecks. +Bootstrap (slice 0) complete and committed (`0fa9d0e`). Deps are installed in the +worktree at **0.80.10** (all three `@earendil-works/*`), `package.json` ranges +corrected, and the new export surface is confirmed resolvable +(`ModelRuntime`, `readStoredCredential` present; `AuthStorage` gone; pi-ai +`InMemoryCredentialStore` present). `npx tsc --noEmit` now reports **24 errors**, +all in `src/server/sessions/` at the expected migration sites (no crash — the +removed `AuthStorage` import and `ModelRegistry.create/inMemory` calls). The +migration itself has not started. ## Leg tracking -- **Last completed leg:** 0 (planning — this packet + assessment). -- **Next leg to run:** 1. +- **Last completed leg:** 1 (slice 0 Bootstrap — deps + range correction). +- **Next leg to run:** 2. ## Next task -Run **charter slice 0 (Bootstrap)** as leg 1: -1. In the worktree (`/srv/dev/pi-web-issue-62`), install deps pinning the three - `@earendil-works/*` packages to 0.80.8+ (0.80.8 or current 0.80.10): - `@earendil-works/pi-coding-agent`, `@earendil-works/pi-ai`, - `@earendil-works/pi-agent-core`. Install in the worktree, **not `/tmp`** - (`/tmp` has a disk-quota problem; see assessment §8). -2. Correct `package.json`: peerDependencies for the three packages - `>=0.80.0 <1` → `>=0.80.8 <0.81`; devDependencies `^0.80.6` → `^0.80.8`. -3. Confirm the new export surface resolves (`readStoredCredential`, - `ModelRuntime` present; `AuthStorage` gone) — e.g. a quick node/tsx check or - just observe the typecheck errors now point at the migration sites. -4. Commit (e.g. `chore(deps): require pi 0.80.8+ and correct dep ranges (issue #62)`). -5. Update this `status.md` + append `log.md`, then hand off to leg 2 (charter - slice 1: `authService.ts` core migration). +Run **charter slice 1 (`authService.ts` core migration)** as leg 2: +- Move `authService.ts` to `ModelRuntime` (async construction via + `ModelRuntime.create({ authPath, modelsPath })`), migrate + `saveApiKey` / `logoutProvider` / `refreshAuthState` / credential access off + the removed `authStorage`/`ModelRegistry.create` surface (see assessment §5.1 + for the concrete mapping). +- Propagate the now-async construction to `src/server/sessiond.ts`. +- **Sessiond path:** this slice touches session-daemon code → note in + status/handoff that a manual sessiond restart will be needed once landed. +- Slice 1 depends only on slice 0 (done). The tree will still not fully + typecheck after this leg (slices 2–4 remain); that is expected — leave an + honest status. -If slice 0 is already done when you arrive, apply the charter's task-selection -policy: pick the lowest-numbered incomplete slice (1 → 6). +If slice 1 is already done when you arrive, apply the charter's task-selection +policy: pick the lowest-numbered incomplete slice (2 → 6). + +### Build/tooling note (important for every leg) +Installs and any native rebuild must set `TMPDIR` to a path inside the worktree, +e.g. `TMPDIR="$PWD/.tmp-build" npm install` (remove the dir after). `/tmp` is a +5.8G tmpfs at ~81% and node-gyp's `node-pty` build fails there with "Disk quota +exceeded". `.tmp-build` is scratch — do not commit it. The pre-commit hook runs +a whole-project typecheck; while the migration is incomplete, commit relay work +with `git commit --no-verify` (the charter permits legs that aren't verify-green). +Node: v24.18.0. ## Relevant context for the next runner - **Plan of record:** `ASSESSMENT-issue-62.md` (root) — read once. §5 has the @@ -53,9 +64,11 @@ commit before handing off. Hand off with `spawn_session` **once** per the charter's Handover section. ## Blockers / intervention state -None currently. Known constraints: +None. Known constraints: - **Sessiond restart pending** once slices touching `sessiond.ts` / session - runtime land — the human must manually restart the sessiond service; note it - here when it applies. -- `/tmp` disk-quota issue observed during assessment — do dependency installs in - the worktree. + runtime land (starts with slice 1/leg 2) — the human must manually restart the + sessiond service; keep this note current when it applies. +- `/tmp` disk-quota issue is real — see the Build/tooling note above; always set + `TMPDIR` into the worktree for installs/native rebuilds. +- node_modules is installed (gitignored) at 0.80.10; a fresh `npm install` is + only needed if node_modules is cleared.