Make main green: source-form e2e harness, section-mode launch reads, checks-job repairs - #133
Merged
Conversation
…use across re-projected definitions
The launch-body reader only understood a definition whose one agent step sat at the top level, so a room agent's section-mode definition (CL-6329's onTrigger turn) failed every read with "step turn is not a step primitive" — inviting an agent into a chat 500'd. It now unwraps the section and reads the agent step inside, for both the inert projection and the live shape. Agent-chat reuse compared definition row ids. A code-sourced deploy projects a fresh workflow_definition row per frozen wire projection, so the id a chat recorded at creation and the id the picker offers later are routinely different rows over the one asset that is the agent, and "reopen my chat with this agent" minted a duplicate instead. Reuse now compares the definition's asset.
…ced deploy
The walking-skeleton suites still published a bare workflow.json and
deployed with the pre-cutover {assetId, sources} body, so every suite
that publishes a workflow died at the push with "path-violation: the
workflow.json envelope form is no longer supported". The harness now
publishes through the platform's own pusher (@corbits/hub-client's
createGitWorkflowPusher, rendering @corbits/workflow-source's tree) and
carries the pushed commit into a {source, entry} deploy body, so the
suite exercises the one publication path the seed and the product use.
Also: the folded-run backfill fixture predated workbench_launch's
NOT NULL current_run_id; the local-rip planner gate counted definition
rows, which a code-sourced deploy re-projects per run, so it now names
the agents that appeared; and the chat settings test ran on bun's 5s
default while its siblings allow 90s.
… agent_turns' allowlist ruling Six test files had drifted from prettier, failing lint before eslint or the unit suite ever ran. Behind that, the task-planner fake db predated the launch path's frozen-projection read (db.select is not a function), and CL-6329's agent_turns table was added to @corbits/chat's schema without the explicit allowlist ruling check:no-product-tenancy requires.
main landed the same section-aware inert reader (extractAgentBearingStep); kept its implementation and dropped this branch's duplicate, along with the tests main already covers. readLiveFoldedBody keeps its folded-only scope: its one caller is the in-process workbench-host launch.
`mock.module` rewrites the module registry for the whole process and bun offers no way to take it back, so three suites that stubbed `@corbits/react-ui`'s `toast` left the stub installed for every file bun loaded after them — `toast-single-system.test.tsx` renders the real toaster and observed nothing, failing four assertions in full-suite runs and none in isolation. The shared spy delegates to the real `toast` instead of replacing it, so the three suites keep the call record they assert on while any file that mounts a `<Toaster />` still sees real toasts. Sonner's store is global and outlives a mount, so the counting suite clears it before each test.
Steps 05-07 still assumed the pre-CL-6342 flow, where the sidebar's "+" minted a workbench on the spot. It opens the picker now, so the harness chooses a kind and presses Create the way a person does.
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.
Main's CI has been red since the milestone merge (#108) — both jobs. This
puts them back green and fixes the real regressions the red was hiding.
walking-skeleton
The e2e harness still spoke the pre-cutover deploy dialect. It pushed
a bare
workflow.jsoninto the asset repo and deployed with{assetId, sources}. The source-form gate rejects the envelope(
path-violation: … the workflow.json envelope form is no longer supported), so seven suites died at the push. The harness now publishesthrough the platform's own
createGitWorkflowPusher(rendering@corbits/workflow-source's tree) and carries the pushed commit into a{source, entry}deploy body — the same path the seed and the producttake, so the suite can't drift from them again.
Agent-chat reuse compared definition row ids. A code-sourced deploy
projects a fresh
workflow_definitionrow per frozen wire projection, sothe id a chat recorded at creation and the id the picker offers later are
routinely different rows over the one asset that is the agent:
"reopen my chat with this agent" minted a duplicate instead. Reuse now
compares the asset.
Fixture alignment alongside those: the folded-run backfill insert
predated
workbench_launch's NOT NULLcurrent_run_id; local-rip'splanner gate counted definition rows (re-projected per run) and now names
the agents that appeared, which is what the gate was always about; and
the chat settings test ran on bun's 5s default while its siblings allow
90s.
(The section-mode launch read —
readFoldedBodychoking on CL-6329'sonTriggerturn — was fixed on main in parallel while this branch was inflight; this branch keeps main's implementation and drops its own.)
checks
Lint failed on prettier drift, which meant eslint and the unit suite
never ran — and both were red behind it. Fixed: the formatting, three
unused symbols left by the section swap, the task-planner fake db (which
predated the launch path's frozen-projection read), and
agent_turns'missing
check:no-product-tenancyallowlist ruling.The toast suite's order-dependent failure is fixed at the cause.
mock.modulerewrites the module registry for the whole process and bunoffers no way to take it back, so three suites that stubbed
@corbits/react-ui'stoastleft the stub installed for every fileloaded after them;
toast-single-system.test.tsxrenders the realtoaster and observed nothing. The shared spy now delegates to the real
toastinstead of replacing it, and the counting suite clears sonner'sglobal store before each test. Verified across repeated full-suite runs.
Browser walkthrough
Steps 05-07 still assumed the pre-CL-6342 flow where the sidebar's "+"
minted a workbench on the spot. The harness now opens the picker, chooses
"Just start talking", and presses Create.
Proof
All three walking-skeleton steps pass locally against a scratch Postgres:
bun test scripts/e2e(36 pass, 1 skip, 18 files),bun test test/isolation(41),bun test apps/hub/test(109).bun run typecheck,bun run lint,bun run build,bun run test, thestructural self-tests, and every
check:*pass.Noted, not fixed here
workflow_definitionrow underthe agent's own name on every launch, so a tenant's definition list
grows per launch and "newest sibling by name" resolution can pick a
run's own derived row. The reuse fix above works around it at the one
place it broke; the identity model itself wants a ticket.
hub restart, a reloaded shell stayed disconnected (no Myra sidebar row
within 15s) on the first attempt and connected on the second. Fresh
evidence that the reconnect is flaky, not fixed.