Files
reverse-engineering-anything/docs/specs/agent-environments/environment-export/plan.md
T
Edgar ArakelyanandClaude Fable 5.1 c6c2a64af3 feat(environment): export an environment manifest as an agent environment bundle
Add rea environment-export <manifest.json> --evidence <capture.json> <dir>
[--package-tarball <path>] [--name <override>]: it reads and authenticates the
manifest and capture pair once and writes an agent environment bundle folder
(README with provenance and a rights note, envs/<name> with a Dockerfile that
pins this exact rea version or installs a given tarball, the manifest and the
Evidence as byte-identical copies, a Python verifier that checks replay
through the MCP endpoint, and a smoke task) that the agentenv framework runs
with agent-env run. Refuses a non-empty directory and a mismatched pair
before writing. Adds the real-agentenv hosted lane, which packs the checkout,
exports a bundle from the source-owned capture fixture and runs it on the
runner's Docker with a pinned agentenv-framework, wired into the CI planner
and its guard tests.

Refs morluto/rea#4933

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-18 19:43:09 -07:00

1.4 KiB

Implementation plan

  1. Extend src/application/environment/environmentSource.ts so loadEnvironmentSource takes the reporting operation and retains the capture artifact's SHA-256, letting the export reuse the serve command's authentication and cross-check unchanged.
  2. Add environmentBundle.ts to plan the bundle from the source alone: the name rule, the Dockerfile for the registry and tarball package sources, the verifier, the smoke task, the README and the copy targets.
  3. Add environmentExport.ts to read each input once through the regular-file reader, refuse an occupied directory, a missing tarball or an unreadable input before writing, then write the planned files with exclusive creation and copy the authenticated bytes and the tarball byte-exact.
  4. Register environment-export in src/cli/environmentCommands.ts beside environment-serve, sharing the argument descriptions, and in CLI_COMMANDS.
  5. Add the agentenv scope, real-agentenv.yml, the package script and scripts/verify-agentenv-environment.mjs, wire ci.yml and extend the ciRequiredLanes and ciChangeScope tables.
  6. Add services, conformance and cli-boundary tests; document the command in docs/cli.md, the bundle and lane in docs/agent-environments.md and docs/testing.md; record the spec.

No new dependency is introduced; the CLI inventory gains one command.