@neonwatty/limner 0.1.7 → 0.1.8
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/README.md +7 -31
- package/dist/commands/compare-image-reference.d.ts +1 -0
- package/dist/commands/compare-image-reference.js +4 -0
- package/dist/commands/compare-image-reference.js.map +1 -1
- package/dist/commands/compare-output.js +1 -1
- package/dist/commands/compare-output.js.map +1 -1
- package/dist/commands/compare.d.ts +1 -0
- package/dist/commands/compare.js +4 -12
- package/dist/commands/compare.js.map +1 -1
- package/dist/commands/loop-cli.js +26 -1
- package/dist/commands/loop-cli.js.map +1 -1
- package/dist/commands/loop-comparison-adapters.d.ts +1 -0
- package/dist/commands/loop-comparison-adapters.js +7 -2
- package/dist/commands/loop-comparison-adapters.js.map +1 -1
- package/dist/commands/loop-response.d.ts +31 -0
- package/dist/commands/loop-response.js +84 -0
- package/dist/commands/loop-response.js.map +1 -0
- package/dist/commands/loop-task.js +5 -2
- package/dist/commands/loop-task.js.map +1 -1
- package/dist/commands/loop.d.ts +1 -0
- package/dist/commands/loop.js +3 -0
- package/dist/commands/loop.js.map +1 -1
- package/dist/core/agent-comparison-pack.d.ts +5 -1
- package/dist/core/agent-comparison-pack.js +17 -100
- package/dist/core/agent-comparison-pack.js.map +1 -1
- package/dist/core/agent-comparison-prompts.d.ts +1 -1
- package/dist/core/agent-comparison-prompts.js +4 -4
- package/dist/core/agent-comparison-prompts.js.map +1 -1
- package/dist/core/agent-comparison-report.js +2 -2
- package/dist/core/agent-comparison-report.js.map +1 -1
- package/dist/core/agent-comparison-response.d.ts +0 -18
- package/dist/core/agent-comparison-response.js +1 -33
- package/dist/core/agent-comparison-response.js.map +1 -1
- package/dist/core/agent-comparison-submit.d.ts +35 -0
- package/dist/core/agent-comparison-submit.js +113 -0
- package/dist/core/agent-comparison-submit.js.map +1 -0
- package/dist/core/comparison-artifacts.js +3 -8
- package/dist/core/comparison-artifacts.js.map +1 -1
- package/dist/core/ledger-agent-responses.d.ts +1 -0
- package/dist/core/ledger-agent-responses.js +3 -3
- package/dist/core/ledger-agent-responses.js.map +1 -1
- package/dist/core/ledger-db.js +2 -0
- package/dist/core/ledger-db.js.map +1 -1
- package/dist/core/ledger-markdown.js +1 -1
- package/dist/core/ledger-markdown.js.map +1 -1
- package/dist/core/ledger-queries.js +2 -1
- package/dist/core/ledger-queries.js.map +1 -1
- package/dist/core/report-writer.js +1 -1
- package/docs/agent-workflow.md +11 -13
- package/docs/archive/visual-spec-workflow.md +23 -0
- package/docs/goals/db-native-agent-responses/goal.md +91 -0
- package/docs/goals/db-native-agent-responses/state.yaml +240 -0
- package/package.json +1 -1
- package/skills/limner/SKILL.md +9 -19
- package/templates/target/AGENT_GUIDE.md +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/commands/loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAA+B,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAMlE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"loop.js","sourceRoot":"","sources":["../../src/commands/loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC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qE;IAChI,MAAM,EAAE,GAAG,kBAAkB,CAAC,EAAE,YAAY,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;IACtF,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/C,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC;AACD,SAAS,QAAQ,CAAC,KAAyB;IACzC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AACtF,CAAC;AAED,SAAS,cAAc,CAAC,KAAuB;IAC7C,OAAO,EAAE,GAAG,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,KAAK,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;AAChU,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type AgentComparisonInputFingerprint } from '../schemas/comparison.js';
|
|
2
2
|
import type { AgentComparisonProfileName } from './agent-comparison-profiles.js';
|
|
3
|
-
import {
|
|
3
|
+
import type { AgentResponseFreshness } from './agent-comparison-response.js';
|
|
4
|
+
import type { AgentComparisonContext } from './agent-comparison-submit.js';
|
|
4
5
|
export type AgentComparisonPackResult = {
|
|
6
|
+
captureDir: string;
|
|
5
7
|
promptPath: string;
|
|
6
8
|
codexPromptPath: string;
|
|
7
9
|
claudePromptPath: string;
|
|
@@ -25,6 +27,7 @@ export type AgentComparisonPackResult = {
|
|
|
25
27
|
structureOverall?: number;
|
|
26
28
|
};
|
|
27
29
|
topFix?: string;
|
|
30
|
+
comparisonContext: AgentComparisonContext;
|
|
28
31
|
};
|
|
29
32
|
export declare function writeAgentComparisonPack(input: {
|
|
30
33
|
workspaceRoot: string;
|
|
@@ -40,4 +43,5 @@ export declare function writeAgentComparisonPack(input: {
|
|
|
40
43
|
actualStructurePath: string;
|
|
41
44
|
structureKind: 'visual-spec' | 'dom-metrics' | 'html' | 'json-description';
|
|
42
45
|
};
|
|
46
|
+
responseSubmitCommand?: string;
|
|
43
47
|
}): Promise<AgentComparisonPackResult>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import {
|
|
3
|
+
import { createAgentComparisonBundleExample, createAgentComparisonJsonSchema, } from '../schemas/comparison.js';
|
|
4
4
|
import { clearAgentComparisonOutputs, createInputFingerprint } from './agent-comparison-fingerprint.js';
|
|
5
|
-
import { readAgentResponse, responseExists } from './agent-comparison-response.js';
|
|
6
5
|
import { buildAgentComparisonPrompt, buildClaudeAgentComparisonPrompt, buildCodexAgentComparisonPrompt, } from './agent-comparison-prompts.js';
|
|
7
|
-
import { validateFixTargets } from './agent-comparison-validation.js';
|
|
8
6
|
export async function writeAgentComparisonPack(input) {
|
|
9
7
|
const packDir = path.join(input.captureDir, 'agent-comparison');
|
|
10
8
|
const promptPath = path.join(packDir, 'agent-prompt.md');
|
|
@@ -12,10 +10,17 @@ export async function writeAgentComparisonPack(input) {
|
|
|
12
10
|
const claudePromptPath = path.join(packDir, 'agent-prompt.claude.md');
|
|
13
11
|
const schemaPath = path.join(packDir, 'agent-response.schema.json');
|
|
14
12
|
const examplePath = path.join(packDir, 'agent-response.example.json');
|
|
15
|
-
const responsePath =
|
|
16
|
-
const responseExistedBefore = await responseExists(responsePath);
|
|
13
|
+
const responsePath = 'sqlite://limner/agent_responses';
|
|
17
14
|
const inputFingerprint = await createInputFingerprint(input);
|
|
18
|
-
const promptInput = { ...input, schemaPath,
|
|
15
|
+
const promptInput = { ...input, schemaPath, responseSubmitCommand: input.responseSubmitCommand, inputFingerprint };
|
|
16
|
+
const comparisonContext = {
|
|
17
|
+
workspaceRoot: input.workspaceRoot,
|
|
18
|
+
captureDir: input.captureDir,
|
|
19
|
+
profile: input.profile,
|
|
20
|
+
inputFingerprint,
|
|
21
|
+
imageInputs: input.imageInputs,
|
|
22
|
+
structureInputs: input.structureInputs,
|
|
23
|
+
};
|
|
19
24
|
await mkdir(packDir, { recursive: true });
|
|
20
25
|
await clearAgentComparisonOutputs(input.captureDir);
|
|
21
26
|
await Promise.all([
|
|
@@ -25,58 +30,20 @@ export async function writeAgentComparisonPack(input) {
|
|
|
25
30
|
writeFile(codexPromptPath, buildCodexAgentComparisonPrompt(promptInput)),
|
|
26
31
|
writeFile(claudePromptPath, buildClaudeAgentComparisonPrompt(promptInput)),
|
|
27
32
|
]);
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
return {
|
|
34
|
+
captureDir: input.captureDir,
|
|
30
35
|
promptPath,
|
|
31
36
|
codexPromptPath,
|
|
32
37
|
claudePromptPath,
|
|
33
38
|
schemaPath,
|
|
34
39
|
examplePath,
|
|
35
40
|
responsePath,
|
|
41
|
+
status: 'awaiting-agent',
|
|
36
42
|
profile: input.profile,
|
|
37
43
|
inputFingerprint,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
if (response.status === 'missing') {
|
|
43
|
-
return { ...base, status: 'awaiting-agent', freshness: 'missing' };
|
|
44
|
-
}
|
|
45
|
-
if (response.status === 'invalid-json') {
|
|
46
|
-
return { ...base, status: 'invalid', freshness: 'invalid', validationErrors: ['agent-response.json: Invalid JSON.'] };
|
|
47
|
-
}
|
|
48
|
-
const parsed = agentComparisonBundleSchema.safeParse(response.value);
|
|
49
|
-
if (!parsed.success) {
|
|
50
|
-
return { ...base, status: 'invalid', freshness: 'invalid', validationErrors: parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`) };
|
|
51
|
-
}
|
|
52
|
-
const activeErrors = validateActiveComparison({ ...input, inputFingerprint }, parsed.data);
|
|
53
|
-
if (activeErrors.length > 0) {
|
|
54
|
-
return { ...base, status: 'invalid', freshness: 'stale', validationErrors: activeErrors };
|
|
55
|
-
}
|
|
56
|
-
const imageComparisonPath = path.join(input.captureDir, 'image-comparison.json');
|
|
57
|
-
const structureComparisonPath = parsed.data.structureComparison ? path.join(input.captureDir, 'structure-comparison.json') : undefined;
|
|
58
|
-
const summaryPath = path.join(input.captureDir, 'comparison-summary.json');
|
|
59
|
-
await writeJson(imageComparisonPath, parsed.data.imageComparison);
|
|
60
|
-
if (parsed.data.structureComparison && structureComparisonPath) {
|
|
61
|
-
await writeJson(structureComparisonPath, parsed.data.structureComparison);
|
|
62
|
-
}
|
|
63
|
-
await writeJson(summaryPath, parsed.data);
|
|
64
|
-
return {
|
|
65
|
-
...base,
|
|
66
|
-
status: 'validated',
|
|
67
|
-
freshness: response.existedBefore ? 'cached' : 'fresh',
|
|
68
|
-
imageComparisonPath,
|
|
69
|
-
structureComparisonPath,
|
|
70
|
-
summaryPath,
|
|
71
|
-
score: {
|
|
72
|
-
imageOverall: parsed.data.imageComparison.score.overall,
|
|
73
|
-
structureOverall: parsed.data.structureComparison?.score.overall,
|
|
74
|
-
},
|
|
75
|
-
topFix: parsed.data.recommendation.topFix,
|
|
76
|
-
scoreHighlights: [
|
|
77
|
-
`Agent image score: ${parsed.data.imageComparison.score.overall}`,
|
|
78
|
-
...(parsed.data.structureComparison ? [`Agent structure score: ${parsed.data.structureComparison.score.overall}`] : []),
|
|
79
|
-
],
|
|
44
|
+
freshness: 'missing',
|
|
45
|
+
responseExistedBefore: false,
|
|
46
|
+
comparisonContext,
|
|
80
47
|
};
|
|
81
48
|
}
|
|
82
49
|
function createExample(input, inputFingerprint) {
|
|
@@ -95,56 +62,6 @@ function createExample(input, inputFingerprint) {
|
|
|
95
62
|
}
|
|
96
63
|
return example;
|
|
97
64
|
}
|
|
98
|
-
function validateActiveComparison(input, bundle) {
|
|
99
|
-
const errors = [];
|
|
100
|
-
if (bundle.profile !== input.profile)
|
|
101
|
-
errors.push(`profile: Expected ${input.profile}.`);
|
|
102
|
-
const expectedSurface = input.profile === 'ideal-to-mockup' ? 'mockup' : 'implementation';
|
|
103
|
-
if (!matchesPath(input.workspaceRoot, input.imageInputs.expectedImagePath, bundle.imageComparison.inputs.expectedImagePath)) {
|
|
104
|
-
errors.push('imageComparison.inputs.expectedImagePath: Does not match the active expected image.');
|
|
105
|
-
}
|
|
106
|
-
if (!matchesPath(input.workspaceRoot, input.imageInputs.actualImagePath, bundle.imageComparison.inputs.actualImagePath)) {
|
|
107
|
-
errors.push('imageComparison.inputs.actualImagePath: Does not match the active actual image.');
|
|
108
|
-
}
|
|
109
|
-
if (bundle.inputFingerprint.expectedImageSha256 !== input.inputFingerprint.expectedImageSha256) {
|
|
110
|
-
errors.push('inputFingerprint.expectedImageSha256: Does not match the active expected image.');
|
|
111
|
-
}
|
|
112
|
-
if (bundle.inputFingerprint.actualImageSha256 !== input.inputFingerprint.actualImageSha256) {
|
|
113
|
-
errors.push('inputFingerprint.actualImageSha256: Does not match the active actual image.');
|
|
114
|
-
}
|
|
115
|
-
validateFixTargets(errors, 'imageComparison', bundle.imageComparison.majorDiffAreas, expectedSurface);
|
|
116
|
-
if (!input.structureInputs && bundle.structureComparison) {
|
|
117
|
-
errors.push('structureComparison: Not expected for this comparison.');
|
|
118
|
-
}
|
|
119
|
-
if (!input.structureInputs && (bundle.inputFingerprint.expectedStructureSha256 || bundle.inputFingerprint.actualStructureSha256)) {
|
|
120
|
-
errors.push('inputFingerprint: Structure hashes are not expected for this comparison.');
|
|
121
|
-
}
|
|
122
|
-
if (input.structureInputs && !bundle.structureComparison) {
|
|
123
|
-
errors.push('structureComparison: Required for this comparison.');
|
|
124
|
-
}
|
|
125
|
-
if (input.structureInputs && bundle.structureComparison) {
|
|
126
|
-
validateFixTargets(errors, 'structureComparison', bundle.structureComparison.majorDiffAreas, expectedSurface);
|
|
127
|
-
if (bundle.inputFingerprint.expectedStructureSha256 !== input.inputFingerprint.expectedStructureSha256) {
|
|
128
|
-
errors.push('inputFingerprint.expectedStructureSha256: Does not match the active expected structure.');
|
|
129
|
-
}
|
|
130
|
-
if (bundle.inputFingerprint.actualStructureSha256 !== input.inputFingerprint.actualStructureSha256) {
|
|
131
|
-
errors.push('inputFingerprint.actualStructureSha256: Does not match the active actual structure.');
|
|
132
|
-
}
|
|
133
|
-
if (!matchesPath(input.workspaceRoot, input.structureInputs.expectedStructurePath, bundle.structureComparison.inputs.expectedStructurePath)) {
|
|
134
|
-
errors.push('structureComparison.inputs.expectedStructurePath: Does not match the active expected structure.');
|
|
135
|
-
}
|
|
136
|
-
if (!matchesPath(input.workspaceRoot, input.structureInputs.actualStructurePath, bundle.structureComparison.inputs.actualStructurePath)) {
|
|
137
|
-
errors.push('structureComparison.inputs.actualStructurePath: Does not match the active actual structure.');
|
|
138
|
-
}
|
|
139
|
-
if (bundle.structureComparison.inputs.structureKind !== input.structureInputs.structureKind) {
|
|
140
|
-
errors.push(`structureComparison.inputs.structureKind: Expected ${input.structureInputs.structureKind}.`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return errors;
|
|
144
|
-
}
|
|
145
|
-
function matchesPath(root, expectedAbsolute, actual) {
|
|
146
|
-
return actual === expectedAbsolute || actual === relative(root, expectedAbsolute);
|
|
147
|
-
}
|
|
148
65
|
function relative(root, filePath) {
|
|
149
66
|
return path.relative(root, filePath);
|
|
150
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-comparison-pack.js","sourceRoot":"","sources":["../../src/core/agent-comparison-pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"agent-comparison-pack.js","sourceRoot":"","sources":["../../src/core/agent-comparison-pack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,kCAAkC,EAClC,+BAA+B,GAGhC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAGxG,OAAO,EACL,0BAA0B,EAC1B,gCAAgC,EAChC,+BAA+B,GAChC,MAAM,+BAA+B,CAAC;AA4BvC,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,KAY9C;IACC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,kBAAkB,CAAC,CAAC;IAChE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;IACpE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,wBAAwB,CAAC,CAAC;IACtE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAAC;IACpE,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,6BAA6B,CAAC,CAAC;IACtE,MAAM,YA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AC,CAAC,GAAG,IAAI,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -3,8 +3,8 @@ import { type AgentComparisonProfileName } from './agent-comparison-profiles.js'
|
|
|
3
3
|
type PromptInput = {
|
|
4
4
|
workspaceRoot: string;
|
|
5
5
|
profile: AgentComparisonProfileName;
|
|
6
|
-
responsePath: string;
|
|
7
6
|
schemaPath: string;
|
|
7
|
+
responseSubmitCommand?: string;
|
|
8
8
|
inputFingerprint: AgentComparisonInputFingerprint;
|
|
9
9
|
imageInputs: {
|
|
10
10
|
expectedImagePath: string;
|
|
@@ -32,9 +32,9 @@ Use this JSON schema:
|
|
|
32
32
|
|
|
33
33
|
- \`${rel(input, input.schemaPath)}\`
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Submit valid JSON through Limner's local SQLite ledger:
|
|
36
36
|
|
|
37
|
-
- \`${
|
|
37
|
+
- \`${input.responseSubmitCommand ?? 'limner loop response submit --trajectory <trajectory-id> --from-run <run-id> --file <response.json>'}\`
|
|
38
38
|
|
|
39
39
|
Rules:
|
|
40
40
|
|
|
@@ -48,14 +48,14 @@ export function buildCodexAgentComparisonPrompt(input) {
|
|
|
48
48
|
return `${buildAgentComparisonPrompt(input)}
|
|
49
49
|
## Codex Instructions
|
|
50
50
|
|
|
51
|
-
Read the local files directly.
|
|
51
|
+
Read the local files directly. Produce JSON matching the schema, then submit it with the Limner command above.
|
|
52
52
|
`;
|
|
53
53
|
}
|
|
54
54
|
export function buildClaudeAgentComparisonPrompt(input) {
|
|
55
55
|
return `${buildAgentComparisonPrompt(input)}
|
|
56
56
|
## Claude Instructions
|
|
57
57
|
|
|
58
|
-
Attach the referenced images, inspect them separately, and return JSON matching the schema.
|
|
58
|
+
Attach the referenced images, inspect them separately, and return JSON matching the schema. Submit that JSON with the Limner command above.
|
|
59
59
|
`;
|
|
60
60
|
}
|
|
61
61
|
function formatStructureFingerprint(fingerprint) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-comparison-prompts.js","sourceRoot":"","sources":["../../src/core/agent-comparison-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,yBAAyB,EAAmC,MAAM,gCAAgC,CAAC;AAmB5G,MAAM,UAAU,0BAA0B,CAAC,KAAkB;IAC3D,MAAM,OAAO,GAAG,yBAAyB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzD,OAAO;;aAEI,OAAO,CAAC,IAAI;iBACR,OAAO,CAAC,YAAY;eACtB,OAAO,CAAC,UAAU;oBACb,OAAO,CAAC,eAAe;;EAEzC,OAAO,CAAC,WAAW;;;;sBAIC,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,iBAAiB,CAAC;oBACjD,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,eAAe,CAAC;;;;;;+BAMlC,KAAK,CAAC,gBAAgB,CAAC,mBAAmB;6BAC5C,KAAK,CAAC,gBAAgB,CAAC,iBAAiB;EACnE,0BAA0B,CAAC,KAAK,CAAC,gBAAgB,CAAC;;;;;EAKlD,sBAAsB,CAAC,KAAK,CAAC;;;MAGzB,GAAG,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC;;;;MAI5B,
|
|
1
|
+
{"version":3,"file":"agent-comparison-prompts.js","sourceRoot":"","sources":["../../src/core/agent-comparison-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,EAAE,yBAAyB,EAAmC,MAAM,gCAAgC,CAAC;AAmB5G,MAAM,UAAU,0BAA0B,CAAC,KAAkB;IAC3D,MAAM,OAAO,GAAG,yBAAyB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACzD,OAAO;;aAEI,OAAO,CAAC,IAAI;iBACR,OAAO,CAAC,YAAY;eACtB,OAAO,CAAC,UAAU;oBACb,OAAO,CAAC,eAAe;;EAEzC,OAAO,CAAC,WAAW;;;;sB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ED,SAAS,GAAG,CAAC,KAAkB,EAAE,QAAgB;IAC/C,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -8,7 +8,7 @@ export function formatAgentComparisonArtifacts(root, agentComparison) {
|
|
|
8
8
|
`- Codex comparison prompt: \`${relative(root, agentComparison.codexPromptPath)}\``,
|
|
9
9
|
`- Claude comparison prompt: \`${relative(root, agentComparison.claudePromptPath)}\``,
|
|
10
10
|
`- Agent comparison schema: \`${relative(root, agentComparison.schemaPath)}\``,
|
|
11
|
-
|
|
11
|
+
'- Agent comparison response store: local SQLite ledger',
|
|
12
12
|
];
|
|
13
13
|
if (agentComparison.imageComparisonPath) {
|
|
14
14
|
lines.push(`- Image comparison: \`${relative(root, agentComparison.imageComparisonPath)}\``);
|
|
@@ -31,7 +31,7 @@ export function formatAgentComparisonStatus(agentComparison) {
|
|
|
31
31
|
## Agent Comparison
|
|
32
32
|
|
|
33
33
|
- Status: awaiting agent response.
|
|
34
|
-
- Next step: have an agent inspect the comparison prompt,
|
|
34
|
+
- Next step: have an agent inspect the comparison prompt, then submit JSON with \`limner loop response submit\`.`;
|
|
35
35
|
}
|
|
36
36
|
if (agentComparison.status === 'invalid') {
|
|
37
37
|
const errors = agentComparison.validationErrors?.map((error) => `- ${error}`).join('\n') ?? '- Unknown validation error.';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-comparison-report.js","sourceRoot":"","sources":["../../src/core/agent-comparison-report.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAI7B,MAAM,UAAU,8BAA8B,CAAC,IAAY,EAAE,eAA2C;IACtG,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GAAG;QACZ,gCAAgC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC,UAAU,CAAC,IAAI;Q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EAAE,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,eAA2C;IACrF,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,IAAI,eAAe,CAAC,MAAM,KAAK,gBAAgB,EAAE,CAAC;QAChD,OAAO;;;;;iHAKsG,CAAC;IAChH,CAAC;IACD,IAAI,eAAe,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACzC,MAAM,MAAM,GAAG,eAAe,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,6BAA6B,CAAC;QAC1H,OAAO;;;;;;EAMT,MAAM,EAAE,CAAC;IACT,CAAC;IACD,OAAO;;;;;EAKP,eAAe,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,yCAAyC,EAAE,CAAC;AAClI,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,QAAgB;IAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
import type { AgentComparisonBundle } from '../schemas/comparison.js';
|
|
2
1
|
export type AgentResponseFreshness = 'missing' | 'fresh' | 'cached' | 'stale' | 'invalid';
|
|
3
|
-
export type AgentResponseRead = {
|
|
4
|
-
status: 'missing';
|
|
5
|
-
existedBefore: boolean;
|
|
6
|
-
} | {
|
|
7
|
-
status: 'invalid-json';
|
|
8
|
-
existedBefore: boolean;
|
|
9
|
-
responseJson: string;
|
|
10
|
-
responseHash: string;
|
|
11
|
-
} | {
|
|
12
|
-
status: 'ok';
|
|
13
|
-
existedBefore: boolean;
|
|
14
|
-
responseJson: string;
|
|
15
|
-
responseHash: string;
|
|
16
|
-
value: AgentComparisonBundle;
|
|
17
|
-
};
|
|
18
|
-
export declare function responseExists(filePath: string): Promise<boolean>;
|
|
19
|
-
export declare function readAgentResponse(filePath: string, existedBefore: boolean): Promise<AgentResponseRead>;
|
|
@@ -1,34 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
3
|
-
export async function responseExists(filePath) {
|
|
4
|
-
try {
|
|
5
|
-
await readFile(filePath);
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
catch {
|
|
9
|
-
return false;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export async function readAgentResponse(filePath, existedBefore) {
|
|
13
|
-
let responseJson;
|
|
14
|
-
try {
|
|
15
|
-
responseJson = await readFile(filePath, 'utf8');
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return { status: 'missing', existedBefore };
|
|
19
|
-
}
|
|
20
|
-
const responseHash = createHash('sha256').update(responseJson).digest('hex');
|
|
21
|
-
try {
|
|
22
|
-
return {
|
|
23
|
-
status: 'ok',
|
|
24
|
-
existedBefore,
|
|
25
|
-
responseJson,
|
|
26
|
-
responseHash,
|
|
27
|
-
value: JSON.parse(responseJson),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return { status: 'invalid-json', existedBefore, responseJson, responseHash };
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
export {};
|
|
34
2
|
//# sourceMappingURL=agent-comparison-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-comparison-response.js","sourceRoot":"","sources":["../../src/core/agent-comparison-response.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-comparison-response.js","sourceRoot":"","sources":["../../src/core/agent-comparison-response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type AgentComparisonInputFingerprint } from '../schemas/comparison.js';
|
|
2
|
+
import type { AgentComparisonProfileName } from './agent-comparison-profiles.js';
|
|
3
|
+
import type { AgentResponseFreshness } from './agent-comparison-response.js';
|
|
4
|
+
export type AgentComparisonContext = {
|
|
5
|
+
workspaceRoot: string;
|
|
6
|
+
captureDir: string;
|
|
7
|
+
profile: AgentComparisonProfileName;
|
|
8
|
+
inputFingerprint: AgentComparisonInputFingerprint;
|
|
9
|
+
imageInputs: {
|
|
10
|
+
expectedImagePath: string;
|
|
11
|
+
actualImagePath: string;
|
|
12
|
+
};
|
|
13
|
+
structureInputs?: {
|
|
14
|
+
expectedStructurePath: string;
|
|
15
|
+
actualStructurePath: string;
|
|
16
|
+
structureKind: 'visual-spec' | 'dom-metrics' | 'html' | 'json-description';
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export type AgentComparisonSubmitResult = {
|
|
20
|
+
status: 'validated' | 'invalid';
|
|
21
|
+
freshness: AgentResponseFreshness;
|
|
22
|
+
responseJson: string;
|
|
23
|
+
responseHash: string;
|
|
24
|
+
validationErrors?: string[];
|
|
25
|
+
imageComparisonPath?: string;
|
|
26
|
+
structureComparisonPath?: string;
|
|
27
|
+
summaryPath?: string;
|
|
28
|
+
score?: {
|
|
29
|
+
imageOverall: number;
|
|
30
|
+
structureOverall?: number;
|
|
31
|
+
};
|
|
32
|
+
topFix?: string;
|
|
33
|
+
scoreHighlights?: string[];
|
|
34
|
+
};
|
|
35
|
+
export declare function submitAgentComparisonResponse(context: AgentComparisonContext, responseJson: string): Promise<AgentComparisonSubmitResult>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { writeFile } from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { agentComparisonBundleSchema, } from '../schemas/comparison.js';
|
|
5
|
+
import { validateFixTargets } from './agent-comparison-validation.js';
|
|
6
|
+
export async function submitAgentComparisonResponse(context, responseJson) {
|
|
7
|
+
const responseHash = createHash('sha256').update(responseJson).digest('hex');
|
|
8
|
+
let parsedJson;
|
|
9
|
+
try {
|
|
10
|
+
parsedJson = JSON.parse(responseJson);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return { status: 'invalid', freshness: 'invalid', responseJson, responseHash, validationErrors: ['Agent response: Invalid JSON.'] };
|
|
14
|
+
}
|
|
15
|
+
const parsed = agentComparisonBundleSchema.safeParse(parsedJson);
|
|
16
|
+
if (!parsed.success) {
|
|
17
|
+
return {
|
|
18
|
+
status: 'invalid',
|
|
19
|
+
freshness: 'invalid',
|
|
20
|
+
responseJson,
|
|
21
|
+
responseHash,
|
|
22
|
+
validationErrors: parsed.error.issues.map((issue) => `${issue.path.join('.')}: ${issue.message}`),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const activeErrors = validateActiveComparison(context, parsed.data);
|
|
26
|
+
if (activeErrors.length > 0) {
|
|
27
|
+
return { status: 'invalid', freshness: 'stale', responseJson, responseHash, validationErrors: activeErrors };
|
|
28
|
+
}
|
|
29
|
+
return writeValidatedOutputs(context, parsed.data, responseJson, responseHash);
|
|
30
|
+
}
|
|
31
|
+
async function writeValidatedOutputs(context, bundle, responseJson, responseHash) {
|
|
32
|
+
const imageComparisonPath = path.join(context.captureDir, 'image-comparison.json');
|
|
33
|
+
const structureComparisonPath = bundle.structureComparison ? path.join(context.captureDir, 'structure-comparison.json') : undefined;
|
|
34
|
+
const summaryPath = path.join(context.captureDir, 'comparison-summary.json');
|
|
35
|
+
await writeJson(imageComparisonPath, bundle.imageComparison);
|
|
36
|
+
if (bundle.structureComparison && structureComparisonPath) {
|
|
37
|
+
await writeJson(structureComparisonPath, bundle.structureComparison);
|
|
38
|
+
}
|
|
39
|
+
await writeJson(summaryPath, bundle);
|
|
40
|
+
return {
|
|
41
|
+
status: 'validated',
|
|
42
|
+
freshness: 'fresh',
|
|
43
|
+
responseJson,
|
|
44
|
+
responseHash,
|
|
45
|
+
imageComparisonPath,
|
|
46
|
+
structureComparisonPath,
|
|
47
|
+
summaryPath,
|
|
48
|
+
score: {
|
|
49
|
+
imageOverall: bundle.imageComparison.score.overall,
|
|
50
|
+
structureOverall: bundle.structureComparison?.score.overall,
|
|
51
|
+
},
|
|
52
|
+
topFix: bundle.recommendation.topFix,
|
|
53
|
+
scoreHighlights: [
|
|
54
|
+
`Agent image score: ${bundle.imageComparison.score.overall}`,
|
|
55
|
+
...(bundle.structureComparison ? [`Agent structure score: ${bundle.structureComparison.score.overall}`] : []),
|
|
56
|
+
],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function validateActiveComparison(context, bundle) {
|
|
60
|
+
const errors = [];
|
|
61
|
+
if (bundle.profile !== context.profile)
|
|
62
|
+
errors.push(`profile: Expected ${context.profile}.`);
|
|
63
|
+
const expectedSurface = context.profile === 'ideal-to-mockup' ? 'mockup' : 'implementation';
|
|
64
|
+
if (!matchesPath(context.workspaceRoot, context.imageInputs.expectedImagePath, bundle.imageComparison.inputs.expectedImagePath)) {
|
|
65
|
+
errors.push('imageComparison.inputs.expectedImagePath: Does not match the active expected image.');
|
|
66
|
+
}
|
|
67
|
+
if (!matchesPath(context.workspaceRoot, context.imageInputs.actualImagePath, bundle.imageComparison.inputs.actualImagePath)) {
|
|
68
|
+
errors.push('imageComparison.inputs.actualImagePath: Does not match the active actual image.');
|
|
69
|
+
}
|
|
70
|
+
if (bundle.inputFingerprint.expectedImageSha256 !== context.inputFingerprint.expectedImageSha256) {
|
|
71
|
+
errors.push('inputFingerprint.expectedImageSha256: Does not match the active expected image.');
|
|
72
|
+
}
|
|
73
|
+
if (bundle.inputFingerprint.actualImageSha256 !== context.inputFingerprint.actualImageSha256) {
|
|
74
|
+
errors.push('inputFingerprint.actualImageSha256: Does not match the active actual image.');
|
|
75
|
+
}
|
|
76
|
+
validateFixTargets(errors, 'imageComparison', bundle.imageComparison.majorDiffAreas, expectedSurface);
|
|
77
|
+
validateStructure(context, bundle, errors, expectedSurface);
|
|
78
|
+
return errors;
|
|
79
|
+
}
|
|
80
|
+
function validateStructure(context, bundle, errors, expectedSurface) {
|
|
81
|
+
if (!context.structureInputs && bundle.structureComparison)
|
|
82
|
+
errors.push('structureComparison: Not expected for this comparison.');
|
|
83
|
+
if (!context.structureInputs && (bundle.inputFingerprint.expectedStructureSha256 || bundle.inputFingerprint.actualStructureSha256)) {
|
|
84
|
+
errors.push('inputFingerprint: Structure hashes are not expected for this comparison.');
|
|
85
|
+
}
|
|
86
|
+
if (context.structureInputs && !bundle.structureComparison)
|
|
87
|
+
errors.push('structureComparison: Required for this comparison.');
|
|
88
|
+
if (!context.structureInputs || !bundle.structureComparison)
|
|
89
|
+
return;
|
|
90
|
+
validateFixTargets(errors, 'structureComparison', bundle.structureComparison.majorDiffAreas, expectedSurface);
|
|
91
|
+
if (bundle.inputFingerprint.expectedStructureSha256 !== context.inputFingerprint.expectedStructureSha256) {
|
|
92
|
+
errors.push('inputFingerprint.expectedStructureSha256: Does not match the active expected structure.');
|
|
93
|
+
}
|
|
94
|
+
if (bundle.inputFingerprint.actualStructureSha256 !== context.inputFingerprint.actualStructureSha256) {
|
|
95
|
+
errors.push('inputFingerprint.actualStructureSha256: Does not match the active actual structure.');
|
|
96
|
+
}
|
|
97
|
+
if (!matchesPath(context.workspaceRoot, context.structureInputs.expectedStructurePath, bundle.structureComparison.inputs.expectedStructurePath)) {
|
|
98
|
+
errors.push('structureComparison.inputs.expectedStructurePath: Does not match the active expected structure.');
|
|
99
|
+
}
|
|
100
|
+
if (!matchesPath(context.workspaceRoot, context.structureInputs.actualStructurePath, bundle.structureComparison.inputs.actualStructurePath)) {
|
|
101
|
+
errors.push('structureComparison.inputs.actualStructurePath: Does not match the active actual structure.');
|
|
102
|
+
}
|
|
103
|
+
if (bundle.structureComparison.inputs.structureKind !== context.structureInputs.structureKind) {
|
|
104
|
+
errors.push(`structureComparison.inputs.structureKind: Expected ${context.structureInputs.structureKind}.`);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function matchesPath(root, expectedAbsolute, actual) {
|
|
108
|
+
return actual === expectedAbsolute || actual === path.relative(root, expectedAbsolute);
|
|
109
|
+
}
|
|
110
|
+
async function writeJson(filePath, value) {
|
|
111
|
+
await writeFile(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=agent-comparison-submit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-comparison-submit.js","sourceRoot":"","sources":["../../src/core/agent-comparison-submit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,2BAA2B,GAG5B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AA6BtE,MAAM,CAAC,KAAK,UAAU,6BAA6B,CACjD,OAA+B,EAC/B,YAAoB;IAEpB,MAAM,YAAY,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7E,IAAI,UAAmB,CAAC;IACxB,IAAI,CAAC;QACH,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC,+BAA+B,CAAC,EAAE,CAAC;IACtI,CAAC;IACD,MAAM,MAAM,GAAG,2BAA2B,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC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AG,CAAC,CAAC;IAC9G,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,gBAAwB,EAAE,MAAc;IACzE,OAAO,MAAM,KAAK,gBAAgB,IAAI,MAAM,KAAK,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;AACzF,CAAC;AAED,KAAK,UAAU,SAAS,CAAC,QAAgB,EAAE,KAAc;IACvD,MAAM,SAAS,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -2,9 +2,6 @@ import path from 'node:path';
|
|
|
2
2
|
export function artifact(path, kind) {
|
|
3
3
|
return path ? [{ path, kind, role: 'artifact' }] : [];
|
|
4
4
|
}
|
|
5
|
-
function expectedOutput(path, kind, exists = false) {
|
|
6
|
-
return path ? [{ path, kind, role: 'expected-output', exists }] : [];
|
|
7
|
-
}
|
|
8
5
|
export function agentComparisonArtifacts(agentComparison) {
|
|
9
6
|
if (!agentComparison)
|
|
10
7
|
return [];
|
|
@@ -14,7 +11,6 @@ export function agentComparisonArtifacts(agentComparison) {
|
|
|
14
11
|
...artifact(agentComparison.claudePromptPath, 'agent-comparison-prompt-claude'),
|
|
15
12
|
...artifact(agentComparison.schemaPath, 'agent-comparison-schema'),
|
|
16
13
|
...artifact(agentComparison.examplePath, 'agent-comparison-example'),
|
|
17
|
-
...expectedOutput(agentComparison.responsePath, 'agent-response-target', agentComparison.status !== 'awaiting-agent'),
|
|
18
14
|
...agentComparisonOutputArtifacts(agentComparison),
|
|
19
15
|
];
|
|
20
16
|
}
|
|
@@ -26,11 +22,10 @@ function agentComparisonOutputArtifacts(agentComparison) {
|
|
|
26
22
|
...artifact(agentComparison.summaryPath, 'comparison-summary'),
|
|
27
23
|
];
|
|
28
24
|
}
|
|
29
|
-
const captureDir = path.dirname(path.dirname(agentComparison.responsePath));
|
|
30
25
|
return [
|
|
31
|
-
{ path: path.join(captureDir, 'image-comparison.json'), kind: 'image-comparison', role: 'artifact', exists: false },
|
|
32
|
-
{ path: path.join(captureDir, 'structure-comparison.json'), kind: 'structure-comparison', role: 'artifact', exists: false },
|
|
33
|
-
{ path: path.join(captureDir, 'comparison-summary.json'), kind: 'comparison-summary', role: 'artifact', exists: false },
|
|
26
|
+
{ path: path.join(agentComparison.captureDir, 'image-comparison.json'), kind: 'image-comparison', role: 'artifact', exists: false },
|
|
27
|
+
{ path: path.join(agentComparison.captureDir, 'structure-comparison.json'), kind: 'structure-comparison', role: 'artifact', exists: false },
|
|
28
|
+
{ path: path.join(agentComparison.captureDir, 'comparison-summary.json'), kind: 'comparison-summary', role: 'artifact', exists: false },
|
|
34
29
|
];
|
|
35
30
|
}
|
|
36
31
|
export function referenceImplementationArtifacts(input) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comparison-artifacts.js","sourceRoot":"","sources":["../../src/core/comparison-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAK7B,MAAM,UAAU,QAAQ,CAAC,IAAwB,EAAE,IAAY;IAC7D,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxD,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"comparison-artifacts.js","sourceRoot":"","sources":["../../src/core/comparison-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAK7B,MAAM,UAAU,QAAQ,CAAC,IAAwB,EAAE,IAAY;IAC7D,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,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,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE;KACxI,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,KAOhD;IACC,OAAO;QACL,GAAG,QAAQ,CAAC,KAAK,CAAC,aAAa,EAAE,sBAAsB,CAAC;QACxD,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,aAAa,eAAe,EAAE,uBAAuB,CAAC;QAC3E,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,aAAa,eAAe,EAAE,uBAAuB,CAAC;QAC3E,GAAG,QAAQ,CAAC,KAAK,CAAC,kBAAkB,EAAE,2BAA2B,CAAC;QAClE,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,kBAAkB,eAAe,EAAE,4BAA4B,CAAC;QACrF,GAAG,QAAQ,CAAC,GAAG,KAAK,CAAC,kBAAkB,eAAe,EAAE,4BAA4B,CAAC;QACrF,GAAG,QAAQ,CAAC,KAAK,CAAC,cAAc,EAAE,cAAc,CAAC;QACjD,GAAG,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC;QAC7C,GAAG,QAAQ,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC;QACvC,GAAG,wBAAwB,CAAC,KAAK,CAAC,eAAe,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -5,9 +5,9 @@ export function insertAgentResponse(db, input, now) {
|
|
|
5
5
|
insert into agent_responses (
|
|
6
6
|
response_id, trajectory_id, iteration_id, run_id, mode, profile, response_path,
|
|
7
7
|
response_hash, freshness, validation_status, input_fingerprint_json,
|
|
8
|
-
response_json, score_json, top_fix, created_at
|
|
9
|
-
) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
10
|
-
`).run(responseId, input.trajectoryId, input.iterationId ?? null, input.runId ?? null, input.mode, input.profile ?? null, input.responsePath, input.responseHash ?? null, input.freshness, input.validationStatus, input.inputFingerprint === undefined ? null : JSON.stringify(input.inputFingerprint), input.responseJson ?? null, input.score === undefined ? null : JSON.stringify(input.score), input.topFix ?? null, now);
|
|
8
|
+
comparison_context_json, response_json, score_json, top_fix, created_at
|
|
9
|
+
) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
10
|
+
`).run(responseId, input.trajectoryId, input.iterationId ?? null, input.runId ?? null, input.mode, input.profile ?? null, input.responsePath, input.responseHash ?? null, input.freshness, input.validationStatus, input.inputFingerprint === undefined ? null : JSON.stringify(input.inputFingerprint), input.comparisonContext === undefined ? null : JSON.stringify(input.comparisonContext), input.responseJson ?? null, input.score === undefined ? null : JSON.stringify(input.score), input.topFix ?? null, now);
|
|
11
11
|
return { responseId };
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=ledger-agent-responses.js.map
|