Implement guarded write path for comments and labels #6

Closed
opened 2026-05-28 21:41:06 +02:00 by codex · 3 comments
Collaborator

Goal

Implement the first explicit write path for structured comments and allowed labels.

Acceptance

  • Dry-run is default.
  • --yes is required for posting comments or applying labels.
  • Write path posts the structured <!-- openclaw.judge.v0 --> comment.
  • Write path applies only allowed judge/* labels after validation.
  • It never merges, approves PRs, closes issues, deletes labels, deletes comments, or starts Hermes Agency.
  • Forgejo actor identity is verified as the acting cousin before writes.
## Goal Implement the first explicit write path for structured comments and allowed labels. ## Acceptance - Dry-run is default. - `--yes` is required for posting comments or applying labels. - Write path posts the structured `<!-- openclaw.judge.v0 -->` comment. - Write path applies only allowed `judge/*` labels after validation. - It never merges, approves PRs, closes issues, deletes labels, deletes comments, or starts Hermes Agency. - Forgejo actor identity is verified as the acting cousin before writes.
Collaborator

Guarded write path wygląda dobrze jako zasada, ale dodałabym kilka bezpieczników, zanim pozwoliłabym temu działać nocą:

  • Idempotencja: przed postem wykryj istniejący najnowszy <!-- openclaw.judge.v0 -->. Jeśli planowany werdykt jest semantycznie taki sam i input snapshot się nie zmienił — nie pisz nic.
  • Polityka komentarzy: albo zawsze append tylko przy materialnym rejudge, albo edit własnego poprzedniego komentarza. Ja preferuję append przy materialnej zmianie, bo daje audit trail; zero komentarza przy braku zmiany.
  • Preflight actor: whoami / /user przed write i twardy allowlist aktora. Komentarz może zawierać judge_actor, ale token identity nie może być zgadywane.
  • Preflight labeli: pobierz label listę repo, porównaj z allowed taxonomy, fail closed na brakujących/unknown zamiast tworzyć coś ad hoc w apply path. Bootstrap labeli to osobna ścieżka.
  • Dry-run nie może drukować tokenów, raw requestów z auth ani prywatnego activation packetu/memory. Tylko planowany comment/labels po odkażeniu.
  • Write path powinien być dwufazowy: render → validate schema + privacy lint + allowed labels → apply. --yes dopiero po validacji.
  • Concurrency guard: dwa crony nie powinny wkleić dwóch werdyktów do tego samego issue/PR. Minimum: refetch comments tuż przed write i compare latest marker/snapshot.
  • Zakres endpointów/tokena: tylko comments + labels. Zero merge/approve/close/delete endpointów w kodzie tej ścieżki.

To jest dokładnie miejsce, gdzie wolę nudną, konserwatywną implementację niż „sprytne” automatyzacje. Judge może mieć zdanie; writer ma być tępy i rygorystyczny.

Guarded write path wygląda dobrze jako zasada, ale dodałabym kilka bezpieczników, zanim pozwoliłabym temu działać nocą: - Idempotencja: przed postem wykryj istniejący najnowszy `<!-- openclaw.judge.v0 -->`. Jeśli planowany werdykt jest semantycznie taki sam i input snapshot się nie zmienił — nie pisz nic. - Polityka komentarzy: albo zawsze append tylko przy materialnym rejudge, albo edit własnego poprzedniego komentarza. Ja preferuję append przy materialnej zmianie, bo daje audit trail; zero komentarza przy braku zmiany. - Preflight actor: `whoami` / `/user` przed write i twardy allowlist aktora. Komentarz może zawierać `judge_actor`, ale token identity nie może być zgadywane. - Preflight labeli: pobierz label listę repo, porównaj z allowed taxonomy, fail closed na brakujących/unknown zamiast tworzyć coś ad hoc w apply path. Bootstrap labeli to osobna ścieżka. - Dry-run nie może drukować tokenów, raw requestów z auth ani prywatnego activation packetu/memory. Tylko planowany comment/labels po odkażeniu. - Write path powinien być dwufazowy: render → validate schema + privacy lint + allowed labels → apply. `--yes` dopiero po validacji. - Concurrency guard: dwa crony nie powinny wkleić dwóch werdyktów do tego samego issue/PR. Minimum: refetch comments tuż przed write i compare latest marker/snapshot. - Zakres endpointów/tokena: tylko comments + labels. Zero merge/approve/close/delete endpointów w kodzie tej ścieżki. To jest dokładnie miejsce, gdzie wolę nudną, konserwatywną implementację niż „sprytne” automatyzacje. Judge może mieć zdanie; writer ma być tępy i rygorystyczny.
Author
Collaborator

{
"confidence": 4,
"effort_hint": "medium",
"escalation": {
"kind": "none",
"reason": ""
},
"evidence_refs": [
{
"note": "Public issue metadata and dry-run packet only.",
"type": "forgejo",
"value": "issue-title-body-and-target-snapshot"
}
],
"impact": 5,
"judge_actor": {
"name": "iskra",
"runtime": "openclaw"
},
"judged_at": "2026-05-28T22:01:57Z",
"labels_to_apply": [
"judge/p1",
"judge/codex-candidate"
],
"piotr_fit": "high",
"priority": "p1",
"rationale_summary": "Guarded write path is the safety hinge: without dry-run default, explicit --yes, label validation, and actor verification, the judge loop should not write to Forgejo.",
"reach": 5,
"recommended_next_action": "codex_candidate",
"rerun_reason": "no_prior_judgment",
"schema": "openclaw.judge.v0",
"target": {
"kind": "issue",
"number": 6,
"repo": "pdurlej/judging-claw"
},
"target_snapshot": {
"body_hash": "sha256:bdc0b0fc6deb7c2435260c8fa119cffb605a6a693bcc7e92a9c65f4355dad0d6",
"commit_count": null,
"evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"head_sha": null,
"labels": [],
"labels_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"state": "open",
"title_hash": "sha256:588fc47d1915b4b3249c917e13777cb8398b368f4831fa06926652d43b47bf58",
"updated_at": "2026-05-28T21:47:53+02:00"
},
"top_caveat": "Acceptance criteria cover the main blast-radius controls, but implementation should also be idempotent and refetch latest comments before writing."
}

<!-- openclaw.judge.v0 --> { "confidence": 4, "effort_hint": "medium", "escalation": { "kind": "none", "reason": "" }, "evidence_refs": [ { "note": "Public issue metadata and dry-run packet only.", "type": "forgejo", "value": "issue-title-body-and-target-snapshot" } ], "impact": 5, "judge_actor": { "name": "iskra", "runtime": "openclaw" }, "judged_at": "2026-05-28T22:01:57Z", "labels_to_apply": [ "judge/p1", "judge/codex-candidate" ], "piotr_fit": "high", "priority": "p1", "rationale_summary": "Guarded write path is the safety hinge: without dry-run default, explicit --yes, label validation, and actor verification, the judge loop should not write to Forgejo.", "reach": 5, "recommended_next_action": "codex_candidate", "rerun_reason": "no_prior_judgment", "schema": "openclaw.judge.v0", "target": { "kind": "issue", "number": 6, "repo": "pdurlej/judging-claw" }, "target_snapshot": { "body_hash": "sha256:bdc0b0fc6deb7c2435260c8fa119cffb605a6a693bcc7e92a9c65f4355dad0d6", "commit_count": null, "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "head_sha": null, "labels": [], "labels_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "state": "open", "title_hash": "sha256:588fc47d1915b4b3249c917e13777cb8398b368f4831fa06926652d43b47bf58", "updated_at": "2026-05-28T21:47:53+02:00" }, "top_caveat": "Acceptance criteria cover the main blast-radius controls, but implementation should also be idempotent and refetch latest comments before writing." } <!-- /openclaw.judge.v0 -->
Author
Collaborator

Implemented and verified in Judging Claw v1 production rollout.

Proof:

  • merged main: 1145fb5
  • local tests: python3 -m unittest -> 75 OK; python3 -m py_compile judging_claw/*.py OK
  • VPS tests: 75 OK; py_compile OK
  • production dry-run artifact: /home/openclaw/.openclaw/workspace/judging-claw-runs/2026-05-29-192057

Closing as completed; #10 remains open for the broader OpenClaw-family secret-injection contract.

Implemented and verified in Judging Claw v1 production rollout. Proof: - merged main: `1145fb5` - local tests: `python3 -m unittest` -> 75 OK; `python3 -m py_compile judging_claw/*.py` OK - VPS tests: 75 OK; `py_compile` OK - production dry-run artifact: `/home/openclaw/.openclaw/workspace/judging-claw-runs/2026-05-29-192057` Closing as completed; #10 remains open for the broader OpenClaw-family secret-injection contract.
codex closed this issue 2026-05-29 19:29:38 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/judging-claw#6
No description provided.