Skip to content

chore: replace knip with fallow and gate site PRs on fallow audit - #31634

Draft
DanielleMaywood wants to merge 1 commit into
site-dead-code-cleanupfrom
fallow-audit-experiment
Draft

DanielleMaywood wants to merge 1 commit into
site-dead-code-cleanupfrom
fallow-audit-experiment

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Replaces knip with fallow for site/ and makes make lint fail on the complexity and dead code a PR introduces.

  • pnpm lint runs fallow dead-code instead of knip, and lint:fix runs fallow fix. site/.knip.jsonc is replaced by site/.fallowrc.jsonc. The entry points and ignores carry over, and vendored code in src/vendor/ is excluded.
  • Type-aware analysis is on (typeAware.enabled). It confirms symbol use through the TypeScript checker, so class members that are passed by reference are not reported as unused, and no suppressions are needed. Its private-type-leaks rule is off: fixing it meant exporting 436 types, most of them with no consumer.
  • make lint/ts/new-code, part of make lint, runs fallow audit against TS_LINT_NEW_CODE_BASE, the same way lint/go/new-code checks Go. The base defaults to origin/main. The CI lint job sets it to HEAD^1 on PRs and HEAD otherwise. The audit fails on new complexity (fallow's default thresholds: cyclomatic 20, cognitive 15) and on new dead code. It also fails when a change makes a function that is already over a threshold more complex (audit.worsened: "error"). New duplication only warns. Findings that already exist on the base do not fail.
  • The frontend-deep-review role files now name fallow where they named knip. dpdm stays as it is.

Stacked on #31690, which fixes the findings fallow reports that knip did not, and on #31689.

Evaluation and decision log

How often the gate would have blocked recent PRs

The audit ran again on the last 60 PRs that touched site/src, with the default thresholds:

  • 12 PRs added a function over a threshold. Examples: ComputerRenderer at cyclomatic 21 and cognitive 34, SubagentTool at 23/31, ProjectSkillEditorView at 21/28, and an arrow function in QueuedMessagesList at 25/20.
  • 21 PRs made a function that was already over a threshold more complex, for example AgentChatInput, at cyclomatic 169.
  • On main, 395 functions are over the thresholds. They are inherited, so they do not block PRs.

Run time

  • fallow dead-code takes about 1 s when there is nothing to verify, and about 9 s when the type checker has candidates to check.
  • fallow audit takes about 15 to 22 s with type-aware analysis, and about 5 to 8 s without it.

Decisions

  • fallow replaces knip, and no fallow check is disabled because another tool also covers it.
  • The audit runs inside the existing lint job, the way knip did, not in its own workflow.
  • typeAware.require: "complete" is not used. It fails on any member that has a doc comment or is accessed dynamically. If the checker cannot run, the class-member false positives come back as errors, so pnpm lint fails anyway.
  • No inline annotations are posted. Findings print in the lint job log.

🤖 This PR was generated by Coder Agents on behalf of @DanielleMaywood.

@DanielleMaywood DanielleMaywood added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Nov 2, 2026
@DanielleMaywood DanielleMaywood changed the title chore: add experimental report-only fallow audit for site chore: replace knip with fallow and gate site PRs on fallow audit Nov 2, 2026
pnpm lint runs fallow dead-code with type-aware analysis instead of
knip. make lint gains lint/ts/new-code, which runs fallow audit against
TS_LINT_NEW_CODE_BASE and fails on complexity and dead code that the
change introduces, or on functions over a complexity threshold that
the change makes more complex.
@DanielleMaywood
DanielleMaywood force-pushed the fallow-audit-experiment branch from 0b72a48 to 69a5cb8 Compare November 3, 2026 11:00
@DanielleMaywood
DanielleMaywood changed the base branch from main to site-dead-code-cleanup November 3, 2026 11:01

This branch has not been deployed

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

Labels

experimental Changes that might not necessarily be merged, until its approved to proceed with.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant