Repository navigation
test(studio): integration suite over the real SDK against mecated --mock - #1767
Merged
Merged
Conversation
samuv
force-pushed
the
studio/integration-tests
branch
from
September 22, 2026 09:04
b2907d1 to
3a382d8
Compare
4 of 15 tasks
samuv
force-pushed
the
studio/integration-tests
branch
from
September 22, 2026 09:14
3a382d8 to
b124580
Compare
samuv
force-pushed
the
studio/integration-tests
branch
from
September 22, 2026 09:23
b124580 to
54d3285
Compare
samuv
force-pushed
the
studio/integration-tests
branch
from
September 22, 2026 09:59
54d3285 to
c56d7c6
Compare
This was referenced Sep 22, 2026
samuv
force-pushed
the
studio/integration-tests
branch
from
September 23, 2026 08:56
c56d7c6 to
5a0cf04
Compare
samuv
force-pushed
the
studio/integration-tests
branch
from
September 23, 2026 09:41
5a0cf04 to
6d22db8
Compare
samuv
force-pushed
the
studio/integration-tests
branch
from
September 23, 2026 10:47
6d22db8 to
0ce1339
Compare
samuv
force-pushed
the
studio/integration-tests
branch
from
September 23, 2026 11:54
0ce1339 to
bd31006
Compare
Codifies the manual smokes that accompanied each Studio layer: a Vitest suite that boots the BFF in mock mode, lets the SDK spawn bin/mecated --mock, and drives every product surface through the Hono app exactly as the browser would — runtime negotiation, session create / list / run-as-SSE / transcript / rename / delete, stale run controls, honest scheduling capability, knowledge inventories and consolidation plan generation, the settings allowlist and storage health, and the CSRF and CORS posture. No fakes below the BFF. It also proves the bounded, resumable activity replay end to end against real durable history: a tiny replay bound truncates after exactly its quota and names the last cursor, resuming from that cursor returns only events not already delivered, walking the cursors to the run's terminal result never duplicates one and never exceeds the bound in a request, and an unusable cursor is refused rather than replaying everything. The suite is a separate Vitest entry point, excluded from the offline pnpm test. task studio:test:integration builds the daemon first and requires it, so a missing binary fails there; a direct run skips loudly instead. The spawned daemon gets a test-owned HOME and XDG directories and DO_NOT_TRACK, so no operator settings leak in. The studio CI job gains a Go toolchain step to run it, mirroring the Slack bot example job, and now also runs on Go changes, since a daemon change can break Studio. Tracking: #1736 Signed-off-by: Samuele Verzi <[email protected]>
samuv
force-pushed
the
studio/integration-tests
branch
from
September 23, 2026 12:54
bd31006 to
5dac601
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Codifies the manual smokes that accompanied each Studio layer as a Vitest integration suite that boots the BFF in mock mode, lets the real SDK spawn
bin/mecated --mock, and drives every product surface through the Hono app exactly as the browser would: runtime negotiation, session create / list / run-as-SSE / transcript / rename / delete, stale run controls (409), honest scheduling capability, knowledge inventories and consolidation plan generation, the settings allowlist and storage health, and the CSRF and CORS posture. No fakes below the BFF.apps/server/test/integration/mecated-mock.test.ts(7 tests) with its ownvitest.integration.config.ts; the offlinepnpm testexcludes it viavitest.config.ts, and it skips loudly when the binary is absent.task studio:test:integrationbuilds the daemon first (task build) and runs the suite, mirroring the Slack bot example's test task.studioCI job gains a Go toolchain step and runs it after the pure-Node gates.It also proves the bounded, resumable activity replay end to end against real durable history: a tiny replay bound truncates after exactly its quota and names the last cursor, resuming from that cursor returns only events not already delivered, walking the cursors to the run's terminal result never duplicates one and never exceeds the bound in a single request, and an unusable cursor is refused rather than replaying everything. This is the acceptance test the review finding asked for, above the unit proofs that use SDK fakes.
Verification
Locally: 7/7 pass against a spawned
mecated --mockin about a second; the offline suite is unchanged at 89 tests;task lint:actions,task docs, Biome, and typecheck pass.Further amendments
task studio:test:integrationsetsSTUDIO_REQUIRE_MECATED=1, so a missing daemon binary fails there and in CI; a direct run still skips loudly.The spawned daemon gets a test-owned
HOMEand XDG directories plusDO_NOT_TRACK=1, so operator settings never leak in.The unusable-cursor assertion is strict (
400 invalid_cursor).The
studioCI job now also runs on Go changes, because the suite tests the currentmecated. The workflow wiring test pins the new gate, and the stale "pure Node" comment is gone.The README's trailing blank lines are removed.
Cursor walk. The walk now asserts that it ended because the stream closed at the run's end and that the terminal
resultevent was delivered. It also asserts that a resumed stream's first frame is a durable event.Re-verified locally: 8/8 pass against a freshly built
mecated --mock.Development stage
Contract linkage
Interface conformance
Issue relationship
Relates to #1736 (stack #1766). Non-closing.
Type of change
Test plan
Baseline checks
task lint)task test)go run ./cmd/mecademo)task docs)Studio gates:
task studio:checkandtask studio:test:integrationpass;task lint:actionspasses for the CI change.User-facing change
None.
Special notes for reviewers
Top layer of the Studio stack. The suite reads the daemon's capabilities and asserts the supported or degraded path accordingly, so it stays truthful if the mock gains scheduling later.