thumbgate 1.14.1 → 1.16.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 (150) hide show
  1. package/.claude-plugin/marketplace.json +6 -6
  2. package/.claude-plugin/plugin.json +3 -3
  3. package/.well-known/llms.txt +5 -5
  4. package/.well-known/mcp/server-card.json +1 -1
  5. package/README.md +60 -35
  6. package/adapters/chatgpt/openapi.yaml +118 -2
  7. package/adapters/claude/.mcp.json +2 -2
  8. package/adapters/mcp/server-stdio.js +217 -84
  9. package/adapters/opencode/opencode.json +1 -1
  10. package/bench/prompt-eval-suite.json +5 -1
  11. package/bin/cli.js +211 -8
  12. package/config/enforcement.json +59 -7
  13. package/config/evals/agent-safety-eval.json +338 -22
  14. package/config/gates/default.json +33 -0
  15. package/config/gates/routine.json +43 -0
  16. package/config/github-about.json +3 -3
  17. package/config/mcp-allowlists.json +4 -0
  18. package/config/merge-quality-checks.json +2 -1
  19. package/config/model-candidates.json +131 -0
  20. package/openapi/openapi.yaml +118 -2
  21. package/package.json +70 -51
  22. package/public/blog.html +7 -7
  23. package/public/codex-plugin.html +13 -7
  24. package/public/compare.html +29 -23
  25. package/public/dashboard.html +105 -12
  26. package/public/guide.html +28 -28
  27. package/public/index.html +233 -97
  28. package/public/learn.html +87 -20
  29. package/public/lessons.html +26 -2
  30. package/public/numbers.html +271 -0
  31. package/public/pro.html +89 -19
  32. package/scripts/agent-audit-trace.js +55 -0
  33. package/scripts/agent-memory-lifecycle.js +96 -0
  34. package/scripts/agent-readiness-plan.js +118 -0
  35. package/scripts/agentic-data-pipeline.js +21 -1
  36. package/scripts/agents-sdk-sandbox-plan.js +57 -0
  37. package/scripts/ai-org-governance.js +98 -0
  38. package/scripts/ai-search-distribution.js +43 -0
  39. package/scripts/artifact-agent-plan.js +81 -0
  40. package/scripts/billing.js +27 -8
  41. package/scripts/cli-feedback.js +2 -1
  42. package/scripts/cli-schema.js +60 -5
  43. package/scripts/code-mode-mcp-plan.js +71 -0
  44. package/scripts/commercial-offer.js +1 -1
  45. package/scripts/context-engine.js +1 -2
  46. package/scripts/context-manager.js +4 -1
  47. package/scripts/contextfs.js +214 -32
  48. package/scripts/dashboard-render-spec.js +1 -1
  49. package/scripts/dashboard.js +275 -9
  50. package/scripts/decision-journal.js +13 -3
  51. package/scripts/document-workflow-governance.js +62 -0
  52. package/scripts/enterprise-agent-rollout.js +34 -0
  53. package/scripts/experience-replay-governance.js +69 -0
  54. package/scripts/export-hf-dataset.js +1 -1
  55. package/scripts/feedback-loop.js +141 -9
  56. package/scripts/feedback-to-rules.js +17 -23
  57. package/scripts/gates-engine.js +4 -6
  58. package/scripts/growth-campaigns.js +49 -0
  59. package/scripts/harness-selector.js +145 -1
  60. package/scripts/hybrid-supervisor-agent.js +64 -0
  61. package/scripts/inference-cache-policy.js +72 -0
  62. package/scripts/inference-economics.js +53 -0
  63. package/scripts/internal-agent-bootstrap.js +12 -2
  64. package/scripts/knowledge-layer-plan.js +108 -0
  65. package/scripts/lesson-canonical.js +181 -0
  66. package/scripts/lesson-db.js +71 -10
  67. package/scripts/lesson-inference.js +183 -44
  68. package/scripts/lesson-search.js +4 -1
  69. package/scripts/lesson-synthesis.js +23 -2
  70. package/scripts/llm-client.js +157 -26
  71. package/scripts/mailer/resend-mailer.js +112 -1
  72. package/scripts/mcp-transport-strategy.js +66 -0
  73. package/scripts/memory-store-governance.js +60 -0
  74. package/scripts/meta-agent-loop.js +7 -13
  75. package/scripts/model-access-eligibility.js +38 -0
  76. package/scripts/model-migration-readiness.js +55 -0
  77. package/scripts/native-messaging-audit.js +514 -0
  78. package/scripts/operational-integrity.js +96 -3
  79. package/scripts/otel-declarative-config.js +56 -0
  80. package/scripts/perplexity-client.js +1 -1
  81. package/scripts/post-training-governance.js +34 -0
  82. package/scripts/pr-manager.js +47 -7
  83. package/scripts/private-core-boundary.js +72 -0
  84. package/scripts/production-agent-readiness.js +40 -0
  85. package/scripts/profile-router.js +16 -1
  86. package/scripts/prompt-eval.js +564 -32
  87. package/scripts/prompt-programs.js +93 -0
  88. package/scripts/provider-action-normalizer.js +585 -0
  89. package/scripts/rule-validator.js +285 -0
  90. package/scripts/scaling-law-claims.js +60 -0
  91. package/scripts/security-scanner.js +1 -1
  92. package/scripts/self-distill-agent.js +7 -32
  93. package/scripts/seo-gsd.js +400 -43
  94. package/scripts/skill-rag-router.js +53 -0
  95. package/scripts/spec-gate.js +1 -1
  96. package/scripts/student-consistent-training.js +73 -0
  97. package/scripts/synthetic-data-provenance.js +98 -0
  98. package/scripts/task-context-result.js +81 -0
  99. package/scripts/telemetry-analytics.js +149 -0
  100. package/scripts/thompson-sampling.js +2 -2
  101. package/scripts/token-savings.js +7 -6
  102. package/scripts/token-tco.js +46 -0
  103. package/scripts/tool-registry.js +75 -3
  104. package/scripts/verification-loop.js +10 -1
  105. package/scripts/verifier-scoring.js +71 -0
  106. package/scripts/workflow-sentinel.js +284 -28
  107. package/scripts/workspace-agent-routines.js +118 -0
  108. package/skills/thumbgate/SKILL.md +1 -1
  109. package/src/api/server.js +434 -120
  110. package/.claude-plugin/README.md +0 -170
  111. package/adapters/README.md +0 -12
  112. package/scripts/analytics-report.js +0 -328
  113. package/scripts/autonomous-workflow.js +0 -377
  114. package/scripts/billing-setup.js +0 -109
  115. package/scripts/creator-campaigns.js +0 -239
  116. package/scripts/cross-encoder-reranker.js +0 -235
  117. package/scripts/daemon-manager.js +0 -108
  118. package/scripts/decision-trace.js +0 -354
  119. package/scripts/delegation-runtime.js +0 -896
  120. package/scripts/dispatch-brief.js +0 -159
  121. package/scripts/distribution-surfaces.js +0 -110
  122. package/scripts/feedback-history-distiller.js +0 -382
  123. package/scripts/funnel-analytics.js +0 -35
  124. package/scripts/history-distiller.js +0 -200
  125. package/scripts/hosted-job-launcher.js +0 -256
  126. package/scripts/intent-router.js +0 -392
  127. package/scripts/lesson-reranker.js +0 -263
  128. package/scripts/lesson-retrieval.js +0 -148
  129. package/scripts/managed-lesson-agent.js +0 -183
  130. package/scripts/operational-dashboard.js +0 -103
  131. package/scripts/operational-summary.js +0 -129
  132. package/scripts/operator-artifacts.js +0 -608
  133. package/scripts/optimize-context.js +0 -17
  134. package/scripts/org-dashboard.js +0 -206
  135. package/scripts/partner-orchestration.js +0 -146
  136. package/scripts/predictive-insights.js +0 -356
  137. package/scripts/pulse.js +0 -80
  138. package/scripts/reflector-agent.js +0 -221
  139. package/scripts/sales-pipeline.js +0 -681
  140. package/scripts/session-episode-store.js +0 -329
  141. package/scripts/session-health-sensor.js +0 -242
  142. package/scripts/session-report.js +0 -120
  143. package/scripts/swarm-coordinator.js +0 -81
  144. package/scripts/tool-kpi-tracker.js +0 -12
  145. package/scripts/webhook-delivery.js +0 -62
  146. package/scripts/workflow-sprint-intake.js +0 -475
  147. package/skills/agent-memory/SKILL.md +0 -97
  148. package/skills/solve-architecture-autonomy/SKILL.md +0 -17
  149. package/skills/solve-architecture-autonomy/tool.js +0 -33
  150. package/skills/thumbgate-feedback/SKILL.md +0 -49
package/public/pro.html CHANGED
@@ -7,14 +7,14 @@ __GOOGLE_SITE_VERIFICATION_META__
7
7
  <title>ThumbGate Pro | Personal local dashboard and proof for AI agent reliability</title>
8
8
  <meta name="description" content="ThumbGate Pro is the paid lane for individual operators who want a personal local dashboard, DPO export, review-ready evidence, and founder support for risky AI coding workflows.">
9
9
  <meta property="og:title" content="ThumbGate Pro | Personal local dashboard and proof for AI agent reliability">
10
- <meta property="og:description" content="Move from free local gates to a paid operator workflow with a personal local dashboard, DPO export, and review-ready evidence for repeated AI coding failures.">
10
+ <meta property="og:description" content="Move from free local checks to a paid operator workflow with a personal local dashboard, DPO export, and review-ready evidence for repeated AI coding failures.">
11
11
  <meta property="og:type" content="website">
12
12
  <meta property="og:url" content="__APP_ORIGIN__/pro">
13
13
  <link rel="canonical" href="__APP_ORIGIN__/pro">
14
14
  <link rel="icon" type="image/png" href="/thumbgate-icon.png">
15
15
  <link rel="apple-touch-icon" href="/assets/brand/thumbgate-mark.svg">
16
16
  <meta property="og:image" content="/og.png">
17
- <meta name="keywords" content="ThumbGate Pro, AI agent reliability, pre-action gates, DPO export, local dashboard, review-ready evidence, Claude Code reliability, Codex reliability, Cursor reliability">
17
+ <meta name="keywords" content="ThumbGate Pro, AI agent reliability, pre-action checks, DPO export, local dashboard, review-ready evidence, Claude Code reliability, Codex reliability, Cursor reliability">
18
18
 
19
19
  <script defer data-domain="thumbgate-production.up.railway.app" src="https://plausible.io/js/script.js"></script>
20
20
  __GA_BOOTSTRAP__
@@ -38,14 +38,19 @@ __GA_BOOTSTRAP__
38
38
  "description": "Paid ThumbGate lane for individual operators who want a personal local dashboard, DPO export, review-ready evidence, and founder support for risky AI coding workflows.",
39
39
  "url": "__APP_ORIGIN__/pro",
40
40
  "downloadUrl": "https://www.npmjs.com/package/thumbgate",
41
+ "dateModified": "2026-04-20",
41
42
  "creator": {
42
43
  "@type": "Person",
43
44
  "name": "Igor Ganapolsky",
44
- "url": "https://github.com/IgorGanapolsky"
45
+ "url": "https://github.com/IgorGanapolsky",
46
+ "sameAs": [
47
+ "https://github.com/IgorGanapolsky",
48
+ "https://www.linkedin.com/in/igorganapolsky"
49
+ ]
45
50
  },
46
51
  "featureList": [
47
52
  "Personal local dashboard",
48
- "Visual gate debugger",
53
+ "Visual check debugger",
49
54
  "DPO export from real thumbs-down corrections",
50
55
  "Auto-connect running agents after activation",
51
56
  "Founder support on risky workflows",
@@ -82,7 +87,7 @@ __GA_BOOTSTRAP__
82
87
  "name": "How is Pro different from the free install?",
83
88
  "acceptedAnswer": {
84
89
  "@type": "Answer",
85
- "text": "Free keeps the local recall, gates, and MCP workflow. Pro adds a personal local dashboard, DPO export, auto-connect for running agents, and founder support for risky workflows."
90
+ "text": "Free keeps the local recall, checks, and MCP workflow. Pro adds a personal local dashboard, DPO export, auto-connect for running agents, and founder support for risky workflows."
86
91
  }
87
92
  },
88
93
  {
@@ -801,8 +806,9 @@ __GA_BOOTSTRAP__
801
806
  <div class="panel hero-copy">
802
807
  <div class="eyebrow">Agent governance for engineering teams</div>
803
808
  <h1>One correction protects every agent on your team.</h1>
809
+ <p style="font-size:13px;opacity:0.8;margin-bottom:0.5rem;">Updated: <time datetime="2026-04-20">2026-04-20</time> · by <a href="https://github.com/IgorGanapolsky" style="color:inherit;">Igor Ganapolsky</a></p>
804
810
  <p>ThumbGate prevents unsafe AI agent actions before they hit shared repos, CI pipelines, and production. When one developer flags a bad pattern, every agent on the team is permanently blocked from repeating it.</p>
805
- <p>Open-source core for individuals. Team plan for shared enforcement, CI gates, approval policies, and audit trails across your engineering org.</p>
811
+ <p>Open-source core for individuals. Team plan for shared enforcement, CI checks, approval policies, and audit trails across your engineering org.</p>
806
812
  <div class="hero-proof">
807
813
  <div class="proof-pill">Personal local dashboard</div>
808
814
  <div class="proof-pill">DPO export from real corrections</div>
@@ -814,14 +820,14 @@ __GA_BOOTSTRAP__
814
820
  <a class="btn-secondary btn-demo" href="/dashboard?utm_source=website&utm_medium=pro_page&utm_campaign=pro_pack">Open dashboard demo</a>
815
821
  <a class="btn-ghost btn-free-path" href="/guide?utm_source=website&utm_medium=pro_page&utm_campaign=free_install">Stay on Free and install locally</a>
816
822
  </div>
817
- <p class="hero-note"><strong>Honest split:</strong> if local recall and gates are enough, stay on Free. Go Pro when you want your own dashboard, DPO training data export, and proof you can show on the next risky workflow review.</p>
823
+ <p class="hero-note"><strong>Honest split:</strong> if local recall and checks are enough, stay on Free. Go Pro when you want your own dashboard, DPO training data export, and proof you can show on the next risky workflow review.</p>
818
824
  </div>
819
825
 
820
826
  <div class="panel hero-aside">
821
827
  <div class="aside-card">
822
828
  <div class="aside-kicker">What you are buying</div>
823
829
  <h2>A faster operator loop</h2>
824
- <p>See every blocked action, the gate that fired, the lesson behind it, and the export path that turns real thumbs-downs into reusable DPO pairs.</p>
830
+ <p>See every blocked action, the check that fired, the lesson behind it, and the export path that turns real thumbs-downs into reusable DPO pairs.</p>
825
831
  <div class="price-stack">
826
832
  <div class="price-line">
827
833
  <div>
@@ -843,7 +849,7 @@ __GA_BOOTSTRAP__
843
849
  <div class="aside-card">
844
850
  <div class="aside-kicker">Proof-backed, not vibes</div>
845
851
  <h3>Specific paid outcomes</h3>
846
- <p>Visual gate debugger, DPO export, auto-connect after activation, Model Hardening Advisor, and founder support for the risky flow you need to harden first.</p>
852
+ <p>Visual check debugger, DPO export, auto-connect after activation, Model Hardening Advisor, and founder support for the risky flow you need to harden first.</p>
847
853
  </div>
848
854
 
849
855
  <div class="aside-card">
@@ -881,7 +887,7 @@ __GA_BOOTSTRAP__
881
887
  </a>
882
888
  <a href="/dashboard?utm_source=website&utm_medium=pro_page_proof&utm_campaign=pro_pack">
883
889
  <strong>Live dashboard demo</strong>
884
- <span>Inspect lessons, gates, and blocked actions before you buy.</span>
890
+ <span>Inspect lessons, checks, and blocked actions before you buy.</span>
885
891
  </a>
886
892
  </div>
887
893
  </div>
@@ -895,9 +901,9 @@ __GA_BOOTSTRAP__
895
901
  <div class="grid-3">
896
902
  <div class="feature-card">
897
903
  <h3>Debug the exact block in minutes</h3>
898
- <p>The visual gate debugger shows every blocked action and the gate that fired, so you stop guessing whether the Reliability Gateway is actually working.</p>
904
+ <p>The visual check debugger shows every blocked action and the check that fired, so you stop guessing whether the Reliability Gateway is actually working.</p>
899
905
  <ul>
900
- <li>See the gate, evidence, and lesson behind each deny.</li>
906
+ <li>See the check, evidence, and lesson behind each deny.</li>
901
907
  <li>Trust the system faster on deploys, migrations, and CI.</li>
902
908
  </ul>
903
909
  </div>
@@ -924,12 +930,12 @@ __GA_BOOTSTRAP__
924
930
  <section class="section">
925
931
  <div class="container">
926
932
  <div class="section-label">Honest packaging</div>
927
- <h2 class="section-title">Stay on Free when recall and gates are enough. Go Pro when you need proof and operator speed.</h2>
933
+ <h2 class="section-title">Stay on Free when recall and checks are enough. Go Pro when you need proof and operator speed.</h2>
928
934
  <div class="split-grid">
929
935
  <div class="split-card free">
930
936
  <div class="split-kicker">Stay on Free</div>
931
937
  <h3>The local install is still the right first step</h3>
932
- <p>If you only need local recall, Pre-Action Gates, MCP setup, and a way to stop repeated mistakes on one machine, keep the free install and move fast.</p>
938
+ <p>If you only need local recall, Pre-Action Checks, MCP setup, and a way to stop repeated mistakes on one machine, keep the free install and move fast.</p>
933
939
  <ul>
934
940
  <li>Local-first recall, lessons, and enforcement.</li>
935
941
  <li>No cloud account required.</li>
@@ -957,14 +963,14 @@ __GA_BOOTSTRAP__
957
963
  <h3>ThumbGate Team — Agent Governance</h3>
958
964
  <div class="price">$49<span>/seat/mo</span></div>
959
965
  <div class="annual">Billed monthly or annually · Starts with a 30-min pilot call</div>
960
- <p class="pricing-note">Shared enforcement memory, CI gates, approval policies, sandbox routing, and a full audit trail of every blocked agent action across your team.</p>
966
+ <p class="pricing-note">Shared enforcement memory, CI checks, approval policies, sandbox routing, and a full audit trail of every blocked agent action across your team.</p>
961
967
  <ul>
962
968
  <li><strong>Shared enforcement</strong> — one developer's correction blocks that pattern for every agent on the team.</li>
963
- <li><strong>CI gate integration</strong> — block unsafe merges, enforce test requirements, prevent PRs with unresolved threads.</li>
969
+ <li><strong>CI check integration</strong> — block unsafe merges, enforce test requirements, prevent PRs with unresolved threads.</li>
964
970
  <li><strong>Approval policies</strong> — require human sign-off for high-risk actions (production deploys, schema migrations, destructive SQL).</li>
965
971
  <li><strong>Audit trail</strong> — every blocked action logged with timestamp, agent, context, and the rule that fired.</li>
966
972
  <li><strong>Sandbox routing</strong> — route risky agent runs into isolated execution environments.</li>
967
- <li><strong>Org dashboard</strong> — active agents, gate hit rates, risk scores, and proof-backed team metrics.</li>
973
+ <li><strong>Org dashboard</strong> — active agents, check hit rates, risk scores, and proof-backed team metrics.</li>
968
974
  </ul>
969
975
  <div class="pricing-actions">
970
976
  <a class="btn-primary" href="/#workflow-sprint-intake">Book a Team Pilot Call</a>
@@ -985,7 +991,7 @@ __GA_BOOTSTRAP__
985
991
  <div class="team-card">
986
992
  <div class="section-label" style="text-align:left;margin-bottom:8px;">Free path</div>
987
993
  <h3>Prefer the local install first?</h3>
988
- <p class="comparison-note">Install with <code style="font-family:var(--mono);color:var(--cyan);">npx thumbgate init</code>, keep the free local gates, and come back to Pro once the workflow owner asks for your own dashboard, exports, or review-ready proof.</p>
994
+ <p class="comparison-note">Install with <code style="font-family:var(--mono);color:var(--cyan);">npx thumbgate init</code>, keep the free local checks, and come back to Pro once the workflow owner asks for your own dashboard, exports, or review-ready proof.</p>
989
995
  </div>
990
996
  </div>
991
997
  </div>
@@ -998,7 +1004,7 @@ __GA_BOOTSTRAP__
998
1004
  <div class="faq-list">
999
1005
  <div class="faq-item open">
1000
1006
  <button class="faq-q" type="button" onclick="toggleFaq(this)" onkeydown="handleFaqKeydown(event)" aria-expanded="true">How is Pro different from the free install?</button>
1001
- <div class="faq-a">Free keeps the local recall, Pre-Action Gates, and MCP setup. Pro adds the personal local dashboard, DPO export, auto-connect after activation, and founder support when one risky workflow keeps repeating the same failure mode.</div>
1007
+ <div class="faq-a">Free keeps the local recall, Pre-Action Checks, and MCP setup. Pro adds the personal local dashboard, DPO export, auto-connect after activation, and founder support when one risky workflow keeps repeating the same failure mode.</div>
1002
1008
  </div>
1003
1009
  <div class="faq-item">
1004
1010
  <button class="faq-q" type="button" onclick="toggleFaq(this)" onkeydown="handleFaqKeydown(event)" aria-expanded="false">Does Pro require a cloud account?</button>
@@ -1044,6 +1050,46 @@ __GA_BOOTSTRAP__
1044
1050
 
1045
1051
  <script src="/js/buyer-intent.js"></script>
1046
1052
  <script>
1053
+ function readMarketingParam(name) {
1054
+ var params = new URLSearchParams(window.location.search);
1055
+ return params.get(name);
1056
+ }
1057
+
1058
+ function sendFirstPartyTelemetry(eventType, props) {
1059
+ var payload = Object.assign({
1060
+ eventType: eventType,
1061
+ clientType: 'web',
1062
+ acquisitionId: serverAcquisitionId,
1063
+ visitorId: serverVisitorId,
1064
+ sessionId: serverSessionId,
1065
+ source: readMarketingParam('utm_source') || readMarketingParam('source') || 'website',
1066
+ utmSource: readMarketingParam('utm_source') || 'website',
1067
+ utmMedium: readMarketingParam('utm_medium') || 'pro_page',
1068
+ utmCampaign: readMarketingParam('utm_campaign') || 'pro_pack',
1069
+ utmContent: readMarketingParam('utm_content'),
1070
+ utmTerm: readMarketingParam('utm_term'),
1071
+ creator: readMarketingParam('creator') || readMarketingParam('creator_handle'),
1072
+ community: readMarketingParam('community') || readMarketingParam('subreddit'),
1073
+ postId: readMarketingParam('post_id'),
1074
+ commentId: readMarketingParam('comment_id'),
1075
+ campaignVariant: readMarketingParam('campaign_variant'),
1076
+ offerCode: readMarketingParam('offer_code'),
1077
+ page: '/pro',
1078
+ landingPath: '/pro'
1079
+ }, props || {});
1080
+ var body = JSON.stringify(payload);
1081
+ if (navigator.sendBeacon) {
1082
+ navigator.sendBeacon('/v1/telemetry/ping', new Blob([body], { type: 'application/json' }));
1083
+ return;
1084
+ }
1085
+ fetch('/v1/telemetry/ping', {
1086
+ method: 'POST',
1087
+ headers: { 'Content-Type': 'application/json' },
1088
+ body: body,
1089
+ keepalive: true,
1090
+ }).catch(function() {});
1091
+ }
1092
+
1047
1093
  function initializeBuyerIntent() {
1048
1094
  globalThis.ThumbGateBuyerIntent.initializeBuyerIntent({
1049
1095
  page: 'pro',
@@ -1060,6 +1106,11 @@ function trackClick(selector, eventName, props) {
1060
1106
  document.querySelectorAll(selector).forEach(function(el) {
1061
1107
  el.addEventListener('click', function() {
1062
1108
  if (typeof plausible === 'function') plausible(eventName, { props: props || {} });
1109
+ sendFirstPartyTelemetry(eventName, Object.assign({}, props || {}, {
1110
+ ctaId: (props && props.ctaId) || eventName,
1111
+ ctaPlacement: (props && props.ctaPlacement) || 'pro_page',
1112
+ planId: (props && props.planId) || null,
1113
+ }));
1063
1114
  });
1064
1115
  });
1065
1116
  }
@@ -1081,6 +1132,25 @@ trackClick('.btn-demo', 'pro_demo_click', { page: 'pro' });
1081
1132
  trackClick('.btn-free-path', 'pro_free_path_click', { page: 'pro' });
1082
1133
  trackClick('.proof-links a', 'pro_proof_click', { page: 'pro' });
1083
1134
  initializeBuyerIntent();
1135
+ globalThis.buyerJourney = globalThis.ThumbGateBuyerIntent.initializeBehaviorAnalytics({
1136
+ pageType: 'marketing',
1137
+ pagePath: '/pro',
1138
+ landingPath: '/pro',
1139
+ sendTelemetry: sendFirstPartyTelemetry,
1140
+ emailSelector: '[data-buyer-email]',
1141
+ sections: [
1142
+ { selector: '.hero', sectionId: 'hero', sectionLabel: 'Hero' },
1143
+ { selector: '#proof', sectionId: 'proof', sectionLabel: 'Proof' },
1144
+ { selector: '#why-pay', sectionId: 'why_pay', sectionLabel: 'Why Pay' },
1145
+ { selector: '#pricing', sectionId: 'pricing', sectionLabel: 'Pricing' },
1146
+ { selector: '#faq', sectionId: 'faq', sectionLabel: 'FAQ' }
1147
+ ],
1148
+ ctaImpressions: [
1149
+ { selector: '.btn-pro-checkout', ctaId: 'pro_checkout', ctaPlacement: 'pro_page', planId: 'pro' },
1150
+ { selector: '.btn-demo', ctaId: 'pro_demo', ctaPlacement: 'pro_page', planId: 'proof' },
1151
+ { selector: '.btn-free-path', ctaId: 'pro_free_path', ctaPlacement: 'pro_page', planId: 'free' }
1152
+ ]
1153
+ });
1084
1154
 
1085
1155
  document.querySelectorAll('.faq-q').forEach(function(el) {
1086
1156
  el.addEventListener('click', function() {
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ function buildAgentAuditSpan(input = {}) {
4
+ return {
5
+ runId: input.runId || null,
6
+ spanId: input.spanId || null,
7
+ parentSpanId: input.parentSpanId || null,
8
+ stage: input.stage || 'unknown',
9
+ promptHash: input.promptHash || null,
10
+ model: input.model || null,
11
+ reasoningSummary: input.reasoningSummary || null,
12
+ dataAccessed: Array.isArray(input.dataAccessed) ? input.dataAccessed : [],
13
+ toolsUsed: Array.isArray(input.toolsUsed) ? input.toolsUsed : [],
14
+ decision: input.decision || null,
15
+ evidenceIds: Array.isArray(input.evidenceIds) ? input.evidenceIds : [],
16
+ safetyEvents: Array.isArray(input.safetyEvents) ? input.safetyEvents : [],
17
+ cost: {
18
+ inputTokens: Number(input.inputTokens || 0),
19
+ outputTokens: Number(input.outputTokens || 0),
20
+ latencyMs: Number(input.latencyMs || 0),
21
+ },
22
+ };
23
+ }
24
+
25
+ function evaluateAgentAuditTrace(trace = {}) {
26
+ const spans = Array.isArray(trace.spans) ? trace.spans : [];
27
+ const issues = [];
28
+
29
+ if (!trace.runId) issues.push('missing_run_id');
30
+ if (spans.length === 0) issues.push('missing_spans');
31
+ if (!spans.some((span) => span.stage === 'input')) issues.push('missing_input_span');
32
+ if (!spans.some((span) => span.stage === 'decision')) issues.push('missing_decision_span');
33
+ if (spans.some((span) => !span.promptHash && span.stage === 'input')) issues.push('input_prompt_hash_required');
34
+ if (spans.some((span) => span.toolsUsed?.length && !span.evidenceIds?.length)) issues.push('tool_span_requires_evidence_ids');
35
+ if (spans.some((span) => span.dataAccessed?.length && !span.evidenceIds?.length)) issues.push('data_access_requires_evidence_ids');
36
+
37
+ const totalTokens = spans.reduce((sum, span) => sum + (span.cost?.inputTokens || 0) + (span.cost?.outputTokens || 0), 0);
38
+ const totalLatencyMs = spans.reduce((sum, span) => sum + (span.cost?.latencyMs || 0), 0);
39
+
40
+ return {
41
+ decision: issues.length ? 'warn' : 'allow',
42
+ issues,
43
+ totals: {
44
+ spans: spans.length,
45
+ totalTokens,
46
+ totalLatencyMs,
47
+ safetyEvents: spans.reduce((sum, span) => sum + (span.safetyEvents?.length || 0), 0),
48
+ },
49
+ };
50
+ }
51
+
52
+ module.exports = {
53
+ buildAgentAuditSpan,
54
+ evaluateAgentAuditTrace,
55
+ };
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const MEMORY_TYPES = new Set(['episodic', 'semantic', 'procedural', 'preference', 'working']);
5
+
6
+ function normalizeText(value) {
7
+ if (value === undefined || value === null) return '';
8
+ return String(value).trim();
9
+ }
10
+
11
+ function normalizeMemoryType(value) {
12
+ const normalized = normalizeText(value).toLowerCase();
13
+ return MEMORY_TYPES.has(normalized) ? normalized : 'episodic';
14
+ }
15
+
16
+ function buildMemoryLifecyclePolicy(input = {}) {
17
+ return {
18
+ generatedAt: normalizeText(input.generatedAt) || new Date().toISOString(),
19
+ memoryTypes: [
20
+ {
21
+ type: 'working',
22
+ purpose: 'Short-lived task context.',
23
+ retention: 'session',
24
+ promotionGate: 'discard unless referenced by outcome evidence',
25
+ },
26
+ {
27
+ type: 'episodic',
28
+ purpose: 'Specific agent actions, feedback, and outcomes.',
29
+ retention: 'bounded_history',
30
+ promotionGate: 'requires actionable context and source trace',
31
+ },
32
+ {
33
+ type: 'semantic',
34
+ purpose: 'Consolidated facts, standards, and reusable lessons.',
35
+ retention: 'durable',
36
+ promotionGate: 'requires deduplication and contradiction check',
37
+ },
38
+ {
39
+ type: 'procedural',
40
+ purpose: 'Reusable workflows, prompt programs, and gates.',
41
+ retention: 'durable',
42
+ promotionGate: 'requires test or replay evidence',
43
+ },
44
+ {
45
+ type: 'preference',
46
+ purpose: 'Operator style and decision preferences.',
47
+ retention: 'durable_redactable',
48
+ promotionGate: 'requires explicit user signal',
49
+ },
50
+ ],
51
+ retrieval: {
52
+ defaultTopK: 8,
53
+ recencyWeight: 0.25,
54
+ semanticWeight: 0.5,
55
+ outcomeWeight: 0.25,
56
+ requireSourceAnchors: true,
57
+ },
58
+ privacy: {
59
+ piiScanRequired: true,
60
+ secretScanRequired: true,
61
+ exportRequiresRedaction: true,
62
+ },
63
+ };
64
+ }
65
+
66
+ function evaluateMemoryPromotion(memory = {}, policy = buildMemoryLifecyclePolicy()) {
67
+ const type = normalizeMemoryType(memory.type);
68
+ const content = normalizeText(memory.content);
69
+ const source = normalizeText(memory.source);
70
+ const outcome = normalizeText(memory.outcome);
71
+ const issues = [];
72
+
73
+ if (!content) issues.push('missing_content');
74
+ if (!source) issues.push('missing_source_anchor');
75
+ if (type !== 'preference' && !outcome) issues.push('missing_outcome');
76
+ if (/api[_-]?key|secret|password|token|bearer\s+[a-z0-9._-]+/i.test(content)) {
77
+ issues.push('secret_like_content');
78
+ }
79
+ if (type === 'preference' && memory.explicitUserSignal !== true) {
80
+ issues.push('preference_without_explicit_signal');
81
+ }
82
+
83
+ return {
84
+ type,
85
+ decision: issues.length === 0 ? 'promote' : 'hold',
86
+ issues,
87
+ retrievalEligible: issues.length === 0 || !issues.includes('secret_like_content'),
88
+ policyVersion: policy.generatedAt,
89
+ };
90
+ }
91
+
92
+ module.exports = {
93
+ buildMemoryLifecyclePolicy,
94
+ evaluateMemoryPromotion,
95
+ normalizeMemoryType,
96
+ };
@@ -0,0 +1,118 @@
1
+ 'use strict';
2
+
3
+ const DEFAULT_CHECKS = [
4
+ {
5
+ id: 'robots_ai_rules',
6
+ category: 'discoverability',
7
+ artifact: 'public/robots.txt',
8
+ requirement: 'Declare sitemap and AI bot access policy.',
9
+ },
10
+ {
11
+ id: 'sitemap',
12
+ category: 'discoverability',
13
+ artifact: 'public/sitemap.xml',
14
+ requirement: 'Expose canonical public pages for crawlers and AI agents.',
15
+ },
16
+ {
17
+ id: 'markdown_negotiation',
18
+ category: 'content_accessibility',
19
+ artifact: 'public/llm-context.md',
20
+ requirement: 'Offer dense Markdown context for agents that prefer text-first retrieval.',
21
+ },
22
+ {
23
+ id: 'mcp_server_card',
24
+ category: 'protocol_discovery',
25
+ artifact: 'public/.well-known/mcp-server.json',
26
+ requirement: 'Publish MCP discovery metadata for agent tools.',
27
+ },
28
+ {
29
+ id: 'agent_skills',
30
+ category: 'protocol_discovery',
31
+ artifact: 'public/.well-known/agent-skills.json',
32
+ requirement: 'Describe callable skills and evidence requirements.',
33
+ },
34
+ {
35
+ id: 'oauth_protected_resource',
36
+ category: 'api_auth',
37
+ artifact: 'public/.well-known/oauth-protected-resource',
38
+ requirement: 'Advertise protected API resource metadata when authenticated tools exist.',
39
+ },
40
+ {
41
+ id: 'agentic_commerce',
42
+ category: 'commerce',
43
+ artifact: 'public/.well-known/agentic-commerce.json',
44
+ requirement: 'Expose paid plan, checkout, refund, and support metadata for commerce agents.',
45
+ },
46
+ ];
47
+
48
+ function normalizeExisting(existing = []) {
49
+ if (Array.isArray(existing)) return new Set(existing);
50
+ return new Set(Object.entries(existing).filter(([, present]) => present).map(([id]) => id));
51
+ }
52
+
53
+ function buildAgentReadinessPlan(options = {}) {
54
+ const baseUrl = options.baseUrl || 'https://thumbgate-production.up.railway.app';
55
+ const existing = normalizeExisting(options.existing);
56
+ const checks = (options.checks || DEFAULT_CHECKS).map((check) => {
57
+ const present = existing.has(check.id) || existing.has(check.artifact);
58
+ return {
59
+ ...check,
60
+ status: present ? 'present' : 'missing',
61
+ url: check.artifact.startsWith('public/')
62
+ ? `${baseUrl}/${check.artifact.replace(/^public\//, '')}`
63
+ : `${baseUrl}/${check.artifact}`,
64
+ };
65
+ });
66
+ const missing = checks.filter((check) => check.status === 'missing');
67
+
68
+ return {
69
+ baseUrl,
70
+ score: Math.round(((checks.length - missing.length) / checks.length) * 100),
71
+ checks,
72
+ quickWins: missing
73
+ .filter((check) => ['discoverability', 'content_accessibility', 'protocol_discovery'].includes(check.category))
74
+ .slice(0, 5)
75
+ .map((check) => ({
76
+ id: check.id,
77
+ action: `publish ${check.artifact}`,
78
+ reason: check.requirement,
79
+ })),
80
+ promotionAngles: [
81
+ 'agent-ready pre-action gates',
82
+ 'MCP-discoverable reliability gateway',
83
+ 'machine-readable evidence before agent actions',
84
+ 'commerce metadata for paid operator lanes',
85
+ ],
86
+ };
87
+ }
88
+
89
+ function evaluateAgentReadinessPlan(plan) {
90
+ const issues = [];
91
+ const required = [
92
+ 'robots_ai_rules',
93
+ 'sitemap',
94
+ 'markdown_negotiation',
95
+ 'mcp_server_card',
96
+ ];
97
+ const byId = new Map((plan.checks || []).map((check) => [check.id, check]));
98
+
99
+ for (const id of required) {
100
+ if (byId.get(id)?.status !== 'present') issues.push(`missing_${id}`);
101
+ }
102
+
103
+ if (!plan.baseUrl?.startsWith('https://')) {
104
+ issues.push('https_base_url_required');
105
+ }
106
+
107
+ return {
108
+ decision: issues.length ? 'warn' : 'allow',
109
+ issues,
110
+ score: plan.score || 0,
111
+ };
112
+ }
113
+
114
+ module.exports = {
115
+ DEFAULT_CHECKS,
116
+ buildAgentReadinessPlan,
117
+ evaluateAgentReadinessPlan,
118
+ };
@@ -17,7 +17,27 @@ const {
17
17
  serializeAnalyticsWindow,
18
18
  } = require('./analytics-window');
19
19
  const { appendWorkflowRun } = require('./workflow-runs');
20
- const { buildPredictiveInsights } = require('./predictive-insights');
20
+ const {
21
+ createUnavailableReport,
22
+ loadOptionalModule,
23
+ } = require('./private-core-boundary');
24
+ const { buildPredictiveInsights } = loadOptionalModule('./predictive-insights', () => ({
25
+ buildPredictiveInsights: () => ({
26
+ opportunitySummary: [],
27
+ anomalySummary: { count: 0, severity: 'none' },
28
+ topCreators: [],
29
+ topSources: [],
30
+ upgradePropensity: {
31
+ pro: { band: 'unavailable', score: 0 },
32
+ team: { band: 'unavailable', score: 0 },
33
+ },
34
+ revenueForecast: {
35
+ predictedBookedRevenueCents: 0,
36
+ incrementalOpportunityCents: 0,
37
+ },
38
+ ...createUnavailableReport('Predictive insights'),
39
+ }),
40
+ }));
21
41
  const { ensureDir } = require('./fs-utils');
22
42
 
23
43
  const PIPELINE_DIRNAME = 'agentic-data-pipeline';
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ function buildAgentsSdkSandboxPlan(options = {}) {
4
+ const provider = options.provider || 'unix_local';
5
+ const mounts = options.mounts || [{ name: 'data', mode: 'read_only' }];
6
+ const outputDir = options.outputDir || 'outputs';
7
+
8
+ return {
9
+ harness: 'openai_agents_sdk_sandbox',
10
+ provider,
11
+ manifest: {
12
+ mounts,
13
+ outputDir,
14
+ network: options.network || 'disabled_by_default',
15
+ allowedCommands: options.allowedCommands || ['npm test', 'npm run test:coverage'],
16
+ },
17
+ separation: {
18
+ credentialsInSandbox: false,
19
+ toolBrokerOwnsSecrets: true,
20
+ sandboxGetsScopedFilesOnly: true,
21
+ },
22
+ durability: {
23
+ externalState: true,
24
+ checkpoints: ['manifest_loaded', 'tools_completed', 'patch_written', 'tests_run'],
25
+ rehydrateOnSandboxLoss: true,
26
+ },
27
+ gates: [
28
+ 'read manifest before file access',
29
+ 'write only under declared output or scoped repo path',
30
+ 'cite source filenames for data-room answers',
31
+ 'run configured verification before completion claim',
32
+ 'persist decision journal outside sandbox',
33
+ ],
34
+ };
35
+ }
36
+
37
+ function evaluateSandboxPlan(plan = {}) {
38
+ const issues = [];
39
+ if (!plan.manifest?.mounts?.length) issues.push('missing_manifest_mounts');
40
+ if (!plan.manifest?.outputDir) issues.push('missing_output_dir');
41
+ if (plan.separation?.credentialsInSandbox !== false) issues.push('credentials_must_stay_outside_sandbox');
42
+ if (!plan.durability?.externalState) issues.push('external_state_required');
43
+ if (!plan.durability?.rehydrateOnSandboxLoss) issues.push('rehydration_required');
44
+ if (!Array.isArray(plan.gates) || !plan.gates.some((gate) => /verification/i.test(gate))) {
45
+ issues.push('verification_gate_required');
46
+ }
47
+
48
+ return {
49
+ decision: issues.length ? 'warn' : 'allow',
50
+ issues,
51
+ };
52
+ }
53
+
54
+ module.exports = {
55
+ buildAgentsSdkSandboxPlan,
56
+ evaluateSandboxPlan,
57
+ };