fix(harness): show candidate diff before approval - #802
Merged
Conversation
cgfixit
force-pushed
the
cx/cyclaw-optimize-harness-macos-safety
branch
from
August 5, 2026 21:25
cebbca8 to
f967288
Compare
|
PR template check (advisory, non-blocking) This PR body doesn't look like it covers everything
This isn't a required check -- it won't block merge. See the template's own "Notes for contributors" for which sections lighter-path PRs can skip. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Plan
Branch:
cx/cyclaw-optimize-harness-macos-safetyDepends on: []
Delivers: pending-diff rendering plus a browser contract regression test
Gates: [targeted pytest + full pytest + Ruff + invariant guard + doc-sync + fresh-main trial merge]
Risks to monitor:
diff; the operator must run/agent status <id>before approval is offered.Summary
Implements the first focused CyClaw-Optimize item for human-review integrity: the browser harness now displays the backend-produced candidate diff before showing
/agent approveand/agent rejectinstructions. If the pending record has no diff, it warns the operator to refresh with/agent statusinstead of offering a blind approval path.Base audited:
origin/mainat26f9586e5ad152ac8b3e46f0a60f81d315f932dd.Invariant / CG-Security Invariant Check (CyClaw)
gate.py,graph.py, or retrieval paths.Verification Steps Before Commit
tests/suite on Python 3.12: passed (GROK_API_KEY=dummy,HF_HUB_OFFLINE=1).ruff check --no-cache tests/test_harness_console_contract.py: passed..claude/skills/doc-sync/doc_sync.py: 0 drift items (D1-D6 clean)..claude/skills/invariant-guard/check_invariants.py: 33 passed, 0 failed.git diff --check: passed; 2 text files changed, no binary files.origin/mainthrowaway trial merge: clean, zero unmerged index entries; focused post-merge tests passed.utils/logger.pyaudit-log line reference: not applicable; this PR does not change that file or audit logging.What Changed and Potential Negative Impact or Drift
static/harness.htmlrendersrec.diffbefore approval instructions./agent status <id>.tests/test_harness_console_contract.pylocks ordering and the fail-closed missing-diff behavior.Potential negative impact: one extra status command may be required when the initial response omits the diff. That is deliberate; review integrity takes precedence over a blind one-click approval path.