chore(lint): vendor anti-slop oxlint plugin and add batched cleanup pipeline

Vendor the anti-slop Oxlint plugin at tools/oxlint/anti-slop and register it
in oxlint.config.ts, with Oxlint's own rule categories disabled so ESLint
stays the general-purpose linter.

Add scripts/anti-slop.mjs (bun run deslop) mirroring the React Doctor batch
interface: next-batch, check-batch, active, release, top, file. Batch handoff
directories now double as file claims shared across clones via
~/.openchamber/maintenance-claims, so concurrent maintenance batches from
either pipeline never select the same file.

Harden both scheduled maintenance flows: stop on a dirty worktree, stop on
NO BATCH AVAILABLE, validate per package instead of workspace-wide, and pin
react-doctor to 0.9.12. The anti-slop task command documents concrete
good and bad fixes and forbids laundering types to satisfy a rule.
This commit is contained in:
Bohdan Triapitsyn
2026-08-16 15:55:08 +03:00
parent e3094ee676
commit 51aef5e316
30 changed files with 3512 additions and 33 deletions
+25 -15
View File
@@ -7,16 +7,27 @@ You are working in the OpenChamber repository.
Goal: follow up on an existing React Doctor maintenance PR, address Greptile/review bot feedback, and clean up the local batch handoff files when done.
Inspect local React Doctor batch handoff files:
This task can run unattended on a schedule, so it must be safe to start at any moment and must stop cleanly when there is nothing to do.
`find .tmp/react-doctor/runs -maxdepth 2 -name batch.json -print 2>/dev/null || true`
First, verify the worktree is safe to use:
`git status --porcelain`
If the output is not empty, stop immediately and report that the worktree has uncommitted changes. Do not stash, reset, discard, or switch branches.
List the active batches:
`bun run doctor -- active`
The listing may include batches owned by the anti-slop pipeline; those are shown as `[pipeline as]`. Never touch them.
Workflow:
- Read the available `.tmp/react-doctor/runs/*/batch.json` files.
- Find the most recent batch that has `branchName`, `batchName`, and `prTitle`.
- Read its `Run ID`, `Batch name`, `Branch name`, `PR title`, and selected files.
- Use `gh` to find the open PR for that branch or title.
- If no open PR exists for the batch, stop and report that there is no PR to follow up.
- If there are no active batches, stop and report that there is nothing to follow up.
- Each active batch corresponds to one open PR. Read its `batch.json` for `runId`, `branchName`, `batchName`, `prTitle`, and selected files.
- Use `gh` to find the open PR for each batch branch.
- Work on the oldest batch that has an open PR with unaddressed feedback. If several qualify, handle exactly one and leave the rest.
- If a batch's PR was already merged or closed, do not treat it as follow-up work. Release its claim with `bun run doctor -- release --run <run-id>` so its files return to the pool, then continue looking.
- If no batch has an open PR with actionable feedback, stop and report that.
- Switch to the batch branch using the exact `branchName`.
- Pull or update the branch from remote if needed.
- Use `gh` to inspect PR review comments, PR issue comments, review threads if available, and check run summaries if relevant.
@@ -32,9 +43,7 @@ After fixes, run:
`bun run doctor -- check-batch --run <run-id>`
`bun run type-check`
`bun run lint`
Then re-run the package-scoped checks for the packages you touched, for example `bun run --cwd packages/ui type-check`, `bun run --cwd packages/ui lint`, and `bun run --cwd packages/ui test`. Workspace-wide checks are CI's job.
Delivery:
- Commit follow-up fixes with a concise message.
@@ -43,14 +52,15 @@ Delivery:
- For each specific review comment you addressed, reply with what was changed and the follow-up commit hash.
- If the feedback was a general PR comment, add one general PR comment summarizing what was addressed, commit hashes, and validation results.
- If a comment is intentionally not addressed, reply with a concise reason.
- After successful push and replies, delete only the completed batch handoff directory: `.tmp/react-doctor/runs/<run-id>/`.
- Do not release the batch while its PR is still open and awaiting review. The claim is what keeps parallel batches off these files.
- Release the batch only once its PR has been merged or closed: `bun run doctor -- release --run <run-id>`.
- After the follow-up is complete, switch back to `main` and pull the latest remote changes.
Constraints:
- Work on exactly one React Doctor batch PR.
- Prefer the most recent batch with an open PR.
- Prefer the oldest batch with an open PR.
- Do not auto-merge.
- Do not close the PR.
- Do not delete handoff files until comments are addressed, validation passes, and follow-up commits are pushed.
- Do not delete unrelated `.tmp/react-doctor/runs/*` directories.
- If validation fails and cannot be fixed safely within scope, do not delete the handoff directory.
- Do not edit `CHANGELOG.md`, package versions, or release metadata.
- Do not release or delete handoff directories for batches you did not handle.
- If validation fails and cannot be fixed safely within scope, leave the batch claimed and report the blocker.