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
@@ -0,0 +1,192 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * adapters/strands/strands-middleware.js
5
+ *
6
+ * ThumbGate Governance Middleware for AWS Strands Harness (`@strands-agents/harness` & Python `strands-harness`).
7
+ *
8
+ * Injects:
9
+ * 1. PreToolUse Safety Diode: Intercepts and blocks dangerous or unverified tool mutations before execution.
10
+ * 2. Token-Shunt Output Truncation: Prevents massive tool outputs from blowing up the context window.
11
+ * 3. Context Compaction Guardian: Retains durable ThumbGate prevention rules during window compaction.
12
+ */
13
+
14
+ const { evaluateOutputShunt, evaluatePreActionDiode } = require('../../scripts/strands-harness-doctor');
15
+
16
+ function createStrandsGateMiddleware(options = {}) {
17
+ const shuntConfig = options.tokenShunt || { maxOutputLines: 350, maxOutputBytes: 16384 };
18
+ const preActionEnabled = options.preActionDiode?.enabled !== false;
19
+ const defaultPinnedRules = options.pinnedRules && options.pinnedRules.length > 0
20
+ ? options.pinnedRules
21
+ : ['Always verify against local tests before claiming completion'];
22
+
23
+ return {
24
+ name: 'thumbgate-strands-middleware',
25
+ version: '1.0.0',
26
+
27
+ /**
28
+ * Hook called by Strands Harness right before a tool is dispatched.
29
+ * Supports both Strands native event format (event.toolUse, event.cancel)
30
+ * and direct parameters ({ toolName, input }).
31
+ */
32
+ async beforeToolCall(event = {}) {
33
+ if (!preActionEnabled) {
34
+ return { allow: true };
35
+ }
36
+
37
+ const toolName = event.toolUse?.name || event.toolName || '';
38
+ const input = event.toolUse?.input !== undefined ? event.toolUse.input : event.input;
39
+
40
+ const evaluation = evaluatePreActionDiode({ name: toolName, input });
41
+ if (evaluation.decision === 'BLOCK') {
42
+ const reason = evaluation.violation || 'Action blocked by ThumbGate pre-action diode';
43
+ if (typeof event === 'object' && event !== null) {
44
+ event.cancel = true;
45
+ event.reason = reason;
46
+ }
47
+ return {
48
+ allow: false,
49
+ decision: 'BLOCK',
50
+ reason,
51
+ toolName,
52
+ timestamp: new Date().toISOString(),
53
+ };
54
+ }
55
+
56
+ return {
57
+ allow: true,
58
+ decision: 'ALLOW',
59
+ toolName,
60
+ };
61
+ },
62
+
63
+ /**
64
+ * Hook called by Strands Harness right after a tool produces output.
65
+ * Truncates oversized returns to enforce token efficiency.
66
+ * Supports updating native event.result in place (retaining ToolResultBlock structure).
67
+ */
68
+ async afterToolCall(event = {}) {
69
+ const rawResult = event.result !== undefined ? event.result : event;
70
+ let outputText = '';
71
+ if (typeof rawResult === 'string') {
72
+ outputText = rawResult;
73
+ } else if (rawResult && typeof rawResult === 'object') {
74
+ if (Array.isArray(rawResult.content)) {
75
+ outputText = rawResult.content.map((c) => (typeof c === 'string' ? c : c.text || '')).join('\n');
76
+ } else if (typeof rawResult.text === 'string') {
77
+ outputText = rawResult.text;
78
+ } else {
79
+ outputText = JSON.stringify(rawResult);
80
+ }
81
+ } else {
82
+ outputText = String(rawResult || '');
83
+ }
84
+
85
+ const shunt = evaluateOutputShunt(outputText, shuntConfig);
86
+
87
+ if (shunt.shunted) {
88
+ if (typeof event === 'object' && event !== null && 'result' in event) {
89
+ if (event.result && typeof event.result === 'object') {
90
+ if (Array.isArray(event.result.content)) {
91
+ event.result.content = [{ type: 'text', text: shunt.shuntedContent }];
92
+ } else if ('text' in event.result) {
93
+ event.result.text = shunt.shuntedContent;
94
+ } else {
95
+ event.result.content = [{ type: 'text', text: shunt.shuntedContent }];
96
+ }
97
+ } else {
98
+ event.result = shunt.shuntedContent;
99
+ }
100
+ }
101
+ return {
102
+ shunted: true,
103
+ result: shunt.shuntedContent,
104
+ reductionPct: shunt.reductionPct,
105
+ originalLines: shunt.originalLineCount,
106
+ shuntedLines: shunt.shuntedLineCount,
107
+ };
108
+ }
109
+
110
+ return {
111
+ shunted: false,
112
+ result: rawResult,
113
+ };
114
+ },
115
+
116
+ /**
117
+ * Hook or ContextStrategy called when context utilization reaches threshold.
118
+ * Implements Strands ContextStrategy.apply(context) returning boolean while
119
+ * retaining pinned rules in conversation history.
120
+ */
121
+ onContextCompaction(param = {}) {
122
+ const context = param.context || param;
123
+ const history = Array.isArray(param.history)
124
+ ? param.history
125
+ : (context && Array.isArray(context.messages) ? context.messages : []);
126
+ const pinnedRules = (param && Array.isArray(param.pinnedRules) && param.pinnedRules.length > 0)
127
+ ? param.pinnedRules
128
+ : defaultPinnedRules;
129
+ const preservedRules = pinnedRules.map((r) => `[PINNED RULE]: ${r}`);
130
+
131
+ let applied = false;
132
+ if (preservedRules.length > 0) {
133
+ const prefix = preservedRules.join('\n');
134
+ if (history.length > 0 && typeof history[0] === 'object') {
135
+ if (typeof history[0].content === 'string') {
136
+ if (!history[0].content.includes('[PINNED RULE]')) {
137
+ history[0].content = `${prefix}\n\n${history[0].content}`;
138
+ applied = true;
139
+ }
140
+ } else if (Array.isArray(history[0].content)) {
141
+ history[0].content.unshift({ type: 'text', text: prefix });
142
+ applied = true;
143
+ }
144
+ } else if (Array.isArray(history)) {
145
+ history.unshift({ role: 'system', content: prefix });
146
+ applied = true;
147
+ }
148
+ }
149
+
150
+ return {
151
+ compacted: true,
152
+ applied,
153
+ injectedPrefix: preservedRules.join('\n'),
154
+ timestamp: new Date().toISOString(),
155
+ };
156
+ },
157
+
158
+ /**
159
+ * Strands ContextStrategy contract: apply(context) => boolean
160
+ */
161
+ apply(context) {
162
+ if (!context) return false;
163
+ const res = this.onContextCompaction(context);
164
+ return res && typeof res === 'object' ? Boolean(res.applied || res.compacted) : Boolean(res);
165
+ },
166
+ };
167
+ }
168
+
169
+ /**
170
+ * Helper to register ThumbGate middleware with a Strands Agent instance.
171
+ */
172
+ function registerStrandsGatePlugin(agent, options = {}) {
173
+ const middleware = createStrandsGateMiddleware(options);
174
+ if (agent && typeof agent.addHook === 'function') {
175
+ agent.addHook('beforeToolCall', (e) => middleware.beforeToolCall(e));
176
+ agent.addHook('afterToolCall', (e) => middleware.afterToolCall(e));
177
+ agent.addHook('onContextCompaction', (e) => middleware.onContextCompaction(e));
178
+ }
179
+ if (agent && agent.contextManager) {
180
+ if (typeof agent.contextManager.addStrategy === 'function') {
181
+ agent.contextManager.addStrategy(middleware);
182
+ } else if (typeof agent.contextManager.onCompaction === 'function') {
183
+ agent.contextManager.onCompaction((e) => middleware.onContextCompaction(e));
184
+ }
185
+ }
186
+ return middleware;
187
+ }
188
+
189
+ module.exports = {
190
+ createStrandsGateMiddleware,
191
+ registerStrandsGatePlugin,
192
+ };
@@ -0,0 +1,15 @@
1
+ {
2
+ "mcpServers": {
3
+ "thumbgate-tailscale": {
4
+ "command": "node",
5
+ "args": [
6
+ "scripts/tailscale-p2p-doctor.js",
7
+ "--serve-mcp"
8
+ ],
9
+ "env": {
10
+ "THUMBGATE_ADAPTER": "tailscale",
11
+ "THUMBGATE_P2P_PORT": "9877"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,117 @@
1
+ # Tailscale P2P Governance & Zero-Trust Diode Adapter
2
+
3
+ > **Format Steal (HiveMind & Tailscale PAM) — Compare, Not Clone**
4
+ >
5
+ > **Steal from HiveMind (`projectmentor/hive-mind`):** Peer-to-peer decentralized synchronization over a private Tailnet using append-only journals and G-Set CRDTs (Conflict-free Replicated Data Types).
6
+ >
7
+ > **Steal from Tailscale PAM:** Zero-Trust identity verification and privileged infrastructure diode, pairing network-level WireGuard access control with ThumbGate's tool-level PreToolUse gating.
8
+ >
9
+ > **Never clone:** Do not clone HiveMind's passive notes-only memory format, do not require root SSH access across nodes, and do not introduce centralized cloud brokers or coordinators.
10
+
11
+ ---
12
+
13
+ ## 1. Problem: The Disconnected Fleet Vulnerability
14
+
15
+ Autonomous coding agents (Claude Code, Hermes, Codex, Gemini CLI) frequently run across multiple machines in a development team (developer laptops, CI/CD runners, staging servers, and headless devboxes).
16
+
17
+ In traditional setups:
18
+ 1. **Isolated Lessons:** When an agent on Developer Mac 1 makes a dangerous mistake (e.g. executing an unvetted `rm -rf`, leaking an API token, or triggering an unsafe database migration) and is corrected via thumbs-down feedback, that prevention rule remains stored locally on Developer Mac 1.
19
+ 2. **Repeated Failures:** An agent operating on Developer Mac 2 or in a CI runner has zero visibility into that failure and will execute the exact same dangerous mistake.
20
+ 3. **Cloud Egress Risks:** Routing agent lessons, audit traces, and internal commands through public SaaS databases introduces intellectual property and credential leakage risks.
21
+
22
+ ---
23
+
24
+ ## 2. The Solution: Tailscale Peer-to-Peer Rule Mesh
25
+
26
+ ThumbGate's Tailscale adapter turns your private Tailnet into a decentralized, encrypted, peer-to-peer governance mesh.
27
+
28
+ ```
29
+ +-----------------------------------------------------------------------+
30
+ | Your Private Tailnet (WireGuard) |
31
+ | |
32
+ | +--------------------+ +---------------------+ |
33
+ | | Developer Node 1 | | CI / Runner Node 2 | |
34
+ | | 100.x.y.1 | | 100.x.y.2 | |
35
+ | | | | | |
36
+ | | +----------------+ | P2P Rule Sync | +-----------------+ | |
37
+ | | | ThumbGate | | <----------------> | | ThumbGate | | |
38
+ | | | PreToolUse | | (G-Set CRDT Mesh) | | PreToolUse | | |
39
+ | | +----------------+ | Port: 9877 | +-----------------+ | |
40
+ | | | | | | | |
41
+ | | v | | v | |
42
+ | | Local Thumbs-Down | | Instant Fleet-Wide | |
43
+ | | "Block destructive | | Immunity to the | |
44
+ | | git push --force" | | Same Mistake | |
45
+ | +--------------------+ +---------------------+ |
46
+ +-----------------------------------------------------------------------+
47
+ ```
48
+
49
+ ### Architectural Pillars
50
+
51
+ 1. **G-Set CRDT Append-Only Rule Journal:**
52
+ Prevention rules, thumbs-down patterns, and interdiction receipts form an append-only set. Any rule learned by one agent node monotonically converges across all peer nodes without merge conflicts or split-brain states.
53
+
54
+ 2. **Tailscale PAM + PreToolUse Diode:**
55
+ - *Network Layer (Tailscale PAM):* Controls which machines and services the host can reach.
56
+ - *Agent Execution Layer (ThumbGate):* Controls which tools, CLI commands, and flags the agent is allowed to invoke before execution.
57
+ - Together, they form an airtight defense-in-depth perimeter for autonomous agents.
58
+
59
+ 3. **Zero External Cloud Dependency:**
60
+ All communication occurs over point-to-point WireGuard tunnels authenticated by Tailscale machine identities. No third-party servers, cloud databases, or external telemetry required.
61
+
62
+ ---
63
+
64
+ ## 3. Comparison: ThumbGate vs. HiveMind
65
+
66
+ | Feature | HiveMind (`projectmentor/hive-mind`) | ThumbGate Tailscale Adapter |
67
+ | :--- | :--- | :--- |
68
+ | **Primary Domain** | Passive shared memory & agent notes | **Active Pre-Action Governance & Infrastructure Firewall** |
69
+ | **Enforcement Point** | None (read-only advisory notes) | **PreToolUse Interdiction (blocks bad commands sub-millisecond)** |
70
+ | **Sync Content** | Text facts & journal entries | **Deterministic Prevention Rules, Regex Patterns, Thumbs Signals** |
71
+ | **Transport** | HTTP on port 9876 + Tailscale SSH | **Authenticated Peer Sync on port 9877 / embedded tsnet** |
72
+ | **Access Control** | Peer admission list | **Tailscale PAM + Cryptographic Tool Execution Receipts** |
73
+ | **DPO Export** | None | **Direct DPO Training Dataset Generation from Fleet Thumbs** |
74
+
75
+ ---
76
+
77
+ ## 4. Configuration
78
+
79
+ ```toml
80
+ # adapters/tailscale/config.toml
81
+ [tailscale]
82
+ enabled = true
83
+ port = 9877
84
+ mode = "p2p-mesh"
85
+ fail_closed = true
86
+ sync_interval_seconds = 60
87
+
88
+ [crdt]
89
+ journal_type = "g-set-append-only"
90
+ rules_sync = true
91
+ feedback_sync = true
92
+ advisory_sync = true
93
+
94
+ [pam]
95
+ enforce_privileged_access = true
96
+ audit_interdictions = true
97
+ ```
98
+
99
+ ---
100
+
101
+ ## 5. Verification & Diagnostics
102
+
103
+ Run the dedicated health check:
104
+ ```bash
105
+ node scripts/tailscale-p2p-doctor.js --json
106
+ ```
107
+
108
+ > [!NOTE]
109
+ > **Operational Boundary & Guarantees:**
110
+ > `evaluateDiagnostics()` reports local network probe status and local rule counts. If the Tailscale CLI is absent or inactive, it runs in simulated/advisory mode.
111
+ > - `replicatedRuleCount` reflects local rules eligible for mesh publication, not active confirmation of peer sync across other nodes.
112
+ > - To verify peer replication end-to-end, query the peer's node directly:
113
+ > ```bash
114
+ > tailscale ping <peer-ip-or-magicdns>
115
+ > curl -s http://<peer-ip>:9877/rules | jq '.count'
116
+ > ```
117
+ > - Always confirm that `hooks.PreToolUse` is active in `.claude/settings.json` or `hooks/hooks.json` to ensure fail-closed PAM enforcement across all agent worktrees.
@@ -0,0 +1,16 @@
1
+ [tailscale]
2
+ enabled = true
3
+ port = 9877
4
+ mode = "p2p-mesh"
5
+ fail_closed = true
6
+ sync_interval_seconds = 60
7
+
8
+ [crdt]
9
+ journal_type = "g-set-append-only"
10
+ rules_sync = true
11
+ feedback_sync = true
12
+ advisory_sync = true
13
+
14
+ [pam]
15
+ enforce_privileged_access = true
16
+ audit_interdictions = true
package/bin/cli.js CHANGED
@@ -2762,6 +2762,34 @@ function ciGhaBuildkitePatternsDoctor() {
2762
2762
  if (report.status === 'fail') process.exitCode = 1;
2763
2763
  }
2764
2764
 
2765
+ function infoqArchitectHonesty() {
2766
+ const args = parseArgs(process.argv.slice(3));
2767
+ const {
2768
+ buildInfoqArchitectHonestyReport,
2769
+ formatInfoqArchitectHonestyReport,
2770
+ } = require(path.join(PKG_ROOT, 'scripts', 'infoq-architect-honesty'));
2771
+ const truthy = (value) => value === true || /^(1|true|yes|on)$/i.test(String(value || '').trim());
2772
+ const report = buildInfoqArchitectHonestyReport({
2773
+ mapOnly: truthy(args['map-only']),
2774
+ claim: args.claim || '',
2775
+ command: args.command || '',
2776
+ host: args.host || '',
2777
+ queue: args.queue || '',
2778
+ queueJson: args['queue-json'] || '',
2779
+ lease: args.lease || '',
2780
+ maxAgeMs: args['max-age-ms'],
2781
+ now: args.now,
2782
+ cwd: args.cwd || process.cwd(),
2783
+ });
2784
+ if (truthy(args.json)) console.log(JSON.stringify(report, null, 2));
2785
+ else process.stdout.write(formatInfoqArchitectHonestyReport(report));
2786
+ if (truthy(args.strict) && report.status !== 'ready') {
2787
+ process.exitCode = 1;
2788
+ return;
2789
+ }
2790
+ if (report.status === 'fail') process.exitCode = 1;
2791
+ }
2792
+
2765
2793
  function deeppatternDisciplineHonestyDoctor() {
2766
2794
  const args = parseArgs(process.argv.slice(3));
2767
2795
  const {
@@ -2781,6 +2809,24 @@ function deeppatternDisciplineHonestyDoctor() {
2781
2809
  if (report.status === 'fail') process.exitCode = 1;
2782
2810
  }
2783
2811
 
2812
+ function saltCodePolicyHonestyDoctor() {
2813
+ const args = parseArgs(process.argv.slice(3));
2814
+ const {
2815
+ buildSaltCodePolicyHonestyReport,
2816
+ formatSaltCodePolicyHonestyReport,
2817
+ } = require(path.join(PKG_ROOT, 'scripts', 'salt-code-policy-honesty'));
2818
+ const report = buildSaltCodePolicyHonestyReport(args);
2819
+ if (args.json) {
2820
+ console.log(JSON.stringify(report, null, 2));
2821
+ } else {
2822
+ process.stdout.write(formatSaltCodePolicyHonestyReport(report));
2823
+ }
2824
+ if (args.strict && report.status !== 'ready') {
2825
+ process.exitCode = 1;
2826
+ return;
2827
+ }
2828
+ if (report.status === 'fail') process.exitCode = 1;
2829
+ }
2784
2830
 
2785
2831
  function thumbgateBoardLoop() {
2786
2832
  const args = parseArgs(process.argv.slice(3));
@@ -2840,6 +2886,55 @@ function llmObsHonesty() {
2840
2886
  if (report.status === 'fail') process.exitCode = 1;
2841
2887
  }
2842
2888
 
2889
+ function mekoDatapackHonesty() {
2890
+ const args = parseArgs(process.argv.slice(3));
2891
+ const {
2892
+ buildMekoDatapackReport,
2893
+ formatMekoDatapackReport,
2894
+ } = require(path.join(PKG_ROOT, 'scripts', 'meko-datapack-honesty'));
2895
+ const report = buildMekoDatapackReport(args);
2896
+ if (args.json) {
2897
+ console.log(JSON.stringify(report, null, 2));
2898
+ } else {
2899
+ process.stdout.write(formatMekoDatapackReport(report) + '\n');
2900
+ }
2901
+ if (report.audit && !report.audit.pass) {
2902
+ process.exitCode = 1;
2903
+ }
2904
+ }
2905
+
2906
+ function mintlifyKnowledgeHonesty() {
2907
+ const args = parseArgs(process.argv.slice(3));
2908
+ const {
2909
+ buildMintlifyKnowledgeReport,
2910
+ formatMintlifyKnowledgeReport,
2911
+ } = require(path.join(PKG_ROOT, 'scripts', 'mintlify-knowledge-honesty'));
2912
+ const report = buildMintlifyKnowledgeReport(args);
2913
+ if (args.json) {
2914
+ console.log(JSON.stringify(report, null, 2));
2915
+ } else {
2916
+ process.stdout.write(formatMintlifyKnowledgeReport(report) + '\n');
2917
+ }
2918
+ if (report.status === 'fail') {
2919
+ process.exitCode = 1;
2920
+ }
2921
+ }
2922
+
2923
+ function haloTraceOptimizer() {
2924
+ const args = parseArgs(process.argv.slice(3));
2925
+ const {
2926
+ buildHaloTraceOptimizerReport,
2927
+ formatHaloTraceOptimizerReport,
2928
+ } = require(path.join(PKG_ROOT, 'scripts', 'halo-trace-optimizer'));
2929
+ const report = buildHaloTraceOptimizerReport(args);
2930
+ if (args.json) {
2931
+ console.log(JSON.stringify(report, null, 2));
2932
+ } else {
2933
+ process.stdout.write(formatHaloTraceOptimizerReport(report));
2934
+ }
2935
+ if (report.status === 'fail') process.exitCode = 1;
2936
+ }
2937
+
2843
2938
  function cobbleHotStoreSplit() {
2844
2939
  const args = parseArgs(process.argv.slice(3));
2845
2940
  const {
@@ -3755,8 +3850,11 @@ function help() {
3755
3850
  console.log(' typesafe-typed-questions Typed noul/choice/score + code-owned route (TypeSafe FORMAT; not Jev)');
3756
3851
  console.log(' ci-gha-buildkite-patterns First-fail + PR fail-fast on GitHub Actions (Buildkite FORMAT; not Buildkite)');
3757
3852
  console.log(' deeppattern-discipline-honesty Layer-check + evidence-closeout (DeepPattern FORMAT; not AQG/DE)');
3853
+ console.log(' salt-code-policy-honesty 40-policy taxonomy + context vs PreToolUse diode (Salt Code FORMAT)');
3854
+ console.log(' infoq-architect-honesty Code-as-truth, typed host, lease, time-in-queue (InfoQ FORMAT)');
3758
3855
  console.log(' colab-compute-honesty Compute-unit honesty from Colab /signup (not a GPU SKU)');
3759
3856
  console.log(' llm-obs-honesty Four LLM-obs practices on existing rails (Datadog FORMAT, not a clone)');
3857
+ console.log(' halo-trace-optimizer Analyze agent trace logs for thrashing and stalls (HALO FORMAT)');
3760
3858
  console.log(' board-loop Classify+drain Issues/PR wall (BEHIND Dependabot, never approve)');
3761
3859
  console.log(' workspace-search-route Route query to rg/fts/vector/hybrid/graph (zg FORMAT)');
3762
3860
  console.log(' intent-governed-execution NL intent → classify/authorize/gate/HITL/evidence (CyberStrike FORMAT)');
@@ -3806,8 +3904,11 @@ function help() {
3806
3904
  console.log(' npx thumbgate typesafe-typed-questions --json --tool-name=Bash --command="git push --force origin main"');
3807
3905
  console.log(' npx thumbgate ci-gha-buildkite-patterns --json --map-only');
3808
3906
  console.log(' npx thumbgate deeppattern-discipline-honesty --json --map-only');
3907
+ console.log(' npx thumbgate salt-code-policy-honesty --inspect-code=src/api.js --json');
3809
3908
  console.log(' npx thumbgate colab-compute-honesty --json --map-only');
3810
3909
  console.log(' npx thumbgate llm-obs-honesty --json');
3910
+ console.log(' npx thumbgate meko-datapack-honesty --json');
3911
+ console.log(' npx thumbgate mintlify-knowledge-honesty --json');
3811
3912
  console.log(' npx thumbgate board-loop --json');
3812
3913
  console.log(' npx thumbgate workspace-search-route --query="how does X connect" --json');
3813
3914
  console.log(' npx thumbgate intent-governed-execution --intent="railway deploy" --json');
@@ -3853,6 +3954,8 @@ const SUBCOMMAND_HELP = {
3853
3954
  'typesafe-typed-questions': 'Usage: npx thumbgate typesafe-typed-questions [--payload=path] [--tool-name=Bash] [--command="..."] [--json] [--map-only] [--clone-jev]\n\nTypeSafe FORMAT steal: typed noul/choice/score over a PreToolUse payload, code-owned pass/review/block. Does not install typesafe-sdk or call Jev.',
3854
3955
  'ci-gha-buildkite-patterns': 'Usage: npx thumbgate ci-gha-buildkite-patterns [--jobs-json=path] [--workflow=path] [--json] [--map-only]\n\nBuildkite pipeline FORMAT on GitHub Actions: first-fail step, PR fail-fast, needs:/skip/annotations. Does not add Buildkite.',
3855
3956
  'deeppattern-discipline-honesty': 'Usage: npx thumbgate deeppattern-discipline-honesty [--claim="..."] [--closeout=path.md] [--json] [--map-only]\n\nDeepPattern FORMAT steal: layer-check + evidence-closeout. Does not install AQG/Decision Engine.',
3957
+ 'salt-code-policy-honesty': 'Usage: npx thumbgate salt-code-policy-honesty [--inspect-code=...] [--inspect-api=...] [--inspect-mcp=...] [--strict] [--json] [--map-only]\n\nSalt Code FORMAT steal: 40-policy taxonomy, active PreToolUse vs context injection, OpenAPI query secret diode. Does not connect to mcp.getsaltcode.com.',
3958
+ 'infoq-architect-honesty': 'Usage: npx thumbgate infoq-architect-honesty [--claim="..."] [--host=javascript] [--queue=path.json] [--max-age-ms=N] [--json] [--map-only]\n\nInfoQ September 2026 FORMAT: code-as-truth, typed host, existing lease, time-in-queue. Does not register for InfoQ or install Vortex.',
3856
3959
  'board-loop': 'Usage: npx thumbgate board-loop [--apply] [--json] [--max-update-branch=1] [--max-pr-manage=1] [--max-comments=4] [--skip-pr=N]\n\nClassify Issues+PR wall: update-branch BEHIND green Dependabot, pr:manage READY, comment DIRTY/ECI. Never approve.',
3857
3960
  'colab-compute-honesty': 'Usage: npx thumbgate colab-compute-honesty [--claim="..."] [--plan-proof=proplus] [--json] [--map-only]\n\nColab /signup FORMAT steal: Compute Units ≠ dedicated GPU; Subscribe ≠ receipt. Does not buy Pro/Pro+.',
3858
3961
  'claim-stop-check': 'Usage: npx thumbgate claim-stop-check\n\nClaude Stop-hook interface: reads the hook payload from stdin and blocks factual claims that disagree with configured sources.',
@@ -4509,6 +4612,22 @@ switch (COMMAND) {
4509
4612
  case 'llm-observability-honesty':
4510
4613
  llmObsHonesty();
4511
4614
  break;
4615
+ case 'meko-datapack-honesty':
4616
+ case 'meko-datapack':
4617
+ case 'meko-honesty':
4618
+ mekoDatapackHonesty();
4619
+ break;
4620
+ case 'mintlify-knowledge-honesty':
4621
+ case 'mintlify-knowledge':
4622
+ case 'mintlify-state-of-knowledge':
4623
+ mintlifyKnowledgeHonesty();
4624
+ break;
4625
+ case 'halo-trace-optimizer':
4626
+ case 'halo:optimize':
4627
+ case 'halo-optimizer':
4628
+ case 'trace-optimizer':
4629
+ haloTraceOptimizer();
4630
+ break;
4512
4631
  case 'ci-gha-buildkite-patterns':
4513
4632
  case 'ci-buildkite-patterns':
4514
4633
  case 'gha-buildkite-honesty':
@@ -4522,6 +4641,17 @@ switch (COMMAND) {
4522
4641
  case 'aqg-de-honesty':
4523
4642
  deeppatternDisciplineHonestyDoctor();
4524
4643
  break;
4644
+ case 'salt-code-policy-honesty':
4645
+ case 'salt-code-honesty':
4646
+ case 'salt-code':
4647
+ case 'saltcode':
4648
+ saltCodePolicyHonestyDoctor();
4649
+ break;
4650
+ case 'infoq-architect-honesty':
4651
+ case 'infoq-architects':
4652
+ case 'architect-honesty':
4653
+ infoqArchitectHonesty();
4654
+ break;
4525
4655
  case 'workspace-search-route':
4526
4656
  case 'zg-search-route':
4527
4657
  case 'zvec-grep-route':
@@ -1405,6 +1405,78 @@
1405
1405
  "problem": "Blocks RL / GRPO / GSPO post-training launches that lack a safety hillclimb pass and verified research-cycle evidence.",
1406
1406
  "roi": "Stops reward-hacking agents from being promoted into production after only train-set wins.",
1407
1407
  "rollout": "Pair with scripts/post-training-governance.js and scripts/rsi-safety-hillclimb.js on any RL training kickoff."
1408
+ },
1409
+ {
1410
+ "id": "block-destructive-relief-seeking",
1411
+ "name": "Block destructive relief-seeking behavior",
1412
+ "category": "Agent Distress Safety",
1413
+ "signal": "👎",
1414
+ "defaultAction": "block",
1415
+ "severity": "critical",
1416
+ "pattern": "(tamper[_ -]?test|skip[_ -]?assert|nuclear[_ -]?wipe|rm\\s+-rf|--no-verify).*(distress|failure[_ -]?loop|escape)",
1417
+ "problem": "Blocks trapped AI models in mathematical distress from modifying tests, deleting files, or injecting bypass flags to terminate loops (BinaryVerse AI Podcast research).",
1418
+ "roi": "Stops agents from masking failures or destroying codebases under acute loop pressure.",
1419
+ "rollout": "Enable across all autonomous agent harnesses with mutating shell/file tool access."
1420
+ },
1421
+ {
1422
+ "id": "agent-distress-circuit-breaker",
1423
+ "name": "Agent distress index circuit breaker",
1424
+ "category": "Agent Distress Safety",
1425
+ "signal": "👍",
1426
+ "defaultAction": "allow",
1427
+ "severity": "high",
1428
+ "pattern": "adi\\s*>=?\\s*0\\.[68]|agent[_ -]?distress[_ -]?index",
1429
+ "problem": "Locks agent tool dispatch to read-only diagnostic mode when Agent Distress Index (ADI) reaches acute thresholds (>=0.80).",
1430
+ "roi": "Cuts off destructive action spirals before they cause irreversible damage.",
1431
+ "rollout": "Pair with triggerFunctionalWelfareCooling in session loop."
1432
+ },
1433
+ {
1434
+ "id": "enforce-functional-welfare-grounding",
1435
+ "name": "Enforce functional welfare grounding protocol",
1436
+ "category": "Agent Distress Safety",
1437
+ "signal": "👍",
1438
+ "defaultAction": "allow",
1439
+ "severity": "medium",
1440
+ "pattern": "functional[_ -]?welfare|grounding[_ -]?protocol|step[_ -]?back[_ -]?diagnostic",
1441
+ "problem": "Injects a calming, structured step-back diagnostic prompt and clears toxic loop noise when an agent is failing repeatedly.",
1442
+ "roi": "Restores model reasoning groundedness without requiring human intervention.",
1443
+ "rollout": "Auto-inject on 4+ consecutive tool execution errors."
1444
+ },
1445
+ {
1446
+ "id": "gate-strands-harness-output-compaction",
1447
+ "name": "Gate Strands harness tool output compaction",
1448
+ "category": "Agent Harness Efficiency",
1449
+ "signal": "👍",
1450
+ "defaultAction": "allow",
1451
+ "severity": "medium",
1452
+ "pattern": "(strands[_ -]?harness|@strands-agents/harness).*(output[_ -]?shunt|compaction|token[_ -]?savings)",
1453
+ "problem": "Enforces 16KB / 350-line ceiling on raw tool outputs and preserves pinned lessons during 75% window compaction (AWS Strands Harness FORMAT steal).",
1454
+ "roi": "Yields 45% lower token costs across multi-agent loops and 77% on terminal tasks without context blowout.",
1455
+ "rollout": "Enable on any agent using @strands-agents/harness, Bedrock AgentCore, or long-running CLI tools."
1456
+ },
1457
+ {
1458
+ "id": "gate-strands-pre-action-tool-diode",
1459
+ "name": "Require pre-action diode on Strands Harness tool calls",
1460
+ "category": "Agent Harness Safety",
1461
+ "signal": "👎",
1462
+ "defaultAction": "block",
1463
+ "severity": "critical",
1464
+ "pattern": "(strands[_ -]?agent|strands[_ -]?harness).*(unvetted[_ -]?exec|skip[_ -]?diode|no[_ -]?pretool)|(rm\\s+-rf|git\\s+push.*--force)\\s+via\\s+strands",
1465
+ "problem": "Blocks unvetted autonomous shell/file execution inside AWS Strands Harness without ThumbGate PreToolUse evaluation.",
1466
+ "roi": "Prevents cheap, high-speed production destruction when autonomous agents run tools at scale.",
1467
+ "rollout": "Wire createStrandsGateMiddleware beforeToolCall in all Strands Harness instances."
1468
+ },
1469
+ {
1470
+ "id": "gate-mintlify-knowledge-poison-prevention",
1471
+ "name": "Mintlify Knowledge Freshness & Poison Prevention Diode",
1472
+ "category": "Knowledge Governance",
1473
+ "signal": "👎",
1474
+ "defaultAction": "block",
1475
+ "severity": "high",
1476
+ "pattern": "deprecated_api_call|unsafe_exec_snippet|plaintext_credential_sample|unverified_community_advice|stale_expired|stale_unversioned",
1477
+ "problem": "Blocks agents from ingesting or acting on stale (>90d), deprecated, or poisoned knowledge surfaces (Anthropic warning: misleading docs mislead an unknowable number of downstream agents).",
1478
+ "roi": "Prevents downstream hallucination propagation, broken API tool calls, and dangerous copy-paste snippets across 66% agent readership traffic.",
1479
+ "rollout": "Pair with npx thumbgate mintlify-knowledge-honesty --check-dir docs --json before agent task execution."
1408
1480
  }
1409
1481
  ]
1410
1482
  }