@secondlayer/shared 7.11.2 → 9.0.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 (60) hide show
  1. package/dist/src/archive/range-digest.d.ts +16 -169
  2. package/dist/src/archive/semantic-digest-builder.d.ts +16 -169
  3. package/dist/src/archive/status.js +11 -3
  4. package/dist/src/archive/status.js.map +3 -3
  5. package/dist/src/coverage/index.d.ts +15 -169
  6. package/dist/src/crypto/secrets.js +22 -3
  7. package/dist/src/crypto/secrets.js.map +3 -3
  8. package/dist/src/db/index.d.ts +18 -211
  9. package/dist/src/db/index.js +23 -16
  10. package/dist/src/db/index.js.map +4 -4
  11. package/dist/src/db/queries/chain-reorgs.d.ts +16 -169
  12. package/dist/src/db/queries/chain-reorgs.js +23 -16
  13. package/dist/src/db/queries/chain-reorgs.js.map +4 -4
  14. package/dist/src/db/queries/contracts.d.ts +16 -169
  15. package/dist/src/db/queries/instance.d.ts +16 -169
  16. package/dist/src/db/queries/integrity.d.ts +16 -169
  17. package/dist/src/db/queries/subgraph-gaps.d.ts +16 -169
  18. package/dist/src/db/queries/subgraph-operations.d.ts +17 -170
  19. package/dist/src/db/queries/subgraph-operations.js +1 -15
  20. package/dist/src/db/queries/subgraph-operations.js.map +3 -3
  21. package/dist/src/db/queries/subgraphs.d.ts +17 -191
  22. package/dist/src/db/queries/subgraphs.js +30 -1068
  23. package/dist/src/db/queries/subgraphs.js.map +5 -12
  24. package/dist/src/db/queries/subscriptions.d.ts +16 -169
  25. package/dist/src/db/queries/subscriptions.js +22 -3
  26. package/dist/src/db/queries/subscriptions.js.map +3 -3
  27. package/dist/src/db/queries/sync-scope.d.ts +1006 -0
  28. package/dist/src/db/queries/sync-scope.js +116 -0
  29. package/dist/src/db/queries/sync-scope.js.map +10 -0
  30. package/dist/src/db/schema.d.ts +17 -198
  31. package/dist/src/errors.d.ts +1 -22
  32. package/dist/src/errors.js +2 -4
  33. package/dist/src/errors.js.map +3 -3
  34. package/dist/src/index.d.ts +22 -256
  35. package/dist/src/index.js +24 -20
  36. package/dist/src/index.js.map +6 -6
  37. package/dist/src/mode.d.ts +16 -2
  38. package/dist/src/mode.js +25 -4
  39. package/dist/src/mode.js.map +3 -3
  40. package/dist/src/node/local-client.d.ts +16 -169
  41. package/dist/src/runtime/index.d.ts +137 -18
  42. package/dist/src/runtime/index.js +261 -41
  43. package/dist/src/runtime/index.js.map +9 -7
  44. package/dist/src/schemas/index.d.ts +5 -25
  45. package/dist/src/schemas/index.js +1 -2
  46. package/dist/src/schemas/index.js.map +3 -3
  47. package/dist/src/schemas/subgraphs.d.ts +5 -25
  48. package/dist/src/schemas/subgraphs.js +1 -2
  49. package/dist/src/schemas/subgraphs.js.map +3 -3
  50. package/dist/src/streams-rows/index.d.ts +399 -0
  51. package/dist/src/streams-rows/index.js +336 -0
  52. package/dist/src/streams-rows/index.js.map +17 -0
  53. package/dist/src/subgraphs/spec.d.ts +0 -9
  54. package/migrations/0118_drop_retired_control_tables.ts +53 -0
  55. package/migrations/0119_drop_accounts_plan.ts +29 -0
  56. package/migrations/0120_sync_scopes.ts +42 -0
  57. package/package.json +10 -6
  58. package/dist/src/x402.d.ts +0 -47
  59. package/dist/src/x402.js +0 -79
  60. package/dist/src/x402.js.map +0 -10
@@ -17,6 +17,7 @@ declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch
17
17
  type FailureClass = (typeof FAILURE_CLASSES)[number];
18
18
  declare const RETRY_STATES: readonly ["open", "retrying", "halted", "resolved"];
19
19
  type RetryState = (typeof RETRY_STATES)[number];
20
+ type BootstrapSource = "archive" | "genesis" | "import";
20
21
  interface BlocksTable {
21
22
  height: number;
22
23
  hash: string;
@@ -222,11 +223,9 @@ interface AccountsTable {
222
223
  ghost: Generated<boolean>;
223
224
  /** Stacks principal owning a wallet-ghost account (x402-paid deploys). */
224
225
  wallet_principal: string | null;
225
- plan: Generated<string>;
226
226
  display_name: string | null;
227
227
  bio: string | null;
228
228
  avatar_url: string | null;
229
- slug: string | null;
230
229
  stripe_customer_id: string | null;
231
230
  /** Opt-out toggle for the subgraph reindex-completion email. Defaults true. */
232
231
  notify_reindex_complete: Generated<boolean>;
@@ -243,19 +242,6 @@ interface SessionsTable {
243
242
  last_used_at: Date | null;
244
243
  created_at: Generated<Date>;
245
244
  }
246
- /**
247
- * One-time claim tokens for ghost accounts. The raw token only ever appears in
248
- * the claim URL returned at mint time; we store its sha256. A used token marks
249
- * the account as claimed (or merged into an existing account).
250
- */
251
- interface ClaimTokensTable {
252
- id: Generated<string>;
253
- account_id: string;
254
- token_hash: string;
255
- created_at: Generated<Date>;
256
- expires_at: Date;
257
- used_at: Date | null;
258
- }
259
245
  interface MagicLinksTable {
260
246
  id: Generated<string>;
261
247
  email: string;
@@ -266,47 +252,6 @@ interface MagicLinksTable {
266
252
  failed_attempts: Generated<number>;
267
253
  created_at: Generated<Date>;
268
254
  }
269
- interface UsageDailyTable {
270
- account_id: string;
271
- tenant_id: string | null;
272
- date: string;
273
- api_requests: Generated<number>;
274
- deliveries: Generated<number>;
275
- streams_events_returned: Generated<number>;
276
- index_decoded_events_returned: Generated<number>;
277
- }
278
- interface UsageSnapshotsTable {
279
- id: Generated<string>;
280
- account_id: string;
281
- measured_at: Generated<Date>;
282
- storage_bytes: Generated<number>;
283
- }
284
- interface AccountInsightsTable {
285
- id: Generated<string>;
286
- account_id: string;
287
- category: string;
288
- insight_type: string;
289
- resource_id: string | null;
290
- severity: string;
291
- title: string;
292
- body: string;
293
- data: unknown;
294
- dismissed_at: Date | null;
295
- expires_at: Date | null;
296
- created_at: Generated<Date>;
297
- }
298
- interface AccountAgentRunsTable {
299
- id: Generated<string>;
300
- account_id: string;
301
- started_at: Generated<Date>;
302
- completed_at: Date | null;
303
- status: Generated<string>;
304
- input_tokens: Generated<number>;
305
- output_tokens: Generated<number>;
306
- cost_usd: Generated<number>;
307
- insights_created: Generated<number>;
308
- error: string | null;
309
- }
310
255
  interface SubgraphProcessingStatsTable {
311
256
  id: Generated<string>;
312
257
  subgraph_name: string;
@@ -339,41 +284,6 @@ interface SubgraphHealthSnapshotsTable {
339
284
  last_processed_block: number | null;
340
285
  captured_at: Generated<Date>;
341
286
  }
342
- interface SubgraphUsageDailyTable {
343
- subgraph_id: string;
344
- date: string;
345
- query_count: Generated<number>;
346
- }
347
- interface ProjectsTable {
348
- id: Generated<string>;
349
- name: string;
350
- slug: string;
351
- account_id: string;
352
- settings: Generated<Record<string, unknown>>;
353
- network: Generated<string>;
354
- node_rpc: string | null;
355
- created_at: Generated<Date>;
356
- updated_at: Generated<Date>;
357
- }
358
- interface TeamMembersTable {
359
- id: Generated<string>;
360
- project_id: string;
361
- account_id: string;
362
- role: Generated<string>;
363
- invited_by: string | null;
364
- created_at: Generated<Date>;
365
- }
366
- interface TeamInvitationsTable {
367
- id: Generated<string>;
368
- project_id: string;
369
- email: string;
370
- role: Generated<string>;
371
- token: string;
372
- invited_by: string | null;
373
- expires_at: Date;
374
- accepted_at: Date | null;
375
- created_at: Generated<Date>;
376
- }
377
287
  interface ProcessedStripeEventsTable {
378
288
  event_id: string;
379
289
  event_type: string;
@@ -810,6 +720,20 @@ interface StageFailuresTable {
810
720
  resolved_at: Date | null;
811
721
  retain_until: Generated<Date>;
812
722
  }
723
+ /**
724
+ * The instance's declared scope — one row per network. `start_height` is what
725
+ * makes missing history below it deliberate rather than a gap.
726
+ */
727
+ interface SyncScopesTable {
728
+ network: string;
729
+ start_height: number;
730
+ target_height: number | null;
731
+ bootstrap_source: BootstrapSource;
732
+ bootstrap_manifest_digest: string | null;
733
+ genesis_hash: string | null;
734
+ created_at: Generated<Date>;
735
+ updated_at: Generated<Date>;
736
+ }
813
737
  interface Database {
814
738
  blocks: BlocksTable;
815
739
  transactions: TransactionsTable;
@@ -826,27 +750,14 @@ interface Database {
826
750
  accounts: AccountsTable;
827
751
  sessions: SessionsTable;
828
752
  magic_links: MagicLinksTable;
829
- claim_tokens: ClaimTokensTable;
830
- usage_daily: UsageDailyTable;
831
- usage_snapshots: UsageSnapshotsTable;
832
- account_insights: AccountInsightsTable;
833
- account_agent_runs: AccountAgentRunsTable;
834
753
  subgraph_health_snapshots: SubgraphHealthSnapshotsTable;
835
754
  subgraph_processing_stats: SubgraphProcessingStatsTable;
836
755
  subgraph_table_snapshots: SubgraphTableSnapshotsTable;
837
756
  subgraph_gaps: SubgraphGapsTable;
838
757
  subgraph_operations: SubgraphOperationsTable;
839
- subgraph_usage_daily: SubgraphUsageDailyTable;
840
- projects: ProjectsTable;
841
- team_members: TeamMembersTable;
842
- team_invitations: TeamInvitationsTable;
843
758
  processed_stripe_events: ProcessedStripeEventsTable;
844
- tenants: TenantsTable;
845
- tenant_usage_monthly: TenantUsageMonthlyTable;
846
- tenant_compute_addons: TenantComputeAddonsTable;
847
759
  account_spend_caps: AccountSpendCapsTable;
848
760
  account_credits: AccountCreditsTable;
849
- provisioning_audit_log: ProvisioningAuditLogTable;
850
761
  subscriptions: SubscriptionsTable;
851
762
  subscription_outbox: SubscriptionOutboxTable;
852
763
  subscription_deliveries: SubscriptionDeliveriesTable;
@@ -875,6 +786,7 @@ interface Database {
875
786
  chain_read_cache: ChainReadCacheTable;
876
787
  pending_fork_blocks: PendingForkBlocksTable;
877
788
  observer_journal: ObserverJournalTable;
789
+ sync_scopes: SyncScopesTable;
878
790
  stage_registry: StageRegistryTable;
879
791
  stage_runs: StageRunsTable;
880
792
  stage_block_receipts: StageBlockReceiptsTable;
@@ -921,57 +833,6 @@ interface X402PaymentsTable {
921
833
  * reconciler's heal path can never double-credit them. */
922
834
  credited_at: Generated<Date> | null;
923
835
  }
924
- type TenantStatus = "provisioning" | "active" | "limit_warning" | "paused_limit" | "suspended" | "error" | "deleted";
925
- interface TenantsTable {
926
- id: Generated<string>;
927
- account_id: string;
928
- slug: string;
929
- status: ColumnType<TenantStatus, TenantStatus | undefined, TenantStatus>;
930
- plan: string;
931
- cpus: ColumnType<number, number | string, number | string>;
932
- memory_mb: number;
933
- storage_limit_mb: number;
934
- storage_used_mb: number | null;
935
- pg_container_id: string | null;
936
- api_container_id: string | null;
937
- processor_container_id: string | null;
938
- target_database_url_enc: Buffer;
939
- tenant_jwt_secret_enc: Buffer;
940
- anon_key_enc: Buffer;
941
- service_key_enc: Buffer;
942
- api_url_internal: string;
943
- api_url_public: string;
944
- suspended_at: Date | null;
945
- last_health_check_at: Date | null;
946
- last_active_at: Generated<Date>;
947
- service_gen: Generated<number>;
948
- anon_gen: Generated<number>;
949
- project_id: string | null;
950
- created_at: Generated<Date>;
951
- updated_at: Generated<Date>;
952
- }
953
- interface TenantUsageMonthlyTable {
954
- id: Generated<string>;
955
- tenant_id: string;
956
- period_month: Date;
957
- storage_peak_mb: Generated<number>;
958
- storage_avg_mb: Generated<number>;
959
- storage_last_mb: Generated<number>;
960
- measurements: Generated<number>;
961
- first_at: Generated<Date>;
962
- last_at: Generated<Date>;
963
- }
964
- interface TenantComputeAddonsTable {
965
- id: Generated<string>;
966
- tenant_id: string;
967
- memory_mb_delta: Generated<number>;
968
- cpu_delta: Generated<number | string>;
969
- storage_mb_delta: Generated<number>;
970
- effective_from: Generated<Date>;
971
- effective_until: Date | null;
972
- stripe_subscription_item_id: string | null;
973
- created_at: Generated<Date>;
974
- }
975
836
  interface AccountSpendCapsTable {
976
837
  account_id: string;
977
838
  monthly_cap_cents: number | null;
@@ -995,20 +856,6 @@ interface AccountCreditsTable {
995
856
  refill_last_at: Date | null;
996
857
  updated_at: Generated<Date>;
997
858
  }
998
- type ProvisioningAuditEvent = "provision.start" | "provision.success" | "provision.failure" | "suspend" | "resume" | "resize" | "keys.rotate" | "bastion.key.upload" | "bastion.key.revoke" | "teardown";
999
- type ProvisioningAuditStatus = "ok" | "error";
1000
- interface ProvisioningAuditLogTable {
1001
- id: Generated<string>;
1002
- tenant_id: string | null;
1003
- tenant_slug: string | null;
1004
- account_id: string | null;
1005
- actor: string;
1006
- event: ProvisioningAuditEvent;
1007
- status: ProvisioningAuditStatus;
1008
- detail: unknown | null;
1009
- error: string | null;
1010
- created_at: Generated<Date>;
1011
- }
1012
859
  type SubscriptionStatus = "active" | "paused" | "error";
1013
860
  /** Polymorphic subscription mode: `subgraph` reacts to processed table rows;
1014
861
  * `chain` reacts to raw chain events matched directly off the Index/Streams
@@ -17,6 +17,7 @@ declare const FAILURE_CLASSES: readonly ["omission", "version", "digest_mismatch
17
17
  type FailureClass = (typeof FAILURE_CLASSES)[number];
18
18
  declare const RETRY_STATES: readonly ["open", "retrying", "halted", "resolved"];
19
19
  type RetryState = (typeof RETRY_STATES)[number];
20
+ type BootstrapSource = "archive" | "genesis" | "import";
20
21
  interface BlocksTable {
21
22
  height: number;
22
23
  hash: string;
@@ -222,11 +223,9 @@ interface AccountsTable {
222
223
  ghost: Generated<boolean>;
223
224
  /** Stacks principal owning a wallet-ghost account (x402-paid deploys). */
224
225
  wallet_principal: string | null;
225
- plan: Generated<string>;
226
226
  display_name: string | null;
227
227
  bio: string | null;
228
228
  avatar_url: string | null;
229
- slug: string | null;
230
229
  stripe_customer_id: string | null;
231
230
  /** Opt-out toggle for the subgraph reindex-completion email. Defaults true. */
232
231
  notify_reindex_complete: Generated<boolean>;
@@ -243,19 +242,6 @@ interface SessionsTable {
243
242
  last_used_at: Date | null;
244
243
  created_at: Generated<Date>;
245
244
  }
246
- /**
247
- * One-time claim tokens for ghost accounts. The raw token only ever appears in
248
- * the claim URL returned at mint time; we store its sha256. A used token marks
249
- * the account as claimed (or merged into an existing account).
250
- */
251
- interface ClaimTokensTable {
252
- id: Generated<string>;
253
- account_id: string;
254
- token_hash: string;
255
- created_at: Generated<Date>;
256
- expires_at: Date;
257
- used_at: Date | null;
258
- }
259
245
  interface MagicLinksTable {
260
246
  id: Generated<string>;
261
247
  email: string;
@@ -266,47 +252,6 @@ interface MagicLinksTable {
266
252
  failed_attempts: Generated<number>;
267
253
  created_at: Generated<Date>;
268
254
  }
269
- interface UsageDailyTable {
270
- account_id: string;
271
- tenant_id: string | null;
272
- date: string;
273
- api_requests: Generated<number>;
274
- deliveries: Generated<number>;
275
- streams_events_returned: Generated<number>;
276
- index_decoded_events_returned: Generated<number>;
277
- }
278
- interface UsageSnapshotsTable {
279
- id: Generated<string>;
280
- account_id: string;
281
- measured_at: Generated<Date>;
282
- storage_bytes: Generated<number>;
283
- }
284
- interface AccountInsightsTable {
285
- id: Generated<string>;
286
- account_id: string;
287
- category: string;
288
- insight_type: string;
289
- resource_id: string | null;
290
- severity: string;
291
- title: string;
292
- body: string;
293
- data: unknown;
294
- dismissed_at: Date | null;
295
- expires_at: Date | null;
296
- created_at: Generated<Date>;
297
- }
298
- interface AccountAgentRunsTable {
299
- id: Generated<string>;
300
- account_id: string;
301
- started_at: Generated<Date>;
302
- completed_at: Date | null;
303
- status: Generated<string>;
304
- input_tokens: Generated<number>;
305
- output_tokens: Generated<number>;
306
- cost_usd: Generated<number>;
307
- insights_created: Generated<number>;
308
- error: string | null;
309
- }
310
255
  interface SubgraphProcessingStatsTable {
311
256
  id: Generated<string>;
312
257
  subgraph_name: string;
@@ -339,41 +284,6 @@ interface SubgraphHealthSnapshotsTable {
339
284
  last_processed_block: number | null;
340
285
  captured_at: Generated<Date>;
341
286
  }
342
- interface SubgraphUsageDailyTable {
343
- subgraph_id: string;
344
- date: string;
345
- query_count: Generated<number>;
346
- }
347
- interface ProjectsTable {
348
- id: Generated<string>;
349
- name: string;
350
- slug: string;
351
- account_id: string;
352
- settings: Generated<Record<string, unknown>>;
353
- network: Generated<string>;
354
- node_rpc: string | null;
355
- created_at: Generated<Date>;
356
- updated_at: Generated<Date>;
357
- }
358
- interface TeamMembersTable {
359
- id: Generated<string>;
360
- project_id: string;
361
- account_id: string;
362
- role: Generated<string>;
363
- invited_by: string | null;
364
- created_at: Generated<Date>;
365
- }
366
- interface TeamInvitationsTable {
367
- id: Generated<string>;
368
- project_id: string;
369
- email: string;
370
- role: Generated<string>;
371
- token: string;
372
- invited_by: string | null;
373
- expires_at: Date;
374
- accepted_at: Date | null;
375
- created_at: Generated<Date>;
376
- }
377
287
  interface ProcessedStripeEventsTable {
378
288
  event_id: string;
379
289
  event_type: string;
@@ -810,6 +720,20 @@ interface StageFailuresTable {
810
720
  resolved_at: Date | null;
811
721
  retain_until: Generated<Date>;
812
722
  }
723
+ /**
724
+ * The instance's declared scope — one row per network. `start_height` is what
725
+ * makes missing history below it deliberate rather than a gap.
726
+ */
727
+ interface SyncScopesTable {
728
+ network: string;
729
+ start_height: number;
730
+ target_height: number | null;
731
+ bootstrap_source: BootstrapSource;
732
+ bootstrap_manifest_digest: string | null;
733
+ genesis_hash: string | null;
734
+ created_at: Generated<Date>;
735
+ updated_at: Generated<Date>;
736
+ }
813
737
  interface Database {
814
738
  blocks: BlocksTable;
815
739
  transactions: TransactionsTable;
@@ -826,27 +750,14 @@ interface Database {
826
750
  accounts: AccountsTable;
827
751
  sessions: SessionsTable;
828
752
  magic_links: MagicLinksTable;
829
- claim_tokens: ClaimTokensTable;
830
- usage_daily: UsageDailyTable;
831
- usage_snapshots: UsageSnapshotsTable;
832
- account_insights: AccountInsightsTable;
833
- account_agent_runs: AccountAgentRunsTable;
834
753
  subgraph_health_snapshots: SubgraphHealthSnapshotsTable;
835
754
  subgraph_processing_stats: SubgraphProcessingStatsTable;
836
755
  subgraph_table_snapshots: SubgraphTableSnapshotsTable;
837
756
  subgraph_gaps: SubgraphGapsTable;
838
757
  subgraph_operations: SubgraphOperationsTable;
839
- subgraph_usage_daily: SubgraphUsageDailyTable;
840
- projects: ProjectsTable;
841
- team_members: TeamMembersTable;
842
- team_invitations: TeamInvitationsTable;
843
758
  processed_stripe_events: ProcessedStripeEventsTable;
844
- tenants: TenantsTable;
845
- tenant_usage_monthly: TenantUsageMonthlyTable;
846
- tenant_compute_addons: TenantComputeAddonsTable;
847
759
  account_spend_caps: AccountSpendCapsTable;
848
760
  account_credits: AccountCreditsTable;
849
- provisioning_audit_log: ProvisioningAuditLogTable;
850
761
  subscriptions: SubscriptionsTable;
851
762
  subscription_outbox: SubscriptionOutboxTable;
852
763
  subscription_deliveries: SubscriptionDeliveriesTable;
@@ -875,6 +786,7 @@ interface Database {
875
786
  chain_read_cache: ChainReadCacheTable;
876
787
  pending_fork_blocks: PendingForkBlocksTable;
877
788
  observer_journal: ObserverJournalTable;
789
+ sync_scopes: SyncScopesTable;
878
790
  stage_registry: StageRegistryTable;
879
791
  stage_runs: StageRunsTable;
880
792
  stage_block_receipts: StageBlockReceiptsTable;
@@ -921,57 +833,6 @@ interface X402PaymentsTable {
921
833
  * reconciler's heal path can never double-credit them. */
922
834
  credited_at: Generated<Date> | null;
923
835
  }
924
- type TenantStatus = "provisioning" | "active" | "limit_warning" | "paused_limit" | "suspended" | "error" | "deleted";
925
- interface TenantsTable {
926
- id: Generated<string>;
927
- account_id: string;
928
- slug: string;
929
- status: ColumnType<TenantStatus, TenantStatus | undefined, TenantStatus>;
930
- plan: string;
931
- cpus: ColumnType<number, number | string, number | string>;
932
- memory_mb: number;
933
- storage_limit_mb: number;
934
- storage_used_mb: number | null;
935
- pg_container_id: string | null;
936
- api_container_id: string | null;
937
- processor_container_id: string | null;
938
- target_database_url_enc: Buffer;
939
- tenant_jwt_secret_enc: Buffer;
940
- anon_key_enc: Buffer;
941
- service_key_enc: Buffer;
942
- api_url_internal: string;
943
- api_url_public: string;
944
- suspended_at: Date | null;
945
- last_health_check_at: Date | null;
946
- last_active_at: Generated<Date>;
947
- service_gen: Generated<number>;
948
- anon_gen: Generated<number>;
949
- project_id: string | null;
950
- created_at: Generated<Date>;
951
- updated_at: Generated<Date>;
952
- }
953
- interface TenantUsageMonthlyTable {
954
- id: Generated<string>;
955
- tenant_id: string;
956
- period_month: Date;
957
- storage_peak_mb: Generated<number>;
958
- storage_avg_mb: Generated<number>;
959
- storage_last_mb: Generated<number>;
960
- measurements: Generated<number>;
961
- first_at: Generated<Date>;
962
- last_at: Generated<Date>;
963
- }
964
- interface TenantComputeAddonsTable {
965
- id: Generated<string>;
966
- tenant_id: string;
967
- memory_mb_delta: Generated<number>;
968
- cpu_delta: Generated<number | string>;
969
- storage_mb_delta: Generated<number>;
970
- effective_from: Generated<Date>;
971
- effective_until: Date | null;
972
- stripe_subscription_item_id: string | null;
973
- created_at: Generated<Date>;
974
- }
975
836
  interface AccountSpendCapsTable {
976
837
  account_id: string;
977
838
  monthly_cap_cents: number | null;
@@ -995,20 +856,6 @@ interface AccountCreditsTable {
995
856
  refill_last_at: Date | null;
996
857
  updated_at: Generated<Date>;
997
858
  }
998
- type ProvisioningAuditEvent = "provision.start" | "provision.success" | "provision.failure" | "suspend" | "resume" | "resize" | "keys.rotate" | "bastion.key.upload" | "bastion.key.revoke" | "teardown";
999
- type ProvisioningAuditStatus = "ok" | "error";
1000
- interface ProvisioningAuditLogTable {
1001
- id: Generated<string>;
1002
- tenant_id: string | null;
1003
- tenant_slug: string | null;
1004
- account_id: string | null;
1005
- actor: string;
1006
- event: ProvisioningAuditEvent;
1007
- status: ProvisioningAuditStatus;
1008
- detail: unknown | null;
1009
- error: string | null;
1010
- created_at: Generated<Date>;
1011
- }
1012
859
  type SubscriptionStatus = "active" | "paused" | "error";
1013
860
  /** Polymorphic subscription mode: `subgraph` reacts to processed table rows;
1014
861
  * `chain` reacts to raw chain events matched directly off the Index/Streams
@@ -17,7 +17,15 @@ var __export = (target, all) => {
17
17
  // src/archive/status.ts
18
18
  var ARCHIVE_STATUS_SCHEMA_VERSION = 1;
19
19
  var DEFAULT_MAX_BLOCKS_BEHIND_FINALIZED = 60000;
20
- var DEFAULT_MAX_SECONDS_SINCE_PROMOTION = 48 * 3600;
20
+ var DEFAULT_MAX_SECONDS_SINCE_PROMOTION = 5 * 24 * 3600;
21
+ function formatAge(seconds) {
22
+ const hours = seconds / 3600;
23
+ if (hours < 48)
24
+ return `${Math.round(hours)}h`;
25
+ const days = hours / 24;
26
+ const rounded = Math.round(days * 10) / 10;
27
+ return `${Number.isInteger(rounded) ? rounded : rounded.toFixed(1)}d`;
28
+ }
21
29
  function deriveArchiveStatus(inputs) {
22
30
  const maxBehind = inputs.maxBlocksBehindFinalized ?? DEFAULT_MAX_BLOCKS_BEHIND_FINALIZED;
23
31
  const maxAge = inputs.maxSecondsSincePromotion ?? DEFAULT_MAX_SECONDS_SINCE_PROMOTION;
@@ -70,7 +78,7 @@ function deriveArchiveStatus(inputs) {
70
78
  return {
71
79
  ...base,
72
80
  state: "stale",
73
- detail: `last promotion was ${Math.round(secondsSincePromotion / 3600)}h ago, beyond the ${Math.round(maxAge / 3600)}h freshness objective`
81
+ detail: `last promotion was ${formatAge(secondsSincePromotion)} ago, beyond the ${formatAge(maxAge)} freshness objective`
74
82
  };
75
83
  }
76
84
  if (behindFinalized !== null && behindFinalized > maxBehind) {
@@ -102,5 +110,5 @@ export {
102
110
  ARCHIVE_STATUS_SCHEMA_VERSION
103
111
  };
104
112
 
105
- //# debugId=D9102A12541A66EA64756E2164756E21
113
+ //# debugId=9AB2F7013DDD92C464756E2164756E21
106
114
  //# sourceMappingURL=status.js.map
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/archive/status.ts"],
4
4
  "sourcesContent": [
5
- "/**\n * `status.json` — the archive's operational truth, published short-cache from\n * verified state only.\n *\n * Everything else in the tree is immutable and signed, which makes it durable\n * but silent: a consumer holding a valid manifest cannot tell whether it is\n * current, three days behind, or the last thing published before an incident.\n * This object answers that, and it is the only object allowed to say something\n * unflattering.\n *\n * The distinction this file exists to protect:\n *\n * lagging → the archive trails the chain tip because it only publishes below\n * the finality boundary. This is CORRECT and permanent. An archive\n * that reported `stale` for its own finality lag would be crying\n * wolf forever, and consumers would learn to ignore it.\n * stale → publishing stopped. The lag exceeds what the finality rule can\n * explain, so something is broken.\n *\n * `state` is derived from measurements, never asserted by the publisher, and\n * every unhealthy state is reachable — an archive that can only report health\n * is decoration.\n */\n\nexport const ARCHIVE_STATUS_SCHEMA_VERSION = 1;\n\nexport type ArchiveState =\n\t| \"fresh\"\n\t| \"lagging\"\n\t| \"stale\"\n\t| \"gap\"\n\t| \"failed-audit\"\n\t| \"source-unavailable\";\n\nexport type ArchiveStatus = {\n\tschema_version: typeof ARCHIVE_STATUS_SCHEMA_VERSION;\n\tnetwork: string;\n\tstate: ArchiveState;\n\t/** Human-facing one-liner explaining the state, including WHY. */\n\tdetail: string;\n\tgenerated_at: string;\n\tarchive: {\n\t\tsnapshot_digest: string | null;\n\t\tcoverage_to_block: number | null;\n\t\tpromoted_at: string | null;\n\t\tsigning_key_id: string | null;\n\t};\n\tsource: {\n\t\t/** Chain tip as the publisher last observed it. Null when unreachable. */\n\t\ttip_height: number | null;\n\t\t/** Highest height eligible to publish under the finality rule. */\n\t\tfinalized_height: number | null;\n\t};\n\tlag: {\n\t\t/** Behind the FINALIZED height — the number that indicates a problem. */\n\t\tblocks_behind_finalized: number | null;\n\t\t/** Behind the raw chain tip — expected to be non-zero forever. */\n\t\tblocks_behind_tip: number | null;\n\t\tseconds_since_promotion: number | null;\n\t};\n\taudit: {\n\t\tcomplete: boolean;\n\t\tchecked_at: string;\n\t} | null;\n\tsignature?: string;\n\tkey_id?: string;\n};\n\nexport type StatusInputs = {\n\tnetwork: string;\n\tsnapshotDigest: string | null;\n\tcoverageToBlock: number | null;\n\tpromotedAt: string | null;\n\tsigningKeyId: string | null;\n\t/** Null when the source could not be reached. */\n\tsourceTipHeight: number | null;\n\tfinalizedHeight: number | null;\n\taudit: { complete: boolean; checkedAt: string } | null;\n\tnow: Date;\n\t/**\n\t * How far behind the FINALIZED height the archive may fall before it is\n\t * stale rather than merely lagging. Publishing one partition covers 50k\n\t * blocks, so a healthy archive sits well inside this.\n\t */\n\tmaxBlocksBehindFinalized?: number;\n\t/** How long since the last promotion before staleness, regardless of height. */\n\tmaxSecondsSincePromotion?: number;\n};\n\nconst DEFAULT_MAX_BLOCKS_BEHIND_FINALIZED = 60_000;\nconst DEFAULT_MAX_SECONDS_SINCE_PROMOTION = 48 * 3_600;\n\n/**\n * Derive status from measurements. Pure, so every state below is reachable in\n * a test rather than only in production at 3am.\n *\n * Order matters: a failing audit outranks freshness, because an archive that\n * is current and wrong is worse than one that is behind and correct.\n */\nexport function deriveArchiveStatus(inputs: StatusInputs): ArchiveStatus {\n\tconst maxBehind =\n\t\tinputs.maxBlocksBehindFinalized ?? DEFAULT_MAX_BLOCKS_BEHIND_FINALIZED;\n\tconst maxAge =\n\t\tinputs.maxSecondsSincePromotion ?? DEFAULT_MAX_SECONDS_SINCE_PROMOTION;\n\n\tconst secondsSincePromotion = inputs.promotedAt\n\t\t? Math.max(\n\t\t\t\t0,\n\t\t\t\tMath.round(\n\t\t\t\t\t(inputs.now.getTime() - Date.parse(inputs.promotedAt)) / 1000,\n\t\t\t\t),\n\t\t\t)\n\t\t: null;\n\n\tconst behindFinalized =\n\t\tinputs.finalizedHeight !== null && inputs.coverageToBlock !== null\n\t\t\t? Math.max(0, inputs.finalizedHeight - inputs.coverageToBlock)\n\t\t\t: null;\n\tconst behindTip =\n\t\tinputs.sourceTipHeight !== null && inputs.coverageToBlock !== null\n\t\t\t? Math.max(0, inputs.sourceTipHeight - inputs.coverageToBlock)\n\t\t\t: null;\n\n\tconst base = {\n\t\tschema_version:\n\t\t\tARCHIVE_STATUS_SCHEMA_VERSION as typeof ARCHIVE_STATUS_SCHEMA_VERSION,\n\t\tnetwork: inputs.network,\n\t\tgenerated_at: inputs.now.toISOString(),\n\t\tarchive: {\n\t\t\tsnapshot_digest: inputs.snapshotDigest,\n\t\t\tcoverage_to_block: inputs.coverageToBlock,\n\t\t\tpromoted_at: inputs.promotedAt,\n\t\t\tsigning_key_id: inputs.signingKeyId,\n\t\t},\n\t\tsource: {\n\t\t\ttip_height: inputs.sourceTipHeight,\n\t\t\tfinalized_height: inputs.finalizedHeight,\n\t\t},\n\t\tlag: {\n\t\t\tblocks_behind_finalized: behindFinalized,\n\t\t\tblocks_behind_tip: behindTip,\n\t\t\tseconds_since_promotion: secondsSincePromotion,\n\t\t},\n\t\taudit: inputs.audit\n\t\t\t? { complete: inputs.audit.complete, checked_at: inputs.audit.checkedAt }\n\t\t\t: null,\n\t};\n\n\t// A failed audit is the loudest signal: current-and-wrong beats behind-and-right.\n\tif (inputs.audit && !inputs.audit.complete) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"failed-audit\",\n\t\t\tdetail: `the canonical audit did not pass at ${inputs.audit.checkedAt}; this archive is not safe to restore from`,\n\t\t};\n\t}\n\n\tif (!inputs.snapshotDigest || inputs.coverageToBlock === null) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"gap\",\n\t\t\tdetail: \"no snapshot is currently promoted\",\n\t\t};\n\t}\n\n\t// Source unreachable: report the gap in KNOWLEDGE rather than guessing. The\n\t// archive may be perfectly healthy; we cannot currently say so.\n\tif (inputs.sourceTipHeight === null || inputs.finalizedHeight === null) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"source-unavailable\",\n\t\t\tdetail:\n\t\t\t\t\"the chain source could not be reached, so freshness cannot be determined\",\n\t\t};\n\t}\n\n\tif (secondsSincePromotion !== null && secondsSincePromotion > maxAge) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"stale\",\n\t\t\tdetail: `last promotion was ${Math.round(secondsSincePromotion / 3_600)}h ago, beyond the ${Math.round(maxAge / 3_600)}h freshness objective`,\n\t\t};\n\t}\n\n\tif (behindFinalized !== null && behindFinalized > maxBehind) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"stale\",\n\t\t\tdetail: `${behindFinalized} blocks behind the finalized height, beyond the ${maxBehind} threshold`,\n\t\t};\n\t}\n\n\t// Behind the tip but within the finality boundary — correct, permanent, and\n\t// explicitly NOT staleness.\n\tif (behindTip !== null && behindTip > 0) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"lagging\",\n\t\t\tdetail: `${behindTip} blocks behind the chain tip, which is expected: only heights below the finality boundary are published`,\n\t\t};\n\t}\n\n\treturn {\n\t\t...base,\n\t\tstate: \"fresh\",\n\t\tdetail: \"published through the finalized height\",\n\t};\n}\n\n/** States a consumer should refuse to restore from. */\nexport function isRestorable(state: ArchiveState): boolean {\n\treturn state === \"fresh\" || state === \"lagging\";\n}\n"
5
+ "/**\n * `status.json` — the archive's operational truth, published short-cache from\n * verified state only.\n *\n * Everything else in the tree is immutable and signed, which makes it durable\n * but silent: a consumer holding a valid manifest cannot tell whether it is\n * current, three days behind, or the last thing published before an incident.\n * This object answers that, and it is the only object allowed to say something\n * unflattering.\n *\n * The distinction this file exists to protect:\n *\n * lagging → the archive trails the chain tip because it only publishes below\n * the finality boundary. This is CORRECT and permanent. An archive\n * that reported `stale` for its own finality lag would be crying\n * wolf forever, and consumers would learn to ignore it.\n * stale → publishing stopped. The lag exceeds what the finality rule can\n * explain, so something is broken.\n *\n * `state` is derived from measurements, never asserted by the publisher, and\n * every unhealthy state is reachable — an archive that can only report health\n * is decoration.\n */\n\nexport const ARCHIVE_STATUS_SCHEMA_VERSION = 1;\n\nexport type ArchiveState =\n\t| \"fresh\"\n\t| \"lagging\"\n\t| \"stale\"\n\t| \"gap\"\n\t| \"failed-audit\"\n\t| \"source-unavailable\";\n\nexport type ArchiveStatus = {\n\tschema_version: typeof ARCHIVE_STATUS_SCHEMA_VERSION;\n\tnetwork: string;\n\tstate: ArchiveState;\n\t/** Human-facing one-liner explaining the state, including WHY. */\n\tdetail: string;\n\tgenerated_at: string;\n\tarchive: {\n\t\tsnapshot_digest: string | null;\n\t\tcoverage_to_block: number | null;\n\t\tpromoted_at: string | null;\n\t\tsigning_key_id: string | null;\n\t};\n\tsource: {\n\t\t/** Chain tip as the publisher last observed it. Null when unreachable. */\n\t\ttip_height: number | null;\n\t\t/** Highest height eligible to publish under the finality rule. */\n\t\tfinalized_height: number | null;\n\t};\n\tlag: {\n\t\t/** Behind the FINALIZED height — the number that indicates a problem. */\n\t\tblocks_behind_finalized: number | null;\n\t\t/** Behind the raw chain tip — expected to be non-zero forever. */\n\t\tblocks_behind_tip: number | null;\n\t\tseconds_since_promotion: number | null;\n\t};\n\taudit: {\n\t\tcomplete: boolean;\n\t\tchecked_at: string;\n\t} | null;\n\tsignature?: string;\n\tkey_id?: string;\n};\n\nexport type StatusInputs = {\n\tnetwork: string;\n\tsnapshotDigest: string | null;\n\tcoverageToBlock: number | null;\n\tpromotedAt: string | null;\n\tsigningKeyId: string | null;\n\t/** Null when the source could not be reached. */\n\tsourceTipHeight: number | null;\n\tfinalizedHeight: number | null;\n\taudit: { complete: boolean; checkedAt: string } | null;\n\tnow: Date;\n\t/**\n\t * How far behind the FINALIZED height the archive may fall before it is\n\t * stale rather than merely lagging. Publishing one partition covers 50k\n\t * blocks, so a healthy archive sits well inside this.\n\t */\n\tmaxBlocksBehindFinalized?: number;\n\t/** How long since the last promotion before staleness, regardless of height. */\n\tmaxSecondsSincePromotion?: number;\n};\n\nconst DEFAULT_MAX_BLOCKS_BEHIND_FINALIZED = 60_000;\n/**\n * Must exceed the publish cadence, or the archive reports `stale` on every\n * healthy cycle and the signal means nothing.\n *\n * The publisher runs Wed + Sun, so the longest gap between promotions in a\n * healthy week is 4 days. Five days leaves a day of grace for a slow export or\n * timer jitter, and still fires two days before the next scheduled attempt\n * whenever a cycle is actually missed.\n *\n * It also lands just inside the height rule: at the observed ~7–9k blocks/day\n * the archive is ~45k blocks behind finalized at the five-day mark, so age\n * trips first and reports the more diagnostic message (\"publishing stopped\")\n * rather than the symptom.\n */\nconst DEFAULT_MAX_SECONDS_SINCE_PROMOTION = 5 * 24 * 3_600;\n\n/**\n * Durations here run to days, and \"beyond the 120h objective\" makes a reader do\n * arithmetic before they can tell whether that is alarming.\n */\nfunction formatAge(seconds: number): string {\n\tconst hours = seconds / 3_600;\n\tif (hours < 48) return `${Math.round(hours)}h`;\n\tconst days = hours / 24;\n\t// One decimal only when it changes the reading: 4d and 4.5d are different\n\t// facts during an incident, 5.0d is noise.\n\tconst rounded = Math.round(days * 10) / 10;\n\treturn `${Number.isInteger(rounded) ? rounded : rounded.toFixed(1)}d`;\n}\n\n/**\n * Derive status from measurements. Pure, so every state below is reachable in\n * a test rather than only in production at 3am.\n *\n * Order matters: a failing audit outranks freshness, because an archive that\n * is current and wrong is worse than one that is behind and correct.\n */\nexport function deriveArchiveStatus(inputs: StatusInputs): ArchiveStatus {\n\tconst maxBehind =\n\t\tinputs.maxBlocksBehindFinalized ?? DEFAULT_MAX_BLOCKS_BEHIND_FINALIZED;\n\tconst maxAge =\n\t\tinputs.maxSecondsSincePromotion ?? DEFAULT_MAX_SECONDS_SINCE_PROMOTION;\n\n\tconst secondsSincePromotion = inputs.promotedAt\n\t\t? Math.max(\n\t\t\t\t0,\n\t\t\t\tMath.round(\n\t\t\t\t\t(inputs.now.getTime() - Date.parse(inputs.promotedAt)) / 1000,\n\t\t\t\t),\n\t\t\t)\n\t\t: null;\n\n\tconst behindFinalized =\n\t\tinputs.finalizedHeight !== null && inputs.coverageToBlock !== null\n\t\t\t? Math.max(0, inputs.finalizedHeight - inputs.coverageToBlock)\n\t\t\t: null;\n\tconst behindTip =\n\t\tinputs.sourceTipHeight !== null && inputs.coverageToBlock !== null\n\t\t\t? Math.max(0, inputs.sourceTipHeight - inputs.coverageToBlock)\n\t\t\t: null;\n\n\tconst base = {\n\t\tschema_version:\n\t\t\tARCHIVE_STATUS_SCHEMA_VERSION as typeof ARCHIVE_STATUS_SCHEMA_VERSION,\n\t\tnetwork: inputs.network,\n\t\tgenerated_at: inputs.now.toISOString(),\n\t\tarchive: {\n\t\t\tsnapshot_digest: inputs.snapshotDigest,\n\t\t\tcoverage_to_block: inputs.coverageToBlock,\n\t\t\tpromoted_at: inputs.promotedAt,\n\t\t\tsigning_key_id: inputs.signingKeyId,\n\t\t},\n\t\tsource: {\n\t\t\ttip_height: inputs.sourceTipHeight,\n\t\t\tfinalized_height: inputs.finalizedHeight,\n\t\t},\n\t\tlag: {\n\t\t\tblocks_behind_finalized: behindFinalized,\n\t\t\tblocks_behind_tip: behindTip,\n\t\t\tseconds_since_promotion: secondsSincePromotion,\n\t\t},\n\t\taudit: inputs.audit\n\t\t\t? { complete: inputs.audit.complete, checked_at: inputs.audit.checkedAt }\n\t\t\t: null,\n\t};\n\n\t// A failed audit is the loudest signal: current-and-wrong beats behind-and-right.\n\tif (inputs.audit && !inputs.audit.complete) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"failed-audit\",\n\t\t\tdetail: `the canonical audit did not pass at ${inputs.audit.checkedAt}; this archive is not safe to restore from`,\n\t\t};\n\t}\n\n\tif (!inputs.snapshotDigest || inputs.coverageToBlock === null) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"gap\",\n\t\t\tdetail: \"no snapshot is currently promoted\",\n\t\t};\n\t}\n\n\t// Source unreachable: report the gap in KNOWLEDGE rather than guessing. The\n\t// archive may be perfectly healthy; we cannot currently say so.\n\tif (inputs.sourceTipHeight === null || inputs.finalizedHeight === null) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"source-unavailable\",\n\t\t\tdetail:\n\t\t\t\t\"the chain source could not be reached, so freshness cannot be determined\",\n\t\t};\n\t}\n\n\tif (secondsSincePromotion !== null && secondsSincePromotion > maxAge) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"stale\",\n\t\t\tdetail: `last promotion was ${formatAge(secondsSincePromotion)} ago, beyond the ${formatAge(maxAge)} freshness objective`,\n\t\t};\n\t}\n\n\tif (behindFinalized !== null && behindFinalized > maxBehind) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"stale\",\n\t\t\tdetail: `${behindFinalized} blocks behind the finalized height, beyond the ${maxBehind} threshold`,\n\t\t};\n\t}\n\n\t// Behind the tip but within the finality boundary — correct, permanent, and\n\t// explicitly NOT staleness.\n\tif (behindTip !== null && behindTip > 0) {\n\t\treturn {\n\t\t\t...base,\n\t\t\tstate: \"lagging\",\n\t\t\tdetail: `${behindTip} blocks behind the chain tip, which is expected: only heights below the finality boundary are published`,\n\t\t};\n\t}\n\n\treturn {\n\t\t...base,\n\t\tstate: \"fresh\",\n\t\tdetail: \"published through the finalized height\",\n\t};\n}\n\n/** States a consumer should refuse to restore from. */\nexport function isRestorable(state: ArchiveState): boolean {\n\treturn state === \"fresh\" || state === \"lagging\";\n}\n"
6
6
  ],
7
- "mappings": ";;;;;;;;;;;;;;;;;AAwBO,IAAM,gCAAgC;AAiE7C,IAAM,sCAAsC;AAC5C,IAAM,sCAAsC,KAAK;AAS1C,SAAS,mBAAmB,CAAC,QAAqC;AAAA,EACxE,MAAM,YACL,OAAO,4BAA4B;AAAA,EACpC,MAAM,SACL,OAAO,4BAA4B;AAAA,EAEpC,MAAM,wBAAwB,OAAO,aAClC,KAAK,IACL,GACA,KAAK,OACH,OAAO,IAAI,QAAQ,IAAI,KAAK,MAAM,OAAO,UAAU,KAAK,IAC1D,CACD,IACC;AAAA,EAEH,MAAM,kBACL,OAAO,oBAAoB,QAAQ,OAAO,oBAAoB,OAC3D,KAAK,IAAI,GAAG,OAAO,kBAAkB,OAAO,eAAe,IAC3D;AAAA,EACJ,MAAM,YACL,OAAO,oBAAoB,QAAQ,OAAO,oBAAoB,OAC3D,KAAK,IAAI,GAAG,OAAO,kBAAkB,OAAO,eAAe,IAC3D;AAAA,EAEJ,MAAM,OAAO;AAAA,IACZ,gBACC;AAAA,IACD,SAAS,OAAO;AAAA,IAChB,cAAc,OAAO,IAAI,YAAY;AAAA,IACrC,SAAS;AAAA,MACR,iBAAiB,OAAO;AAAA,MACxB,mBAAmB,OAAO;AAAA,MAC1B,aAAa,OAAO;AAAA,MACpB,gBAAgB,OAAO;AAAA,IACxB;AAAA,IACA,QAAQ;AAAA,MACP,YAAY,OAAO;AAAA,MACnB,kBAAkB,OAAO;AAAA,IAC1B;AAAA,IACA,KAAK;AAAA,MACJ,yBAAyB;AAAA,MACzB,mBAAmB;AAAA,MACnB,yBAAyB;AAAA,IAC1B;AAAA,IACA,OAAO,OAAO,QACX,EAAE,UAAU,OAAO,MAAM,UAAU,YAAY,OAAO,MAAM,UAAU,IACtE;AAAA,EACJ;AAAA,EAGA,IAAI,OAAO,SAAS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