Commit 9a35270
* AMPR-167 #494: Ampere client-runtime readiness
I (Claude) implemented this in collaboration with Miley. It closes out
AMPR-167 in a single commit covering Waves 0-3 plus the follow-up that
wires UpstreamLlmClient through the agent construction chain.
What's new (public injection surface):
- MemoryStore (commonMain) — composition over KnowledgeRepository +
OutcomeMemoryRepository, the seam Socket implements for on-device
durable memory.
- UpstreamLlmClient (commonMain) — call-origination seam in AgentLLMService;
default BundledUpstreamLlmClient is byte-equivalent to pre-seam behavior.
- AgentConfiguration.upstreamLlmClient + AmpereInstance.upstreamLlmClient
— the load-bearing path that lets a runtime default from fromEnvironment
reach AgentLLMService.call via SparkBasedAgent -> AgentReasoning.
- Ampere.fromEnvironment(memoryStore, upstreamLlmClient) — additive params;
existing JVM callers compile unchanged.
What moved:
- 7 Default*Service files from jvmMain to commonMain (zero JVM-isms in
their bodies — they were misplaced).
- Ampere.fromEnvironment body to commonMain; Ampere.jvm.kt trimmed to just
the actual fun createInstance for the heavy Ampere.create path.
Tests + CI:
- MemoryStore + UpstreamLlmClient contract tests; plumbing test verifying
the config field flows through AgentLLMService.call (commonTest).
- fromEnvironment construction + event-bus smoke on JVM (full), iOS sim
(full), Android Robolectric (construction-only — Robolectric's bundled
SQLite native runtime lacks FTS5).
- CI matrix: Linux + macOS run JVM + Android tests; macOS also runs
iosSimulatorArm64Test. Previously :test silently skipped jvmTest in KMP
modules.
- Deleted 9 dormant ToolRead/Run/WriteCodeFile test stubs (no @test
annotations on any platform; never ran anything).
Audit doc: docs/ampr-167-fromenvironment-audit.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* AMPR-167 #494: Fix CI — use jvmTest for ampere-cli/ampere-compose
I (Claude) goofed the CI task names in the previous commit. Both
ampere-cli and ampere-compose are KMP modules whose runnable JVM-test
task is :jvmTest, not :test (which doesn't exist in KMP modules). Also
adding :ampere-compose:testDebugUnitTest for parity with ampere-core's
Android coverage.
Verified locally:
- :ampere-cli:jvmTest passes
- :ampere-compose:jvmTest passes
- :ampere-compose:testDebugUnitTest passes
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* AMPR-167 #494: Fix McpIntegrationTest runTest+real-dispatcher race
I (Claude) fixed three flaky assertions in McpIntegrationTest that were
masked when CI ran `./gradlew test` (which silently skips `:jvmTest` in
KMP modules) and surfaced once my CI changes started running `jvmTest`
on every PR.
The race: each `runTest` test called `manager.discoverAndRegisterTools()`
then `kotlinx.coroutines.delay(200)` and asserted on events captured
from the event bus. But the event bus runs on `Dispatchers.Default`,
and `delay(...)` inside `runTest` advances virtual time only — the real
dispatcher gets zero wall-clock time, so on loaded CI runners the
asserted events hadn't been delivered yet.
Fix: introduced an `awaitUntil(predicate)` helper that switches to
`Dispatchers.Default` (escaping the virtual scheduler) and polls the
predicate up to 5s with 25ms intervals. Replaced all three fixed-delay
sites with predicate polls — `2 ToolRegistered events emitted`,
`ToolDiscoveryComplete event emitted`, and `tools removed from
registry after disconnect`.
Verified 5/5 clean local runs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* AMPR-167 #494: Bump ProgressIndicatorTest render wait from 60ms to 500ms
I (Claude) fixed another pre-existing flake that my CI changes exposed
once :ampere-cli:jvmTest started running on every PR. The test that
failed on the ubuntu-latest job — \`state indicator can change state\` —
sets the indicator's state to SUCCESS and waits 60ms before asserting
the output contains "[OK]". The indicator renders on a background thread
at BaseProgressIndicator.FRAME_INTERVAL_MS (50ms), so 60ms gave only ~1
frame of headroom and lost the race against JVM warmup / GC / scheduling
on the CI runner.
There are 18 identical Thread.sleep(60) call sites in this file, all
paired with output assertions. Rather than refactor each one to a
condition poll (varying assertion shapes), I extracted a single
RENDER_WAIT_MS constant set to 500ms — 10x the frame interval —
and replaced every site. Adds ~8s to the test run; well worth not
flaking.
Verified :ampere-cli:jvmTest passes locally.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e53774e commit 9a35270
36 files changed
Lines changed: 1568 additions & 253 deletions
File tree
- .github/workflows
- ampere-cli/src/jvmTest/kotlin/link/socket/ampere/repl
- ampere-core
- src
- androidUnitTest/kotlin/link/socket/ampere
- agents/execution/tools
- api
- commonMain/kotlin/link/socket/ampere
- agents
- config
- definition
- domain/reasoning
- api
- internal
- llm
- memory
- commonTest/kotlin/link/socket/ampere
- agents/execution/tools
- llm
- memory
- iosTest/kotlin/link/socket/ampere/api
- jvmMain/kotlin/link/socket/ampere/api
- jvmTest/kotlin/link/socket/ampere
- agents
- execution/tools
- tools/mcp
- api
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
48 | | - | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
Lines changed: 25 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
19 | 26 | | |
20 | 27 | | |
21 | 28 | | |
| |||
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
85 | | - | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
106 | 113 | | |
107 | 114 | | |
108 | 115 | | |
109 | | - | |
| 116 | + | |
110 | 117 | | |
111 | 118 | | |
112 | 119 | | |
| |||
184 | 191 | | |
185 | 192 | | |
186 | 193 | | |
187 | | - | |
| 194 | + | |
188 | 195 | | |
189 | 196 | | |
190 | 197 | | |
| |||
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
205 | | - | |
| 212 | + | |
206 | 213 | | |
207 | 214 | | |
208 | 215 | | |
| |||
219 | 226 | | |
220 | 227 | | |
221 | 228 | | |
222 | | - | |
| 229 | + | |
223 | 230 | | |
224 | 231 | | |
225 | 232 | | |
| |||
238 | 245 | | |
239 | 246 | | |
240 | 247 | | |
241 | | - | |
| 248 | + | |
242 | 249 | | |
243 | 250 | | |
244 | 251 | | |
| |||
256 | 263 | | |
257 | 264 | | |
258 | 265 | | |
259 | | - | |
| 266 | + | |
260 | 267 | | |
261 | 268 | | |
262 | 269 | | |
| |||
303 | 310 | | |
304 | 311 | | |
305 | 312 | | |
306 | | - | |
| 313 | + | |
307 | 314 | | |
308 | | - | |
| 315 | + | |
309 | 316 | | |
310 | 317 | | |
311 | 318 | | |
| |||
320 | 327 | | |
321 | 328 | | |
322 | 329 | | |
323 | | - | |
| 330 | + | |
324 | 331 | | |
325 | 332 | | |
326 | 333 | | |
| |||
336 | 343 | | |
337 | 344 | | |
338 | 345 | | |
339 | | - | |
| 346 | + | |
340 | 347 | | |
341 | 348 | | |
342 | 349 | | |
| |||
348 | 355 | | |
349 | 356 | | |
350 | 357 | | |
351 | | - | |
| 358 | + | |
352 | 359 | | |
353 | 360 | | |
354 | 361 | | |
| |||
405 | 412 | | |
406 | 413 | | |
407 | 414 | | |
408 | | - | |
| 415 | + | |
409 | 416 | | |
410 | 417 | | |
411 | 418 | | |
| |||
423 | 430 | | |
424 | 431 | | |
425 | 432 | | |
426 | | - | |
| 433 | + | |
427 | 434 | | |
428 | 435 | | |
429 | 436 | | |
| |||
445 | 452 | | |
446 | 453 | | |
447 | 454 | | |
448 | | - | |
| 455 | + | |
449 | 456 | | |
450 | 457 | | |
451 | 458 | | |
| |||
468 | 475 | | |
469 | 476 | | |
470 | 477 | | |
471 | | - | |
| 478 | + | |
472 | 479 | | |
473 | 480 | | |
474 | 481 | | |
| |||
479 | 486 | | |
480 | 487 | | |
481 | 488 | | |
482 | | - | |
| 489 | + | |
483 | 490 | | |
484 | 491 | | |
485 | 492 | | |
| |||
497 | 504 | | |
498 | 505 | | |
499 | 506 | | |
500 | | - | |
| 507 | + | |
501 | 508 | | |
502 | 509 | | |
503 | 510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
198 | 207 | | |
199 | 208 | | |
200 | 209 | | |
| |||
250 | 259 | | |
251 | 260 | | |
252 | 261 | | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
253 | 267 | | |
254 | 268 | | |
255 | 269 | | |
| |||
Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 82 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
19 | 31 | | |
0 commit comments