Skip to content
Draft
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c8020b3
ooo: complete auto session execution started for grade A Seed
lee3Q Nov 29, 2026
60fe174
feat(cloud): add zero-daemon cloud sandbox runtime and workspace-loca…
lee3Q Nov 29, 2026
cc94095
docs: record cloud runtime verification status
lee3Q Nov 29, 2026
52c5b09
fix(cloud): harden portable bundle recovery
lee3Q Nov 29, 2026
e8d3f17
fix(cloud): harden checkpoint and import boundaries
lee3Q Nov 29, 2026
896b3fe
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 29, 2026
58797a9
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 29, 2026
a32a16a
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 29, 2026
0b03a62
test(cloud): close round four verification gaps
lee3Q Nov 29, 2026
1a18bb1
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 29, 2026
c0d893b
test(cloud): add real process recovery journeys
lee3Q Nov 29, 2026
fa2b5ae
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 29, 2026
16e686a
test(cloud): complete maintainer readiness hardening
lee3Q Nov 30, 2026
fbbc5c3
fix(cloud): close round nine isolation and rollback gaps
lee3Q Nov 30, 2026
b44f9e3
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
c9d3083
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
b7aaf16
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
0c0e703
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
0bd4a2e
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
24a30b0
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
49fdd63
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
34a5461
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
f48f2b7
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
b8b040c
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
ec5ac3b
test(task2-chatgpt-work-cloud-runtime): complete verification & harde…
lee3Q Nov 30, 2026
88679cb
Merge remote-tracking branch 'origin/main' into feat/cloud-sandbox-ru…
lee3Q Nov 30, 2026
427e8eb
Merge remote-tracking branch 'origin/main' into feat/cloud-sandbox-ru…
lee3Q Nov 30, 2026
c9fcabd
Merge remote-tracking branch 'origin/main' into feat/cloud-sandbox-ru…
lee3Q Nov 30, 2026
932e76b
Merge remote-tracking branch 'origin/main' into feat/cloud-sandbox-ru…
lee3Q Nov 30, 2026
7aeeffd
fix(cloud): harden trust boundary and crash recovery
lee3Q Nov 30, 2026
3312432
chore: remove prohibited root work state files
lee3Q Nov 30, 2026
e641d45
fix(cloud): harden bundle and host-turn boundaries
lee3Q Nov 30, 2026
55a4917
fix(cloud): make crash recovery replay safe
lee3Q Nov 30, 2026
41e66bf
fix(cloud): harden bundle publish recovery boundaries
lee3Q Nov 30, 2026
a6b6757
fix(cloud): close round five runtime regressions
lee3Q Nov 30, 2026
4ff2f07
fix(cloud): harden round six edge cases
lee3Q Nov 30, 2026
0bacebf
fix(cloud): validate quoted patch paths
lee3Q Nov 30, 2026
e3cbed0
ci: always collect Windows worker evidence
lee3Q Nov 30, 2026
a801fe0
test(hv2-ouroboros-cloud-3129-security-and-work-integration): complet…
lee3Q Nov 30, 2026
3d6675a
fix(cloud): harden crash recovery and import replay
lee3Q Dec 1, 2026
41ebd0e
fix(cloud): bound detached output drain
lee3Q Dec 1, 2026
0f15e97
ci: preserve Windows worker evidence after cancellation
lee3Q Dec 1, 2026
94af23b
fix(mcp): await owning task during job cancellation
lee3Q Dec 1, 2026
1abf2da
fix(cloud): ignore hunk lines as patch headers
lee3Q Dec 1, 2026
152a3ad
fix(cloud): confine import journal recovery paths
lee3Q Dec 1, 2026
37075e9
chore(fix_pr3129_octal_path_rollback): checkpoint verified stage
Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions STATUS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ouroboros

## 🗺️ 단계 / 로드맵
- [x] 1단계: 기존 런타임·CLI 경계와 모듈 크기 게이트 점검
- [x] 2단계: Cloud Sandbox / Zero-Daemon 휴대용 런타임 구현 및 단위 테스트
- [x] 3단계: 로컬 제한 환경 시뮬레이션과 전체 품질 게이트 검증
- [x] 4단계: Live Aside 확인 기록 및 Draft PR 게시
- [ ] 👉 5단계: Draft PR CI 재확인 및 결정적 bundle/patch 왕복 보강 (현재 위치)

## 🛑 블로커
- 블로커: 없음

## 🤖 AI 실행 맥락
- 마지막 커밋: feat/cloud-sandbox-runtime-20261130 (Draft PR #3129)
- 마지막 검증: cloud/telemetry 27개 및 `tests/ -k cloud` 32개, module-size, Ruff, MyPy 통과
- 지금 손댄 파일: `src/ouroboros/cloud/bundle.py`, `src/ouroboros/cloud/state.py`, `src/ouroboros/cloud/driver.py`
- 다음 할 일: 변경 커밋·푸시 후 Draft PR CI 재확인
22 changes: 22 additions & 0 deletions docs/cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,35 @@ ouroboros [OPTIONS] COMMAND [ARGS]...
| `seed` | Generate or inspect seed specifications |
| `workflow-ir` | Inspect workflow intermediate representation |
| `zcode` | Convenience wrapper for Zcode (bundles `start`, `qa`, `run` with Zcode pre-selected; for global config use `setup --runtime zcode`) |
| `cloud` | Run a workspace-local zero-daemon workflow and export/import portable state bundles |

> **Shorthand entry points:** `ooo` and `ouroboros` both launch the main CLI.
> `ozo` is a standalone shorthand that launches only the Zcode convenience commands
> (equivalent to `ouroboros zcode ...`).

---

## `ouroboros cloud`

Run a deterministic host-turn workflow in a managed cloud sandbox without a
background daemon, runtime socket, writable HOME/XDG directory, or private Git
authentication. State is stored under `<workspace>/.ouroboros-cloud/`.

```bash
ouroboros cloud init --workspace . --seed "Build a report"
ouroboros cloud plan --workspace . 'python -m compileall -q src' 'uv run pytest tests/unit/cloud -q'
ouroboros cloud next --workspace .
ouroboros cloud record-evidence tests passed --workspace . --step 0
ouroboros cloud verify --workspace .
```

`cloud bundle export` creates a deterministic, checksum-manifested tar bundle.
For Git workspaces it also includes an execution patch tied to the recorded
base revision. `cloud bundle import` verifies the manifest and refuses to
apply that patch if local `HEAD` moved or the patch no longer applies.

---


## `ouroboros auto`

Expand Down
49 changes: 49 additions & 0 deletions docs/guides/cloud-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Cloud Sandbox / Zero-Daemon Runtime

The portable runtime keeps its durable workflow state in
`<workspace>/.ouroboros-cloud/state.json`. It does not use `HOME`, XDG state,
private GitHub credentials, background daemons, or runtime sockets.

Environment detection is available through `ouroboros.cloud.detect_environment`.
It recognizes `/workspace`, `CODEX_CLOUD`, unavailable HOME/XDG directories,
`GIT_TERMINAL_PROMPT=0`, and explicit daemon/socket restrictions. These facts
are diagnostic inputs; the portable driver always remains usable when they are
restricted.

The host-shell driver is deterministic: planned commands run in list order,
once each, from the workspace with `GIT_TERMINAL_PROMPT=0`. Typical use is:

```console
ooo cloud init --workspace . --seed "Build a report"
ooo cloud plan --workspace . 'python -m compileall -q src' 'uv run pytest tests/unit/cloud -q'
ooo cloud next --workspace .
ooo cloud record-evidence tests passed --workspace .
ooo cloud verify --workspace .
ooo cloud bundle-export portable.tar.gz --workspace .
ooo cloud bundle-import portable.tar.gz --workspace ./restored
```

Bundles contain the JSON state, a bootstrap marker, and (when the workspace is
a Git checkout) a binary-safe `execution.patch` relative to the revision
recorded when the run was initialized. A sorted SHA-256 manifest covers every
payload, and tar/gzip metadata is normalized so repeated exports are
byte-for-byte identical. Import validates every member and checksum before
writing; a corrupted checkpoint therefore cannot replace a good one.

When a patch is present, import first checks that local `HEAD` still equals the
cloud base revision and runs `git apply --check`. If local `main` advanced or
the patch no longer applies, import fails with a conflict and does not apply
the patch. The state-only legacy bundle form remains readable, but an
execution patch always requires the manifest.

## Live ChatGPT Work check (2026-11-30)

Aside used the configured account and profile, but the browser opened at
`https://chatgpt.com/auth/login?next=%2F`. Because the fresh-chat login was
unavailable, no ChatGPT Work cloud computer was reached and no `uname -a` or
cloud-runtime result was observed. No existing/private chat, account settings,
billing, or other service was opened or changed.

The local restricted-host simulation did complete the equivalent CLI roundtrip
with `env -i`, isolated HOME/XDG directories, `CODEX_CLOUD=1`, and
`GIT_TERMINAL_PROMPT=0`; it ended with `ISOLATED_CLOUD_ROUNDTRIP_OK`.
1 change: 1 addition & 0 deletions llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Two command surfaces exist. They are NOT a 1:1 mapping.
ouroboros auto Run bounded full-quality ooo auto pipeline.
ouroboros cancel Cancel stuck or orphaned executions.
ouroboros cleanup Prune leftover auto-session worktrees, branches, locks, and state files.
ouroboros cloud Run a workspace-local zero-daemon cloud workflow.
ouroboros codex Manage Ouroboros Codex CLI integration artifacts.
ouroboros config Manage Ouroboros configuration.
ouroboros detect Generate .ouroboros/mechanical.toml via one AI call.
Expand Down
1 change: 1 addition & 0 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Every top-level command `ouroboros --help` lists; `ouroboros <command> --help` s
- `ouroboros auto`: Run bounded full-quality ooo auto pipeline.
- `ouroboros cancel`: Cancel stuck or orphaned executions.
- `ouroboros cleanup`: Prune leftover auto-session worktrees, branches, locks, and state files.
- `ouroboros cloud`: Run a workspace-local zero-daemon cloud workflow.
- `ouroboros codex`: Manage Ouroboros Codex CLI integration artifacts.
- `ouroboros config`: Manage Ouroboros configuration.
- `ouroboros detect`: Generate .ouroboros/mechanical.toml via one AI call.
Expand Down
121 changes: 121 additions & 0 deletions src/ouroboros/cli/commands/cloud.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
"""CLI for the portable zero-daemon cloud runtime."""

from __future__ import annotations

from dataclasses import asdict
import json
from pathlib import Path
from typing import Annotated

import typer

from ouroboros.cloud.bundle import export_bundle, import_bundle
from ouroboros.cloud.driver import CloudDriver
from ouroboros.cloud.environment import detect_environment

app = typer.Typer(name="cloud", help="Run a workspace-local zero-daemon cloud workflow.")
record_app = typer.Typer(help="Record portable workflow evidence.")
bundle_app = typer.Typer(help="Export or import a portable workflow bundle.")


def _driver(workspace: Path | None) -> CloudDriver:
return CloudDriver(detect_environment(workspace).workspace)


@app.command()
def init(
workspace: Annotated[Path | None, typer.Option("--workspace")] = None, seed: str = ""
) -> None:
state = _driver(workspace).init(seed)
typer.echo(json.dumps(state.to_dict(), indent=2, sort_keys=True))


@app.command()
def plan(
steps: Annotated[list[str], typer.Argument()],
workspace: Annotated[Path | None, typer.Option("--workspace")] = None,
) -> None:
state = _driver(workspace).plan(steps)
typer.echo(json.dumps(state.to_dict(), indent=2, sort_keys=True))


@app.command(name="seed")
def seed_plan(
seed: str, workspace: Annotated[Path | None, typer.Option("--workspace")] = None
) -> None:
state = _driver(workspace).init(seed)
typer.echo(json.dumps(state.to_dict(), indent=2, sort_keys=True))


@app.command()
def next(workspace: Annotated[Path | None, typer.Option("--workspace")] = None) -> None:
result = _driver(workspace).next()
typer.echo("no pending step" if result is None else json.dumps(asdict(result), sort_keys=True))


@record_app.command("evidence")
def record_evidence(
name: str,
value: str,
step: Annotated[int | None, typer.Option("--step")] = None,
workspace: Annotated[Path | None, typer.Option("--workspace")] = None,
) -> None:
typer.echo(
json.dumps(
_driver(workspace).record_evidence(name, value, step).to_dict(),
indent=2,
sort_keys=True,
)
)


@app.command()
def verify(workspace: Annotated[Path | None, typer.Option("--workspace")] = None) -> None:
driver = _driver(workspace)
valid = driver.verify()
typer.echo(json.dumps(driver.state.verification_receipts[-1], sort_keys=True))
raise typer.Exit(code=0 if valid else 1)


@app.command()
def status(workspace: Annotated[Path | None, typer.Option("--workspace")] = None) -> None:
"""Print the current portable state and detected host constraints."""
driver = _driver(workspace)
environment = detect_environment(driver.store.workspace)
typer.echo(
json.dumps(
{"environment": environment.to_dict(), "state": driver.state.to_dict()},
indent=2,
sort_keys=True,
)
)


@bundle_app.command("export")
def bundle_export(
destination: Path, workspace: Annotated[Path | None, typer.Option("--workspace")] = None
) -> None:
typer.echo(str(export_bundle(_driver(workspace).store.workspace, destination)))


@bundle_app.command("import")
def bundle_import(
bundle: Path, workspace: Annotated[Path | None, typer.Option("--workspace")] = None
) -> None:
typer.echo(str(import_bundle(bundle, _driver(workspace).store.workspace)))


# Keep single-command spellings stable for scripts while supporting readable
# ``cloud record evidence`` and ``cloud bundle export`` forms.
app.command(name="record-evidence")(record_evidence)
app.command(name="bundle-export")(bundle_export)
app.command(name="bundle-import")(bundle_import)
app.command(name="next-step")(next)
app.add_typer(record_app, name="record")
app.add_typer(bundle_app, name="bundle")


# Long-form spellings read naturally in host-turn instructions. Keep the
# original bundle-* names for compatibility with the first cloud prototype.
app.command(name="export-bundle")(bundle_export)
app.command(name="import-bundle")(bundle_import)
1 change: 1 addition & 0 deletions src/ouroboros/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class _Command(NamedTuple):
_Group("gui", f"{_COMMANDS_PACKAGE}.gui"),
_Group("service", f"{_COMMANDS_PACKAGE}.service"),
_Group("pm", f"{_COMMANDS_PACKAGE}.pm"),
_Group("cloud", f"{_COMMANDS_PACKAGE}.cloud"),
_Command(
"qa",
f"{_COMMANDS_PACKAGE}.qa",
Expand Down
18 changes: 18 additions & 0 deletions src/ouroboros/cloud/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Portable, workspace-local runtime for restricted cloud sandboxes."""

from ouroboros.cloud.bootstrap import bootstrap_bundle
from ouroboros.cloud.bundle import export_bundle, import_bundle
from ouroboros.cloud.driver import CloudDriver
from ouroboros.cloud.environment import CloudEnvironment, detect_environment
from ouroboros.cloud.state import CloudState, CloudStateStore

__all__ = [
"CloudDriver",
"CloudEnvironment",
"CloudState",
"CloudStateStore",
"detect_environment",
"export_bundle",
"import_bundle",
"bootstrap_bundle",
]
15 changes: 15 additions & 0 deletions src/ouroboros/cloud/bootstrap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Bootstrap a portable cloud bundle without auth, sockets, or child daemons."""

from __future__ import annotations

from pathlib import Path

from ouroboros.cloud.bundle import import_bundle


def bootstrap_bundle(bundle: str | Path, workspace: str | Path) -> Path:
"""Restore ``bundle`` into ``workspace`` and return its portable state path."""
return import_bundle(bundle, workspace)


__all__ = ["bootstrap_bundle"]
Loading
Loading