feat!: replace deterministic analysis with AI agent architecture#3
Merged
feat!: replace deterministic analysis with AI agent architecture#3
Conversation
79e3a94 to
060d89d
Compare
BREAKING CHANGE: Remove @pr-impact/core, @pr-impact/cli, @pr-impact/mcp-server. Replace with 4 new packages: - @pr-impact/tools-core: 6 pure tool handler functions (git_diff, read_file_at_ref, list_changed_files, search_code, find_importers, list_test_files) - @pr-impact/tools: MCP server wrapping tools-core for Claude Code / AI assistants - @pr-impact/action: GitHub Action with Anthropic API agentic loop (30 iterations, 180s timeout, temperature 0, PR comment posting) - @pr-impact/skill: Claude Code plugin with assembled skill.md from shared templates Analysis logic moves from coded heuristics to AI reasoning via prompt templates. Shared templates (system-prompt.md, report-template.md) define the methodology and are embedded at build time into both the skill and action packages. 53 tests across 11 test files, all passing.
060d89d to
5cbfd52
Compare
Record<string, unknown> cannot be directly asserted to specific param types with required properties under strict mode. Cast through unknown first.
1. Shared tool definitions (DRY): - Create tools-core/src/tool-defs.ts with canonical TOOL_DEFS - action/client.ts builds Anthropic tools from shared defs - tools/register.ts builds zod schemas from shared defs - Eliminates duplicated tool names, descriptions, and parameters 2. Client test cases (error handling, timeouts, iteration limits): - Tool execution error sends is_error back to Claude - Parallel tool_use blocks execute via Promise.all - Wall-clock timeout returns partial text or throws - Max iterations (30) returns partial text or throws 3. Risk score parsing edge cases: - Boundary values 0/100 and 100/100 - Unparseable report skips threshold check - Score equal to threshold triggers failure (>= comparison) - Non-Error rejection handled in main()
Create C3v4 architecture docs covering all 4 containers, 16 components, and 3 cross-cutting refs. Documents the system context, container boundaries, component responsibilities, and shared patterns (git operations, ESM conventions, build pipeline).
Doc fixes: - Add tool-defs.ts to source layouts in CLAUDE.md and README.md - Fix comment marker text in action/CLAUDE.md - Add c3-generated blocks to all package CLAUDE.md files - Update test count to 100 Code fixes: - find-imports: strip /index suffix in normalizeModulePath so bare directory imports match index files - client: throw on empty output instead of returning empty string - comment: log warning on API failure instead of silent null return Test additions: - find-imports: dynamic import(), require(), directory-to-index resolution, unreadable file handling - list-files: copied (C) status, binary files
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
core,cli,mcp-server) with 4 new packages (tools-core,tools,action,skill)templates/and are embedded at build timeNew Packages
@pr-impact/tools-core@pr-impact/tools@pr-impact/action@pr-impact/skill/pr-impactslash commandWhat Changed
scripts/embed-templates.ts(action) andscripts/build-skill.ts(skill)dist/index.cjs) with all dependencies bundled for GitHub ActionsTest plan