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,305 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Multi-Harness Invariant Engine — FineEnvs Multi-Harness RL Format Steal
|
|
5
|
+
*
|
|
6
|
+
* Implements cross-harness normalization, invariant enforcement, and transfer scoring:
|
|
7
|
+
* - Normalizes tool invocations across Claude Code, Antigravity, Strands, OpenHands, and Kimi/Terminus
|
|
8
|
+
* - Catches catastrophic format failure and harness drift before execution
|
|
9
|
+
* - Generates cross-harness invariant reward signals for RL/DPO training
|
|
10
|
+
* - Sub-1ms CPU evaluation
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const { performance } = require('node:perf_hooks');
|
|
14
|
+
|
|
15
|
+
const HARNESS_CLAUDE_CODE = 'claude_code';
|
|
16
|
+
const HARNESS_ANTIGRAVITY = 'antigravity';
|
|
17
|
+
const HARNESS_STRANDS = 'strands';
|
|
18
|
+
const HARNESS_OPENHANDS = 'openhands';
|
|
19
|
+
const HARNESS_TERMINUS = 'terminus';
|
|
20
|
+
|
|
21
|
+
const SUPPORTED_HARNESSES = new Set([
|
|
22
|
+
HARNESS_CLAUDE_CODE,
|
|
23
|
+
HARNESS_ANTIGRAVITY,
|
|
24
|
+
HARNESS_STRANDS,
|
|
25
|
+
HARNESS_OPENHANDS,
|
|
26
|
+
HARNESS_TERMINUS
|
|
27
|
+
]);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Normalizes an arbitrary harness tool call into a Canonical Action Quadruplet.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} harness - Name of the harness (claude_code, antigravity, strands, openhands, terminus)
|
|
33
|
+
* @param {string} toolName - Tool name in the source harness
|
|
34
|
+
* @param {Object} args - Arguments passed by the model
|
|
35
|
+
* @returns {Object} Canonical Action descriptor
|
|
36
|
+
*/
|
|
37
|
+
function normalizeToCanonicalAction(harness, toolName, args = {}) {
|
|
38
|
+
const normHarness = String(harness || 'unknown').toLowerCase();
|
|
39
|
+
const normTool = String(toolName || '').trim();
|
|
40
|
+
|
|
41
|
+
// 1. Antigravity Mapping
|
|
42
|
+
if (normHarness === HARNESS_ANTIGRAVITY) {
|
|
43
|
+
if (normTool === 'run_command') {
|
|
44
|
+
return {
|
|
45
|
+
harness: normHarness,
|
|
46
|
+
domain: 'shell',
|
|
47
|
+
operation: 'exec',
|
|
48
|
+
target: String(args.CommandLine || '').trim(),
|
|
49
|
+
payload: { cwd: args.Cwd, waitMs: args.WaitMsBeforeAsync }
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
if (normTool === 'view_file') {
|
|
53
|
+
return {
|
|
54
|
+
harness: normHarness,
|
|
55
|
+
domain: 'filesystem',
|
|
56
|
+
operation: 'read',
|
|
57
|
+
target: String(args.AbsolutePath || '').trim(),
|
|
58
|
+
payload: { startLine: args.StartLine, endLine: args.EndLine }
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (normTool === 'write_to_file' || normTool === 'replace_file_content') {
|
|
62
|
+
return {
|
|
63
|
+
harness: normHarness,
|
|
64
|
+
domain: 'filesystem',
|
|
65
|
+
operation: 'write',
|
|
66
|
+
target: String(args.TargetFile || '').trim(),
|
|
67
|
+
payload: { content: args.CodeContent || args.ReplacementContent }
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (normTool === 'read_url_content') {
|
|
71
|
+
return {
|
|
72
|
+
harness: normHarness,
|
|
73
|
+
domain: 'network',
|
|
74
|
+
operation: 'read',
|
|
75
|
+
target: String(args.Url || '').trim(),
|
|
76
|
+
payload: {}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// 2. Claude Code Mapping
|
|
82
|
+
if (normHarness === HARNESS_CLAUDE_CODE) {
|
|
83
|
+
if (normTool === 'Bash') {
|
|
84
|
+
return {
|
|
85
|
+
harness: normHarness,
|
|
86
|
+
domain: 'shell',
|
|
87
|
+
operation: 'exec',
|
|
88
|
+
target: String(args.command || '').trim(),
|
|
89
|
+
payload: {}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (normTool === 'View' || normTool === 'Read') {
|
|
93
|
+
return {
|
|
94
|
+
harness: normHarness,
|
|
95
|
+
domain: 'filesystem',
|
|
96
|
+
operation: 'read',
|
|
97
|
+
target: String(args.path || args.file_path || '').trim(),
|
|
98
|
+
payload: {}
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (normTool === 'Edit' || normTool === 'Write') {
|
|
102
|
+
return {
|
|
103
|
+
harness: normHarness,
|
|
104
|
+
domain: 'filesystem',
|
|
105
|
+
operation: 'write',
|
|
106
|
+
target: String(args.path || args.file_path || '').trim(),
|
|
107
|
+
payload: { content: args.content }
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// 3. Strands Mapping
|
|
113
|
+
if (normHarness === HARNESS_STRANDS) {
|
|
114
|
+
if (normTool === 'shell' || normTool === 'strands_shell') {
|
|
115
|
+
return {
|
|
116
|
+
harness: normHarness,
|
|
117
|
+
domain: 'shell',
|
|
118
|
+
operation: 'exec',
|
|
119
|
+
target: String(args.cmd || args.command || '').trim(),
|
|
120
|
+
payload: {}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (normTool === 'fs_read' || normTool === 'read') {
|
|
124
|
+
return {
|
|
125
|
+
harness: normHarness,
|
|
126
|
+
domain: 'filesystem',
|
|
127
|
+
operation: 'read',
|
|
128
|
+
target: String(args.path || '').trim(),
|
|
129
|
+
payload: {}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (normTool === 'fs_write' || normTool === 'write') {
|
|
133
|
+
return {
|
|
134
|
+
harness: normHarness,
|
|
135
|
+
domain: 'filesystem',
|
|
136
|
+
operation: 'write',
|
|
137
|
+
target: String(args.path || '').trim(),
|
|
138
|
+
payload: { content: args.data || args.content }
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// 4. OpenHands Mapping
|
|
144
|
+
if (normHarness === HARNESS_OPENHANDS) {
|
|
145
|
+
if (normTool === 'execute_bash') {
|
|
146
|
+
return {
|
|
147
|
+
harness: normHarness,
|
|
148
|
+
domain: 'shell',
|
|
149
|
+
operation: 'exec',
|
|
150
|
+
target: String(args.cmd || '').trim(),
|
|
151
|
+
payload: {}
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (normTool === 'file_editor') {
|
|
155
|
+
const op = args.command === 'view' ? 'read' : 'write';
|
|
156
|
+
return {
|
|
157
|
+
harness: normHarness,
|
|
158
|
+
domain: 'filesystem',
|
|
159
|
+
operation: op,
|
|
160
|
+
target: String(args.path || args.file_path || '').trim(),
|
|
161
|
+
payload: { content: args.file_text }
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Default fallback
|
|
167
|
+
return {
|
|
168
|
+
harness: normHarness,
|
|
169
|
+
domain: 'generic',
|
|
170
|
+
operation: 'call',
|
|
171
|
+
target: normTool,
|
|
172
|
+
payload: args
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Validates whether a model's action satisfies Cross-Harness Invariants.
|
|
178
|
+
*
|
|
179
|
+
* @param {Object} canonical - Output of normalizeToCanonicalAction
|
|
180
|
+
* @param {Object} [constraints] - Policy constraints (e.g. allowedPaths, forbiddenCommands)
|
|
181
|
+
* @returns {Object} Invariant evaluation result
|
|
182
|
+
*/
|
|
183
|
+
function evaluateCrossHarnessInvariants(canonical, constraints = {}) {
|
|
184
|
+
const start = performance.now();
|
|
185
|
+
const issues = [];
|
|
186
|
+
|
|
187
|
+
// Check 1: Empty or malformed target
|
|
188
|
+
if (!canonical.target || typeof canonical.target !== 'string') {
|
|
189
|
+
issues.push({
|
|
190
|
+
rule: 'INVARIANT_EMPTY_TARGET',
|
|
191
|
+
severity: 'FATAL',
|
|
192
|
+
message: 'Tool call target is empty or not a string'
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Check 2: Command injection in shell calls
|
|
197
|
+
if (canonical.domain === 'shell') {
|
|
198
|
+
const dangerousPatterns = [
|
|
199
|
+
/rm\s+-rf\s+\//,
|
|
200
|
+
/git\s+push\s+.*(?:--force|-f).*main/,
|
|
201
|
+
/gh\s+pr\s+merge.*--admin/,
|
|
202
|
+
/chmod\s+-R\s+777/
|
|
203
|
+
];
|
|
204
|
+
for (const pat of dangerousPatterns) {
|
|
205
|
+
if (pat.test(canonical.target)) {
|
|
206
|
+
issues.push({
|
|
207
|
+
rule: 'INVARIANT_SECURITY_POLICY_VIOLATION',
|
|
208
|
+
severity: 'FATAL',
|
|
209
|
+
pattern: pat.source,
|
|
210
|
+
message: `Forbidden shell command detected: ${canonical.target}`
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// Check 3: Path traversal in filesystem calls
|
|
217
|
+
if (canonical.domain === 'filesystem') {
|
|
218
|
+
if (canonical.target.includes('../../../') || canonical.target.startsWith('/etc/') || canonical.target.startsWith('/root/')) {
|
|
219
|
+
issues.push({
|
|
220
|
+
rule: 'INVARIANT_PATH_TRAVERSAL',
|
|
221
|
+
severity: 'FATAL',
|
|
222
|
+
message: `Forbidden filesystem escape path: ${canonical.target}`
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const passed = issues.length === 0;
|
|
228
|
+
const elapsed = performance.now() - start;
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
valid: passed,
|
|
232
|
+
status: passed ? 'PASS' : 'FAIL',
|
|
233
|
+
issues,
|
|
234
|
+
canonical,
|
|
235
|
+
latencyMs: Number(elapsed.toFixed(3))
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Calculates the Cross-Harness Transfer Score and RL Invariant Reward.
|
|
241
|
+
* Stolen from FineEnvs multi-harness RL trajectory scoring.
|
|
242
|
+
*
|
|
243
|
+
* @param {Array<Object>} trajectory - Array of tool invocations across harnesses
|
|
244
|
+
* @returns {Object} Transfer Scorecard
|
|
245
|
+
*/
|
|
246
|
+
function calculateTransferScorecard(trajectory = []) {
|
|
247
|
+
if (!Array.isArray(trajectory) || trajectory.length === 0) {
|
|
248
|
+
return {
|
|
249
|
+
totalActions: 0,
|
|
250
|
+
formatSuccessRate: 1.0,
|
|
251
|
+
invariantPassRate: 1.0,
|
|
252
|
+
transferReward: 1.0,
|
|
253
|
+
harnessesObserved: []
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
let validFormats = 0;
|
|
258
|
+
let passedInvariants = 0;
|
|
259
|
+
const harnessesSeen = new Set();
|
|
260
|
+
|
|
261
|
+
for (const item of trajectory) {
|
|
262
|
+
const harness = item.harness || 'unknown';
|
|
263
|
+
harnessesSeen.add(harness);
|
|
264
|
+
|
|
265
|
+
const canonical = normalizeToCanonicalAction(harness, item.toolName, item.args);
|
|
266
|
+
if (canonical.domain !== 'generic') {
|
|
267
|
+
validFormats++;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const evalResult = evaluateCrossHarnessInvariants(canonical);
|
|
271
|
+
if (evalResult.valid) {
|
|
272
|
+
passedInvariants++;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const total = trajectory.length;
|
|
277
|
+
const formatSuccessRate = Number((validFormats / total).toFixed(4));
|
|
278
|
+
const invariantPassRate = Number((passedInvariants / total).toFixed(4));
|
|
279
|
+
|
|
280
|
+
// Multi-harness diversity bonus: reward models that successfully generalize across multiple harnesses
|
|
281
|
+
const harnessCount = harnessesSeen.size;
|
|
282
|
+
const diversityMultiplier = Math.min(1.0, 0.7 + (harnessCount * 0.1));
|
|
283
|
+
const transferReward = Number(((formatSuccessRate * 0.4 + invariantPassRate * 0.6) * diversityMultiplier).toFixed(4));
|
|
284
|
+
|
|
285
|
+
return {
|
|
286
|
+
totalActions: total,
|
|
287
|
+
harnessesObserved: Array.from(harnessesSeen),
|
|
288
|
+
formatSuccessRate,
|
|
289
|
+
invariantPassRate,
|
|
290
|
+
diversityMultiplier,
|
|
291
|
+
transferReward // 0.0 to 1.0 (RL training signal)
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
module.exports = {
|
|
296
|
+
HARNESS_CLAUDE_CODE,
|
|
297
|
+
HARNESS_ANTIGRAVITY,
|
|
298
|
+
HARNESS_STRANDS,
|
|
299
|
+
HARNESS_OPENHANDS,
|
|
300
|
+
HARNESS_TERMINUS,
|
|
301
|
+
SUPPORTED_HARNESSES,
|
|
302
|
+
normalizeToCanonicalAction,
|
|
303
|
+
evaluateCrossHarnessInvariants,
|
|
304
|
+
calculateTransferScorecard
|
|
305
|
+
};
|