@moda-ai/cli 1.29.0 → 1.29.1
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/dist/{cli-351a5yc4.js → cli-5e0rd8mf.js} +47 -2
- package/dist/{cli-3w6hbpr3.js → cli-b2ktsnmh.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{harness-github-actions-p8xa3akx.js → harness-github-actions-dmy8fz54.js} +1 -1
- package/dist/{index-8ksqhqmr.js → index-6twsawta.js} +2 -2
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
|
@@ -1179,7 +1179,7 @@ function firstEvidencePath(item) {
|
|
|
1179
1179
|
function stampRemoteSnapshotTruncation(report) {
|
|
1180
1180
|
const scanRecord = isRecord(report.graph.scan) ? report.graph.scan : {};
|
|
1181
1181
|
const truncationReasons = Array.isArray(scanRecord.truncationReasons) ? scanRecord.truncationReasons.map(String) : [];
|
|
1182
|
-
|
|
1182
|
+
const stamped = {
|
|
1183
1183
|
...report,
|
|
1184
1184
|
graph: {
|
|
1185
1185
|
...report.graph,
|
|
@@ -1193,6 +1193,10 @@ function stampRemoteSnapshotTruncation(report) {
|
|
|
1193
1193
|
}
|
|
1194
1194
|
}
|
|
1195
1195
|
};
|
|
1196
|
+
if (stamped.source?.graphHash) {
|
|
1197
|
+
stamped.source = { ...stamped.source, graphHash: hashStableJson(graphForReport(stamped.graph)) };
|
|
1198
|
+
}
|
|
1199
|
+
return stamped;
|
|
1196
1200
|
}
|
|
1197
1201
|
function requiresGraphItemConfidence(collection) {
|
|
1198
1202
|
return collection !== "relationships" && collection !== "unknowns";
|
|
@@ -3533,7 +3537,7 @@ async function runHarnessCommand(context) {
|
|
|
3533
3537
|
elapsed_ms: Date.now() - context.startedAt
|
|
3534
3538
|
});
|
|
3535
3539
|
if (context.flags["github-actions"] === "true") {
|
|
3536
|
-
const { runGithubActionsAnalyze } = await import("./harness-github-actions-
|
|
3540
|
+
const { runGithubActionsAnalyze } = await import("./harness-github-actions-dmy8fz54.js");
|
|
3537
3541
|
const result = await runGithubActionsAnalyze(rootDir, {
|
|
3538
3542
|
writeReport: (report2) => {
|
|
3539
3543
|
const normalized = normalizeHarnessReport(report2);
|
|
@@ -4064,9 +4068,49 @@ function repairExternalAnalystReport(report, rootDir) {
|
|
|
4064
4068
|
repairCitationLines(normalized, rootDir);
|
|
4065
4069
|
mergeDeterministicArtifacts(normalized.graph, rootDir);
|
|
4066
4070
|
hydratePromptAndToolBodies(normalized.graph, rootDir);
|
|
4071
|
+
deriveRelationshipsFromGraph(normalized.graph);
|
|
4067
4072
|
repairReportSummaryCounts(normalized);
|
|
4073
|
+
if (normalized.source?.graphHash) {
|
|
4074
|
+
normalized.source.graphHash = hashStableJson(graphForReport(normalized.graph));
|
|
4075
|
+
}
|
|
4068
4076
|
return normalized;
|
|
4069
4077
|
}
|
|
4078
|
+
function deriveRelationshipsFromGraph(graph) {
|
|
4079
|
+
if (process.env.MODA_HARNESS_DERIVE_RELATIONSHIPS === "0")
|
|
4080
|
+
return { added: 0 };
|
|
4081
|
+
const agentIds = new Set(graph.runtimeAgents.map((agent) => agent.id));
|
|
4082
|
+
const artifactsById = new Map(graph.artifacts.map((artifact) => [artifact.id, artifact]));
|
|
4083
|
+
const seen = new Set(graph.relationships.map((rel) => `${rel.type}|${rel.from}|${rel.to}`));
|
|
4084
|
+
let added = 0;
|
|
4085
|
+
const push = (type, from, to, evidence) => {
|
|
4086
|
+
const key = `${type}|${from}|${to}`;
|
|
4087
|
+
if (seen.has(key))
|
|
4088
|
+
return;
|
|
4089
|
+
seen.add(key);
|
|
4090
|
+
graph.relationships.push({ type, from, to, evidence });
|
|
4091
|
+
added += 1;
|
|
4092
|
+
};
|
|
4093
|
+
for (const artifact of graph.artifacts) {
|
|
4094
|
+
const evidence = artifact.evidence?.length ? [artifact.evidence[0]] : [{ path: artifact.sourcePath ?? ".", reason: "derived from artifact linkage fields" }];
|
|
4095
|
+
if (artifact.ownedByAgentId && agentIds.has(artifact.ownedByAgentId)) {
|
|
4096
|
+
push("owns_artifact", artifact.ownedByAgentId, artifact.id, evidence);
|
|
4097
|
+
}
|
|
4098
|
+
for (const agentId of artifact.usedByAgentIds ?? []) {
|
|
4099
|
+
if (agentIds.has(agentId))
|
|
4100
|
+
push("uses_artifact", agentId, artifact.id, evidence);
|
|
4101
|
+
}
|
|
4102
|
+
}
|
|
4103
|
+
for (const agent of graph.runtimeAgents) {
|
|
4104
|
+
for (const artifactId of agent.artifactIds ?? []) {
|
|
4105
|
+
const artifact = artifactsById.get(artifactId);
|
|
4106
|
+
if (!artifact)
|
|
4107
|
+
continue;
|
|
4108
|
+
const evidence = agent.evidence?.length ? [agent.evidence[0]] : [{ path: agent.root ?? ".", reason: "derived from agent artifactIds" }];
|
|
4109
|
+
push("uses_artifact", agent.id, artifact.id, evidence);
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
return { added };
|
|
4113
|
+
}
|
|
4070
4114
|
function mergeDeterministicArtifacts(graph, rootDir) {
|
|
4071
4115
|
if (process.env.MODA_HARNESS_DETERMINISTIC_MERGE === "0")
|
|
4072
4116
|
return { added: 0 };
|
|
@@ -4767,6 +4811,7 @@ function renderExternalHarnessAnalystPrompt(options) {
|
|
|
4767
4811
|
"Artifacts must include id, type, name, scope, usedByAgentIds, confidence, evidence, and optional sourcePath/contentHash/ownedByAgentId. Emit one artifact PER tool, PER prompt (including each inline system prompt), PER guardrail, and PER eval — enumerate them all; artifact types are entrypoint, prompt, tool, skill, eval, retrieval_index, memory, guardrail, model_config, unknown.",
|
|
4768
4812
|
"Do NOT transcribe prompt/tool text into `body` when it exists verbatim in the repo — pin its exact location instead (sourcePath for a dedicated file, or evidence [{ path, line, reason }] at the definition line) and Moda hydrates `body` locally from that location after validation. Set `body` inline ONLY for content that cannot be recovered from one pinned location: dynamically assembled prompts, fragments concatenated at runtime, or values you had to derive. Short bodies for `guardrail` (the rule), `eval` (what it asserts), and `model_config` (the config values) are still welcome. Redact any secret literals.",
|
|
4769
4813
|
"For every `prompt` and `tool` artifact, at least one evidence entry MUST pin an exact source location so downstream optimization can retrieve the item text: carry a numeric `line` (the definition line, or the first line of the range) — evidence: [{ path, line, reason }]. The only exception is an artifact whose entire dedicated file is the text (e.g. a standalone prompt file); set its sourcePath and cite that same file and no line is required. When a single file holds multiple inline prompts or tool definitions, give each its own distinct line — a bare { path, reason } is a defect there.",
|
|
4814
|
+
"LINKAGE IS MANDATORY, not optional metadata: every artifact you author must carry usedByAgentIds naming each runtime agent that uses it (and ownedByAgentId when a single agent owns it), and every runtime agent's artifactIds must list its prompts, tools, and evals. Moda derives uses_artifact/owns_artifact edges from these fields after your run, so empty linkage means a disconnected map. Reserve explicit `relationships` entries for what linkage fields cannot express: covered_by_eval, runs_in_environment, invoked_by_channel, deployed_as, shares_artifact_with, resolves_identity_to, emits_telemetry.",
|
|
4770
4815
|
"Agent families must include id, name, runtimeAgentIds, sharedArtifactIds, confidence, evidence.",
|
|
4771
4816
|
"Frameworks/providers must include packageNames and runtimeAgentIds arrays; providers also include envVars and modelHints arrays.",
|
|
4772
4817
|
"Unknowns in graph must include id, question, candidateIds, evidence. Report-level unknowns must include id, question, citationIds.",
|
package/dist/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
runPromptsCommand,
|
|
9
9
|
runSkillsCommand,
|
|
10
10
|
runStatusCommand
|
|
11
|
-
} from "./cli-
|
|
11
|
+
} from "./cli-b2ktsnmh.js";
|
|
12
12
|
import {
|
|
13
13
|
ApiError,
|
|
14
14
|
HARNESS_REPORT_APPROVAL_PATH,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
summarizeHarness,
|
|
30
30
|
terminalStyles,
|
|
31
31
|
validateHarnessReport
|
|
32
|
-
} from "./cli-
|
|
32
|
+
} from "./cli-5e0rd8mf.js";
|
|
33
33
|
import {
|
|
34
34
|
authFetch,
|
|
35
35
|
clearAuthSession,
|
|
@@ -6496,7 +6496,7 @@ var commandRegistry = createCommandRegistry([
|
|
|
6496
6496
|
resetApiRequestCountBeforeRun: true,
|
|
6497
6497
|
telemetry: "result",
|
|
6498
6498
|
handler: async (context) => {
|
|
6499
|
-
const { runInit } = await import("./index-
|
|
6499
|
+
const { runInit } = await import("./index-6twsawta.js");
|
|
6500
6500
|
if (context.outputMode === "agent-stream") {
|
|
6501
6501
|
context.output.writeEvent({
|
|
6502
6502
|
event: "started",
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
runPromptSync,
|
|
10
10
|
runSkillSync,
|
|
11
11
|
upsertSkillManifestRecord
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-b2ktsnmh.js";
|
|
13
13
|
import {
|
|
14
14
|
codingAgentDisplayName,
|
|
15
15
|
describeCodingAgentEvent,
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
runHarnessCommand,
|
|
28
28
|
startRemoteAnalyze,
|
|
29
29
|
stripAnsi
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-5e0rd8mf.js";
|
|
31
31
|
import {
|
|
32
32
|
selectTenantAndCreateKey
|
|
33
33
|
} from "./cli-pq6rte0w.js";
|
package/package.json
CHANGED