feat: SCIP import, git hooks manager, version tracking, CLI enhancements #34
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
src/scip/index.ts):ScipImporterclass with two-pass SCIP JSON processing (definitions first, then references), content-hash fingerprinting for idempotent imports, andfindSCIPFiles()auto-detectionsrc/sync/git-hooks.ts):GitHooksManagerclass for installing/removing post-commit hooks with worktree support, marker-based hook identification, and safe append/remove operationssrc/version.ts):getRuntimeVersion()returning package version + git rev with cachingsrc/bin/codegraph.ts):hooks install/hooks remove/hooks statuscommands,displayIndexStatsin status output, version displaysrc/index.ts): New methods on CodeGraph class —importSCIP(),getVersion(),installGitHooks(),removeGitHooks(),isGitRepository(),isGitHookInstalled(),getMetadata()Details
SCIP Import
The
ScipImporterprocesses SCIP (Source Code Intelligence Protocol) JSON files in two passes:SymbolRole.DefinitionContent-hash fingerprinting (SHA-256 of the SCIP file) enables idempotent imports — re-importing the same file is a no-op.
Git Hooks Manager
The
GitHooksManagerhandles post-commit hook installation for automaticcodegraph sync:.gitdirectory correctly for worktreesCODEGRAPH_MARKERcomments to identify managed hook sectionsHookInstallResult/HookRemoveResultwith status detailsDead code verification
Every new export has at least one caller within this PR:
ScipImporter→ called byimportSCIP()insrc/index.tsGitHooksManager→ used in CodeGraph constructor + CLI commandscreateGitHooksManager→ called in CodeGraph constructorgetRuntimeVersion()→ called by CLI status +CodeGraph.getVersion()HookInstallResult/HookRemoveResult→ used in method signaturesTest plan
npm run buildcompiles without errorsnpm testpasses with same baseline (28 pre-existing failures, 326 passing)src/scip/index.ts(new),src/sync/git-hooks.ts(new),src/version.ts(new),src/sync/index.ts,src/index.ts,src/bin/codegraph.tsinitSentry,captureException, error handlers)src/index.tspreserved