@starci/eslint-canon-be 3.27.1 → 3.27.2
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 +4 -0
- package/README.md +1 -2
- package/dist/comments.d.ts +2 -2
- package/dist/comments.js +3 -27
- package/dist/lib/nivoos-profile.js +3 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.27.2 - 2026-11-18
|
|
4
|
+
|
|
5
|
+
- Changed (`lib/nivoos-profile.ts`): the nivoos authoring profile no longer applies `no-non-ascii-source` to a declared package (Vietnamese in literals, comments and identifiers); the literal-only narrowing inside the rule is removed and the rule is listed in `NIVOOS_RELAXED` with its reason. An undeclared package keeps the whole rule.
|
|
6
|
+
|
|
3
7
|
## 3.27.1 - 2026-11-18
|
|
4
8
|
|
|
5
9
|
- Added (`lib/nivoos-profile.ts`): the lint profile of a declared nivoos business package (slot `app.nivoos-package`, `lintProfile: nivoos`, PROJECT-BUSINESS-1): `no-non-ascii-source` allows Vietnamese letters inside string and template literals (comments, identifiers and emoji stay refused); `no-default-export` allows the default export of `src/<name>.package.ts`, which the SDK loads; `explicit-export-surface`, `require-public-member-jsdoc`, `job-shape` and `throw-domain-error` do not apply to the package source (nothing imports it, the SDK interface owns its members, `.step.ts` is the SDK file kind, an SDK node fails with a coded `Error`). Every other rule, `schema-bounded` included, still applies.
|
package/README.md
CHANGED
|
@@ -37,9 +37,8 @@ A package authored with the nivoos SDK (agents, workflows, cells, steps, brain,
|
|
|
37
37
|
(`lintProfile: nivoos`), and `starciBePackagesConfig` judges `packages/<name>/src/**` with the same canon less what an SDK package cannot satisfy. The profile is chosen by the slot and takes no
|
|
38
38
|
file comment; the same code in an undeclared package is judged by the whole canon (`src/lib/nivoos-profile.ts`, `src/nivoos-profile.spec.ts`):
|
|
39
39
|
|
|
40
|
-
- `no-non-ascii-source` accepts Vietnamese letters inside string and template literals (the business's copy) and refuses them in comments and identifiers; an emoji or ornament is refused everywhere;
|
|
41
40
|
- `no-default-export` accepts the default export of the entry `src/<name>.package.ts`, which the SDK loads;
|
|
42
|
-
- `explicit-export-surface`, `require-public-member-jsdoc`, `job-shape` and `throw-domain-error` are not applied, each with its reason in `NIVOOS_RELAXED` (nothing imports a package's source and the SDK's
|
|
41
|
+
- `no-non-ascii-source` is not applied (Vietnamese copy and comments are expected; identifiers stay ASCII by the package convention), and `explicit-export-surface`, `require-public-member-jsdoc`, `job-shape` and `throw-domain-error` are not applied, each with its reason in `NIVOOS_RELAXED` (nothing imports a package's source and the SDK's
|
|
43
42
|
interfaces type its members; a member is a field of the SDK interface; `.step.ts` is a workflow step, not a job step; an SDK node fails by a thrown coded `Error`).
|
|
44
43
|
|
|
45
44
|
[contexts/project/business-repo.md](../../contexts/project/business-repo.md) owns the page; the findings each relaxation held are those of the first package, `nivo-web`.
|
package/dist/comments.d.ts
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* - `require-enum-member-jsdoc` checks an adjacent non-empty description, never whether it states a
|
|
14
14
|
* consequence. That half is read by a person, and the rule says so rather than pretending.
|
|
15
15
|
* - `no-non-ascii-source` takes no exemption marker, so text a program depends on
|
|
16
|
-
* lives in a message catalog (slot be.domain.messages, of any module tier, or be.feature.messages), the only place Vietnamese may appear (
|
|
17
|
-
*
|
|
16
|
+
* lives in a message catalog (slot be.domain.messages, of any module tier, or be.feature.messages), the only place Vietnamese may appear (a declared nivoos package
|
|
17
|
+
* is not judged by this rule at all: its business copy, comments included, is Vietnamese, lib/nivoos-profile.ts NIVOOS_RELAXED). Specs
|
|
18
18
|
* and fixtures get no exemption.
|
|
19
19
|
* - `no-restated-name-jsdoc` (law 7) holds the decidable slice of law 3 - a doc block whose only
|
|
20
20
|
* content is the declared name re-spelled in words teaches nothing beyond the import line, so it
|
package/dist/comments.js
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* - `require-enum-member-jsdoc` checks an adjacent non-empty description, never whether it states a
|
|
14
14
|
* consequence. That half is read by a person, and the rule says so rather than pretending.
|
|
15
15
|
* - `no-non-ascii-source` takes no exemption marker, so text a program depends on
|
|
16
|
-
* lives in a message catalog (slot be.domain.messages, of any module tier, or be.feature.messages), the only place Vietnamese may appear (
|
|
17
|
-
*
|
|
16
|
+
* lives in a message catalog (slot be.domain.messages, of any module tier, or be.feature.messages), the only place Vietnamese may appear (a declared nivoos package
|
|
17
|
+
* is not judged by this rule at all: its business copy, comments included, is Vietnamese, lib/nivoos-profile.ts NIVOOS_RELAXED). Specs
|
|
18
18
|
* and fixtures get no exemption.
|
|
19
19
|
* - `no-restated-name-jsdoc` (law 7) holds the decidable slice of law 3 - a doc block whose only
|
|
20
20
|
* content is the declared name re-spelled in words teaches nothing beyond the import line, so it
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
*/
|
|
26
26
|
import { nameOrValue } from "./lib/ast.js";
|
|
27
27
|
import { hfsOf } from "./lib/hfs.js";
|
|
28
|
-
import { nivoosAuthored } from "./lib/nivoos-profile.js";
|
|
29
28
|
import { normalizePath } from "./lib/path.js";
|
|
30
29
|
import { hasSecondLanguage } from "@starci/hfs/runtime/scripts/lib/language.mjs";
|
|
31
30
|
import { jsdocBefore, jsdocDescription } from "../runtime/scripts/lib/jsdoc.mjs";
|
|
@@ -82,26 +81,6 @@ const offenceIn = (line) => {
|
|
|
82
81
|
return "an ornamental symbol";
|
|
83
82
|
return null;
|
|
84
83
|
};
|
|
85
|
-
/**
|
|
86
|
-
* The source text with the Vietnamese letters inside string and template literals replaced by `a`, so a line of it offends only with what is
|
|
87
|
-
* outside a literal (a comment, an identifier) or with an emoji or an ornament anywhere.
|
|
88
|
-
*
|
|
89
|
-
* @param sourceCode - The linted file.
|
|
90
|
-
* @returns The text, line breaks kept.
|
|
91
|
-
*/
|
|
92
|
-
const withoutLiteralText = (sourceCode) => {
|
|
93
|
-
const text = sourceCode.text;
|
|
94
|
-
let out = "";
|
|
95
|
-
let at = 0;
|
|
96
|
-
for (const token of sourceCode.ast.tokens) {
|
|
97
|
-
if (token.type !== "String" && token.type !== "Template")
|
|
98
|
-
continue;
|
|
99
|
-
out += text.slice(at, token.range[0]);
|
|
100
|
-
out += Array.from(text.slice(token.range[0], token.range[1]).normalize("NFC"), (char) => (hasSecondLanguage(char) ? "a" : char)).join("");
|
|
101
|
-
at = token.range[1];
|
|
102
|
-
}
|
|
103
|
-
return out + text.slice(at);
|
|
104
|
-
};
|
|
105
84
|
/**
|
|
106
85
|
* Whether an exported declaration has a surface a caller documents: a data constant is already described by its name,
|
|
107
86
|
* and a kind outside DOCUMENTED_KINDS has no surface at all.
|
|
@@ -305,12 +284,9 @@ export const noNonAsciiSource = {
|
|
|
305
284
|
const slot = hfsOf(context).slotOf(context.filename);
|
|
306
285
|
if (CATALOG_SLOTS.has(slot) || FIXTURE_SLOTS.has(slot))
|
|
307
286
|
return {};
|
|
308
|
-
// A declared nivoos package carries its business copy (titles, labels, prompts, guidance) in string and template literals: Vietnamese is accepted there and
|
|
309
|
-
// nowhere else (a comment, an identifier), and an emoji or an ornament stays refused everywhere (lib/nivoos-profile.ts).
|
|
310
|
-
const copyInLiterals = nivoosAuthored(context);
|
|
311
287
|
return {
|
|
312
288
|
"Program:exit"(node) {
|
|
313
|
-
const lines =
|
|
289
|
+
const lines = sourceCode.text.split(/\r\n|[\r\n\u2028\u2029]/u);
|
|
314
290
|
for (const [index, line] of lines.entries()) {
|
|
315
291
|
const offence = offenceIn(line);
|
|
316
292
|
if (offence === null)
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* and the slot's `lintProfile: nivoos` is what puts its source under this profile: the profile is applied by the slot, never by a disable in the file.
|
|
5
5
|
*
|
|
6
6
|
* The profile keeps the whole canon and relaxes exactly what an SDK package cannot satisfy, each for a reason the real findings of a package showed (the
|
|
7
|
-
* `nivo-web` package: 508 findings, of which these relaxations account for 412 and 96 are source to fix).
|
|
8
|
-
* (`no-
|
|
7
|
+
* `nivo-web` package: 508 findings, of which these relaxations account for 412 and 96 are source to fix). One rule narrows inside its own file
|
|
8
|
+
* (`no-default-export` for the package entry); the rest is a rule the profile does not enable, in `NIVOOS_RELAXED`.
|
|
9
9
|
*/
|
|
10
10
|
import { normalizePath } from "./path.js";
|
|
11
11
|
import { hfsOf } from "./hfs.js";
|
|
@@ -40,6 +40,7 @@ export const isNivoosEntry = (filename) => /\/packages\/[^/]+\/src\/[^/]+\.packa
|
|
|
40
40
|
* reason is the finding: what the real package showed and why the rule's own purpose does not hold for SDK code.
|
|
41
41
|
*/
|
|
42
42
|
export const NIVOOS_RELAXED = Object.freeze({
|
|
43
|
+
"starci-be/no-non-ascii-source": "A business package is written for a Vietnamese business: its titles, labels, prompts, guidance and brain documents are Vietnamese, and so are the comments that explain them to the people who own the business. The rule exists so source prose is English for a reader who does not share the author's language; the readers of this package do share it, so the rule is not applied to the package at all, comments included. Identifiers stay ASCII by the package convention (one class per node, named for its key) and the canon has no other rule to hold them to it. Owner direction 2026-11-18.",
|
|
43
44
|
"starci-be/explicit-export-surface": "Its purpose is that importers read a file's declared types without inferring them and are not re-linted when it changes. Nothing imports a business package's source: the nivoos CLI loads the entry and writes the seed document, and the SDK's own interfaces (Node, NodeIf, NodeRun, Workspace, Package) type every member. The SDK idioms it refuses cannot be annotated at all: `export class X extends NodeRun(Cell)<typeof State>` (an extends clause with a call), an exported `z.strictObject(...)` schema the next line's `typeof` reads, `export default {...} satisfies Package`. 186 of 508 findings.",
|
|
44
45
|
"starci-be/require-public-member-jsdoc": "The public members of a cell, step, agent or workspace class are the fields of the SDK interface it implements (key, version, title, input, output, reads, mutation, run, when, yes, no, next, into, label): the SDK documents them, and the class JSDoc (`require-export-jsdoc`, kept) says what this node is for. A sentence on each restates the interface. 152 of 508 findings.",
|
|
45
46
|
"starci-be/job-shape": "The canon's `<step>.step.ts` is the jobs capability's file kind (`features/jobs/<job>/steps/`); the SDK's `.step.ts` is a workflow step (NodeRun, NodeIf) of the same suffix, and an SDK package has no jobs capability. 17 of 508 findings, all false positives of the shared suffix.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/eslint-canon-be",
|
|
3
|
-
"version": "3.27.
|
|
3
|
+
"version": "3.27.2",
|
|
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",
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"typescript": "^6.0.3"
|
|
75
75
|
},
|
|
76
76
|
"types": "./dist/index.d.ts",
|
|
77
|
-
"gitHead": "
|
|
78
|
-
"starciSource": "
|
|
77
|
+
"gitHead": "bf57eda186e017fced7929e422e3d9a521d98273",
|
|
78
|
+
"starciSource": "c058d7203457adca5866a74866f78af8611c069075553bfc9f8cb36dd3ee81f5"
|
|
79
79
|
}
|