See docs/DISCLAIMER_SNIPPET.md
Repo-Healer v1 is a bounded CI repair capability for this repository (AGI-Alpha-Agent-v0).
The legacy UI demo and sample_broken_calc fixture still exist, but they are no longer the production repair path.
See also repo_healer_v1/SCRATCHPAD.md for a concise persisted snapshot used during implementation.
- Canonical evaluator surface now
- PR gate: ✅ PR CI (
.github/workflows/pr-ci.yml) withruff check .and smoke pytest subset. - Heavy integration matrix: 🚀 Integration CI — Insight Demo (
.github/workflows/ci.yml) with actionlint, Ruff, Mypy, pytest, docs/deploy/build checks. - Optional surfaces: 🔥 Smoke Test and 📚 Docs workflows.
- PR gate: ✅ PR CI (
- What was toy-specific before
- defaulting to
sample_broken_calcclone flow, - relying on unstructured logs and placeholder diffs,
- treating pytest as one-size-fits-all validation.
- defaulting to
- Narrow truthful v1
- typed failure bundle plus GitHub workflow_run ingestion (
ci_bundle.py), - deterministic triage + validator registry aligned to real CI commands,
- bounded isolated repair loop with patch safety checks,
- seeded benchmark proving baseline vs healed outcomes on this repo.
- typed failure bundle plus GitHub workflow_run ingestion (
- Docs that overclaimed
- legacy table rows suggesting fully autonomous CI healing to green for every class,
- toy clone behavior implied as the main production path.
- Ruff failures.
- Mypy failures.
- Broken imports/simple Python config regressions.
- Linux reproducible pytest/smoke failures.
- MkDocs
mkdocs build --strictfailures when reproducible locally. - Unknown/unmapped signatures are automatically downgraded to structured
REPORT_ONLYdiagnosis instead of unsafe guess-patching.
- workflow YAML/actionlint issues,
- Docker build failures,
- Windows-only and macOS-only failures.
- Secrets/tokens/credentials/signing/release publish surfaces.
- Branch protection weakening, CI bypasses, skipped validators.
- Permission broadening or policy bypasses.
repo_healer_v1/models.py: typed failure bundle and report model (workflow name/file, run id/url/attempt, event/ref/sha, job/step, validator/support/risk, evidence).repo_healer_v1/triage.py: deterministic classification to support mode.repo_healer_v1/ci_bundle.py: workflow-run ingestion that captures run/job URLs, Linux-first failed job selection, and smoke-vs-pytest validator mapping. It also enforces early-attemptrun_attempt<2report-only posture and infers non-autopatch support modes from failed-step metadata (permission, transient infra, protected release surfaces, and platform constraints).repo_healer_v1/validators.py: registry of targeted + broader validator commands from real workflows. It reads.github/workflows/pr-ci.yml,ci.yml,smoke.yml, anddocs.ymlto resolve canonical workflow names.repo_healer_v1/safety.py: protected-surface and existing-file-only patch safety policy.repo_healer_v1/engine.py: isolated repair loop (triage -> safety -> targeted -> broader -> promote).repo_healer_v1/candidate_generation.py: deterministic rule-based candidate synthesis for Ruff (ruff --fix), missing-import regressions, narrow Mypy literal-regression repairs, bounded pytest/smoke regression repairs for this repo, and MkDocs YAML regressions when no explicit candidates are supplied.repo_healer_v1/benchmark.py: seeded benchmark in isolated temp copy with machine-readable result.
AUTOPATCH_SAFE: run bounded autopatch loop.DRAFT_PR_ONLY: produce structured diagnosis and commands for human/draft flow.REPORT_ONLY: explicit read-only/report execution mode.TRANSIENT_INFRA: retry-oriented transient infrastructure diagnosis mode.PERMISSION_OR_FORK_CONTEXT: fork/permission constrained diagnosis mode.UNSAFE_PROTECTED_SURFACE: policy-protected surface refusal mode.
Workflow: .github/workflows/repo-healer.yml
- Runtime dependencies are installed from
repo_healer_v1/requirements-ci.txtto keep bundle/report execution deterministic and explicit. - Trigger: failed
workflow_runfrom real CI workflows + manual dispatch. - Emits structured artifacts:
repo_healer_bundle.jsonrepo_healer_candidates.jsonrepo_healer_report.json
- Execution modes are context-aware:
workflow_dispatch: report-only diagnosis by default for ordinary manual runs (because no failed workflow-run bundle is attached), but mode selection still honors the configured threshold when anAUTOPATCH_SAFEbundle is supplied.workflow_runwithrun_attemptbelowREPO_HEALER_APPLY_AFTER_ATTEMPT: report-only triage in bundle ingestion, then dry-run/apply remains blocked.workflow_runwithrun_attempt >= REPO_HEALER_APPLY_AFTER_ATTEMPTandAUTOPATCH_SAFE: bounded apply mode in checkout, still no auto-merge/no branch-protection changes.- Apply threshold can be tuned for all events via repository variable
REPO_HEALER_APPLY_AFTER_ATTEMPT;workflow_dispatchinput only overrides it for that manual run.
python -m alpha_factory_v1.demos.self_healing_repo.repo_healer_v1.cli \
--repo . \
--failure-bundle repo_healer_bundle.json \
--candidates repo_healer_candidates.json \
--report repo_healer_report.jsonUse --dry-run to verify safety/classification and planned validators without applying patches. The CLI defaults --repo to this repository root (AGI-Alpha-Agent-v0) so production runs target the real codebase by default.
If --candidates is empty, Repo-Healer v1 attempts bounded rule-based candidate generation for supported classes before falling back to structured diagnosis.
python -m alpha_factory_v1.demos.self_healing_repo.repo_healer_v1.benchmark \
--repo . \
--out repo_healer_benchmark.jsonCases (all against this repository in an isolated copy):
- Ruff seed
- Mypy seed
- broken import seed
- Linux pytest seed
- mkdocs seed
- non-autofix permission/context seed (graceful refusal)
The benchmark runs in an isolated temp copy and reports baseline vs healed exit codes. For determinism and bounded runtime it executes targeted validators only (the full engine still runs targeted + broader validators by default).
If a required validator binary is unavailable in the local environment (for example, mkdocs), that case is marked as
SKIPPED_MISSING_VALIDATOR in the machine-readable output instead of being misreported as a failed auto-repair.
agent_selfheal_entrypoint.py and sample_broken_calc/ remain as lightweight fixture/UI examples only.
They are not the canonical Repo-Healer v1 production loop.
agent_selfheal_entrypoint.py now defaults to this repository.
Use SELFHEAL_MODE=sample to exercise the old sample_broken_calc fixture intentionally.