Skip to content

Commit 6baeddf

Browse files
committed
docs(openspec): add harden-opencode-runtime-integration spec.md
1 parent 3e9455d commit 6baeddf

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

  • openspec/changes/harden-opencode-runtime-integration/specs/server-lifecycle
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Delta for Server Lifecycle
2+
3+
## ADDED Requirements
4+
5+
### Requirement: Long-running OpenCode processes use managed lifecycle semantics
6+
7+
The SDK MUST provide a managed process abstraction for long-running OpenCode launch modes instead of applying the ordinary short-command timeout.
8+
9+
#### Scenario: Web process remains alive
10+
11+
- GIVEN a caller starts OpenCode Web through the managed API
12+
- WHEN startup succeeds
13+
- THEN the process MUST remain alive beyond the short-command timeout
14+
- UNTIL the caller stops it, the process exits, or an explicit lifetime policy terminates it
15+
16+
### Requirement: Readiness is distinct from process spawn
17+
18+
The SDK MUST expose readiness independently from successful process creation.
19+
20+
#### Scenario: Process starts but health endpoint is unavailable
21+
22+
- GIVEN the child process was spawned
23+
- AND the expected OpenCode HTTP endpoint does not become healthy before startup timeout
24+
- WHEN the caller awaits readiness
25+
- THEN readiness MUST fail
26+
- AND the process MUST be cleaned up according to the startup-failure policy
27+
28+
### Requirement: Managed processes expose deterministic shutdown
29+
30+
The SDK MUST provide graceful stop and force-kill operations with observable exit completion.
31+
32+
#### Scenario: Graceful stop times out
33+
34+
- GIVEN a managed process does not exit after a graceful stop request
35+
- WHEN the graceful shutdown timeout elapses
36+
- THEN the caller MUST be able to force terminate the process
37+
- AND the final exit state MUST be observable

0 commit comments

Comments
 (0)