Skip to content

Commit f9f0bc7

Browse files
committed
docs(openspec): add harden-opencode-runtime-integration spec.md
1 parent 1493a8b commit f9f0bc7

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

  • openspec/changes/harden-opencode-runtime-integration/specs/cli-contract
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Delta for CLI Contract
2+
3+
## MODIFIED Requirements
4+
5+
### Requirement: Typed CLI options match upstream option arity
6+
7+
The SDK MUST model each typed OpenCode CLI option using the same value arity and semantic type as the supported upstream OpenCode version.
8+
9+
#### Scenario: Share session
10+
11+
- GIVEN a caller enables session sharing
12+
- WHEN `OpenCodeRunOptions` is converted to CLI arguments
13+
- THEN the arguments MUST contain `--share`
14+
- AND MUST NOT append an arbitrary value after `--share`
15+
16+
#### Scenario: Auto approval remains opt-in
17+
18+
- GIVEN a caller does not explicitly enable automatic approval
19+
- WHEN run arguments are generated
20+
- THEN `--auto` MUST NOT be emitted
21+
22+
#### Scenario: Auto approval enabled
23+
24+
- GIVEN a caller explicitly enables automatic approval
25+
- WHEN run arguments are generated
26+
- THEN `--auto` MUST be emitted exactly once
27+
28+
### Requirement: Typed wrappers remain extensible
29+
30+
The SDK MUST retain a raw argument escape hatch for upstream commands or flags that have not yet received a typed wrapper.
31+
32+
#### Scenario: Unknown future option
33+
34+
- GIVEN a future OpenCode flag is not modeled by the current SDK
35+
- WHEN the caller uses the raw CLI entry point
36+
- THEN the SDK MUST pass the provided argument vector without shell interpolation

0 commit comments

Comments
 (0)