Skip to content

feat(core): add workspace environment foundation - #40967

Open
kitlangton wants to merge 3 commits into
v2from
environment-foundation
Open

feat(core): add workspace environment foundation#40967
kitlangton wants to merge 3 commits into
v2from
environment-foundation

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Adds the workspace environment foundation as a pure addition. Nothing consumes this module yet.

The core thesis is that spawn is the driver contract: Files is derived from an Effect ChildProcessSpawner, while drivers may provide native fast-path overrides that promise identical observable semantics.

How

  • Adds the Driver, Files, FileInfo, DirEntry, and exact NotFound / WrongKind / Failed error vocabulary under packages/core/src/environment/.
  • Derives GNU/Linux file operations from a supplied spawner, with one bounded process round trip per intent, fused metadata reads and parent-creating writes, byte-precise ranges, and NUL-safe directory listing.
  • Adds a complete Map-backed memory driver whose spawner fails and whose file overrides implement POSIX path and symlink semantics.
  • Adds one shared conformance suite under packages/core/test/lib/. The suite is the executable parity mechanism for this driver and future local and Modal drivers.
  • Runs the same suite against memory everywhere and against execDefaults plus CrossSpawnSpawner on Linux.

GNU-only defaults are intentional: these commands run inside sandbox images we control. The exec-default conformance leg is skipped on non-Linux development hosts and runs on Linux CI.

Scope

  • Pure addition, consumed by nothing in this PR.
  • No V1 changes.
  • No watch support.
  • No local or Modal native driver yet.
  • The conformance helper stays in core test infrastructure until another package needs a promoted runtime export.

Testing

  • cd packages/core && bun typecheck
  • cd packages/core && bun run test test/environment*.test.ts (8 memory tests passed; 8 GNU tests skipped on macOS)
  • cd packages/core && bun run test (1,555 passed, 15 skipped; unrelated existing failures in models.test.ts, invalid-regex handling in tool-search.test.ts, and config/plugin.test.ts)
  • Push hook: workspace typecheck passed across all 32 participating packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant