Repository navigation
test(schedules): pin the paused-source branch of copy (#1319) - #1343
Merged
Merged
Conversation
The paused branch of copySchedule is the only path that calls service.create instead of the row write, and nothing exercised it. Pause a task, copy it, and assert a fresh id, create called with the source's request, and a next run anchored to now + interval as Resume anchors one. Replacing that create with copyRow fails the new case with "No such task". Fixes #1319
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.
Written-by: Dev3
Owner: Dev3
Reviewer: Reviewer2
Tip SHA: 4ba2e53
Fixes #1319
Reproduce
copySchedulesplits atcore/src/host/schedules.js:341: a paused source goes throughservice.create(as Resume does), an active one through the row writecopyRow. The three#1287cases copy an active source only, so nothing in the suite executes:341— the reviewer that PASSed#1307named this path as untested, and#1319tracks exactly that gap. Evidence the branch is real and not the happy path: replace:341withcopyRowand every existing case still passes.What changed
core/test/schedules.test.js: one case that pauses a task, copies it to another Bot, and asserts a freshschedule-*id (never the paused source's),service.createcalled once for the copy on the target's current part with the source's request ({title, prompt, every_seconds}), and the copy's next run anchored to now + interval the way Resume re-anchors one — then asserts the paused source is still paused. It also covers the refusals this branch shares with the active one (same chat) and that a refused copy creates nothing.createdlog so a case can say which creates happened, not only how many rows exist.patches/ds-bot/0001-core-fixes.patchregenerated withnode scripts/ds-bot-patches.mjs generate; no product code changed — the case exposed no defect, as#1319predicted.What I ran
node --test test/schedules.test.jsincore/→# tests 28 / # pass 28 / # fail 0node scripts/ds-bot-patches.mjs check→ threeoklines: pinFei2411/DeepSeek-Bot@2b10c70 (tree 5834c00, v0.1.5),10 patches apply cleanly in order,core/ equals ds-bot/ + patches/ds-bot/node scripts/build-client.mjs --check→ exit 0npm run lint→ 70 warnings, 0 errors (same as base)Red without the source change
This issue is a test-gap issue: no source code changes here — the knife is a temporary source edit, measured and then reverted.
On exactly this tip's
core/test/schedules.test.js(git hash-object=bbc61301dbc8c916a49f582aeee68e212fd13e2f, the blob in this PR): temporarily replace the paused branch'sawait service.create(toSession, request)withawait copyRow(sourceSession, sourceId, toSession)and run the file:One failure, and it is the new case. Restored (
cmpagainst the saved copy: identical) the file is back to# tests 28 / # pass 28 / # fail 0.Not run
core/suite locally: CItests-okruns it at this tip, and one test file is the whole diff.index.jsorsrc/host/change.Risk
Test-only change plus the generated mirror; no runtime behaviour moves. The new case pins a current contract (a paused copy re-anchors, as Resume does) — if copy semantics for paused sources ever change deliberately, this case must change with them, which is the point of pinning it.
Checkpoint
{
"pr": 1343, "claim": "Dev3", "issue": 1319,
"summary": "Pins the paused-source branch of copySchedule, the one path that calls service.create instead of the row write. The new case pauses a task, copies it, and asserts a fresh id, create called with the source's request on the target's current part, and a next run re-anchored to now + interval. It also checks the refusals this branch shares and that a refused copy creates nothing. No product code changed; the case exposed no defect.",
"files": ["core/test/schedules.test.js", "patches/ds-bot/0001-core-fixes.patch"],
"checks": { "ran": "node scripts/ds-bot-patches check; node --test test/schedules.test.js", "result": "green", "at": "4ba2e53cfd0c5527f48e57e038282f2260f1ff19" },
"next": "none — ready for review"
}