omkit 0.0.13 → 0.0.14

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.
@@ -321,6 +321,11 @@ export class SpinHost {
321
321
  const file = await this.output.runLog.write();
322
322
  // Direct to the terminal — the file's already written, so this line isn't in it.
323
323
  this.term(LogRenderer.marker("run", `log → ${file}`));
324
+ // If this run logged any assertions, link the dedicated file beside the main one
325
+ // (only exists when there was at least one assertion). Terminal-only, like `log →`.
326
+ const assertionsFile = this.output.runLog.assertionsLog;
327
+ if (assertionsFile)
328
+ this.term(LogRenderer.marker("assert", `assertions → ${assertionsFile}`));
324
329
  const result = { ok: this.failures.length === 0, failures: this.failures };
325
330
  // One process = one run = one verdict; reflect pass/fail in the exit code so
326
331
  // shells and CI see it without parsing the log. Only set it on failure, so a
@@ -13,7 +13,10 @@ import type { SnapshotStore } from "../snapshot/SnapshotStore.ts";
13
13
  export declare class RunLog {
14
14
  private readonly folder;
15
15
  private readonly snapshots;
16
+ private assertionsPath;
16
17
  constructor(folder: RunFolder, snapshots: SnapshotStore);
18
+ /** The `assertions.log` path if any assertion was logged this run, else `undefined`. */
19
+ get assertionsLog(): string | undefined;
17
20
  /**
18
21
  * Streams every log entry to `run.jsonl` (the complete, authoritative record) and a
19
22
  * live `run.log` incrementally as they arrive, so output survives a hard kill or lost
@@ -15,10 +15,18 @@ import { ymd, hms } from "../../utils/format.js";
15
15
  export class RunLog {
16
16
  folder;
17
17
  snapshots;
18
+ // Path of `assertions.log`, set the first time an assertion is streamed (lazily
19
+ // created). Stays `undefined` for a run with no assertions, so the finalize step
20
+ // links it only when it exists. See {@link assertionsLog}.
21
+ assertionsPath;
18
22
  constructor(folder, snapshots) {
19
23
  this.folder = folder;
20
24
  this.snapshots = snapshots;
21
25
  }
26
+ /** The `assertions.log` path if any assertion was logged this run, else `undefined`. */
27
+ get assertionsLog() {
28
+ return this.assertionsPath;
29
+ }
22
30
  /**
23
31
  * Streams every log entry to `run.jsonl` (the complete, authoritative record) and a
24
32
  * live `run.log` incrementally as they arrive, so output survives a hard kill or lost
@@ -46,7 +54,10 @@ export class RunLog {
46
54
  jsonl.write(JSON.stringify(entry) + "\n");
47
55
  pretty.write(renderer.render(entry) + "\n");
48
56
  if (entry.level === "assert") {
49
- assertions ??= createWriteStream(this.folder.resolve("assertions.log"));
57
+ if (!assertions) {
58
+ this.assertionsPath = this.folder.resolve("assertions.log");
59
+ assertions = createWriteStream(this.assertionsPath);
60
+ }
50
61
  assertions.write(LogRenderer.marker("assert", entry.message) + "\n");
51
62
  }
52
63
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omkit",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "A tiny runtime for developer workflows: typed actions that pass runtime capabilities and emit typed events, under one run and one shared log. The operational/runtime layer to tskb's knowledge layer.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",