my-durable 0.0.45 → 0.0.47

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.
@@ -7,8 +7,8 @@
7
7
  <meta name="referrer" content="no-referrer" />
8
8
  <link rel="icon" type="image/svg+xml" href="/icons/durable-pi.svg" />
9
9
  <title>Durable Pi | Network</title>
10
- <script type="module" crossorigin src="/assets/index-CIMZq9MU.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-Dp-HJ4Vs.css">
10
+ <script type="module" crossorigin src="/assets/index-BQX67D5M.js"></script>
11
+ <link rel="stylesheet" crossorigin href="/assets/index-BJ1vWSJJ.css">
12
12
  </head>
13
13
  <body>
14
14
  <div id="app"></div>
@@ -7,8 +7,8 @@
7
7
  // change needs a daemon restart to apply — the panel says so, it does not
8
8
  // pretend otherwise.
9
9
  import { computed, ref, watch } from "vue";
10
- import { RefreshCw, Plus, Pencil, Trash2, FileCog } from "lucide-vue-next";
11
- import type { EnvFileView, EnvVarView } from "@sdk/api";
10
+ import { RefreshCw, Plus, Pencil, Trash2, FileCog, KeyRound } from "lucide-vue-next";
11
+ import type { EnvFileView, EnvVarView, PiAuthView } from "@sdk/api";
12
12
  import { deviceClient, message } from "../client/hub";
13
13
  import { notify, selected, ui } from "../client/store";
14
14
 
@@ -37,9 +37,65 @@ async function load() {
37
37
  } finally {
38
38
  loading.value = false;
39
39
  }
40
+ void loadKeys();
40
41
  }
41
42
  watch(deviceId, load, { immediate: true });
42
43
 
44
+ // ---------------------------------------------------------------- pi keys
45
+ // Gate #2: WRITE-ONLY provider keys in pi's own auth.json. Values are never
46
+ // shown — the list carries masked tails only — and the input is a password
47
+ // field that is cleared the moment a save lands.
48
+ const keys = ref<PiAuthView | null>(null);
49
+ const keysError = ref("");
50
+ const addingKey = ref(false);
51
+ const keyDraft = ref({ providerId: "", key: "" });
52
+
53
+ async function loadKeys() {
54
+ if (!deviceId.value) return void (keys.value = null);
55
+ try {
56
+ keys.value = await client().piAuth();
57
+ keysError.value = "";
58
+ } catch (e) {
59
+ const text = message(e);
60
+ keysError.value =
61
+ (e as { code?: string }).code === "not_found" || /allowlist/i.test(text)
62
+ ? "This device runs an older build: update it (`dpi update`) to manage pi keys."
63
+ : text.slice(0, 160);
64
+ }
65
+ }
66
+
67
+ async function addKey() {
68
+ const providerId = keyDraft.value.providerId.trim();
69
+ if (!providerId || !keyDraft.value.key) return;
70
+ busy.value = "pi-key";
71
+ try {
72
+ const r = await client().setPiApiKey(providerId, keyDraft.value.key);
73
+ keyDraft.value = { providerId: "", key: "" };
74
+ addingKey.value = false;
75
+ await loadKeys();
76
+ notify(`${providerId} saved (now ${r.masked}) — restart the device to apply it.`);
77
+ } catch (e) {
78
+ notify(message(e).slice(0, 160));
79
+ } finally {
80
+ busy.value = "";
81
+ }
82
+ }
83
+
84
+ function removeKey(providerId: string) {
85
+ ui.dialog = {
86
+ kind: "prompt",
87
+ title: `Remove the ${providerId} key?`,
88
+ hint: "The entry is deleted from pi's auth.json. pi's own logins are never touched. Restart the device to apply.",
89
+ submit: "Remove",
90
+ danger: true,
91
+ run: async () => {
92
+ await client().removePiApiKey(providerId);
93
+ await loadKeys();
94
+ notify(`${providerId} removed — restart the device to apply it.`);
95
+ },
96
+ };
97
+ }
98
+
43
99
  const editable = (v: EnvVarView) => v.source === "file" && !v.managed;
44
100
 
45
101
  async function add() {
@@ -173,6 +229,81 @@ function remove(v: EnvVarView) {
173
229
  </ul>
174
230
 
175
231
  <p v-if="view" class="hint path">{{ view.envFile }}</p>
232
+
233
+ <header class="panel-heading keys-heading">
234
+ <span><KeyRound :size="16" />PI KEYS</span>
235
+ <button
236
+ class="icon-button"
237
+ :disabled="loading || !deviceId"
238
+ aria-label="Refresh pi keys"
239
+ title="Refresh"
240
+ @click="loadKeys"
241
+ >
242
+ <RefreshCw :size="15" />
243
+ </button>
244
+ <button
245
+ class="icon-button"
246
+ :disabled="!deviceId || !!keysError"
247
+ aria-label="Add a pi provider key"
248
+ title="Add a provider key to pi's auth.json"
249
+ @click="addingKey = !addingKey"
250
+ >
251
+ <Plus :size="15" />
252
+ </button>
253
+ </header>
254
+
255
+ <p class="hint">
256
+ Provider keys in pi's own <code>auth.json</code> — write-only: values are never shown, pi's interactive
257
+ logins (oauth) are never touched.
258
+ </p>
259
+ <p v-if="keysError" class="message-error">{{ keysError }}</p>
260
+
261
+ <form v-if="addingKey" class="add-form" @submit.prevent="addKey">
262
+ <label
263
+ >Provider id<input v-model="keyDraft.providerId" placeholder="zai" required />
264
+ </label>
265
+ <label
266
+ >Key<input
267
+ v-model="keyDraft.key"
268
+ type="password"
269
+ autocomplete="off"
270
+ placeholder="paste the api key"
271
+ required
272
+ />
273
+ </label>
274
+ <div class="row">
275
+ <button class="primary small" type="submit" :disabled="busy === 'pi-key'">
276
+ {{ busy === 'pi-key' ? "saving…" : "Save to auth.json" }}
277
+ </button>
278
+ <button class="small" type="button" @click="addingKey = false">Cancel</button>
279
+ </div>
280
+ <p class="hint">Applies after the next device restart. Existing keys for other providers stay as they are.</p>
281
+ </form>
282
+
283
+ <p v-if="!addingKey && keys && !keys.entries.length && !keysError" class="hint">
284
+ No provider keys found.
285
+ </p>
286
+
287
+ <ul v-if="keys?.entries.length" class="var-list">
288
+ <li v-for="k in keys.entries" :key="k.providerId" class="var">
289
+ <div class="head">
290
+ <code class="key">{{ k.providerId }}</code>
291
+ <span class="tag">{{ k.source }}</span>
292
+ <span v-if="k.type !== 'api_key'" class="tag" title="Set by pi /login — read-only here">{{ k.type }}</span>
293
+ <span class="spacer" />
294
+ <button
295
+ v-if="k.type === 'api_key'"
296
+ class="icon-button"
297
+ :aria-label="`Remove ${k.providerId} key`"
298
+ title="Remove from auth.json"
299
+ @click="removeKey(k.providerId)"
300
+ >
301
+ <Trash2 :size="13" />
302
+ </button>
303
+ </div>
304
+ <code class="value" title="write-only — masked tail">{{ k.masked }}</code>
305
+ </li>
306
+ </ul>
176
307
  </section>
177
308
  </template>
178
309
 
@@ -257,6 +388,9 @@ function remove(v: EnvVarView) {
257
388
  opacity: 0.55;
258
389
  word-break: break-all;
259
390
  }
391
+ .keys-heading {
392
+ margin-top: 14px;
393
+ }
260
394
  .spin {
261
395
  animation: spin 1s linear infinite;
262
396
  }
@@ -78,15 +78,22 @@ const remove = (s: ScheduleView) =>
78
78
 
79
79
  /** The model is picked from the device's own catalog, not typed from memory. */
80
80
  const models = ref<{ key: string }[]>([]);
81
+ /** While the device's model catalog loads the form must say so — a silent
82
+ * dead Create button is how live-driving caught this (tunnel first-hit lag). */
83
+ const modelsLoading = ref(false);
81
84
  async function openAdd() {
82
85
  adding.value = true;
83
- draft.value = { name: "", cwd: selected.value?.sessionId ? "" : "", prompt: "", model: "" };
86
+ draft.value = { name: "", cwd: "", prompt: "", model: "" };
87
+ models.value = [];
88
+ modelsLoading.value = true;
84
89
  try {
85
90
  const device = await client().device();
86
91
  models.value = device.models.map((m) => ({ key: `${m.provider}/${m.id}` }));
87
92
  draft.value.model = device.defaultModel;
88
93
  } catch {
89
94
  models.value = [];
95
+ } finally {
96
+ modelsLoading.value = false;
90
97
  }
91
98
  }
92
99
 
@@ -94,7 +101,11 @@ async function save() {
94
101
  const d = draft.value;
95
102
  const [provider, ...rest] = d.model.split("/");
96
103
  const modelId = rest.join("/");
97
- if (!d.name.trim() || !d.cwd.trim() || !d.prompt.trim() || !provider || !modelId) return;
104
+ if (!d.name.trim() || !d.cwd.trim() || !d.prompt.trim()) return;
105
+ if (!provider || !modelId) {
106
+ notify(modelsLoading.value ? "Still loading the model list — one moment." : "Pick a model first.");
107
+ return;
108
+ }
98
109
  busy.value = "new";
99
110
  try {
100
111
  await client().createSchedule({
@@ -138,7 +149,9 @@ async function save() {
138
149
  <label>Prompt<textarea v-model="draft.prompt" rows="3" placeholder="Run the tests and summarise failures" required /></label>
139
150
  <label
140
151
  >Model
141
- <select v-model="draft.model">
152
+ <select v-model="draft.model" :disabled="modelsLoading">
153
+ <option v-if="modelsLoading" value="">loading…</option>
154
+ <option v-else-if="!models.length" value="">(no models — check the device)</option>
142
155
  <option v-for="m in models" :key="m.key" :value="m.key">{{ m.key }}</option>
143
156
  </select>
144
157
  </label>
@@ -148,8 +161,8 @@ async function save() {
148
161
  <label class="inline">daily at <input v-model="daily" class="num time" placeholder="03:00" :disabled="!!every" /></label>
149
162
  </div>
150
163
  <div class="row">
151
- <button class="primary small" type="submit" :disabled="busy === 'new'">
152
- {{ busy === "new" ? "creating…" : "Create schedule" }}
164
+ <button class="primary small" type="submit" :disabled="busy === 'new' || modelsLoading || !draft.model">
165
+ {{ busy === "new" ? "creating…" : modelsLoading ? "loading models…" : "Create schedule" }}
153
166
  </button>
154
167
  <button class="small" type="button" @click="adding = false">Cancel</button>
155
168
  </div>
@@ -93,7 +93,10 @@ function add() {
93
93
  :disabled="disabled"
94
94
  @change="emit('change', $event)"
95
95
  />
96
- <form v-if="adding && kind === 'array'" class="state-add" @submit.prevent="add">
96
+ <!-- The add-form/button must exist for BOTH objects and arrays: live-
97
+ driving caught that the `kind === "array"` guards made object
98
+ containers (including the ROOT) unable to gain fields at all. -->
99
+ <form v-if="adding" class="state-add" @submit.prevent="add">
97
100
  <input
98
101
  v-if="kind !== 'array'"
99
102
  v-model="key"
@@ -115,7 +118,7 @@ function add() {
115
118
  <button type="button" class="text-button" @click="adding = false">Cancel</button>
116
119
  </form>
117
120
  <button
118
- v-else-if="kind === 'array'"
121
+ v-else
119
122
  class="text-button state-add-button"
120
123
  :disabled="disabled"
121
124
  :aria-label="`Add ${kind === 'array' ? 'item' : 'field'} to ${path || '/'}`"
@@ -42,12 +42,19 @@ const background = computed(() =>
42
42
  : (agent.value?.background ?? 0),
43
43
  );
44
44
  const busy = computed(() => session.value?.busy || agent.value?.busy);
45
- /** Behind the hub's build: devices self-update, this is only a hint. */
45
+ /** Behind the hub's build: devices self-update, this is only a hint. The
46
+ * oldest devices predate the rename and report `durableVersion` instead of
47
+ * `packageVersion` — they are exactly the ones the badge exists for. */
46
48
  const behind = computed(() => {
47
- const theirs = device.value?.info?.packageVersion;
49
+ const info = device.value?.info as { packageVersion?: string; durableVersion?: string } | undefined;
50
+ const theirs = info?.packageVersion ?? info?.durableVersion;
48
51
  const ours = hubVersion.value;
49
52
  return Boolean(theirs && ours && ours !== "unknown" && theirs !== ours);
50
53
  });
54
+ const theirVersion = computed(() => {
55
+ const info = device.value?.info as { packageVersion?: string; durableVersion?: string } | undefined;
56
+ return info?.packageVersion ?? info?.durableVersion ?? "?";
57
+ });
51
58
  const statusText = computed(() => {
52
59
  const d = device.value;
53
60
  if (!d) return "";
@@ -122,7 +129,7 @@ const title = computed(() => {
122
129
  <span
123
130
  v-if="behind"
124
131
  class="tag update"
125
- :title="`device runs ${device?.info?.packageVersion ?? '?'}; hub runs ${hubVersion}. Devices self-update: dpi update`"
132
+ :title="`device runs ${theirVersion}; hub runs ${hubVersion}. Devices self-update: dpi update`"
126
133
  >update</span
127
134
  >
128
135
  <span class="meta" :class="{ err: dot === 'err' }">{{ statusText }}</span>
@@ -54,7 +54,11 @@ async function load() {
54
54
  try {
55
55
  usage.value = await deviceClient(id).deviceUsage();
56
56
  } catch (e) {
57
- error.value = message(e).slice(0, 160);
57
+ const text = message(e);
58
+ error.value =
59
+ (e as { code?: string }).code === "not_found" || /allowlist|not found/i.test(text)
60
+ ? "This device runs an older build: update it (`dpi update`) to see usage."
61
+ : text.slice(0, 160);
58
62
  } finally {
59
63
  busy.value = false;
60
64
  }
@@ -233,6 +233,24 @@ export interface EnvVarView {
233
233
  managed: boolean;
234
234
  }
235
235
 
236
+ /** One provider credential in pi's auth.json — masked tail only, never the value. */
237
+ export interface PiAuthEntry {
238
+ providerId: string;
239
+ type: string;
240
+ source: "auth.json" | "models.json" | "both";
241
+ masked: string;
242
+ }
243
+
244
+ export interface PiAuthView {
245
+ entries: PiAuthEntry[];
246
+ }
247
+
248
+ export interface PiAuthWriteResult {
249
+ providerId: string;
250
+ masked: string;
251
+ restartRequired: true;
252
+ }
253
+
236
254
  export interface EnvFileView {
237
255
  envFile: string;
238
256
  exists: boolean;
@@ -5,6 +5,8 @@ import type {
5
5
  AgentSummary,
6
6
  CompactionSettings,
7
7
  EnvFileView,
8
+ PiAuthView,
9
+ PiAuthWriteResult,
8
10
  GraphRecord,
9
11
  GraphRunRecord,
10
12
  GraphTask,
@@ -261,6 +263,19 @@ export class DpiClient {
261
263
  removeEnvVar(key: string) {
262
264
  return this.request<{ removed: boolean }>("DELETE", `/v1/device/env/${enc(key)}`);
263
265
  }
266
+ /** pi provider keys — WRITE-ONLY: the view carries masked tails, never values. */
267
+ piAuth() {
268
+ return this.request<PiAuthView>("GET", "/v1/device/pi-auth");
269
+ }
270
+ setPiApiKey(providerId: string, key: string) {
271
+ return this.request<PiAuthWriteResult>("PUT", `/v1/device/pi-auth/${enc(providerId)}`, { key });
272
+ }
273
+ removePiApiKey(providerId: string) {
274
+ return this.request<{ removed: boolean; restartRequired: true }>(
275
+ "DELETE",
276
+ `/v1/device/pi-auth/${enc(providerId)}`,
277
+ );
278
+ }
264
279
  /** Task-graphs: a DAG of prompt-tasks the device runs sequentially. */
265
280
  graphs() {
266
281
  return this.request<{ graphs: Array<GraphRecord & { lastRun?: GraphRunRecord }> }>("GET", "/v1/graphs");
@@ -15,6 +15,9 @@ const ROUTES: readonly (readonly [method: string, pattern: string])[] = [
15
15
  ["GET", "/device/env"],
16
16
  ["POST", "/device/env"],
17
17
  ["DELETE", "/device/env/:key"],
18
+ ["GET", "/device/pi-auth"],
19
+ ["PUT", "/device/pi-auth/:provider"],
20
+ ["DELETE", "/device/pi-auth/:provider"],
18
21
  ["GET", "/device/usage"],
19
22
  ["GET", "/tree"],
20
23
  ["GET", "/fs/dirs"],
@@ -1,7 +1,7 @@
1
1
  # Host / Project / Device / Session Management Feature Checklist — orca / paseo / zcode / herdr / piggery → durable-pi
2
2
 
3
3
  Run: `team_20261024143910_47d06fe8b77400d4` · Steps: 01_explore (inventory) → 02_analyze (verify/correct) → 03_write (this file)
4
- Status: **ALL WAVES ADOPTED (0.0.45 — live-verified in production Chrome: bell+panel, usage chip+total row, transcript download, prompt library, bulk select bar, recent-cwds chips; Host vitals with real uptime/load/memory/disk, tunnel-routed session search, and a bundle zip that real `unzip` opens).** Wave 2 complete (0.0.42); Wave 3 complete: diagnostics + keep-awake (0.0.43), telegram bridge + conversation share (0.0.44), task-graph DAG (0.0.45); ssh-interactivity and bulk-resume closed by design. NOTHING left on the feature list — remaining rows are policy decisions (#1 crash reporting, #2 writable pi credentials, #4 remote update posture), not features. #3 is implemented as manual-only GC (no defaults, no timer). Companion to `docs/git-ui-checklist.md` (CLOSED): that file covered the git panel; this one covers everything **around** the agent runtime — projects/workspaces, host/device management, session lifecycle, config/credentials, diagnostics, maintenance. Git-panel features are deliberately absent here. Every load-bearing citation below was re-read in the actual files during this run (see [Verification log](#verification-log)).
4
+ Status: **ALL WAVES ADOPTED (0.0.45 — live-verified in production Chrome: bell+panel, usage chip+total row, transcript download, prompt library, bulk select bar, recent-cwds chips; Host vitals with real uptime/load/memory/disk, tunnel-routed session search, and a bundle zip that real `unzip` opens).** Wave 2 complete (0.0.42); Wave 3 complete: diagnostics + keep-awake (0.0.43), telegram bridge + conversation share (0.0.44), task-graph DAG (0.0.45); ssh-interactivity and bulk-resume closed by design. NOTHING left on the feature list. Policy ledger: **ALL FOUR DECIDED** — #1 crash reporting local-only ✅ (0.0.46) · #2 pi credentials write-only ✅ (0.0.46) · #3 retention manual-only PERMANENTLY ✅ (user 2026-10-25: old sessions are future feature surface — nothing ever auto-deletes) · #4 remote updates hint-only badge ✅ (hub never pushes code). Companion to `docs/git-ui-checklist.md` (CLOSED): that file covered the git panel; this one covers everything **around** the agent runtime — projects/workspaces, host/device management, session lifecycle, config/credentials, diagnostics, maintenance. Git-panel features are deliberately absent here. Every load-bearing citation below was re-read in the actual files during this run (see [Verification log](#verification-log)).
5
5
 
6
6
  ## Why this doc exists
7
7
 
@@ -101,13 +101,20 @@ The analyst corrected the explorer's first draft; the writer re-verified each co
101
101
  Four rows below cannot default; they need the leader's decision before their wave enters the roadmap.
102
102
  None of them blocks Wave 1.
103
103
 
104
- 1. **Crash reporting** (Wave 3) — privacy posture: what is collected, opt-in vs opt-out.
105
- 2. **Writable provider credentials** (Wave 3) — pi owns `~/.pi/agent/auth.json`; our read-only view is
106
- deliberate (`pi-config.ts:10-11`). A write path means deciding who owns that file.
107
- 3. **Retention / auto-archive defaults** (Wave 2) — deletes user data; needs explicit defaults and a
108
- dry-run story before any automatic deletion.
109
- 4. **Hub-driven remote updates** (Wave 2) — trust boundary: the hub must never push code to devices.
110
- Badge-only (device self-updates, hub informs) is the safe shape; anything more needs a decision.
104
+ All four are DECIDED (0.0.46, user-approved):
105
+
106
+ 1. **Crash reporting — DECIDED: local-only.** One short redacted markdown file per crash under
107
+ `<home>/backend/crashes/`; no telemetry, no upload, no opt-in question — *we cannot leak what we
108
+ never send*. Human- and agent-readable fixed template; `dpi doctor` surfaces reports as a warn.
109
+ 2. **Writable provider credentials — DECIDED: write-only.** pi keeps owning `~/.pi/agent/auth.json`;
110
+ the device may set/remove exactly one `api_key` entry. Values never leave the file (masked tails
111
+ only), oauth logins and corrupt files are refused, writes atomic 0600 + `.bak`.
112
+ 3. **Retention / auto-archive — DECIDED: manual-only, permanently.** `dpi gc --closed-before 30d`
113
+ (dry-run default, `--yes` to act) stays the ONLY deletion path; nothing ever schedules itself.
114
+ Rationale (user, 2026-10-25): old sessions are a likely FEATURE surface later (search/resume/
115
+ history mining), so the device must never silently destroy them — the operator is the only deleter.
116
+ 4. **Hub-driven remote updates — DECIDED: hint-only badge.** The hub informs, the device self-updates;
117
+ the hub never pushes code to devices. If more is ever needed, that is a new decision, not a default.
111
118
 
112
119
  ## Wave 1a — FE-only, no BE change (start here)
113
120
 
@@ -138,7 +145,7 @@ None of them blocks Wave 1.
138
145
  | MUST | Usage dashboard | orca `usage/agent-token-usage.ts` + `usage-calendar-range.ts` (46-file suite incl. per-provider parsers) | ✅ (`0.0.39`) | GET `/device/usage` sums each harness's usage per session/model/project; Inspector **Usage** tab. Live: 4,307 tok → `opencode-go/claude-haiku-5-5`, attributed to its project. No calendar/persistence yet (archived sessions are closed stores) |
139
146
  | SHOULD | Notification delivery fan-out | orca `notification-delivery-service.ts:15-49` (tray→mobile→desktop, burst cooldown); piggery notify hooks desktop/herdr/ntfy (`docs/reference.md:15`) | ✅ (`0.0.41`) | `notify-sinks.ts`: webhook + ntfy sinks, per-(sink,event-kind) 10 s cooldown, SSRF guard with `DPI_NOTIFY_ALLOW_PRIVATE=1` for LAN. Events: `session.failed`, `schedule.ok`, `schedule.failed`, `test`. `dpi notify list/add/enable/disable/remove/test/events`; Inspector **Notify** tab. Live: ntfy.sh received the test sent from the panel |
140
147
  | SHOULD | Env-var management UI | orca `settings/HostAgentEnvironmentEditor.tsx` + `agent-default-env-draft.ts` | ✅ (`0.0.42`) | `env-vars.ts`: the DEVICE's env file, not the laptop's yaml — managed keys (DPI_TOKEN/port/…) refused, secret-NAMED values return masked (`••••••••t123`), process-only vars listed read-only (`loadEnvFile` never overrides them). `GET/POST/DELETE /v1/device/env`; Inspector **Env** tab with a restart-required banner (nothing pretends to hot-apply). Caught live: the hub caches the tunnel allowlist in memory, so new device routes also need a hub restart |
141
- | MUST | Retention / auto-GC — **policy #3** | orca `terminal-history-gc.ts`; piggery `gc --closed-before DURATION [--dry-run]` (`docs/reference.md:31`) | ✅ manual-only (`0.0.40`) | `gc.ts` + `dpi gc --closed-before 30d [--yes]`: **dry-run is the default and nothing schedules itself** — the retention policy stays the operator's call (gate #3 remains open for defaults) |
148
+ | MUST | Retention / auto-GC — **policy #3** | orca `terminal-history-gc.ts`; piggery `gc --closed-before DURATION [--dry-run]` (`docs/reference.md:31`) | ✅ manual-only (`0.0.40`) | `gc.ts` + `dpi gc --closed-before 30d [--yes]`: **dry-run is the default and nothing schedules itself** — and per the user's decision (2026-10-25) this is PERMANENT: no auto-archive will ever ship, because old sessions are a likely future feature surface (search/resume/history mining). The operator is the only deleter |
142
149
  | SHOULD | Remote update badge — **policy #4** | orca `ssh/managed-server-update-check.ts` + `orcad-update-plan.ts` | ✅ (`0.0.40`) | `GET /api/version` (hub walks up to the `my-durable` package.json) + device `packageVersion` in `/v1/device` → tree badge "update". Hint only: devices self-update, the hub never pushes code. Verified 0 badges when versions match, and the 1.3.0-vs-0.0.39 trap (pi-durable's version) is fixed by reporting both |
143
150
  | SHOULD | Backup/restore of session data | orca `rolling-file-backup.ts`; paseo `migrations/` (schema side) | ✅ (`0.0.42`) | `dpi backup create|list|restore` (executor module + 16 tests): whole-home zip (binary-capable writer reusing zip.ts's crc32) into a SIBLING `<home>-backups/` dir so a backup never contains itself; restore is plan-first (`--yes`), refuses while the daemon answers healthz, and never deletes — the old home becomes `home.bak-<ts>`. Live: 73 files / 5.4 MiB from the real device home, `unzip`/`zipfile`-clean, restore refused with exit 1 while running |
144
151
  | SHOULD | Rate-limit surfacing | orca `rate-limits/` | ✅ device-side (`0.0.41`) | `classifyProviderError`: 429/quota → `rate_limited` (+`retryAfterMs` from Retry-After), 401/403 → `auth`, 404 → `missing`; `probeModel` returns the provider's own words, `dpi doctor` prints "rate limited — retry in 30s" / "provider key rejected". **Not** in the web picker: `probe-model` is deliberately local-only (never tunnelled), so the FE cannot probe |
@@ -155,8 +162,8 @@ None of them blocks Wave 1.
155
162
  | SHOULD | Conversation share | zcode `packages/services/src/conversation-share/` | ✅ (`0.0.44`) | hub `shares.ts`: the shell uploads prepared transcripts (it holds the tunnel creds — the hub never talks to devices for this) and gets a tokenized PUBLIC link; **retention decided: 7-day expiry, swept on create/get/list, admin DELETE kills early** (the row demanded that decision up front). Public page is server-rendered, escaped, CSP `default-src 'none'; style-src 'unsafe-inline'`, zero scripts; junk/expired/deleted tokens all 404 identically. Live in Chrome: share button → confirm (says what "public" means) → link + expiry toast → page renders logged-out → admin delete → 404 |
156
163
  | SHOULD | Task-graph orchestration | paseo `packages/server/src/server/tasks/task-graph.ts` (+execution-order); zcode `task-groups/` | ✅ (`0.0.45`) | `graphs.ts` (executor, 32 tests) + a store engine: a graph is a validated DAG (Kahn cycle refusal naming the ring), run sequentially in topological order — deterministic on one device; **each task = a fresh session** (the schedules rule), turn completion detected via `settled` polling with a 30-min ceiling; failure cascades `skipped` to dependants; a restart flips a running run to `interrupted` with tasks back to pending (re-run continues); events `graph.ok`/`graph.failed`. Routes `GET/POST/PATCH/DELETE /graphs` + `/:id/run`; Inspector **DAG** tab; `dpi graph list\|show\|add\|run\|remove`. Live: demo-dag on the real device — T+8s `alpha ok, beta running`, T+16s `ok`; FE shows per-task statuses with deps. Built on the session-submission surface (schedules-proven), not the per-session job API — a cross-session DAG over jobs would need multi-session job plumbing this stack does not have; approval-gate nodes are a natural follow-up |
157
164
  | SHOULD | Diagnostic bundle | orca `settings/PrivacyDiagnosticBundleControls.tsx` | ✅ (`0.0.43`) | `dpi diagnostics` (executor module, 14 tests): 10-section 0600 zip — manifest, doctor, device/vitals/env, sessions/projects/schedules/notify, 400-line redacted `device.log` tail. Sections fail independently (a dead device still produces a bundle). `redact()` strips dpi_/Bearer/sk- shapes; verified on the LIVE device: 10/10 ok, **0 raw tokens in any entry**. Hub-side audit denies still not included (the device cannot read the hub's audit log — a hub-side bundle would be a separate feature) |
158
- | SHOULD | Crash reporting — **policy #1** | orca `crash-reporting/` | ❌ | opt-in only if adopted at all; leader decides privacy posture |
159
- | — (policy) | Writable provider credential store | orca `credentials/encrypted-api-key-file-store.ts` | ❌ (read-only by design, `pi-config.ts:10-11`) | **policy #2** — any write path needs an ownership decision over `~/.pi/agent/auth.json`; do not default |
165
+ | SHOULD | Crash reporting — **policy #1** | orca `crash-reporting/` | ✅ (`0.0.46`) | **DECIDED: local-only** — `crash.ts` (executor, 11 tests) writes ONE short markdown file per crash to `<home>/backend/crashes/` (newest 10 kept). There is no telemetry, no upload, no opt-in question at all: *we cannot leak what we never send*. The template is fixed-headings, ~24 lines, readable by a human or an independent agent; every line passes `redactLine()` (sk-/dpi_/adm_/Bearer/PRIVATE KEY shapes — live probe: `sk-<redacted>`, `DPI_TOKEN=<redacted>`). `uncaughtException` → report + exit 1; `unhandledRejection` → report, keep running (Node's own posture). Handlers install BEFORE loadConfig in `main.ts` (a config failure still reports); state counts arrive via a never-throwing snapshot. `dpi doctor` shows a **warn** row with age + filename (a past crash is information, not a broken device); diagnostics carry the same check. Live-proven: a real thrown error → exit 1 → redacted report → doctor `warn crash reports — 1 report — newest just now` |
166
+ | — (policy) | Writable provider credential store | orca `credentials/encrypted-api-key-file-store.ts` | ✅ (`0.0.46`) | **DECIDED: write-only over pi's own file.** pi keeps owning `~/.pi/agent/auth.json`; the device may SET/REMOVE an `api_key` entry in it — nothing else. Security rules (each tested): **values never leave the file** (`GET /v1/device/pi-auth` returns names + type + source + masked tail `••••••••9999` only); **pi's interactive logins are untouchable** (an `oauth` entry is refused on write AND delete with a pointer to pi); **a corrupt auth.json is refused, not rewritten**; writes are atomic tmp+rename 0600 with a `.bak`, and every OTHER entry survives byte-for-byte (live-verified: after add+remove of a test key, all five real providers' values identical). Web surface: Env tab **PI KEYS** card — password input + `autocomplete=off`, cleared the moment a save lands, remove behind a danger confirm; the key transits the TLS tunnel in the PUT body and is never echoed, logged, or stored FE-side. Restart-required banner like the env file (creds load at boot). FE test asserts the panel never interpolates a raw key |
160
167
  | — | Remote daemon deploy (orcad-style) | orca `ssh/orcad-ssh-provisioning.ts` + migration/cutover suite | 🟡 (`dpi device install` covers local) | only if the SSH suite lands and manual deploy still hurts; orcad is an entire subsystem |
161
168
 
162
169
  ## SKIP — infra-specific, do not adopt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-durable",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "description": "Durable Pi — the durable agent network: hub web UI, device backend daemon, TUI admin and the shared SDK, packaged as one runnable monorepo install",
5
5
  "license": "MIT",
6
6
  "repository": {