Conversation
Add RepoProfileService that generates a living markdown profile at .lisa/data/repo-profile.md from git pipeline data (triage, extraction). Provides read + freshness checking for downstream integration. - IFileSystem domain interface for testable file I/O - IRepoProfileService contract with generate/read/checkFreshness - NodeFileSystem infrastructure implementation - RepoProfileService with 8 markdown sections (overview, hotspots, architecture evolution, feature waves, decisions, gotchas, concerns, recent activity) - Pure exported functions: renderMarkdown, calculateFreshness - Freshness model: fresh (<24h), stale (1-7d), expired (>7d), missing - 39 unit tests covering all service methods and pure functions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
📝 WalkthroughWalkthroughAdds a RepoProfileService that renders and manages a Markdown repo profile at Changes
Sequence DiagramsequenceDiagram
participant Caller
participant RepoProfileService
participant FileSystem
participant Renderer
Caller->>RepoProfileService: generate(input, options)
RepoProfileService->>Renderer: renderMarkdown(input, options)
Renderer-->>RepoProfileService: markdown, sectionsPopulated
RepoProfileService->>FileSystem: writeFile(profilePath, markdown)
FileSystem-->>RepoProfileService: ok
RepoProfileService-->>Caller: IProfileGenerateResult
Caller->>RepoProfileService: read(projectRoot)
RepoProfileService->>FileSystem: readFile(profilePath)
FileSystem-->>RepoProfileService: markdown | throws
RepoProfileService->>FileSystem: stat(profilePath)
FileSystem-->>RepoProfileService: IFileStat | null
RepoProfileService->>RepoProfileService: calculateFreshness(mtime)
RepoProfileService-->>Caller: IProfileReadResult
Estimated code review effort🎯 4 (Complex) | ⏱️ ~40 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @.gitignore:
- Line 49: The .gitignore entry ".mcp.json" is ambiguous; update the .gitignore
by replacing the bare pattern with a clarified entry and comment: if .mcp.json
only lives at the repo root, change the pattern to "/.mcp.json" and add a short
comment explaining what MCP/.mcp.json is and why it must be ignored, otherwise
keep ".mcp.json" but prepend a comment line that documents the file's purpose
and scope (e.g., that all .mcp.json files in subdirectories should be ignored).
In `@src/lib/infrastructure/services/NodeFileSystem.ts`:
- Around line 26-31: The stat() method in NodeFileSystem currently swallows all
errors and returns null; change it to return null only when the filesystem error
is "file not found" and rethrow all other errors. In the async
NodeFileSystem.stat(filePath: string) implementation, catch the thrown error
from fsp.stat, inspect the error (as an ErrnoException) and if err.code ===
'ENOENT' return null, otherwise throw the original error so permission/IO issues
bubble up to callers.
Address CodeRabbit review feedback: - .gitignore: scope /.mcp.json to repo root with explanatory comment - NodeFileSystem.stat(): only return null for ENOENT, rethrow other filesystem errors (permissions, IO) to prevent misclassifying inaccessible profiles as missing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
RepoProfileServicethat generates a living markdown profile at.lisa/data/repo-profile.mdfrom git pipeline data (triage, extraction)generate(),read(), andcheckFreshness()for downstream integration (LISA-6 CLI, LISA-12 session hooks)Changes
Domain interfaces:
IFileSystem- minimal file system abstraction (readFile, writeFile, stat)IRepoProfileService- full service contract with profile typesInfrastructure:
NodeFileSystem- wrapsnode:fs/promiseswith null-safe statApplication:
RepoProfileService- factory function with 8 markdown sections: overview, architecture evolution, hotspots, feature waves, decisions, gotchas, concerns, recent activityrenderMarkdown(),calculateFreshness()Tests:
Test plan
npm test- 1610 tests pass (39 new)npm run lint- cleannpm run build- compiles successfullyCloses LISA-11
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores
Tests