thumbgate 1.37.3 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/.agents/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
  2. package/.agents/skills/halo-trace-optimize-not-clone/SKILL.md +60 -0
  3. package/.agents/skills/infoq-architect-honesty-not-clone/SKILL.md +37 -0
  4. package/.agents/skills/meko-datapack-honesty-not-clone/SKILL.md +45 -0
  5. package/.agents/skills/mintlify-knowledge-honesty-not-clone/SKILL.md +49 -0
  6. package/.agents/skills/model-distress-governance/SKILL.md +56 -0
  7. package/.agents/skills/salt-code-policy-honesty-not-clone/SKILL.md +76 -0
  8. package/.claude-plugin/plugin.json +1 -1
  9. package/.well-known/mcp/server-card.json +1 -1
  10. package/adapters/claude/.mcp.json +2 -2
  11. package/adapters/forge/forge.yaml +3 -3
  12. package/adapters/future-agi/.mcp.json +1 -1
  13. package/adapters/future-agi/config.toml +1 -1
  14. package/adapters/future-agi/opencode.json +1 -1
  15. package/adapters/herdr/herdr-plugin.toml +2 -2
  16. package/adapters/mcp/server-stdio.js +1 -1
  17. package/adapters/opencode/opencode.json +1 -1
  18. package/adapters/strands/STRANDS.md +107 -0
  19. package/adapters/strands/strands-middleware.js +192 -0
  20. package/adapters/tailscale/.mcp.json +15 -0
  21. package/adapters/tailscale/TAILSCALE.md +117 -0
  22. package/adapters/tailscale/config.toml +16 -0
  23. package/bin/cli.js +130 -0
  24. package/config/gate-templates.json +72 -0
  25. package/package.json +54 -9
  26. package/public/blog/2026-09-28-pretool-secret-deny.html +83 -0
  27. package/public/blog/2026-10-01-aws-strands-harness-token-firewall.html +77 -0
  28. package/public/blog/2026-10-01-model-distress-relief-seeking-firewall.html +71 -0
  29. package/public/blog/2026-10-02-salt-code-honest-steal-40-guardrails.html +106 -0
  30. package/public/index.html +2 -2
  31. package/public/install.html +7 -7
  32. package/public/numbers.html +2 -2
  33. package/public/onboarding.html +794 -0
  34. package/scripts/autoresearch-runner.js +20 -1
  35. package/scripts/experiment-tracker.js +5 -3
  36. package/scripts/halo-trace-optimizer.js +631 -0
  37. package/scripts/infoq-architect-honesty.js +362 -0
  38. package/scripts/meko-datapack-honesty.js +414 -0
  39. package/scripts/mintlify-knowledge-honesty.js +647 -0
  40. package/scripts/model-distress-detector.js +207 -0
  41. package/scripts/model-distress-doctor.js +200 -0
  42. package/scripts/rrsi-regularizer.js +445 -0
  43. package/scripts/salt-code-policy-honesty.js +1204 -0
  44. package/scripts/strands-harness-doctor.js +390 -0
  45. package/scripts/tailscale-p2p-doctor.js +252 -0
  46. package/scripts/workspace-evolver.js +143 -13
  47. package/server.json +2 -2
  48. package/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
  49. package/src/api/server.js +33 -4
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ const { randomInt } = require('node:crypto');
3
4
  const { spawnSync } = require('node:child_process');
4
5
 
5
6
  const {
@@ -15,6 +16,15 @@ const {
15
16
  restoreEvolutionSnapshot,
16
17
  withTemporaryEvolutionSettings,
17
18
  } = require('./evolution-state');
19
+ const {
20
+ calculateAnnealedBudget,
21
+ calculateAnnealedStepMultiplier,
22
+ screenLeakage,
23
+ computeComplexityDelta,
24
+ evaluateComplexityRegularizedScore,
25
+ detectStagnation,
26
+ selectTargetWithExploration,
27
+ } = require('./rrsi-regularizer');
18
28
 
19
29
  const DEFAULT_TIMEOUT_MS = 120000;
20
30
 
@@ -115,8 +125,7 @@ function parseCommandLine(cmdString) {
115
125
  let inSingleQuote = false;
116
126
  let escaped = false;
117
127
 
118
- for (let i = 0; i < cmdString.length; i++) {
119
- const char = cmdString[i];
128
+ for (const char of cmdString) {
120
129
 
121
130
  if (escaped) {
122
131
  current += char;
@@ -248,13 +257,18 @@ function evaluateWorkspace({
248
257
  };
249
258
  }
250
259
 
251
- function chooseNextValue(target, currentValue, requestedValue = undefined) {
260
+ function chooseNextValue(target, currentValue, requestedValue = undefined, stepMultiplier = 1.0) {
252
261
  if (Number.isFinite(requestedValue)) {
253
262
  return Math.max(target.range[0], Math.min(target.range[1], requestedValue));
254
263
  }
255
264
 
256
- const direction = Math.random() >= 0.5 ? 1 : -1;
257
- const candidate = currentValue + (direction * target.step);
265
+ const direction = randomInt(0, 2) === 1 ? 1 : -1;
266
+ const rawStep = target.step * (Number.isFinite(stepMultiplier) ? stepMultiplier : 1.0);
267
+ const effectiveStep = typeof target.step === 'number' && Number.isInteger(target.step)
268
+ ? Math.max(1, Math.round(rawStep))
269
+ : Math.max(1e-4, rawStep);
270
+
271
+ const candidate = currentValue + (direction * effectiveStep);
258
272
  const bounded = Math.max(target.range[0], Math.min(target.range[1], candidate));
259
273
  return typeof target.step === 'number' && Number.isInteger(target.step)
260
274
  ? Math.round(bounded)
@@ -275,21 +289,88 @@ function recommendEvolutionTarget({ failureType, tags = [] } = {}) {
275
289
  return 'half_life_days';
276
290
  }
277
291
 
278
- function runWorkspaceEvolution(opts = {}) {
279
- const target = opts.targetName
280
- ? EVOLUTION_TARGETS.find((entry) => entry.name === opts.targetName)
281
- : EVOLUTION_TARGETS[Math.floor(Math.random() * EVOLUTION_TARGETS.length)];
292
+ function resolveEvolutionTarget(opts, enableRRSI, history) {
293
+ if (opts.targetName) {
294
+ const target = EVOLUTION_TARGETS.find((entry) => entry.name === opts.targetName);
295
+ if (!target) {
296
+ throw new Error(`Unknown evolution target: ${opts.targetName}`);
297
+ }
298
+ return { target, meta: null };
299
+ }
282
300
 
283
- if (!target) {
284
- throw new Error(`Unknown evolution target: ${opts.targetName}`);
301
+ if (enableRRSI) {
302
+ const stagnation = detectStagnation(history, { windowSize: opts.stagnationWindow });
303
+ const selection = selectTargetWithExploration({
304
+ targets: EVOLUTION_TARGETS,
305
+ history,
306
+ isStagnant: stagnation.isStagnant,
307
+ });
308
+ return { target: selection.target, meta: selection };
285
309
  }
286
310
 
311
+ const index = randomInt(0, EVOLUTION_TARGETS.length);
312
+ return { target: EVOLUTION_TARGETS[index], meta: null };
313
+ }
314
+
315
+ function evaluateCandidateMutation({
316
+ target,
317
+ currentValue,
318
+ nextValue,
319
+ enableRRSI,
320
+ candidateEvaluation,
321
+ baselineEvaluation,
322
+ opts,
323
+ }) {
324
+ const complexityDelta = enableRRSI
325
+ ? computeComplexityDelta(nextValue, currentValue, { range: target.range })
326
+ : 0;
327
+
328
+ if (enableRRSI) {
329
+ const rrsiDecision = evaluateComplexityRegularizedScore({
330
+ baselineScore: baselineEvaluation.score,
331
+ candidateScore: candidateEvaluation.score,
332
+ testsPassed: candidateEvaluation.passed,
333
+ complexityDelta,
334
+ }, {
335
+ lambda: opts.lambda,
336
+ stabilityFloor: opts.stabilityFloor,
337
+ });
338
+ return {
339
+ kept: rrsiDecision.accepted,
340
+ rrsiDecision,
341
+ complexityDelta,
342
+ };
343
+ }
344
+
345
+ return {
346
+ kept: candidateEvaluation.passed && candidateEvaluation.score > baselineEvaluation.score,
347
+ rrsiDecision: null,
348
+ complexityDelta,
349
+ };
350
+ }
351
+
352
+ function runWorkspaceEvolution(opts = {}) {
353
+ const enableRRSI = opts.enableRRSI !== false;
354
+ const iteration = Number.isFinite(opts.iteration) ? opts.iteration : 0;
355
+ const totalIterations = Number.isFinite(opts.totalIterations) ? opts.totalIterations : 1;
356
+ const history = Array.isArray(opts.history) ? opts.history : [];
357
+
358
+ const { target, meta: targetSelectionMeta } = resolveEvolutionTarget(opts, enableRRSI, history);
359
+
287
360
  const primaryCommands = normalizeCommands(opts.primaryCommands || opts.testCommand, ['npm test']);
288
361
  const holdoutCommands = normalizeCommands(opts.holdoutCommands, []);
289
362
  const timeoutMs = Number.isFinite(opts.timeoutMs) ? opts.timeoutMs : DEFAULT_TIMEOUT_MS;
290
363
  const feedbackDir = opts.feedbackDir;
291
364
  const currentValue = getEffectiveSetting(target.settingKey, target.range[0], feedbackDir);
292
- const nextValue = chooseNextValue(target, currentValue, opts.nextValue);
365
+
366
+ const stepMultiplier = enableRRSI
367
+ ? calculateAnnealedStepMultiplier(iteration, totalIterations)
368
+ : 1.0;
369
+ const annealedBudget = enableRRSI
370
+ ? calculateAnnealedBudget(iteration, totalIterations)
371
+ : 1;
372
+
373
+ const nextValue = chooseNextValue(target, currentValue, opts.nextValue, stepMultiplier);
293
374
 
294
375
  if (nextValue === currentValue) {
295
376
  return {
@@ -301,6 +382,30 @@ function runWorkspaceEvolution(opts = {}) {
301
382
  };
302
383
  }
303
384
 
385
+ // RRSI Selection Critic: screen proposed mutation & commands for benchmark leakage
386
+ if (enableRRSI) {
387
+ const leakageCheck = screenLeakage({
388
+ target: target.name,
389
+ settingKey: target.settingKey,
390
+ from: currentValue,
391
+ to: nextValue,
392
+ hypothesisSuffix: opts.hypothesisSuffix,
393
+ primaryCommands,
394
+ holdoutCommands,
395
+ });
396
+
397
+ if (!leakageCheck.passed) {
398
+ return {
399
+ skipped: true,
400
+ reason: `[RRSI Leakage Critic] ${leakageCheck.reason}`,
401
+ leakageCheck,
402
+ target,
403
+ currentValue,
404
+ nextValue,
405
+ };
406
+ }
407
+ }
408
+
304
409
  const experiment = createExperiment({
305
410
  name: `${target.name}: ${currentValue} → ${nextValue}`,
306
411
  hypothesis: [
@@ -332,7 +437,18 @@ function runWorkspaceEvolution(opts = {}) {
332
437
  [target.settingKey]: nextValue,
333
438
  }, () => evaluateWorkspace(evaluationOptions), feedbackDir);
334
439
 
335
- const kept = candidateEvaluation.passed && candidateEvaluation.score > baselineEvaluation.score;
440
+
441
+
442
+ const { kept, rrsiDecision, complexityDelta } = evaluateCandidateMutation({
443
+ target,
444
+ currentValue,
445
+ nextValue,
446
+ enableRRSI,
447
+ candidateEvaluation,
448
+ baselineEvaluation,
449
+ opts,
450
+ });
451
+
336
452
  const acceptedMutation = kept
337
453
  ? applyAcceptedMutation({
338
454
  targetKey: target.settingKey,
@@ -353,6 +469,8 @@ function runWorkspaceEvolution(opts = {}) {
353
469
  score: candidateEvaluation.score,
354
470
  baseline: baselineEvaluation.score,
355
471
  testsPassed: candidateEvaluation.passed,
472
+ kept,
473
+ reason: rrsiDecision ? rrsiDecision.reason : undefined,
356
474
  metrics: {
357
475
  target: target.name,
358
476
  settingKey: target.settingKey,
@@ -364,6 +482,17 @@ function runWorkspaceEvolution(opts = {}) {
364
482
  candidateEvaluation,
365
483
  evolutionStatePath: getEvolutionPaths(feedbackDir).statePath,
366
484
  rollbackSnapshotId: acceptedMutation ? acceptedMutation.rollbackSnapshot.snapshotId : null,
485
+ rrsi: enableRRSI ? {
486
+ enabled: true,
487
+ iteration,
488
+ totalIterations,
489
+ annealedBudget,
490
+ stepMultiplier,
491
+ complexityDelta,
492
+ penalty: rrsiDecision?.penalty ?? 0,
493
+ regularizedDelta: rrsiDecision?.regularizedDelta ?? (candidateEvaluation.score - baselineEvaluation.score),
494
+ targetStrategy: targetSelectionMeta?.strategy ?? 'explicit',
495
+ } : { enabled: false },
367
496
  ...(opts.additionalMetrics || {}),
368
497
  },
369
498
  });
@@ -378,6 +507,7 @@ function runWorkspaceEvolution(opts = {}) {
378
507
  candidateEvaluation,
379
508
  acceptedMutation,
380
509
  evolutionState: readEvolutionState(feedbackDir),
510
+ rrsiDecision,
381
511
  };
382
512
  }
383
513
 
package/server.json CHANGED
@@ -8,13 +8,13 @@
8
8
  "source": "github",
9
9
  "url": "https://github.com/IgorGanapolsky/ThumbGate"
10
10
  },
11
- "version": "1.37.3",
11
+ "version": "1.38.0",
12
12
  "packages": [
13
13
  {
14
14
  "registryType": "npm",
15
15
  "registryBaseUrl": "https://registry.npmjs.org",
16
16
  "identifier": "thumbgate",
17
- "version": "1.37.3",
17
+ "version": "1.38.0",
18
18
  "runtimeHint": "npx",
19
19
  "runtimeArguments": [
20
20
  {
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: aws-strands-harness-not-clone
3
+ description: >
4
+ AWS Strands Harness (The New Stack 2026-10 / Marc Brooker) is an agent
5
+ runtime architecture, not a ThumbGate clone. Steal the three context-management
6
+ defaults (output shunting <= 350 lines, 75% compaction threshold, in-loop
7
+ recovery) and inject ThumbGate's PreToolUse diode. Never vendor Bedrock-only
8
+ dependencies. Slash: /aws-strands-harness-not-clone.
9
+ ---
10
+
11
+ # AWS Strands Harness — FORMAT Steal, Not Clone
12
+
13
+ ## Goal
14
+
15
+ Provide fail-closed pre-action governance and token-shunted output bounds for agents running on AWS Strands Harness (`@strands-agents/harness` or `strands-harness`), capturing the 45% (and 77% Terminal-Bench 2.1) token savings while preventing destructive tool actions.
16
+
17
+ ## Constraints
18
+
19
+ | NEVER | ALWAYS |
20
+ | --- | --- |
21
+ | Clone or install Bedrock-only proprietary packages | Use decoupled providers (Bedrock, Anthropic, OpenAI, Ollama) |
22
+ | Allow un-shunted raw tool returns (> 350 lines / 16KB) | Truncate with `evaluateOutputShunt` offset markers |
23
+ | Drop durable prevention rules during context compaction | Pin ThumbGate rules across 75% compaction threshold |
24
+ | Crash the agent loop on context overflow | Recover in-loop by pruning non-pinned conversational history |
25
+ | Execute mutating shell/file tools without governance | Run ThumbGate `PreToolUse` diode before dispatch |
26
+ | Claim 77% savings without citing Terminal-Bench 2.1 | Ground benchmarks in measured tool-output reduction |
27
+
28
+ HARD fail closed. REFUSE un-gated autonomous execution.
29
+
30
+ ## Reference
31
+
32
+ - The New Stack (2026-10): *AWS open-sources an AI agent it says is 45% cheaper than Claude Code and Codex*
33
+ - `scripts/strands-harness-doctor.js`
34
+ - `adapters/strands/strands-middleware.js`
35
+ - `adapters/strands/config.json`
36
+ - `adapters/strands/STRANDS.md`
37
+ - `docs/agents/aws-strands-harness.md`
38
+
39
+ ## Usage
40
+
41
+ ```bash
42
+ # Audit Strands Harness compliance
43
+ node scripts/strands-harness-doctor.js
44
+
45
+ # Machine-readable output
46
+ node scripts/strands-harness-doctor.js --json
47
+
48
+ # Architectural map
49
+ node scripts/strands-harness-doctor.js --map-only
50
+
51
+ # CI Gate check
52
+ node scripts/strands-harness-doctor.js --check
53
+ ```
package/src/api/server.js CHANGED
@@ -338,6 +338,7 @@ const FOUNDERS_PAGE_PATH = path.resolve(__dirname, '../../public/founders.html')
338
338
  const PARTNER_INTAKE_PAGE_PATH = path.resolve(__dirname, '../../public/partner-intake.html');
339
339
  const PETER_PAGE_PATH = path.resolve(__dirname, '../../public/peter.html');
340
340
  const INSTALL_PAGE_PATH = path.resolve(__dirname, '../../public/install.html');
341
+ const ONBOARDING_PAGE_PATH = path.resolve(__dirname, '../../public/onboarding.html');
341
342
  const LEARN_DIR = path.resolve(__dirname, '../../public/learn');
342
343
  const GUIDES_DIR = path.resolve(__dirname, '../../public/guides');
343
344
  const COMPARE_DIR = path.resolve(__dirname, '../../public/compare');
@@ -3575,6 +3576,10 @@ function loadLearnPageHtml(runtimeConfig, pageContext = {}) {
3575
3576
  return loadPublicMarketingTemplateHtml(LEARN_PAGE_PATH, runtimeConfig, pageContext);
3576
3577
  }
3577
3578
 
3579
+ function loadOnboardingPageHtml(runtimeConfig, pageContext = {}) {
3580
+ return loadPublicMarketingTemplateHtml(ONBOARDING_PAGE_PATH, runtimeConfig, pageContext);
3581
+ }
3582
+
3578
3583
  function readOptionalPublicTemplate(filePath) {
3579
3584
  try {
3580
3585
  return fs.readFileSync(filePath, 'utf-8');
@@ -5788,7 +5793,7 @@ function createApiServer() {
5788
5793
  return;
5789
5794
  }
5790
5795
  }
5791
- (async () => {
5796
+ void (async () => {
5792
5797
  try {
5793
5798
  const { callTool } = require('../../adapters/mcp/server-stdio');
5794
5799
  const name = msg.params?.name;
@@ -6671,6 +6676,25 @@ async function addContext(){
6671
6676
  return;
6672
6677
  }
6673
6678
 
6679
+ if (isGetLikeRequest && (pathname === '/onboarding' || pathname === '/onboarding.html')) {
6680
+ try {
6681
+ servePublicMarketingPage({
6682
+ req,
6683
+ res,
6684
+ parsed,
6685
+ hostedConfig,
6686
+ isHeadRequest,
6687
+ renderHtml: loadOnboardingPageHtml,
6688
+ extraTelemetry: {
6689
+ pageType: 'onboarding',
6690
+ },
6691
+ });
6692
+ } catch (err) {
6693
+ sendText(res, 500, err.message || 'Onboarding page unavailable');
6694
+ }
6695
+ return;
6696
+ }
6697
+
6674
6698
 
6675
6699
  // Partner co-branded case study (Peter Yang / high-ROI acquisition landing).
6676
6700
  if (isGetLikeRequest && (pathname === '/peter' || pathname === '/peter.html')) {
@@ -11444,7 +11468,12 @@ module.exports = {
11444
11468
  };
11445
11469
 
11446
11470
  if (require.main === module) {
11447
- startServer().then(({ host, port }) => {
11448
- console.log(`ThumbGate API listening on http://${host}:${port}`);
11449
- });
11471
+ startServer()
11472
+ .then(({ host, port }) => {
11473
+ console.log(`ThumbGate API listening on http://${host}:${port}`);
11474
+ })
11475
+ .catch((err) => {
11476
+ console.error('Failed to start ThumbGate server:', err);
11477
+ process.exit(1);
11478
+ });
11450
11479
  }