@starci/eslint-canon-be 3.9.2 → 3.9.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.9.3 - 2026-10-31
4
+
5
+ - Changed: the bundled canon pins name the 0.16.3 cohort (@starci/grammar, eslint-grammar-core and eslint-grammar-offset-pop 0.16.3, eslint-canon-fe 9.6.3, eslint-canon-be 3.9.3, stylelint-canon 2.3.0, jest-preset 2.6.0, hfs 4.13.0); ChatWorkspace and PaneLayout are removed with no alias; PaneGrid and Pane are the one generic pane grid: grammar names are generic.
6
+ - Added: `entity-extends-base` (R342 `BE_ENTITY_EXTENDS_BASE`, `src/entity-base.ts`, BE-PERSISTENCE-3, ruling entity-base), both editions: an `@Entity` class that declares a database-set `created_at` or `updated_at` itself (`@CreateDateColumn`, `@UpdateDateColumn`, or a `@Column` on those names, or on `createdAt` / `updatedAt`, with `insert: false`, `update: false` or a `default`) and, beside both, the generated uuid `id` is refused; the finding names `UuidAbstractEntity` or `AbstractEntity` of `@modules/platform/database` as the base to extend. A timestamp the application sets (a plain `@Column`) and the base file `platform/database/abstract.entity.ts` are not judged. Spec: `src/entity-base.spec.ts`.
7
+ - Changed: the bundled rule catalog adds R342 and the failure codes add `BE_ENTITY_EXTENDS_BASE`.
8
+ - Added: the lint result cache of `starci app check` (ruling app-check-cache): `crossFileInputs`, the files and folders each rule reads beyond the linted file (git-history inputs; third-party-owner walks the integrations only for integration files; an fs-audit spec proves every rule declares what it reads), and the `projectGraph` export the cache keys a file's lint record on.
9
+
3
10
  ## 3.9.2 - 2026-10-31
4
11
 
5
12
  - Changed: the bundled canon pins name @starci/grammar 0.16.2 (the horizontal Stepper connector line; SurfaceListCard takes its depth from the surface context).
package/README.md CHANGED
@@ -60,6 +60,7 @@ A sample, not the list:
60
60
  | **CQRS** | A message extends `Command<R>` / `Query<R>` from `@nestjs/cqrs`, carries one `readonly params: ExecuteParams<X>` (no entity reachable from `X`), a handler extends `ICQRSHandler` and overrides `process`; a handler is thin: it injects only `*Service` classes and the Logger, and `process` is one `return this.<service>.<method>(...)` with no branch, loop, EntityManager or second call (`handler-is-thin`); no `*.use-case.ts`, no forwarder service, no `EventBus`, `@nestjs/event-emitter`, `EventEmitter` or RxJS `Subject` constructed or extended, and no class that stores callbacks other code registers (`handler-overrides-process`, `message-carries-params-only`, `message-typed-result`, `execute-params-shape`, `no-use-case`, `no-event-bus`) |
61
61
  | **Module layering** | Another owner is imported through its public `index.ts` (`@modules/domain/plan`, `@features/api/plan`), never through a path into it, and a same-owner import is relative and never through the own index (`import-owner-entry`); an owner has one `index.ts` (a nested one is refused) that holds only named `export { }` lines, with no `export *`, and a bounded number of names (`no-folder-reexport`); self-aliases and relative escapes are refused (`no-self-module-alias`, `no-relative-capability-escape`). Owners come from the HFS slots, aliases from the program's `compilerOptions.paths`. |
62
62
  | **Data access** | The database is reached through the shared `EntityManager` only, received as a constructor parameter with the named injector of a declared connection - a lookalike name, property injection, an injected `DataSource` or `QueryRunner` outside `platform/database` and the cli (`apps/cli`, `src/features/cli/`), `getRepository` and repository types are refused, specs included (`must-inject-entity-manager`, `named-entity-manager-only`, `no-injected-repository`); a `DataSource` or `QueryRunner` is not written as a type, awaited value or `provide:` token outside those places, and a class that receives a wrapper exposing one is refused (`named-entity-manager-only`); a class outside an application handler, a domain service and a platform persistence capability takes, holds or returns no `EntityManager`, `Repository`, `DataSource` or `QueryRunner` whatever it is called, and no exported function takes an `EntityManager` first (a statement module); `src/tests` is exempt (`no-repository-class`); a `DataSource` or `QueryRunner` is not written as a type, awaited value or `provide:` token outside those places, and a class that receives a wrapper exposing one is refused (`named-entity-manager-only`); a class outside an application handler, a domain service and a platform persistence capability takes, holds or returns no `EntityManager`, `Repository`, `DataSource` or `QueryRunner`, whatever it is called, and no exported function takes an `EntityManager` first (a statement module); the test tree (`src/tests`) is exempt (`no-repository-class`); inside a transaction callback only the manager it received is used (`no-outer-manager-in-transaction`); no call through an integration, `HttpClient` or `MessagePublisher` typed receiver spans a transaction (`no-external-call-in-transaction`); the manager is injected only in application handlers, domain services and the platform database, inbox, outbox and lease capabilities (`em-injection-slots`) |
63
+ | **Entity base** | An `@Entity` class does not repeat the columns every table shares: a database-set `created_at` or `updated_at` (`@CreateDateColumn`, `@UpdateDateColumn`, or a `@Column` on those names with `insert: false`, `update: false` or a `default`) and, beside both, the generated uuid `id` are inherited from `UuidAbstractEntity` or `AbstractEntity` of `@modules/platform/database`; the finding names the base. A table whose timestamps the application sets, or that lacks one of them, extends nothing, and the base file `platform/database/abstract.entity.ts` is exempt (`entity-extends-base`, R342, BE-PERSISTENCE-3) |
63
64
  | **Connections** | One database is one connection and one `Inject<Conn>EntityManager()` injector: `InjectEntityManager(`, `InjectDataSource(` and `getEntityManagerToken(` are called only in `platform/database/<conn>.decorators.ts`, the cli and the test world; an exported EntityManager injector is exactly the declared connection's; `TypeOrmModule.forRoot*` and `new DataSource(` live in the platform database capability and the cli; the connection name is written once, in its `<conn>.connection.ts`; a `<conn>.config.ts` reads only keys of its `envPrefix` (`one-connection-per-database`) |
64
65
  | **Operations** | A versioned operation is declared once in the app's typed operation table (`query({ input, output, refusal })` / `mutation(...)` registered by `defineOperations`, declared by the platform capability `operations`): bounded input and output schemas come from an owner's `*.schema.ts` file, their inferred types are closed, and refusal codes form a closed union of string literals. A route takes `OperationRequest<Table>`, validates it with the canon `OperationValidationPolicy` constructed from that same table, and answers `Promise<OperationReply<Table>>` (`operation-contract-decidable`, `operation-table-schemas`, `operation-route-driven-by-table`) |
65
66
  | **Webhooks and realtime** | A provider webhook door injects only the `WebhookSignatureService` and domain services, verifies first (awaited when async), and hands the POST delivery to exactly one domain intake that records the inbox receipt and outbox event; a domain method may combine proof and intake. The POST returns nothing or the own-feature exported literal `PROVIDER_ACK`. One optional GET challenge handler returns only its declared domain verifier's result. The door and HTTP module import or inject no `CommandBus`, `QueryBus` or feature command handler, and its resolved domain intake dispatches no command/query bus or feature handler; a reactor or job dispatches after commit (`webhook-shape`, `webhook-verify-first`, `feature-thin`). A realtime door is one gateway or subscription that injects only the `RealtimeHub` and subscribes to a topic built from its `@CurrentPrincipal()` (`realtime-shape`, `realtime-read-only`, `realtime-topic-scope`) |
@@ -0,0 +1,9 @@
1
+ import type { RuleModule, Recommended } from "./lib/rule.js";
2
+ /** An entity inherits the columns every table shares. */
3
+ export declare const entityExtendsBase: RuleModule;
4
+ /** The rules of the entity-base law, by name. */
5
+ export declare const rules: {
6
+ "entity-extends-base": RuleModule;
7
+ };
8
+ /** On at error; both editions. */
9
+ export declare const recommended: Recommended;
@@ -0,0 +1,117 @@
1
+ /** The file that declares the bases: the one place these columns are written. */
2
+ const BASE_FILE = /[\\/]platform[\\/]database[\\/]abstract\.entity\.ts$/;
3
+ /** The base entities and the public entry they are imported from. */
4
+ const BASE_ENTITY = "AbstractEntity";
5
+ const UUID_BASE_ENTITY = "UuidAbstractEntity";
6
+ const DATABASE_MODULE = "@modules/platform/database";
7
+ /** The shared timestamp columns and the property that maps to each when a decorator names no column. */
8
+ const TIMESTAMPS = { created_at: "createdAt", updated_at: "updatedAt" };
9
+ /** The decorators TypeORM itself fills a timestamp through, and the column each one fills. */
10
+ const MANAGED_DATE_COLUMNS = { CreateDateColumn: "created_at", UpdateDateColumn: "updated_at" };
11
+ /** The decorator of a node whose name is in `names`, with its call when it is called. */
12
+ const decoratorOf = (node, names) => {
13
+ for (const decorator of node.decorators) {
14
+ const expression = decorator.expression;
15
+ if (expression.type === "Identifier" && names.has(expression.name))
16
+ return { name: expression.name, call: null };
17
+ if (expression.type === "CallExpression" && expression.callee.type === "Identifier" && names.has(expression.callee.name))
18
+ return { name: expression.callee.name, call: expression };
19
+ }
20
+ return undefined;
21
+ };
22
+ /** One option of a decorator's options object: whether it is written and, when it is a literal, its value. */
23
+ const optionOf = (options, key) => {
24
+ if (options?.type !== "ObjectExpression")
25
+ return { present: false };
26
+ for (const property of options.properties) {
27
+ if (property.type !== "Property" || property.computed)
28
+ continue;
29
+ const name = property.key.type === "Identifier" ? property.key.name : property.key.type === "Literal" ? String(property.key.value) : undefined;
30
+ if (name !== key)
31
+ continue;
32
+ return property.value.type === "Literal" ? { present: true, value: property.value.value } : { present: true };
33
+ }
34
+ return { present: false };
35
+ };
36
+ /** The options object of a decorator call: its first object argument. */
37
+ const optionsOf = (call) => call?.arguments.find((argument) => argument.type === "ObjectExpression");
38
+ /** The key of a class property when it is a plain identifier or string. */
39
+ const propertyName = (member) => {
40
+ if (member.computed)
41
+ return undefined;
42
+ if (member.key.type === "Identifier")
43
+ return member.key.name;
44
+ return member.key.type === "Literal" ? String(member.key.value) : undefined;
45
+ };
46
+ /** The column a decorator maps: its literal `name`, else the column the property `createdAt` / `updatedAt` stands for. */
47
+ const columnOf = (member, options) => {
48
+ const named = optionOf(options, "name");
49
+ if (named.present)
50
+ return named.value;
51
+ return Object.keys(TIMESTAMPS).find((column) => TIMESTAMPS[column] === propertyName(member));
52
+ };
53
+ /** The shared timestamp column a property maps through a database-set decorator, or undefined. */
54
+ const timestampColumnOf = (member) => {
55
+ const managed = decoratorOf(member, new Set(Object.keys(MANAGED_DATE_COLUMNS)));
56
+ if (managed) {
57
+ const column = columnOf(member, optionsOf(managed.call));
58
+ return typeof column === "string" && column === MANAGED_DATE_COLUMNS[managed.name] ? column : undefined;
59
+ }
60
+ const plain = decoratorOf(member, new Set(["Column"]));
61
+ if (!plain)
62
+ return undefined;
63
+ const options = optionsOf(plain.call);
64
+ const column = columnOf(member, options);
65
+ if (typeof column !== "string" || TIMESTAMPS[column] === undefined)
66
+ return undefined;
67
+ const databaseSet = optionOf(options, "insert").value === false || optionOf(options, "update").value === false || optionOf(options, "default").present;
68
+ return databaseSet ? column : undefined;
69
+ };
70
+ /** True when a property is the generated uuid primary key. */
71
+ const isGeneratedUuid = (member) => {
72
+ const generated = decoratorOf(member, new Set(["PrimaryGeneratedColumn"]));
73
+ if (!generated)
74
+ return false;
75
+ const [first, second] = generated.call?.arguments ?? [];
76
+ const strategy = first?.type === "Literal" ? first.value : optionOf(first, "type").value;
77
+ const name = optionOf(second?.type === "ObjectExpression" ? second : first, "name");
78
+ return strategy === "uuid" && (!name.present || name.value === "id");
79
+ };
80
+ /** An entity inherits the columns every table shares. */
81
+ export const entityExtendsBase = {
82
+ meta: {
83
+ type: "problem",
84
+ docs: { description: "An @Entity class does not repeat created_at / updated_at (or the generated uuid id beside them); it extends AbstractEntity or UuidAbstractEntity of @modules/platform/database." },
85
+ schema: [],
86
+ messages: {
87
+ timestamp: `\`{{entity}}\` maps \`{{column}}\` itself. Columns every table shares are inherited, never repeated (BE-PERSISTENCE-3, ruling entity-base): extend \`{{base}}\` imported from \`${DATABASE_MODULE}\` and drop this property. A table whose timestamps the application sets, or that lacks one of them, extends nothing and maps its own with a plain \`@Column\`.`,
88
+ key: `\`{{entity}}\` maps the generated uuid \`id\` beside \`created_at\` and \`updated_at\` itself. Columns every table shares are inherited, never repeated (BE-PERSISTENCE-3, ruling entity-base): extend \`${UUID_BASE_ENTITY}\` imported from \`${DATABASE_MODULE}\` and drop the three properties.`,
89
+ },
90
+ },
91
+ create(context) {
92
+ if (BASE_FILE.test(context.filename))
93
+ return {};
94
+ const judge = (node) => {
95
+ if (!decoratorOf(node, new Set(["Entity"])))
96
+ return;
97
+ const entity = node.id?.name ?? "the entity";
98
+ const properties = node.body.body.filter((member) => member.type === "PropertyDefinition");
99
+ const timestamps = properties.flatMap((member) => {
100
+ const column = timestampColumnOf(member);
101
+ return column === undefined ? [] : [{ member, column }];
102
+ });
103
+ const both = new Set(timestamps.map((entry) => entry.column)).size === Object.keys(TIMESTAMPS).length;
104
+ const keys = both ? properties.filter(isGeneratedUuid) : [];
105
+ const base = keys.length > 0 ? UUID_BASE_ENTITY : BASE_ENTITY;
106
+ for (const { member, column } of timestamps)
107
+ context.report({ node: member, messageId: "timestamp", data: { entity, column, base } });
108
+ for (const member of keys)
109
+ context.report({ node: member, messageId: "key", data: { entity } });
110
+ };
111
+ return { ClassDeclaration: judge, ClassExpression: judge };
112
+ },
113
+ };
114
+ /** The rules of the entity-base law, by name. */
115
+ export const rules = { "entity-extends-base": entityExtendsBase };
116
+ /** On at error; both editions. */
117
+ export const recommended = { "starci-be/entity-extends-base": "error" };
package/dist/index.d.ts CHANGED
@@ -52,3 +52,7 @@ export declare const starciBeConfig: ({ hfs }: {
52
52
  }) => Promise<TSESLint.FlatConfig.ConfigArray>;
53
53
  export { linterOptions } from "./lib/config.js";
54
54
  export { loadHfs } from "./lib/hfs.js";
55
+ export { crossFileInputs } from "./lib/cross-file-inputs.js";
56
+ export type { CrossFileInput } from "./lib/cross-file-inputs.js";
57
+ export { projectGraph } from "./project-graph.js";
58
+ export type { ProjectGraphFinding, ProjectGraphSnapshot } from "./project-graph.js";
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ import { pluginForEdition } from "./lib/edition.js";
21
21
  import { recommended as aiGatewayRecommended, rules as aiGatewayRules } from "./ai-gateway.js";
22
22
  import { recommended as authPassportRecommended, rules as authPassportRules } from "./auth-passport.js";
23
23
  import { recommended as noRawSqlRecommended, rules as noRawSqlRules } from "./no-raw-sql.js";
24
+ import { recommended as entityBaseRecommended, rules as entityBaseRules } from "./entity-base.js";
24
25
  import { recommended as eventBusLiteRecommended, rules as eventBusLiteRules } from "./event-bus-lite.js";
25
26
  import { recommended as jobsSchedulerRecommended, rules as jobsSchedulerRules } from "./jobs-scheduler.js";
26
27
  import { recommended as ambientIdRecommended, rules as ambientIdRules } from "./ambient-id.js";
@@ -80,6 +81,7 @@ const CONTRIBUTIONS = [
80
81
  { law: "ai-gateway", rules: aiGatewayRules, recommended: aiGatewayRecommended },
81
82
  { law: "auth-passport", rules: authPassportRules, recommended: authPassportRecommended },
82
83
  { law: "no-raw-sql", rules: noRawSqlRules, recommended: noRawSqlRecommended },
84
+ { law: "entity-base", rules: entityBaseRules, recommended: entityBaseRecommended },
83
85
  { law: "event-bus-lite", rules: eventBusLiteRules, recommended: eventBusLiteRecommended },
84
86
  { law: "jobs-scheduler", rules: jobsSchedulerRules, recommended: jobsSchedulerRecommended },
85
87
  { law: "ambient-id", rules: ambientIdRules, recommended: ambientIdRecommended },
@@ -216,3 +218,6 @@ for (const entry of [
216
218
  Object.assign(rules, entry.rules);
217
219
  Object.assign(recommended, entry.recommended);
218
220
  }
221
+ // The result cache of `starci app lint` (contexts/project/check-cache.md) reads these two declarations of the installed canon.
222
+ export { crossFileInputs } from "./lib/cross-file-inputs.js";
223
+ export { projectGraph } from "./project-graph.js";
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The files a rule of this canon reads that ESLint's own import graph does not carry.
3
+ *
4
+ * The result cache of `starci app lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
5
+ * changed. A rule that reads another file by path, with `fs` (a sibling, a directory listing, a manifest, a module file it follows by hand),
6
+ * has an input the import graph cannot see, so the rule declares it here and the cache dirties the files that depend on it:
7
+ *
8
+ * - `content`: the rule reads the bytes of the files the globs match; a changed, added or removed match dirties the dependants.
9
+ * - `exists`: the rule only asks whether a file is there or lists a folder; an added or removed match dirties the dependants.
10
+ * - `git`: the rule compares the file with git history (the merge-base with the base branch), which no file holds; a change of the merge-base
11
+ * dirties every dependant of more than `minLines` lines (the rule reads history only for a file over its size budget). `globs` is empty.
12
+ *
13
+ * `globs` are relative to the linted file's folder (`relativeTo: "file"`) or to the side root, the folder of the side's `eslint.config.mjs`
14
+ * (`relativeTo: "side"`); they use `*`, `**`, `?` and `{a,b}`, posix separators. `appliesTo` are side-root globs of the linted files that
15
+ * depend on the input. A declaration may be wider than the read, never narrower: a too wide one costs a lint, a too narrow one a wrong answer.
16
+ * `cross-file-inputs.spec.ts` proves the list complete: every source file that reads the disk is named here or accounted for, and a recorder of
17
+ * file reads checks each rule's real reads against these declarations and the import graph.
18
+ */
19
+ /** One input of a rule that the import graph does not carry. */
20
+ export interface CrossFileInput {
21
+ /** The published rule name (without the plugin prefix). */
22
+ readonly rule: string;
23
+ readonly kind: "content" | "exists" | "git";
24
+ readonly relativeTo: "file" | "side";
25
+ readonly globs: readonly string[];
26
+ /** For `git`: the line count above which the rule reads history; a file of fewer lines does not depend on it. */
27
+ readonly minLines?: number;
28
+ /** The linted files (side-root globs) whose result depends on the input. */
29
+ readonly appliesTo: readonly string[];
30
+ /** The source file of this package (relative to `src/`) that performs the read; the audit checks it exists and that no reader is missing. */
31
+ readonly reader: string;
32
+ }
33
+ /** The line count above which `file-size-growth` reads history: the soft budget of the shipped manifest (500) is never lower than this. */
34
+ export declare const HISTORY_MIN_LINES = 400;
35
+ /** Every disk read of this canon's rules beyond the import graph. */
36
+ export declare const crossFileInputs: readonly CrossFileInput[];
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The files a rule of this canon reads that ESLint's own import graph does not carry.
3
+ *
4
+ * The result cache of `starci app lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
5
+ * changed. A rule that reads another file by path, with `fs` (a sibling, a directory listing, a manifest, a module file it follows by hand),
6
+ * has an input the import graph cannot see, so the rule declares it here and the cache dirties the files that depend on it:
7
+ *
8
+ * - `content`: the rule reads the bytes of the files the globs match; a changed, added or removed match dirties the dependants.
9
+ * - `exists`: the rule only asks whether a file is there or lists a folder; an added or removed match dirties the dependants.
10
+ * - `git`: the rule compares the file with git history (the merge-base with the base branch), which no file holds; a change of the merge-base
11
+ * dirties every dependant of more than `minLines` lines (the rule reads history only for a file over its size budget). `globs` is empty.
12
+ *
13
+ * `globs` are relative to the linted file's folder (`relativeTo: "file"`) or to the side root, the folder of the side's `eslint.config.mjs`
14
+ * (`relativeTo: "side"`); they use `*`, `**`, `?` and `{a,b}`, posix separators. `appliesTo` are side-root globs of the linted files that
15
+ * depend on the input. A declaration may be wider than the read, never narrower: a too wide one costs a lint, a too narrow one a wrong answer.
16
+ * `cross-file-inputs.spec.ts` proves the list complete: every source file that reads the disk is named here or accounted for, and a recorder of
17
+ * file reads checks each rule's real reads against these declarations and the import graph.
18
+ */
19
+ /** The line count above which `file-size-growth` reads history: the soft budget of the shipped manifest (500) is never lower than this. */
20
+ export const HISTORY_MIN_LINES = 400;
21
+ const SOURCE = "{ts,tsx,mts,cts,js,jsx,mjs,cjs}";
22
+ /** Every disk read of this canon's rules beyond the import graph. */
23
+ export const crossFileInputs = [
24
+ // readiness: follows the module files of the controller's folders up to the side root, and the local imports of those by hand
25
+ { rule: "ready-real", kind: "content", relativeTo: "side", globs: ["**/*.ts"], appliesTo: ["**/transport/http/**/*.ts"], reader: "health-ready.ts" },
26
+ { rule: "ready-real", kind: "exists", relativeTo: "side", globs: ["**/*"], appliesTo: ["**/transport/http/**/*.ts"], reader: "health-ready.ts" },
27
+ { rule: "health-signals", kind: "content", relativeTo: "side", globs: ["**/*.ts"], appliesTo: ["**/main.ts"], reader: "health-ready.ts" },
28
+ { rule: "health-signals", kind: "exists", relativeTo: "side", globs: ["**/*"], appliesTo: ["**/main.ts"], reader: "health-ready.ts" },
29
+ // a unit spec reads its sibling subject (value schema, value-object classes)
30
+ { rule: "spec-builds-with-testing-module", kind: "content", relativeTo: "file", globs: ["*.ts"], appliesTo: ["**/*.spec.ts"], reader: "lib/schema-values.ts" },
31
+ { rule: "spec-builds-with-testing-module", kind: "content", relativeTo: "file", globs: ["*.ts"], appliesTo: ["**/*.spec.ts"], reader: "lib/subject-values.ts" },
32
+ { rule: "spec-no-new-subject", kind: "content", relativeTo: "file", globs: ["*.ts"], appliesTo: ["**/*.spec.ts"], reader: "lib/subject-values.ts" },
33
+ // a spec and its subject must sit side by side
34
+ { rule: "unit-test-colocated", kind: "exists", relativeTo: "file", globs: ["*.ts"], appliesTo: ["**/*.ts"], reader: "testing.ts" },
35
+ // a module has a sibling definition and options file
36
+ { rule: "module-definition-required", kind: "exists", relativeTo: "file", globs: ["*.module-definition.ts", "*.options.ts"], appliesTo: ["**/*.module.ts"], reader: "module-shape.ts" },
37
+ // the dependency manifest (the app's, one level above be/); the SDK imports of every integration owner are read only to judge an integration file
38
+ { rule: "third-party-import-owner", kind: "content", relativeTo: "side", globs: ["package.json", "../package.json"], appliesTo: [`**/*.${SOURCE}`], reader: "third-party-owner.ts" },
39
+ { rule: "third-party-import-owner", kind: "content", relativeTo: "side", globs: [`**/*.${SOURCE}`], appliesTo: [`**/modules/integrations/**/*.${SOURCE}`], reader: "third-party-owner.ts" },
40
+ // an over-budget file is compared with its size at the merge-base with the base branch
41
+ { rule: "file-size-growth", kind: "git", relativeTo: "side", globs: [], minLines: HISTORY_MIN_LINES, appliesTo: [`**/*.${SOURCE}`], reader: "size-budget.ts" },
42
+ ];
@@ -7,3 +7,30 @@ export declare const rules: {
7
7
  export declare const recommended: {
8
8
  [k: string]: "error";
9
9
  };
10
+ /** One finding of the project graph on a file, as the rule of its enforcer reports it. Lines and columns count from 1, the way the machine names them. */
11
+ export interface ProjectGraphFinding {
12
+ readonly rule: string;
13
+ readonly code: string;
14
+ readonly line: number;
15
+ readonly column: number;
16
+ readonly message: string;
17
+ }
18
+ /** The project-graph findings of one side, by side-relative posix path, each list sorted by line, column, code and message. */
19
+ export interface ProjectGraphSnapshot {
20
+ readonly files: number;
21
+ readonly byFile: Readonly<Record<string, readonly ProjectGraphFinding[]>>;
22
+ }
23
+ /**
24
+ * The findings every project-graph rule of this canon reports, per file, from one fresh build of the side's graph.
25
+ *
26
+ * The result cache of `starci app lint` calls this once for a side whose files changed and compares each file's findings with the recorded
27
+ * ones: a file whose graph findings differ is linted again by ESLint itself, so ESLint stays the only emitter of each message. It is the very
28
+ * graph the rules read (same machine, same manifest, same filter), never a second judge.
29
+ *
30
+ * @param input - The side folder (`repoRoot`, the folder of the side's `eslint.config.mjs`); `injectedTypeScript` is for hermetic fixtures only.
31
+ * @returns The findings of the rules of `recommended`, keyed by path relative to the side folder.
32
+ */
33
+ export declare const projectGraph: ({ repoRoot, injectedTypeScript }: {
34
+ repoRoot: string;
35
+ injectedTypeScript?: object;
36
+ }) => ProjectGraphSnapshot;
@@ -7,7 +7,8 @@
7
7
  * rules and their codes is `LINT_ENFORCERS` of the machine (scripts/hfs/architecture/surface.mjs); `starci app check` keeps the
8
8
  * findings that have no TypeScript file to sit on. A graph that cannot be built stops the run with the machine's message.
9
9
  */
10
- import { LINT_ENFORCERS } from "../runtime/scripts/hfs/architecture/surface.mjs";
10
+ import { LINT_ENFORCERS, belongsTo, codeOf } from "../runtime/scripts/hfs/architecture/surface.mjs";
11
+ import { projectGraph as buildProjectGraph, resetProjectGraphs } from "../runtime/scripts/hfs/project-graph.mjs";
11
12
  import { projectRule } from "../runtime/scripts/hfs/project-rule.mjs";
12
13
  import { hfsOf } from "./lib/hfs.js";
13
14
  import { RUNTIME_ROOT } from "./lib/runtime-root.js";
@@ -19,3 +20,31 @@ export const rules = Object.fromEntries(mine.map((enforcer) => [
19
20
  ]));
20
21
  /** Every one at error. */
21
22
  export const recommended = Object.fromEntries(mine.map((e) => [`starci-be/${e.id}`, "error"]));
23
+ /**
24
+ * The findings every project-graph rule of this canon reports, per file, from one fresh build of the side's graph.
25
+ *
26
+ * The result cache of `starci app lint` calls this once for a side whose files changed and compares each file's findings with the recorded
27
+ * ones: a file whose graph findings differ is linted again by ESLint itself, so ESLint stays the only emitter of each message. It is the very
28
+ * graph the rules read (same machine, same manifest, same filter), never a second judge.
29
+ *
30
+ * @param input - The side folder (`repoRoot`, the folder of the side's `eslint.config.mjs`); `injectedTypeScript` is for hermetic fixtures only.
31
+ * @returns The findings of the rules of `recommended`, keyed by path relative to the side folder.
32
+ */
33
+ export const projectGraph = ({ repoRoot, injectedTypeScript }) => {
34
+ resetProjectGraphs();
35
+ const graph = buildProjectGraph({ repoRoot, ...(injectedTypeScript === undefined ? {} : { injectedTypeScript }), runtimeRoot: RUNTIME_ROOT });
36
+ const byFile = {};
37
+ for (const [file, findings] of graph.byFile) {
38
+ for (const finding of findings) {
39
+ for (const enforcer of mine.filter((entry) => belongsTo(entry, finding))) {
40
+ const line = finding.line !== undefined && Number.isInteger(finding.line) && finding.line >= 1 ? finding.line : 1;
41
+ const column = finding.column !== undefined && Number.isInteger(finding.column) && finding.column >= 1 ? finding.column : 1;
42
+ (byFile[file] ??= []).push({ rule: `starci-be/${enforcer.id}`, code: String(codeOf(finding)), line, column, message: String(finding.message) });
43
+ }
44
+ }
45
+ }
46
+ const order = (a, b) => a.line - b.line || a.column - b.column || a.code.localeCompare(b.code) || a.message.localeCompare(b.message);
47
+ for (const list of Object.values(byFile))
48
+ list.sort(order);
49
+ return { files: graph.files, byFile };
50
+ };
@@ -24,7 +24,9 @@ const FRAMEWORK = new Set([
24
24
  "@as-integrations/express5", "express", "nest-commander", "typeorm",
25
25
  ]);
26
26
  const TEST_LIBRARIES = new Set(["@nestjs/testing", "@starci/jest-preset", "@starci/test-world", "@jest/globals", "jest", "jest-mock"]);
27
- const INVENTORIES = new WeakMap();
27
+ const DEPENDENCIES = new WeakMap();
28
+ /** The module references of each integration file; read only when an integration file is judged. */
29
+ const INTEGRATIONS = new WeakMap();
28
30
  const SOURCE = /\.[cm]?[jt]sx?$/;
29
31
  const GENERATED = new Set(["node_modules", "dist", "coverage", ".git"]);
30
32
  /** The package root of a bare module specifier, including a scoped package's subpaths. */
@@ -60,11 +62,11 @@ const referencesOf = (file, text) => {
60
62
  return found;
61
63
  };
62
64
  /**
63
- * The app's dependency declarations and the SDK imports of all integration owners, read once for this HFS view.
65
+ * The app's dependency declarations, read once for this HFS view.
64
66
  * No ancestor search: be/ has the app-root package.json immediately above it; standalone fixtures may put it at root.
65
67
  */
66
- const inventoryOf = (hfs) => {
67
- const cached = INVENTORIES.get(hfs);
68
+ const dependenciesOf = (hfs) => {
69
+ const cached = DEPENDENCIES.get(hfs);
68
70
  if (cached)
69
71
  return cached;
70
72
  const appManifest = join(dirname(hfs.repoRoot), "package.json");
@@ -82,6 +84,17 @@ const inventoryOf = (hfs) => {
82
84
  dependencies.set(name, alias?.[1] ?? name);
83
85
  }
84
86
  }
87
+ DEPENDENCIES.set(hfs, dependencies);
88
+ return dependencies;
89
+ };
90
+ /**
91
+ * The SDK imports of all integration owners, read once for this HFS view. Only a file of an integration owner needs them (to see whether
92
+ * another owner imports the same SDK), so every other file is judged without walking the tree.
93
+ */
94
+ const integrationsOf = (hfs) => {
95
+ const cached = INTEGRATIONS.get(hfs);
96
+ if (cached)
97
+ return cached;
85
98
  const byFile = new Map();
86
99
  const walk = (directory) => {
87
100
  for (const entry of readdirSync(directory, { withFileTypes: true })) {
@@ -95,9 +108,8 @@ const inventoryOf = (hfs) => {
95
108
  }
96
109
  };
97
110
  walk(hfs.repoRoot);
98
- const result = { dependencies, byFile };
99
- INVENTORIES.set(hfs, result);
100
- return result;
111
+ INTEGRATIONS.set(hfs, byFile);
112
+ return byFile;
101
113
  };
102
114
  /** The table already owns this import (including a package subpath); R90 alone judges it. */
103
115
  const inInfraTable = (hfs, specifier) => Object.keys(hfs.ruleParams.infraOwners).some((key) => specifier === key || specifier.startsWith(`${key}/`));
@@ -130,13 +142,11 @@ export const thirdPartyImportOwner = {
130
142
  const file = context.filename;
131
143
  if (!inSource(hfs, file))
132
144
  return {};
133
- let inventory;
134
145
  return moduleReferences(({ source, value }) => {
135
146
  // Relative paths, node builtins and the infrastructure table need no dependency manifest.
136
147
  if (packageOf(value) === null || inInfraTable(hfs, value))
137
148
  return;
138
- inventory ??= inventoryOf(hfs);
139
- const { dependencies, byFile } = inventory;
149
+ const dependencies = dependenciesOf(hfs);
140
150
  const sdk = sdkOf(hfs, dependencies, file, value);
141
151
  if (sdk === null)
142
152
  return;
@@ -146,7 +156,7 @@ export const thirdPartyImportOwner = {
146
156
  return;
147
157
  }
148
158
  const owners = new Set([here]);
149
- for (const [other, references] of byFile) {
159
+ for (const [other, references] of integrationsOf(hfs)) {
150
160
  // ESLint's current buffer replaces the on-disk text of this file.
151
161
  if (other === resolve(file))
152
162
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-canon-be",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
4
4
  "description": "The StarCi back-end lint canon: every rule its laws publish, gathered as one flat-config plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -50,7 +50,7 @@
50
50
  "build": "node -e \"require('node:fs').rmSync('dist', {recursive: true, force: true})\" && tsc -p tsconfig.build.json && node -e \"const fs = require('node:fs'); for (const f of fs.readdirSync('dist', {recursive: true}).filter((n) => n.endsWith('.d.ts'))) fs.writeFileSync('dist/' + f, fs.readFileSync('dist/' + f, 'utf8').replace(/((?:from |import\\()['\\x22]\\.\\.?\\/[^'\\x22]+)\\.ts(['\\x22])/g, (all, head, quote) => head + '.js' + quote))\"",
51
51
  "typecheck": "tsc -p tsconfig.json",
52
52
  "prepack": "npm run build",
53
- "test": "npm run typecheck && node --test \"src/**/*.spec.ts\""
53
+ "test": "npm run typecheck && node --import ./fixtures/fs-audit-preload.ts --test \"src/**/*.spec.ts\""
54
54
  },
55
55
  "keywords": [
56
56
  "eslint",
@@ -32,6 +32,7 @@
32
32
  "scripts/api/git/remote.mjs",
33
33
  "scripts/api/git/rev-parse-query.mjs",
34
34
  "scripts/api/git/show.mjs",
35
+ "scripts/api/git/tag.mjs",
35
36
  "scripts/hfs/allows.mjs",
36
37
  "scripts/hfs/architecture/ast-walks.mjs",
37
38
  "scripts/hfs/architecture/automatic-gates.mjs",
@@ -31,42 +31,42 @@ pins:
31
31
  source: packages/event-stream/package.json
32
32
  why: 'the one server-sent-events client of every front end (fe-stack event-stream, owner:event-stream-package): the transport client layer (modules/api/sse/clients) creates one instance for the app with the bearer token source and the stream operations follow on it; it carries Last-Event-ID resume, the capped doubling backoff, the heartbeat timeout, the single 401 renewal and the useSWRSubscription adapter, so no app keeps a hand-written reader.'
33
33
  '@starci/grammar':
34
- version: 0.16.2
34
+ version: 0.16.3
35
35
  group: starci
36
36
  install: registry
37
37
  side: fe
38
38
  source: packages/grammar/package.json
39
39
  why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind, the copyable and read-only Input, the IconButton disclosure props and count badge, ChatBubble, FillViewport, Textarea mentions and Enter-to-send, the leading PrimaryRailLayout rail, the plate-less Image, ListRow, the soft Alert, Progress steps, the floating primary IconButton, FlowGraph, the STATE-8 loading views and the bordered selectable TagGroup chips. The runtime source version wins for a @starci package.'
40
40
  '@starci/eslint-canon-be':
41
- version: 3.9.2
41
+ version: 3.9.3
42
42
  group: starci
43
43
  install: registry
44
44
  side: be
45
45
  source: packages/eslint-canon-be/package.json
46
46
  why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
47
47
  '@starci/eslint-canon-fe':
48
- version: 9.6.2
48
+ version: 9.6.3
49
49
  group: starci
50
50
  install: registry
51
51
  side: fe
52
52
  source: packages/eslint-canon-fe/package.json
53
53
  why: 'the front-end ESLint canon: `loadHfs(import.meta.url)` of fe/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the fe side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; the front end has no tests (FE_NO_TESTS R97 in hfs) and no-vietnamese-in-source (R91) applies.'
54
54
  '@starci/eslint-grammar-core':
55
- version: 0.16.2
55
+ version: 0.16.3
56
56
  group: starci
57
57
  install: registry
58
58
  side: fe
59
59
  source: packages/eslint-grammar-core/package.json
60
60
  why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
61
61
  '@starci/eslint-grammar-offset-pop':
62
- version: 0.16.2
62
+ version: 0.16.3
63
63
  group: starci
64
64
  install: registry
65
65
  side: fe
66
66
  source: packages/eslint-grammar-offset-pop/package.json
67
67
  why: 'the Offset Pop Grammar component API lint, versioned with @starci/grammar; its shared component contract comes from the StarCi family lint without copying rules.'
68
68
  '@starci/stylelint-canon':
69
- version: 2.2.1
69
+ version: 2.3.0
70
70
  group: starci
71
71
  install: registry
72
72
  side: fe
@@ -85,7 +85,7 @@ pins:
85
85
  side: both
86
86
  source: packages/prettier-config/package.json
87
87
  '@starci/jest-preset':
88
- version: 2.5.3
88
+ version: 2.6.0
89
89
  group: starci
90
90
  install: registry
91
91
  side: be
@@ -106,7 +106,7 @@ pins:
106
106
  source: packages/ai-router/package.json
107
107
  why: 'the AI pool router of a back end: a NestJS module that routes OpenAI-compatible chat, stream and embeddings calls across keys, models and providers, with @starci/ai-router/testing for its specs; @starci/jest-preset compiles it as an ESM-only dependency.'
108
108
  '@starci/hfs':
109
- version: 4.12.2
109
+ version: 4.13.0
110
110
  group: starci
111
111
  install: registry
112
112
  side: both
@@ -5890,3 +5890,26 @@ rules:
5890
5890
  - {path: packages/eslint-canon-be/src/event-bus-lite.spec.ts, edition: lite, codes: [BE_EVENT_BUS_LITE_SHAPE]}
5891
5891
  witness:
5892
5892
  - {path: packages/eslint-canon-be/src/event-bus-lite.spec.ts, edition: lite, codes: [BE_EVENT_BUS_LITE_SHAPE]}
5893
+ - id: R342
5894
+ code: "BE_ENTITY_EXTENDS_BASE"
5895
+ law: "An @Entity class does not repeat the columns every table shares: a database-set created_at or updated_at (CreateDateColumn, UpdateDateColumn, or a Column on those names, or on createdAt / updatedAt, with insert false, update false or a default) and, beside both, the generated uuid id are inherited from AbstractEntity or UuidAbstractEntity of @modules/platform/database (BE-PERSISTENCE-3, ruling entity-base). The finding names the base to extend: UuidAbstractEntity with the uuid key, AbstractEntity without it. A table whose timestamps the application sets (a plain Column), or that lacks one of them, extends nothing and maps its own; the base file platform/database/abstract.entity.ts is exempt."
5896
+ kinds: [lint]
5897
+ gates: [pre-commit, settle, land, ci]
5898
+ failureCodes: ["BE_ENTITY_EXTENDS_BASE"]
5899
+ enforcers:
5900
+ - {kind: eslint-be, id: entity-extends-base}
5901
+ editions: [lite, full]
5902
+ docs: [contexts/code/be/persistence.md]
5903
+ proves:
5904
+ - packages/eslint-canon-be/src/entity-base.spec.ts
5905
+ exemplifiedBy:
5906
+ - {path: packages/hfs/templates/be/table/entity.ts.tpl, editions: [lite, full]}
5907
+ - {path: packages/eslint-canon-be/src/entity-base.spec.ts, editions: [lite, full], codes: [BE_ENTITY_EXTENDS_BASE]}
5908
+ witness:
5909
+ - {path: packages/eslint-canon-be/src/entity-base.spec.ts, editions: [lite, full], codes: [BE_ENTITY_EXTENDS_BASE]}
5910
+ cases:
5911
+ - id: case-1
5912
+ date: "2026-10-31"
5913
+ source: owner
5914
+ quote: "Entities do not repeat the columns every table shares; the owner approved a lint so they never repeat them again (ruling entity-base, 2026-10-31)."
5915
+ ruling: "A table whose migration has created_at, updated_at (set by the database) and the generated uuid id maps them by extending AbstractEntity or UuidAbstractEntity from @modules/platform/database; an entity that declares them itself is a finding. A table without them extends nothing."
@@ -0,0 +1,4 @@
1
+ // tag.mjs — `git tag <args>`: list or create tags (--points-at <rev>, -l <pattern>, -a <name> -m <message>).
2
+ import { runGit } from './lib.mjs';
3
+ /** The spawn result {status, stdout, stderr, error} of `git tag ...args`; options are runGit's (cwd or dir, config, timeout, maxBuffer, input, encoding, env, git). */
4
+ export const tag = (args = [], options = {}) => runGit(['tag', ...args], options);
@@ -3,6 +3,7 @@
3
3
  import { lsTree } from '../../api/git/ls-tree.mjs';
4
4
  import { mergeBase } from '../../api/git/merge-base.mjs';
5
5
  import { show } from '../../api/git/show.mjs';
6
+ import { tag } from '../../api/git/tag.mjs';
6
7
  import { withoutGitLocalEnv } from '../../lib/git.mjs';
7
8
  import { eachInOrder, findInOrder } from '../../lib/in-order.mjs';
8
9
  import { sameText } from '../../lib/same-text.mjs';
@@ -37,12 +38,21 @@ export function defaultGit(args, { cwd }) {
37
38
  const sha = mergeBase(cwd, rest[0], rest[1]);
38
39
  return { ok: sha !== null, stdout: sha ?? '' };
39
40
  }
41
+ if (verb === 'previous-release')
42
+ return previousReleaseTag(cwd, env, rest[0]);
40
43
  let call = show;
41
44
  if (verb === 'ls-tree')
42
45
  call = lsTree;
43
46
  const result = call(rest, { cwd, env, maxBuffer: 64 * 1024 * 1024 });
44
47
  return { ok: !result.error && result.status === 0, stdout: result.stdout };
45
48
  }
49
+ /** The nearest release tag before HEAD: the newest version among the tags HEAD contains that do not point at HEAD itself. `pattern` is a tag glob (v*). */
50
+ function previousReleaseTag(cwd, env, pattern) {
51
+ const listed = (args) => { const result = tag(args, { cwd, env }); return !result.error && result.status === 0 ? String(result.stdout).split(/\r?\n/).map((line) => line.trim()).filter(Boolean) : []; };
52
+ const here = new Set(listed(['--points-at', 'HEAD']));
53
+ const previous = listed(['--merged', 'HEAD', '--list', pattern, '--sort=-v:refname']).find((name) => !here.has(name));
54
+ return { ok: previous !== undefined, stdout: previous ?? '' };
55
+ }
46
56
  const runGit = (git, repoRoot, args) => Promise.resolve(git(args, { cwd: repoRoot }))
47
57
  .then((result) => ({ ok: result?.ok === true, stdout: String(result?.stdout ?? '') }));
48
58
  async function baseShaOf(git, repoRoot, base) {
@@ -515,6 +525,51 @@ function destructiveFileFindings(file, text, references) {
515
525
  return finding ? [finding] : [];
516
526
  });
517
527
  }
528
+ const BE_SQL_SOURCE = /^be\/src\/.+\.(?:sql|entity)\.[cm]?tsx?$/;
529
+ /** The tag glob of a release (release.tagPrefix defaults to v). */
530
+ const RELEASE_TAG_GLOB = 'v*';
531
+ /**
532
+ * A contract migration must not ship in the same release as the code change it depends on (cicd.md, Database migrations). The deploy applies
533
+ * a contract migration right after the accept, while the release it replaced is still the rollback target: if that release's code still names
534
+ * the destroyed object, a rollback after the contract would run code against a schema that no longer has it. The check judges exactly that
535
+ * with git: each contract migration that is new since the previous release tag (absent there) is read for the objects it destroys, and the
536
+ * be/src sources AS THEY WERE AT THE PREVIOUS RELEASE TAG must not reference them (the sources at HEAD are judged by destructiveMigrationFindings).
537
+ * The first release, a repository without a release tag, or an unreadable git history has no previous release and no finding. It reports
538
+ * DB_MIGRATION_DESTRUCTIVE (R259), a hard blocker: ship the code change in one release and its contract migration in the next.
539
+ */
540
+ export async function contractReleaseFindings({ repoRoot, migrations, git }) {
541
+ const contracts = migrations.filter((file) => /_contract_[a-z0-9]+(?:[-_][a-z0-9]+)*\.sql$/.test(file));
542
+ if (!contracts.length)
543
+ return [];
544
+ const previous = await runGit(git, repoRoot, ['previous-release', RELEASE_TAG_GLOB]);
545
+ const release = previous.stdout.trim();
546
+ if (!previous.ok || !release)
547
+ return [];
548
+ const known = new Set(await migrationFilesAt(git, repoRoot, release));
549
+ const fresh = contracts.filter((file) => !known.has(file));
550
+ if (!fresh.length)
551
+ return [];
552
+ const listing = await runGit(git, repoRoot, ['ls-tree', '-r', '--name-only', '-z', release, '--', 'be/src']);
553
+ const sources = listing.ok ? listing.stdout.split('\0').filter((file) => BE_SQL_SOURCE.test(file)) : [];
554
+ if (!sources.length)
555
+ return [];
556
+ const ts = loadTypescript(repoRoot, HERE);
557
+ if (!ts)
558
+ return [found(DB_MIGRATION_DESTRUCTIVE, 'hfs.json', 'the contract-release check requires the TypeScript parser to read the be/src references of the previous release')];
559
+ const references = [];
560
+ await eachInOrder(sources, async (file) => {
561
+ references.push({ file, scopes: sourceNameScopes(ts, await baseFileText(git, repoRoot, release, file) ?? '', file) });
562
+ });
563
+ return fresh.flatMap((file) => {
564
+ const text = readText(repoRoot, file);
565
+ if (text === null)
566
+ return [];
567
+ return databaseSqlStatements(databaseExecutableTokens(text)).flatMap(destructiveObjects).flatMap((object) => {
568
+ const reference = references.find(({ scopes }) => referencesObject(scopes, object));
569
+ return reference ? [found(DB_MIGRATION_DESTRUCTIVE, file, `${file}:${object.line} destroys ${object.name}, which the previous release ${release} still references in ${reference.file}; the contract migration runs right after the accept while that release is the rollback target: ship the code change in one release and this contract migration in the next`, { line: object.line, object: object.name, release, reference: reference.file })] : [];
570
+ });
571
+ });
572
+ }
518
573
  /** Destructive changes require a contract migration and no remaining SQL/entity reference in be/src. */
519
574
  export function destructiveMigrationFindings({ repoRoot, migrations, files }) {
520
575
  const sources = files.filter((file) => /^be\/src\/.+\.(?:sql|entity)\.[cm]?tsx?$/.test(file));