thumbgate 1.39.0 → 1.39.1

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 (52) hide show
  1. package/.agents/skills/craft-playbook-gate/SKILL.md +51 -0
  2. package/.agents/skills/qwenwork-policy-group-honesty-not-clone/SKILL.md +36 -0
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.well-known/mcp/server-card.json +1 -1
  5. package/README.md +6 -1
  6. package/adapters/claude/.mcp.json +2 -2
  7. package/adapters/forge/forge.yaml +3 -3
  8. package/adapters/future-agi/.mcp.json +1 -1
  9. package/adapters/future-agi/config.toml +1 -1
  10. package/adapters/future-agi/opencode.json +1 -1
  11. package/adapters/herdr/herdr-plugin.toml +2 -2
  12. package/adapters/mcp/server-stdio.js +23 -1
  13. package/adapters/opencode/opencode.json +1 -1
  14. package/adapters/strands/strands-middleware.js +31 -4
  15. package/bin/cli.js +63 -39
  16. package/config/github-about.json +1 -1
  17. package/config/merge-quality-checks.json +2 -1
  18. package/config/post-deploy-marketing-pages.json +1 -1
  19. package/hooks/hooks.json +24 -0
  20. package/package.json +33 -13
  21. package/public/assets/diagrams/hero-thumbs.svg +2 -4
  22. package/public/case-studies.html +4 -4
  23. package/public/dashboard.html +2 -2
  24. package/public/diagnostic.html +7 -7
  25. package/public/index.html +170 -55
  26. package/public/install.html +12 -7
  27. package/public/lessons.html +144 -38
  28. package/public/numbers.html +2 -2
  29. package/public/pricing.html +100 -18
  30. package/scripts/action-receipts.js +393 -0
  31. package/scripts/auto-wire-hooks.js +64 -25
  32. package/scripts/cli-demo.js +5 -27
  33. package/scripts/cli-schema.js +24 -0
  34. package/scripts/craft-playbook-gate.js +550 -0
  35. package/scripts/failure-diagnostics.js +11 -0
  36. package/scripts/gate-stats.js +32 -5
  37. package/scripts/gates-engine.js +632 -10
  38. package/scripts/gitlab-sdlc-prompts.js +397 -0
  39. package/scripts/hook-runtime.js +10 -0
  40. package/scripts/hybrid-feedback-context.js +2 -0
  41. package/scripts/mabl-failure-honesty.js +273 -0
  42. package/scripts/model-distress-detector.js +3 -3
  43. package/scripts/product-feedback.js +35 -0
  44. package/scripts/prompt-eval.js +1 -1
  45. package/scripts/qwenwork-policy-group.js +413 -0
  46. package/scripts/tailscale-october-access.js +416 -0
  47. package/scripts/task-outcomes.js +29 -0
  48. package/scripts/telemetry-analytics.js +22 -3
  49. package/server.json +2 -2
  50. package/src/api/server.js +95 -7
  51. package/src/mcp/email-triage-server/index.js +973 -0
  52. package/src/mcp/email-triage-server/package.json +12 -0
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: craft-playbook-gate
3
+ description: >
4
+ Rachel Woods's autonomous-AI episode is a playbook format, not a ThumbGate
5
+ product. Keep one atomic playbook in git, refuse zero-touch on the first
6
+ cycle, and require a backup hash plus a named approval before a structural
7
+ self-edit. Use when checking a playbook outline, a CRAFT cycle, a self-edit,
8
+ a trigger word, or a local stack. Do NOT use to install dayglass or skill-up,
9
+ store the playbook in a vendor chat UI, spawn a subagent, call Asana or
10
+ ClickUp, reply on YouTube, or email the host.
11
+ ---
12
+
13
+ # Craft playbook gate — own the playbook, rent the model
14
+
15
+ ## Goal
16
+
17
+ Keep one deliverable's trigger, inputs, steps, output, and escalation in git.
18
+ The first cycle keeps a named human step. A later cycle can close that step
19
+ only after every CRAFT stage is done and each locked win is text inside a step.
20
+
21
+ ## Constraints
22
+
23
+ | NEVER | ALWAYS |
24
+ | --- | --- |
25
+ | Install dayglass or skill-up | `node scripts/craft-playbook-gate.js` |
26
+ | Use Docker or OpenSandbox | Home `git` and a relative `.md` or `.json` path |
27
+ | Store the playbook in a vendor chat UI | Boolean stages, in order: clear, realistic, setup, feedback, rollout |
28
+ | Approve a self-edit by line count or percent | A backup sha256 of the previous playbook |
29
+ | Spawn a subagent or call Asana or ClickUp | Explicit `approved: true` and a named `approvedBy` for a structural edit |
30
+ | Claim zero-touch on cycle 1 | Trigger word `nitpicking`, not `feedback` |
31
+ | Reply on the YouTube episode or email the host | A stack is done only when every child has `verified: true` |
32
+
33
+ ## Procedures
34
+
35
+ ```bash
36
+ node scripts/craft-playbook-gate.js --map-only
37
+ node scripts/craft-playbook-gate.js
38
+ npm run craft:playbook
39
+ npm run test:craft-playbook-gate
40
+ ```
41
+
42
+ `--help` and `--map-only` print and exit without reading stdin. Any other
43
+ command reads one JSON object from stdin. The command writes nothing. Exit 0
44
+ is accept. Exit 1 is a hold. A minor detail tweak may be applied later only
45
+ when the backup hash matches and `feedbackRef` names the review. Changing the
46
+ trigger, a step id, an escalation flag, or the escalation text stays held
47
+ until a person approves it. Moving the playbook out of git, or onto an
48
+ absolute path, is a hold even when the rest of the edit is minor.
49
+
50
+ Code as truth: scripts/craft-playbook-gate.js
51
+ Provenance: https://www.youtube.com/watch?v=CMkwClAm2TI
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: qwenwork-policy-group-honesty-not-clone
3
+ description: >
4
+ The 2026-10-28 QwenWork Enterprise Premium note is FORMAT, not a ThumbGate
5
+ product. Steal one org policy group at the action: model catalog, usage
6
+ limit, marketplace installs, trusted devices and networks, sensitive words,
7
+ IM channels, and exportable admin/user/AI audit. Never buy seats, call
8
+ Alibaba Cloud, or install DingTalk, WeCom, or Feishu.
9
+ Slash: /qwenwork-policy-group-honesty-not-clone.
10
+ ---
11
+
12
+ # QwenWork policy group — compare, do not clone
13
+
14
+ ## Goal
15
+
16
+ Decide one org action before it runs. Unlisted models, skills, connectors, expert suites, devices, networks, and IM channels deny.
17
+
18
+ ## Constraints
19
+
20
+ | NEVER | ALWAYS |
21
+ | --- | --- |
22
+ | Buy Enterprise Premium seats or a credits pack | `npx thumbgate qwenwork-policy-group --json` |
23
+ | Call Alibaba Cloud or open an Alibaba account | Directory slot is entra, ldap, scim, saml, or oidc |
24
+ | Install DingTalk, WeCom, or Feishu | Trusted device, trusted network, sensitive word, and IM channel deny when they miss the policy |
25
+ | Treat their seat price as a ThumbGate price | Audit class is admin, user, or ai, and the record is exportable |
26
+ | Ship a white-label standalone app | Training use is on only when the action is BYOK and `allowByokTraining` is true |
27
+
28
+ ## Procedures
29
+
30
+ ```bash
31
+ npx thumbgate qwenwork-policy-group --json --map-only
32
+ npx thumbgate qwenwork-policy-group --json --policy=policy.json --action=action.json
33
+ npm run test:qwenwork-policy-group
34
+ ```
35
+
36
+ `policy.org` is required. An empty allowlist denies that install. `brand.apply` records a branding label. `clone` and `packageApp` deny.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thumbgate",
3
3
  "description": "One 👎 becomes a hard rule the agent cannot bypass. Captures thumbs-down feedback, distills it into PreToolUse Pre-Action Checks, enforced across every future Claude Code session.",
4
- "version": "1.39.0",
4
+ "version": "1.39.1",
5
5
  "author": {
6
6
  "name": "Igor Ganapolsky",
7
7
  "email": "ig5973700@gmail.com",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thumbgate",
3
- "version": "1.39.0",
3
+ "version": "1.39.1",
4
4
  "description": "ThumbGate — 👍👎 feedback that teaches your AI agent. Thumbs down a mistake, it never happens again.",
5
5
  "homepage": "https://thumbgate.ai",
6
6
  "transport": "stdio",
package/README.md CHANGED
@@ -292,6 +292,11 @@ curl -X POST http://localhost:3456/v1/dpo/export \
292
292
 
293
293
  Every Changeset is tied to the exact `main` merge commit and generates Verification Evidence for Release Confidence.
294
294
 
295
+
296
+ ## Cloud & model infrastructure
297
+
298
+ - **Local Pre-Action Firewall & MCP Runtime**: Sub-`0.5ms` local `PreToolUse` enforcement (`npx thumbgate init`) across Claude Code, Cursor, Codex, and Gemini CLI; `TencentDB Agent Memory` record normalization into blocking SQL safety candidates is covered in `tests/memory-provider-enforcement-bridge.test.js`, and outer-harness context-budget checks inspired by Tencent Hunyuan `Hy-Memory-30B-A3B` research are validated in `scripts/rrsi-doctor.js`.
299
+ - **Companion Benchmark & Technical Case Study**: External evaluation of [Tencent Cloud](https://www.tencentcloud.com/) Lighthouse / CVM (`SA5` / `SA9` AMD Turin-Dense `3.4 GHz` all-core turbo in `ap-hongkong` & `ap-singapore`) and the `Hy-Memory-30B-A3B` surgical state-patching pattern is published in our companion `hermes-eval` benchmark repository (`docs/TENCENT-CLOUD-SA9-HUNYUAN-CASE-STUDY.md` and `scripts/tencent_sa9_hunyuan_benchmark.py`).
295
300
  ---
296
301
 
297
302
  ## Integrations (compact)
@@ -331,7 +336,7 @@ Full index: **[docs/INDEX.md](docs/INDEX.md)**
331
336
 
332
337
  ## Who builds this
333
338
 
334
- **Igor Ganapolsky** — payments (Stripe/Connect), AI agent guardrails/MCP, Android + backends. Small number of contract slots: **$120–150/hr, 1099, remote US**. [LinkedIn](https://www.linkedin.com/in/igor-ganapolsky-859317343/) · [thumbgate.ai](https://thumbgate.ai)
339
+ **Igor Ganapolsky** — payments (Stripe/Connect), AI agent guardrails/MCP, Android + backends. Small number of contract slots: **$120–150/hr, 1099, remote US**. [LinkedIn](https://www.linkedin.com/in/igor-ganapolsky-664324431/) · [thumbgate.ai](https://thumbgate.ai)
335
340
 
336
341
  ## License
337
342
 
@@ -2,13 +2,13 @@
2
2
  "mcpServers": {
3
3
  "thumbgate": {
4
4
  "command": "npx",
5
- "args": ["--yes", "--package", "thumbgate@1.39.0", "thumbgate", "serve"]
5
+ "args": ["--yes", "--package", "thumbgate@1.39.1", "thumbgate", "serve"]
6
6
  }
7
7
  },
8
8
  "hooks": {
9
9
  "preToolUse": {
10
10
  "command": "npx",
11
- "args": ["--yes", "--package", "thumbgate@1.39.0", "thumbgate", "gate-check"]
11
+ "args": ["--yes", "--package", "thumbgate@1.39.1", "thumbgate", "gate-check"]
12
12
  }
13
13
  }
14
14
  }
@@ -9,12 +9,12 @@ version: "1"
9
9
  skills:
10
10
  thumbgate-gate-check:
11
11
  description: "ThumbGate PreToolUse gate — blocks known-bad tool calls"
12
- command: "npx --yes --package thumbgate@1.39.0 thumbgate gate-check"
12
+ command: "npx --yes --package thumbgate@1.39.1 thumbgate gate-check"
13
13
  trigger: pre_tool_use
14
14
 
15
15
  thumbgate-feedback:
16
16
  description: "ThumbGate feedback capture — logs user prompt context"
17
- command: "npx --yes --package thumbgate@1.39.0 thumbgate hook-auto-capture"
17
+ command: "npx --yes --package thumbgate@1.39.1 thumbgate hook-auto-capture"
18
18
  trigger: user_prompt
19
19
 
20
20
  mcp:
@@ -23,6 +23,6 @@ mcp:
23
23
  args:
24
24
  - "--yes"
25
25
  - "--package"
26
- - "thumbgate@1.39.0"
26
+ - "thumbgate@1.39.1"
27
27
  - "thumbgate"
28
28
  - "serve"
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "thumbgate": {
4
4
  "command": "npx",
5
- "args": ["--yes", "--package", "thumbgate@1.39.0", "thumbgate", "serve"]
5
+ "args": ["--yes", "--package", "thumbgate@1.39.1", "thumbgate", "serve"]
6
6
  }
7
7
  }
8
8
  }
@@ -1,3 +1,3 @@
1
1
  [mcp.servers.thumbgate]
2
2
  command = "npx"
3
- args = ["--yes", "--package", "thumbgate@1.39.0", "thumbgate", "serve"]
3
+ args = ["--yes", "--package", "thumbgate@1.39.1", "thumbgate", "serve"]
@@ -2,7 +2,7 @@
2
2
  "mcpServers": {
3
3
  "thumbgate": {
4
4
  "command": "npx",
5
- "args": ["--yes", "--package", "thumbgate@1.39.0", "thumbgate", "serve"]
5
+ "args": ["--yes", "--package", "thumbgate@1.39.1", "thumbgate", "serve"]
6
6
  }
7
7
  }
8
8
  }
@@ -1,7 +1,7 @@
1
1
  [plugin]
2
2
  id = "thumbgate-approvals"
3
3
  name = "ThumbGate Approvals"
4
- version = "1.39.0"
4
+ version = "1.39.1"
5
5
  minHerdrVersion = "0.7.0"
6
6
  description = "Pre-action governance, spend guard, and safety approval gates for multi-agent terminal sessions in Herdr."
7
7
  platforms = ["linux", "macos", "windows"]
@@ -12,7 +12,7 @@ category = "Security & Governance"
12
12
 
13
13
  [mcp_server]
14
14
  command = "npx"
15
- args = ["--yes", "--package", "thumbgate@1.39.0", "thumbgate", "serve"]
15
+ args = ["--yes", "--package", "thumbgate@1.39.1", "thumbgate", "serve"]
16
16
 
17
17
  [mcp_server.env]
18
18
  THUMBGATE_ENFORCE_ENTITLEMENTS = "1"
@@ -334,7 +334,7 @@ const {
334
334
  finalizeSession: finalizeFeedbackSession,
335
335
  } = require('../../scripts/feedback-session');
336
336
 
337
- const SERVER_INFO = { name: 'thumbgate-mcp', version: '1.39.0' };
337
+ const SERVER_INFO = { name: 'thumbgate-mcp', version: '1.39.1' };
338
338
  const COMMERCE_CATEGORIES = [
339
339
  'product_recommendation',
340
340
  'brand_compliance',
@@ -1246,6 +1246,28 @@ async function callToolInner(name, args) {
1246
1246
  }
1247
1247
  case 'feedback_stats':
1248
1248
  return toTextResult(analyzeFeedback(undefined, { humanOnly: true }));
1249
+ case 'gold_gate_check': {
1250
+ const cudaGateBatch = require(path.join(__dirname, '..', '..', 'scripts', 'cuda-gate-batch'));
1251
+ const result = await cudaGateBatch.runGatePipeline({
1252
+ tool_name: args.tool_name,
1253
+ tool_input: args.tool_input || {},
1254
+ });
1255
+ return toTextResult(JSON.stringify({
1256
+ decision: result.decision,
1257
+ flagged: result.verdict.matchedRules.length > 0,
1258
+ reason: result.reason,
1259
+ categoriesChecked: result.verdict.categoriesChecked,
1260
+ rulesMatched: result.verdict.matchedRules.length,
1261
+ latencyUs: result.verdict.stats.totalLatencyUs,
1262
+ guidance: result.decision === 'deny'
1263
+ ? 'Do NOT run this action. Surface the reason to the user.'
1264
+ : 'No policy gate matched.',
1265
+ }, null, 2));
1266
+ }
1267
+ case 'gate_semantic_layer': {
1268
+ const semanticLayer = require(path.join(__dirname, '..', '..', 'scripts', 'gate-semantic-layer'));
1269
+ return toTextResult(JSON.stringify(semanticLayer.describeGoldLayer(), null, 2));
1270
+ }
1249
1271
  case 'diagnose_failure':
1250
1272
  return buildDiagnoseFailureResponse(args);
1251
1273
  case 'reflect_on_feedback':
@@ -7,7 +7,7 @@
7
7
  "npx",
8
8
  "--yes",
9
9
  "--package",
10
- "thumbgate@1.39.0",
10
+ "thumbgate@1.39.1",
11
11
  "thumbgate",
12
12
  "serve"
13
13
  ],
@@ -12,7 +12,7 @@
12
12
  */
13
13
 
14
14
  const { evaluateOutputShunt, evaluatePreActionDiode } = require('../../scripts/strands-harness-doctor');
15
-
15
+ const { beforeToolCallIntervention } = require('./strands-decider-adapter');
16
16
  function createStrandsGateMiddleware(options = {}) {
17
17
  const shuntConfig = options.tokenShunt || { maxOutputLines: 350, maxOutputBytes: 16384 };
18
18
  const preActionEnabled = options.preActionDiode?.enabled !== false;
@@ -31,15 +31,22 @@ function createStrandsGateMiddleware(options = {}) {
31
31
  */
32
32
  async beforeToolCall(event = {}) {
33
33
  if (!preActionEnabled) {
34
- return { allow: true };
34
+ return { allow: true, interventionAction: 'Proceed' };
35
35
  }
36
36
 
37
37
  const toolName = event.toolUse?.name || event.toolName || '';
38
38
  const input = event.toolUse?.input !== undefined ? event.toolUse.input : event.input;
39
39
 
40
40
  const evaluation = evaluatePreActionDiode({ name: toolName, input });
41
- if (evaluation.decision === 'BLOCK') {
42
- const reason = evaluation.violation || 'Action blocked by ThumbGate pre-action diode';
41
+ const decider = beforeToolCallIntervention({
42
+ toolName,
43
+ args: input,
44
+ userMessages: event.userMessages,
45
+ exemptKeys: event.exemptKeys,
46
+ });
47
+
48
+ if (evaluation.decision === 'BLOCK' || decider.action === 'Deny') {
49
+ const reason = evaluation.violation || decider.reason || 'Action blocked by ThumbGate pre-action diode';
43
50
  if (typeof event === 'object' && event !== null) {
44
51
  event.cancel = true;
45
52
  event.reason = reason;
@@ -47,15 +54,35 @@ function createStrandsGateMiddleware(options = {}) {
47
54
  return {
48
55
  allow: false,
49
56
  decision: 'BLOCK',
57
+ interventionAction: 'Deny',
50
58
  reason,
51
59
  toolName,
52
60
  timestamp: new Date().toISOString(),
53
61
  };
54
62
  }
55
63
 
64
+ if (decider.action === 'Guide' || decider.action === 'Confirm') {
65
+ if (typeof event === 'object' && event !== null) {
66
+ event.cancel = true;
67
+ event.reason = decider.feedback || decider.reason;
68
+ event.interventionAction = decider.action;
69
+ }
70
+ return {
71
+ allow: false,
72
+ decision: decider.action.toUpperCase(),
73
+ interventionAction: decider.action,
74
+ reason: decider.reason,
75
+ feedback: decider.feedback,
76
+ noul: decider.noul || null,
77
+ toolName,
78
+ timestamp: new Date().toISOString(),
79
+ };
80
+ }
81
+
56
82
  return {
57
83
  allow: true,
58
84
  decision: 'ALLOW',
85
+ interventionAction: 'Proceed',
59
86
  toolName,
60
87
  };
61
88
  },
package/bin/cli.js CHANGED
@@ -1,31 +1,5 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * thumbgate CLI
4
- *
5
- * Usage:
6
- * npx thumbgate init # scaffold .thumbgate/ config + .mcp.json
7
- * npx thumbgate init --wire-hooks # wire hooks only (auto-detect agent)
8
- * npx thumbgate init --agent claude-code # scaffold + wire hooks for specific agent
9
- * npx thumbgate gate-check # PreToolUse hook: pipe tool JSON via stdin, get verdict
10
- * npx thumbgate capture # capture feedback
11
- * npx thumbgate import-doc # import a local policy/runbook document and propose gates
12
- * npx thumbgate export-dpo # export DPO training pairs
13
- * npx thumbgate export-databricks # export Databricks-ready analytics bundle
14
- * npx thumbgate eval --from-feedback # turn feedback into reusable prompt evals
15
- * npx thumbgate code-graph-guardrails # map code-graph signals to pre-action checks
16
- * npx thumbgate proxy-pointer-rag-guardrails # map visual document RAG signals to gates
17
- * npx thumbgate rag-precision-guardrails # map retrieval tuning regressions to gates
18
- * npx thumbgate long-running-agent-context-guardrails # map structured-memory gaps to gates
19
- * npx thumbgate reasoning-efficiency-guardrails # map reasoning compression signals to gates
20
- * npx thumbgate deepseek-v4-runtime-guardrails # map sparse-attention runtime signals to gates
21
- * npx thumbgate upstream-contributions # rank upstream repo issues for trust-building PRs
22
- * npx thumbgate stats # feedback analytics + Revenue-at-Risk
23
- * npx thumbgate background-governance # background-agent run report + risk check
24
- * npx thumbgate cfo # local operational billing summary
25
- * npx thumbgate pro # solo dashboard + exports side lane
26
- * npx thumbgate diagnostic # team workflow diagnostic intake + checkout path
27
- * npx thumbgate audit <file> # audit an agent transcript for repeat-mistake token waste
28
- */
2
+ // thumbgate CLI entrypoint
29
3
 
30
4
  'use strict';
31
5
 
@@ -2892,6 +2866,26 @@ function infoqArchitectHonesty() {
2892
2866
  if (report.status === 'fail') process.exitCode = 1;
2893
2867
  }
2894
2868
 
2869
+ function qwenworkPolicyGroup() {
2870
+ const args = parseArgs(process.argv.slice(3));
2871
+ const {
2872
+ buildQwenWorkPolicyGroupReport,
2873
+ formatQwenWorkPolicyGroupReport,
2874
+ } = require(path.join(PKG_ROOT, 'scripts', 'qwenwork-policy-group'));
2875
+ const truthy = (value) => value === true || /^(1|true|yes|on)$/i.test(String(value || '').trim());
2876
+ const report = buildQwenWorkPolicyGroupReport({
2877
+ mapOnly: truthy(args['map-only']),
2878
+ claim: args.claim || '',
2879
+ policyJson: args['policy-json'] || '',
2880
+ actionJson: args['action-json'] || '',
2881
+ policyPath: args.policy || '',
2882
+ actionPath: args.action || '',
2883
+ });
2884
+ if (truthy(args.json)) console.log(JSON.stringify(report, null, 2));
2885
+ else process.stdout.write(formatQwenWorkPolicyGroupReport(report));
2886
+ if (report.status === 'fail') process.exitCode = 1;
2887
+ }
2888
+
2895
2889
  function deeppatternDisciplineHonestyDoctor() {
2896
2890
  const args = parseArgs(process.argv.slice(3));
2897
2891
  const {
@@ -3559,6 +3553,24 @@ function cacheUpdate() {
3559
3553
  updateCacheFromEvent(payload ? JSON.parse(payload) : {});
3560
3554
  }
3561
3555
 
3556
+ function observeToolResult() {
3557
+ try {
3558
+ const payload = readStdinText();
3559
+ const input = payload ? JSON.parse(payload) : {};
3560
+ const gatesEngine = require(path.join(PKG_ROOT, 'scripts', 'gates-engine'));
3561
+ gatesEngine.observeTeamsSendResult(input);
3562
+ const result = gatesEngine.observeSwarmClaimResult(input);
3563
+ if (!result) {
3564
+ process.stdout.write('{}\n');
3565
+ return;
3566
+ }
3567
+ process.stdout.write(`${gatesEngine.formatObserveStop(result)}\n`);
3568
+ } catch (err) {
3569
+ process.stderr.write(`observe-tool-result error: ${err.message}\n`);
3570
+ process.stdout.write('{}\n');
3571
+ }
3572
+ }
3573
+
3562
3574
  function statuslineRender() {
3563
3575
  syncActiveProjectContext();
3564
3576
  try {
@@ -4045,6 +4057,7 @@ function help() {
4045
4057
  console.log(' statusline-render Render ThumbGate Claude status line');
4046
4058
  console.log(' hook-auto-capture Process Claude UserPromptSubmit inline feedback');
4047
4059
  console.log(' claim-stop-check Recheck configured factual claims before Claude stops');
4060
+ console.log(' observe-tool-result Record swarm-claim.py exit 3, including a failed shell, and a Teams send that succeeded');
4048
4061
  console.log(' session-start Refresh local ThumbGate session cache');
4049
4062
  console.log('');
4050
4063
 
@@ -4103,6 +4116,7 @@ function help() {
4103
4116
  console.log(' deeppattern-discipline-honesty Layer-check + evidence-closeout (DeepPattern FORMAT; not AQG/DE)');
4104
4117
  console.log(' salt-code-policy-honesty 40-policy taxonomy + context vs PreToolUse diode (Salt Code FORMAT)');
4105
4118
  console.log(' infoq-architect-honesty Code-as-truth, typed host, lease, time-in-queue (InfoQ FORMAT)');
4119
+ console.log(' qwenwork-policy-group Org policy group at the action (QwenWork FORMAT; not seats or DingTalk)');
4106
4120
  console.log(' colab-compute-honesty Compute-unit honesty from Colab /signup (not a GPU SKU)');
4107
4121
  console.log(' omp-coordination-honesty Named-model session handoff on the checkout lease (omp FORMAT; does not install omp)');
4108
4122
  console.log(' saas-moat-honesty 8-moat diagnostic, Ed25519 entitlement audit, and cross-customer signature loop (Walling FORMAT)');
@@ -4237,6 +4251,7 @@ const SUBCOMMAND_HELP = {
4237
4251
  '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.',
4238
4252
  '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.',
4239
4253
  '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.',
4254
+ 'qwenwork-policy-group': 'Usage: npx thumbgate qwenwork-policy-group [--claim="..."] [--policy=path.json] [--action=path.json] [--json] [--map-only]\n\nQwenWork Enterprise Premium FORMAT: one org policy group at the action. Does not buy seats, call Alibaba Cloud, or install DingTalk, WeCom, or Feishu.',
4240
4255
  '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.',
4241
4256
  '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+.',
4242
4257
  'omp-coordination-honesty': 'Usage: npx thumbgate omp-coordination-honesty [--claim="..."] [--handoff=path] [--json] [--map-only] [--strict]\n\nMap omp session/subagent/collab FORMAT onto the checkout lease. Does not install omp.',
@@ -4537,6 +4552,9 @@ switch (COMMAND) {
4537
4552
  case 'claim-stop-check':
4538
4553
  claimStopCheckCmd();
4539
4554
  break;
4555
+ case 'observe-tool-result':
4556
+ observeToolResult();
4557
+ break;
4540
4558
  case 'session-start':
4541
4559
  sessionStart();
4542
4560
  break;
@@ -5103,6 +5121,9 @@ switch (COMMAND) {
5103
5121
  case 'architect-honesty':
5104
5122
  infoqArchitectHonesty();
5105
5123
  break;
5124
+ case 'qwenwork-policy-group':
5125
+ qwenworkPolicyGroup();
5126
+ break;
5106
5127
  case 'workspace-search-route':
5107
5128
  case 'zg-search-route':
5108
5129
  case 'zvec-grep-route':
@@ -5498,6 +5519,20 @@ switch (COMMAND) {
5498
5519
  }
5499
5520
  break;
5500
5521
  }
5522
+ case 'dream':
5523
+ case 'dream-mode': {
5524
+ // ThumbGate Dream Mode (Anthropic REM memory consolidation, read-only on source code)
5525
+ const { dreamCmd } = require(path.join(PKG_ROOT, 'scripts', 'thumbgate-dream'));
5526
+ dreamCmd();
5527
+ break;
5528
+ }
5529
+ case 'cuda-gate':
5530
+ case 'cuda-gate-batch': {
5531
+ // CUDA-inspired parallel PreToolUse gate evaluation
5532
+ const { cudaGateBatchCmd } = require(path.join(PKG_ROOT, 'scripts', 'cuda-gate-batch'));
5533
+ cudaGateBatchCmd();
5534
+ break;
5535
+ }
5501
5536
  case 'start-api':
5502
5537
  startApi();
5503
5538
  break;
@@ -5510,18 +5545,7 @@ switch (COMMAND) {
5510
5545
  compact();
5511
5546
  break;
5512
5547
  case 'subscribe': {
5513
- // Capture an installer's email so we can send the 5-minute setup
5514
- // guide + weekly tips. Drops to /v1/marketing/install-email on the
5515
- // hosted endpoint; the server fires sendNewsletterWelcomeEmail via
5516
- // Resend and persists the address for follow-up.
5517
- //
5518
- // Usage:
5519
- // npx thumbgate subscribe you@company.com
5520
- // npx thumbgate subscribe --email=you@company.com
5521
- //
5522
- // Never prompts interactively — postinstall must stay non-interactive
5523
- // for CI safety. This is the deliberate opt-in path the banner points
5524
- // at; if the operator runs it, they want the email.
5548
+ // Non-interactive installer email subscription (/v1/marketing/install-email)
5525
5549
  const args = process.argv.slice(3);
5526
5550
  let email = '';
5527
5551
  for (const arg of args) {
@@ -23,5 +23,5 @@
23
23
  "thompson-sampling",
24
24
  "self-improving-agents"
25
25
  ],
26
- "metaDescription": "Stop AI agent mistakes before they cost you. Self-serve is $19/mo; the $499 Diagnostic installs one hard, test-backed safety gate for a supported AI-agent workflow in two business days."
26
+ "metaDescription": "Stop AI agent mistakes before they cost you. Install free. Pro is $19/mo. The $499 Setup Sprint installs one hard, test-backed safety gate for a supported AI-agent workflow in two business days."
27
27
  }
@@ -29,6 +29,7 @@
29
29
  "Vercel",
30
30
  "Vercel Preview Comments",
31
31
  "Gitar",
32
- "Gitar AI"
32
+ "Gitar AI",
33
+ "Entire Gates"
33
34
  ]
34
35
  }
@@ -23,7 +23,7 @@
23
23
  },
24
24
  {
25
25
  "route": "/diagnostic",
26
- "sentinel": "Enterprise Workflow Gate",
26
+ "sentinel": "Exactly what the $499 Setup Sprint includes",
27
27
  "description": "Managed gate checkout and fit-check page for high-intent warm traffic"
28
28
  },
29
29
  {
package/hooks/hooks.json CHANGED
@@ -23,6 +23,30 @@
23
23
  ]
24
24
  }
25
25
  ],
26
+ "PostToolUse": [
27
+ {
28
+ "matcher": "^(?:Bash|Shell|bash)$|teams.*(send|reply|post_message)",
29
+ "hooks": [
30
+ {
31
+ "type": "command",
32
+ "command": "node",
33
+ "args": ["${CLAUDE_PLUGIN_ROOT}/bin/cli.js", "observe-tool-result"]
34
+ }
35
+ ]
36
+ }
37
+ ],
38
+ "PostToolUseFailure": [
39
+ {
40
+ "matcher": "^(?:Bash|Shell|bash)$|teams.*(send|reply|post_message)",
41
+ "hooks": [
42
+ {
43
+ "type": "command",
44
+ "command": "node",
45
+ "args": ["${CLAUDE_PLUGIN_ROOT}/bin/cli.js", "observe-tool-result"]
46
+ }
47
+ ]
48
+ }
49
+ ],
26
50
  "SessionStart": [
27
51
  {
28
52
  "hooks": [