thumbgate 1.39.0 → 1.40.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 (180) 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/llms.txt +2 -2
  5. package/.well-known/mcp/server-card.json +1 -1
  6. package/README.md +11 -5
  7. package/adapters/claude/.mcp.json +6 -2
  8. package/adapters/codex/config.toml +5 -0
  9. package/adapters/forge/forge.yaml +4 -4
  10. package/adapters/future-agi/.mcp.json +1 -1
  11. package/adapters/future-agi/config.toml +1 -1
  12. package/adapters/future-agi/opencode.json +1 -1
  13. package/adapters/herdr/herdr-plugin.toml +2 -2
  14. package/adapters/mcp/server-stdio.js +104 -7
  15. package/adapters/opencode/opencode.json +1 -1
  16. package/adapters/strands/strands-middleware.js +31 -4
  17. package/bin/cli.js +191 -54
  18. package/config/brand-standards.json +131 -0
  19. package/config/gates/default.json +18 -1
  20. package/config/github-about.json +1 -1
  21. package/config/mcp-allowlists.json +16 -3
  22. package/config/merge-quality-checks.json +3 -1
  23. package/config/post-deploy-marketing-pages.json +4 -4
  24. package/config/schemas/task-outcome-receipt.schema.json +9 -0
  25. package/hooks/hooks.json +24 -0
  26. package/openapi/openapi.yaml +7 -3
  27. package/package.json +87 -33
  28. package/public/about.html +2 -2
  29. package/public/admin.html +771 -0
  30. package/public/agent-manager.html +3 -3
  31. package/public/agents-cost-savings.html +1 -1
  32. package/public/ai-malpractice-prevention.html +12 -12
  33. package/public/architecture.html +0 -1
  34. package/public/assets/diagrams/decision.svg +3 -3
  35. package/public/assets/diagrams/hero-thumbs.svg +2 -4
  36. package/public/blog/2026-10-05-why-3-days-of-triage-wont-save-ai-speed-code.html +1 -1
  37. package/public/blog/2026-10-09-your-code-got-a-third-author-governance.html +1 -1
  38. package/public/blog/git-at-agent-scale.html +2 -2
  39. package/public/blog/inside-your-boundary.html +1 -1
  40. package/public/blog/process-over-outcome-gates.html +1 -1
  41. package/public/case-studies.html +5 -6
  42. package/public/codex-enterprise.html +1 -1
  43. package/public/codex-plugin.html +1 -1
  44. package/public/dashboard.html +775 -483
  45. package/public/diagnostic.html +15 -10
  46. package/public/enterprise-governance.html +26 -174
  47. package/public/eval-scorecard.html +3 -4
  48. package/public/eval-scorecard.json +2 -2
  49. package/public/evaluations.html +0 -1
  50. package/public/founders.html +3 -3
  51. package/public/gaming-playbook.html +4 -4
  52. package/public/guide.html +3 -5
  53. package/public/index.html +302 -97
  54. package/public/install.html +16 -10
  55. package/public/js/buyer-intent.js +49 -8
  56. package/public/lessons.html +246 -83
  57. package/public/numbers.html +32 -33
  58. package/public/operator-framework.html +44 -72
  59. package/public/peter.html +3 -3
  60. package/public/platform-partners.html +1 -1
  61. package/public/pricing.html +163 -66
  62. package/public/pro.html +3 -1
  63. package/public/project-switcher.js +76 -0
  64. package/public/whitepaper.html +1 -2
  65. package/scripts/action-receipts.js +393 -0
  66. package/scripts/activation-quickstart.js +15 -3
  67. package/scripts/activation-tracker.js +280 -3
  68. package/scripts/agent-action-inventory.js +235 -143
  69. package/scripts/agent-operations-planner.js +1 -1
  70. package/scripts/agent-readiness.js +36 -6
  71. package/scripts/agentic-prompt-pipelines.js +901 -0
  72. package/scripts/analytics-window.js +7 -1
  73. package/scripts/async-job-runner.js +66 -11
  74. package/scripts/audit-trail.js +37 -24
  75. package/scripts/auto-promote-gates.js +37 -27
  76. package/scripts/auto-wire-hooks.js +64 -25
  77. package/scripts/backfill-lesson-scopes.js +122 -0
  78. package/scripts/billing.js +889 -132
  79. package/scripts/bot-detection.js +112 -0
  80. package/scripts/brand-standards-gate.js +571 -0
  81. package/scripts/chatgpt-ads-readiness-pack.js +1 -1
  82. package/scripts/cli-demo.js +5 -27
  83. package/scripts/cli-schema.js +25 -1
  84. package/scripts/commercial-offer.js +2 -2
  85. package/scripts/contextfs.js +9 -3
  86. package/scripts/craft-playbook-gate.js +550 -0
  87. package/scripts/cross-encoder-reranker.js +4 -0
  88. package/scripts/dashboard-chat.js +11 -0
  89. package/scripts/dashboard.js +574 -167
  90. package/scripts/decision-journal.js +7 -4
  91. package/scripts/docker-sandbox-planner.js +3 -3
  92. package/scripts/export-dpo-pairs.js +12 -7
  93. package/scripts/failure-diagnostics.js +11 -0
  94. package/scripts/feedback-aggregate.js +4 -0
  95. package/scripts/feedback-attribution.js +6 -4
  96. package/scripts/feedback-history-distiller.js +18 -6
  97. package/scripts/feedback-loop.js +255 -89
  98. package/scripts/feedback-paths.js +8 -1
  99. package/scripts/feedback-sanitizer.js +5 -0
  100. package/scripts/feedback-scope.js +106 -0
  101. package/scripts/feedback-session.js +8 -2
  102. package/scripts/filesystem-search.js +13 -8
  103. package/scripts/financial-control-plane.js +707 -45
  104. package/scripts/gate-stats.js +38 -5
  105. package/scripts/gates-engine.js +1326 -240
  106. package/scripts/generate-eval-scorecard.js +0 -1
  107. package/scripts/gitlab-sdlc-prompts.js +397 -0
  108. package/scripts/harness-tool-names.js +31 -5
  109. package/scripts/hook-runtime.js +10 -0
  110. package/scripts/hybrid-feedback-context.js +7 -2
  111. package/scripts/intervention-policy.js +2 -1
  112. package/scripts/lesson-canonical.js +2 -2
  113. package/scripts/lesson-db.js +55 -14
  114. package/scripts/lesson-graph.js +2 -1
  115. package/scripts/lesson-retrieval.js +95 -9
  116. package/scripts/lesson-search.js +86 -22
  117. package/scripts/lesson-synthesis.js +21 -5
  118. package/scripts/mabl-failure-honesty.js +273 -0
  119. package/scripts/mailer/index.js +17 -1
  120. package/scripts/mailer/resend-mailer.js +213 -179
  121. package/scripts/migrate-project-scope.js +209 -0
  122. package/scripts/model-distress-detector.js +3 -3
  123. package/scripts/operational-integrity.js +436 -3
  124. package/scripts/override-audit.js +2 -0
  125. package/scripts/owner-admin.js +338 -0
  126. package/scripts/pr-manager.js +194 -1
  127. package/scripts/product-feedback.js +35 -0
  128. package/scripts/progressive-signoff.js +260 -0
  129. package/scripts/project-catalog.js +243 -0
  130. package/scripts/project-dashboard.js +61 -0
  131. package/scripts/project-evidence.js +172 -0
  132. package/scripts/project-identity.js +182 -0
  133. package/scripts/project-scope.js +381 -0
  134. package/scripts/prompt-eval.js +1 -1
  135. package/scripts/prompt-guard.js +446 -52
  136. package/scripts/proof-report.js +232 -0
  137. package/scripts/provider-action-normalizer.js +14 -6
  138. package/scripts/qwenwork-policy-group.js +413 -0
  139. package/scripts/rate-limiter.js +41 -0
  140. package/scripts/secret-redaction.js +171 -25
  141. package/scripts/secret-scanner.js +101 -42
  142. package/scripts/self-protection.js +2 -2
  143. package/scripts/seo-gsd.js +14 -14
  144. package/scripts/session-context-dedupe.js +66 -0
  145. package/scripts/settings-hierarchy.js +4 -2
  146. package/scripts/statusline-meta.js +34 -23
  147. package/scripts/tailscale-october-access.js +416 -0
  148. package/scripts/task-outcomes.js +58 -2
  149. package/scripts/telemetry-analytics.js +260 -16
  150. package/scripts/thumbgate-search.js +23 -9
  151. package/scripts/tool-kpi-tracker.js +5 -2
  152. package/scripts/tool-registry.js +42 -1
  153. package/scripts/triage-savings-calculator.js +1 -1
  154. package/scripts/vector-store.js +4 -1
  155. package/scripts/verified-lessons.js +270 -0
  156. package/scripts/verify-marketing-pages-deployed.js +2 -2
  157. package/scripts/workflow-sentinel.js +29 -10
  158. package/server.json +2 -2
  159. package/src/api/server.js +2478 -470
  160. package/src/feedback.js +21 -0
  161. package/src/hermes-sync-plane.js +2 -1
  162. package/src/index.js +2 -0
  163. package/src/lesson-search.js +9 -0
  164. package/src/mckinsey-top-company-ai-coding.js +493 -0
  165. package/src/mcp/email-triage-server/index.js +973 -0
  166. package/src/mcp/email-triage-server/package.json +12 -0
  167. package/src/mcp/server.js +3 -0
  168. package/src/mcp-writeguard.js +772 -11
  169. package/src/openshell-lovable-engine.js +1475 -0
  170. package/src/task-outcome.js +3 -0
  171. package/config/evals/agent-safety-eval.json +0 -447
  172. package/config/evals/retrieval-ranking-golden.json +0 -522
  173. package/config/progressive/01-wire-only.json +0 -11
  174. package/config/progressive/02-dashboard-empty-ok.json +0 -10
  175. package/config/progressive/03-one-lesson.json +0 -10
  176. package/config/progressive/04-warn-fires.json +0 -11
  177. package/config/progressive/05-strict-optional.json +0 -11
  178. package/config/progressive/README.md +0 -15
  179. package/public/assets/diagrams/agent-integration.png +0 -0
  180. package/public/assets/diagrams/thumbgate-architecture.png +0 -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.40.1",
5
5
  "author": {
6
6
  "name": "Igor Ganapolsky",
7
7
  "email": "ig5973700@gmail.com",
@@ -61,8 +61,8 @@ npx thumbgate init --agent claude-code
61
61
  - Free GPT: advice, checkpointing, and setup help in ChatGPT
62
62
  - Codex Plugin: https://thumbgate.ai/codex-plugin
63
63
  - Free local CLI: 2 captures/day, 10 total captures, up to 3 active auto-promoted prevention rules, and local Pre-Action Checks after install (recall and lesson search are Pro-only)
64
- - Pro: $19/mo or $149/yr — personal enforcement proof, local dashboard, check debugger, DPO export, synced lessons/rules across machines, and review-ready exports
65
- - Managed AI Agent Workflow Gate: one-time engagement covering one supported workflow — a 60-minute review, one configured local gate, its regression test, and written rollout/rollback proof within two business days. Current terms: https://thumbgate.ai/pricing
64
+ - Setup Sprint: $499 one-time for one supported workflow. Free CLI for evaluation. Custom scope after proof.
65
+ - Setup Sprint: one-time engagement covering one supported workflow — a 60-minute review, one configured local gate, its regression test, and written rollout/rollback proof within two business days. Current terms: https://thumbgate.ai/pricing
66
66
  - Enterprise: custom pricing, scoped after intake — shared hosted lesson database, org-wide dashboard, GCP/DFCX guardrails, VPC gating, and white-glove workflow hardening sprints
67
67
 
68
68
  ## Links
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thumbgate",
3
- "version": "1.39.0",
3
+ "version": "1.40.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
@@ -25,7 +25,7 @@
25
25
  <a href="#quick-start"><img src="https://img.shields.io/badge/⚡_Quick_Start-npx_thumbgate_init-22d3ee?style=for-the-badge" alt="Quick Start" /></a>
26
26
  <a href="https://thumbgate.ai/#demo?utm_source=github&utm_medium=readme"><img src="https://img.shields.io/badge/🎬_Watch-90s_Demo-ff647c?style=for-the-badge" alt="Watch Demo" /></a>
27
27
  <a href="https://thumbgate.ai/go/gpt?utm_source=github&utm_medium=readme"><img src="https://img.shields.io/badge/💬_Try-ThumbGate_GPT-56e39f?style=for-the-badge" alt="Try GPT" /></a>
28
- <a href="https://thumbgate.ai/checkout/pro?utm_source=github&utm_medium=readme"><img src="https://img.shields.io/badge/💼_Pro-$19/mo-ffd166?style=for-the-badge" alt="Pro Tier" /></a>
28
+ <a href="https://thumbgate.ai/go/pro-direct?utm_source=github&utm_medium=readme"><img src="https://img.shields.io/badge/💼_Pro-$19/mo-ffd166?style=for-the-badge" alt="Pro Tier" /></a>
29
29
  </p>
30
30
 
31
31
  ---
@@ -183,15 +183,15 @@ Free tier: **2 feedback captures/day (10 total)** and **up to 3 active auto-prom
183
183
  | Hosted team lesson sync | — | — | Not general availability |
184
184
  | Hosted org dashboard | — | — | Not general availability |
185
185
 
186
- **Enterprise intake path:** the **Workflow Hardening Sprint** scopes one repeated failure before any broader rollout commitment. **[Start intake →](https://thumbgate.ai/?utm_source=github&utm_medium=readme&utm_campaign=team_rollout#workflow-sprint-intake)**
186
+ **Enterprise intake path:** the **Setup Sprint** scopes one repeated failure before any broader rollout commitment. **[Start intake →](https://thumbgate.ai/go/diagnostic?utm_source=github&utm_medium=readme&utm_campaign=team_rollout)**
187
187
 
188
188
  **Local technical path:** install the CLI and use `init` plus the documented setup so Pre-Action Checks evaluate tool calls where the agent actually runs.
189
189
 
190
190
  **First-dollar activation path:** open the [ThumbGate GPT](https://thumbgate.ai/go/gpt?utm_source=github&utm_medium=readme), paste the risky action, capture typed feedback (`thumbs down:` / `thumbs up:`). **Native ChatGPT rating buttons are not the ThumbGate capture path.** Ask: **what repeated AI mistake would be worth catching before the tool executes?**
191
191
 
192
- **Paid path for individual operators:** [ThumbGate Pro](https://thumbgate.ai/checkout/pro?utm_source=github&utm_medium=readme&utm_campaign=pro_page) is the self-serve side lane for a personal dashboard and export-ready evidence.
192
+ **Paid path for individual operators:** [ThumbGate Pro](https://thumbgate.ai/go/pro-direct?utm_source=github&utm_medium=readme&utm_campaign=pro_page) is the self-serve side lane for a personal dashboard and export-ready evidence.
193
193
 
194
- [**Start free**](https://thumbgate.ai/?utm_source=github&utm_medium=readme) · [**Pro $19/mo**](https://thumbgate.ai/checkout/pro?utm_source=github&utm_medium=readme) · [**Live Dashboard**](https://thumbgate.ai/dashboard?utm_source=github&utm_medium=readme) · [**Team Sprint intake**](https://thumbgate.ai/?utm_source=github&utm_medium=readme#workflow-sprint-intake) · [**Workflow Hardening Sprint**](https://thumbgate.ai/?utm_source=github&utm_medium=readme&utm_campaign=top_cta#workflow-sprint-intake) · [**First Dollar Playbook**](docs/FIRST_DOLLAR_PLAYBOOK.md)
194
+ [**Start free**](https://thumbgate.ai/?utm_source=github&utm_medium=readme) · [**Pro $19/mo**](https://thumbgate.ai/go/pro-direct?utm_source=github&utm_medium=readme) · [**Live Dashboard**](https://thumbgate.ai/dashboard?utm_source=github&utm_medium=readme) · [**Team Sprint intake**](https://thumbgate.ai/go/diagnostic?utm_source=github&utm_medium=readme) · [**Setup Sprint**](https://thumbgate.ai/go/diagnostic?utm_source=github&utm_medium=readme&utm_campaign=top_cta) · [**First Dollar Playbook**](docs/FIRST_DOLLAR_PLAYBOOK.md)
195
195
 
196
196
  **Popular buyer questions:** **[AI search topical presence](https://thumbgate.ai/guides/ai-search-topical-presence?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Relational knowledge and AI recommendations](https://thumbgate.ai/guides/relational-knowledge-ai-recommendations?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[AI Mode ads for agent governance](https://thumbgate.ai/guides/ai-mode-ads-agent-governance?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[MCP tool governance](https://thumbgate.ai/guides/mcp-tool-governance?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[AI agent pre-action approval gates](https://thumbgate.ai/guides/ai-agent-pre-action-approval-gates?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Background agent governance](https://thumbgate.ai/guides/background-agent-governance?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[GPT-5.5 model evaluation](https://thumbgate.ai/guides/gpt-5-5-model-evaluation?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Stop repeated AI agent mistakes](https://thumbgate.ai/guides/stop-repeated-ai-agent-mistakes?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Browser automation safety](https://thumbgate.ai/guides/browser-automation-safety?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Native messaging host security](https://thumbgate.ai/guides/native-messaging-host-security?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Autoresearch agent safety](https://thumbgate.ai/guides/autoresearch-agent-safety?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Cursor guardrails](https://thumbgate.ai/guides/cursor-agent-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Codex CLI guardrails](https://thumbgate.ai/guides/codex-cli-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Gemini CLI memory + enforcement](https://thumbgate.ai/guides/gemini-cli-feedback-memory?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Google Cloud MCP guardrails](https://thumbgate.ai/guides/gcp-mcp-guardrails?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)** · **[Roo Code alternative: migrate to Cline](https://thumbgate.ai/guides/roo-code-alternative-cline?utm_source=github&utm_medium=readme&utm_campaign=buyer_questions)**
197
197
 
@@ -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)
@@ -315,6 +320,7 @@ Full index: **[docs/INDEX.md](docs/INDEX.md)**
315
320
  |------|------|
316
321
  | Agent workflow contract | [WORKFLOW.md](WORKFLOW.md) |
317
322
  | Ready-for-agent intake | [.github/ISSUE_TEMPLATE/ready-for-agent.yml](.github/ISSUE_TEMPLATE/ready-for-agent.yml) |
323
+ | Cloud-to-Mac dispatch loop | [docs/guides/mac-dispatch-loop.md](docs/guides/mac-dispatch-loop.md) |
318
324
  | Verification Evidence | [docs/VERIFICATION_EVIDENCE.md](docs/VERIFICATION_EVIDENCE.md) |
319
325
  | Release Confidence | [docs/RELEASE_CONFIDENCE.md](docs/RELEASE_CONFIDENCE.md) |
320
326
  | Changeset strategy | [docs/CHANGESET_STRATEGY.md](docs/CHANGESET_STRATEGY.md) |
@@ -331,7 +337,7 @@ Full index: **[docs/INDEX.md](docs/INDEX.md)**
331
337
 
332
338
  ## Who builds this
333
339
 
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)
340
+ **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
341
 
336
342
  ## License
337
343
 
@@ -2,13 +2,17 @@
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.40.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.40.1", "thumbgate", "gate-check"]
12
+ },
13
+ "userPromptSubmit": {
14
+ "command": "npx",
15
+ "args": ["--yes", "--package", "thumbgate@1.40.1", "thumbgate", "hook-auto-capture"]
12
16
  }
13
17
  }
14
18
  }
@@ -9,3 +9,8 @@ args = ["-lc", "[ -x \"$HOME/.thumbgate/runtime/node_modules/.bin/thumbgate\" ]
9
9
  [hooks.pre_tool_use]
10
10
  command = "sh"
11
11
  args = ["-lc", "[ -x \"$HOME/.thumbgate/runtime/node_modules/.bin/thumbgate\" ] && exec \"$HOME/.thumbgate/runtime/node_modules/.bin/thumbgate\" \"gate-check\" || mkdir -p \"$HOME/.thumbgate/runtime\" && exec npm \"exec\" \"--prefix\" \"$HOME/.thumbgate/runtime\" \"--yes\" \"--package\" \"thumbgate@latest\" \"--\" \"thumbgate\" \"gate-check\""]
12
+
13
+ # Hard UserPromptSubmit hook for Codex — blocks pasted passwords and API keys before model submission
14
+ [hooks.user_prompt_submit]
15
+ command = "sh"
16
+ args = ["-lc", "[ -x \"$HOME/.thumbgate/runtime/node_modules/.bin/thumbgate\" ] && exec \"$HOME/.thumbgate/runtime/node_modules/.bin/thumbgate\" \"hook-auto-capture\" || mkdir -p \"$HOME/.thumbgate/runtime\" && exec npm \"exec\" \"--prefix\" \"$HOME/.thumbgate/runtime\" \"--yes\" \"--package\" \"thumbgate@latest\" \"--\" \"thumbgate\" \"hook-auto-capture\""]
@@ -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.40.1 thumbgate gate-check"
13
13
  trigger: pre_tool_use
14
14
 
15
15
  thumbgate-feedback:
16
- description: "ThumbGate feedback capture — logs user prompt context"
17
- command: "npx --yes --package thumbgate@1.39.0 thumbgate hook-auto-capture"
16
+ description: "ThumbGate UserPromptSubmit guard & feedback capture — blocks pasted passwords/keys and logs safe prompt context"
17
+ command: "npx --yes --package thumbgate@1.40.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.40.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.40.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.40.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.40.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.40.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.40.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.40.1' };
338
338
  const COMMERCE_CATEGORIES = [
339
339
  'product_recommendation',
340
340
  'brand_compliance',
@@ -579,6 +579,29 @@ function buildSuggestFixResponse(args = {}) {
579
579
  .slice(0, limit)
580
580
  .map(({ action, source }) => ({ action, source }));
581
581
 
582
+ let designSelfCorrection = null;
583
+ const isDesignQuery = /\b(contrast|tap\s*target|touch\s*target|44px|overflow|focus\s*ring|colorblind|cls|layout\s*shift)\b/i.test(context)
584
+ || typeof args.sourceCode === 'string'
585
+ || Array.isArray(args.visualFindings);
586
+ const rawDesignSrc = typeof args.sourceCode === 'string' ? args.sourceCode : '';
587
+ if (isDesignQuery && rawDesignSrc.length <= 262144) {
588
+ try {
589
+ const { runDesignSelfCorrectionPipeline } = require('../../src/openshell-lovable-engine');
590
+ const vf = Array.isArray(args.visualFindings) ? args.visualFindings : (context ? [context] : []);
591
+ designSelfCorrection = runDesignSelfCorrectionPipeline({
592
+ sourceCode: rawDesignSrc,
593
+ visualFindings: vf,
594
+ });
595
+ for (const p of designSelfCorrection.patches) {
596
+ const tw = p.tailwindPatch?.add?.length ? ` | Tailwind +[${p.tailwindPatch.add.join(' ')}]` : '';
597
+ all.unshift({
598
+ action: `Apply [${p.type}] on ${p.selector || p.astPath}: CSS { ${p.cssOverride} }${tw}`,
599
+ source: 'lovable-ast-design-engine',
600
+ });
601
+ }
602
+ } catch { /* non-fatal */ }
603
+ }
604
+
582
605
  // If nothing matched, add generic fallback
583
606
  if (all.length === 0) {
584
607
  all.push({
@@ -587,10 +610,12 @@ function buildSuggestFixResponse(args = {}) {
587
610
  });
588
611
  }
589
612
 
613
+ const capped = all.slice(0, limit);
590
614
  return toTextResult({
591
- suggestions: all,
615
+ suggestions: capped,
592
616
  query: context,
593
- totalFound: all.length,
617
+ totalFound: capped.length,
618
+ ...(designSelfCorrection ? { designSelfCorrection } : {}),
594
619
  });
595
620
  }
596
621
 
@@ -1096,15 +1121,19 @@ async function callToolInner(name, args) {
1096
1121
  const pairedFeedback = pairFeedbackWithReceipt(args);
1097
1122
  return toCaptureFeedbackTextResult(captureFeedback({
1098
1123
  ...pairedFeedback,
1124
+ cwd: resolveWorkspaceCwd(args.cwd),
1125
+ lessonId: args.lessonId,
1126
+ lessonKey: args.lessonKey,
1099
1127
  reviewOrigin: 'automated',
1100
1128
  }));
1101
1129
  }
1102
1130
  case 'feedback_summary':
1103
- return toTextResult(feedbackSummary(Number(args.recent || 20), { humanOnly: true }));
1131
+ return toTextResult(feedbackSummary(Number(args.recent || 20), { humanOnly: true, projectKey: require('../../scripts/project-identity').resolveLocalProject(resolveWorkspaceCwd(args.cwd)).projectKey }));
1104
1132
  case 'search_lessons': {
1105
1133
  const module = loadPrivateMcpModule('lessonSearch');
1106
1134
  if (!module) return unavailablePrivateMcpFeature('search_lessons');
1107
1135
  return toTextResult(module.searchLessons(args.query || '', {
1136
+ projectKey: require('../../scripts/project-identity').resolveLocalProject(resolveWorkspaceCwd(args.cwd)).projectKey,
1108
1137
  limit: Number(args.limit || 10),
1109
1138
  category: args.category,
1110
1139
  tags: Array.isArray(args.tags) ? args.tags : [],
@@ -1124,7 +1153,9 @@ async function callToolInner(name, args) {
1124
1153
  { maxResults: options.maxResults || 5 },
1125
1154
  ),
1126
1155
  }));
1127
- return toTextResult(await retrieveWithReranking(
1156
+ const { lookupLessonByError } = require('../../scripts/verified-lessons');
1157
+ const exactError = lookupLessonByError(args.actionContext || '');
1158
+ let retrievalResults = await retrieveWithReranking(
1128
1159
  args.toolName,
1129
1160
  args.actionContext || '',
1130
1161
  {
@@ -1137,7 +1168,22 @@ async function callToolInner(name, args) {
1137
1168
  queryRewrite: args.queryRewrite !== false,
1138
1169
  includeRetrievalMeta: args.includeRetrievalMeta === true,
1139
1170
  },
1140
- ));
1171
+ );
1172
+ if (exactError && exactError.isSeeded) {
1173
+ const exactItem = {
1174
+ id: exactError.id,
1175
+ title: (exactError.stale ? '[STALE] ' : '') + exactError.title,
1176
+ signal: 'negative',
1177
+ content: exactError.content,
1178
+ badge: exactError.badge,
1179
+ stale: exactError.stale,
1180
+ verificationCount: exactError.verificationCount,
1181
+ lastVerifiedAt: exactError.lastVerifiedAt,
1182
+ rule: { fix: exactError.fix },
1183
+ };
1184
+ retrievalResults = [exactItem, ...(Array.isArray(retrievalResults) ? retrievalResults.filter(r => r.id !== exactError.id) : [])];
1185
+ }
1186
+ return toTextResult(retrievalResults);
1141
1187
  }
1142
1188
  case 'ai_component_inventory': {
1143
1189
  const {
@@ -1224,6 +1270,20 @@ async function callToolInner(name, args) {
1224
1270
  decision = 'error';
1225
1271
  reason = 'gate engine returned unparseable output';
1226
1272
  }
1273
+ let designSelfCorrection = null;
1274
+ if (decision !== 'block' && decision !== 'error') {
1275
+ try {
1276
+ const ti = canonical.toolInput || {};
1277
+ const fp = String(ti.file_path || ti.filePath || '').trim();
1278
+ const src = String(ti.content ?? ti.new_string ?? ti.sourceCode ?? '');
1279
+ const hasVf = Array.isArray(ti.visualFindings) && ti.visualFindings.length > 0;
1280
+ if (src.length <= 262144 && ((/\.(?:html?|jsx|tsx|css)$/i.test(fp) && Boolean(src)) || hasVf)) {
1281
+ const { runDesignSelfCorrectionPipeline } = require('../../src/openshell-lovable-engine');
1282
+ const rep = runDesignSelfCorrectionPipeline({ sourceCode: src, visualFindings: ti.visualFindings });
1283
+ if (rep.issueCount > 0) designSelfCorrection = rep;
1284
+ }
1285
+ } catch { /* non-fatal */ }
1286
+ }
1227
1287
  const strict = process.env.THUMBGATE_STRICT_ENFORCEMENT === '1';
1228
1288
  return {
1229
1289
  content: [{
@@ -1240,12 +1300,35 @@ async function callToolInner(name, args) {
1240
1300
  ? 'Gate evaluation failed. Treat as unsafe and ask the user.'
1241
1301
  : 'No policy gate matched.',
1242
1302
  reason,
1303
+ ...(designSelfCorrection ? { designSelfCorrection } : {}),
1243
1304
  }, null, 2),
1244
1305
  }],
1245
1306
  };
1246
1307
  }
1247
1308
  case 'feedback_stats':
1248
1309
  return toTextResult(analyzeFeedback(undefined, { humanOnly: true }));
1310
+ case 'gold_gate_check': {
1311
+ const cudaGateBatch = require(path.join(__dirname, '..', '..', 'scripts', 'cuda-gate-batch'));
1312
+ const result = await cudaGateBatch.runGatePipeline({
1313
+ tool_name: args.tool_name,
1314
+ tool_input: args.tool_input || {},
1315
+ });
1316
+ return toTextResult(JSON.stringify({
1317
+ decision: result.decision,
1318
+ flagged: result.verdict.matchedRules.length > 0,
1319
+ reason: result.reason,
1320
+ categoriesChecked: result.verdict.categoriesChecked,
1321
+ rulesMatched: result.verdict.matchedRules.length,
1322
+ latencyUs: result.verdict.stats.totalLatencyUs,
1323
+ guidance: result.decision === 'deny'
1324
+ ? 'Do NOT run this action. Surface the reason to the user.'
1325
+ : 'No policy gate matched.',
1326
+ }, null, 2));
1327
+ }
1328
+ case 'gate_semantic_layer': {
1329
+ const semanticLayer = require(path.join(__dirname, '..', '..', 'scripts', 'gate-semantic-layer'));
1330
+ return toTextResult(JSON.stringify(semanticLayer.describeGoldLayer(), null, 2));
1331
+ }
1249
1332
  case 'diagnose_failure':
1250
1333
  return buildDiagnoseFailureResponse(args);
1251
1334
  case 'reflect_on_feedback':
@@ -1407,9 +1490,19 @@ async function callToolInner(name, args) {
1407
1490
  gateName,
1408
1491
  args.evidence || '',
1409
1492
  args.structuredReasoning || null,
1410
- { source: 'mcp', actor: args.actor || 'agent' },
1493
+ { ...require('../../scripts/project-identity').resolveLocalProject(resolveWorkspaceCwd(args.cwd)), source: 'mcp', actor: args.actor || 'agent' },
1411
1494
  );
1412
1495
  const result = { satisfied: true, gate: gateName, ...entry };
1496
+ if (args.lessonId || args.lessonKey || args.appliedLessons) {
1497
+ try {
1498
+ const { verifyLesson } = require("../../scripts/verified-lessons");
1499
+ const lessons = Array.isArray(args.appliedLessons) ? args.appliedLessons : [args.lessonId || args.lessonKey];
1500
+ const checkCmd = args.evidence || ("gate " + gateName + " satisfied");
1501
+ for (const lid of lessons) {
1502
+ if (lid) verifyLesson(lid, checkCmd);
1503
+ }
1504
+ } catch (_satErr) {}
1505
+ }
1413
1506
  // Log structured reasoning to audit trail for learning
1414
1507
  if (args.structuredReasoning) {
1415
1508
  recordAuditEvent({
@@ -1766,6 +1859,10 @@ async function callToolInner(name, args) {
1766
1859
  matryoshkaEmbedding: args.matryoshkaEmbedding !== false,
1767
1860
  matryoshkaOptions: args.matryoshkaOptions || undefined,
1768
1861
  }));
1862
+ case 'graphrag_traverse':
1863
+ case 'route_workload':
1864
+ case 'trim_context':
1865
+ return toTextResult(await require('../../scripts/agentic-prompt-pipelines').handlePipelineTool(name, args));
1769
1866
  case 'plan_agent_design_governance':
1770
1867
  return toTextResult(buildAgentDesignGovernancePlan(args));
1771
1868
  case 'plan_proactive_agent_eval_guardrails':
@@ -7,7 +7,7 @@
7
7
  "npx",
8
8
  "--yes",
9
9
  "--package",
10
- "thumbgate@1.39.0",
10
+ "thumbgate@1.40.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
  },