chore(comments): drop epic, sprint and review-round ids from the code
The code cited its plan instead of saying why: `E28 review J4`, `(R6 S3b)`, `S1 justified…`,
`deep-review round 5`. That plan lives in the private ops repo, so for every reader of this one the
citation was noise, and a sentence whose subject was the plan step ("round 2 showed…") hid its
lesson behind an id. Each one is gone and the "why" kept: a bare citation is deleted, a sentence
carrying a lesson is reworded around it ("a later attempt showed…").
Measured (`scripts/audit_metrics.py`, product code): 652 lines in 270 files carried an epic code by
the definition the next commit holds (507 / 241 by the old, two-digit-only one) -> 0. Across all
code, tests, scripts and configs: ~1100 epic-code lines plus ~320 sprint/round ids.
Behaviour unchanged, checked mechanically: every changed .py file has the same AST once docstrings
are blanked; css/sh/toml/yml/json files are identical once comments are stripped; the only
non-comment changes in TS/JS are test titles, one description string in a contract table, and five
ESLint messages, whose text is all the gates snapshot diff holds. Not touched: Markdown (docs and
the changelog keep their history), Alembic migrations, TV episode notation (`S2 · E5`), DESIGN.md
ids (`C1`, `B4`, `S3h`), tracker ids (`SEC-16`, `DX-17`).
One stale claim fixed on the way: test_hls_reaper's docstring said the player checkpoints "every
10 s whether or not it is playing", which plex/stream.py calls wrong; it now says what the code does.
This commit is contained in:
@@ -10,7 +10,7 @@ import ts from "typescript";
|
||||
import tseslint from "typescript-eslint";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
// The gate register (docs/gates.md) is held to the EFFECTIVE configuration (E32). A narrowing that
|
||||
// The gate register (docs/gates.md) is held to the EFFECTIVE configuration. A narrowing that
|
||||
// is not on the register fails here — a rule switched off for a scope, a weak compiler flag, a ruff
|
||||
// ignore, a knip exclusion, an accepted CVE. So "the gate checks X" is a claim this test verifies,
|
||||
// not one a comment makes. (The comment that claimed the React Compiler's rules "are also linted"
|
||||
@@ -101,7 +101,7 @@ function restrictedEntries(entry: Linter.RuleEntry | undefined): Set<string> {
|
||||
|
||||
// --- the snapshot ---------------------------------------------------------------------------------
|
||||
// The configs that can narrow a gate in more shapes than a check can enumerate are held to a
|
||||
// COMMITTED SNAPSHOT (E32 review): ESLint's effective config per scope, and the lines that run the
|
||||
// COMMITTED SNAPSHOT: ESLint's effective config per scope, and the lines that run the
|
||||
// lanes. Any change fails until the snapshot is regenerated, so a narrowing arrives as a diff of
|
||||
// `gates.snapshot.json` in review instead of slipping past a detector. (Three review rounds kept
|
||||
// finding shapes the detector this replaced did not model — a `basePath` global ignore, a widened glob
|
||||
@@ -109,7 +109,7 @@ function restrictedEntries(entry: Linter.RuleEntry | undefined): Set<string> {
|
||||
// shape to miss.)
|
||||
//
|
||||
// A scope is named by PATH (`scopeOf`), and every file of a scope must get the same effective config.
|
||||
// So a new file in a known place changes nothing (until E35 the snapshot listed every file, and 31% of
|
||||
// So a new file in a known place changes nothing (the snapshot once listed every file, and 31% of
|
||||
// commits regenerated it), while a glob that moves a file into another config splits its scope and
|
||||
// fails below, and a scope whose rules change is a snapshot diff.
|
||||
//
|
||||
@@ -404,7 +404,7 @@ describe("the gate register (docs/gates.md)", () => {
|
||||
});
|
||||
// `strict: true` is a bundle: a sub-flag set false beside it, an `extends` this test cannot see
|
||||
// through, or a narrowed `include` / an `exclude` weakens the project while the five flags above
|
||||
// still read true (E32 review).
|
||||
// still read true.
|
||||
const STRICT_FAMILY = [
|
||||
"noImplicitAny",
|
||||
"strictNullChecks",
|
||||
@@ -448,7 +448,7 @@ describe("the gate register (docs/gates.md)", () => {
|
||||
.map((f): [string, string] => ["config files", `${f} — not type-checked`]);
|
||||
expect(missingFrom(found)).toEqual([]);
|
||||
// a `.js` in `include` is dropped without a word unless allowJs, and read unchecked without
|
||||
// checkJs (E32 review round 2)
|
||||
// checkJs
|
||||
const opts = jsonc("frontend/tsconfig.node.json").compilerOptions as Record<string, unknown>;
|
||||
if ([...checked].some((f) => /[.][mc]?js$/.test(f)))
|
||||
expect([opts.allowJs, opts.checkJs]).toEqual([true, true]);
|
||||
@@ -457,10 +457,10 @@ describe("the gate register (docs/gates.md)", () => {
|
||||
// --- Ruff -----------------------------------------------------------------------------------------
|
||||
// Ruff, pyright, pytest and knip are read as whitelists: a key this test does not know (an
|
||||
// `extend-exclude`, a `lint.extend-ignore`, a narrowing `select`, a pyright `exclude`, a pytest
|
||||
// `-m "not slow"`, a knip `rules`) fails until someone decides whether it narrows (E32 review —
|
||||
// only `ignore` and the immutable calls used to be read). The TOML is PARSED, not scanned line by
|
||||
// line: a `[lint.per-file-ignores]` table or a quoted key is a key path like any other (E32 review
|
||||
// round 2 — a line regex saw neither).
|
||||
// `-m "not slow"`, a knip `rules`) fails until someone decides whether it narrows (only
|
||||
// `ignore` and the immutable calls used to be read). The TOML is PARSED, not scanned line by
|
||||
// line: a `[lint.per-file-ignores]` table or a quoted key is a key path like any other (a line
|
||||
// regex saw neither).
|
||||
const keyPaths = (o: Record<string, unknown>, prefix = ""): string[] =>
|
||||
Object.entries(o).flatMap(([k, v]) =>
|
||||
v !== null && typeof v === "object" && !Array.isArray(v)
|
||||
@@ -501,7 +501,7 @@ describe("the gate register (docs/gates.md)", () => {
|
||||
// Every ruff lane passes `--config backend/ruff.toml`, which makes ruff ignore any other config
|
||||
// file it would discover (measured: a nested `ruff.toml` selecting the `D` rules changed nothing).
|
||||
// So that flag is what makes this file the whole configuration. The snapshot holds every line of
|
||||
// the gate script; these two are spelled out because the reason is (round 3: a substring check let
|
||||
// the gate script; these two are spelled out because the reason is (a substring check once let
|
||||
// an extra `--config "lint.extend-ignore=…"` override through).
|
||||
it("runs both ruff lanes on backend/ruff.toml and nothing else", () => {
|
||||
const lanes = read("scripts/check.sh")
|
||||
@@ -541,8 +541,8 @@ describe("the gate register (docs/gates.md)", () => {
|
||||
|
||||
// --- pytest ---------------------------------------------------------------------------------------
|
||||
// Held line by line, not key by key: pytest's ini reader also takes `key: value` and indented
|
||||
// continuation lines (`addopts = -q` + ` -m "not slow"`), and a key regex saw neither (E32 review
|
||||
// round 2). Every line that is not blank or a comment must be one of these, and all must be there.
|
||||
// continuation lines (`addopts = -q` + ` -m "not slow"`), and a key regex saw neither.
|
||||
// Every line that is not blank or a comment must be one of these, and all must be there.
|
||||
it("keeps pytest strict: the whole tests/ tree, no selection, no warning filters, --strict-markers", () => {
|
||||
const lines = read("backend/pytest.ini")
|
||||
.split("\n")
|
||||
@@ -572,7 +572,7 @@ describe("the gate register (docs/gates.md)", () => {
|
||||
// the positive pattern is the project itself: narrowing it drops files from the lane
|
||||
expect((cfg.project ?? []).filter((p) => !p.startsWith("!"))).toEqual(["**/*.{ts,tsx,js}"]);
|
||||
// and knip.jsonc is the config knip reads: a knip.json (read first) or a package.json `knip` key
|
||||
// (merged in) would narrow it unseen (E32 review round 3)
|
||||
// (merged in) would narrow it unseen
|
||||
const KNIP_FILES = /^\.?knip(\.config)?\.(json|jsonc|js|ts|mjs|cjs|mts|cts|toml|ya?ml)$/;
|
||||
expect(readdirSync(FRONTEND).filter((f) => KNIP_FILES.test(f))).toEqual(["knip.jsonc"]);
|
||||
expect("knip" in pkg).toBe(false);
|
||||
|
||||
Reference in New Issue
Block a user