@lcv-ideas-software/cross-review 4.0.2 → 4.0.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
@@ -7,6 +7,53 @@ standard `v00.00.00`; npm package versions remain SemVer.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [v04.00.03] — 2026-05-15
11
+
12
+ **Patch — biome integration to satisfy the 4-gate quality directive
13
+ (operator 2026-05-15: eslint + biome + prettier + cross-review).** The
14
+ repo had eslint + prettier covering the static gates but lacked biome.
15
+ This release adds biome at parity with the 8 other workspace apps that
16
+ already use it (admin-app, astrologo-frontend, calculadora-app,
17
+ mainsite-frontend, mainsite-worker, mtasts-motor, oraculo-financeiro,
18
+ sponsor-motor).
19
+
20
+ ### Added
21
+
22
+ - `@biomejs/biome` (^2.4.0) devDep + `biome.json` config matching the
23
+ prettier conventions already in use (lineWidth 100, indent space 2,
24
+ double quotes, trailing commas all, semicolons always). Linter
25
+ enabled with `recommended` rules.
26
+ - `npm run biome` (check-only) + `npm run biome:write` (with --write
27
+ auto-fix) scripts scoped to `src/` and `scripts/`.
28
+ - `npm run check` aggregate script that runs all 4 statics:
29
+ `format:check && lint && biome && typecheck`. Single-command gate
30
+ for local + CI use.
31
+
32
+ ### Updated
33
+
34
+ - `.github/workflows/ci.yml` adds an explicit `Biome (lint + format)`
35
+ step between `Lint (eslint)` and `Typecheck` for granular per-gate
36
+ visibility in CI logs.
37
+ - `.github/workflows/publish.yml` adds a `Pre-publish gate (format +
38
+ lint + biome + typecheck)` step calling `npm run check` before the
39
+ existing `npm test` verify step. Defense-in-depth: the publish
40
+ runner re-verifies the 4 statics independent of the CI workflow.
41
+
42
+ ### Fixed (biome --write --unsafe applied)
43
+
44
+ - `scripts/smoke.ts`: 5 `lint/style/useTemplate` (prefer template
45
+ literals) + 1 `lint/correctness/noEmptyCharacterClassInRegex`
46
+ (the regex `[^]*?` flagged as negated-empty class → replaced with
47
+ `[\s\S]*?` which is semantically identical and lint-clean).
48
+ - `src/peers/perplexity.ts`: 4 `lint/complexity/noUselessSwitchCase`
49
+ (collapsed cases that fell through to the same return).
50
+ - `src/core/caller-tokens.ts`: 1 `lint/complexity/useOptionalChain`.
51
+ - `src/observability/logger.ts`: 1
52
+ `lint/correctness/noUnusedPrivateClassMembers`.
53
+ - 15 files received import-reorder auto-fixes (mostly grouping
54
+ `import type` vs `import` and sort order). Zero behavioral
55
+ change — typecheck + smoke + npm test all green post-fix.
56
+
10
57
  ## [v04.00.02] — 2026-05-15
11
58
 
12
59
  **Patch — Codex second-pass audit close-out (6 findings).** v4.0.1 closed 8
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-default-smoke.js","sourceRoot":"","sources":["../../scripts/runtime-default-smoke.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,+DAA+D;AAC/D,mEAAmE;AACnE,wEAAwE;AACxE,wEAAwE;AACxE,sEAAsE;AACtE,0DAA0D;AAC1D,EAAE;AACF,gBAAgB;AAChB,0EAA0E;AAC1E,0EAA0E;AAC1E,wDAAwD;AACxD,yEAAyE;AACzE,4DAA4D;AAC5D,oEAAoE;AACpE,0EAA0E;AAC1E,2BAA2B;AAC3B,uDAAuD;AACvD,EAAE;AACF,qEAAqE;AACrE,yDAAyD;AACzD,oCAAoC;AACpC,8CAA8C;AAC9C,oCAAoC;AACpC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAGhF,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,2BAA2B,KAAK,GAAG,CAAC;AAChE,IAAI,CAAC,OAAO,EAAE,CAAC;IACb,OAAO,CAAC,GAAG,CACT,0FAA0F,CAC3F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED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H,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE,CAAC;IAC/B,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,MAAM,YAAY,EAAE,CAAC;IACvB,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,gCAAgC,IAAI,4CAA4C,CAAC,CAAC;IAChG,CAAC;AACH,CAAC;AAED,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;IACjB,OAAO,CAAC,KAAK,CAAC,2BAA2B,QAAQ,0BAA0B,CAAC,CAAC;IAC7E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AACD,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC"}
@@ -3842,26 +3842,26 @@ assert.equal(Object.hasOwn(metrics.decision_quality, "undefined"), false);
3842
3842
  assert.equal(stripPerplexityThinkingBlock(cleanJson), cleanJson, "clean JSON without <think> blocks must be returned unchanged");
3843
3843
  // Scenario B: single `<think>` block followed by JSON — strip block,
3844
3844
  // trim whitespace, return JSON.
3845
- const singleThink = "<think>\nLet me reason about this carefully.\nThe evidence shows...\n</think>\n\n" + cleanJson;
3845
+ const singleThink = `<think>\nLet me reason about this carefully.\nThe evidence shows...\n</think>\n\n${cleanJson}`;
3846
3846
  assert.equal(stripPerplexityThinkingBlock(singleThink), cleanJson, "single <think> block must be stripped; trailing JSON preserved");
3847
3847
  // Scenario C: multiple `<think>` blocks (rare but legal) — every
3848
3848
  // occurrence must be removed.
3849
- const multipleThinks = "<think>first thought</think>\nintermediate text\n<think>second thought</think>\n" + cleanJson;
3849
+ const multipleThinks = `<think>first thought</think>\nintermediate text\n<think>second thought</think>\n${cleanJson}`;
3850
3850
  const strippedMultiple = stripPerplexityThinkingBlock(multipleThinks);
3851
3851
  assert.ok(!/<think/i.test(strippedMultiple), "multiple <think> blocks must all be stripped");
3852
3852
  assert.ok(strippedMultiple.includes(cleanJson), "multi-think strip must preserve trailing JSON payload");
3853
3853
  // Scenario D: `<think>` block spanning multiple lines with arbitrary
3854
3854
  // whitespace and nested-looking content (no actual nesting since
3855
3855
  // Perplexity never emits nested reasoning blocks).
3856
- const multilineThink = "<think>\n Line 1\n Line 2 with <b>html</b>\n Line 3\n</think>\n" + cleanJson;
3856
+ const multilineThink = `<think>\n Line 1\n Line 2 with <b>html</b>\n Line 3\n</think>\n${cleanJson}`;
3857
3857
  assert.equal(stripPerplexityThinkingBlock(multilineThink), cleanJson, "multi-line <think> with arbitrary indentation must strip cleanly");
3858
3858
  // Scenario E: `<think>` with attribute-like content (`<think foo="bar">`)
3859
3859
  // — regex must allow attribute fragment before close `>`.
3860
- const attributedThink = '<think foo="bar">reasoning</think>\n' + cleanJson;
3860
+ const attributedThink = `<think foo="bar">reasoning</think>\n${cleanJson}`;
3861
3861
  assert.equal(stripPerplexityThinkingBlock(attributedThink), cleanJson, "<think> tag with attribute fragment must still strip");
3862
3862
  // Scenario F: empty `<think></think>` (degenerate case) — strip + trim
3863
3863
  // still yields the trailing JSON.
3864
- const emptyThink = "<think></think>\n" + cleanJson;
3864
+ const emptyThink = `<think></think>\n${cleanJson}`;
3865
3865
  assert.equal(stripPerplexityThinkingBlock(emptyThink), cleanJson, "empty <think></think> must strip cleanly");
3866
3866
  // Scenario G: only `<think>` block, no trailing JSON — output is empty
3867
3867
  // string after trim (caller's downstream parser then triggers
@@ -6015,7 +6015,7 @@ assert.equal(Object.hasOwn(metrics.decision_quality, "undefined"), false);
6015
6015
  // 5 sites must use `.max(PEERS.length)`.
6016
6016
  const maxPeersLen = serverSrcA.match(/\.max\(PEERS\.length\)/g) ?? [];
6017
6017
  assert.ok(maxPeersLen.length >= 5, `v3.7.0 / AUDIT-3: expected >=5 .max(PEERS.length) sites (4 peers panels + judge_peers), found ${maxPeersLen.length}`);
6018
- assert.ok(!/\.min\(1\)\s*\n?\s*[^]*?\.max\(5\)\s*\n?\s*\.default\(\[\.\.\.PEERS\]/.test(serverSrcA), "v3.7.0 / AUDIT-3: the peers schema must NOT keep the stale `.max(5)` against a 6-element PEERS default");
6018
+ assert.ok(!/\.min\(1\)\s*\n?\s*[\s\S]*?\.max\(5\)\s*\n?\s*\.default\(\[\.\.\.PEERS\]/.test(serverSrcA), "v3.7.0 / AUDIT-3: the peers schema must NOT keep the stale `.max(5)` against a 6-element PEERS default");
6019
6019
  assert.ok(!/judge_peers: z\.array\(PeerSchema\)\.min\(2\)\.max\(5\)/.test(serverSrcA), "v3.7.0 / AUDIT-3: judge_peers must NOT keep the stale `.max(5)`");
6020
6020
  // AUDIT-4.
6021
6021
  assert.ok(/PEERS\.filter\(\(peer\) => runtime\.config\.peer_enabled\[peer\]\)/.test(serverSrcA), "v3.7.0 / AUDIT-4: server_info.financial_controls must compute readiness over the enabled peer subset");