Skip to content

feat(sleep): adopt reviewed skill subsets safely - #212

Open
Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
microsoft:mainfrom
bogdanbaciu21:skoc-008-adopt-reviewed-skill-subset
Open

feat(sleep): adopt reviewed skill subsets safely#212
Bogdan (Dan) Baciu (bogdanbaciu21) wants to merge 1 commit into
microsoft:mainfrom
bogdanbaciu21:skoc-008-adopt-reviewed-skill-subset

Conversation

@bogdanbaciu21

@bogdanbaciu21 Bogdan (Dan) Baciu (bogdanbaciu21) commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Supersedes #189, which could not be reopened after its branch was rebased.

Adds an explicit, auditable way to adopt a reviewed subset of multi-skill Sleep proposals. Staging remains non-mutating: live skills change only when adopt_skills() is explicitly called.

What changed

  • Adds staged_skills() to inspect staged skill proposals.
  • Adds adopt_skills(staging_dir, skill_names) for subset or all-skill adoption.
  • Validates every selection before writing anything.
  • Backs up existing files and replaces them atomically.
  • Rolls back the entire selection if any write fails.
  • Records SHA-256 before/after hashes and backup paths.
  • Preserves existing file permissions.
  • Documents the staging layout, adoption flow, receipts, and migration behavior.

Safety contract

  • No implicit adoption.
  • Unknown, duplicate, malformed, or unsafe selections fail before writes.
  • Unselected skills remain untouched.
  • Partial adoption cannot survive a failed write.
  • Every adopted change produces a verifiable receipt.

Compatibility

The existing single-skill path is unchanged:

  • Manifests without skills remain valid.
  • adopt() retains its current behavior.
  • adopt_skills() is an independent, opt-in API.
  • skill_names=None adopts all staged skills; [] adopts none.

Review follow-up

Addresses all feedback from #189:

  • Validates the manifest root.
  • Rejects unsafe proposal filenames.
  • Preserves file modes during atomic replacement.
  • Removes the redundant live-file read.

Validation

  • 39 focused tests passed.
  • 233 Sleep tests passed, 3 skipped.
  • 945 full-suite tests passed, 8 skipped.
  • Ruff passed.

Non-goals

  • Automatic adoption.
  • Changes to gate or scoring behavior.
  • Changes to legacy single-skill staging semantics.

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.

1 participant