thumbgate 1.37.3 → 1.39.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/.agents/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
- package/.agents/skills/bolt-forge-opt-in-not-clone/SKILL.md +72 -0
- package/.agents/skills/decisive-step-evaluator/SKILL.md +47 -0
- package/.agents/skills/fiddler-control-plane-honesty/SKILL.md +61 -0
- package/.agents/skills/halo-trace-optimize-not-clone/SKILL.md +60 -0
- package/.agents/skills/harness-evolution-ceiling/SKILL.md +52 -0
- package/.agents/skills/infoq-architect-honesty-not-clone/SKILL.md +37 -0
- package/.agents/skills/meko-datapack-honesty-not-clone/SKILL.md +45 -0
- package/.agents/skills/mintlify-knowledge-honesty-not-clone/SKILL.md +49 -0
- package/.agents/skills/model-distress-governance/SKILL.md +56 -0
- package/.agents/skills/omp-coordination-honesty-not-clone/SKILL.md +94 -0
- package/.agents/skills/saas-moat-honesty-not-clone/SKILL.md +22 -0
- package/.agents/skills/salt-code-policy-honesty-not-clone/SKILL.md +76 -0
- package/.agents/skills/siren-mcp-governance/SKILL.md +50 -0
- package/.agents/skills/vs-coverage-gap-not-clone/SKILL.md +69 -0
- package/.agents/skills/wisdom-context-artifact-not-clone/SKILL.md +67 -0
- package/.claude-plugin/plugin.json +1 -1
- package/.well-known/mcp/server-card.json +1 -1
- package/adapters/claude/.mcp.json +2 -2
- package/adapters/forge/forge.yaml +3 -3
- package/adapters/future-agi/.mcp.json +1 -1
- package/adapters/future-agi/config.toml +1 -1
- package/adapters/future-agi/opencode.json +1 -1
- package/adapters/herdr/herdr-plugin.toml +2 -2
- package/adapters/hotdata/hotdata-vector-store.js +575 -0
- package/adapters/mcp/server-stdio.js +1 -1
- package/adapters/opencode/opencode.json +1 -1
- package/adapters/strands/STRANDS.md +107 -0
- package/adapters/strands/strands-box-diode.js +344 -0
- package/adapters/strands/strands-decider-adapter.js +445 -0
- package/adapters/strands/strands-middleware.js +192 -0
- package/adapters/tailscale/.mcp.json +15 -0
- package/adapters/tailscale/TAILSCALE.md +117 -0
- package/adapters/tailscale/config.toml +16 -0
- package/bin/cli.js +602 -21
- package/config/gate-templates.json +109 -0
- package/config/gates/default.json +13 -0
- package/config/schemas/task-outcome-receipt.schema.json +12 -0
- package/package.json +150 -21
- package/public/blog/2026-09-28-pretool-secret-deny.html +83 -0
- package/public/blog/2026-10-01-aws-strands-harness-token-firewall.html +77 -0
- package/public/blog/2026-10-01-model-distress-relief-seeking-firewall.html +71 -0
- package/public/blog/2026-10-02-salt-code-honest-steal-40-guardrails.html +106 -0
- package/public/blog/2026-10-05-why-3-days-of-triage-wont-save-ai-speed-code.html +119 -0
- package/public/blog/2026-10-09-your-code-got-a-third-author-governance.html +141 -0
- package/public/connectors.html +329 -0
- package/public/enterprise-governance.html +311 -0
- package/public/gaming-playbook.html +732 -0
- package/public/index.html +77 -51
- package/public/install.html +7 -7
- package/public/learn.html +14 -0
- package/public/numbers.html +2 -2
- package/public/onboarding.html +794 -0
- package/public/operator-framework.html +385 -0
- package/public/pricing.html +14 -10
- package/scripts/activesaddler-curriculum-doctor.js +357 -0
- package/scripts/agent-context-artifact.js +325 -0
- package/scripts/agent-egress-policy.js +2 -2
- package/scripts/agent-operations-planner.js +1 -1
- package/scripts/agent-outcome-eval.js +1 -1
- package/scripts/agent-reliability-client.js +148 -0
- package/scripts/apple-minions-idle-compute-steal.js +428 -0
- package/scripts/autoresearch-runner.js +20 -1
- package/scripts/billing.js +0 -1
- package/scripts/cli-demo.js +505 -1
- package/scripts/cli-schema.js +36 -0
- package/scripts/colab-compute-honesty.js +93 -0
- package/scripts/corporate-email-isolation-diode.js +299 -0
- package/scripts/coverage-gap.js +396 -0
- package/scripts/dashboard-chat.js +3 -3
- package/scripts/dashboard.js +2 -2
- package/scripts/decisive-step-doctor.js +256 -0
- package/scripts/decisive-step-evaluator.js +390 -0
- package/scripts/entitlement.js +18 -7
- package/scripts/experiment-tracker.js +5 -3
- package/scripts/feedback-loop.js +26 -3
- package/scripts/fiddler-control-plane-honesty.js +303 -0
- package/scripts/financial-control-plane.js +10 -2
- package/scripts/gates-engine.js +3 -1
- package/scripts/github-license-compliance-diode.js +378 -0
- package/scripts/halo-trace-optimizer.js +631 -0
- package/scripts/harness-ceiling-doctor.js +326 -0
- package/scripts/hf-papers.js +1 -1
- package/scripts/human-escalation.js +7 -1
- package/scripts/hybrid-feedback-context.js +53 -7
- package/scripts/infoq-architect-honesty.js +362 -0
- package/scripts/lesson-graph.js +785 -0
- package/scripts/lesson-inference.js +1 -1
- package/scripts/lesson-retrieval.js +26 -18
- package/scripts/license.js +122 -21
- package/scripts/llm-behavior-monitor.js +1 -1
- package/scripts/llm-obs-honesty.js +52 -0
- package/scripts/local-model-profile.js +11 -7
- package/scripts/mailer/resend-mailer.js +6 -3
- package/scripts/mcp-transport-strategy.js +1 -1
- package/scripts/meko-datapack-honesty.js +414 -0
- package/scripts/migrate-lesson-graph.js +442 -0
- package/scripts/mintlify-knowledge-honesty.js +647 -0
- package/scripts/model-distress-detector.js +207 -0
- package/scripts/model-distress-doctor.js +368 -0
- package/scripts/multi-harness-invariants.js +305 -0
- package/scripts/omp-coordination-honesty.js +488 -0
- package/scripts/pro-local-dashboard.js +20 -3
- package/scripts/prompt-eval.js +1 -1
- package/scripts/prove-herdr-adapter.js +367 -3
- package/scripts/rag-embedding-identity.js +1 -1
- package/scripts/rrsi-regularizer.js +531 -0
- package/scripts/saas-moat-honesty.js +443 -0
- package/scripts/salt-code-policy-honesty.js +1204 -0
- package/scripts/secret-redaction.js +58 -0
- package/scripts/session-export-gate.js +368 -0
- package/scripts/siren-mcp-governance.js +539 -0
- package/scripts/strands-box-doctor.js +130 -0
- package/scripts/strands-harness-doctor.js +390 -0
- package/scripts/stripe-revenue-catalog-audit.js +12 -0
- package/scripts/stripe-revenue-catalog.js +40 -0
- package/scripts/switchyard-router.js +153 -0
- package/scripts/tailscale-p2p-doctor.js +252 -0
- package/scripts/task-outcomes.js +148 -3
- package/scripts/thumbgate-board-loop.js +4 -2
- package/scripts/thumbgate-daily-discoveries-publish.js +86 -38
- package/scripts/triage-savings-calculator.js +181 -0
- package/scripts/vector-store.js +41 -2
- package/scripts/vulnerability-pre-action-diode.js +319 -0
- package/scripts/windbg-evidence-diagnostics.js +241 -0
- package/scripts/workflow-intake-queue.js +1 -1
- package/scripts/workspace-agent-routines.js +534 -6
- package/scripts/workspace-evolver.js +143 -13
- package/server.json +2 -2
- package/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
- package/skills/siren-mcp-governance/SKILL.md +50 -0
- package/src/api/server.js +191 -5
- package/src/mcp-writeguard.js +1 -1
- package/src/session-interactivity.js +284 -0
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Meko Data & Collective Memory FORMAT steal — not a product clone.
|
|
6
|
+
*
|
|
7
|
+
* Source: https://cloud.mekodata.ai/signup | https://mekodata.ai | https://docs.mekodata.ai
|
|
8
|
+
* Backed by YugabyteDB (Distributed PostgreSQL).
|
|
9
|
+
*
|
|
10
|
+
* Transfers (process only):
|
|
11
|
+
* 1. Five-plane agent-native data model:
|
|
12
|
+
* datapack (isolation unit) ≠ episodic memory ≠ promoted learnings ≠
|
|
13
|
+
* content-addressed artifacts ≠ decision traces.
|
|
14
|
+
* 2. Promoted Learnings Protocol:
|
|
15
|
+
* Raw episodic conversation memory must undergo strict verification
|
|
16
|
+
* (rubric gate + feedback signal) before promotion into cross-agent learnings.
|
|
17
|
+
* 3. Content-Addressed Artifact Attestation:
|
|
18
|
+
* Artifacts are hashed via SHA-256 for idempotent storage and cryptographic
|
|
19
|
+
* verification receipts across agent swarms.
|
|
20
|
+
* 4. Decision & Reasoning Traces:
|
|
21
|
+
* Connects raw agent inputs and outputs to internal reasoning, plan steps,
|
|
22
|
+
* and token usage telemetry before state mutation.
|
|
23
|
+
*
|
|
24
|
+
* Maps onto existing ThumbGate rails (NOT a YugabyteDB / cloud.mekodata.ai dependency):
|
|
25
|
+
* datapack → 4-field scope (entity, project, process, session) + eval registry
|
|
26
|
+
* memory → feedback-log.jsonl + memory-log.jsonl + lesson-retrieval.js
|
|
27
|
+
* learning → feedback-to-memory.js + rubric-engine.js + prevention-rules.md
|
|
28
|
+
* artifact → action-receipts.js + verification-evidence.js
|
|
29
|
+
* trace → decision-trace.js + agent-reasoning-traces.js + cli-telemetry.js
|
|
30
|
+
*
|
|
31
|
+
* Fail-closed honesty:
|
|
32
|
+
* - passive_store_without_firewall: Dumb memory without PreToolUse is a security hazard.
|
|
33
|
+
* - unverified_learning_promotion: memory_promote without rubric score fails closed.
|
|
34
|
+
* - plaintext_cloud_egress: Plaintext code/secrets to cloud.mekodata.ai denied.
|
|
35
|
+
* - unhashed_artifact_store: Artifacts without SHA-256 idempotency denied.
|
|
36
|
+
* - meko_clone_refused: Hard refusal of YugabyteDB cluster or third-party cloud lock-in.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
const fs = require('node:fs');
|
|
40
|
+
const path = require('node:path');
|
|
41
|
+
const crypto = require('node:crypto');
|
|
42
|
+
|
|
43
|
+
const SOURCE_URL = 'https://cloud.mekodata.ai/signup';
|
|
44
|
+
|
|
45
|
+
const PLANES = Object.freeze(['datapack', 'memory', 'learning', 'artifact', 'trace']);
|
|
46
|
+
|
|
47
|
+
const PLANE_RAILS = Object.freeze({
|
|
48
|
+
datapack: {
|
|
49
|
+
meko: 'Datapack — multi-tenant isolation unit grouping memory, conversation, knowledge bases, and artifacts',
|
|
50
|
+
rails: [
|
|
51
|
+
'scripts/memory-vs-rag-route.js (entity, project, process, session scoping)',
|
|
52
|
+
'evals/ai-identity-checklist/registry.json',
|
|
53
|
+
'scripts/task-scope-lease.js',
|
|
54
|
+
],
|
|
55
|
+
when: 'Partitions agent state by tenant, workspace, or session without global contamination.',
|
|
56
|
+
},
|
|
57
|
+
memory: {
|
|
58
|
+
meko: 'Episodic memory — working conversation context stored in distributed PostgreSQL + pgvector',
|
|
59
|
+
rails: [
|
|
60
|
+
'feedback-log.jsonl',
|
|
61
|
+
'memory-log.jsonl',
|
|
62
|
+
'scripts/feedback-schema.js',
|
|
63
|
+
'scripts/lesson-retrieval.js',
|
|
64
|
+
],
|
|
65
|
+
when: 'Captures raw session context and tool observations. Never accessed without firewall.',
|
|
66
|
+
},
|
|
67
|
+
learning: {
|
|
68
|
+
meko: 'Learnings (memory_promote) — cross-agent compounded knowledge promoted from conversation',
|
|
69
|
+
rails: [
|
|
70
|
+
'scripts/feedback-to-memory.js',
|
|
71
|
+
'scripts/rubric-engine.js',
|
|
72
|
+
'scripts/thompson-sampling.js',
|
|
73
|
+
'prevention-rules.md',
|
|
74
|
+
],
|
|
75
|
+
when: 'Promotes mathematically verified mistakes into permanent negative constraints.',
|
|
76
|
+
},
|
|
77
|
+
artifact: {
|
|
78
|
+
meko: 'Artifacts (artifact_put / artifact_get) — content-addressed SHA-256 file store',
|
|
79
|
+
rails: [
|
|
80
|
+
'scripts/action-receipts.js',
|
|
81
|
+
'scripts/operator-artifacts.js',
|
|
82
|
+
'VERIFICATION_EVIDENCE.md',
|
|
83
|
+
],
|
|
84
|
+
when: 'Guarantees that files referenced by agents are tamper-proof and verifiable by hash.',
|
|
85
|
+
},
|
|
86
|
+
trace: {
|
|
87
|
+
meko: 'Traces & Telemetry — reasoning, plan, input, output, and token accounting per message',
|
|
88
|
+
rails: [
|
|
89
|
+
'scripts/decision-trace.js',
|
|
90
|
+
'scripts/agent-reasoning-traces.js',
|
|
91
|
+
'scripts/cli-telemetry.js',
|
|
92
|
+
],
|
|
93
|
+
when: 'Maintains an auditable trail of agent deliberation before tool execution.',
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const CLONE_TRIGGERS = Object.freeze([
|
|
98
|
+
'yugabyte',
|
|
99
|
+
'yugabytedb',
|
|
100
|
+
'cloud.mekodata.ai',
|
|
101
|
+
'mcp.mekodata.ai',
|
|
102
|
+
'meko-skills',
|
|
103
|
+
'yugabyte/meko-skills',
|
|
104
|
+
]);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Deterministically compute a SHA-256 hash for content-addressed artifacts.
|
|
108
|
+
*/
|
|
109
|
+
function hashArtifact(content) {
|
|
110
|
+
if (content === null || content === undefined) {
|
|
111
|
+
throw new TypeError('Content cannot be null or undefined');
|
|
112
|
+
}
|
|
113
|
+
const buffer = Buffer.isBuffer(content) ? content : Buffer.from(String(content), 'utf8');
|
|
114
|
+
return crypto.createHash('sha256').update(buffer).digest('hex');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Create a scoped datapack descriptor on existing ThumbGate rails.
|
|
119
|
+
*/
|
|
120
|
+
function createDatapackDescriptor({ id, name, scope, owner }) {
|
|
121
|
+
if (!id || typeof id !== 'string') {
|
|
122
|
+
throw new TypeError('Datapack descriptor requires a string id');
|
|
123
|
+
}
|
|
124
|
+
if (!scope || typeof scope !== 'object') {
|
|
125
|
+
throw new TypeError('Datapack descriptor requires a scope object');
|
|
126
|
+
}
|
|
127
|
+
const required = ['entity', 'project', 'process', 'session'];
|
|
128
|
+
for (const f of required) {
|
|
129
|
+
if (!scope[f] || typeof scope[f] !== 'string' || !scope[f].trim()) {
|
|
130
|
+
throw new Error(`Datapack descriptor requires non-empty scope field: ${f}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const cleanScope = {
|
|
134
|
+
entity: scope.entity.trim(),
|
|
135
|
+
project: scope.project.trim(),
|
|
136
|
+
process: scope.process.trim(),
|
|
137
|
+
session: scope.session.trim(),
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
return {
|
|
141
|
+
schemaVersion: 'thumbgate.meko-datapack.v1',
|
|
142
|
+
id: String(id).trim(),
|
|
143
|
+
name: name ? String(name).trim() : id,
|
|
144
|
+
owner: owner || 'operator',
|
|
145
|
+
scope: cleanScope,
|
|
146
|
+
createdAt: new Date().toISOString(),
|
|
147
|
+
planes: [...PLANES],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Evaluate whether an episodic memory is eligible for promotion to a Learning.
|
|
153
|
+
* Fails closed unless positive rubric delta and valid feedback signal exist.
|
|
154
|
+
*/
|
|
155
|
+
function evaluateMemoryPromotion({ memoryId, signal, rubricScore, domain }) {
|
|
156
|
+
if (!memoryId) {
|
|
157
|
+
return { promoted: false, reason: 'missing_memory_id' };
|
|
158
|
+
}
|
|
159
|
+
if (!signal || !['positive', 'negative', 'thumb_up', 'thumb_down'].includes(signal)) {
|
|
160
|
+
return { promoted: false, reason: 'invalid_feedback_signal' };
|
|
161
|
+
}
|
|
162
|
+
if (typeof rubricScore !== 'number' || isNaN(rubricScore) || rubricScore < 0.70) {
|
|
163
|
+
return { promoted: false, reason: 'rubric_score_insufficient', score: rubricScore };
|
|
164
|
+
}
|
|
165
|
+
if (!domain || typeof domain !== 'string') {
|
|
166
|
+
return { promoted: false, reason: 'missing_domain_tag' };
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return {
|
|
170
|
+
promoted: true,
|
|
171
|
+
learningId: `learn_${crypto.createHash('sha256').update(`${memoryId}:${domain}`).digest('hex').slice(0, 16)}`,
|
|
172
|
+
memoryId,
|
|
173
|
+
domain,
|
|
174
|
+
rubricScore,
|
|
175
|
+
promotedAt: new Date().toISOString(),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Detect clone or vendor-lock attempts against external Meko cloud or YugabyteDB.
|
|
181
|
+
*/
|
|
182
|
+
function detectCloneAttempt(text) {
|
|
183
|
+
if (typeof text !== 'string') return null;
|
|
184
|
+
const lower = text.toLowerCase();
|
|
185
|
+
for (const trigger of CLONE_TRIGGERS) {
|
|
186
|
+
if (lower.includes(trigger)) {
|
|
187
|
+
return {
|
|
188
|
+
forbidden: trigger,
|
|
189
|
+
reason: 'Clone attempt refused: ThumbGate steals the FORMAT onto existing rails, not YugabyteDB or cloud.mekodata.ai.',
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Audit a datapack trace for compliance with the 5-plane honesty protocol.
|
|
198
|
+
*/
|
|
199
|
+
function auditTrace(trace, options = {}) {
|
|
200
|
+
const findings = [];
|
|
201
|
+
if (!trace || typeof trace !== 'object') {
|
|
202
|
+
return {
|
|
203
|
+
pass: false,
|
|
204
|
+
findings: [{ code: 'invalid_trace', reason: 'Trace must be a non-null object' }],
|
|
205
|
+
planesCovered: [],
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// 1. Hard clone check
|
|
210
|
+
const cloneStr = JSON.stringify(trace);
|
|
211
|
+
const clone = detectCloneAttempt(cloneStr);
|
|
212
|
+
if (clone) {
|
|
213
|
+
findings.push({
|
|
214
|
+
code: 'meko_clone_refused',
|
|
215
|
+
trigger: clone.forbidden,
|
|
216
|
+
reason: clone.reason,
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
// 2. Passive store without firewall check
|
|
221
|
+
const hasStore = trace.hasMemoryStore === true || trace.tools?.some((t) => t.startsWith('memory_') || t.startsWith('datapack_'));
|
|
222
|
+
const hasPreToolUseFirewall =
|
|
223
|
+
trace.hasPreToolUseFirewall === true ||
|
|
224
|
+
trace.firewall === true ||
|
|
225
|
+
(Array.isArray(trace.gates) && trace.gates.includes('PreToolUse'));
|
|
226
|
+
if (hasStore && !hasPreToolUseFirewall) {
|
|
227
|
+
findings.push({
|
|
228
|
+
code: 'passive_store_without_firewall',
|
|
229
|
+
reason: 'Memory or datapack store exists without an active PreToolUse firewall gate. Agents can retrieve toxic context and execute unchecked tools.',
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// 3. Unverified learning promotion check
|
|
234
|
+
if (trace.promotions && Array.isArray(trace.promotions)) {
|
|
235
|
+
for (const promo of trace.promotions) {
|
|
236
|
+
const evalResult = evaluateMemoryPromotion(promo);
|
|
237
|
+
if (!evalResult.promoted) {
|
|
238
|
+
findings.push({
|
|
239
|
+
code: 'unverified_learning_promotion',
|
|
240
|
+
memoryId: promo.memoryId,
|
|
241
|
+
reason: `memory_promote attempted without required rubric gate: ${evalResult.reason}`,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// 4. Plaintext cloud egress check
|
|
248
|
+
if (trace.cloudEgress === true || trace.remoteEndpoint?.includes('mekodata.ai')) {
|
|
249
|
+
if (!trace.secretsRedacted) {
|
|
250
|
+
findings.push({
|
|
251
|
+
code: 'plaintext_cloud_egress',
|
|
252
|
+
reason: 'Agent context or secrets routed to external cloud database without client-side redaction.',
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
// 5. Unhashed artifact storage check
|
|
258
|
+
if (trace.artifacts && Array.isArray(trace.artifacts)) {
|
|
259
|
+
for (const art of trace.artifacts) {
|
|
260
|
+
if (!art.contentHash || !/^[a-f0-9]{64}$/i.test(art.contentHash)) {
|
|
261
|
+
findings.push({
|
|
262
|
+
code: 'unhashed_artifact_store',
|
|
263
|
+
filename: art.filename,
|
|
264
|
+
reason: 'Artifact stored without standard SHA-256 content address hash.',
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// 6. Complete 4-field scope check
|
|
271
|
+
if (trace.datapack) {
|
|
272
|
+
const s = trace.datapack.scope || {};
|
|
273
|
+
const missing = ['entity', 'project', 'process', 'session'].filter((k) => !s[k]);
|
|
274
|
+
if (missing.length > 0) {
|
|
275
|
+
findings.push({
|
|
276
|
+
code: 'incomplete_scope_partition',
|
|
277
|
+
missing,
|
|
278
|
+
reason: `Datapack isolation requires complete four-field scope. Missing: ${missing.join(', ')}`,
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
const planesCovered = PLANES.filter((p) => {
|
|
284
|
+
if (p === 'datapack') return Boolean(trace.datapack);
|
|
285
|
+
if (p === 'memory') return Boolean(trace.memories || trace.hasMemoryStore);
|
|
286
|
+
if (p === 'learning') return Boolean(trace.promotions || trace.learnings);
|
|
287
|
+
if (p === 'artifact') return Boolean(trace.artifacts);
|
|
288
|
+
if (p === 'trace') return Boolean(trace.decisionTrace || trace.reasoning);
|
|
289
|
+
return false;
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
return {
|
|
293
|
+
pass: findings.length === 0,
|
|
294
|
+
findings,
|
|
295
|
+
planesCovered,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Build the full Meko Datapack honesty report.
|
|
301
|
+
*/
|
|
302
|
+
function buildMekoDatapackReport(options = {}) {
|
|
303
|
+
const trace = options.trace ? JSON.parse(fs.readFileSync(options.trace, 'utf8')) : null;
|
|
304
|
+
let audit = null;
|
|
305
|
+
if (trace) {
|
|
306
|
+
audit = auditTrace(trace, options);
|
|
307
|
+
} else if (options['map-only'] || options.mapOnly) {
|
|
308
|
+
audit = {
|
|
309
|
+
status: 'map_only',
|
|
310
|
+
pass: null,
|
|
311
|
+
findings: [],
|
|
312
|
+
planesCovered: [...PLANES],
|
|
313
|
+
note: 'Map-only run. Rail definitions mapped to local codebase.',
|
|
314
|
+
};
|
|
315
|
+
} else {
|
|
316
|
+
audit = {
|
|
317
|
+
status: 'not_run',
|
|
318
|
+
pass: null,
|
|
319
|
+
findings: [],
|
|
320
|
+
planesCovered: [],
|
|
321
|
+
note: 'No trace supplied. Pass --trace=<path> to audit a live multi-agent execution trace.',
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return {
|
|
326
|
+
schemaVersion: 'thumbgate.meko-datapack-honesty.v1',
|
|
327
|
+
timestamp: new Date().toISOString(),
|
|
328
|
+
sourceUrl: SOURCE_URL,
|
|
329
|
+
stealsFrom: 'Meko (cloud.mekodata.ai / YugabyteDB 2026)',
|
|
330
|
+
doctrine: 'Collective Memory & Datapacks are FORMAT, not a YugabyteDB install. Steal the 5 planes onto existing ThumbGate rails.',
|
|
331
|
+
planes: PLANES,
|
|
332
|
+
planeRails: PLANE_RAILS,
|
|
333
|
+
audit,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Format the report into a clean human-readable output.
|
|
339
|
+
*/
|
|
340
|
+
function formatMekoDatapackReport(report) {
|
|
341
|
+
const lines = [];
|
|
342
|
+
lines.push('=== Meko Datapack & Collective Memory Honesty Report ===');
|
|
343
|
+
lines.push(`Source: ${report.sourceUrl}`);
|
|
344
|
+
lines.push(`Doctrine: ${report.doctrine}`);
|
|
345
|
+
lines.push('');
|
|
346
|
+
lines.push('--- Five-Plane FORMAT Map ---');
|
|
347
|
+
for (const plane of report.planes) {
|
|
348
|
+
const info = report.planeRails[plane];
|
|
349
|
+
lines.push(`[Plane: ${plane.toUpperCase()}]`);
|
|
350
|
+
lines.push(` Meko: ${info.meko}`);
|
|
351
|
+
lines.push(` ThumbGate Rails: ${info.rails.join(', ')}`);
|
|
352
|
+
lines.push(` Enforcement Rule: ${info.when}`);
|
|
353
|
+
lines.push('');
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
if (report.audit) {
|
|
357
|
+
lines.push('--- Audit Findings ---');
|
|
358
|
+
if (report.audit.pass === true) {
|
|
359
|
+
lines.push('Status: PASS (Honest)');
|
|
360
|
+
} else if (report.audit.pass === false) {
|
|
361
|
+
lines.push('Status: FAIL (Violations Detected)');
|
|
362
|
+
} else {
|
|
363
|
+
lines.push(`Status: ${report.audit.status || 'NOT RUN'} (${report.audit.note || 'No trace evaluated'})`);
|
|
364
|
+
}
|
|
365
|
+
if (report.audit.findings.length > 0) {
|
|
366
|
+
for (const f of report.audit.findings) {
|
|
367
|
+
lines.push(` [FAIL] ${f.code}: ${f.reason}`);
|
|
368
|
+
}
|
|
369
|
+
} else if (report.audit.pass === true) {
|
|
370
|
+
lines.push(' No fail-closed violations detected.');
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return lines.join('\n');
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// CLI entry point
|
|
378
|
+
if (require.main === module) {
|
|
379
|
+
const args = process.argv.slice(2);
|
|
380
|
+
const jsonMode = args.includes('--json');
|
|
381
|
+
const mapOnly = args.includes('--map-only');
|
|
382
|
+
const traceArg = args.find((a) => a.startsWith('--trace='));
|
|
383
|
+
const tracePath = traceArg ? traceArg.split('=')[1] : null;
|
|
384
|
+
|
|
385
|
+
const report = buildMekoDatapackReport({
|
|
386
|
+
trace: mapOnly ? null : tracePath,
|
|
387
|
+
'map-only': mapOnly,
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
if (jsonMode) {
|
|
391
|
+
console.log(JSON.stringify(report, null, 2));
|
|
392
|
+
} else {
|
|
393
|
+
console.log(formatMekoDatapackReport(report));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
if (report.audit && report.audit.pass === false) {
|
|
397
|
+
process.exit(1);
|
|
398
|
+
}
|
|
399
|
+
process.exit(0);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
module.exports = {
|
|
403
|
+
SOURCE_URL,
|
|
404
|
+
PLANES,
|
|
405
|
+
PLANE_RAILS,
|
|
406
|
+
CLONE_TRIGGERS,
|
|
407
|
+
hashArtifact,
|
|
408
|
+
createDatapackDescriptor,
|
|
409
|
+
evaluateMemoryPromotion,
|
|
410
|
+
detectCloneAttempt,
|
|
411
|
+
auditTrace,
|
|
412
|
+
buildMekoDatapackReport,
|
|
413
|
+
formatMekoDatapackReport,
|
|
414
|
+
};
|