fix(repair): require a trusted status comment author - #1073
Conversation
…mment author cannot be read
…ug fix on status comment author
…f for openclaw clawsweeper on bug fix
There was a problem hiding this comment.
Pull request overview
This PR fixes a fail-open condition in the repair lane’s “trusted status comment” guard by ensuring that an unreadable/absent comment author is not treated as trusted. It centralizes the trust check into a single exported helper in comment-router-core.ts, updates both prior call sites to use it, and adds focused regression coverage plus a proof contract.
Changes:
- Introduce
isTrustedStatusCommentAuthor(...)that trims/normalizes the login and fails closed when the author cannot be read. - Replace the two prior private predicate copies in
comment-router.tsandexecute-fix-artifact.tswith the shared helper (preserving the hardcoded repair trusted authors set). - Add unit tests and a reproducible proof package under
docs/proof/trusted-status-comment-fail-open/.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/repair/comment-router-core.ts | Adds the shared exported trust comparator that fails closed on missing authors. |
| src/repair/comment-router.ts | Switches status-comment trust to the shared comparator using trustedBots. |
| src/repair/execute-fix-artifact.ts | Switches status-comment trust to the shared comparator with a fixed trusted-author set. |
| test/repair/comment-router-core.test.ts | Adds behavioral coverage for unreadable authors and trusted logins. |
| docs/proof/trusted-status-comment-fail-open/run-proof.sh | Adds container proof harness to build, extract pre-fix source, and run proof + focused tests. |
| docs/proof/trusted-status-comment-fail-open/run-proof.mjs | Adds proof script validating fail-closed behavior, no-loss, and deduplication in dist/. |
| docs/proof/trusted-status-comment-fail-open/README.md | Documents the proof contract, claims, commands, and limits. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const distCore = path.join(repoRoot, "dist", "repair", "comment-router-core.js"); | ||
|
|
||
| if (!fs.existsSync(distCore)) { | ||
| console.error(`missing build artifact: ${distCore}\nrun: pnpm run build:repair`); |
|
Codex review: needs maintainer review before merge. Reviewed September 1, 2026, 5:09 AM ET / 09:09 UTC. ClawSweeper reviewWhat this changesThe branch shares a status-comment author predicate between the repair router and executor so missing, empty, unknown, and padded author logins cannot authorize status adoption or updates. Merge readinessKeep this PR open: current main still accepts unreadable status-comment authors, while the reviewed head replaces both consumers with a shared fail-closed predicate for the linked security issue #1072. The bounded current-main integration delta is coherent and no blocking defect was found. Priority: P3 Review scores
Verification
How this fits togetherRepair automation reads GitHub issue comments to find durable status messages before routing commands or updating repair/automerge status. The router and repair executor each consume those comments and can otherwise send a GitHub comment mutation downstream. flowchart LR
A[GitHub issue comments] --> B[Author identity check]
B -->|trusted| C[Router status selection]
B -->|trusted| D[Repair executor]
B -->|missing or untrusted| E[Skip adoption and recovery]
C --> F[GitHub status comment update]
D --> F
Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one fail-closed comparator for both consumers, keep their distinct allowlists, and land the narrowly scoped hardening after normal maintainer review. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main's two status predicates explicitly authorize an empty normalized author, and the exact-head proof exercises missing-author inputs through the compiled consumers. Is this the best way to solve the issue? Yes. A shared nonempty-author predicate removes the duplicated fail-open condition while preserving separate router and executor allowlists and untrimmed case-insensitive matching. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1d79ae6c9f2d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
…claw proofs with latest changes and reruning
9efcaa5 to
18d2a59
Compare
…enclaw#1295) Co-authored-by: Peter Steinberger <steipete@gmail.com>
* fix(dashboard): make telemetry coverage explicit * fix(dashboard): fail closed during telemetry recovery * fix(dashboard): reject contradictory freshness metadata * fix(dashboard): harden cached telemetry freshness * style(dashboard): format reconciliation guard
* fix(dashboard): correlate exact-review queue failures * test(dashboard): retain queue failure proof * fix(dashboard): keep queue log calls statically bounded * fix(dashboard): retain telemetry reconciliation correlation
* fix(review): bootstrap pinned local scanner * test(review): preserve scanner refusal coverage * fix(review): reject in-checkout scanner caches * fix(review): bound scanner bootstrap downloads * fix(review): validate preflight scanner cache * fix(review): reject symlinked scanner cache entries * fix(review): require private scanner cache authority * fix(review): preserve bootstrap proxy settings * fix(review): allow read-only cache ACLs
…claw#1324) * fix(queue): use saved lease authority for direct requeues Follow up on openclaw#1251 by reading direct-requeue authority from the saved lease decision. Preserve accepted and deduplicated receipt ownership, reject superseded completion authority, and keep newer command decisions intact. The original lost-completion fix is already upstream; retain its existing contributor credit. * test(queue): document the saved-lease authority repro
) Share leading-front-matter structure across report metadata, repair intake, workflow selection, and decision packets while preserving each reader's decoding and legacy promotion guards. Keep duplicate and competing metadata fail-closed without treating ordinary body examples as authority. Add regression coverage and inspectable consumer proof. Exact-head controlled apply proof also verifies that a persisted conflicting record is rejected before GitHub transport, while valid controls reach the close boundary on synthetic state. Co-authored-by: Dwin Gharibi <dwin.gharibi@email.kntu.ac.ir>
…aw#1323) * fix(review): classify test support consistently * test(review): preserve unknown surface counts after integration
* fix(review): provision pinned Codex source * fix(review): refresh OpenClaw review caches
) Fix hosted exact-event review ancestry acquisition for pull requests that merge the base branch. Preserve complete blobless history while retaining bounded fail-closed hydration for genuinely incomplete ancestry. Co-authored-by: Goutam Adwant <8672451+goutamadwant@users.noreply.github.com> Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com> Co-authored-by: Vito Cappello <3279061+VACInc@users.noreply.github.com>
* refactor(review): let Codex judge changed PR content Remove the compiler-backed semantic cache and its patch, tree-mode, revalidation, telemetry, and runtime-install plumbing. Keep exact-input caches, restricted checkout hydration, scanner admission, and durable publication gates. Bundle matching runtime configuration, prompts, and schemas. * docs(review): describe exact-input cache ownership
Keep the runtime-budget preload fixed and move timestamps and paths into sibling JSON state. Pass the terminal fixture's checkout directory directly as inherited fd 9 instead of constructing a shell command. Remove the unnecessary temporary Node helper module while retaining all clock, readiness, descriptor and cleanup assertions. This is test-only fixture hardening with no production, configuration, dependency, deadline or threshold change. The maintainer cleanup removes four lines and one temporary program lifecycle relative to the contributor proposal; the final two-file change is +61/-57 against its integrated base. Validated published head 2e11ef4 on fresh AWS: 34/34 focused fixture cases, 4,248 full-check passes with eight explicit platform/capability skips, and 13/13 changed-coverage script tests. Exact-head CI and both CodeQL analyses passed. Precommit and committed Codex reviews had no accepted/actionable P0 findings. The unchanged macOS viewport cleanup deadline failure remains documented; it passed on AWS, and no workaround was added here. The current ClawSweeper review found no patch defect but reported missing blobs in its partial clone. Maintainer verification independently materialized all 25 relevant historical/current blobs without lazy fetch and confirmed that current main 1bcce8b leaves the fixture, helper, terminal-cleanup and runtime-budget owners unchanged from the integrated base. That covers this PR's source-review gap without claiming the reviewer infrastructure itself is fixed. Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Rewrite the contributor proposal on current main while preserving its ancestry and fail-closed fix. Share the author predicate between router and executor; preserve their distinct allowlists and case-insensitive, untrimmed matching. Missing author metadata must not authorize status selection or recovery. Remove the historical proof-only scaffold from the proposed tree. Build, 167 focused tests, and controlled compiled-function proof passed: 12 author scenarios and 103 boundary calls per phase, synthetic I/O only. AWS pnpm check passed 4,253 tests, 14 skipped, plus 13 focused coverage tests. Managed P0 Codex review passed. Bay API/UI/schema contracts are unchanged. Fixes openclaw#1072 Co-authored-by: Dwin Gharibi <dwin.gharibi@email.kntu.ac.ir>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Fixes #1072.
Both status-comment consumers previously accepted a missing author through
!author. Share a fail-closed comparator: an unreadable or empty login cannot authorize status selection, acknowledgement recovery, or canonical-landing status evaluation. Preserve the router's configurable bot set, the executor's fixed bot set, and case-insensitive matching without trimming.This rewrites the original proposal on current main while preserving @dwin-gharibi's commit ancestry and credit. The final patch is 61 insertions / 10 deletions across five files, including focused tests and the active trust documentation. The historical proof-only scaffold is removed from the proposed tree. Existing marker, receipt, freshness, and callback gates remain intact.
OpenClaw Bay impact: no status schema, observer API, or UI change. A genuine bot comment with lost author metadata is deliberately ignored and may lead to a replacement status comment. No new dependency or changelog change.
Controlled real behavior proof
Candidate
44dd657628dc7664e2074d025354c036986dd25awas compared with current-main base7cc443fe363386e197a0b19fde0c4b534df6c943on Node 24.20.0. The same probe exercised 12 author scenarios and 103 built-production boundary calls per phase. The candidate proof was replayed after committing, and source hashes still match the reviewed and remotely checked files.The command modules have executable top levels, so temporary adapters export their exact compiled private function bodies without running the CLI. Public readiness and receipt helpers are imported directly. The probe intercepts network/storage I/O and records selections, return values and callbacks; it does not replace the author comparator.
skipped_untrusted; needs-human status rejectedThe exact-head merge-readiness negative controls were already waiting before the change and remain waiting. This proof does not claim a demonstrated unauthorized merge or live exploit. No live GitHub mutation, workflow dispatch, or merge was performed by the probe.
The shared predicate can also be exercised directly after
pnpm run build:node:Validation
pnpm run check: 4,253 passed, 14 skipped, zero failures, plus 13/13 changed-coverage tests.cbx_30cef78d916c, imageami-0461d919be7deb53c, Node 24.18.1, pnpm 11.10.0. The tested candidate files match this committed head; the lease is released.