Repository navigation
feat(platform): keep test reports, try drafts and run tests by hand - #4808
Merged
Merged
Conversation
A save, the deploy gate and a check made by hand now store the report their tests verdict came from, which act made it and who (migration 0200: tests_report, tests_checked_via, tests_checked_by). A verdict without a report clears the old one, and a reader shows a report only while its checkedAt matches the verdict, so an earlier report never reads as the current one. Version history rows count it; readTestReport answers a version's last check.
POST /:name/try runs a draft or a saved version once in mock mode with an input and stand-ins, recorded like a stored run and never stored. POST /:name/run-tests runs a draft's or a version's tests, all or some, each with its run; a saved version's whole suite is recorded as its verdict, made by hand. GET /:name/test-report answers a version's last check. Runs are charged to a new automation:bench bucket, held to four per process, capped in body and answer, and stopped when the caller leaves. The app gets contract entries and parsed adapters for the three.
This was referenced Oct 11, 2026
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.
What
The storage and app routes the editor's Tests panel builds on: a version keeps what its latest test check found, and the app can try a draft and run tests by hand. This is the app half of P5's tests wire. The MCP/REST halves follow the MCP OAuth work; bench runs on the durable stepper (
/startwith stand-ins, protocol 2) follow the walker.Storage —
0200_automation_test_reports.sqltests_report jsonb: the trimmedstoredTestReportSchemacopy, ≤ 64 KB.tests_checked_via:save | deploy | manual, enforced by a CHECK.tests_checked_by: who, increated_by's vocabulary.SaveOptions.testReport,deploy(…, {testReport}),recordTestVerdict(…, {report, via}).checkedAtmatches the verdict's time, so an earlier report never reads as the current one.readTestReportanswers a version's last check. History rows fill theirtestssummary (passed, failed, total, via, by) from SQL.Routes (Developer and up)
POST /:name/tryruns a draft or a saved version once, in mock mode: input and stand-ins (runBenchSchema), a 20 s deadline, recorded like a stored run, nothing stored. A refused draft answersAUTOMATION_INVALIDwith its problems; a stand-in the run cannot take answersBENCH_INVALID.POST /:name/run-testsruns the tests of a draft or a saved version, all or some, each with its run (10 s per test, 60 s per suite). A saved version's whole suite, run to its end, is recorded as its verdict, made by hand (recorded); a subset or a draft records nothing. A document without tests answers an empty report.GET /:name/test-report?version=Nanswers a saved version's last check.test-reportjoins the reserved last segments of a new automation's name (AUTO-R49), since the bareGET /:namewould otherwise answer a name ending in it as another automation's report.automation:bench(120/min, burst 240), a suite by its test count, answeringRATE_LIMITED+Retry-After.Retry-After: 2).detailOmitted.App data layer
tryAutomation,runAutomationTests(refreshes version reads when it records), andgetAutomationTestReport(under the automation's keys). The answer schemas live inlib/shared/schemas/automation-tests.ts.Spec
AUTO-R50: a version keeps what its latest test check found, and who made it.Verification (local)
tsc; oxlint; the UI suites (2,479); automations browser tests (93); format,lint:links,lint:manual,knip.tests/guards/automation-legacy-agent-flow.test.ts("reuses unchanged historical helpers"), is red onmaintoo:backend/core/node_only/sandbox/turn_budget.tschanged in 6d1e153 without its pinned hash inagent-flow-provenance.json. This branch does not touch either file.store.save-version,store.deploy,dispatch.authoring,dispatch.refusals,routes.authoring,routes.versions), with a new case each for a report kept on save and on deploy.routes.bench.test.ts, 11): run, record, refusals, 413, 429 for a spent budget and for a busy server, and the verdict recorded only for a whole suite of a saved version. Each real answer also parses with the app's schemas.bench.test.ts): concurrency cap, document hash, value cut, a run left out.checkTestReports(new, 6 checks) passed withcheckVersionHistoryandcheckDeploymentHistory(97/97, migration applied fresh).checkAutomations,checkMcp,checkMcpAuthoringParity,checkManagedAutomationConfiguration,checkRestDoor,checkAutomationTemplates,checkAutomationsSurface): 137 of 138. The one red ischeckAutomationsSurface's zip staging (an emptystorageIdin a filtered run), which fails the same way on a cleanmainin a filtered run.