fix(sleep): separate optimizer feedback from judge evidence - #270
fix(sleep): separate optimizer feedback from judge evidence#270diqierjia wants to merge 2 commits into
Conversation
b00456b to
53e3fac
Compare
|
@microsoft-github-policy-service agree |
|
Reviewed draft The separation has clear value: raw judge evidence remains auditable, while ordinary reflection, contrastive reflection, slow update, and the contributed OpenClaw path use the semantic projection. The compatibility wrapper and legacy-result regressions are also helpful. Before marking this ready, please add a short reviewer receipt or an end-to-end integration regression tracing a mined description through replay, optimizer input, and the resulting proposal/audit artifacts. The existing focused tests cover the individual paths; the remaining acceptance question is whether the complete workflow retains useful learning signal without feeding verifier syntax back into the proposal. In particular, include a small before/after example for rule feedback and an exact/rubric or legacy non-rule case. The generic non-rule fallback is intentionally conservative, but it also removes information that was previously available to reflection; please make that trade-off and any observed effect on improvement explicit rather than equating “no regex in a prompt” with “optimization quality preserved.” Use only synthetic/public examples, not private transcripts. Please also document the trust boundary of operator/miner-provided descriptions: this is a targeted projection of known judge evidence, not a universal sanitizer for arbitrary untrusted prose or a solution to the entire alignment problem. Once the remaining draft work is complete, mark it ready and obtain green official CI on the final unchanged head. I am not treating the current draft as merge-ready, nor claiming a newly reproduced runtime regression here. |
53e3fac to
250cb66
Compare
|
Addressed the remaining draft feedback on final head
Local validation: focused |
|
Official CI status for final unchanged head |
Summary
Related to #154.
This change addresses one concrete, reproducible failure mode: raw judge evidence can leak regexes and checker implementation details into SkillOpt-Sleep optimizer prompts. The optimizer may then learn verifier syntax instead of user-visible behavior.
Scope
ReplayResult.optimizer_feedbackchannel for learning-safe semantic feedback.fail_reasonandjudge_rationaleunchanged as raw audit/debug evidence.description; if it is absent, regex checks use a conservative non-pattern fallback.Data flow
Raw judge rationale remains available in replay results, evidence logs, diagnostics, and reports for auditability. Optimizer prompts receive only
optimizer_feedback(or a recomputed safe projection for legacy rule results). Rule scoring keeps the existing backward-compatiblescore_rule_judge()return shape; the new helper carries the additional semantic feedback.Integration receipt
tests/test_optimizer_feedback_flow.pyis a deterministic, no-network end-to-end regression using the real sleep-cycle orchestration:miner description -> replay -> optimizer prompt -> proposal/audit artifactsTwo synthetic rule tasks provide train/validation separation. The baseline produces no required route and scores
0.0; the optimizer receives only the semantic description, proposes a general routing rule, and the candidate scores1.0. Assertions verify that the private regex remains available in miner/replay evidence and diagnostics, while it is absent from the optimizer prompt, returned edit, report, and staged proposal.This demonstrates preserved useful signal for this synthetic rule-judge path only. It does not establish unchanged optimization quality for every judge type or real workload.
Backward compatibility
optimizer_feedbackis optional and defaults to an empty string. Older or manually deserializedReplayResultobjects without that attribute remain usable: rule tasks recompute feedback from the task judge, while exact/rubric and other legacy non-rule results use a generic message rather than exposing raw rationale. This fallback intentionally loses potentially useful diagnostic detail; richer non-rule learning feedback requires a future typed, explicitly safe feedback API.Trust boundary
A check
descriptionis a targeted semantic projection expected to come from a trusted operator or miner. It is not a universal sanitizer for arbitrary untrusted prose, and this change is not a solution to the broader alignment problem. A description that literally copies its regex is rejected, but mined tasks, raw evidence, and staged proposals still require review.Validation
WinError 1314:TestHarnessEvidence.test_pytest_after_edit_fails_closed_on_broken_source_symlinkTestCLIFailClosed.test_symlinked_candidate_refusedpython -m compileall -q skillopt skillopt_sleep plugins scripts tests: passed.mkdocs build --strict: passed.ruff check tests/test_optimizer_feedback_flow.py plugins/openclaw/skillopt_sleep_openclaw.py: passed.git diff --check: passed.Non-goals
This is intentionally not a solution for the full intent-level mining or proxy-alignment problem described in #154. It is a narrow containment fix for judge-evidence leakage while preserving existing scoring and audit behavior.