@staix/agent-research 0.1.0 → 0.3.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/CHANGELOG.md +137 -0
- package/README.md +356 -31
- package/package.json +4 -2
- package/src/autonomy.ts +50 -0
- package/src/cli.ts +134 -14
- package/src/commands-table.ts +43 -9
- package/src/commands.ts +244 -43
- package/src/copilot.ts +91 -0
- package/src/exp/attempts.ts +512 -69
- package/src/exp/executor.ts +235 -12
- package/src/exp/final.ts +1 -1
- package/src/exp/investigate.ts +7 -2
- package/src/exp/logs.ts +25 -12
- package/src/exp/metrics.ts +6 -5
- package/src/exp/pipeline.ts +92 -0
- package/src/exp/protocol.ts +88 -18
- package/src/exp/retention-script.ts +649 -0
- package/src/exp/retention.ts +70 -0
- package/src/exp/reuse-admission.ts +63 -0
- package/src/exp/reuse-contract.ts +48 -0
- package/src/exp/reuse-runtime.ts +87 -0
- package/src/exp/reuse.ts +87 -0
- package/src/exp/selection.ts +1 -1
- package/src/exp/snapshot.ts +3 -3
- package/src/exp/stages.ts +117 -0
- package/src/harness/experience-source.ts +34 -0
- package/src/harness/experience.ts +206 -0
- package/src/harness/hub-guidance.ts +140 -0
- package/src/harness/hub-reference.ts +18 -0
- package/src/harness/lesson-candidates.ts +162 -0
- package/src/harness/limits.ts +2 -0
- package/src/harness/privacy.ts +4 -0
- package/src/harness/receipts.ts +84 -0
- package/src/harness/rounds.ts +198 -0
- package/src/harness/transitions.ts +152 -0
- package/src/http.ts +46 -2
- package/src/lit/candidates.ts +13 -5
- package/src/lit/cards.ts +55 -4
- package/src/lit/flow.ts +82 -0
- package/src/lit/queries.ts +62 -0
- package/src/lit/watch.ts +14 -1
- package/src/manifest.ts +15 -7
- package/src/mcp-tools.ts +140 -32
- package/src/mcp.ts +6 -0
- package/src/memory/amem-show.ts +135 -0
- package/src/memory/amem.ts +3 -0
- package/src/memory/archive.ts +20 -8
- package/src/memory/evidence-local.ts +77 -0
- package/src/memory/evidence.ts +39 -0
- package/src/memory/lessons.ts +4 -2
- package/src/memory/skill-check.ts +56 -0
- package/src/memory/skill-format.ts +77 -0
- package/src/memory/skills.ts +72 -26
- package/src/memory/source-budget.ts +11 -0
- package/src/memory/vault-cards.ts +226 -0
- package/src/paper/build.ts +20 -8
- package/src/paper/check.ts +40 -12
- package/src/paper/headings.ts +39 -0
- package/src/paper/hygiene.ts +153 -0
- package/src/paper/placeholders.ts +21 -4
- package/src/paper/plan.ts +170 -0
- package/src/paper/point-evidence.ts +63 -0
- package/src/paper/points.ts +83 -0
- package/src/paper/review.ts +116 -11
- package/src/paper/scopes.ts +51 -0
- package/src/plan/controller.ts +42 -12
- package/src/plan/definition.ts +22 -6
- package/src/plan/hub.ts +6 -0
- package/src/plan/state.ts +58 -17
- package/src/playbook.ts +47 -20
- package/src/privacy.ts +9 -0
- package/src/provenance.ts +679 -0
- package/src/scope.ts +24 -3
- package/src/study-export.ts +282 -0
- package/src/study.ts +94 -26
- package/src/ui/panel.css +4 -0
- package/src/ui/panel.js +271 -9
- package/src/ui/plugin.ts +89 -17
package/src/ui/panel.js
CHANGED
|
@@ -10,6 +10,8 @@ export default (host) => {
|
|
|
10
10
|
const number = (value) => typeof value === "number" && Number.isFinite(value) ? String(value) : "Unavailable";
|
|
11
11
|
const rows = (value) => Array.isArray(value) ? value : [];
|
|
12
12
|
const record = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
13
|
+
const autonomyLabel = (value) => typeof value === "string" ? text(value)
|
|
14
|
+
: `${text(record(value).default)}${Object.keys(record(record(value).phases)).length ? " (phase overrides)" : ""}`;
|
|
13
15
|
const line = (value, max = 180) => {
|
|
14
16
|
const valueText = text(value, "").replace(/\s+/g, " ").trim();
|
|
15
17
|
return valueText.length > max ? `${valueText.slice(0, max - 3)}...` : valueText;
|
|
@@ -17,7 +19,7 @@ export default (host) => {
|
|
|
17
19
|
const at = (value) => typeof value === "string" ? value.replace("T", " ").replace(/\.\d+Z$/, " UTC") : "Time unavailable";
|
|
18
20
|
const go = (target, extra = {}) => host.navigate(host.tool, target, extra);
|
|
19
21
|
const tone = (state) => ["accepted", "approved", "qualified", "succeeded", "ready"].includes(state) ? "ok"
|
|
20
|
-
: ["failed", "unknown", "unavailable"].includes(state) ? "err"
|
|
22
|
+
: ["failed", "unknown", "unavailable", "corrupt", "missing"].includes(state) ? "err"
|
|
21
23
|
: ["pending", "proposed", "not_qualified", "rejected"].includes(state) ? "warn" : "neutral";
|
|
22
24
|
const decisionNotice = () => ui.notice("Each decision opens a preview. Nothing is written until you confirm.", "neutral");
|
|
23
25
|
const perform = async (input) => {
|
|
@@ -72,7 +74,8 @@ export default (host) => {
|
|
|
72
74
|
if (value.available === false) return h("section", { class: "ares-card" }, h("h3", { text: "Attempts unavailable" }),
|
|
73
75
|
ui.notice(line(value.reason) || "Attempt records could not be read. Inspect the study records and refresh.", "err"));
|
|
74
76
|
return h("section", { class: "ares-card" }, h("h3", { text: `Attempts: ${number(value.total)}` }),
|
|
75
|
-
ui.rows(Object.entries(byStatus), ([state, count]) => ui.row({ title: state, sub: number(count), chip: { text: state, tone: tone(state) } })) ?? ui.empty("No attempt status details")
|
|
77
|
+
ui.rows(Object.entries(byStatus), ([state, count]) => ui.row({ title: state, sub: number(count), chip: { text: state, tone: tone(state) } })) ?? ui.empty("No attempt status details"),
|
|
78
|
+
value.reuse ? h("p", {class: "ares-sub", text: `Reuse-controlled attempts: ${number(value.reuse.attempts)} | executed stages: ${number(value.reuse.executedStages)} | reused stages: ${number(value.reuse.reusedStages)} | fresh evaluations: ${number(value.reuse.freshEvaluations)} | independent samples: ${number(value.reuse.independentSamples)}`}) : null);
|
|
76
79
|
};
|
|
77
80
|
const studies = (snapshot) => {
|
|
78
81
|
const list = rows(snapshot.studies);
|
|
@@ -84,11 +87,29 @@ export default (host) => {
|
|
|
84
87
|
const attempts = study.attempts?.available === false ? `Attempts unavailable: ${line(study.attempts.reason) || "Attempt records could not be read."}` : `${number(study.attempts?.total)} attempts`;
|
|
85
88
|
const pending = rows(study.gates).filter((gate) => gate.state === "pending").length;
|
|
86
89
|
return ui.row({ title: line(study.question) || text(study.id, "Unavailable study"),
|
|
87
|
-
sub: available ? [text(study.mode),
|
|
90
|
+
sub: available ? [text(study.mode), autonomyLabel(study.autonomy), attempts, `${pending} pending gates`, finalState ? `Final ${finalState}` : "Final unavailable", reviewState, watchState].join(" | ") : text(study.reason, "Study cannot be read; its registration is retained."),
|
|
88
91
|
chip: { text: available ? text(study.mode, "study") : "unavailable", tone: available ? "neutral" : "err" },
|
|
89
92
|
...(typeof study.dir === "string" ? { onOpen: () => go("study", { study: study.dir }) } : {}) });
|
|
90
93
|
}) ?? ui.empty("No registered studies", "Register one with ares console add <dir>. Ares does not scan the disk for studies.")];
|
|
91
94
|
};
|
|
95
|
+
const skillRef = (value) => {
|
|
96
|
+
if (typeof value === "string") return value;
|
|
97
|
+
const ref = record(value), fields = ["v", "tool", "projectKey", "kind", "id", "revision", "sha256"];
|
|
98
|
+
return JSON.stringify(Object.fromEntries(fields.filter(key => ref[key] !== undefined).map(key => [key, ref[key]])));
|
|
99
|
+
};
|
|
100
|
+
const skillList = (values, render = (value) => text(value)) => h("div", {},
|
|
101
|
+
rows(values).length ? h("ul", {class: "ares-list"}, ...rows(values).slice(0, 64).map(value => h("li", {text: render(value)}))) : h("p", {text: "None recorded"}),
|
|
102
|
+
rows(values).length > 64 ? ui.notice(`${rows(values).length - 64} more entries; display incomplete.`, "warn") : null);
|
|
103
|
+
const skillInspections = (values, caption) => h("div", {}, rows(values).length ? ui.table({caption,
|
|
104
|
+
columns: [{key: "ref", label: "Typed reference"}, {key: "state", label: "Recorded availability"}, {key: "integrity", label: "Integrity"}, {key: "outcome", label: "Recorded outcome"}, {key: "success", label: "Recorded success"}, {key: "support", label: "Support"}, {key: "digest", label: "Digest"}, {key: "versions", label: "Source versions"}, {key: "observed", label: "Observed time"}],
|
|
105
|
+
rows: rows(values).slice(0, 64).map(value => {
|
|
106
|
+
const item = record(value), version = record(item.sourceVersion);
|
|
107
|
+
return {ref: skillRef(item.ref), state: text(item.state), integrity: text(item.integrity), outcome: text(record(item.outcome).status),
|
|
108
|
+
success: typeof record(item.outcome).success === "boolean" ? String(item.outcome.success) : "Unavailable",
|
|
109
|
+
support: text(item.support), digest: text(item.digest, "not recorded"),
|
|
110
|
+
versions: JSON.stringify(Object.fromEntries(["reference", "native", "ledger", "amem"].filter(key => version[key] !== undefined).map(key => [key, version[key]]))), observed: at(item.observedAt)};
|
|
111
|
+
})}) : ui.empty("No stored inspection receipts"),
|
|
112
|
+
rows(values).length > 64 ? ui.notice(`${rows(values).length - 64} more receipts; display incomplete.`, "warn") : null);
|
|
92
113
|
const skillRows = (skills, study) => ui.rows(rows(skills), (skill) => ui.detail({
|
|
93
114
|
kind: "Skill proposal", title: text(skill.name), state: { text: text(skill.state), tone: tone(skill.state) }, summary: text(skill.summary, ""),
|
|
94
115
|
actions: skill.state === "proposed" && typeof skill.name === "string" && typeof study === "string" ? [
|
|
@@ -96,18 +117,34 @@ export default (host) => {
|
|
|
96
117
|
ui.button("Reject...", () => askDecision(`Reject ${skill.name}`, { action: "skill.reject", study, name: skill.name }), { tone: "danger" }),
|
|
97
118
|
ui.button("Withdraw...", () => askDecision(`Withdraw ${skill.name}`, { action: "skill.withdraw", study, name: skill.name }), { tone: "danger" }),
|
|
98
119
|
] : [],
|
|
99
|
-
sections: [{
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
sections: [{title: "Evidence status", body: h("div", {},
|
|
121
|
+
ui.notice(skill.skillProposal === 1 ? "Legacy v1 evidence: legacy-unresolved. Create a new v2 proposal for evidence-backed checks." : "V2 evidence: inspection-required. Stored receipts are not a current privacy check.", "warn"),
|
|
122
|
+
h("p", {text: `Run explicitly: ares skill check ${text(study, "<dir>")} ${text(skill.name, "<name>")}`}),
|
|
123
|
+
h("p", {text: "Acceptance reruns evidence and counterevidence under the study lock. Negative/no-winner outcomes are not success; source integrity is not support. Support remains reviewer-judgment."}))},
|
|
124
|
+
{title: "Applicability", body: h("p", {text: text(skill.applicability, "not recorded")})},
|
|
125
|
+
{title: "Limitations", body: skillList(skill.limitations)},
|
|
126
|
+
{title: "Steps", body: skillList(skill.steps)},
|
|
127
|
+
{title: "Evidence", body: skillList(skill.evidence, skillRef)},
|
|
128
|
+
{title: "Counterevidence", body: skillList(skill.counterevidence, skillRef)},
|
|
129
|
+
{title: "Proposal inspection receipts", body: skillInspections(skill.inspections, "Stored proposal inspections")},
|
|
130
|
+
...(skill.decision ? [{title: "Recorded decision", body: h("div", {},
|
|
131
|
+
h("p", {text: `${text(skill.decision.action)}: ${text(skill.decision.reason)}`}),
|
|
132
|
+
h("p", {text: `Actor: ${text(record(skill.decision.actor).kind)} ${text(record(skill.decision.actor).id, "")} | ${at(skill.decision.at)}`}),
|
|
133
|
+
h("p", {text: `Evidence fingerprint: ${text(skill.decision.evidenceFingerprint, "not recorded")}`}),
|
|
134
|
+
h("p", {text: `PR reference supplied (not verified as merged): ${text(skill.decision.pr, "not recorded")}`}))},
|
|
135
|
+
{title: "Decision inspection receipts", body: skillInspections(skill.decision.inspections, "Stored decision inspections")}] : [])],
|
|
102
136
|
footer: typeof skill.sha256 === "string" ? [skill.sha256] : [],
|
|
103
137
|
})) ?? ui.empty("No skill proposals");
|
|
104
138
|
const studyView = (snapshot) => {
|
|
105
139
|
const study = snapshot.study;
|
|
106
140
|
if (!study) return [toolbar("Study", true), ui.notice(text(snapshot.error, "Choose a registered study from the studies panel."), "warn")];
|
|
107
141
|
const sections = [toolbar(text(study.question, "Study"), true), decisionNotice()];
|
|
142
|
+
if (typeof study.dir === "string") sections.push(h("div", { class: "ares-bar" },
|
|
143
|
+
ui.button("Lineage", () => go("lineage", { study: study.dir })), ui.button("Compare", () => go("compare", { study: study.dir })), ui.button("Harness", () => go("harness", {study: study.dir}))));
|
|
108
144
|
if (study.available === false) return [...sections, ui.notice(text(study.reason, "Study unavailable; its registration is retained."), "err"), h("p", { class: "ares-sub", text: text(study.dir, "") })];
|
|
109
|
-
sections.push(h("div", { class: "ares-bar" }, ui.chip(text(study.mode), "neutral"), ui.chip(
|
|
145
|
+
sections.push(h("div", { class: "ares-bar" }, ui.chip(text(study.mode), "neutral"), ui.chip(autonomyLabel(study.autonomy), "neutral")),
|
|
110
146
|
h("p", { class: "ares-sub", text: text(study.dir, "") }), gateRows(study.gates, study.dir), attemptRows(study.attempts));
|
|
147
|
+
if (study.autonomy && typeof study.autonomy === "object") sections.push(block("Autonomy policy", study.autonomy));
|
|
111
148
|
const final = record(study.final);
|
|
112
149
|
sections.push(h("section", { class: "ares-card" }, h("h3", { text: "Final status" }),
|
|
113
150
|
typeof final.status === "string" ? ui.chip(final.status, tone(final.status)) : ui.empty("No current closed final"),
|
|
@@ -119,11 +156,13 @@ export default (host) => {
|
|
|
119
156
|
rows(review.openBlocking).length ? ui.notice(`${review.openBlocking.length} blocking findings remain open.`, "warn") : null));
|
|
120
157
|
if (typeof study.manuscript?.id === "string") sections.push(h("section", { class: "ares-card" }, h("h3", { text: "Built manuscript" }),
|
|
121
158
|
ui.link({ asset: study.manuscript.id }, "Open manuscript text")));
|
|
159
|
+
const investigationArtifact = record(study.investigationArtifact);
|
|
160
|
+
if (investigationArtifact.state === "missing") sections.push(ui.notice(text(investigationArtifact.message, "Investigation artifact missing; displayed result is recalculated. Restore the artifact or run ares investigate close."), "warn"));
|
|
122
161
|
sections.push(block("Investigation", study.investigation), block("Posthoc exploration", study.posthoc));
|
|
123
162
|
const watch = record(study.watch), watchConfig = record(watch.config);
|
|
124
163
|
sections.push(h("section", { class: "ares-card" }, h("h3", { text: "Watch" }),
|
|
125
164
|
typeof watchConfig.rubric === "string" ? h("div", {}, h("strong", { text: "Display-only rubric" }), h("p", { class: "ares-prose", text: watchConfig.rubric })) : null,
|
|
126
|
-
ui.rows(rows(watch.runs), (run) => ui.row({ title: run.ok ? "Source answered" : "All sources failed", sub: `${at(run.at)} | ${number(run.added)} added | ${number(run.addedIdsTotal)} recorded ids`, chip: { text: run.ok ? "answered" : "failed", tone: run.ok ? "ok" : "err" } })) ?? ui.empty("No watch runs")));
|
|
165
|
+
ui.rows(rows(watch.runs), (run) => ui.row({ title: run.ok ? "Source answered" : run.cause === undefined ? "All sources failed" : ["terminated", "filesystem", "internal", "network", "rate", "server", "client", "format"].includes(run.cause) ? `Watch run failed (${run.cause})` : "Watch run failed (unknown cause)", sub: `${at(run.at)} | ${number(run.added)} added | ${number(run.addedIdsTotal)} recorded ids`, chip: { text: run.ok ? "answered" : "failed", tone: run.ok ? "ok" : "err" } })) ?? ui.empty("No watch runs")));
|
|
127
166
|
const candidates = rows(record(watch.newCandidates).candidates).filter((candidate) => candidate.status === "new" && typeof candidate.id === "string");
|
|
128
167
|
sections.push(h("section", { class: "ares-card" }, h("h3", { text: "New candidates" }),
|
|
129
168
|
ui.rows(candidates, (candidate) => ui.row({ title: line(candidate.title) || candidate.id, sub: `${candidate.id}${typeof candidate.year === "number" ? ` | ${candidate.year}` : ""}`, verbs: typeof study.dir === "string" ? [
|
|
@@ -140,10 +179,233 @@ export default (host) => {
|
|
|
140
179
|
ui.rows(errors, ([name, reason]) => ui.row({ title: name, sub: String(reason) }))));
|
|
141
180
|
return sections;
|
|
142
181
|
};
|
|
182
|
+
const rootParams = () => Object.fromEntries(["rootKind", "rootId", "rootRevision", "rootSha256"].filter(key => typeof params[key] === "string").map(key => [key, params[key]]));
|
|
183
|
+
const referenceLabel = (value) => {
|
|
184
|
+
const ref = record(value);
|
|
185
|
+
return `${text(ref.kind)}: ${text(ref.id)}${typeof ref.revision === "string" ? ` | revision ${ref.revision}` : ""}${typeof ref.sha256 === "string" ? ` | sha256 ${ref.sha256}` : ""}`;
|
|
186
|
+
};
|
|
187
|
+
const trace = (study, value) => {
|
|
188
|
+
const ref = record(value);
|
|
189
|
+
if (typeof study !== "string" || typeof ref.kind !== "string" || typeof ref.id !== "string") return;
|
|
190
|
+
go("lineage", { study, rootKind: ref.kind, rootId: ref.id,
|
|
191
|
+
...(typeof ref.revision === "string" ? { rootRevision: ref.revision } : {}), ...(typeof ref.sha256 === "string" ? { rootSha256: ref.sha256 } : {}) });
|
|
192
|
+
};
|
|
193
|
+
const proofLabel = (value) => {
|
|
194
|
+
const proof = record(value);
|
|
195
|
+
return `${text(proof.file)} | sha256 ${text(proof.sha256)}${typeof proof.ledgerIndex === "number" ? ` | ledger index ${proof.ledgerIndex}` : ""}${typeof proof.recordType === "string" ? ` | ${proof.recordType}` : ""}${typeof proof.nativeId === "string" ? ` | native id ${proof.nativeId}` : ""}`;
|
|
196
|
+
};
|
|
197
|
+
const chooseStudy = (snapshot, target) => ui.rows(rows(snapshot.studies).slice(0, 200), study => ui.row({
|
|
198
|
+
title: text(study.question, text(study.id, text(study.dir, "Registered study"))), sub: text(study.dir, ""),
|
|
199
|
+
...(typeof study.dir === "string" ? { onOpen: () => go(target, { study: study.dir }) } : {}),
|
|
200
|
+
})) ?? ui.empty("No registered studies", "Register a study with ares console add <dir>.");
|
|
201
|
+
const readHeader = (title, snapshot) => {
|
|
202
|
+
const study = record(snapshot.study), sections = [toolbar(title, true)];
|
|
203
|
+
if (typeof study.dir === "string") sections.push(h("div", { class: "ares-bar" },
|
|
204
|
+
ui.button("Study detail", () => go("study", { study: study.dir })),
|
|
205
|
+
ui.button("Full lineage", () => go("lineage", { study: study.dir })), ui.button("Compare", () => go("compare", { study: study.dir }))));
|
|
206
|
+
if (snapshot.error) sections.push(ui.notice(String(snapshot.error), "err"));
|
|
207
|
+
return sections;
|
|
208
|
+
};
|
|
209
|
+
const moreNotice = (count, command) => count > 0 ? ui.notice(`${count} more; inspect with ares lineage ${command} <dir> --json`, "warn") : null;
|
|
210
|
+
const reasonRows = (value, command = "compare") => {
|
|
211
|
+
const values = rows(value), shown = values.slice(0, 64);
|
|
212
|
+
return h("div", {}, ui.rows(shown, reason => ui.row({ title: String(reason) })), moreNotice(values.length - shown.length, command));
|
|
213
|
+
};
|
|
214
|
+
const readNotices = (value, command = "show") => {
|
|
215
|
+
const data = record(value), notices = [];
|
|
216
|
+
if (data.status === "changed") notices.push(ui.notice(command === "compare" ? "Sources changed or a write is in progress; retry the comparison." : "Sources or the root selection changed. Restart from the first page before continuing.", "warn"));
|
|
217
|
+
else if (data.status === "capped" || data.truncated === true) notices.push(ui.notice(data.status === "capped" ? command === "compare" ? "Traversal capped: this is a partial comparison, not complete evidence." : "Traversal capped: this is a partial graph, not complete provenance." : "This page is partial. Continue to read the remaining source-proven records.", "warn"));
|
|
218
|
+
if (data.status === "unavailable") notices.push(ui.notice("Some source records are unavailable or corrupt. Retained receipts do not establish current readable results.", "warn"));
|
|
219
|
+
const issues = rows(data.issues), critical = issue => /capped|changed/.test(text(issue.code, "")) || issue.code === "comparison-selection-unavailable";
|
|
220
|
+
const important = issues.filter(critical), shown = [...important, ...issues.filter(issue => !critical(issue)).slice(0, Math.max(0, 64 - important.length))];
|
|
221
|
+
notices.push(...shown.map(issue => ui.notice(`${text(issue.code, "Source issue")}: ${text(issue.message, "Inspect and restore the source record.")}`, "warn")));
|
|
222
|
+
const omitted = moreNotice(issues.length - shown.length, command); if (omitted) notices.push(omitted);
|
|
223
|
+
return notices;
|
|
224
|
+
};
|
|
225
|
+
const lineageView = (snapshot) => {
|
|
226
|
+
const sections = readHeader("Execution lineage", snapshot), study = record(snapshot.study), page = snapshot.lineage;
|
|
227
|
+
if (!study.dir) return [...sections, chooseStudy(snapshot, "lineage")];
|
|
228
|
+
if (!page) return [...sections, ui.empty("Lineage unavailable", "Choose a registered study or refresh after restoring its source records.")];
|
|
229
|
+
sections.push(...readNotices(page), h("p", { class: "ares-sub ares-identifiers", text: `Source sha256: ${text(page.sourceSha256)} | ledger bytes: ${number(page.ledgerPosition)} | nodes: ${number(page.totals?.nodes)} | edges: ${number(page.totals?.edges)}` }));
|
|
230
|
+
if (typeof params.rootKind === "string" && typeof params.rootId === "string") sections.push(h("p", { class: "ares-sub ares-identifiers", text: `Root ${params.rootKind}: ${params.rootId}` }));
|
|
231
|
+
if (page.status === "changed") sections.push(ui.button("Restart lineage", () => go("lineage", { study: study.dir, ...rootParams() })));
|
|
232
|
+
sections.push(h("section", { class: "ares-card ares-identifiers" }, h("h3", { text: "Source nodes" }),
|
|
233
|
+
ui.rows(rows(page.nodes).slice(0, 100), node => ui.row({ title: referenceLabel(node.ref), sub: proofLabel(node.proof),
|
|
234
|
+
chip: { text: `${text(node.state)} / ${text(node.availability)}`, tone: tone(node.state === "current" ? node.availability : node.state) }, onOpen: () => trace(study.dir, node.ref) })) ?? ui.empty("No source nodes on this page")));
|
|
235
|
+
sections.push(h("section", { class: "ares-card ares-identifiers" }, h("h3", { text: "Recorded relationships" }),
|
|
236
|
+
ui.table({ caption: "Source-proven edges", columns: [{ key: "from", label: "From" }, { key: "relation", label: "Relation" }, { key: "to", label: "To" }, { key: "proof", label: "Source proof" }],
|
|
237
|
+
rows: rows(page.edges).slice(0, 200).map(edge => ({ from: referenceLabel(edge.from), relation: text(edge.relation), to: referenceLabel(edge.to), proof: proofLabel(edge.proof) })) })));
|
|
238
|
+
sections.push(ui.notice("Current and historical receipts describe their source state. Missing/corrupt sources stay explicit; not-read artifacts show digests only, never output bodies.", "neutral"));
|
|
239
|
+
if (typeof page.nextCursor === "string") sections.push(ui.button("Next lineage page", () => go("lineage", { study: study.dir, ...rootParams(), graphCursor: page.nextCursor })));
|
|
240
|
+
return sections;
|
|
241
|
+
};
|
|
242
|
+
const compareView = (snapshot) => {
|
|
243
|
+
const sections = readHeader("Compare execution records", snapshot), study = record(snapshot.study);
|
|
244
|
+
if (!study.dir) return [...sections, chooseStudy(snapshot, "compare")];
|
|
245
|
+
const errors = h("div", { "aria-live": "polite" });
|
|
246
|
+
sections.push(ui.notice("Read-only comparison. Select exactly one list of existing records; this creates no winner, action or result receipt.", "neutral"),
|
|
247
|
+
ui.form([{ name: "attempts", label: "Attempt ids (comma-separated, at most eight)", value: typeof params.attempts === "string" ? params.attempts : "" }, { name: "candidates", label: "Candidate commits (comma-separated, at most eight)", value: typeof params.candidates === "string" ? params.candidates : "" }], { label: "Compare records", primary: true }, values => {
|
|
248
|
+
const attempts = text(values.attempts, "").trim(), candidates = text(values.candidates, "").trim();
|
|
249
|
+
const selected = attempts || candidates, ids = selected.split(",").map(id => id.trim()), pattern = attempts ? /^[a-f0-9]{16}$/ : /^[a-f0-9]{40}$/;
|
|
250
|
+
if (!!attempts === !!candidates || ids.length < 1 || ids.length > 8 || new Set(ids).size !== ids.length || ids.some(id => !pattern.test(id))) {
|
|
251
|
+
errors.replaceChildren(ui.notice("Enter exactly one list: one to eight distinct 16-hex attempt ids or full 40-hex candidate commits.", "err")); return;
|
|
252
|
+
}
|
|
253
|
+
go("compare", { study: study.dir, ...(attempts ? { attempts: ids.join(",") } : { candidates: ids.join(",") }) });
|
|
254
|
+
}), errors);
|
|
255
|
+
const comparison = snapshot.comparison;
|
|
256
|
+
if (!comparison) return [...sections, ui.empty("Choose records to compare", "Failed and unknown attempts remain visible; retries are not independent samples.")];
|
|
257
|
+
sections.push(ui.notice("Reused computation is historical, not a new independent sample. Original compute and current verification/materialization overhead stay separate; no savings are inferred.", "neutral"), ...readNotices(comparison, "compare"), h("p", { class: "ares-sub ares-identifiers", text: `Source sha256: ${text(comparison.sourceSha256)} | ledger bytes: ${number(comparison.ledgerPosition)}` }), ui.notice("Aggregation unavailable; performed: false. These descriptive rows do not pool retries or create a verdict. Existing closed investigation and fresh final remain the result authorities.", "neutral"));
|
|
258
|
+
const aggregation = record(comparison.aggregation);
|
|
259
|
+
sections.push(h("section", { class: "ares-card" }, h("h3", { text: "Input compatibility" }),
|
|
260
|
+
ui.chip(aggregation.compatible === true ? "compatible inputs" : "compatibility unavailable or restricted", aggregation.compatible === true ? "neutral" : "warn"),
|
|
261
|
+
reasonRows(aggregation.reasons)));
|
|
262
|
+
for (const row of rows(comparison.rows).slice(0, 8)) {
|
|
263
|
+
const attempts = rows(row.attempts).slice(0, 128), columns = [
|
|
264
|
+
["id", "Attempt"], ["code", "Code commit / tree / snapshot"], ["protocol", "Protocol hash"], ["seed", "Seed"], ["status", "Status"], ["retry", "Retry ancestry / sample group"], ["metrics", "Metrics and units"], ["digests", "Artifact digests (not read)"], ["wall", "Wall ms (recorded)"], ["bytes", "Output bytes"], ["execution", "Execution / independent samples"], ["reuseSources", "Reused source references"], ["reuseCosts", "Original / incremental overhead"], ["other", "Other costs"],
|
|
265
|
+
].map(([key, label]) => ({ key, label, ...(["seed", "wall", "bytes"].includes(key) ? { align: "end" } : {}) }));
|
|
266
|
+
const cost = value => typeof value === "number" && Number.isFinite(value) ? value : "unknown";
|
|
267
|
+
const tableRows = attempts.map(attempt => {
|
|
268
|
+
const code = record(attempt.code), costs = record(attempt.costs), reuse = record(attempt.reuse), reuseCosts = record(reuse.costs);
|
|
269
|
+
return { id: text(attempt.id), code: [text(code.commit), text(code.treeId), text(code.snapshotSha256, "unknown")].join(" / "), protocol: text(attempt.protocolHash), seed: number(attempt.seed), status: text(attempt.status),
|
|
270
|
+
retry: `${text(attempt.retryOf, "none")} | ancestry: ${rows(attempt.retryAncestry).join(" -> ") || "none"} | sample group: ${text(attempt.sampleGroup, "unknown")}`,
|
|
271
|
+
metrics: rows(attempt.metrics).slice(0, 32).map(metric => `${text(metric.name)}: ${number(metric.value)} ${text(metric.unit, "unit unavailable")}`).join("; ") || "unknown",
|
|
272
|
+
digests: rows(attempt.artifactDigests).slice(0, 64).join("; ") || "none recorded", wall: cost(costs.wallMilliseconds), bytes: cost(costs.storageBytes),
|
|
273
|
+
execution: attempt.reuse ? `executed: ${number(reuse.executedStages)}; reused: ${number(reuse.reusedStages)}; fresh evaluator: ${number(reuse.freshEvaluations)}; independent samples: ${number(reuse.independentSamples)}` : "legacy/fresh receipt; reuse metadata unavailable",
|
|
274
|
+
reuseSources: rows(reuse.sources).slice(0, 16).map(raw => { const source = record(raw), ref = record(source.ref); return `${text(source.candidateStage)} <- ${text(ref.attemptId)} / ${text(ref.stage)} / ${text(ref.sha256)}`; }).join("; ") || "none recorded",
|
|
275
|
+
reuseCosts: attempt.reuse ? `original wall seconds: ${cost(reuseCosts.originalWallSeconds)}; original GPU hours: ${cost(reuseCosts.originalGpuHours)}; current verification ms: ${cost(reuseCosts.verificationMilliseconds)}; current materialization ms: ${cost(reuseCosts.materializationMilliseconds)}; preflight failure ms (overlapping subset): ${cost(reuseCosts.observedPreflightFailureMilliseconds)}; total failure/CPU/storage/transfer: unknown; do not sum clock subsets` : "unknown",
|
|
276
|
+
other: ["compute", "transfer", "verification", "retention", "materialization", "idle", "person"].map(name => `${name}: ${cost(costs[name])}`).join("; ") };
|
|
277
|
+
});
|
|
278
|
+
const candidate = record(row.candidate), perSeed = rows(candidate.perSeed).slice(0, 128);
|
|
279
|
+
const recorded = value => typeof value === "number" && Number.isFinite(value) ? value : value === null ? "null (not recorded)" : "unknown";
|
|
280
|
+
const candidateSummary = row.candidate && typeof row.candidate === "object" ? h("section", { class: "ares-card" },
|
|
281
|
+
h("h3", { text: "Recorded closed candidate summary" }),
|
|
282
|
+
ui.notice("Existing closed investigation values only: no recalculation or new eligibility judgment.", "neutral"),
|
|
283
|
+
ui.table({ caption: "Recorded closed candidate summary", columns: [{ key: "reason", label: "Recorded reason" }, { key: "eligible", label: "Recorded eligible" }, { key: "mean", label: "Recorded mean" }, { key: "baselineMean", label: "Recorded baseline mean" }, { key: "delta", label: "Recorded delta" }],
|
|
284
|
+
rows: [{ reason: text(candidate.reason, "unknown"), eligible: typeof candidate.eligible === "boolean" ? String(candidate.eligible) : "unknown", mean: recorded(candidate.mean), baselineMean: recorded(candidate.baselineMean), delta: recorded(candidate.delta) }] }),
|
|
285
|
+
ui.table({ caption: "Recorded per-seed values", columns: [{ key: "seed", label: "Seed", align: "end" }, { key: "attempt", label: "Attempt" }, { key: "value", label: "Recorded value", align: "end" }],
|
|
286
|
+
rows: perSeed.map(sample => ({ seed: recorded(sample.seed), attempt: text(sample.attempt), value: recorded(sample.value) })) }),
|
|
287
|
+
rows(candidate.perSeed).length > perSeed.length ? ui.notice("Per-seed display shortened to the first 128 records. Inspect the complete closed investigation with the ares CLI.", "warn") : null) : null;
|
|
288
|
+
sections.push(h("section", { class: "ares-card ares-identifiers" }, h("h3", { text: `${text(row.kind)}: ${text(row.id)}` }), ui.chip(text(row.state), tone(row.state)), candidateSummary,
|
|
289
|
+
reasonRows(row.reasons),
|
|
290
|
+
ui.table({ caption: "Recorded attempt comparison", columns, rows: tableRows }),
|
|
291
|
+
ui.rows(attempts, attempt => ui.row({ title: `Trace attempt ${text(attempt.id)}`, sub: rows(attempt.comparabilityReasons).join("; "), onOpen: () => trace(study.dir, { kind: "attempt", id: attempt.id }) })),
|
|
292
|
+
rows(row.attempts).length > attempts.length || attempts.some(attempt => rows(attempt.metrics).length > 32 || rows(attempt.artifactDigests).length > 64) ? ui.notice("Display shortened to bounded rows or inventories. Inspect the full read-only comparison with the ares CLI.", "warn") : null));
|
|
293
|
+
}
|
|
294
|
+
return sections;
|
|
295
|
+
};
|
|
296
|
+
const harnessView = (snapshot) => {
|
|
297
|
+
const sections = readHeader("Harness rounds", snapshot), study = record(snapshot.study), harness = record(snapshot.harness);
|
|
298
|
+
if (!study.dir) return [...sections, chooseStudy(snapshot, "harness")];
|
|
299
|
+
if (!snapshot.harness) return [...sections, ui.empty("Harness records unavailable", "Restore the recorded round sources and refresh.")];
|
|
300
|
+
sections.push(ui.notice("Experimental records only. Correctness is unavailable; transfer is not demonstrated. Fixture compatibility is not matched live execution or scientific evidence.", "warn"));
|
|
301
|
+
const roundViews = rows(harness.rounds).slice(0, 16);
|
|
302
|
+
sections.push(ui.rows(roundViews, view => {
|
|
303
|
+
const definition = record(view.definition), readiness = record(record(view.transitions).readiness);
|
|
304
|
+
return ui.row({title: text(definition.id, "Round"), sub: `Task ${text(record(definition.task).id)} | binding ${text(view.binding)}`, chip: {text: text(readiness.state, "open"), tone: readiness.state === "stale" ? "warn" : "neutral"}, onOpen: () => go("harness", {study: study.dir, round: definition.id})});
|
|
305
|
+
}) ?? ui.empty("No harness rounds", "No declared round is recorded for this experiment."));
|
|
306
|
+
if (harness.truncated || Number(harness.remaining) > 0 || rows(harness.rounds).length > roundViews.length) sections.push(ui.notice("Round list shortened. Inspect the complete records with the ares CLI; this view is not a complete evidence set.", "warn"));
|
|
307
|
+
const selected = roundViews.filter(view => typeof params.round === "string" ? record(view.definition).id === params.round : roundViews.length === 1);
|
|
308
|
+
if (!selected.length && roundViews.length) sections.push(ui.notice("Choose a round to inspect its recorded comparison and edit-to-evidence chain.", "neutral"));
|
|
309
|
+
const describe = value => {
|
|
310
|
+
const items = Array.isArray(value) ? value.filter(item => typeof item === "string") : null;
|
|
311
|
+
const omitted = items ? value.length - Math.min(items.length, 16) : 0;
|
|
312
|
+
const raw = items ? items.slice(0, 16).join("; ") : text(value, "Not recorded");
|
|
313
|
+
return (raw.length > 4000 ? raw.slice(0, 4000) + "... (text display incomplete)" : raw) + (omitted > 0 ? ` (${omitted} more entries; display incomplete)` : "");
|
|
314
|
+
};
|
|
315
|
+
const actorLabel = value => {const actor = record(value); return `${text(actor.kind, "actor unavailable")}${typeof actor.id === "string" ? `: ${actor.id}` : ""}`;};
|
|
316
|
+
const recorded = entry => `${text(entry.sha256)} | ${actorLabel(entry.actor)} | ${at(entry.at)}`;
|
|
317
|
+
for (const view of selected) {
|
|
318
|
+
const definition = record(view.definition), transitions = record(view.transitions), readiness = record(transitions.readiness), hypothesis = record(definition.hypothesis);
|
|
319
|
+
sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: `Round ${text(definition.id)}`}),
|
|
320
|
+
h("p", {text: `Declared authoring: ${text(definition.authoring)} | round ${text(view.binding)} | transitions ${text(transitions.fingerprint)}`}),
|
|
321
|
+
h("p", {text: `Deficiency: ${describe(hypothesis.deficiency)}`}), h("p", {text: `Predicted change: ${describe(hypothesis.predictedChange)}`}),
|
|
322
|
+
ui.chip(`Recorded state: ${text(readiness.state, "open")}`, readiness.state === "stale" ? "warn" : "neutral"),
|
|
323
|
+
h("p", {text: "Experimental: true | correctness: unavailable | transfer: not-demonstrated"}),
|
|
324
|
+
ui.table({caption: "Declared guidance identities", columns: [{key: "arm", label: "Arm"}, {key: "hash", label: "Guidance SHA-256"}], rows: [{arm: "baseline", hash: text(record(definition.baseline).guidanceSha256)}, ...rows(definition.candidates).slice(0, 2).map(candidate => ({arm: text(candidate.id), hash: text(candidate.guidanceSha256)}))]})));
|
|
325
|
+
sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: "Recorded comparisons"}),
|
|
326
|
+
ui.table({caption: "Fixture comparison identities", columns: [{key: "arm", label: "Arm"}, {key: "compatible", label: "Declared inputs compatible"}, {key: "matched", label: "Matched live evidence"}, {key: "source", label: "Source strength"}, {key: "reasons", label: "Reasons / confounders"}],
|
|
327
|
+
rows: rows(view.comparisons).slice(0, 3).map(comparison => ({arm: text(comparison.arm), compatible: String(comparison.compatible === true), matched: "false", source: text(comparison.sourceStrength, "producer-unavailable"), reasons: describe([...rows(comparison.reasons), ...rows(comparison.confounders)])}))}),
|
|
328
|
+
h("p", {text: `Historical fixture imports: ${number(view.historicalImports)}. Real import and end-to-end evaluation remain unavailable.`})));
|
|
329
|
+
if (rows(view.comparisons).length > 3) sections.push(ui.notice("Comparison display shortened; inspect ares harness show --json for the complete admitted identities.", "warn"));
|
|
330
|
+
if (typeof transitions.nextStep === "string") sections.push(ui.notice(transitions.nextStep, "neutral"));
|
|
331
|
+
const contrasts = rows(transitions.contrasts).slice(0, 32);
|
|
332
|
+
if (!contrasts.length) sections.push(ui.empty("No recorded contrasts"));
|
|
333
|
+
for (const entry of contrasts) {
|
|
334
|
+
const form = record(entry.form), evidence = rows(form.evidence).slice(0, 16);
|
|
335
|
+
const account = form.basis === "actor-claim" ? "Actor claim (not observed evidence)" : form.basis === "blinded-judgment" ? "Recorded blinded judgment" : form.basis === "deterministic-check" ? "Recorded deterministic-check account" : "Recorded account (basis unavailable)";
|
|
336
|
+
sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: `Recorded contrast ${text(form.id)}`}),
|
|
337
|
+
h("p", {text: `${text(form.arm)} | outcome ${text(form.outcome)} | provenance basis ${text(form.basis)}${form.basis === "blinded-judgment" ? ` | judge ${text(form.judge, "not declared")}` : ""} | model ${text(form.model, "not declared")}`}),
|
|
338
|
+
h("p", {class: "ares-prose", text: `${account}: ${describe(form.observations)}`}), h("p", {class: "ares-prose", text: `Uncertainty: ${describe(form.uncertainty)}`}),
|
|
339
|
+
h("p", {class: "ares-prose", text: `Explanations: ${describe(form.explanations)}`}), h("p", {class: "ares-sub", text: recorded(entry)}),
|
|
340
|
+
ui.table({caption: "Recorded contrast evidence references", columns: [{key: "probe", label: "Probe"}, {key: "projection", label: "Projection SHA-256"}, {key: "output", label: "Output manifest SHA-256"}],
|
|
341
|
+
rows: evidence.map(item => ({probe: typeof item.probe === "string" ? item.probe : text(record(item.probe).id), projection: text(item.projectionSha256), output: text(item.outputManifestHash, "not recorded")}))}),
|
|
342
|
+
rows(form.evidence).length > evidence.length ? ui.notice("Evidence references shortened to the first sixteen; inspect the full round with the CLI.", "warn") : null));
|
|
343
|
+
}
|
|
344
|
+
if (rows(transitions.contrasts).length > contrasts.length) sections.push(ui.notice(`${rows(transitions.contrasts).length - contrasts.length} more contrasts; inspect ares harness show --json for the complete round.`, "warn"));
|
|
345
|
+
const composition = record(transitions.composition), compositionForm = record(composition.form), edits = rows(compositionForm.sections).slice(0, 32);
|
|
346
|
+
if (transitions.composition) sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: `Recorded per-section edit-to-evidence ${text(compositionForm.id)}`}),
|
|
347
|
+
h("p", {text: `Composed successor SHA-256: ${text(compositionForm.successorSha256, "none recorded")}`}),
|
|
348
|
+
h("p", {class: "ares-sub", text: recorded(composition)}),
|
|
349
|
+
ui.table({caption: "Recorded composition decisions", columns: [{key: "section", label: "Section"}, {key: "decision", label: "Recorded decision"}, {key: "contrasts", label: "Contrast ids / hashes"}, {key: "reason", label: "Reason"}],
|
|
350
|
+
rows: edits.map(edit => ({section: text(edit.section), decision: text(edit.decision), contrasts: rows(edit.contrasts).slice(0, 16).map(contrast => `${text(contrast.id)} @ ${text(contrast.sha256)}`).join("; ") || "none recorded", reason: describe(edit.reason)}))}),
|
|
351
|
+
rows(compositionForm.sections).length > edits.length || edits.some(edit => rows(edit.contrasts).length > 16) ? ui.notice("Composition display shortened to bounded sections or contrast references.", "warn") : null));
|
|
352
|
+
else sections.push(ui.empty("No recorded composition"));
|
|
353
|
+
const adoption = record(transitions.adoption), adoptionForm = record(adoption.form), independent = record(adoptionForm.independentCheck), checkSource = record(independent.source);
|
|
354
|
+
if (transitions.adoption) sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: `Recorded adoption ${text(adoptionForm.id)}`}),
|
|
355
|
+
h("p", {text: `${text(adoptionForm.decision)} | arm ${text(adoptionForm.arm)} | ${describe(adoptionForm.reason)}`}), h("p", {class: "ares-sub", text: recorded(adoption)}),
|
|
356
|
+
ui.chip(`Independent check state: ${text(independent.state, "unavailable")}`, "neutral"), h("p", {text: `Independent check source kind: ${text(checkSource.kind, "unavailable")}`}),
|
|
357
|
+
ui.notice("Judgment basis and independent-check source/status are separate. Synthetic fixture references do not promote a check into verified correctness or transfer evidence.", "neutral"),
|
|
358
|
+
ui.table({caption: "Recorded adoption probe references", columns: [{key: "probe", label: "Declared probe"}, {key: "projection", label: "Projection SHA-256"}, {key: "output", label: "Output manifest SHA-256"}], rows: rows(adoptionForm.checks).slice(0, 16).map(ref => ({probe: text(ref.probe), projection: text(ref.projectionSha256), output: text(ref.outputManifestHash, "not recorded")}))}),
|
|
359
|
+
rows(adoptionForm.checks).length > 16 ? ui.notice("Adoption probe references shortened to sixteen records.", "warn") : null,
|
|
360
|
+
ui.table({caption: "Recorded independent-check source references", columns: [{key: "probe", label: "Probe"}, {key: "projection", label: "Projection SHA-256"}, {key: "output", label: "Output manifest SHA-256"}], rows: rows(checkSource.refs).slice(0, 16).map(ref => ({probe: text(ref.probe), projection: text(ref.projectionSha256), output: text(ref.outputManifestHash, "not recorded")}))}),
|
|
361
|
+
rows(checkSource.refs).length > 16 ? ui.notice("Independent-check references shortened to sixteen records.", "warn") : null));
|
|
362
|
+
const closure = record(transitions.closure), closureForm = record(closure.form);
|
|
363
|
+
if (transitions.closure) sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: `Recorded closure ${text(closureForm.id)}`}),
|
|
364
|
+
ui.chip(closure.current === true ? "current closure" : "stale closure", closure.current === true ? "neutral" : "warn"),
|
|
365
|
+
h("p", {text: `Recorded outcome: ${text(closureForm.outcome)} | ${describe(closureForm.reason)}`}), h("p", {class: "ares-sub", text: recorded(closure)}),
|
|
366
|
+
h("p", {text: `Binding ${text(closure.binding)} | synthetic-fixture | matched: false${typeof closureForm.adoptionSha256 === "string" ? ` | adoption SHA-256 ${closureForm.adoptionSha256}` : ""}`}),
|
|
367
|
+
ui.notice("An adopted-experimental closure does not activate guidance or demonstrate correctness or transfer.", "neutral")));
|
|
368
|
+
else sections.push(ui.empty("Round remains open", "No immutable closure is recorded."));
|
|
369
|
+
const history = rows(transitions.closures).slice(0, 16);
|
|
370
|
+
if (history.length) sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: "Recorded closure history"}),
|
|
371
|
+
ui.table({caption: "Immutable closure records", columns: [{key: "id", label: "Closure"}, {key: "outcome", label: "Recorded outcome"}, {key: "currency", label: "Binding state"}, {key: "binding", label: "Binding"}, {key: "record", label: "Recorded hash / actor / time"}], rows: history.map(entry => ({id: text(record(entry.form).id), outcome: text(record(entry.form).outcome), currency: entry.current === true ? "current" : entry.current === false ? "stale" : "not asserted", binding: text(entry.binding), record: recorded(entry)}))})));
|
|
372
|
+
const remainingClosures = (Number.isSafeInteger(transitions.remainingClosures) && transitions.remainingClosures >= 0 ? transitions.remainingClosures : 0) + rows(transitions.closures).length - history.length;
|
|
373
|
+
if (remainingClosures > 0) sections.push(ui.notice(`${remainingClosures} more closure records; displayed history is incomplete. Inspect the complete immutable history with the CLI.`, "warn"));
|
|
374
|
+
const lessons = rows(snapshot.lessonCandidates).filter(row => record(row.proposal).round === definition.id), visibleLessons = lessons.slice(0, 32);
|
|
375
|
+
if (Number(snapshot.remainingLessonCandidates) > 0) sections.push(ui.notice(`${Number(snapshot.remainingLessonCandidates)} more lesson candidates omitted by the bounded snapshot; inspect ares lesson list --json.`, "warn"));
|
|
376
|
+
sections.push(h("h3", {text: "Linked lesson candidates"}));
|
|
377
|
+
if (!lessons.length) sections.push(ui.empty("No stored lesson candidates for this round"));
|
|
378
|
+
for (const lesson of visibleLessons) {
|
|
379
|
+
const proposal = record(lesson.proposal), changes = rows(proposal.change).slice(0, 16), behavior = rows(proposal.behavior).slice(0, 16), disposition = record(lesson.disposition);
|
|
380
|
+
sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: `Lesson ${describe(proposal.name)}`}),
|
|
381
|
+
ui.chip(`Stored disposition: ${text(lesson.state)}`, tone(lesson.state)), ui.chip(lesson.current === true ? "current proposal" : "stale proposal", lesson.current === true ? "neutral" : "warn"),
|
|
382
|
+
ui.notice("synthetic-fixture; not evidence of real agent behavior. Single-task observation; transfer: not-demonstrated. No success or scientific support is inferred.", "warn"),
|
|
383
|
+
h("p", {text: `Kind: ${text(proposal.kind)} | evidence label: ${text(proposal.evidenceLabel)} | stored exportable flag: ${String(lesson.exportable === true)}`}),
|
|
384
|
+
ui.notice(proposal.kind === "no-lesson" ? "No-lesson candidates never export. Stored eligibility is not fresh proof." : "Stored exportability is local eligibility only, not fresh proof. Owner source recheck is required before archive.", "neutral"),
|
|
385
|
+
h("p", {text: "Needs source recheck: true. Stored inspection receipts are not a current privacy check; this panel performs no source checks or activation."}),
|
|
386
|
+
h("p", {text: `Summary: ${describe(proposal.summary)}`}), h("p", {text: `Procedure: ${describe(proposal.procedure)}`}),
|
|
387
|
+
h("p", {text: `Applicability: ${describe(proposal.applicability)}`}), h("p", {text: `Limitations: ${describe(proposal.limitations)}`}),
|
|
388
|
+
h("p", {text: `When not to use: ${describe(proposal.whenNotToUse)}`}), h("p", {text: `Failure: ${describe(proposal.failure)}`}), h("p", {text: `Retry when: ${describe(proposal.retryWhen)}`}),
|
|
389
|
+
h("p", {class: "ares-sub", text: `Proposal SHA-256: ${text(lesson.sha256)} | source closure: ${text(proposal.closureSha256)} | round binding: ${text(proposal.roundBinding)} | source fingerprint: ${text(proposal.sourceFingerprint)} | evidence fingerprint: ${text(lesson.evidenceFingerprint)}`}),
|
|
390
|
+
h("p", {class: "ares-sub", text: recorded(lesson)}),
|
|
391
|
+
ui.table({caption: "Lesson change references", columns: [{key: "kind", label: "Change kind"}, {key: "id", label: "Native id"}, {key: "hash", label: "Recorded SHA-256"}], rows: changes.map(change => ({kind: text(change.kind), id: text(change.id), hash: text(change.sha256)}))}),
|
|
392
|
+
ui.table({caption: "Lesson behavior references", columns: [{key: "probe", label: "Declared probe"}, {key: "projection", label: "Projection SHA-256"}, {key: "output", label: "Output manifest SHA-256"}], rows: behavior.map(ref => ({probe: text(ref.probe), projection: text(ref.projectionSha256), output: text(ref.outputManifestHash, "not recorded")}))}),
|
|
393
|
+
rows(proposal.change).length > changes.length || rows(proposal.behavior).length > behavior.length ? ui.notice("Lesson reference display incomplete; inspect the stored candidate with the CLI.", "warn") : null,
|
|
394
|
+
skillInspections(proposal.inspections, "Stored lesson inspections"),
|
|
395
|
+
lesson.disposition ? h("p", {text: `Recorded decision: ${text(disposition.decision)} | reason: ${describe(disposition.reason)} | strength acknowledged: ${describe(disposition.acknowledgeStrength)} | ${recorded(disposition)} | evidence fingerprint: ${text(disposition.evidenceFingerprint)}`}) : null));
|
|
396
|
+
}
|
|
397
|
+
if (lessons.length > visibleLessons.length) sections.push(ui.notice(`${lessons.length - visibleLessons.length} more lesson candidates; display incomplete.`, "warn"));
|
|
398
|
+
const successor = record(transitions.successor);
|
|
399
|
+
if (transitions.successor) sections.push(h("section", {class: "ares-card ares-identifiers"}, h("h3", {text: "Successor guidance"}),
|
|
400
|
+
h("p", {text: `SHA-256 ${text(successor.guidanceSha256)} | ${text(successor.execution)}${typeof successor.probeId === "string" ? ` | probe ${successor.probeId}` : ""}`}),
|
|
401
|
+
ui.notice(successor.execution === "unexecuted" ? "Successor guidance is unexecuted and untested." : "Successor guidance remains untested: a fixture declaration is not live execution or an independent correctness check.", "warn")));
|
|
402
|
+
}
|
|
403
|
+
return sections;
|
|
404
|
+
};
|
|
143
405
|
const render = (snapshot) => {
|
|
144
406
|
if (destroyed || !visible || snapshot.changed === false) return;
|
|
145
407
|
last = { key: viewKey(), snapshot };
|
|
146
|
-
const body = snapshot.error && panel !== "study" ? [ui.notice(String(snapshot.error), "err")]
|
|
408
|
+
const body = panel === "harness" ? harnessView(snapshot) : panel === "lineage" ? lineageView(snapshot) : panel === "compare" ? compareView(snapshot) : snapshot.error && panel !== "study" ? [ui.notice(String(snapshot.error), "err")]
|
|
147
409
|
: panel === "studies" ? studies(snapshot) : panel === "study" ? studyView(snapshot) : [ui.empty("Unknown research panel", "Choose Studies from the console.")];
|
|
148
410
|
root.replaceChildren(...body.filter(Boolean));
|
|
149
411
|
};
|