@cat-factory/worker 0.167.0 → 0.168.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 (59) hide show
  1. package/dist/index.d.ts.map +1 -1
  2. package/dist/index.js +9 -17
  3. package/dist/index.js.map +1 -1
  4. package/dist/infrastructure/config/retention.d.ts.map +1 -1
  5. package/dist/infrastructure/config/retention.js +6 -0
  6. package/dist/infrastructure/config/retention.js.map +1 -1
  7. package/dist/infrastructure/container-assembly.d.ts.map +1 -1
  8. package/dist/infrastructure/container-assembly.js +14 -8
  9. package/dist/infrastructure/container-assembly.js.map +1 -1
  10. package/dist/infrastructure/env.d.ts +7 -0
  11. package/dist/infrastructure/env.d.ts.map +1 -1
  12. package/dist/infrastructure/env.js.map +1 -1
  13. package/dist/infrastructure/observability/logExport.d.ts.map +1 -1
  14. package/dist/infrastructure/observability/logExport.js +10 -4
  15. package/dist/infrastructure/observability/logExport.js.map +1 -1
  16. package/dist/infrastructure/observability/logSettings.d.ts +22 -0
  17. package/dist/infrastructure/observability/logSettings.d.ts.map +1 -0
  18. package/dist/infrastructure/observability/logSettings.js +42 -0
  19. package/dist/infrastructure/observability/logSettings.js.map +1 -0
  20. package/dist/infrastructure/observability/operationalFlush.d.ts.map +1 -1
  21. package/dist/infrastructure/observability/operationalFlush.js +8 -4
  22. package/dist/infrastructure/observability/operationalFlush.js.map +1 -1
  23. package/dist/infrastructure/repositories/D1AuditEventRepository.d.ts +1 -0
  24. package/dist/infrastructure/repositories/D1AuditEventRepository.d.ts.map +1 -1
  25. package/dist/infrastructure/repositories/D1AuditEventRepository.js +6 -0
  26. package/dist/infrastructure/repositories/D1AuditEventRepository.js.map +1 -1
  27. package/dist/infrastructure/repositories/D1UserRepository.d.ts +2 -0
  28. package/dist/infrastructure/repositories/D1UserRepository.d.ts.map +1 -1
  29. package/dist/infrastructure/repositories/D1UserRepository.js +26 -0
  30. package/dist/infrastructure/repositories/D1UserRepository.js.map +1 -1
  31. package/dist/infrastructure/workflows/BootstrapWorkflow.d.ts +1 -0
  32. package/dist/infrastructure/workflows/BootstrapWorkflow.d.ts.map +1 -1
  33. package/dist/infrastructure/workflows/BootstrapWorkflow.js +9 -2
  34. package/dist/infrastructure/workflows/BootstrapWorkflow.js.map +1 -1
  35. package/dist/infrastructure/workflows/EnvConfigRepairWorkflow.d.ts +1 -0
  36. package/dist/infrastructure/workflows/EnvConfigRepairWorkflow.d.ts.map +1 -1
  37. package/dist/infrastructure/workflows/EnvConfigRepairWorkflow.js +7 -2
  38. package/dist/infrastructure/workflows/EnvConfigRepairWorkflow.js.map +1 -1
  39. package/dist/infrastructure/workflows/EnvironmentTestWorkflow.d.ts +1 -0
  40. package/dist/infrastructure/workflows/EnvironmentTestWorkflow.d.ts.map +1 -1
  41. package/dist/infrastructure/workflows/EnvironmentTestWorkflow.js +7 -2
  42. package/dist/infrastructure/workflows/EnvironmentTestWorkflow.js.map +1 -1
  43. package/dist/infrastructure/workflows/ExecutionWorkflow.d.ts +1 -0
  44. package/dist/infrastructure/workflows/ExecutionWorkflow.d.ts.map +1 -1
  45. package/dist/infrastructure/workflows/ExecutionWorkflow.js +10 -2
  46. package/dist/infrastructure/workflows/ExecutionWorkflow.js.map +1 -1
  47. package/dist/infrastructure/workflows/GitHubBackfillWorkflow.d.ts.map +1 -1
  48. package/dist/infrastructure/workflows/GitHubBackfillWorkflow.js +11 -5
  49. package/dist/infrastructure/workflows/GitHubBackfillWorkflow.js.map +1 -1
  50. package/dist/infrastructure/workflows/logExport.d.ts +11 -0
  51. package/dist/infrastructure/workflows/logExport.d.ts.map +1 -0
  52. package/dist/infrastructure/workflows/logExport.js +110 -0
  53. package/dist/infrastructure/workflows/logExport.js.map +1 -0
  54. package/dist/infrastructure/workflows/retention.d.ts +12 -2
  55. package/dist/infrastructure/workflows/retention.d.ts.map +1 -1
  56. package/dist/infrastructure/workflows/retention.js +4 -1
  57. package/dist/infrastructure/workflows/retention.js.map +1 -1
  58. package/migrations/0084_user_session_generation.sql +22 -0
  59. package/package.json +18 -18
@@ -25,7 +25,7 @@ const SUBSCRIPTION_QUOTA_CYCLE_RETENTION_MS = 30 * 24 * 60 * 60 * 1000;
25
25
  * since the same table failed on every subsequent pass too. Shared with the Node twin via
26
26
  * `createRetentionPass`, so the two facades cannot drift on it.
27
27
  */
28
- export async function sweepRetention({ tokenUsageRepository, rateLimitRepository, commitRepository, llmCallMetricRepository, agentContextSnapshotRepository, agentSearchQueryRepository, agentToolCallRepository, subscriptionQuotaCycleRepository, pipelineScheduleRepository, provisioningLogRepository, passwordResetTokenRepository, machineNodeRepository, authAttemptRepository, notificationRepository, gateOutcomeRepository, platformMetricsRepository, spendRollupRepository, clock, policy, logger, }) {
28
+ export async function sweepRetention({ tokenUsageRepository, rateLimitRepository, commitRepository, llmCallMetricRepository, agentContextSnapshotRepository, agentSearchQueryRepository, agentToolCallRepository, subscriptionQuotaCycleRepository, pipelineScheduleRepository, provisioningLogRepository, passwordResetTokenRepository, machineNodeRepository, authAttemptRepository, notificationRepository, gateOutcomeRepository, platformMetricsRepository, auditEventRepository, spendRollupRepository, clock, policy, logger, }) {
29
29
  const now = clock.now();
30
30
  const pass = createRetentionPass(logger);
31
31
  return {
@@ -72,6 +72,9 @@ export async function sweepRetention({ tokenUsageRepository, rateLimitRepository
72
72
  // rather than leaving a day permanently half-counted.
73
73
  runDaysRolledUp: await pass.materialize('platform_run_days', () => platformMetricsRepository.rollupRunDays(now - RUN_DAY_ROLLUP_LOOKBACK_MS, now)),
74
74
  runDays: await pass.prune('platform_run_days', policy.runDaysMs, now, (c) => platformMetricsRepository.deleteRunDaysOlderThan(c)),
75
+ // The audit log, in its own database. Last because it is the only pass whose window is
76
+ // measured in years: the others reclaim on most ticks, this one usually reclaims nothing.
77
+ auditEvents: await pass.prune('audit_events', policy.auditEventsMs, now, (c) => auditEventRepository.deleteOlderThan(c)),
75
78
  failedTables: pass.failed,
76
79
  };
77
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"retention.js","sourceRoot":"","sources":["../../../src/infrastructure/workflows/retention.ts"],"names":[],"mappings":"AAqBA,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,4BAA4B,CAAA;AAEnC,+EAA+E;AAC/E,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEzD,8FAA8F;AAC9F,+FAA+F;AAC/F,iGAAiG;AACjG,iGAAiG;AACjG,8DAA8D;AAC9D,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,qCAAqC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AA8GtE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,EACnC,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,8BAA8B,EAC9B,0BAA0B,EAC1B,uBAAuB,EACvB,gCAAgC,EAChC,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,qBAAqB,EACrB,KAAK,EACL,MAAM,EACN,MAAM,GACQ;IACd,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,EAAE,CAAA;IACvB,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO;QACL,yFAAyF;QACzF,yFAAyF;QACzF,uFAAuF;QACvF,yFAAyF;QACzF,yFAAyF;QACzF,uFAAuF;QACvF,+CAA+C;QAC/C,iBAAiB,EAAE,MAAM,sBAAsB,CAC7C,IAAI,EACJ,qBAAqB,EACrB,GAAG,EACH,MAAM,CAAC,YAAY,EACnB,MAAM,CACP;QACD,UAAU,EAAE,MAAM,IAAI,CAAC,KAA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,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAC1E,yBAAyB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CACpD;QACD,uFAAuF;QACvF,0FAA0F;QAC1F,WAAW,EAAE,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,MAAM,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAC7E,oBAAoB,CAAC,eAAe,CAAC,CAAC,CAAC,CACxC;QACD,YAAY,EAAE,IAAI,CAAC,MAAM;KAC1B,CAAA;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ -- Per-user SESSION GENERATION: the one row write that revokes every bearer a person holds.
2
+ --
3
+ -- Sessions are stateless HMAC-signed tokens, so before this column there was nothing to revoke:
4
+ -- logout dropped the token client-side and a leaked (or offboarded) bearer stayed valid until it
5
+ -- expired. That is the gap enterprise SSO cannot close on its own — the whole offboarding promise
6
+ -- is "we disabled them in the IdP and they lost access", and re-reading the directory on sign-in
7
+ -- only stops a NEW session being minted, never the one they already hold.
8
+ --
9
+ -- A GENERATION rather than a token blocklist. The token carries the generation it was minted
10
+ -- under; verification compares that claim against this column and refuses a mismatch. Revoking
11
+ -- every session is therefore `session_generation + 1`, one write, with nothing to enumerate and no
12
+ -- second table to grow and prune. A blocklist would need a row per outstanding token, a retention
13
+ -- sweep of its own, and would still be unable to answer for a token it never saw minted.
14
+ --
15
+ -- DEFAULT 0 so every existing row is valid without a backfill. Note that existing TOKENS are not:
16
+ -- they carry no generation claim at all and are refused after this ships, which logs everyone out
17
+ -- once. That is the deliberate pre-1.0 internal break (CLAUDE.md → "Internals: backwards
18
+ -- compatibility is NOT a goal") rather than a dual-read that would leave a permanent
19
+ -- claim-less-means-valid hole — precisely the hole an attacker would aim at.
20
+ --
21
+ -- Mirrors the Drizzle `users.session_generation` column on the Node facade.
22
+ ALTER TABLE users ADD COLUMN session_generation INTEGER NOT NULL DEFAULT 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/worker",
3
- "version": "0.167.0",
3
+ "version": "0.168.1",
4
4
  "description": "Reusable Cloudflare Worker library (Hono + D1) exposing the Agent Architecture Board core: the `createApp()` Hono factory, the default fetch/scheduled/queue handler, and the Durable Object + Workflow classes. Deployments (see deploy/backend) supply the wrangler.toml + config and re-export these.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,22 +43,22 @@
43
43
  "pino": "^10.3.1",
44
44
  "valibot": "^1.4.2",
45
45
  "workers-ai-provider": "^4.0.0",
46
- "@cat-factory/agents": "0.116.4",
47
- "@cat-factory/caching": "0.16.6",
48
- "@cat-factory/consensus": "0.14.41",
49
- "@cat-factory/contracts": "0.259.0",
50
- "@cat-factory/eks": "0.1.253",
51
- "@cat-factory/gates": "0.9.21",
52
- "@cat-factory/gitlab": "0.16.12",
53
- "@cat-factory/kernel": "0.257.0",
54
- "@cat-factory/observability-langfuse": "0.10.25",
55
- "@cat-factory/observability-otel": "0.16.5",
56
- "@cat-factory/orchestration": "0.226.0",
57
- "@cat-factory/integrations": "0.138.3",
58
- "@cat-factory/prompt-fragments": "1.0.5",
59
- "@cat-factory/provider-cloudflare": "0.7.403",
60
- "@cat-factory/spend": "0.15.23",
61
- "@cat-factory/server": "0.237.1"
46
+ "@cat-factory/agents": "0.116.7",
47
+ "@cat-factory/caching": "0.17.1",
48
+ "@cat-factory/consensus": "0.14.44",
49
+ "@cat-factory/contracts": "0.261.0",
50
+ "@cat-factory/eks": "0.1.256",
51
+ "@cat-factory/gates": "0.9.24",
52
+ "@cat-factory/gitlab": "0.16.15",
53
+ "@cat-factory/integrations": "0.140.1",
54
+ "@cat-factory/kernel": "0.260.0",
55
+ "@cat-factory/observability-langfuse": "0.10.28",
56
+ "@cat-factory/observability-otel": "0.16.8",
57
+ "@cat-factory/orchestration": "0.228.1",
58
+ "@cat-factory/prompt-fragments": "1.0.8",
59
+ "@cat-factory/provider-cloudflare": "0.7.406",
60
+ "@cat-factory/server": "0.239.1",
61
+ "@cat-factory/spend": "0.15.26"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@cloudflare/vitest-pool-workers": "^0.20.1",
@@ -66,7 +66,7 @@
66
66
  "typescript": "7.0.2",
67
67
  "vitest": "^4.1.10",
68
68
  "wrangler": "^4.118.0",
69
- "@cat-factory/conformance": "0.31.17"
69
+ "@cat-factory/conformance": "0.31.20"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsc -b tsconfig.build.json",