Repository navigation
feat(sleep): add AgenticReplayBackend with three-valued outcome and isolated worktree (#155) - #391
RohithPariki wants to merge 2 commits into
Conversation
|
Thanks for picking up #155. The three-valued outcome, the reason codes and the list-argv invocation are good foundations. Measured against the acceptance bar agreed on #155 (lifecycle first, agent execution disabled by default, no sandbox claims, inconclusive separated by cause), there are a few issues to resolve before this can merge. I'm listing all of them at once.
Smaller items: kill the whole process group on timeout (a backgrounded grandchild currently survives), cap captured stdout and diff size (300 MiB of agent output raised harness RSS to about 920 MiB), keep the agent's HOME outside the diffed tree (files written there end up in |
…nv isolation, and add pairwise gate exclusion
|
Thank you for the thorough review Yifan Yang (@Yif-Yang)! I have updated the PR branch (
Validation run after the final edit:
|
Summary
Implements the workspace-lifecycle and three-valued outcome slice for Issue #155:
Three-Valued Outcome Protocol (
skillopt_sleep/types.py):ReplayResultwithoutcome(pass|fail|inconclusive),inconclusive_reason(timeout,infra,fixture_failure,budget_exhausted,insufficient_evidence), anddiff.__post_init__default inference ("pass"whenhard >= 1.0, else"fail").Opt-In Scratch Workspace & Hardened Lifecycle (
skillopt_sleep/agentic_replay.py):agent_runnerpath (agent_cmd/ live CLI binary execution andsandbox_typeremoved;enabled=Falseby default, strictis Truecheck).AgenticWorkspace, not a linked worktree and with no OS/container security boundary or network enforcement):git archive --format=tar <sha>without copying.git; unpinned copies reject.gitfiles, symlinks escaping root, andobjects/info/alternates.harness.gitwith-c core.hooksPath=<empty> -c core.fsmonitor= -c diff.external= -c commit.gpgsign=false --no-ext-diff --no-textconvand strict scrubbed env (GIT_CONFIG_NOSYSTEM=1,GIT_CONFIG_GLOBAL=<empty_file>), failing cleanly withFixtureSetupError(fixture_failure) rather than swallowing git errors.PATH, locale/OS minimal vars) redirectingHOME,USERPROFILE,TMPDIR, XDG dirs,CLAUDE_CONFIG_DIR,CODEX_HOME,GIT_ASKPASS,SSH_ASKPASSoutside the diffed workspace tree.intent,context_excerpt,skill,memory) delivered viastdin/ external JSON payload file; fixtures accepted only from explicitagentic_fixture_rootwithrealpathcontainment validation.stdout/stderrand unified diffs.inconclusive(insufficient_evidence); non-zero subprocess exits classify asinfra; enforces thread-safe per-night replay/token/turn caps and decidable action floors.Pairwise Gate Exclusion & Wiring (
replay.py,consolidate.py,dream.py,cycle.py,backend.py,config.py,__init__.py):pairwise_aggregate_scores()and updatedconsolidate()to score baseline and candidate over the exact intersection of decidable validation tasks, exclude inconclusive tasks from train reflection, and abstain (abstain_inconclusive) belowmin_decidable_coverage.agentic_*configuration keys fromSleepConfigthroughcycle.py/build_backend/get_backendwith per-night budget resets (reset_run_budget()) and lazy import inskillopt_sleep/__init__.py.Tests (
tests/test_agentic_replay.py):git worktree add&alternatesisolation,.git/configdiff.externaldefense, flag-like intent/fixture containment, allowlist scrubbing, process-group timeout kills, byte caps, pairwise gate abstention/acceptance, and reflection filtering.Closes #155 (first workspace-lifecycle slice).