@oathe/oathe 0.2.1 → 0.2.3

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.
package/README.md CHANGED
@@ -2,15 +2,33 @@
2
2
 
3
3
  **Auto save across your harnesses.**
4
4
 
5
- ![Claude Code hits its usage limit mid-fix; Codex opens in the same repo and Oathe resumes the task — progress, effect receipt, and verification target intact.](assets/oathe-hero.svg)
5
+ [![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)
6
6
 
7
- You're mid-refactor in Claude Code when it hits a usage limit. What if you could open Codex and it picks up the same task checkpointed, what's done, what's left, and a test that decides whether it's finished. No copy and paste, no re-explaining, and the new agent doesn't have to take the old agent's word for anything because models are getting too good at being wrong AND confident.
7
+ ![Side by side: oathe claude claims the task and works until the model's usage limit cuts it off; oathe codex greets the same board — the task still claimed, completion not asserted — and picks up in the same workspace.](assets/handoff-splash.png)
8
+
9
+ You're mid-refactor in Claude Code when it hits a usage limit. What if you could open Codex and it picks up the same task checkpointed, what's done, what's left, and a test that decides whether it's finished. No copy and paste, no re-explaining, and the new agent doesn't have to take the old agent's word for anything because **models are getting too good at being wrong AND confident.**
8
10
 
9
11
  That's oathe.
10
12
 
11
13
  Below is exactly how much of it works today, because a reliability project that overstates its own status would be a joke.
12
14
 
13
- [![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)
15
+ ## Quickstart
16
+
17
+ You need Node ≥ 22 and a running Postgres. Every command below is real and exercised by the
18
+ test suite and a clean-container proof.
19
+
20
+ ```bash
21
+ npm install -g @oathe/oathe@latest
22
+
23
+ cd your-project
24
+ oathe init # local substrate up (createdb + schema), both installed harnesses onboarded
25
+ oathe claude # a normal interactive session — the board shows, nothing auto-resumes
26
+ ```
27
+
28
+ Ctrl-C anytime. Open `oathe codex` in the same folder — same board, same claims, other harness.
29
+
30
+ What Oathe reads, stores, and sends: [docs/PRIVACY.md](docs/PRIVACY.md). The full
31
+ technical reference: [docs/PACKAGE.md](docs/PACKAGE.md).
14
32
 
15
33
  ## What gets saved
16
34
 
@@ -22,7 +40,7 @@ oathe goes up a layer of abstraction:
22
40
  | Saved | Why it matters |
23
41
  | --- | --- |
24
42
  | The task and who owns it | The next agent continues *assigned work*, not the last sentence someone typed |
25
- | Progress and evidence | no grep, proper evidence and agent trajectory analysis |
43
+ | Progress and evidence | no grep, proper evidence and agent trajectory analysis to **make sure agents are DOING what they SAY they're doing**|
26
44
  | Side-effect receipts | critical actions get deduplicated etc. (A deploy, payment etc.) that already happened doesn't happen again on retry |
27
45
  | Definition of done | established before agent work starts, so it can't quietly drift |
28
46
  | workspace checkpoint | Branch, commit, and work-in-progress bytes survive your session |
@@ -69,18 +87,11 @@ Honest labels, kept current in [ROADMAP.md](ROADMAP.md):
69
87
 
70
88
  Known limitations are disclosed in the roadmap, including the ones that are semi-embarrassing.
71
89
 
72
- ## Quickstart
73
-
74
- You need Node ≥ 22 and a running Postgres. Every command below is real and exercised by the
75
- test suite and a clean-container proof.
90
+ ## Under the hood
76
91
 
77
- ```bash
78
- npm install -g @oathe/oathe
92
+ A small runtime plus a Postgres schema that carries the invariants. The database is deliberately "load-bearing": the rules that keep work safe (one current attempt per task, receipts before effects, verification before settlement) are enforced where no caller can route around them. Harness adapters are thin; our substrate is strict.
79
93
 
80
- cd your-project
81
- oathe init # local substrate up (createdb + schema), both installed harnesses onboarded
82
- oathe claude # a normal interactive session — the board shows, nothing auto-resumes
83
- ```
94
+ ## CLI and MCP
84
95
 
85
96
  Claim work in-session through the `oathe_*` tools (or from the terminal):
86
97
 
@@ -92,20 +103,6 @@ oathe verify fix-login # a NON-author engine judges it from your recorded sess
92
103
  oathe ls # the board; `oathe uninstall` removes exactly what init recorded
93
104
  ```
94
105
 
95
- Ctrl-C anytime. Open `oathe codex` in the same folder — same board, same claims, other harness.
96
-
97
- What Oathe reads, stores, and sends: [docs/PRIVACY.md](docs/PRIVACY.md). The full
98
- technical reference: [docs/PACKAGE.md](docs/PACKAGE.md).
99
-
100
- ## Under the hood
101
-
102
- A small runtime plus a Postgres schema that carries the invariants. The database is deliberately "load-bearing": the rules that keep work safe (one current attempt per task, receipts before effects, verification before settlement) are enforced where no caller can route around them. Harness adapters are thin; our substrate is strict.
103
-
104
- ## Community
105
-
106
- Questions, feedback, and show-and-tell: [Discord](https://discord.gg/sjrdWEj4W8) ·
107
- [GitHub Discussions](https://github.com/oathe-ai/oathe/discussions)
108
-
109
106
  ## Contributing
110
107
 
111
108
  Start with [CONTRIBUTING.md](CONTRIBUTING.md). Substantial changes begin with a design issue. The most valuable first contribution is a reproducible failure-and-recovery scenario — if we claim a failure mode is handled, the repository should prove it.
Binary file
package/bin/oathe.mjs CHANGED
@@ -58,17 +58,30 @@ const handlers = {
58
58
  async init() {
59
59
  const { runInit } = await import('../src/init.mjs');
60
60
  const result = await runInit({});
61
- process.stdout.write('harness census:\n');
62
- for (const c of result.census) {
63
- process.stdout.write(` ${c.name.padEnd(8)} ${c.installed ? 'onboarded' : 'not installed — skipped'}\n`);
64
- }
61
+ const tty = process.stdout.isTTY === true;
62
+ const B = tty ? '\x1b[1m' : '';
63
+ const D = tty ? '\x1b[2m' : '';
64
+ const G = tty ? '\x1b[32m' : '';
65
+ const R = tty ? '\x1b[0m' : '';
66
+ const ok = `${G}✓${R}`;
65
67
  const s = result.substrate;
66
- process.stdout.write(`substrate: db up, ddl ${s.ddl_applied}/${s.ddl_expected} applied `
67
- + `(source: ${s.ddl_source}), yield cause ${s.yield_cause_registered ? 'registered' : 'MISSING'}\n`);
68
- process.stdout.write(`principal: ${result.principal.principal_id} (${result.principal.role})\n`);
69
- for (const a of result.actions) {
70
- process.stdout.write(` ${a.harness.padEnd(8)} ${a.action}\n`);
68
+ const lines = ['', ` ${B}⚡ Oathe is up${R}`, ''];
69
+ lines.push(` ${ok} ${B}substrate${R} ${D}db up · ${s.ddl_applied}/${s.ddl_expected} schema applied · verification lane ready${R}`);
70
+ if (!s.yield_cause_registered) {
71
+ lines.push(` ${B}! yield cause MISSING${R} — run \`oathe doctor\` before claiming work`);
72
+ }
73
+ for (const c of result.census) {
74
+ const wired = result.actions.filter((a) => a.harness === c.name).length;
75
+ lines.push(c.installed
76
+ ? ` ${ok} ${B}${c.name.padEnd(9)}${R} ${D}onboarded (${wired} surface${wired === 1 ? '' : 's'} wired, reversible)${R}`
77
+ : ` ${D}– ${c.name.padEnd(9)} not installed — skipped${R}`);
71
78
  }
79
+ lines.push(` ${ok} ${B}you${R} ${D}${result.principal.principal_id}${R}`);
80
+ lines.push('');
81
+ lines.push(` Next: ${B}oathe claude${R} ${D}(or codex)${R} in any project — the board rides every session.`);
82
+ lines.push(` Claim before you build: ${B}oathe claim <task> "what done means"${R}`);
83
+ lines.push('');
84
+ process.stdout.write(`${lines.join('\n')}\n`);
72
85
  summary('init', 'ok');
73
86
  },
74
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oathe/oathe",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Auto save and verified completion for AI coding agents \u2014 a durable local task board that outlives any one session. D0 preview.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "oathe",
3
3
  "displayName": "Oathe",
4
- "version": "0.2.1",
4
+ "version": "0.2.3",
5
5
  "description": "Claims are speech acts: your session opens on this folder's board, records progress as statements, and yields what it cannot finish. Horizons move only by deliberate acts \u2014 never by session liveness.",
6
6
  "author": {
7
7
  "name": "Oathe"
@@ -4,8 +4,58 @@
4
4
  // and everything plugin-side asks ONE predicate before touching the substrate. Named once here:
5
5
  // the launcher writes the block, the hooks and the server read it.
6
6
 
7
+ import fs from 'node:fs';
8
+ import path from 'node:path';
9
+
7
10
  export const LAUNCHED_HARNESS_ENV = 'OATHE_LAUNCHED_HARNESS';
8
11
 
12
+ // The env marker crosses the cage boundary for harnesses that pass their environment to MCP
13
+ // children (Claude Code). Codex builds MCP child environments from its own config, so the
14
+ // marker dies at that boundary — the SESSION MARKER FILE is the harness-agnostic transport:
15
+ // the launcher writes <oatheHome>/launched/<workspace>.<pid>.json while it supervises, the
16
+ // gate honors any marker for its workspace whose supervisor is still alive, and teardown
17
+ // (or the supervisor dying) retires it. Stale markers fail the liveness probe and are inert.
18
+
19
+ export function sessionMarkerPath(oatheHome, workspace, pid = process.pid) {
20
+ return path.join(oatheHome, 'launched', `${workspace}.${pid}.json`);
21
+ }
22
+
23
+ /** @returns {string} the marker file path (hand it to clearSessionMarker at teardown).
24
+ * `wiring` is the launchSessionEnv block: harnesses that strip the environment on the way
25
+ * to their MCP children (Codex) get it back from here, identity included. */
26
+ export function writeSessionMarker({ oatheHome, workspace, harness, cwd, wiring = {}, pid = process.pid }) {
27
+ const file = sessionMarkerPath(oatheHome, workspace, pid);
28
+ fs.mkdirSync(path.dirname(file), { recursive: true });
29
+ fs.writeFileSync(file, `${JSON.stringify({
30
+ harness, supervisor_pid: pid, cwd, wiring, started_at: new Date().toISOString(),
31
+ })}\n`);
32
+ return file;
33
+ }
34
+
35
+ export function clearSessionMarker(file) {
36
+ fs.rmSync(file, { force: true });
37
+ }
38
+
39
+ /** The full LIVE launch marker for this workspace ({harness, wiring, …}), or null.
40
+ * Dead and unreadable markers are retired on sight. */
41
+ export function liveSessionMarker({ oatheHome, workspace }) {
42
+ const dir = path.join(oatheHome, 'launched');
43
+ let names;
44
+ try { names = fs.readdirSync(dir); } catch { return null; }
45
+ for (const name of names) {
46
+ if (!name.startsWith(`${workspace}.`) || !name.endsWith('.json')) continue;
47
+ const file = path.join(dir, name);
48
+ try {
49
+ const marker = JSON.parse(fs.readFileSync(file, 'utf8'));
50
+ process.kill(marker.supervisor_pid, 0); // throws when the supervisor is gone
51
+ return marker;
52
+ } catch {
53
+ fs.rmSync(file, { force: true }); // stale or unreadable: retire it
54
+ }
55
+ }
56
+ return null;
57
+ }
58
+
9
59
  /** The harness ('claude' | 'codex') that launched this session, or null when unlaunched. */
10
60
  export function launchedHarness(env = process.env) {
11
61
  const value = String(env[LAUNCHED_HARNESS_ENV] ?? '').trim();
package/src/launch.mjs CHANGED
@@ -16,7 +16,7 @@ import { FencedBlock, FENCE_STYLES } from './blocks.mjs';
16
16
  import { sha256Hex } from './manifest.mjs';
17
17
  import { workspaceRef } from './workspace.mjs';
18
18
  import { SessionHost } from './session-host.mjs';
19
- import { launchSessionEnv } from './launch-env.mjs';
19
+ import { launchSessionEnv, writeSessionMarker, clearSessionMarker } from './launch-env.mjs';
20
20
 
21
21
  export class LaunchError extends Error {
22
22
  constructor(code, message, details = {}) {
@@ -157,6 +157,10 @@ export async function runHarness({
157
157
 
158
158
  const unit = `oathe-${Date.now().toString(36)}-${process.pid}`;
159
159
  const extra = launchSessionEnv({ config, identity, cwd, harness });
160
+ // The env block above dies at Codex's MCP spawn boundary; the marker file is the
161
+ // harness-agnostic copy of the same wiring, retired in the finally below.
162
+ const marker = writeSessionMarker({
163
+ oatheHome: paths.oatheHome, workspace, harness, cwd, wiring: extra });
160
164
  const cage = spawnCaged({
161
165
  unit,
162
166
  env: curatedEnv(env, { hermetic, extra }),
@@ -170,7 +174,7 @@ export async function runHarness({
170
174
  client: substrate,
171
175
  identity,
172
176
  workspace,
173
- liveness: () => cage.enumerate().length > 0,
177
+ liveness: () => (cage.alive ? cage.alive() : cage.enumerate().length > 0),
174
178
  observeIntervalMs,
175
179
  });
176
180
  host.start();
@@ -182,6 +186,7 @@ export async function runHarness({
182
186
  if (exitCode === 0) await host.stop({ exitCode });
183
187
  else await host.stopSilently(); // a non-zero exit was not a clean goodbye — leave the absence
184
188
  } finally {
189
+ clearSessionMarker(marker);
185
190
  await substrate.close();
186
191
  }
187
192
  const teardown = await cage.teardownProvenEmpty();
@@ -15,7 +15,7 @@ import { pathToFileURL } from 'node:url';
15
15
  import crypto from 'node:crypto';
16
16
 
17
17
  import { standardPlan, verificationTaskId, verificationObjective, isVerificationTask } from '../plans.mjs';
18
- import { launchedHarness } from '../launch-env.mjs';
18
+ import { launchedHarness, liveSessionMarker } from '../launch-env.mjs';
19
19
 
20
20
  export const PROTOCOL_VERSION = '2025-06-18';
21
21
  export const SERVER_NAME = 'oathe-tools';
@@ -379,7 +379,8 @@ export function createOatheTools({ client, identity, workspace, executionActor,
379
379
  if (!successor) {
380
380
  throw new OatheToolError('OATHE_PICKUP_UNAVAILABLE',
381
381
  'pickup is not wired into this tools server — the successor sequence is unavailable in '
382
- + 'this session (a preview limitation of sessions without the runtime seam); pickup '
382
+ + 'this session (a preview limitation of sessions without the runtime seam).'
383
+ + ' Continue the task directly instead: its objective and recorded progress are on the board (oathe_board), so inspect the workspace, keep working, record progress with oathe_statement, and assert completion with oathe_done — the claim is already yours. Pickup '
383
384
  + 'cannot pretend', { task_id });
384
385
  }
385
386
  return successor({ task_id, work_claim_id: latest.work_claim_id });
@@ -416,8 +417,8 @@ export async function handleToolCall(params, tools) {
416
417
  * OATHE_NOT_LAUNCHED refusal — loud to the model (a called tool must answer), inert to the
417
418
  * substrate (an unlaunched session never touches the board).
418
419
  */
419
- export function withLaunchGate(tools, env = process.env) {
420
- if (launchedHarness(env)) return tools;
420
+ export function withLaunchGate(tools, env = process.env, { launched = false } = {}) {
421
+ if (launchedHarness(env) || launched) return tools;
421
422
  const refuse = async () => {
422
423
  throw new OatheToolError('OATHE_NOT_LAUNCHED',
423
424
  'this session was not launched through oathe, so the board is not bound to it — start the '
@@ -461,7 +462,20 @@ export async function main(env = process.env) {
461
462
  const { Substrate } = await import('../substrate.mjs');
462
463
  const { buildPaths } = await import('../paths.mjs');
463
464
  const { workspaceRef } = await import('../workspace.mjs');
464
- const paths = buildPaths(env);
465
+ let paths = buildPaths(env);
466
+ // Codex builds MCP child environments from its own config, so the launcher's env block
467
+ // never crosses that boundary. A live session marker for this cwd's workspace is the
468
+ // harness-agnostic transport: adopt its recorded wiring (identity included) and re-derive.
469
+ let markerLaunched = false;
470
+ if (!env.OATHE_LAUNCHED_HARNESS) {
471
+ const marker = liveSessionMarker({
472
+ oatheHome: paths.oatheHome, workspace: workspaceRef(process.cwd()) });
473
+ if (marker) {
474
+ env = { ...env, ...marker.wiring, OATHE_LAUNCHED_HARNESS: marker.harness };
475
+ paths = buildPaths(env);
476
+ markerLaunched = true;
477
+ }
478
+ }
465
479
  const { OatheConfig } = await import('../config.mjs');
466
480
  const config = new OatheConfig({ env, cwd: env.OATHE_WORKSPACE_DIR || process.cwd() });
467
481
  const substrate = new Substrate({ database: config.get('db'), paths, env, config });
@@ -500,7 +514,7 @@ export async function main(env = process.env) {
500
514
  return (await successorPromise).pickup(o);
501
515
  },
502
516
  });
503
- const served = withLaunchGate(tools, env);
517
+ const served = withLaunchGate(tools, env, { launched: markerLaunched });
504
518
  const rl = readline.createInterface({ input: process.stdin });
505
519
  rl.on('line', async (line) => {
506
520
  const s = line.trim();
@@ -132,7 +132,8 @@ export class StandaloneRuntimeProvider {
132
132
  throw new RuntimeError('OATHE_PICKUP_UNAVAILABLE',
133
133
  'the successor sequence needs the oathe runtime, which does not resolve on this '
134
134
  + 'machine (runtime provider: standalone) — pickup cannot pretend; this is a preview '
135
- + 'limitation', { provider: 'standalone' });
135
+ + 'limitation.'
136
+ + ' Continue the task directly instead: its objective and recorded progress are on the board (oathe_board), so inspect the workspace, keep working, record progress with oathe_statement, and assert completion with oathe_done — the claim is already yours.', { provider: 'standalone' });
136
137
  },
137
138
  close: async () => {},
138
139
  };
@@ -24,7 +24,17 @@ export function spawnCaged({ unit, env, cmd, args, cwd, stdio, graceMs = DEFAULT
24
24
  });
25
25
  const pgid = child.pid;
26
26
 
27
- /** Kernel read of the group — live pids (stopped counts as live), [] once the scope is empty. */
27
+ /** Liveness of the group as a kernel signal probe — kill(-pgid, 0) costs nanoseconds and
28
+ * spawns nothing. True while ANY member (stopped and zombie included) exists. This is the
29
+ * hot-path check: a full `ps -A` here made every poll a whole-system process-table scan,
30
+ * and concurrent cages contending on that scan wedged macOS's proc subsystem (measured:
31
+ * `ps` latency >45s while the test suite ran — the suite was DDoSing itself). */
32
+ const alive = () => {
33
+ try { process.kill(-pgid, 0); return true; } catch { return false; }
34
+ };
35
+
36
+ /** Kernel read of the group — live pids, [] once the scope is empty. Full-table scan:
37
+ * COLD PATH ONLY (the final proof and its failure detail), never inside a poll loop. */
28
38
  const enumerate = () => {
29
39
  const ps = spawnSync('ps', ['-A', '-o', 'pid=,pgid='], { encoding: 'utf8' });
30
40
  if (ps.status !== 0) {
@@ -41,15 +51,16 @@ export function spawnCaged({ unit, env, cmd, args, cwd, stdio, graceMs = DEFAULT
41
51
  };
42
52
 
43
53
  const drainUntil = async (deadline) => {
44
- while (Date.now() < deadline && enumerate().length > 0) await sleep(POLL_MS);
54
+ while (Date.now() < deadline && alive()) await sleep(POLL_MS);
45
55
  };
46
56
 
47
- /** SIGTERM → grace → SIGKILL, then RE-ENUMERATE: the emptiness is proof, not assumption. */
57
+ /** SIGTERM → grace → SIGKILL, then RE-ENUMERATE: the emptiness is proof, not assumption.
58
+ * Polling rides the signal probe; the one authoritative ps scan is the closing proof. */
48
59
  const teardownProvenEmpty = async () => {
49
- if (enumerate().length > 0) {
60
+ if (alive()) {
50
61
  signalGroup('SIGTERM');
51
62
  await drainUntil(Date.now() + graceMs);
52
- if (enumerate().length > 0) {
63
+ if (alive()) {
53
64
  signalGroup('SIGKILL');
54
65
  await drainUntil(Date.now() + graceMs);
55
66
  }
@@ -63,5 +74,5 @@ export function spawnCaged({ unit, env, cmd, args, cwd, stdio, graceMs = DEFAULT
63
74
  };
64
75
  };
65
76
 
66
- return { child, enumerate, teardownProvenEmpty };
77
+ return { child, alive, enumerate, teardownProvenEmpty };
67
78
  }
package/src/successor.mjs CHANGED
@@ -24,7 +24,8 @@ export async function buildSuccessor({ substrate, identity, paths }) {
24
24
  } catch (e) {
25
25
  throw new RuntimeError('OATHE_PICKUP_UNAVAILABLE',
26
26
  'the successor sequence needs the oathe runtime, which does not resolve on this machine '
27
- + '— pickup cannot pretend; this is a preview limitation until oathe-runtime lands',
27
+ + '— pickup cannot pretend; this is a preview limitation until oathe-runtime lands.'
28
+ + ' Continue the task directly instead: its objective and recorded progress are on the board (oathe_board), so inspect the workspace, keep working, record progress with oathe_statement, and assert completion with oathe_done — the claim is already yours.',
28
29
  { cause: String(e?.message || e) });
29
30
  }
30
31
  return seam.buildSuccessor({ substrate, identity, paths });
@@ -1,92 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 856" font-family="Menlo, 'SF Mono', Consolas, 'Liberation Mono', 'DejaVu Sans Mono', monospace" font-size="13">
2
- <style>text { white-space: pre; }</style>
3
- <defs>
4
- <clipPath id="winTop"><rect x="0" y="0" width="900" height="468" rx="10"/></clipPath>
5
- <clipPath id="winBot"><rect x="0" y="492" width="900" height="364" rx="10"/></clipPath>
6
- </defs>
7
-
8
- <!-- ===== Top window: Claude Code ===== -->
9
- <g clip-path="url(#winTop)">
10
- <rect x="0" y="0" width="900" height="468" fill="#111214"/>
11
- <rect x="0" y="0" width="900" height="32" fill="#1b1c20"/>
12
- </g>
13
- <rect x="0.5" y="0.5" width="899" height="467" rx="10" fill="none" stroke="#2a2c33"/>
14
- <circle cx="22" cy="16" r="6" fill="#ff5f57"/>
15
- <circle cx="42" cy="16" r="6" fill="#febc2e"/>
16
- <circle cx="62" cy="16" r="6" fill="#28c840"/>
17
- <text x="450" y="21" text-anchor="middle" fill="#8b8f98">checkout-service — claude</text>
18
-
19
- <!-- Claude Code pixel mascot -->
20
- <g fill="#d97757">
21
- <rect x="24" y="48" width="40" height="32"/>
22
- <rect x="26" y="80" width="5" height="8"/>
23
- <rect x="37" y="80" width="5" height="8"/>
24
- <rect x="48" y="80" width="5" height="8"/>
25
- <rect x="59" y="80" width="5" height="8"/>
26
- </g>
27
- <rect x="36" y="56" width="4" height="12" fill="#2a1a12"/>
28
- <rect x="50" y="56" width="4" height="12" fill="#2a1a12"/>
29
-
30
- <g xml:space="preserve" fill="#d6d8dd">
31
- <text x="76" y="60"><tspan font-weight="bold" fill="#e8eaef">Claude Code</tspan><tspan fill="#8b8f98"> v2.1.239</tspan></text>
32
- <text x="76" y="80" fill="#8b8f98">Fable 5 with xhigh effort · Claude Max</text>
33
- <text x="76" y="100" fill="#8b8f98">~/checkout-service</text>
34
-
35
- <text x="24" y="136"><tspan fill="#8b8f98">&gt; </tspan><tspan fill="#e8eaef">Customers get double-charged on checkout retries — find and fix it.</tspan></text>
36
-
37
- <text x="24" y="172"><tspan fill="#4ec97a">● </tspan><tspan>capturePayment omits the order's idempotency key, so a retried request opens a</tspan></text>
38
- <text x="24" y="192"><tspan> second charge. I'll thread it through the gateway call.</tspan></text>
39
-
40
- <text x="24" y="220"><tspan fill="#4ec97a">● </tspan><tspan font-weight="bold" fill="#e8eaef">Read</tspan><tspan fill="#6cb6ff">(src/capturePayment.ts, gateway.ts)</tspan></text>
41
- <text x="24" y="240" fill="#8b8f98"> ⎿ Read 2 files</text>
42
-
43
- <text x="24" y="268"><tspan fill="#4ec97a">● </tspan><tspan font-weight="bold" fill="#e8eaef">Update</tspan><tspan fill="#6cb6ff">(src/capturePayment.ts)</tspan></text>
44
- <text x="24" y="288" fill="#8b8f98"> ⎿ Added 1 line, removed 1 line</text>
45
-
46
- <text x="24" y="312" fill="#8b8f98"> 22 const res = await gateway.charge({</text>
47
- <rect x="12" y="320" width="876" height="20" fill="#3b1517"/>
48
- <text x="24" y="334"><tspan fill="#8b8f98"> 23 </tspan><tspan fill="#f47067">- source: order.token,</tspan></text>
49
- <rect x="12" y="340" width="876" height="20" fill="#13351d"/>
50
- <text x="24" y="354"><tspan fill="#8b8f98"> 23 </tspan><tspan fill="#7ee787">+ source: order.token, idempotencyKey: order.idempotencyKey,</tspan></text>
51
- <text x="24" y="374" fill="#8b8f98"> 24 })</text>
52
-
53
- <text x="24" y="402"><tspan fill="#4ec97a">● </tspan><tspan font-weight="bold" fill="#e8eaef">Bash</tspan><tspan fill="#6cb6ff">(node --test test/payment.idempotency.test.js)</tspan></text>
54
- <text x="24" y="422" fill="#8b8f98"> ⎿ Running verification…</text>
55
-
56
- <text x="24" y="450"><tspan fill="#e5a44c">⚠ Claude usage limit reached · resets 1:00 AM · run /upgrade to raise your limit</tspan></text>
57
- </g>
58
-
59
- <!-- ===== Bottom window: Codex ===== -->
60
- <g clip-path="url(#winBot)">
61
- <rect x="0" y="492" width="900" height="364" fill="#111214"/>
62
- <rect x="0" y="492" width="900" height="32" fill="#1b1c20"/>
63
- </g>
64
- <rect x="0.5" y="492.5" width="899" height="363" rx="10" fill="none" stroke="#2a2c33"/>
65
- <circle cx="22" cy="508" r="6" fill="#ff5f57"/>
66
- <circle cx="42" cy="508" r="6" fill="#febc2e"/>
67
- <circle cx="62" cy="508" r="6" fill="#28c840"/>
68
- <text x="450" y="513" text-anchor="middle" fill="#8b8f98">checkout-service — codex</text>
69
-
70
- <g xml:space="preserve" fill="#d6d8dd">
71
- <text x="24" y="552" fill="#8b8f98">(base) dev@macbook-pro checkout-service % <tspan font-weight="bold" fill="#e8eaef">codex</tspan></text>
72
-
73
- <rect x="20" y="564" width="420" height="52" rx="6" fill="none" stroke="#3a3f4b"/>
74
- <text x="34" y="586"><tspan font-weight="bold" fill="#e8eaef">&gt;_ OpenAI Codex</tspan><tspan fill="#8b8f98"> model: gpt-5.6</tspan></text>
75
- <text x="34" y="606" fill="#8b8f98"> directory: ~/checkout-service</text>
76
-
77
- <text x="24" y="642"><tspan fill="#4ec97a">● </tspan><tspan font-weight="bold" fill="#e8eaef">oathe</tspan><tspan fill="#8b8f98"> · unfinished work found — </tspan><tspan fill="#e8eaef">handoff from claude-code</tspan></text>
78
- <text x="24" y="668"><tspan fill="#8b8f98"> work </tspan><tspan>prevent duplicate charge on checkout retry</tspan></text>
79
- <text x="24" y="688"><tspan fill="#8b8f98"> progress </tspan><tspan>idempotency guard implemented in capturePayment.ts</tspan></text>
80
- <text x="24" y="708"><tspan fill="#8b8f98"> effects </tspan><tspan fill="#6cb6ff">charge ch_4821</tspan><tspan> already recorded — </tspan><tspan fill="#4ec97a">will not repeat</tspan></text>
81
- <text x="24" y="728"><tspan fill="#8b8f98"> verify </tspan><tspan fill="#6cb6ff">payment-idempotency</tspan><tspan> contract</tspan></text>
82
- <text x="24" y="748"><tspan fill="#8b8f98"> next </tspan><tspan>run verification</tspan></text>
83
-
84
- <rect x="238" y="768" width="44" height="22" rx="5" fill="#1d3b28" stroke="#2ea55f"/>
85
- <text x="24" y="783"><tspan fill="#4ec97a">❯ </tspan><tspan fill="#e8eaef">Resume this work?</tspan></text>
86
- <text x="248" y="783" fill="#7ee787">Yes</text>
87
- <text x="296" y="783" fill="#8b8f98">No</text>
88
-
89
- <text x="24" y="815"><tspan fill="#4ec97a">● </tspan><tspan>Resuming open oathe claim</tspan></text>
90
- <text x="24" y="839"><tspan fill="#4ec97a">● </tspan><tspan>Running <tspan fill="#6cb6ff">payment-idempotency</tspan> contract…</tspan></text>
91
- </g>
92
- </svg>