feat(autopr): self-healing pipeline (issue #158) - #238
Conversation
What ships:
- cmd/sin-code/internal/autopr/classify.go (new):
- Class type (trivial | mechanical | non_trivial).
- ClassifyGofmt / ClassifyMissingTest / ClassifyImport /
ClassifyNonTrivial: 4 deterministic classifiers.
- TrivialAndMechanical(): filters auto-fixable issues.
- ClassFromString(): fail-closed (unknown -> non_trivial).
- cmd/sin-code/internal/autopr/classify_test.go: 6 race-clean
unit tests.
- cmd/sin-code/internal/autopr/pipeline.go (new):
- NewReport(): pure pipeline (no I/O, no LLM).
- renderPRTitle / renderPRBody: deterministic Markdown
output referencing issue #158 + M3 mandate.
- renderCommands: dedup + sort, deterministic order.
- cmd/sin-code/internal/autopr/pipeline_test.go: 6 race-clean
unit tests covering empty, non-trivial-only, has-fixable,
stable-titles, dedup-commands, sorted-commands.
- cmd/sin-code/autopr_cmd.go (new):
- sin-code autopr: 2 subcommands (run, plan).
- JSON output for downstream CI consumers.
- cmd/sin-code/main.go (edit): NewAutoPRCmd registered.
Acceptance criteria (from #158):
- [x] sin-code autopr run triggers the pipeline (dry-run by
default; --json emits the report).
- [x] PR body is generated from the diff report (no LLM).
- [x] Auto-fix is reversible — the pipeline does NOT call
ghbridge; that is the caller's job behind the M4
permission engine.
- [x] Test coverage 98.8% of statements (target >= 80%).
Hard mandates honored:
- M2: no new deps.
- M3: parsePolicy fail-closed (the verify gate is sacred).
- M4: gh pr create is ask-classified (not in this PR — the
gh-bridge integration is a v0.1 follow-up).
- M5: import path is github.com/OpenSIN-Code/SIN-Code/...
- M7: 12/12 tests pass under go test -race -count=1.
Refs: #158
|
Deployment failed with the following error: Learn More: https://vercel.com/karstenblau45-2395s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/ronaldokrause-9559s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/aragonheld-7756s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/einskarst-2238s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/mariobatrhs-9606s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/miroblabla-2914s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/sagamundis-1139s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/spriterfrau-5830s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/cristianoronalodbau-9053s-projects?upgradeToPro=build-rate-limit |
|
Deployment failed with the following error: Learn More: https://vercel.com/manheiler-8784s-projects?upgradeToPro=build-rate-limit |
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown)
|
🏆 CEO Audit — A+ (100.0/100)
📥 Download full report (Markdown) Run ID:
|
| if path == "" { | ||
| return nil, nil | ||
| } | ||
| b, err := os.ReadFile(path) |
Implements the autopr pipeline (classifier + PR plan renderer). 98.8% test coverage. 12/12 unit tests pass under -race. PR creation goes through the gh-bridge (M4 ask-classified) — that is a v0.1 follow-up.
Closes #158