Skip to content

Commit f9eb9c0

Browse files
committed
chore(dashboard-agent-db,contracts): cut the query and wire-contract comments
1 parent 9270caf commit f9eb9c0

15 files changed

Lines changed: 276 additions & 1126 deletions

File tree

internal-packages/dashboard-agent-contracts/src/blocks.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
type ViewBlock,
1616
} from "./blocks.js";
1717

18-
// A diagnosis block exactly as stored before the envelope existed.
1918
const legacyDiagnosis = {
2019
type: "diagnosis",
2120
runId: "run_abc123",
@@ -36,7 +35,6 @@ const legacyDiagnosis = {
3635
actions: [{ label: "View run", kind: "view_run", target: "run_abc123" }],
3736
};
3837

39-
// A chart block exactly as stored before the envelope existed.
4038
const legacyChart = {
4139
type: "chart",
4240
title: "Failures per hour",
@@ -53,7 +51,6 @@ const legacyChart = {
5351

5452
const envelope = { id: "toolcall_1", revision: 0, version: VIEW_BLOCK_VERSION };
5553

56-
// A health report as the reports API returns it, trimmed to one finding.
5754
const reportVm = {
5855
title: "health",
5956
scope: "prod",
@@ -298,7 +295,6 @@ describe("report block", () => {
298295
expect(parsed.vm).toEqual(reportVm);
299296
expect(parsed.asOf).toBe("2026-07-27T10:15:00.000Z");
300297
expect(parsed.reportUri).toBe("trigger://proj_abc/env_abc/report/health");
301-
// A JSON round-trip is how it reaches a transcript.
302298
expect(reportBlockSchema.parse(JSON.parse(JSON.stringify(parsed)))).toEqual(parsed);
303299
});
304300

@@ -342,14 +338,12 @@ describe("report block", () => {
342338
...reportBlock,
343339
vm: {
344340
...reportVm,
345-
// A field the presenter grew after this transcript was written.
346341
confidence: "high",
347342
metrics: [{ id: "spend", value: 12, unit: "usd", severity: "ok" }],
348343
},
349344
};
350345
const parsed = reportBlockSchema.parse(evolved);
351346
expect(parsed.vm.confidence).toBe("high");
352-
// An unknown unit degrades to `count` instead of failing the whole block.
353347
expect(parsed.vm.metrics[0]!.unit).toBe("count");
354348
});
355349

@@ -361,10 +355,6 @@ describe("report block", () => {
361355
});
362356
});
363357

364-
// ---------------------------------------------------------------------------
365-
// investigation
366-
// ---------------------------------------------------------------------------
367-
368358
const runEvidence = {
369359
kind: "run" as const,
370360
uri: "trigger://proj_abc/env_abc/run/run_abc123",
@@ -403,15 +393,13 @@ describe("investigation block", () => {
403393
expect(strict.id).toBe("inv_abc123");
404394
expect(strict.revision).toBe(2);
405395
expect(strict.investigation.remediation).toBeDefined();
406-
// A JSON round-trip is how it reaches a transcript.
407396
expect(investigationBlockSchema.parse(JSON.parse(JSON.stringify(strict)))).toEqual(strict);
408397
});
409398

410399
it("is in the strict and the lenient unions", () => {
411400
expect(viewBlockSchema.safeParse(investigationBlock).success).toBe(true);
412401
const lenient: ViewBlock = investigationBlockSchema.parse(investigationBlock);
413402
expect(lenient.type).toBe("investigation");
414-
// A pre-envelope stored block still parses.
415403
expect(parseStoredViewBlock(investigationBody).id).toBeUndefined();
416404
});
417405

@@ -465,7 +453,6 @@ describe("investigation block", () => {
465453
viewBlockInputSchema.safeParse({ type: "investigation", investigation: withoutFinding })
466454
.success
467455
).toBe(false);
468-
// A hypothesis still being tested doesn't need one.
469456
expect(
470457
viewBlockInputSchema.safeParse({
471458
type: "investigation",
@@ -480,7 +467,6 @@ describe("investigation block", () => {
480467
});
481468

482469
it("the model-facing input accepts bare resource ids; the strict schema still demands trigger:// URIs", () => {
483-
// Input boundary: the model cites by bare id, the executor canonicalizes.
484470
expect(
485471
viewBlockInputSchema.safeParse({
486472
type: "investigation",
@@ -490,7 +476,6 @@ describe("investigation block", () => {
490476
},
491477
}).success
492478
).toBe(true);
493-
// Persist/emit boundary: anything that isn't a canonical URI stays rejected.
494479
expect(
495480
investigationStateSchema.safeParse({
496481
...concludedInvestigation,
@@ -504,7 +489,6 @@ describe("investigation block", () => {
504489
const rev1 = investigationBlockSchema.parse({ ...investigationBlock, revision: 1 });
505490
expect(rev0.id).toBe(rev1.id);
506491
expect(rev1.revision).toBeGreaterThan(rev0.revision);
507-
// Unlike a report, whose revision is pinned to 0.
508492
expect(
509493
investigationBlockSchema.safeParse({ ...investigationBlock, revision: -1 }).success
510494
).toBe(false);
@@ -527,9 +511,7 @@ describe("investigation evidence refs (the model-facing boundary)", () => {
527511
label: "the retry config",
528512
}).success
529513
).toBe(true);
530-
// The commit is optional — the executor pins it to the turn's snapshot.
531514
expect(withEvidence({ kind: "source", path: "src/a.ts", label: "a file" }).success).toBe(true);
532-
// A path:line string in `uri` is exactly what couldn't be canonicalized.
533515
expect(withEvidence({ kind: "source", uri: "src/a.ts:42", label: "a file" }).success).toBe(
534516
false
535517
);
@@ -591,8 +573,6 @@ describe("investigation capabilities", () => {
591573
...investigationBlock,
592574
capabilities: { version: 1, actions: [action] },
593575
});
594-
// Nothing here comes from the model, so a navigate target must already be a
595-
// canonical URI. Unlike a chart action, there is no lenient string to allow.
596576
expect(
597577
withAction({
598578
kind: "view_similar",

0 commit comments

Comments
 (0)