@lunora/advisor 1.0.0-alpha.290 → 1.0.0-alpha.292

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 (105) hide show
  1. package/dist/index.d.mts +44 -22
  2. package/dist/index.d.ts +44 -22
  3. package/dist/index.mjs +1 -1
  4. package/dist/packem_shared/{actionFetchSsrf-BK-kvOPO.mjs → actionFetchSsrf-B7FqsLWm.mjs} +1 -1
  5. package/dist/packem_shared/actionWithoutErrorHandling-DK3rB5c-.mjs +1 -0
  6. package/dist/packem_shared/adminRouteWithoutGuard-CcdlN75o.mjs +1 -0
  7. package/dist/packem_shared/{aiRawRunEscapeHatch-BW7a8kZC.mjs → aiRawRunEscapeHatch-CzIaQf_v.mjs} +1 -1
  8. package/dist/packem_shared/aiRunWithoutLogging-Ct5MeKWe.mjs +1 -0
  9. package/dist/packem_shared/{aiToolSideEffectPromptInjection-9eJXRlKt.mjs → aiToolSideEffectPromptInjection-Ck_h8tFx.mjs} +1 -1
  10. package/dist/packem_shared/aiUnboundedGenerationPublic-CzF3xBc3.mjs +1 -0
  11. package/dist/packem_shared/{authApiCallWithoutHeaders-CReJRsGW.mjs → authApiCallWithoutHeaders-9PpziIB9.mjs} +1 -1
  12. package/dist/packem_shared/{authCsrfCheckDisabled-CRIVsvb9.mjs → authCsrfCheckDisabled-DYTzZFpp.mjs} +1 -1
  13. package/dist/packem_shared/{authEmailVerificationDisabled-BjFlnHr2.mjs → authEmailVerificationDisabled-OiNes7Dz.mjs} +1 -1
  14. package/dist/packem_shared/{authScimWithoutTransactions-B5ATiz5A.mjs → authScimWithoutTransactions-CajXH24D.mjs} +1 -1
  15. package/dist/packem_shared/{authSecureCookiesDisabled-By8PVum3.mjs → authSecureCookiesDisabled-CA5zyqDZ.mjs} +1 -1
  16. package/dist/packem_shared/{authSessionFreshageZero-DuxX3Ln9.mjs → authSessionFreshageZero-C3IYlYft.mjs} +1 -1
  17. package/dist/packem_shared/{authTrustedOriginsWildcard-BKIh6788.mjs → authTrustedOriginsWildcard-661FRsGe.mjs} +1 -1
  18. package/dist/packem_shared/{browserUserUrlWithoutAllowlist-CzDEraJB.mjs → browserUserUrlWithoutAllowlist-Bi5ZWTF7.mjs} +1 -1
  19. package/dist/packem_shared/{containerInstanceKeyFromUserInput-Bl-tAzKV.mjs → containerInstanceKeyFromUserInput-DHQ2JL4x.mjs} +1 -1
  20. package/dist/packem_shared/containerLongSleepAfter-DSGnfpfl.mjs +1 -0
  21. package/dist/packem_shared/containerOversizedInstance-INKmy3-D.mjs +1 -0
  22. package/dist/packem_shared/containerPublicInternet-Csh5_RwX.mjs +1 -0
  23. package/dist/packem_shared/{containerRuntimeEgressRelaxation-4tMrhq1k.mjs → containerRuntimeEgressRelaxation-J6rpfvr8.mjs} +1 -1
  24. package/dist/packem_shared/{containerStartEnableInternetOverride-mN_kuRtk.mjs → containerStartEnableInternetOverride-Bxbmrpwe.mjs} +1 -1
  25. package/dist/packem_shared/{countWithoutIndex-DjQFNBrw.mjs → countWithoutIndex-CTbdpLyE.mjs} +1 -1
  26. package/dist/packem_shared/cronEveryMinute-BjdRdTEz.mjs +1 -0
  27. package/dist/packem_shared/duplicateIndex-BJI90Cnj.mjs +1 -0
  28. package/dist/packem_shared/errorWithoutCatalog-Dib0sdSD.mjs +1 -0
  29. package/dist/packem_shared/{filterAfterIndexScan-CV8aPq7v.mjs → filterAfterIndexScan-BTHjxkNi.mjs} +1 -1
  30. package/dist/packem_shared/{filterOnPrimaryKey-CAhFiqp_.mjs → filterOnPrimaryKey-DeRYfLa7.mjs} +1 -1
  31. package/dist/packem_shared/{filterWithoutIndex-BGv3jbgg.mjs → filterWithoutIndex-8VrXwbq5.mjs} +1 -1
  32. package/dist/packem_shared/{flagGatesSecurityWithUnsafeDefault-B5FBDF8c.mjs → flagGatesSecurityWithUnsafeDefault-CJK9sKcH.mjs} +1 -1
  33. package/dist/packem_shared/{geoIndexFieldNotGeopoint-BMQuok2-.mjs → geoIndexFieldNotGeopoint-Cx_9INob.mjs} +1 -1
  34. package/dist/packem_shared/{helpers-DdZ_pyR3.mjs → helpers-YAAwOBMH.mjs} +1 -1
  35. package/dist/packem_shared/{httpActionMissingAuthGuard-DhMIs1EI.mjs → httpActionMissingAuthGuard-D58Vnjr0.mjs} +1 -1
  36. package/dist/packem_shared/{httpActionResponseHeaderInjection-mcRYd3Zw.mjs → httpActionResponseHeaderInjection-Yn1pbKZ8.mjs} +1 -1
  37. package/dist/packem_shared/{identityUndeclaredClaimTrusted-D1sEd5lr.mjs → identityUndeclaredClaimTrusted-Z-9ob8F2.mjs} +1 -1
  38. package/dist/packem_shared/{imagesUrlSourceFromUserInput-BJXotuyO.mjs → imagesUrlSourceFromUserInput-a2CZ-Xnj.mjs} +1 -1
  39. package/dist/packem_shared/{indexReferencesUnknownField-DKz4-bla.mjs → indexReferencesUnknownField-CV8STvk0.mjs} +1 -1
  40. package/dist/packem_shared/indexUtilization-CmtN9-HA.mjs +1 -0
  41. package/dist/packem_shared/insertManyUnsafeUserData-CSvy65sr.mjs +1 -0
  42. package/dist/packem_shared/{kvUnscopedUserKeyIdor-DhymglIq.mjs → kvUnscopedUserKeyIdor-D0O2alyn.mjs} +1 -1
  43. package/dist/packem_shared/{mailRecipientFromRequestInput-BVXsZ4Xf.mjs → mailRecipientFromRequestInput-BMrAJjNK.mjs} +1 -1
  44. package/dist/packem_shared/{maskWeakHashStrategyOnPii-DJasagzX.mjs → maskWeakHashStrategyOnPii-CwgAXFSx.mjs} +1 -1
  45. package/dist/packem_shared/{outputProjectionMissingOnPublicRead-DWSeo7oC.mjs → outputProjectionMissingOnPublicRead-BPS-eg2q.mjs} +1 -1
  46. package/dist/packem_shared/{ownerFieldFromArgsNotAuth-J8Xbz5uI.mjs → ownerFieldFromArgsNotAuth-BmKLZxrX.mjs} +1 -1
  47. package/dist/packem_shared/{paymentWebhookWideTolerance-DVhJB0Ip.mjs → paymentWebhookWideTolerance-D9i3Vb1n.mjs} +1 -1
  48. package/dist/packem_shared/policyReferencesUnknownTable-DiQYFRFY.mjs +1 -0
  49. package/dist/packem_shared/{privilegedDispatchUnvalidatedPayload-BM3NtT57.mjs → privilegedDispatchUnvalidatedPayload-BJL0JNzG.mjs} +1 -1
  50. package/dist/packem_shared/privilegedFanoutFromPublicProcedure-Byw3Prsi.mjs +1 -0
  51. package/dist/packem_shared/procedureWithoutStructuredEvent-na08a0M1.mjs +1 -0
  52. package/dist/packem_shared/publicMutationWithoutRatelimit-DAxh8tL0.mjs +1 -0
  53. package/dist/packem_shared/{publicTableRlsOptoutConfusion-CbNk75Xo.mjs → publicTableRlsOptoutConfusion-W_jAkKFR.mjs} +1 -1
  54. package/dist/packem_shared/queueWithoutDlq-CF_xUgE_.mjs +1 -0
  55. package/dist/packem_shared/{ratelimitKeySpoofableOrGlobal-DHMl74hR.mjs → ratelimitKeySpoofableOrGlobal-VSGOuu5X.mjs} +1 -1
  56. package/dist/packem_shared/{ratelimitMiddlewareFailOpen-Di2t8pDc.mjs → ratelimitMiddlewareFailOpen-bweBVZ4J.mjs} +1 -1
  57. package/dist/packem_shared/{relationReferencesUnknownField-Cl6mik8w.mjs → relationReferencesUnknownField-hVsgaUKy.mjs} +1 -1
  58. package/dist/packem_shared/rlsUncoveredTable-e2FhD6Nr.mjs +1 -0
  59. package/dist/packem_shared/selfRescheduleWithoutProgress-HoknmezK.mjs +1 -0
  60. package/dist/packem_shared/shapeTargetsGlobalTable-CYRV8OvU.mjs +1 -0
  61. package/dist/packem_shared/shapeUnknownTable-6virkUOz.mjs +1 -0
  62. package/dist/packem_shared/signupMutationWithoutDisposableGating-nopEfEEK.mjs +1 -0
  63. package/dist/packem_shared/sqlInjectionRisk-CSKho3Vk.mjs +1 -0
  64. package/dist/packem_shared/{storageGenerateUploadUrlNoContentTypePin-CrwFuo83.mjs → storageGenerateUploadUrlNoContentTypePin-BlOPGwhZ.mjs} +1 -1
  65. package/dist/packem_shared/{storageKeyFromUserArgs-3vkxmI3v.mjs → storageKeyFromUserArgs-BuoTsz-h.mjs} +1 -1
  66. package/dist/packem_shared/{storagePresignedUrlForPrivateContent-C3KeV5tV.mjs → storagePresignedUrlForPrivateContent-l-EwrAfj.mjs} +1 -1
  67. package/dist/packem_shared/{storageUploadWithoutContentTypeAllowlist-BXoK_QWE.mjs → storageUploadWithoutContentTypeAllowlist-JmITAazT.mjs} +1 -1
  68. package/dist/packem_shared/{storageUploadWithoutMaxSize-CW7uKvSi.mjs → storageUploadWithoutMaxSize-DlhE1I98.mjs} +1 -1
  69. package/dist/packem_shared/sweeps-DYG_FnlQ.mjs +1 -0
  70. package/dist/packem_shared/tableWithoutInsert-DrDVc5Do.mjs +1 -0
  71. package/dist/packem_shared/{ttlFieldNotTimestamp-lnb5nmM6.mjs → ttlFieldNotTimestamp-C8zgHJjp.mjs} +1 -1
  72. package/dist/packem_shared/{unboundedCollectOnOpenRange-DHy2RUL7.mjs → unboundedCollectOnOpenRange-DDGNuKks.mjs} +1 -1
  73. package/dist/packem_shared/{unboundedLoop-DxN3_apu.mjs → unboundedLoop-CUF9Wdxa.mjs} +1 -1
  74. package/dist/packem_shared/userCreatingMutationWithoutCaptcha-8mtYqiGy.mjs +1 -0
  75. package/dist/packem_shared/{vectorsNamespaceFromUserInput-CFa2qhFU.mjs → vectorsNamespaceFromUserInput-537Bt2vT.mjs} +1 -1
  76. package/dist/packem_shared/{workflowUnknownTarget-DEKB5H0g.mjs → workflowUnknownTarget-DdG3cUPH.mjs} +1 -1
  77. package/dist/packem_shared/workflowUnused-CSKRWTd_.mjs +1 -0
  78. package/package.json +1 -1
  79. package/dist/packem_shared/actionWithoutErrorHandling-4GCBT0_z.mjs +0 -1
  80. package/dist/packem_shared/adminRouteWithoutGuard-DPE7LuNh.mjs +0 -1
  81. package/dist/packem_shared/aiRunWithoutLogging-DT665z-w.mjs +0 -1
  82. package/dist/packem_shared/aiUnboundedGenerationPublic-C17h6sMV.mjs +0 -1
  83. package/dist/packem_shared/containerLongSleepAfter-CVvHEGYC.mjs +0 -1
  84. package/dist/packem_shared/containerOversizedInstance-Bx89uR7E.mjs +0 -1
  85. package/dist/packem_shared/containerPublicInternet-BFfZf_P4.mjs +0 -1
  86. package/dist/packem_shared/cronEveryMinute-CtpEAbxs.mjs +0 -1
  87. package/dist/packem_shared/duplicateIndex-Cip6-Rpu.mjs +0 -1
  88. package/dist/packem_shared/errorWithoutCatalog-BTfvaXHR.mjs +0 -1
  89. package/dist/packem_shared/indexUtilization-CkVPZcVe.mjs +0 -1
  90. package/dist/packem_shared/insertManyUnsafeUserData-DWE8d_DF.mjs +0 -1
  91. package/dist/packem_shared/policyReferencesUnknownTable-CIKuRZ5Y.mjs +0 -1
  92. package/dist/packem_shared/privilegedFanoutFromPublicProcedure-DV188gHQ.mjs +0 -1
  93. package/dist/packem_shared/procedureWithoutStructuredEvent-BcOE0mFx.mjs +0 -1
  94. package/dist/packem_shared/publicMutationWithoutRatelimit-Bd-rRxnz.mjs +0 -1
  95. package/dist/packem_shared/queueWithoutDlq-BvHz3Opg.mjs +0 -1
  96. package/dist/packem_shared/rlsUncoveredTable-CZ4ie4gX.mjs +0 -1
  97. package/dist/packem_shared/selfRescheduleWithoutProgress-CQNZI4FA.mjs +0 -1
  98. package/dist/packem_shared/shapeTargetsGlobalTable-Bu3eEDic.mjs +0 -1
  99. package/dist/packem_shared/shapeUnknownTable-CREfNnWi.mjs +0 -1
  100. package/dist/packem_shared/signupMutationWithoutDisposableGating-BdKwtxDP.mjs +0 -1
  101. package/dist/packem_shared/sqlInjectionRisk-BYRllgPV.mjs +0 -1
  102. package/dist/packem_shared/sweeps-JWMwcakB.mjs +0 -1
  103. package/dist/packem_shared/tableWithoutInsert-ClJp_jDr.mjs +0 -1
  104. package/dist/packem_shared/userCreatingMutationWithoutCaptcha-D4TZEpgz.mjs +0 -1
  105. package/dist/packem_shared/workflowUnused-DHwwE-1P.mjs +0 -1
package/dist/index.d.mts CHANGED
@@ -10,6 +10,8 @@ interface AdvisorAdminRoute {
10
10
  exportName: string;
11
11
  /** Source file relative to the lunora dir, no extension. */
12
12
  file: string;
13
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
14
+ line?: number;
13
15
  /** HTTP verb the route binds to (uppercased), e.g. `"POST"`. */
14
16
  method: string;
15
17
  /** The route path, e.g. `/admin/users`. */
@@ -396,6 +398,8 @@ interface AdvisorContainer {
396
398
  enableInternet?: boolean;
397
399
  /** The `lunora/containers.ts` export name, e.g. `transcoder`. */
398
400
  exportName: string;
401
+ /** Lunora-relative module of the declaration, without extension, when the feeder recorded it. */
402
+ file?: string;
399
403
  /** Declared `hardTimeout` value, when a static literal. Caps total lifetime, idle or not. */
400
404
  hardTimeout?: number | string;
401
405
  /** Declared `instanceType`: a named size, or a custom `{ vcpu, memoryMib, diskMb }`. */
@@ -404,6 +408,8 @@ interface AdvisorContainer {
404
408
  memoryMib?: number;
405
409
  vcpu?: number;
406
410
  };
411
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
412
+ line?: number;
407
413
  /** Declared `maxInstances` cap, when present. */
408
414
  maxInstances?: number;
409
415
  /** Declared `sleepAfter` value, when a static literal. */
@@ -444,8 +450,12 @@ interface AdvisorCountRead {
444
450
  interface AdvisorCron {
445
451
  /** The compiled standard five-field cron expression, e.g. `"0 9 * * *"`. */
446
452
  cron: string;
453
+ /** Lunora-relative module of the declaration, without extension, when the feeder recorded it. */
454
+ file?: string;
447
455
  /** The `namespace:fn` the job dispatches; absent when the job starts a workflow. */
448
456
  functionPath?: string;
457
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
458
+ line?: number;
449
459
  /** Unique job name. */
450
460
  name: string;
451
461
  /** Set when each fire starts a workflow instance instead of dispatching a function. */
@@ -704,8 +714,8 @@ interface AdvisorImageDeliveryUrlAccess {
704
714
  }
705
715
  /**
706
716
  * Observed read signal over a table — the input the `index_utilization` runtime
707
- * lint consumes. Produced by the studio backend from each shard's recorded
708
- * metrics.
717
+ * lint consumes. Produced by the studio from the recorded metrics of the shard
718
+ * being inspected.
709
719
  *
710
720
  * `AdvisorTableScan` comes straight from the per-`(function, table)` full-scan
711
721
  * attribution the runtime already records (`__lunora_metrics_scans`, surfaced as
@@ -715,16 +725,17 @@ interface AdvisorImageDeliveryUrlAccess {
715
725
  * `AdvisorIndexHit` is the per-declared-index hit count. The runtime now records
716
726
  * this in the durable `__lunora_metrics_index` table (stamped on every index use
717
727
  * via `onIndexUse`) and surfaces it through the `getMetrics` admin RPC; the
718
- * studio sums the per-shard arrays and feeds them as `context.indexHits`, and the
719
- * lint flags a declared index with zero recorded reads as dead. When the feed is
728
+ * studio passes the counters of the shard being inspected as `context.indexHits`,
729
+ * so an index used only on other shards reads as dead there. The lint flags a
730
+ * declared index with zero recorded reads as dead. When the feed is
720
731
  * absent (a static caller, or a shard that recorded nothing) the dead-index half
721
732
  * is a no-op and only the hot-scan half runs off the scan attribution.
722
733
  */
723
734
  /**
724
735
  * Per-table full-scan volume observed over the window — a read that hit no
725
- * index. Sourced from `FunctionCallStat.scannedTables` aggregated across
726
- * functions and shards. Runtime callers supply this; static callers don't, so
727
- * the hot-scan half of the lint finds nothing there.
736
+ * index. Sourced from `FunctionCallStat.scannedTables` aggregated across the
737
+ * functions of the shard being inspected. Runtime callers supply this; static
738
+ * callers don't, so the hot-scan half of the lint finds nothing there.
728
739
  */
729
740
  interface AdvisorTableScan {
730
741
  /** Total full-scans of `table` over the observed window. */
@@ -1236,6 +1247,8 @@ interface AdvisorProcedureProtection {
1236
1247
  hasEmailArg?: boolean;
1237
1248
  /** Registration kind — `query` is read-only; `mutation`/`action` are write-shaped. */
1238
1249
  kind: "action" | "mutation" | "query";
1250
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1251
+ line?: number;
1239
1252
  /** `true` when the handler reaches an outbound surface (`ctx.fetch`, mail, queues, storage, sql, ai, …) that can fail. */
1240
1253
  reachesOutbound?: boolean;
1241
1254
  /** `true` when the handler runs any AI generation, bounded or not. */
@@ -1392,6 +1405,8 @@ interface AdvisorQueue {
1392
1405
  exportName: string;
1393
1406
  file: string;
1394
1407
  };
1408
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1409
+ line?: number;
1395
1410
  /** How the queue is consumed: `"push"` (a worker `queue()` handler) or `"pull"` (external HTTP). */
1396
1411
  mode: "pull" | "push";
1397
1412
  /**
@@ -1514,6 +1529,8 @@ interface AdvisorRlsProcedure {
1514
1529
  exportName: string;
1515
1530
  /** Source file relative to the lunora dir, no extension. */
1516
1531
  file: string;
1532
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1533
+ line?: number;
1517
1534
  /**
1518
1535
  * Tables explicitly named in the `rls(policies)` array passed to `.use(rls(...))`
1519
1536
  * in this procedure's builder chain. Empty when the policies argument is not a
@@ -1759,6 +1776,8 @@ interface AdvisorShape {
1759
1776
  exportName: string;
1760
1777
  /** File the shape is declared in (relative, for the operator to open). */
1761
1778
  file: string;
1779
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1780
+ line?: number;
1762
1781
  /**
1763
1782
  * The `table` string literal the shape replicates from, or `undefined` when
1764
1783
  * the feeder could not read it as a plain string literal — tier-sensitive
@@ -2010,12 +2029,16 @@ interface AdvisorWorkflowStep {
2010
2029
  interface AdvisorWorkflow {
2011
2030
  /** The `lunora/workflows.ts` export name, e.g. `orderPipeline`. */
2012
2031
  exportName: string;
2032
+ /** Lunora-relative module of the declaration, without extension, when the feeder recorded it. */
2033
+ file?: string;
2013
2034
  /**
2014
2035
  * The file declaring the handler when it is passed by reference from another
2015
2036
  * file (`handler: onboard`) — the file the {@link AdvisorWorkflow.steps} lines
2016
2037
  * are in. Lunora-relative inside `lunora/`, project-relative outside it.
2017
2038
  */
2018
2039
  handlerFile?: string;
2040
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
2041
+ line?: number;
2019
2042
  /**
2020
2043
  * The durable step labels discovered in the handler body, in source order —
2021
2044
  * the duplicate-step-name input. Cloudflare memoizes a step by its name, so a
@@ -2818,8 +2841,8 @@ declare const hotShard: Lint;
2818
2841
  * (`context.indexHits`); a declared index whose recorded `reads` is `0` is dead.
2819
2842
  * The runtime records this in the durable `__lunora_metrics_index` table (every
2820
2843
  * index use stamps a per-`(table, index)` counter via `onIndexUse`) and surfaces
2821
- * it through the `getMetrics` admin RPC; the studio sums the per-shard arrays
2822
- * into `context.indexHits` (see `AdvisorIndexHit`). The counter is cumulative and
2844
+ * it through the `getMetrics` admin RPC; the studio passes the counters of the
2845
+ * shard being inspected as `context.indexHits` (see `AdvisorIndexHit`). The counter is cumulative and
2823
2846
  * never decays, so a non-zero index never reverts to "dead" — `reads: 0` means
2824
2847
  * the index has not been used once since the counter was created.
2825
2848
  *
@@ -4166,9 +4189,9 @@ declare const paymentCreateWithoutAuthorize: Lint;
4166
4189
  *
4167
4190
  * Runs only when the codegen feeder supplies adapter evidence
4168
4191
  * (`context.paymentWebhooks`); a runtime caller flags nothing. Fires only on a
4169
- * statically-known numeric `webhookToleranceSeconds` literal above the ceiling —
4170
- * a computed or env-sourced value is not evaluated, to keep the false-positive
4171
- * rate low. One finding per matching adapter.
4192
+ * statically-known `webhookToleranceSeconds` (a literal or arithmetic over
4193
+ * literals) above the ceiling; an env-sourced value is not evaluated, to keep the
4194
+ * false-positive rate low. One finding per matching adapter.
4172
4195
  */
4173
4196
  declare const paymentWebhookWideTolerance: Lint;
4174
4197
  /**
@@ -4611,15 +4634,13 @@ declare const signupMutationWithoutDisposableGating: Lint;
4611
4634
  */
4612
4635
  declare const softDeleteIncludeDeletedFromArgs: Lint;
4613
4636
  /**
4614
- * Flags a `ctx.sql` tagged-template that splices an unparameterized
4615
- * string-building expression into the query.
4637
+ * Flags a `ctx.sql.query(text, params)` / `ctx.sql.unsafe(text, params)` call whose
4638
+ * `text` is built from a non-constant value.
4616
4639
  *
4617
- * The Hyperdrive `ctx.sql\`…\`` driver binds each `${value}` placeholder as a
4618
- * query parameter — safe by construction. But a placeholder that *builds* a string
4619
- * in place (`ctx.sql\`… ${"WHERE name='" + name + "'"}\``, or a nested template
4620
- * literal) splices raw, attacker-controlled text into the SQL, reopening classic
4621
- * SQL injection. The fix is always to pass the value through a placeholder so the
4622
- * driver parameterizes it.
4640
+ * The driver binds only `params`; `text` runs verbatim, so request input that reaches
4641
+ * the text reopens SQL injection. Codegen's feeder decides what counts as constant
4642
+ * (literals, module consts, fixed joins), so this lint only reports sinks it could not
4643
+ * prove fixed.
4623
4644
  *
4624
4645
  * Runs only when the codegen feeder supplies interpolation evidence
4625
4646
  * (`context.sqlInterpolations`); a runtime caller flags nothing. One finding per
@@ -4753,8 +4774,9 @@ declare const storageUploadWithoutMaxSize: Lint;
4753
4774
  *
4754
4775
  * Using `@lunora/codegen`'s write-side discovery (the analog of the read
4755
4776
  * discovery that feeds `filter_without_index`), this lint cross-references every
4756
- * schema table against the set of tables some exported function writes via
4757
- * `ctx.db.insert("<table>", …)`. A table with no such write either is dead schema
4777
+ * schema table against the set of tables some exported function inserts into, by
4778
+ * `ctx.db.insert("<table>", …)`, the `ctx.db.<table>` facade (`insert`, `insertMany`,
4779
+ * `upsert`, `upsertMany`), or `insertMany`. A table with no such write either is dead schema
4758
4780
  * or is populated through a path the static analysis can't see — a migration/seed,
4759
4781
  * cross-region replication, the `ctx.orm.insert(...)` builder, or a trusted
4760
4782
  * snapshot import. Hence `INFO`/`INTERNAL`: a nudge to confirm intent, not an error.
package/dist/index.d.ts CHANGED
@@ -10,6 +10,8 @@ interface AdvisorAdminRoute {
10
10
  exportName: string;
11
11
  /** Source file relative to the lunora dir, no extension. */
12
12
  file: string;
13
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
14
+ line?: number;
13
15
  /** HTTP verb the route binds to (uppercased), e.g. `"POST"`. */
14
16
  method: string;
15
17
  /** The route path, e.g. `/admin/users`. */
@@ -396,6 +398,8 @@ interface AdvisorContainer {
396
398
  enableInternet?: boolean;
397
399
  /** The `lunora/containers.ts` export name, e.g. `transcoder`. */
398
400
  exportName: string;
401
+ /** Lunora-relative module of the declaration, without extension, when the feeder recorded it. */
402
+ file?: string;
399
403
  /** Declared `hardTimeout` value, when a static literal. Caps total lifetime, idle or not. */
400
404
  hardTimeout?: number | string;
401
405
  /** Declared `instanceType`: a named size, or a custom `{ vcpu, memoryMib, diskMb }`. */
@@ -404,6 +408,8 @@ interface AdvisorContainer {
404
408
  memoryMib?: number;
405
409
  vcpu?: number;
406
410
  };
411
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
412
+ line?: number;
407
413
  /** Declared `maxInstances` cap, when present. */
408
414
  maxInstances?: number;
409
415
  /** Declared `sleepAfter` value, when a static literal. */
@@ -444,8 +450,12 @@ interface AdvisorCountRead {
444
450
  interface AdvisorCron {
445
451
  /** The compiled standard five-field cron expression, e.g. `"0 9 * * *"`. */
446
452
  cron: string;
453
+ /** Lunora-relative module of the declaration, without extension, when the feeder recorded it. */
454
+ file?: string;
447
455
  /** The `namespace:fn` the job dispatches; absent when the job starts a workflow. */
448
456
  functionPath?: string;
457
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
458
+ line?: number;
449
459
  /** Unique job name. */
450
460
  name: string;
451
461
  /** Set when each fire starts a workflow instance instead of dispatching a function. */
@@ -704,8 +714,8 @@ interface AdvisorImageDeliveryUrlAccess {
704
714
  }
705
715
  /**
706
716
  * Observed read signal over a table — the input the `index_utilization` runtime
707
- * lint consumes. Produced by the studio backend from each shard's recorded
708
- * metrics.
717
+ * lint consumes. Produced by the studio from the recorded metrics of the shard
718
+ * being inspected.
709
719
  *
710
720
  * `AdvisorTableScan` comes straight from the per-`(function, table)` full-scan
711
721
  * attribution the runtime already records (`__lunora_metrics_scans`, surfaced as
@@ -715,16 +725,17 @@ interface AdvisorImageDeliveryUrlAccess {
715
725
  * `AdvisorIndexHit` is the per-declared-index hit count. The runtime now records
716
726
  * this in the durable `__lunora_metrics_index` table (stamped on every index use
717
727
  * via `onIndexUse`) and surfaces it through the `getMetrics` admin RPC; the
718
- * studio sums the per-shard arrays and feeds them as `context.indexHits`, and the
719
- * lint flags a declared index with zero recorded reads as dead. When the feed is
728
+ * studio passes the counters of the shard being inspected as `context.indexHits`,
729
+ * so an index used only on other shards reads as dead there. The lint flags a
730
+ * declared index with zero recorded reads as dead. When the feed is
720
731
  * absent (a static caller, or a shard that recorded nothing) the dead-index half
721
732
  * is a no-op and only the hot-scan half runs off the scan attribution.
722
733
  */
723
734
  /**
724
735
  * Per-table full-scan volume observed over the window — a read that hit no
725
- * index. Sourced from `FunctionCallStat.scannedTables` aggregated across
726
- * functions and shards. Runtime callers supply this; static callers don't, so
727
- * the hot-scan half of the lint finds nothing there.
736
+ * index. Sourced from `FunctionCallStat.scannedTables` aggregated across the
737
+ * functions of the shard being inspected. Runtime callers supply this; static
738
+ * callers don't, so the hot-scan half of the lint finds nothing there.
728
739
  */
729
740
  interface AdvisorTableScan {
730
741
  /** Total full-scans of `table` over the observed window. */
@@ -1236,6 +1247,8 @@ interface AdvisorProcedureProtection {
1236
1247
  hasEmailArg?: boolean;
1237
1248
  /** Registration kind — `query` is read-only; `mutation`/`action` are write-shaped. */
1238
1249
  kind: "action" | "mutation" | "query";
1250
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1251
+ line?: number;
1239
1252
  /** `true` when the handler reaches an outbound surface (`ctx.fetch`, mail, queues, storage, sql, ai, …) that can fail. */
1240
1253
  reachesOutbound?: boolean;
1241
1254
  /** `true` when the handler runs any AI generation, bounded or not. */
@@ -1392,6 +1405,8 @@ interface AdvisorQueue {
1392
1405
  exportName: string;
1393
1406
  file: string;
1394
1407
  };
1408
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1409
+ line?: number;
1395
1410
  /** How the queue is consumed: `"push"` (a worker `queue()` handler) or `"pull"` (external HTTP). */
1396
1411
  mode: "pull" | "push";
1397
1412
  /**
@@ -1514,6 +1529,8 @@ interface AdvisorRlsProcedure {
1514
1529
  exportName: string;
1515
1530
  /** Source file relative to the lunora dir, no extension. */
1516
1531
  file: string;
1532
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1533
+ line?: number;
1517
1534
  /**
1518
1535
  * Tables explicitly named in the `rls(policies)` array passed to `.use(rls(...))`
1519
1536
  * in this procedure's builder chain. Empty when the policies argument is not a
@@ -1759,6 +1776,8 @@ interface AdvisorShape {
1759
1776
  exportName: string;
1760
1777
  /** File the shape is declared in (relative, for the operator to open). */
1761
1778
  file: string;
1779
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
1780
+ line?: number;
1762
1781
  /**
1763
1782
  * The `table` string literal the shape replicates from, or `undefined` when
1764
1783
  * the feeder could not read it as a plain string literal — tier-sensitive
@@ -2010,12 +2029,16 @@ interface AdvisorWorkflowStep {
2010
2029
  interface AdvisorWorkflow {
2011
2030
  /** The `lunora/workflows.ts` export name, e.g. `orderPipeline`. */
2012
2031
  exportName: string;
2032
+ /** Lunora-relative module of the declaration, without extension, when the feeder recorded it. */
2033
+ file?: string;
2013
2034
  /**
2014
2035
  * The file declaring the handler when it is passed by reference from another
2015
2036
  * file (`handler: onboard`) — the file the {@link AdvisorWorkflow.steps} lines
2016
2037
  * are in. Lunora-relative inside `lunora/`, project-relative outside it.
2017
2038
  */
2018
2039
  handlerFile?: string;
2040
+ /** 1-based start line of the declaring statement, when the feeder recorded it. */
2041
+ line?: number;
2019
2042
  /**
2020
2043
  * The durable step labels discovered in the handler body, in source order —
2021
2044
  * the duplicate-step-name input. Cloudflare memoizes a step by its name, so a
@@ -2818,8 +2841,8 @@ declare const hotShard: Lint;
2818
2841
  * (`context.indexHits`); a declared index whose recorded `reads` is `0` is dead.
2819
2842
  * The runtime records this in the durable `__lunora_metrics_index` table (every
2820
2843
  * index use stamps a per-`(table, index)` counter via `onIndexUse`) and surfaces
2821
- * it through the `getMetrics` admin RPC; the studio sums the per-shard arrays
2822
- * into `context.indexHits` (see `AdvisorIndexHit`). The counter is cumulative and
2844
+ * it through the `getMetrics` admin RPC; the studio passes the counters of the
2845
+ * shard being inspected as `context.indexHits` (see `AdvisorIndexHit`). The counter is cumulative and
2823
2846
  * never decays, so a non-zero index never reverts to "dead" — `reads: 0` means
2824
2847
  * the index has not been used once since the counter was created.
2825
2848
  *
@@ -4166,9 +4189,9 @@ declare const paymentCreateWithoutAuthorize: Lint;
4166
4189
  *
4167
4190
  * Runs only when the codegen feeder supplies adapter evidence
4168
4191
  * (`context.paymentWebhooks`); a runtime caller flags nothing. Fires only on a
4169
- * statically-known numeric `webhookToleranceSeconds` literal above the ceiling —
4170
- * a computed or env-sourced value is not evaluated, to keep the false-positive
4171
- * rate low. One finding per matching adapter.
4192
+ * statically-known `webhookToleranceSeconds` (a literal or arithmetic over
4193
+ * literals) above the ceiling; an env-sourced value is not evaluated, to keep the
4194
+ * false-positive rate low. One finding per matching adapter.
4172
4195
  */
4173
4196
  declare const paymentWebhookWideTolerance: Lint;
4174
4197
  /**
@@ -4611,15 +4634,13 @@ declare const signupMutationWithoutDisposableGating: Lint;
4611
4634
  */
4612
4635
  declare const softDeleteIncludeDeletedFromArgs: Lint;
4613
4636
  /**
4614
- * Flags a `ctx.sql` tagged-template that splices an unparameterized
4615
- * string-building expression into the query.
4637
+ * Flags a `ctx.sql.query(text, params)` / `ctx.sql.unsafe(text, params)` call whose
4638
+ * `text` is built from a non-constant value.
4616
4639
  *
4617
- * The Hyperdrive `ctx.sql\`…\`` driver binds each `${value}` placeholder as a
4618
- * query parameter — safe by construction. But a placeholder that *builds* a string
4619
- * in place (`ctx.sql\`… ${"WHERE name='" + name + "'"}\``, or a nested template
4620
- * literal) splices raw, attacker-controlled text into the SQL, reopening classic
4621
- * SQL injection. The fix is always to pass the value through a placeholder so the
4622
- * driver parameterizes it.
4640
+ * The driver binds only `params`; `text` runs verbatim, so request input that reaches
4641
+ * the text reopens SQL injection. Codegen's feeder decides what counts as constant
4642
+ * (literals, module consts, fixed joins), so this lint only reports sinks it could not
4643
+ * prove fixed.
4623
4644
  *
4624
4645
  * Runs only when the codegen feeder supplies interpolation evidence
4625
4646
  * (`context.sqlInterpolations`); a runtime caller flags nothing. One finding per
@@ -4753,8 +4774,9 @@ declare const storageUploadWithoutMaxSize: Lint;
4753
4774
  *
4754
4775
  * Using `@lunora/codegen`'s write-side discovery (the analog of the read
4755
4776
  * discovery that feeds `filter_without_index`), this lint cross-references every
4756
- * schema table against the set of tables some exported function writes via
4757
- * `ctx.db.insert("<table>", …)`. A table with no such write either is dead schema
4777
+ * schema table against the set of tables some exported function inserts into, by
4778
+ * `ctx.db.insert("<table>", …)`, the `ctx.db.<table>` facade (`insert`, `insertMany`,
4779
+ * `upsert`, `upsertMany`), or `insertMany`. A table with no such write either is dead schema
4758
4780
  * or is populated through a path the static analysis can't see — a migration/seed,
4759
4781
  * cross-region replication, the `ctx.orm.insert(...)` builder, or a trusted
4760
4782
  * snapshot import. Hence `INFO`/`INTERNAL`: a nudge to confirm intent, not an error.
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{dedupeCacheKeys as c}from"./packem_shared/dedupeCacheKeys-DtBOHffV.mjs";import d from"./packem_shared/fanOutBreadth-CBtmZnoh.mjs";import u from"./packem_shared/hotShard-BwGYZ3Tq.mjs";import h from"./packem_shared/indexUtilization-CkVPZcVe.mjs";import g from"./packem_shared/actionFetchSsrf-BK-kvOPO.mjs";import b from"./packem_shared/actionWithoutErrorHandling-4GCBT0_z.mjs";import y from"./packem_shared/adminRouteWithoutGuard-DPE7LuNh.mjs";import S from"./packem_shared/aiRawRunEscapeHatch-BW7a8kZC.mjs";import w from"./packem_shared/aiRunWithoutLogging-DT665z-w.mjs";import v from"./packem_shared/aiToolSideEffectPromptInjection-9eJXRlKt.mjs";import A from"./packem_shared/aiUnboundedGenerationPublic-C17h6sMV.mjs";import R from"./packem_shared/allowUnauthenticatedShardAccessEnabled-BQufF5Kb.mjs";import U from"./packem_shared/authApiCallWithoutHeaders-CReJRsGW.mjs";import W from"./packem_shared/authCsrfCheckDisabled-CRIVsvb9.mjs";import I from"./packem_shared/authEmailVerificationDisabled-BjFlnHr2.mjs";import T from"./packem_shared/authScimWithoutTransactions-B5ATiz5A.mjs";import x from"./packem_shared/authSecureCookiesDisabled-By8PVum3.mjs";import C from"./packem_shared/authSessionFreshageZero-DuxX3Ln9.mjs";import k from"./packem_shared/authTrustedOriginsWildcard-BKIh6788.mjs";import N from"./packem_shared/browserAllowPrivateTargets-Cj5sizhv.mjs";import F from"./packem_shared/browserUserUrlWithoutAllowlist-CzDEraJB.mjs";import M from"./packem_shared/circularFk-DtcWFJxK.mjs";import O from"./packem_shared/commitOrderedHardDelete-BPdwOKA7.mjs";import D from"./packem_shared/containerInstanceKeyFromUserInput-Bl-tAzKV.mjs";import E from"./packem_shared/containerLongSleepAfter-CVvHEGYC.mjs";import P from"./packem_shared/containerOversizedInstance-Bx89uR7E.mjs";import $ from"./packem_shared/containerPublicInternet-BFfZf_P4.mjs";import q from"./packem_shared/containerRuntimeEgressRelaxation-4tMrhq1k.mjs";import L from"./packem_shared/containerStartEnableInternetOverride-mN_kuRtk.mjs";import K from"./packem_shared/countWithoutIndex-DjQFNBrw.mjs";import G from"./packem_shared/cronEveryMinute-CtpEAbxs.mjs";import _ from"./packem_shared/crossModuleTableWrite-DjiVTAwK.mjs";import z from"./packem_shared/dispatchCycle-BwuXRDiL.mjs";import H from"./packem_shared/duplicateIndex-Cip6-Rpu.mjs";import B from"./packem_shared/emptyIndex-BnHDcXza.mjs";import j from"./packem_shared/errorWithoutCatalog-BTfvaXHR.mjs";import V from"./packem_shared/exportSinkMisconfigured-JfbAx9AI.mjs";import Q from"./packem_shared/externalSourceIncrementalNoDeletePath-BCzm3HzF.mjs";import X from"./packem_shared/externalSourceOnGlobal-CH7xbJ49.mjs";import Z from"./packem_shared/externalSourceUnscoped-BxU2uSXk.mjs";import J from"./packem_shared/filterAfterIndexScan-CV8aPq7v.mjs";import Y from"./packem_shared/filterOnPrimaryKey-CAhFiqp_.mjs";import oo from"./packem_shared/filterWithoutIndex-BGv3jbgg.mjs";import eo from"./packem_shared/flagGatesSecurityWithUnsafeDefault-B5FBDF8c.mjs";import ro from"./packem_shared/flagReadInSubscription-DabIhYGD.mjs";import to from"./packem_shared/geoIndexFieldNotGeopoint-BMQuok2-.mjs";import io from"./packem_shared/geoIndexUnused-D7C9Qr4U.mjs";import no from"./packem_shared/globalTableNearColumnLimit-BFbBBd6A.mjs";import ao from"./packem_shared/hardcodedSecret-Bw_4FYrs.mjs";import mo from"./packem_shared/httpActionMissingAuthGuard-DhMIs1EI.mjs";import lo from"./packem_shared/httpActionResponseHeaderInjection-mcRYd3Zw.mjs";import so from"./packem_shared/hyperdriveOutsideAction-CPDdGP2g.mjs";import po from"./packem_shared/identityUndeclaredClaimTrusted-D1sEd5lr.mjs";import fo from"./packem_shared/imagesUrlSourceFromUserInput-BJXotuyO.mjs";import co from"./packem_shared/indexReferencesUnknownField-DKz4-bla.mjs";import uo from"./packem_shared/insertManyUnsafeUserData-DWE8d_DF.mjs";import ho from"./packem_shared/kvUnscopedUserKeyIdor-DhymglIq.mjs";import go from"./packem_shared/mailInboundDispatchWithoutVerify-CWwqXyPX.mjs";import bo from"./packem_shared/mailRecipientFromRequestInput-BVXsZ4Xf.mjs";import yo from"./packem_shared/maskUncoveredPiiColumn-axEka4nd.mjs";import So from"./packem_shared/maskWeakHashStrategyOnPii-DJasagzX.mjs";import wo from"./packem_shared/maskedRelationLeakViaWith-CIFij6vE.mjs";import{e as a}from"./packem_shared/finding-NrKO8idM.mjs";import vo from"./packem_shared/mutatorFullRowReplace-NuqUCVOI.mjs";import Ao from"./packem_shared/mutatorWithoutOwnerScope-BoS81ns0.mjs";import Ro from"./packem_shared/nondeterministicQueryMutation-DA_Lq_IE.mjs";import Uo from"./packem_shared/normalizeIdUsedAsAuthorization-BXN-Can6.mjs";import Wo from"./packem_shared/notifyMissingPushConfig-BYks8FAs.mjs";import Io from"./packem_shared/notifySendOutsideAction-BJrDkr4h.mjs";import To from"./packem_shared/openShardAccess-CVMAgmmY.mjs";import xo from"./packem_shared/outputProjectionMissingOnPublicRead-DWSeo7oC.mjs";import Co from"./packem_shared/ownerFieldFromArgsNotAuth-J8Xbz5uI.mjs";import ko from"./packem_shared/paymentCreateWithoutAuthorize-CdenWpXD.mjs";import No from"./packem_shared/paymentWebhookWideTolerance-DVhJB0Ip.mjs";import Fo from"./packem_shared/plaintextSecretInWranglerVariables-bNkqmNqV.mjs";import Mo from"./packem_shared/policyReferencesUnknownTable-CIKuRZ5Y.mjs";import Oo from"./packem_shared/privilegedDispatchUnvalidatedPayload-BM3NtT57.mjs";import Do from"./packem_shared/privilegedFanoutFromPublicProcedure-DV188gHQ.mjs";import Eo from"./packem_shared/procedureWithoutStructuredEvent-BcOE0mFx.mjs";import Po from"./packem_shared/publicArgumentUsesAny-BDEvMA8Q.mjs";import $o from"./packem_shared/publicMutationWithoutRatelimit-Bd-rRxnz.mjs";import qo from"./packem_shared/publicTableRlsOptoutConfusion-CbNk75Xo.mjs";import Lo from"./packem_shared/queueDispatchCycle-84yt1IR-.mjs";import Ko from"./packem_shared/queueWithoutDlq-BvHz3Opg.mjs";import Go from"./packem_shared/r2sqlOutsideAction-BdLiLOAX.mjs";import _o from"./packem_shared/ratelimitDefaultMemoryStore-Dj0Kk7t9.mjs";import zo from"./packem_shared/ratelimitKeySpoofableOrGlobal-DHMl74hR.mjs";import Ho from"./packem_shared/ratelimitMiddlewareFailOpen-Di2t8pDc.mjs";import Bo from"./packem_shared/relationReferencesUnknownField-Cl6mik8w.mjs";import jo from"./packem_shared/relationReferencesUnknownTable-vYjirSxf.mjs";import Vo from"./packem_shared/rlsUncoveredTable-CZ4ie4gX.mjs";import Qo from"./packem_shared/selfRescheduleWithoutProgress-CQNZI4FA.mjs";import Xo from"./packem_shared/shapeTargetsGlobalTable-Bu3eEDic.mjs";import Zo from"./packem_shared/shapeUnknownTable-CREfNnWi.mjs";import Jo from"./packem_shared/signupMutationWithoutDisposableGating-BdKwtxDP.mjs";import Yo from"./packem_shared/softDeleteIncludeDeletedFromArgs-C7Ugg4zb.mjs";import oe from"./packem_shared/sqlInjectionRisk-BYRllgPV.mjs";import ee from"./packem_shared/storageGenerateUploadUrlNoContentTypePin-CrwFuo83.mjs";import re from"./packem_shared/storageKeyFromUserArgs-3vkxmI3v.mjs";import te from"./packem_shared/storagePresignedUrlForPrivateContent-C3KeV5tV.mjs";import ie from"./packem_shared/storageUploadWithoutContentTypeAllowlist-BXoK_QWE.mjs";import ne from"./packem_shared/storageUploadWithoutMaxSize-CW7uKvSi.mjs";import ae from"./packem_shared/tableWithoutInsert-ClJp_jDr.mjs";import me from"./packem_shared/throughRelationMissingUniqueIndex-Cg5e3GkS.mjs";import le from"./packem_shared/topicTooManySubscriptions-CiZhFm9r.mjs";import se from"./packem_shared/ttlFieldNotTimestamp-lnb5nmM6.mjs";import{s as pe,q as fe,c as ce}from"./packem_shared/helpers-DdZ_pyR3.mjs";import de from"./packem_shared/unboundedCollectOnOpenRange-DHy2RUL7.mjs";import ue from"./packem_shared/unboundedLoop-DxN3_apu.mjs";import he from"./packem_shared/unboundedStringArgument-jZnCbwB0.mjs";import ge from"./packem_shared/unindexedForeignKey-Dypgn8uH.mjs";import be from"./packem_shared/unindexedRelationTarget-Dj2_NOCm.mjs";import ye from"./packem_shared/unrestrictedWhereBranch-CcIBmHik.mjs";import Se from"./packem_shared/userCreatingMutationWithoutCaptcha-D4TZEpgz.mjs";import we from"./packem_shared/vectorsNamespaceFromUserInput-CFa2qhFU.mjs";import ve from"./packem_shared/workflowDuplicateStepName-B6eAJzwA.mjs";import Ae from"./packem_shared/workflowUnknownTarget-DEKB5H0g.mjs";import Re from"./packem_shared/workflowUnused-DHwwE-1P.mjs";import{callSiteCallers as _t,callSiteDescription as zt,callSiteLabel as Ht,callSiteMetadata as Bt,helperRole as jt,isReachableSite as Vt,readCallSiteCallers as Qt}from"./packem_shared/callSiteCallers-DArHfQSU.mjs";import{compareToBaseline as Zt,parseAdvisorMap as Jt}from"./packem_shared/compareToBaseline-CUG59IOy.mjs";import{gradeFromScore as oi}from"./packem_shared/gradeFromScore-KSt58rj1.mjs";import{MAP_VERSION as ri,byCodepoint as ti,scoreAdvisor as ii}from"./packem_shared/MAP_VERSION-MQ5W2B6n.mjs";import{default as ai}from"./packem_shared/classifySensitivity-JnjaTGYi.mjs";import{fromServerSchema as li}from"./packem_shared/fromServerSchema-KWJd4PLE.mjs";const Ue={convex:"migrating/from-convex",firebase:"migrating/from-firebase",supabase:"migrating/from-supabase"},m={categories:["SCHEMA"],description:"A migrated-away platform's SDK is still imported from `lunora/` source. The code compiles and typechecks, so a half-finished port keeps reading from the old platform at runtime and the two stores silently drift apart.",facing:"INTERNAL",level:"WARN",name:"migration_stale_import",remediation:"Replace the call with its Lunora equivalent and drop the dependency. If the import is deliberate — a second data source you still read from — move it out of `lunora/` so it is not mistaken for an unfinished migration.",run:r=>r.staleMigrationImports===void 0?[]:r.staleMigrationImports.map(o=>a(m,{cacheKey:`migration_stale_import:${o.file}:${o.line.toString()}:${o.moduleSpecifier}`,detail:`\`${o.file}\` (line ${o.line.toString()}) still imports \`${o.moduleSpecifier}\`. Finish the port — see \`${Ue[o.platform]}\` — or move the import out of \`lunora/\` if you genuinely still read from ${o.platform}.`,metadata:{file:o.file,line:o.line,moduleSpecifier:o.moduleSpecifier,platform:o.platform}})),source:"static",title:"Stale migration import"},We=new Map([["global",{level:"WARN",scope:r=>`it reads the whole D1 table "${r}" over a cross-region round trip`}],["root",{level:"WARN",scope:r=>`it loads every row of "${r}" from the root Durable Object's SQLite into memory`}],["shardBy",{level:"INFO",scope:r=>`"${r}" is \`.shardBy()\`, so this collects one shard's rows rather than the whole table — bounded by a single tenant's row count`}]]),Ie={level:"WARN",scope:r=>`it loads every row of "${r}"`},l={categories:["PERFORMANCE"],description:"A query calls `.collect()` with no `.withIndex()` and no `.filter()`, so it materializes every row of the table. Any live subscription over it also re-sends that whole result to every subscribed client on every write to the table.",facing:"EXTERNAL",level:"WARN",name:"unbounded_collect",remediation:'Narrow the read with `.withIndex("name", (q) => q.eq(...))`, cap it with `.take(n)`, or page it with `.paginate(args.paginationOpts)` so neither the scan nor the subscription payload grows with the table.',run:r=>{const o=[],i=pe(r.schema);for(const e of r.queries??[]){if(e.terminal!=="collect"||e.hasIndex||e.table===""||e.hasFilter)continue;const t=i.get(e.table),{level:n,scope:s}=We.get(t??"")??Ie,p=fe(e),f=n==="WARN"?` A live subscription over this query records a whole-table dependency, so every write to "${e.table}" re-runs it and re-sends the full result to each subscribed socket.`:" Cap it with `.take(n)` if that count can grow.";o.push(a(l,{cacheKey:`unbounded_collect:${e.file}:${e.line.toString()}:${e.table}`,detail:`Query on "${e.table}" at ${p} calls .collect() with no index and no filter — ${s(e.table)}.${f}`,level:n,metadata:{...ce(e),shardKind:t??"unknown",table:e.table}}))}return o},source:"static",title:"Unbounded collect"},Te=[co,jo,Bo,Ae,ve,Zo,Q,X,Z,B,no,j,to,io,V,se,O,M,K,_,ge,be,me,H,ae,Re,Lo,Ko,G,le,Y,oo,J,l,de,ue,z,Qo,Xo,vo,Ao,Ro,so,Go,U,Mo,Vo,yo,So,E,P,$,$o,ye,Se,Jo,Po,he,ao,oe,y,ko,go,_o,N,Do,Eo,uo,A,g,b,Co,re,ho,D,S,w,we,bo,F,Oo,L,q,T,k,W,x,I,C,fo,zo,qo,R,To,ie,ne,ee,te,mo,lo,Ho,eo,ro,v,po,No,Yo,wo,xo,Uo,Io,Wo,Fo,m],xe=[u,h,d],Ce=[...Te,...xe],Lt=(r,o={})=>{const i=o.lints??Ce,e=[];for(const t of i)o.source!==void 0&&t.source!==o.source||e.push(...t.run(r));return c(e)};export{Ce as ALL_LINTS,ri as MAP_VERSION,xe as RUNTIME_LINTS,Te as STATIC_LINTS,g as actionFetchSsrf,b as actionWithoutErrorHandling,y as adminRouteWithoutGuard,S as aiRawRunEscapeHatch,w as aiRunWithoutLogging,v as aiToolSideEffectPromptInjection,A as aiUnboundedGenerationPublic,R as allowUnauthenticatedShardAccessEnabled,U as authApiCallWithoutHeaders,W as authCsrfCheckDisabled,I as authEmailVerificationDisabled,T as authScimWithoutTransactions,x as authSecureCookiesDisabled,C as authSessionFreshageZero,k as authTrustedOriginsWildcard,N as browserAllowPrivateTargets,F as browserUserUrlWithoutAllowlist,ti as byCodepoint,_t as callSiteCallers,zt as callSiteDescription,Ht as callSiteLabel,Bt as callSiteMetadata,M as circularFk,ai as classifySensitivity,O as commitOrderedHardDelete,Zt as compareToBaseline,D as containerInstanceKeyFromUserInput,E as containerLongSleepAfter,P as containerOversizedInstance,$ as containerPublicInternet,q as containerRuntimeEgressRelaxation,L as containerStartEnableInternetOverride,K as countWithoutIndex,G as cronEveryMinute,_ as crossModuleTableWrite,c as dedupeCacheKeys,z as dispatchCycle,H as duplicateIndex,B as emptyIndex,j as errorWithoutCatalog,V as exportSinkMisconfigured,Q as externalSourceIncrementalNoDeletePath,X as externalSourceOnGlobal,Z as externalSourceUnscoped,d as fanOutBreadth,J as filterAfterIndexScan,Y as filterOnPrimaryKey,oo as filterWithoutIndex,eo as flagGatesSecurityWithUnsafeDefault,ro as flagReadInSubscription,li as fromServerSchema,to as geoIndexFieldNotGeopoint,io as geoIndexUnused,no as globalTableNearColumnLimit,oi as gradeFromScore,ao as hardcodedSecret,jt as helperRole,u as hotShard,mo as httpActionMissingAuthGuard,lo as httpActionResponseHeaderInjection,so as hyperdriveOutsideAction,po as identityUndeclaredClaimTrusted,fo as imagesUrlSourceFromUserInput,co as indexReferencesUnknownField,h as indexUtilization,uo as insertManyUnsafeUserData,Vt as isReachableSite,ho as kvUnscopedUserKeyIdor,go as mailInboundDispatchWithoutVerify,bo as mailRecipientFromRequestInput,yo as maskUncoveredPiiColumn,So as maskWeakHashStrategyOnPii,wo as maskedRelationLeakViaWith,vo as mutatorFullRowReplace,Ao as mutatorWithoutOwnerScope,Ro as nondeterministicQueryMutation,Uo as normalizeIdUsedAsAuthorization,Wo as notifyMissingPushConfig,Io as notifySendOutsideAction,To as openShardAccess,xo as outputProjectionMissingOnPublicRead,Co as ownerFieldFromArgsNotAuth,Jt as parseAdvisorMap,ko as paymentCreateWithoutAuthorize,No as paymentWebhookWideTolerance,Fo as plaintextSecretInWranglerVariables,Mo as policyReferencesUnknownTable,Oo as privilegedDispatchUnvalidatedPayload,Do as privilegedFanoutFromPublicProcedure,Eo as procedureWithoutStructuredEvent,Po as publicArgumentUsesAny,$o as publicMutationWithoutRatelimit,qo as publicTableRlsOptoutConfusion,Lo as queueDispatchCycle,Ko as queueWithoutDlq,Go as r2sqlOutsideAction,_o as ratelimitDefaultMemoryStore,zo as ratelimitKeySpoofableOrGlobal,Ho as ratelimitMiddlewareFailOpen,Qt as readCallSiteCallers,Bo as relationReferencesUnknownField,jo as relationReferencesUnknownTable,Vo as rlsUncoveredTable,Lt as runAdvisor,ii as scoreAdvisor,Qo as selfRescheduleWithoutProgress,Xo as shapeTargetsGlobalTable,Zo as shapeUnknownTable,Jo as signupMutationWithoutDisposableGating,Yo as softDeleteIncludeDeletedFromArgs,oe as sqlInjectionRisk,ee as storageGenerateUploadUrlNoContentTypePin,re as storageKeyFromUserArgs,te as storagePresignedUrlForPrivateContent,ie as storageUploadWithoutContentTypeAllowlist,ne as storageUploadWithoutMaxSize,ae as tableWithoutInsert,me as throughRelationMissingUniqueIndex,le as topicTooManySubscriptions,se as ttlFieldNotTimestamp,de as unboundedCollectOnOpenRange,ue as unboundedLoop,he as unboundedStringArgument,ge as unindexedForeignKey,be as unindexedRelationTarget,ye as unrestrictedWhereBranch,Se as userCreatingMutationWithoutCaptcha,we as vectorsNamespaceFromUserInput,ve as workflowDuplicateStepName,Ae as workflowUnknownTarget,Re as workflowUnused};
1
+ import{dedupeCacheKeys as c}from"./packem_shared/dedupeCacheKeys-DtBOHffV.mjs";import d from"./packem_shared/fanOutBreadth-CBtmZnoh.mjs";import u from"./packem_shared/hotShard-BwGYZ3Tq.mjs";import h from"./packem_shared/indexUtilization-CmtN9-HA.mjs";import g from"./packem_shared/actionFetchSsrf-B7FqsLWm.mjs";import b from"./packem_shared/actionWithoutErrorHandling-DK3rB5c-.mjs";import y from"./packem_shared/adminRouteWithoutGuard-CcdlN75o.mjs";import S from"./packem_shared/aiRawRunEscapeHatch-CzIaQf_v.mjs";import w from"./packem_shared/aiRunWithoutLogging-Ct5MeKWe.mjs";import v from"./packem_shared/aiToolSideEffectPromptInjection-Ck_h8tFx.mjs";import A from"./packem_shared/aiUnboundedGenerationPublic-CzF3xBc3.mjs";import R from"./packem_shared/allowUnauthenticatedShardAccessEnabled-BQufF5Kb.mjs";import U from"./packem_shared/authApiCallWithoutHeaders-9PpziIB9.mjs";import T from"./packem_shared/authCsrfCheckDisabled-DYTzZFpp.mjs";import W from"./packem_shared/authEmailVerificationDisabled-OiNes7Dz.mjs";import I from"./packem_shared/authScimWithoutTransactions-CajXH24D.mjs";import x from"./packem_shared/authSecureCookiesDisabled-CA5zyqDZ.mjs";import C from"./packem_shared/authSessionFreshageZero-C3IYlYft.mjs";import N from"./packem_shared/authTrustedOriginsWildcard-661FRsGe.mjs";import k from"./packem_shared/browserAllowPrivateTargets-Cj5sizhv.mjs";import F from"./packem_shared/browserUserUrlWithoutAllowlist-Bi5ZWTF7.mjs";import M from"./packem_shared/circularFk-DtcWFJxK.mjs";import O from"./packem_shared/commitOrderedHardDelete-BPdwOKA7.mjs";import $ from"./packem_shared/containerInstanceKeyFromUserInput-DHQ2JL4x.mjs";import E from"./packem_shared/containerLongSleepAfter-DSGnfpfl.mjs";import D from"./packem_shared/containerOversizedInstance-INKmy3-D.mjs";import P from"./packem_shared/containerPublicInternet-Csh5_RwX.mjs";import L from"./packem_shared/containerRuntimeEgressRelaxation-J6rpfvr8.mjs";import q from"./packem_shared/containerStartEnableInternetOverride-Bxbmrpwe.mjs";import K from"./packem_shared/countWithoutIndex-CTbdpLyE.mjs";import _ from"./packem_shared/cronEveryMinute-BjdRdTEz.mjs";import G from"./packem_shared/crossModuleTableWrite-DjiVTAwK.mjs";import z from"./packem_shared/dispatchCycle-BwuXRDiL.mjs";import H from"./packem_shared/duplicateIndex-BJI90Cnj.mjs";import B from"./packem_shared/emptyIndex-BnHDcXza.mjs";import j from"./packem_shared/errorWithoutCatalog-Dib0sdSD.mjs";import V from"./packem_shared/exportSinkMisconfigured-JfbAx9AI.mjs";import Q from"./packem_shared/externalSourceIncrementalNoDeletePath-BCzm3HzF.mjs";import X from"./packem_shared/externalSourceOnGlobal-CH7xbJ49.mjs";import Z from"./packem_shared/externalSourceUnscoped-BxU2uSXk.mjs";import J from"./packem_shared/filterAfterIndexScan-BTHjxkNi.mjs";import Y from"./packem_shared/filterOnPrimaryKey-DeRYfLa7.mjs";import ee from"./packem_shared/filterWithoutIndex-8VrXwbq5.mjs";import oe from"./packem_shared/flagGatesSecurityWithUnsafeDefault-CJK9sKcH.mjs";import re from"./packem_shared/flagReadInSubscription-DabIhYGD.mjs";import te from"./packem_shared/geoIndexFieldNotGeopoint-Cx_9INob.mjs";import ie from"./packem_shared/geoIndexUnused-D7C9Qr4U.mjs";import ne from"./packem_shared/globalTableNearColumnLimit-BFbBBd6A.mjs";import ae from"./packem_shared/hardcodedSecret-Bw_4FYrs.mjs";import me from"./packem_shared/httpActionMissingAuthGuard-D58Vnjr0.mjs";import se from"./packem_shared/httpActionResponseHeaderInjection-Yn1pbKZ8.mjs";import le from"./packem_shared/hyperdriveOutsideAction-CPDdGP2g.mjs";import pe from"./packem_shared/identityUndeclaredClaimTrusted-Z-9ob8F2.mjs";import fe from"./packem_shared/imagesUrlSourceFromUserInput-a2CZ-Xnj.mjs";import ce from"./packem_shared/indexReferencesUnknownField-CV8STvk0.mjs";import de from"./packem_shared/insertManyUnsafeUserData-CSvy65sr.mjs";import ue from"./packem_shared/kvUnscopedUserKeyIdor-D0O2alyn.mjs";import he from"./packem_shared/mailInboundDispatchWithoutVerify-CWwqXyPX.mjs";import ge from"./packem_shared/mailRecipientFromRequestInput-BMrAJjNK.mjs";import be from"./packem_shared/maskUncoveredPiiColumn-axEka4nd.mjs";import ye from"./packem_shared/maskWeakHashStrategyOnPii-CwgAXFSx.mjs";import Se from"./packem_shared/maskedRelationLeakViaWith-CIFij6vE.mjs";import{e as a}from"./packem_shared/finding-NrKO8idM.mjs";import we from"./packem_shared/mutatorFullRowReplace-NuqUCVOI.mjs";import ve from"./packem_shared/mutatorWithoutOwnerScope-BoS81ns0.mjs";import Ae from"./packem_shared/nondeterministicQueryMutation-DA_Lq_IE.mjs";import Re from"./packem_shared/normalizeIdUsedAsAuthorization-BXN-Can6.mjs";import Ue from"./packem_shared/notifyMissingPushConfig-BYks8FAs.mjs";import Te from"./packem_shared/notifySendOutsideAction-BJrDkr4h.mjs";import We from"./packem_shared/openShardAccess-CVMAgmmY.mjs";import Ie from"./packem_shared/outputProjectionMissingOnPublicRead-BPS-eg2q.mjs";import xe from"./packem_shared/ownerFieldFromArgsNotAuth-BmKLZxrX.mjs";import Ce from"./packem_shared/paymentCreateWithoutAuthorize-CdenWpXD.mjs";import Ne from"./packem_shared/paymentWebhookWideTolerance-D9i3Vb1n.mjs";import ke from"./packem_shared/plaintextSecretInWranglerVariables-bNkqmNqV.mjs";import Fe from"./packem_shared/policyReferencesUnknownTable-DiQYFRFY.mjs";import Me from"./packem_shared/privilegedDispatchUnvalidatedPayload-BJL0JNzG.mjs";import Oe from"./packem_shared/privilegedFanoutFromPublicProcedure-Byw3Prsi.mjs";import $e from"./packem_shared/procedureWithoutStructuredEvent-na08a0M1.mjs";import Ee from"./packem_shared/publicArgumentUsesAny-BDEvMA8Q.mjs";import De from"./packem_shared/publicMutationWithoutRatelimit-DAxh8tL0.mjs";import Pe from"./packem_shared/publicTableRlsOptoutConfusion-W_jAkKFR.mjs";import Le from"./packem_shared/queueDispatchCycle-84yt1IR-.mjs";import qe from"./packem_shared/queueWithoutDlq-CF_xUgE_.mjs";import Ke from"./packem_shared/r2sqlOutsideAction-BdLiLOAX.mjs";import _e from"./packem_shared/ratelimitDefaultMemoryStore-Dj0Kk7t9.mjs";import Ge from"./packem_shared/ratelimitKeySpoofableOrGlobal-VSGOuu5X.mjs";import ze from"./packem_shared/ratelimitMiddlewareFailOpen-bweBVZ4J.mjs";import He from"./packem_shared/relationReferencesUnknownField-hVsgaUKy.mjs";import Be from"./packem_shared/relationReferencesUnknownTable-vYjirSxf.mjs";import je from"./packem_shared/rlsUncoveredTable-e2FhD6Nr.mjs";import Ve from"./packem_shared/selfRescheduleWithoutProgress-HoknmezK.mjs";import Qe from"./packem_shared/shapeTargetsGlobalTable-CYRV8OvU.mjs";import Xe from"./packem_shared/shapeUnknownTable-6virkUOz.mjs";import Ze from"./packem_shared/signupMutationWithoutDisposableGating-nopEfEEK.mjs";import Je from"./packem_shared/softDeleteIncludeDeletedFromArgs-C7Ugg4zb.mjs";import Ye from"./packem_shared/sqlInjectionRisk-CSKho3Vk.mjs";import eo from"./packem_shared/storageGenerateUploadUrlNoContentTypePin-BlOPGwhZ.mjs";import oo from"./packem_shared/storageKeyFromUserArgs-BuoTsz-h.mjs";import ro from"./packem_shared/storagePresignedUrlForPrivateContent-l-EwrAfj.mjs";import to from"./packem_shared/storageUploadWithoutContentTypeAllowlist-JmITAazT.mjs";import io from"./packem_shared/storageUploadWithoutMaxSize-DlhE1I98.mjs";import no from"./packem_shared/tableWithoutInsert-DrDVc5Do.mjs";import ao from"./packem_shared/throughRelationMissingUniqueIndex-Cg5e3GkS.mjs";import mo from"./packem_shared/topicTooManySubscriptions-CiZhFm9r.mjs";import so from"./packem_shared/ttlFieldNotTimestamp-C8zgHJjp.mjs";import{s as lo,q as po,c as fo}from"./packem_shared/helpers-YAAwOBMH.mjs";import co from"./packem_shared/unboundedCollectOnOpenRange-DDGNuKks.mjs";import uo from"./packem_shared/unboundedLoop-CUF9Wdxa.mjs";import ho from"./packem_shared/unboundedStringArgument-jZnCbwB0.mjs";import go from"./packem_shared/unindexedForeignKey-Dypgn8uH.mjs";import bo from"./packem_shared/unindexedRelationTarget-Dj2_NOCm.mjs";import yo from"./packem_shared/unrestrictedWhereBranch-CcIBmHik.mjs";import So from"./packem_shared/userCreatingMutationWithoutCaptcha-8mtYqiGy.mjs";import wo from"./packem_shared/vectorsNamespaceFromUserInput-537Bt2vT.mjs";import vo from"./packem_shared/workflowDuplicateStepName-B6eAJzwA.mjs";import Ao from"./packem_shared/workflowUnknownTarget-DdG3cUPH.mjs";import Ro from"./packem_shared/workflowUnused-CSKRWTd_.mjs";import{callSiteCallers as Gt,callSiteDescription as zt,callSiteLabel as Ht,callSiteMetadata as Bt,helperRole as jt,isReachableSite as Vt,readCallSiteCallers as Qt}from"./packem_shared/callSiteCallers-DArHfQSU.mjs";import{compareToBaseline as Zt,parseAdvisorMap as Jt}from"./packem_shared/compareToBaseline-CUG59IOy.mjs";import{gradeFromScore as ei}from"./packem_shared/gradeFromScore-KSt58rj1.mjs";import{MAP_VERSION as ri,byCodepoint as ti,scoreAdvisor as ii}from"./packem_shared/MAP_VERSION-MQ5W2B6n.mjs";import{default as ai}from"./packem_shared/classifySensitivity-JnjaTGYi.mjs";import{fromServerSchema as si}from"./packem_shared/fromServerSchema-KWJd4PLE.mjs";const Uo={convex:"migrating/from-convex",firebase:"migrating/from-firebase",supabase:"migrating/from-supabase"},m={categories:["SCHEMA"],description:"A migrated-away platform's SDK is still imported from `lunora/` source. The code compiles and typechecks, so a half-finished port keeps reading from the old platform at runtime and the two stores silently drift apart.",facing:"INTERNAL",level:"WARN",name:"migration_stale_import",remediation:"Replace the call with its Lunora equivalent and drop the dependency. If the import is deliberate — a second data source you still read from — move it out of `lunora/` so it is not mistaken for an unfinished migration.",run:r=>r.staleMigrationImports===void 0?[]:r.staleMigrationImports.map(e=>a(m,{cacheKey:`migration_stale_import:${e.file}:${e.line.toString()}:${e.moduleSpecifier}`,detail:`\`${e.file}\` (line ${e.line.toString()}) still imports \`${e.moduleSpecifier}\`. Finish the port — see \`${Uo[e.platform]}\` — or move the import out of \`lunora/\` if you genuinely still read from ${e.platform}.`,metadata:{file:e.file,line:e.line,moduleSpecifier:e.moduleSpecifier,platform:e.platform}})),source:"static",title:"Stale migration import"},To=new Map([["global",{level:"WARN",scope:r=>`it reads the whole D1 table "${r}" over a cross-region round trip`}],["root",{level:"WARN",scope:r=>`it loads every row of "${r}" from the root Durable Object's SQLite into memory`}],["shardBy",{level:"INFO",scope:r=>`"${r}" is \`.shardBy()\`, so this collects one shard's rows rather than the whole table — bounded by a single tenant's row count`}]]),Wo={level:"WARN",scope:r=>`it loads every row of "${r}"`},s={categories:["PERFORMANCE"],description:"A query calls `.collect()` with no `.withIndex()` and no `.filter()`, so it materializes every row of the table. Any live subscription over it also re-sends that whole result to every subscribed client on every write to the table.",facing:"EXTERNAL",level:"WARN",name:"unbounded_collect",remediation:'Narrow the read with `.withIndex("name", (q) => q.eq(...))`, cap it with `.take(n)`, or page it with `.paginate(args.paginationOpts)` so neither the scan nor the subscription payload grows with the table.',run:r=>{const e=[],n=lo(r.schema);for(const o of r.queries??[]){if(o.terminal!=="collect"||o.hasIndex||o.table===""||o.hasFilter)continue;const t=n.get(o.table),{level:i,scope:l}=To.get(t??"")??Wo,p=po(o),f=i==="WARN"?` A live subscription over this query records a whole-table dependency, so every write to "${o.table}" re-runs it and re-sends the full result to each subscribed socket.`:" Cap it with `.take(n)` if that count can grow.";e.push(a(s,{cacheKey:`unbounded_collect:${o.file}:${o.line.toString()}:${o.table}`,detail:`Query on "${o.table}" at ${p} calls .collect() with no index and no filter — ${l(o.table)}.${f}`,level:i,metadata:{...fo(o),shardKind:t??"unknown",table:o.table}}))}return e},source:"static",title:"Unbounded collect"},Io=[ce,Be,He,Ao,vo,Xe,Q,X,Z,B,ne,j,te,ie,V,so,O,M,K,G,go,bo,ao,H,no,Ro,Le,qe,_,mo,Y,ee,J,s,co,uo,z,Ve,Qe,we,ve,Ae,le,Ke,U,Fe,je,be,ye,E,D,P,De,yo,So,Ze,Ee,ho,ae,Ye,y,Ce,he,_e,k,Oe,$e,de,A,g,b,xe,oo,ue,$,S,w,wo,ge,F,Me,q,L,I,N,T,x,W,C,fe,Ge,Pe,R,We,to,io,eo,ro,me,se,ze,oe,re,v,pe,Ne,Je,Se,Ie,Re,Te,Ue,ke,m],xo=[u,h,d],Co=[...Io,...xo],qt=(r,e={})=>{const n=e.lints??Co,o=[];for(const t of n)if(!(e.source!==void 0&&t.source!==e.source))try{o.push(...t.run(r))}catch(i){o.push({cacheKey:`advisor_lint_failed:${t.name}`,categories:t.categories,description:"An advisor lint threw while running, so its check did not run. This is a bug in the lint, not in your app.",detail:`The \`${t.name}\` lint threw: ${i instanceof Error?i.message:String(i)}. Its findings are missing from this run.`,facing:"INTERNAL",level:t.level,metadata:{lint:t.name},name:"advisor_lint_failed",remediation:"Report the error with the source shape that triggered it. Pass `--no-strict-advisories` to deploy past it in the meantime.",title:`Advisor lint \`${t.name}\` failed`})}return c(o)};export{Co as ALL_LINTS,ri as MAP_VERSION,xo as RUNTIME_LINTS,Io as STATIC_LINTS,g as actionFetchSsrf,b as actionWithoutErrorHandling,y as adminRouteWithoutGuard,S as aiRawRunEscapeHatch,w as aiRunWithoutLogging,v as aiToolSideEffectPromptInjection,A as aiUnboundedGenerationPublic,R as allowUnauthenticatedShardAccessEnabled,U as authApiCallWithoutHeaders,T as authCsrfCheckDisabled,W as authEmailVerificationDisabled,I as authScimWithoutTransactions,x as authSecureCookiesDisabled,C as authSessionFreshageZero,N as authTrustedOriginsWildcard,k as browserAllowPrivateTargets,F as browserUserUrlWithoutAllowlist,ti as byCodepoint,Gt as callSiteCallers,zt as callSiteDescription,Ht as callSiteLabel,Bt as callSiteMetadata,M as circularFk,ai as classifySensitivity,O as commitOrderedHardDelete,Zt as compareToBaseline,$ as containerInstanceKeyFromUserInput,E as containerLongSleepAfter,D as containerOversizedInstance,P as containerPublicInternet,L as containerRuntimeEgressRelaxation,q as containerStartEnableInternetOverride,K as countWithoutIndex,_ as cronEveryMinute,G as crossModuleTableWrite,c as dedupeCacheKeys,z as dispatchCycle,H as duplicateIndex,B as emptyIndex,j as errorWithoutCatalog,V as exportSinkMisconfigured,Q as externalSourceIncrementalNoDeletePath,X as externalSourceOnGlobal,Z as externalSourceUnscoped,d as fanOutBreadth,J as filterAfterIndexScan,Y as filterOnPrimaryKey,ee as filterWithoutIndex,oe as flagGatesSecurityWithUnsafeDefault,re as flagReadInSubscription,si as fromServerSchema,te as geoIndexFieldNotGeopoint,ie as geoIndexUnused,ne as globalTableNearColumnLimit,ei as gradeFromScore,ae as hardcodedSecret,jt as helperRole,u as hotShard,me as httpActionMissingAuthGuard,se as httpActionResponseHeaderInjection,le as hyperdriveOutsideAction,pe as identityUndeclaredClaimTrusted,fe as imagesUrlSourceFromUserInput,ce as indexReferencesUnknownField,h as indexUtilization,de as insertManyUnsafeUserData,Vt as isReachableSite,ue as kvUnscopedUserKeyIdor,he as mailInboundDispatchWithoutVerify,ge as mailRecipientFromRequestInput,be as maskUncoveredPiiColumn,ye as maskWeakHashStrategyOnPii,Se as maskedRelationLeakViaWith,we as mutatorFullRowReplace,ve as mutatorWithoutOwnerScope,Ae as nondeterministicQueryMutation,Re as normalizeIdUsedAsAuthorization,Ue as notifyMissingPushConfig,Te as notifySendOutsideAction,We as openShardAccess,Ie as outputProjectionMissingOnPublicRead,xe as ownerFieldFromArgsNotAuth,Jt as parseAdvisorMap,Ce as paymentCreateWithoutAuthorize,Ne as paymentWebhookWideTolerance,ke as plaintextSecretInWranglerVariables,Fe as policyReferencesUnknownTable,Me as privilegedDispatchUnvalidatedPayload,Oe as privilegedFanoutFromPublicProcedure,$e as procedureWithoutStructuredEvent,Ee as publicArgumentUsesAny,De as publicMutationWithoutRatelimit,Pe as publicTableRlsOptoutConfusion,Le as queueDispatchCycle,qe as queueWithoutDlq,Ke as r2sqlOutsideAction,_e as ratelimitDefaultMemoryStore,Ge as ratelimitKeySpoofableOrGlobal,ze as ratelimitMiddlewareFailOpen,Qt as readCallSiteCallers,He as relationReferencesUnknownField,Be as relationReferencesUnknownTable,je as rlsUncoveredTable,qt as runAdvisor,ii as scoreAdvisor,Ve as selfRescheduleWithoutProgress,Qe as shapeTargetsGlobalTable,Xe as shapeUnknownTable,Ze as signupMutationWithoutDisposableGating,Je as softDeleteIncludeDeletedFromArgs,Ye as sqlInjectionRisk,eo as storageGenerateUploadUrlNoContentTypePin,oo as storageKeyFromUserArgs,ro as storagePresignedUrlForPrivateContent,to as storageUploadWithoutContentTypeAllowlist,io as storageUploadWithoutMaxSize,no as tableWithoutInsert,ao as throughRelationMissingUniqueIndex,mo as topicTooManySubscriptions,so as ttlFieldNotTimestamp,co as unboundedCollectOnOpenRange,uo as unboundedLoop,ho as unboundedStringArgument,go as unindexedForeignKey,bo as unindexedRelationTarget,yo as unrestrictedWhereBranch,So as userCreatingMutationWithoutCaptcha,wo as vectorsNamespaceFromUserInput,vo as workflowDuplicateStepName,Ao as workflowUnknownTarget,Ro as workflowUnused};
@@ -1 +1 @@
1
- import{e as a}from"./finding-NrKO8idM.mjs";import{c as r,a as s}from"./helpers-DdZ_pyR3.mjs";const i={categories:["SECURITY"],description:"An action's `ctx.fetch(url)` fetches a URL derived from the handler's `args`. `ctx.fetch` applies no host allowlist, so request-controlled URLs let a caller reach cloud metadata endpoints or internal services — server-side request forgery.",facing:"EXTERNAL",level:"ERROR",name:"action_fetch_ssrf",remediation:"Validate the URL against an allowlist of expected hosts before fetching, and reject private, loopback, and link-local addresses (notably `169.254.169.254`). Never pass request input straight to `ctx.fetch`.",run:t=>t.argumentDerivedFetches===void 0?[]:t.argumentDerivedFetches.map(e=>a(i,{cacheKey:`action_fetch_ssrf:${e.file}:${e.line.toString()}`,detail:`\`ctx.fetch\` in ${s(e)} fetches a URL derived from \`args\` — a server-side request forgery vector. Validate the URL against a host allowlist and reject private/link-local targets before fetching.`,metadata:{...r(e)}})),source:"static",title:"Possible SSRF from arg-derived ctx.fetch URL"};export{i as default};
1
+ import{e as a}from"./finding-NrKO8idM.mjs";import{c as r,a as s}from"./helpers-YAAwOBMH.mjs";const i={categories:["SECURITY"],description:"An action's `ctx.fetch(url)` fetches a URL derived from the handler's `args`. `ctx.fetch` applies no host allowlist, so request-controlled URLs let a caller reach cloud metadata endpoints or internal services — server-side request forgery.",facing:"EXTERNAL",level:"ERROR",name:"action_fetch_ssrf",remediation:"Validate the URL against an allowlist of expected hosts before fetching, and reject private, loopback, and link-local addresses (notably `169.254.169.254`). Never pass request input straight to `ctx.fetch`.",run:t=>t.argumentDerivedFetches===void 0?[]:t.argumentDerivedFetches.map(e=>a(i,{cacheKey:`action_fetch_ssrf:${e.file}:${e.line.toString()}`,detail:`\`ctx.fetch\` in ${s(e)} fetches a URL derived from \`args\` — a server-side request forgery vector. Validate the URL against a host allowlist and reject private/link-local targets before fetching.`,metadata:{...r(e)}})),source:"static",title:"Possible SSRF from arg-derived ctx.fetch URL"};export{i as default};
@@ -0,0 +1 @@
1
+ import{e as a}from"./finding-NrKO8idM.mjs";import{d as n}from"./helpers-YAAwOBMH.mjs";const i={categories:["SCHEMA"],description:"An `action` calls an outbound surface (fetch, mail, queues, storage, sql, ai) with no `try`/`catch`. Those fail routinely, and an uncaught rejection reaches the caller with no indication of which dependency broke.",facing:"EXTERNAL",level:"WARN",name:"action_without_error_handling",remediation:"Wrap the outbound call in `try`/`catch`, then either degrade or rethrow a coded `LunoraError` naming the dependency that failed.",run:t=>t.procedureProtections===void 0?[]:t.procedureProtections.filter(e=>e.kind==="action"&&e.reachesOutbound===!0&&e.handlesErrors===!1).map(e=>a(i,{cacheKey:`action_without_error_handling:${e.file}:${e.exportName}`,detail:`Action \`${e.exportName}\` (${e.file}) calls an outbound surface with no \`try\`/\`catch\`. A dependency failure will surface to the caller unexplained.`,metadata:{exportName:e.exportName,...n(e),kind:e.kind}})),source:"static",title:"Action performs outbound I/O with no error handling"};export{i as default};
@@ -0,0 +1 @@
1
+ import{e as t}from"./finding-NrKO8idM.mjs";import{d as i}from"./helpers-YAAwOBMH.mjs";const r={categories:["SECURITY"],description:"An `httpRoute` on an admin/privileged path has no visible auth/admin guard. REST routes aren't covered by RLS, so an unguarded `/admin/*` route is callable by anyone who reaches the URL.",facing:"EXTERNAL",level:"WARN",name:"admin_route_without_guard",remediation:"Assert an authenticated, authorized caller at the top of the handler — check `ctx.auth` / `getSession(...)`, or a `requireAdmin`-style guard — and reject (401/403) before doing privileged work. For machine callers, verify a secret with a timing-safe compare.",run:a=>a.adminRoutes===void 0?[]:a.adminRoutes.filter(e=>!e.usesGuard).map(e=>t(r,{cacheKey:`admin_route_without_guard:${e.file}:${e.method}:${e.path}`,detail:`Route \`${e.method} ${e.path}\` (\`${e.exportName}\` in ${e.file}) is on an admin/privileged path but its handler shows no auth/admin guard. Assert an authorized caller before doing privileged work.`,metadata:{exportName:e.exportName,...i(e),method:e.method,path:e.path}})),source:"static",title:"Admin route without an auth guard"};export{r as default};
@@ -1 +1 @@
1
- import{e as r}from"./finding-NrKO8idM.mjs";import{c as t,a as i}from"./helpers-DdZ_pyR3.mjs";const s={categories:["SECURITY"],description:"A `ctx.ai.run(model, …)` call selects its model from the handler's `args` with no server-side scoping. `ctx.ai.run` is the raw Workers AI binding passthrough, so an arg-derived model id lets any caller pick an arbitrary model — bypassing the typed `ctx.ai.model(...)` + AI-SDK layer's cap/schema.",facing:"EXTERNAL",level:"WARN",name:"ai_raw_run_escape_hatch",remediation:"Select the model from a fixed server-side allowlist — never from `args`. Prefer the typed `ctx.ai.model(...)` + `generateText`/`streamText` path with an output cap over the raw `ctx.ai.run` escape hatch.",run:a=>a.aiRawRuns===void 0?[]:a.aiRawRuns.map(e=>r(s,{cacheKey:`ai_raw_run_escape_hatch:${e.file}:${e.line.toString()}`,detail:`\`ctx.ai.run\` in ${i(e)} selects its model from \`args\` with no server-side scoping — any caller can pick an arbitrary model, bypassing the typed AI-SDK layer's cap/schema. Select the model from a fixed server-side allowlist instead.`,metadata:{...t(e)}})),source:"static",title:"Possible arbitrary model selection from arg-derived ctx.ai.run"};export{s as default};
1
+ import{e as r}from"./finding-NrKO8idM.mjs";import{c as t,a as i}from"./helpers-YAAwOBMH.mjs";const s={categories:["SECURITY"],description:"A `ctx.ai.run(model, …)` call selects its model from the handler's `args` with no server-side scoping. `ctx.ai.run` is the raw Workers AI binding passthrough, so an arg-derived model id lets any caller pick an arbitrary model — bypassing the typed `ctx.ai.model(...)` + AI-SDK layer's cap/schema.",facing:"EXTERNAL",level:"WARN",name:"ai_raw_run_escape_hatch",remediation:"Select the model from a fixed server-side allowlist — never from `args`. Prefer the typed `ctx.ai.model(...)` + `generateText`/`streamText` path with an output cap over the raw `ctx.ai.run` escape hatch.",run:a=>a.aiRawRuns===void 0?[]:a.aiRawRuns.map(e=>r(s,{cacheKey:`ai_raw_run_escape_hatch:${e.file}:${e.line.toString()}`,detail:`\`ctx.ai.run\` in ${i(e)} selects its model from \`args\` with no server-side scoping — any caller can pick an arbitrary model, bypassing the typed AI-SDK layer's cap/schema. Select the model from a fixed server-side allowlist instead.`,metadata:{...t(e)}})),source:"static",title:"Possible arbitrary model selection from arg-derived ctx.ai.run"};export{s as default};
@@ -0,0 +1 @@
1
+ import{e as n}from"./finding-NrKO8idM.mjs";import{d as i}from"./helpers-YAAwOBMH.mjs";const a={categories:["PERFORMANCE"],description:"A procedure runs an AI generation but emits no structured event. Model calls bill per invocation and are not reproducible, so without one there is no way to attribute spend or trace a bad answer back to its prompt.",facing:"INTERNAL",level:"INFO",name:"ai_run_without_logging",remediation:'Emit an event around the generation — `ctx.trace("<name>", …)`, or a `ctx.log` line carrying the model and token usage.',run:e=>e.procedureProtections===void 0?[]:e.procedureProtections.filter(t=>t.runsAiGeneration===!0&&t.emitsEvent===!1).map(t=>n(a,{cacheKey:`ai_run_without_logging:${t.file}:${t.exportName}`,detail:`${t.kind} \`${t.exportName}\` (${t.file}) runs an AI generation with no structured event, so its cost and output cannot be attributed later.`,metadata:{exportName:t.exportName,...i(t),kind:t.kind}})),source:"static",title:"AI generation with no structured event"};export{a as default};
@@ -1 +1 @@
1
- import{e as o}from"./finding-NrKO8idM.mjs";import{a as n,c as a}from"./helpers-DdZ_pyR3.mjs";const r={categories:["SECURITY"],description:"A `generateText` / `streamText` call whose prompt/messages carry user-supplied text and whose model-callable `tools` perform a privileged side effect (DB write, `ctx.run` dispatch, or outbound send). An injected instruction in the user text can steer the model into firing that action — the confused-deputy prompt-injection hazard.",facing:"EXTERNAL",level:"WARN",name:"ai_tool_side_effect_prompt_injection",remediation:"Don't let a model with user-derived input directly trigger a privileged action. Have the tool return a proposal the server validates and authorizes before executing, gate the side effect behind an explicit human/step confirmation, or keep side-effecting tools out of any generation whose prompt includes untrusted input.",run:t=>t.aiToolSideEffects===void 0?[]:t.aiToolSideEffects.filter(e=>e.userInputDerived).map(e=>{const i=n(e);return o(r,{cacheKey:`ai_tool_side_effect_prompt_injection:${e.file}:${e.line.toString()}`,detail:`\`${e.method}\` in ${i} feeds user-derived input to a model whose tools reach \`${e.sideEffect}\`. An injected instruction can steer the model into firing that side effect.`,metadata:{...a(e),method:e.method,sideEffect:e.sideEffect}})}),source:"static",title:"AI tool side effect reachable via prompt injection"};export{r as default};
1
+ import{e as o}from"./finding-NrKO8idM.mjs";import{a as n,c as a}from"./helpers-YAAwOBMH.mjs";const r={categories:["SECURITY"],description:"A `generateText` / `streamText` call whose prompt/messages carry user-supplied text and whose model-callable `tools` perform a privileged side effect (DB write, `ctx.run` dispatch, or outbound send). An injected instruction in the user text can steer the model into firing that action — the confused-deputy prompt-injection hazard.",facing:"EXTERNAL",level:"WARN",name:"ai_tool_side_effect_prompt_injection",remediation:"Don't let a model with user-derived input directly trigger a privileged action. Have the tool return a proposal the server validates and authorizes before executing, gate the side effect behind an explicit human/step confirmation, or keep side-effecting tools out of any generation whose prompt includes untrusted input.",run:t=>t.aiToolSideEffects===void 0?[]:t.aiToolSideEffects.filter(e=>e.userInputDerived).map(e=>{const i=n(e);return o(r,{cacheKey:`ai_tool_side_effect_prompt_injection:${e.file}:${e.line.toString()}`,detail:`\`${e.method}\` in ${i} feeds user-derived input to a model whose tools reach \`${e.sideEffect}\`. An injected instruction can steer the model into firing that side effect.`,metadata:{...a(e),method:e.method,sideEffect:e.sideEffect}})}),source:"static",title:"AI tool side effect reachable via prompt injection"};export{r as default};
@@ -0,0 +1 @@
1
+ import{e as n}from"./finding-NrKO8idM.mjs";import{m as i}from"./procedure-protections-DRQotu9I.mjs";import{d as a}from"./helpers-YAAwOBMH.mjs";const o={categories:["SECURITY"],description:"A public procedure runs an AI generation (`generateText`/`streamText`/`generateObject`/`streamObject`) with no `maxOutputTokens` bound. Generation bills per output token, so an anonymous caller can request arbitrarily long completions in a loop — a denial-of-wallet vector that also ties up worker time on long streams.",facing:"EXTERNAL",level:"WARN",name:"ai_unbounded_generation_public",remediation:"Cap the completion with `maxOutputTokens` in the generation config, and rate-limit the public entry point (`.use(rateLimit(...))`). For expensive models, prefer running generation from an internal, authenticated path rather than exposing it directly to anonymous callers.",run:t=>t.procedureProtections===void 0?[]:t.procedureProtections.filter(e=>i(e.unboundedAiGeneration)&&e.visibility==="public").map(e=>n(o,{cacheKey:`ai_unbounded_generation_public:${e.file}:${e.exportName}`,detail:`\`${e.exportName}\` (${e.file}) is public and runs an AI generation with no \`maxOutputTokens\` bound — an anonymous caller can drive unbounded, billable completions in a loop. Add a \`maxOutputTokens\` cap and rate-limit the entry point.`,metadata:{exportName:e.exportName,...a(e),kind:e.kind}})),source:"static",title:"Public procedure runs unbounded AI generation (no maxOutputTokens)"};export{o as default};
@@ -1 +1 @@
1
- import{dedupeCacheKeys as i}from"./dedupeCacheKeys-DtBOHffV.mjs";import{e as a}from"./finding-NrKO8idM.mjs";import{c as s,a as r}from"./helpers-DdZ_pyR3.mjs";const h={categories:["SECURITY"],description:"A `ctx.authApi.<method>(...)` call omits `headers` — better-auth skips session authorization and runs the call with full server-to-server privileges, regardless of the caller's identity.",facing:"EXTERNAL",level:"WARN",name:"auth_api_call_without_headers",remediation:"Pass the inbound `headers` from the incoming request into every `ctx.authApi.*` call: `ctx.authApi.<method>({ body, headers: request.headers })`. See the `withAuthPlugins` middleware doc for details.",run:t=>t.authApiCalls===void 0?[]:i(t.authApiCalls.filter(e=>!e.hasHeaders).map(e=>a(h,{cacheKey:`auth_api_call_without_headers:${e.file}:${e.line.toString()}:${e.method}`,detail:`\`ctx.authApi.${e.method||"<method>"}(…)\` in ${r(e)} is called without \`headers\` — better-auth skips session authorization, so this runs with full privileges. Pass the inbound \`headers\`.`,metadata:{...s(e),method:e.method}}))),source:"static",title:"Privileged ctx.authApi call missing headers"};export{h as default};
1
+ import{dedupeCacheKeys as i}from"./dedupeCacheKeys-DtBOHffV.mjs";import{e as a}from"./finding-NrKO8idM.mjs";import{c as s,a as r}from"./helpers-YAAwOBMH.mjs";const h={categories:["SECURITY"],description:"A `ctx.authApi.<method>(...)` call omits `headers` — better-auth skips session authorization and runs the call with full server-to-server privileges, regardless of the caller's identity.",facing:"EXTERNAL",level:"WARN",name:"auth_api_call_without_headers",remediation:"Pass the inbound `headers` from the incoming request into every `ctx.authApi.*` call: `ctx.authApi.<method>({ body, headers: request.headers })`. See the `withAuthPlugins` middleware doc for details.",run:t=>t.authApiCalls===void 0?[]:i(t.authApiCalls.filter(e=>!e.hasHeaders).map(e=>a(h,{cacheKey:`auth_api_call_without_headers:${e.file}:${e.line.toString()}:${e.method}`,detail:`\`ctx.authApi.${e.method||"<method>"}(…)\` in ${r(e)} is called without \`headers\` — better-auth skips session authorization, so this runs with full privileges. Pass the inbound \`headers\`.`,metadata:{...s(e),method:e.method}}))),source:"static",title:"Privileged ctx.authApi call missing headers"};export{h as default};
@@ -1 +1 @@
1
- import{e as t}from"./finding-NrKO8idM.mjs";import{c as i,a as r}from"./helpers-DdZ_pyR3.mjs";const s={categories:["SECURITY"],description:"A `createAuth({...})` call sets `advanced.disableCSRFCheck: true`, turning off better-auth's origin validation for state-changing auth requests — a cross-site request riding the ambient auth cookie is processed like a same-origin one.",facing:"EXTERNAL",level:"ERROR",name:"auth_csrf_check_disabled",remediation:"Remove `advanced.disableCSRFCheck: true` from `createAuth({...})` and rely on `trustedOrigins` for origin validation instead of disabling the check.",run:a=>a.authConfigs===void 0?[]:a.authConfigs.filter(e=>e.analyzable&&e.disableCsrfCheck).map(e=>t(s,{cacheKey:`auth_csrf_check_disabled:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${r(e)} sets \`advanced.disableCSRFCheck: true\`, turning off origin validation for state-changing auth requests. Remove the flag and rely on \`trustedOrigins\` instead.`,metadata:{...i(e)}})),source:"static",title:"createAuth CSRF check disabled"};export{s as default};
1
+ import{e as t}from"./finding-NrKO8idM.mjs";import{c as i,a as r}from"./helpers-YAAwOBMH.mjs";const s={categories:["SECURITY"],description:"A `createAuth({...})` call sets `advanced.disableCSRFCheck: true`, turning off better-auth's origin validation for state-changing auth requests — a cross-site request riding the ambient auth cookie is processed like a same-origin one.",facing:"EXTERNAL",level:"ERROR",name:"auth_csrf_check_disabled",remediation:"Remove `advanced.disableCSRFCheck: true` from `createAuth({...})` and rely on `trustedOrigins` for origin validation instead of disabling the check.",run:a=>a.authConfigs===void 0?[]:a.authConfigs.filter(e=>e.analyzable&&e.disableCsrfCheck).map(e=>t(s,{cacheKey:`auth_csrf_check_disabled:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${r(e)} sets \`advanced.disableCSRFCheck: true\`, turning off origin validation for state-changing auth requests. Remove the flag and rely on \`trustedOrigins\` instead.`,metadata:{...i(e)}})),source:"static",title:"createAuth CSRF check disabled"};export{s as default};
@@ -1 +1 @@
1
- import{e as i}from"./finding-NrKO8idM.mjs";import{c as t,a as r}from"./helpers-DdZ_pyR3.mjs";const l={categories:["SECURITY"],description:"A `createAuth({...})` call enables `emailAndPassword` with no `requireEmailVerification: true`. better-auth defaults email verification off, so an account is usable before the caller has proven ownership of the email address.",facing:"EXTERNAL",level:"WARN",name:"auth_email_verification_disabled",remediation:"Set `emailAndPassword.requireEmailVerification: true` on `createAuth({...})` so a new account can't act until its email address is verified.",run:a=>a.authConfigs===void 0?[]:a.authConfigs.filter(e=>e.analyzable&&e.emailPasswordEnabled&&!e.requireEmailVerification).map(e=>i(l,{cacheKey:`auth_email_verification_disabled:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${r(e)} enables \`emailAndPassword\` with no \`requireEmailVerification: true\`, so an account is usable before its email is proven. Set \`emailAndPassword.requireEmailVerification: true\`.`,metadata:{...t(e)}})),source:"static",title:"createAuth email verification disabled"};export{l as default};
1
+ import{e as i}from"./finding-NrKO8idM.mjs";import{c as t,a as r}from"./helpers-YAAwOBMH.mjs";const l={categories:["SECURITY"],description:"A `createAuth({...})` call enables `emailAndPassword` with no `requireEmailVerification: true`. better-auth defaults email verification off, so an account is usable before the caller has proven ownership of the email address.",facing:"EXTERNAL",level:"WARN",name:"auth_email_verification_disabled",remediation:"Set `emailAndPassword.requireEmailVerification: true` on `createAuth({...})` so a new account can't act until its email address is verified.",run:a=>a.authConfigs===void 0?[]:a.authConfigs.filter(e=>e.analyzable&&e.emailPasswordEnabled&&!e.requireEmailVerification).map(e=>i(l,{cacheKey:`auth_email_verification_disabled:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${r(e)} enables \`emailAndPassword\` with no \`requireEmailVerification: true\`, so an account is usable before its email is proven. Set \`emailAndPassword.requireEmailVerification: true\`.`,metadata:{...t(e)}})),source:"static",title:"createAuth email verification disabled"};export{l as default};
@@ -1 +1 @@
1
- import{e}from"./finding-NrKO8idM.mjs";import{c as r,a as s}from"./helpers-DdZ_pyR3.mjs";const i={categories:["SECURITY"],description:"A `createAuth({...})` call loads `scim()` with a `database` that has no native transactions (`lunoraD1Adapter` / `lunoraAuthAdapter`). `@better-auth/scim` refuses to serve on such an adapter, so every SCIM request fails.",facing:"EXTERNAL",level:"ERROR",name:"auth_scim_without_transactions",remediation:"Move the auth tables somewhere with real transactions: `.auth({ namespace })` with a `LunoraAuthDO` (Durable Object storage), or a Postgres/MySQL kysely dialect over `@lunora/hyperdrive` with `transaction: true`. D1 cannot host SCIM.",run:t=>t.authConfigs===void 0?[]:t.authConfigs.filter(a=>a.analyzable&&a.scimOnNonTransactionalAdapter).map(a=>e(i,{cacheKey:`auth_scim_without_transactions:${a.file}:${a.line.toString()}`,detail:`\`createAuth\` in ${s(a)} loads \`scim()\` on an adapter without native transactions, so the SCIM plugin will refuse to serve and every provisioning request from your IdP fails. Host the auth tables in a Durable Object (\`.auth({ namespace })\`) or on Postgres/MySQL via \`@lunora/hyperdrive\`.`,metadata:{...r(a)}})),source:"static",title:"SCIM configured on an adapter without transactions"};export{i as default};
1
+ import{e}from"./finding-NrKO8idM.mjs";import{c as r,a as s}from"./helpers-YAAwOBMH.mjs";const i={categories:["SECURITY"],description:"A `createAuth({...})` call loads `scim()` with a `database` that has no native transactions (`lunoraD1Adapter` / `lunoraAuthAdapter`). `@better-auth/scim` refuses to serve on such an adapter, so every SCIM request fails.",facing:"EXTERNAL",level:"ERROR",name:"auth_scim_without_transactions",remediation:"Move the auth tables somewhere with real transactions: `.auth({ namespace })` with a `LunoraAuthDO` (Durable Object storage), or a Postgres/MySQL kysely dialect over `@lunora/hyperdrive` with `transaction: true`. D1 cannot host SCIM.",run:t=>t.authConfigs===void 0?[]:t.authConfigs.filter(a=>a.analyzable&&a.scimOnNonTransactionalAdapter).map(a=>e(i,{cacheKey:`auth_scim_without_transactions:${a.file}:${a.line.toString()}`,detail:`\`createAuth\` in ${s(a)} loads \`scim()\` on an adapter without native transactions, so the SCIM plugin will refuse to serve and every provisioning request from your IdP fails. Host the auth tables in a Durable Object (\`.auth({ namespace })\`) or on Postgres/MySQL via \`@lunora/hyperdrive\`.`,metadata:{...r(a)}})),source:"static",title:"SCIM configured on an adapter without transactions"};export{i as default};
@@ -1 +1 @@
1
- import{e as s}from"./finding-NrKO8idM.mjs";import{c as a,a as o}from"./helpers-DdZ_pyR3.mjs";const i={categories:["SECURITY"],description:"A `createAuth({...})` call sets `advanced.useSecureCookies: false`, overriding Lunora's secure-by-default posture — the session cookie ships without `Secure` even on an HTTPS deployment, so it can be sent over a plaintext connection.",facing:"EXTERNAL",level:"ERROR",name:"auth_secure_cookies_disabled",remediation:"Remove `advanced.useSecureCookies: false` from `createAuth({...})` — let Lunora's secure-by-default posture set the `Secure` cookie attribute for an HTTPS deployment.",run:t=>t.authConfigs===void 0?[]:t.authConfigs.filter(e=>e.analyzable&&e.secureCookiesDisabled).map(e=>s(i,{cacheKey:`auth_secure_cookies_disabled:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${o(e)} sets \`advanced.useSecureCookies: false\`, so the session cookie ships without \`Secure\` even on an HTTPS deployment. Remove the override and let Lunora's secure-by-default posture apply.`,metadata:{...a(e)}})),source:"static",title:"createAuth secure cookies disabled"};export{i as default};
1
+ import{e as s}from"./finding-NrKO8idM.mjs";import{c as a,a as o}from"./helpers-YAAwOBMH.mjs";const i={categories:["SECURITY"],description:"A `createAuth({...})` call sets `advanced.useSecureCookies: false`, overriding Lunora's secure-by-default posture — the session cookie ships without `Secure` even on an HTTPS deployment, so it can be sent over a plaintext connection.",facing:"EXTERNAL",level:"ERROR",name:"auth_secure_cookies_disabled",remediation:"Remove `advanced.useSecureCookies: false` from `createAuth({...})` — let Lunora's secure-by-default posture set the `Secure` cookie attribute for an HTTPS deployment.",run:t=>t.authConfigs===void 0?[]:t.authConfigs.filter(e=>e.analyzable&&e.secureCookiesDisabled).map(e=>s(i,{cacheKey:`auth_secure_cookies_disabled:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${o(e)} sets \`advanced.useSecureCookies: false\`, so the session cookie ships without \`Secure\` even on an HTTPS deployment. Remove the override and let Lunora's secure-by-default posture apply.`,metadata:{...a(e)}})),source:"static",title:"createAuth secure cookies disabled"};export{i as default};
@@ -1 +1 @@
1
- import{e as t}from"./finding-NrKO8idM.mjs";import{c as r,a}from"./helpers-DdZ_pyR3.mjs";const i={categories:["SECURITY"],description:"A `createAuth({...})` call sets `session.freshAge: 0`, disabling better-auth's recent-reauth check for sensitive operations — a long-lived stolen session can perform them without proving the caller still controls the credentials.",facing:"EXTERNAL",level:"WARN",name:"auth_session_freshage_zero",remediation:"Remove `session.freshAge: 0` from `createAuth({...})` (or set it to a real window) so sensitive operations require a recently re-authenticated session.",run:s=>s.authConfigs===void 0?[]:s.authConfigs.filter(e=>e.analyzable&&e.sessionFreshAgeZero).map(e=>t(i,{cacheKey:`auth_session_freshage_zero:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${a(e)} sets \`session.freshAge: 0\`, disabling the recent-reauth check for sensitive operations. Remove the override or set a real window.`,metadata:{...r(e)}})),source:"static",title:"createAuth session freshAge zero"};export{i as default};
1
+ import{e as t}from"./finding-NrKO8idM.mjs";import{c as r,a}from"./helpers-YAAwOBMH.mjs";const i={categories:["SECURITY"],description:"A `createAuth({...})` call sets `session.freshAge: 0`, disabling better-auth's recent-reauth check for sensitive operations — a long-lived stolen session can perform them without proving the caller still controls the credentials.",facing:"EXTERNAL",level:"WARN",name:"auth_session_freshage_zero",remediation:"Remove `session.freshAge: 0` from `createAuth({...})` (or set it to a real window) so sensitive operations require a recently re-authenticated session.",run:s=>s.authConfigs===void 0?[]:s.authConfigs.filter(e=>e.analyzable&&e.sessionFreshAgeZero).map(e=>t(i,{cacheKey:`auth_session_freshage_zero:${e.file}:${e.line.toString()}`,detail:`\`createAuth\` in ${a(e)} sets \`session.freshAge: 0\`, disabling the recent-reauth check for sensitive operations. Remove the override or set a real window.`,metadata:{...r(e)}})),source:"static",title:"createAuth session freshAge zero"};export{i as default};
@@ -1 +1 @@
1
- import{e as t}from"./finding-NrKO8idM.mjs";import{c as r,a}from"./helpers-DdZ_pyR3.mjs";const s={categories:["SECURITY"],description:"A `createAuth({...})` call's `trustedOrigins` array contains a `\"*\"` entry, disabling better-auth's CSRF/origin validation entirely — any origin is accepted for state-changing auth requests.",facing:"EXTERNAL",level:"ERROR",name:"auth_trusted_origins_wildcard",remediation:'List the specific origins your deployment serves in `trustedOrigins` instead of `"*"` — a wildcard disables origin validation for every caller.',run:e=>e.authConfigs===void 0?[]:e.authConfigs.filter(i=>i.analyzable&&i.trustedOriginsWildcard).map(i=>t(s,{cacheKey:`auth_trusted_origins_wildcard:${i.file}:${i.line.toString()}`,detail:`\`createAuth\` in ${a(i)} sets \`trustedOrigins\` to include \`"*"\`, disabling CSRF/origin validation for every request. List the specific origins your deployment serves instead.`,metadata:{...r(i)}})),source:"static",title:"createAuth trustedOrigins wildcard"};export{s as default};
1
+ import{e as t}from"./finding-NrKO8idM.mjs";import{c as r,a}from"./helpers-YAAwOBMH.mjs";const s={categories:["SECURITY"],description:"A `createAuth({...})` call's `trustedOrigins` array contains a `\"*\"` entry, disabling better-auth's CSRF/origin validation entirely — any origin is accepted for state-changing auth requests.",facing:"EXTERNAL",level:"ERROR",name:"auth_trusted_origins_wildcard",remediation:'List the specific origins your deployment serves in `trustedOrigins` instead of `"*"` — a wildcard disables origin validation for every caller.',run:e=>e.authConfigs===void 0?[]:e.authConfigs.filter(i=>i.analyzable&&i.trustedOriginsWildcard).map(i=>t(s,{cacheKey:`auth_trusted_origins_wildcard:${i.file}:${i.line.toString()}`,detail:`\`createAuth\` in ${a(i)} sets \`trustedOrigins\` to include \`"*"\`, disabling CSRF/origin validation for every request. List the specific origins your deployment serves instead.`,metadata:{...r(i)}})),source:"static",title:"createAuth trustedOrigins wildcard"};export{s as default};
@@ -1 +1 @@
1
- import{m as t}from"./argument-derived-sink-DLXFC79t.mjs";import{c as s,a as o}from"./helpers-DdZ_pyR3.mjs";const n=t({cacheKey:e=>`browser_user_url_without_allowlist:${e.file}:${e.line.toString()}`,categories:["SECURITY"],description:"A `ctx.browser.<method>(url, …)` call navigates to a URL derived from the handler's `args` with no server-side scoping, and no `createBrowser` allowlist contains it. The default guard blocks private targets but not arbitrary public URLs, so any caller can make the headless browser an open-proxy / SSRF tool (fetch arbitrary third-party URLs, DNS-rebind to internal hosts).",detail:e=>`\`ctx.browser.${e.method}\` in ${o(e)} navigates to a URL derived from \`args\` with no server-side scoping, and no \`createBrowser\` allowlist contains it — the default guard blocks private targets but not arbitrary public URLs, so any caller can turn the headless browser into an open-proxy / SSRF tool. Pin \`allowedHosts\` on \`createBrowser({...})\` (Browser Run enforces it on the session), and derive the URL from server-trusted state where possible.`,facing:"EXTERNAL",getAccesses:e=>e.browserUrlAccesses,level:"WARN",metadata:e=>({...s(e),method:e.method}),name:"browser_user_url_without_allowlist",remediation:"Pin the browser with an `allowedHosts` allowlist on `createBrowser({...})` — Browser Run enforces it on the session, which makes it the supported production posture — and derive the navigation URL from server-trusted state where possible rather than passing `args` straight to `ctx.browser`.",suppressWhen:e=>(e.configCalls??[]).some(r=>r.callee==="createBrowser"&&r.analyzable&&r.presentKeys.includes("allowedHosts")),title:"Browser navigates to arg-derived URL with no allowlist"});export{n as default};
1
+ import{m as t}from"./argument-derived-sink-DLXFC79t.mjs";import{c as s,a as o}from"./helpers-YAAwOBMH.mjs";const n=t({cacheKey:e=>`browser_user_url_without_allowlist:${e.file}:${e.line.toString()}`,categories:["SECURITY"],description:"A `ctx.browser.<method>(url, …)` call navigates to a URL derived from the handler's `args` with no server-side scoping, and no `createBrowser` allowlist contains it. The default guard blocks private targets but not arbitrary public URLs, so any caller can make the headless browser an open-proxy / SSRF tool (fetch arbitrary third-party URLs, DNS-rebind to internal hosts).",detail:e=>`\`ctx.browser.${e.method}\` in ${o(e)} navigates to a URL derived from \`args\` with no server-side scoping, and no \`createBrowser\` allowlist contains it — the default guard blocks private targets but not arbitrary public URLs, so any caller can turn the headless browser into an open-proxy / SSRF tool. Pin \`allowedHosts\` on \`createBrowser({...})\` (Browser Run enforces it on the session), and derive the URL from server-trusted state where possible.`,facing:"EXTERNAL",getAccesses:e=>e.browserUrlAccesses,level:"WARN",metadata:e=>({...s(e),method:e.method}),name:"browser_user_url_without_allowlist",remediation:"Pin the browser with an `allowedHosts` allowlist on `createBrowser({...})` — Browser Run enforces it on the session, which makes it the supported production posture — and derive the navigation URL from server-trusted state where possible rather than passing `args` straight to `ctx.browser`.",suppressWhen:e=>(e.configCalls??[]).some(r=>r.callee==="createBrowser"&&r.analyzable&&r.presentKeys.includes("allowedHosts")),title:"Browser navigates to arg-derived URL with no allowlist"});export{n as default};
@@ -1 +1 @@
1
- import{m as t}from"./argument-derived-sink-DLXFC79t.mjs";import{c as n,a as r}from"./helpers-DdZ_pyR3.mjs";const s=t({cacheKey:e=>`container_instance_key_from_user_input:${e.file}:${e.line.toString()}`,categories:["SECURITY"],description:"A `ctx.containers.<name>.get` call routes to a container instance using a key derived from the handler's `args` with no server-side scoping. Any caller can supply another tenant's key and reach that tenant's container instance — a cross-tenant insecure direct object reference (IDOR).",detail:e=>`\`ctx.containers.*.${e.method}\` in ${r(e)} routes to a container instance using a key derived from \`args\` with no server-side scoping — any caller can reach another tenant's container (IDOR). Derive the key from a server-trusted identity (e.g. \`\${ctx.auth.userId}\`).`,facing:"EXTERNAL",getAccesses:e=>e.containerKeyAccesses,level:"WARN",metadata:e=>({...n(e),method:e.method}),name:"container_instance_key_from_user_input",remediation:"Derive the container instance key from a server-trusted identity (e.g. `${ctx.auth.userId}`) or a record the caller owns — never pass request input straight to `ctx.containers.<name>.get`.",title:"Possible cross-tenant IDOR from arg-derived unscoped container key"});export{s as default};
1
+ import{m as t}from"./argument-derived-sink-DLXFC79t.mjs";import{c as n,a as r}from"./helpers-YAAwOBMH.mjs";const s=t({cacheKey:e=>`container_instance_key_from_user_input:${e.file}:${e.line.toString()}`,categories:["SECURITY"],description:"A `ctx.containers.<name>.get` call routes to a container instance using a key derived from the handler's `args` with no server-side scoping. Any caller can supply another tenant's key and reach that tenant's container instance — a cross-tenant insecure direct object reference (IDOR).",detail:e=>`\`ctx.containers.*.${e.method}\` in ${r(e)} routes to a container instance using a key derived from \`args\` with no server-side scoping — any caller can reach another tenant's container (IDOR). Derive the key from a server-trusted identity (e.g. \`\${ctx.auth.userId}\`).`,facing:"EXTERNAL",getAccesses:e=>e.containerKeyAccesses,level:"WARN",metadata:e=>({...n(e),method:e.method}),name:"container_instance_key_from_user_input",remediation:"Derive the container instance key from a server-trusted identity (e.g. `${ctx.auth.userId}`) or a record the caller owns — never pass request input straight to `ctx.containers.<name>.get`.",title:"Possible cross-tenant IDOR from arg-derived unscoped container key"});export{s as default};
@@ -0,0 +1 @@
1
+ import{e as c}from"./finding-NrKO8idM.mjs";import{d as l}from"./helpers-YAAwOBMH.mjs";const f=3600,p={h:3600,m:60,s:1},m=/^(\d+)([smh])$/u,d=n=>{if(typeof n=="number")return n;const o=m.exec(n);if(o===null)return;const[,e="0",t="s"]=o;return Number(e)*(p[t]??1)},u={categories:["PERFORMANCE"],description:"A container's idle window (its `sleepAfter`, capped by any `hardTimeout`) is longer than an hour, so every idle instance keeps running, and billed, for that whole window.",facing:"INTERNAL",level:"WARN",name:"container_long_sleep_after",remediation:"Lower `sleepAfter` to the idle window the workload needs (the default is 10m), or add a `hardTimeout` that caps how long an instance may live.",run:n=>{const o=[];for(const e of n.containers??[]){const{hardTimeout:t,sleepAfter:i}=e;if(i===void 0)continue;const r=d(i);if(r===void 0)continue;const a=t===void 0?void 0:d(t),s=a===void 0?r:Math.min(r,a);s<=f||o.push(c(u,{cacheKey:`container_long_sleep_after:${e.exportName}`,detail:`Container "${e.exportName}" can sit idle for ${s.toString()} s before it sleeps (sleepAfter ${String(i)}${a===void 0?"":`, capped by hardTimeout ${String(t)}`}); every idle instance is billed for that whole window.`,metadata:{...l(e),container:e.exportName,effectiveIdleSeconds:s,hardTimeout:t,sleepAfter:i}}))}return o},source:"static",title:"Long container idle window"};export{u as default};
@@ -0,0 +1 @@
1
+ import{e as a}from"./finding-NrKO8idM.mjs";import{d as r}from"./helpers-YAAwOBMH.mjs";const o=new Set(["standard-3","standard-4"]),c=2,d=4096,l=e=>typeof e=="string"?o.has(e):(e.vcpu??0)>c||(e.memoryMib??0)>d,m={categories:["PERFORMANCE"],description:"A container is declared on a large instance type, whose provisioned memory and disk are billed for the lifetime of every running instance.",facing:"INTERNAL",level:"INFO",name:"container_oversized_instance",remediation:"Confirm the workload needs this size; a smaller instanceType (lite/basic/standard-1) costs less while idle-but-running.",run:e=>{const t=[];for(const i of e.containers??[]){const{instanceType:n}=i;if(n===void 0||!l(n))continue;const s=typeof n=="string"?n:JSON.stringify(n);t.push(a(m,{cacheKey:`container_oversized_instance:${i.exportName}`,detail:`Container "${i.exportName}" uses a large instance type (${s}); its memory + disk are billed while any instance runs.`,metadata:{...r(i),container:i.exportName,instanceType:n}}))}return t},source:"static",title:"Oversized container instance"};export{m as default};