Skip to content

docs: add feature backlog and track file moves in hooks#71

Merged
carlos-alm merged 2 commits intomainfrom
docs/backlog-and-roadmap-reorg
Feb 24, 2026
Merged

docs: add feature backlog and track file moves in hooks#71
carlos-alm merged 2 commits intomainfrom
docs/backlog-and-roadmap-reorg

Conversation

@carlos-alm
Copy link
Contributor

Summary

  • Create roadmap/ folder and add BACKLOG.md with 20 prioritized feature items derived from competitive analysis, including assessment columns for dependency impact, foundation alignment, problem-fit scoring, and breaking change tracking
  • Move ROADMAP.md and llm-integration.md into roadmap/ to consolidate planning docs
  • Add track-moves.sh PostToolUse hook that detects mv/git mv/cp in Bash commands and logs affected paths to session-edits.log, fixing false blocks from guard-git.sh when files are moved

Test plan

  • Verify roadmap/BACKLOG.md renders correctly with all 20 items and scoring guide
  • Verify roadmap/ROADMAP.md and roadmap/llm-integration.md are intact after move
  • Test track-moves.sh by running mv in a session and confirming paths appear in .claude/session-edits.log
  • Confirm guard-git.sh allows committing moved files after track-moves.sh logs them

Move ROADMAP.md and llm-integration.md into roadmap/ folder.
Add BACKLOG.md with 20 prioritized feature items derived from
competitive analysis, including assessment columns for dependency
impact, foundation alignment, problem-fit scoring, and breaking
change tracking.
Add track-moves.sh PostToolUse hook for Bash that detects mv, git mv,
and cp commands, extracts all source and destination paths, and logs
them to .claude/session-edits.log. This prevents guard-git.sh from
blocking commits that include moved or copied files.
@claude
Copy link

claude bot commented Feb 24, 2026

Claude finished @carlos-alm's task —— View job


PR Review Completed ✅

Root Cause Analysis

Problem Being Solved: This PR addresses two distinct issues:

  1. Documentation organization - Consolidating planning docs under roadmap/ and adding a comprehensive feature backlog derived from competitive analysis
  2. Hook system gap - Fixing false positives in guard-git.sh when files are moved/copied but not tracked in the session edit log

Why This Approach: The file move tracking uses a PostToolUse hook on Bash commands to detect mv/git mv/cp operations and log all affected paths to the session edit log. This ensures guard-git.sh can validate commits that include moved files. The documentation reorganization follows a logical structure.

Risk Assessment: Low risk - this is primarily documentation organization with a defensive shell script addition.

Critical Concerns (if any)

None identified. All changes are additive and defensive in nature.

Code Quality Assessment

Excellent Documentation Structure

  • Comprehensive backlog: 20 well-researched features with clear assessment criteria
  • Proper organization: roadmap/ folder consolidates all planning docs logically
  • Scoring methodology: The 4-column assessment framework (Zero-dep, Foundation-aligned, Problem-fit, Breaking) provides systematic prioritization

Robust Hook Implementation

  • Correct command detection: Lines 27,48 - Regex properly matches mv, git mv, and cp with word boundaries
  • Smart argument parsing: Lines 51-77 - Handles quoted arguments, filters flags, and respects shell quoting rules
  • Safe path resolution: Lines 69-73 - Uses path.relative() to prevent directory traversal, only logs paths within project
  • Defensive coding: Lines 20,78 - Multiple fallback points with || true to never break the tool chain
  • Informational only: Line 93 - Always exits 0, never blocks execution (correct for PostToolUse hook)

Configuration Integration

  • Proper hook registration: Lines 67-75 in .claude/settings.json correctly add the new hook to PostToolUse for Bash commands
  • Consistent timeout: 5s timeout matches other tracking hooks

Security Considerations

  • No shell injection: Uses execFileSync semantics via Node.js argument parsing
  • Input validation: Extracts JSON safely, validates commands before processing
  • Privilege principle: Logging only - no file system modifications

⚠️ Minor Technical Notes

  1. Line 48: Regex could theoretically match git mvp or git mv-branch but this is extremely unlikely in practice
  2. Lines 69-72: The relative path calculation assumes $PROJECT_DIR is always the git root, which should be true given the hook context

Final Assessment

Root Cause Analysis

Problem Being Solved: Addresses real issues - false positives in commit validation when files are moved, and lack of organized feature planning documentation.

Why This Approach: File move tracking is the correct architectural solution - detect at the Bash command level and integrate with existing session tracking. Documentation organization follows established patterns.

Risk Assessment: Minimal risk - purely additive changes that improve existing safety mechanisms.

Final Recommendation

  • Rating: ⭐⭐⭐⭐☆ (4/5)
  • Action: APPROVE
  • Reasoning: Well-implemented solution to real problems. The hook script demonstrates strong understanding of shell command parsing and defensive programming. Documentation organization is excellent and will improve project maintainability. No breaking changes or risky patterns detected.

Minor suggestions for follow-up (not blocking):

  1. Consider adding a test case for the regex patterns in future hook testing
  2. The backlog assessment columns could be filled out in a future planning session

This PR successfully solves the stated problems with clean, defensive implementations.


@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 24, 2026

Greptile Summary

This PR adds infrastructure to track file moves in hooks and consolidates planning documentation. The track-moves.sh hook solves a critical gap in the session safety system: when files are moved via mv/git mv/cp, they weren't being logged to session-edits.log, causing guard-git.sh to incorrectly block commits. The hook parses Bash commands, extracts affected paths from move operations, and logs both source and destination paths.

  • Created roadmap/ folder and moved ROADMAP.md and llm-integration.md into it for better organization
  • Added BACKLOG.md with 20 prioritized feature items from competitive analysis, including assessment framework for dependency impact, foundation alignment, problem-fit scoring, and breaking change tracking
  • Implemented track-moves.sh PostToolUse hook that detects mv/git mv/cp commands and logs paths to session-edits.log
  • Registered the new hook in .claude/settings.json with 5s timeout

All changes are purely additive and non-breaking.

Confidence Score: 5/5

  • This PR is safe to merge with no concerns
  • All changes are documentation moves and a new safety hook that only logs data without blocking operations. The hook implementation is defensive with proper error handling, the shell script exits 0 in all cases, and the documentation files are simple renames with no content changes.
  • No files require special attention

Important Files Changed

Filename Overview
.claude/hooks/track-moves.sh New PostToolUse hook that parses mv/git mv/cp commands and logs affected paths to session-edits.log for commit validation
.claude/settings.json Added PostToolUse hook registration for track-moves.sh on Bash tool calls with 5s timeout
roadmap/BACKLOG.md New feature backlog with 20 prioritized items derived from competitive analysis, includes scoring rubric for assessment
roadmap/ROADMAP.md Moved from root to roadmap/ directory to consolidate planning documentation
roadmap/llm-integration.md Moved from docs/ to roadmap/ directory for better planning doc organization

Last reviewed commit: cfe633b

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@carlos-alm carlos-alm merged commit ca5cf24 into main Feb 24, 2026
17 checks passed
@carlos-alm carlos-alm deleted the docs/backlog-and-roadmap-reorg branch February 24, 2026 02:06
carlos-alm added a commit that referenced this pull request Mar 16, 2026
…in backlog

These two items deliver the highest immediate impact on agent experience
and graph accuracy without requiring Rust porting or TypeScript migration.
They should be implemented before any Phase 4+ roadmap work.

- #83: hook-optimized `codegraph brief` enriches passively-injected context
- #71: basic type inference closes the biggest resolution gap for TS/Java
carlos-alm added a commit that referenced this pull request Mar 16, 2026
* docs: move 3.16 items to new Phase 5 (Runtime & Extensibility)

Expand the deferred Phase 3 items into a dedicated phase after
TypeScript Migration with detailed descriptions for each sub-item:
event-driven pipeline, unified engine strategy, subgraph export
filtering, transitive confidence, query caching, config profiles,
pagination standardization, and plugin system.

Renumber subsequent phases 5-9 → 6-10 with all cross-references
updated.

* refactor: migrate integration tests to InMemoryRepository

Add openRepo() utility that accepts an injected Repository instance or
falls back to SQLite, enabling tests to bypass the filesystem entirely.

- Add openRepo(dbPath, opts) to src/db/connection.js
- Make findMatchingNodes and buildDependencyGraph polymorphic (accept
  db or Repository via instanceof check)
- Refactor triageData, sequenceData, communitiesData to use openRepo
- Convert triage, sequence, communities test fixtures to createTestRepo()
  fluent builder (sequence dataflow tests stay on SQLite)
- Mark ROADMAP 3.13 InMemoryRepository migration item complete

Impact: 10 functions changed, 11 affected

* fix: use instanceof SqliteRepository guard and validate openRepo opts

Impact: 2 functions changed, 18 affected

* docs: add Phase 4 (Native Analysis Acceleration) to roadmap

Add new Phase 4 covering the port of JS-only build phases to Rust:
- 4.1-4.3: AST nodes, CFG, dataflow visitor ports (~587ms savings)
- 4.4: Batch SQLite inserts (~143ms)
- 4.5: Role classification & structure (~42ms)
- 4.6: Complete complexity pre-computation
- 4.7: Fix incremental rebuild data loss on native engine
- 4.8: Incremental rebuild performance (target sub-100ms)

Bump old Phases 4-10 to 5-11 with all cross-references updated.
Benchmark evidence shows ~50% of native build time is spent in
JS visitors that run identically on both engines.
carlos-alm added a commit that referenced this pull request Mar 16, 2026
* docs: promote #83 (brief command) and #71 (type inference) to Tier 0 in backlog

These two items deliver the highest immediate impact on agent experience
and graph accuracy without requiring Rust porting or TypeScript migration.
They should be implemented before any Phase 4+ roadmap work.

- #83: hook-optimized `codegraph brief` enriches passively-injected context
- #71: basic type inference closes the biggest resolution gap for TS/Java

* docs: add Phase 4 (Native Analysis Acceleration) to roadmap

Add new Phase 4 covering the port of JS-only build phases to Rust:
- 4.1-4.3: AST nodes, CFG, dataflow visitor ports (~587ms savings)
- 4.4: Batch SQLite inserts (~143ms)
- 4.5: Role classification & structure (~42ms)
- 4.6: Complete complexity pre-computation
- 4.7: Fix incremental rebuild data loss on native engine
- 4.8: Incremental rebuild performance (target sub-100ms)

Bump old Phases 4-10 to 5-11 with all cross-references updated.
Benchmark evidence shows ~50% of native build time is spent in
JS visitors that run identically on both engines.

* docs: fix sub-section numbering to match parent phase headings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant