@oathe/oathe 0.3.2 → 0.4.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 +42 -12
- package/assets/oathe-hero.png +0 -0
- package/bin/node-floor.mjs +16 -0
- package/bin/oathe.mjs +96 -136
- package/docs/PRIVACY.md +7 -6
- package/notch/Oathe Notch.app/Contents/Info.plist +1 -1
- package/notch/Oathe Notch.app/Contents/MacOS/OatheNotch +0 -0
- package/notch/README.md +33 -18
- package/package.json +9 -5
- package/plugin/.claude-plugin/plugin.json +2 -2
- package/plugin/.cursor-plugin/plugin.json +2 -2
- package/plugin/commands/verify.md +6 -5
- package/plugin/hooks/heartbeat.mjs +14 -5
- package/plugin/hooks/hooks.json +1 -1
- package/plugin/hooks/lib.mjs +7 -5
- package/plugin/hooks/render-board.mjs +3 -3
- package/plugin/skills/oathe-work/SKILL.md +4 -1
- package/src/activation.mjs +3 -0
- package/src/atif.mjs +182 -348
- package/src/board-render.mjs +46 -42
- package/src/breach-digest.mjs +183 -0
- package/src/config.mjs +15 -3
- package/src/context.mjs +1 -1
- package/src/doctor.mjs +30 -8
- package/src/evidence.mjs +153 -0
- package/src/harnesses/catalog.mjs +12 -1
- package/src/harnesses/claude-roster.mjs +49 -0
- package/src/harnesses/claude-transcript.mjs +174 -0
- package/src/harnesses/claude.mjs +35 -2
- package/src/harnesses/codex-rollout.mjs +610 -0
- package/src/harnesses/codex-roster.mjs +88 -0
- package/src/harnesses/codex.mjs +72 -2
- package/src/harnesses/cursor.mjs +10 -8
- package/src/harnesses/fidelity.mjs +123 -0
- package/src/init.mjs +5 -1
- package/src/launch-env.mjs +5 -5
- package/src/launch.mjs +5 -6
- package/src/manifest.mjs +35 -0
- package/src/mcp/connection.mjs +9 -7
- package/src/mcp/oathe-tools.mjs +135 -75
- package/src/node-floor.mjs +44 -0
- package/src/notch-frame.mjs +152 -0
- package/src/oathe-annotator.mjs +113 -0
- package/src/pager.mjs +75 -37
- package/src/runtime/provider.mjs +2 -2
- package/src/session-host.mjs +1 -1
- package/src/sessions.mjs +8 -1
- package/src/speaker.mjs +54 -26
- package/src/statements.mjs +120 -2
- package/src/substrate.mjs +3 -3
- package/src/successor.mjs +2 -3
- package/src/trace-census.mjs +96 -0
- package/src/traces.mjs +98 -6
- package/src/uninstall.mjs +4 -1
- package/src/update.mjs +86 -0
- package/src/verifier.mjs +37 -19
- package/assets/oathe-hero.svg +0 -92
package/src/traces.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// oathe — the trace stores: how
|
|
1
|
+
// oathe — the trace stores: how Claude Code's and Codex's session records are found, validated, and
|
|
2
2
|
// read. The CONTRACT lives in docs/traces.md; both vendors disclaim schema stability, so
|
|
3
3
|
// every read validates and REFUSES loudly (TraceContractError) rather than returning less
|
|
4
4
|
// evidence than a claim recorded. Nothing is hardcoded: every path derives from the store's
|
|
@@ -88,6 +88,26 @@ export class TraceStore {
|
|
|
88
88
|
newestFileIn(dir, matches) {
|
|
89
89
|
return this.#newestIn(dir, matches);
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Protected: matched files whose mtime falls inside the window, newest first, capped at
|
|
94
|
+
* maxFiles — and the newest match is ALWAYS included, so an idle store still yields its
|
|
95
|
+
* latest record instead of an empty (and therefore silently green) sweep.
|
|
96
|
+
*/
|
|
97
|
+
recentFilesIn(dir, matches, { days, maxFiles, now = Date.now() }) {
|
|
98
|
+
if (!fs.existsSync(dir)) return [];
|
|
99
|
+
const hits = [];
|
|
100
|
+
for (const entry of fs.readdirSync(dir, { recursive: true })) {
|
|
101
|
+
const full = path.join(dir, String(entry));
|
|
102
|
+
if (!matches(String(entry))) continue;
|
|
103
|
+
const stat = fs.statSync(full, { throwIfNoEntry: false });
|
|
104
|
+
if (stat?.isFile()) hits.push({ full, mtimeMs: stat.mtimeMs });
|
|
105
|
+
}
|
|
106
|
+
hits.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
107
|
+
const windowed = hits.filter((h) => h.mtimeMs >= now - days * 86_400_000).slice(0, maxFiles);
|
|
108
|
+
if (windowed.length === 0 && hits.length > 0) return [hits[0].full];
|
|
109
|
+
return windowed.map((h) => h.full);
|
|
110
|
+
}
|
|
91
111
|
}
|
|
92
112
|
|
|
93
113
|
const CLAUDE_MESSAGE_TYPES = new Set(['user', 'assistant', 'system']);
|
|
@@ -152,8 +172,44 @@ export class ClaudeTraceStore extends TraceStore {
|
|
|
152
172
|
});
|
|
153
173
|
}
|
|
154
174
|
|
|
175
|
+
static #isTranscript = (p) => /[0-9a-f-]{36}\.jsonl$/.test(p) && !p.includes('subagents');
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* The file a session's rows actually live in. The harness names a transcript per hook
|
|
179
|
+
* (`transcript_path`), but after a resume — and after a context compaction — it rotates the
|
|
180
|
+
* session id, reports `<new-id>.jsonl`, and keeps appending to the ORIGINAL file, stamping
|
|
181
|
+
* each new row with `session_id: <new-id>` beside the file's own `sessionId` (measured
|
|
182
|
+
* 2026-09-01). So: a reported file that exists is the answer; otherwise the newest sibling
|
|
183
|
+
* whose rows carry the id is; otherwise the reported path stands — a fresh session's file
|
|
184
|
+
* is created lazily and nothing carries its id yet. Positive evidence only, never a guess:
|
|
185
|
+
* a file that merely mentions the id in its text is not the session's.
|
|
186
|
+
*/
|
|
187
|
+
transcriptFor({ sessionId, reportedPath }) {
|
|
188
|
+
if (reportedPath === null || reportedPath === undefined || fs.existsSync(reportedPath)) return reportedPath ?? null;
|
|
189
|
+
const dir = path.dirname(reportedPath);
|
|
190
|
+
if (!fs.existsSync(dir)) return reportedPath;
|
|
191
|
+
const siblings = fs.readdirSync(dir)
|
|
192
|
+
.filter((f) => ClaudeTraceStore.#isTranscript(f))
|
|
193
|
+
.map((f) => ({ full: path.join(dir, f), mtimeMs: fs.statSync(path.join(dir, f)).mtimeMs }))
|
|
194
|
+
.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
195
|
+
const carries = (row) => row?.session_id === sessionId || row?.sessionId === sessionId;
|
|
196
|
+
for (const { full } of siblings) {
|
|
197
|
+
const text = fs.readFileSync(full, 'utf8');
|
|
198
|
+
if (!text.includes(sessionId)) continue; // the cheap gate; the rows decide
|
|
199
|
+
for (const line of text.split('\n')) {
|
|
200
|
+
if (!line.includes(sessionId)) continue;
|
|
201
|
+
try { if (carries(JSON.parse(line))) return full; } catch { /* a malformed line is describe()'s refusal, not this scan's */ }
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return reportedPath;
|
|
205
|
+
}
|
|
206
|
+
|
|
155
207
|
newestTranscript() {
|
|
156
|
-
return this.newestFileIn(this.projectsRoot,
|
|
208
|
+
return this.newestFileIn(this.projectsRoot, ClaudeTraceStore.#isTranscript);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
recentTranscripts({ days, maxFiles }) {
|
|
212
|
+
return this.recentFilesIn(this.projectsRoot, ClaudeTraceStore.#isTranscript, { days, maxFiles });
|
|
157
213
|
}
|
|
158
214
|
}
|
|
159
215
|
|
|
@@ -222,21 +278,57 @@ export class CodexTraceStore extends TraceStore {
|
|
|
222
278
|
}
|
|
223
279
|
}
|
|
224
280
|
|
|
225
|
-
/**
|
|
281
|
+
/**
|
|
282
|
+
* Fan-out: children of a thread per thread_spawn_edges, joined to their rollout paths —
|
|
283
|
+
* with the edge status (a failed child must be distinguishable from a completed one) and
|
|
284
|
+
* the spawn identity from threads.source (`{subagent: {thread_spawn: {agent_nickname,
|
|
285
|
+
* agent_role, agent_path, depth, …}}}`, measured live 2026-08-31). A source that is not
|
|
286
|
+
* JSON is an expected shape gone unreadable — refuse, never project a nameless child.
|
|
287
|
+
*/
|
|
226
288
|
childThreads(threadId) {
|
|
227
289
|
const db = this.#db();
|
|
228
290
|
try {
|
|
229
291
|
return db.prepare(
|
|
230
|
-
`SELECT e.child_thread_id AS thread_id, t.rollout_path, t.cwd, t.title
|
|
292
|
+
`SELECT e.child_thread_id AS thread_id, e.status, t.rollout_path, t.cwd, t.title, t.source
|
|
231
293
|
FROM thread_spawn_edges e LEFT JOIN threads t ON t.id = e.child_thread_id
|
|
232
294
|
WHERE e.parent_thread_id = ?`,
|
|
233
|
-
).all(threadId)
|
|
295
|
+
).all(threadId).map(({ source, ...row }) => {
|
|
296
|
+
let parsed = null;
|
|
297
|
+
if (source != null) {
|
|
298
|
+
try {
|
|
299
|
+
parsed = JSON.parse(source);
|
|
300
|
+
} catch (e) {
|
|
301
|
+
throw new TraceContractError('TRACE_CODEX_SOURCE_MALFORMED',
|
|
302
|
+
`thread ${row.thread_id}: threads.source is not JSON (${e.message}) — the spawn `
|
|
303
|
+
+ 'identity this store relies on is unreadable', { thread_id: row.thread_id });
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return { ...row, spawn: parsed?.subagent?.thread_spawn ?? null };
|
|
307
|
+
});
|
|
234
308
|
} finally {
|
|
235
309
|
db.close();
|
|
236
310
|
}
|
|
237
311
|
}
|
|
238
312
|
|
|
313
|
+
static #isRollout = (p) => /rollout-.+\.jsonl(\.zst)?$/.test(p);
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* The rollout a thread's rows live in: the reported path when it exists, else the thread
|
|
317
|
+
* index's own `rollout_path` (the store's record of where it writes), else the reported
|
|
318
|
+
* path — a rollout not written yet. Same contract as the Claude store's.
|
|
319
|
+
*/
|
|
320
|
+
transcriptFor({ sessionId, reportedPath }) {
|
|
321
|
+
if (reportedPath === null || reportedPath === undefined || fs.existsSync(reportedPath)) return reportedPath ?? null;
|
|
322
|
+
let indexed = null;
|
|
323
|
+
try { indexed = this.threadRow(sessionId)?.rollout_path ?? null; } catch { indexed = null; } // no index on this machine: nothing to consult
|
|
324
|
+
return indexed !== null && fs.existsSync(indexed) ? indexed : reportedPath;
|
|
325
|
+
}
|
|
326
|
+
|
|
239
327
|
newestRollout() {
|
|
240
|
-
return this.newestFileIn(this.sessionsRoot,
|
|
328
|
+
return this.newestFileIn(this.sessionsRoot, CodexTraceStore.#isRollout);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
recentRollouts({ days, maxFiles }) {
|
|
332
|
+
return this.recentFilesIn(this.sessionsRoot, CodexTraceStore.#isRollout, { days, maxFiles });
|
|
241
333
|
}
|
|
242
334
|
}
|
package/src/uninstall.mjs
CHANGED
|
@@ -38,7 +38,10 @@ export async function runUninstall({ env = process.env, exec, purgeDb = false }
|
|
|
38
38
|
// The notch LaunchAgent: booted out and removed exactly as recorded (src/notch.mjs).
|
|
39
39
|
const { unwireNotch } = await import('./notch.mjs');
|
|
40
40
|
actions.push(...unwireNotch({ manifest, ...(exec ? { exec } : {}) }));
|
|
41
|
-
|
|
41
|
+
// Same rule as init (B4): rows that landed while the undo CLIs ran are kept, this run's
|
|
42
|
+
// removals hold, and the save happens under the lock against the file as it is now.
|
|
43
|
+
const { withFileLock } = await import('./fslock.mjs');
|
|
44
|
+
await withFileLock(manifest.manifestPath, async () => { manifest.refresh({ merge: true }); manifest.save(); });
|
|
42
45
|
|
|
43
46
|
let databaseDropped = false;
|
|
44
47
|
if (purgeDb) {
|
package/src/update.mjs
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// oathe — `oathe update`: the documented upgrade, `npm i -g @oathe/oathe@latest && oathe init`,
|
|
2
|
+
// as one verb (founder's word, 2026-09-03). Three facts it holds:
|
|
3
|
+
// - the npm it calls is the one BESIDE the node running this bin (process.execPath), never
|
|
4
|
+
// PATH's — on an nvm machine PATH can lead to another node's npm, and then the upgrade lands
|
|
5
|
+
// somewhere this bin never looks (the trap the 0.4.1 trial hit);
|
|
6
|
+
// - init runs through the NEW bin — the one under npm's global PREFIX (`npm prefix -g`),
|
|
7
|
+
// which is node's own directory by default but not with `npm config set prefix …` (a
|
|
8
|
+
// Greptile P1 on PR #33 caught the execPath-sibling shortcut) — as a child with the terminal
|
|
9
|
+
// attached: this process still holds the old modules, and init's one screen needs the TTY;
|
|
10
|
+
// - a checkout is refused typed — it updates by git — and npm's failure is refused with npm's
|
|
11
|
+
// own last word, never a bland "done".
|
|
12
|
+
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import { spawnSync } from 'node:child_process';
|
|
16
|
+
|
|
17
|
+
import { defaultExec } from './harnesses/harness.mjs';
|
|
18
|
+
|
|
19
|
+
export class UpdateError extends Error {
|
|
20
|
+
constructor(code, message, details = {}) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.name = 'UpdateError';
|
|
23
|
+
this.code = code;
|
|
24
|
+
this.details = details;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** A sibling of the node that runs this process — npm ships with node, so this is npm's own home. */
|
|
29
|
+
export function siblingBin(name, { execPath = process.execPath } = {}) {
|
|
30
|
+
return path.join(path.dirname(execPath), name);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** One npm query, refused typed when npm cannot answer it. */
|
|
34
|
+
function npmQuery(exec, npm, args, code) {
|
|
35
|
+
const r = exec.run(npm, args);
|
|
36
|
+
if (r.status !== 0) {
|
|
37
|
+
throw new UpdateError(code, `update refused — \`${npm} ${args.join(' ')}\` failed: ${lastLine(r.stderr) || `exit ${r.status}`}`, { npm, args });
|
|
38
|
+
}
|
|
39
|
+
return r.stdout.trim();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The new bin, with the terminal attached — init's screen must reach the person. */
|
|
43
|
+
function defaultHandoff(bin, args, { env }) {
|
|
44
|
+
const r = spawnSync(bin, args, { stdio: 'inherit', env });
|
|
45
|
+
return { status: r.status ?? 1 };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const lastLine = (text) => String(text ?? '').trim().split('\n').filter(Boolean).at(-1) ?? '';
|
|
49
|
+
const realpathOrSelf = (p) => { try { return fs.realpathSync(p); } catch { return p; } };
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {{packageRoot: string, execPath?: string, exec?: {run: Function}, handoff?: Function,
|
|
53
|
+
* env?: NodeJS.ProcessEnv, args?: string[], out?: {write: Function}, tag?: string}} o
|
|
54
|
+
* @returns {{before: string, after: string, initStatus: number}}
|
|
55
|
+
*/
|
|
56
|
+
export function runUpdate({
|
|
57
|
+
packageRoot, execPath = process.execPath, exec = defaultExec, handoff = defaultHandoff,
|
|
58
|
+
env = process.env, args = [], out = process.stdout, tag = 'latest',
|
|
59
|
+
}) {
|
|
60
|
+
const readPkg = () => JSON.parse(fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
61
|
+
const pkg = readPkg();
|
|
62
|
+
const npm = siblingBin('npm', { execPath });
|
|
63
|
+
const globalRoot = path.join(npmQuery(exec, npm, ['root', '-g'], 'OATHE_UPDATE_NPM_UNAVAILABLE'), ...pkg.name.split('/'));
|
|
64
|
+
if (realpathOrSelf(globalRoot) !== realpathOrSelf(packageRoot)) {
|
|
65
|
+
throw new UpdateError('OATHE_UPDATE_NOT_GLOBAL',
|
|
66
|
+
`update refused — this oathe runs from ${packageRoot}, not from npm's global install `
|
|
67
|
+
+ `(${globalRoot}); a checkout updates with git, and \`npm i -g ${pkg.name}@${tag}\` installs the published package`,
|
|
68
|
+
{ packageRoot, globalRoot });
|
|
69
|
+
}
|
|
70
|
+
const before = pkg.version;
|
|
71
|
+
out.write(`update: ${pkg.name} ${before} → @${tag} (${npm})\n`);
|
|
72
|
+
const install = exec.run(npm, ['i', '-g', `${pkg.name}@${tag}`]);
|
|
73
|
+
if (install.status !== 0) {
|
|
74
|
+
throw new UpdateError('OATHE_UPDATE_FAILED',
|
|
75
|
+
`update refused — \`npm i -g ${pkg.name}@${tag}\` failed (exit ${install.status}): ${lastLine(install.stderr) || lastLine(install.stdout)}`,
|
|
76
|
+
{ status: install.status });
|
|
77
|
+
}
|
|
78
|
+
if (lastLine(install.stdout)) out.write(`update: ${lastLine(install.stdout)}\n`);
|
|
79
|
+
const after = readPkg().version; // npm replaced the files under this same root
|
|
80
|
+
out.write(`update: ${before} → ${after}${after === before ? ' (already current)' : ''} — running init through the new bin\n`);
|
|
81
|
+
// The new bin lives under npm's global prefix — node's directory by default, elsewhere with a
|
|
82
|
+
// custom prefix — never assumed from where node is.
|
|
83
|
+
const prefix = npmQuery(exec, npm, ['prefix', '-g'], 'OATHE_UPDATE_NPM_UNAVAILABLE');
|
|
84
|
+
const init = handoff(path.join(prefix, 'bin', 'oathe'), ['init', ...args], { env });
|
|
85
|
+
return { before, after, initStatus: init.status };
|
|
86
|
+
}
|
package/src/verifier.mjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// → gather the record: objective, frozen plan, completion statement, linked traces (fan-out
|
|
10
10
|
// derived at read time; a trace that fails the contract REFUSES — never less evidence
|
|
11
11
|
// than the claim recorded)
|
|
12
|
-
// → one headless engine run (
|
|
12
|
+
// → one headless engine run (any verifier-capable adapter, assigned at claim time) → strict JSON verdict
|
|
13
13
|
// → the verdict lands as the verification task's completion statement (durable, addressable)
|
|
14
14
|
// → the acceptance lane settles the ORIGINAL claim: seat = verifier principal (FC010: not
|
|
15
15
|
// the author), checker = 'oathe-verdict' (deterministic: the standard conditions PLUS the
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
// PROVENANCE; the judgment quality is the engine's, and the linked traces exist precisely so
|
|
23
23
|
// that judgment stays auditable.
|
|
24
24
|
|
|
25
|
-
import { isTraceSubjectSql } from './statements.mjs';
|
|
25
|
+
import { isTraceSubjectSql, TRACE_SUBJECT_PREFIX } from './statements.mjs';
|
|
26
26
|
import { createRequire } from 'node:module';
|
|
27
27
|
import { spawn } from 'node:child_process';
|
|
28
|
-
import { amendSubjectRef, engineFailureRef } from './statements.mjs';
|
|
28
|
+
import { amendSubjectRef, engineFailureRef, evidenceFailureRef } from './statements.mjs';
|
|
29
29
|
import { emit as wireEmit } from './wire.mjs';
|
|
30
30
|
import { WorkspaceRegistry } from './registry.mjs';
|
|
31
31
|
import { homeOf } from './paths.mjs';
|
|
@@ -33,7 +33,8 @@ import { HomeBoard } from './home.mjs';
|
|
|
33
33
|
|
|
34
34
|
import { createOatheTools } from './mcp/oathe-tools.mjs';
|
|
35
35
|
import { renderEvidenceView, sliceForTask } from './atif.mjs';
|
|
36
|
-
import {
|
|
36
|
+
import { transcriptFor } from './harnesses/catalog.mjs';
|
|
37
|
+
import { projectAnnotated } from './oathe-annotator.mjs';
|
|
37
38
|
import { verificationTaskId, isVerificationTask, ACCEPTANCE_CLAUSE_KEY } from './plans.mjs';
|
|
38
39
|
import { RECORDED_VERDICT_CHECKER } from './runtime/discharge.mjs';
|
|
39
40
|
|
|
@@ -56,7 +57,8 @@ export class Verifier {
|
|
|
56
57
|
* config: import('./config.mjs').OatheConfig, operatorPrincipal: string,
|
|
57
58
|
* engineRunner?: ({engine, prompt}) => Promise<{verdict: string, reason: string}>}} o
|
|
58
59
|
*/
|
|
59
|
-
constructor({ substrate, paths, workspace, config, operatorPrincipal, engineRunner, provider = null, homePathFor = null }) {
|
|
60
|
+
constructor({ substrate, paths, workspace, config, operatorPrincipal, engineRunner, provider = null, homePathFor = null, env = process.env }) {
|
|
61
|
+
this.env = env; // the store home follows the RUN's env — a rebound HOME (cage, sandbox) must read the store the hooks wrote
|
|
60
62
|
this.substrate = substrate;
|
|
61
63
|
this.paths = paths;
|
|
62
64
|
this.workspace = workspace;
|
|
@@ -123,8 +125,14 @@ export class Verifier {
|
|
|
123
125
|
[this.orgId, workClaimId]);
|
|
124
126
|
const traces = [];
|
|
125
127
|
for (const row of rows) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
// The file the session's rows LIVE in: a link spoken from a resumed session names the
|
|
129
|
+
// transcript the harness reported and never wrote — the store resolves it from the rows
|
|
130
|
+
// that carry the session id (transcriptFor); a file nothing carries stays as recorded
|
|
131
|
+
// and refuses below, loudly.
|
|
132
|
+
const sessionId = row.subject_ref.slice(TRACE_SUBJECT_PREFIX.length);
|
|
133
|
+
for (const ref of row.evidence_refs) {
|
|
134
|
+
const file = transcriptFor({ sessionId, reportedPath: ref, home: homeOf(this.env) });
|
|
135
|
+
traces.push({ path: file, trajectory: await projectAnnotated(file, { home: homeOf(this.env) }) });
|
|
128
136
|
}
|
|
129
137
|
}
|
|
130
138
|
return traces;
|
|
@@ -137,8 +145,9 @@ export class Verifier {
|
|
|
137
145
|
'You are a verification agent. Judge ONE question: do the recorded ACTIONS and OUTCOMES',
|
|
138
146
|
'support the completion assertion? In the trace views below, SAID lines are the agent\'s',
|
|
139
147
|
'own claims; CLAIM lines are its on-the-record speech acts; DID lines are the actions it',
|
|
140
|
-
'actually took; GOT lines are what actually came back
|
|
141
|
-
'
|
|
148
|
+
'actually took; GOT lines are what actually came back; FROM lines are messages other agents sent',
|
|
149
|
+
'this one (a delegated brief, a subagent\'s answer) — never this agent\'s own claims. Judge',
|
|
150
|
+
'claims against actions and outcomes — be strict: absence of evidence is absence.',
|
|
142
151
|
'You are running in the task\'s workspace — check asserted artifacts against the files on disk.',
|
|
143
152
|
'',
|
|
144
153
|
`TASK: ${taskId}`,
|
|
@@ -184,14 +193,15 @@ export class Verifier {
|
|
|
184
193
|
const vclaim = await this.tools.oathe_claim({ task_id: verificationTask });
|
|
185
194
|
|
|
186
195
|
// 2-3. EVERYTHING between the claim and a durable verdict runs under the release
|
|
187
|
-
// guard (ruling 2026-08-31: ANY exit before a verdict fails loud and frees the claim
|
|
188
|
-
//
|
|
189
|
-
//
|
|
190
|
-
//
|
|
196
|
+
// guard (ruling 2026-08-31: ANY exit before a verdict fails loud and frees the claim —
|
|
197
|
+
// an exit outside the guard, an unreadable trace say, would leave the twin wedged
|
|
198
|
+
// behind its lease). Evidence-gathering and the engine fail the same way: durable
|
|
199
|
+
// statement, yield, verify_failed on the wire.
|
|
191
200
|
let raw;
|
|
192
201
|
let completion;
|
|
193
202
|
let taskRows;
|
|
194
203
|
let traces;
|
|
204
|
+
let engineLaunched = false;
|
|
195
205
|
try {
|
|
196
206
|
completion = await this.#completionStatement(originalTask);
|
|
197
207
|
({ rows: taskRows } = await this.substrate.query(
|
|
@@ -209,6 +219,7 @@ export class Verifier {
|
|
|
209
219
|
WHERE org_id = $1 AND task_id = $2 AND subject_ref = $3
|
|
210
220
|
ORDER BY asserted_at`,
|
|
211
221
|
[this.orgId, originalTask, amendSubjectRef(originalTask)]);
|
|
222
|
+
engineLaunched = true;
|
|
212
223
|
raw = await this.engineRunner({
|
|
213
224
|
engine,
|
|
214
225
|
cwd: taskHome,
|
|
@@ -220,16 +231,23 @@ export class Verifier {
|
|
|
220
231
|
+ `{verdict: ${VERDICTS.join('|')}, reason} and the lane never guesses`, { raw, engine });
|
|
221
232
|
}
|
|
222
233
|
} catch (e) {
|
|
234
|
+
// One guard, two honest stalls (the 2026-08-31 pileup): an unreadable record fails
|
|
235
|
+
// every engine alike, so only an engine-stage death may advise trying another one.
|
|
236
|
+
const msg = String(e?.message ?? e).slice(0, 400);
|
|
237
|
+
const stall = engineLaunched
|
|
238
|
+
? { proposition: `engine ${engine} failed before a verdict: ${msg}`,
|
|
239
|
+
ref: engineFailureRef(engine),
|
|
240
|
+
note: `engine ${engine} died — released for retry: oathe verify ${originalTask} --engine <another>` }
|
|
241
|
+
: { proposition: `gathering evidence failed before the ${engine} engine launched: ${msg}`,
|
|
242
|
+
ref: evidenceFailureRef(e?.code),
|
|
243
|
+
note: `the record could not be read — fix the cause and retry: oathe verify ${originalTask}` };
|
|
223
244
|
try {
|
|
224
245
|
await this.tools.oathe_statement({
|
|
225
246
|
task_id: verificationTask,
|
|
226
|
-
proposition:
|
|
227
|
-
evidence_ref:
|
|
228
|
-
});
|
|
229
|
-
await this.tools.oathe_yield({
|
|
230
|
-
task_id: verificationTask,
|
|
231
|
-
note: `engine ${engine} died — released for retry: oathe verify ${originalTask} --engine <another>`,
|
|
247
|
+
proposition: stall.proposition,
|
|
248
|
+
evidence_ref: stall.ref,
|
|
232
249
|
});
|
|
250
|
+
await this.tools.oathe_yield({ task_id: verificationTask, note: stall.note });
|
|
233
251
|
} catch { /* best-effort release — the primary failure must surface either way */ }
|
|
234
252
|
// The glass hears the failure too (fail-soft inside emit): named by the ORIGINAL
|
|
235
253
|
// task — the row a person is looking at — so retry is one act, not archaeology.
|
package/assets/oathe-hero.svg
DELETED
|
@@ -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">> </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">>_ 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>
|