Skip to content

Automation: CodeRabbit-Hard-Gate, Remark-lint und verzögerte Reparatur - #44

Merged
H234598 merged 96 commits into
mainfrom
feat/hard-review-repair-policy
Jul 28, 2026
Merged

Automation: CodeRabbit-Hard-Gate, Remark-lint und verzögerte Reparatur#44
H234598 merged 96 commits into
mainfrom
feat/hard-review-repair-policy

Conversation

@H234598

@H234598 H234598 commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Ziel

Implementiert die neue Merge-/Repair-Policy für automatische Einheiten-PRs.

Verbindliche Änderungen

  • CodeRabbit wird zum harten Gate des aktuellen Head-Commits.
  • Fehlendes oder rotes CodeRabbit-Signal, ungelöste Threads und ungeklärter Agent-CodeRabbit-Dissens blockieren Ready for review und Merge.
  • Auch veraltete Threads müssen behoben oder nachvollziehbar als gegenstandslos abgeschlossen werden.
  • Remark-lint wird mit exakt gepinnten npm-Abhängigkeiten und npm ci als reproduzierbarer blockierender Check ausgeführt.
  • Der Reparaturzyklus startet frühestens zu max(PR-Erstellung + 2 Stunden, 20:00 Uhr Europe/Berlin am Erstellungstag).
  • Vor dem Reparaturfenster sammelt der Merge-Wächter Diagnosen und prüft weiter; er bricht nicht nach dem zweiten roten CI-Lauf ab.
  • Ab dem Reparaturfenster ist pro Wächterlauf ein sicherer idempotenter Reparaturzyklus auf dem bestehenden Branch zulässig.
  • Wissenschaftliche Reviewhinweise erzwingen eine aktuelle Deep-Research-Prüfung, aktualisierte Studienkarten und reproduzierbar regenerierte Literaturausgaben.

Technische Komponenten

  • scripts/merge_repair_policy.py
  • scripts/review_gate.py
  • scripts/remark_lint.mjs
  • .github/workflows/coderabbit-hard-gate.yml
  • .github/workflows/remark-lint.yml
  • neue Regressionstests
  • aktualisierte Merge- und Repairprompts
  • aktualisierte CodeRabbit-Konfiguration und Betriebsdokumentation

Zusätzliche Härtung nach Review

  • Check-runs werden vollständig paginiert.
  • queued, in_progress, neutral und skipped können das Gate nicht bestehen.
  • Nur die exakten CodeRabbit-Kommentaridentitäten werden als CodeRabbit-Threads erkannt.
  • Ein Dissens kann nur durch CodeRabbit, den Repositoryinhaber oder explizit konfigurierte vertrauenswürdige Resolver geschlossen werden; fremde PR-Kommentare können das Gate nicht mehr umgehen.
  • Der Paginationstest verwendet nun den tatsächlichen page-Parameter statt des mehrdeutigen Teilstrings page=1 in per_page=100; dadurch kann die Validierung nicht mehr in einer künstlichen Endlosschleife hängen.

Sicherheit

Die Gate-Implementierung wird im pull_request_target-Kontext ausschließlich aus dem vertrauenswürdigen main ausgecheckt. Schreibende Tokens werden dort nicht verwendet. Dieser PR verändert Workflows, Prompts, Tests und Buildabhängigkeiten und muss deshalb bewusst manuell geprüft werden.

Status

  • Branch: feat/hard-review-repair-policy
  • aktueller Head: ac96d910e4131a9c05c5273900082073c8cddcb2
  • aktuelles main: 93c8c02d263ec123c1c271caf0d2deaa76760ccb
  • PR ist Ready for review
  • Remark-lint und Runtime-Status sind für den aktuellen Head grün
  • Projektvalidierung, Codacy, qlty und inkrementelle CodeRabbit-Prüfung laufen erneut
  • automatischer Merge bleibt wegen <!-- manual-merge-required --> verboten

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds blocking Remark-lint and CodeRabbit gates, deterministic merge/repair policy evaluation, stricter automation prompts and status handling, trusted workflows, documentation updates, and regression tests covering the new policy behavior.

Changes

Merge and review enforcement

Layer / File(s) Summary
Policy and CodeRabbit gate evaluation
scripts/merge_repair_policy.py, scripts/review_gate.py, tests/test_merge_repair_policy.py, tests/test_review_gate.py
Adds timezone-aware repair decisions, current-head CodeRabbit signal evaluation, unresolved-thread and disagreement blocking, structured reports, and regression coverage.
Blocking Markdown lint pipeline
.codacy.yml, package.json, scripts/remark_lint.mjs, .github/workflows/remark-lint.yml, tests/test_review_policy_files.py
Adds pinned Remark tooling, changed-file discovery, Obsidian syntax sanitization, dependency auditing, and a blocking lint workflow with configuration tests.
Merge, repair, and status contracts
automation/MERGE-REPAIR-POLICY.md, prompts/*, automation/prompt-baselines.json, scripts/validate_prompt_baselines.py, CONTRIBUTING.md, automation/README.md, prompts/README.md
Defines timed repair windows, mandatory gates, disagreement handling, safe repair rules, revision-aware recovery, prompt baselines, and reproducible validation sequences.
Workflow and documentation integration
.github/workflows/coderabbit-hard-gate.yml, .github/README.md, .coderabbit.yaml, WARTUNG.md, scripts/build_docs.py
Wires trusted CodeRabbit execution, updates workflow and maintenance documentation, changes CodeRabbit gate comments, and includes the new policy document in documentation output.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Watcher
  participant merge_repair_policy.py
  participant review_gate.py
  participant GitHub
  participant Remark
  Watcher->>merge_repair_policy.py: evaluate PR timing and gate states
  Watcher->>review_gate.py: check current-head CodeRabbit gate
  review_gate.py->>GitHub: fetch signals, threads, and comments
  GitHub-->>review_gate.py: return review state
  Watcher->>Remark: run changed-Markdown lint
  Remark-->>Watcher: return blocking lint result
  Watcher-->>GitHub: select wait, repair, ready, or merge action
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.76% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: a CodeRabbit hard gate, Remark-lint enforcement, and delayed repair flow.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/hard-review-repair-policy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/review_gate.py (1)

265-291: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Restrict disruption-resolution markers to trusted PR commenters.

evaluate_gate() parses DISAGREEMENT_RESOLVED_RE from every /issues/:number/comments body without checking the commenting user’s identity, while resolved review threads are already filtered by CodeRabbit comment authors. Any account able to approve a PR can post a fake marker and close a documented unresolved agent–CodeRabbit disagreement, clearing a required disagreement gate failure.

🛡️ Suggested author allow-list check
     for comment in comments:
         body = str(comment.get("body") or "")
         raw_created = str(comment.get("created_at") or "")
         if not raw_created:
             continue
+        author = str(_mapping(comment.get("user")).get("login") or "")
+        if not TRUSTED_MARKER_AUTHOR_RE.search(author):
+            continue
         created = datetime.fromisoformat(raw_created.replace("Z", "+00:00"))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/review_gate.py` around lines 265 - 291, Update the comment-processing
logic in evaluate_gate() so DISAGREEMENT_RESOLVED_RE markers are recorded only
when the comment author belongs to the trusted CodeRabbit commenter allow-list
used for review-thread filtering. Keep disagreement markers processed as
currently, and ensure untrusted commenters cannot resolve entries in resolutions
or clear disagreement_open.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/review_gate.py`:
- Around line 233-247: Update the CodeRabbit state classification around the
successful and pending sets so only “success” counts as a passing review; remove
“neutral” and “skipped” from successful and classify them according to the
existing incomplete/failure policy, preserving the current handling for missing
and actively pending states.

In `@scripts/validate_prompt_baselines.py`:
- Around line 135-145: Update report generation in main so OSError from
report.parent.mkdir or report.write_text is caught and a warning is logged,
while the existing validation errors remain printed and the intended nonzero
validation exit code is always preserved. Keep successful report writing
unchanged and scope the handling to diagnostic-report creation.

---

Outside diff comments:
In `@scripts/review_gate.py`:
- Around line 265-291: Update the comment-processing logic in evaluate_gate() so
DISAGREEMENT_RESOLVED_RE markers are recorded only when the comment author
belongs to the trusted CodeRabbit commenter allow-list used for review-thread
filtering. Keep disagreement markers processed as currently, and ensure
untrusted commenters cannot resolve entries in resolutions or clear
disagreement_open.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c1c7e777-0c04-48ce-9c88-bf122e87001e

📥 Commits

Reviewing files that changed from the base of the PR and between b56a258 and c332b6b.

📒 Files selected for processing (12)
  • CHANGELOG.md
  • CONTRIBUTING.md
  • WARTUNG.md
  • automation/prompt-baselines.json
  • prompts/MERGE-AUTOMATION-PROMPT.md
  • prompts/PR-REPAIR-PROMPT.md
  • scripts/merge_repair_policy.py
  • scripts/review_gate.py
  • scripts/validate_prompt_baselines.py
  • tests/test_merge_repair_policy.py
  • tests/test_review_gate.py
  • tests/test_review_policy_files.py
🚧 Files skipped from review as they are similar to previous changes (6)
  • CHANGELOG.md
  • automation/prompt-baselines.json
  • WARTUNG.md
  • scripts/merge_repair_policy.py
  • prompts/MERGE-AUTOMATION-PROMPT.md
  • prompts/PR-REPAIR-PROMPT.md

Comment thread scripts/review_gate.py
Comment thread scripts/validate_prompt_baselines.py Outdated
@H234598
H234598 marked this pull request as draft July 27, 2026 21:38
@H234598
H234598 marked this pull request as ready for review July 27, 2026 21:38
@H234598
H234598 merged commit 28c2770 into main Jul 28, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants