You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agent/contracts/compatibility-governance.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,10 +67,10 @@ Unexpected issues, workarounds, and integration friction encountered during secu
67
67
-**THEN** its log entry MUST be updated to indicate resolution and summarize the fix
68
68
69
69
### Requirement: Run Bridge Type Conformance Tests After Bridge Changes
70
-
Any change to files under `packages/secure-exec-nodejs/src/bridge` MUST run bridge type conformance checks via `pnpm run check-types:test` in `packages/secure-exec` before completion.
70
+
Any change to files under `packages/nodejs/src/bridge` MUST run bridge type conformance checks via `pnpm run check-types:test` in `packages/secure-exec` before completion.
71
71
72
72
#### Scenario: Bridge source file is modified
73
-
-**WHEN** a commit modifies one or more files in `packages/secure-exec-nodejs/src/bridge`
73
+
-**WHEN** a commit modifies one or more files in `packages/nodejs/src/bridge`
74
74
-**THEN**`pnpm run check-types:test` MUST be executed and failures MUST be addressed before the change is considered complete
@@ -221,15 +221,15 @@ Changes to runtime or bridge filesystem metadata/rename behavior SHALL update co
221
221
-**THEN** the compatibility project-matrix MUST include fixture coverage that exercises the changed behavior under host Node and secure-exec comparison
222
222
223
223
### Requirement: Governance References Use Canonical Secure-Exec Package Family Naming
224
-
Governance artifacts that reference runtime package imports SHALL use the `@secure-exec/*` scoped package names (`@secure-exec/core`, `@secure-exec/nodejs`, `@secure-exec/browser`, `@secure-exec/python`) or the `secure-exec` barrel. Source paths SHALL use the corresponding workspace directories (`packages/secure-exec-core`, `packages/secure-exec-nodejs`, `packages/secure-exec-browser`, `packages/secure-exec-python`, `packages/secure-exec`).
224
+
Governance artifacts that reference runtime package imports SHALL use the `@secure-exec/*` scoped package names (`@secure-exec/core`, `@secure-exec/nodejs`, `@secure-exec/browser`, `@secure-exec/python`) or the `secure-exec` barrel. Source paths SHALL use the corresponding workspace directories (`packages/core`, `packages/nodejs`, `packages/browser`, `packages/python`, `packages/secure-exec`).
-**WHEN** a governance document or spec requirement describes runtime source directories
232
-
-**THEN** it MUST use the appropriate `packages/secure-exec-*` workspace path for the component being referenced
232
+
-**THEN** it MUST use the appropriate `packages/*` workspace path for the component being referenced
233
233
234
234
### Requirement: Module-Access Boundary Changes MUST Update Security and Friction Documentation
235
235
Any change that introduces or modifies driver-managed host module projection or overlay boundaries MUST update compatibility/friction and security-model documentation in the same change.
@@ -261,7 +261,7 @@ Any change that introduces or modifies runtime log-capture defaults or hook-base
261
261
Any change that modifies runtime-driver behavior or runtime orchestration contracts MUST run shared integration suites against both node and browser runtime-driver targets.
-**WHEN** a change modifies runtime contracts or driver behavior under `packages/secure-exec-core/src/`, `packages/secure-exec-nodejs/src/`, or `packages/secure-exec-browser/src/`
264
+
-**WHEN** a change modifies runtime contracts or driver behavior under `packages/core/src/`, `packages/nodejs/src/`, or `packages/browser/src/`
265
265
-**THEN** the change MUST execute shared integration suites for both node and browser targets before completion
266
266
267
267
#### Scenario: Shared suites are reused between targets
The isolate-runtime source tree SHALL organize host-injected entry scripts under `packages/secure-exec-core/isolate-runtime/src/inject/` and shared reusable modules under `packages/secure-exec-core/isolate-runtime/src/common/`.
7
+
The isolate-runtime source tree SHALL organize host-injected entry scripts under `packages/core/isolate-runtime/src/inject/` and shared reusable modules under `packages/core/isolate-runtime/src/common/`.
8
8
9
9
#### Scenario: Existing inject sources are migrated to canonical layout
10
10
-**WHEN** isolate-runtime injection sources are maintained or refactored
11
-
-**THEN** entry scripts evaluated by host runtime MUST live under `packages/secure-exec-core/isolate-runtime/src/inject/` and shared helpers/types MUST live under `packages/secure-exec-core/isolate-runtime/src/common/`
11
+
-**THEN** entry scripts evaluated by host runtime MUST live under `packages/core/isolate-runtime/src/inject/` and shared helpers/types MUST live under `packages/core/isolate-runtime/src/common/`
12
12
13
13
#### Scenario: New isolate injection source is added
14
14
-**WHEN** contributors introduce a new host-to-isolate injected script
15
-
-**THEN** the source file MUST be added under `packages/secure-exec-core/isolate-runtime/src/inject/` and MUST NOT be placed in legacy flat isolate-runtime paths
15
+
-**THEN** the source file MUST be added under `packages/core/isolate-runtime/src/inject/` and MUST NOT be placed in legacy flat isolate-runtime paths
16
16
17
17
### Requirement: Inject Entrypoints SHALL Compile as Standalone Runtime Artifacts
18
18
Inject entrypoint files SHALL be compiled into standalone executable source payloads suitable for host runtime injection, including any shared code imported from `src/common`.
-**THEN** bridge handling MUST return entry type information without a repeated `readDir` probe for each entry
118
118
119
119
### Requirement: Bridge Boundary Contracts SHALL Be Defined In A Canonical Shared Type Module
120
-
Bridge global keys and host/isolate boundary type contracts SHALL be defined in canonical shared type modules — bridge-contract types in `packages/secure-exec-nodejs/src/bridge-contract.ts` and global-exposure helpers in `packages/secure-exec-core/src/shared/global-exposure.ts` — and reused across host runtime setup and bridge modules.
120
+
Bridge global keys and host/isolate boundary type contracts SHALL be defined in canonical shared type modules — bridge-contract types in `packages/nodejs/src/bridge-contract.ts` and global-exposure helpers in `packages/core/src/shared/global-exposure.ts` — and reused across host runtime setup and bridge modules.
-**THEN** shared types and runtime classes MUST live under `packages/secure-exec-core`, Node driver code under `packages/secure-exec-nodejs`, browser driver code under `packages/secure-exec-browser`, Python driver code under `packages/secure-exec-python`, and the barrel re-export layer under `packages/secure-exec`
332
+
-**THEN** shared types and runtime classes MUST live under `packages/core`, Node driver code under `packages/nodejs`, browser driver code under `packages/browser`, Python driver code under `packages/python`, and the barrel re-export layer under `packages/secure-exec`
329
333
330
334
#### Scenario: Barrel package contains no source logic
-**THEN** runtime MUST fail deterministically and MUST NOT execute native addon code
340
344
341
345
### Requirement: Isolate-Executed Bootstrap Sources MUST Be Static TypeScript Modules
342
-
Any source code evaluated inside the isolate for runtime/bootstrap setup MUST originate from static files under `packages/secure-exec-core/isolate-runtime/src/` and MUST be tracked as normal TypeScript source with inject entrypoints rooted in `packages/secure-exec-core/isolate-runtime/src/inject/`.
346
+
Any source code evaluated inside the isolate for runtime/bootstrap setup MUST originate from static files under `packages/core/isolate-runtime/src/` and MUST be tracked as normal TypeScript source with inject entrypoints rooted in `packages/core/isolate-runtime/src/inject/`.
343
347
344
348
#### Scenario: Runtime injects require and bridge bootstrap code
345
349
-**WHEN** secure-exec prepares isolate bootstrap code for `require` setup, bridge setup, or related runtime helpers
346
350
-**THEN** the injected source MUST come from static isolate-runtime module files rather than ad-hoc inline source assembly in host runtime files
347
351
348
352
#### Scenario: New isolate injection path is introduced
349
353
-**WHEN** a change adds a new host-to-isolate code injection path
350
-
-**THEN** the injected code MUST be added as a static `.ts` file under `packages/secure-exec-core/isolate-runtime/src/inject/` in the same change
354
+
-**THEN** the injected code MUST be added as a static `.ts` file under `packages/core/isolate-runtime/src/inject/` in the same change
351
355
352
356
#### Scenario: Existing template-generated bootstrap helper is migrated
353
357
-**WHEN** secure-exec migrates helpers such as `getRequireSetupCode`, `getBridgeWithConfig`, or `createInitialBridgeGlobalsCode`
@@ -357,7 +361,7 @@ Any source code evaluated inside the isolate for runtime/bootstrap setup MUST or
357
361
The `@secure-exec/core` package build MUST execute isolate-runtime compilation before producing final runtime artifacts, and build orchestration MUST treat isolate-runtime compilation and isolate-runtime typecheck as explicit validation dependencies.
358
362
359
363
#### Scenario: Package build runs with clean outputs
360
-
-**WHEN**`packages/secure-exec-core` is built from a clean workspace
364
+
-**WHEN**`packages/core` is built from a clean workspace
361
365
-**THEN** the build MUST run a dedicated isolate-runtime compile step before final package build output is produced
#### Scenario: Shared matrix entrypoint exists at canonical path
@@ -48,15 +48,15 @@ Shared suite registration order in the matrix entrypoint MUST be explicit and st
48
48
-**THEN** they MUST be imported and invoked in deterministic source order rather than filesystem discovery
49
49
50
50
### Requirement: Kernel Unit Tests SHALL Use MockRuntimeDriver In Kernel Package
51
-
Kernel unit tests that validate kernel subsystem behavior (VFS, FD table, process table, device layer, pipe manager, command registry, permissions) SHALL reside under `packages/secure-exec-core/test/kernel/` and use MockRuntimeDriver for driver interactions.
51
+
Kernel unit tests that validate kernel subsystem behavior (VFS, FD table, process table, device layer, pipe manager, command registry, permissions) SHALL reside under `packages/core/test/kernel/` and use MockRuntimeDriver for driver interactions.
52
52
53
53
#### Scenario: Kernel unit tests live in kernel package
54
54
-**WHEN** contributors add or update tests for kernel subsystem behavior
55
-
-**THEN** those tests MUST reside under `packages/secure-exec-core/test/kernel/` as `*.test.ts` files
55
+
-**THEN** those tests MUST reside under `packages/core/test/kernel/` as `*.test.ts` files
56
56
57
57
#### Scenario: Kernel unit tests use MockRuntimeDriver
58
58
-**WHEN** kernel unit tests need to validate spawn/exec orchestration or command registration
59
-
-**THEN** they MUST use a MockRuntimeDriver (from `packages/secure-exec-core/test/kernel/helpers.ts`) that implements the RuntimeDriver interface with controllable behavior, rather than requiring real runtime drivers
59
+
-**THEN** they MUST use a MockRuntimeDriver (from `packages/core/test/kernel/helpers.ts`) that implements the RuntimeDriver interface with controllable behavior, rather than requiring real runtime drivers
60
60
61
61
#### Scenario: Kernel unit tests validate subsystem invariants independently
62
62
-**WHEN** kernel unit tests validate FD table, process table, pipe manager, or device layer behavior
Copy file name to clipboardExpand all lines: CLAUDE.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,17 +57,17 @@
57
57
- the WasmVM runtime requires standalone WASM binaries in `native/wasmvm/target/wasm32-wasip1/release/commands/`
58
58
- build them locally: `cd native/wasmvm && make wasm` (requires Rust nightly + wasm32-wasip1 target + rust-src component + wasm-opt/binaryen)
59
59
- the Rust toolchain is pinned in `native/wasmvm/rust-toolchain.toml` — rustup will auto-install it
60
-
- CI builds the binaries before tests; a CI-only guard test in `packages/secure-exec-wasmvm/test/driver.test.ts` fails if they're missing
60
+
- CI builds the binaries before tests; a CI-only guard test in `packages/wasmvm/test/driver.test.ts` fails if they're missing
61
61
- tests gated behind `skipIf(!hasWasmBinaries)` or `skipUnlessWasmBuilt()` will skip locally if binaries aren't built
62
62
- see `native/wasmvm/CLAUDE.md` for full build details and architecture
63
63
64
64
## WasmVM Syscall Coverage
65
65
66
66
- every function in the `host_process` and `host_user` import modules (declared in `native/wasmvm/crates/wasi-ext/src/lib.rs`) must have at least one C parity test exercising it through libc
67
-
- when adding a new host import, add a matching test case to `native/wasmvm/c/programs/syscall_coverage.c` and its parity test in `packages/secure-exec-wasmvm/test/c-parity.test.ts`
67
+
- when adding a new host import, add a matching test case to `native/wasmvm/c/programs/syscall_coverage.c` and its parity test in `packages/wasmvm/test/c-parity.test.ts`
68
68
- the canonical source of truth for import signatures is `native/wasmvm/crates/wasi-ext/src/lib.rs` — C patches and JS host implementations must match exactly
69
69
- C patches in `native/wasmvm/patches/wasi-libc/` must be kept in sync with wasi-ext — ABI drift between C, Rust, and JS is a P0 bug
70
-
- permission tier enforcement must cover ALL write/spawn/kill/pipe/dup operations — audit `packages/secure-exec-wasmvm/src/kernel-worker.ts` when adding new syscalls
70
+
- permission tier enforcement must cover ALL write/spawn/kill/pipe/dup operations — audit `packages/wasmvm/src/kernel-worker.ts` when adding new syscalls
71
71
-`PATCHED_PROGRAMS` in `native/wasmvm/c/Makefile` must include all programs that use `host_process` or `host_user` imports (programs linking the patched sysroot)
0 commit comments