@hublo/sentinel 1.7.0-alpha.35 → 1.7.0-alpha.37
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 +2 -1
- package/dist/bin/sentinel.js +35 -10
- package/dist/{chunk-NGLEGAEN.js → chunk-5KNSTZ7F.js} +8 -3
- package/dist/chunk-5KNSTZ7F.js.map +1 -0
- package/dist/{chunk-2PRJJRJI.js → chunk-E3FWHZ65.js} +3 -2
- package/dist/chunk-F5WISUN3.js +17 -0
- package/dist/chunk-F5WISUN3.js.map +1 -0
- package/dist/{chunk-YUZB4LRJ.js → chunk-KKHKRY7P.js} +6 -1
- package/dist/chunk-KKHKRY7P.js.map +1 -0
- package/dist/{chunk-IXXRITO5.js → chunk-MAC5PJ62.js} +10781 -6915
- package/dist/chunk-NE3IEJBN.js +59 -0
- package/dist/chunk-NE3IEJBN.js.map +1 -0
- package/dist/{chunk-TMVKYXZ3.js → chunk-QJCZ2EDV.js} +1 -1
- package/dist/chunk-QJCZ2EDV.js.map +1 -0
- package/dist/{chunk-LVY5NPOC.js → chunk-QMIJ4ZGJ.js} +2 -2
- package/dist/chunk-U7G2Y6YC.js +15 -0
- package/dist/chunk-U7G2Y6YC.js.map +1 -0
- package/dist/chunk-VWASE6NN.js +34 -0
- package/dist/chunk-VWASE6NN.js.map +1 -0
- package/dist/{chunk-APBEGLRI.js → chunk-YOFCDKTI.js} +18 -4
- package/dist/chunk-YOFCDKTI.js.map +1 -0
- package/dist/index.d.ts +10 -2
- package/dist/index.js +10 -6
- package/dist/roles/arch/config.d.ts +8 -2
- package/dist/roles/arch/config.js +1 -1
- package/dist/roles/runtime-analysis/config.d.ts +97 -0
- package/dist/roles/runtime-analysis/config.js +10 -0
- package/dist/roles/runtime-analysis/config.js.map +1 -0
- package/dist/roles/runtime-analysis/gateway.d.ts +2 -0
- package/dist/roles/runtime-analysis/gateway.js +89 -0
- package/dist/roles/runtime-analysis/gateway.js.map +1 -0
- package/dist/roles/runtime-analysis/mock-api.d.ts +2 -0
- package/dist/roles/runtime-analysis/mock-api.js +43 -0
- package/dist/roles/runtime-analysis/mock-api.js.map +1 -0
- package/dist/roles/sql/config.d.ts +21 -1
- package/dist/roles/sql/config.js +5 -3
- package/dist/roles/static-analysis/config.d.ts +1 -0
- package/dist/roles/static-analysis/config.js +1 -1
- package/dist/roles/test/setup/jest-parity.js +2 -2
- package/dist/roles/test/setup/workspace-entry.js +2 -2
- package/dist/{validate-4GMB32V7.js → validate-UENGAIDH.js} +2 -2
- package/docs/arch-adoption.md +24 -9
- package/docs/runtime-analysis-adoption.md +198 -0
- package/docs/sql-adoption.md +140 -27
- package/docs/static-analysis-adoption.md +4 -2
- package/docs/typescript-traces.md +37 -6
- package/lint/react.json +1 -0
- package/package.json +11 -2
- package/runtime-analysis-deps/load.mjs +6 -0
- package/runtime-analysis-deps/package-lock.json +1766 -0
- package/runtime-analysis-deps/package.json +11 -0
- package/dist/chunk-APBEGLRI.js.map +0 -1
- package/dist/chunk-NGLEGAEN.js.map +0 -1
- package/dist/chunk-TMVKYXZ3.js.map +0 -1
- package/dist/chunk-YUZB4LRJ.js.map +0 -1
- /package/dist/{chunk-LVY5NPOC.js.map → chunk-QMIJ4ZGJ.js.map} +0 -0
package/docs/sql-adoption.md
CHANGED
|
@@ -145,11 +145,14 @@ which a module may turn off) and the 2 timeouts the key calls for.
|
|
|
145
145
|
| sentinel, `applied-migration-changed` | 1 | **yes**, at `warn` |
|
|
146
146
|
| sentinel, `enum-value-used-before-commit` | 1 | **yes**, at `warn` |
|
|
147
147
|
| sentinel, `migration-folder-without-sql` | 1 | **yes**, at `warn` |
|
|
148
|
+
| sentinel, its rules on the SQL of templates | 5 | **yes**, at `warn` |
|
|
149
|
+
| sentinel, its opt-in rules on the SQL of templates | 3 | no: one runs once the module gives it a level |
|
|
148
150
|
|
|
149
|
-
**
|
|
151
|
+
**60 rules run on every module**, the set squawk itself runs, plus sentinel's ten. sentinel turns
|
|
150
152
|
no squawk rule off and turns no opt-in rule on: the choice of what runs by default is squawk's, and
|
|
151
|
-
a module moves it in its own config. `pnpm exec sentinel --inspect --sql --json` lists all
|
|
152
|
-
with the level each has in this module: squawk's 76, sentinel's
|
|
153
|
+
a module moves it in its own config. `pnpm exec sentinel --inspect --sql --json` lists all 90 names
|
|
154
|
+
with the level each has in this module: squawk's 76, sentinel's thirteen, and `syntax-error`. The
|
|
155
|
+
rules on the SQL of templates are in [The SQL of templates](#the-sql-of-templates-queryraw-executeraw-prismasql).
|
|
153
156
|
|
|
154
157
|
**A migration that does not parse** is reported first, with its first error (the ones squawk gives
|
|
155
158
|
after it follow from it), and counts as **one finding** under `syntax-error`, at `warn` like every
|
|
@@ -177,15 +180,16 @@ every setting the module can move and the role's value today, generated from the
|
|
|
177
180
|
cannot drift from them. A setting the module leaves out keeps the role's value; a setting it writes
|
|
178
181
|
**replaces** it, including inside a list, and the html report shows it as overridden by this module.
|
|
179
182
|
|
|
180
|
-
| Setting
|
|
181
|
-
|
|
|
182
|
-
| `migrations.include`
|
|
183
|
-
| `migrations.exclude`
|
|
184
|
-
| `
|
|
185
|
-
| `unsafe.
|
|
186
|
-
| `
|
|
187
|
-
| `
|
|
188
|
-
| `
|
|
183
|
+
| Setting | Default | What it moves |
|
|
184
|
+
| ------------------------ | ------------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
|
|
185
|
+
| `migrations.include` | `["**/migrations/*/migration.sql"]` | which files are migrations |
|
|
186
|
+
| `migrations.exclude` | `[]` | migrations never read |
|
|
187
|
+
| `migrations.indexesFrom` | `[]` | other migrations folders whose trigram indexes this module's queries use, read for `leading-wildcard-like` only |
|
|
188
|
+
| `unsafe.includeTests` | `true` | whether calls in test files are checked, by both rules |
|
|
189
|
+
| `unsafe.tests` | test folders and `*.spec`/`*.test`/… files | what counts as a test file |
|
|
190
|
+
| `ignore` | `node_modules`, `dist`, `coverage` | never read, by either check |
|
|
191
|
+
| `pgVersion` | `"16.8"` | the PostgreSQL version squawk checks against |
|
|
192
|
+
| `rules` | `{}`, every rule at its default | a level per rule, by its name |
|
|
189
193
|
|
|
190
194
|
An example that blocks two rules, silences one and turns an opt-in rule on:
|
|
191
195
|
|
|
@@ -546,22 +550,126 @@ the safety of the text rests on code the call does not show.
|
|
|
546
550
|
list, but its separator, prefix and suffix are SQL text. Measured on `main`: 88 calls with a
|
|
547
551
|
separator, every one a literal (`' AND '`, `' OR '`, `'\n'`), so none is reported.
|
|
548
552
|
|
|
553
|
+
## The SQL of templates, `$queryRaw`, `$executeRaw`, `Prisma.sql`
|
|
554
|
+
|
|
555
|
+
Prisma binds every `${}` of these three, so they are safe from injection. Their SQL is still SQL,
|
|
556
|
+
and the 19 May incident was written in one. The role reads each template of the files the branch
|
|
557
|
+
adds or changes with **PostgreSQL's own parser** (`libpg-query` 16.8.3, the 16 line the monorepo
|
|
558
|
+
runs), the same grammar the server applies: a rule matches the tree, never a word in a string or a
|
|
559
|
+
comment.
|
|
560
|
+
|
|
561
|
+
**How a fragment is read.** A `Prisma.sql` is often a fragment, a condition or an `ORDER BY` list,
|
|
562
|
+
joined into a query later. Each `${}` is filled with what it most likely is (a value, then an
|
|
563
|
+
identifier, then nothing, then a list of values), and the text is wrapped in the smallest statement
|
|
564
|
+
it can stand in (itself, `SELECT …`, `SELECT 1 WHERE …`, `… ORDER BY …`, `WITH … SELECT 1`, …). The
|
|
565
|
+
first reading PostgreSQL accepts is kept. A rule never reports what the wrap wrote, and a rule
|
|
566
|
+
about a whole statement (`UPDATE` without `WHERE`) runs only on a template that is one.
|
|
567
|
+
|
|
568
|
+
**What cannot be read alone** is named in every report, the console, the comment, the json and the
|
|
569
|
+
page, with its line, and never fails the run: the role reads all it can rather than stop. On
|
|
570
|
+
`main` 837abe3f29c, 1 237 of the 1 360 production templates holding SQL of their own are read
|
|
571
|
+
(91 %), and 227 of 227 in tests. A template made of `${}` only has nothing to read and is not
|
|
572
|
+
counted.
|
|
573
|
+
|
|
574
|
+
**Tests are read**, as the `Unsafe` rule reads them: `unsafe.includeTests`, which a module may set
|
|
575
|
+
to `false` for both.
|
|
576
|
+
|
|
577
|
+
| Rule | Default | Reports | Leaves alone |
|
|
578
|
+
| --------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
|
|
579
|
+
| `exists-union-correlated-outside` | **on** | an `EXISTS` over a derived `UNION` filtered only outside it | a `UNION` whose branches each carry the correlation (mission's `UNION ALL`) |
|
|
580
|
+
| `update-delete-without-where` | **on** | an `UPDATE` or `DELETE` with no `WHERE`, `UPDATE … FROM` included | a `SET` fragment |
|
|
581
|
+
| `insert-without-columns` | **on** | an `INSERT` with values and no column list | `DEFAULT VALUES`, a `VALUES` fragment |
|
|
582
|
+
| `select-star` | **on** | `SELECT *` or `t.*` on a table of the schema | `EXISTS (SELECT * …)`, `count(*)`, a `WITH` table, a subquery, `jsonb_to_recordset(…)` |
|
|
583
|
+
| `leading-wildcard-like` | **on** | a `LIKE` / `ILIKE` pattern starting with `%`, written in the SQL or built by the TypeScript, on an expression no trigram index of the migrations read serves | an anchored pattern, one whose start the code does not show, a served search, a `CHECK` constraint |
|
|
584
|
+
| `offset-pagination` | opt-in | `OFFSET` in a query or in the fragment that pages it | `LIMIT` alone |
|
|
585
|
+
| `select-distinct` | opt-in | a plain `SELECT DISTINCT` | `DISTINCT ON (…)` |
|
|
586
|
+
| `not-in-subquery` | opt-in | `NOT IN (SELECT …)`, which one `NULL` in the result empties | `NOT IN (1, 2)`, `NOT EXISTS` |
|
|
587
|
+
|
|
588
|
+
Measured over every template of `main` 837abe3f29c: the five rules on by default report 3
|
|
589
|
+
templates of production code (all `select-star` on a table) and 15 in tests (fixtures that update
|
|
590
|
+
every row or insert by position, and two `ILIKE '%…'` on `pg_indexes`). Turned on, the opt-in
|
|
591
|
+
ones would report 14, 22 and 0 templates of production code.
|
|
592
|
+
|
|
593
|
+
### Searches inside the text, `leading-wildcard-like`
|
|
594
|
+
|
|
595
|
+
A pattern that starts with `%` cannot use a B-tree index: every row is read. A trigram index
|
|
596
|
+
(`pg_trgm`, `gin_trgm_ops` or `gist_trgm_ops`) on the very expression searched serves it, so the
|
|
597
|
+
rule speaks only when none is in the migrations it read.
|
|
598
|
+
|
|
599
|
+
It reads the pattern wherever it is written: a literal (`'%x'`), SQL that builds it (`'%' || $1`,
|
|
600
|
+
`concat('%', $1)`, `LIKE … ESCAPE`), and the TypeScript that builds and binds it
|
|
601
|
+
(``${`%${word}%`}``, or a `const` of the file), through `lower`, `upper`, `unaccent` and
|
|
602
|
+
`immutable_unaccent`. A pattern whose start the code does not show, a function parameter, is not
|
|
603
|
+
judged.
|
|
604
|
+
|
|
605
|
+
The index must be on the same expression: an index on `"searchName"` does not serve
|
|
606
|
+
`unaccent(w."searchName")`. When a fragment does not say which table it reads (its `FROM` is in
|
|
607
|
+
another template), an index on that expression of any table counts.
|
|
608
|
+
|
|
609
|
+
**A module that queries another module's database** names that module's migrations, or the rule
|
|
610
|
+
would say that no index serves searches that one does:
|
|
611
|
+
|
|
612
|
+
```js
|
|
613
|
+
// apps/nest/microservices/mission/sql.config.mjs
|
|
614
|
+
export default defineSql({
|
|
615
|
+
root: import.meta.dirname,
|
|
616
|
+
overrides: { migrations: { indexesFrom: ['../../../../libs/nest/db-main/prisma/migrations'] } },
|
|
617
|
+
})
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
Those migrations are read for their indexes only, never checked. An index created by hand in a
|
|
621
|
+
database is in no migration: the message says which migrations were read, and that such an index
|
|
622
|
+
is not seen.
|
|
623
|
+
|
|
624
|
+
Measured on `main` 190dc8e3595, production code: the literal pattern alone, the rule of
|
|
625
|
+
1.7.0-alpha.33, reported **0** places. This one reports 38 with each module's own migrations, and
|
|
626
|
+
**26** once the modules name `libs/nest/db-main`'s, where the 9 trigram indexes of the monorepo
|
|
627
|
+
are: 12 searches are served and stay silent. The 26 were read one by one: none has a trigram index
|
|
628
|
+
on its expression in any migration (`unaccent(w."searchName")` on an index of `"searchName"`,
|
|
629
|
+
recruitment's searches on a database whose migrations create the extension and no index).
|
|
630
|
+
|
|
631
|
+
### The 19 May incident, `exists-union-correlated-outside`
|
|
632
|
+
|
|
633
|
+
```sql
|
|
634
|
+
EXISTS (
|
|
635
|
+
SELECT 1 FROM (
|
|
636
|
+
SELECT j.profile_id FROM profile_jobs j WHERE j.approval = 'idle'
|
|
637
|
+
UNION
|
|
638
|
+
SELECT s.profile_id FROM profile_specialties s WHERE s.approval = 'idle'
|
|
639
|
+
) pending
|
|
640
|
+
WHERE pending.profile_id = p.id
|
|
641
|
+
)
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
The correlation to the outer row sits outside the union, on the derived table, and PostgreSQL does
|
|
645
|
+
not push it into the branches: for every outer row it builds the whole union. That made the
|
|
646
|
+
network list scan both tables once per profile (monorepo 868e2b4). Run on a copy of `network`, the
|
|
647
|
+
rule reports `has-pending-skill-requests.filter-strategy.ts:21` at `868e2b4^1` and nothing at
|
|
648
|
+
`868e2b4`; over every template of `main`, nothing.
|
|
649
|
+
|
|
650
|
+
```
|
|
651
|
+
this EXISTS reads the UNION `pending` and filters it only outside the union (`pending.profile_id`): PostgreSQL cannot push that filter into the branches, so it builds the whole union for every outer row. This is the shape of the 19 May incident.
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
The fix: repeat the correlation in each branch (`WHERE j.profile_id = p.id`), or write one
|
|
655
|
+
`EXISTS` per branch joined by `OR`, so each branch is filtered with its own index.
|
|
656
|
+
|
|
549
657
|
## Every way to send SQL text, and what reads it
|
|
550
658
|
|
|
551
659
|
Measured on the monorepo (`main` f12da701121), every call that can send text to a database:
|
|
552
660
|
|
|
553
|
-
| Entry point | Calls | Its text is | Read by
|
|
554
|
-
| ---------------------------------------------------------------------- | ------------: | -------------------------------------------------------- |
|
|
555
|
-
| `` $queryRaw`…` ``, `` $executeRaw`…` ``, `` Prisma.sql`…` `` (tagged) | 332 and 1 079 | a template whose every `${}` Prisma binds |
|
|
556
|
-
| `$queryRaw(sql)` called as a function | 30 | a `Prisma.Sql` object; TypeScript refuses a plain string | nothing to report
|
|
557
|
-
| `$queryRawUnsafe` / `$executeRawUnsafe` | 219 | SQL | `unsafe-sql-pasted-value`
|
|
558
|
-
| `pg` `query` | 37 | SQL | `unsafe-sql-pasted-value`
|
|
559
|
-
| postgres.js `unsafe` | 1 | SQL | `unsafe-sql-pasted-value`
|
|
560
|
-
| `Prisma.raw` | 97 | SQL, pasted as is | `unsafe-sql-raw-fragment`
|
|
561
|
-
| `Prisma.join` separator, prefix, suffix | 88 | SQL | `unsafe-sql-raw-fragment`
|
|
562
|
-
| postgres.js tagged `` sql`…` `` | | a template whose every `${}` the driver binds | nothing to report
|
|
563
|
-
| knex, TypeORM, Sequelize, mysql | 0 | | not used
|
|
564
|
-
| MongoDB (35 imports) | | not SQL | outside this role
|
|
661
|
+
| Entry point | Calls | Its text is | Read by |
|
|
662
|
+
| ---------------------------------------------------------------------- | ------------: | -------------------------------------------------------- | -------------------------------------------------------------- |
|
|
663
|
+
| `` $queryRaw`…` ``, `` $executeRaw`…` ``, `` Prisma.sql`…` `` (tagged) | 332 and 1 079 | a template whose every `${}` Prisma binds | safe from injection; its SQL is read by the rules on templates |
|
|
664
|
+
| `$queryRaw(sql)` called as a function | 30 | a `Prisma.Sql` object; TypeScript refuses a plain string | nothing to report |
|
|
665
|
+
| `$queryRawUnsafe` / `$executeRawUnsafe` | 219 | SQL | `unsafe-sql-pasted-value` |
|
|
666
|
+
| `pg` `query` | 37 | SQL | `unsafe-sql-pasted-value` |
|
|
667
|
+
| postgres.js `unsafe` | 1 | SQL | `unsafe-sql-pasted-value` |
|
|
668
|
+
| `Prisma.raw` | 97 | SQL, pasted as is | `unsafe-sql-raw-fragment` |
|
|
669
|
+
| `Prisma.join` separator, prefix, suffix | 88 | SQL | `unsafe-sql-raw-fragment` |
|
|
670
|
+
| postgres.js tagged `` sql`…` `` | | a template whose every `${}` the driver binds | nothing to report |
|
|
671
|
+
| knex, TypeORM, Sequelize, mysql | 0 | | not used |
|
|
672
|
+
| MongoDB (35 imports) | | not SQL | outside this role |
|
|
565
673
|
|
|
566
674
|
## What the role does not read yet
|
|
567
675
|
|
|
@@ -570,9 +678,14 @@ Said here so that a clean report is not read as more than it is:
|
|
|
570
678
|
- **`VACUUM` in a migration of several statements.** PostgreSQL refuses it inside a transaction,
|
|
571
679
|
as it refuses `CONCURRENTLY`, and squawk 2.72.0 does not report it there. No migration of the
|
|
572
680
|
monorepo runs `VACUUM`.
|
|
573
|
-
- **
|
|
574
|
-
|
|
575
|
-
|
|
681
|
+
- **A problem split across two templates.** Each template is read alone: an `EXISTS` in one
|
|
682
|
+
`Prisma.sql` and the `UNION` a `${}` brings from another are two readings, and the rule sees
|
|
683
|
+
neither whole. Assembling the fragments of a query would be close to reading the ORM chain.
|
|
684
|
+
- **The templates PostgreSQL's parser cannot read alone**, about 9 % of the production ones on
|
|
685
|
+
`main` 837abe3f29c: named in every report, never a failure, and checked by no rule.
|
|
686
|
+
- **The SQL text of `$queryRawUnsafe`** is checked for what is pasted into it, not against the
|
|
687
|
+
rules on templates, and **drizzle-orm's `` sql`…` ``** (6 files) is not read: its fragments are
|
|
688
|
+
built for its query builder.
|
|
576
689
|
- **JavaScript files** (`.js`, `.mjs`): the role reads TypeScript (`.ts`, `.mts`, `.cts`).
|
|
577
690
|
- **Files outside a module.** The role runs on a module; a script at the repository's root that
|
|
578
691
|
belongs to no module is read by no role.
|
|
@@ -223,7 +223,9 @@ The **import graph** is explorable. Point at a dot for its path, which the brows
|
|
|
223
223
|
|
|
224
224
|
`--output markdown` writes `static-analysis-report/static-analysis.md`: one table, one row per family, the headline figure and how many places that family holds. It is what a workflow posts as a comment, one section per affected module.
|
|
225
225
|
|
|
226
|
-
|
|
226
|
+
**It compares with the merge base.** Each place (a clone, a dead file, a cycle) is compared by what it is, not by its line numbers: what the branch added, what it removed, and how many were already there. A module already at 6.81% is not read as one this branch pushed there.
|
|
227
|
+
|
|
228
|
+
**A new import cycle can fail the run.** `graph.newCycles` decides: `warn` (the default until January) reports a cycle the branch adds, `error` fails the run on it. A cycle already on `main` never fails it. A module raises it in its config, `overrides: { graph: { newCycles: 'error' } }`; anything but `warn` or `error`, `off` included, is refused and read as `warn`.
|
|
227
229
|
|
|
228
230
|
⚠️ `static-analysis-report/` is generated, and **`--init` ignores it for you**: it writes one line into your repository's root `.gitignore`, unanchored so it matches at every depth, rather than one line in every adopting module's own file. It checks first, in any spelling, so adopting a second module adds nothing. You have nothing to do and nothing to commit beyond that line.
|
|
229
231
|
|
|
@@ -279,7 +281,7 @@ Absent with its reason, rather than a figure that is wrong by half.
|
|
|
279
281
|
|
|
280
282
|
## What the role will not do
|
|
281
283
|
|
|
282
|
-
- **It will not fail your build.** No threshold here refuses anything, by design
|
|
284
|
+
- **It will not fail your build on a figure.** No threshold here refuses anything, by design. The non-zero exits are an unknown `--output` value, a tool that could not be run at all, and one finding: a new import cycle at `graph.newCycles: error`, the one deterministic rule that blocks what a pull request adds.
|
|
283
285
|
- **It will not read your module's `.oxlintrc.json`.** The size gauge writes its own config to a temporary directory, so its scale is the same in every module. A gauge whose scale moves per module compares nothing.
|
|
284
286
|
- **It will not look outside the module**, except for the one measurement that cannot be answered inside it: a library's reachability.
|
|
285
287
|
- **It will not measure your tests.** Specs, fixtures, mocks, stories and generated files are out of every product figure. Duplication reports the test suite separately, on its own two rows, because that one is worth seeing and must not be blended into the product number.
|
|
@@ -241,9 +241,7 @@ $ sentinel --report --json 2>/dev/null
|
|
|
241
241
|
"code-churn",
|
|
242
242
|
"arch"
|
|
243
243
|
],
|
|
244
|
-
"skipped": [
|
|
245
|
-
"runtime-analysis"
|
|
246
|
-
],
|
|
244
|
+
"skipped": [],
|
|
247
245
|
"results": [
|
|
248
246
|
{
|
|
249
247
|
"project": "svelte-app",
|
|
@@ -330,6 +328,7 @@ $ sentinel --report --json 2>/dev/null
|
|
|
330
328
|
"migrations": 0,
|
|
331
329
|
"codeFiles": 1,
|
|
332
330
|
"unsafeFiles": 0,
|
|
331
|
+
"templateFiles": 0,
|
|
333
332
|
"base": null,
|
|
334
333
|
"migrationsRead": 0,
|
|
335
334
|
"migrationsUnchanged": 0,
|
|
@@ -338,6 +337,9 @@ $ sentinel --report --json 2>/dev/null
|
|
|
338
337
|
"unsafeCalls": 0,
|
|
339
338
|
"rawFragmentCalls": 0,
|
|
340
339
|
"unsafeUnparsed": 0,
|
|
340
|
+
"templateFilesRead": 0,
|
|
341
|
+
"templatesRead": 0,
|
|
342
|
+
"templatesUnread": 0,
|
|
341
343
|
"findings": 0,
|
|
342
344
|
"errors": 0,
|
|
343
345
|
"rulesOff": [],
|
|
@@ -454,6 +456,7 @@ $ sentinel --report --json 2>/dev/null
|
|
|
454
456
|
"migrations": 0,
|
|
455
457
|
"codeFiles": 1,
|
|
456
458
|
"unsafeFiles": 0,
|
|
459
|
+
"templateFiles": 0,
|
|
457
460
|
"base": null,
|
|
458
461
|
"migrationsRead": 0,
|
|
459
462
|
"migrationsUnchanged": 0,
|
|
@@ -462,6 +465,9 @@ $ sentinel --report --json 2>/dev/null
|
|
|
462
465
|
"unsafeCalls": 0,
|
|
463
466
|
"rawFragmentCalls": 0,
|
|
464
467
|
"unsafeUnparsed": 0,
|
|
468
|
+
"templateFilesRead": 0,
|
|
469
|
+
"templatesRead": 0,
|
|
470
|
+
"templatesUnread": 0,
|
|
465
471
|
"findings": 0,
|
|
466
472
|
"errors": 0,
|
|
467
473
|
"rulesOff": [],
|
|
@@ -578,6 +584,7 @@ $ sentinel --report --json 2>/dev/null
|
|
|
578
584
|
"migrations": 0,
|
|
579
585
|
"codeFiles": 1,
|
|
580
586
|
"unsafeFiles": 0,
|
|
587
|
+
"templateFiles": 0,
|
|
581
588
|
"base": null,
|
|
582
589
|
"migrationsRead": 0,
|
|
583
590
|
"migrationsUnchanged": 0,
|
|
@@ -586,6 +593,9 @@ $ sentinel --report --json 2>/dev/null
|
|
|
586
593
|
"unsafeCalls": 0,
|
|
587
594
|
"rawFragmentCalls": 0,
|
|
588
595
|
"unsafeUnparsed": 0,
|
|
596
|
+
"templateFilesRead": 0,
|
|
597
|
+
"templatesRead": 0,
|
|
598
|
+
"templatesUnread": 0,
|
|
589
599
|
"findings": 0,
|
|
590
600
|
"errors": 0,
|
|
591
601
|
"rulesOff": [],
|
|
@@ -690,6 +700,7 @@ $ sentinel --report --json 2>/dev/null
|
|
|
690
700
|
"migrations": 0,
|
|
691
701
|
"codeFiles": 1,
|
|
692
702
|
"unsafeFiles": 0,
|
|
703
|
+
"templateFiles": 0,
|
|
693
704
|
"base": null,
|
|
694
705
|
"migrationsRead": 0,
|
|
695
706
|
"migrationsUnchanged": 0,
|
|
@@ -698,6 +709,9 @@ $ sentinel --report --json 2>/dev/null
|
|
|
698
709
|
"unsafeCalls": 0,
|
|
699
710
|
"rawFragmentCalls": 0,
|
|
700
711
|
"unsafeUnparsed": 0,
|
|
712
|
+
"templateFilesRead": 0,
|
|
713
|
+
"templatesRead": 0,
|
|
714
|
+
"templatesUnread": 0,
|
|
701
715
|
"findings": 0,
|
|
702
716
|
"errors": 0,
|
|
703
717
|
"rulesOff": [],
|
|
@@ -765,9 +779,7 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
765
779
|
"code-churn",
|
|
766
780
|
"arch"
|
|
767
781
|
],
|
|
768
|
-
"skipped": [
|
|
769
|
-
"runtime-analysis"
|
|
770
|
-
],
|
|
782
|
+
"skipped": [],
|
|
771
783
|
"results": [
|
|
772
784
|
{
|
|
773
785
|
"project": "svelte-app",
|
|
@@ -854,6 +866,7 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
854
866
|
"migrations": 0,
|
|
855
867
|
"codeFiles": 1,
|
|
856
868
|
"unsafeFiles": 0,
|
|
869
|
+
"templateFiles": 0,
|
|
857
870
|
"base": null,
|
|
858
871
|
"migrationsRead": 0,
|
|
859
872
|
"migrationsUnchanged": 0,
|
|
@@ -862,6 +875,9 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
862
875
|
"unsafeCalls": 0,
|
|
863
876
|
"rawFragmentCalls": 0,
|
|
864
877
|
"unsafeUnparsed": 0,
|
|
878
|
+
"templateFilesRead": 0,
|
|
879
|
+
"templatesRead": 0,
|
|
880
|
+
"templatesUnread": 0,
|
|
865
881
|
"findings": 0,
|
|
866
882
|
"errors": 0,
|
|
867
883
|
"rulesOff": [],
|
|
@@ -978,6 +994,7 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
978
994
|
"migrations": 0,
|
|
979
995
|
"codeFiles": 1,
|
|
980
996
|
"unsafeFiles": 0,
|
|
997
|
+
"templateFiles": 0,
|
|
981
998
|
"base": null,
|
|
982
999
|
"migrationsRead": 0,
|
|
983
1000
|
"migrationsUnchanged": 0,
|
|
@@ -986,6 +1003,9 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
986
1003
|
"unsafeCalls": 0,
|
|
987
1004
|
"rawFragmentCalls": 0,
|
|
988
1005
|
"unsafeUnparsed": 0,
|
|
1006
|
+
"templateFilesRead": 0,
|
|
1007
|
+
"templatesRead": 0,
|
|
1008
|
+
"templatesUnread": 0,
|
|
989
1009
|
"findings": 0,
|
|
990
1010
|
"errors": 0,
|
|
991
1011
|
"rulesOff": [],
|
|
@@ -1102,6 +1122,7 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
1102
1122
|
"migrations": 0,
|
|
1103
1123
|
"codeFiles": 1,
|
|
1104
1124
|
"unsafeFiles": 0,
|
|
1125
|
+
"templateFiles": 0,
|
|
1105
1126
|
"base": null,
|
|
1106
1127
|
"migrationsRead": 0,
|
|
1107
1128
|
"migrationsUnchanged": 0,
|
|
@@ -1110,6 +1131,9 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
1110
1131
|
"unsafeCalls": 0,
|
|
1111
1132
|
"rawFragmentCalls": 0,
|
|
1112
1133
|
"unsafeUnparsed": 0,
|
|
1134
|
+
"templateFilesRead": 0,
|
|
1135
|
+
"templatesRead": 0,
|
|
1136
|
+
"templatesUnread": 0,
|
|
1113
1137
|
"findings": 0,
|
|
1114
1138
|
"errors": 0,
|
|
1115
1139
|
"rulesOff": [],
|
|
@@ -1214,6 +1238,7 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
1214
1238
|
"migrations": 0,
|
|
1215
1239
|
"codeFiles": 1,
|
|
1216
1240
|
"unsafeFiles": 0,
|
|
1241
|
+
"templateFiles": 0,
|
|
1217
1242
|
"base": null,
|
|
1218
1243
|
"migrationsRead": 0,
|
|
1219
1244
|
"migrationsUnchanged": 0,
|
|
@@ -1222,6 +1247,9 @@ $ sentinel --report --all --json 2>/dev/null
|
|
|
1222
1247
|
"unsafeCalls": 0,
|
|
1223
1248
|
"rawFragmentCalls": 0,
|
|
1224
1249
|
"unsafeUnparsed": 0,
|
|
1250
|
+
"templateFilesRead": 0,
|
|
1251
|
+
"templatesRead": 0,
|
|
1252
|
+
"templatesUnread": 0,
|
|
1225
1253
|
"findings": 0,
|
|
1226
1254
|
"errors": 0,
|
|
1227
1255
|
"rulesOff": [],
|
|
@@ -1570,6 +1598,7 @@ $ sentinel --init --dry-run
|
|
|
1570
1598
|
+ // deadCode.minConfidence 60
|
|
1571
1599
|
+ // deadCode.categories unused-file, unused-export, unused-symbol, unused-import
|
|
1572
1600
|
+ // graph.resolution 1
|
|
1601
|
+
+ // graph.newCycles warn
|
|
1573
1602
|
+ //
|
|
1574
1603
|
+ // A list shown as a count is not copyable, and replacing one means writing back what you keep,
|
|
1575
1604
|
+ // so read the values in full with:
|
|
@@ -1745,6 +1774,7 @@ $ sentinel --init --dry-run
|
|
|
1745
1774
|
+ }
|
|
1746
1775
|
+ }
|
|
1747
1776
|
dry run: the lint autofix runs on adoption and can rewrite source, as moving to another linter does; add --rehearse to name the files (it runs the pass in a throwaway copy, as long as the real one)
|
|
1777
|
+
dry run: adoption also measures the existing lint violations, which can rewrite .oxlintrc.baseline.json; --rehearse names it when it would change
|
|
1748
1778
|
dry run: the format autofix runs on adoption and can rewrite source, as moving to another formatter does; add --rehearse to name the files (it runs the pass in a throwaway copy, as long as the real one)
|
|
1749
1779
|
dry run: would ignore static-analysis-report/ in the root .gitignore
|
|
1750
1780
|
dry run: would ignore sql-report/ in the root .gitignore
|
|
@@ -1868,6 +1898,7 @@ $ sentinel --init --dry-run --rehearse
|
|
|
1868
1898
|
+ // deadCode.minConfidence 60
|
|
1869
1899
|
+ // deadCode.categories unused-file, unused-export, unused-symbol, unused-import
|
|
1870
1900
|
+ // graph.resolution 1
|
|
1901
|
+
+ // graph.newCycles warn
|
|
1871
1902
|
+ //
|
|
1872
1903
|
+ // A list shown as a count is not copyable, and replacing one means writing back what you keep,
|
|
1873
1904
|
+ // so read the values in full with:
|
package/lint/react.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hublo/sentinel",
|
|
3
|
-
"version": "1.7.0-alpha.
|
|
3
|
+
"version": "1.7.0-alpha.37",
|
|
4
4
|
"description": "One CLI that guards code health across Hublo repos: shared lint/typescript/build/test presets, static & dynamic analysis, and architecture checks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
"types": "./dist/roles/code-churn/config.d.ts",
|
|
67
67
|
"import": "./dist/roles/code-churn/config.js"
|
|
68
68
|
},
|
|
69
|
+
"./runtime-analysis": {
|
|
70
|
+
"types": "./dist/roles/runtime-analysis/config.d.ts",
|
|
71
|
+
"import": "./dist/roles/runtime-analysis/config.js"
|
|
72
|
+
},
|
|
69
73
|
"./env": {
|
|
70
74
|
"types": "./dist/roles/env/config.d.ts",
|
|
71
75
|
"import": "./dist/roles/env/config.js"
|
|
@@ -125,7 +129,8 @@
|
|
|
125
129
|
"docs",
|
|
126
130
|
"lint",
|
|
127
131
|
"oxlint",
|
|
128
|
-
"plugins"
|
|
132
|
+
"plugins",
|
|
133
|
+
"runtime-analysis-deps"
|
|
129
134
|
],
|
|
130
135
|
"scripts": {
|
|
131
136
|
"build": "tsup && tsx scripts/build-presets.ts",
|
|
@@ -177,6 +182,7 @@
|
|
|
177
182
|
"jscpd": "5.4.0",
|
|
178
183
|
"jsdom": "^24.1.3",
|
|
179
184
|
"jsonc-parser": "^3.3.1",
|
|
185
|
+
"libpg-query": "16.8.3",
|
|
180
186
|
"msw": "1.3.3",
|
|
181
187
|
"nitro": "3.0.260415-beta",
|
|
182
188
|
"oxc-parser": "0.147.0",
|
|
@@ -196,7 +202,10 @@
|
|
|
196
202
|
"@hublo/sentinel": "link:.",
|
|
197
203
|
"@types/node": "^24.19.2",
|
|
198
204
|
"@types/picomatch": "4.0.3",
|
|
205
|
+
"lighthouse": "13.6.0",
|
|
199
206
|
"nx": "^23.1.0",
|
|
207
|
+
"playwright-core": "1.64.1",
|
|
208
|
+
"puppeteer-core": "25.16.0",
|
|
200
209
|
"tsup": "^8.3.0",
|
|
201
210
|
"tsx": "^4.19.0"
|
|
202
211
|
},
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Imported by file path from sentinel's cache: the bare names below resolve to the node_modules
|
|
2
|
+
// installed next to this file, never to the workspace's.
|
|
3
|
+
export { startFlow } from 'lighthouse'
|
|
4
|
+
export { default as desktopConfig } from 'lighthouse/core/config/desktop-config.js'
|
|
5
|
+
export { chromium } from 'playwright-core'
|
|
6
|
+
export { default as puppeteer } from 'puppeteer-core'
|