Skip to content

Commit 7fb1b71

Browse files
committed
Merge remote-tracking branch 'origin/main' into tml-2733-migration-list-graph-review-followups
Signed-off-by: Will Madden <madden@prisma.io>
2 parents f54e6cc + 5a32a1b commit 7fb1b71

18 files changed

Lines changed: 371 additions & 450 deletions

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
"lint:docs": "node scripts/validate-package-readmes.mjs",
3939
"lint:manifests": "node scripts/validate-package-manifests.mjs",
4040
"lint:workflows": "node scripts/lint-workflow-triggers.mjs",
41-
"test:scripts": "node --test scripts/lint-workflow-triggers.test.mjs scripts/validate-skills.test.mjs scripts/determine-version-utils.test.ts scripts/check-upgrade-coverage.test.mjs scripts/set-version-utils.test.ts scripts/check-publish-deps-pn-pins.test.mjs scripts/publish-packages-utils.test.mjs scripts/check-clean-tree.test.mjs scripts/lint-casts.test.mjs scripts/sync-agent-rules.test.mjs skills-contrib/drive-diagnose-run/test/load.test.ts skills-contrib/drive-diagnose-run/test/metrics.test.ts skills-contrib/drive-diagnose-run/test/invariants.test.ts skills-contrib/drive-diagnose-run/test/cascade-brief.test.ts skills-contrib/drive-diagnose-run/test/report.test.ts skills-contrib/drive-diagnose-run/test/posthoc.test.ts",
41+
"test:scripts": "node --test scripts/lint-workflow-triggers.test.mjs scripts/validate-skills.test.mjs scripts/determine-version-utils.test.ts scripts/check-upgrade-coverage.test.mjs scripts/set-version-utils.test.ts scripts/check-publish-deps-pn-pins.test.mjs scripts/publish-packages-utils.test.mjs scripts/check-clean-tree.test.mjs scripts/lint-casts.test.mjs scripts/sync-agent-rules.test.mjs skills-contrib/drive-diagnose-run/test/load.test.ts skills-contrib/drive-diagnose-run/test/metrics.test.ts skills-contrib/drive-diagnose-run/test/invariants.test.ts skills-contrib/drive-diagnose-run/test/cascade-brief.test.ts skills-contrib/drive-diagnose-run/test/report.test.ts skills-contrib/drive-diagnose-run/test/posthoc.test.ts skills-contrib/drive-record-traces/test/emit.test.ts",
4242
"drive:diagnose": "node skills-contrib/drive-diagnose-run/cli.ts",
43+
"drive:emit": "node skills-contrib/drive-record-traces/emit.ts",
4344
"bump-minor": "node scripts/bump-minor.ts",
4445
"check:publish-deps": "node scripts/check-publish-deps.mjs",
4546
"check:upgrade-coverage": "node scripts/check-upgrade-coverage.mjs",

skills-contrib/drive-diagnose-run/SKILL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A **deterministic, LLM-free tool** that reads an emitted Drive `trace.jsonl` and
1212

1313
## What it is
1414

15-
- `schema.ts`arktype schemas for all 17 trace-event types, transcribed from the `drive-record-traces` skill (the source of truth for the vocabulary).
15+
- arktype schemas — imported directly from the canonical `skills-contrib/drive-record-traces/schema.ts` (the single source of truth for the trace-event vocabulary).
1616
- `load.ts` — JSONL loader: parses + validates each line; collects errors with line numbers instead of throwing.
1717
- `metrics.ts` — diagnostic-metric functions over a `TraceEvent[]` (rework rate, brief reissues, spec amendments, plan amendments, I12 halts, tier mix, wall-clock, etc.). Metric names count instability: lower is better, `0` means the artefact held.
1818
- `assertions/` — one checker per Drive invariant (I1–I12), cascade-redesign rule, and brief-discipline anti-pattern; each returns `pass | fail | not-checkable` with evidence refs.
@@ -56,4 +56,4 @@ A zero-dependency validator is a possible future improvement; for now `arktype`
5656

5757
## Relationship to the trace vocabulary
5858

59-
Event schemas in `schema.ts` are transcribed from the **`drive-record-traces`** skill, which is the single source of truth for the trace-event vocabulary and emission protocol. If a schema changes, update `schema.ts` to match `drive-record-traces`.
59+
`drive-diagnose-run` imports schemas directly from the canonical `skills-contrib/drive-record-traces/schema.ts`, which is the single source of truth for the trace-event vocabulary and emission protocol. Schema changes go in `drive-record-traces`.

skills-contrib/drive-diagnose-run/assertions/brief.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TraceEvent } from '../schema.ts';
1+
import type { TraceEvent } from '../../drive-record-traces/schema.ts';
22
import type { AssertionResult, TraceRef } from './types.ts';
33

44
function eventsOfType<T extends TraceEvent['event_type']>(

skills-contrib/drive-diagnose-run/assertions/cascade.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TraceEvent } from '../schema.ts';
1+
import type { TraceEvent } from '../../drive-record-traces/schema.ts';
22
import type { AssertionResult, TraceRef } from './types.ts';
33

44
function eventsOfType<T extends TraceEvent['event_type']>(

skills-contrib/drive-diagnose-run/assertions/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TraceEvent } from '../schema.ts';
1+
import type { TraceEvent } from '../../drive-record-traces/schema.ts';
22
import { checkBriefDiscipline } from './brief.ts';
33
import { checkCascadeRules } from './cascade.ts';
44
import { checkInvariants } from './invariants.ts';

skills-contrib/drive-diagnose-run/assertions/invariants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TraceEvent } from '../schema.ts';
1+
import type { TraceEvent } from '../../drive-record-traces/schema.ts';
22
import type { AssertionResult, TraceRef } from './types.ts';
33

44
function eventsOfType<T extends TraceEvent['event_type']>(

skills-contrib/drive-diagnose-run/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { writeFileSync } from 'node:fs';
22
import { fileURLToPath } from 'node:url';
3+
import type { TraceEvent } from '../drive-record-traces/schema.ts';
34
import { runAssertions } from './assertions/index.ts';
45
import { loadTrace } from './load.ts';
56
import { computeMetrics } from './metrics.ts';
67
import { parseTranscript } from './posthoc.ts';
78
import { renderReport } from './report.ts';
8-
import type { TraceEvent } from './schema.ts';
99

1010
function getProjectRunIds(events: TraceEvent[]): string[] {
1111
const ids = new Set<string>();

skills-contrib/drive-diagnose-run/load.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readFileSync } from 'node:fs';
22
import { type } from 'arktype';
3-
import type { TraceEvent } from './schema.ts';
4-
import { KNOWN_EVENT_TYPES, Slice1TraceEvent } from './schema.ts';
3+
import type { TraceEvent } from '../drive-record-traces/schema.ts';
4+
import { KNOWN_EVENT_TYPES, Slice1TraceEvent } from '../drive-record-traces/schema.ts';
55

66
export type LoadError = { line: number; raw: string; problem: string };
77

skills-contrib/drive-diagnose-run/metrics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TraceEvent } from './schema.ts';
1+
import type { TraceEvent } from '../drive-record-traces/schema.ts';
22

33
// Narrows the event union to the events of the requested type using a type
44
// predicate, so no bare `as` cast is needed at call sites.

skills-contrib/drive-diagnose-run/test/cascade-brief.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'node:test';
33
import { fileURLToPath } from 'node:url';
4+
import type { TraceEvent } from '../../drive-record-traces/schema.ts';
45
import { checkBriefDiscipline } from '../assertions/brief.ts';
56
import { checkCascadeRules } from '../assertions/cascade.ts';
67
import { runAssertions } from '../assertions/index.ts';
78
import { loadTrace } from '../load.ts';
8-
import type { TraceEvent } from '../schema.ts';
99

1010
const TRACE_PATH = fileURLToPath(new URL('./fixtures/sample-trace.jsonl', import.meta.url));
1111

0 commit comments

Comments
 (0)