chore: remove dead code and duplicate compat shims - #96
Merged
Conversation
Deletes code confirmed to have zero production callers and zero test coverage beyond its own dedicated tests: - wiki-engine/manifest-compiler.ts: comment claimed it's invoked via `teamai codebase --compile`, but that flag was never wired into codebase-cmd.ts. - wiki-engine/doc-graph-extractor.ts: only ever exercised by its own unit test, never wired into the extract/import flow. - utils/source-conflict.ts (recordSourceUpdate): production only reads source-marks.jsonl (codebase-lint.ts has its own independent parser), nothing ever writes to it, so multi-source-conflict detection never had data to work with. - Dead exports: buildCodeGraphIndex/writeCodeGraph (code-graph.ts), scanInterfacesFromFacts (interface-scanner.ts), fromLegacyConfidence (reconciler-v2-types.ts), plus their exclusive private helpers. - save-session CLI command chain (session-collector.ts): never wired into any hook, its `push --sessions` landing path is still only an aspirational line in docs/designs/team-intelligence-platform.md, and it duplicates contribute-check.ts's actively-used per-session state. - utils/gf-cli.ts / utils/repo-url.ts: pure backward-compat re-export shims for providers/tgit/*, referenced only by tests (several of which were mocking the shim path even though the code under test had already migrated to import the provider path directly). - @deprecated CodeGraphIndex type alias: renamed its one remaining usage (codebase-wiki-lint.ts) to GraphIndex directly and dropped the alias — pure type-level change, erased at compile time. Two items from the issue were investigated and deliberately left alone, since both are live code paths rather than confirmed-dead: import-mr.ts still depends on the old docs/team-codebase (applyCodebaseSuggestions) path even though CI's extract-mr.ts has moved to the teamwiki graph engine, and the legacy hidden hook subcommands (TEAMAI_LEGACY_HOOK_SUBCOMMANDS) have no sunset condition recorded anywhere. Both need an explicit maintainer decision rather than a unilateral deletion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Follow-up to the dead-code cleanup: this command and its e2e test were removed, but docs/ci-e2e-setup.md's coverage table still listed it as exercised. docs/designs/team-intelligence-platform.md and CHANGELOG.md intentionally keep their save-session mentions (the former is an aspirational future-design doc, the latter is a historical record of a past release), so only this table needed a fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #86. Batched cleanup of confirmed-dead code and duplicate compat shims:
wiki-engine/manifest-compiler.ts— deleted. Comment claimed it's invoked viateamai codebase --compile, but that flag was never wired intocodebase-cmd.ts; zero importers.wiki-engine/doc-graph-extractor.ts— deleted. Only ever exercised by its own unit test, never wired into the extract/import flow.utils/source-conflict.ts(recordSourceUpdate) — deleted. Production only readssource-marks.jsonl(codebase-lint.tshas its own independent parser); nothing ever wrote to it, so multi-source-conflict detection never had data.buildCodeGraphIndex/writeCodeGraph(code-graph.ts),scanInterfacesFromFacts(interface-scanner.ts),fromLegacyConfidence(reconciler-v2-types.ts), plus their exclusive private helpers — all zero-caller, zero-test-coverage.save-sessionCLI command chain (session-collector.ts) — deleted. Never wired into any hook; itspush --sessionslanding path is still only an aspirational line indocs/designs/team-intelligence-platform.md; duplicatescontribute-check.ts's actively-used per-session state.utils/gf-cli.ts/utils/repo-url.ts— deleted. Pure backward-compat re-export shims forproviders/tgit/*, referenced only by tests (several of which mocked the shim path even though the code under test had already migrated to import the provider path directly — cleaned those up too).@deprecated CodeGraphIndextype alias — removed; renamed its one remaining usage (codebase-wiki-lint.ts) toGraphIndexdirectly. Pure type-level change, erased at compile time.Deliberately left alone (both are live code paths, not confirmed-dead — need a maintainer call, not a unilateral deletion):
docs/team-codebasevsteamwiki/dual-track:import-mr.tsstill calls the oldapplyCodebaseSuggestionson every MR import, whilesrc/ci/extract-mr.tshas already moved to the teamwiki graph engine. No commit/doc declares the old path superseded.TEAMAI_LEGACY_HOOK_SUBCOMMANDSinhooks.ts) — still have real, working CLI handlers kept for migrating old tool-settings configs ontohook-dispatch. No sunset condition recorded anywhere in code or docs.Net: 22 files changed, +5/-1183 lines.
Test plan
npx tsc --noEmit— cleannpx vitest run— 128 test files, 1656 tests passingnpm run build— tsup build succeedsgit log -S/grep that no commit ahead of this branch's base introduces new references to any removed symbol🤖 Generated with Claude Code