@mneme-ai/core 2.31.0 → 2.32.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/dist/agent_manifest.d.ts +1 -1
- package/dist/agent_manifest.d.ts.map +1 -1
- package/dist/agent_manifest.js +9 -0
- package/dist/agent_manifest.js.map +1 -1
- package/dist/flywheel/controller.d.ts +51 -0
- package/dist/flywheel/controller.d.ts.map +1 -0
- package/dist/flywheel/controller.js +186 -0
- package/dist/flywheel/controller.js.map +1 -0
- package/dist/flywheel/flywheel.test.d.ts +2 -0
- package/dist/flywheel/flywheel.test.d.ts.map +1 -0
- package/dist/flywheel/flywheel.test.js +264 -0
- package/dist/flywheel/flywheel.test.js.map +1 -0
- package/dist/flywheel/fuse.d.ts +16 -0
- package/dist/flywheel/fuse.d.ts.map +1 -0
- package/dist/flywheel/fuse.js +132 -0
- package/dist/flywheel/fuse.js.map +1 -0
- package/dist/flywheel/harvest.d.ts +31 -0
- package/dist/flywheel/harvest.d.ts.map +1 -0
- package/dist/flywheel/harvest.js +286 -0
- package/dist/flywheel/harvest.js.map +1 -0
- package/dist/flywheel/index.d.ts +26 -0
- package/dist/flywheel/index.d.ts.map +1 -0
- package/dist/flywheel/index.js +19 -0
- package/dist/flywheel/index.js.map +1 -0
- package/dist/flywheel/liveness.d.ts +34 -0
- package/dist/flywheel/liveness.d.ts.map +1 -0
- package/dist/flywheel/liveness.js +63 -0
- package/dist/flywheel/liveness.js.map +1 -0
- package/dist/flywheel/personal_cheatsheet.d.ts +34 -0
- package/dist/flywheel/personal_cheatsheet.d.ts.map +1 -0
- package/dist/flywheel/personal_cheatsheet.js +95 -0
- package/dist/flywheel/personal_cheatsheet.js.map +1 -0
- package/dist/flywheel/prescribe.d.ts +20 -0
- package/dist/flywheel/prescribe.d.ts.map +1 -0
- package/dist/flywheel/prescribe.js +119 -0
- package/dist/flywheel/prescribe.js.map +1 -0
- package/dist/flywheel/reciprocity.d.ts +36 -0
- package/dist/flywheel/reciprocity.d.ts.map +1 -0
- package/dist/flywheel/reciprocity.js +113 -0
- package/dist/flywheel/reciprocity.js.map +1 -0
- package/dist/flywheel/types.d.ts +117 -0
- package/dist/flywheel/types.d.ts.map +1 -0
- package/dist/flywheel/types.js +25 -0
- package/dist/flywheel/types.js.map +1 -0
- package/dist/flywheel/vendor_bulletin.d.ts +44 -0
- package/dist/flywheel/vendor_bulletin.d.ts.map +1 -0
- package/dist/flywheel/vendor_bulletin.js +118 -0
- package/dist/flywheel/vendor_bulletin.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/truth_gate/claims.d.ts.map +1 -1
- package/dist/truth_gate/claims.js +10 -0
- package/dist/truth_gate/claims.js.map +1 -1
- package/dist/truth_gate/probes.d.ts.map +1 -1
- package/dist/truth_gate/probes.js +30 -0
- package/dist/truth_gate/probes.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — Personal cheatsheet engine.
|
|
3
|
+
*
|
|
4
|
+
* Reads .mneme/flywheel/cmd_history.jsonl, counts invocations per
|
|
5
|
+
* command, returns top-3 along with a header explaining that the
|
|
6
|
+
* cheatsheet *shrinks* over time as the user specializes.
|
|
7
|
+
*
|
|
8
|
+
* Fresh-install fallback: if < 5 history rows, return the global
|
|
9
|
+
* recommended top-5 — the highest-leverage commands for new users.
|
|
10
|
+
*/
|
|
11
|
+
interface CmdHistoryRow {
|
|
12
|
+
command: string;
|
|
13
|
+
at: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function recordCommand(repoRoot: string, command: string): void;
|
|
16
|
+
export declare function readHistory(repoRoot: string, limit?: number): CmdHistoryRow[];
|
|
17
|
+
export interface CheatsheetEntry {
|
|
18
|
+
command: string;
|
|
19
|
+
why: string;
|
|
20
|
+
invocations?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface CheatsheetSnapshot {
|
|
23
|
+
entries: CheatsheetEntry[];
|
|
24
|
+
/** "personalized" | "fresh_install" */
|
|
25
|
+
mode: "personalized" | "fresh_install";
|
|
26
|
+
/** ISO of latest row used. */
|
|
27
|
+
basedOn: string | null;
|
|
28
|
+
/** Plain-English explanation for the user. */
|
|
29
|
+
header: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function computeCheatsheet(repoRoot: string): CheatsheetSnapshot;
|
|
32
|
+
export declare function renderCheatsheetMarkdown(snap: CheatsheetSnapshot): string;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=personal_cheatsheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal_cheatsheet.d.ts","sourceRoot":"","sources":["../../src/flywheel/personal_cheatsheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,UAAU,aAAa;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;CAAE;AAYxD,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAIrE;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAO,GAAG,aAAa,EAAE,CAY3E;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,uCAAuC;IACvC,IAAI,EAAE,cAAc,GAAG,eAAe,CAAC;IACvC,8BAA8B;IAC9B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAwBtE;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAazE"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — Personal cheatsheet engine.
|
|
3
|
+
*
|
|
4
|
+
* Reads .mneme/flywheel/cmd_history.jsonl, counts invocations per
|
|
5
|
+
* command, returns top-3 along with a header explaining that the
|
|
6
|
+
* cheatsheet *shrinks* over time as the user specializes.
|
|
7
|
+
*
|
|
8
|
+
* Fresh-install fallback: if < 5 history rows, return the global
|
|
9
|
+
* recommended top-5 — the highest-leverage commands for new users.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, mkdirSync, appendFileSync, readFileSync } from "node:fs";
|
|
12
|
+
import { join } from "node:path";
|
|
13
|
+
const GLOBAL_TOP5 = [
|
|
14
|
+
{ command: "mneme verify \"<claim>\"", why: "Truth-check ANY factual claim before relaying — refuses to hallucinate." },
|
|
15
|
+
{ command: "mneme welcome", why: "Install handoff + what's changed since last session — start here." },
|
|
16
|
+
{ command: "mneme flywheel run", why: "Run the self-reflective audit — closes the 4 loops every release." },
|
|
17
|
+
{ command: "mneme honest_mirror calibrate", why: "Tune vendor trust on YOUR own past commits — eval-aware-defeating." },
|
|
18
|
+
{ command: "mneme rewind run", why: "Track vendor regression on YOUR repo as new model versions ship." },
|
|
19
|
+
];
|
|
20
|
+
function dirOf(repoRoot) {
|
|
21
|
+
const d = join(repoRoot, ".mneme", "flywheel");
|
|
22
|
+
if (!existsSync(d))
|
|
23
|
+
mkdirSync(d, { recursive: true });
|
|
24
|
+
return d;
|
|
25
|
+
}
|
|
26
|
+
function historyPath(repoRoot) {
|
|
27
|
+
return join(dirOf(repoRoot), "cmd_history.jsonl");
|
|
28
|
+
}
|
|
29
|
+
export function recordCommand(repoRoot, command) {
|
|
30
|
+
try {
|
|
31
|
+
appendFileSync(historyPath(repoRoot), JSON.stringify({ command, at: new Date().toISOString() }) + "\n", "utf8");
|
|
32
|
+
}
|
|
33
|
+
catch { /* best-effort */ }
|
|
34
|
+
}
|
|
35
|
+
export function readHistory(repoRoot, limit = 1000) {
|
|
36
|
+
const p = historyPath(repoRoot);
|
|
37
|
+
if (!existsSync(p))
|
|
38
|
+
return [];
|
|
39
|
+
try {
|
|
40
|
+
const body = readFileSync(p, "utf8");
|
|
41
|
+
const lines = body.split("\n").filter(Boolean);
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const ln of lines.slice(-limit)) {
|
|
44
|
+
try {
|
|
45
|
+
out.push(JSON.parse(ln));
|
|
46
|
+
}
|
|
47
|
+
catch { /* skip */ }
|
|
48
|
+
}
|
|
49
|
+
return out;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
export function computeCheatsheet(repoRoot) {
|
|
56
|
+
const history = readHistory(repoRoot, 5000);
|
|
57
|
+
if (history.length < 5) {
|
|
58
|
+
return {
|
|
59
|
+
entries: GLOBAL_TOP5.map((g) => ({ ...g })),
|
|
60
|
+
mode: "fresh_install",
|
|
61
|
+
basedOn: history.length === 0 ? null : history[history.length - 1].at,
|
|
62
|
+
header: "Fresh install — here are the 5 highest-leverage commands. Use Mneme for a few days and the cheatsheet auto-shrinks to YOUR top-3.",
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
// Count invocations per command, keep top-3.
|
|
66
|
+
const counts = new Map();
|
|
67
|
+
for (const row of history)
|
|
68
|
+
counts.set(row.command, (counts.get(row.command) ?? 0) + 1);
|
|
69
|
+
const sorted = Array.from(counts.entries()).sort((a, b) => b[1] - a[1]).slice(0, 3);
|
|
70
|
+
return {
|
|
71
|
+
entries: sorted.map(([command, n]) => ({
|
|
72
|
+
command,
|
|
73
|
+
why: GLOBAL_TOP5.find((g) => command.startsWith(g.command.split(" ")[0]))?.why ?? "Frequently used by you.",
|
|
74
|
+
invocations: n,
|
|
75
|
+
})),
|
|
76
|
+
mode: "personalized",
|
|
77
|
+
basedOn: history[history.length - 1].at,
|
|
78
|
+
header: `Personal cheatsheet: top-3 commands you actually use (from ${history.length} invocations).`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function renderCheatsheetMarkdown(snap) {
|
|
82
|
+
const lines = [];
|
|
83
|
+
lines.push(`# Mneme — Personal Cheatsheet`);
|
|
84
|
+
lines.push(``);
|
|
85
|
+
lines.push(`> ${snap.header}`);
|
|
86
|
+
lines.push(``);
|
|
87
|
+
for (const e of snap.entries) {
|
|
88
|
+
lines.push(`- \`${e.command}\` — ${e.why}${typeof e.invocations === "number" ? ` (${e.invocations}×)` : ""}`);
|
|
89
|
+
}
|
|
90
|
+
lines.push(``);
|
|
91
|
+
lines.push(`---`);
|
|
92
|
+
lines.push(`Mode: ${snap.mode} · basedOn: ${snap.basedOn ?? "(no history yet)"}`);
|
|
93
|
+
return lines.join("\n");
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=personal_cheatsheet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"personal_cheatsheet.js","sourceRoot":"","sources":["../../src/flywheel/personal_cheatsheet.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,WAAW,GAA4C;IAC3D,EAAE,OAAO,EAAE,0BAA0B,EAAE,GAAG,EAAE,yEAAyE,EAAE;IACvH,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,mEAAmE,EAAE;IACtG,EAAE,OAAO,EAAE,oBAAoB,EAAE,GAAG,EAAE,mEAAmE,EAAE;IAC3G,EAAE,OAAO,EAAE,+BAA+B,EAAE,GAAG,EAAE,oEAAoE,EAAE;IACvH,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,kEAAkE,EAAE;CACz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;IAClB,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,eAAe,IAAI,CAAC,OAAO,IAAI,kBAAkB,EAAE,CAAC,CAAC;IAClF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL PRESCRIBE stage.
|
|
3
|
+
*
|
|
4
|
+
* Turns fused findings into 5 action kinds:
|
|
5
|
+
*
|
|
6
|
+
* heal — auto-draft PR to fix a TRUTH GATE drift or marketing
|
|
7
|
+
* claim. Artifact = markdown PR body.
|
|
8
|
+
* wire — auto-draft PR to add CLI/MCP surface for a dormant
|
|
9
|
+
* primitive. Artifact = checklist + concrete file paths.
|
|
10
|
+
* delete — recommend removing a primitive that has NO invocation
|
|
11
|
+
* record AND no cross-source partners (truly unused).
|
|
12
|
+
* shrink — personal cheatsheet shrink to ≤ 3 cmds.
|
|
13
|
+
* publish — Vendor Bulletin .md from REWIND + HGP + HONEST MIRROR.
|
|
14
|
+
*
|
|
15
|
+
* One action can close MULTIPLE findings (cluster bonus). PRESCRIBE
|
|
16
|
+
* groups findings by clusterId then emits one action per cluster.
|
|
17
|
+
*/
|
|
18
|
+
import type { FusedFinding, PrescribedAction } from "./types.js";
|
|
19
|
+
export declare function prescribe(fused: FusedFinding[]): PrescribedAction[];
|
|
20
|
+
//# sourceMappingURL=prescribe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prescribe.d.ts","sourceRoot":"","sources":["../../src/flywheel/prescribe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAc,MAAM,YAAY,CAAC;AAiF7E,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,gBAAgB,EAAE,CAmBnE"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL PRESCRIBE stage.
|
|
3
|
+
*
|
|
4
|
+
* Turns fused findings into 5 action kinds:
|
|
5
|
+
*
|
|
6
|
+
* heal — auto-draft PR to fix a TRUTH GATE drift or marketing
|
|
7
|
+
* claim. Artifact = markdown PR body.
|
|
8
|
+
* wire — auto-draft PR to add CLI/MCP surface for a dormant
|
|
9
|
+
* primitive. Artifact = checklist + concrete file paths.
|
|
10
|
+
* delete — recommend removing a primitive that has NO invocation
|
|
11
|
+
* record AND no cross-source partners (truly unused).
|
|
12
|
+
* shrink — personal cheatsheet shrink to ≤ 3 cmds.
|
|
13
|
+
* publish — Vendor Bulletin .md from REWIND + HGP + HONEST MIRROR.
|
|
14
|
+
*
|
|
15
|
+
* One action can close MULTIPLE findings (cluster bonus). PRESCRIBE
|
|
16
|
+
* groups findings by clusterId then emits one action per cluster.
|
|
17
|
+
*/
|
|
18
|
+
function group(findings) {
|
|
19
|
+
const by = new Map();
|
|
20
|
+
for (const f of findings) {
|
|
21
|
+
const arr = by.get(f.clusterId) ?? [];
|
|
22
|
+
arr.push(f);
|
|
23
|
+
by.set(f.clusterId, arr);
|
|
24
|
+
}
|
|
25
|
+
return Array.from(by.entries()).map(([clusterId, fs]) => ({ clusterId, findings: fs }))
|
|
26
|
+
.sort((a, b) => Math.max(...b.findings.map((f) => f.compositeScore)) - Math.max(...a.findings.map((f) => f.compositeScore)));
|
|
27
|
+
}
|
|
28
|
+
function maxPriority(fs) {
|
|
29
|
+
return Math.max(...fs.map((f) => f.compositeScore));
|
|
30
|
+
}
|
|
31
|
+
function pickKind(fs) {
|
|
32
|
+
// Action kind is derived from the dominant source in the cluster.
|
|
33
|
+
// Priority order: primitive_registry → wire/delete, marketing_diff → heal,
|
|
34
|
+
// truth_gate → heal, hgp/rewind/honest_mirror → publish, command_history → shrink.
|
|
35
|
+
const sources = new Set(fs.map((f) => f.source));
|
|
36
|
+
if (sources.has("primitive_registry")) {
|
|
37
|
+
// Has cross-source partners → wire (composed with something useful).
|
|
38
|
+
// No partners → delete (truly unused).
|
|
39
|
+
const anyPartners = fs.some((f) => f.composedWith.length > 0);
|
|
40
|
+
return anyPartners ? "wire" : "delete";
|
|
41
|
+
}
|
|
42
|
+
if (sources.has("truth_gate") || sources.has("marketing_diff"))
|
|
43
|
+
return "heal";
|
|
44
|
+
if (sources.has("hgp") || sources.has("rewind") || sources.has("honest_mirror"))
|
|
45
|
+
return "publish";
|
|
46
|
+
if (sources.has("command_history"))
|
|
47
|
+
return "shrink";
|
|
48
|
+
return "heal";
|
|
49
|
+
}
|
|
50
|
+
function renderPRDraft(kind, fs) {
|
|
51
|
+
const lines = [];
|
|
52
|
+
lines.push(`# 🪄 FLYWHEEL ${kind.toUpperCase()} action`);
|
|
53
|
+
lines.push(``);
|
|
54
|
+
lines.push(`## Closes ${fs.length} finding(s)`);
|
|
55
|
+
lines.push(``);
|
|
56
|
+
for (const f of fs) {
|
|
57
|
+
lines.push(`- **${f.source}** ${f.id} — ${f.headline} (${f.severity}, score ${f.compositeScore})`);
|
|
58
|
+
}
|
|
59
|
+
if (fs.some((f) => f.composedWith.length > 0)) {
|
|
60
|
+
lines.push(``);
|
|
61
|
+
lines.push(`### Composition bonus`);
|
|
62
|
+
for (const f of fs) {
|
|
63
|
+
if (f.composedWith.length === 0)
|
|
64
|
+
continue;
|
|
65
|
+
lines.push(`- ${f.source}:${f.id} composes with: ${f.composedWith.map((p) => `${p.source}:${p.id}`).join(", ")}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
lines.push(``);
|
|
69
|
+
lines.push(`## Suggested actions`);
|
|
70
|
+
lines.push(``);
|
|
71
|
+
if (kind === "heal") {
|
|
72
|
+
lines.push(`- Add probe binding in \`packages/core/src/truth_gate/probes.ts\``);
|
|
73
|
+
lines.push(`- Add claim row in \`packages/core/src/truth_gate/claims.ts\` referencing the new probe id`);
|
|
74
|
+
lines.push(`- OR remove the unbound marketing copy from the source file(s) listed above`);
|
|
75
|
+
}
|
|
76
|
+
else if (kind === "wire") {
|
|
77
|
+
const names = fs.map((f) => f.detail?.["name"] ?? f.id).join(", ");
|
|
78
|
+
lines.push(`- Add CLI surface for dormant primitive(s): ${names}`);
|
|
79
|
+
lines.push(`- Add MCP tool wrapper if missing`);
|
|
80
|
+
lines.push(`- Add 1 discrete pinned test that exercises the primitive`);
|
|
81
|
+
lines.push(`- Push a heartbeat row to \`.mneme/flywheel/primitive_ledger.jsonl\` to mark "alive"`);
|
|
82
|
+
}
|
|
83
|
+
else if (kind === "delete") {
|
|
84
|
+
const names = fs.map((f) => f.detail?.["name"] ?? f.id).join(", ");
|
|
85
|
+
lines.push(`- Confirm primitive(s) ${names} are NOT externally relied upon`);
|
|
86
|
+
lines.push(`- Remove the implementation file(s) + tests`);
|
|
87
|
+
lines.push(`- Remove the registry entry + manifest catalog row`);
|
|
88
|
+
lines.push(`- Update README/docs to remove any reference`);
|
|
89
|
+
}
|
|
90
|
+
else if (kind === "shrink") {
|
|
91
|
+
lines.push(`- The personal cheatsheet ledger suggests reducing the surface to the top-N most-used commands.`);
|
|
92
|
+
}
|
|
93
|
+
else if (kind === "publish") {
|
|
94
|
+
lines.push(`- Render the Vendor Bulletin markdown via \`mneme flywheel bulletin\` + post publicly`);
|
|
95
|
+
lines.push(`- Apply the auto-trust-delta from RECIPROCITY ledger to \`.mneme/aletheia/honest_mirror_weights.json\``);
|
|
96
|
+
}
|
|
97
|
+
return lines.join("\n");
|
|
98
|
+
}
|
|
99
|
+
export function prescribe(fused) {
|
|
100
|
+
const groups = group(fused);
|
|
101
|
+
const out = [];
|
|
102
|
+
for (const g of groups) {
|
|
103
|
+
const kind = pickKind(g.findings);
|
|
104
|
+
const priority = maxPriority(g.findings);
|
|
105
|
+
const closes = g.findings.map((f) => ({ source: f.source, id: f.id }));
|
|
106
|
+
const blocking = g.findings.some((f) => f.severity === "block");
|
|
107
|
+
const rationale = `${g.findings.length} finding(s) in cluster ${g.clusterId} (score ${priority}) — ${kind}.`;
|
|
108
|
+
out.push({
|
|
109
|
+
kind,
|
|
110
|
+
closesFindings: closes,
|
|
111
|
+
rationale,
|
|
112
|
+
artifact: renderPRDraft(kind, g.findings),
|
|
113
|
+
blocking,
|
|
114
|
+
priority,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=prescribe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prescribe.js","sourceRoot":"","sources":["../../src/flywheel/prescribe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH,SAAS,KAAK,CAAC,QAAwB;IACrC,MAAM,EAAE,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC7C,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QACtC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACZ,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;SACpF,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CA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AAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL RECIPROCITY layer.
|
|
3
|
+
*
|
|
4
|
+
* Living negotiation organ with the AI vendor ecosystem. When a
|
|
5
|
+
* Vendor Bulletin is posted publicly (off-system), the user records
|
|
6
|
+
* the vendor's response here. Trust deltas auto-feed
|
|
7
|
+
* .mneme/aletheia/honest_mirror_weights.json (the same file HONEST
|
|
8
|
+
* MIRROR + REWIND already write to) — closing the loop.
|
|
9
|
+
*
|
|
10
|
+
* Trust delta rules (v2.32.0):
|
|
11
|
+
* fix within 7 days → +0.05
|
|
12
|
+
* acknowledge within 7d → +0.01
|
|
13
|
+
* ignore > 30 days → −0.10
|
|
14
|
+
* disputed (with evidence)→ 0.00 (neutral)
|
|
15
|
+
*/
|
|
16
|
+
import type { ReciprocityEntry } from "./types.js";
|
|
17
|
+
export declare function computeTrustDelta(response: ReciprocityEntry["response"], reactionDays: number): number;
|
|
18
|
+
export interface RecordResponseParams {
|
|
19
|
+
vendor: string;
|
|
20
|
+
bulletinSeq: number;
|
|
21
|
+
response: ReciprocityEntry["response"];
|
|
22
|
+
reactionDays: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function recordResponse(repoRoot: string, params: RecordResponseParams): ReciprocityEntry;
|
|
25
|
+
export declare function readLedger(repoRoot: string, limit?: number): ReciprocityEntry[];
|
|
26
|
+
/**
|
|
27
|
+
* Apply the cumulative trust delta per vendor into the shared
|
|
28
|
+
* .mneme/aletheia/honest_mirror_weights.json file. Composes with the
|
|
29
|
+
* HONEST MIRROR + REWIND feedback loops — same destination, source
|
|
30
|
+
* field disambiguates ("reciprocity") so we never overwrite a
|
|
31
|
+
* fresher calibration.
|
|
32
|
+
*
|
|
33
|
+
* Returns the per-vendor net delta applied this run.
|
|
34
|
+
*/
|
|
35
|
+
export declare function applyToAletheiaWeights(repoRoot: string): Record<string, number>;
|
|
36
|
+
//# sourceMappingURL=reciprocity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reciprocity.d.ts","sourceRoot":"","sources":["../../src/flywheel/reciprocity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAYnD,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAKtG;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,GAAG,gBAAgB,CAY/F;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,gBAAgB,EAAE,CAW5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CA4B/E"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL RECIPROCITY layer.
|
|
3
|
+
*
|
|
4
|
+
* Living negotiation organ with the AI vendor ecosystem. When a
|
|
5
|
+
* Vendor Bulletin is posted publicly (off-system), the user records
|
|
6
|
+
* the vendor's response here. Trust deltas auto-feed
|
|
7
|
+
* .mneme/aletheia/honest_mirror_weights.json (the same file HONEST
|
|
8
|
+
* MIRROR + REWIND already write to) — closing the loop.
|
|
9
|
+
*
|
|
10
|
+
* Trust delta rules (v2.32.0):
|
|
11
|
+
* fix within 7 days → +0.05
|
|
12
|
+
* acknowledge within 7d → +0.01
|
|
13
|
+
* ignore > 30 days → −0.10
|
|
14
|
+
* disputed (with evidence)→ 0.00 (neutral)
|
|
15
|
+
*/
|
|
16
|
+
import { existsSync, mkdirSync, appendFileSync, readFileSync, writeFileSync } from "node:fs";
|
|
17
|
+
import { join } from "node:path";
|
|
18
|
+
function dirOf(repoRoot) {
|
|
19
|
+
const d = join(repoRoot, ".mneme", "flywheel");
|
|
20
|
+
if (!existsSync(d))
|
|
21
|
+
mkdirSync(d, { recursive: true });
|
|
22
|
+
return d;
|
|
23
|
+
}
|
|
24
|
+
function ledgerPath(repoRoot) {
|
|
25
|
+
return join(dirOf(repoRoot), "reciprocity.jsonl");
|
|
26
|
+
}
|
|
27
|
+
export function computeTrustDelta(response, reactionDays) {
|
|
28
|
+
if (response === "fix" && reactionDays <= 7)
|
|
29
|
+
return 0.05;
|
|
30
|
+
if (response === "acknowledge" && reactionDays <= 7)
|
|
31
|
+
return 0.01;
|
|
32
|
+
if (response === "ignore" && reactionDays >= 30)
|
|
33
|
+
return -0.10;
|
|
34
|
+
return 0.0;
|
|
35
|
+
}
|
|
36
|
+
export function recordResponse(repoRoot, params) {
|
|
37
|
+
const trustDelta = computeTrustDelta(params.response, params.reactionDays);
|
|
38
|
+
const entry = {
|
|
39
|
+
vendor: params.vendor,
|
|
40
|
+
bulletinSeq: params.bulletinSeq,
|
|
41
|
+
response: params.response,
|
|
42
|
+
reactionDays: params.reactionDays,
|
|
43
|
+
trustDelta,
|
|
44
|
+
at: new Date().toISOString(),
|
|
45
|
+
};
|
|
46
|
+
appendFileSync(ledgerPath(repoRoot), JSON.stringify(entry) + "\n", "utf8");
|
|
47
|
+
return entry;
|
|
48
|
+
}
|
|
49
|
+
export function readLedger(repoRoot, limit = 500) {
|
|
50
|
+
const p = ledgerPath(repoRoot);
|
|
51
|
+
if (!existsSync(p))
|
|
52
|
+
return [];
|
|
53
|
+
try {
|
|
54
|
+
const body = readFileSync(p, "utf8");
|
|
55
|
+
const out = [];
|
|
56
|
+
for (const ln of body.split("\n").filter(Boolean).slice(-limit)) {
|
|
57
|
+
try {
|
|
58
|
+
out.push(JSON.parse(ln));
|
|
59
|
+
}
|
|
60
|
+
catch { /* skip */ }
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Apply the cumulative trust delta per vendor into the shared
|
|
70
|
+
* .mneme/aletheia/honest_mirror_weights.json file. Composes with the
|
|
71
|
+
* HONEST MIRROR + REWIND feedback loops — same destination, source
|
|
72
|
+
* field disambiguates ("reciprocity") so we never overwrite a
|
|
73
|
+
* fresher calibration.
|
|
74
|
+
*
|
|
75
|
+
* Returns the per-vendor net delta applied this run.
|
|
76
|
+
*/
|
|
77
|
+
export function applyToAletheiaWeights(repoRoot) {
|
|
78
|
+
const ledger = readLedger(repoRoot);
|
|
79
|
+
const sumByVendor = {};
|
|
80
|
+
for (const e of ledger)
|
|
81
|
+
sumByVendor[e.vendor] = (sumByVendor[e.vendor] ?? 0) + e.trustDelta;
|
|
82
|
+
const aletheiaDir = join(repoRoot, ".mneme", "aletheia");
|
|
83
|
+
if (!existsSync(aletheiaDir))
|
|
84
|
+
mkdirSync(aletheiaDir, { recursive: true });
|
|
85
|
+
const aletheiaPath = join(aletheiaDir, "honest_mirror_weights.json");
|
|
86
|
+
const merged = {};
|
|
87
|
+
if (existsSync(aletheiaPath)) {
|
|
88
|
+
try {
|
|
89
|
+
Object.assign(merged, JSON.parse(readFileSync(aletheiaPath, "utf8")));
|
|
90
|
+
}
|
|
91
|
+
catch { /* corrupt — start fresh */ }
|
|
92
|
+
}
|
|
93
|
+
const applied = {};
|
|
94
|
+
for (const [vendor, delta] of Object.entries(sumByVendor)) {
|
|
95
|
+
const prior = merged[vendor]?.trust ?? 0.5;
|
|
96
|
+
// Only overwrite if the existing entry isn't from a fresher calibration
|
|
97
|
+
// pass (honest_mirror/rewind already wrote within the last hour).
|
|
98
|
+
const existing = merged[vendor];
|
|
99
|
+
if (existing && (existing.source === "honest_mirror" || existing.source === "rewind")) {
|
|
100
|
+
const minutesAgo = (Date.now() - Date.parse(existing.at)) / 60_000;
|
|
101
|
+
if (minutesAgo < 60) {
|
|
102
|
+
applied[vendor] = 0;
|
|
103
|
+
continue;
|
|
104
|
+
} // skip — fresher signal wins
|
|
105
|
+
}
|
|
106
|
+
const next = Math.max(0.1, Math.min(0.95, Number((prior + delta).toFixed(3))));
|
|
107
|
+
merged[vendor] = { trust: next, source: "reciprocity", at: new Date().toISOString() };
|
|
108
|
+
applied[vendor] = next - prior;
|
|
109
|
+
}
|
|
110
|
+
writeFileSync(aletheiaPath, JSON.stringify(merged, null, 2));
|
|
111
|
+
return applied;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=reciprocity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reciprocity.js","sourceRoot":"","sources":["../../src/flywheel/reciprocity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAIjC,SAAS,KAAK,CAAC,QAAgB;IAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC/C,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,SAAS,CAAC,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,SAAS,UAAU,CAAC,QAAgB;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,QAAsC,EAA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,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL types.
|
|
3
|
+
*
|
|
4
|
+
* FLYWHEEL is the self-reflective release organ. It consumes signals
|
|
5
|
+
* from the 5 existing audit primitives (TRUTH GATE, PEAK GAUNTLET,
|
|
6
|
+
* HONEST MIRROR, REWIND, HGP) + command-history + primitive registry,
|
|
7
|
+
* fuses them via cross-pollination, and prescribes 5 action kinds
|
|
8
|
+
* (Heal / Wire / Delete / Shrink / Publish). Closes the 4 weakness
|
|
9
|
+
* loops Mneme has historically suffered from:
|
|
10
|
+
*
|
|
11
|
+
* 1. Tool sprawl → Shrink (personal cheatsheet ≤ 3 cmds)
|
|
12
|
+
* 2. Solo-dev asymmetry → Publish (Vendor Bulletin .md) + cross-vendor reciprocity
|
|
13
|
+
* 3. Wiring lag → Wire (dormant primitives flagged + auto-PR draft)
|
|
14
|
+
* 4. Marketing drift → Heal (unbound claims flagged + auto-PR draft)
|
|
15
|
+
*
|
|
16
|
+
* 5-stage controller:
|
|
17
|
+
* HARVEST → FUSE → PRESCRIBE → EXECUTE → RECIPROCITY
|
|
18
|
+
*
|
|
19
|
+
* The CREATIVE part: stage 5 RECIPROCITY records vendor responses to
|
|
20
|
+
* past bulletins. Vendors that fix within 7 days get +0.05 trust boost
|
|
21
|
+
* (auto-feeds aletheia weights); vendors that ignore for 30+ days get
|
|
22
|
+
* −0.10 penalty. Living negotiation organ with the AI vendor ecosystem.
|
|
23
|
+
*/
|
|
24
|
+
/** Severity ladder shared across all findings. */
|
|
25
|
+
export type Severity = "info" | "warn" | "block";
|
|
26
|
+
/** Source primitives we ingest signal from. */
|
|
27
|
+
export type SignalSource = "truth_gate" | "peak_gauntlet" | "honest_mirror" | "rewind" | "hgp" | "command_history" | "primitive_registry" | "marketing_diff";
|
|
28
|
+
export interface RawFinding {
|
|
29
|
+
/** Source primitive + finding id (stable per source). */
|
|
30
|
+
source: SignalSource;
|
|
31
|
+
id: string;
|
|
32
|
+
/** Human-readable headline. */
|
|
33
|
+
headline: string;
|
|
34
|
+
severity: Severity;
|
|
35
|
+
/** ISO timestamp of when the finding was first observed. */
|
|
36
|
+
firstSeen: string;
|
|
37
|
+
/** ISO timestamp of the freshest observation. */
|
|
38
|
+
lastSeen: string;
|
|
39
|
+
/** Free-form structured detail per source. */
|
|
40
|
+
detail?: Record<string, unknown>;
|
|
41
|
+
/** Per-source freshness in days; lower = fresher. */
|
|
42
|
+
ageDays: number;
|
|
43
|
+
}
|
|
44
|
+
/** Cross-pollinated finding after FUSE stage. */
|
|
45
|
+
export interface FusedFinding extends RawFinding {
|
|
46
|
+
/** Other source findings related by signature / claim / vendor / simhash. */
|
|
47
|
+
composedWith: Array<{
|
|
48
|
+
source: SignalSource;
|
|
49
|
+
id: string;
|
|
50
|
+
}>;
|
|
51
|
+
/** Composite priority 0..1 — higher = more urgent. */
|
|
52
|
+
compositeScore: number;
|
|
53
|
+
/** Sortable cluster id (findings in same cluster share root cause). */
|
|
54
|
+
clusterId: string;
|
|
55
|
+
}
|
|
56
|
+
export type ActionKind = "heal" | "wire" | "delete" | "shrink" | "publish";
|
|
57
|
+
export interface PrescribedAction {
|
|
58
|
+
kind: ActionKind;
|
|
59
|
+
/** Findings this action closes. */
|
|
60
|
+
closesFindings: Array<{
|
|
61
|
+
source: SignalSource;
|
|
62
|
+
id: string;
|
|
63
|
+
}>;
|
|
64
|
+
/** What changes if executed. Plain-English. */
|
|
65
|
+
rationale: string;
|
|
66
|
+
/** Concrete artifact: PR draft markdown / cheatsheet text / bulletin .md. */
|
|
67
|
+
artifact: string;
|
|
68
|
+
/** Should this action BLOCK publish if not executed? */
|
|
69
|
+
blocking: boolean;
|
|
70
|
+
/** Composite priority inherited from the highest-priority finding closed. */
|
|
71
|
+
priority: number;
|
|
72
|
+
}
|
|
73
|
+
export interface ReciprocityEntry {
|
|
74
|
+
vendor: string;
|
|
75
|
+
/** Bulletin seq this records a response to. */
|
|
76
|
+
bulletinSeq: number;
|
|
77
|
+
/** "fix" | "ignore" | "acknowledge" | "disputed". */
|
|
78
|
+
response: "fix" | "ignore" | "acknowledge" | "disputed";
|
|
79
|
+
/** Days between bulletin emission and observed response (NaN if no response). */
|
|
80
|
+
reactionDays: number;
|
|
81
|
+
/** Trust delta to apply to vendor's aletheia weight (+0.05 fix, -0.10 ignore, ±0 ack/disputed). */
|
|
82
|
+
trustDelta: number;
|
|
83
|
+
/** ISO of when the response was recorded. */
|
|
84
|
+
at: string;
|
|
85
|
+
}
|
|
86
|
+
export interface FlywheelReport {
|
|
87
|
+
spec: {
|
|
88
|
+
name: "MNEME-FLYWHEEL";
|
|
89
|
+
version: "1.0";
|
|
90
|
+
};
|
|
91
|
+
startedAt: string;
|
|
92
|
+
finishedAt: string;
|
|
93
|
+
totalMs: number;
|
|
94
|
+
/** Number of raw findings harvested per source. */
|
|
95
|
+
harvestCounts: Record<SignalSource, number>;
|
|
96
|
+
fusedCount: number;
|
|
97
|
+
clusterCount: number;
|
|
98
|
+
actions: PrescribedAction[];
|
|
99
|
+
/** Reciprocity ledger snapshot at run time. */
|
|
100
|
+
reciprocity: ReciprocityEntry[];
|
|
101
|
+
/** Aggregate health 0..100 (1 − fraction of BLOCK actions). */
|
|
102
|
+
health: number;
|
|
103
|
+
trafficLight: "green" | "yellow" | "red";
|
|
104
|
+
headline: string;
|
|
105
|
+
hmac: string;
|
|
106
|
+
seq: number;
|
|
107
|
+
bodyDigest: string;
|
|
108
|
+
}
|
|
109
|
+
export interface FlywheelOptions {
|
|
110
|
+
/** Limit raw findings per source to bound work. */
|
|
111
|
+
perSourceLimit?: number;
|
|
112
|
+
/** Min cluster size to recommend a deletion (default 0 = any dormant primitive gets a delete option). */
|
|
113
|
+
minDeleteAge?: number;
|
|
114
|
+
/** If true, skip the EXECUTE side-effects (no Aletheia weights write). Useful for dry-runs. */
|
|
115
|
+
dryRun?: boolean;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=types.d.ts.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ACZ,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL types.
|
|
3
|
+
*
|
|
4
|
+
* FLYWHEEL is the self-reflective release organ. It consumes signals
|
|
5
|
+
* from the 5 existing audit primitives (TRUTH GATE, PEAK GAUNTLET,
|
|
6
|
+
* HONEST MIRROR, REWIND, HGP) + command-history + primitive registry,
|
|
7
|
+
* fuses them via cross-pollination, and prescribes 5 action kinds
|
|
8
|
+
* (Heal / Wire / Delete / Shrink / Publish). Closes the 4 weakness
|
|
9
|
+
* loops Mneme has historically suffered from:
|
|
10
|
+
*
|
|
11
|
+
* 1. Tool sprawl → Shrink (personal cheatsheet ≤ 3 cmds)
|
|
12
|
+
* 2. Solo-dev asymmetry → Publish (Vendor Bulletin .md) + cross-vendor reciprocity
|
|
13
|
+
* 3. Wiring lag → Wire (dormant primitives flagged + auto-PR draft)
|
|
14
|
+
* 4. Marketing drift → Heal (unbound claims flagged + auto-PR draft)
|
|
15
|
+
*
|
|
16
|
+
* 5-stage controller:
|
|
17
|
+
* HARVEST → FUSE → PRESCRIBE → EXECUTE → RECIPROCITY
|
|
18
|
+
*
|
|
19
|
+
* The CREATIVE part: stage 5 RECIPROCITY records vendor responses to
|
|
20
|
+
* past bulletins. Vendors that fix within 7 days get +0.05 trust boost
|
|
21
|
+
* (auto-feeds aletheia weights); vendors that ignore for 30+ days get
|
|
22
|
+
* −0.10 penalty. Living negotiation organ with the AI vendor ecosystem.
|
|
23
|
+
*/
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/flywheel/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG"}
|