Skip to content

Adopt local quality-tooling standard - #49

Merged
ckelsoe merged 1 commit into
mainfrom
chore/quality-tooling-standard
Aug 10, 2026
Merged

ckelsoe merged 1 commit into
mainfrom
chore/quality-tooling-standard

Conversation

@ckelsoe

@ckelsoe ckelsoe commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What

Rolls the local quality-tooling standard onto annoteca.

Tooling: type-checked eslint (recommendedTypeChecked + the curated sonarjs BUG allowlist), full strict tsconfig with skipLibCheck and noFallthroughCasesInSwitch, husky pre-commit, knip, type-coverage (atLeast: 99), and Stryker (npm run test:mutation, on demand). Prettier was already adopted. Adds the template check-submission.mjs (with the as Window ban) and .coderabbit.yaml.

Dependencies: removes the legacy blanket ajv override (ajv resolves patched on its own; no scoped override) and adds the qs ^6.15.2 floor Stryker's dep tree needs. OSV clean.

Findings the tooling surfaced, all fixed and test-verified

  • strictFunctionTypes: widened the editorCallback / editor-menu params to MarkdownFileInfo, the wider type Obsidian actually passes. The downstream methods already accept it, so no call site narrows.
  • Real always-false comparison: removed a dead match.index === undefined guard in the fence parser (match.index is always defined for matchAll).
  • Three super-linear (ReDoS) regexes: rewrote the <!-- opener escape/unescape/reguard patterns and the fence-line matcher to linear equivalents (atomic-group emulation for the fence). 288 parser + import tests confirm identical behavior.
  • require-await: made the sync view lifecycle methods non-async and dropped the pointless async on the composer submit path.
  • Duplication: extracted IndexBackedListView for the shared list-view onOpen, and shared tfile / target test helpers.
  • knip (unused exports): dropped unused exports, and used the INDEX_ENTRY_CATEGORY constant in settings.ts instead of an inline duplicate of it.

Verification

eslint, prettier, check-submission, marketplace typecheck, tsc --noEmit, 808 tests, type-coverage 99.96%, OSV clean. The husky hook blocks a bad commit. No user-facing behavior change, so no version bump.

Follow-up (non-gate)

Stryker instruments cleanly with no ajv error, but its dry-run needs the jsdom test env wrapped in Stryker's coverage mixin before a mutation baseline runs. Same "baseline pending" state as icon-palette; tracked separately.

Roll the fleet quality-tooling standard onto annoteca: type-checked eslint
(recommendedTypeChecked plus the curated sonarjs BUG allowlist), full strict
tsconfig, husky pre-commit, knip, type-coverage, and Stryker. Prettier was
already adopted. Add the template check-submission.mjs (with the as Window ban)
and .coderabbit.yaml.

Remove the legacy blanket ajv override (ajv resolves patched on its own; no
scoped override) and add the qs floor Stryker's dep tree needs. OSV clean.

Fix every finding the new tooling surfaces, verified by the test suite:
- Widen the editorCallback and editor-menu params to MarkdownFileInfo so
  strictFunctionTypes accepts them; the downstream methods already take it.
- Remove a dead always-false match.index check in the fence parser.
- Rewrite three super-linear regexes (the opener escape, unescape, and reguard
  patterns, and the fence-line matcher) to linear equivalents.
- Make the sync view lifecycle methods non-async and drop the pointless async on
  the composer submit path.
- Extract IndexBackedListView for the shared list-view onOpen, plus shared test
  helpers, removing duplicate functions.
- Clear knip: drop unused exports, and use the INDEX_ENTRY_CATEGORY constant in
  settings instead of an inline duplicate.

No user-facing behavior change.
Copilot AI lite review requested due to automatic review settings August 10, 2026 15:25
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Ignoring CodeRabbit configuration file changes. For security, only the configuration from the base branch is applied for open source repositories.

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved parsing reliability for formatted content and malformed markers.
    • Improved navigation and selection handling for comments and indexed views.
    • Added safeguards to detect unsupported type assertions and compatibility issues earlier.
  • Refactor

    • Streamlined shared view behavior and refresh handling.
    • Simplified submission and editor interaction flows without changing expected functionality.
  • Chores

    • Strengthened linting, type checking, code-quality analysis, and automated review checks.
    • Added mutation testing and coverage validation to improve release confidence.

Walkthrough

The pull request refines Markdown fence and opener parsing, consolidates editor and view lifecycle behavior, reduces public module surface, reuses shared settings and test helpers, and adds static analysis, mutation testing, type coverage, commit, and submission checks.

Changes

Core code changes

Layer / File(s) Summary
Parser and module boundary updates
imports.ts, parser.ts, frontmatter-summary.ts, types.ts
Fence matching and opener escaping use revised regular expressions and replacements. Internal constants and AnchorTier are no longer exported.
Editor targeting and view lifecycle
main.ts, views.ts, composer.ts
Editor callbacks use MarkdownFileInfo. Selection opening delegates to cursor opening. Index-backed views share refresh behavior. Composer submission is synchronous.
Shared settings and test fixtures
settings.ts, __tests__/comment-service.test.ts, __tests__/orphan-stars.test.ts
Settings reuse INDEX_ENTRY_CATEGORY. Tests reuse shared comment-target and TFile helpers.

Repository quality tooling

Layer / File(s) Summary
Static analysis and test tooling
package.json, tsconfig.json, eslint.config.mts, knip.json, stryker.config.mjs
The repository adds type-aware linting, SonarJS rules, Knip, Stryker, type coverage, and stricter compiler checks.
Repository enforcement and submission checks
.coderabbit.yaml, .husky/pre-commit, .gitignore, scripts/check-submission.mjs
Review and commit behavior is configured. Mutation artifacts are ignored. Submission scanning rejects Window type assertions and documents scan behavior.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: copilot-pull-request-reviewer

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the PR's main change: adopting the project's local quality-tooling standard.
Description check ✅ Passed The description directly explains the tooling adoption, dependency changes, fixes, and verification results covered by the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Rolls a standardized local “quality tooling” stack onto Annoteca (type-aware ESLint, stricter TypeScript, submission checks, and optional analysis tools) and applies the resulting cleanup/refactors across the plugin to keep the codebase passing gates.

Changes:

  • Adopt type-aware ESLint + curated sonarjs bug rules, and move TS config to strict with additional safety flags.
  • Add optional developer tooling (Husky pre-commit, Knip, type-coverage, Stryker) and supporting configs.
  • Refactor a few modules to remove unused exports / unnecessary async and deduplicate view logic.

Reviewed changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
views.ts Deduplicates shared list-view onOpen wiring and removes re-exports of view-utils helpers.
types.ts Removes an unused exported type alias from the public surface.
tsconfig.json Switches to strict and adds additional compiler safety flags.
stryker.config.mjs Adds on-demand mutation testing configuration.
settings.ts Reuses INDEX_ENTRY_CATEGORY and makes some helpers internal-only.
scripts/check-submission.mjs Extends submission pre-checks (regex lookbehind + Window assertion ban) and clarifies rationale.
parser.ts Rewrites opener-escape regex handling for linear behavior and tightens a dead guard in matchAll.
package.json Adds scripts and dev tooling configuration (knip, type-coverage, Stryker, husky).
package-lock.json Locks new dev-tool dependencies and updates transitive dependency graph.
knip.json Adds Knip configuration scaffold.
imports.ts Rewrites fence-line regex to avoid super-linear backtracking.
frontmatter-summary.ts Makes internal constants non-exported.
eslint.config.mts Enables type-aware ESLint presets and adds sonarjs bug-focused ruleset.
composer.ts Removes unnecessary async on synchronous submit path and internalizes a helper.
.husky/pre-commit Adds a deterministic local pre-commit gate script.
.gitignore Ignores Stryker sandbox and mutation reports.
.coderabbit.yaml Configures CodeRabbit review behavior for this repo.
tests/orphan-stars.test.ts Deduplicates a minimal TFile stand-in helper across test cases.
tests/comment-service.test.ts Deduplicates a shared “target comment” helper for multi-marker fixtures.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .husky/pre-commit
Comment on lines +1 to +7
# Deterministic pre-commit gate. Blocks the commit if any check fails:
# - eslint (incl. type-aware no-unsafe-* and async-safety rules)
# - prettier --check
# - submission pre-checks
# - full type-check (tsc --noEmit)
# To fix formatting: npx prettier --write "**/*.ts"
npm run lint && npx tsc --noEmit
coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@__tests__/orphan-stars.test.ts`:
- Around line 47-52: Move the shared tfile TFile test-double helper from
orphan-stars.test.ts into a non-test helper file under __tests__, export it
there, and import it into orphan-stars.test.ts. Preserve its current path and md
extension initialization and update all existing usages to use the imported
helper.

In @.husky/pre-commit:
- Around line 1-7: Change the executable permission of the .husky/pre-commit
hook from 100644 to 100755, leaving its lint and TypeScript commands unchanged
so Git runs the pre-commit checks.

In `@scripts/check-submission.mjs`:
- Around line 91-93: Update the submission scanning logic around WINDOW_ASSERT
and the code[index] lookup to detect Window assertions that span multiple
physical lines, while still ignoring comments. Normalize source by logical
statements/tokens or scan non-comment source across newlines, and report the
first original source line where the assertion begins using the existing
findings format.
- Around line 118-125: Update the comment above the built-bundle check to state
that the release flow runs lint before the build, while preserving that this
branch remains opportunistic because it does not execute after the build. Keep
the explanation that the source scan is the primary CI guard and avoid changing
the check’s behavior.
- Around line 50-52: Update the source preprocessing used before WINDOW_ASSERT
is applied so string and template-literal contents are masked while preserving
newline positions and code structure. Ensure withoutComments() or the
corresponding check path excludes literal text from the assertion scan, while
actual as Window casts remain detectable by the code-only checks near line 91.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 56f32489-4d5f-4ca2-bc7b-452230b05203

📥 Commits

Reviewing files that changed from the base of the PR and between bf5d19f and 80c74b3.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • .coderabbit.yaml
  • .gitignore
  • .husky/pre-commit
  • __tests__/comment-service.test.ts
  • __tests__/orphan-stars.test.ts
  • composer.ts
  • eslint.config.mts
  • frontmatter-summary.ts
  • imports.ts
  • knip.json
  • main.ts
  • package.json
  • parser.ts
  • scripts/check-submission.mjs
  • settings.ts
  • stryker.config.mjs
  • tsconfig.json
  • types.ts
  • views.ts

Comment on lines +47 to +52
// Minimal in-memory TFile stand-in shared by the harnesses and cases below.
const tfile = (path: string): TFile => {
const f = new TFile();
Object.assign(f, { path, extension: 'md' });
return f;
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Move the shared TFile test double out of this test file.

__tests__/orphan-stars.test.ts defines tfile as a shared test double. Move it to a non-*.test.ts helper under __tests__/, then import it here.

As per coding guidelines, shared test doubles must be placed in non-*.test.ts files under __tests__/.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@__tests__/orphan-stars.test.ts` around lines 47 - 52, Move the shared tfile
TFile test-double helper from orphan-stars.test.ts into a non-test helper file
under __tests__, export it there, and import it into orphan-stars.test.ts.
Preserve its current path and md extension initialization and update all
existing usages to use the imported helper.

Source: Coding guidelines

Comment thread .husky/pre-commit
Comment on lines +1 to +7
# Deterministic pre-commit gate. Blocks the commit if any check fails:
# - eslint (incl. type-aware no-unsafe-* and async-safety rules)
# - prettier --check
# - submission pre-checks
# - full type-check (tsc --noEmit)
# To fix formatting: npx prettier --write "**/*.ts"
npm run lint && npx tsc --noEmit

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

mode="$(git ls-files --stage -- .husky/pre-commit | awk 'NR == 1 { print $1 }')"

if [ "$mode" != "100755" ]; then
  printf 'Expected .husky/pre-commit to have mode 100755; found %s\n' "$mode"
  exit 1
fi

Repository: ckelsoe/obsidian-annoteca

Length of output: 224


Set the pre-commit hook to executable mode.

.husky/pre-commit is stored as 100644, so Git does not run it. Change the hook mode to 100755 to keep the lint and TypeScript gates enabled.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.husky/pre-commit around lines 1 - 7, Change the executable permission of
the .husky/pre-commit hook from 100644 to 100755, leaving its lint and
TypeScript commands unchanged so Git runs the pre-commit checks.

Comment on lines +50 to +52
const WINDOW_ASSERT = /\bas\s+(?:unknown\s+as\s+)?Window\b/;
const WINDOW_ASSERT_WHY =
"do not type-assert to Window (`as Window`); use Obsidian's activeWindow / activeDocument or proper typing instead.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Files matching check-submission:\n'
fd -a 'check-submission\.mjs$' . || true

printf '\nGit status summary:\n'
git status --short

file="$(fd 'check-submission\.mjs$' . | head -n 1)"
if [ -n "${file:-}" ]; then
  printf '\nLine count:\n'
  wc -l "$file"
  printf '\nOutline:\n'
  ast-grep outline "$file" --view compact || true
  printf '\nRelevant lines 1-110:\n'
  sed -n '1,110p' "$file" | nl -ba
fi

printf '\nSearch WINDOW_ASSERT and comment stripper usages:\n'
rg -n "WINDOW_ASSERT|withoutComments|without[[:space:]']*(Comments|Strings|Literals)|test\\(code" . --glob '!node_modules' --glob '!dist' --glob '!build' || true

Repository: ckelsoe/obsidian-annoteca

Length of output: 538


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="./scripts/check-submission.mjs"

printf 'Lines 1-170:\n'
awk '{printf "%4d\t%s\n", NR, $0}' "$file"

printf '\nRelevant WINDOW/line-check occurrences:\n'
grep -n -E "WINDOW_ASSERT|withoutComments|test\\(code|const code =|for \\(|match" "$file"

Repository: ckelsoe/obsidian-annoteca

Length of output: 9612


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Behavioral probe of WINDOW_ASSERT with comment-stripped literals:\n'
node - <<'JS'
const source = `
let a = "convert this as Window";
let b = \`convert this as Window\`;
let c = 'convert this as Window';
let d = /* convert this as Window */ 1;
let e = value as Window;
let f = value as unknown as Window;
`;
const WINDOW_ASSERT = /\bas\s+(?:unknown\s+as\s+)?Window\b/;
function withoutComments(source) {
  return source
    .replace(/\/\*[\s\S]*?\*\//g, m => m.replace(/[^\n]/g, " "))
    .split(/\r?\n/)
    .map(line => line.replace(/\/\/.*$/, ""));
}
const code = withoutComments(source);
code.forEach((line, index) => {
  if (WINDOW_ASSERT.test(line)) {
    console.log(`${index + 1}: ${line.trim()}`);
  }
});
JS

printf '\nCheck whether source repo has any current WINDOW_ASSERT false positives outside comments:\n'
node - <<'JS'
const { readdirSync, readFileSync } = require("node:fs");
const { execSync } = require("node:child_process");
const SKIP_DIRS = new Set(["node_modules", ".git", "dist", "build", "scripts"]);
const CODE_EXT = /\.(ts|mts|cts|tsx|js|mjs|cjs)$/;
const WINDOW_ASSERT = /\bas\s+(?:unknown\s+as\s+)?Window\b/;

function walk(dir) {
  const paths = [];
  for (const entry of readdirSync(dir, { withFileTypes: true })) {
    const path = `${dir}/${entry.name}`;
    if (entry.isDirectory() && !SKIP_DIRS.has(entry.name)) paths.push(...walk(path));
    if (entry.isFile() && CODE_EXT.test(entry.name)) paths.push(path);
  }
  return paths;
}

for (const file of walk(".")) {
  try {
    const source = readFileSync(file, "utf8");
    const codeLines = source
      .replace(/\/\*[\s\S]*?\*\//g, m => m.replace(/[^\n]/g, " "))
      .split(/\r?\n/)
      .map(line => line.replace(/\/\/.*$/, ""));
    codeLines.forEach((line, index) => {
      if (WINDOW_ASSERT.test(line)) {
        console.log(`${file}:${index + 1}: ${line.trim()}`);
      }
    });
  } catch {}
}
const files = walk(".");
console.log("scanned", files.length, "code files");
JS

Repository: ckelsoe/obsidian-annoteca

Length of output: 520


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Files matching check-submission:\n'
fd -a 'check-submission\.mjs$' . || true

printf '\nGit status summary:\n'
git status --short

file="$(fd 'check-submission\.mjs$' . | head -n 1)"
if [ -n "${file:-}" ]; then
  printf '\nLine count:\n'
  wc -l "$file"
  printf '\nOutline:\n'
  ast-grep outline "$file" --view expanded || true
  printf '\nRelevant lines 1-110:\n'
  sed -n '1,110p' "$file" | awk '{printf "%4d\t%s\n", NR, $0}'
fi

printf '\nSearch WINDOW_ASSERT and comment stripper usages:\n'
rg -n "WINDOW_ASSERT|withoutComments|without[[:space:]']*(Comments|Strings|Literals)|test\\(code" . --glob '!node_modules' --glob '!dist' --glob '!build' || true

Repository: ckelsoe/obsidian-annoteca

Length of output: 7948


Mask string literals before applying WINDOW_ASSERT.

withoutComments() keeps string and template-literal contents, so ordinary text such as "convert this as Window" can trigger this scan while the file has no as Window cast. Mask literals or parse tokens while preserving line positions so the code-only checks at line 91 do not reject valid source.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-submission.mjs` around lines 50 - 52, Update the source
preprocessing used before WINDOW_ASSERT is applied so string and
template-literal contents are masked while preserving newline positions and code
structure. Ensure withoutComments() or the corresponding check path excludes
literal text from the assertion scan, while actual as Window casts remain
detectable by the code-only checks near line 91.

Comment on lines +91 to +93
if (WINDOW_ASSERT.test(code[index] ?? "")) {
findings.push(`${where}: ${WINDOW_ASSERT_WHY}`);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -U '\bas\s+(?:unknown\s+as\s+)?\s*\n\s*Window\b' \
  --glob '*.ts' \
  --glob '*.tsx'

Repository: ckelsoe/obsidian-annoteca

Length of output: 163


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== file outline/preview =="
wc -l scripts/check-submission.mjs
sed -n '1,150p' scripts/check-submission.mjs | cat -n

echo "== all WINDOW_ASSERT usage =="
rg -n "WINDOW_ASSERT|WINDOW_ASSERT_WHY|comment|lookbehind|jsesc|split\\(" scripts/check-submission.mjs

Repository: ckelsoe/obsidian-annoteca

Length of output: 10626


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== package/test references mentioning Window assertion or submission check =="
rg -n "check-submission|WINDOW_ASSERT|lookbehind|lint:release|npm run lint|submission" .github scripts package.json 2>/dev/null || true

echo "== git status/stat =="
git diff --stat || true
git status --short || true

Repository: ckelsoe/obsidian-annoteca

Length of output: 4459


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

node - <<'JS'
const source =
`function f() {
	const value = 1;
	const x = value as unknown as
	Window;
}
`;

const WINDOW_ASSERT = /\bas\s+(?:unknown\s+as\s+)?Window\b/;
const code = source
  .replace(/\/\*[\s\S]*?\*\//g, (m) => m.replace(/[^\n]/g, " "))
  .split(/\r?\n/)
  .map((line) => line.replace(/\/\/.*$/, ""));

console.log(JSON.stringify({
  perLineWindowFound: code.some((line) => WINDOW_ASSERT.test(line)),
  perLineWindowMatches: code.map((line, i) => ({ index: i + 1, line, window: WINDOW_ASSERT.test(line) })),
  fullSourceWindowFound: WINDOW_ASSERT.test(source),
  line: code.length
}));
JS

Repository: ckelsoe/obsidian-annoteca

Length of output: 550


Handle multiline Window assertions in the submission guard.

WINDOW_ASSERT runs on comment-stripped lines, so value as unknown as \| Window is not reported. Normalize source over logical statements/tokens or scan non-comment source through newlines, then report the first original line that starts the assertion.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-submission.mjs` around lines 91 - 93, Update the submission
scanning logic around WINDOW_ASSERT and the code[index] lookup to detect Window
assertions that span multiple physical lines, while still ignoring comments.
Normalize source by logical statements/tokens or scan non-comment source across
newlines, and report the first original source line where the assertion begins
using the existing findings format.

Comment on lines +118 to +125
// Opportunistic, and deliberately NOT the primary check: `main.js` is gitignored,
// so it is absent on a fresh checkout. In CI `npm run lint` runs before
// `npm run build`, and the release flow does not run lint at all, so in current
// automation this branch finds nothing; it fires only when lint runs after a
// build (e.g. locally). The source scan above is the guard that actually holds in
// CI; this adds the one thing sources cannot show, a DEPENDENCY that inlines a
// lookbehind into the bundle. Making automation scan the built bundle would mean
// reordering the workflows to run this after the build (a fleet-wide change).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the release-flow description.

The comment says that the release flow does not run lint. .github/workflows/release.yml runs npm run lint at Lines [39]-[45]. State that release lint runs before the build. The bundle branch remains opportunistic because it does not run after the build.

Proposed wording
-// `npm run lint` runs before
-// `npm run build`, and the release flow does not run lint at all, so in current
+// `npm run lint` runs before
+// `npm run build` in both CI and the release flow, so in current
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Opportunistic, and deliberately NOT the primary check: `main.js` is gitignored,
// so it is absent on a fresh checkout. In CI `npm run lint` runs before
// `npm run build`, and the release flow does not run lint at all, so in current
// automation this branch finds nothing; it fires only when lint runs after a
// build (e.g. locally). The source scan above is the guard that actually holds in
// CI; this adds the one thing sources cannot show, a DEPENDENCY that inlines a
// lookbehind into the bundle. Making automation scan the built bundle would mean
// reordering the workflows to run this after the build (a fleet-wide change).
// Opportunistic, and deliberately NOT the primary check: `main.js` is gitignored,
// so it is absent on a fresh checkout. In CI `npm run lint` runs before
// `npm run build` in both CI and the release flow, so in current
// automation this branch finds nothing; it fires only when lint runs after a
// build (e.g. locally). The source scan above is the guard that actually holds in
// CI; this adds the one thing sources cannot show, a DEPENDENCY that inlines a
// lookbehind into the bundle. Making automation scan the built bundle would mean
// reordering the workflows to run this after the build (a fleet-wide change).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/check-submission.mjs` around lines 118 - 125, Update the comment
above the built-bundle check to state that the release flow runs lint before the
build, while preserving that this branch remains opportunistic because it does
not execute after the build. Keep the explanation that the source scan is the
primary CI guard and avoid changing the check’s behavior.

@ckelsoe
ckelsoe dismissed coderabbitai[bot]’s stale review August 10, 2026 15:56

Dismissing per maintainer decision. CodeRabbit's code review found zero actionable findings; this CHANGES_REQUESTED is driven solely by the org-level Docstring Coverage pre-merge check (71.43 percent vs an 80 percent threshold), which counts JSDoc blocks and not the diff's extensive line comments. The docstring-coverage gate is being addressed in CodeRabbit config, not in this PR. CI check is green.

@ckelsoe
ckelsoe merged commit 51d0735 into main Aug 10, 2026
5 checks passed
@ckelsoe
ckelsoe deleted the chore/quality-tooling-standard branch August 10, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants