@intentius/behold 0.13.1 → 0.15.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/AGENTS.md +78 -7
- package/dist/cli.js +2310 -1874
- package/example-argo-estate/app-a/package.json +2 -2
- package/example-argo-estate/app-b/package.json +2 -2
- package/example-argo-estate/control-plane/package.json +2 -2
- package/example-argo-estate/package-lock.json +144 -52
- package/example-carve/app/package-lock.json +9 -9
- package/example-carve/app/package.json +2 -2
- package/example-flux-estate/app-a/package.json +2 -2
- package/example-flux-estate/app-b/package.json +2 -2
- package/example-flux-estate/control-plane/package.json +2 -2
- package/example-flux-estate/package-lock.json +144 -52
- package/example-k8s/package-lock.json +18 -18
- package/example-k8s/package.json +3 -3
- package/example-writes/package-lock.json +14 -14
- package/example-writes/package.json +3 -3
- package/package.json +3 -3
- package/web/app.js +124 -5
- package/web/index.html +24 -2
- package/web/operator.js +247 -14
- package/web/operator.test.js +188 -4
- package/web/release.js +66 -0
- package/web/release.test.js +52 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { releaseRows, runLink, unlinkedReason, runText } from "../web/release.js";
|
|
3
|
+
|
|
4
|
+
const NOW = Date.parse("2026-09-01T12:00:00Z");
|
|
5
|
+
const base = { runId: "18234771902", gitSha: "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678", digest: "sha256:86bf5e3c", timestamp: "2026-09-01T11:30:00Z", actor: "ci-bot" };
|
|
6
|
+
|
|
7
|
+
describe("release rows (#165)", () => {
|
|
8
|
+
it("a record that carries its own address links the run, and names forge + repo", () => {
|
|
9
|
+
const r = { ...base, forge: "github", originSource: "record", repo: "INTENTIUS/loomster", url: "https://github.com/INTENTIUS/loomster/actions/runs/18234771902", approver: "alex" };
|
|
10
|
+
const rows = releaseRows(r, NOW);
|
|
11
|
+
expect(rows[0]).toEqual(["run", { href: r.url, text: "18234771902 · GitHub Actions · INTENTIUS/loomster" }]);
|
|
12
|
+
expect(rows.find(([k]) => k === "")).toBeUndefined();
|
|
13
|
+
expect(rows.find(([k]) => k === "approver")[1]).toBe("alex");
|
|
14
|
+
expect(rows.find(([k]) => k === "recorded")[1]).toBe("2026-09-01T11:30:00Z (30m ago)");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("a bare id from a pre-chant#2045 record is never linked, and the caveat says why", () => {
|
|
18
|
+
const r = { ...base, forge: "unknown", originSource: "inferred" };
|
|
19
|
+
expect(runLink(r)).toBeNull();
|
|
20
|
+
expect(unlinkedReason(r)).toMatch(/chant#2045/);
|
|
21
|
+
expect(unlinkedReason(r)).toMatch(/will not guess/);
|
|
22
|
+
expect(releaseRows(r, NOW)[0]).toEqual(["run", "18234771902 · an unlinked run"]);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("a laptop run says there is nowhere to go — whether the record said local or the id's spelling did", () => {
|
|
26
|
+
const said = { ...base, runId: "local-1756726200000", forge: "local", originSource: "record" };
|
|
27
|
+
const spelled = { ...base, runId: "local-1756726200000", forge: "local", originSource: "inferred" };
|
|
28
|
+
expect(unlinkedReason(said)).toMatch(/the record says so/);
|
|
29
|
+
expect(unlinkedReason(spelled)).toMatch(/a local- id/);
|
|
30
|
+
expect(runText(said)).toBe("local-1756726200000 · a laptop run");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it("an inferred origin never yields a link even if a url is somehow present", () => {
|
|
34
|
+
expect(runLink({ ...base, forge: "github", originSource: "inferred", url: "https://example.com/run" })).toBeNull();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("a recorded origin with a non-http url is not a link — the gate card's rule", () => {
|
|
38
|
+
const r = { ...base, forge: "github", originSource: "record", url: "javascript:alert(1)" };
|
|
39
|
+
expect(runLink(r)).toBeNull();
|
|
40
|
+
expect(unlinkedReason(r)).toMatch(/named no server URL/);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("an ungated change says so in the approver row rather than leaving a gap", () => {
|
|
44
|
+
const rows = releaseRows({ ...base, forge: "op", originSource: "record" }, NOW);
|
|
45
|
+
expect(rows.find(([k]) => k === "approver")[1]).toBe("none — an ungated change");
|
|
46
|
+
expect(unlinkedReason({ ...base, forge: "op", originSource: "record" })).toMatch(/Temporal/);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it("nothing recorded → no rows", () => {
|
|
50
|
+
expect(releaseRows(undefined)).toEqual([]);
|
|
51
|
+
});
|
|
52
|
+
});
|