| 243 | }); |
| 244 | |
| 245 | class RestrictedTestRuntime extends TestRuntime { |
| 246 | constructor( |
| 247 | projectPath: string, |
| 248 | muxHomePath: string, |
| 249 | private readonly readableRoot: string |
| 250 | ) { |
| 251 | super(projectPath, muxHomePath); |
| 252 | } |
| 253 | |
| 254 | override readFile(filePath: string, abortSignal?: AbortSignal): ReadableStream<Uint8Array> { |
| 255 | const root = path.resolve(this.readableRoot); |
| 256 | const target = path.resolve(filePath); |
| 257 | if (target !== root && !target.startsWith(`${root}${path.sep}`)) { |
| 258 | throw new Error(`RestrictedTestRuntime cannot read outside ${root}: ${target}`); |
| 259 | } |
| 260 | return super.readFile(filePath, abortSignal); |
| 261 | } |
| 262 | } |
| 263 | |
| 264 | describe("buildStreamSystemContext", () => { |
| 265 | test("includes proactive memory guidance only when the memory tool is available", async () => { |
nothing calls this directly
no outgoing calls
no test coverage detected