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

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.
package/dist/index.d.mts CHANGED
@@ -704,8 +704,8 @@ interface AdvisorImageDeliveryUrlAccess {
704
704
  }
705
705
  /**
706
706
  * 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.
707
+ * lint consumes. Produced by the studio from the recorded metrics of the shard
708
+ * being inspected.
709
709
  *
710
710
  * `AdvisorTableScan` comes straight from the per-`(function, table)` full-scan
711
711
  * attribution the runtime already records (`__lunora_metrics_scans`, surfaced as
@@ -715,16 +715,17 @@ interface AdvisorImageDeliveryUrlAccess {
715
715
  * `AdvisorIndexHit` is the per-declared-index hit count. The runtime now records
716
716
  * this in the durable `__lunora_metrics_index` table (stamped on every index use
717
717
  * 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
718
+ * studio passes the counters of the shard being inspected as `context.indexHits`,
719
+ * so an index used only on other shards reads as dead there. The lint flags a
720
+ * declared index with zero recorded reads as dead. When the feed is
720
721
  * absent (a static caller, or a shard that recorded nothing) the dead-index half
721
722
  * is a no-op and only the hot-scan half runs off the scan attribution.
722
723
  */
723
724
  /**
724
725
  * 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.
726
+ * index. Sourced from `FunctionCallStat.scannedTables` aggregated across the
727
+ * functions of the shard being inspected. Runtime callers supply this; static
728
+ * callers don't, so the hot-scan half of the lint finds nothing there.
728
729
  */
729
730
  interface AdvisorTableScan {
730
731
  /** Total full-scans of `table` over the observed window. */
@@ -2818,8 +2819,8 @@ declare const hotShard: Lint;
2818
2819
  * (`context.indexHits`); a declared index whose recorded `reads` is `0` is dead.
2819
2820
  * The runtime records this in the durable `__lunora_metrics_index` table (every
2820
2821
  * 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
2822
+ * it through the `getMetrics` admin RPC; the studio passes the counters of the
2823
+ * shard being inspected as `context.indexHits` (see `AdvisorIndexHit`). The counter is cumulative and
2823
2824
  * never decays, so a non-zero index never reverts to "dead" — `reads: 0` means
2824
2825
  * the index has not been used once since the counter was created.
2825
2826
  *
@@ -4166,9 +4167,9 @@ declare const paymentCreateWithoutAuthorize: Lint;
4166
4167
  *
4167
4168
  * Runs only when the codegen feeder supplies adapter evidence
4168
4169
  * (`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.
4170
+ * statically-known `webhookToleranceSeconds` (a literal or arithmetic over
4171
+ * literals) above the ceiling; an env-sourced value is not evaluated, to keep the
4172
+ * false-positive rate low. One finding per matching adapter.
4172
4173
  */
4173
4174
  declare const paymentWebhookWideTolerance: Lint;
4174
4175
  /**
@@ -4611,15 +4612,13 @@ declare const signupMutationWithoutDisposableGating: Lint;
4611
4612
  */
4612
4613
  declare const softDeleteIncludeDeletedFromArgs: Lint;
4613
4614
  /**
4614
- * Flags a `ctx.sql` tagged-template that splices an unparameterized
4615
- * string-building expression into the query.
4615
+ * Flags a `ctx.sql.query(text, params)` / `ctx.sql.unsafe(text, params)` call whose
4616
+ * `text` is built from a non-constant value.
4616
4617
  *
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.
4618
+ * The driver binds only `params`; `text` runs verbatim, so request input that reaches
4619
+ * the text reopens SQL injection. Codegen's feeder decides what counts as constant
4620
+ * (literals, module consts, fixed joins), so this lint only reports sinks it could not
4621
+ * prove fixed.
4623
4622
  *
4624
4623
  * Runs only when the codegen feeder supplies interpolation evidence
4625
4624
  * (`context.sqlInterpolations`); a runtime caller flags nothing. One finding per
@@ -4753,8 +4752,9 @@ declare const storageUploadWithoutMaxSize: Lint;
4753
4752
  *
4754
4753
  * Using `@lunora/codegen`'s write-side discovery (the analog of the read
4755
4754
  * 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
4755
+ * schema table against the set of tables some exported function inserts into, by
4756
+ * `ctx.db.insert("<table>", …)`, the `ctx.db.<table>` facade (`insert`, `insertMany`,
4757
+ * `upsert`, `upsertMany`), or `insertMany`. A table with no such write either is dead schema
4758
4758
  * or is populated through a path the static analysis can't see — a migration/seed,
4759
4759
  * cross-region replication, the `ctx.orm.insert(...)` builder, or a trusted
4760
4760
  * snapshot import. Hence `INFO`/`INTERNAL`: a nudge to confirm intent, not an error.
package/dist/index.d.ts CHANGED
@@ -704,8 +704,8 @@ interface AdvisorImageDeliveryUrlAccess {
704
704
  }
705
705
  /**
706
706
  * 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.
707
+ * lint consumes. Produced by the studio from the recorded metrics of the shard
708
+ * being inspected.
709
709
  *
710
710
  * `AdvisorTableScan` comes straight from the per-`(function, table)` full-scan
711
711
  * attribution the runtime already records (`__lunora_metrics_scans`, surfaced as
@@ -715,16 +715,17 @@ interface AdvisorImageDeliveryUrlAccess {
715
715
  * `AdvisorIndexHit` is the per-declared-index hit count. The runtime now records
716
716
  * this in the durable `__lunora_metrics_index` table (stamped on every index use
717
717
  * 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
718
+ * studio passes the counters of the shard being inspected as `context.indexHits`,
719
+ * so an index used only on other shards reads as dead there. The lint flags a
720
+ * declared index with zero recorded reads as dead. When the feed is
720
721
  * absent (a static caller, or a shard that recorded nothing) the dead-index half
721
722
  * is a no-op and only the hot-scan half runs off the scan attribution.
722
723
  */
723
724
  /**
724
725
  * 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.
726
+ * index. Sourced from `FunctionCallStat.scannedTables` aggregated across the
727
+ * functions of the shard being inspected. Runtime callers supply this; static
728
+ * callers don't, so the hot-scan half of the lint finds nothing there.
728
729
  */
729
730
  interface AdvisorTableScan {
730
731
  /** Total full-scans of `table` over the observed window. */
@@ -2818,8 +2819,8 @@ declare const hotShard: Lint;
2818
2819
  * (`context.indexHits`); a declared index whose recorded `reads` is `0` is dead.
2819
2820
  * The runtime records this in the durable `__lunora_metrics_index` table (every
2820
2821
  * 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
2822
+ * it through the `getMetrics` admin RPC; the studio passes the counters of the
2823
+ * shard being inspected as `context.indexHits` (see `AdvisorIndexHit`). The counter is cumulative and
2823
2824
  * never decays, so a non-zero index never reverts to "dead" — `reads: 0` means
2824
2825
  * the index has not been used once since the counter was created.
2825
2826
  *
@@ -4166,9 +4167,9 @@ declare const paymentCreateWithoutAuthorize: Lint;
4166
4167
  *
4167
4168
  * Runs only when the codegen feeder supplies adapter evidence
4168
4169
  * (`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.
4170
+ * statically-known `webhookToleranceSeconds` (a literal or arithmetic over
4171
+ * literals) above the ceiling; an env-sourced value is not evaluated, to keep the
4172
+ * false-positive rate low. One finding per matching adapter.
4172
4173
  */
4173
4174
  declare const paymentWebhookWideTolerance: Lint;
4174
4175
  /**
@@ -4611,15 +4612,13 @@ declare const signupMutationWithoutDisposableGating: Lint;
4611
4612
  */
4612
4613
  declare const softDeleteIncludeDeletedFromArgs: Lint;
4613
4614
  /**
4614
- * Flags a `ctx.sql` tagged-template that splices an unparameterized
4615
- * string-building expression into the query.
4615
+ * Flags a `ctx.sql.query(text, params)` / `ctx.sql.unsafe(text, params)` call whose
4616
+ * `text` is built from a non-constant value.
4616
4617
  *
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.
4618
+ * The driver binds only `params`; `text` runs verbatim, so request input that reaches
4619
+ * the text reopens SQL injection. Codegen's feeder decides what counts as constant
4620
+ * (literals, module consts, fixed joins), so this lint only reports sinks it could not
4621
+ * prove fixed.
4623
4622
  *
4624
4623
  * Runs only when the codegen feeder supplies interpolation evidence
4625
4624
  * (`context.sqlInterpolations`); a runtime caller flags nothing. One finding per
@@ -4753,8 +4752,9 @@ declare const storageUploadWithoutMaxSize: Lint;
4753
4752
  *
4754
4753
  * Using `@lunora/codegen`'s write-side discovery (the analog of the read
4755
4754
  * 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
4755
+ * schema table against the set of tables some exported function inserts into, by
4756
+ * `ctx.db.insert("<table>", …)`, the `ctx.db.<table>` facade (`insert`, `insertMany`,
4757
+ * `upsert`, `upsertMany`), or `insertMany`. A table with no such write either is dead schema
4758
4758
  * or is populated through a path the static analysis can't see — a migration/seed,
4759
4759
  * cross-region replication, the `ctx.orm.insert(...)` builder, or a trusted
4760
4760
  * 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-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 T from"./packem_shared/authCsrfCheckDisabled-CRIVsvb9.mjs";import W from"./packem_shared/authEmailVerificationDisabled-BjFlnHr2.mjs";import I from"./packem_shared/authScimWithoutTransactions-B5ATiz5A.mjs";import x from"./packem_shared/authSecureCookiesDisabled-By8PVum3.mjs";import C from"./packem_shared/authSessionFreshageZero-DuxX3Ln9.mjs";import N from"./packem_shared/authTrustedOriginsWildcard-BKIh6788.mjs";import k 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 $ from"./packem_shared/containerInstanceKeyFromUserInput-Bl-tAzKV.mjs";import E from"./packem_shared/containerLongSleepAfter-CVvHEGYC.mjs";import D from"./packem_shared/containerOversizedInstance-Bx89uR7E.mjs";import P from"./packem_shared/containerPublicInternet-BFfZf_P4.mjs";import L from"./packem_shared/containerRuntimeEgressRelaxation-4tMrhq1k.mjs";import q from"./packem_shared/containerStartEnableInternetOverride-mN_kuRtk.mjs";import K from"./packem_shared/countWithoutIndex-DjQFNBrw.mjs";import _ from"./packem_shared/cronEveryMinute-CtpEAbxs.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-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 ee from"./packem_shared/filterWithoutIndex-BGv3jbgg.mjs";import oe from"./packem_shared/flagGatesSecurityWithUnsafeDefault-B5FBDF8c.mjs";import re from"./packem_shared/flagReadInSubscription-DabIhYGD.mjs";import te from"./packem_shared/geoIndexFieldNotGeopoint-BMQuok2-.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-DhMIs1EI.mjs";import se from"./packem_shared/httpActionResponseHeaderInjection-mcRYd3Zw.mjs";import le from"./packem_shared/hyperdriveOutsideAction-CPDdGP2g.mjs";import pe from"./packem_shared/identityUndeclaredClaimTrusted-D1sEd5lr.mjs";import fe from"./packem_shared/imagesUrlSourceFromUserInput-BJXotuyO.mjs";import ce from"./packem_shared/indexReferencesUnknownField-DKz4-bla.mjs";import de from"./packem_shared/insertManyUnsafeUserData-DWE8d_DF.mjs";import ue from"./packem_shared/kvUnscopedUserKeyIdor-DhymglIq.mjs";import he from"./packem_shared/mailInboundDispatchWithoutVerify-CWwqXyPX.mjs";import ge from"./packem_shared/mailRecipientFromRequestInput-BVXsZ4Xf.mjs";import be from"./packem_shared/maskUncoveredPiiColumn-axEka4nd.mjs";import ye from"./packem_shared/maskWeakHashStrategyOnPii-DJasagzX.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-DWSeo7oC.mjs";import xe from"./packem_shared/ownerFieldFromArgsNotAuth-J8Xbz5uI.mjs";import Ce from"./packem_shared/paymentCreateWithoutAuthorize-CdenWpXD.mjs";import Ne from"./packem_shared/paymentWebhookWideTolerance-CqMcZOb2.mjs";import ke from"./packem_shared/plaintextSecretInWranglerVariables-bNkqmNqV.mjs";import Fe from"./packem_shared/policyReferencesUnknownTable-CIKuRZ5Y.mjs";import Me from"./packem_shared/privilegedDispatchUnvalidatedPayload-BM3NtT57.mjs";import Oe from"./packem_shared/privilegedFanoutFromPublicProcedure-DV188gHQ.mjs";import $e from"./packem_shared/procedureWithoutStructuredEvent-BcOE0mFx.mjs";import Ee from"./packem_shared/publicArgumentUsesAny-BDEvMA8Q.mjs";import De from"./packem_shared/publicMutationWithoutRatelimit-Bd-rRxnz.mjs";import Pe from"./packem_shared/publicTableRlsOptoutConfusion-CbNk75Xo.mjs";import Le from"./packem_shared/queueDispatchCycle-84yt1IR-.mjs";import qe from"./packem_shared/queueWithoutDlq-BvHz3Opg.mjs";import Ke from"./packem_shared/r2sqlOutsideAction-BdLiLOAX.mjs";import _e from"./packem_shared/ratelimitDefaultMemoryStore-Dj0Kk7t9.mjs";import Ge from"./packem_shared/ratelimitKeySpoofableOrGlobal-DHMl74hR.mjs";import ze from"./packem_shared/ratelimitMiddlewareFailOpen-Di2t8pDc.mjs";import He from"./packem_shared/relationReferencesUnknownField-Cl6mik8w.mjs";import Be from"./packem_shared/relationReferencesUnknownTable-vYjirSxf.mjs";import je from"./packem_shared/rlsUncoveredTable-CZ4ie4gX.mjs";import Ve from"./packem_shared/selfRescheduleWithoutProgress-CQNZI4FA.mjs";import Qe from"./packem_shared/shapeTargetsGlobalTable-Bu3eEDic.mjs";import Xe from"./packem_shared/shapeUnknownTable-CREfNnWi.mjs";import Ze from"./packem_shared/signupMutationWithoutDisposableGating-BdKwtxDP.mjs";import Je from"./packem_shared/softDeleteIncludeDeletedFromArgs-C7Ugg4zb.mjs";import Ye from"./packem_shared/sqlInjectionRisk-BBWvOBtw.mjs";import eo from"./packem_shared/storageGenerateUploadUrlNoContentTypePin-CrwFuo83.mjs";import oo from"./packem_shared/storageKeyFromUserArgs-3vkxmI3v.mjs";import ro from"./packem_shared/storagePresignedUrlForPrivateContent-C3KeV5tV.mjs";import to from"./packem_shared/storageUploadWithoutContentTypeAllowlist-BXoK_QWE.mjs";import io from"./packem_shared/storageUploadWithoutMaxSize-CW7uKvSi.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-lnb5nmM6.mjs";import{s as lo,q as po,c as fo}from"./packem_shared/helpers-DdZ_pyR3.mjs";import co from"./packem_shared/unboundedCollectOnOpenRange-DHy2RUL7.mjs";import uo from"./packem_shared/unboundedLoop-DxN3_apu.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-D4TZEpgz.mjs";import wo from"./packem_shared/vectorsNamespaceFromUserInput-CFa2qhFU.mjs";import vo from"./packem_shared/workflowDuplicateStepName-B6eAJzwA.mjs";import Ao from"./packem_shared/workflowUnknownTarget-DEKB5H0g.mjs";import Ro from"./packem_shared/workflowUnused-DHwwE-1P.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};
@@ -0,0 +1 @@
1
+ import{e as r}from"./finding-NrKO8idM.mjs";const o=(d,i)=>d.length>i.length?!1:d.every((n,s)=>n===i[s]),l={categories:["PERFORMANCE"],description:"A secondary index is redundant because another index already covers every lookup it serves (its columns are a leading prefix of the other's). The redundant index costs storage and is maintained on every write for no read benefit.",facing:"INTERNAL",level:"INFO",name:"duplicate_index",remediation:"Drop the redundant index; the covering index already serves its lookups.",run:d=>{const i=[];for(const n of d.schema.tables){const s=n.indexes.filter(e=>e.kind==="index");for(const e of s){if(e.unique===!0)continue;const t=s.find(a=>a===e||!o(e.fields,a.fields)?!1:e.fields.length===a.fields.length?a.unique===!0||e.name>a.name:!0);t&&i.push(r(l,{cacheKey:`duplicate_index:${n.name}:${e.name}`,detail:`Index "${e.name}" on table "${n.name}" (${e.fields.join(", ")}) is redundant — index "${t.name}" (${t.fields.join(", ")}) already covers its lookups.`,metadata:{coveredBy:{fields:t.fields,name:t.name},fields:e.fields,index:e.name,table:n.name}}))}}return i},source:"static",title:"Duplicate / redundant index"};export{l as default};
@@ -0,0 +1 @@
1
+ import{e as n}from"./finding-NrKO8idM.mjs";const d=25,i={categories:["PERFORMANCE"],description:"Recorded reads show an index the workload doesn't pay for: either a declared index no read ever used (dead overhead on every write) or a table read hot with no index at all (a repeated full scan that degrades as it grows).",facing:"INTERNAL",level:"INFO",name:"index_utilization",remediation:"Before dropping an index that reads as dead, check it is unused on every shard; then drop it so writes stop maintaining it. Add an index covering the hot full-scanned table's read predicate so the read stops scanning every row.",run:t=>{const a=[];for(const e of t.indexHits??[])e.reads>0||a.push(n(i,{cacheKey:`index_utilization:dead_index:${e.table}:${e.index}`,detail:`Index "${e.index}" on table "${e.table}" has recorded no reads on the inspected shard since its counter was created — every write maintains it and nothing on this shard reads through it.`,metadata:{index:e.index,kind:"dead_index",reads:e.reads,table:e.table}}));for(const e of t.tableScans??[])e.scans<d||a.push(n(i,{cacheKey:`index_utilization:hot_scan:${e.table}`,detail:`Table "${e.table}" has been full-scanned ${e.scans.toString()} times (cumulative) with no index — a repeated full scan that degrades linearly as "${e.table}" grows. Add an index covering the read predicate.`,facing:"EXTERNAL",level:"WARN",metadata:{kind:"hot_scan",scans:e.scans,table:e.table}}));return a},source:"runtime",title:"Index utilization"};export{i as default};
@@ -1 +1 @@
1
- import{e as n}from"./finding-NrKO8idM.mjs";import{a as i,c as l}from"./helpers-DdZ_pyR3.mjs";const r=3600,s={categories:["SECURITY"],description:"A payment webhook adapter configured with an implausibly wide `webhookToleranceSeconds` (over an hour). The timestamp tolerance is the webhook replay window; widening it far past the 300s default keeps captured signed events replayable long after capture, defeating the replay check.",facing:"EXTERNAL",level:"WARN",name:"payment_webhook_wide_tolerance",remediation:"Keep `webhookToleranceSeconds` at or near the 300s default — just enough for clock skew. If a wide window was set to work around retries or backfills, handle those with idempotency on the event id instead, not by loosening the replay-window guard.",run:t=>{if(t.paymentWebhooks===void 0)return[];const a=e=>e.toleranceSeconds!==void 0&&e.toleranceSeconds>=r;return t.paymentWebhooks.filter(e=>a(e)).map(e=>{const o=i(e);return n(s,{cacheKey:`payment_webhook_wide_tolerance:${e.file}:${e.line.toString()}`,detail:`\`${e.callee}\` in ${o} sets \`webhookToleranceSeconds\` to ${(e.toleranceSeconds??0).toString()}s (default 300s). That replay window keeps captured signed events valid long after capture.`,metadata:{callee:e.callee,...l(e),toleranceSeconds:e.toleranceSeconds}})})},source:"static",title:"Payment webhook replay-tolerance window is implausibly wide"};export{s as default};
1
+ import{e as n}from"./finding-NrKO8idM.mjs";import{a as i,c as l}from"./helpers-DdZ_pyR3.mjs";const r=3600,s={categories:["SECURITY"],description:"A payment webhook adapter configured with an implausibly wide `webhookToleranceSeconds` (over an hour). The timestamp tolerance is the webhook replay window; widening it far past the 300s default keeps captured signed events replayable long after capture, defeating the replay check.",facing:"EXTERNAL",level:"WARN",name:"payment_webhook_wide_tolerance",remediation:"Keep `webhookToleranceSeconds` at or near the 300s default — just enough for clock skew. If a wide window was set to work around retries or backfills, handle those with idempotency on the event id instead, not by loosening the replay-window guard.",run:t=>{if(t.paymentWebhooks===void 0)return[];const a=e=>e.toleranceSeconds!==void 0&&e.toleranceSeconds>r;return t.paymentWebhooks.filter(e=>a(e)).map(e=>{const o=i(e);return n(s,{cacheKey:`payment_webhook_wide_tolerance:${e.file}:${e.line.toString()}`,detail:`\`${e.callee}\` in ${o} sets \`webhookToleranceSeconds\` to ${(e.toleranceSeconds??0).toString()}s (default 300s). That replay window keeps captured signed events valid long after capture.`,metadata:{callee:e.callee,...l(e),toleranceSeconds:e.toleranceSeconds}})})},source:"static",title:"Payment webhook replay-tolerance window is implausibly wide"};export{s as default};
@@ -0,0 +1 @@
1
+ import{e as s}from"./finding-NrKO8idM.mjs";import{c as i,a}from"./helpers-DdZ_pyR3.mjs";const n={categories:["SECURITY"],description:"A `ctx.sql.query(text, params)` / `ctx.sql.unsafe(text, params)` call builds its SQL `text` from non-constant values. The driver binds only `params` and runs `text` verbatim, so request input in the text reopens SQL injection.",facing:"EXTERNAL",level:"ERROR",name:"sql_injection_risk",remediation:"Keep the SQL text constant and pass every value through the `params` array (`$1`, `$2`, …) so the driver binds it. Never build SQL text from request input.",run:e=>e.sqlInterpolations===void 0?[]:e.sqlInterpolations.map(t=>s(n,{cacheKey:`sql_injection_risk:${t.file}:${t.line.toString()}`,detail:`\`ctx.sql\` in ${a(t)} builds its SQL text from a non-constant value instead of passing it in \`params\` — a SQL-injection vector. Keep the text constant and bind the value through \`params\`.`,metadata:{...i(t)}})),source:"static",title:"Possible SQL injection in ctx.sql text"};export{n as default};
@@ -0,0 +1 @@
1
+ import{isReachableSite as a}from"./callSiteCallers-DArHfQSU.mjs";import{e as n}from"./finding-NrKO8idM.mjs";const s=new Set(["insert","insertMany","insertManyUnsafe","upsert","upsertMany"]),r={categories:["SCHEMA"],description:'No function inserts into this table via `ctx.db.insert("<table>", …)`, the `ctx.db.<table>` facade, or `insertMany`. It may be read-only by design (seeded by a migration, replicated, or written through a path the advisor can\'t see) — or it may be dead schema.',facing:"INTERNAL",level:"INFO",name:"table_without_insert",remediation:'If the table should be writable, add a mutation that inserts into it with `ctx.db.insert("<table>", …)` or `ctx.db.<table>.insert(…)`. If it is read-only or seeded elsewhere, this advisory can be ignored.',run:t=>{if(t.inserts===void 0)return[];const i=new Set([...t.inserts.filter(e=>e.table!==""&&a(e.scope)),...(t.tableWrites??[]).filter(e=>s.has(e.method)&&e.table!==""&&a(e.scope))].map(e=>e.table));return t.schema.tables.filter(e=>!i.has(e.name)&&e.externallyManaged!==!0).map(e=>n(r,{cacheKey:`table_without_insert:${e.name}`,detail:`No function inserts into "${e.name}" via \`ctx.db.insert("${e.name}", …)\`, \`ctx.db.${e.name}.insert\`, \`ctx.db.${e.name}.upsert\` or \`insertMany\` — table "${e.name}" has no discovered insert path.`,metadata:{table:e.name}}))},source:"static",title:"Table has no insert path"};export{r as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/advisor",
3
- "version": "1.0.0-alpha.290",
3
+ "version": "1.0.0-alpha.291",
4
4
  "description": "Schema & query lints (splinter-style advisors) for Lunora, feeding the Studio Advisors view",
5
5
  "keywords": [
6
6
  "advisor",
@@ -1 +0,0 @@
1
- import{e as r}from"./finding-NrKO8idM.mjs";const o=(a,i)=>a.length>i.length?!1:a.every((n,d)=>n===i[d]),l={categories:["PERFORMANCE"],description:"A secondary index is redundant because another index already covers every lookup it serves (its columns are a leading prefix of the other's). The redundant index costs storage and is maintained on every write for no read benefit.",facing:"INTERNAL",level:"INFO",name:"duplicate_index",remediation:"Drop the redundant index; the covering index already serves its lookups.",run:a=>{const i=[];for(const n of a.schema.tables){const d=n.indexes.filter(e=>e.kind==="index");for(const e of d){if(e.unique===!0)continue;const t=d.find(s=>s===e||!o(e.fields,s.fields)?!1:e.fields.length===s.fields.length?e.name>s.name:!0);t&&i.push(r(l,{cacheKey:`duplicate_index:${n.name}:${e.name}`,detail:`Index "${e.name}" on table "${n.name}" (${e.fields.join(", ")}) is redundant — index "${t.name}" (${t.fields.join(", ")}) already covers its lookups.`,metadata:{coveredBy:{fields:t.fields,name:t.name},fields:e.fields,index:e.name,table:n.name}}))}}return i},source:"static",title:"Duplicate / redundant index"};export{l as default};
@@ -1 +0,0 @@
1
- import{e as n}from"./finding-NrKO8idM.mjs";const d=25,i={categories:["PERFORMANCE"],description:"Recorded reads show an index the workload doesn't pay for: either a declared index no read ever used (dead overhead on every write) or a table read hot with no index at all (a repeated full scan that degrades as it grows).",facing:"INTERNAL",level:"INFO",name:"index_utilization",remediation:"Drop a dead index so writes stop maintaining it; add an index covering the hot full-scanned table's read predicate so the read stops scanning every row.",run:t=>{const a=[];for(const e of t.indexHits??[])e.reads>0||a.push(n(i,{cacheKey:`index_utilization:dead_index:${e.table}:${e.index}`,detail:`Index "${e.index}" on table "${e.table}" has recorded no reads since its counter was created — it's dead overhead: every write maintains it and nothing reads through it.`,metadata:{index:e.index,kind:"dead_index",reads:e.reads,table:e.table}}));for(const e of t.tableScans??[])e.scans<d||a.push(n(i,{cacheKey:`index_utilization:hot_scan:${e.table}`,detail:`Table "${e.table}" has been full-scanned ${e.scans.toString()} times (cumulative) with no index — a repeated full scan that degrades linearly as "${e.table}" grows. Add an index covering the read predicate.`,facing:"EXTERNAL",level:"WARN",metadata:{kind:"hot_scan",scans:e.scans,table:e.table}}));return a},source:"runtime",title:"Index utilization"};export{i as default};
@@ -1 +0,0 @@
1
- import{e as i}from"./finding-NrKO8idM.mjs";import{c as n,a}from"./helpers-DdZ_pyR3.mjs";const s={categories:["SECURITY"],description:"A `ctx.sql` tagged-template interpolates an unparameterized string-building expression (concatenation or nested template) instead of a bound value — splicing raw text into the query and reopening SQL injection.",facing:"EXTERNAL",level:"ERROR",name:"sql_injection_risk",remediation:"Pass the value through a bound placeholder so the driver parameterizes it — keep request input inside a `ctx.sql` placeholder instead of concatenating it into the query string. Never build SQL text from request input by hand.",run:t=>t.sqlInterpolations===void 0?[]:t.sqlInterpolations.map(e=>i(s,{cacheKey:`sql_injection_risk:${e.file}:${e.line.toString()}`,detail:`\`ctx.sql\` in ${a(e)} interpolates a string-building expression instead of a bound value — a SQL-injection vector. Pass the value through a bound placeholder so the driver parameterizes it.`,metadata:{...n(e)}})),source:"static",title:"Possible SQL injection in ctx.sql interpolation"};export{s as default};
@@ -1 +0,0 @@
1
- import{isReachableSite as i}from"./callSiteCallers-DArHfQSU.mjs";import{e as s}from"./finding-NrKO8idM.mjs";const r={categories:["SCHEMA"],description:'No function inserts into this table via `ctx.db.insert("<table>", …)`. It may be read-only by design (seeded by a migration, replicated, or written through a path the advisor can\'t see) — or it may be dead schema.',facing:"INTERNAL",level:"INFO",name:"table_without_insert",remediation:'If the table should be writable, add a mutation that calls `ctx.db.insert("<table>", …)`. If it is read-only or seeded elsewhere, this advisory can be ignored.',run:t=>{if(t.inserts===void 0)return[];const a=new Set(t.inserts.filter(e=>e.table!==""&&i(e.scope)).map(e=>e.table));return t.schema.tables.filter(e=>!a.has(e.name)&&e.externallyManaged!==!0).map(e=>s(r,{cacheKey:`table_without_insert:${e.name}`,detail:`No function calls \`ctx.db.insert("${e.name}", …)\` — table "${e.name}" has no discovered insert path.`,metadata:{table:e.name}}))},source:"static",title:"Table has no insert path"};export{r as default};