@starci/eslint-canon-be 3.8.12 → 3.8.14
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 +9 -0
- package/dist/idempotency.js +17 -29
- package/dist/lib/ports.d.ts +17 -0
- package/dist/lib/ports.js +39 -0
- package/dist/lib/webhook-handoff-inbox.js +9 -14
- package/dist/lib/webhook-handoff-intake.js +2 -2
- package/package.json +1 -1
- package/runtime/knowledge/hfs/canon-pins.yaml +7 -7
- package/runtime/knowledge/hfs/rules.yaml +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.8.14 - 2026-10-29
|
|
4
|
+
|
|
5
|
+
- Changed: `inbox-dedupe-required` (R80) and `webhook-inbox-key` (R263) accept `claimRow(source, eventId, tx, receipt)` on the `EntityInbox` port of `platform/inbox` (and `claim` on an `EntityInbox`-typed receiver) as a delivery method's first await, with the same guarantees as `claim`: the real port by its owner (a lookalike is refused), the first await (R263: the first statement, keyed by the delivery id, with the transaction callback's own manager), and the return on a repeat, which for `claimRow` is the receipt id answering `undefined` (`!receiptId` or `receiptId === undefined`, inline or stored and tested straight after). A stored answer is compared by binding in either operand. The R263 receipt-port check also admits an `EntityInbox` constructor parameter. Shared in `lib/ports.ts` (`isInboxPortType`, `inboxClaimOf`, `refusesRepeat`); the typed fixture's inbox port declares `EntityInbox`. Specs: `r80-inbox-dedupe-required.spec.ts` and `webhook-handoff-inbox.spec.ts` (valid claimRow intakes; claimRow not first, on a lookalike, keyed by a constant, with another manager, with too few arguments, without the return, or returning on `false`, refused). The bundled `rules.yaml` states both laws with `claimRow`.
|
|
6
|
+
- Changed: the bundled canon pins name hfs 4.11.15, eslint-canon-be 3.8.14, eslint-canon-fe 9.5.16, the Grammar family 0.15.27 and jest-preset 2.5.1.
|
|
7
|
+
|
|
8
|
+
## 3.8.13 - 2026-10-29
|
|
9
|
+
|
|
10
|
+
- Changed: the bundled canon pins name hfs 4.11.14, eslint-canon-be 3.8.13, eslint-canon-fe 9.5.15 and the Grammar family 0.15.26. No rule changed.
|
|
11
|
+
|
|
3
12
|
## 3.8.12 - 2026-10-29
|
|
4
13
|
|
|
5
14
|
- Changed: the bundled `runtime/scripts/lib/sops-envelope.mjs` admits an age set of one or more recipients for the selected-identity decrypt (`selectedAgeEnvelope`): the selected recipient must be one of the set, an empty entry or gap (`invalid-age-entry`) and a recipient named twice (`duplicate-age-recipient`) are refused, a dotenv envelope reads every `sops_age__list_<n>__` entry; the bundled canon pins name hfs 4.11.13, eslint-canon-be 3.8.12, eslint-canon-fe 9.5.14 and the Grammar family 0.15.25. No rule changed.
|
package/dist/idempotency.js
CHANGED
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
* if ((await this.inbox.claim(source, id)) === false) { return }
|
|
21
21
|
* const fresh = await this.inbox.claim(source, id)
|
|
22
22
|
* if (!fresh) return
|
|
23
|
+
* The `EntityInbox` extension of the port claims the same way with `claimRow(source, id, tx, receipt)`, which inserts the
|
|
24
|
+
* receipt row only for the winning claim and answers its id; a repeat answers undefined, so the return is on that:
|
|
25
|
+
* const receiptId = await this.inbox.claimRow(source, id, tx, { entity: ReceiptEntity, row })
|
|
26
|
+
* if (receiptId === undefined) return
|
|
23
27
|
* A transaction delivery returns or awaits one `.transaction(...)` as its sole statement, on a receiver typed as typeorm's
|
|
24
28
|
* `EntityManager` or as a port the `platform/database` owner declares; the callback's one parameter is typed `EntityManager`.
|
|
25
29
|
* Either the actual selected inline async callback claims with that manager in its first statement, then returns on false,
|
|
@@ -41,7 +45,7 @@
|
|
|
41
45
|
import ts from "typescript";
|
|
42
46
|
import { hfsOf } from "./lib/hfs.js";
|
|
43
47
|
import { keyName, walk } from "./lib/ast.js";
|
|
44
|
-
import { baseName,
|
|
48
|
+
import { baseName, inboxClaimOf, ownerNameOf, refusesRepeat } from "./lib/ports.js";
|
|
45
49
|
import { resolveVariable } from "./lib/transactions.js";
|
|
46
50
|
import { childNode, typeOrigins, typed } from "./lib/types.js";
|
|
47
51
|
import { mutationIdempotent } from "./lib/client-idempotency.js";
|
|
@@ -60,22 +64,11 @@ const valueParams = (member) => {
|
|
|
60
64
|
const value = member.value;
|
|
61
65
|
return value && "params" in value ? value.params : undefined;
|
|
62
66
|
};
|
|
63
|
-
/** The `Inbox` port of `platform/inbox`. */
|
|
64
|
-
const isInboxType = (context, node) => isOwnedType(context, node, { name: "Inbox", capability: "inbox", tier: "platform" });
|
|
65
67
|
/** A `return` statement, or a block that ends in one. */
|
|
66
68
|
const returns = (statement) => statement?.type === "ReturnStatement"
|
|
67
69
|
|| (statement?.type === "BlockStatement" && statement.body.at(-1)?.type === "ReturnStatement");
|
|
68
|
-
/**
|
|
69
|
-
const
|
|
70
|
-
if (test.type === "UnaryExpression" && test.operator === "!")
|
|
71
|
-
return test.argument === target || (test.argument.type === "Identifier" && target.type === "Identifier" && test.argument.name === target.name);
|
|
72
|
-
if (test.type === "BinaryExpression" && (test.operator === "===" || test.operator === "==")) {
|
|
73
|
-
const [left, right] = [test.left, test.right];
|
|
74
|
-
const isFalse = (node) => node.type === "Literal" && node.value === false;
|
|
75
|
-
return (left === target && isFalse(right)) || (right === target && isFalse(left));
|
|
76
|
-
}
|
|
77
|
-
return false;
|
|
78
|
-
};
|
|
70
|
+
/** The same identifier spelled twice: the stored claim answer read back by its test. */
|
|
71
|
+
const sameName = (left, right) => left.type === "Identifier" && right.type === "Identifier" && left.name === right.name;
|
|
79
72
|
/** Where the awaited claim sits: the statement that tests it, or the declaration that stores it followed by that test. */
|
|
80
73
|
/** The statements of the block or program a node holds as its `body` list, else null. */
|
|
81
74
|
const statementsOf = (node) => {
|
|
@@ -84,9 +77,11 @@ const statementsOf = (node) => {
|
|
|
84
77
|
const body = node.body;
|
|
85
78
|
return Array.isArray(body) ? body : null;
|
|
86
79
|
};
|
|
87
|
-
|
|
80
|
+
/** Whether the claim's repeat answer returns at once: `false` from `claim`, `undefined` (no receipt id) from `claimRow`. */
|
|
81
|
+
const returnsOnRepeat = (awaited, method) => {
|
|
88
82
|
const node = awaited;
|
|
89
83
|
const parent = node.parent;
|
|
84
|
+
const refusesOn = (test, target) => refusesRepeat(test, target, method, { same: sameName, loose: true });
|
|
90
85
|
if (parent.type === "UnaryExpression" || parent.type === "BinaryExpression") {
|
|
91
86
|
const statement = parent.parent;
|
|
92
87
|
return statement.type === "IfStatement" && statement.test === parent && refusesOn(parent, node) && returns(statement.consequent);
|
|
@@ -327,7 +322,7 @@ const claimedManagerPosition = (checker, signature) => {
|
|
|
327
322
|
visit(body);
|
|
328
323
|
const claim = found.awaited?.expression;
|
|
329
324
|
if (!claim || !ts.isCallExpression(claim) || !ts.isPropertyAccessExpression(claim.expression)
|
|
330
|
-
|| claim.expression.name.text
|
|
325
|
+
|| !["claim", "claimRow"].includes(claim.expression.name.text))
|
|
331
326
|
return -1;
|
|
332
327
|
const managerArgument = claim.arguments[2];
|
|
333
328
|
if (!managerArgument)
|
|
@@ -380,11 +375,11 @@ const inheritedDelivery = (context, method) => {
|
|
|
380
375
|
export const inboxDedupeRequired = {
|
|
381
376
|
meta: {
|
|
382
377
|
type: "problem",
|
|
383
|
-
docs: { description: "A public service method whose first parameter carries an `eventId` claims `(source, eventId)` on the `Inbox` port first and returns early
|
|
378
|
+
docs: { description: "A public service method whose first parameter carries an `eventId` claims `(source, eventId)` on the `Inbox` port first (`claim`, or `claimRow` on its `EntityInbox`) and returns early on a repeat: `false`, or no receipt id." },
|
|
384
379
|
schema: [],
|
|
385
380
|
messages: {
|
|
386
|
-
noClaim: "This delivery method's first awaited expression is not `claim(source, eventId)` on the `Inbox` port of `platform/inbox` (`@InjectInbox() private readonly inbox: Inbox`). A sender that gets no timely reply resends the same event: claim it before anything else so a repeat delivery is a no-op.",
|
|
387
|
-
noEarlyReturn: "This delivery method claims the event but does not return
|
|
381
|
+
noClaim: "This delivery method's first awaited expression is not `claim(source, eventId)` on the `Inbox` port of `platform/inbox` (`@InjectInbox() private readonly inbox: Inbox`), nor `claimRow(source, eventId, tx, receipt)` on its `EntityInbox` (`@InjectEntityInbox()`). A sender that gets no timely reply resends the same event: claim it before anything else so a repeat delivery is a no-op.",
|
|
382
|
+
noEarlyReturn: "This delivery method claims the event but does not return on a repeat. Write `if (!(await this.inbox.claim(source, eventId))) return` (or store the answer and return on `!fresh` straight after); with `claimRow`, store the receipt id and return on `receiptId === undefined` straight after, so a repeat does none of the work again.",
|
|
388
383
|
},
|
|
389
384
|
},
|
|
390
385
|
create(context) {
|
|
@@ -405,17 +400,10 @@ export const inboxDedupeRequired = {
|
|
|
405
400
|
if (![...inherited.managers].every((position) => helperClaim(context, node, params[position]) === awaited))
|
|
406
401
|
awaited = null;
|
|
407
402
|
}
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
&& call.callee.type === "MemberExpression"
|
|
411
|
-
&& !call.callee.computed
|
|
412
|
-
&& call.callee.property.type === "Identifier"
|
|
413
|
-
&& call.callee.property.name === "claim"
|
|
414
|
-
&& call.arguments.length >= 2
|
|
415
|
-
&& isInboxType(context, call.callee.object);
|
|
416
|
-
if (!claims)
|
|
403
|
+
const method = inboxClaimOf(context, awaited?.argument);
|
|
404
|
+
if (!awaited || !method)
|
|
417
405
|
context.report({ node: node.key, messageId: "noClaim" });
|
|
418
|
-
else if (!awaited
|
|
406
|
+
else if (!returnsOnRepeat(awaited, method))
|
|
419
407
|
context.report({ node: node.key, messageId: "noEarlyReturn" });
|
|
420
408
|
};
|
|
421
409
|
return {
|
package/dist/lib/ports.d.ts
CHANGED
|
@@ -68,3 +68,20 @@ export declare const enumMemberOf: (context: Context, node: Node) => {
|
|
|
68
68
|
* @returns {string | null} The package name.
|
|
69
69
|
*/
|
|
70
70
|
export declare const packageOfFile: (file: string) => string | null;
|
|
71
|
+
/** The receiver is typed as the `Inbox` port of `platform/inbox` or its `EntityInbox` extension, never a lookalike of another owner. */
|
|
72
|
+
export declare const isInboxPortType: (context: Context, node: Node) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The claim a call makes on an inbox port: `claim` (source, eventId[, tx]) answers whether the delivery is new; `claimRow`
|
|
75
|
+
* (source, eventId, tx, receipt) claims, then inserts the receipt row only for the winning claim and answers its id, undefined
|
|
76
|
+
* on a repeat. Null for any other call: a computed or optional member, another method, too few arguments or another receiver.
|
|
77
|
+
*/
|
|
78
|
+
export declare const inboxClaimOf: (context: Context, call: Node | null | undefined) => "claim" | "claimRow" | null;
|
|
79
|
+
/**
|
|
80
|
+
* Whether `test` refuses the repeat `target` answered (the awaited claim, or the binding holding it): `!target` for both claims,
|
|
81
|
+
* `target === false` for `claim`, `target === undefined` for `claimRow`; `loose` also admits `==`. `same` compares a stored
|
|
82
|
+
* answer by its binding.
|
|
83
|
+
*/
|
|
84
|
+
export declare const refusesRepeat: (test: Node | null | undefined, target: Node, method: "claim" | "claimRow", { same, loose }: {
|
|
85
|
+
same: (left: Node, right: Node) => boolean;
|
|
86
|
+
loose?: boolean;
|
|
87
|
+
}) => boolean;
|
package/dist/lib/ports.js
CHANGED
|
@@ -135,3 +135,42 @@ export const packageOfFile = (file) => {
|
|
|
135
135
|
const head = parts[0] ?? "";
|
|
136
136
|
return head.startsWith("@") ? `${head}/${parts[1]}` : head;
|
|
137
137
|
};
|
|
138
|
+
/** The ports `platform/inbox` declares a delivery claim on: `Inbox`, and `EntityInbox`, which extends it with `claimRow`. */
|
|
139
|
+
const INBOX_PORTS = ["Inbox", "EntityInbox"];
|
|
140
|
+
/** The receiver is typed as the `Inbox` port of `platform/inbox` or its `EntityInbox` extension, never a lookalike of another owner. */
|
|
141
|
+
export const isInboxPortType = (context, node) => INBOX_PORTS.some((name) => isOwnedType(context, node, { name, capability: "inbox", tier: "platform" }));
|
|
142
|
+
/**
|
|
143
|
+
* The claim a call makes on an inbox port: `claim` (source, eventId[, tx]) answers whether the delivery is new; `claimRow`
|
|
144
|
+
* (source, eventId, tx, receipt) claims, then inserts the receipt row only for the winning claim and answers its id, undefined
|
|
145
|
+
* on a repeat. Null for any other call: a computed or optional member, another method, too few arguments or another receiver.
|
|
146
|
+
*/
|
|
147
|
+
export const inboxClaimOf = (context, call) => {
|
|
148
|
+
if (call?.type !== "CallExpression" || call.optional)
|
|
149
|
+
return null;
|
|
150
|
+
const callee = call.callee;
|
|
151
|
+
if (callee.type !== "MemberExpression" || callee.computed || callee.optional || callee.property.type !== "Identifier")
|
|
152
|
+
return null;
|
|
153
|
+
const method = callee.property.name;
|
|
154
|
+
const arity = method === "claim" ? 2 : method === "claimRow" ? 4 : Number.POSITIVE_INFINITY;
|
|
155
|
+
if (call.arguments.length < arity || call.arguments.some((argument) => argument.type === "SpreadElement"))
|
|
156
|
+
return null;
|
|
157
|
+
return isInboxPortType(context, callee.object) ? (method === "claim" ? "claim" : "claimRow") : null;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Whether `test` refuses the repeat `target` answered (the awaited claim, or the binding holding it): `!target` for both claims,
|
|
161
|
+
* `target === false` for `claim`, `target === undefined` for `claimRow`; `loose` also admits `==`. `same` compares a stored
|
|
162
|
+
* answer by its binding.
|
|
163
|
+
*/
|
|
164
|
+
export const refusesRepeat = (test, target, method, { same, loose = false }) => {
|
|
165
|
+
if (!test)
|
|
166
|
+
return false;
|
|
167
|
+
if (test.type === "UnaryExpression" && test.operator === "!")
|
|
168
|
+
return test.argument === target || same(test.argument, target);
|
|
169
|
+
if (test.type !== "BinaryExpression" || !(test.operator === "===" || (loose && test.operator === "==")))
|
|
170
|
+
return false;
|
|
171
|
+
const repeat = (node) => method === "claim"
|
|
172
|
+
? node.type === "Literal" && node.value === false
|
|
173
|
+
: node.type === "Identifier" && node.name === "undefined";
|
|
174
|
+
const answer = (node) => node === target || same(node, target);
|
|
175
|
+
return (answer(test.left) && repeat(test.right)) || (answer(test.right) && repeat(test.left));
|
|
176
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
import { memberKeyValue, nameOrValue, walk } from "./ast.js";
|
|
4
4
|
import { hfsOf } from "./hfs.js";
|
|
5
|
-
import { baseName,
|
|
5
|
+
import { baseName, inboxClaimOf, ownerNameOf, refusesRepeat } from "./ports.js";
|
|
6
6
|
import { resolveVariable } from "./transactions.js";
|
|
7
7
|
import { isPackageType, typed } from "./types.js";
|
|
8
8
|
import { webhookIntakeProcessesDelivery } from "./webhook-handoff-intake.js";
|
|
@@ -212,12 +212,9 @@ const claimBody = (context, body) => {
|
|
|
212
212
|
return manager?.type === "Identifier" && isPackageType(context, manager, "EntityManager", "typeorm")
|
|
213
213
|
? { body: callback.body, manager } : { body, manager: null };
|
|
214
214
|
};
|
|
215
|
-
/** Match an immediate false
|
|
216
|
-
const rejectsDuplicate = (context, awaited, body) => {
|
|
217
|
-
const rejects = (test, target) => test
|
|
218
|
-
|| test?.type === "BinaryExpression" && test.operator === "==="
|
|
219
|
-
&& ((test.left === target && test.right.type === "Literal" && test.right.value === false)
|
|
220
|
-
|| (test.right === target && test.left.type === "Literal" && test.left.value === false));
|
|
215
|
+
/** Match an immediate refusal of the repeat (`false` from claim, no receipt id from claimRow) with no work before the return. */
|
|
216
|
+
const rejectsDuplicate = (context, awaited, body, method) => {
|
|
217
|
+
const rejects = (test, target) => refusesRepeat(test, target, method, { same: (left, right) => sameBinding(context, left, right) });
|
|
221
218
|
const returns = (statement) => statement?.type === "ReturnStatement" && !statement.argument
|
|
222
219
|
|| statement?.type === "BlockStatement" && statement.body.length === 1 && returns(statement.body[0]);
|
|
223
220
|
const parent = awaited.parent;
|
|
@@ -237,10 +234,10 @@ const rejectsDuplicate = (context, awaited, body) => {
|
|
|
237
234
|
export const webhookInboxKey = {
|
|
238
235
|
meta: {
|
|
239
236
|
type: "problem",
|
|
240
|
-
docs: { description: "Delivery methods with first *Id parameters or DTO properties, or raw-body signature contracts, claim the real Inbox with a stable delivery key before work and return on duplicates. Receipt transactions publish events and leave processing to a reactor/job." },
|
|
237
|
+
docs: { description: "Delivery methods with first *Id parameters or DTO properties, or raw-body signature contracts, claim the real Inbox (claim, or claimRow on its EntityInbox) with a stable delivery key before work and return on duplicates. Receipt transactions publish events and leave processing to a reactor/job." },
|
|
241
238
|
schema: [],
|
|
242
239
|
messages: {
|
|
243
|
-
key: "[BE_WEBHOOK_INBOX_KEY] This delivery intake must first await the real platform/inbox claim(source, deliveryId), using its first *Id parameter or DTO property, or a decoded id for a signed raw-body intake, and return immediately
|
|
240
|
+
key: "[BE_WEBHOOK_INBOX_KEY] This delivery intake must first await the real platform/inbox claim(source, deliveryId), or claimRow(source, deliveryId, tx, receipt) on its EntityInbox, using its first *Id parameter or DTO property, or a decoded id for a signed raw-body intake, and return immediately on a repeat (claim answers false, claimRow undefined). A transaction claim uses that callback's own manager; raw payloads and fixed literals are not delivery keys.",
|
|
244
241
|
handoff: "[BE_WEBHOOK_INBOX_KEY] A receipt transaction records the inbox delivery and publishes the typed event. Remove the process callback and domain/command processing from this transaction; a reactor or job processes the delivery after commit.",
|
|
245
242
|
},
|
|
246
243
|
},
|
|
@@ -270,16 +267,14 @@ export const webhookInboxKey = {
|
|
|
270
267
|
const parent = awaited?.parent;
|
|
271
268
|
const statement = parent?.type === "VariableDeclarator" ? parent.parent
|
|
272
269
|
: parent?.type === "UnaryExpression" || parent?.type === "BinaryExpression" ? parent.parent : parent;
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
&& call.callee.property.name === "claim" && call.arguments.length >= 2
|
|
276
|
-
&& isOwnedType(context, call.callee.object, { name: "Inbox", capability: "inbox", tier: "platform" })
|
|
270
|
+
const claimMethod = inboxClaimOf(context, call);
|
|
271
|
+
const claims = awaited !== null && call?.type === "CallExpression" && claimMethod !== null
|
|
277
272
|
&& usesKey(context, call.arguments[1], key)
|
|
278
273
|
&& preservesKey(context, key, call)
|
|
279
274
|
&& (!manager || sameBinding(context, call.arguments[2], manager))
|
|
280
275
|
&& claimsBeforeWork(context, body, statement, key, call)
|
|
281
276
|
&& !priorWork(statement, call)
|
|
282
|
-
&& rejectsDuplicate(context, awaited, body);
|
|
277
|
+
&& rejectsDuplicate(context, awaited, body, claimMethod);
|
|
283
278
|
if (!claims)
|
|
284
279
|
context.report({ node: method.key, messageId: "key" });
|
|
285
280
|
},
|
|
@@ -55,7 +55,7 @@ const isBusinessOrigin = (hfs, origin) => {
|
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* A domain receipt port records a delivery and processes nothing: a class with no base class whose constructor takes only platform
|
|
58
|
-
* ports (and TypeORM), at least one of them the platform `Inbox
|
|
58
|
+
* ports (and TypeORM), at least one of them the platform `Inbox` (or its `EntityInbox` extension). It cannot reach another domain service or the CQRS buses, so a call
|
|
59
59
|
* on it inside the receipt transaction is the inbox record itself (owner ruling 2026-10-17 "Theo y tro": the owner delegated the decision to main).
|
|
60
60
|
*/
|
|
61
61
|
const isReceiptPort = (checker, hfs, type) => {
|
|
@@ -65,7 +65,7 @@ const isReceiptPort = (checker, hfs, type) => {
|
|
|
65
65
|
return false;
|
|
66
66
|
const dependencies = constructor.parameters.map((parameter) => originsOfType(checker, checker.getTypeAtLocation(parameter)));
|
|
67
67
|
const isPort = (origin) => origin.module === "typeorm" || (origin.module === null && hfs.tierOf(origin.file) === "platform");
|
|
68
|
-
const isInbox = (origin) => origin.module === null && origin.name
|
|
68
|
+
const isInbox = (origin) => origin.module === null && ["Inbox", "EntityInbox"].includes(origin.name) && hfs.tierOf(origin.file) === "platform" && ownerNameOf(hfs, origin.file) === "inbox";
|
|
69
69
|
return dependencies.every((origins) => origins.length > 0 && origins.every(isPort)) && dependencies.some((origins) => origins.some(isInbox));
|
|
70
70
|
};
|
|
71
71
|
/** The transaction port's package establishes when the callback runs before commit. */
|
package/package.json
CHANGED
|
@@ -31,35 +31,35 @@ 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.15.
|
|
34
|
+
version: 0.15.27
|
|
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.8.
|
|
41
|
+
version: 3.8.14
|
|
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.5.
|
|
48
|
+
version: 9.5.16
|
|
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.15.
|
|
55
|
+
version: 0.15.27
|
|
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.15.
|
|
62
|
+
version: 0.15.27
|
|
63
63
|
group: starci
|
|
64
64
|
install: registry
|
|
65
65
|
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.
|
|
88
|
+
version: 2.5.1
|
|
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.11.
|
|
109
|
+
version: 4.11.15
|
|
110
110
|
group: starci
|
|
111
111
|
install: registry
|
|
112
112
|
side: both
|
|
@@ -1629,7 +1629,7 @@ rules:
|
|
|
1629
1629
|
witness:
|
|
1630
1630
|
- {"path":"packages/eslint/be/r80-inbox-dedupe-required.spec.mjs","edition":"lite","codes":["BE_INBOX_DEDUPE_MISSING"]}
|
|
1631
1631
|
- {"path":"packages/eslint/be/r80-inbox-dedupe-required.spec.mjs","edition":"full","codes":["BE_INBOX_DEDUPE_MISSING"]}
|
|
1632
|
-
law: "Every service method that takes a delivery (a public method of a `*.service.ts` whose first parameter has an `eventId`) makes `claim(source, eventId)` on the `Inbox` port its first awaited expression and returns early when
|
|
1632
|
+
law: "Every service method that takes a delivery (a public method of a `*.service.ts` whose first parameter has an `eventId`) makes `claim(source, eventId)` on the `Inbox` port, or `claimRow(source, eventId, tx, receipt)` on its `EntityInbox` extension (the claim, then the receipt entity row inserted only for the winning claim), its first awaited expression and returns early on a repeat: when `claim` answers `false` or `claimRow` answers no receipt id (`undefined`); consumers stay thin doors (R88) and dispatch one command to the handler whose service claims. SignedWebhook controllers verify first and call one domain recording intake directly (R182, R183); a reactor or job dispatches the processing command after the inbox receipt commits."
|
|
1633
1633
|
kinds: [lint, design]
|
|
1634
1634
|
gates: [pre-commit, settle, land, ci]
|
|
1635
1635
|
failureCodes: ["BE_INBOX_DEDUPE_MISSING"]
|
|
@@ -4233,7 +4233,7 @@ rules:
|
|
|
4233
4233
|
code: "HFS_AGE_KEY_CUSTODY"
|
|
4234
4234
|
editions: [lite, full]
|
|
4235
4235
|
docs: [docs/host-secrets.md#application-secret-rules]
|
|
4236
|
-
law: "The age identity that seals and opens an app's `.starcistacks/<env>/secrets/*.enc` is host-local custody only: it lives in the untracked `.claude/secret.env` (as `SOPS_AGE_KEY`, which wins over the legacy `keys.txt` and is handed to sops through the `SOPS_AGE_KEY` child environment, never as an argument and never printed) or in the sops config dir's `keys.txt`; a tracked `.claude/secret.env`, `keys.txt` or `*.agekey` is the identity committed. The three files the secret custody depends on - `src/modules/platform/config/env-source.config.ts`, `src/modules/platform/http-security/origin.guard.ts` and `src/modules/platform/http-security/webhook-signature.service.ts` - are hash-sensitive canon, not files to edit: their bytes equal the `be/skeleton` template
|
|
4236
|
+
law: "The age identity that seals and opens an app's `.starcistacks/<env>/secrets/*.enc` is host-local custody only: it lives in the untracked `.claude/secret.env` (as `SOPS_AGE_KEY`, which wins over the legacy `keys.txt` and is handed to sops through the `SOPS_AGE_KEY` child environment, never as an argument and never printed) or in the sops config dir's `keys.txt`; a tracked `.claude/secret.env`, `keys.txt` or `*.agekey` is the identity committed. The three files the secret custody depends on - `src/modules/platform/config/env-source.config.ts`, `src/modules/platform/http-security/origin.guard.ts` and `src/modules/platform/http-security/webhook-signature.service.ts` - are hash-sensitive canon, not files to edit: their bytes equal the `be/skeleton` template of the @starci/hfs version the app pins (never of a newer hfs running the check), judged by sha256."
|
|
4237
4237
|
kinds: [check]
|
|
4238
4238
|
gates: [settle, land, ci]
|
|
4239
4239
|
failureCodes: ["HFS_AGE_KEY_CUSTODY", "HFS_CANON_COPY_DRIFT"]
|
|
@@ -4418,7 +4418,7 @@ rules:
|
|
|
4418
4418
|
- id: R263
|
|
4419
4419
|
code: "BE_WEBHOOK_SCOPE"
|
|
4420
4420
|
amendedBy: [owner:oauth-redirect-not-webhook, owner:webhook-receipt-port]
|
|
4421
|
-
law: "SignedWebhook public metadata belongs only to a webhook HTTP door or an exact domain verifier declared in its HTTP module's exported webhookVerifiers array. A public controller route containing webhook, callback or events belongs in the webhook door; the one exception is a third-party OAuth redirect (owner:oauth-redirect-not-webhook): a GET route that declares PublicReason.AuthHandshake and whose path is not a webhook or events path, which has no signature to verify and is not a door. A POST, a webhook or events path, and any other reason are still judged. A receipt transaction may call a domain receipt port (owner:webhook-receipt-port): a class with no base class whose constructor takes only platform ports and TypeORM, one of them the platform Inbox; a call on any other domain service or on a bus inside the transaction is processing. Domain intake methods identified by a first *Id parameter or DTO property, or raw-body signature input, claim the shared Inbox with the stable delivery key and return early on a duplicate before doing work. The receipt transaction records the inbox delivery and publishes its typed outbox event; process callbacks, domain processing and command dispatch run only after commit in a reactor or job."
|
|
4421
|
+
law: "SignedWebhook public metadata belongs only to a webhook HTTP door or an exact domain verifier declared in its HTTP module's exported webhookVerifiers array. A public controller route containing webhook, callback or events belongs in the webhook door; the one exception is a third-party OAuth redirect (owner:oauth-redirect-not-webhook): a GET route that declares PublicReason.AuthHandshake and whose path is not a webhook or events path, which has no signature to verify and is not a door. A POST, a webhook or events path, and any other reason are still judged. A receipt transaction may call a domain receipt port (owner:webhook-receipt-port): a class with no base class whose constructor takes only platform ports and TypeORM, one of them the platform Inbox or its EntityInbox; a call on any other domain service or on a bus inside the transaction is processing. Domain intake methods identified by a first *Id parameter or DTO property, or raw-body signature input, claim the shared Inbox with the stable delivery key (claim, or claimRow on its EntityInbox with the receipt row and the transaction's own manager) and return early on a duplicate (false from claim, undefined from claimRow) before doing work. The receipt transaction records the inbox delivery and publishes its typed outbox event; process callbacks, domain processing and command dispatch run only after commit in a reactor or job."
|
|
4422
4422
|
kinds: [lint]
|
|
4423
4423
|
gates: ["pre-commit","settle","land","ci"]
|
|
4424
4424
|
failureCodes: ["BE_WEBHOOK_SCOPE", "BE_WEBHOOK_INBOX_KEY"]
|