THE PROBLEM: THE ASSERTION PROXIMITY TRAP IN CI/CD Every day, engineering teams lose thousands of hours to broken CI/CD pipelines. Existing AI coding assistants fail at autonomous CI repair because of the Assertion Proximity Trap: where a test assertion fails is almost never where the bug actually lives. A test fails in tests/test_pricing.py, which calls order_service/pricing.py, which imports order_service/discount.py. Naive AI tools inspect only the failing test file, hallucinate unverified patches, or delete test assertions to force a fake green build. THE SOLUTION: SENTRY Sentry is an autonomous, self-healing CI/CD repair agent built on the IBM Bob 2.0 Gateway and IBM Granite (granite-8b-code-instruct). It operates as a deterministic 8-state finite state machine with closed-loop sandbox verification: 1. INGEST AND REPRODUCE: Clones the repository into an isolated sandbox (Docker or Local) and executes the test suite (pytest, unittest, node --test, Jest) to capture baseline counts and stack traces. 2. NAVIGATE (4-Hop AST and Import Traversal): Extracts stack frames and traverses Python and Node.js module imports up to 4 hops deep, feeding the call chain to IBM Granite 8B Code Instruct while strictly forbidding edits to test files. 3. HYPOTHESIZE AND PATCH: Ranks suspect files by confidence score (0-100%), formulates a root-cause hypothesis, and generates a minimal unified diff. 4. VALIDATE (Closed-Loop Retry up to 3 Attempts): Applies the patch and re-runs the full test suite in the sandbox. If validation fails, Sentry reverts the workspace via git checkout and feeds the error trace back into the model. 5. PR_CREATE VS. REPORT_BEST_EFFORT (Anti-Hallucination Guarantee): - RED TO GREEN: Automatically creates a fix branch, pushes to GitHub, and opens a Pull Request with a before-and-after verification matrix. - Unresolved After 3 Attempts: Never fabricates success. Compiles an honest Best-Effort Diagnostic Report (suspects, attempted diffs, and hypotheses) for human engineers. ARCHITECTURE AND TECH STACK - AI Layer: IBM Granite (granite-8b-code-instruct) and IBM watsonx Orchestrate routed through IBM Bob 2.0 Gateway with multi-model failover. - Backend: Deterministic 8-state Python FSM bridged to a FastAPI async WebSocket server (/ws). - Sandbox: Pluggable DockerSandbox and LocalSandbox with multi-runner output parsers. - Frontend: Next.js 14 (App Router, TypeScript, Tailwind CSS) real-time dashboard with live state timeline, streaming event log, confidence bars, and unified diff viewer. VERIFIED BENCHMARKS 1. Python (hero_python): Traces 2 hops from test_pricing.py into discount.py (90% confidence), fixes 0.8 multiplier to 0.2, validates 3/4 RED to 4/4 GREEN on Attempt 1, and opens GitHub PR #1. 2. Node.js (hero_node): Traces CommonJS modules into token_validator.js (92% confidence), fixes clock-skew operator (- to +), and validates 2/3 RED to 3/3 GREEN on Attempt 1. 3. Honest Failure: Reverts all 3 failed attempts on unfixable bugs and exports a diagnostic trail with 0% false positive claims.
Category tags: