@lunora/advisor 1.0.0-alpha.55 → 1.0.0-alpha.56
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/README.md +53 -0
- package/dist/index.d.mts +397 -61
- package/dist/index.d.ts +397 -61
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/MAP_VERSION-BS08jBkS.mjs +1 -0
- package/dist/packem_shared/actionWithoutErrorHandling-D1DqSPpg.mjs +1 -0
- package/dist/packem_shared/aiRunWithoutLogging-CMvQPNBr.mjs +1 -0
- package/dist/packem_shared/classifySensitivity-DjswRYWd.mjs +1 -0
- package/dist/packem_shared/compareToBaseline-T1_kl8VY.mjs +1 -0
- package/dist/packem_shared/errorWithoutCatalog-DTDVKU4b.mjs +1 -0
- package/dist/packem_shared/{filterWithoutIndex-ht2GZQWV.mjs → filterWithoutIndex-yd1N-GQ0.mjs} +1 -1
- package/dist/packem_shared/gradeFromScore-DW82YDVY.mjs +1 -0
- package/dist/packem_shared/procedureWithoutStructuredEvent-D4Qi2vH7.mjs +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -814,36 +814,6 @@ interface AdvisorOwnerFieldWrite {
|
|
|
814
814
|
/** The `ctx.db` write method (`insert` / `replace` / `patch` / `insertManyUnsafe`). */
|
|
815
815
|
method: string;
|
|
816
816
|
}
|
|
817
|
-
/**
|
|
818
|
-
* One branching `defineShape({ where })` / `definePolicy({ when })` predicate arm
|
|
819
|
-
* that returns an unrestricted predicate — the `unrestricted_where_branch` lint
|
|
820
|
-
* input.
|
|
821
|
-
*
|
|
822
|
-
* A row predicate returns a *filter*, not a boolean, so the denial arm has to be a
|
|
823
|
-
* predicate matching **no** rows: `deny()` / `{ OR: [] }`, a disjunction over zero
|
|
824
|
-
* branches. The plausible-looking `{}` is its exact opposite — it matches every row,
|
|
825
|
-
* so an arm meaning "this caller sees nothing" silently replicates or exposes the
|
|
826
|
-
* whole table, with no error and no log line.
|
|
827
|
-
*
|
|
828
|
-
* Only reported for a *branching* predicate: a single-exit `where: () => ({})` is an
|
|
829
|
-
* author deliberately replicating everything, which is legitimate. Produced by the
|
|
830
|
-
* codegen feeder; runtime callers don't supply it, so the lint finds nothing there.
|
|
831
|
-
* Structurally identical to `UnrestrictedWhereBranchIR`.
|
|
832
|
-
*/
|
|
833
|
-
interface AdvisorUnrestrictedWhereBranch {
|
|
834
|
-
/** The exported binding name of the shape / policy the predicate belongs to. */
|
|
835
|
-
exportName: string;
|
|
836
|
-
/** Source file relative to the lunora dir, no extension. */
|
|
837
|
-
file: string;
|
|
838
|
-
/** Which unrestricted form was returned. */
|
|
839
|
-
form: "empty-object" | "undefined";
|
|
840
|
-
/** The config key carrying the predicate (`where` for a shape, `when` for a policy). */
|
|
841
|
-
key: string;
|
|
842
|
-
/** 1-based line of the offending returned expression. */
|
|
843
|
-
line: number;
|
|
844
|
-
/** The declaring call (`defineShape` / `definePolicy`). */
|
|
845
|
-
owner: string;
|
|
846
|
-
}
|
|
847
817
|
/**
|
|
848
818
|
* One payment webhook-adapter construction (`createStripeAdapter` /
|
|
849
819
|
* `createPolarAdapter` / `createAutumnAdapter` / `createDodoPaymentsAdapter`) —
|
|
@@ -906,12 +876,24 @@ interface AdvisorPrivilegedDispatch {
|
|
|
906
876
|
interface AdvisorProcedureProtection {
|
|
907
877
|
/** `true` when the handler references `ctx.mail` / `ctx.email` (sends mail). */
|
|
908
878
|
callsMail: boolean;
|
|
879
|
+
/** `true` when the handler emits a structured observability event (`ctx.log` / `ctx.span` / `ctx.trace`). */
|
|
880
|
+
emitsEvent?: boolean;
|
|
881
|
+
/**
|
|
882
|
+
* `true` when the source carries a `// lunora-advisor-exempt` directive above
|
|
883
|
+
* the export — the developer's explicit opt-out. The row still appears in the
|
|
884
|
+
* map, marked `exempt`, but pulls no weight.
|
|
885
|
+
*/
|
|
886
|
+
exempt?: boolean;
|
|
887
|
+
/** The `-- reason` from the directive, so an exemption is argued rather than silent. */
|
|
888
|
+
exemptReason?: string;
|
|
909
889
|
/** The exported binding name of the procedure (e.g. `signUp`). */
|
|
910
890
|
exportName: string;
|
|
911
891
|
/** `true` when the handler fans work out to a privileged, cost-bearing dispatch surface (scheduler `runAfter`/`runAt`, a queue producer send, or a workflow create). Read by the privileged-fanout lint, paired with public visibility and no rate limit. */
|
|
912
892
|
fanOut: boolean;
|
|
913
893
|
/** Source file relative to the lunora dir, no extension. */
|
|
914
894
|
file: string;
|
|
895
|
+
/** `true` when the handler wraps work in `try`/`catch`. */
|
|
896
|
+
handlesErrors?: boolean;
|
|
915
897
|
/**
|
|
916
898
|
* `true` when the procedure declares an email-shaped argument. Read by the
|
|
917
899
|
* `signup_mutation_without_disposable_gating` lint: `emailGateMiddleware`
|
|
@@ -924,6 +906,12 @@ interface AdvisorProcedureProtection {
|
|
|
924
906
|
hasEmailArg?: boolean;
|
|
925
907
|
/** Registration kind — `query` is read-only; `mutation`/`action` are write-shaped. */
|
|
926
908
|
kind: "action" | "mutation" | "query";
|
|
909
|
+
/** `true` when the handler runs any AI generation, bounded or not. */
|
|
910
|
+
runsAiGeneration?: boolean;
|
|
911
|
+
/** `true` when the handler reaches an outbound surface (`ctx.fetch`, mail, queues, storage, sql, ai, …) that can fail. */
|
|
912
|
+
reachesOutbound?: boolean;
|
|
913
|
+
/** `true` when the handler throws a bare `new Error(...)` rather than a coded `LunoraError`. */
|
|
914
|
+
throwsBareError?: boolean;
|
|
927
915
|
/** `true` when the handler runs an AI generation (`generateText`/`streamText`/`generateObject`/`streamObject`) with no `maxOutputTokens` bound. Read by the `ai_unbounded_generation_public` lint (paired with public visibility). */
|
|
928
916
|
unboundedAiGeneration: boolean;
|
|
929
917
|
/** `true` when the chain carries `.use(verifyTurnstile(...))` or a `protectPublic({ captcha })` bundle. */
|
|
@@ -950,6 +938,16 @@ interface AdvisorProcedureProtection {
|
|
|
950
938
|
* supply it, so the lint simply finds nothing there.
|
|
951
939
|
*/
|
|
952
940
|
interface AdvisorQueryRead {
|
|
941
|
+
/**
|
|
942
|
+
* The exported procedure the read sits in, when the feeder could resolve one.
|
|
943
|
+
* Carried so the advisor map can attribute the finding to that procedure's row
|
|
944
|
+
* rather than to the project bucket; a read outside any export (module scope)
|
|
945
|
+
* legitimately has none.
|
|
946
|
+
*
|
|
947
|
+
* Optional so a feeder predating this field still typechecks — such a run
|
|
948
|
+
* simply attributes project-wide, exactly as before.
|
|
949
|
+
*/
|
|
950
|
+
exportName?: string;
|
|
953
951
|
/** Source file the read appears in (relative to the lunora dir, no extension). */
|
|
954
952
|
file: string;
|
|
955
953
|
/** True when the chain calls `.filter(...)`. */
|
|
@@ -1468,6 +1466,36 @@ interface AdvisorTableSample {
|
|
|
1468
1466
|
/** Whether more rows exist beyond the cap. */
|
|
1469
1467
|
readonly truncated: boolean;
|
|
1470
1468
|
}
|
|
1469
|
+
/**
|
|
1470
|
+
* One branching `defineShape({ where })` / `definePolicy({ when })` predicate arm
|
|
1471
|
+
* that returns an unrestricted predicate — the `unrestricted_where_branch` lint
|
|
1472
|
+
* input.
|
|
1473
|
+
*
|
|
1474
|
+
* A row predicate returns a *filter*, not a boolean, so the denial arm has to be a
|
|
1475
|
+
* predicate matching **no** rows: `deny()` / `{ OR: [] }`, a disjunction over zero
|
|
1476
|
+
* branches. The plausible-looking `{}` is its exact opposite — it matches every row,
|
|
1477
|
+
* so an arm meaning "this caller sees nothing" silently replicates or exposes the
|
|
1478
|
+
* whole table, with no error and no log line.
|
|
1479
|
+
*
|
|
1480
|
+
* Only reported for a *branching* predicate: a single-exit `where: () => ({})` is an
|
|
1481
|
+
* author deliberately replicating everything, which is legitimate. Produced by the
|
|
1482
|
+
* codegen feeder; runtime callers don't supply it, so the lint finds nothing there.
|
|
1483
|
+
* Structurally identical to `UnrestrictedWhereBranchIR`.
|
|
1484
|
+
*/
|
|
1485
|
+
interface AdvisorUnrestrictedWhereBranch {
|
|
1486
|
+
/** The exported binding name of the shape / policy the predicate belongs to. */
|
|
1487
|
+
exportName: string;
|
|
1488
|
+
/** Source file relative to the lunora dir, no extension. */
|
|
1489
|
+
file: string;
|
|
1490
|
+
/** Which unrestricted form was returned. */
|
|
1491
|
+
form: "empty-object" | "undefined";
|
|
1492
|
+
/** The config key carrying the predicate (`where` for a shape, `when` for a policy). */
|
|
1493
|
+
key: string;
|
|
1494
|
+
/** 1-based line of the offending returned expression. */
|
|
1495
|
+
line: number;
|
|
1496
|
+
/** The declaring call (`defineShape` / `definePolicy`). */
|
|
1497
|
+
owner: string;
|
|
1498
|
+
}
|
|
1471
1499
|
/**
|
|
1472
1500
|
* One `ctx.vectors.<method>(indexName, input)` call whose `input.namespace` is
|
|
1473
1501
|
* derived from the handler's `args` with no server-side scoping — the input the
|
|
@@ -1912,12 +1940,6 @@ interface LintContext {
|
|
|
1912
1940
|
* absent for runtime callers, where the lint finds nothing.
|
|
1913
1941
|
*/
|
|
1914
1942
|
ownerFieldWrites?: ReadonlyArray<AdvisorOwnerFieldWrite>;
|
|
1915
|
-
/**
|
|
1916
|
-
* Branching shape/policy predicate arms returning an unrestricted filter (`{}` /
|
|
1917
|
-
* `undefined`) — the `unrestricted_where_branch` lint input. Supplied by the
|
|
1918
|
-
* codegen feeder only.
|
|
1919
|
-
*/
|
|
1920
|
-
unrestrictedWhereBranches?: ReadonlyArray<AdvisorUnrestrictedWhereBranch>;
|
|
1921
1943
|
/**
|
|
1922
1944
|
* Payment webhook-adapter constructions (`createStripeAdapter` /
|
|
1923
1945
|
* `createPolarAdapter` / `createAutumnAdapter` / `createDodoPaymentsAdapter`) — the payment-webhook wide-tolerance lint's input. Each row's
|
|
@@ -2090,6 +2112,12 @@ interface LintContext {
|
|
|
2090
2112
|
* and shards. Absent for static callers, where the lint finds nothing.
|
|
2091
2113
|
*/
|
|
2092
2114
|
tableScans?: ReadonlyArray<AdvisorTableScan>;
|
|
2115
|
+
/**
|
|
2116
|
+
* Branching shape/policy predicate arms returning an unrestricted filter (`{}` /
|
|
2117
|
+
* `undefined`) — the `unrestricted_where_branch` lint input. Supplied by the
|
|
2118
|
+
* codegen feeder only.
|
|
2119
|
+
*/
|
|
2120
|
+
unrestrictedWhereBranches?: ReadonlyArray<AdvisorUnrestrictedWhereBranch>;
|
|
2093
2121
|
/**
|
|
2094
2122
|
* `ctx.vectors.<method>(index, { namespace, … })` calls whose `namespace` is
|
|
2095
2123
|
* derived from the handler's `args` with no server-side scoping — the
|
|
@@ -2322,6 +2350,21 @@ declare const indexUtilization: Lint;
|
|
|
2322
2350
|
* arg-derived `ctx.fetch` call.
|
|
2323
2351
|
*/
|
|
2324
2352
|
declare const actionFetchSsrf: Lint;
|
|
2353
|
+
/**
|
|
2354
|
+
* Flags an `action` that reaches an outbound surface with no `try`/`catch`
|
|
2355
|
+
* anywhere in its body.
|
|
2356
|
+
*
|
|
2357
|
+
* Actions are where Lunora talks to things it does not control — `ctx.fetch`,
|
|
2358
|
+
* mail, queues, storage, external SQL, AI. Every one of those fails routinely
|
|
2359
|
+
* (timeout, 5xx, quota), and an uncaught rejection there surfaces to the caller
|
|
2360
|
+
* as an opaque failure with no indication of which dependency broke. Catching it
|
|
2361
|
+
* is what lets the handler add that context, or degrade instead of failing.
|
|
2362
|
+
*
|
|
2363
|
+
* Only `action` is checked: queries and mutations run inside the Durable Object
|
|
2364
|
+
* and cannot reach these surfaces. Runs only when the codegen feeder supplies
|
|
2365
|
+
* procedure evidence.
|
|
2366
|
+
*/
|
|
2367
|
+
declare const actionWithoutErrorHandling: Lint;
|
|
2325
2368
|
/**
|
|
2326
2369
|
* Flags an `httpRoute` on an admin/privileged-looking path whose handler shows no
|
|
2327
2370
|
* auth/admin guard.
|
|
@@ -2359,6 +2402,22 @@ declare const adminRouteWithoutGuard: Lint;
|
|
|
2359
2402
|
* arg-derived, unscoped `ctx.ai.run` call.
|
|
2360
2403
|
*/
|
|
2361
2404
|
declare const aiRawRunEscapeHatch: Lint;
|
|
2405
|
+
/**
|
|
2406
|
+
* Flags a procedure that runs an AI generation but emits no structured event.
|
|
2407
|
+
*
|
|
2408
|
+
* Model calls are the least reproducible thing in an app and the only one that
|
|
2409
|
+
* bills per invocation: the same input can return a different answer tomorrow,
|
|
2410
|
+
* and a runaway loop is a cost incident rather than an outage. Without an event
|
|
2411
|
+
* recording that the call happened there is no way to attribute spend, compare a
|
|
2412
|
+
* bad answer against the prompt that produced it, or notice a retry storm.
|
|
2413
|
+
*
|
|
2414
|
+
* Keyed on whether the handler runs a model at all — bounded or not. An earlier
|
|
2415
|
+
* cut reused the `unboundedAiGeneration` / raw-run signals, which meant the
|
|
2416
|
+
* correctly-bounded `generateText({ …, maxOutputTokens })` — the common case, and
|
|
2417
|
+
* the one this rule exists for — was never flagged, while procedures another lint
|
|
2418
|
+
* had already caught were charged twice.
|
|
2419
|
+
*/
|
|
2420
|
+
declare const aiRunWithoutLogging: Lint;
|
|
2362
2421
|
/**
|
|
2363
2422
|
* Flags a `generateText` / `streamText` call whose model input is user-derived
|
|
2364
2423
|
* **and** whose model-callable `tools` reach a privileged side effect.
|
|
@@ -2476,6 +2535,30 @@ declare const authCsrfCheckDisabled: Lint;
|
|
|
2476
2535
|
* call.
|
|
2477
2536
|
*/
|
|
2478
2537
|
declare const authEmailVerificationDisabled: Lint;
|
|
2538
|
+
/**
|
|
2539
|
+
* Flags a `createAuth({...})` call that loads `scim()` on an adapter with no native
|
|
2540
|
+
* transactions.
|
|
2541
|
+
*
|
|
2542
|
+
* `@better-auth/scim` refuses to serve at all unless its adapter exposes a
|
|
2543
|
+
* `transaction` function — its provisioning writes go through a read-then-conditional-write
|
|
2544
|
+
* decommission lease. `lunoraD1Adapter` and `lunoraAuthAdapter` are single-table CRUD,
|
|
2545
|
+
* and D1 has no interactive transactions to expose in the first place, so this pairing
|
|
2546
|
+
* throws on the first SCIM request:
|
|
2547
|
+
*
|
|
2548
|
+
* ```
|
|
2549
|
+
* BetterAuthError: The scim plugin requires a database adapter with native transaction support.
|
|
2550
|
+
* ```
|
|
2551
|
+
*
|
|
2552
|
+
* This exists because the combination shipped in real documentation once. It is not a
|
|
2553
|
+
* subtle misconfiguration — it is a deployment where directory sync cannot work at all —
|
|
2554
|
+
* and it is entirely visible at build time, so there is no reason for the first
|
|
2555
|
+
* indication to be a 500 from an IdP's provisioning call.
|
|
2556
|
+
*
|
|
2557
|
+
* Runs only when the codegen feeder supplies auth-config evidence
|
|
2558
|
+
* (`context.authConfigs`), and only for an analyzable config; an opaque one could pass
|
|
2559
|
+
* a different `database` and is skipped rather than guessed at.
|
|
2560
|
+
*/
|
|
2561
|
+
declare const authScimWithoutTransactions: Lint;
|
|
2479
2562
|
/**
|
|
2480
2563
|
* Flags a `createAuth({...})` call whose `advanced.useSecureCookies` is
|
|
2481
2564
|
* explicitly `false`.
|
|
@@ -2515,30 +2598,6 @@ declare const authSecureCookiesDisabled: Lint;
|
|
|
2515
2598
|
* call.
|
|
2516
2599
|
*/
|
|
2517
2600
|
declare const authSessionFreshageZero: Lint;
|
|
2518
|
-
/**
|
|
2519
|
-
* Flags a `createAuth({...})` call that loads `scim()` on an adapter with no native
|
|
2520
|
-
* transactions.
|
|
2521
|
-
*
|
|
2522
|
-
* `@better-auth/scim` refuses to serve at all unless its adapter exposes a
|
|
2523
|
-
* `transaction` function — its provisioning writes go through a read-then-conditional-write
|
|
2524
|
-
* decommission lease. `lunoraD1Adapter` and `lunoraAuthAdapter` are single-table CRUD,
|
|
2525
|
-
* and D1 has no interactive transactions to expose in the first place, so this pairing
|
|
2526
|
-
* throws on the first SCIM request:
|
|
2527
|
-
*
|
|
2528
|
-
* ```
|
|
2529
|
-
* BetterAuthError: The scim plugin requires a database adapter with native transaction support.
|
|
2530
|
-
* ```
|
|
2531
|
-
*
|
|
2532
|
-
* This exists because the combination shipped in real documentation once. It is not a
|
|
2533
|
-
* subtle misconfiguration — it is a deployment where directory sync cannot work at all —
|
|
2534
|
-
* and it is entirely visible at build time, so there is no reason for the first
|
|
2535
|
-
* indication to be a 500 from an IdP's provisioning call.
|
|
2536
|
-
*
|
|
2537
|
-
* Runs only when the codegen feeder supplies auth-config evidence
|
|
2538
|
-
* (`context.authConfigs`), and only for an analyzable config; an opaque one could pass
|
|
2539
|
-
* a different `database` and is skipped rather than guessed at.
|
|
2540
|
-
*/
|
|
2541
|
-
declare const authScimWithoutTransactions: Lint;
|
|
2542
2601
|
/**
|
|
2543
2602
|
* Flags a `createAuth({...})` call whose `trustedOrigins` array literal
|
|
2544
2603
|
* contains a `"*"` entry.
|
|
@@ -2694,6 +2753,19 @@ declare const duplicateIndex: Lint;
|
|
|
2694
2753
|
* least one field by construction, so only `kind: "index"` is checked.)
|
|
2695
2754
|
*/
|
|
2696
2755
|
declare const emptyIndex: Lint;
|
|
2756
|
+
/**
|
|
2757
|
+
* Flags a procedure that throws a bare `new Error(...)`.
|
|
2758
|
+
*
|
|
2759
|
+
* A bare `Error` crosses the RPC boundary as an opaque message: the client
|
|
2760
|
+
* cannot branch on it, `@lunora/fingerprint` cannot group it into an issue, and
|
|
2761
|
+
* the message itself is free text that changes whenever someone edits the
|
|
2762
|
+
* string. `LunoraError` carries a stable code from `ERROR_CATALOG`, which is
|
|
2763
|
+
* what makes an error both matchable on the client and groupable in Studio.
|
|
2764
|
+
*
|
|
2765
|
+
* Runs only when the codegen feeder supplies procedure evidence; a runtime
|
|
2766
|
+
* caller with no evidence flags nothing.
|
|
2767
|
+
*/
|
|
2768
|
+
declare const errorWithoutCatalog: Lint;
|
|
2697
2769
|
/**
|
|
2698
2770
|
* Flags a misconfigured CDC export sink (plan 170) — a `defineExportSink` /
|
|
2699
2771
|
* `webhookExportSink` / `r2Sink` construction with a required config field
|
|
@@ -3378,6 +3450,23 @@ declare const privilegedDispatchUnvalidatedPayload: Lint;
|
|
|
3378
3450
|
* per unguarded public fan-out procedure.
|
|
3379
3451
|
*/
|
|
3380
3452
|
declare const privilegedFanoutFromPublicProcedure: Lint;
|
|
3453
|
+
/**
|
|
3454
|
+
* Flags a public `mutation`/`action` whose handler emits no structured
|
|
3455
|
+
* observability event.
|
|
3456
|
+
*
|
|
3457
|
+
* When one of these fails in production you get a stack trace and nothing about
|
|
3458
|
+
* the request that caused it — no ids, no tenant, no outcome. `ctx.log` /
|
|
3459
|
+
* `ctx.span` attach that context to the invocation, so the failure is
|
|
3460
|
+
* searchable instead of merely visible. Reads are excluded: a `query` that
|
|
3461
|
+
* returns the wrong rows is diagnosable from its arguments, while a write that
|
|
3462
|
+
* half-succeeded is not.
|
|
3463
|
+
*
|
|
3464
|
+
* Runs only when the codegen feeder supplies procedure evidence; a runtime
|
|
3465
|
+
* caller with no evidence flags nothing. The feeder reports "no event" only when
|
|
3466
|
+
* it could read the body, so a procedure whose handler it cannot analyze is left
|
|
3467
|
+
* alone rather than nagged.
|
|
3468
|
+
*/
|
|
3469
|
+
declare const procedureWithoutStructuredEvent: Lint;
|
|
3381
3470
|
/**
|
|
3382
3471
|
* Flags a `v.any()` argument on a public procedure.
|
|
3383
3472
|
*
|
|
@@ -3982,6 +4071,253 @@ declare const workflowUnknownTarget: Lint;
|
|
|
3982
4071
|
* (`context.workflows` present); a runtime caller flags nothing.
|
|
3983
4072
|
*/
|
|
3984
4073
|
declare const workflowUnused: Lint;
|
|
4074
|
+
/** Letter band for a 0–100 score. */
|
|
4075
|
+
type Grade = "at-risk" | "excellent" | "good" | "needs-work";
|
|
4076
|
+
/**
|
|
4077
|
+
* How a single procedure came out of the lints that apply to it.
|
|
4078
|
+
*
|
|
4079
|
+
* Named for severity rather than instrumentation, because the score is driven by
|
|
4080
|
+
* every lint family (security, performance, schema): a verdict like
|
|
4081
|
+
* "uninstrumented" would claim something the map does not measure, and would
|
|
4082
|
+
* report a security regression as a telemetry gap. `clean` means no lint fired.
|
|
4083
|
+
* `exempt` rows pull no weight.
|
|
4084
|
+
*/
|
|
4085
|
+
type Coverage = "clean" | "exempt" | "failing" | "warned";
|
|
4086
|
+
/**
|
|
4087
|
+
* One *rule* that fired against a procedure, reduced to its score contribution.
|
|
4088
|
+
*
|
|
4089
|
+
* Deduplicated by lint: a rule that fires on five call sites is one check with
|
|
4090
|
+
* `occurrences: 5`, costing its weight once. Counting occurrences instead would
|
|
4091
|
+
* let a single rule zero a procedure and would fill the artifact with identical
|
|
4092
|
+
* rows.
|
|
4093
|
+
*/
|
|
4094
|
+
interface CheckResult {
|
|
4095
|
+
/** Worst severity seen across this rule's occurrences. */
|
|
4096
|
+
level: Level;
|
|
4097
|
+
/** The lint id that fired, e.g. `unindexed_foreign_key`. */
|
|
4098
|
+
name: string;
|
|
4099
|
+
/** How many findings this rule produced on the procedure (>= 1). */
|
|
4100
|
+
occurrences: number;
|
|
4101
|
+
/** Points subtracted from the procedure's score — charged once, not per occurrence. */
|
|
4102
|
+
weight: number;
|
|
4103
|
+
}
|
|
4104
|
+
/** How much a procedure's failures matter — see `classifySensitivity`. */
|
|
4105
|
+
type SensitivityLevel = "high" | "none";
|
|
4106
|
+
/** A procedure's sensitivity plus the declarations that produced it. */
|
|
4107
|
+
interface Sensitivity {
|
|
4108
|
+
/** `high` when any signal fired; `none` means no signal, not "safe". */
|
|
4109
|
+
level: SensitivityLevel;
|
|
4110
|
+
/** Human-readable signals, e.g. "writes an identity table". Empty when `none`. */
|
|
4111
|
+
reasons: string[];
|
|
4112
|
+
}
|
|
4113
|
+
/** One scored procedure — the unit the map is built from. */
|
|
4114
|
+
interface ProcedureScore {
|
|
4115
|
+
/** Rules that fired against this procedure, sorted by `name`. */
|
|
4116
|
+
checks: CheckResult[];
|
|
4117
|
+
/** Verdict derived from {@link ProcedureScore.score}. */
|
|
4118
|
+
coverage: Coverage;
|
|
4119
|
+
/** Why this row is `exempt`, when a source directive said so. Empty when none was given. */
|
|
4120
|
+
exemptReason?: string;
|
|
4121
|
+
/** Exported binding name, e.g. `sendMessage`. */
|
|
4122
|
+
exportName: string;
|
|
4123
|
+
/** Source file relative to the lunora dir, no extension. */
|
|
4124
|
+
file: string;
|
|
4125
|
+
/** Stable `file#exportName` identity — the baseline diff key. */
|
|
4126
|
+
id: string;
|
|
4127
|
+
/** Registration kind. */
|
|
4128
|
+
kind: "action" | "mutation" | "query";
|
|
4129
|
+
/** 0–100, starting at 100 less each fired rule's weight. */
|
|
4130
|
+
score: number;
|
|
4131
|
+
/** How much this procedure's failures matter, and why. */
|
|
4132
|
+
sensitivity: Sensitivity;
|
|
4133
|
+
/** Public (client-callable) or internal (server-called). */
|
|
4134
|
+
visibility: "internal" | "public";
|
|
4135
|
+
/** This row's weight in the global mean — see `procedureWeight`. */
|
|
4136
|
+
weight: number;
|
|
4137
|
+
}
|
|
4138
|
+
/**
|
|
4139
|
+
* Findings that name no procedure — schema-shape and project-wide lints
|
|
4140
|
+
* (missing index, circular FK, plaintext wrangler secret), plus any finding
|
|
4141
|
+
* whose `file`/`exportName` matches no declared procedure.
|
|
4142
|
+
*
|
|
4143
|
+
* Folded into the global mean at a weight proportional to the procedure
|
|
4144
|
+
* population (see `projectWeight`) so schema debt genuinely moves the grade.
|
|
4145
|
+
* Because this single score saturates at 0, `compareToBaseline` also diffs
|
|
4146
|
+
* `checks.length` — otherwise new schema errors would be free once the bucket
|
|
4147
|
+
* bottoms out.
|
|
4148
|
+
*/
|
|
4149
|
+
interface ProjectScore {
|
|
4150
|
+
/** Rules that fired at project level, sorted by `name`. */
|
|
4151
|
+
checks: CheckResult[];
|
|
4152
|
+
/** 0–100, same formula as a procedure. */
|
|
4153
|
+
score: number;
|
|
4154
|
+
}
|
|
4155
|
+
/** Coverage tallies for the summary line and the Studio matrix header. */
|
|
4156
|
+
interface MapSummary {
|
|
4157
|
+
/** Procedures with no lint firing. */
|
|
4158
|
+
clean: number;
|
|
4159
|
+
/** Procedures excluded from scoring. */
|
|
4160
|
+
exempt: number;
|
|
4161
|
+
/** Procedures scoring below the failing floor. */
|
|
4162
|
+
failing: number;
|
|
4163
|
+
/** Total procedures in the map, exempt included. */
|
|
4164
|
+
procedures: number;
|
|
4165
|
+
/** Findings attributed to a scored row, after per-rule deduplication. */
|
|
4166
|
+
rulesFired: number;
|
|
4167
|
+
/** Procedures scoring at or above the failing floor, but not clean. */
|
|
4168
|
+
warned: number;
|
|
4169
|
+
}
|
|
4170
|
+
/**
|
|
4171
|
+
* The `lunora.advisor.map.json` artifact — the unit a baseline is diffed
|
|
4172
|
+
* against and the Studio health panel renders.
|
|
4173
|
+
*/
|
|
4174
|
+
interface AdvisorMap {
|
|
4175
|
+
/**
|
|
4176
|
+
* ISO-8601 stamp. Defaults to the current time; pass
|
|
4177
|
+
* `ScoreAdvisorOptions.generatedAt` explicitly when the artifact must be
|
|
4178
|
+
* byte-stable (tests, reproducible builds) — everything else in the map is
|
|
4179
|
+
* a pure function of the findings.
|
|
4180
|
+
*/
|
|
4181
|
+
generatedAt: string;
|
|
4182
|
+
/** Band for {@link AdvisorMap.score}. */
|
|
4183
|
+
grade: Grade;
|
|
4184
|
+
/** Per-procedure rows, sorted by `id` for a stable diff. */
|
|
4185
|
+
procedures: ProcedureScore[];
|
|
4186
|
+
/** Findings not attributable to a procedure. */
|
|
4187
|
+
project: ProjectScore;
|
|
4188
|
+
/** Weighted mean over non-exempt procedures plus the project entry, 0–100. */
|
|
4189
|
+
score: number;
|
|
4190
|
+
/** Coverage tallies. */
|
|
4191
|
+
summary: MapSummary;
|
|
4192
|
+
/** Artifact shape version; bump on a breaking change so an old baseline is rejected rather than mis-read. */
|
|
4193
|
+
version: number;
|
|
4194
|
+
}
|
|
4195
|
+
/** One procedure whose score moved between the baseline and the current map. */
|
|
4196
|
+
interface ProcedureDelta {
|
|
4197
|
+
/** Score in the current map. */
|
|
4198
|
+
after: number;
|
|
4199
|
+
/** Score in the baseline. */
|
|
4200
|
+
before: number;
|
|
4201
|
+
/** `file#exportName`. */
|
|
4202
|
+
id: string;
|
|
4203
|
+
}
|
|
4204
|
+
/**
|
|
4205
|
+
* The verdict a CI gate acts on.
|
|
4206
|
+
*
|
|
4207
|
+
* A discriminated union on purpose: the obvious shape (a flat object with
|
|
4208
|
+
* `comparable: boolean` and `regressed: false` when incomparable) reads as
|
|
4209
|
+
* "no regression" for a missing, stale, or corrupt baseline, so a gate written
|
|
4210
|
+
* as `if (diff.regressed)` silently passes forever after a `MAP_VERSION` bump.
|
|
4211
|
+
* Forcing the caller to narrow makes that mistake unrepresentable.
|
|
4212
|
+
*/
|
|
4213
|
+
type BaselineComparison = {
|
|
4214
|
+
comparable: false;
|
|
4215
|
+
/** Why no comparison was possible — a gate should treat this as "cannot verify", not "clean". */
|
|
4216
|
+
reason: "version-mismatch";
|
|
4217
|
+
} | {
|
|
4218
|
+
comparable: true;
|
|
4219
|
+
/** Procedures present in both maps whose score fell, sorted by `id`. */
|
|
4220
|
+
dropped: ProcedureDelta[];
|
|
4221
|
+
/** Procedures that are `failing` now and were not before — new rows included. */
|
|
4222
|
+
newFailing: string[];
|
|
4223
|
+
/** `true` when the project bucket gained rules or occurrences, even if its saturated score did not move. */
|
|
4224
|
+
projectRegressed: boolean;
|
|
4225
|
+
/** `true` when any signal above fired. */
|
|
4226
|
+
regressed: boolean;
|
|
4227
|
+
/** Current global score less the baseline's; negative is a regression. */
|
|
4228
|
+
scoreDelta: number;
|
|
4229
|
+
/**
|
|
4230
|
+
* Procedures whose score held but whose findings grew — a new rule fired,
|
|
4231
|
+
* or an existing one fired at more call sites. Scoring charges a rule once
|
|
4232
|
+
* however many times it fires, so without this signal "same rule, five more
|
|
4233
|
+
* violations" would look identical to the baseline.
|
|
4234
|
+
*/
|
|
4235
|
+
worsened: string[];
|
|
4236
|
+
};
|
|
4237
|
+
/**
|
|
4238
|
+
* Diff a freshly-scored map against a committed one.
|
|
4239
|
+
*
|
|
4240
|
+
* Five independent regression signals, any of which fails a gate: the global
|
|
4241
|
+
* score fell, a procedure that existed before got worse, a procedure started
|
|
4242
|
+
* failing, a procedure's findings grew without its score moving, or the project
|
|
4243
|
+
* bucket gained findings. The per-procedure signals matter because a refactor can
|
|
4244
|
+
* leave the global mean flat while gutting one handler; the growth signals matter
|
|
4245
|
+
* because a rule is charged once however many times it fires, and the project
|
|
4246
|
+
* score saturates at 0 — without them, new violations would be free.
|
|
4247
|
+
*/
|
|
4248
|
+
declare const compareToBaseline: (current: AdvisorMap, baseline: AdvisorMap) => BaselineComparison;
|
|
4249
|
+
/**
|
|
4250
|
+
* Narrow a parsed `lunora.advisor.map.json` to an {@link AdvisorMap}, returning
|
|
4251
|
+
* `undefined` when it is not one this build can read.
|
|
4252
|
+
*
|
|
4253
|
+
* Validates *shape* — the header and every procedure row — because
|
|
4254
|
+
* `compareToBaseline` dereferences `entry.id` / `entry.score` /
|
|
4255
|
+
* `entry.coverage`: a truncated or merge-conflicted baseline with a `null` row
|
|
4256
|
+
* would otherwise crash the gate, and a row of `{}` would compare as a silent
|
|
4257
|
+
* no-op. Non-finite scores are rejected for the same reason — `NaN < 0` is
|
|
4258
|
+
* `false`, which reads as "no regression".
|
|
4259
|
+
*
|
|
4260
|
+
* Version *policy* deliberately lives in {@link compareToBaseline}, not here.
|
|
4261
|
+
* Rejecting a mismatch in both places made that function's `comparable: false`
|
|
4262
|
+
* arm unreachable through every shipped path, so the union that exists to stop a
|
|
4263
|
+
* stale baseline reading as "clean" was never exercised. Here we only require a
|
|
4264
|
+
* version to be present and finite.
|
|
4265
|
+
*/
|
|
4266
|
+
declare const parseAdvisorMap: (value: unknown) => AdvisorMap | undefined;
|
|
4267
|
+
/** Band a 0–100 score. */
|
|
4268
|
+
declare const gradeFromScore: (score: number) => Grade;
|
|
4269
|
+
/**
|
|
4270
|
+
* Codepoint ordering. `localeCompare` would sort by the host's `LANG`/`LC_ALL`,
|
|
4271
|
+
* so the same repo scored on a Danish-locale runner emits a different row order
|
|
4272
|
+
* than an `en_US` one — the committed artifact would churn and a
|
|
4273
|
+
* `git diff --exit-code` gate would fail for no reason. Ordering must be a
|
|
4274
|
+
* property of the data, not the machine.
|
|
4275
|
+
*/
|
|
4276
|
+
declare const byCodepoint: (a: string, b: string) => number;
|
|
4277
|
+
/**
|
|
4278
|
+
* {@link AdvisorMap.version} this build emits. Bump on a breaking shape change
|
|
4279
|
+
* so `compareToBaseline` rejects a stale artifact instead of mis-reading it.
|
|
4280
|
+
*/
|
|
4281
|
+
declare const MAP_VERSION = 1;
|
|
4282
|
+
/** Options for {@link scoreAdvisor}. */
|
|
4283
|
+
interface ScoreAdvisorOptions {
|
|
4284
|
+
/**
|
|
4285
|
+
* Procedure ids (`file#exportName`) to exclude from scoring, for a caller
|
|
4286
|
+
* that computes exemptions itself. Source-level `// lunora-advisor-exempt`
|
|
4287
|
+
* directives are honoured independently; the two compose.
|
|
4288
|
+
*/
|
|
4289
|
+
exempt?: ReadonlyArray<string>;
|
|
4290
|
+
/**
|
|
4291
|
+
* Stamp written to {@link AdvisorMap.generatedAt}. Defaults to now; pass it
|
|
4292
|
+
* explicitly when the map must be byte-stable (tests, reproducible builds).
|
|
4293
|
+
*/
|
|
4294
|
+
generatedAt?: string;
|
|
4295
|
+
}
|
|
4296
|
+
/**
|
|
4297
|
+
* Roll a lint run up into a scored coverage map (see the package's
|
|
4298
|
+
* `docs/index.mdx` for the scoring rules and the baseline gate).
|
|
4299
|
+
*
|
|
4300
|
+
* Pure: it re-reads the `findings` a caller already got from `runAdvisor` rather
|
|
4301
|
+
* than running lints itself, so scoring never double-runs a rule and the lint
|
|
4302
|
+
* core stays untouched. Findings are attributed to a procedure via their
|
|
4303
|
+
* `metadata.file` + `metadata.exportName`; everything else lands in the project
|
|
4304
|
+
* bucket, which is folded into the global mean at a weight proportional to the
|
|
4305
|
+
* procedure population so schema debt genuinely moves the grade.
|
|
4306
|
+
*
|
|
4307
|
+
* Takes the procedure list directly rather than a `LintContext`: it reads no
|
|
4308
|
+
* other feeder, and asking for the whole context forced callers with only a
|
|
4309
|
+
* procedure array to fabricate an empty schema.
|
|
4310
|
+
*/
|
|
4311
|
+
declare const scoreAdvisor: (procedures: ReadonlyArray<AdvisorProcedureProtection>, findings: ReadonlyArray<Finding>, options?: ScoreAdvisorOptions) => AdvisorMap;
|
|
4312
|
+
/**
|
|
4313
|
+
* Classify how much a procedure's failures matter, from the protective
|
|
4314
|
+
* declarations and behavioural facts the feeder already collected.
|
|
4315
|
+
*
|
|
4316
|
+
* Runs before any rule so a lint can gate on it, and feeds the global weighting:
|
|
4317
|
+
* a handler touching identity, mail, or tenant-scoped rows pulls harder on the
|
|
4318
|
+
* grade than a plain read. `none` means no signal fired — not "safe".
|
|
4319
|
+
*/
|
|
4320
|
+
declare const classifySensitivity: (procedure: AdvisorProcedureProtection) => Sensitivity;
|
|
3985
4321
|
/**
|
|
3986
4322
|
* Every lint that runs against the declared schema (and, for
|
|
3987
4323
|
* `filter_without_index`, the discovered query reads) — no running shard
|
|
@@ -4013,4 +4349,4 @@ interface RunAdvisorOptions {
|
|
|
4013
4349
|
* `static` lints at build time and defer `runtime` lints to a live shard.
|
|
4014
4350
|
*/
|
|
4015
4351
|
declare const runAdvisor: (context: LintContext, options?: RunAdvisorOptions) => Finding[];
|
|
4016
|
-
export { AE_METRIC_EVENTS, ALL_LINTS, type AdvisorAdminRoute, type AdvisorAiRawRun, type AdvisorAiToolSideEffect, type AdvisorArgumentDerivedFetch, type AdvisorArgumentValidator, type AdvisorAuthApiCall, type AdvisorAuthConfig, type AdvisorBrowserUrlAccess, type AdvisorConfigCall, type AdvisorContainer, type AdvisorContainerKeyAccess, type AdvisorContainerOverride, type AdvisorExportSink, type AdvisorFailOpenGuard, type AdvisorFlagSecurityDefault, type AdvisorGeoIndexUsage, type AdvisorHttpActionGuard, type AdvisorHttpHeaderWrite, type AdvisorHyperdriveCall, type AdvisorIdentityClaimRead, type AdvisorImageDeliveryUrlAccess, type AdvisorIndex, type AdvisorIndexHit, type AdvisorInsertWrite, type AdvisorKvKeyAccess, type AdvisorMailRecipientAccess, type AdvisorMaskProcedure, type AdvisorMaskStrategy, type AdvisorMutatorWrite, type AdvisorNondeterministicCall, type AdvisorNormalizeIdAuthorization, type AdvisorNotifyCall, type AdvisorNotifyConfig, type AdvisorOwnerFieldWrite, type AdvisorPaymentWebhook, type AdvisorPrivilegedDispatch, type AdvisorProcedureProtection, type AdvisorQueryRead, type AdvisorQueue, type AdvisorQueueTuning, type AdvisorR2sqlCall, type AdvisorRatelimitKeySelector, type AdvisorRawRowReturn, type AdvisorRelation, type AdvisorRelationLoad, type AdvisorRlsProcedure, type AdvisorSchema, type AdvisorSecretLiteral, type AdvisorShape, type AdvisorShardTraffic, type AdvisorSoftDeleteRead, type AdvisorSqlInterpolation, type AdvisorStorageKeyAccess, type AdvisorStorageUpload, type AdvisorTable, type AdvisorTableSample, type AdvisorTableScan, type AdvisorVectorNamespaceAccess, type AdvisorWorkflow, type AdvisorWorkflowCall, type AdvisorWranglerVariable, type AnalyticsMetricsOptions, type AnalyticsMetricsSource, type AnalyticsRuntimeMetrics, type Category, type Facing, type Finding, type Level, type Lint, type LintContext, type LintSource, RUNTIME_LINTS, RunAdvisorOptions, STATIC_LINTS, actionFetchSsrf, adminRouteWithoutGuard, aiRawRunEscapeHatch, aiToolSideEffectPromptInjection, aiUnboundedGenerationPublic, allowUnauthenticatedShardAccessEnabled, authApiCallWithoutHeaders, authCsrfCheckDisabled, authEmailVerificationDisabled, authScimWithoutTransactions, authSecureCookiesDisabled, authSessionFreshageZero, authTrustedOriginsWildcard, browserAllowPrivateTargets, browserUserUrlWithoutAllowlist, circularFk, constraintValidator, containerInstanceKeyFromUserInput, containerOversizedInstance, containerPublicInternet, containerRuntimeEgressRelaxation, containerStartEnableInternetOverride, dedupeCacheKeys, duplicateIndex, emptyIndex, exportSinkMisconfigured, externalSourceIncrementalNoDeletePath, externalSourceOnGlobal, externalSourceUnscoped, filterWithoutIndex, flagGatesSecurityWithUnsafeDefault, fromServerSchema, geoIndexFieldNotGeopoint, geoIndexUnused, hardcodedSecret, hotShard, httpActionMissingAuthGuard, httpActionResponseHeaderInjection, hyperdriveOutsideAction, identityUndeclaredClaimTrusted, imagesUrlSourceFromUserInput, indexReferencesUnknownField, indexUtilization, insertManyUnsafeUserData, kvUnscopedUserKeyIdor, loadAnalyticsRuntimeMetrics, mailInboundDispatchWithoutVerify, mailRecipientFromRequestInput, maskUncoveredPiiColumn, maskWeakHashStrategyOnPii, maskedRelationLeakViaWith, mutatorFullRowReplace, nondeterministicQueryMutation, normalizeIdUsedAsAuthorization, notifyMissingPushConfig, notifySendOutsideAction, outputProjectionMissingOnPublicRead, ownerFieldFromArgsNotAuth, paymentCreateWithoutAuthorize, paymentWebhookWideTolerance, plaintextSecretInWranglerVariables, policyReferencesUnknownTable, privilegedDispatchUnvalidatedPayload, privilegedFanoutFromPublicProcedure, publicArgumentUsesAny, publicMutationWithoutRatelimit, publicTableRlsOptoutConfusion, queueWithoutDlq, r2sqlOutsideAction, ratelimitDefaultMemoryStore, ratelimitKeySpoofableOrGlobal, ratelimitMiddlewareFailOpen, relationReferencesUnknownField, relationReferencesUnknownTable, rlsUncoveredTable, runAdvisor, shapeTargetsGlobalTable, shapeUnknownTable, signupMutationWithoutDisposableGating, softDeleteIncludeDeletedFromArgs, sqlInjectionRisk, storageGenerateUploadUrlNoContentTypePin, storageKeyFromUserArgs, storagePresignedUrlForPrivateContent, storageUploadWithoutContentTypeAllowlist, storageUploadWithoutMaxSize, tableWithoutInsert, ttlFieldNotTimestamp, unboundedStringArgument, unindexedForeignKey, unindexedRelationTarget, unrestrictedWhereBranch, userCreatingMutationWithoutCaptcha, vectorsNamespaceFromUserInput, workflowDuplicateStepName, workflowUnknownTarget, workflowUnused };
|
|
4352
|
+
export { AE_METRIC_EVENTS, ALL_LINTS, type AdvisorAdminRoute, type AdvisorAiRawRun, type AdvisorAiToolSideEffect, type AdvisorArgumentDerivedFetch, type AdvisorArgumentValidator, type AdvisorAuthApiCall, type AdvisorAuthConfig, type AdvisorBrowserUrlAccess, type AdvisorConfigCall, type AdvisorContainer, type AdvisorContainerKeyAccess, type AdvisorContainerOverride, type AdvisorExportSink, type AdvisorFailOpenGuard, type AdvisorFlagSecurityDefault, type AdvisorGeoIndexUsage, type AdvisorHttpActionGuard, type AdvisorHttpHeaderWrite, type AdvisorHyperdriveCall, type AdvisorIdentityClaimRead, type AdvisorImageDeliveryUrlAccess, type AdvisorIndex, type AdvisorIndexHit, type AdvisorInsertWrite, type AdvisorKvKeyAccess, type AdvisorMailRecipientAccess, type AdvisorMap, type AdvisorMaskProcedure, type AdvisorMaskStrategy, type AdvisorMutatorWrite, type AdvisorNondeterministicCall, type AdvisorNormalizeIdAuthorization, type AdvisorNotifyCall, type AdvisorNotifyConfig, type AdvisorOwnerFieldWrite, type AdvisorPaymentWebhook, type AdvisorPrivilegedDispatch, type AdvisorProcedureProtection, type AdvisorQueryRead, type AdvisorQueue, type AdvisorQueueTuning, type AdvisorR2sqlCall, type AdvisorRatelimitKeySelector, type AdvisorRawRowReturn, type AdvisorRelation, type AdvisorRelationLoad, type AdvisorRlsProcedure, type AdvisorSchema, type AdvisorSecretLiteral, type AdvisorShape, type AdvisorShardTraffic, type AdvisorSoftDeleteRead, type AdvisorSqlInterpolation, type AdvisorStorageKeyAccess, type AdvisorStorageUpload, type AdvisorTable, type AdvisorTableSample, type AdvisorTableScan, type AdvisorVectorNamespaceAccess, type AdvisorWorkflow, type AdvisorWorkflowCall, type AdvisorWranglerVariable, type AnalyticsMetricsOptions, type AnalyticsMetricsSource, type AnalyticsRuntimeMetrics, type BaselineComparison, type Category, type CheckResult, type Coverage, type Facing, type Finding, type Grade, type Level, type Lint, type LintContext, type LintSource, MAP_VERSION, type MapSummary, type ProcedureDelta, type ProcedureScore, type ProjectScore, RUNTIME_LINTS, RunAdvisorOptions, STATIC_LINTS, type ScoreAdvisorOptions, type Sensitivity, type SensitivityLevel, actionFetchSsrf, actionWithoutErrorHandling, adminRouteWithoutGuard, aiRawRunEscapeHatch, aiRunWithoutLogging, aiToolSideEffectPromptInjection, aiUnboundedGenerationPublic, allowUnauthenticatedShardAccessEnabled, authApiCallWithoutHeaders, authCsrfCheckDisabled, authEmailVerificationDisabled, authScimWithoutTransactions, authSecureCookiesDisabled, authSessionFreshageZero, authTrustedOriginsWildcard, browserAllowPrivateTargets, browserUserUrlWithoutAllowlist, byCodepoint, circularFk, classifySensitivity, compareToBaseline, constraintValidator, containerInstanceKeyFromUserInput, containerOversizedInstance, containerPublicInternet, containerRuntimeEgressRelaxation, containerStartEnableInternetOverride, dedupeCacheKeys, duplicateIndex, emptyIndex, errorWithoutCatalog, exportSinkMisconfigured, externalSourceIncrementalNoDeletePath, externalSourceOnGlobal, externalSourceUnscoped, filterWithoutIndex, flagGatesSecurityWithUnsafeDefault, fromServerSchema, geoIndexFieldNotGeopoint, geoIndexUnused, gradeFromScore, hardcodedSecret, hotShard, httpActionMissingAuthGuard, httpActionResponseHeaderInjection, hyperdriveOutsideAction, identityUndeclaredClaimTrusted, imagesUrlSourceFromUserInput, indexReferencesUnknownField, indexUtilization, insertManyUnsafeUserData, kvUnscopedUserKeyIdor, loadAnalyticsRuntimeMetrics, mailInboundDispatchWithoutVerify, mailRecipientFromRequestInput, maskUncoveredPiiColumn, maskWeakHashStrategyOnPii, maskedRelationLeakViaWith, mutatorFullRowReplace, nondeterministicQueryMutation, normalizeIdUsedAsAuthorization, notifyMissingPushConfig, notifySendOutsideAction, outputProjectionMissingOnPublicRead, ownerFieldFromArgsNotAuth, parseAdvisorMap, paymentCreateWithoutAuthorize, paymentWebhookWideTolerance, plaintextSecretInWranglerVariables, policyReferencesUnknownTable, privilegedDispatchUnvalidatedPayload, privilegedFanoutFromPublicProcedure, procedureWithoutStructuredEvent, publicArgumentUsesAny, publicMutationWithoutRatelimit, publicTableRlsOptoutConfusion, queueWithoutDlq, r2sqlOutsideAction, ratelimitDefaultMemoryStore, ratelimitKeySpoofableOrGlobal, ratelimitMiddlewareFailOpen, relationReferencesUnknownField, relationReferencesUnknownTable, rlsUncoveredTable, runAdvisor, scoreAdvisor, shapeTargetsGlobalTable, shapeUnknownTable, signupMutationWithoutDisposableGating, softDeleteIncludeDeletedFromArgs, sqlInjectionRisk, storageGenerateUploadUrlNoContentTypePin, storageKeyFromUserArgs, storagePresignedUrlForPrivateContent, storageUploadWithoutContentTypeAllowlist, storageUploadWithoutMaxSize, tableWithoutInsert, ttlFieldNotTimestamp, unboundedStringArgument, unindexedForeignKey, unindexedRelationTarget, unrestrictedWhereBranch, userCreatingMutationWithoutCaptcha, vectorsNamespaceFromUserInput, workflowDuplicateStepName, workflowUnknownTarget, workflowUnused };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{dedupeCacheKeys as a}from"./packem_shared/dedupeCacheKeys-7JgxaQWV.mjs";import m from"./packem_shared/constraintValidator-N339mfyx.mjs";import s from"./packem_shared/hotShard-DVs_U17R.mjs";import n from"./packem_shared/indexUtilization-QfbIH_w4.mjs";import p from"./packem_shared/actionFetchSsrf-BbWxy1Yf.mjs";import f from"./packem_shared/adminRouteWithoutGuard-DSo4t9j4.mjs";import l from"./packem_shared/aiRawRunEscapeHatch-DfhjYm43.mjs";import u from"./packem_shared/aiToolSideEffectPromptInjection-DnWQOoKi.mjs";import d from"./packem_shared/aiUnboundedGenerationPublic-D3HZrh5_.mjs";import c from"./packem_shared/allowUnauthenticatedShardAccessEnabled-D4aMNBb0.mjs";import $ from"./packem_shared/authApiCallWithoutHeaders-BItMMdZP.mjs";import h from"./packem_shared/authCsrfCheckDisabled-De9ammtV.mjs";import g from"./packem_shared/authEmailVerificationDisabled-BFKdJcx4.mjs";import U from"./packem_shared/authSecureCookiesDisabled-B4WIzvMm.mjs";import b from"./packem_shared/authSessionFreshageZero-Bpcaf_Pe.mjs";import S from"./packem_shared/authScimWithoutTransactions-DCtLXzks.mjs";import I from"./packem_shared/authTrustedOriginsWildcard-DjU9NXEm.mjs";import A from"./packem_shared/browserAllowPrivateTargets-Dxyeh6lg.mjs";import T from"./packem_shared/browserUserUrlWithoutAllowlist-BHBS6b0N.mjs";import y from"./packem_shared/circularFk-BMuJKmuZ.mjs";import w from"./packem_shared/containerInstanceKeyFromUserInput-C8S4T3ty.mjs";import R from"./packem_shared/containerOversizedInstance-B9wW_sU5.mjs";import k from"./packem_shared/containerPublicInternet-Bx2J7tha.mjs";import W from"./packem_shared/containerRuntimeEgressRelaxation-BQ2ZD1aV.mjs";import F from"./packem_shared/containerStartEnableInternetOverride-B62WUura.mjs";import x from"./packem_shared/duplicateIndex-DFT7qLQD.mjs";import C from"./packem_shared/emptyIndex-BiXEfyfN.mjs";import P from"./packem_shared/exportSinkMisconfigured-DvpAaa6j.mjs";import v from"./packem_shared/externalSourceIncrementalNoDeletePath-DnoL64YY.mjs";import M from"./packem_shared/externalSourceOnGlobal-DNPLoNUg.mjs";import D from"./packem_shared/externalSourceUnscoped-DqBp5jYr.mjs";import N from"./packem_shared/filterWithoutIndex-ht2GZQWV.mjs";import O from"./packem_shared/flagGatesSecurityWithUnsafeDefault-DPGFEHTt.mjs";import E from"./packem_shared/geoIndexFieldNotGeopoint-DAGLZtaH.mjs";import G from"./packem_shared/geoIndexUnused-BgDE6_AR.mjs";import z from"./packem_shared/hardcodedSecret-rIRc3aNk.mjs";import K from"./packem_shared/httpActionMissingAuthGuard-BZDdeW_D.mjs";import L from"./packem_shared/httpActionResponseHeaderInjection-D063rB7U.mjs";import V from"./packem_shared/hyperdriveOutsideAction-CRmOQz67.mjs";import j from"./packem_shared/identityUndeclaredClaimTrusted-BYRYGQ74.mjs";import q from"./packem_shared/imagesUrlSourceFromUserInput-Cy5pc_dA.mjs";import _ from"./packem_shared/indexReferencesUnknownField-r3QHlaz6.mjs";import H from"./packem_shared/insertManyUnsafeUserData-DrH7PdRs.mjs";import B from"./packem_shared/kvUnscopedUserKeyIdor-B4lGxRxh.mjs";import Q from"./packem_shared/mailInboundDispatchWithoutVerify-BivYJ5F9.mjs";import Z from"./packem_shared/mailRecipientFromRequestInput-BR_oSh65.mjs";import J from"./packem_shared/maskUncoveredPiiColumn-DqPfZM2O.mjs";import X from"./packem_shared/maskWeakHashStrategyOnPii-CEiiGgT7.mjs";import Y from"./packem_shared/maskedRelationLeakViaWith-CxYk0MDW.mjs";import oo from"./packem_shared/mutatorFullRowReplace-CEgecSGm.mjs";import ro from"./packem_shared/nondeterministicQueryMutation-BaMfbAk_.mjs";import to from"./packem_shared/normalizeIdUsedAsAuthorization-FjISSXJm.mjs";import io from"./packem_shared/notifyMissingPushConfig-C_GbVw3S.mjs";import eo from"./packem_shared/notifySendOutsideAction-B0jZuUP3.mjs";import ao from"./packem_shared/outputProjectionMissingOnPublicRead-9Pm9766s.mjs";import mo from"./packem_shared/ownerFieldFromArgsNotAuth-BoR9vvst.mjs";import so from"./packem_shared/paymentCreateWithoutAuthorize-CurtqN8K.mjs";import no from"./packem_shared/paymentWebhookWideTolerance-I7ingfR8.mjs";import po from"./packem_shared/plaintextSecretInWranglerVariables-DXjKIm8H.mjs";import fo from"./packem_shared/policyReferencesUnknownTable-D3WelAQa.mjs";import lo from"./packem_shared/privilegedDispatchUnvalidatedPayload-74GuGye1.mjs";import uo from"./packem_shared/privilegedFanoutFromPublicProcedure-C2j2GSUN.mjs";import co from"./packem_shared/publicArgumentUsesAny-BJb4cTqL.mjs";import $o from"./packem_shared/publicMutationWithoutRatelimit-D9phluHW.mjs";import ho from"./packem_shared/publicTableRlsOptoutConfusion-CaWtPGAn.mjs";import go from"./packem_shared/queueWithoutDlq-BLY3iy9Q.mjs";import Uo from"./packem_shared/r2sqlOutsideAction-CKK_I1Ms.mjs";import bo from"./packem_shared/ratelimitDefaultMemoryStore-mOdI3Jmb.mjs";import So from"./packem_shared/ratelimitKeySpoofableOrGlobal-DaGId_Fh.mjs";import Io from"./packem_shared/ratelimitMiddlewareFailOpen-CTWVosEc.mjs";import Ao from"./packem_shared/relationReferencesUnknownField-clqyB69Y.mjs";import To from"./packem_shared/relationReferencesUnknownTable-CLdrhkmS.mjs";import yo from"./packem_shared/rlsUncoveredTable-DYHgnoos.mjs";import wo from"./packem_shared/shapeTargetsGlobalTable-Blz-aSkg.mjs";import Ro from"./packem_shared/shapeUnknownTable-DFxtyFio.mjs";import ko from"./packem_shared/signupMutationWithoutDisposableGating-BNzlsE0F.mjs";import Wo from"./packem_shared/softDeleteIncludeDeletedFromArgs-DgxpQHRA.mjs";import Fo from"./packem_shared/sqlInjectionRisk-D2NaT-5c.mjs";import xo from"./packem_shared/storageGenerateUploadUrlNoContentTypePin-C9cjl6Jh.mjs";import Co from"./packem_shared/storageKeyFromUserArgs-BeS5cp56.mjs";import Po from"./packem_shared/storagePresignedUrlForPrivateContent-j7VhwIdu.mjs";import vo from"./packem_shared/storageUploadWithoutContentTypeAllowlist-oxKLecuf.mjs";import Mo from"./packem_shared/storageUploadWithoutMaxSize-DUDxPutk.mjs";import Do from"./packem_shared/tableWithoutInsert-D3AhaNzR.mjs";import No from"./packem_shared/ttlFieldNotTimestamp-BFiRkSZD.mjs";import Oo from"./packem_shared/unboundedStringArgument-AkkIcr-S.mjs";import Eo from"./packem_shared/unindexedForeignKey-DK4eWXkb.mjs";import Go from"./packem_shared/unindexedRelationTarget-B5fFq1E8.mjs";import zo from"./packem_shared/unrestrictedWhereBranch-YKiydie4.mjs";import Ko from"./packem_shared/userCreatingMutationWithoutCaptcha-iDjRkUFO.mjs";import Lo from"./packem_shared/vectorsNamespaceFromUserInput-Cyq5B2kF.mjs";import Vo from"./packem_shared/workflowDuplicateStepName-cXF6Rpvg.mjs";import jo from"./packem_shared/workflowUnknownTarget-JF8rITLP.mjs";import qo from"./packem_shared/workflowUnused-Dx_FQwGE.mjs";import{AE_METRIC_EVENTS as Et,loadAnalyticsRuntimeMetrics as Gt}from"./packem_shared/AE_METRIC_EVENTS-LP_0D7Uw.mjs";import{fromServerSchema as Kt}from"./packem_shared/fromServerSchema-CJ-AQ2kw.mjs";const _o=[_,To,Ao,jo,Vo,Ro,v,M,D,C,E,G,P,No,y,Eo,Go,x,Do,qo,go,N,wo,oo,ro,V,Uo,$,fo,yo,J,X,R,k,$o,zo,Ko,ko,co,Oo,z,Fo,f,so,Q,bo,A,uo,H,d,p,mo,Co,B,w,l,Lo,Z,T,lo,F,W,S,I,h,U,g,b,q,So,ho,c,vo,Mo,xo,Po,K,L,Io,O,u,j,no,Wo,Y,ao,to,eo,io,po],Ho=[s,n,m],Bo=[..._o,...Ho],Dt=(i,o={})=>{const e=o.lints??Bo,r=[];for(const t of e)o.source!==void 0&&t.source!==o.source||r.push(...t.run(i));return a(r)};export{Et as AE_METRIC_EVENTS,Bo as ALL_LINTS,Ho as RUNTIME_LINTS,_o as STATIC_LINTS,p as actionFetchSsrf,f as adminRouteWithoutGuard,l as aiRawRunEscapeHatch,u as aiToolSideEffectPromptInjection,d as aiUnboundedGenerationPublic,c as allowUnauthenticatedShardAccessEnabled,$ as authApiCallWithoutHeaders,h as authCsrfCheckDisabled,g as authEmailVerificationDisabled,S as authScimWithoutTransactions,U as authSecureCookiesDisabled,b as authSessionFreshageZero,I as authTrustedOriginsWildcard,A as browserAllowPrivateTargets,T as browserUserUrlWithoutAllowlist,y as circularFk,m as constraintValidator,w as containerInstanceKeyFromUserInput,R as containerOversizedInstance,k as containerPublicInternet,W as containerRuntimeEgressRelaxation,F as containerStartEnableInternetOverride,a as dedupeCacheKeys,x as duplicateIndex,C as emptyIndex,P as exportSinkMisconfigured,v as externalSourceIncrementalNoDeletePath,M as externalSourceOnGlobal,D as externalSourceUnscoped,N as filterWithoutIndex,O as flagGatesSecurityWithUnsafeDefault,Kt as fromServerSchema,E as geoIndexFieldNotGeopoint,G as geoIndexUnused,z as hardcodedSecret,s as hotShard,K as httpActionMissingAuthGuard,L as httpActionResponseHeaderInjection,V as hyperdriveOutsideAction,j as identityUndeclaredClaimTrusted,q as imagesUrlSourceFromUserInput,_ as indexReferencesUnknownField,n as indexUtilization,H as insertManyUnsafeUserData,B as kvUnscopedUserKeyIdor,Gt as loadAnalyticsRuntimeMetrics,Q as mailInboundDispatchWithoutVerify,Z as mailRecipientFromRequestInput,J as maskUncoveredPiiColumn,X as maskWeakHashStrategyOnPii,Y as maskedRelationLeakViaWith,oo as mutatorFullRowReplace,ro as nondeterministicQueryMutation,to as normalizeIdUsedAsAuthorization,io as notifyMissingPushConfig,eo as notifySendOutsideAction,ao as outputProjectionMissingOnPublicRead,mo as ownerFieldFromArgsNotAuth,so as paymentCreateWithoutAuthorize,no as paymentWebhookWideTolerance,po as plaintextSecretInWranglerVariables,fo as policyReferencesUnknownTable,lo as privilegedDispatchUnvalidatedPayload,uo as privilegedFanoutFromPublicProcedure,co as publicArgumentUsesAny,$o as publicMutationWithoutRatelimit,ho as publicTableRlsOptoutConfusion,go as queueWithoutDlq,Uo as r2sqlOutsideAction,bo as ratelimitDefaultMemoryStore,So as ratelimitKeySpoofableOrGlobal,Io as ratelimitMiddlewareFailOpen,Ao as relationReferencesUnknownField,To as relationReferencesUnknownTable,yo as rlsUncoveredTable,Dt as runAdvisor,wo as shapeTargetsGlobalTable,Ro as shapeUnknownTable,ko as signupMutationWithoutDisposableGating,Wo as softDeleteIncludeDeletedFromArgs,Fo as sqlInjectionRisk,xo as storageGenerateUploadUrlNoContentTypePin,Co as storageKeyFromUserArgs,Po as storagePresignedUrlForPrivateContent,vo as storageUploadWithoutContentTypeAllowlist,Mo as storageUploadWithoutMaxSize,Do as tableWithoutInsert,No as ttlFieldNotTimestamp,Oo as unboundedStringArgument,Eo as unindexedForeignKey,Go as unindexedRelationTarget,zo as unrestrictedWhereBranch,Ko as userCreatingMutationWithoutCaptcha,Lo as vectorsNamespaceFromUserInput,Vo as workflowDuplicateStepName,jo as workflowUnknownTarget,qo as workflowUnused};
|
|
1
|
+
import{dedupeCacheKeys as a}from"./packem_shared/dedupeCacheKeys-7JgxaQWV.mjs";import m from"./packem_shared/constraintValidator-N339mfyx.mjs";import s from"./packem_shared/hotShard-DVs_U17R.mjs";import n from"./packem_shared/indexUtilization-QfbIH_w4.mjs";import p from"./packem_shared/actionFetchSsrf-BbWxy1Yf.mjs";import f from"./packem_shared/actionWithoutErrorHandling-D1DqSPpg.mjs";import l from"./packem_shared/adminRouteWithoutGuard-DSo4t9j4.mjs";import u from"./packem_shared/aiRawRunEscapeHatch-DfhjYm43.mjs";import d from"./packem_shared/aiRunWithoutLogging-CMvQPNBr.mjs";import c from"./packem_shared/aiToolSideEffectPromptInjection-DnWQOoKi.mjs";import $ from"./packem_shared/aiUnboundedGenerationPublic-D3HZrh5_.mjs";import h from"./packem_shared/allowUnauthenticatedShardAccessEnabled-D4aMNBb0.mjs";import g from"./packem_shared/authApiCallWithoutHeaders-BItMMdZP.mjs";import b from"./packem_shared/authCsrfCheckDisabled-De9ammtV.mjs";import U from"./packem_shared/authEmailVerificationDisabled-BFKdJcx4.mjs";import S from"./packem_shared/authScimWithoutTransactions-DCtLXzks.mjs";import I from"./packem_shared/authSecureCookiesDisabled-B4WIzvMm.mjs";import A from"./packem_shared/authSessionFreshageZero-Bpcaf_Pe.mjs";import y from"./packem_shared/authTrustedOriginsWildcard-DjU9NXEm.mjs";import T from"./packem_shared/browserAllowPrivateTargets-Dxyeh6lg.mjs";import W from"./packem_shared/browserUserUrlWithoutAllowlist-BHBS6b0N.mjs";import R from"./packem_shared/circularFk-BMuJKmuZ.mjs";import w from"./packem_shared/containerInstanceKeyFromUserInput-C8S4T3ty.mjs";import x from"./packem_shared/containerOversizedInstance-B9wW_sU5.mjs";import k from"./packem_shared/containerPublicInternet-Bx2J7tha.mjs";import F from"./packem_shared/containerRuntimeEgressRelaxation-BQ2ZD1aV.mjs";import v from"./packem_shared/containerStartEnableInternetOverride-B62WUura.mjs";import C from"./packem_shared/duplicateIndex-DFT7qLQD.mjs";import M from"./packem_shared/emptyIndex-BiXEfyfN.mjs";import P from"./packem_shared/errorWithoutCatalog-DTDVKU4b.mjs";import D from"./packem_shared/exportSinkMisconfigured-DvpAaa6j.mjs";import E from"./packem_shared/externalSourceIncrementalNoDeletePath-DnoL64YY.mjs";import N from"./packem_shared/externalSourceOnGlobal-DNPLoNUg.mjs";import O from"./packem_shared/externalSourceUnscoped-DqBp5jYr.mjs";import G from"./packem_shared/filterWithoutIndex-yd1N-GQ0.mjs";import L from"./packem_shared/flagGatesSecurityWithUnsafeDefault-DPGFEHTt.mjs";import V from"./packem_shared/geoIndexFieldNotGeopoint-DAGLZtaH.mjs";import z from"./packem_shared/geoIndexUnused-BgDE6_AR.mjs";import K from"./packem_shared/hardcodedSecret-rIRc3aNk.mjs";import _ from"./packem_shared/httpActionMissingAuthGuard-BZDdeW_D.mjs";import j from"./packem_shared/httpActionResponseHeaderInjection-D063rB7U.mjs";import q from"./packem_shared/hyperdriveOutsideAction-CRmOQz67.mjs";import H from"./packem_shared/identityUndeclaredClaimTrusted-BYRYGQ74.mjs";import B from"./packem_shared/imagesUrlSourceFromUserInput-Cy5pc_dA.mjs";import Q from"./packem_shared/indexReferencesUnknownField-r3QHlaz6.mjs";import Z from"./packem_shared/insertManyUnsafeUserData-DrH7PdRs.mjs";import J from"./packem_shared/kvUnscopedUserKeyIdor-B4lGxRxh.mjs";import X from"./packem_shared/mailInboundDispatchWithoutVerify-BivYJ5F9.mjs";import Y from"./packem_shared/mailRecipientFromRequestInput-BR_oSh65.mjs";import oo from"./packem_shared/maskUncoveredPiiColumn-DqPfZM2O.mjs";import ro from"./packem_shared/maskWeakHashStrategyOnPii-CEiiGgT7.mjs";import to from"./packem_shared/maskedRelationLeakViaWith-CxYk0MDW.mjs";import io from"./packem_shared/mutatorFullRowReplace-CEgecSGm.mjs";import eo from"./packem_shared/nondeterministicQueryMutation-BaMfbAk_.mjs";import ao from"./packem_shared/normalizeIdUsedAsAuthorization-FjISSXJm.mjs";import mo from"./packem_shared/notifyMissingPushConfig-C_GbVw3S.mjs";import so from"./packem_shared/notifySendOutsideAction-B0jZuUP3.mjs";import no from"./packem_shared/outputProjectionMissingOnPublicRead-9Pm9766s.mjs";import po from"./packem_shared/ownerFieldFromArgsNotAuth-BoR9vvst.mjs";import fo from"./packem_shared/paymentCreateWithoutAuthorize-CurtqN8K.mjs";import lo from"./packem_shared/paymentWebhookWideTolerance-I7ingfR8.mjs";import uo from"./packem_shared/plaintextSecretInWranglerVariables-DXjKIm8H.mjs";import co from"./packem_shared/policyReferencesUnknownTable-D3WelAQa.mjs";import $o from"./packem_shared/privilegedDispatchUnvalidatedPayload-74GuGye1.mjs";import ho from"./packem_shared/privilegedFanoutFromPublicProcedure-C2j2GSUN.mjs";import go from"./packem_shared/procedureWithoutStructuredEvent-D4Qi2vH7.mjs";import bo from"./packem_shared/publicArgumentUsesAny-BJb4cTqL.mjs";import Uo from"./packem_shared/publicMutationWithoutRatelimit-D9phluHW.mjs";import So from"./packem_shared/publicTableRlsOptoutConfusion-CaWtPGAn.mjs";import Io from"./packem_shared/queueWithoutDlq-BLY3iy9Q.mjs";import Ao from"./packem_shared/r2sqlOutsideAction-CKK_I1Ms.mjs";import yo from"./packem_shared/ratelimitDefaultMemoryStore-mOdI3Jmb.mjs";import To from"./packem_shared/ratelimitKeySpoofableOrGlobal-DaGId_Fh.mjs";import Wo from"./packem_shared/ratelimitMiddlewareFailOpen-CTWVosEc.mjs";import Ro from"./packem_shared/relationReferencesUnknownField-clqyB69Y.mjs";import wo from"./packem_shared/relationReferencesUnknownTable-CLdrhkmS.mjs";import xo from"./packem_shared/rlsUncoveredTable-DYHgnoos.mjs";import ko from"./packem_shared/shapeTargetsGlobalTable-Blz-aSkg.mjs";import Fo from"./packem_shared/shapeUnknownTable-DFxtyFio.mjs";import vo from"./packem_shared/signupMutationWithoutDisposableGating-BNzlsE0F.mjs";import Co from"./packem_shared/softDeleteIncludeDeletedFromArgs-DgxpQHRA.mjs";import Mo from"./packem_shared/sqlInjectionRisk-D2NaT-5c.mjs";import Po from"./packem_shared/storageGenerateUploadUrlNoContentTypePin-C9cjl6Jh.mjs";import Do from"./packem_shared/storageKeyFromUserArgs-BeS5cp56.mjs";import Eo from"./packem_shared/storagePresignedUrlForPrivateContent-j7VhwIdu.mjs";import No from"./packem_shared/storageUploadWithoutContentTypeAllowlist-oxKLecuf.mjs";import Oo from"./packem_shared/storageUploadWithoutMaxSize-DUDxPutk.mjs";import Go from"./packem_shared/tableWithoutInsert-D3AhaNzR.mjs";import Lo from"./packem_shared/ttlFieldNotTimestamp-BFiRkSZD.mjs";import Vo from"./packem_shared/unboundedStringArgument-AkkIcr-S.mjs";import zo from"./packem_shared/unindexedForeignKey-DK4eWXkb.mjs";import Ko from"./packem_shared/unindexedRelationTarget-B5fFq1E8.mjs";import _o from"./packem_shared/unrestrictedWhereBranch-YKiydie4.mjs";import jo from"./packem_shared/userCreatingMutationWithoutCaptcha-iDjRkUFO.mjs";import qo from"./packem_shared/vectorsNamespaceFromUserInput-Cyq5B2kF.mjs";import Ho from"./packem_shared/workflowDuplicateStepName-cXF6Rpvg.mjs";import Bo from"./packem_shared/workflowUnknownTarget-JF8rITLP.mjs";import Qo from"./packem_shared/workflowUnused-Dx_FQwGE.mjs";import{AE_METRIC_EVENTS as qt,loadAnalyticsRuntimeMetrics as Ht}from"./packem_shared/AE_METRIC_EVENTS-LP_0D7Uw.mjs";import{compareToBaseline as Qt,parseAdvisorMap as Zt}from"./packem_shared/compareToBaseline-T1_kl8VY.mjs";import{gradeFromScore as Xt}from"./packem_shared/gradeFromScore-DW82YDVY.mjs";import{MAP_VERSION as oi,byCodepoint as ri,scoreAdvisor as ti}from"./packem_shared/MAP_VERSION-BS08jBkS.mjs";import{default as ei}from"./packem_shared/classifySensitivity-DjswRYWd.mjs";import{fromServerSchema as mi}from"./packem_shared/fromServerSchema-CJ-AQ2kw.mjs";const Zo=[Q,wo,Ro,Bo,Ho,Fo,E,N,O,M,P,V,z,D,Lo,R,zo,Ko,C,Go,Qo,Io,G,ko,io,eo,q,Ao,g,co,xo,oo,ro,x,k,Uo,_o,jo,vo,bo,Vo,K,Mo,l,fo,X,yo,T,ho,go,Z,$,p,f,po,Do,J,w,u,d,qo,Y,W,$o,v,F,S,y,b,I,U,A,B,To,So,h,No,Oo,Po,Eo,_,j,Wo,L,c,H,lo,Co,to,no,ao,so,mo,uo],Jo=[s,n,m],Xo=[...Zo,...Jo],Kt=(i,o={})=>{const e=o.lints??Xo,r=[];for(const t of e)o.source!==void 0&&t.source!==o.source||r.push(...t.run(i));return a(r)};export{qt as AE_METRIC_EVENTS,Xo as ALL_LINTS,oi as MAP_VERSION,Jo as RUNTIME_LINTS,Zo as STATIC_LINTS,p as actionFetchSsrf,f as actionWithoutErrorHandling,l as adminRouteWithoutGuard,u as aiRawRunEscapeHatch,d as aiRunWithoutLogging,c as aiToolSideEffectPromptInjection,$ as aiUnboundedGenerationPublic,h as allowUnauthenticatedShardAccessEnabled,g as authApiCallWithoutHeaders,b as authCsrfCheckDisabled,U as authEmailVerificationDisabled,S as authScimWithoutTransactions,I as authSecureCookiesDisabled,A as authSessionFreshageZero,y as authTrustedOriginsWildcard,T as browserAllowPrivateTargets,W as browserUserUrlWithoutAllowlist,ri as byCodepoint,R as circularFk,ei as classifySensitivity,Qt as compareToBaseline,m as constraintValidator,w as containerInstanceKeyFromUserInput,x as containerOversizedInstance,k as containerPublicInternet,F as containerRuntimeEgressRelaxation,v as containerStartEnableInternetOverride,a as dedupeCacheKeys,C as duplicateIndex,M as emptyIndex,P as errorWithoutCatalog,D as exportSinkMisconfigured,E as externalSourceIncrementalNoDeletePath,N as externalSourceOnGlobal,O as externalSourceUnscoped,G as filterWithoutIndex,L as flagGatesSecurityWithUnsafeDefault,mi as fromServerSchema,V as geoIndexFieldNotGeopoint,z as geoIndexUnused,Xt as gradeFromScore,K as hardcodedSecret,s as hotShard,_ as httpActionMissingAuthGuard,j as httpActionResponseHeaderInjection,q as hyperdriveOutsideAction,H as identityUndeclaredClaimTrusted,B as imagesUrlSourceFromUserInput,Q as indexReferencesUnknownField,n as indexUtilization,Z as insertManyUnsafeUserData,J as kvUnscopedUserKeyIdor,Ht as loadAnalyticsRuntimeMetrics,X as mailInboundDispatchWithoutVerify,Y as mailRecipientFromRequestInput,oo as maskUncoveredPiiColumn,ro as maskWeakHashStrategyOnPii,to as maskedRelationLeakViaWith,io as mutatorFullRowReplace,eo as nondeterministicQueryMutation,ao as normalizeIdUsedAsAuthorization,mo as notifyMissingPushConfig,so as notifySendOutsideAction,no as outputProjectionMissingOnPublicRead,po as ownerFieldFromArgsNotAuth,Zt as parseAdvisorMap,fo as paymentCreateWithoutAuthorize,lo as paymentWebhookWideTolerance,uo as plaintextSecretInWranglerVariables,co as policyReferencesUnknownTable,$o as privilegedDispatchUnvalidatedPayload,ho as privilegedFanoutFromPublicProcedure,go as procedureWithoutStructuredEvent,bo as publicArgumentUsesAny,Uo as publicMutationWithoutRatelimit,So as publicTableRlsOptoutConfusion,Io as queueWithoutDlq,Ao as r2sqlOutsideAction,yo as ratelimitDefaultMemoryStore,To as ratelimitKeySpoofableOrGlobal,Wo as ratelimitMiddlewareFailOpen,Ro as relationReferencesUnknownField,wo as relationReferencesUnknownTable,xo as rlsUncoveredTable,Kt as runAdvisor,ti as scoreAdvisor,ko as shapeTargetsGlobalTable,Fo as shapeUnknownTable,vo as signupMutationWithoutDisposableGating,Co as softDeleteIncludeDeletedFromArgs,Mo as sqlInjectionRisk,Po as storageGenerateUploadUrlNoContentTypePin,Do as storageKeyFromUserArgs,Eo as storagePresignedUrlForPrivateContent,No as storageUploadWithoutContentTypeAllowlist,Oo as storageUploadWithoutMaxSize,Go as tableWithoutInsert,Lo as ttlFieldNotTimestamp,Vo as unboundedStringArgument,zo as unindexedForeignKey,Ko as unindexedRelationTarget,_o as unrestrictedWhereBranch,jo as userCreatingMutationWithoutCaptcha,qo as vectorsNamespaceFromUserInput,Ho as workflowDuplicateStepName,Bo as workflowUnknownTarget,Qo as workflowUnused};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{scoreProcedure as h,procedureWeight as y,coverageFromScore as k,scoreGlobal as N,gradeFromScore as b,projectWeight as M,worstLevel as $,weightFor as j}from"./gradeFromScore-DW82YDVY.mjs";import F from"./classifySensitivity-DjswRYWd.mjs";const S=(e,o)=>e===o?0:e<o?-1:1,w=(e,o)=>S(e.name,o.name),x=(e,o)=>{const t=e[o];return typeof t=="string"?t:void 0},p=(e,o)=>`${e}#${o}`,R=(e,o,t,s)=>e===void 0?{level:o,name:t,occurrences:1,weight:s}:{level:$(e.level,o),name:t,occurrences:e.occurrences+1,weight:Math.max(e.weight,s)},A=(e,o,t)=>{const s=new Map;for(const a of e)s.set(p(a.file,a.exportName),new Map);const c=new Map;for(const a of o){const n=x(a.metadata,"file"),l=x(a.metadata,"exportName"),m=(n!==void 0&&l!==void 0?s.get(p(n,l)):void 0)??c;m.set(a.name,R(m.get(a.name),a.level,a.name,t(a)))}return{byProcedure:new Map([...s].map(([a,n])=>[a,[...n.values()].toSorted(w)])),project:[...c.values()].toSorted(w)}},I=(e,o)=>{const t={clean:0,exempt:0,failing:0,warned:0};let s=o.checks.length;for(const c of e)t[c.coverage]+=1,s+=c.checks.length;return{clean:t.clean,exempt:t.exempt,failing:t.failing,procedures:e.length,rulesFired:s,warned:t.warned}},O=1,W=(e,o,t={})=>{const s=new Set(t.exempt),c=A(e,o,r=>j(r.level)),a=e.map(r=>{const i=p(r.file,r.exportName),v=c.byProcedure.get(i)??[],u=h(v),d=s.has(i)||r.exempt===!0,f=F(r);return{checks:v,coverage:d?"exempt":k(u),...d?{exemptReason:r.exemptReason??""}:{},exportName:r.exportName,file:r.file,id:i,kind:r.kind,score:u,sensitivity:f,visibility:r.visibility,weight:d?0:y(r,f.level)}}).toSorted((r,i)=>S(r.id,i.id)),n={checks:c.project,score:h(c.project)},l=a.filter(r=>r.coverage!=="exempt"),m=l.reduce((r,i)=>r+i.weight,0),g=N([...l,{score:n.score,weight:M(m)}]);return{generatedAt:t.generatedAt??new Date().toISOString(),grade:b(g),procedures:a,project:n,score:g,summary:I(a,n),version:O}};export{O as MAP_VERSION,S as byCodepoint,W as scoreAdvisor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as o}from"./finding-BAVgqnCF.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=>{if(t.procedureProtections===void 0)return[];const r=[];for(const e of t.procedureProtections)e.kind!=="action"||e.reachesOutbound!==!0||e.handlesErrors!==!1||r.push(o(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}}));return r},source:"static",title:"Action performs outbound I/O with no error handling"};export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as o}from"./finding-BAVgqnCF.mjs";const r={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.span("<name>", …)`, or a `ctx.log` line carrying the model and token usage.',run:t=>{if(t.procedureProtections===void 0)return[];const n=[];for(const e of t.procedureProtections)e.runsAiGeneration!==!0||e.emitsEvent!==!1||n.push(o(r,{cacheKey:`ai_run_without_logging:${e.file}:${e.exportName}`,detail:`${e.kind} \`${e.exportName}\` (${e.file}) runs an AI generation with no structured event, so its cost and output cannot be attributed later.`,metadata:{exportName:e.exportName,file:e.file,kind:e.kind}}));return n},source:"static",title:"AI generation with no structured event"};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=[{reason:"writes an identity table",test:e=>e.writesUserTable},{reason:"sends mail",test:e=>e.callsMail},{reason:"fans out to a privileged dispatch surface",test:e=>e.fanOut},{reason:"bypasses validators with insertManyUnsafe",test:e=>e.usesInsertManyUnsafe},{reason:"runs an unbounded AI generation",test:e=>e.unboundedAiGeneration}],a=e=>{const s=[];for(const n of t)n.test(e)&&s.push(n.reason);return{level:s.length===0?"none":"high",reasons:s}};export{a as default};
|