@lunora/advisor 1.0.0-alpha.205 → 1.0.0-alpha.206
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.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-B4ZaOBlW.mjs";import b from"./packem_shared/actionWithoutErrorHandling-4GCBT0_z.mjs";import y from"./packem_shared/adminRouteWithoutGuard-DPE7LuNh.mjs";import S from"./packem_shared/aiRawRunEscapeHatch-B5980eT9.mjs";import w from"./packem_shared/aiRunWithoutLogging-CvHHtEN9.mjs";import v from"./packem_shared/aiToolSideEffectPromptInjection-_3MrX9Ul.mjs";import A from"./packem_shared/aiUnboundedGenerationPublic-C17h6sMV.mjs";import R from"./packem_shared/allowUnauthenticatedShardAccessEnabled-BQufF5Kb.mjs";import U from"./packem_shared/authApiCallWithoutHeaders-D8U1hv8s.mjs";import W from"./packem_shared/authCsrfCheckDisabled-C6bxME5y.mjs";import T from"./packem_shared/authEmailVerificationDisabled-yROPDgn-.mjs";import I from"./packem_shared/authScimWithoutTransactions-w9qb3iBe.mjs";import k from"./packem_shared/authSecureCookiesDisabled-qrCktlch.mjs";import C from"./packem_shared/authSessionFreshageZero-BMisjIIS.mjs";import N from"./packem_shared/authTrustedOriginsWildcard-DFDpfN84.mjs";import x from"./packem_shared/browserAllowPrivateTargets-Cj5sizhv.mjs";import F from"./packem_shared/browserUserUrlWithoutAllowlist-CcK27rvt.mjs";import M from"./packem_shared/circularFk-DtcWFJxK.mjs";import O from"./packem_shared/commitOrderedHardDelete-BPdwOKA7.mjs";import D from"./packem_shared/containerInstanceKeyFromUserInput-DBdjUnQb.mjs";import $ from"./packem_shared/containerOversizedInstance-Bx89uR7E.mjs";import E from"./packem_shared/containerPublicInternet-BFfZf_P4.mjs";import P from"./packem_shared/containerRuntimeEgressRelaxation-CioCA2zY.mjs";import K from"./packem_shared/containerStartEnableInternetOverride-C6dbznku.mjs";import L from"./packem_shared/crossModuleTableWrite-DjiVTAwK.mjs";import q from"./packem_shared/dispatchCycle-CWc5Q0cd.mjs";import G from"./packem_shared/duplicateIndex-Cip6-Rpu.mjs";import _ from"./packem_shared/emptyIndex-BnHDcXza.mjs";import z from"./packem_shared/errorWithoutCatalog-BTfvaXHR.mjs";import H from"./packem_shared/exportSinkMisconfigured-JfbAx9AI.mjs";import B from"./packem_shared/externalSourceIncrementalNoDeletePath-BCzm3HzF.mjs";import j from"./packem_shared/externalSourceOnGlobal-CH7xbJ49.mjs";import V from"./packem_shared/externalSourceUnscoped-BxU2uSXk.mjs";import Q from"./packem_shared/filterOnPrimaryKey-DbFriOZA.mjs";import X from"./packem_shared/filterWithoutIndex-Dc7Nn0y2.mjs";import Z from"./packem_shared/flagGatesSecurityWithUnsafeDefault-DB9M6hLM.mjs";import J from"./packem_shared/flagReadInSubscription-DabIhYGD.mjs";import Y from"./packem_shared/geoIndexFieldNotGeopoint-CDMNbAfp.mjs";import oo from"./packem_shared/geoIndexUnused-D7C9Qr4U.mjs";import eo from"./packem_shared/globalTableNearColumnLimit-BFbBBd6A.mjs";import ro from"./packem_shared/hardcodedSecret-Bw_4FYrs.mjs";import to from"./packem_shared/httpActionMissingAuthGuard-BhvcmkwW.mjs";import io from"./packem_shared/httpActionResponseHeaderInjection-DKz2SlCa.mjs";import no from"./packem_shared/hyperdriveOutsideAction-CPDdGP2g.mjs";import ao from"./packem_shared/identityUndeclaredClaimTrusted-CAUagXkJ.mjs";import mo from"./packem_shared/imagesUrlSourceFromUserInput-C2CJTTCI.mjs";import lo from"./packem_shared/indexReferencesUnknownField-Dm8SL4Tp.mjs";import so from"./packem_shared/insertManyUnsafeUserData-DWE8d_DF.mjs";import po from"./packem_shared/kvUnscopedUserKeyIdor-CXFKAyM2.mjs";import fo from"./packem_shared/mailInboundDispatchWithoutVerify-CWwqXyPX.mjs";import co from"./packem_shared/mailRecipientFromRequestInput-CQZeOsP9.mjs";import uo from"./packem_shared/maskUncoveredPiiColumn-axEka4nd.mjs";import ho from"./packem_shared/maskWeakHashStrategyOnPii-njstapQY.mjs";import go from"./packem_shared/maskedRelationLeakViaWith-CIFij6vE.mjs";import{e as a}from"./packem_shared/finding-NrKO8idM.mjs";import bo from"./packem_shared/mutatorFullRowReplace-BzRpZ47r.mjs";import yo from"./packem_shared/mutatorWithoutOwnerScope-BoS81ns0.mjs";import So from"./packem_shared/nondeterministicQueryMutation-sxmixc0l.mjs";import wo from"./packem_shared/normalizeIdUsedAsAuthorization-BXN-Can6.mjs";import vo from"./packem_shared/notifyMissingPushConfig-DeQMoNwm.mjs";import Ao from"./packem_shared/notifySendOutsideAction-BJrDkr4h.mjs";import Ro from"./packem_shared/outputProjectionMissingOnPublicRead-DHivs_73.mjs";import Uo from"./packem_shared/ownerFieldFromArgsNotAuth-lgjS8mdd.mjs";import Wo from"./packem_shared/paymentCreateWithoutAuthorize-CICGmRFR.mjs";import To from"./packem_shared/paymentWebhookWideTolerance-CtZb2AVA.mjs";import Io from"./packem_shared/plaintextSecretInWranglerVariables-bNkqmNqV.mjs";import ko from"./packem_shared/policyReferencesUnknownTable-CIKuRZ5Y.mjs";import Co from"./packem_shared/privilegedDispatchUnvalidatedPayload-DlJovHrt.mjs";import No from"./packem_shared/privilegedFanoutFromPublicProcedure-DV188gHQ.mjs";import xo from"./packem_shared/procedureWithoutStructuredEvent-CZ_B23nM.mjs";import Fo from"./packem_shared/publicArgumentUsesAny-BDEvMA8Q.mjs";import Mo from"./packem_shared/publicMutationWithoutRatelimit-BeYapu1F.mjs";import Oo from"./packem_shared/publicTableRlsOptoutConfusion-BFmh1kH0.mjs";import Do from"./packem_shared/queueWithoutDlq-BvHz3Opg.mjs";import $o from"./packem_shared/r2sqlOutsideAction-BdLiLOAX.mjs";import Eo from"./packem_shared/ratelimitDefaultMemoryStore-Dj0Kk7t9.mjs";import Po from"./packem_shared/ratelimitKeySpoofableOrGlobal-DlvJfSXs.mjs";import Ko from"./packem_shared/ratelimitMiddlewareFailOpen-DGtyt-pc.mjs";import Lo from"./packem_shared/relationReferencesUnknownField-CqGEJD57.mjs";import qo from"./packem_shared/relationReferencesUnknownTable-CP4aWtAJ.mjs";import Go from"./packem_shared/rlsUncoveredTable-CZ4ie4gX.mjs";import _o from"./packem_shared/shapeTargetsGlobalTable-Bu3eEDic.mjs";import zo from"./packem_shared/shapeUnknownTable-CREfNnWi.mjs";import Ho from"./packem_shared/signupMutationWithoutDisposableGating-CFtFMJz8.mjs";import Bo from"./packem_shared/softDeleteIncludeDeletedFromArgs-C7Ugg4zb.mjs";import jo from"./packem_shared/sqlInjectionRisk-y-7c46LJ.mjs";import Vo from"./packem_shared/storageGenerateUploadUrlNoContentTypePin-Bx9oGOjM.mjs";import Qo from"./packem_shared/storageKeyFromUserArgs-BryKJJM-.mjs";import Xo from"./packem_shared/storagePresignedUrlForPrivateContent-lqE6LvNu.mjs";import Zo from"./packem_shared/storageUploadWithoutContentTypeAllowlist-DMr7w29r.mjs";import Jo from"./packem_shared/storageUploadWithoutMaxSize-rSNFNb2l.mjs";import Yo from"./packem_shared/tableWithoutInsert-ClJp_jDr.mjs";import oe from"./packem_shared/topicTooManySubscriptions-CiZhFm9r.mjs";import ee from"./packem_shared/ttlFieldNotTimestamp-Dxa-6RfM.mjs";import{s as re,q as te,c as ie}from"./packem_shared/helpers-BmppB5nL.mjs";import ne from"./packem_shared/unboundedLoop-BqbZ7boE.mjs";import ae from"./packem_shared/unboundedStringArgument-jZnCbwB0.mjs";import me from"./packem_shared/unindexedForeignKey-Dypgn8uH.mjs";import le from"./packem_shared/unindexedRelationTarget-CSqRJWYZ.mjs";import se from"./packem_shared/unrestrictedWhereBranch-CcIBmHik.mjs";import pe from"./packem_shared/userCreatingMutationWithoutCaptcha-C8yaqIIj.mjs";import fe from"./packem_shared/vectorsNamespaceFromUserInput-7I_Kwxvp.mjs";import ce from"./packem_shared/workflowDuplicateStepName-B6eAJzwA.mjs";import de from"./packem_shared/workflowUnknownTarget-Cm1hfTTs.mjs";import ue from"./packem_shared/workflowUnused-DHwwE-1P.mjs";import{callSiteCallers as Wt,callSiteDescription as Tt,callSiteLabel as It,callSiteMetadata as kt,helperRole as Ct,isReachableSite as Nt,readCallSiteCallers as xt}from"./packem_shared/callSiteCallers-DArHfQSU.mjs";import{compareToBaseline as Mt,parseAdvisorMap as Ot}from"./packem_shared/compareToBaseline-CUG59IOy.mjs";import{gradeFromScore as $t}from"./packem_shared/gradeFromScore-KSt58rj1.mjs";import{MAP_VERSION as Pt,byCodepoint as Kt,scoreAdvisor as Lt}from"./packem_shared/MAP_VERSION-MQ5W2B6n.mjs";import{default as Gt}from"./packem_shared/classifySensitivity-JnjaTGYi.mjs";import{fromServerSchema as zt}from"./packem_shared/fromServerSchema-fAymN8o2.mjs";const he={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 \`${he[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"},ge=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`}]]),be={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=re(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}=ge.get(t??"")??be,p=te(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:{...ie(e),shardKind:t??"unknown",table:e.table}}))}return o},source:"static",title:"Unbounded collect"},ye=[lo,qo,Lo,de,ce,zo,B,j,V,_,eo,z,Y,oo,H,ee,O,M,L,me,le,G,Yo,ue,Do,oe,Q,X,l,ne,q,_o,bo,yo,So,no,$o,U,ko,Go,uo,ho,$,E,Mo,se,pe,Ho,Fo,ae,ro,jo,y,Wo,fo,Eo,x,No,xo,so,A,g,b,Uo,Qo,po,D,S,w,fe,co,F,Co,K,P,I,N,W,k,T,C,mo,Po,Oo,R,Zo,Jo,Vo,Xo,to,io,Ko,Z,J,v,ao,To,Bo,go,Ro,wo,Ao,vo,Io,m],Se=[u,h,d],we=[...ye,...Se],At=(r,o={})=>{const i=o.lints??we,e=[];for(const t of i)o.source!==void 0&&t.source!==o.source||e.push(...t.run(r));return c(e)};export{we as ALL_LINTS,Pt as MAP_VERSION,Se as RUNTIME_LINTS,ye 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,T as authEmailVerificationDisabled,I as authScimWithoutTransactions,k as authSecureCookiesDisabled,C as authSessionFreshageZero,N as authTrustedOriginsWildcard,x as browserAllowPrivateTargets,F as browserUserUrlWithoutAllowlist,Kt as byCodepoint,Wt as callSiteCallers,Tt as callSiteDescription,It as callSiteLabel,kt as callSiteMetadata,M as circularFk,Gt as classifySensitivity,O as commitOrderedHardDelete,Mt as compareToBaseline,D as containerInstanceKeyFromUserInput,$ as containerOversizedInstance,E as containerPublicInternet,P as containerRuntimeEgressRelaxation,K as containerStartEnableInternetOverride,L as crossModuleTableWrite,c as dedupeCacheKeys,q as dispatchCycle,G as duplicateIndex,_ as emptyIndex,z as errorWithoutCatalog,H as exportSinkMisconfigured,B as externalSourceIncrementalNoDeletePath,j as externalSourceOnGlobal,V as externalSourceUnscoped,d as fanOutBreadth,Q as filterOnPrimaryKey,X as filterWithoutIndex,Z as flagGatesSecurityWithUnsafeDefault,J as flagReadInSubscription,zt as fromServerSchema,Y as geoIndexFieldNotGeopoint,oo as geoIndexUnused,eo as globalTableNearColumnLimit,$t as gradeFromScore,ro as hardcodedSecret,Ct as helperRole,u as hotShard,to as httpActionMissingAuthGuard,io as httpActionResponseHeaderInjection,no as hyperdriveOutsideAction,ao as identityUndeclaredClaimTrusted,mo as imagesUrlSourceFromUserInput,lo as indexReferencesUnknownField,h as indexUtilization,so as insertManyUnsafeUserData,Nt as isReachableSite,po as kvUnscopedUserKeyIdor,fo as mailInboundDispatchWithoutVerify,co as mailRecipientFromRequestInput,uo as maskUncoveredPiiColumn,ho as maskWeakHashStrategyOnPii,go as maskedRelationLeakViaWith,bo as mutatorFullRowReplace,yo as mutatorWithoutOwnerScope,So as nondeterministicQueryMutation,wo as normalizeIdUsedAsAuthorization,vo as notifyMissingPushConfig,Ao as notifySendOutsideAction,Ro as outputProjectionMissingOnPublicRead,Uo as ownerFieldFromArgsNotAuth,Ot as parseAdvisorMap,Wo as paymentCreateWithoutAuthorize,To as paymentWebhookWideTolerance,Io as plaintextSecretInWranglerVariables,ko as policyReferencesUnknownTable,Co as privilegedDispatchUnvalidatedPayload,No as privilegedFanoutFromPublicProcedure,xo as procedureWithoutStructuredEvent,Fo as publicArgumentUsesAny,Mo as publicMutationWithoutRatelimit,Oo as publicTableRlsOptoutConfusion,Do as queueWithoutDlq,$o as r2sqlOutsideAction,Eo as ratelimitDefaultMemoryStore,Po as ratelimitKeySpoofableOrGlobal,Ko as ratelimitMiddlewareFailOpen,xt as readCallSiteCallers,Lo as relationReferencesUnknownField,qo as relationReferencesUnknownTable,Go as rlsUncoveredTable,At as runAdvisor,Lt as scoreAdvisor,_o as shapeTargetsGlobalTable,zo as shapeUnknownTable,Ho as signupMutationWithoutDisposableGating,Bo as softDeleteIncludeDeletedFromArgs,jo as sqlInjectionRisk,Vo as storageGenerateUploadUrlNoContentTypePin,Qo as storageKeyFromUserArgs,Xo as storagePresignedUrlForPrivateContent,Zo as storageUploadWithoutContentTypeAllowlist,Jo as storageUploadWithoutMaxSize,Yo as tableWithoutInsert,oe as topicTooManySubscriptions,ee as ttlFieldNotTimestamp,ne as unboundedLoop,ae as unboundedStringArgument,me as unindexedForeignKey,le as unindexedRelationTarget,se as unrestrictedWhereBranch,pe as userCreatingMutationWithoutCaptcha,fe as vectorsNamespaceFromUserInput,ce as workflowDuplicateStepName,de as workflowUnknownTarget,ue 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-CkVPZcVe.mjs";import g from"./packem_shared/actionFetchSsrf-B4ZaOBlW.mjs";import b from"./packem_shared/actionWithoutErrorHandling-4GCBT0_z.mjs";import y from"./packem_shared/adminRouteWithoutGuard-DPE7LuNh.mjs";import S from"./packem_shared/aiRawRunEscapeHatch-B5980eT9.mjs";import w from"./packem_shared/aiRunWithoutLogging-CvHHtEN9.mjs";import v from"./packem_shared/aiToolSideEffectPromptInjection-_3MrX9Ul.mjs";import A from"./packem_shared/aiUnboundedGenerationPublic-C17h6sMV.mjs";import R from"./packem_shared/allowUnauthenticatedShardAccessEnabled-BQufF5Kb.mjs";import U from"./packem_shared/authApiCallWithoutHeaders-D8U1hv8s.mjs";import W from"./packem_shared/authCsrfCheckDisabled-C6bxME5y.mjs";import T from"./packem_shared/authEmailVerificationDisabled-yROPDgn-.mjs";import I from"./packem_shared/authScimWithoutTransactions-w9qb3iBe.mjs";import k from"./packem_shared/authSecureCookiesDisabled-qrCktlch.mjs";import C from"./packem_shared/authSessionFreshageZero-BMisjIIS.mjs";import N from"./packem_shared/authTrustedOriginsWildcard-DFDpfN84.mjs";import x from"./packem_shared/browserAllowPrivateTargets-Cj5sizhv.mjs";import F from"./packem_shared/browserUserUrlWithoutAllowlist-CcK27rvt.mjs";import M from"./packem_shared/circularFk-DtcWFJxK.mjs";import O from"./packem_shared/commitOrderedHardDelete-BPdwOKA7.mjs";import D from"./packem_shared/containerInstanceKeyFromUserInput-DBdjUnQb.mjs";import $ from"./packem_shared/containerOversizedInstance-Bx89uR7E.mjs";import E from"./packem_shared/containerPublicInternet-BFfZf_P4.mjs";import P from"./packem_shared/containerRuntimeEgressRelaxation-CioCA2zY.mjs";import K from"./packem_shared/containerStartEnableInternetOverride-C6dbznku.mjs";import L from"./packem_shared/crossModuleTableWrite-DjiVTAwK.mjs";import q from"./packem_shared/dispatchCycle-CWc5Q0cd.mjs";import G from"./packem_shared/duplicateIndex-Cip6-Rpu.mjs";import _ from"./packem_shared/emptyIndex-BnHDcXza.mjs";import z from"./packem_shared/errorWithoutCatalog-BTfvaXHR.mjs";import H from"./packem_shared/exportSinkMisconfigured-JfbAx9AI.mjs";import B from"./packem_shared/externalSourceIncrementalNoDeletePath-BCzm3HzF.mjs";import j from"./packem_shared/externalSourceOnGlobal-CH7xbJ49.mjs";import V from"./packem_shared/externalSourceUnscoped-BxU2uSXk.mjs";import Q from"./packem_shared/filterOnPrimaryKey-DbFriOZA.mjs";import X from"./packem_shared/filterWithoutIndex-Dc7Nn0y2.mjs";import Z from"./packem_shared/flagGatesSecurityWithUnsafeDefault-DB9M6hLM.mjs";import J from"./packem_shared/flagReadInSubscription-DabIhYGD.mjs";import Y from"./packem_shared/geoIndexFieldNotGeopoint-CDMNbAfp.mjs";import oo from"./packem_shared/geoIndexUnused-D7C9Qr4U.mjs";import eo from"./packem_shared/globalTableNearColumnLimit-BFbBBd6A.mjs";import ro from"./packem_shared/hardcodedSecret-Bw_4FYrs.mjs";import to from"./packem_shared/httpActionMissingAuthGuard-BhvcmkwW.mjs";import io from"./packem_shared/httpActionResponseHeaderInjection-DKz2SlCa.mjs";import no from"./packem_shared/hyperdriveOutsideAction-CPDdGP2g.mjs";import ao from"./packem_shared/identityUndeclaredClaimTrusted-CAUagXkJ.mjs";import mo from"./packem_shared/imagesUrlSourceFromUserInput-C2CJTTCI.mjs";import lo from"./packem_shared/indexReferencesUnknownField-Dm8SL4Tp.mjs";import so from"./packem_shared/insertManyUnsafeUserData-DWE8d_DF.mjs";import po from"./packem_shared/kvUnscopedUserKeyIdor-CXFKAyM2.mjs";import fo from"./packem_shared/mailInboundDispatchWithoutVerify-CWwqXyPX.mjs";import co from"./packem_shared/mailRecipientFromRequestInput-CQZeOsP9.mjs";import uo from"./packem_shared/maskUncoveredPiiColumn-axEka4nd.mjs";import ho from"./packem_shared/maskWeakHashStrategyOnPii-njstapQY.mjs";import go from"./packem_shared/maskedRelationLeakViaWith-CIFij6vE.mjs";import{e as a}from"./packem_shared/finding-NrKO8idM.mjs";import bo from"./packem_shared/mutatorFullRowReplace-BzRpZ47r.mjs";import yo from"./packem_shared/mutatorWithoutOwnerScope-BoS81ns0.mjs";import So from"./packem_shared/nondeterministicQueryMutation-Bbb-AGOS.mjs";import wo from"./packem_shared/normalizeIdUsedAsAuthorization-BXN-Can6.mjs";import vo from"./packem_shared/notifyMissingPushConfig-DeQMoNwm.mjs";import Ao from"./packem_shared/notifySendOutsideAction-BJrDkr4h.mjs";import Ro from"./packem_shared/outputProjectionMissingOnPublicRead-DHivs_73.mjs";import Uo from"./packem_shared/ownerFieldFromArgsNotAuth-lgjS8mdd.mjs";import Wo from"./packem_shared/paymentCreateWithoutAuthorize-CICGmRFR.mjs";import To from"./packem_shared/paymentWebhookWideTolerance-CtZb2AVA.mjs";import Io from"./packem_shared/plaintextSecretInWranglerVariables-bNkqmNqV.mjs";import ko from"./packem_shared/policyReferencesUnknownTable-CIKuRZ5Y.mjs";import Co from"./packem_shared/privilegedDispatchUnvalidatedPayload-DlJovHrt.mjs";import No from"./packem_shared/privilegedFanoutFromPublicProcedure-DV188gHQ.mjs";import xo from"./packem_shared/procedureWithoutStructuredEvent-CZ_B23nM.mjs";import Fo from"./packem_shared/publicArgumentUsesAny-BDEvMA8Q.mjs";import Mo from"./packem_shared/publicMutationWithoutRatelimit-BeYapu1F.mjs";import Oo from"./packem_shared/publicTableRlsOptoutConfusion-BFmh1kH0.mjs";import Do from"./packem_shared/queueWithoutDlq-BvHz3Opg.mjs";import $o from"./packem_shared/r2sqlOutsideAction-BdLiLOAX.mjs";import Eo from"./packem_shared/ratelimitDefaultMemoryStore-Dj0Kk7t9.mjs";import Po from"./packem_shared/ratelimitKeySpoofableOrGlobal-DlvJfSXs.mjs";import Ko from"./packem_shared/ratelimitMiddlewareFailOpen-DGtyt-pc.mjs";import Lo from"./packem_shared/relationReferencesUnknownField-CqGEJD57.mjs";import qo from"./packem_shared/relationReferencesUnknownTable-CP4aWtAJ.mjs";import Go from"./packem_shared/rlsUncoveredTable-CZ4ie4gX.mjs";import _o from"./packem_shared/shapeTargetsGlobalTable-Bu3eEDic.mjs";import zo from"./packem_shared/shapeUnknownTable-CREfNnWi.mjs";import Ho from"./packem_shared/signupMutationWithoutDisposableGating-CFtFMJz8.mjs";import Bo from"./packem_shared/softDeleteIncludeDeletedFromArgs-C7Ugg4zb.mjs";import jo from"./packem_shared/sqlInjectionRisk-y-7c46LJ.mjs";import Vo from"./packem_shared/storageGenerateUploadUrlNoContentTypePin-Bx9oGOjM.mjs";import Qo from"./packem_shared/storageKeyFromUserArgs-BryKJJM-.mjs";import Xo from"./packem_shared/storagePresignedUrlForPrivateContent-lqE6LvNu.mjs";import Zo from"./packem_shared/storageUploadWithoutContentTypeAllowlist-DMr7w29r.mjs";import Jo from"./packem_shared/storageUploadWithoutMaxSize-rSNFNb2l.mjs";import Yo from"./packem_shared/tableWithoutInsert-ClJp_jDr.mjs";import oe from"./packem_shared/topicTooManySubscriptions-CiZhFm9r.mjs";import ee from"./packem_shared/ttlFieldNotTimestamp-Dxa-6RfM.mjs";import{s as re,q as te,c as ie}from"./packem_shared/helpers-BmppB5nL.mjs";import ne from"./packem_shared/unboundedLoop-BqbZ7boE.mjs";import ae from"./packem_shared/unboundedStringArgument-jZnCbwB0.mjs";import me from"./packem_shared/unindexedForeignKey-Dypgn8uH.mjs";import le from"./packem_shared/unindexedRelationTarget-CSqRJWYZ.mjs";import se from"./packem_shared/unrestrictedWhereBranch-CcIBmHik.mjs";import pe from"./packem_shared/userCreatingMutationWithoutCaptcha-C8yaqIIj.mjs";import fe from"./packem_shared/vectorsNamespaceFromUserInput-7I_Kwxvp.mjs";import ce from"./packem_shared/workflowDuplicateStepName-B6eAJzwA.mjs";import de from"./packem_shared/workflowUnknownTarget-Cm1hfTTs.mjs";import ue from"./packem_shared/workflowUnused-DHwwE-1P.mjs";import{callSiteCallers as Wt,callSiteDescription as Tt,callSiteLabel as It,callSiteMetadata as kt,helperRole as Ct,isReachableSite as Nt,readCallSiteCallers as xt}from"./packem_shared/callSiteCallers-DArHfQSU.mjs";import{compareToBaseline as Mt,parseAdvisorMap as Ot}from"./packem_shared/compareToBaseline-CUG59IOy.mjs";import{gradeFromScore as $t}from"./packem_shared/gradeFromScore-KSt58rj1.mjs";import{MAP_VERSION as Pt,byCodepoint as Kt,scoreAdvisor as Lt}from"./packem_shared/MAP_VERSION-MQ5W2B6n.mjs";import{default as Gt}from"./packem_shared/classifySensitivity-JnjaTGYi.mjs";import{fromServerSchema as zt}from"./packem_shared/fromServerSchema-fAymN8o2.mjs";const he={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 \`${he[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"},ge=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`}]]),be={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=re(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}=ge.get(t??"")??be,p=te(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:{...ie(e),shardKind:t??"unknown",table:e.table}}))}return o},source:"static",title:"Unbounded collect"},ye=[lo,qo,Lo,de,ce,zo,B,j,V,_,eo,z,Y,oo,H,ee,O,M,L,me,le,G,Yo,ue,Do,oe,Q,X,l,ne,q,_o,bo,yo,So,no,$o,U,ko,Go,uo,ho,$,E,Mo,se,pe,Ho,Fo,ae,ro,jo,y,Wo,fo,Eo,x,No,xo,so,A,g,b,Uo,Qo,po,D,S,w,fe,co,F,Co,K,P,I,N,W,k,T,C,mo,Po,Oo,R,Zo,Jo,Vo,Xo,to,io,Ko,Z,J,v,ao,To,Bo,go,Ro,wo,Ao,vo,Io,m],Se=[u,h,d],we=[...ye,...Se],At=(r,o={})=>{const i=o.lints??we,e=[];for(const t of i)o.source!==void 0&&t.source!==o.source||e.push(...t.run(r));return c(e)};export{we as ALL_LINTS,Pt as MAP_VERSION,Se as RUNTIME_LINTS,ye 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,T as authEmailVerificationDisabled,I as authScimWithoutTransactions,k as authSecureCookiesDisabled,C as authSessionFreshageZero,N as authTrustedOriginsWildcard,x as browserAllowPrivateTargets,F as browserUserUrlWithoutAllowlist,Kt as byCodepoint,Wt as callSiteCallers,Tt as callSiteDescription,It as callSiteLabel,kt as callSiteMetadata,M as circularFk,Gt as classifySensitivity,O as commitOrderedHardDelete,Mt as compareToBaseline,D as containerInstanceKeyFromUserInput,$ as containerOversizedInstance,E as containerPublicInternet,P as containerRuntimeEgressRelaxation,K as containerStartEnableInternetOverride,L as crossModuleTableWrite,c as dedupeCacheKeys,q as dispatchCycle,G as duplicateIndex,_ as emptyIndex,z as errorWithoutCatalog,H as exportSinkMisconfigured,B as externalSourceIncrementalNoDeletePath,j as externalSourceOnGlobal,V as externalSourceUnscoped,d as fanOutBreadth,Q as filterOnPrimaryKey,X as filterWithoutIndex,Z as flagGatesSecurityWithUnsafeDefault,J as flagReadInSubscription,zt as fromServerSchema,Y as geoIndexFieldNotGeopoint,oo as geoIndexUnused,eo as globalTableNearColumnLimit,$t as gradeFromScore,ro as hardcodedSecret,Ct as helperRole,u as hotShard,to as httpActionMissingAuthGuard,io as httpActionResponseHeaderInjection,no as hyperdriveOutsideAction,ao as identityUndeclaredClaimTrusted,mo as imagesUrlSourceFromUserInput,lo as indexReferencesUnknownField,h as indexUtilization,so as insertManyUnsafeUserData,Nt as isReachableSite,po as kvUnscopedUserKeyIdor,fo as mailInboundDispatchWithoutVerify,co as mailRecipientFromRequestInput,uo as maskUncoveredPiiColumn,ho as maskWeakHashStrategyOnPii,go as maskedRelationLeakViaWith,bo as mutatorFullRowReplace,yo as mutatorWithoutOwnerScope,So as nondeterministicQueryMutation,wo as normalizeIdUsedAsAuthorization,vo as notifyMissingPushConfig,Ao as notifySendOutsideAction,Ro as outputProjectionMissingOnPublicRead,Uo as ownerFieldFromArgsNotAuth,Ot as parseAdvisorMap,Wo as paymentCreateWithoutAuthorize,To as paymentWebhookWideTolerance,Io as plaintextSecretInWranglerVariables,ko as policyReferencesUnknownTable,Co as privilegedDispatchUnvalidatedPayload,No as privilegedFanoutFromPublicProcedure,xo as procedureWithoutStructuredEvent,Fo as publicArgumentUsesAny,Mo as publicMutationWithoutRatelimit,Oo as publicTableRlsOptoutConfusion,Do as queueWithoutDlq,$o as r2sqlOutsideAction,Eo as ratelimitDefaultMemoryStore,Po as ratelimitKeySpoofableOrGlobal,Ko as ratelimitMiddlewareFailOpen,xt as readCallSiteCallers,Lo as relationReferencesUnknownField,qo as relationReferencesUnknownTable,Go as rlsUncoveredTable,At as runAdvisor,Lt as scoreAdvisor,_o as shapeTargetsGlobalTable,zo as shapeUnknownTable,Ho as signupMutationWithoutDisposableGating,Bo as softDeleteIncludeDeletedFromArgs,jo as sqlInjectionRisk,Vo as storageGenerateUploadUrlNoContentTypePin,Qo as storageKeyFromUserArgs,Xo as storagePresignedUrlForPrivateContent,Zo as storageUploadWithoutContentTypeAllowlist,Jo as storageUploadWithoutMaxSize,Yo as tableWithoutInsert,oe as topicTooManySubscriptions,ee as ttlFieldNotTimestamp,ne as unboundedLoop,ae as unboundedStringArgument,me as unindexedForeignKey,le as unindexedRelationTarget,se as unrestrictedWhereBranch,pe as userCreatingMutationWithoutCaptcha,fe as vectorsNamespaceFromUserInput,ce as workflowDuplicateStepName,de as workflowUnknownTarget,ue as workflowUnused};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as u}from"./finding-NrKO8idM.mjs";const l=(t,n,a)=>t==="Date.now"||t==="new Date"?"Read the time through `ctx.now` instead: it is captured once when this run begins. A replay of the run captures it again, so a value that must survive a replay should come in as an argument.":t==="crypto.randomUUID"&&a==="mutation"?"Use `ctx.newId()` instead: a replay of the same call reproduces its ids. The ids are derived, not random, so a token or secret keeps `crypto.randomUUID()`.":a==="query"?"Compute it in an `action` and pass the value in as an argument. The query then reads a fixed input, so a re-run with the same arguments returns the same result.":`No action needed unless \`${n}\` is invoked from a workflow step or queue consumer that can itself replay.`,c={categories:["SCHEMA"],description:"A `query`/`mutation` handler calls a non-deterministic API (`Date.now`, `Math.random`, `crypto.randomUUID`, `crypto.getRandomValues`, or `fetch`). A `query` may be re-run by a live subscription, so non-determinism there can flicker between evaluations (WARN). An ordinary `mutation` handler does not replay on this runtime — it runs at most once per logical write — so this is informational there (INFO) unless the mutation is itself invoked from a workflow step or queue consumer that can replay. For `Date.now()`, read the time through `ctx.now` instead: it is the instant the handler began, captured once, so it is stable across re-evaluations and replays.",facing:"EXTERNAL",level:"WARN",name:"nondeterministic_query_mutation",remediation:"For `Date.now()`: use `ctx.now` in the query or mutation handler. It is the wall-clock instant (epoch ms) the handler began. A re-evaluation or a replay captures it again, so a value that must stay fixed belongs in an argument. For other non-deterministic calls in a `query`: move them into an `action(...)` (which runs once and may use ambient APIs), then pass the computed value into the mutation as an argument, or accept that the value may differ across re-evaluations. For an ordinary `mutation`: no action needed — the handler runs at most once per logical write on this runtime. If the mutation is dispatched from inside a workflow step or queue consumer, treat it like an action value instead, since the surrounding step/consumer can replay.",run:t=>{if(t.nondeterministicCalls===void 0)return[];const n=[],a=new Map;for(const e of t.nondeterministicCalls){const i=`${e.file}:${e.line.toString()}:${e.callee}`,r=(a.get(i)??0)+1;a.set(i,r);const o=r>1?`:${r.toString()}`:"",s={callee:e.callee,exportName:e.exportName,file:e.file,kind:e.kind,line:e.line};if(e.kind==="mutation"){n.push(u(c,{cacheKey:`nondeterministic_query_mutation:${i}${o}`,detail:`\`${e.callee}(…)\` in ${e.exportName} (${e.file}:${e.line.toString()}) runs inside a mutation handler. Ordinary mutations don't replay on this runtime (idempotency dedup returns a cached result rather than re-running the handler, and an OCC conflict throws to the caller instead of retrying internally), so this is informational. ${l(e.callee,e.exportName,"mutation")}`,facing:"INTERNAL",level:"INFO",metadata:s}));continue}n.push(u(c,{cacheKey:`nondeterministic_query_mutation:${i}${o}`,detail:`\`${e.callee}(…)\` in ${e.exportName} (${e.file}:${e.line.toString()}) runs inside a query handler — a live subscription may re-run this query, so the result can differ between evaluations. ${l(e.callee,e.exportName,"query")}`,metadata:s}))}return n},source:"static",title:"Non-deterministic call in query/mutation handler"};export{c as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/advisor",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.206",
|
|
4
4
|
"description": "Schema & query lints (splinter-style advisors) for Lunora, feeding the Studio Advisors view",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"advisor",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
50
|
-
"@lunora/server": "1.0.0-alpha.
|
|
50
|
+
"@lunora/server": "1.0.0-alpha.190"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
53
|
"node": "^22.15.0 || >=24.11.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as l}from"./finding-NrKO8idM.mjs";const c={categories:["SCHEMA"],description:"A `query`/`mutation` handler calls a non-deterministic API (`Date.now`, `Math.random`, `crypto.randomUUID`, `crypto.getRandomValues`, or `fetch`). A `query` may be re-run by a live subscription, so non-determinism there can flicker between evaluations (WARN). An ordinary `mutation` handler does not replay on this runtime — it runs at most once per logical write — so this is informational there (INFO) unless the mutation is itself invoked from a workflow step or queue consumer that can replay.",facing:"EXTERNAL",level:"WARN",name:"nondeterministic_query_mutation",remediation:"For a `query`: move the non-deterministic call into an `action(...)` (which runs once and may use ambient APIs), then pass the computed value into the mutation as an argument, or accept that the value may differ across re-evaluations. For an ordinary `mutation`: no action needed — the handler runs at most once per logical write on this runtime. If the mutation is dispatched from inside a workflow step or queue consumer, treat it like an action value instead, since the surrounding step/consumer can replay.",run:a=>{if(a.nondeterministicCalls===void 0)return[];const t=[],o=new Map;for(const e of a.nondeterministicCalls){const n=`${e.file}:${e.line.toString()}:${e.callee}`,i=(o.get(n)??0)+1;o.set(n,i);const r=i>1?`:${i.toString()}`:"",s={callee:e.callee,exportName:e.exportName,file:e.file,kind:e.kind,line:e.line};if(e.kind==="mutation"){t.push(l(c,{cacheKey:`nondeterministic_query_mutation:${n}${r}`,detail:`\`${e.callee}(…)\` in ${e.exportName} (${e.file}:${e.line.toString()}) runs inside a mutation handler. Ordinary mutations don't replay on this runtime (idempotency dedup returns a cached result rather than re-running the handler, and an OCC conflict throws to the caller instead of retrying internally), so this is informational — no action needed unless \`${e.exportName}\` is invoked from a workflow step or queue consumer that can itself replay.`,facing:"INTERNAL",level:"INFO",metadata:s}));continue}t.push(l(c,{cacheKey:`nondeterministic_query_mutation:${n}${r}`,detail:`\`${e.callee}(…)\` in ${e.exportName} (${e.file}:${e.line.toString()}) runs inside a query handler — a live subscription may re-run this query, so the result can differ between evaluations. Compute it in an \`action\` and pass the value into the mutation as an argument.`,metadata:s}))}return t},source:"static",title:"Non-deterministic call in query/mutation handler"};export{c as default};
|