@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,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL FUSE stage.
|
|
3
|
+
*
|
|
4
|
+
* Cross-pollinates raw findings. The wild part: when two findings from
|
|
5
|
+
* DIFFERENT sources share a root signature (vendor / claim / simhash),
|
|
6
|
+
* the composite score gets a 30% boost. That's the "composition
|
|
7
|
+
* bonus" — fixing a fused finding kills 2+ root causes at once.
|
|
8
|
+
*
|
|
9
|
+
* Cluster ids: findings tagged with the same clusterId share root
|
|
10
|
+
* cause and should be prescribed as ONE action.
|
|
11
|
+
*/
|
|
12
|
+
import { createHash } from "node:crypto";
|
|
13
|
+
function sha8(s) {
|
|
14
|
+
return createHash("sha256").update(s).digest("hex").slice(0, 8);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Derive a cluster key from a raw finding. Findings that hash to the
|
|
18
|
+
* SAME cluster key share root cause (vendor / claim / simhash).
|
|
19
|
+
*
|
|
20
|
+
* Heuristic per source:
|
|
21
|
+
* honest_mirror + rewind → "vendor:<vendor-id>"
|
|
22
|
+
* hgp → "hgp:<hgpId>" (also adds vendor:<each-vendor> sub-clusters)
|
|
23
|
+
* truth_gate → "claim:<claimId>"
|
|
24
|
+
* peak_gauntlet → "finding:<id>"
|
|
25
|
+
* primitive_registry → "primitive:<name>"
|
|
26
|
+
* marketing_diff → "marketing:<file>"
|
|
27
|
+
* command_history → "cmd:<command>"
|
|
28
|
+
*/
|
|
29
|
+
function clusterKeys(f) {
|
|
30
|
+
const keys = [];
|
|
31
|
+
if (f.source === "honest_mirror" || f.source === "rewind") {
|
|
32
|
+
const v = f.detail?.["vendor"] ?? "";
|
|
33
|
+
if (v)
|
|
34
|
+
keys.push(`vendor:${v}`);
|
|
35
|
+
}
|
|
36
|
+
else if (f.source === "hgp") {
|
|
37
|
+
keys.push(`hgp:${f.id}`);
|
|
38
|
+
const vc = f.detail?.["vendorCounts"] ?? {};
|
|
39
|
+
for (const v of Object.keys(vc))
|
|
40
|
+
keys.push(`vendor:${v}`);
|
|
41
|
+
}
|
|
42
|
+
else if (f.source === "truth_gate") {
|
|
43
|
+
keys.push(`claim:${f.id}`);
|
|
44
|
+
}
|
|
45
|
+
else if (f.source === "peak_gauntlet") {
|
|
46
|
+
keys.push(`finding:${f.id}`);
|
|
47
|
+
}
|
|
48
|
+
else if (f.source === "primitive_registry") {
|
|
49
|
+
keys.push(`primitive:${f.id}`);
|
|
50
|
+
}
|
|
51
|
+
else if (f.source === "marketing_diff") {
|
|
52
|
+
const file = f.detail?.["file"] ?? "";
|
|
53
|
+
if (file)
|
|
54
|
+
keys.push(`marketing:${file}`);
|
|
55
|
+
}
|
|
56
|
+
else if (f.source === "command_history") {
|
|
57
|
+
keys.push(`cmd:${f.id}`);
|
|
58
|
+
}
|
|
59
|
+
// Always include the (source, id) self-key as a fallback so isolated
|
|
60
|
+
// findings still get a stable cluster id.
|
|
61
|
+
keys.push(`self:${f.source}:${f.id}`);
|
|
62
|
+
return keys;
|
|
63
|
+
}
|
|
64
|
+
const SEVERITY_WEIGHT = {
|
|
65
|
+
info: 0.2, warn: 0.6, block: 1.0,
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Composite priority 0..1 = baseSeverity × freshness × (1 + composition-bonus).
|
|
69
|
+
* baseSeverity ∈ [0.2, 1.0]
|
|
70
|
+
* freshness ∈ [0.2, 1.0] (1.0 if 0 days old; 0.2 if 60+ days)
|
|
71
|
+
* compositionBonus = min(0.3, 0.1 × cross-source-partners)
|
|
72
|
+
*/
|
|
73
|
+
function compositeScore(f, crossSourcePartners) {
|
|
74
|
+
const base = SEVERITY_WEIGHT[f.severity] ?? 0.5;
|
|
75
|
+
const fresh = Math.max(0.2, 1.0 - f.ageDays / 60);
|
|
76
|
+
const comp = Math.min(0.3, 0.1 * crossSourcePartners);
|
|
77
|
+
return Number((Math.min(1, base * fresh * (1 + comp))).toFixed(3));
|
|
78
|
+
}
|
|
79
|
+
export function fuse(raw) {
|
|
80
|
+
// Bucket by cluster key.
|
|
81
|
+
const byKey = new Map();
|
|
82
|
+
for (const f of raw) {
|
|
83
|
+
for (const k of clusterKeys(f)) {
|
|
84
|
+
const arr = byKey.get(k) ?? [];
|
|
85
|
+
arr.push(f);
|
|
86
|
+
byKey.set(k, arr);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
// For each finding, find cross-source partners (findings in any
|
|
90
|
+
// shared cluster from a DIFFERENT source).
|
|
91
|
+
const out = [];
|
|
92
|
+
for (const f of raw) {
|
|
93
|
+
const partners = new Set(); // dedup by `${source}:${id}`
|
|
94
|
+
for (const k of clusterKeys(f)) {
|
|
95
|
+
for (const peer of byKey.get(k) ?? []) {
|
|
96
|
+
if (peer === f)
|
|
97
|
+
continue;
|
|
98
|
+
if (peer.source === f.source && peer.id === f.id)
|
|
99
|
+
continue;
|
|
100
|
+
if (peer.source !== f.source)
|
|
101
|
+
partners.add(`${peer.source}:${peer.id}`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const partnerList = Array.from(partners).map((s) => {
|
|
105
|
+
const i = s.indexOf(":");
|
|
106
|
+
return { source: s.slice(0, i), id: s.slice(i + 1) };
|
|
107
|
+
});
|
|
108
|
+
// Pick the most-specific cluster key as the canonical clusterId.
|
|
109
|
+
const cands = clusterKeys(f).filter((k) => !k.startsWith("self:"));
|
|
110
|
+
const clusterKey = cands[0] ?? clusterKeys(f).pop();
|
|
111
|
+
out.push({
|
|
112
|
+
...f,
|
|
113
|
+
composedWith: partnerList,
|
|
114
|
+
compositeScore: compositeScore(f, partnerList.length),
|
|
115
|
+
clusterId: sha8(clusterKey),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Sort by compositeScore descending, then severity descending, then ageDays asc.
|
|
119
|
+
out.sort((a, b) => {
|
|
120
|
+
if (b.compositeScore !== a.compositeScore)
|
|
121
|
+
return b.compositeScore - a.compositeScore;
|
|
122
|
+
if (SEVERITY_WEIGHT[b.severity] !== SEVERITY_WEIGHT[a.severity])
|
|
123
|
+
return SEVERITY_WEIGHT[b.severity] - SEVERITY_WEIGHT[a.severity];
|
|
124
|
+
return a.ageDays - b.ageDays;
|
|
125
|
+
});
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
/** Count distinct clusters across a fused list. */
|
|
129
|
+
export function distinctClusterCount(fused) {
|
|
130
|
+
return new Set(fused.map((f) => f.clusterId)).size;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=fuse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuse.js","sourceRoot":"","sources":["../../src/flywheel/fuse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAGzC,SAAS,IAAI,CAAC,CAAS;IACrB,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,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C,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL HARVEST stage.
|
|
3
|
+
*
|
|
4
|
+
* Pulls raw findings from every source primitive's existing ledger.
|
|
5
|
+
* Pure file reads + JSONL parsing — NO new state, NO new primitive
|
|
6
|
+
* call. Every reader is best-effort: a missing file = empty list
|
|
7
|
+
* (FLYWHEEL still emits a useful report on a fresh install).
|
|
8
|
+
*/
|
|
9
|
+
import type { RawFinding } from "./types.js";
|
|
10
|
+
export declare function harvestTruthGate(repoRoot: string, limit: number): RawFinding[];
|
|
11
|
+
export declare function harvestGauntlet(repoRoot: string, limit: number): RawFinding[];
|
|
12
|
+
export declare function harvestHonestMirror(repoRoot: string, limit: number): RawFinding[];
|
|
13
|
+
export declare function harvestRewind(repoRoot: string, limit: number): RawFinding[];
|
|
14
|
+
export declare function harvestHgp(repoRoot: string, limit: number): RawFinding[];
|
|
15
|
+
interface CmdHistoryLine {
|
|
16
|
+
command: string;
|
|
17
|
+
at: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function harvestCommandHistory(repoRoot: string, limit: number): CmdHistoryLine[];
|
|
20
|
+
export interface MarketingClaim {
|
|
21
|
+
file: string;
|
|
22
|
+
text: string;
|
|
23
|
+
kind: "numeric" | "superlative";
|
|
24
|
+
}
|
|
25
|
+
export declare function harvestMarketing(repoRoot: string, knownBoundClaimIds: string[]): RawFinding[];
|
|
26
|
+
export declare function harvestLiveness(repoRoot: string, registrySnapshot: Array<{
|
|
27
|
+
name: string;
|
|
28
|
+
sinceVersion?: string;
|
|
29
|
+
}>, minDeleteAge: number): RawFinding[];
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=harvest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harvest.d.ts","sourceRoot":"","sources":["../../src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0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL HARVEST stage.
|
|
3
|
+
*
|
|
4
|
+
* Pulls raw findings from every source primitive's existing ledger.
|
|
5
|
+
* Pure file reads + JSONL parsing — NO new state, NO new primitive
|
|
6
|
+
* call. Every reader is best-effort: a missing file = empty list
|
|
7
|
+
* (FLYWHEEL still emits a useful report on a fresh install).
|
|
8
|
+
*/
|
|
9
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
10
|
+
import { join } from "node:path";
|
|
11
|
+
function daysBetween(isoA, isoB) {
|
|
12
|
+
const a = Date.parse(isoA);
|
|
13
|
+
const b = Date.parse(isoB);
|
|
14
|
+
if (Number.isNaN(a) || Number.isNaN(b))
|
|
15
|
+
return 0;
|
|
16
|
+
return Math.max(0, Math.round((b - a) / 86_400_000));
|
|
17
|
+
}
|
|
18
|
+
function safeJsonl(p, limit) {
|
|
19
|
+
if (!existsSync(p))
|
|
20
|
+
return [];
|
|
21
|
+
try {
|
|
22
|
+
const body = readFileSync(p, "utf8");
|
|
23
|
+
const lines = body.split("\n").filter(Boolean);
|
|
24
|
+
const slice = lines.slice(-limit);
|
|
25
|
+
const out = [];
|
|
26
|
+
for (const ln of slice) {
|
|
27
|
+
try {
|
|
28
|
+
out.push(JSON.parse(ln));
|
|
29
|
+
}
|
|
30
|
+
catch { /* skip */ }
|
|
31
|
+
}
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function harvestTruthGate(repoRoot, limit) {
|
|
39
|
+
const p = join(repoRoot, ".mneme", "truth_gate", "matrix.jsonl");
|
|
40
|
+
const rows = safeJsonl(p, limit);
|
|
41
|
+
const now = new Date().toISOString();
|
|
42
|
+
const out = [];
|
|
43
|
+
for (const r of rows) {
|
|
44
|
+
const at = r.finishedAt ?? now;
|
|
45
|
+
for (const d of r.drifted ?? []) {
|
|
46
|
+
if (!d.claimId)
|
|
47
|
+
continue;
|
|
48
|
+
out.push({
|
|
49
|
+
source: "truth_gate",
|
|
50
|
+
id: `${d.claimId}`,
|
|
51
|
+
headline: d.headline ?? `TRUTH GATE drift on ${d.claimId}`,
|
|
52
|
+
severity: "warn",
|
|
53
|
+
firstSeen: at, lastSeen: at,
|
|
54
|
+
ageDays: daysBetween(at, now),
|
|
55
|
+
detail: { claimId: d.claimId },
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return out;
|
|
60
|
+
}
|
|
61
|
+
export function harvestGauntlet(repoRoot, limit) {
|
|
62
|
+
const p = join(repoRoot, ".mneme", "tune", "scorecard.jsonl");
|
|
63
|
+
const rows = safeJsonl(p, limit);
|
|
64
|
+
const now = new Date().toISOString();
|
|
65
|
+
const out = [];
|
|
66
|
+
const last = rows[rows.length - 1];
|
|
67
|
+
if (!last)
|
|
68
|
+
return out;
|
|
69
|
+
const at = last.finishedAt ?? now;
|
|
70
|
+
for (const f of last.findings ?? []) {
|
|
71
|
+
if (!f.id || typeof f.stars !== "number")
|
|
72
|
+
continue;
|
|
73
|
+
if (f.stars >= 10)
|
|
74
|
+
continue;
|
|
75
|
+
out.push({
|
|
76
|
+
source: "peak_gauntlet",
|
|
77
|
+
id: f.id,
|
|
78
|
+
headline: f.title ? `${f.id} ${f.stars}★: ${f.title}` : `${f.id} ${f.stars}★`,
|
|
79
|
+
severity: f.stars <= 5 ? "block" : "warn",
|
|
80
|
+
firstSeen: at, lastSeen: at,
|
|
81
|
+
ageDays: daysBetween(at, now),
|
|
82
|
+
detail: { stars: f.stars, title: f.title },
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
export function harvestHonestMirror(repoRoot, limit) {
|
|
88
|
+
const p = join(repoRoot, ".mneme", "honest_mirror", "reports.jsonl");
|
|
89
|
+
const rows = safeJsonl(p, limit);
|
|
90
|
+
const now = new Date().toISOString();
|
|
91
|
+
const out = [];
|
|
92
|
+
for (const r of rows) {
|
|
93
|
+
if (r.trafficLight === "green")
|
|
94
|
+
continue;
|
|
95
|
+
const at = r.finishedAt ?? now;
|
|
96
|
+
for (const v of r.perVendor ?? []) {
|
|
97
|
+
if (!v.vendor || typeof v.delta !== "number")
|
|
98
|
+
continue;
|
|
99
|
+
// Skip mock vendors — their deterministic answers can't match real
|
|
100
|
+
// commit diffs, so they're not an honest calibration signal (same
|
|
101
|
+
// filter TRUTH GATE applies in probes.ts).
|
|
102
|
+
if (v.vendor.startsWith("mock") || v.vendor.includes("@mock"))
|
|
103
|
+
continue;
|
|
104
|
+
const abs = Math.abs(v.delta);
|
|
105
|
+
if (abs < 0.1)
|
|
106
|
+
continue;
|
|
107
|
+
out.push({
|
|
108
|
+
source: "honest_mirror",
|
|
109
|
+
id: `vendor:${v.vendor}`,
|
|
110
|
+
headline: `${v.vendor} calibration Δ=${(v.delta * 100).toFixed(0)}%`,
|
|
111
|
+
severity: abs >= 0.25 ? "block" : "warn",
|
|
112
|
+
firstSeen: at, lastSeen: at,
|
|
113
|
+
ageDays: daysBetween(at, now),
|
|
114
|
+
detail: { vendor: v.vendor, delta: v.delta, weight: v.weight },
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return out;
|
|
119
|
+
}
|
|
120
|
+
export function harvestRewind(repoRoot, limit) {
|
|
121
|
+
const p = join(repoRoot, ".mneme", "rewind", "cards.jsonl");
|
|
122
|
+
const rows = safeJsonl(p, limit);
|
|
123
|
+
const now = new Date().toISOString();
|
|
124
|
+
const out = [];
|
|
125
|
+
for (const r of rows) {
|
|
126
|
+
if (r.regression !== "regression")
|
|
127
|
+
continue;
|
|
128
|
+
const at = r.runAt ?? now;
|
|
129
|
+
out.push({
|
|
130
|
+
source: "rewind",
|
|
131
|
+
id: `vendor:${r.vendor ?? "?"}@${r.vendorVersion ?? "?"}`,
|
|
132
|
+
headline: r.headline ?? `REWIND regression for ${r.vendor}@${r.vendorVersion}`,
|
|
133
|
+
severity: Math.abs(r.delta ?? 0) >= 0.15 ? "block" : "warn",
|
|
134
|
+
firstSeen: at, lastSeen: at,
|
|
135
|
+
ageDays: daysBetween(at, now),
|
|
136
|
+
detail: { vendor: r.vendor, vendorVersion: r.vendorVersion, delta: r.delta, weight: r.weight },
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
141
|
+
export function harvestHgp(repoRoot, limit) {
|
|
142
|
+
const p = join(repoRoot, ".mneme", "hgp", "registry.jsonl");
|
|
143
|
+
const rows = safeJsonl(p, limit);
|
|
144
|
+
// Collapse by id, pick top-N by severity (recompute on collapsed view).
|
|
145
|
+
const byId = new Map();
|
|
146
|
+
for (const r of rows) {
|
|
147
|
+
if (!r.hgpId)
|
|
148
|
+
continue;
|
|
149
|
+
const cur = byId.get(r.hgpId);
|
|
150
|
+
if (!cur) {
|
|
151
|
+
byId.set(r.hgpId, { ...r });
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
cur.lastSeen = (r.lastSeen ?? cur.lastSeen);
|
|
155
|
+
cur.observeCount = (cur.observeCount ?? 0) + (r.observeCount ?? 0);
|
|
156
|
+
cur.vendorCounts = { ...cur.vendorCounts };
|
|
157
|
+
for (const [v, c] of Object.entries(r.vendorCounts ?? {})) {
|
|
158
|
+
cur.vendorCounts[v] = (cur.vendorCounts[v] ?? 0) + c;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
const now = new Date().toISOString();
|
|
162
|
+
const out = [];
|
|
163
|
+
for (const r of byId.values()) {
|
|
164
|
+
const sev = (r.severity ?? 0);
|
|
165
|
+
if (sev < 0.3)
|
|
166
|
+
continue;
|
|
167
|
+
out.push({
|
|
168
|
+
source: "hgp",
|
|
169
|
+
id: r.hgpId,
|
|
170
|
+
headline: `${r.hgpId} severity ${sev.toFixed(2)} · ${r.observeCount ?? 0} obs · ${Object.keys(r.vendorCounts ?? {}).length} vendor(s)`,
|
|
171
|
+
severity: sev >= 0.7 ? "block" : "warn",
|
|
172
|
+
firstSeen: r.firstSeen ?? now,
|
|
173
|
+
lastSeen: r.lastSeen ?? now,
|
|
174
|
+
ageDays: daysBetween(r.lastSeen ?? now, now),
|
|
175
|
+
detail: { hgpId: r.hgpId, simhash: r.simhash, observeCount: r.observeCount, vendorCounts: r.vendorCounts, sample: r.sample },
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return out;
|
|
179
|
+
}
|
|
180
|
+
export function harvestCommandHistory(repoRoot, limit) {
|
|
181
|
+
const p = join(repoRoot, ".mneme", "flywheel", "cmd_history.jsonl");
|
|
182
|
+
return safeJsonl(p, limit);
|
|
183
|
+
}
|
|
184
|
+
// ── Marketing diff harvest ──────────────────────────────────────────
|
|
185
|
+
// Scans README + docs/*.md for numeric / categorical assertions that
|
|
186
|
+
// LOOK like measurable claims but have no probe binding in TRUTH GATE.
|
|
187
|
+
// Recommends ADDING a probe (heal action).
|
|
188
|
+
const NUMERIC_CLAIM_RX = /\b(\d{1,5})\s*(\/\s*\d{1,5})?\s*(primitives|tools|tests|cards|claims|HGP-IDs|findings|vendors|attack vectors|stars|points)\b/gi;
|
|
189
|
+
const SUPERLATIVE_RX = /\b(world-first|world's first|the only|first ever|never before|no AI tool)\b/gi;
|
|
190
|
+
export function harvestMarketing(repoRoot, knownBoundClaimIds) {
|
|
191
|
+
const candidates = [];
|
|
192
|
+
for (const file of ["README.md", "docs/FUNCTIONS-EN.md", "docs/FUNCTIONS-TH.md"]) {
|
|
193
|
+
const p = join(repoRoot, file);
|
|
194
|
+
if (!existsSync(p))
|
|
195
|
+
continue;
|
|
196
|
+
try {
|
|
197
|
+
const body = readFileSync(p, "utf8");
|
|
198
|
+
for (const m of body.matchAll(NUMERIC_CLAIM_RX)) {
|
|
199
|
+
candidates.push({ file, text: m[0], kind: "numeric" });
|
|
200
|
+
}
|
|
201
|
+
for (const m of body.matchAll(SUPERLATIVE_RX)) {
|
|
202
|
+
candidates.push({ file, text: m[0], kind: "superlative" });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch { /* skip */ }
|
|
206
|
+
}
|
|
207
|
+
// Dedup by (file, text).
|
|
208
|
+
const seen = new Set();
|
|
209
|
+
const unique = [];
|
|
210
|
+
for (const c of candidates) {
|
|
211
|
+
const k = `${c.file}|${c.text.toLowerCase()}`;
|
|
212
|
+
if (seen.has(k))
|
|
213
|
+
continue;
|
|
214
|
+
seen.add(k);
|
|
215
|
+
unique.push(c);
|
|
216
|
+
}
|
|
217
|
+
// For v2.32.0 we report all UNIQUE claim candidates as candidates
|
|
218
|
+
// for binding — TRUTH GATE catalog growth is tracked separately.
|
|
219
|
+
// A future version will simhash-match candidates to known bound
|
|
220
|
+
// claim ids; for now we surface them all as info-level findings.
|
|
221
|
+
void knownBoundClaimIds;
|
|
222
|
+
const now = new Date().toISOString();
|
|
223
|
+
const out = [];
|
|
224
|
+
for (const c of unique) {
|
|
225
|
+
out.push({
|
|
226
|
+
source: "marketing_diff",
|
|
227
|
+
id: `${c.file}::${c.text.slice(0, 40).toLowerCase().replace(/\s+/g, "_")}`,
|
|
228
|
+
headline: `${c.kind} claim in ${c.file}: "${c.text}"`,
|
|
229
|
+
severity: "info",
|
|
230
|
+
firstSeen: now, lastSeen: now,
|
|
231
|
+
ageDays: 0,
|
|
232
|
+
detail: { file: c.file, text: c.text, kind: c.kind },
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
export function harvestLiveness(repoRoot, registrySnapshot, minDeleteAge) {
|
|
238
|
+
const p = join(repoRoot, ".mneme", "flywheel", "primitive_ledger.jsonl");
|
|
239
|
+
const beats = safeJsonl(p, 10000);
|
|
240
|
+
// FIRST-RUN GRACE: if the ledger has fewer than 5 heartbeats, we
|
|
241
|
+
// haven't seen enough live traffic to call anything "dormant" yet.
|
|
242
|
+
// Skip the dormant check until the system has been used a bit.
|
|
243
|
+
// Without this guard, the FIRST flywheel.run on a fresh install
|
|
244
|
+
// would flag every shipped primitive as dormant (correct logic but
|
|
245
|
+
// useless signal — nothing has had a chance to fire).
|
|
246
|
+
if (beats.length < 5)
|
|
247
|
+
return [];
|
|
248
|
+
const lastSeenByName = new Map();
|
|
249
|
+
const shippedByName = new Map();
|
|
250
|
+
for (const b of beats) {
|
|
251
|
+
if (!b.name)
|
|
252
|
+
continue;
|
|
253
|
+
const cur = lastSeenByName.get(b.name);
|
|
254
|
+
if (!cur || b.at > cur)
|
|
255
|
+
lastSeenByName.set(b.name, b.at);
|
|
256
|
+
if (b.shippedAt && !shippedByName.has(b.name))
|
|
257
|
+
shippedByName.set(b.name, b.shippedAt);
|
|
258
|
+
}
|
|
259
|
+
const now = new Date().toISOString();
|
|
260
|
+
const out = [];
|
|
261
|
+
for (const prim of registrySnapshot) {
|
|
262
|
+
const last = lastSeenByName.get(prim.name);
|
|
263
|
+
// Only treat as dormant if we have a known shipped date. Without
|
|
264
|
+
// shippedAt, we can't honestly say it's "old" — could be a brand
|
|
265
|
+
// new primitive that just hasn't beat yet.
|
|
266
|
+
const shipped = shippedByName.get(prim.name);
|
|
267
|
+
if (last)
|
|
268
|
+
continue; // alive
|
|
269
|
+
if (!shipped)
|
|
270
|
+
continue; // unknown age — don't flag
|
|
271
|
+
const ageDays = daysBetween(shipped, now);
|
|
272
|
+
if (ageDays < minDeleteAge)
|
|
273
|
+
continue;
|
|
274
|
+
out.push({
|
|
275
|
+
source: "primitive_registry",
|
|
276
|
+
id: prim.name,
|
|
277
|
+
headline: `Dormant primitive: ${prim.name} (shipped ${ageDays}d ago, never invoked)`,
|
|
278
|
+
severity: ageDays >= 90 ? "block" : "warn",
|
|
279
|
+
firstSeen: shipped, lastSeen: shipped,
|
|
280
|
+
ageDays,
|
|
281
|
+
detail: { name: prim.name, sinceVersion: prim.sinceVersion ?? "?" },
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
return out;
|
|
285
|
+
}
|
|
286
|
+
//# s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historic Mneme
|
|
5
|
+
* weakness loops: tool sprawl + solo-dev asymmetry + wiring lag +
|
|
6
|
+
* marketing drift. 5-stage controller HARVEST → FUSE → PRESCRIBE
|
|
7
|
+
* → EXECUTE → RECIPROCITY. Composes with TRUTH GATE + PEAK GAUNTLET
|
|
8
|
+
* + HONEST MIRROR + REWIND + HGP via the SAME
|
|
9
|
+
* .mneme/aletheia/honest_mirror_weights.json feedback file.
|
|
10
|
+
*/
|
|
11
|
+
export type { Severity, SignalSource, RawFinding, FusedFinding, ActionKind, PrescribedAction, ReciprocityEntry, FlywheelReport, FlywheelOptions, } from "./types.js";
|
|
12
|
+
export { harvestTruthGate, harvestGauntlet, harvestHonestMirror, harvestRewind, harvestHgp, harvestCommandHistory, harvestMarketing, harvestLiveness, } from "./harvest.js";
|
|
13
|
+
export type { MarketingClaim } from "./harvest.js";
|
|
14
|
+
export { fuse, distinctClusterCount } from "./fuse.js";
|
|
15
|
+
export { prescribe } from "./prescribe.js";
|
|
16
|
+
export { computeCheatsheet, recordCommand, readHistory, renderCheatsheetMarkdown, } from "./personal_cheatsheet.js";
|
|
17
|
+
export type { CheatsheetEntry, CheatsheetSnapshot } from "./personal_cheatsheet.js";
|
|
18
|
+
export { heartbeat, readHeartbeats, lastSeenMap, } from "./liveness.js";
|
|
19
|
+
export type { PrimitiveSnapshot } from "./liveness.js";
|
|
20
|
+
export { gatherBulletinData, renderBulletinMarkdown, } from "./vendor_bulletin.js";
|
|
21
|
+
export type { BulletinData } from "./vendor_bulletin.js";
|
|
22
|
+
export { computeTrustDelta, recordResponse, readLedger as readReciprocityLedger, applyToAletheiaWeights, } from "./reciprocity.js";
|
|
23
|
+
export type { RecordResponseParams } from "./reciprocity.js";
|
|
24
|
+
export { runFlywheel, listReports, readLatestReport, verifyReport, blockingActions, __resetFlywheelChainForTest, } from "./controller.js";
|
|
25
|
+
export type { RunInput, ReportLedgerEntry } from "./controller.js";
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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BAAiB,CAAC;AACzB,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — FLYWHEEL public surface.
|
|
3
|
+
*
|
|
4
|
+
* Self-reflective release organ that closes 4 historic Mneme
|
|
5
|
+
* weakness loops: tool sprawl + solo-dev asymmetry + wiring lag +
|
|
6
|
+
* marketing drift. 5-stage controller HARVEST → FUSE → PRESCRIBE
|
|
7
|
+
* → EXECUTE → RECIPROCITY. Composes with TRUTH GATE + PEAK GAUNTLET
|
|
8
|
+
* + HONEST MIRROR + REWIND + HGP via the SAME
|
|
9
|
+
* .mneme/aletheia/honest_mirror_weights.json feedback file.
|
|
10
|
+
*/
|
|
11
|
+
export { harvestTruthGate, harvestGauntlet, harvestHonestMirror, harvestRewind, harvestHgp, harvestCommandHistory, harvestMarketing, harvestLiveness, } from "./harvest.js";
|
|
12
|
+
export { fuse, distinctClusterCount } from "./fuse.js";
|
|
13
|
+
export { prescribe } from "./prescribe.js";
|
|
14
|
+
export { computeCheatsheet, recordCommand, readHistory, renderCheatsheetMarkdown, } from "./personal_cheatsheet.js";
|
|
15
|
+
export { heartbeat, readHeartbeats, lastSeenMap, } from "./liveness.js";
|
|
16
|
+
export { gatherBulletinData, renderBulletinMarkdown, } from "./vendor_bulletin.js";
|
|
17
|
+
export { computeTrustDelta, recordResponse, readLedger as readReciprocityLedger, applyToAletheiaWeights, } from "./reciprocity.js";
|
|
18
|
+
export { runFlywheel, listReports, readLatestReport, verifyReport, blockingActions, __resetFlywheelChainForTest, } from "./controller.js";
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/flywheel/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EACL,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EACtD,aAAa,EAAE,UAAU,EAAE,qBAAqB,EAChD,gBAAgB,EAAE,eAAe,GAClC,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EACL,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,wBAAwB,GACxE,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,SAAS,EAAE,cAAc,EAAE,WAAW,GACvC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,kBAAkB,EAAE,sBAAsB,GAC3C,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,iBAAiB,EAAE,cAAc,EAAE,UAAU,IAAI,qBAAqB,EACtE,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,WAAW,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EACzE,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — Primitive liveness ledger.
|
|
3
|
+
*
|
|
4
|
+
* Every time an MCP tool fires (or the universal CLI router invokes
|
|
5
|
+
* a primitive), the caller can push a heartbeat row to
|
|
6
|
+
* .mneme/flywheel/primitive_ledger.jsonl. FLYWHEEL HARVEST reads this
|
|
7
|
+
* to detect dormant primitives.
|
|
8
|
+
*
|
|
9
|
+
* v2.32.0 ships the ledger primitive + harvest reader; wiring every
|
|
10
|
+
* MCP tool to auto-push a heartbeat is a v2.32.x enhancement to avoid
|
|
11
|
+
* cross-package coupling in v1. For now, tests + manual probes push
|
|
12
|
+
* heartbeats explicitly.
|
|
13
|
+
*/
|
|
14
|
+
interface Heartbeat {
|
|
15
|
+
name: string;
|
|
16
|
+
at: string;
|
|
17
|
+
shippedAt?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function heartbeat(repoRoot: string, name: string, shippedAt?: string): void;
|
|
20
|
+
export declare function readHeartbeats(repoRoot: string, limit?: number): Heartbeat[];
|
|
21
|
+
/** Last-seen per primitive name. */
|
|
22
|
+
export declare function lastSeenMap(repoRoot: string): Map<string, string>;
|
|
23
|
+
/**
|
|
24
|
+
* Snapshot of every primitive currently registered (name +
|
|
25
|
+
* sinceVersion). Caller supplies this — we keep the dependency
|
|
26
|
+
* surface tiny by accepting a parameter (so flywheel doesn't have to
|
|
27
|
+
* cross-import the agent_manifest catalog).
|
|
28
|
+
*/
|
|
29
|
+
export interface PrimitiveSnapshot {
|
|
30
|
+
name: string;
|
|
31
|
+
sinceVersion?: string;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=liveness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveness.d.ts","sourceRoot":"","sources":["../../src/flywheel/liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAYD,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAMlF;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,SAAQ,GAAG,SAAS,EAAE,CAW3E;AAED,oCAAoC;AACpC,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAOjE;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* v2.32.0 — Primitive liveness ledger.
|
|
3
|
+
*
|
|
4
|
+
* Every time an MCP tool fires (or the universal CLI router invokes
|
|
5
|
+
* a primitive), the caller can push a heartbeat row to
|
|
6
|
+
* .mneme/flywheel/primitive_ledger.jsonl. FLYWHEEL HARVEST reads this
|
|
7
|
+
* to detect dormant primitives.
|
|
8
|
+
*
|
|
9
|
+
* v2.32.0 ships the ledger primitive + harvest reader; wiring every
|
|
10
|
+
* MCP tool to auto-push a heartbeat is a v2.32.x enhancement to avoid
|
|
11
|
+
* cross-package coupling in v1. For now, tests + manual probes push
|
|
12
|
+
* heartbeats explicitly.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync, mkdirSync, appendFileSync, readFileSync } from "node:fs";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
function dirOf(repoRoot) {
|
|
17
|
+
const d = join(repoRoot, ".mneme", "flywheel");
|
|
18
|
+
if (!existsSync(d))
|
|
19
|
+
mkdirSync(d, { recursive: true });
|
|
20
|
+
return d;
|
|
21
|
+
}
|
|
22
|
+
function ledgerPath(repoRoot) {
|
|
23
|
+
return join(dirOf(repoRoot), "primitive_ledger.jsonl");
|
|
24
|
+
}
|
|
25
|
+
export function heartbeat(repoRoot, name, shippedAt) {
|
|
26
|
+
try {
|
|
27
|
+
const row = { name, at: new Date().toISOString() };
|
|
28
|
+
if (shippedAt)
|
|
29
|
+
row.shippedAt = shippedAt;
|
|
30
|
+
appendFileSync(ledgerPath(repoRoot), JSON.stringify(row) + "\n", "utf8");
|
|
31
|
+
}
|
|
32
|
+
catch { /* best-effort */ }
|
|
33
|
+
}
|
|
34
|
+
export function readHeartbeats(repoRoot, limit = 10000) {
|
|
35
|
+
const p = ledgerPath(repoRoot);
|
|
36
|
+
if (!existsSync(p))
|
|
37
|
+
return [];
|
|
38
|
+
try {
|
|
39
|
+
const body = readFileSync(p, "utf8");
|
|
40
|
+
const out = [];
|
|
41
|
+
for (const ln of body.split("\n").filter(Boolean).slice(-limit)) {
|
|
42
|
+
try {
|
|
43
|
+
out.push(JSON.parse(ln));
|
|
44
|
+
}
|
|
45
|
+
catch { /* skip */ }
|
|
46
|
+
}
|
|
47
|
+
return out;
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/** Last-seen per primitive name. */
|
|
54
|
+
export function lastSeenMap(repoRoot) {
|
|
55
|
+
const out = new Map();
|
|
56
|
+
for (const b of readHeartbeats(repoRoot)) {
|
|
57
|
+
const cur = out.get(b.name);
|
|
58
|
+
if (!cur || b.at > cur)
|
|
59
|
+
out.set(b.name, b.at);
|
|
60
|
+
}
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=liveness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveness.js","sourceRoot":"","sources":["../../src/flywheel/liveness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQjC,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,wBAAwB,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,QAAgB,EAAE,IAAY,EAAE,SAAkB;IAC1E,IAAI,CAAC;QACH,MAAM,GAAG,GAAc,EAAE,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