Commit Graph

293 Commits

Author SHA1 Message Date
Yifan Yang
38697febfb Merge pull request #151 from Alphaxalchemy/feat/sleep-evidence-chain
feat(sleep): per-night evidence chain + live prompt registry
2026-07-22 01:26:45 +08:00
Yif-Yang
b12b54cb30 fix(sleep): harden evidence log privacy 2026-07-21 17:25:52 +00:00
Alpha
08cb5a9cb6 feat(sleep): per-night evidence chain and live prompt registry
* skillopt_sleep/evidence.py — append-only, thread-safe, redacted
  evidence.jsonl per night: harvest sessions -> miner exchanges (verbatim
  prompt/reply) -> mined tasks with checks -> split assignment -> every
  replay attempt (phase-tagged, cache hits marked) -> per-task scores with
  failing checks named -> reflect exchanges + parsed edits -> gate trials
  and the final decision with its score arithmetic -> staged artifacts.
  Config-gated (evidence_log, default on; evidence_max_chars cap).

* skillopt_sleep/prompts.py — central registry of the four LLM prompt
  templates (miner/attempt/judge/reflect), byte-identical defaults to the
  previously inlined strings; user overrides in prompts.json take effect
  on the next model call (mtime-checked), no restart needed.

* cycle.py builds dual backends from config (optimizer_*/target_*),
  pre-creates the staging dir so evidence lands beside the report;
  staging.new_staging_dir() de-collides same-second runs;
  latest_staging() now skips non-adoptable (evidence-only) folders.

* tests/test_sleep_evidence.py — 8 no-network stdlib tests: chain
  completeness, redaction/truncation/ordering, disable flag, prompt
  override round-trip + live effect, no-tasks-night adoption guard.
2026-07-21 17:15:41 +00:00
Yifan Yang
b39081768a Merge pull request #161 from Yif-Yang/fix/cursor-env-isolation
fix(sleep): isolate Cursor backend environment
2026-07-22 01:15:01 +08:00
Yif-Yang
717dedd5a9 fix(sleep): isolate Cursor backend environment 2026-07-21 17:14:05 +00:00
Yifan Yang
4a1fa4f247 Merge pull request #159 from jamesmdavies88/feat/cursor-skillopt-sleep
Add native Cursor support to SkillOpt-Sleep
2026-07-22 01:06:16 +08:00
Yif-Yang
57c808d2d7 Merge upstream/main into feat/cursor-skillopt-sleep 2026-07-21 17:05:31 +00:00
Yifan Yang
90954e6686 Merge pull request #160 from jamesmdavies88/feat/cursor-core-target
Add Cursor Agent as a core SkillOpt target backend
2026-07-22 01:04:18 +08:00
James Davies
4aa59ed0a8 Guard Cursor file-edit rollouts with sandboxing 2026-07-20 21:15:04 +01:00
James Davies
8b1d75e6b8 Disable unverified Cursor Sleep tool replay 2026-07-20 21:14:39 +01:00
James Davies
586b1e3f6c Allow cursor to work with non-sleep Skillopt 2026-07-20 21:05:09 +01:00
James Davies
a31cc94139 Slim down surface for this integration 2026-07-19 22:37:20 +01:00
James Davies
c2596e0c1a docs: clarify Cursor replay boundaries 2026-07-19 21:21:55 +01:00
James Davies
e34f3c912c Merge branch 'main' of https://github.com/microsoft/SkillOpt into feat/cursor-skillopt-sleep
# Conflicts:
#	plugins/devin/README.md
#	plugins/devin/mcp_server.py
#	tests/test_devin_plugin.py
2026-07-19 21:21:27 +01:00
James Davies
cd5ca48226 Add Cursor SkillOpt-Sleep integration and transcript harvesting. 2026-07-19 21:03:25 +01:00
Yifan Yang
b860a5cf88 Merge pull request #150 from Yif-Yang/test/assert-fractional-degradation-score
test(sleep): assert fractional candidate score
2026-07-19 01:28:47 +08:00
Yif-Yang
7933f37bf0 test(sleep): assert fractional candidate score 2026-07-18 17:28:22 +00:00
Yifan Yang
67b67acf5f Merge pull request #149 from harshitnagar22/test/fractional-degradation-gate
test(sleep): add fractional degradation gate test for partial held-out regression
2026-07-19 01:26:25 +08:00
Harshit Nagar
4a4d597527 test(sleep): add fractional degradation gate test for partial held-out regression 2026-07-18 22:24:30 +05:30
Yifan Yang
8a50db3312 Merge pull request #147 from detailobsessed/feat/devin-handoff-backend
feat(devin): expose handoff backend in MCP server enum
2026-07-18 01:01:59 +08:00
Ismar
195d95e00c feat(devin): expose handoff backend in MCP server enum (#3)
The Devin MCP server's backend enum only listed mock/claude/codex/copilot,
excluding the handoff backend that was merged to the engine in #125. This
made the subscription-friendly, no-API-key path unavailable to Devin users
while Claude Code had a dedicated /skillopt-sleep-handoff command for it.

Add "handoff" to the backend enum in _TOOL_SCHEMA so sleep_run accepts
backend: "handoff". The engine already handles the prompt/answer file loop
(exit code 3 + .skillopt-sleep-handoff/); the MCP server needs no special
handling — it passes through the engine output showing pending prompts.

Update the README, rules snippet, and test_backends_in_enum accordingly.
2026-07-16 15:20:50 +02:00
Yifan Yang
d2670205d1 Merge pull request #146 from Yif-Yang/fix/codex-token-tracker-isolation
fix(model): prevent Codex token double counting
2026-07-16 19:03:02 +09:00
Yif-Yang
74ff263608 fix(model): isolate Codex token tracking 2026-07-16 10:02:21 +00:00
Yifan Yang
3e3df8895e Merge pull request #112 from TheGameVIX/agent/codex-exec-optimizer-main
fix(codex): support exec optimizer backend
2026-07-16 18:57:47 +09:00
Yifan Yang
0d8839778c Merge pull request #101 from SparshGarg999/fix/46-windows-support-codex
feat(codex): add Windows support and compatibility for Codex plugin
2026-07-16 18:57:15 +09:00
TheGameVIX
0b94f890a0 fix(codex): support exec optimizer backend 2026-07-15 12:06:46 -04:00
Sparsh :)
7c7fdfcd6c fix(windows): resolve control flow and path quoting in scheduler task execution 2026-07-15 14:54:27 +05:30
Yifan Yang
57333f3406 Merge pull request #143 from Yif-Yang/draft/technical-blog-sar-review
docs: clarify blog structure and Skill-Aware Reflection
2026-07-15 04:12:07 +09:00
Yif-Yang
a44566aeb8 docs: clarify technical blog structure and SAR 2026-07-14 19:10:47 +00:00
Yifan Yang
9babe37944 Merge pull request #140 from Yif-Yang/docs/technical-blog-gating-reflection
docs: launch SkillOpt Technical Blog
2026-07-15 03:14:20 +09:00
Yif-Yang
a12072241d docs: launch SkillOpt Technical Blog 2026-07-14 18:12:58 +00:00
Yifan Yang
a49d0eb1b9 Merge pull request #139 from Yif-Yang/docs/sync-post-v0.2
docs: sync documentation with post-v0.2 changes
2026-07-15 02:16:18 +09:00
Yif-Yang
f31bf8c06b docs: sync documentation with post-v0.2 changes 2026-07-14 17:11:40 +00:00
Yifan Yang
efb30b4bcc Merge pull request #138 from Yif-Yang/fix/sleep-openai-compat-safety
fix(sleep): harden OpenAI compatibility boundaries
2026-07-14 18:17:58 +09:00
Yif-Yang
8b39394c88 fix(sleep): harden OpenAI compatibility boundaries 2026-07-14 09:17:18 +00:00
Yifan Yang
be2184660a Merge pull request #129 from Alphaxalchemy/feat/openai-compatible-endpoints
feat(sleep): support OpenAI-compatible endpoints (DeepSeek, vLLM) in azure_openai backend
2026-07-14 18:10:17 +09:00
Yifan Yang
940c3cd4ec Merge pull request #137 from Yif-Yang/fix/claude-tempdir-cleanup
fix(claude): use cleanup-tolerant temporary directory
2026-07-14 17:50:10 +09:00
Yifan Yang
42270f7fa4 Merge pull request #136 from Yif-Yang/fix/json-array-scan-linear
perf(json): keep array scan linear on malformed output
2026-07-14 17:50:07 +09:00
Yif-Yang
6a193ffd78 fix(claude): use cleanup-tolerant temporary directory 2026-07-14 08:46:54 +00:00
Yif-Yang
48e4c66827 perf(json): keep array scan linear on malformed output 2026-07-14 08:46:54 +00:00
Yifan Yang
1b64b000fb Merge pull request #135 from nankingjing/fix/issue-117-wheel-md-and-tempdir
Fix #117: include .md prompt files in wheel + handle Windows temp-dir cleanup
2026-07-14 17:41:55 +09:00
Yifan Yang
7191f1cb1f Merge pull request #103 from zixuanguo786-ctrl/codex/robust-json-array-extraction
[codex] Harden JSON array extraction
2026-07-14 17:41:52 +09:00
Yifan Yang
7bf9ecbec6 Merge pull request #115 from nankingjing/contrib/add-openai-compatible-backend
feat(model): add generic OpenAI-compatible LLM backend
2026-07-14 17:41:49 +09:00
Yifan Yang
2ffa73410e Merge pull request #105 from zixuanguo786-ctrl/codex/reject-duplicate-searchqa-manifest-ids
[codex] Reject duplicate SearchQA manifest ids
2026-07-14 17:41:45 +09:00
Yifan Yang
c2992b96a6 Merge pull request #104 from zixuanguo786-ctrl/codex/preserve-fractional-hard-score
[codex] Preserve fractional rollout hard scores
2026-07-14 17:41:42 +09:00
Alphaxalchemy
4ff77b71ff fix(sleep): address review — CLI choice, auth guard, provider-neutral kwargs, tests
Addresses maintainer review on the OpenAI-compatible endpoints PR:

1. CLI: accept --backend azure_openai in skillopt_sleep/__main__.py (the
   documented command was rejected by the argparse choices).
2. Example runner: exit with the child's return code so watchdog/supervisors
   see a failed sleep run as a failure.
3. Error state: clear last_call_error when a retry recovers; set an explicit
   "empty response on all N attempts" diagnostic when every attempt returns
   empty text.
4. Security guard: the managed-identity path now refuses to send an Azure AD
   bearer token to any endpoint outside *.openai.azure.com /
   *.cognitiveservices.azure.com — a custom endpoint requires explicit
   AZURE_OPENAI_AUTH_MODE=openai_compatible + API key.
5. Provider-neutral requests: compat mode sends only the standard contract
   (max_tokens, default 8192 via SKILLOPT_SLEEP_COMPAT_MAX_TOKENS);
   provider-specific body fields are opt-in via SKILLOPT_SLEEP_CHAT_EXTRA_BODY
   (JSON) — the deepseek model-name inference is removed.
6. Docs: removed the unimplemented OPTIMIZER_*/TARGET_* env-var claim; added a
   configuration reference matching the implementation exactly.
7. Tests: tests/test_azure_openai_compat.py — 17 deterministic no-network
   unittest cases covering CLI acceptance, compat-vs-Azure client selection,
   endpoint resolution, the credential guard, request kwargs (opt-in extra
   body / token cap), retry-success error clearing, empty-response
   diagnostics, and runner exit-code propagation.

Re-verified live against DeepSeek (deepseek-v4-pro, openai_compatible mode)
after the rework: client type OpenAI, completion returned, no error state.
2026-07-14 01:22:19 -06:00
nankingjing
df5bf20f09 Fix #117: include .md prompt files in wheel + handle Windows temp-dir cleanup
Fix 1: Add [tool.setuptools.package-data] to pyproject.toml so that
all .md prompt files (generic prompts under skillopt/prompts/ and
env-specific prompts under skillopt/envs/*/prompts/) are included
in the wheel. Previously pip install from PyPI would fail with
FileNotFoundError on first prompt load.

Fix 2: Replace TemporaryDirectory context manager with mkdtemp +
shutil.rmtree(ignore_errors=True) in claude_backend._run_claude_print.
On Windows, the spawned claude/node subprocess still holds a handle
on the temp directory when the context manager tries to clean up,
causing WinError 32. Manual rmtree with ignore_errors=True works
on all Python versions >= 3.10.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-14 11:17:19 +08:00
Ziiii
ddc35b339d Fix array extraction after unmatched brace 2026-07-14 09:35:42 +08:00
nankingjing
45ff88a20c test(model): cover OpenAI-compatible backend integration
Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-14 09:21:11 +08:00
黄云龙
e452761231 docs(new-backend): document the built-in openai_compatible backend 2026-07-14 09:17:43 +08:00