@ted-galago/wave-cli 0.1.16 → 0.1.17

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.
@@ -1172,17 +1172,21 @@ function runOsmdLiveVerification() {
1172
1172
  reason: "depth_zero_contract"
1173
1173
  });
1174
1174
 
1175
- const wikiRootRead = runWave(["osmd", "wiki", "read", "Agent Wiki"], env);
1176
- results.push(wikiRootRead);
1175
+ const wikiStatus = runWave(["osmd", "wiki", "status", "index.md"], env);
1176
+ results.push(wikiStatus);
1177
1177
  osmdVerificationFailures += recordExactCheck({
1178
1178
  lines: osmdVerificationLines,
1179
- label: "osmd.wiki read root",
1180
- result: wikiRootRead,
1179
+ label: "osmd.wiki status index",
1180
+ result: wikiStatus,
1181
1181
  ok:
1182
- wikiRootRead.parsed?.ok === true &&
1183
- wikiRootRead.parsed?.data?.path === "Agent Wiki" &&
1184
- wikiRootRead.parsed?.data?.source === "agent_wiki",
1185
- reason: "agent_wiki_root_read"
1182
+ wikiStatus.parsed?.ok === true &&
1183
+ wikiStatus.parsed?.data?.path === "Agent Wiki/index.md" &&
1184
+ wikiStatus.parsed?.data?.source === "agent_wiki" &&
1185
+ (wikiStatus.parsed?.data?.exists !== false ||
1186
+ (wikiStatus.parsed?.data?.canCreate === true &&
1187
+ wikiStatus.parsed?.data?.canUpdate === false &&
1188
+ wikiStatus.parsed?.data?.suggestedAction === "create")),
1189
+ reason: "agent_wiki_index_status"
1186
1190
  });
1187
1191
 
1188
1192
  const wikiChildren = runWave(["osmd", "wiki", "children"], env);
@@ -1195,27 +1199,86 @@ function runOsmdLiveVerification() {
1195
1199
  reason: "agent_wiki_children"
1196
1200
  });
1197
1201
 
1198
- const missingWikiPath = `missing-${verifyStamp}.md`;
1199
- const missingWikiUpdate = runWave(
1200
- ["osmd", "wiki", "update", missingWikiPath, "--content", "verify missing update"],
1202
+ const wikiLogStatus = runWave(["osmd", "wiki", "status", "log.md"], env);
1203
+ results.push(wikiLogStatus);
1204
+ osmdVerificationFailures += recordExactCheck({
1205
+ lines: osmdVerificationLines,
1206
+ label: "osmd.wiki status append-only log",
1207
+ result: wikiLogStatus,
1208
+ ok:
1209
+ wikiLogStatus.parsed?.ok === true &&
1210
+ wikiLogStatus.parsed?.data?.path === "Agent Wiki/log.md" &&
1211
+ wikiLogStatus.parsed?.data?.source === "agent_wiki" &&
1212
+ wikiLogStatus.parsed?.data?.access === "append_only" &&
1213
+ typeof wikiLogStatus.parsed?.data?.canAppend === "boolean",
1214
+ reason: "agent_wiki_log_status"
1215
+ });
1216
+
1217
+ const wikiLogRead = runWave(["osmd", "wiki", "read", "Agent Wiki/log.md"], env);
1218
+ results.push(wikiLogRead);
1219
+ osmdVerificationFailures += recordExactCheck({
1220
+ lines: osmdVerificationLines,
1221
+ label: "osmd.wiki read append-only log does not create",
1222
+ result: wikiLogRead,
1223
+ ok:
1224
+ wikiLogRead.parsed?.ok === true &&
1225
+ wikiLogRead.parsed?.data?.path === "Agent Wiki/log.md" &&
1226
+ wikiLogRead.parsed?.data?.access === "append_only" &&
1227
+ wikiLogRead.parsed?.data?.exists === wikiLogStatus.parsed?.data?.exists,
1228
+ reason: "agent_wiki_log_read"
1229
+ });
1230
+
1231
+ const wikiLogAppend = runWave(
1232
+ ["osmd", "wiki", "append-log", "--content", `CLI live verify log ${verifyStamp}`],
1201
1233
  env
1202
1234
  );
1203
- results.push(missingWikiUpdate);
1235
+ results.push(wikiLogAppend);
1236
+ const logAppendAllowed =
1237
+ wikiLogStatus.parsed?.data?.exists === true &&
1238
+ wikiLogStatus.parsed?.data?.access === "append_only" &&
1239
+ wikiLogStatus.parsed?.data?.canAppend === true;
1204
1240
  osmdVerificationFailures += recordExactCheck({
1205
1241
  lines: osmdVerificationLines,
1206
- label: "osmd.wiki update missing file returns 404 metadata",
1207
- result: missingWikiUpdate,
1208
- ok:
1209
- missingWikiUpdate.code === 5 &&
1210
- missingWikiUpdate.parsed?.ok === false &&
1211
- missingWikiUpdate.parsed?.status === 404 &&
1212
- missingWikiUpdate.parsed?.error?.code === "agent_file_not_found" &&
1213
- missingWikiUpdate.parsed?.error?.suggestedAction === "create" &&
1214
- missingWikiUpdate.parsed?.data?.exists === false &&
1215
- missingWikiUpdate.parsed?.data?.canCreate === true,
1216
- reason: "missing_file_404"
1242
+ label: "osmd.wiki append-log follows backend canAppend",
1243
+ result: wikiLogAppend,
1244
+ ok: logAppendAllowed
1245
+ ? wikiLogAppend.parsed?.ok === true &&
1246
+ wikiLogAppend.parsed?.data?.path === "Agent Wiki/log.md" &&
1247
+ wikiLogAppend.parsed?.data?.access === "append_only"
1248
+ : wikiLogAppend.parsed?.ok === false &&
1249
+ wikiLogAppend.parsed?.data?.path === "Agent Wiki/log.md" &&
1250
+ wikiLogAppend.parsed?.data?.canAppend === false,
1251
+ reason: "agent_wiki_log_append"
1217
1252
  });
1218
1253
 
1254
+ if (wikiStatus.parsed?.data?.exists === false) {
1255
+ const missingWikiUpdate = runWave(
1256
+ ["osmd", "wiki", "update", "index.md", "--content", "verify missing update"],
1257
+ env
1258
+ );
1259
+ results.push(missingWikiUpdate);
1260
+ osmdVerificationFailures += recordExactCheck({
1261
+ lines: osmdVerificationLines,
1262
+ label: "osmd.wiki update missing file returns 404 metadata",
1263
+ result: missingWikiUpdate,
1264
+ ok:
1265
+ missingWikiUpdate.code === 5 &&
1266
+ missingWikiUpdate.parsed?.ok === false &&
1267
+ missingWikiUpdate.parsed?.status === 404 &&
1268
+ missingWikiUpdate.parsed?.error?.code === "agent_file_not_found" &&
1269
+ missingWikiUpdate.parsed?.error?.suggestedAction === "create" &&
1270
+ missingWikiUpdate.parsed?.data?.exists === false &&
1271
+ missingWikiUpdate.parsed?.data?.canCreate === true &&
1272
+ missingWikiUpdate.parsed?.data?.canUpdate === false &&
1273
+ missingWikiUpdate.parsed?.data?.suggestedAction === "create",
1274
+ reason: "missing_file_404"
1275
+ });
1276
+ } else {
1277
+ osmdVerificationLines.push(
1278
+ "PASS | status=n/a | err=skipped_existing_index | reason=missing_file_404_skipped | osmd.wiki update missing file returns 404 metadata"
1279
+ );
1280
+ }
1281
+
1219
1282
  const parentRef = resolveOsmdAgentParentRef();
1220
1283
  if (!parentRef) {
1221
1284
  osmdVerificationLines.push(
@@ -1247,8 +1310,8 @@ function runOsmdLiveVerification() {
1247
1310
  result: agentInit,
1248
1311
  ok:
1249
1312
  agentInit.parsed?.ok === true &&
1250
- initFiles.some((file) => file?.path?.endsWith("/.agent/notes.md")) &&
1251
- initFiles.some((file) => file?.path?.endsWith("/.agent/log.md")),
1313
+ (initFiles.some((file) => file?.path?.endsWith("/.agent/notes.md")) ||
1314
+ agentInit.parsed?.data?.path?.endsWith("/.agent/notes.md")),
1252
1315
  reason: "agent_overlay_init"
1253
1316
  });
1254
1317