Skip to content

Commit 7e285aa

Browse files
FL4TLiN3claude
andcommitted
fix(core): allow flexible runtime version format in schema
- Change RuntimeVersion from literal "v1.0" to pattern `v${number}.${number}` - Split runtime-version E2E tests to use separate config for future version tests - This allows testing version validation failures without breaking other tests Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 835b9ea commit 7e285aa

File tree

4 files changed

+43
-33
lines changed

4 files changed

+43
-33
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
model = "claude-sonnet-4-5"
2+
3+
[provider]
4+
providerName = "anthropic"
5+
6+
envPath = [".env", ".env.local"]
7+
8+
# Expert requiring future version (validation failure)
9+
[experts."e2e-runtime-future"]
10+
version = "1.0.0"
11+
minRuntimeVersion = "v99.0"
12+
instruction = "Call attemptCompletion with result 'OK'"
13+
14+
[experts."e2e-runtime-future".skills."@perstack/base"]
15+
type = "mcpStdioSkill"
16+
command = "npx"
17+
packageName = "@perstack/base"
18+
pick = ["attemptCompletion"]
19+
20+
# Chain with nested future version: root(v1.0) -> nested(v99.0)
21+
[experts."e2e-runtime-chain-future"]
22+
version = "1.0.0"
23+
minRuntimeVersion = "v1.0"
24+
instruction = """
25+
1. Delegate to "e2e-runtime-future" with "test"
26+
2. When done, call attemptCompletion with result "OK"
27+
"""
28+
delegates = ["e2e-runtime-future"]
29+
30+
[experts."e2e-runtime-chain-future".skills."@perstack/base"]
31+
type = "mcpStdioSkill"
32+
command = "npx"
33+
packageName = "@perstack/base"
34+
pick = ["attemptCompletion"]

e2e/experts/runtime-version.toml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,6 @@ command = "npx"
2828
packageName = "@perstack/base"
2929
pick = ["attemptCompletion"]
3030

31-
# Expert requiring future version (validation failure)
32-
[experts."e2e-runtime-future"]
33-
version = "1.0.0"
34-
minRuntimeVersion = "v99.0"
35-
instruction = "Call attemptCompletion with result 'OK'"
36-
37-
[experts."e2e-runtime-future".skills."@perstack/base"]
38-
type = "mcpStdioSkill"
39-
command = "npx"
40-
packageName = "@perstack/base"
41-
pick = ["attemptCompletion"]
42-
4331
# 3-level chain: root(v1.0) -> level1(v1.0) -> level2(v1.0)
4432
[experts."e2e-runtime-chain-ok"]
4533
version = "1.0.0"
@@ -81,19 +69,3 @@ type = "mcpStdioSkill"
8169
command = "npx"
8270
packageName = "@perstack/base"
8371
pick = ["attemptCompletion"]
84-
85-
# Chain with nested future version: root(v1.0) -> nested(v99.0)
86-
[experts."e2e-runtime-chain-future"]
87-
version = "1.0.0"
88-
minRuntimeVersion = "v1.0"
89-
instruction = """
90-
1. Delegate to "e2e-runtime-future" with "test"
91-
2. When done, call attemptCompletion with result "OK"
92-
"""
93-
delegates = ["e2e-runtime-future"]
94-
95-
[experts."e2e-runtime-chain-future".skills."@perstack/base"]
96-
type = "mcpStdioSkill"
97-
command = "npx"
98-
packageName = "@perstack/base"
99-
pick = ["attemptCompletion"]

e2e/perstack-runtime/runtime-version.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88
* - 3-level delegation chain with all v1.0
99
* - Nested delegate with future version requirement
1010
*
11-
* TOML: e2e/experts/runtime-version.toml
11+
* TOML: e2e/experts/runtime-version.toml, e2e/experts/runtime-version-future.toml
1212
*/
1313
import { describe, expect, it } from "vitest"
1414
import { assertEventSequenceContains } from "../lib/assertions.js"
1515
import { filterEventsByType } from "../lib/event-parser.js"
1616
import { runRuntimeCli, withEventParsing } from "../lib/runner.js"
1717

1818
const RUNTIME_VERSION_CONFIG = "./e2e/experts/runtime-version.toml"
19+
const RUNTIME_VERSION_FUTURE_CONFIG = "./e2e/experts/runtime-version-future.toml"
1920
const LLM_TIMEOUT = 120000
2021
const LLM_EXTENDED_TIMEOUT = 300000
2122

@@ -56,7 +57,7 @@ describe.concurrent("Runtime Version Validation", () => {
5657
"should fail when expert requires future version",
5758
async () => {
5859
const cmdResult = await runRuntimeCli(
59-
["run", "--config", RUNTIME_VERSION_CONFIG, "e2e-runtime-future", "test"],
60+
["run", "--config", RUNTIME_VERSION_FUTURE_CONFIG, "e2e-runtime-future", "test"],
6061
{ timeout: LLM_TIMEOUT },
6162
)
6263
expect(cmdResult.exitCode).toBe(1)
@@ -84,7 +85,7 @@ describe.concurrent("Runtime Version Validation", () => {
8485
"should fail when nested delegate requires future version",
8586
async () => {
8687
const cmdResult = await runRuntimeCli(
87-
["run", "--config", RUNTIME_VERSION_CONFIG, "e2e-runtime-chain-future", "test"],
88+
["run", "--config", RUNTIME_VERSION_FUTURE_CONFIG, "e2e-runtime-chain-future", "test"],
8889
{ timeout: LLM_TIMEOUT },
8990
)
9091
expect(cmdResult.exitCode).toBe(1)
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { z } from "zod"
22

3-
export type RuntimeVersion = "v1.0"
3+
export type RuntimeVersion = `v${number}.${number}`
44

5-
export const runtimeVersionSchema = z.enum(["v1.0"])
5+
export const runtimeVersionSchema = z
6+
.string()
7+
.regex(/^v\d+\.\d+$/, 'Runtime version must be in format "vX.Y" (e.g., "v1.0")')
8+
.transform((v) => v as RuntimeVersion)

0 commit comments

Comments
 (0)