CIFuse
From failing CI to source evidence, contextual diagnostics and tested repair patches.
Try the workbench · Português · Contribute · Limitations
A failed build often means scrolling through the same errors, copying evidence into an issue, and checking whether the failure happened before. CIFuse automates that triage in your terminal, browser or GitHub job summary.
Quick start
Run the bundled example with Node.js 22+ and Git:
npx --yes github:brunnojob/cifuse --demo
Requires Node.js 22+ and Git for the GitHub install. The initial install downloads source; local log analysis makes no network requests. Optional GitHub imports use the API. No npm registry release is required.
npx --yes github:brunnojob/cifuse build.log --format json > report.json
npx --yes github:brunnojob/cifuse next.log --baseline report.json --fail-on new
- Groups repeated diagnostics with separate log and verified code locations.
- Inspects relative imports, dependency declarations and project setup context.
- Reproduces supported failures, generates a repair patch and checks tests before/after.
- Optionally imports failed GitHub jobs, updates a PR report or opens a validated repair PR.
- Recognizes 12 pattern families across dependencies, compilers, tests and infrastructure.
- Compares reports for new, existing and resolved signatures.
- Exports JSON and Markdown; supports English and Brazilian Portuguese.
- Runs offline after loading. No backend, account, AI key or runtime dependencies.
- Redacts common credential formats from reports, including surrounding context. This is best effort, not a secret scanner.
What it actually does
The included illustrative fixture contains 8 matching lines grouped into 5 signals. Open the workbench and click Load example, or run npm run demo. Expand any result to inspect its original context.
CIFuse combines deterministic patterns with bounded source inspection. It suggests an investigation starting point and identifies possible exit-status consequences; neither proves causality. Supported import-casing repairs can be validated against an explicit test command. It does not identify flaky tests or replace your test exit status. Compared with grep, it adds grouping, source locations, baseline comparison and portable reports. Compared with an LLM tool, it needs no model or external log submission. See design and tradeoffs.
Analyze code and validate a repair
node bin/cifuse.js build.log --repo /path/to/trusted-project --lang en
node bin/cifuse.js build.log --repo /path/to/trusted-project \
--fix --validate '["node","--test"]' --patch /tmp/cifuse.patch --format json
Source context verifies referenced lines and inspects JS/TS relative imports, dependency declarations, Node requirements and package-manager configuration. Browser users can select a source folder for the same static checks, processed locally.
Repair currently handles unambiguous relative import casing mismatches. It uses a temporary Git worktree, requires failing validation before the patch and passing validation after it, and preserves the original checkout. --open-pr --repository owner/repo additionally pushes and opens a PR using authenticated Git/gh. Validation executes trusted project code; the browser never executes your tests.
See the complete workflow, statuses and limits. Run npm run benchmark for the small, reproducible tool-diagnostic corpus, including successful negative controls.
GitHub Action
Install CIFuse CI log triage from GitHub Marketplace. Free and MIT licensed. See the Action guide for every input/output, permissions, fork PRs and troubleshooting.
Capture an existing command's output and keep its original failure status. Run CIFuse afterwards:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Test and capture log
shell: bash
run: |
set -o pipefail
npm test 2>&1 | tee build.log
- name: Summarize failure evidence
if: ${{ !cancelled() && hashFiles('build.log') != '' }}
uses: brunnojob/[email protected]
with:
log: build.log
lang: en
The Action appends the report to the job summary. By default it reads one local text file. Optional github-run: owner/repo/run-id downloads failed job logs using token; optional comment: true updates its report on the current PR. These require actions: read and pull-requests: write respectively. Pin a reviewed full commit SHA in production for an immutable reference. baseline accepts a previous JSON report; fail-on accepts findings or new (the latter requires a baseline). Local reporting needs only the checkout's contents: read. The Action never executes tests or repairs.
The default JSON artifact path is cifuse-report.json. Use a step id to access outputs.report, outputs.groups, outputs.signals, outputs.new and outputs.resolved.
- uses: actions/upload-artifact@v4
if: ${{ always() && hashFiles('cifuse-report.json') != '' }}
with:
name: cifuse-report
path: cifuse-report.json
Source context and a persistent PR report
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
# Run your existing test step and capture build.log first.
- uses: brunnojob/[email protected]
if: ${{ !cancelled() && hashFiles('build.log') != '' }}
with:
log: build.log
repo: .
repository: ${{ github.repository }}
commit: ${{ github.event.pull_request.head.sha }}
token: ${{ github.token }}
comment: 'true'
output: cifuse-report.json
Use this in a pull_request job. Fork tokens may lack comment permission; use reporting only in that case. Do not switch to pull_request_target to run untrusted code. Keep the JSON output as an artifact with actions/upload-artifact if desired.
CLI
node bin/cifuse.js build.log another.log --lang pt-BR
cat build.log | node bin/cifuse.js - --format json
node bin/cifuse.js build.log --fail-on findings
Exit codes: 0 analysis completed, 1 selected threshold matched, 2 invalid arguments or input. Default behavior is reporting only. Explicit validation or repair returns 1 if validation fails or the repair is not validated. Limits: 100 files / 5 MiB combined, 10 retained locations per group. Analysis uses in-memory text logs, not ZIP archives. Large or compressed logs must be split or decoded first.
Run and contribute
git clone https://github.com/brunnojob/cifuse.git
cd cifuse
npm test
npm run build
Serve dist/ with any static server to try the website locally. Both browser and CLI import src/engine.js; the website defaults to English and offers a persistent PT-BR language switch. Only the language preference is stored; logs, source files and reports are not persisted by the application.
Start with CONTRIBUTING.md, the rule catalog, or issues labelled good first issue. Sanitized real-world fixtures are especially useful. Launch material is ready to adapt for a community post.
Created by Brunno. MIT licensed. If this saves you time, a star helps others find it.
Support development
Contribute any amount via Stripe. Contributions are optional; all features remain free and open source.