@oathe/oathe 0.4.4 → 0.4.6

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 (59) hide show
  1. package/.claude-plugin/marketplace.json +18 -2
  2. package/README.md +6 -3
  3. package/bin/oathe.mjs +199 -35
  4. package/docs/PRIVACY.md +26 -4
  5. package/notch/Oathe Notch.app/Contents/Info.plist +1 -1
  6. package/notch/Oathe Notch.app/Contents/MacOS/OatheNotch +0 -0
  7. package/notch/README.md +4 -3
  8. package/package.json +5 -4
  9. package/plugin/.claude-plugin/plugin.json +21 -3
  10. package/plugin/.cursor-plugin/plugin.json +2 -2
  11. package/plugin/hooks/hooks.json +4 -4
  12. package/plugin/hooks/lib.mjs +9 -0
  13. package/plugin/hooks/render-board.mjs +4 -2
  14. package/src/blocks.mjs +10 -1
  15. package/src/board-render.mjs +7 -4
  16. package/src/breach-digest.mjs +75 -10
  17. package/src/config.mjs +18 -0
  18. package/src/context.mjs +1 -1
  19. package/src/device.mjs +106 -0
  20. package/src/doctor.mjs +101 -6
  21. package/src/engine-update.mjs +170 -0
  22. package/src/evidence-discovery.mjs +170 -0
  23. package/src/fence.mjs +3 -3
  24. package/src/harnesses/catalog.mjs +46 -4
  25. package/src/harnesses/claude.mjs +56 -4
  26. package/src/harnesses/codex-rollout.mjs +110 -21
  27. package/src/harnesses/codex.mjs +106 -19
  28. package/src/harnesses/cursor.mjs +31 -18
  29. package/src/harnesses/harness.mjs +82 -13
  30. package/src/harnesses/surfaces.mjs +2 -2
  31. package/src/home.mjs +174 -52
  32. package/src/init.mjs +27 -2
  33. package/src/launch.mjs +7 -9
  34. package/src/launchd.mjs +100 -0
  35. package/src/manifest.mjs +48 -6
  36. package/src/mcp/connection.mjs +73 -7
  37. package/src/mcp/daemon.mjs +123 -0
  38. package/src/mcp/forwarder.mjs +99 -0
  39. package/src/mcp/oathe-tools.mjs +392 -145
  40. package/src/notch-frame.mjs +118 -42
  41. package/src/notch.mjs +34 -68
  42. package/src/oathe-annotator.mjs +10 -10
  43. package/src/pager.mjs +144 -40
  44. package/src/paths.mjs +1 -0
  45. package/src/plans.mjs +44 -5
  46. package/src/registry.mjs +10 -2
  47. package/src/serve.mjs +82 -0
  48. package/src/session-host.mjs +1 -1
  49. package/src/sessions.mjs +39 -8
  50. package/src/shim.mjs +110 -0
  51. package/src/speaker.mjs +24 -5
  52. package/src/statements.mjs +116 -2
  53. package/src/traces.mjs +61 -19
  54. package/src/uninstall.mjs +20 -3
  55. package/src/update.mjs +35 -7
  56. package/src/verifier.mjs +215 -105
  57. package/src/verify-dispatch.mjs +86 -32
  58. package/src/wire.mjs +7 -1
  59. package/plugin/.mcp.json +0 -10
@@ -1,14 +1,30 @@
1
1
  {
2
2
  "name": "oathe",
3
3
  "owner": {
4
- "name": "Oathe"
4
+ "name": "Oathe",
5
+ "url": "https://oathe.ai"
5
6
  },
6
7
  "description": "The Oathe marketplace: one plugin, the claim loop over the local cell substrate.",
7
8
  "plugins": [
8
9
  {
9
10
  "name": "oathe",
10
11
  "source": "./plugin",
11
- "description": "The Oathe claim loop: board at SessionStart, statements as you work, lease heartbeat at Stop, frame note before compaction."
12
+ "description": "The Oathe claim loop: board at SessionStart, statements as you work, lease heartbeat at Stop, frame note before compaction.",
13
+ "homepage": "https://oathe.ai",
14
+ "repository": "https://github.com/oathe-ai/oathe",
15
+ "license": "Apache-2.0",
16
+ "category": "workflow",
17
+ "keywords": [
18
+ "claude-code",
19
+ "agents",
20
+ "multi-agent",
21
+ "verification",
22
+ "settlement",
23
+ "handoff",
24
+ "reliability",
25
+ "harness",
26
+ "auto-save"
27
+ ]
12
28
  }
13
29
  ]
14
30
  }
package/README.md CHANGED
@@ -2,13 +2,16 @@
2
2
 
3
3
  **Auto save across your harnesses.**
4
4
 
5
- Make sure your agent actually **DID** what it **SAID.**
5
+ Make sure your agent actually **DID** what it **SAID** it did.
6
+
6
7
  ![Claude Code hits its usage limit mid-fix; Codex opens in the same repo and continues the task — progress, statements, and verification target intact.](assets/oathe-hero.png)
7
8
 
8
9
  You're mid-refactor in Claude Code when it hits a usage limit. You open Codex, say `continue`, and it picks up the same task — what's done, what's left, and a test that decides whether it's actually finished. Nothing pasted, nothing retyped, and the new agent doesn't have to take the old agent's word for anything because models are very good at being wrong AND confident.
9
10
 
10
11
  That's the product. Below is exactly how much of it works today, because a reliability project that overstates its own status would be a joke.
11
12
 
13
+ <img width="800" height="519" alt="Live UI/UX. Picking up a chatgpt app task in Claude code" src="https://github.com/user-attachments/assets/be275ab6-ea90-412a-8cea-0eb4f8f17eac" />
14
+
12
15
  [![CI](https://github.com/oathe-ai/oathe/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/oathe-ai/oathe/actions/workflows/ci.yml) [![License](https://img.shields.io/badge/license-Apache--2.0-green.svg)](LICENSE) [![Discord](https://img.shields.io/badge/discord-join-5865F2?logo=discord&logoColor=white)](https://discord.gg/sjrdWEj4W8)
13
16
 
14
17
  ## Quickstart
@@ -81,8 +84,8 @@ Two rules carry most of the weight:
81
84
 
82
85
  Honest labels, kept current in [ROADMAP.md](ROADMAP.md):
83
86
 
84
- - **Working:** durable tasks and attempts, death-and-recovery (the task survives the session; the next session opens on it), non-author verification, cross-harness handoff (`continue`: same board, same claims, either harness).
85
- - **Designed:** workspace checkpoints, effect receipts, teammate handoff, the reliability benchmark, per-harness drift monitors (docs, install, and live lanes — proven on a developer machine against Claude Code, Codex, and Cursor; the scheduled workflows run in this repository).
87
+ - **Working:** durable tasks and attempts, death-and-recovery (the task survives the session; the next session opens on it), non-author verification, cross-harness handoff (`continue`: same board, same claims, either harness), workspace checkpoints, effect receipts.
88
+ - **Designed:** teammate handoff, the reliability benchmark, per-harness drift monitors (docs, install, and live lanes — proven on a developer machine against Claude Code, Codex, and Cursor; the scheduled workflows run in this repository).
86
89
  - **Planned:** automatic pickup of interrupted work, cloud continuation, third-party conformance.
87
90
 
88
91
  Known limitations are disclosed in the roadmap, including the ones that are semi-embarrassing.
package/bin/oathe.mjs CHANGED
@@ -5,10 +5,9 @@
5
5
 
6
6
  import { parseArgs } from 'node:util';
7
7
 
8
- import { isTraceSubjectSql } from '../src/statements.mjs';
9
8
  import { byName, launchable, verifierCapable } from '../src/harnesses/catalog.mjs';
10
9
 
11
- const VERBS = ['init', ...launchable(), 'claim', 'ls', 'note', 'amend', 'done', 'verify', 'trace', 'notch', 'yield', 'config', 'doctor', 'uninstall', 'status', 'version', 'update', 'hook', 'mcp'];
10
+ const VERBS = ['init', ...launchable(), 'claim', 'ls', 'note', 'amend', 'done', 'verify', 'engine', 'trace', 'notch', 'yield', 'config', 'doctor', 'uninstall', 'status', 'version', 'update', 'hook', 'mcp', 'serve'];
12
11
 
13
12
  const USAGE = `usage: oathe <verb> [args]
14
13
 
@@ -21,6 +20,7 @@ ${launchable().map((name) => ` ${name.padEnd(6)} [--hermetic] [args…] ${byNa
21
20
  amend <task> "<objective>" "<why>" change what done means, on the record (active claim only)
22
21
  done <task-id> <what> [ref] assert completion (a completion statement + the substrate's terminal)
23
22
  verify [task] [--all] [--engine ${verifierCapable().join('|')}] run the verification lane (non-author seat settles)
23
+ engine update <harness> [--then-verify [task]] update an engine's CLI in place, as the claim update:<harness> (what the glass's update ↗ runs); --then-verify re-judges what its old version failed
24
24
  trace <task-id> [--out dir] export the claim's linked session traces as ATIF trajectories
25
25
  notch [--welcome] the whole machine's board + breach digest, pure JSON (only shows); --welcome replays the one-time welcome on the glass
26
26
  yield <task-id> <note> yield: the task goes back on the board, unowned
@@ -30,16 +30,36 @@ ${launchable().map((name) => ` ${name.padEnd(6)} [--hermetic] [args…] ${byNa
30
30
  update [--yes] [--harness a,b] the upgrade as one verb: npm i -g @oathe/oathe@latest through this node's npm, then init through the new bin
31
31
  config <key> [value] [--global] read or write a config key (workspace scope by default)
32
32
  uninstall [--purge-db] remove exactly what init recorded (the database stays put)
33
- hook <name> · mcp internal: the plugin's hook/server entry points (bin-addressed)
33
+ hook <name> · mcp · serve internal: the hook/server entry points and the device daemon (shim-addressed)
34
34
  `;
35
35
 
36
36
  function summary(verb, status) {
37
37
  process.stdout.write(`oathe: ${verb} ${status}\n`);
38
38
  }
39
39
 
40
+ /**
41
+ * The one line a speech act prints when it RESUMED rejected work first (ruling 2026-09-04:
42
+ * the verdict hands the work back; the act is the principal speaking) — the reclaim is on
43
+ * the record, so is the verdict it answers. Empty when the act spoke against a held claim.
44
+ */
45
+ function reclaimLine(out) {
46
+ if (!out.reclaimed) return '';
47
+ const why = out.rejection?.reason ? ` — ${out.rejection.reason}` : '';
48
+ return `reclaimed: ${out.task_id} (lease ${out.lease})${why}\n`;
49
+ }
50
+
51
+ /** A verb's own typed refusal — the OATHE_* vocabulary, never a bare Error a reader sniffs words from. */
52
+ function refusal(code, message) {
53
+ const e = new Error(message);
54
+ e.code = code;
55
+ return e;
56
+ }
57
+
40
58
  function fail(verb, e) {
41
59
  process.stderr.write(`${e?.code ? `[${e.code}] ` : ''}${e?.message || e}\n`);
42
- const status = /refus|REFUSED|already|second|active claim/i.test(String(e?.message)) ? 'refused' : 'error';
60
+ // A typed code is a refusal by definition (the OATHE_* vocabulary, docs/PRODUCT.md §16);
61
+ // anything else is an error. No message sniffing — every refusal carries its code.
62
+ const status = /^OATHE_/.test(String(e?.code ?? '')) ? 'refused' : 'error';
43
63
  process.stderr.write(`oathe: ${verb} ${status}\n`);
44
64
  process.exit(1);
45
65
  }
@@ -60,17 +80,29 @@ function parseFlags(verb, spec) {
60
80
  }
61
81
  }
62
82
 
83
+ /**
84
+ * The ONE description of where this process stands: `{ref, dir, synthetic}` from the resolver —
85
+ * a ChatGPT staging dir is synthetic and mints no folder id (the verifier's seat, ruling 2026-09-05).
86
+ */
87
+ async function workspaceHere(env = process.env) {
88
+ const [{ WorkspaceResolver }, { homeOf }] = await Promise.all([import('../src/workspace-resolver.mjs'), import('../src/paths.mjs')]);
89
+ return WorkspaceResolver.describe({ dir: process.cwd(), home: homeOf(env) });
90
+ }
91
+
92
+ /** The workspace ref a seat claims under: a folder's ref, or null (the ledger's `none`) for a synthetic dir. */
93
+ const seatWorkspace = (place) => (place.synthetic ? null : place.ref);
94
+
63
95
  async function toolsForCwd(env = process.env) {
64
- const [{ buildContext }, { createOatheTools }, { WorkspaceResolver }, { WorkspaceRegistry }, { ActivationSeam }, { homeOf }, { resolveSpeaker }, { verifierSeam }] = await Promise.all([
65
- import('../src/context.mjs'), import('../src/mcp/oathe-tools.mjs'), import('../src/workspace-resolver.mjs'),
66
- import('../src/registry.mjs'), import('../src/activation.mjs'), import('../src/paths.mjs'),
96
+ const [{ buildContext }, { createOatheTools }, { WorkspaceRegistry }, { ActivationSeam }, { resolveSpeaker }, { verifierSeam }] = await Promise.all([
97
+ import('../src/context.mjs'), import('../src/mcp/oathe-tools.mjs'),
98
+ import('../src/registry.mjs'), import('../src/activation.mjs'),
67
99
  import('../src/speaker.mjs'), import('../src/verify-dispatch.mjs'),
68
100
  ]);
69
101
  const ctx = buildContext({ env });
70
- // The terminal IS the workspace: its facts (ref, synthetic) come from the one describer, and
102
+ // The terminal IS the workspace: its facts (ref, synthetic, dir) come from the one describer, and
71
103
  // every verb registers it centrally through the one seam — claim activates (fences included).
72
104
  const cwd = process.cwd();
73
- const place = WorkspaceResolver.describe({ dir: cwd, home: homeOf(env) });
105
+ const place = await workspaceHere(env);
74
106
  return {
75
107
  ctx,
76
108
  tools: createOatheTools({
@@ -79,15 +111,17 @@ async function toolsForCwd(env = process.env) {
79
111
  config: ctx.config,
80
112
  workspace: place.ref,
81
113
  synthetic: place.synthetic,
114
+ dir: place.dir,
82
115
  // A CLI verb run from inside a harness session's shell speaks FOR that session — the
83
116
  // ancestry reaches the registered harness pid; a bare terminal resolves to nulls.
84
- speaker: resolveSpeaker({ sessionsPath: ctx.paths.sessionsPath }),
117
+ speaker: resolveSpeaker({ sessionsPath: ctx.paths.sessionsPath, devicePath: ctx.paths.devicePath }),
85
118
  // ONE verifier seam, every surface: done's auto-dispatch works from the CLI too.
86
119
  verifier: verifierSeam({
87
120
  orgId: ctx.identity.orgId,
88
121
  query: (sql, params) => ctx.substrate.query(sql, params),
89
122
  paths: ctx.paths,
90
123
  cwd,
124
+ progressIntervalMs: ctx.config.get('mcpProgressIntervalSec') * 1000,
91
125
  }),
92
126
  activation: new ActivationSeam({
93
127
  cwd,
@@ -128,14 +162,22 @@ const handlers = {
128
162
  process.stdout.write(` substrate: db up, ddl ${s.ddl_applied}/${s.ddl_expected} applied `
129
163
  + `(source: ${s.ddl_source}), yield cause ${s.yield_cause_registered ? 'registered' : 'MISSING'}\n`);
130
164
  process.stdout.write(` principal: ${result.principal.principal_id} (${result.principal.role})\n`);
131
- // The notch is a surface the person looks at: its state is said from launchd, and a dead
132
- // one is attention, never folded into ok.
165
+ process.stdout.write(` device: ${result.device.device_id} (${result.device.minted ? 'minted' : 'kept'})\n`);
166
+ // The notch is a surface the person looks at, and the daemon is what every session
167
+ // forwards to: each state is said from launchd, and a dead one is attention, never
168
+ // folded into ok.
133
169
  const glass = result.actions.find((a) => a.harness === 'notch' && /^notch-(running|not-running)$/.test(a.action));
134
170
  if (glass) {
135
171
  process.stdout.write(glass.action === 'notch-running'
136
172
  ? ` notch: running (pid ${glass.pid})\n`
137
173
  : ` notch: NOT RUNNING — launchd: ${glass.detail} (${glass.label}); run \`oathe init\` again, or \`oathe doctor\`\n`);
138
174
  }
175
+ const dmn = result.actions.find((a) => a.harness === 'serve' && /^serve-(running|not-running)$/.test(a.action));
176
+ if (dmn) {
177
+ process.stdout.write(dmn.action === 'serve-running'
178
+ ? ` daemon: running (pid ${dmn.pid})\n`
179
+ : ` daemon: NOT RUNNING — launchd: ${dmn.detail} (${dmn.label}); run \`oathe init\` again, or \`oathe doctor\`\n`);
180
+ }
139
181
  // The surface note lives here, once: the screen showed only the row.
140
182
  for (const surface of result.surfaces.filter((x) => x.detected)) {
141
183
  process.stdout.write(`\n${surface.displayName} — detected; nothing to wire:\n${surface.steps.split('\n').map((l) => ` ${l}`).join('\n')}\n`);
@@ -166,6 +208,26 @@ const handlers = {
166
208
  await main();
167
209
  },
168
210
 
211
+ // The device daemon (connection-lane phase 2): launchd runs this through the shim; every
212
+ // `oathe mcp` forwards to it when it answers. Long-running like mcp — no trailer on the
213
+ // happy path; a refusal (a daemon already serving) throws typed and trails as error.
214
+ async serve() {
215
+ const [{ OatheDaemon }, { serveSocketPath }, { OatheConfig }, { buildPaths }] = await Promise.all([
216
+ import('../src/mcp/daemon.mjs'), import('../src/serve.mjs'), import('../src/config.mjs'), import('../src/paths.mjs'),
217
+ ]);
218
+ const config = OatheConfig.global({});
219
+ const daemon = new OatheDaemon({
220
+ env: process.env,
221
+ socketPath: serveSocketPath(buildPaths(process.env), config),
222
+ });
223
+ await daemon.start();
224
+ // launchd ends the daemon with SIGTERM on bootout — close the connections and the
225
+ // socket cleanly; forwarders' pipes end with us and their sessions respawn.
226
+ for (const signal of ['SIGTERM', 'SIGINT']) {
227
+ process.on(signal, () => { daemon.close().finally(() => process.exit(0)); });
228
+ }
229
+ },
230
+
169
231
  async claim(argv) {
170
232
  const [taskId, objective] = argv;
171
233
  if (!taskId) throw new Error('usage: oathe claim <task-id> [objective]');
@@ -173,7 +235,10 @@ const handlers = {
173
235
  try {
174
236
  const out = await tools.oathe_claim({ task_id: taskId, objective });
175
237
  process.stdout.write(`claimed: ${out.task_id} (lease ${out.lease}) — ${out.note}${out.lineage ? ` — spawned under ${out.lineage.parent}` : ''}\n`);
176
- summary('claim', 'ok');
238
+ // An admitted session-less claim (a surface with no hooks) says so, and the run is attention.
239
+ const unattributed = out.spoken_from?.session === null && out.trace_link?.why;
240
+ if (unattributed) process.stdout.write(`unattributed: ${out.trace_link.why}\n`);
241
+ summary('claim', unattributed ? 'attention' : 'ok');
177
242
  } finally {
178
243
  await ctx.substrate.close();
179
244
  }
@@ -189,8 +254,11 @@ const handlers = {
189
254
  process.stdout.write(`board${workspace ? ` (${workspace})` : ' (all workspaces)'}:\n`);
190
255
  const listed = [...sections.mine, ...sections.open, ...sections.asserted, ...sections.held];
191
256
  if (listed.length === 0) process.stdout.write(' (none — a clean slate)\n');
257
+ const { JUDGMENT } = await import('../src/breach-digest.mjs');
192
258
  for (const r of listed) {
193
- const holder = r.state === 'active' ? `${r.principal_id}, lease until ${r.lease_until}` : (r.state ?? 'open');
259
+ // An asserted row says which judgment it awaits (UX rule 22) — the one table's word.
260
+ const holder = r.state === 'active' ? `${r.principal_id}, lease until ${r.lease_until}`
261
+ : r.judgment ? JUDGMENT[r.judgment].word : (r.state ?? 'open');
194
262
  process.stdout.write(` [${(r.state ?? 'open').padEnd(8)}] ${r.task_id} — ${r.objective} (${holder})\n`);
195
263
  }
196
264
  // UX rule 18: the terminal is the uncapped pull — every breached promise on the machine,
@@ -220,7 +288,7 @@ const handlers = {
220
288
  const { ctx, tools } = await toolsForCwd();
221
289
  try {
222
290
  const out = await tools.oathe_amend({ task_id: taskId, objective, why });
223
- process.stdout.write(`amended to v${out.version} — ${out.note}\n`);
291
+ process.stdout.write(`${reclaimLine(out)}amended to v${out.version} — ${out.note}\n`);
224
292
  summary('amend', 'ok');
225
293
  } finally {
226
294
  await ctx.substrate.close();
@@ -233,7 +301,7 @@ const handlers = {
233
301
  const { ctx, tools } = await toolsForCwd();
234
302
  try {
235
303
  const out = await tools.oathe_statement({ task_id: taskId, proposition, evidence_ref: evidenceRef });
236
- process.stdout.write(`statement recorded (${out.note})\n`);
304
+ process.stdout.write(`${reclaimLine(out)}statement recorded (${out.note})\n`);
237
305
  summary('note', 'ok');
238
306
  } finally {
239
307
  await ctx.substrate.close();
@@ -245,12 +313,16 @@ const handlers = {
245
313
  if (!taskId || !proposition) throw new Error('usage: oathe done <task-id> <what-was-done> [evidence-ref]');
246
314
  const { ctx, tools } = await toolsForCwd();
247
315
  try {
248
- const out = await tools.oathe_done({ task_id: taskId, proposition, evidence_ref: evidenceRef });
316
+ // The wait says it is still judging — the same ticks an MCP client hears, on stderr here.
317
+ const out = await tools.oathe_done({ task_id: taskId, proposition, evidence_ref: evidenceRef },
318
+ { progress: (message) => process.stderr.write(`${message}\n`) });
249
319
  process.stdout.write(`done: ${out.task_id} — ${out.note}\n`);
250
320
  // The blocked verdict, for the human (ruling 2026-08-31: locally, done owes its answer).
251
321
  const v = out.verification;
252
322
  if (v?.verdict) {
253
323
  process.stdout.write(`verdict: ${v.verdict} — ${v.reason}\n`);
324
+ // A rejection handed the work back in this exchange (ruling 2026-09-04).
325
+ process.stdout.write(reclaimLine(out));
254
326
  if (v.your_options) process.stdout.write(`next: ${v.your_options}\n`);
255
327
  } else if (v?.failed) {
256
328
  process.stdout.write(`verification failed: ${v.reason}\n`);
@@ -267,21 +339,26 @@ const handlers = {
267
339
  options: { all: { type: 'boolean', default: false }, engine: { type: 'string' }, detach: { type: 'boolean', default: false } },
268
340
  allowPositionals: true,
269
341
  });
270
- const [{ buildContext }, { Verifier }, { workspaceRef }] = await Promise.all([
271
- import('../src/context.mjs'), import('../src/verifier.mjs'), import('../src/workspace.mjs'),
342
+ const [{ buildContext }, { Verifier }] = await Promise.all([
343
+ import('../src/context.mjs'), import('../src/verifier.mjs'),
272
344
  ]);
273
345
  const ctx = buildContext({});
274
346
  // --detach: the judgment survives its terminal — one dispatcher, same as MCP and the
275
347
  // glass; closing the window can never orphan a verify claim again.
276
348
  if (values.detach === true) {
277
349
  if (!positionals[0]) throw new Error('usage: oathe verify --detach <task-id>');
278
- const { dispatchVerification } = await import('../src/verify-dispatch.mjs');
350
+ const [{ dispatchVerification }, { emit }] = await Promise.all([
351
+ import('../src/verify-dispatch.mjs'), import('../src/wire.mjs'),
352
+ ]);
279
353
  try {
280
354
  const out = await dispatchVerification({
281
355
  taskId: positionals[0], engine: values.engine ?? null, orgId: ctx.identity.orgId,
282
356
  query: (sql, params) => ctx.substrate.query(sql, params),
283
357
  paths: ctx.paths, cwd: process.cwd(), env: process.env,
284
358
  });
359
+ // The glass hears the dispatch (a silent nudge — the judgment's own claim turns the
360
+ // row verifying); a retry launched from a terminal never leaves the glass stale.
361
+ await emit(ctx.substrate, { kind: 'verify_dispatched', task_id: positionals[0] });
285
362
  process.stdout.write(`dispatched — the verdict lands on the glass. Log: ${out.log}\n`);
286
363
  summary('verify', 'ok');
287
364
  } finally {
@@ -291,7 +368,7 @@ const handlers = {
291
368
  }
292
369
  const verifier = new Verifier({
293
370
  substrate: ctx.substrate, paths: ctx.paths, config: ctx.config,
294
- workspace: workspaceRef(process.cwd()),
371
+ workspace: seatWorkspace(await workspaceHere()),
295
372
  operatorPrincipal: ctx.identity.principalId,
296
373
  });
297
374
  try {
@@ -311,14 +388,46 @@ const handlers = {
311
388
  }
312
389
  },
313
390
 
391
+ async engine(argv) {
392
+ const [sub, harness, ...rest] = argv;
393
+ const usage = 'usage: oathe engine update <harness> [--then-verify [task-id]]';
394
+ if (sub !== 'update' || !harness) throw new Error(usage);
395
+ const { values, positionals } = parseFlags('engine', {
396
+ args: rest, options: { 'then-verify': { type: 'boolean', default: false } }, allowPositionals: true,
397
+ });
398
+ const [{ buildContext }, { EngineUpdate }] = await Promise.all([
399
+ import('../src/context.mjs'), import('../src/engine-update.mjs'),
400
+ ]);
401
+ const ctx = buildContext({});
402
+ const update = new EngineUpdate({
403
+ substrate: ctx.substrate, paths: ctx.paths, config: ctx.config, manifest: ctx.manifest,
404
+ workspace: seatWorkspace(await workspaceHere()), operatorPrincipal: ctx.identity.principalId,
405
+ onStart: ({ address, before, command, log }) => process.stdout.write(`updating ${harness} at ${address} (${before}) via ${command} — log: ${log}\n`),
406
+ });
407
+ try {
408
+ const out = await update.run({ harness, thenVerify: values['then-verify'] === true, task: positionals[0] ?? null });
409
+ process.stdout.write(`updated ${harness}: ${out.before} → ${out.after} (${out.update_task} settled)\n`);
410
+ let attention = false;
411
+ for (const r of out.reverified) {
412
+ const mark = r.error ? `✗ not judged — ${r.error}` : r.verdict === 'accepted' ? '✓ settled' : '✗ rejected — task reopened';
413
+ process.stdout.write(`${r.task_id}: ${mark}\n`);
414
+ if (r.error || r.verdict !== 'accepted') attention = true;
415
+ }
416
+ summary('engine', attention ? 'attention' : 'ok');
417
+ } finally {
418
+ await update.close();
419
+ await ctx.substrate.close();
420
+ }
421
+ },
422
+
314
423
  async trace(argv) {
315
424
  const { values, positionals } = parseFlags('trace', {
316
425
  args: argv, options: { out: { type: 'string' }, pure: { type: 'boolean', default: false } }, allowPositionals: true,
317
426
  });
318
427
  const [taskId] = positionals;
319
428
  if (!taskId) throw new Error('usage: oathe trace <task-id> [--out <dir>] [--pure]');
320
- const [{ buildContext }, { workspaceRef }, { projectAnnotated }, { projectorFor }, fs, path] = await Promise.all([
321
- import('../src/context.mjs'), import('../src/workspace.mjs'), import('../src/oathe-annotator.mjs'),
429
+ const [{ buildContext }, { projectAnnotated }, { projectorFor }, fs, path] = await Promise.all([
430
+ import('../src/context.mjs'), import('../src/oathe-annotator.mjs'),
322
431
  import('../src/harnesses/catalog.mjs'), import('node:fs'), import('node:path'),
323
432
  ]);
324
433
  const ctx = buildContext({});
@@ -327,18 +436,21 @@ const handlers = {
327
436
  `SELECT work_claim_id, contract_ref FROM cell.work_claim
328
437
  WHERE org_id = $1 AND task_id = $2 ORDER BY claimed_at DESC LIMIT 1`,
329
438
  [ctx.identity.orgId, taskId]);
330
- if (claims.length === 0) throw new Error(`no claim on '${taskId}' — nothing to trace`);
439
+ if (claims.length === 0) throw refusal('OATHE_NOTHING_TO_TRACE', `no claim on '${taskId}' — nothing to trace`);
331
440
  const claim = claims[0];
332
- const { rows: traceRows } = await ctx.substrate.query(
333
- `SELECT evidence_refs FROM cell.agent_statement
334
- WHERE org_id = $1 AND work_claim_id = $2 AND ${isTraceSubjectSql('subject_ref')}`,
335
- [ctx.identity.orgId, claim.work_claim_id]);
336
441
  const { rows: verdicts } = await ctx.substrate.query(
337
442
  `SELECT result, verifier_principal, verification_id FROM cell.verification
338
443
  WHERE org_id = $1 AND task_id = $2 ORDER BY recorded_at DESC LIMIT 1`,
339
444
  [ctx.identity.orgId, taskId]);
340
- const files = traceRows.flatMap((r) => r.evidence_refs);
341
- if (files.length === 0) throw new Error(`'${taskId}' has no linked traces — nothing to export`);
445
+ // The export reads the same evidence the verifier judges: recorded links ∪ fingerprint
446
+ // discovery (src/evidence-discovery.mjs) — a traceless surface's work still exports.
447
+ const { EvidenceDiscovery } = await import('../src/evidence-discovery.mjs');
448
+ const { traces: gathered, unreadable } = await new EvidenceDiscovery({ client: ctx.substrate, orgId: ctx.identity.orgId })
449
+ .read({ taskId });
450
+ // stdout is the JSON; what the scan could not read is said on stderr, never swallowed.
451
+ for (const u of unreadable) process.stderr.write(`trace: unreadable store file skipped: ${u.path} (${u.code})\n`);
452
+ const files = gathered.map((t) => t.path);
453
+ if (files.length === 0) throw refusal('OATHE_EVIDENCE_EMPTY', `no evidence for '${taskId}' — no linked traces and no discovery hits`);
342
454
  const trajectories = [];
343
455
  // The export is the annotated read with the OBLIGATION stamped on the root — what this
344
456
  // trajectory is evidence for, in the annotator's own slot. --pure exports the
@@ -353,7 +465,7 @@ const handlers = {
353
465
  task_id: taskId,
354
466
  work_claim_id: claim.work_claim_id,
355
467
  contract_ref: claim.contract_ref,
356
- workspace: workspaceRef(process.cwd()),
468
+ workspace: seatWorkspace(await workspaceHere()),
357
469
  ...(verdicts[0] ? { verdict: verdicts[0] } : {}),
358
470
  },
359
471
  }));
@@ -503,7 +615,52 @@ const handlers = {
503
615
  });
504
616
  beat = setInterval(guarded('heartbeat frame', async () => write(await serveFrame())), ctx.config.get('notchHeartbeatSeconds') * 1000);
505
617
  write(await serveFrame());
506
- process.stdin.resume();
618
+ // The glass speaks acts UP the same pipe — one ndjson line, the mirror of a frame
619
+ // (ruling 2026-09-04: a judgment needs no terminal). `{act:'verify', task_id, cwd}` runs
620
+ // the ONE dispatcher the CLI and MCP run; `{act:'update', task_id, harness, cwd}` (ruling
621
+ // 2026-09-05) runs the engine update the same detached way. The child's own claim then
622
+ // wakes the frame (verify_started / the update:<harness> hold). A refusal other than
623
+ // "already in flight" rides the next frame as an amber notice — the glass never learns of a
624
+ // failure by silence. The feed holds no memory of either: the frame is the only truth.
625
+ const { dispatchVerification, dispatchEngineUpdate } = await import('../src/verify-dispatch.mjs');
626
+ const common = (req) => ({
627
+ orgId: ctx.identity.orgId, query: (sql, params) => ctx.substrate.query(sql, params),
628
+ paths: ctx.paths, cwd: typeof req.cwd === 'string' ? req.cwd : homeOf(), env: process.env,
629
+ });
630
+ const dispatchers = {
631
+ verify: (req) => dispatchVerification({ taskId: req.task_id, ...common(req) }),
632
+ update: (req) => (typeof req.harness === 'string' ? dispatchEngineUpdate({ harness: req.harness, ...common(req) }) : null),
633
+ };
634
+ const act = guarded('act', async (req) => {
635
+ const dispatch = typeof req?.task_id === 'string' ? dispatchers[req.act] : null;
636
+ const pending = dispatch ? dispatch(req) : null;
637
+ if (pending === null) {
638
+ process.stderr.write(`oathe notch: unknown act ${JSON.stringify(req).slice(0, 120)} — ignored\n`);
639
+ return;
640
+ }
641
+ try {
642
+ await pending;
643
+ } catch (e) {
644
+ if (e?.code === 'OATHE_VERIFY_IN_FLIGHT' || e?.code === 'OATHE_UPDATE_IN_FLIGHT') return; // the row already says so
645
+ const f = await serveFrame();
646
+ f.notice = { text: `✗ ${req.act} '${req.task_id}' not dispatched — [${e?.code ?? 'error'}] ${String(e?.message ?? e).slice(0, 160)}`, tone: 'amber' };
647
+ write(f);
648
+ }
649
+ });
650
+ let inbound = '';
651
+ process.stdin.setEncoding('utf8');
652
+ process.stdin.on('data', (chunk) => {
653
+ inbound += chunk;
654
+ let nl;
655
+ while ((nl = inbound.indexOf('\n')) >= 0) {
656
+ const line = inbound.slice(0, nl).trim();
657
+ inbound = inbound.slice(nl + 1);
658
+ if (line === '') continue;
659
+ let req = null;
660
+ try { req = JSON.parse(line); } catch { process.stderr.write(`oathe notch: act line is not JSON — ignored\n`); continue; }
661
+ act(req);
662
+ }
663
+ });
507
664
  process.stdin.on('end', shutdown);
508
665
  process.stdin.on('close', shutdown);
509
666
  process.on('SIGTERM', shutdown);
@@ -517,7 +674,7 @@ const handlers = {
517
674
  const { ctx, tools } = await toolsForCwd();
518
675
  try {
519
676
  const out = await tools.oathe_yield({ task_id: taskId, note });
520
- process.stdout.write(`yielded: ${out.task_id} — ${out.note}\n`);
677
+ process.stdout.write(`${reclaimLine(out)}yielded: ${out.task_id} — ${out.note}\n`);
521
678
  summary('yield', 'ok');
522
679
  } finally {
523
680
  await ctx.substrate.close();
@@ -561,7 +718,7 @@ const handlers = {
561
718
  e.code = 'OATHE_UPDATE_INIT_FAILED';
562
719
  throw e;
563
720
  }
564
- summary('update', out.notch && out.notch.pid === null ? 'attention' : 'ok');
721
+ summary('update', (out.notch && out.notch.pid === null) || (out.daemon && out.daemon.pid === null) ? 'attention' : 'ok');
565
722
  },
566
723
 
567
724
  async doctor(argv) {
@@ -610,15 +767,22 @@ const handlers = {
610
767
  process.stdout.write(`traces: ${harness.padEnd(8)} ${trace.status}`
611
768
  + `${trace.status === 'DRIFT' ? ` — ${trace.detail} (${trace.newest})` : ''}\n`);
612
769
  }
770
+ // The daemon's answer is a health fact wherever serve is WIRED: launchd holding the
771
+ // agent while nothing answers the socket means every session forwards into nothing.
772
+ process.stdout.write(result.daemon.answering
773
+ ? `daemon: answering (${result.daemon.server.name} ${result.daemon.server.version}) @ ${result.daemon.socket}\n`
774
+ : `daemon: NOT ANSWERING @ ${result.daemon.socket ?? '(unresolved socket)'}\n`);
613
775
  for (const row of result.rows) {
614
776
  process.stdout.write(` ${row.status.padEnd(12)} ${row.harness.padEnd(8)} ${row.kind.padEnd(12)} ${row.file}\n`);
615
777
  }
778
+ const serveWired = result.rows.some((r) => r.harness === 'serve' && r.kind === 'launch-agent');
616
779
  const healthy = s.reachable && s.database_exists && s.ddl_applied === s.ddl_expected
617
780
  && s.ddl_source !== 'ABSENT'
618
781
  && result.plugin.resolves && result.runtime.provider !== null
619
782
  && result.runtime.probe?.ok !== false
620
783
  && result.rows.every((r) => r.status === 'ok')
621
- && Object.values(result.traces).every((t) => t.status !== 'DRIFT');
784
+ && Object.values(result.traces).every((t) => t.status !== 'DRIFT')
785
+ && (!serveWired || result.daemon.answering);
622
786
  summary('doctor', healthy ? 'ok' : 'attention');
623
787
  if (!healthy) process.exit(1);
624
788
  },
package/docs/PRIVACY.md CHANGED
@@ -14,9 +14,14 @@ Oathe does not crawl arbitrary files. It reads exactly these declared surfaces:
14
14
  - **Harness configuration it manages**: `~/.claude/settings.json` (two owned keys),
15
15
  `~/.codex/config.toml` (via the codex CLI), and `~/.cursor/mcp.json` + `~/.cursor/hooks.json`
16
16
  (owned entries), plus the project's `CLAUDE.md`/`AGENTS.md` fenced sections.
17
- - **Its own state**: the install manifest, backups, artifact store, and the workspace
18
- registry (`workspaces.json` — folder path, git identity, when each harness last opened it)
19
- under `~/.oathe/`, and the workspace config (`.oathe.json`).
17
+ - **Its own state**: the install manifest, backups, artifact store, the workspace registry
18
+ (`workspaces.json` — folder path, git identity, when each harness last opened it), the
19
+ session registry (`sessions.json` — which local process embodies which harness session,
20
+ while it lives), and the device identity (`device.json`) under `~/.oathe/`, and the
21
+ workspace config (`.oathe.json`).
22
+ - **Process ancestry** (`ps` on macOS, `/proc` on Linux: pids and executable paths of the
23
+ writing process's parents) to resolve which harness session a speech act belongs to. Never
24
+ sent anywhere.
20
25
  - **Git metadata** of the working directory (root, origin) to derive the workspace identity.
21
26
 
22
27
  One write behavior to know about: **opening a session in a folder activates it** — the
@@ -33,6 +38,20 @@ your local substrate and nothing else. Everything stays on your machine.
33
38
  Task ids, objectives, claims, statements, verdicts, and transcript file **paths**.
34
39
  Transcript contents are not copied into the database.
35
40
 
41
+ ## Attributes (who spoke)
42
+
43
+ Every speech act records the surface it was spoken from, the app bundle above it, the harness
44
+ session it belongs to, and this install's device id. The session is resolved by walking the
45
+ speaking process's ancestry and matching it against `sessions.json`; over the local daemon's
46
+ socket the daemon walks the pid the session's forwarder named — the walk is measured, the
47
+ starting pid is the forwarder's own word, trusted because the socket is 0600 (only your OS user
48
+ can reach it; no peer credential is read). A claim whose session cannot be resolved is refused
49
+ at the moment it is spoken, unless the surface runs no hooks by design (the ChatGPT desktop
50
+ app) — then it is admitted and its evidence is found by discovery at verify. The device id in
51
+ `~/.oathe/device.json` is a random UUID minted by `oathe init`, derived from no hardware, kept
52
+ across re-inits, removed by `oathe uninstall`; the ed25519 key pair beside it is minted for a
53
+ future enrollment and signs nothing today.
54
+
36
55
  ## Sends
37
56
 
38
57
  Exactly one path sends anything anywhere: **`oathe verify`**. It projects the linked
@@ -42,7 +61,10 @@ character-budgeted evidence view (SAID/CLAIM/DID/GOT lines — not raw transcrip
42
61
  and passes that rendering to the verification engine you configured (`claude`, `codex`, or
43
62
  `cursor`) as a command-line prompt. That content therefore reaches the engine's model
44
63
  provider (Anthropic, OpenAI, or Cursor) under YOUR account and their terms. If you never run `verify`,
45
- nothing leaves your machine. Oathe has no telemetry, no server, and phones home to no one.
64
+ nothing leaves your machine. Oathe has no telemetry and phones home to no one. The only server
65
+ it runs is on your machine: `oathe serve`, a daemon on a unix socket under `~/.oathe/` (mode
66
+ 0600 — reachable only by your OS user) that your harness sessions forward to; it opens no port
67
+ and accepts nothing from the network.
46
68
 
47
69
  Two disclosed sharp edges:
48
70
 
@@ -6,7 +6,7 @@
6
6
  <key>CFBundleName</key><string>Oathe Notch</string>
7
7
  <key>CFBundleExecutable</key><string>OatheNotch</string>
8
8
  <key>CFBundlePackageType</key><string>APPL</string>
9
- <key>CFBundleShortVersionString</key><string>0.4.4</string>
9
+ <key>CFBundleShortVersionString</key><string>0.4.6</string>
10
10
  <key>LSMinimumSystemVersion</key><string>14.0</string>
11
11
  <key>LSUIElement</key><true/>
12
12
  </dict>
package/notch/README.md CHANGED
@@ -44,10 +44,11 @@ A frame carries:
44
44
 
45
45
  | Key | What it is |
46
46
  |---|---|
47
- | `breaches` | the breach digest's rows — sharpest first, at most the sheet's row cap, each with `kind_word`, `objective`, `home`, `detail`, `at`, and its `act` (`kind`, `word`, and what to run) |
47
+ | `breaches` | the breach digest's rows — sharpest first, at most the sheet's row cap, each with `kind_word`, `objective`, `home`, `detail`, `at`, `busy` (a system claim in flight: the word is `verifying` or `updating <Engine>`, the failure is gone, no act — the glass adds a spinner), and its `act` (`kind`, `word`, and what to run; a `dispatch` carries `act` — `verify` or `update` — and, for an update, `harness`: the glass relays the line up the feed and decides nothing; an `open-app` carries `paste` — the line the glass puts on the clipboard — and `flash`, the sentence the expanded row shows; rows also carry `place_dir`, the app pickup's project folder) |
48
48
  | `more` | how many breaches the budget left out |
49
- | `motion` | anyone's active claim with a recent word, or one heard live on the wire — each with `objective`, `holder`, `surface`, `session`, `children_line`, and its `resume` |
50
- | `idle` | your held claims gone quiet, after motion |
49
+ | `motion` | anyone's active claim with a recent word, or one heard live on the wire — each with `objective`, `holder`, `surface`, `session`, `children_line`, `home_path` (the folder it resides in, or the app's word), `place_dir` (an app pickup's project folder), and its `resume` (null when there is nothing to resume into — then no button; an `open-app` resume carries `paste` and `flash` like a breach's act) |
50
+ | `judged` | asserted claims awaiting their verdict (never invisible between done and verdict) — the same row shape, with `judgment` (the word: `verifying` while a judge holds it, `awaiting verdict` until one does), `busy` (the spinner, the key a breach spins on), and no `resume` — nothing a person does moves a judgment |
51
+ | `idle` | your held claims gone quiet, after motion and judgment |
51
52
  | `sections` | the one board classification (`mine` · `open` · `asserted` · `held`) |
52
53
  | `default_agent` | the machine's chosen agent, or null — the glass reads no config |
53
54
  | `notice` | optional: the words of the event that caused this frame, with a tone |
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@oathe/oathe",
3
- "version": "0.4.4",
4
- "description": "Auto save and verified completion for AI coding agents — a durable local task board that outlives any one session. D0 preview.",
3
+ "version": "0.4.6",
4
+ "description": "Oathe is auto save for AI coding agents: an open-source runtime that moves a task between Claude Code, Codex and Cursor and checks the work was actually done. D0 preview.",
5
+ "author": "Oathe Inc. (https://oathe.ai)",
5
6
  "type": "module",
6
7
  "engines": {
7
8
  "node": ">=22.13.0"
@@ -12,8 +13,8 @@
12
13
  "scripts": {
13
14
  "preinstall": "node bin/node-floor.mjs",
14
15
  "test": "npm run test:unit && npm run test:heavy",
15
- "test:unit": "node --test tests/exec-results.test.mjs tests/activation.test.mjs tests/atif.test.mjs tests/blocks.test.mjs tests/board-render.test.mjs tests/breach-digest.test.mjs tests/config.test.mjs tests/cursor-harness.test.mjs tests/discharge.test.mjs tests/evidence-budget.test.mjs tests/fslock.test.mjs tests/harness-contract.test.mjs tests/harness-docs.test.mjs tests/harness-docs-drift.test.mjs tests/harbor-conformance.test.mjs tests/harness.test.mjs tests/notch-frame.test.mjs tests/home.test.mjs tests/horizon-census.test.mjs tests/manifest.test.mjs tests/mcp-connection.test.mjs tests/node-floor.test.mjs tests/notch.test.mjs tests/packaging.test.mjs tests/paths.test.mjs tests/registry.test.mjs tests/runtime-provider.test.mjs tests/sessions.test.mjs tests/setup.test.mjs tests/speaker.test.mjs tests/successor.test.mjs tests/trace-census.test.mjs tests/trace-fixture-tools.test.mjs tests/trace-fixtures.test.mjs tests/update.test.mjs tests/traces.test.mjs tests/ux-contract.test.mjs tests/verify-dispatch.test.mjs tests/welcome.test.mjs tests/workspace-resolver.test.mjs tests/workspace.test.mjs",
16
- "test:heavy": "node --test --test-concurrency=2 tests/amend.test.mjs tests/cli.test.mjs tests/harness-install-contract.test.mjs tests/harness-live-contract.test.mjs tests/init.test.mjs tests/integration.test.mjs tests/launch.test.mjs tests/lineage.test.mjs tests/oathe-tools.test.mjs tests/pager.test.mjs tests/plugin.test.mjs tests/session-host.test.mjs tests/simple-cage.test.mjs tests/sql-acceptance-lane.test.mjs tests/substrate.test.mjs tests/vendor-scripts.test.mjs tests/verifier.test.mjs tests/notch-launchd.test.mjs",
16
+ "test:unit": "node --test tests/exec-results.test.mjs tests/forwarder.test.mjs tests/activation.test.mjs tests/atif.test.mjs tests/blocks.test.mjs tests/board-render.test.mjs tests/breach-digest.test.mjs tests/config.test.mjs tests/cursor-harness.test.mjs tests/daemon.test.mjs tests/device.test.mjs tests/discharge.test.mjs tests/evidence-budget.test.mjs tests/evidence-discovery.test.mjs tests/fslock.test.mjs tests/harness-contract.test.mjs tests/harness-docs.test.mjs tests/harness-docs-drift.test.mjs tests/harbor-conformance.test.mjs tests/harness.test.mjs tests/notch-frame.test.mjs tests/home.test.mjs tests/horizon-census.test.mjs tests/manifest-kinds.test.mjs tests/manifest.test.mjs tests/mcp-connection.test.mjs tests/node-floor.test.mjs tests/notch.test.mjs tests/packaging.test.mjs tests/paths.test.mjs tests/registry.test.mjs tests/runtime-provider.test.mjs tests/sessions.test.mjs tests/serve.test.mjs tests/setup.test.mjs tests/launchd.test.mjs tests/shim.test.mjs tests/speaker.test.mjs tests/successor.test.mjs tests/system-tasks.test.mjs tests/trace-census.test.mjs tests/trace-fixture-tools.test.mjs tests/trace-fixtures.test.mjs tests/update.test.mjs tests/traces.test.mjs tests/ux-contract.test.mjs tests/verify-dispatch.test.mjs tests/welcome.test.mjs tests/workspace-resolver.test.mjs tests/workspace.test.mjs",
17
+ "test:heavy": "node --test --test-concurrency=2 tests/amend.test.mjs tests/cli.test.mjs tests/harness-install-contract.test.mjs tests/harness-live-contract.test.mjs tests/init.test.mjs tests/integration.test.mjs tests/launch.test.mjs tests/lineage.test.mjs tests/oathe-tools.test.mjs tests/pager.test.mjs tests/plugin.test.mjs tests/rejection-loop.test.mjs tests/session-host.test.mjs tests/simple-cage.test.mjs tests/sql-acceptance-lane.test.mjs tests/substrate.test.mjs tests/vendor-scripts.test.mjs tests/verifier.test.mjs tests/notch-launchd.test.mjs",
17
18
  "lint": "npx -y eslint@10.9.1 .",
18
19
  "pack:dry-run": "npm pack --dry-run --ignore-scripts",
19
20
  "prepack": "node scripts/pack-notch.mjs",