@starci/hfs 4.9.0 → 4.9.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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.9.2 - 2026-10-28
4
+
5
+ - Fixed: `repositoryName` (runtime/scripts/hfs/repo-identity.mjs) names a repository by its origin remote, whatever folder holds the clone; the main checkout's folder names it only without an origin. HFS_README_TITLE_INVALID and the stack project name no longer change with the clone folder. Spec: `src/repo-identity.spec.mjs`.
6
+ - Fixed: the rendered `sonar-project.properties` carries `sonar.cpd.exclusions` inside the generated `starci:sonar-scope` block, after `sonar.coverage.exclusions`, and its entries are the `cpd-exclusions` allowances of the bundled design truths (`SONAR_CPD_EXCLUSIONS` reads them; no second list), so `starci check loosening` accepts the rendered line as the block `starci app sonar` derives instead of flagging a ruled exclusion as hand-written. An app moves the line with `starci app sync --write`.
7
+ - Fixed: the fe skeleton passes canon-fe 9.4.1: `SignInForm` takes `{ props: { ..., pending, errorMessage }, on }` (no retired `state`, no `failure` status prop), and the opt-in auth callback's `GET` and `exchangeAuthCode` are arrow consts. Spec: `src/scaffold-template-canon-fe.spec.mjs` scaffolds each edition and lints every fe source with the starci-fe rules.
8
+ - Changed: the bundled canon pins follow release D (Grammar family 0.15.1, hfs 4.9.2, canon-fe 9.4.1, canon-be 3.6.1, starci-harness 1.1.0-alpha.2), so an app installs the released versions without pin drift.
9
+
10
+ ## 4.9.1 - 2026-10-28
11
+
12
+ - Changed: the bundled canon pins follow release C (Grammar family 0.15.0, hfs 4.9.1, canon-fe 9.4.0, canon-be 3.6.0, jest-preset 2.4.1, stylelint-canon 2.2.1, tsconfig 2.1.0, prettier-config 1.1.0, and `@starci/ai-router` 0.2.1 pinned), so an app installs the released versions without pin drift.
13
+
3
14
  ## 4.9.0 - 2026-10-28
4
15
 
5
16
  - Removed: 121 bundled runtime scripts that only served the legacy runtime and that no `starci app` verb, package entry or catalogued rule enforcer reaches: `scripts/agent/`, `scripts/reconciler/`, the legacy hook guards of `scripts/guards/` (command, seat, rights, install and launch verdicts), the op gate of `scripts/gates/` (`gate.mjs`, canon pins and digest, type impact), the drawing pipeline of `scripts/work/` other than the DNA judge (`draw-dna*`, `grammar-proposal`, `asset-slot`), the ledger of `engine/db/`, the machine helpers, and the `scripts/api` and `scripts/lib` helpers only they imported; with them the specs that exercised only that code. The `release-push-gate` and `hook-io` cases of `hook-input.spec.mjs` stay.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/hfs",
3
- "version": "4.9.0",
3
+ "version": "4.9.2",
4
4
  "description": "The StarCi app command implementation for scaffolding, linting, checking and synchronizing one product repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -30,61 +30,61 @@ pins:
30
30
  source: packages/event-stream/package.json
31
31
  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.'
32
32
  '@starci/grammar':
33
- version: 0.14.0
33
+ version: 0.15.1
34
34
  group: starci
35
35
  install: registry
36
36
  side: fe
37
37
  source: packages/grammar/package.json
38
38
  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.'
39
39
  '@starci/eslint-canon-be':
40
- version: 3.5.0
40
+ version: 3.6.1
41
41
  group: starci
42
42
  install: registry
43
43
  side: be
44
44
  source: packages/eslint-canon-be/package.json
45
45
  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.'
46
46
  '@starci/eslint-canon-fe':
47
- version: 9.3.0
47
+ version: 9.4.1
48
48
  group: starci
49
49
  install: registry
50
50
  side: fe
51
51
  source: packages/eslint-canon-fe/package.json
52
52
  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.'
53
53
  '@starci/eslint-grammar-core':
54
- version: 0.14.0
54
+ version: 0.15.1
55
55
  group: starci
56
56
  install: registry
57
57
  side: fe
58
58
  source: packages/eslint-grammar-core/package.json
59
59
  why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
60
60
  '@starci/eslint-grammar-offset-pop':
61
- version: 0.14.0
61
+ version: 0.15.1
62
62
  group: starci
63
63
  install: registry
64
64
  side: fe
65
65
  source: packages/eslint-grammar-offset-pop/package.json
66
66
  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.'
67
67
  '@starci/stylelint-canon':
68
- version: 2.1.0
68
+ version: 2.2.1
69
69
  group: starci
70
70
  install: registry
71
71
  side: fe
72
72
  source: packages/stylelint-canon/package.json
73
73
  why: 'the front-end stylelint canon: no-class-selector refuses a compound class selector (`div.card`); the brand layer accepts `--font-sans` and `--font-mono`; status-contrast measures the HeroUI soft pairs per theme; brand-layer-shape reads the shared :root,.light,.dark block and the info soft pair; appTokens come from loadAppTokens(import.meta.url) for the managed one-line stylelint.config.mjs.'
74
74
  '@starci/tsconfig':
75
- version: 2.0.8
75
+ version: 2.1.0
76
76
  group: starci
77
77
  install: registry
78
78
  side: both
79
79
  source: packages/tsconfig/package.json
80
80
  '@starci/prettier-config':
81
- version: 1.0.5
81
+ version: 1.1.0
82
82
  group: starci
83
83
  install: registry
84
84
  side: both
85
85
  source: packages/prettier-config/package.json
86
86
  '@starci/jest-preset':
87
- version: 2.3.7
87
+ version: 2.4.1
88
88
  group: starci
89
89
  install: registry
90
90
  side: be
@@ -97,15 +97,22 @@ pins:
97
97
  side: be
98
98
  source: packages/test-world/package.json
99
99
  why: 'the shared e2e library of every back end (R47, R48), a devDependency of every back end: the warm stack behind toxiproxy, the network-edge fakes, the Nest boot, the typed useTestWorld handle, useSandbox for contract specs and the outage lock. Kafka is real own infra (the one digest-pinned apache/kafka KRaft image, a broker listener and proxy per slot, slot-prefixed topics, consumer groups and client ids) and Postgres is schema-per-context (a schema and a login role per context in a shared database). Each worker has its own data slot (<ns>_w<k>) with its own databases, Keycloak realm, leased Redis DB, bucket/collection/topic prefixes, fakes host, toxiproxy proxies and outage lock; a run provisions min(jest workers, workers cap, default 2) slots, and state file protocol 2 pairs exactly with @starci/jest-preset (TEST_WORLD_PAIR_MISMATCH otherwise). A modules world boots real peer apps beside its modules, world.apps.<name>.during(fn) is the outage of a peer app, w.keycloak.clientSecret(client) answers the run-generated secret of a confidential realm client, world.keycloak.events/sessions read the realm user events and live sessions, world.infra.postgresql.connection(name) takes one database connection down while the others serve, and world.resolve and scope.resolve take any Nest token. Every path a declaration names (`stack`, seeds, the realm, Dockerfiles) resolves from the app root (the directory of hfs.json); the globalSetup registers the path aliases as TypeScript resolves them. Its CLI main is exported at ./cli for starci app stack.'
100
+ '@starci/ai-router':
101
+ version: 0.2.1
102
+ group: starci
103
+ install: registry
104
+ side: be
105
+ source: packages/ai-router/package.json
106
+ 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.'
100
107
  'starci-harness':
101
- version: 1.1.0-alpha.1
108
+ version: 1.1.0-alpha.2
102
109
  group: starci
103
110
  install: registry
104
111
  side: both
105
112
  source: cli/package.json
106
113
  why: 'the one StarCi command line (bins starci and starci-harness): a product repository installs it for starci app, which it runs in-process through its exact @starci/hfs dependency, and its codegen loads starci-harness/input-bounds.'
107
114
  '@starci/hfs':
108
- version: 4.9.0
115
+ version: 4.9.2
109
116
  group: starci
110
117
  install: registry
111
118
  side: both
@@ -42,13 +42,13 @@ function askGit(root) {
42
42
  }
43
43
 
44
44
  /**
45
- * The product repository name: the main checkout's folder name (so a worktree and its main checkout agree), else the
46
- * origin remote's name, else package.json name outside Git, else the folder name. A folder inside a larger repository
47
- * (a nested product, an example) is named by its own folder.
45
+ * The product repository name: the origin remote's repository name (one name for every clone and worktree, whatever
46
+ * folder holds it), else the main checkout's folder name (so a worktree and its main checkout agree), else package.json
47
+ * name outside Git, else the folder name. A folder inside a larger repository (a nested product, an example) is named by
48
+ * its own folder.
48
49
  */
49
50
  export function repositoryName(root) {
50
51
  const { inWorkTree, repositoryRoot, home } = identityOf(root);
51
- if (home) return path.basename(home);
52
52
  if (repositoryRoot) {
53
53
  try {
54
54
  const remote = trimTrailingSlashes(git(gitRemote, root, ['get-url', 'origin'])).replace(GIT_SUFFIX, '');
@@ -56,6 +56,7 @@ export function repositoryName(root) {
56
56
  if (name) return name;
57
57
  } catch { /* No origin remote. */ }
58
58
  }
59
+ if (home) return path.basename(home);
59
60
  if (inWorkTree && !repositoryRoot) return path.basename(root);
60
61
  try {
61
62
  const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));
package/sync/index.mjs CHANGED
@@ -36,6 +36,9 @@ import { ciWorkflowCommands } from './ci-commands.mjs';
36
36
  import { dependabotUpdates, hasDeclaredServices, readDeclaredQuality, readDeclaredBadges, sonarHostLine } from './quality-services.mjs';
37
37
  import { qualityServices } from '../runtime/scripts/hfs/ci-declaration.mjs';
38
38
  import { grammarLintFor } from '../runtime/scripts/lib/grammar-lint.mjs';
39
+ import { LIST } from '../runtime/scripts/lib/loosening-config.mjs';
40
+ import { readTruths } from '../runtime/scripts/lib/loosening-state.mjs';
41
+ import { parseYaml as bundledParseYaml } from '../runtime/engine/yaml.mjs';
39
42
 
40
43
  export const TEMPLATES_DIR = path.join(import.meta.dirname, '..', 'templates');
41
44
  const NODE_MAJOR = 22;
@@ -194,11 +197,18 @@ export function bundledPresets() {
194
197
 
195
198
  /** Where the be unit run writes the lcov report (jest `coverageDirectory` coverage under be/, reporter lcov), from the app root. */
196
199
  const LCOV_REPORT = 'be/coverage/lcov.info';
200
+ /** The design truths this package ships: the one list of the exceptions the canon allows, each with its owner ruling. */
201
+ const DESIGN_TRUTHS = path.join(import.meta.dirname, '..', 'runtime', 'knowledge', 'hfs', 'design-truths.yaml');
202
+ /** Every entry the design truths allow on `list`, in manifest order. */
203
+ const designTruthEntries = list => [...new Set(readTruths(bundledParseYaml(fs.readFileSync(DESIGN_TRUTHS, 'utf8'))).literal.filter(allow => allow.list === list).flatMap(allow => allow.entries))];
197
204
  /**
198
- * The message catalogs Sonar's copy-paste detection leaves out (owner ruling 2026-10-22): a catalog holds one block per language
199
- * with the same keys, which CPD reads as duplicated code. They are still sources: linted, analysed and held to every other rule.
205
+ * The entries Sonar's copy-paste detection leaves out: every `cpd-exclusions` entry the design truths
206
+ * (knowledge/hfs/design-truths.yaml) allow, today the message catalogs (ruling message-catalogs-not-duplicate-code): a catalog
207
+ * holds one block per language with the same keys, which CPD reads as duplicated code. They are still sources: linted, analysed
208
+ * and held to every other rule. The rendered properties carry them inside the generated Sonar block, and `starci check loosening`
209
+ * accepts the block only as this manifest derives it.
200
210
  */
201
- export const SONAR_CPD_EXCLUSIONS = Object.freeze(['**/messages/*.messages.ts', '**/messages/*.json']);
211
+ export const SONAR_CPD_EXCLUSIONS = Object.freeze(designTruthEntries(LIST.cpd));
202
212
 
203
213
  /**
204
214
  * The Sonar scope of the jest preset's exclusions (presets.sonarExclusions): its file patterns are the tests, which
@@ -2,12 +2,12 @@
2
2
  {{sonarHostLine}}
3
3
  sonar.tests={{sonarSources}}
4
4
  sonar.exclusions={{sonarExclusions}}
5
- sonar.cpd.exclusions={{cpdExclusions}}
6
5
  sonar.test.inclusions={{sonarTestInclusions}}
7
6
  sonar.typescript.tsconfigPaths={{tsconfigPaths}}
8
7
  sonar.externalIssuesReportPaths=reports/lint.sonar.json
9
8
  sonar.javascript.lcov.reportPaths={{lcovReport}}
10
9
  # starci:sonar-scope begin (generated by `starci app sonar --write` from contexts/hfs/slots.yaml; do not edit)
11
10
  sonar.coverage.exclusions={{coverageExclusions}}
11
+ sonar.cpd.exclusions={{cpdExclusions}}
12
12
  # starci:sonar-scope end
13
13
  sonar.javascript.node.maxspace=6144
@@ -3,7 +3,7 @@ import { exchangeAuthCode } from "@/modules/auth/server"
3
3
  import { APP_ROUTES } from "@/modules/routes"
4
4
 
5
5
  /** The opt-in Supabase PKCE callback only exchanges the code and redirects home. */
6
- export async function GET(request: Request): Promise<NextResponse> {
6
+ export const GET = async (request: Request): Promise<NextResponse> => {
7
7
  const url = new URL(request.url)
8
8
  const code = url.searchParams.get("code")
9
9
  if (code) await exchangeAuthCode(code)
@@ -1,14 +1,16 @@
1
1
  import { Button, Form, Input, SectionHeader, Text } from "@starci/grammar/common"
2
2
 
3
- /** Copy, state and action supplied by the connected sign-in block. */
3
+ /** Copy, the pending flag, the first error message and the action supplied by the connected sign-in block. */
4
4
  export interface SignInFormBaseProps {
5
- readonly state: "ready" | "working" | "failed"
6
5
  readonly props: {
7
6
  readonly title: string
8
7
  readonly emailLabel: string
9
8
  readonly passwordLabel: string
10
9
  readonly submitLabel: string
11
- readonly failure: string | undefined
10
+ /** True while the sign-in request runs. */
11
+ readonly pending: boolean
12
+ /** The resolved message of the last refused sign-in, or undefined. */
13
+ readonly errorMessage: string | undefined
12
14
  }
13
15
  readonly on: { readonly submit: (input: FormData) => void }
14
16
  }
@@ -17,11 +19,11 @@ export interface SignInFormBaseProps {
17
19
  export const SignInFormBase = (props: SignInFormBaseProps) => (
18
20
  <>
19
21
  <SectionHeader title={props.props.title} level={2} />
20
- <Form label={props.props.title} isPending={props.state === "working"} onSubmit={props.on.submit}>
22
+ <Form label={props.props.title} isPending={props.props.pending} onSubmit={props.on.submit}>
21
23
  <Input id="sign-in-email" name="email" label={props.props.emailLabel} kind="email" isRequired />
22
24
  <Input id="sign-in-password" name="password" label={props.props.passwordLabel} kind="password" isRequired />
23
- {props.props.failure === undefined ? null : <Text live="assertive">{props.props.failure}</Text>}
24
- <Button type="submit" intent="commit" isPending={props.state === "working"}>
25
+ {props.props.errorMessage === undefined ? null : <Text live="assertive">{props.props.errorMessage}</Text>}
26
+ <Button type="submit" intent="commit" isPending={props.props.pending}>
25
27
  {props.props.submitLabel}
26
28
  </Button>
27
29
  </Form>
@@ -5,12 +5,6 @@ import { useSession, useSignIn } from "@/hooks/auth"
5
5
  import type { SignInFailure } from "@/hooks/auth"
6
6
  import { SignInFormBase } from "./component"
7
7
 
8
- /** The state the form shows: working while a request runs, failed after a refusal, else ready. */
9
- const stateOf = (pending: boolean, failure: SignInFailure | undefined): "working" | "ready" | "failed" => {
10
- if (pending) return "working"
11
- return failure === undefined ? "ready" : "failed"
12
- }
13
-
14
8
  /** The fields of the submitted form, or undefined when one is missing. */
15
9
  const credentialsOf = (input: FormData): { readonly email: string; readonly password: string } | undefined => {
16
10
  const email = input.get("email")
@@ -36,13 +30,13 @@ export const SignInForm = () => {
36
30
  }
37
31
  return (
38
32
  <SignInFormBase
39
- state={stateOf(pending, failure)}
40
33
  props={{
41
34
  title: t("title"),
42
35
  emailLabel: t("email"),
43
36
  passwordLabel: t("password"),
44
37
  submitLabel: pending ? t("working") : t("submit"),
45
- failure: failure === undefined ? undefined : failureMessages[failure],
38
+ pending,
39
+ errorMessage: failure === undefined ? undefined : failureMessages[failure],
46
40
  }}
47
41
  on={{ submit }}
48
42
  />
@@ -4,7 +4,7 @@ import { cookies } from "next/headers"
4
4
  import { supabaseAnonKey, supabaseUrl } from "@/modules/config"
5
5
 
6
6
  /** The server auth owner reads the PKCE verifier and persists the exchanged session in cookies. */
7
- export async function exchangeAuthCode(code: string): Promise<void> {
7
+ export const exchangeAuthCode = async (code: string): Promise<void> => {
8
8
  const cookieStore = await cookies()
9
9
  const client = createServerClient(supabaseUrl(), supabaseAnonKey(), {
10
10
  cookies: {