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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/index.d.mts +44 -22
  2. package/dist/index.d.ts +44 -22
  3. package/dist/index.mjs +1 -1
  4. package/dist/packem_shared/{actionFetchSsrf-BK-kvOPO.mjs → actionFetchSsrf-B7FqsLWm.mjs} +1 -1
  5. package/dist/packem_shared/actionWithoutErrorHandling-DK3rB5c-.mjs +1 -0
  6. package/dist/packem_shared/adminRouteWithoutGuard-CcdlN75o.mjs +1 -0
  7. package/dist/packem_shared/{aiRawRunEscapeHatch-BW7a8kZC.mjs → aiRawRunEscapeHatch-CzIaQf_v.mjs} +1 -1
  8. package/dist/packem_shared/aiRunWithoutLogging-Ct5MeKWe.mjs +1 -0
  9. package/dist/packem_shared/{aiToolSideEffectPromptInjection-9eJXRlKt.mjs → aiToolSideEffectPromptInjection-Ck_h8tFx.mjs} +1 -1
  10. package/dist/packem_shared/aiUnboundedGenerationPublic-CzF3xBc3.mjs +1 -0
  11. package/dist/packem_shared/{authApiCallWithoutHeaders-CReJRsGW.mjs → authApiCallWithoutHeaders-9PpziIB9.mjs} +1 -1
  12. package/dist/packem_shared/{authCsrfCheckDisabled-CRIVsvb9.mjs → authCsrfCheckDisabled-DYTzZFpp.mjs} +1 -1
  13. package/dist/packem_shared/{authEmailVerificationDisabled-BjFlnHr2.mjs → authEmailVerificationDisabled-OiNes7Dz.mjs} +1 -1
  14. package/dist/packem_shared/{authScimWithoutTransactions-B5ATiz5A.mjs → authScimWithoutTransactions-CajXH24D.mjs} +1 -1
  15. package/dist/packem_shared/{authSecureCookiesDisabled-By8PVum3.mjs → authSecureCookiesDisabled-CA5zyqDZ.mjs} +1 -1
  16. package/dist/packem_shared/{authSessionFreshageZero-DuxX3Ln9.mjs → authSessionFreshageZero-C3IYlYft.mjs} +1 -1
  17. package/dist/packem_shared/{authTrustedOriginsWildcard-BKIh6788.mjs → authTrustedOriginsWildcard-661FRsGe.mjs} +1 -1
  18. package/dist/packem_shared/{browserUserUrlWithoutAllowlist-CzDEraJB.mjs → browserUserUrlWithoutAllowlist-Bi5ZWTF7.mjs} +1 -1
  19. package/dist/packem_shared/{containerInstanceKeyFromUserInput-Bl-tAzKV.mjs → containerInstanceKeyFromUserInput-DHQ2JL4x.mjs} +1 -1
  20. package/dist/packem_shared/containerLongSleepAfter-DSGnfpfl.mjs +1 -0
  21. package/dist/packem_shared/containerOversizedInstance-INKmy3-D.mjs +1 -0
  22. package/dist/packem_shared/containerPublicInternet-Csh5_RwX.mjs +1 -0
  23. package/dist/packem_shared/{containerRuntimeEgressRelaxation-4tMrhq1k.mjs → containerRuntimeEgressRelaxation-J6rpfvr8.mjs} +1 -1
  24. package/dist/packem_shared/{containerStartEnableInternetOverride-mN_kuRtk.mjs → containerStartEnableInternetOverride-Bxbmrpwe.mjs} +1 -1
  25. package/dist/packem_shared/{countWithoutIndex-DjQFNBrw.mjs → countWithoutIndex-CTbdpLyE.mjs} +1 -1
  26. package/dist/packem_shared/cronEveryMinute-BjdRdTEz.mjs +1 -0
  27. package/dist/packem_shared/duplicateIndex-BJI90Cnj.mjs +1 -0
  28. package/dist/packem_shared/errorWithoutCatalog-Dib0sdSD.mjs +1 -0
  29. package/dist/packem_shared/{filterAfterIndexScan-CV8aPq7v.mjs → filterAfterIndexScan-BTHjxkNi.mjs} +1 -1
  30. package/dist/packem_shared/{filterOnPrimaryKey-CAhFiqp_.mjs → filterOnPrimaryKey-DeRYfLa7.mjs} +1 -1
  31. package/dist/packem_shared/{filterWithoutIndex-BGv3jbgg.mjs → filterWithoutIndex-8VrXwbq5.mjs} +1 -1
  32. package/dist/packem_shared/{flagGatesSecurityWithUnsafeDefault-B5FBDF8c.mjs → flagGatesSecurityWithUnsafeDefault-CJK9sKcH.mjs} +1 -1
  33. package/dist/packem_shared/{geoIndexFieldNotGeopoint-BMQuok2-.mjs → geoIndexFieldNotGeopoint-Cx_9INob.mjs} +1 -1
  34. package/dist/packem_shared/{helpers-DdZ_pyR3.mjs → helpers-YAAwOBMH.mjs} +1 -1
  35. package/dist/packem_shared/{httpActionMissingAuthGuard-DhMIs1EI.mjs → httpActionMissingAuthGuard-D58Vnjr0.mjs} +1 -1
  36. package/dist/packem_shared/{httpActionResponseHeaderInjection-mcRYd3Zw.mjs → httpActionResponseHeaderInjection-Yn1pbKZ8.mjs} +1 -1
  37. package/dist/packem_shared/{identityUndeclaredClaimTrusted-D1sEd5lr.mjs → identityUndeclaredClaimTrusted-Z-9ob8F2.mjs} +1 -1
  38. package/dist/packem_shared/{imagesUrlSourceFromUserInput-BJXotuyO.mjs → imagesUrlSourceFromUserInput-a2CZ-Xnj.mjs} +1 -1
  39. package/dist/packem_shared/{indexReferencesUnknownField-DKz4-bla.mjs → indexReferencesUnknownField-CV8STvk0.mjs} +1 -1
  40. package/dist/packem_shared/indexUtilization-CmtN9-HA.mjs +1 -0
  41. package/dist/packem_shared/insertManyUnsafeUserData-CSvy65sr.mjs +1 -0
  42. package/dist/packem_shared/{kvUnscopedUserKeyIdor-DhymglIq.mjs → kvUnscopedUserKeyIdor-D0O2alyn.mjs} +1 -1
  43. package/dist/packem_shared/{mailRecipientFromRequestInput-BVXsZ4Xf.mjs → mailRecipientFromRequestInput-BMrAJjNK.mjs} +1 -1
  44. package/dist/packem_shared/{maskWeakHashStrategyOnPii-DJasagzX.mjs → maskWeakHashStrategyOnPii-CwgAXFSx.mjs} +1 -1
  45. package/dist/packem_shared/{outputProjectionMissingOnPublicRead-DWSeo7oC.mjs → outputProjectionMissingOnPublicRead-BPS-eg2q.mjs} +1 -1
  46. package/dist/packem_shared/{ownerFieldFromArgsNotAuth-J8Xbz5uI.mjs → ownerFieldFromArgsNotAuth-BmKLZxrX.mjs} +1 -1
  47. package/dist/packem_shared/{paymentWebhookWideTolerance-DVhJB0Ip.mjs → paymentWebhookWideTolerance-D9i3Vb1n.mjs} +1 -1
  48. package/dist/packem_shared/policyReferencesUnknownTable-DiQYFRFY.mjs +1 -0
  49. package/dist/packem_shared/{privilegedDispatchUnvalidatedPayload-BM3NtT57.mjs → privilegedDispatchUnvalidatedPayload-BJL0JNzG.mjs} +1 -1
  50. package/dist/packem_shared/privilegedFanoutFromPublicProcedure-Byw3Prsi.mjs +1 -0
  51. package/dist/packem_shared/procedureWithoutStructuredEvent-na08a0M1.mjs +1 -0
  52. package/dist/packem_shared/publicMutationWithoutRatelimit-DAxh8tL0.mjs +1 -0
  53. package/dist/packem_shared/{publicTableRlsOptoutConfusion-CbNk75Xo.mjs → publicTableRlsOptoutConfusion-W_jAkKFR.mjs} +1 -1
  54. package/dist/packem_shared/queueWithoutDlq-CF_xUgE_.mjs +1 -0
  55. package/dist/packem_shared/{ratelimitKeySpoofableOrGlobal-DHMl74hR.mjs → ratelimitKeySpoofableOrGlobal-VSGOuu5X.mjs} +1 -1
  56. package/dist/packem_shared/{ratelimitMiddlewareFailOpen-Di2t8pDc.mjs → ratelimitMiddlewareFailOpen-bweBVZ4J.mjs} +1 -1
  57. package/dist/packem_shared/{relationReferencesUnknownField-Cl6mik8w.mjs → relationReferencesUnknownField-hVsgaUKy.mjs} +1 -1
  58. package/dist/packem_shared/rlsUncoveredTable-e2FhD6Nr.mjs +1 -0
  59. package/dist/packem_shared/selfRescheduleWithoutProgress-HoknmezK.mjs +1 -0
  60. package/dist/packem_shared/shapeTargetsGlobalTable-CYRV8OvU.mjs +1 -0
  61. package/dist/packem_shared/shapeUnknownTable-6virkUOz.mjs +1 -0
  62. package/dist/packem_shared/signupMutationWithoutDisposableGating-nopEfEEK.mjs +1 -0
  63. package/dist/packem_shared/sqlInjectionRisk-CSKho3Vk.mjs +1 -0
  64. package/dist/packem_shared/{storageGenerateUploadUrlNoContentTypePin-CrwFuo83.mjs → storageGenerateUploadUrlNoContentTypePin-BlOPGwhZ.mjs} +1 -1
  65. package/dist/packem_shared/{storageKeyFromUserArgs-3vkxmI3v.mjs → storageKeyFromUserArgs-BuoTsz-h.mjs} +1 -1
  66. package/dist/packem_shared/{storagePresignedUrlForPrivateContent-C3KeV5tV.mjs → storagePresignedUrlForPrivateContent-l-EwrAfj.mjs} +1 -1
  67. package/dist/packem_shared/{storageUploadWithoutContentTypeAllowlist-BXoK_QWE.mjs → storageUploadWithoutContentTypeAllowlist-JmITAazT.mjs} +1 -1
  68. package/dist/packem_shared/{storageUploadWithoutMaxSize-CW7uKvSi.mjs → storageUploadWithoutMaxSize-DlhE1I98.mjs} +1 -1
  69. package/dist/packem_shared/sweeps-DYG_FnlQ.mjs +1 -0
  70. package/dist/packem_shared/tableWithoutInsert-DrDVc5Do.mjs +1 -0
  71. package/dist/packem_shared/{ttlFieldNotTimestamp-lnb5nmM6.mjs → ttlFieldNotTimestamp-C8zgHJjp.mjs} +1 -1
  72. package/dist/packem_shared/{unboundedCollectOnOpenRange-DHy2RUL7.mjs → unboundedCollectOnOpenRange-DDGNuKks.mjs} +1 -1
  73. package/dist/packem_shared/{unboundedLoop-DxN3_apu.mjs → unboundedLoop-CUF9Wdxa.mjs} +1 -1
  74. package/dist/packem_shared/userCreatingMutationWithoutCaptcha-8mtYqiGy.mjs +1 -0
  75. package/dist/packem_shared/{vectorsNamespaceFromUserInput-CFa2qhFU.mjs → vectorsNamespaceFromUserInput-537Bt2vT.mjs} +1 -1
  76. package/dist/packem_shared/{workflowUnknownTarget-DEKB5H0g.mjs → workflowUnknownTarget-DdG3cUPH.mjs} +1 -1
  77. package/dist/packem_shared/workflowUnused-CSKRWTd_.mjs +1 -0
  78. package/package.json +1 -1
  79. package/dist/packem_shared/actionWithoutErrorHandling-4GCBT0_z.mjs +0 -1
  80. package/dist/packem_shared/adminRouteWithoutGuard-DPE7LuNh.mjs +0 -1
  81. package/dist/packem_shared/aiRunWithoutLogging-DT665z-w.mjs +0 -1
  82. package/dist/packem_shared/aiUnboundedGenerationPublic-C17h6sMV.mjs +0 -1
  83. package/dist/packem_shared/containerLongSleepAfter-CVvHEGYC.mjs +0 -1
  84. package/dist/packem_shared/containerOversizedInstance-Bx89uR7E.mjs +0 -1
  85. package/dist/packem_shared/containerPublicInternet-BFfZf_P4.mjs +0 -1
  86. package/dist/packem_shared/cronEveryMinute-CtpEAbxs.mjs +0 -1
  87. package/dist/packem_shared/duplicateIndex-Cip6-Rpu.mjs +0 -1
  88. package/dist/packem_shared/errorWithoutCatalog-BTfvaXHR.mjs +0 -1
  89. package/dist/packem_shared/indexUtilization-CkVPZcVe.mjs +0 -1
  90. package/dist/packem_shared/insertManyUnsafeUserData-DWE8d_DF.mjs +0 -1
  91. package/dist/packem_shared/policyReferencesUnknownTable-CIKuRZ5Y.mjs +0 -1
  92. package/dist/packem_shared/privilegedFanoutFromPublicProcedure-DV188gHQ.mjs +0 -1
  93. package/dist/packem_shared/procedureWithoutStructuredEvent-BcOE0mFx.mjs +0 -1
  94. package/dist/packem_shared/publicMutationWithoutRatelimit-Bd-rRxnz.mjs +0 -1
  95. package/dist/packem_shared/queueWithoutDlq-BvHz3Opg.mjs +0 -1
  96. package/dist/packem_shared/rlsUncoveredTable-CZ4ie4gX.mjs +0 -1
  97. package/dist/packem_shared/selfRescheduleWithoutProgress-CQNZI4FA.mjs +0 -1
  98. package/dist/packem_shared/shapeTargetsGlobalTable-Bu3eEDic.mjs +0 -1
  99. package/dist/packem_shared/shapeUnknownTable-CREfNnWi.mjs +0 -1
  100. package/dist/packem_shared/signupMutationWithoutDisposableGating-BdKwtxDP.mjs +0 -1
  101. package/dist/packem_shared/sqlInjectionRisk-BYRllgPV.mjs +0 -1
  102. package/dist/packem_shared/sweeps-JWMwcakB.mjs +0 -1
  103. package/dist/packem_shared/tableWithoutInsert-ClJp_jDr.mjs +0 -1
  104. package/dist/packem_shared/userCreatingMutationWithoutCaptcha-D4TZEpgz.mjs +0 -1
  105. package/dist/packem_shared/workflowUnused-DHwwE-1P.mjs +0 -1
package/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.292",
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 a}from"./finding-NrKO8idM.mjs";const n={categories:["SCHEMA"],description:"An `action` calls an outbound surface (fetch, mail, queues, storage, sql, ai) with no `try`/`catch`. Those fail routinely, and an uncaught rejection reaches the caller with no indication of which dependency broke.",facing:"EXTERNAL",level:"WARN",name:"action_without_error_handling",remediation:"Wrap the outbound call in `try`/`catch`, then either degrade or rethrow a coded `LunoraError` naming the dependency that failed.",run:t=>t.procedureProtections===void 0?[]:t.procedureProtections.filter(e=>e.kind==="action"&&e.reachesOutbound===!0&&e.handlesErrors===!1).map(e=>a(n,{cacheKey:`action_without_error_handling:${e.file}:${e.exportName}`,detail:`Action \`${e.exportName}\` (${e.file}) calls an outbound surface with no \`try\`/\`catch\`. A dependency failure will surface to the caller unexplained.`,metadata:{exportName:e.exportName,file:e.file,kind:e.kind}})),source:"static",title:"Action performs outbound I/O with no error handling"};export{n as default};
@@ -1 +0,0 @@
1
- import{e as t}from"./finding-NrKO8idM.mjs";const i={categories:["SECURITY"],description:"An `httpRoute` on an admin/privileged path has no visible auth/admin guard. REST routes aren't covered by RLS, so an unguarded `/admin/*` route is callable by anyone who reaches the URL.",facing:"EXTERNAL",level:"WARN",name:"admin_route_without_guard",remediation:"Assert an authenticated, authorized caller at the top of the handler — check `ctx.auth` / `getSession(...)`, or a `requireAdmin`-style guard — and reject (401/403) before doing privileged work. For machine callers, verify a secret with a timing-safe compare.",run:a=>a.adminRoutes===void 0?[]:a.adminRoutes.filter(e=>!e.usesGuard).map(e=>t(i,{cacheKey:`admin_route_without_guard:${e.file}:${e.method}:${e.path}`,detail:`Route \`${e.method} ${e.path}\` (\`${e.exportName}\` in ${e.file}) is on an admin/privileged path but its handler shows no auth/admin guard. Assert an authorized caller before doing privileged work.`,metadata:{exportName:e.exportName,file:e.file,method:e.method,path:e.path}})),source:"static",title:"Admin route without an auth guard"};export{i as default};
@@ -1 +0,0 @@
1
- import{e as n}from"./finding-NrKO8idM.mjs";const i={categories:["PERFORMANCE"],description:"A procedure runs an AI generation but emits no structured event. Model calls bill per invocation and are not reproducible, so without one there is no way to attribute spend or trace a bad answer back to its prompt.",facing:"INTERNAL",level:"INFO",name:"ai_run_without_logging",remediation:'Emit an event around the generation — `ctx.trace("<name>", …)`, or a `ctx.log` line carrying the model and token usage.',run:e=>e.procedureProtections===void 0?[]:e.procedureProtections.filter(t=>t.runsAiGeneration===!0&&t.emitsEvent===!1).map(t=>n(i,{cacheKey:`ai_run_without_logging:${t.file}:${t.exportName}`,detail:`${t.kind} \`${t.exportName}\` (${t.file}) runs an AI generation with no structured event, so its cost and output cannot be attributed later.`,metadata:{exportName:t.exportName,file:t.file,kind:t.kind}})),source:"static",title:"AI generation with no structured event"};export{i as default};
@@ -1 +0,0 @@
1
- import{e as t}from"./finding-NrKO8idM.mjs";import{m as i}from"./procedure-protections-DRQotu9I.mjs";const a={categories:["SECURITY"],description:"A public procedure runs an AI generation (`generateText`/`streamText`/`generateObject`/`streamObject`) with no `maxOutputTokens` bound. Generation bills per output token, so an anonymous caller can request arbitrarily long completions in a loop — a denial-of-wallet vector that also ties up worker time on long streams.",facing:"EXTERNAL",level:"WARN",name:"ai_unbounded_generation_public",remediation:"Cap the completion with `maxOutputTokens` in the generation config, and rate-limit the public entry point (`.use(rateLimit(...))`). For expensive models, prefer running generation from an internal, authenticated path rather than exposing it directly to anonymous callers.",run:n=>n.procedureProtections===void 0?[]:n.procedureProtections.filter(e=>i(e.unboundedAiGeneration)&&e.visibility==="public").map(e=>t(a,{cacheKey:`ai_unbounded_generation_public:${e.file}:${e.exportName}`,detail:`\`${e.exportName}\` (${e.file}) is public and runs an AI generation with no \`maxOutputTokens\` bound — an anonymous caller can drive unbounded, billable completions in a loop. Add a \`maxOutputTokens\` cap and rate-limit the entry point.`,metadata:{exportName:e.exportName,file:e.file,kind:e.kind}})),source:"static",title:"Public procedure runs unbounded AI generation (no maxOutputTokens)"};export{a as default};
@@ -1 +0,0 @@
1
- import{e as d}from"./finding-NrKO8idM.mjs";const l=3600,f={h:3600,m:60,s:1},p=/^(\d+)([smh])$/u,c=n=>{if(typeof n=="number")return n;const o=p.exec(n);if(o===null)return;const[,e="0",t="s"]=o;return Number(e)*(f[t]??1)},u={categories:["PERFORMANCE"],description:"A container's idle window (its `sleepAfter`, capped by any `hardTimeout`) is longer than an hour, so every idle instance keeps running, and billed, for that whole window.",facing:"INTERNAL",level:"WARN",name:"container_long_sleep_after",remediation:"Lower `sleepAfter` to the idle window the workload needs (the default is 10m), or add a `hardTimeout` that caps how long an instance may live.",run:n=>{const o=[];for(const e of n.containers??[]){const{hardTimeout:t,sleepAfter:i}=e;if(i===void 0)continue;const r=c(i);if(r===void 0)continue;const a=t===void 0?void 0:c(t),s=a===void 0?r:Math.min(r,a);s<=l||o.push(d(u,{cacheKey:`container_long_sleep_after:${e.exportName}`,detail:`Container "${e.exportName}" can sit idle for ${s.toString()} s before it sleeps (sleepAfter ${String(i)}${a===void 0?"":`, capped by hardTimeout ${String(t)}`}); every idle instance is billed for that whole window.`,metadata:{container:e.exportName,effectiveIdleSeconds:s,hardTimeout:t,sleepAfter:i}}))}return o},source:"static",title:"Long container idle window"};export{u as default};
@@ -1 +0,0 @@
1
- import{e as a}from"./finding-NrKO8idM.mjs";const r=new Set(["standard-3","standard-4"]),o=2,c=4096,d=e=>typeof e=="string"?r.has(e):(e.vcpu??0)>o||(e.memoryMib??0)>c,l={categories:["PERFORMANCE"],description:"A container is declared on a large instance type, whose provisioned memory and disk are billed for the lifetime of every running instance.",facing:"INTERNAL",level:"INFO",name:"container_oversized_instance",remediation:"Confirm the workload needs this size; a smaller instanceType (lite/basic/standard-1) costs less while idle-but-running.",run:e=>{const t=[];for(const i of e.containers??[]){const{instanceType:n}=i;if(n===void 0||!d(n))continue;const s=typeof n=="string"?n:JSON.stringify(n);t.push(a(l,{cacheKey:`container_oversized_instance:${i.exportName}`,detail:`Container "${i.exportName}" uses a large instance type (${s}); its memory + disk are billed while any instance runs.`,metadata:{container:i.exportName,instanceType:n}}))}return t},source:"static",title:"Oversized container instance"};export{l as default};
@@ -1 +0,0 @@
1
- import{e as n}from"./finding-NrKO8idM.mjs";const a={categories:["SECURITY"],description:"A container leaves outbound internet access at the default (enabled), which is billed per GB of egress and widens the attack surface.",facing:"INTERNAL",level:"INFO",name:"container_public_internet",remediation:"Set `enableInternet: false` on the container if it doesn't call external services, or `true` to opt in deliberately.",run:t=>(t.containers??[]).filter(e=>e.enableInternet===void 0).map(e=>n(a,{cacheKey:`container_public_internet:${e.exportName}`,detail:`Container "${e.exportName}" doesn't set enableInternet, so outbound internet is on by default (egress is billed).`,metadata:{container:e.exportName}})),source:"static",title:"Container egress enabled by default"};export{a as default};
@@ -1 +0,0 @@
1
- import{parse as c}from"@visulima/cron-parser/cloudflare";import{e as h}from"./finding-NrKO8idM.mjs";const d=/\s+/,l=t=>{const e=t.trim();if(e.split(d).length===5)try{const{dayOfMonth:r,dayOfWeek:n,hour:a,minute:i,month:s}=c(e).fields;return i.values.length!==60?void 0:a.values.length===24&&r.values.length===31&&s.values.length===12&&n.values.length===7?"always":"windowed"}catch{return}},o=t=>t.workflow===void 0?t.functionPath??"its target":`a new instance of workflow "${t.workflow.exportName}"`,u={categories:["PERFORMANCE"],description:"A cron job fires every minute, the fastest cadence Cloudflare Cron Triggers allow. Each fire is a Worker invocation (shared by jobs on the same schedule) plus a dispatch to its target (a Durable Object request, or a new workflow instance), billed whether or not there was work to do.",facing:"INTERNAL",level:"INFO",name:"cron_every_minute",remediation:"Confirm the cadence is needed. If the job only reacts to new work, drop it to a coarser interval, or replace the poll with `ctx.scheduler.runAfter(…)` armed by the write that creates the work. Whatever the cadence, make the target return early on an indexed read when there is nothing to do.",run:t=>(t.crons??[]).flatMap(e=>{const r=l(e.cron);if(r===void 0)return[];const n=r==="always"?`fires every minute — about 43,200 dispatches a month of ${o(e)}`:`fires every minute while its window is open, dispatching ${o(e)} once a minute`;return[h(u,{cacheKey:`cron_every_minute:${e.name}`,detail:`Cron job "${e.name}" (\`${e.cron}\`) ${n}, whether or not there is work. Jobs on the same schedule share one Worker invocation.`,metadata:{cron:e.cron,job:e.name,window:r==="windowed"}})]}),source:"static",title:"Cron job fires every minute"};export{u as default};
@@ -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 t}from"./finding-NrKO8idM.mjs";const o={categories:["SCHEMA"],description:"A procedure throws a bare `new Error(...)`. It reaches the client as an opaque message the caller cannot branch on, and error grouping cannot fingerprint it into a stable issue.",facing:"EXTERNAL",level:"WARN",name:"error_without_catalog",remediation:'Throw a coded error instead: `throw new LunoraError("<CODE>", { … })` from `@lunora/errors`, adding the code to `ERROR_CATALOG` if it is new.',run:e=>e.procedureProtections===void 0?[]:e.procedureProtections.filter(r=>r.throwsBareError===!0).map(r=>t(o,{cacheKey:`error_without_catalog:${r.file}:${r.exportName}`,detail:`${r.kind} \`${r.exportName}\` (${r.file}) throws a bare \`new Error(...)\`. Use \`LunoraError\` with a catalog code so the client can branch on it and Studio can group it.`,metadata:{exportName:r.exportName,file:r.file,kind:r.kind}})),source:"static",title:"Bare Error thrown instead of a coded LunoraError"};export{o 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 s}from"./finding-NrKO8idM.mjs";import{m as i}from"./procedure-protections-DRQotu9I.mjs";const r={categories:["SECURITY"],description:"A public procedure calls `ctx.db.insertManyUnsafe(...)`, which writes rows straight to storage and bypasses both the per-row validators and the schema's insert triggers (server-trusted columns, ownership stamping, RLS write checks). On a public entry point the rows are request-shaped, so a caller can write columns they shouldn't control and skip every trigger-enforced invariant.",facing:"EXTERNAL",level:"WARN",name:"insert_many_unsafe_user_data",remediation:"Use the validated `ctx.db.insert(...)` path in public procedures so validators and insert triggers run. If you need the unsafe bulk write, move it into an internal function (`internalMutation`/`internalAction`) that is fed only server-constructed rows, never request input.",run:t=>t.procedureProtections===void 0?[]:t.procedureProtections.filter(e=>i(e.usesInsertManyUnsafe)&&e.visibility==="public").map(e=>s(r,{cacheKey:`insert_many_unsafe_user_data:${e.file}:${e.exportName}`,detail:`\`${e.exportName}\` (${e.file}) is public and calls \`ctx.db.insertManyUnsafe(...)\`, bypassing validators and insert triggers on request-shaped rows. Switch to \`ctx.db.insert(...)\`, or move the bulk write into an internal function fed server-built rows.`,metadata:{exportName:e.exportName,file:e.file,kind:e.kind}})),source:"static",title:"Public procedure uses insertManyUnsafe (bypasses validators and triggers)"};export{r as default};
@@ -1 +0,0 @@
1
- import{e as s}from"./finding-NrKO8idM.mjs";const i={categories:["SECURITY"],description:"An RLS policy is bound to a `table` name that does not exist in the schema. The `rls()` middleware never matches it, so the table the policy was meant to protect is left ungated — reads return unrestricted rows and writes are allowed.",facing:"EXTERNAL",level:"WARN",name:"policy_references_unknown_table",remediation:"Fix the policy's `table` to a real table name (check for a typo or a table that was renamed/removed). If the table is gone, delete the dead policy.",run:a=>{if(a.rlsProcedures===void 0)return[];const r=new Set(a.schema.tables.map(t=>t.name)),n=new Set,o=[];for(const t of a.rlsProcedures)for(const e of t.rlsTables)e===""||r.has(e)||n.has(e)||(n.add(e),o.push(s(i,{cacheKey:`policy_references_unknown_table:${e}`,detail:`An RLS policy in \`${t.exportName}\` (${t.file}) is bound to table \`${e}\`, which is not declared in the schema. The policy never matches, so \`${e}\` — if it exists under another name — is left ungated.`,metadata:{exportName:t.exportName,file:t.file,table:e}})));return o},source:"static",title:"RLS policy bound to an unknown table"};export{i as default};
@@ -1 +0,0 @@
1
- import{e as i}from"./finding-NrKO8idM.mjs";import{m as a}from"./procedure-protections-DRQotu9I.mjs";const r={categories:["SECURITY"],description:"A public procedure fans work out to a privileged dispatch surface (`ctx.scheduler.runAfter`/`runAt`, a `ctx.queues.<name>` send, a `ctx.topics.<name>.publish`, or `ctx.workflows.<name>.create`) with no rate-limit guard. Each dispatch runs later under the system identity and bills the account, so an anonymous caller can amplify cost and flood the async surface in a loop.",facing:"EXTERNAL",level:"WARN",name:"privileged_fanout_from_public_procedure",remediation:"Gate the public entry point with a rate limit (`.use(rateLimit(...))` or a `protectPublic({ rateLimit })` bundle), or make the fan-out procedure internal and trigger it only from an authenticated, guarded path. Never expose an unbounded scheduler/queue/topic/workflow dispatch to anonymous callers.",run:t=>t.procedureProtections===void 0?[]:t.procedureProtections.filter(e=>a(e.fanOut)&&e.visibility==="public"&&!e.usesRateLimit).map(e=>i(r,{cacheKey:`privileged_fanout_from_public_procedure:${e.file}:${e.exportName}`,detail:`\`${e.exportName}\` (${e.file}) is public and fans work out to a privileged dispatch surface (scheduler/queue/topic/workflow) with no rate limit — an anonymous caller can drive that billable, system-identity dispatch in a loop. Add a rate-limit guard, or make it internal and trigger it from an authenticated path.`,metadata:{exportName:e.exportName,file:e.file,kind:e.kind}})),source:"static",title:"Public procedure fans out to a privileged dispatch surface"};export{r as default};
@@ -1 +0,0 @@
1
- import{e as i}from"./finding-NrKO8idM.mjs";const a={categories:["SCHEMA"],description:"A public `mutation`/`action` emits no structured event. When it fails you get a stack trace with no request context — no ids, no tenant, no outcome — so the failure is visible but not searchable.",facing:"INTERNAL",level:"INFO",name:"procedure_without_structured_event",remediation:'Emit one event on the primary path: `ctx.log.info("<verb>", { … })`, or attach the facts to the request\'s span with `ctx.span.setAttributes({ … })`, and time a step with `ctx.trace("<name>", …)`.',run:e=>e.procedureProtections===void 0?[]:e.procedureProtections.filter(t=>t.visibility==="public"&&t.kind!=="query"&&t.emitsEvent===!1).map(t=>i(a,{cacheKey:`procedure_without_structured_event:${t.file}:${t.exportName}`,detail:`Public ${t.kind} \`${t.exportName}\` (${t.file}) emits no structured event. Add a \`ctx.log\` line or a \`ctx.span\` so a failure carries its request context.`,metadata:{exportName:t.exportName,file:t.file,kind:t.kind}})),source:"static",title:"Public write emits no structured event"};export{a as default};
@@ -1 +0,0 @@
1
- import{e as a}from"./finding-NrKO8idM.mjs";import{e as r,m as s}from"./helpers-DdZ_pyR3.mjs";const n=["contact","forgot","login","logIn","magic","otp","register","reset","signin","signIn","signup","signUp","subscribe","verify"],o={categories:["SECURITY"],description:"A public `mutation`/`action` has no `rateLimit` middleware. Publicly-callable writes are flood and brute-force targets — an attacker can exhaust writes, mail quota, or credits, or guess credentials on auth-shaped endpoints.",facing:"EXTERNAL",level:"WARN",name:"public_mutation_without_ratelimit",remediation:'Attach a rate limit: `.use(rateLimit(limiter, "<bucket>"))` from `@lunora/ratelimit`, or wrap the recommended public-procedure guards with `.use(protectPublic({ rateLimit, captcha }))` from `@lunora/server`. Genuinely-open writes can be acknowledged by adding a permissive limiter.',run:i=>i.procedureProtections===void 0?[]:i.procedureProtections.filter(t=>r(t)&&!t.usesRateLimit).map(t=>{const e=s(t.exportName,n);return a(o,{cacheKey:`public_mutation_without_ratelimit:${t.file}:${t.exportName}`,detail:`Public ${t.kind} \`${t.exportName}\` (${t.file}) has no rate limit${e?" — its name suggests an auth/abuse-sensitive endpoint, so this is high-risk":""}. Add \`.use(rateLimit(...))\` or \`.use(protectPublic({ rateLimit }))\`.`,metadata:{exportName:t.exportName,file:t.file,kind:t.kind,sensitive:e}})}),source:"static",title:"Public write without a rate limit"};export{o as default};
@@ -1 +0,0 @@
1
- import{e as n}from"./finding-NrKO8idM.mjs";const r={categories:["SCHEMA"],description:"A queue consumer drops a message once it exhausts `maxRetries` (default 3) delivery attempts. Without a `deadLetterQueue`, that message is deleted permanently with no record — route exhausted messages to a DLQ so you can inspect, alert on, and replay them.",facing:"INTERNAL",level:"WARN",name:"queue_without_dlq",remediation:'Add `deadLetterQueue: "<name>-dlq"` to the `defineQueue({...})` options and declare a consumer for that queue so exhausted messages are inspectable (an unconsumed DLQ still expires at the retention window). `vis generate lunora-queue` with the best-practice setup scaffolds both. If the queue is fire-and-forget and message loss is acceptable, this advisory can be ignored.',run:t=>{if(t.queues===void 0)return[];const i=new Set(t.queues.map(e=>e.tuning.deadLetterQueue).filter(e=>e!==void 0&&e!=="")),s=[];for(const e of t.queues){const u=e.tuning.deadLetterQueue;if(u!==void 0&&u!==""||i.has(e.name))continue;const a=typeof e.tuning.maxRetries=="number"?e.tuning.maxRetries:3;s.push(n(r,{cacheKey:`queue_without_dlq:${e.exportName}`,detail:`Queue "${e.exportName}" declares no \`deadLetterQueue\`, so a message that exhausts its retries (\`maxRetries\` = ${String(a)}, ~${String(a+1)} delivery attempts) is dropped and permanently lost.`,metadata:{maxRetries:a,mode:e.mode,queue:e.exportName}}))}return s},source:"static",title:"Queue has no dead-letter queue"};export{r as default};
@@ -1 +0,0 @@
1
- import{e as a}from"./finding-NrKO8idM.mjs";const l={categories:["SECURITY"],description:"A public procedure reads or writes a table that is covered by an RLS policy elsewhere in the app, but this procedure's builder chain does not include `.use(rls(...))`. The raw, unwrapped `ctx.db` silently bypasses every policy in the list.",facing:"EXTERNAL",level:"WARN",name:"rls_uncovered_table",remediation:"Add `.use(rls(policies))` to the procedure's builder chain — e.g. `c.use(rls(myPolicies)).query(...)` — so its `ctx.db` is wrapped by the same policy evaluator as the rest of the app. If this procedure is intentionally privileged (e.g. a background job), declare it with `internalQuery` / `internalMutation` / `internalAction` instead of the public builder so the intent is explicit.",run:r=>{if(r.rlsProcedures===void 0)return[];const s=new Set;for(const e of r.rlsProcedures)for(const i of e.rlsTables)i!==""&&s.add(i);if(s.size===0)return[];const o=[];for(const e of r.rlsProcedures){if(e.usesRls||e.visibility==="internal")continue;const i=new Set;for(const t of[...e.tablesRead,...e.tablesWritten])t!==""&&s.has(t)&&i.add(t);for(const t of i)o.push(a(l,{cacheKey:`rls_uncovered_table:${e.file}:${e.exportName}:${t}`,detail:`\`${e.exportName}\` in ${e.file} accesses table \`${t}\` without \`.use(rls(...))\` — the table is policy-gated elsewhere in the app but this procedure bypasses those policies entirely.`,metadata:{exportName:e.exportName,file:e.file,table:t}}))}return o},source:"static",title:"RLS-gated table accessed without rls() middleware"};export{l as default};
@@ -1 +0,0 @@
1
- import{callSiteCallers as l}from"./callSiteCallers-DArHfQSU.mjs";import{e as c}from"./finding-NrKO8idM.mjs";import{r as d,f as u,g as f}from"./helpers-DdZ_pyR3.mjs";const h=1e3,p=6e4,m=new Set(["patch","patchIf","patchMany","patchWhere"]),w=e=>new Map([...e].map(([n,o])=>[n,o.filter(t=>!m.has(t.method))])),g=/^(?:continue|next|page)?_?cursor$/iu,v=e=>{if(!(e.kind!=="schedule"||e.conditional!==!0||e.target===void 0||e.scope.kind!=="export"))return e.target===u(e.file,e.scope.name)?e.scope.name:void 0},y=e=>{const n=e.schedule?.delayMs,o=e.schedule?.argKeys;if(!(n===void 0||n>=p||o===void 0||o.some(t=>g.test(t))))return n},R=(e,n,o)=>e.some(t=>t.kind==="call"&&t.file===n&&t.scope.kind==="export"&&t.scope.name===o),E=(e,n,o,t)=>{const s=(e.queries??[]).filter(r=>r.file===n&&r.table!==""&&l(r.scope).includes(o));return s.length===0||s.some(r=>f(t,r,void 0,[o]))},S={categories:["PERFORMANCE"],description:"A function re-arms itself with `ctx.scheduler.runAfter` on a delay under a minute, and the re-arming passes no cursor and nothing in the function removes the rows it reads. Each run finds the same rows and does the same work again; a delay under a second is a spin, and a longer one is a poll that rewrites a row on every tick.",facing:"EXTERNAL",level:"WARN",name:"self_reschedule_without_progress",remediation:"Carry the progress forward: pass a cursor (or the last processed id) in the dispatch args, or delete or update the rows the function handled so the next run selects only what is left. Re-arm only while work remains, and use a longer delay or a `cron` for periodic work.",run:e=>{if(e.callEdges===void 0)return[];const{callEdges:n}=e,o=d(e.tableWrites,e.rowEffects),t=[];for(const s of n){const r=v(s),i=y(s);if(r===void 0||i===void 0)continue;const a=i>=h;R(n,s.file,r)||E(e,s.file,r,a?w(o):o)||t.push(c(S,{cacheKey:`self_reschedule_without_progress:${s.file}:${s.line.toString()}:${r}`,detail:a?`\`${r}\` (${s.file}:${s.line.toString()}) polls itself every ${i.toString()} ms with no cursor in its args, and it removes none of the rows it reads. Each tick re-reads the same rows and rewrites in place, and each run is billed.`:`\`${r}\` (${s.file}:${s.line.toString()}) re-arms itself after ${i.toString()} ms with no cursor in its args, and it removes none of the rows it reads. The next run finds the same rows and starts the same work again.`,level:a?"INFO":"WARN",metadata:{delayMs:i,file:s.file,function:r,line:s.line,tier:a?"poll":"spin"}}))}return t},source:"static",title:"Self-reschedule without progress"};export{S as default};
@@ -1 +0,0 @@
1
- import{e as l}from"./finding-NrKO8idM.mjs";const r={categories:["PERFORMANCE"],description:"A `defineShape` replicates from a `.global()` table. Global tables live outside the shard DO's SQLite op-log, so the shape is served through the cross-shard tier — coordinator/poll-refreshed and latency-tiered, not poke-live like a sharded shape.",facing:"EXTERNAL",level:"WARN",name:"shape_targets_global_table",remediation:"Expected if you want the cross-shard tier — just don't assume poke-live freshness; global shapes refresh on a poll. For live updates, replicate from a sharded table instead (denormalize the columns you need into the shard).",run:a=>{if(a.shapes===void 0)return[];const t=new Set(a.schema.tables.filter(e=>e.shardKind==="global").map(e=>e.name));return a.shapes.filter(e=>e.table!==void 0&&t.has(e.table)).map(e=>l(r,{cacheKey:`shape_targets_global_table:${e.exportName}`,detail:`Shape \`${e.exportName}\` (${e.file}) replicates from the \`.global()\` table \`${e.table}\`. It is served through the cross-shard global tier — poll-refreshed and latency-tiered, not poke-live.`,metadata:{exportName:e.exportName,file:e.file,table:e.table}}))},source:"static",title:"Shape replicates from a global (cross-shard) table"};export{r as default};
@@ -1 +0,0 @@
1
- import{e as n}from"./finding-NrKO8idM.mjs";const o={categories:["SCHEMA"],description:"A `defineShape` is bound to a `table` name that does not exist in the schema. The shape can never resolve a rowset — its subscription seeds empty and errors at the first flush.",facing:"INTERNAL",level:"ERROR",name:"shape_unknown_table",remediation:"Fix the shape's `table` to a real table name (check for a typo or a table that was renamed/removed).",run:a=>{if(a.shapes===void 0)return[];const t=new Set(a.schema.tables.map(e=>e.name));return a.shapes.filter(e=>e.table!==void 0&&!t.has(e.table)).map(e=>n(o,{cacheKey:`shape_unknown_table:${e.exportName}`,detail:`Shape \`${e.exportName}\` (${e.file}) replicates from table \`${e.table}\`, which is not declared in the schema. The shape can never resolve a rowset.`,metadata:{exportName:e.exportName,file:e.file,table:e.table}}))},source:"static",title:"Shape bound to an unknown table"};export{o as default};
@@ -1 +0,0 @@
1
- import{e as s}from"./finding-NrKO8idM.mjs";import{m as t}from"./procedure-protections-DRQotu9I.mjs";import{e as o}from"./helpers-DdZ_pyR3.mjs";const r={categories:["SECURITY"],description:"A public `mutation`/`action` that creates a user/session/account row has no disposable-email gate. Throwaway mailboxes farm free trials, evade bans, and pollute the user table.",facing:"EXTERNAL",level:"WARN",name:"signup_mutation_without_disposable_gating",remediation:"Add `.use(emailGateMiddleware({ email: (ctx) => ctx.args.email }))` from `@lunora/auth/email-guard` to reject disposable domains at signup, or gate better-auth's native signup with `withEmailGate(...)` / `emailGateDatabaseHooks(...)`.",run:a=>{if(a.procedureProtections===void 0)return[];const i=[];for(const e of a.procedureProtections)!o(e)||!t(e.writesUserTable)||e.usesEmailGate||t(e.hasEmailArg)&&e.hasEmailArg!==!1&&i.push(s(r,{cacheKey:`signup_mutation_without_disposable_gating:${e.file}:${e.exportName}`,detail:`Public ${e.kind} \`${e.exportName}\` (${e.file}) writes a user/session/account table but has no disposable-email gate. Add \`.use(emailGateMiddleware(...))\` from \`@lunora/auth/email-guard\`.`,metadata:{exportName:e.exportName,file:e.file,kind:e.kind,writesUserTable:e.writesUserTable}}));return i},source:"static",title:"Account-creating write without a disposable-email gate"};export{r 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{callSiteCallers as u}from"./callSiteCallers-DArHfQSU.mjs";import{h as d,r as f,i as h,g,f as m}from"./helpers-DdZ_pyR3.mjs";const p=new Set(["lt","lte"]),w=s=>{const o=d(s.callEdges,s.cronTargets),t=f(s.tableWrites,s.rowEffects),i=h(s.schema);return(s.queries??[]).filter(e=>{if(e.terminal!=="collect"||e.table===""||e.index?.bounds===void 0)return!1;const{bounds:l}=e.index;if(l.some(n=>p.has(n)))return!1;const r=l.length>0&&l.every(n=>n==="eq"),c=n=>o.has(m(e.file,n))||e.visibility==="internal"&&!r,a=i(e);return u(e.scope).some(n=>c(n)&&!g(t,e,a,[n]))})},b=(s,o)=>{const t=new Set(o);return(s.filterFields??[]).filter(i=>i!=="_id"&&!t.has(i))};export{w as o,b as u};
@@ -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};
@@ -1 +0,0 @@
1
- import{e as a}from"./finding-NrKO8idM.mjs";import{m as i}from"./procedure-protections-DRQotu9I.mjs";import{e as s}from"./helpers-DdZ_pyR3.mjs";const r=t=>t.writesUserTable===!0?"writes a user/session table":t.callsMail===!0?"sends mail":t.analyzableBody===!1?"may write a user/session table or send mail — its handler body could not be read":"may write a user/session table or send mail — at least one could not be determined",n={categories:["SECURITY"],description:"A public `mutation`/`action` that creates a user/session or sends mail has no CAPTCHA / bot check. Account-creating and mail-sending endpoints are prime automated-abuse targets (credential stuffing, mailbox flooding, disposable-account farming).",facing:"EXTERNAL",level:"WARN",name:"user_creating_mutation_without_captcha",remediation:"Add a server-verified human check: `.use(verifyTurnstileMiddleware({ secret, token: (c) => c.args.captchaToken }))` from `@lunora/auth`, or wrap it with `.use(protectPublic({ rateLimit, captcha }))` from `@lunora/server`. Pair with a rate limit for defense in depth. Note it is `verifyTurnstileMiddleware`, not the bare `verifyTurnstile` verdict function — that one returns a Promise and verifies nothing when placed in a `.use()` chain.",run:t=>t.procedureProtections===void 0?[]:t.procedureProtections.filter(e=>s(e)&&(i(e.writesUserTable)||i(e.callsMail))&&!e.usesCaptcha).map(e=>a(n,{cacheKey:`user_creating_mutation_without_captcha:${e.file}:${e.exportName}`,detail:`Public ${e.kind} \`${e.exportName}\` (${e.file}) ${r(e)} but has no CAPTCHA check. Add \`.use(verifyTurnstileMiddleware(...))\` or \`.use(protectPublic({ captcha }))\`.`,metadata:{callsMail:e.callsMail,exportName:e.exportName,file:e.file,kind:e.kind,writesUserTable:e.writesUserTable}})),source:"static",title:"Account-creating / mail-sending write without a CAPTCHA"};export{n as default};
@@ -1 +0,0 @@
1
- import{isReachableSite as a}from"./callSiteCallers-DArHfQSU.mjs";import{e as i}from"./finding-NrKO8idM.mjs";const s={categories:["SCHEMA"],description:'No function starts this workflow via `ctx.workflows.get("<name>")`. It may be triggered through a path the advisor can\'t see (the Cloudflare API, a wrangler invocation, a cross-service binding) — or it may be dead code that still deploys as a billable WorkflowEntrypoint.',facing:"INTERNAL",level:"INFO",name:"workflow_unused",remediation:'If the workflow should be triggered in-app, start it from a mutation/action with `ctx.workflows.get("<name>").create({ params })`. If it is started externally or is no longer needed, this advisory can be ignored (or remove the `defineWorkflow` export).',run:o=>{if(o.workflows===void 0||o.workflowCalls===void 0)return[];const t=o.workflowCalls.filter(e=>a(e.scope));if(t.some(e=>e.workflow===""))return[];const r=new Set(t.map(e=>e.workflow));return o.workflows.filter(e=>!r.has(e.exportName)).map(e=>i(s,{cacheKey:`workflow_unused:${e.exportName}`,detail:`No function calls \`ctx.workflows.get("${e.exportName}")\` — workflow "${e.exportName}" is declared but never started in app code.`,metadata:{workflow:e.exportName}}))},source:"static",title:"Workflow is never started"};export{s as default};