@basou/cli 0.54.0 → 0.56.0
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/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/program.js +11 -7
- package/dist/program.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -139,6 +139,7 @@ import {
|
|
|
139
139
|
LOCAL_CLI_EVENT_SOURCE,
|
|
140
140
|
linkYamlFile,
|
|
141
141
|
loadApproval,
|
|
142
|
+
normalizeApprovalTimestamps,
|
|
142
143
|
prefixedUlid,
|
|
143
144
|
readSessionYaml,
|
|
144
145
|
readYamlFile,
|
|
@@ -226,7 +227,7 @@ async function readApprovalListRecord(paths, id, location, now) {
|
|
|
226
227
|
console.error(`Skipped ${shortId(id)}: ${describeReadError(error)}`);
|
|
227
228
|
return null;
|
|
228
229
|
}
|
|
229
|
-
const parse = ApprovalSchema.safeParse(raw);
|
|
230
|
+
const parse = ApprovalSchema.safeParse(normalizeApprovalTimestamps(raw));
|
|
230
231
|
if (!parse.success) {
|
|
231
232
|
console.error(`Skipped ${shortId(id)}: invalid approval schema`);
|
|
232
233
|
return null;
|
|
@@ -323,7 +324,7 @@ async function doRunApprovalResolve(idInput, options, ctx, decision) {
|
|
|
323
324
|
}
|
|
324
325
|
throw new Error("Failed to read approval", { cause: error });
|
|
325
326
|
}
|
|
326
|
-
const approvalParse = ApprovalSchema.safeParse(pendingRaw);
|
|
327
|
+
const approvalParse = ApprovalSchema.safeParse(normalizeApprovalTimestamps(pendingRaw));
|
|
327
328
|
if (!approvalParse.success) {
|
|
328
329
|
throw new Error("Failed to read approval", { cause: approvalParse.error });
|
|
329
330
|
}
|
|
@@ -3153,7 +3154,7 @@ async function importDerivedSessions(paths, manifest, options, sourceKind, candi
|
|
|
3153
3154
|
dryRun: options.dryRun === true
|
|
3154
3155
|
});
|
|
3155
3156
|
if (outcome.status === "skipped") {
|
|
3156
|
-
const detail = outcome.reason === "prior_events_unreadable" ? "prior events.jsonl has unreadable lines" : outcome.reason === "prior_chain_broken" ? "prior events.jsonl failed hash-chain verification (run 'basou verify')" : "source changed in a non-append way (derived events would be dropped)";
|
|
3157
|
+
const detail = outcome.reason === "prior_events_unreadable" ? "prior events.jsonl has unreadable lines" : outcome.reason === "prior_chain_broken" ? "prior events.jsonl failed hash-chain verification (run 'basou verify')" : outcome.reason === "prior_yaml_invalid" ? "prior session.yaml does not load as a whole document" : "source changed in a non-append way (derived events would be dropped)";
|
|
3157
3158
|
console.error(`Import: ${externalId} ${detail}; re-import skipped`);
|
|
3158
3159
|
counts.skippedUnverifiable++;
|
|
3159
3160
|
continue;
|
|
@@ -10025,6 +10026,7 @@ import {
|
|
|
10025
10026
|
importSessionFromJson as importSessionFromJson2,
|
|
10026
10027
|
LOCAL_CLI_EVENT_SOURCE as LOCAL_CLI_EVENT_SOURCE4,
|
|
10027
10028
|
loadSessionEntries as loadSessionEntries2,
|
|
10029
|
+
normalizeSessionTimestamps,
|
|
10028
10030
|
readAllEvents,
|
|
10029
10031
|
readManifest as readManifest11,
|
|
10030
10032
|
readObservedDuration,
|
|
@@ -10147,7 +10149,7 @@ async function doRunSessionShow(idInput, options, ctx) {
|
|
|
10147
10149
|
let session;
|
|
10148
10150
|
try {
|
|
10149
10151
|
const raw = await readYamlFile7(sessionYamlPath);
|
|
10150
|
-
session = SessionSchema3.parse(raw);
|
|
10152
|
+
session = SessionSchema3.parse(normalizeSessionTimestamps(raw));
|
|
10151
10153
|
} catch (error) {
|
|
10152
10154
|
if (findErrorCode12(error, "ENOENT")) {
|
|
10153
10155
|
throw new Error(`Session not found: ${idInput}`);
|
|
@@ -12083,7 +12085,8 @@ async function doRunVerify(options, ctx) {
|
|
|
12083
12085
|
status: verdict.status,
|
|
12084
12086
|
event_count: verdict.eventCount,
|
|
12085
12087
|
...verdict.reason !== void 0 ? { reason: verdict.reason } : {},
|
|
12086
|
-
...verdict.line !== void 0 ? { line: verdict.line } : {}
|
|
12088
|
+
...verdict.line !== void 0 ? { line: verdict.line } : {},
|
|
12089
|
+
...verdict.sessionYamlInvalid === true ? { session_yaml_invalid: true } : {}
|
|
12087
12090
|
});
|
|
12088
12091
|
}
|
|
12089
12092
|
const tamperedCount = rows.filter((r) => r.status === "tampered").length;
|
|
@@ -12091,7 +12094,8 @@ async function doRunVerify(options, ctx) {
|
|
|
12091
12094
|
console.log(JSON.stringify(rows, null, 2));
|
|
12092
12095
|
} else {
|
|
12093
12096
|
for (const row of rows) {
|
|
12094
|
-
|
|
12097
|
+
const note = row.session_yaml_invalid === true ? " \u2014 session.yaml does not load as a whole document (session_yaml_invalid)" : "";
|
|
12098
|
+
console.log(`${row.session_id} ${renderVerdict(row)}${note}`);
|
|
12095
12099
|
}
|
|
12096
12100
|
const tally = (status) => rows.filter((r) => r.status === status).length;
|
|
12097
12101
|
console.log(
|
|
@@ -14111,7 +14115,7 @@ async function assertWorkspaceInitialized15(basouRoot) {
|
|
|
14111
14115
|
function readBuildStamp() {
|
|
14112
14116
|
if (false) return void 0;
|
|
14113
14117
|
try {
|
|
14114
|
-
return JSON.parse('{"version":"0.
|
|
14118
|
+
return JSON.parse('{"version":"0.56.0","commit":"dcbb7ee","committedAt":"2026-09-30T13:15:29+09:00"}');
|
|
14115
14119
|
} catch {
|
|
14116
14120
|
return void 0;
|
|
14117
14121
|
}
|