thumbgate 1.27.20 → 1.28.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 (63) hide show
  1. package/.claude-plugin/plugin.json +2 -1
  2. package/.well-known/mcp/server-card.json +1 -1
  3. package/README.md +124 -129
  4. package/adapters/claude/.mcp.json +2 -2
  5. package/adapters/mcp/server-stdio.js +18 -33
  6. package/adapters/opencode/opencode.json +1 -1
  7. package/bin/cli.js +95 -78
  8. package/bin/postinstall.js +1 -1
  9. package/config/entitlement-public-keys.json +6 -0
  10. package/config/gates/default.json +3 -3
  11. package/config/github-about.json +2 -5
  12. package/config/merge-quality-checks.json +3 -0
  13. package/config/post-deploy-marketing-pages.json +1 -1
  14. package/hooks/hooks.json +38 -0
  15. package/package.json +28 -10
  16. package/public/about.html +1 -4
  17. package/public/agent-manager.html +6 -6
  18. package/public/agents-cost-savings.html +3 -3
  19. package/public/ai-malpractice-prevention.html +1 -1
  20. package/public/blog.html +12 -9
  21. package/public/chatgpt-app.html +3 -3
  22. package/public/codex-enterprise.html +3 -3
  23. package/public/codex-plugin.html +5 -5
  24. package/public/compare.html +10 -10
  25. package/public/dashboard.html +1 -1
  26. package/public/diagnostic.html +23 -1
  27. package/public/federal.html +2 -2
  28. package/public/guide.html +14 -14
  29. package/public/index.html +202 -220
  30. package/public/install.html +14 -14
  31. package/public/learn.html +4 -17
  32. package/public/numbers.html +2 -2
  33. package/public/partner-intake.html +198 -0
  34. package/public/pricing.html +61 -31
  35. package/public/pro.html +2 -2
  36. package/scripts/agent-reward-model.js +13 -0
  37. package/scripts/bayes-optimal-gate.js +6 -1
  38. package/scripts/billing.js +815 -137
  39. package/scripts/checkout-attribution-reference.js +85 -0
  40. package/scripts/claude-feedback-sync.js +23 -6
  41. package/scripts/cli-feedback.js +33 -8
  42. package/scripts/commercial-offer.js +3 -3
  43. package/scripts/entitlement.js +250 -0
  44. package/scripts/export-databricks-bundle.js +5 -0
  45. package/scripts/export-dpo-pairs.js +6 -0
  46. package/scripts/export-hf-dataset.js +5 -0
  47. package/scripts/feedback-loop.js +290 -1
  48. package/scripts/feedback-quality.js +25 -26
  49. package/scripts/feedback-sanitizer.js +151 -3
  50. package/scripts/gates-engine.js +134 -43
  51. package/scripts/hosted-config.js +9 -2
  52. package/scripts/imperative-detector.js +85 -0
  53. package/scripts/intervention-policy.js +13 -0
  54. package/scripts/mailer/resend-mailer.js +11 -5
  55. package/scripts/pr-manager.js +9 -22
  56. package/scripts/pro-local-dashboard.js +198 -0
  57. package/scripts/risk-scorer.js +6 -0
  58. package/scripts/secret-scanner.js +363 -68
  59. package/scripts/self-protection.js +21 -36
  60. package/scripts/seo-gsd.js +2 -2
  61. package/scripts/thompson-sampling.js +11 -2
  62. package/src/api/server.js +202 -22
  63. package/public/assets/brand/github-social-preview.png +0 -0
@@ -11,6 +11,7 @@
11
11
 
12
12
  const path = require('node:path');
13
13
  const { loadEpisodes } = require('./session-episode-store');
14
+ const { requireLearnedModelsEntitlement } = require('./entitlement');
14
15
 
15
16
  const HIGH_RISK_TAGS = new Set([
16
17
  'billing',
@@ -163,6 +164,10 @@ function isRlTuple(value) {
163
164
  }
164
165
 
165
166
  function buildPreferencePairs(episodes = [], options = {}) {
167
+ requireLearnedModelsEntitlement({
168
+ ...(options.entitlement || {}),
169
+ label: 'agent reward preference-pair generation',
170
+ });
166
171
  const tuples = episodes
167
172
  .map((episode) => episodeToRlTuple(episode, options))
168
173
  .sort((a, b) => a.reward.total - b.reward.total);
@@ -181,6 +186,10 @@ function buildPreferencePairs(episodes = [], options = {}) {
181
186
  }
182
187
 
183
188
  function rankGateCandidatesByReward(episodes = [], options = {}) {
189
+ requireLearnedModelsEntitlement({
190
+ ...(options.entitlement || {}),
191
+ label: 'agent reward gate ranking',
192
+ });
184
193
  const minOccurrences = Math.max(1, Number(options.minOccurrences || 2));
185
194
  const buckets = new Map();
186
195
 
@@ -305,6 +314,10 @@ function allocateTestTimeCompute(action = {}) {
305
314
  }
306
315
 
307
316
  function buildRewardReport(episodes = [], options = {}) {
317
+ requireLearnedModelsEntitlement({
318
+ ...(options.entitlement || {}),
319
+ label: 'agent reward model report',
320
+ });
308
321
  const tuples = episodes.map((episode) => episodeToRlTuple(episode, options));
309
322
  const rewards = tuples.map((tuple) => tuple.reward.total);
310
323
  const averageReward = rewards.length ? round(rewards.reduce((sum, value) => sum + value, 0) / rewards.length) : 0;
@@ -32,6 +32,7 @@
32
32
 
33
33
  const fs = require('node:fs');
34
34
  const path = require('node:path');
35
+ const { requireLearnedModelsEntitlement } = require('./entitlement');
35
36
 
36
37
  // Baseline loss matrix. `default` applies when no tag-specific override
37
38
  // matches. Higher = more expensive. The asymmetry below reflects the
@@ -181,7 +182,11 @@ function computeBayesPosterior({ tags, riskByTag, baseRate, modelProbability } =
181
182
  *
182
183
  * This reduces to the usual Bayes classifier when both costs are equal.
183
184
  */
184
- function bayesOptimalDecision(posterior, tags, lossMatrix = DEFAULT_LOSS_MATRIX) {
185
+ function bayesOptimalDecision(posterior, tags, lossMatrix = DEFAULT_LOSS_MATRIX, options = {}) {
186
+ requireLearnedModelsEntitlement({
187
+ ...(options.entitlement || {}),
188
+ label: 'Bayes-optimal gate decisioning',
189
+ });
185
190
  const pHarmful = clip(Number(posterior?.pHarmful), 0, 1);
186
191
  const pSafe = clip(Number(posterior?.pSafe ?? 1 - pHarmful), 0, 1);
187
192
  const cFalseAllow = resolveCost(lossMatrix?.falseAllow || {}, tags);