Skip to content

fix(sleep): harden merged outcome, grouping, and Copilot paths - #203

Merged
Yifan Yang (Yif-Yang) merged 3 commits into
microsoft:mainfrom
Yif-Yang:fix/aug06-post-merge-hardening
Aug 6, 2026
Merged

fix(sleep): harden merged outcome, grouping, and Copilot paths#203
Yifan Yang (Yif-Yang) merged 3 commits into
microsoft:mainfrom
Yif-Yang:fix/aug06-post-merge-hardening

Conversation

@Yif-Yang

Copy link
Copy Markdown
Contributor

Follow-up hardening for #198, #186, and #200 after preserving their original merge commits and contributor attribution.

Changes

  • Measure bare-refusal length after removing leading Markdown markers, while avoiding Unicode case-folding length distortion.
  • Enforce read-only shared memory in grouped consolidation without duplicate evolve_memory keyword failures.
  • Redact Copilot CLI transcript secrets before the 4000-character persistence boundary is applied.

Verification

  • 86 focused tests passed.
  • Full suite: 796 passed, 6 skipped, 130 subtests passed.
  • Ruff passed on all changed source and test files.
  • git diff --check passed.
  • A second independent Codex review found no blockers.

Copilot AI lite review requested due to automatic review settings August 6, 2026 02:06
@Yif-Yang
Yifan Yang (Yif-Yang) merged commit 9639719 into microsoft:main Aug 6, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens SkillOpt-Sleep’s consolidation and judging/harvest pipelines following earlier merges, focusing on refusal detection robustness, enforcing read-only shared memory in grouped consolidation, and preventing secret persistence when harvesting Copilot CLI sessions.

Changes:

  • Update no_refusal detection to measure refusal length after stripping leading Markdown markers and avoid Unicode lowercasing length distortion.
  • Enforce shared-memory isolation in consolidate_groups() by overriding any caller-supplied evolve_memory.
  • Redact secrets in Copilot CLI session text before applying the 4000-character clipping bound.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_sleep_multi_skill.py Adds coverage ensuring callers cannot override grouped shared-memory isolation.
tests/test_outcome_judges.py Adds regression tests for refusal-length measurement vs Markdown prefixes and Unicode lowercasing expansion.
tests/test_harvest_copilot_cli.py Adds tests asserting secrets are redacted (including before clipping) when harvesting Copilot CLI sessions.
skillopt_sleep/multi_skill.py Hardens grouped consolidation to always force evolve_memory=False without duplicate-kw failures.
skillopt_sleep/judges.py Refines refusal detection to strip Markdown markers before length checks and avoid lowercasing length distortion.
skillopt_sleep/harvest_copilot_cli.py Redacts secrets before truncating harvested Copilot CLI text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

(
"s1",
0,
f"Use Authorization: Bearer {user_secret} for this task",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants