## Summary
- Refactor for readability + add tests
- Allow small agent-branch PRs to reach Tier 2 (< 50 prod lines, ≤ 3 files)
- Add cross-layer detection to keep multi-package changes at Tier 3+
- Raise Tier 2 ceiling from 100 → 150 production lines
- Exclude test and changeset files from line counts used for tier decisions
- Extract pure classification logic into .github/scripts/ for testability
- Gate classify job on tests passing in pr-triage.yml
- Only CI changes to main.yaml and release.yaml are tier 4
- Test changes in critical paths don't count toward tiering decisions
## Summary
Simplify the knip GitHub Action and expand where it runs:
- **Remove main-branch comparison** — knip now reports all issues found on the current branch rather than diffing against main. This makes the output more straightforward and actionable.
- **Fail on errors** — the job calls `core.setFailed()` when knip finds issues, so the check shows as failed on the PR.
- **Run on push to main** — added `push` trigger so knip also runs when commits land on main.
- **Support fork PRs** — on fork PRs, the GITHUB_TOKEN can't write to the base repo, so the action skips PR commenting and logs results to the Actions console instead.
### How to test locally or on Vercel
1. Open a PR from a non-fork branch — knip should comment on the PR with results
2. Push to main — knip should run and log results to the Actions console without attempting to comment
3. (Fork PR) — knip should run, log results to the console, and skip commenting
### References
- Related PRs:
## Summary
Resolve all remaining knip issues — removes unused exports/types, adds missing direct dependencies, deletes dead code, and updates knip config.
**Dependency fixes:**
- Root: swapped unused `eslint-config-next`/`eslint-plugin-react-hooks` for actually-imported `@eslint/js`, `typescript-eslint`, `tslib`
- App: added directly-used transitive deps (`@codemirror/*`, `react-resizable`, `postcss-simple-vars`, `rimraf`, `serve`, `@next/eslint-plugin-next`, `eslint-plugin-react`); removed unused `@storybook/react`
**Dead code removal:**
- Removed ~100 unused exports/types across api and app packages (removed `export` keyword where used locally, deleted entirely where not)
- Fixed duplicate `DBRowTableIconButton` default+named export; updated consumers to use named import
**knip.json updates:**
- Added `fixtures.ts` entry point and `opamp/**` ignore for api package
- Excluded `enumMembers` and `duplicates` issue types
- Enabled `ignoreExportsUsedInFile`
### How to test locally or on Vercel
1. `yarn install && yarn knip` — should produce zero output
2. `make ci-lint` — all packages pass
3. `make ci-unit` — all unit tests pass
## Summary
Adds [Knip](https://knip.dev) to the monorepo to detect unused files, dependencies, and exports. The goal is to reduce dead code over time and prevent new unused code from accumulating.
**What's included:**
- Root-level `knip.json` configured for all three workspaces (`packages/app`, `packages/api`, `packages/common-utils`)
- `yarn knip` and `yarn knip:ci` scripts for local and CI usage
- GitHub Action (`.github/workflows/knip.yml`) that runs on every PR to `main`, compares results against the base branch, and posts a summary comment showing any increase or decrease in unused code
- Removed the previous app-only `packages/app/knip.json` in favor of the monorepo-wide config
**How the CI workflow works:**
1. Runs Knip on the PR branch
2. Checks out `main` and runs Knip there
3. Compares issue counts per category and posts/updates a PR comment with a diff table
This is additive — Knip runs as an informational check and does not block PRs.