@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.
Files changed (78) hide show
  1. package/CHANGELOG.md +137 -0
  2. package/README.md +356 -31
  3. package/package.json +4 -2
  4. package/src/autonomy.ts +50 -0
  5. package/src/cli.ts +134 -14
  6. package/src/commands-table.ts +43 -9
  7. package/src/commands.ts +244 -43
  8. package/src/copilot.ts +91 -0
  9. package/src/exp/attempts.ts +512 -69
  10. package/src/exp/executor.ts +235 -12
  11. package/src/exp/final.ts +1 -1
  12. package/src/exp/investigate.ts +7 -2
  13. package/src/exp/logs.ts +25 -12
  14. package/src/exp/metrics.ts +6 -5
  15. package/src/exp/pipeline.ts +92 -0
  16. package/src/exp/protocol.ts +88 -18
  17. package/src/exp/retention-script.ts +649 -0
  18. package/src/exp/retention.ts +70 -0
  19. package/src/exp/reuse-admission.ts +63 -0
  20. package/src/exp/reuse-contract.ts +48 -0
  21. package/src/exp/reuse-runtime.ts +87 -0
  22. package/src/exp/reuse.ts +87 -0
  23. package/src/exp/selection.ts +1 -1
  24. package/src/exp/snapshot.ts +3 -3
  25. package/src/exp/stages.ts +117 -0
  26. package/src/harness/experience-source.ts +34 -0
  27. package/src/harness/experience.ts +206 -0
  28. package/src/harness/hub-guidance.ts +140 -0
  29. package/src/harness/hub-reference.ts +18 -0
  30. package/src/harness/lesson-candidates.ts +162 -0
  31. package/src/harness/limits.ts +2 -0
  32. package/src/harness/privacy.ts +4 -0
  33. package/src/harness/receipts.ts +84 -0
  34. package/src/harness/rounds.ts +198 -0
  35. package/src/harness/transitions.ts +152 -0
  36. package/src/http.ts +46 -2
  37. package/src/lit/candidates.ts +13 -5
  38. package/src/lit/cards.ts +55 -4
  39. package/src/lit/flow.ts +82 -0
  40. package/src/lit/queries.ts +62 -0
  41. package/src/lit/watch.ts +14 -1
  42. package/src/manifest.ts +15 -7
  43. package/src/mcp-tools.ts +140 -32
  44. package/src/mcp.ts +6 -0
  45. package/src/memory/amem-show.ts +135 -0
  46. package/src/memory/amem.ts +3 -0
  47. package/src/memory/archive.ts +20 -8
  48. package/src/memory/evidence-local.ts +77 -0
  49. package/src/memory/evidence.ts +39 -0
  50. package/src/memory/lessons.ts +4 -2
  51. package/src/memory/skill-check.ts +56 -0
  52. package/src/memory/skill-format.ts +77 -0
  53. package/src/memory/skills.ts +72 -26
  54. package/src/memory/source-budget.ts +11 -0
  55. package/src/memory/vault-cards.ts +226 -0
  56. package/src/paper/build.ts +20 -8
  57. package/src/paper/check.ts +40 -12
  58. package/src/paper/headings.ts +39 -0
  59. package/src/paper/hygiene.ts +153 -0
  60. package/src/paper/placeholders.ts +21 -4
  61. package/src/paper/plan.ts +170 -0
  62. package/src/paper/point-evidence.ts +63 -0
  63. package/src/paper/points.ts +83 -0
  64. package/src/paper/review.ts +116 -11
  65. package/src/paper/scopes.ts +51 -0
  66. package/src/plan/controller.ts +42 -12
  67. package/src/plan/definition.ts +22 -6
  68. package/src/plan/hub.ts +6 -0
  69. package/src/plan/state.ts +58 -17
  70. package/src/playbook.ts +47 -20
  71. package/src/privacy.ts +9 -0
  72. package/src/provenance.ts +679 -0
  73. package/src/scope.ts +24 -3
  74. package/src/study-export.ts +282 -0
  75. package/src/study.ts +94 -26
  76. package/src/ui/panel.css +4 -0
  77. package/src/ui/panel.js +271 -9
  78. package/src/ui/plugin.ts +89 -17
package/src/lit/cards.ts CHANGED
@@ -1,12 +1,22 @@
1
+ import { lstatSync, type Stats } from "node:fs";
1
2
  import { join } from "node:path";
2
- import { boundedText, onlyKeys, plain, sha256 } from "../study.ts";
3
+ import { boundedText, onlyKeys, plain, readTextBounded, sha256 } from "../study.ts";
3
4
 
4
- export interface Card { summary: string; claims: string[]; methods?: string; findings?: string; limitations?: string; relevance?: string }
5
- const OPTIONAL = ["methods", "findings", "limitations", "relevance"] as const;
5
+ export interface Card { summary: string; claims: string[]; methods?: string; findings?: string; limitations?: string; relevance?: string; datasets?: string; results?: string; motivation?: string }
6
+ const OPTIONAL = ["methods", "findings", "limitations", "relevance", "datasets", "results", "motivation"] as const;
7
+ export const CARD_FIELDS = ["summary", "claims", ...OPTIONAL] as const;
8
+ export const CARD_BYTES = 65_536;
6
9
 
10
+ /** Who extracted a card, carried with it when it travels through the vault. */
11
+ export interface CardProvenance { studySha256: string; extractedAt: string; extractor: { kind: "person" | "agent" | "auto"; modelFamily?: string } }
12
+ /** Stored only by `lit card import`: a planning aid copied from a vault note, never verification, screening or support evidence. */
13
+ export interface CardReuse { from: "vault"; vault: string; note: string; at: string; provenance: CardProvenance }
14
+ export interface StoredCard extends Card { id: string; reused?: CardReuse }
15
+
16
+ /** User card input: the original closed field set plus the optional datasets/results/motivation. `reused` is never accepted here. */
7
17
  export function validateCard(raw: unknown): Card {
8
18
  if (!plain(raw)) throw new Error("card: JSON object required");
9
- onlyKeys(raw, ["summary", "claims", ...OPTIONAL], "card");
19
+ onlyKeys(raw, CARD_FIELDS, "card");
10
20
  const claims = raw.claims ?? [];
11
21
  if (!Array.isArray(claims) || claims.length > 50) throw new Error("card.claims: list of at most 50");
12
22
  const card: Card = { summary: boundedText(raw.summary, "card.summary", 4000), claims: claims.map((c, i) => boundedText(c, `card.claims[${i}]`, 1000)) };
@@ -14,6 +24,47 @@ export function validateCard(raw: unknown): Card {
14
24
  return card;
15
25
  }
16
26
 
27
+ const HEX64 = /^[a-f0-9]{64}$/, FAMILY = /^[a-z0-9][a-z0-9 ._-]{0,47}$/;
28
+ export function validateProvenance(raw: unknown, what: string): CardProvenance {
29
+ if (!plain(raw)) throw new Error(`${what}: object required`);
30
+ onlyKeys(raw, ["studySha256", "extractedAt", "extractor"], what);
31
+ if (typeof raw.studySha256 !== "string" || !HEX64.test(raw.studySha256)) throw new Error(`${what}.studySha256: 64-hex study hash required`);
32
+ if (typeof raw.extractedAt !== "string" || !Number.isFinite(Date.parse(raw.extractedAt))) throw new Error(`${what}.extractedAt: ISO time required`);
33
+ if (!plain(raw.extractor)) throw new Error(`${what}.extractor: object required`);
34
+ onlyKeys(raw.extractor, ["kind", "modelFamily"], `${what}.extractor`);
35
+ const kind = raw.extractor.kind;
36
+ if (kind !== "person" && kind !== "agent" && kind !== "auto") throw new Error(`${what}.extractor.kind: person, agent or auto`);
37
+ const family = raw.extractor.modelFamily;
38
+ if (family !== undefined && (typeof family !== "string" || !FAMILY.test(family))) throw new Error(`${what}.extractor.modelFamily: lower-case label of at most 48 characters`);
39
+ return { studySha256: raw.studySha256, extractedAt: raw.extractedAt, extractor: { kind, ...(family !== undefined ? { modelFamily: family as string } : {}) } };
40
+ }
41
+
42
+ /** A stored card file: the user fields plus id and, for imported cards, the reuse record. */
43
+ export function readCard(dir: string, id: string): StoredCard | undefined {
44
+ const path = cardPath(dir, id), where = join("literature", "cards");
45
+ const notRegular = () => new Error(`card ${id}: ${where} holds a link or special file; a card must be a regular physical file, so remove the link and restore the card from the ledger's lit.card hash or record the card again`);
46
+ let stat: Stats;
47
+ try { stat = lstatSync(path); }
48
+ catch (error) { if ((error as NodeJS.ErrnoException).code === "ENOENT") return undefined; throw new Error(`card ${id}: unreadable card path; restore ${where} from the ledger's lit.card hash or record the card again`); }
49
+ if (!stat.isFile() || stat.isSymbolicLink()) throw notRegular();
50
+ let raw: unknown;
51
+ try { raw = JSON.parse(readTextBounded(path, CARD_BYTES, {noFollow: true})); }
52
+ catch (error) {
53
+ if ((error as NodeJS.ErrnoException).code === "ELOOP") throw notRegular();
54
+ throw new Error(`card ${id}: unreadable, invalid JSON or larger than 64 KiB; restore ${where} from the ledger's lit.card hash or record the card again`);
55
+ }
56
+ if (!plain(raw) || raw.id !== id) throw new Error(`card ${id}: malformed or belongs to another candidate; record the card again with ares lit card`);
57
+ const { id: _id, reused, ...fields } = raw;
58
+ const card: StoredCard = { id, ...validateCard(fields) };
59
+ if (reused !== undefined) {
60
+ if (!plain(reused)) throw new Error(`card ${id}.reused: object required`);
61
+ onlyKeys(reused, ["from", "vault", "note", "at", "provenance"], `card ${id}.reused`);
62
+ if (reused.from !== "vault" || typeof reused.vault !== "string" || typeof reused.note !== "string" || typeof reused.at !== "string") throw new Error(`card ${id}.reused: from, vault, note and at required; re-import the card`);
63
+ card.reused = { from: "vault", vault: boundedText(reused.vault, "reused.vault", 64), note: boundedText(reused.note, "reused.note", 200), at: reused.at, provenance: validateProvenance(reused.provenance, `card ${id}.reused.provenance`) };
64
+ }
65
+ return card;
66
+ }
67
+
17
68
  /** A readable, collision-free file name for a candidate id such as `doi:10.1/x`. */
18
69
  export function cardPath(dir: string, id: string): string {
19
70
  const readable = id.toLowerCase().replace(/[^a-z0-9.-]+/g, "_").slice(0, 80);
@@ -0,0 +1,82 @@
1
+ import { existsSync } from "node:fs";
2
+ import { candidatesPath, includedHash, isVerified, loadCandidates, type Candidate } from "./candidates.ts";
3
+ import { cardPath } from "./cards.ts";
4
+ import { readScope } from "../scope.ts";
5
+ import { gateState, openStudy, readLedger, type LedgerEvent } from "../study.ts";
6
+
7
+ /** Fields available as {{n:lit.flow.<field>}}; excluded.<code> is added per declared code plus "uncoded". */
8
+ export const FLOW_FIELDS = ["records", "duplicates", "unique", "screened", "excluded", "unscreened", "included", "verified", "cards"] as const;
9
+ export type FlowField = typeof FLOW_FIELDS[number];
10
+ const count = (value: unknown) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : 0;
11
+
12
+ /** Derived only from the ledger, the candidate file, scope.json and card existence; no new state. */
13
+ export function flowFrom(dir: string, events: LedgerEvent[], candidates: Candidate[]) {
14
+ const searches = events.filter(e => e.type === "lit.search"), scope = readScope(dir);
15
+ const bySource: Record<string, { searches: number; ok: number; records: number }> = {};
16
+ let records = 0, duplicates = 0, dropped = 0;
17
+ const yearFrom = new Set<number>();
18
+ for (const e of searches) {
19
+ for (const s of Array.isArray(e.data.sources) ? e.data.sources as { source?: unknown; ok?: unknown; returned?: unknown }[] : []) {
20
+ const name = typeof s.source === "string" ? s.source : "unknown", row = bySource[name] ??= { searches: 0, ok: 0, records: 0 };
21
+ row.searches++; if (s.ok === true) row.ok++; row.records += count(s.returned); records += count(s.returned);
22
+ }
23
+ // A bridging record that folds an earlier candidate away removes one more duplicate than its single merge.
24
+ duplicates += count(e.data.merged) + count(e.data.absorbed); dropped += count(e.data.dropped);
25
+ if (typeof e.data.yearFrom === "number") yearFrom.add(e.data.yearFrom);
26
+ }
27
+ const included = candidates.filter(c => c.status === "included"), excluded = candidates.filter(c => c.status === "excluded");
28
+ const codes = scope?.exclusionCodes ?? [];
29
+ // Without declared codes every exclusion is one "uncoded" group; a code no longer declared still counts under its name.
30
+ const excludedByCode: Record<string, number> = Object.fromEntries([...codes.map(c => [c.code, 0] as [string, number]), ["uncoded", 0]]);
31
+ for (const c of excluded) { const key = c.exclusionCode ?? "uncoded"; excludedByCode[key] = (excludedByCode[key] ?? 0) + 1; }
32
+ return {
33
+ window: { firstSearch: searches[0]?.at ?? null, lastSearch: searches.at(-1)?.at ?? null, searches: searches.length, yearFrom: [...yearFrom].sort((a, b) => a - b), scopeYearFrom: scope?.yearFrom ?? null, scopeYearTo: scope?.yearTo ?? null },
34
+ sources: bySource,
35
+ records, duplicates, dropped, unique: candidates.length,
36
+ screened: included.length + excluded.length, excluded: excluded.length, excludedByCode,
37
+ exclusionCodes: codes, unscreened: candidates.length - included.length - excluded.length,
38
+ included: included.length, verified: included.filter(isVerified).length,
39
+ cards: included.filter(c => existsSync(cardPath(dir, c.id))).length,
40
+ };
41
+ }
42
+ export type Flow = ReturnType<typeof flowFrom>;
43
+
44
+ /** The screen gate binds the included set; flow numbers are citable only while it is approved for the current set. */
45
+ export function screenApproved(events: LedgerEvent[], candidates: Candidate[]): boolean {
46
+ return gateState("screen", events, gate => gate === "screen" ? includedHash(candidates) : undefined).state === "approved";
47
+ }
48
+
49
+ export function litFlow(dirArg: string) {
50
+ const { dir } = openStudy(dirArg), events = readLedger(dir), candidates = loadCandidates(dir);
51
+ return { ...flowFrom(dir, events, candidates), screenApproved: screenApproved(events, candidates) };
52
+ }
53
+
54
+ /** Value for a lit.flow.* ref, or undefined for an unknown field. */
55
+ export function flowValue(flow: Flow, field: string): number | undefined {
56
+ if ((FLOW_FIELDS as readonly string[]).includes(field)) return flow[field as FlowField];
57
+ const match = /^excluded\.([a-z][a-z0-9-]{0,31})$/.exec(field);
58
+ return match && Object.hasOwn(flow.excludedByCode, match[1]!) ? flow.excludedByCode[match[1]!] : undefined;
59
+ }
60
+
61
+ /** A pasteable Markdown table whose every number is a {{n:lit.flow.*}} placeholder; labels hold no digits. */
62
+ export function flowMarkdown(dirArg: string): string {
63
+ const { dir } = openStudy(dirArg), flow = flowFrom(dir, readLedger(dir), loadCandidates(dir));
64
+ const n = (field: string) => `{{n:lit.flow.${field}}}`;
65
+ const label = (text: string) => /\p{Nd}/u.test(text) ? `{{lit:${text}}}` : text;
66
+ const rows: [string, string][] = [
67
+ ["Records retrieved from all sources", n("records")],
68
+ ["Duplicates merged", n("duplicates")],
69
+ ["Unique records", n("unique")],
70
+ ["Records screened", n("screened")],
71
+ ["Records excluded", n("excluded")],
72
+ ...flow.exclusionCodes.map(c => [`Excluded: ${label(c.label)}`, n(`excluded.${c.code}`)] as [string, string]),
73
+ ...(flow.exclusionCodes.length && flow.excludedByCode.uncoded ? [["Excluded without a code", n("excluded.uncoded")] as [string, string]] : []),
74
+ ["Records not yet screened", n("unscreened")],
75
+ ["Studies included", n("included")],
76
+ ["Included with verified identifiers", n("verified")],
77
+ ["Included with extraction cards", n("cards")],
78
+ ];
79
+ return ["| Stage | Count |", "| --- | --- |", ...rows.map(([stage, value]) => `| ${stage} | ${value} |`)].join("\n") + "\n";
80
+ }
81
+
82
+ export function flowSourceFile(dir: string): string { return candidatesPath(dir); }
@@ -0,0 +1,62 @@
1
+ import { loadCandidates } from "./candidates.ts";
2
+ import { openStudy, readLedger, type LedgerEvent } from "../study.ts";
3
+
4
+ /** Query intents (#103). ares records them; it never generates or ranks queries. */
5
+ export const QUERY_INTENTS = ["lexical", "semantic", "background"] as const;
6
+ export type QueryIntent = typeof QUERY_INTENTS[number];
7
+ export type IntentLabel = QueryIntent | "unspecified";
8
+
9
+ export function validateIntent(raw: unknown, field = "--intent"): QueryIntent {
10
+ if (typeof raw !== "string" || !(QUERY_INTENTS as readonly string[]).includes(raw)) throw new Error(`${field}: unknown query intent; use ${QUERY_INTENTS.join(", ")} or omit it`);
11
+ return raw as QueryIntent;
12
+ }
13
+ /** Ledger events carry no id; a search is named by its 1-based ordinal among lit.search events in the append-only ledger. */
14
+ export function searchId(ordinal: number): string { return `search-${ordinal}`; }
15
+ export function nextSearchId(events: LedgerEvent[]): string { return searchId(events.filter(e => e.type === "lit.search").length + 1); }
16
+ /** Old or hand-edited events read as unspecified rather than failing the report. */
17
+ export function intentOf(event: LedgerEvent): IntentLabel {
18
+ const value = event.data.intent;
19
+ return typeof value === "string" && (QUERY_INTENTS as readonly string[]).includes(value) ? value as QueryIntent : "unspecified";
20
+ }
21
+
22
+ interface Yield { included: number; excluded: number; new: number }
23
+ const LABELS: IntentLabel[] = [...QUERY_INTENTS, "unspecified"];
24
+ const count = (value: unknown) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : 0;
25
+
26
+ /** Per-intent counts only, for the content-free export bundle. */
27
+ export function intentSummary(events: LedgerEvent[], candidates: { firstQuery?: string; status: string }[]) {
28
+ return queryReport(events, candidates).byIntent;
29
+ }
30
+
31
+ function queryReport(events: LedgerEvent[], candidates: { firstQuery?: string; status: string }[]) {
32
+ const yields = new Map<string, Yield>();
33
+ let unattributed = 0;
34
+ for (const c of candidates) {
35
+ if (!c.firstQuery) { unattributed++; continue; }
36
+ const row = yields.get(c.firstQuery) ?? { included: 0, excluded: 0, new: 0 };
37
+ if (c.status === "included") row.included++; else if (c.status === "excluded") row.excluded++; else row.new++;
38
+ yields.set(c.firstQuery, row);
39
+ }
40
+ const rows = events.filter(e => e.type === "lit.search").map((e, index) => {
41
+ const id = searchId(index + 1), y = yields.get(id) ?? { included: 0, excluded: 0, new: 0 };
42
+ const sources = Array.isArray(e.data.sources) ? (e.data.sources as { source?: unknown; ok?: unknown }[]).map(s => ({ source: typeof s.source === "string" ? s.source : "unknown", ok: s.ok === true })) : [];
43
+ return { id, at: e.at, query: typeof e.data.query === "string" ? e.data.query : "", intent: intentOf(e), sources, added: count(e.data.added), merged: count(e.data.merged), ...y };
44
+ });
45
+ const byIntent = Object.fromEntries(LABELS.map(label => [label, { queries: 0, added: 0, merged: 0, included: 0, excluded: 0, new: 0 }])) as Record<IntentLabel, { queries: number; added: number; merged: number } & Yield>;
46
+ for (const row of rows) {
47
+ const s = byIntent[row.intent];
48
+ s.queries++; s.added += row.added; s.merged += row.merged; s.included += row.included; s.excluded += row.excluded; s.new += row.new;
49
+ }
50
+ return { rows, byIntent, unattributed };
51
+ }
52
+
53
+ /** Read-only per-query yield: what each search first added and how that screened out. */
54
+ export function litQueries(dirArg: string) {
55
+ const { dir } = openStudy(dirArg), report = queryReport(readLedger(dir), loadCandidates(dir));
56
+ return {
57
+ queries: report.rows, byIntent: report.byIntent,
58
+ zeroIncluded: report.rows.filter(row => row.included === 0).map(row => ({ id: row.id, intent: row.intent, added: row.added })),
59
+ // Candidates created before #103 (or by older ares) have no firstQuery and cannot be attributed to one search.
60
+ unattributed: report.unattributed,
61
+ };
62
+ }
package/src/lit/watch.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { HttpError } from "../http.ts";
1
2
  import { join } from "node:path";
2
3
  import { assertWritable, boundedText, commit, onlyKeys, openStudy, plain, readLedger, readBytesBounded, sha256, type Actor } from "../study.ts";
3
4
  import { loadCandidates } from "./candidates.ts";
@@ -10,7 +11,8 @@ export interface WatchSnapshot { config: WatchConfig; sha256: string }
10
11
  export interface SearchResult { added: number; merged: number; dropped: number; linked: number; sources: { source: SourceName; ok: boolean; returned: number; error?: string }[] }
11
12
  export interface WatchError { host: string; status: number | null }
12
13
  export interface WatchQueryResult { id: string; added: number; merged: number; dropped: number; linked: number; sources: { source: SourceName; ok: boolean; returned: number }[]; errors: WatchError[] }
13
- export interface WatchRun { configSha256: string; queries: WatchQueryResult[]; added: number; addedIds: string[]; addedIdsTotal: number; ok: boolean }
14
+ export type WatchFailureClass = "terminated" | "filesystem" | "network" | "rate" | "server" | "client" | "format" | "internal";
15
+ export interface WatchRun { cause?: WatchFailureClass; configSha256: string; queries: WatchQueryResult[]; added: number; addedIds: string[]; addedIdsTotal: number; ok: boolean }
14
16
  const HOSTS: Record<SourceName, string> = { openalex: "api.openalex.org", s2: "api.semanticscholar.org", arxiv: "export.arxiv.org" };
15
17
  class WatchInputError extends Error {}
16
18
  class WatchVersionError extends WatchInputError {}
@@ -80,6 +82,17 @@ function sourceErrors(sources: SearchResult["sources"]): WatchError[] {
80
82
  return { host, status: match?.[1] === undefined ? null : Number(match[1]) };
81
83
  });
82
84
  }
85
+ /** A closed vocabulary only: thrown messages can contain request URLs, keys or response bodies. */
86
+ export function watchFailureClass(error: unknown): WatchFailureClass {
87
+ if (error instanceof HttpError) return error.kind;
88
+ const code = error && typeof error === "object" && "code" in error ? error.code : undefined;
89
+ return ["ENOENT", "EACCES", "EPERM", "ENOSPC", "EIO", "EROFS", "ENOTDIR", "EISDIR"].includes(String(code)) ? "filesystem" : "internal";
90
+ }
91
+ /** Caller still holds the study lock; no partial query details or diagnostic text are copied. */
92
+ export function recordWatchFailure(dir: string, snapshot: WatchSnapshot, actor: Actor, cause: WatchFailureClass): void {
93
+ const run: WatchRun = { configSha256: snapshot.sha256, queries: [], added: 0, addedIds: [], addedIdsTotal: 0, ok: false, cause };
94
+ commit(dir, [], [{ actor, type: "watch.ran", data: { ...run } }]);
95
+ }
83
96
  /** One finite pass, using the caller's existing locked lit-search operation. No timer or screening. */
84
97
  export async function runWatch(dir: string, snapshot: WatchSnapshot, actor: Actor, search: (query: WatchQuery) => Promise<SearchResult>): Promise<WatchRun> {
85
98
  const { config } = snapshot;
package/src/manifest.ts CHANGED
@@ -5,25 +5,33 @@ import { ARES_TOOLS } from "./mcp-tools.ts";
5
5
  /** Implemented family-readable records only; private inputs and future integrations are not contracts. */
6
6
  export const FORMAT_VERSIONS = {
7
7
  manifest: 1,
8
- study: 1,
9
- paperEvidence: 1,
10
- skillProposal: 1,
8
+ harnessRound: 1,
9
+ lessonProposal: 1,
10
+ harnessTransition: 1,
11
+ harnessStream: 1,
12
+ harnessExperience: 1,
13
+ harnessFixtureProjection: 1,
14
+ study: 2,
15
+ paperEvidence: 2,
16
+ paperPlan: 2,
17
+ skillProposal: 2,
11
18
  studyRegistry: 1,
12
19
  watchConfig: 1,
13
20
  studyPlan: 1,
14
21
  ledgerEvent: 1,
15
- experimentProtocol: 1,
22
+ experimentProtocol: 2,
16
23
  experimentSelection: 1,
17
24
  experimentFinalSeeds: 1,
18
25
  ablateResult: 1,
19
26
  finalResult: 1,
20
27
  investigateResult: 1,
21
28
  executor: 1,
22
- experimentAttempt: 1,
29
+ experimentAttempt: 3,
30
+ studyBundle: 1,
23
31
  } as const;
24
- export const MEMORY_LEDGER_EVENTS = ["archive.exported", "skill.proposed", "skill.decided"] as const;
32
+ export const MEMORY_LEDGER_EVENTS = ["archive.exported", "skill.proposed", "skill.decided", "lesson.proposed", "lesson.decided"] as const;
25
33
  export const WATCH_LEDGER_EVENTS = ["watch.set", "watch.ran"] as const;
26
- export const LEDGER_EVENTS = [...MEMORY_LEDGER_EVENTS, ...WATCH_LEDGER_EVENTS] as const;
34
+ export const LEDGER_EVENTS = [...MEMORY_LEDGER_EVENTS, ...WATCH_LEDGER_EVENTS, "autonomy.set", "harness.round.set", "harness.probe.declared", "harness.contrast.recorded", "harness.composition.recorded", "harness.adoption.decided", "harness.round.closed", "experience.stream.set", "experience.frozen", "retention.pruned", "attempt.pipeline.code", "attempt.pipeline.inputs", "attempt.stage.terminated", "attempt.reuse.preflight", "attempt.reuse.fresh-intent", "attempt.reuse.materialized", "attempt.reuse.miss", "attempt.stage.reused", "paper.plan.set"] as const;
27
35
  export interface Manifest {
28
36
  v: 1;
29
37
  name: "ares";