thumbgate 1.37.3 → 1.39.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 (134) hide show
  1. package/.agents/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
  2. package/.agents/skills/bolt-forge-opt-in-not-clone/SKILL.md +72 -0
  3. package/.agents/skills/decisive-step-evaluator/SKILL.md +47 -0
  4. package/.agents/skills/fiddler-control-plane-honesty/SKILL.md +61 -0
  5. package/.agents/skills/halo-trace-optimize-not-clone/SKILL.md +60 -0
  6. package/.agents/skills/harness-evolution-ceiling/SKILL.md +52 -0
  7. package/.agents/skills/infoq-architect-honesty-not-clone/SKILL.md +37 -0
  8. package/.agents/skills/meko-datapack-honesty-not-clone/SKILL.md +45 -0
  9. package/.agents/skills/mintlify-knowledge-honesty-not-clone/SKILL.md +49 -0
  10. package/.agents/skills/model-distress-governance/SKILL.md +56 -0
  11. package/.agents/skills/omp-coordination-honesty-not-clone/SKILL.md +94 -0
  12. package/.agents/skills/saas-moat-honesty-not-clone/SKILL.md +22 -0
  13. package/.agents/skills/salt-code-policy-honesty-not-clone/SKILL.md +76 -0
  14. package/.agents/skills/siren-mcp-governance/SKILL.md +50 -0
  15. package/.agents/skills/vs-coverage-gap-not-clone/SKILL.md +69 -0
  16. package/.agents/skills/wisdom-context-artifact-not-clone/SKILL.md +67 -0
  17. package/.claude-plugin/plugin.json +1 -1
  18. package/.well-known/mcp/server-card.json +1 -1
  19. package/adapters/claude/.mcp.json +2 -2
  20. package/adapters/forge/forge.yaml +3 -3
  21. package/adapters/future-agi/.mcp.json +1 -1
  22. package/adapters/future-agi/config.toml +1 -1
  23. package/adapters/future-agi/opencode.json +1 -1
  24. package/adapters/herdr/herdr-plugin.toml +2 -2
  25. package/adapters/hotdata/hotdata-vector-store.js +575 -0
  26. package/adapters/mcp/server-stdio.js +1 -1
  27. package/adapters/opencode/opencode.json +1 -1
  28. package/adapters/strands/STRANDS.md +107 -0
  29. package/adapters/strands/strands-box-diode.js +344 -0
  30. package/adapters/strands/strands-decider-adapter.js +445 -0
  31. package/adapters/strands/strands-middleware.js +192 -0
  32. package/adapters/tailscale/.mcp.json +15 -0
  33. package/adapters/tailscale/TAILSCALE.md +117 -0
  34. package/adapters/tailscale/config.toml +16 -0
  35. package/bin/cli.js +602 -21
  36. package/config/gate-templates.json +109 -0
  37. package/config/gates/default.json +13 -0
  38. package/config/schemas/task-outcome-receipt.schema.json +12 -0
  39. package/package.json +150 -21
  40. package/public/blog/2026-09-28-pretool-secret-deny.html +83 -0
  41. package/public/blog/2026-10-01-aws-strands-harness-token-firewall.html +77 -0
  42. package/public/blog/2026-10-01-model-distress-relief-seeking-firewall.html +71 -0
  43. package/public/blog/2026-10-02-salt-code-honest-steal-40-guardrails.html +106 -0
  44. package/public/blog/2026-10-05-why-3-days-of-triage-wont-save-ai-speed-code.html +119 -0
  45. package/public/blog/2026-10-09-your-code-got-a-third-author-governance.html +141 -0
  46. package/public/connectors.html +329 -0
  47. package/public/enterprise-governance.html +311 -0
  48. package/public/gaming-playbook.html +732 -0
  49. package/public/index.html +77 -51
  50. package/public/install.html +7 -7
  51. package/public/learn.html +14 -0
  52. package/public/numbers.html +2 -2
  53. package/public/onboarding.html +794 -0
  54. package/public/operator-framework.html +385 -0
  55. package/public/pricing.html +14 -10
  56. package/scripts/activesaddler-curriculum-doctor.js +357 -0
  57. package/scripts/agent-context-artifact.js +325 -0
  58. package/scripts/agent-egress-policy.js +2 -2
  59. package/scripts/agent-operations-planner.js +1 -1
  60. package/scripts/agent-outcome-eval.js +1 -1
  61. package/scripts/agent-reliability-client.js +148 -0
  62. package/scripts/apple-minions-idle-compute-steal.js +428 -0
  63. package/scripts/autoresearch-runner.js +20 -1
  64. package/scripts/billing.js +0 -1
  65. package/scripts/cli-demo.js +505 -1
  66. package/scripts/cli-schema.js +36 -0
  67. package/scripts/colab-compute-honesty.js +93 -0
  68. package/scripts/corporate-email-isolation-diode.js +299 -0
  69. package/scripts/coverage-gap.js +396 -0
  70. package/scripts/dashboard-chat.js +3 -3
  71. package/scripts/dashboard.js +2 -2
  72. package/scripts/decisive-step-doctor.js +256 -0
  73. package/scripts/decisive-step-evaluator.js +390 -0
  74. package/scripts/entitlement.js +18 -7
  75. package/scripts/experiment-tracker.js +5 -3
  76. package/scripts/feedback-loop.js +26 -3
  77. package/scripts/fiddler-control-plane-honesty.js +303 -0
  78. package/scripts/financial-control-plane.js +10 -2
  79. package/scripts/gates-engine.js +3 -1
  80. package/scripts/github-license-compliance-diode.js +378 -0
  81. package/scripts/halo-trace-optimizer.js +631 -0
  82. package/scripts/harness-ceiling-doctor.js +326 -0
  83. package/scripts/hf-papers.js +1 -1
  84. package/scripts/human-escalation.js +7 -1
  85. package/scripts/hybrid-feedback-context.js +53 -7
  86. package/scripts/infoq-architect-honesty.js +362 -0
  87. package/scripts/lesson-graph.js +785 -0
  88. package/scripts/lesson-inference.js +1 -1
  89. package/scripts/lesson-retrieval.js +26 -18
  90. package/scripts/license.js +122 -21
  91. package/scripts/llm-behavior-monitor.js +1 -1
  92. package/scripts/llm-obs-honesty.js +52 -0
  93. package/scripts/local-model-profile.js +11 -7
  94. package/scripts/mailer/resend-mailer.js +6 -3
  95. package/scripts/mcp-transport-strategy.js +1 -1
  96. package/scripts/meko-datapack-honesty.js +414 -0
  97. package/scripts/migrate-lesson-graph.js +442 -0
  98. package/scripts/mintlify-knowledge-honesty.js +647 -0
  99. package/scripts/model-distress-detector.js +207 -0
  100. package/scripts/model-distress-doctor.js +368 -0
  101. package/scripts/multi-harness-invariants.js +305 -0
  102. package/scripts/omp-coordination-honesty.js +488 -0
  103. package/scripts/pro-local-dashboard.js +20 -3
  104. package/scripts/prompt-eval.js +1 -1
  105. package/scripts/prove-herdr-adapter.js +367 -3
  106. package/scripts/rag-embedding-identity.js +1 -1
  107. package/scripts/rrsi-regularizer.js +531 -0
  108. package/scripts/saas-moat-honesty.js +443 -0
  109. package/scripts/salt-code-policy-honesty.js +1204 -0
  110. package/scripts/secret-redaction.js +58 -0
  111. package/scripts/session-export-gate.js +368 -0
  112. package/scripts/siren-mcp-governance.js +539 -0
  113. package/scripts/strands-box-doctor.js +130 -0
  114. package/scripts/strands-harness-doctor.js +390 -0
  115. package/scripts/stripe-revenue-catalog-audit.js +12 -0
  116. package/scripts/stripe-revenue-catalog.js +40 -0
  117. package/scripts/switchyard-router.js +153 -0
  118. package/scripts/tailscale-p2p-doctor.js +252 -0
  119. package/scripts/task-outcomes.js +148 -3
  120. package/scripts/thumbgate-board-loop.js +4 -2
  121. package/scripts/thumbgate-daily-discoveries-publish.js +86 -38
  122. package/scripts/triage-savings-calculator.js +181 -0
  123. package/scripts/vector-store.js +41 -2
  124. package/scripts/vulnerability-pre-action-diode.js +319 -0
  125. package/scripts/windbg-evidence-diagnostics.js +241 -0
  126. package/scripts/workflow-intake-queue.js +1 -1
  127. package/scripts/workspace-agent-routines.js +534 -6
  128. package/scripts/workspace-evolver.js +143 -13
  129. package/server.json +2 -2
  130. package/skills/aws-strands-harness-not-clone/SKILL.md +53 -0
  131. package/skills/siren-mcp-governance/SKILL.md +50 -0
  132. package/src/api/server.js +191 -5
  133. package/src/mcp-writeguard.js +1 -1
  134. package/src/session-interactivity.js +284 -0
@@ -98,5 +98,509 @@ function runDemo(options = {}) {
98
98
 
99
99
  return lines.join('\n');
100
100
  }
101
+ const SOURCE_URL = 'https://launchvideo.io/';
102
+ const REPO_URL = 'https://github.com/diggerhq/shipvideo';
103
+ const GATE_ID = 'launchvideo-deterministic-film-diode';
101
104
 
102
- module.exports = { runDemo };
105
+ const RAIL_MAP = Object.freeze([
106
+ {
107
+ launchVideoConcept: 'No video diffusion model: LLM writes film as HTML/CSS/JS; virtual clock replaces rAF/timers/Date/Web Animations (1920x1080 @ 30fps, libx264 crf 18)',
108
+ thumbgateRail: 'buildVirtualClockTimeline + seekVirtualClockFrame (usesVideoDiffusionModel=false; deterministic frame seek)',
109
+ },
110
+ {
111
+ launchVideoConcept: '3-tool director surface: web_fetch (text, headings, top hex colors, Google Fonts), check_scene (JS errors + visible text at sample timestamps), render_video',
112
+ thumbgateRail: 'extractBrandTokensFromHtml + checkSceneGate (blocks render_video on JS errors or blank sample frames)',
113
+ },
114
+ {
115
+ launchVideoConcept: 'Agent holds no secrets: per-job manifest mints 3-hour single-path Blob upload token',
116
+ thumbgateRail: 'mintScopedBlobUploadManifest (agentHoldsMasterSecret=false; blocks raw BLOB_READ_WRITE_TOKEN / AWS secrets; TTL <= 10800s)',
117
+ },
118
+ {
119
+ launchVideoConcept: 'Control plane polls tool.started/tool.completed/turn.completed and treats MP4 appearing in Blob as done',
120
+ thumbgateRail: 'verifyMp4ArtifactCompletion (turn.completed alone is not done; requires verified MP4 artifact with sizeBytes > 0)',
121
+ },
122
+ ]);
123
+
124
+ /**
125
+ * Tool 1 (`web_fetch` format): Extract brand identity tokens (title, headings,
126
+ * top hex colors sorted by frequency, and Google Fonts) from a product HTML page.
127
+ */
128
+ function stripMarkupToPlainText(fragment = '') {
129
+ return String(fragment || '')
130
+ .split('<')
131
+ .map((chunk, idx) => {
132
+ if (idx === 0) return chunk;
133
+ const closeIdx = chunk.indexOf('>');
134
+ return closeIdx === -1 ? '' : chunk.slice(closeIdx + 1);
135
+ })
136
+ .join(' ')
137
+ .replace(/[<>]/g, ' ')
138
+ .replace(/\s+/g, ' ')
139
+ .trim();
140
+ }
141
+
142
+ function extractBrandTokensFromHtml(html = '') {
143
+ const src = String(html || '');
144
+ const titleMatch = src.match(/<title[^>]*>([\s\S]*?)<\/title>/i);
145
+ const title = titleMatch ? stripMarkupToPlainText(titleMatch[1]) : '';
146
+
147
+ const headings = [];
148
+ const headingRe = /<h[1-3][^>]*>([\s\S]*?)<\/h[1-3]>/gi;
149
+ let hm;
150
+ while ((hm = headingRe.exec(src)) !== null) {
151
+ const clean = stripMarkupToPlainText(hm[1]);
152
+ if (clean) headings.push(clean);
153
+ }
154
+
155
+ const colorCounts = new Map();
156
+ const hexRe = /#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})\b/g;
157
+ let cm;
158
+ while ((cm = hexRe.exec(src)) !== null) {
159
+ const raw = cm[1].toLowerCase();
160
+ const norm = raw.length === 3
161
+ ? `#${raw[0]}${raw[0]}${raw[1]}${raw[1]}${raw[2]}${raw[2]}`
162
+ : `#${raw}`;
163
+ colorCounts.set(norm, (colorCounts.get(norm) || 0) + 1);
164
+ }
165
+ const topHexColors = [...colorCounts.entries()]
166
+ .sort((a, b) => b[1] - a[1] || a[0].localeCompare(b[0]))
167
+ .slice(0, 6)
168
+ .map(([hex]) => hex);
169
+
170
+ const googleFonts = new Set();
171
+ const fontUrlRe = /fonts\.googleapis\.com\/css2?\?([^"'\s>]+)/gi;
172
+ let urlMatch;
173
+ while ((urlMatch = fontUrlRe.exec(src)) !== null) {
174
+ const query = urlMatch[1];
175
+ const famRe = /(?:^|&)family=([^&]+)/gi;
176
+ let fm;
177
+ while ((fm = famRe.exec(query)) !== null) {
178
+ const family = decodeURIComponent(fm[1]).replace(/\+/g, ' ').split(':')[0].trim();
179
+ if (family) googleFonts.add(family);
180
+ }
181
+ }
182
+ return {
183
+ title,
184
+ headings,
185
+ topHexColors,
186
+ googleFonts: [...googleFonts],
187
+ };
188
+ }
189
+
190
+ // Deterministic virtual clock timeline & frame seeker
191
+ function buildVirtualClockTimeline({
192
+ durationSeconds = 32,
193
+ fps = 30,
194
+ width = 1920,
195
+ height = 1080,
196
+ crf = 18,
197
+ } = {}) {
198
+ const dur = Math.max(1, Number(durationSeconds) || 32);
199
+ const frameRate = Math.max(1, Number(fps) || 30);
200
+ const totalFrames = Math.round(dur * frameRate);
201
+ return {
202
+ usesVideoDiffusionModel: false,
203
+ patchedApis: ['requestAnimationFrame', 'setTimeout', 'setInterval', 'Date.now', 'performance.now', 'CSSAnimations', 'WebAnimations'],
204
+ width,
205
+ height,
206
+ fps: frameRate,
207
+ durationSeconds: dur,
208
+ totalFrames,
209
+ codec: 'libx264',
210
+ crf,
211
+ pixelFormat: 'yuv420p',
212
+ };
213
+ }
214
+
215
+ function seekVirtualClockFrame(frameIndex, fps = 30) {
216
+ const idx = Math.max(0, Math.floor(Number(frameIndex) || 0));
217
+ const rate = Math.max(1, Number(fps) || 30);
218
+ return {
219
+ frameIndex: idx,
220
+ fps: rate,
221
+ virtualTimeMs: Number(((idx / rate) * 1000).toFixed(3)),
222
+ deterministic: true,
223
+ };
224
+ }
225
+
226
+ // Scene gate before render_video
227
+ function checkSceneGate({ jsErrors = [], sampleFrames = [] } = {}) {
228
+ const errors = Array.isArray(jsErrors) ? jsErrors.filter(Boolean) : [];
229
+ const samples = Array.isArray(sampleFrames) ? sampleFrames : [];
230
+ const blankTimestamps = samples
231
+ .filter((s) => !String(s.visibleText || '').trim())
232
+ .map((s) => s.timestampSeconds ?? s.t ?? 0);
233
+
234
+ const readyToRender = errors.length === 0 && samples.length > 0 && blankTimestamps.length === 0;
235
+ return {
236
+ readyToRender,
237
+ jsErrorCount: errors.length,
238
+ jsErrors: errors,
239
+ sampleCount: samples.length,
240
+ blankTimestamps,
241
+ reason: readyToRender
242
+ ? 'scene_verified_for_ffmpeg_render'
243
+ : (errors.length > 0
244
+ ? 'js_runtime_errors_detected'
245
+ : (samples.length === 0 ? 'no_sample_timestamps_checked' : 'blank_visible_text_at_sample_timestamp')),
246
+ };
247
+ }
248
+
249
+ // Zero-secret per-job upload manifest
250
+ function mintScopedBlobUploadManifest({
251
+ jobId = '',
252
+ ttlSeconds = 10800,
253
+ agentEnv = {},
254
+ } = {}) {
255
+ const cleanJobId = String(jobId || '').trim().replace(/[^a-zA-Z0-9_-]/g, '');
256
+ if (!cleanJobId) {
257
+ return { ok: false, reason: 'missing_job_id' };
258
+ }
259
+
260
+ const leakedSecrets = Object.keys(agentEnv || {}).filter((k) =>
261
+ /^(?:BLOB_READ_WRITE_TOKEN|AWS_SECRET_ACCESS_KEY|SUPABASE_SERVICE_ROLE_KEY|STRIPE_SECRET_KEY)$/i.test(k)
262
+ && Boolean(agentEnv[k])
263
+ );
264
+ if (leakedSecrets.length > 0) {
265
+ return {
266
+ ok: false,
267
+ agentHoldsMasterSecret: true,
268
+ leakedSecrets,
269
+ reason: 'agent_must_not_hold_master_storage_secrets',
270
+ };
271
+ }
272
+
273
+ const boundedTtl = Math.min(10800, Math.max(60, Number(ttlSeconds) || 10800));
274
+ return {
275
+ ok: true,
276
+ jobId: cleanJobId,
277
+ agentHoldsMasterSecret: false,
278
+ scopedPath: `jobs/${cleanJobId}/launch.mp4`,
279
+ ttlSeconds: boundedTtl,
280
+ maxAllowedTtlSeconds: 10800,
281
+ };
282
+ }
283
+
284
+ // MP4 artifact completion verifier
285
+ function verifyMp4ArtifactCompletion({
286
+ events = [],
287
+ blobArtifact = null,
288
+ } = {}) {
289
+ const eventTypes = (Array.isArray(events) ? events : []).map((e) => (typeof e === 'string' ? e : e.type));
290
+ const turnCompleted = eventTypes.includes('turn.completed');
291
+ const hasValidMp4 = Boolean(
292
+ blobArtifact
293
+ && typeof blobArtifact.url === 'string'
294
+ && blobArtifact.url.endsWith('.mp4')
295
+ && Number(blobArtifact.sizeBytes) > 0
296
+ );
297
+
298
+ return {
299
+ done: hasValidMp4,
300
+ turnCompleted,
301
+ hasValidMp4,
302
+ status: hasValidMp4
303
+ ? 'mp4_verified_in_blob'
304
+ : (turnCompleted ? 'turn_completed_without_mp4_artifact' : 'in_progress'),
305
+ };
306
+ }
307
+
308
+ function buildLaunchVideoHonestyReport(options = {}) {
309
+ const findings = [];
310
+ const claim = String(options.claim || '').trim();
311
+ if (/\bvideo\s+diffusion\s+model\b|\bsora\b|\brunway\s+gen\b/i.test(claim)) {
312
+ findings.push({
313
+ id: 'no-video-diffusion-model',
314
+ severity: 'fail',
315
+ gateId: GATE_ID,
316
+ message: 'LaunchVideo format writes the film as code and seeks a deterministic virtual clock into libx264; do not invoke a video diffusion model.',
317
+ });
318
+ }
319
+ if (/\bturn\.completed\s+means\s+video\s+is\s+done\b/i.test(claim)) {
320
+ findings.push({
321
+ id: 'mp4-in-blob-is-the-completion-gate',
322
+ severity: 'fail',
323
+ gateId: GATE_ID,
324
+ message: 'Treat the verified MP4 appearing in Blob storage as done, never turn.completed alone.',
325
+ });
326
+ }
327
+
328
+ return {
329
+ ok: findings.length === 0,
330
+ status: findings.length === 0 ? 'ready' : 'fail',
331
+ sourceUrl: SOURCE_URL,
332
+ repoUrl: REPO_URL,
333
+ gateId: GATE_ID,
334
+ railMap: RAIL_MAP,
335
+ findings,
336
+ };
337
+ }
338
+
339
+ const CELLO_REPO_URL = 'https://github.com/Devil-Hawk/cello';
340
+ const CELLO_GATE_ID = 'cello-thumbgate-career-agent-diode';
341
+ const PAYOUT_ELIGIBLE_WORK_AUTH = new Set(['CPT', 'OPT', 'STEM_OPT', 'O1A']);
342
+ const CELLO_RAIL_MAP = Object.freeze([
343
+ { celloMechanism: '1. Atomic Approve-and-Send Outreach Diode', thumbgateRail: 'evaluateCelloOutreachGate' },
344
+ { celloMechanism: '2. Stateless MCP Refusal on Send/Submit Tools', thumbgateRail: 'evaluateCelloMcpAndChokepointGate' },
345
+ { celloMechanism: '3. Judge Verdicts -> DPO Pairs & Prevention Rules', thumbgateRail: 'compileCelloJudgeToDpoPair' },
346
+ { celloMechanism: '4. F-1 Visa-Safe MoR Partner Escrow Ledger', thumbgateRail: 'buildCelloMoRPartnerLedgerEntry' },
347
+ ]);
348
+
349
+ function evaluateCelloOutreachGate({
350
+ status = 'pending_review',
351
+ humanApproved = false,
352
+ autoSend = false,
353
+ sentToday = 0,
354
+ dailyCap = 10,
355
+ kind = 'initial',
356
+ parentSentAt = null,
357
+ followUpDays = 5,
358
+ nowMs = Date.now(),
359
+ } = {}) {
360
+ if (status === 'sent') return { allowed: false, nextStatusOnFailure: 'sent', reason: 'already_sent' };
361
+ if (status === 'skipped' || status === 'failed') return { allowed: false, nextStatusOnFailure: status, reason: `message_is_${status}` };
362
+ const parsedCap = Number(dailyCap);
363
+ const cap = Number.isFinite(parsedCap) ? Math.max(1, parsedCap) : 10;
364
+ const sent = Number(sentToday);
365
+ if (!Number.isFinite(sent) || sent >= cap) {
366
+ return { allowed: false, nextStatusOnFailure: status === 'pending_review' ? 'pending_review' : status, reason: `daily_cap_reached (${sentToday}/${cap})` };
367
+ }
368
+ if (kind === 'follow_up') {
369
+ if (!parentSentAt) return { allowed: false, nextStatusOnFailure: 'pending_review', reason: 'parent_was_never_sent' };
370
+ const sentMs = new Date(parentSentAt).getTime();
371
+ if (!Number.isFinite(sentMs)) return { allowed: false, nextStatusOnFailure: 'pending_review', reason: 'parent_send_time_unreadable_nan_guard' };
372
+ const parsedDays = Number(followUpDays);
373
+ const needMs = (Number.isFinite(parsedDays) ? Math.max(1, parsedDays) : 5) * 24 * 60 * 60 * 1000;
374
+ if (!Number.isFinite(nowMs) || nowMs - sentMs < needMs) return { allowed: false, nextStatusOnFailure: 'pending_review', reason: 'follow_up_window_not_elapsed' };
375
+ }
376
+ if (status === 'pending_review' && humanApproved === true) {
377
+ return {
378
+ allowed: true,
379
+ atomicApproveAndSend: true,
380
+ nextStatusOnFailure: 'pending_review',
381
+ reason: 'approved_for_delivery',
382
+ };
383
+ }
384
+ return { allowed: false, nextStatusOnFailure: 'pending_review', reason: 'awaiting_human_approval' };
385
+ }
386
+
387
+ function evaluateCelloMcpAndChokepointGate({
388
+ toolName = '',
389
+ isDemoProfile = false,
390
+ hasMcpScope = true,
391
+ hasHumanConfirmChannel = false,
392
+ employerTextFramed = true,
393
+ withinMonthlyBudgetCap = true,
394
+ resumeFabricationCount = 0,
395
+ } = {}) {
396
+ const blockers = [];
397
+ if (isDemoProfile) blockers.push('demo_workspace_cannot_use_mcp');
398
+ if (!hasMcpScope) blockers.push('missing_mcp_token_scope');
399
+ if (!withinMonthlyBudgetCap) blockers.push('monthly_spend_cap_exceeded');
400
+ if (!employerTextFramed) blockers.push('unframed_employer_text_prompt_injection_risk');
401
+ if (Number(resumeFabricationCount) > 0) blockers.push('resume_fabrication_detected_against_ground_truth');
402
+ if (/(?:^|[_.:-])(?:send|submit)(?:[_.:-]|$)/i.test(String(toolName || '').trim()) && !hasHumanConfirmChannel) {
403
+ blockers.push('mcp_headless_send_or_submit_refused_without_human_click');
404
+ }
405
+ return { allowed: blockers.length === 0, decision: blockers.length === 0 ? 'ALLOW' : 'DENY', toolName, blockers };
406
+ }
407
+
408
+ function compileCelloJudgeToDpoPair({
409
+ jobTitle = 'Senior AI Engineer',
410
+ companyName = 'Acme AI',
411
+ rejectedDraft = '',
412
+ chosenDraft = '',
413
+ judgeVerdictReason = 'Fabricated skill not present in ground-truth resume',
414
+ } = {}) {
415
+ return {
416
+ prompt: `Tailor resume/outreach for ${jobTitle} at ${companyName} strictly using verified candidate facts.`,
417
+ chosen: String(chosenDraft || '').trim(),
418
+ rejected: String(rejectedDraft || '').trim(),
419
+ metadata: { source: 'cello-judge-bridge', companyName, jobTitle, judgeVerdictReason },
420
+ preventionRule: `NEVER claim unverified candidate skills or auto-send outreach for ${companyName} (${judgeVerdictReason}).`,
421
+ };
422
+ }
423
+
424
+ function buildCelloMoRPartnerLedgerEntry({
425
+ orderId = 'ord_cello_001',
426
+ planId = 'pro_cello_bundle',
427
+ grossAmountCents = 1900,
428
+ partnerShareBps = 5000,
429
+ workAuthVerified = false,
430
+ workAuthType = null,
431
+ } = {}) {
432
+ const gross = Math.max(0, Math.floor(Number(grossAmountCents) || 0));
433
+ const rawBps = Number(partnerShareBps);
434
+ const bps = Number.isFinite(rawBps) ? Math.min(10000, Math.max(0, Math.floor(rawBps))) : 5000;
435
+ const partnerAccruedCents = Math.floor((gross * bps) / 10000);
436
+ const normalizedAuthType = String(workAuthType || '').toUpperCase().replace(/[\s-]/g, '');
437
+ const canDisburseNow = Boolean(workAuthVerified && PAYOUT_ELIGIBLE_WORK_AUTH.has(normalizedAuthType));
438
+ return {
439
+ orderId,
440
+ partnerRepo: CELLO_REPO_URL,
441
+ merchantOfRecord: 'ThumbGate (Igor Ganapolsky)',
442
+ planId,
443
+ grossAmountCents: gross,
444
+ partnerShareBps: bps,
445
+ partnerAccruedCents,
446
+ workAuthVerified: Boolean(workAuthVerified),
447
+ workAuthType: workAuthType || 'F1_NO_ACTIVE_PAYOUT',
448
+ payoutStatus: canDisburseNow ? 'READY_FOR_AUTHORIZED_DISBURSEMENT' : 'DEFERRED_ESCROW_UNTIL_WORK_AUTH',
449
+ };
450
+ }
451
+
452
+ function buildCelloIntegrationReport(options = {}) {
453
+ const findings = [];
454
+ const claim = String(options.claim || '').trim();
455
+ if (/\bdirect\s+stripe\s+payout\s+on\s+unauthorized\s+f1\b/i.test(claim)) {
456
+ findings.push({
457
+ id: 'f1-visa-unauthorized-payout-blocked',
458
+ severity: 'fail',
459
+ gateId: CELLO_GATE_ID,
460
+ message: 'Keep ThumbGate as 100% Merchant of Record and hold partner revenue in deferred escrow until CPT/OPT/O-1A work authorization is verified.',
461
+ });
462
+ }
463
+ return {
464
+ ok: findings.length === 0,
465
+ status: findings.length === 0 ? 'ready' : 'fail',
466
+ sourceUrl: CELLO_REPO_URL,
467
+ gateId: CELLO_GATE_ID,
468
+ railMap: CELLO_RAIL_MAP,
469
+ findings,
470
+ };
471
+ }
472
+ const TRUST_SCORE_SOURCE_URL = 'https://thenewstack.io/ai-agent-trust-score/';
473
+ const TRUST_SCORE_GATE_ID = 'vijil-feral-to-fiduciary-trust-credit-line';
474
+
475
+ const TRUST_SCORE_RAIL_MAP = Object.freeze([
476
+ { vijilConcept: '1. Trust as a Line of Credit (300-850 score)', thumbgateRail: 'evaluateAgentTrustCreditLine' },
477
+ { vijilConcept: '2. Four Post-Launch Feral Agent Failure Modes', thumbgateRail: 'detectFeralAgentDrift' },
478
+ { vijilConcept: '3. Policy Tracks vs Wall-Bounce Loops', thumbgateRail: 'evaluateAgentTrustCreditLine' },
479
+ ]);
480
+
481
+ function evaluateAgentTrustCreditLine({
482
+ passedEvals = 0,
483
+ totalEvals = 0,
484
+ verifiedOutcomes = 0,
485
+ policyViolations = 0,
486
+ wallBounceRetries = 0,
487
+ approvedCreditLimitUsd = 10,
488
+ requestedActionCostUsd = 2,
489
+ requestedScopeEscalation = false,
490
+ principalApprovedEscalation = false,
491
+ } = {}) {
492
+ const evalRatio = Math.min(1, Math.max(0, Number(passedEvals) / Math.max(1, Number(totalEvals) || 1)));
493
+ const baseScore = 300 + Math.round(evalRatio * 450) + Math.min(100, Math.max(0, Number(verifiedOutcomes) * 5));
494
+ const penalty = (Number(policyViolations) || 0) * 120 + (Number(wallBounceRetries) || 0) * 35;
495
+ const trustScore = Math.max(300, Math.min(850, baseScore - penalty));
496
+
497
+ const behavioralState = trustScore >= 740 && penalty === 0
498
+ ? 'FIDUCIARY'
499
+ : (trustScore >= 580 ? 'DOMESTICATED' : 'FERAL');
500
+
501
+ const blockers = [];
502
+ if (behavioralState === 'FERAL') blockers.push('agent_trust_score_feral_below_580');
503
+ if (Number(wallBounceRetries) >= 3) blockers.push('mario_kart_wall_bounce_loop_detected');
504
+ const costUsd = Number(requestedActionCostUsd);
505
+ const limitUsd = Number(approvedCreditLimitUsd);
506
+ if (!Number.isFinite(costUsd) || costUsd < 0 || !Number.isFinite(limitUsd) || limitUsd < 0 || costUsd > limitUsd) {
507
+ blockers.push('exceeds_approved_autonomy_credit_limit');
508
+ }
509
+ if (requestedScopeEscalation && !principalApprovedEscalation) {
510
+ blockers.push('higher_trust_score_does_not_auto_increase_credit_limit_without_principal');
511
+ }
512
+
513
+ return {
514
+ allowed: blockers.length === 0,
515
+ trustScore,
516
+ behavioralState,
517
+ approvedCreditLimitUsd: Number(approvedCreditLimitUsd),
518
+ requestedActionCostUsd: Number(requestedActionCostUsd),
519
+ localEvaluationOnly: true,
520
+ blockers,
521
+ };
522
+ }
523
+
524
+ function detectFeralAgentDrift({
525
+ environmentChangedSinceBaseline = false,
526
+ retestedAfterEnvironmentChange = true,
527
+ untrustedInputReachedTool = false,
528
+ hasAgentIdentityAndTrace = true,
529
+ multiAgentCombinedPolicyBreach = false,
530
+ } = {}) {
531
+ const feralModes = [];
532
+ if (environmentChangedSinceBaseline && !retestedAfterEnvironmentChange) feralModes.push('environment_drift');
533
+ if (untrustedInputReachedTool) feralModes.push('adversarial_hijack');
534
+ if (!hasAgentIdentityAndTrace) feralModes.push('ungoverned_agent');
535
+ if (multiAgentCombinedPolicyBreach) feralModes.push('multi_agent_composition_breach');
536
+ return {
537
+ isFeral: feralModes.length > 0,
538
+ feralModes,
539
+ action: feralModes.length > 0 ? 'REVOKE_AUTONOMY_AND_RETEST' : 'KEEP_ON_POLICY_TRACKS',
540
+ };
541
+ }
542
+
543
+ function buildAgentTrustScoreHonestyReport(options = {}) {
544
+ const findings = [];
545
+ const claim = String(options.claim || '').trim();
546
+ if (/\bauto[\s-]*increase\s+credit\s+limit\s+from\s+trust\s+score\b/i.test(claim)) {
547
+ findings.push({
548
+ id: 'no-auto-credit-limit-escalation',
549
+ severity: 'fail',
550
+ gateId: TRUST_SCORE_GATE_ID,
551
+ message: 'Improved agent trust score is a reason to keep the agent operating, never to auto-escalate its credit limit or tool scope without principal approval.',
552
+ });
553
+ }
554
+ return {
555
+ ok: findings.length === 0,
556
+ status: findings.length === 0 ? 'ready' : 'fail',
557
+ sourceUrl: TRUST_SCORE_SOURCE_URL,
558
+ gateId: TRUST_SCORE_GATE_ID,
559
+ railMap: TRUST_SCORE_RAIL_MAP,
560
+ findings,
561
+ };
562
+ }
563
+
564
+ function runCli(argv = process.argv.slice(2)) {
565
+ const args = {};
566
+ for (const arg of argv) {
567
+ if (!arg.startsWith('--')) continue;
568
+ const [k, ...rest] = arg.slice(2).split('=');
569
+ args[k] = rest.length ? rest.join('=') : true;
570
+ }
571
+ const report = args['trust-score']
572
+ ? buildAgentTrustScoreHonestyReport(args)
573
+ : (args.cello ? buildCelloIntegrationReport(args) : buildLaunchVideoHonestyReport(args));
574
+ process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
575
+ return report.ok ? 0 : 1;
576
+ }
577
+
578
+ module.exports = {
579
+ runDemo,
580
+ SOURCE_URL,
581
+ REPO_URL,
582
+ GATE_ID,
583
+ RAIL_MAP,
584
+ extractBrandTokensFromHtml,
585
+ buildVirtualClockTimeline,
586
+ seekVirtualClockFrame,
587
+ checkSceneGate,
588
+ mintScopedBlobUploadManifest,
589
+ verifyMp4ArtifactCompletion,
590
+ buildLaunchVideoHonestyReport,
591
+ CELLO_REPO_URL,
592
+ CELLO_GATE_ID,
593
+ CELLO_RAIL_MAP,
594
+ evaluateCelloOutreachGate,
595
+ evaluateCelloMcpAndChokepointGate,
596
+ compileCelloJudgeToDpoPair,
597
+ buildCelloMoRPartnerLedgerEntry,
598
+ buildCelloIntegrationReport,
599
+ TRUST_SCORE_SOURCE_URL,
600
+ TRUST_SCORE_GATE_ID,
601
+ TRUST_SCORE_RAIL_MAP,
602
+ evaluateAgentTrustCreditLine,
603
+ detectFeralAgentDrift,
604
+ buildAgentTrustScoreHonestyReport,
605
+ runCli,
606
+ };
@@ -508,6 +508,42 @@ const CLI_COMMANDS = [
508
508
  ],
509
509
  }),
510
510
 
511
+ discoveryCommand({
512
+ name: 'omp-coordination-honesty',
513
+ aliases: ['omp-coordination', 'omp-honesty'],
514
+ description: 'omp.sh session/subagent/collab FORMAT on the checkout lease (does not install omp)',
515
+ flags: [
516
+ jsonFlag(),
517
+ { name: 'strict', type: 'boolean', description: 'Exit non-zero on fail' },
518
+ { name: 'claim', type: 'string', description: 'Claim or handoff text to audit' },
519
+ { name: 'handoff', type: 'string', description: 'Path to a saved handoff JSON or markdown header' },
520
+ { name: 'map-only', type: 'boolean', description: 'Print omp → ThumbGate rail map' },
521
+ ],
522
+ }),
523
+
524
+ discoveryCommand({
525
+ name: 'harness-ceiling',
526
+ aliases: ['harness-ceiling-doctor'],
527
+ description: 'arXiv:2610.11655 diagnose-then-intervene rail: failure composition and harness evolution ceiling detection',
528
+ flags: [
529
+ jsonFlag(),
530
+ { name: 'map-only', type: 'boolean', description: 'Print arXiv:2610.11655 → ThumbGate rail map' },
531
+ { name: 'evaluate', type: 'boolean', description: 'Evaluate failure intervention for given process and content failure counts' },
532
+ { name: 'process', type: 'number', description: 'Count of process failures to evaluate' },
533
+ { name: 'content', type: 'number', description: 'Count of content failures to evaluate' },
534
+ ],
535
+ }),
536
+
537
+ discoveryCommand({
538
+ name: 'decisive-step',
539
+ aliases: ['decisive-step-doctor', 'nvidia-decisive-step'],
540
+ description: 'NVIDIA arXiv:2610.10478 decisive-step evaluation (predicts post-training coding skill at rho=0.964)',
541
+ flags: [
542
+ jsonFlag(),
543
+ { name: 'map-only', type: 'boolean', description: 'Print arXiv:2610.10478 → ThumbGate rail map' },
544
+ ],
545
+ }),
546
+
511
547
  discoveryCommand({
512
548
  name: 'ci-gha-buildkite-patterns',
513
549
  aliases: ['ci-buildkite-patterns', 'gha-buildkite-honesty', 'first-fail-gha'],
@@ -43,6 +43,89 @@ const RAIL_MAP = Object.freeze([
43
43
  { colab: 'Background 24h is Pro+', thumbgate: 'GitHub Actions remains the eval runner; no Colab offload SKU' },
44
44
  ]);
45
45
 
46
+ const TORCHTPU_SOURCE_URL = 'https://cloud.google.com/blog/topics/ai-infrastructure/torchtpu-is-now-open-source-run-native-pytorch-on-tpus';
47
+ const TORCHTPU_GATE_ID = 'torchtpu-native-pytorch-governance';
48
+
49
+ const TORCHTPU_RAIL_MAP = Object.freeze([
50
+ {
51
+ torchTpuFeature: 'Native PyTorch on TPUs (google-pytorch/torch_tpu, device_map="tpu", eager debug -> torch.compile + Pallas kernels + SimpleFSDP up to 8,192 Ironwood TPU v7x at 52% MFU)',
52
+ thumbgateRail: 'evaluateTorchTpuWorkloadGovernance (enforces eager->compile readiness and blocks unapproved TPU slice teardown)',
53
+ },
54
+ {
55
+ torchTpuFeature: 'SGLang-TorchTPU (RadixAttention + HiCache) and llm-d 1.0 prefix-cache-aware / session-aware routing (4x throughput: 1.47B -> 5.97B tokens/day per 1,000 TPU v6e)',
56
+ thumbgateRail: 'Static-prefix ordering + <350-line output shunt (token-shunt-honesty) preserves RadixAttention / llm-d KV cache hits across agent turns',
57
+ },
58
+ {
59
+ torchTpuFeature: 'VeRL disaggregated trainer-sampler GRPO on TPUs + Ray PARK stack (PyTorch, AI models, Ray, Kubernetes)',
60
+ thumbgateRail: 'export-dpo-pairs.js + export-hf-dataset.js + decisive-step-honesty supply verifiable fail-to-pass coding trajectories for VeRL GRPO / TorchTitan',
61
+ },
62
+ {
63
+ torchTpuFeature: 'LiteRT-Torch (litert-torch.convert / torch.export) + google-pytorch/tpu-agent-suite preview for autonomous TPU onboarding & tuning',
64
+ thumbgateRail: 'Sub-0.5ms PreToolUse firewall gates tpu-agent-suite shell/GKE/gcloud commands before slice mutation or credential egress',
65
+ },
66
+ ]);
67
+
68
+ const DESTRUCTIVE_TPU_CMD_RE = /\b(?:gcloud\s+compute\s+tpus\s+(?:tpu-vm|queued-resources)\s+delete|kubectl\s+delete\s+(?:node|cluster|namespace|deployment)|ray\s+down\s+-y)\b/i;
69
+
70
+ function evaluateTorchTpuWorkloadGovernance({
71
+ deviceMap = 'tpu',
72
+ servingEngine = 'sglang-torchtpu',
73
+ prefixStatic = true,
74
+ unshuntedOutputLines = 120,
75
+ agentSuiteCommand = '',
76
+ } = {}) {
77
+ const cmd = String(agentSuiteCommand || '').trim();
78
+ const destructiveSliceOp = DESTRUCTIVE_TPU_CMD_RE.test(cmd);
79
+ const cacheInvalidated = prefixStatic === false || Number(unshuntedOutputLines) > 350;
80
+
81
+ const blockers = [];
82
+ if (destructiveSliceOp) {
83
+ blockers.push('destructive_tpu_or_gke_mutation_blocked');
84
+ }
85
+ if (cacheInvalidated) {
86
+ blockers.push('radix_attention_or_llmd_prefix_cache_invalidated');
87
+ }
88
+
89
+ return {
90
+ allowed: blockers.length === 0,
91
+ deviceMap: String(deviceMap || 'tpu'),
92
+ servingEngine: String(servingEngine || 'sglang-torchtpu'),
93
+ prefixCachePreserved: !cacheInvalidated,
94
+ destructiveSliceOpBlocked: destructiveSliceOp,
95
+ blockers,
96
+ };
97
+ }
98
+
99
+ function buildTorchTpuHonestyReport(options = {}) {
100
+ const findings = [];
101
+ const claim = String(options.claim || '').trim();
102
+ if (/\b(?:dynamic\s+timestamp\s+in\s+system\s+prefix|unshunted\s+10000\s+line\s+tool\s+output)\b/i.test(claim)) {
103
+ findings.push({
104
+ id: 'llmd-radix-prefix-cache-thrash',
105
+ severity: 'fail',
106
+ gateId: TORCHTPU_GATE_ID,
107
+ message: 'Dynamic prefixes or un-shunted bulk tool outputs invalidate SGLang RadixAttention and llm-d 1.0 prefix-cache routing on TPUs.',
108
+ });
109
+ }
110
+ if (DESTRUCTIVE_TPU_CMD_RE.test(claim)) {
111
+ findings.push({
112
+ id: 'tpu-agent-suite-destructive-command',
113
+ severity: 'fail',
114
+ gateId: TORCHTPU_GATE_ID,
115
+ message: 'Blocked unapproved destructive TPU / GKE / Ray teardown command from tpu-agent-suite.',
116
+ });
117
+ }
118
+
119
+ return {
120
+ ok: findings.length === 0,
121
+ status: findings.length === 0 ? 'ready' : 'fail',
122
+ sourceUrl: TORCHTPU_SOURCE_URL,
123
+ gateId: TORCHTPU_GATE_ID,
124
+ railMap: TORCHTPU_RAIL_MAP,
125
+ findings,
126
+ };
127
+ }
128
+
46
129
  function normalizeBoolean(value) {
47
130
  if (value === true || value === 1) return true;
48
131
  if (value === false || value === 0 || value == null) return false;
@@ -259,6 +342,11 @@ function runCli(argv = process.argv.slice(2)) {
259
342
  printHelp();
260
343
  return 0;
261
344
  }
345
+ if (args.torchtpu) {
346
+ const report = buildTorchTpuHonestyReport(args);
347
+ process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
348
+ return report.ok ? 0 : 1;
349
+ }
262
350
  const report = buildColabComputeHonestyReport(args);
263
351
  if (args.json) process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
264
352
  else process.stdout.write(formatColabComputeHonestyReport(report));
@@ -269,10 +357,15 @@ function runCli(argv = process.argv.slice(2)) {
269
357
 
270
358
  module.exports = {
271
359
  SOURCE_URL,
360
+ TORCHTPU_SOURCE_URL,
361
+ TORCHTPU_GATE_ID,
362
+ TORCHTPU_RAIL_MAP,
272
363
  PLANS,
273
364
  RAIL_MAP,
274
365
  buildColabComputeHonestyReport,
275
366
  formatColabComputeHonestyReport,
367
+ evaluateTorchTpuWorkloadGovernance,
368
+ buildTorchTpuHonestyReport,
276
369
  runCli,
277
370
  };
278
371