Skip to content

chore(lint): every @deprecated names its removal version — lint:deprecations in CI, CONTRIBUTING rule #1510

Closed

Description

@admarble

Epic: graph-2026-10-fundamentals Tier: mechanical Execution: sequant_run Blocked by: #1503

Problem

18 @deprecated JSDoc tags exist in non-test source; none names a removal in a parseable form (two mention a version loosely). Deprecation here is a label, not a lifecycle stage: nothing is ever scheduled out, which is how 6 commands, 64 of 89 flags and 26 of 65 settings reached zero use while still shipping (usage-audit.md). The rule is small: a @deprecated tag says remove in vX.Y. Default version for the 18 tags is the next minor after package.json's current version; the owner may raise any of them on the PR. Nothing is removed here (F-10, D-2).

Acceptance Criteria

  • AC-1: The lint passes. Evidence: npm run lint:deprecations > /dev/null 2>&1 && echo ok → ok
  • AC-2: No unversioned tag remains. Evidence: grep -rn '@deprecated' src bin --include='*.ts' | grep -v '\.test\.' | grep -vcE 'remove in v[0-9]+\.[0-9]+' → 0
  • AC-3: The lint fails on an unversioned tag. Evidence: npx vitest run scripts/lint-deprecations.test.ts → ≥ 2 passed, 0 failed (a temp file with @deprecated and no version → exit 1 naming the file:line; with remove in v3.1 → exit 0)
  • AC-4: CONTRIBUTING states the rule. Evidence: grep -c 'remove in v' CONTRIBUTING.md → ≥ 1
  • AC-5: CI runs it. Evidence: grep -c 'lint:deprecations' .github/workflows/ci.yml → ≥ 1
  • AC-6: The baseline moves down with the PR. Evidence: jq '.deprecatedWithoutRemoval' scripts/qa/health-baseline.json → 0

Prior fixes / producers

  • Prior fixes: none (gh issue list --state all --search "deprecat removal version" returns no lifecycle issue). Isolated.
  • Producers of @deprecated tags: 18 sites across src/, bin/; this node edits the tag text only.

May touch

scripts/lint-deprecations.ts (new), scripts/lint-deprecations.test.ts (new), package.json (one lint:deprecations script line), .github/workflows/ci.yml (one line in validate-skills or a new job, appended), CONTRIBUTING.md (one paragraph), the 18 tag lines, scripts/qa/health-baseline.json (I-4).

Non-Goals

  • Removing anything (F-10, D-2).
  • Deprecating anything new.
  • No edits under plugin/, .claude/skills/, templates/skills/ (I-1).

Done when

Every @deprecated in the tree names the release that removes it, and CI rejects one that does not.

Activity

  1. added
    graph-2026-10-fundamentals
    on Oct 18, 2026
  2. admarble commented on Oct 20, 2026

    @admarble
    ContributorAuthor

    Runner context, 2026-10-20, before launch (fundamentals W2; stop-at-PR; mechanical tier). main = 10fe972 (#1504 merged: batch-executor.ts and log-writer.ts changed today; merge origin/main before editing them).

    Choosing each removal version. The issue doesn't fix it, so apply this rule and list every tag in the PR body as a table (file:line, symbol, user-visible yes/no, version chosen, one-line reason) for owner review:

    • User-visible (exported from src/index.ts, a settings key, a CLI command or flag, an MCP tool param): remove in v3.0. Removing it breaks users, so it waits for a major.
    • Internal only (not reachable through any of the above): remove in v2.22.
    • If unsure, choose v3.0 and say why.

    The package is at 2.20.0 today. Do not remove or newly deprecate anything (Non-Goals).

    For every phase, and the qa phase by name: run the full suite at most once, in the foreground, under timeout, after a WIP commit. Each MCP-dispatched phase has a 30-minute wall. Prefer the targeted npx vitest run <files> for the ACs.
    CHANGELOG: add [Unreleased] lines under the existing ### Added / ### Changed headings, not changelog.d/ fragments, and never add a second heading of the same name.
    Lint: #1503 made no-unused-vars, no-empty-object-type and prefer-const errors, and knip counts unused exports. Don't export what nothing imports.
    Health baseline: regenerate scripts/qa/health-baseline.json (npx tsx scripts/qa/health-report.ts --write-baseline) only to record a metric that went down. If npm run lint:health reports a rise, restructure so it holds. Otherwise leave the baseline alone and name the rise in the PR body. Owner ruling: a proseGate.lines rise caused by tests in files that mention SKILL.md only as a path may be absorbed, and must be said so.
    Freeze: nothing under plugin/, .claude/skills/ or templates/skills/.

  3. admarble commented on Oct 20, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (6 ACs, 6 directories)

    AC Quality Check

    All six ACs are single-line with a command-shaped Evidence:. Run against today's base:

    • AC-1 (npm run lint:deprecations): script doesn't exist → fails today. Good.
    • AC-2 (grep count 0): prints 18 today → fails today. Good. It is per-line, so remove in vX.Y must sit on the same line as @deprecated. Six tags are followed by prose on the next line, so the version goes on the tag line.
    • AC-3 (test file): doesn't exist → fails today. Good.
    • AC-4 / AC-5: remove in v / lint:deprecations absent from CONTRIBUTING.md and ci.yml today (to confirm at exec). Fail today.
    • AC-6 (jq → 0): baseline is 18 today. Fails today. Good.
    • Weak spot: AC-2's grep matches the literal @deprecated in lint-script or test files only if they live under src/bin; they live in scripts/, so no self-match.

    Scope Assessment

    Non-Goals: present (no removals, no new deprecations, nothing under plugin/, .claude/skills/, templates/skills/).

    Metric Value Status
    Feature count 1 ✅
    AC items 6 ✅
    Directory spread 6 (src/lib, scripts, scripts/qa, .github, root docs, package.json) ⚠️ (mostly one-line edits)

    Verdict: ✅ SCOPE_OK

    Acceptance Criteria

    AC-1: lint passes

    Verification: Integration Test (CLI) — Given the tagged tree → When npm run lint:deprecations → Then exit 0.

    AC-2: no unversioned tag

    Verification: Integration Test (CLI grep) — Then count 0.

    AC-3: lint fails on unversioned tag

    Verification: Unit Test — scripts/lint-deprecations.test.ts, ≥2 cases: temp file with bare @deprecated → exit 1 naming file:line; with remove in v3.1 → exit 0.

    AC-4: CONTRIBUTING states the rule

    Verification: Manual Test (grep ≥1).

    AC-5: CI runs it

    Verification: Manual Test (grep ≥1 in ci.yml).

    AC-6: baseline moves to 0

    Verification: Integration Test — jq → 0, and npm run lint:health stays green.

    Implementation Plan

    Phase 1: Lint (AC-1, 3, 5)

    1. scripts/lint-deprecations.ts: walk src and bin for *.ts excluding *.test.*; per line containing @deprecated, require /remove in v\d+\.\d+/ on the same line (the exact rule health-report.ts:262 already counts, so lint and metric agree). Print file:line per violation, exit 1. Export the checking function with a root-dir arg; don't export anything nothing imports (knip).
    2. scripts/lint-deprecations.test.ts: temp-dir cases (bare tag → 1 + file:line; versioned → 0), plus a no-tags case.
    3. package.json: "lint:deprecations": "npx tsx scripts/lint-deprecations.ts". ci.yml: append a step next to lint:skill-sync in validate-skills.

    Phase 2: Tag the 18 sites (AC-2, 6)

    1. Append remove in vX.Y to each tag line (rule from the runner comment: user-visible → v3.0, internal → v2.22, unsure → v3.0). Proposed classification (verify exports at exec):
      • v3.0 (exported from src/index.ts): 6× assess-comment-parser.ts (re-exported at index.ts:120-129), phase-signal.ts:36, state-manager.ts:645 (StateManager is exported), state-schema.ts:357, agent-driver.ts:58,96 (check if the type is exported), settings.ts:62 (settings key agents.model → v3.0).
      • v3.0: solve-comment-parser.ts:4 (module; check for a public export or solve alias), ci/types.ts:40 (check export).
      • Probably v2.22 (internal): shutdown.ts:206,214, log-writer.ts:71, batch-executor.ts:602 (re-exported only via commands/run-compat; confirm that isn't public API).
      • batch-executor.ts and log-writer.ts changed in feat(run): a dropped error leaves a trace — noteSuppressed() counts into the run log, batch-executor's 25 silent catches converted #1504: merge origin/main before editing.
    2. PR body: table of every tag (file:line, symbol, user-visible y/n, version, reason).
    3. CONTRIBUTING.md: one paragraph stating "a @deprecated tag says remove in vX.Y, on the tag line". CHANGELOG [Unreleased] line under the existing ### Changed heading.
    4. Regenerate the baseline with npx tsx scripts/qa/health-report.ts --write-baseline (deprecatedWithoutRemoval 18 → 0 is a decrease); check the diff touches only that metric.

    Design Review

    1. Where does this belong? scripts/lint-*.ts plus an npm script and CI step, the same shape as the other lint:* checks.
    2. Simplest approach: a line-based regex scan, with no TS AST. Rejected: an AST/JSDoc parse (the multi-line tag text doesn't need it) and extending health-report.ts (a metric isn't a gate).
    3. Pattern / re-patch count: follows lint-skill-calls. No prior deprecation-lifecycle fixes (issue search empty, per the issue). The regex already exists in health-report.ts:262. Two copies of one rule: have the lint import a shared constant only if that costs nothing in exports. Otherwise add a parity case to the test and note it.
    4. Senior challenge: "Why v3.0 for most?" The user-visible rule from the runner comment; the owner reviews the table.
    5. Producers/consumers: producers are the 18 tags. Consumers are health-report.ts (counter, baseline) and the new lint. Two consumers share one regex; the parity test covers it.

    Feature Quality Planning

    All standard checks pass. Notable items:

    • Gate-test mutation verification (CLAUDE.md): AC-3 is a gate test. Delete the version check from the lint, confirm the "bare tag → exit 1" case fails, restore, and record Mutation-verified: AC-3 — …; scripts/lint-deprecations.test.ts > … failed; restored. in the PR body (file path first, per the marker format).
    • Freeze: nothing under plugin/, .claude/skills/, templates/skills/.
    • Don't run the full suite more than once (foreground, timeout, after a WIP commit); use targeted vitest.
    • The new test is in scripts/ — check vitest project membership for the 5 s timeout (name has no .integration.).

    Open Questions

    1. Does the -compat re-export or index.ts make batch-executor.ts:602, shutdown.ts, log-writer.ts:71 public? Recommendation: v2.22 only if not reachable from src/index.ts, a settings key, a CLI flag or an MCP param; otherwise v3.0. Impact: a wrong v2.22 schedules a breaking removal early (owner reviews the table).

    Recommended Workflow

    Phases: exec → qa
    Quality Loop: disabled
    Reasoning: Mechanical tier. AC-3 declares a unit test, but it is a single small lint test written alongside the script, so testgen adds nothing. No UI.

    Label Review

    Current: graph-2026-10-fundamentals. Recommended: add planned. Quality Loop: won't auto-enable (SCOPE_OK).

  4. added
    planned
    on Oct 20, 2026
  5. admarble commented on Oct 20, 2026

    @admarble
    ContributorAuthor

    QA Verdict: AC_MET_BUT_NOT_A_PLUS

    AC coverage: 6/6 met

    Gaps:

    • The lint and health-counter regexes can drift apart without any test failing
    • The appended removal version splits JSDoc sentences in 7 multi-line tags; putting it right after @deprecated reads better
    • In 7 multi-line tags, (remove in vX.Y) now sits in the middle of a sentence and splits it. For example, settings.ts:62 reads …Subagents (remove in v3.0) and the sentence continues on the next line. Other examples are agent-driver.ts:58,96, state-manager.ts:645, state-schema.ts:357 and batch-executor.ts:602. The fix is to put the version right after @deprecated (@deprecated remove in v3.0. Use …) or at the end of the tag's first clause. This is cosmetic; the lint passes either way.
    • The regex exists in two places (scripts/lint-deprecations.ts:23 and scripts/qa/health-report.ts:262), and no parity test checks they stay the same. The spec asked for a parity case if they weren't shared.
  6. added a commit that references this issue on Oct 20, 2026
  7. admarble commented on Oct 20, 2026

    @admarble
    ContributorAuthor

    Execution Verification (runner, 2026-10-20), PR #1568 @ 4e6d809

    After merging main (through #1512), the runner re-ran the ACs:

    • AC-1: ok
    • AC-2: 0
    • AC-3: 3 passed
    • AC-4: 1
    • AC-5: 1
    • AC-6: 0
    • Lint green; build exit 0; lint:health shows no rise.

    Fixed from QA's findings:

    • One regex. REMOVAL_VERSION_RE is now exported from scripts/lint-deprecations.ts and imported by health-report.ts, so the two can't drift. This replaces the parity test QA asked for.
    • The version leads every tag: @deprecated (remove in vX.Y) …. This applies to all 18 tags, so none splits a sentence.
    • CONTRIBUTING states the rule actually applied. Anything users can reach (an export from src/index.ts, a settings key, a CLI command or flag, an MCP tool param) gets v3.0. Internals get the minor after the next one (v2.22 while 2.20 is current). The earlier text said "next minor", which would be v2.21.

    For the owner: the PR body's per-tag table lists each version choice. agent-driver.ts:58 (sessionId) is marked 'unsure' and got v3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    graph-2026-10-fundamentalsplanned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions