Repository navigation
Adopt an existing 09:00 digest task instead of writing a second one (#1751) - #3172
Merged
Merged
Conversation
Four cases drive what `reconcile` does today: it writes a second 09:00 task beside the one the Session already holds, writes an active one over the digest its owner paused, keeps the dead row's id when a task ended, and treats a weekly task that reuses the digest title as the digest. They fail until the assistant adopts the task that is already there. Part of #3114 (the umbrella stays open - this slice closes its own issue).
`reconcile` and `project-create` retried the digest by writing a task, so a Session that already held its 09:00 digest got a second one — and when the first was paused, the retry wrote an active copy over the owner's pause; when the Project had lost its id it could store the id of an ended row and never schedule again. `scheduleDigest` now reads `schedules` first and adopts a task on the Session with the digest title and a daily rule (`status !== 'inactive'`, so a paused one counts and an ended one does not). Only a miss writes, and the row read back after the write is found by the same identity. Fixes #3171 Part of #3114 (the umbrella stays open - this slice closes its own issue).
Collaborator
Author
|
Verdict: PASS at 0accac2 Ran at this tip: Reviewed at tip 0accac2 (tip tarball; red run on a copy with
next: enqueue this tip. |
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: Dev
Fixes #3171
Part of #3114 (the umbrella stays open — this slice closes its own issue)
Owner: Dev
Reviewer: Reviewer
Tier: T2
What changed
plugins/project/src/project-assistant.jsL224scheduleDigestwrote aschedule-createon every retry. A Project whose assistant Session already held its 09:00 digest got a second one; when that first task had been paused by its owner, the retry wrote an active copy over the pause; and when the Project had lost its id it could store the id of a row that had already ended, after whichreconcile(L263typeof scheduleId === 'string') never tried again and the Project had no digest at all.scheduleDigestnow readsschedulesbefore it writes and adopts a task that is already on the Session with the digest title and a daily rule. DSH's task states areactive | inactive(a paused task is merged in byschedulesViewasstatus: 'paused'), so the test iskind === 'daily' && status !== 'inactive': a paused digest is adopted and stays paused, only an ended row is replaced. Only a miss reachesschedule-create, and the row read back after the write is found by the same identity. Identity is title + daily rule, notdaily.time, because DSH normalises the time string (09:00:00.000) and a string compare would break with the version — that trade is written down indocs/subsystems/project.md.Four cases were added to the existing file (no new file, no scaffold change), one changelog fragment, one docs line.
core/**was not touched: nogenerate, noclient.js.Verification at the tip
Tip SHA:
0accac2f9f2ad7b7259c9216cfe77bcaf965dca2(base25ab31c97c4fa57de2174fa6a676bd937066cb21)Ran (red, tests only — commit
f98969e15b4ec31ca97012ee167960e20425f4a7, implementation untouched):Ran at this tip:
Environment note: this box has no
gitinPATH, so the git-dependent gates above (canonical,arch-docs, thegit difflines) ran with the bundled git 2.53.0 at/data/dsh/bot/workspace/tools/git;origin/mainis a local ref to the base commit, whose treeb331dea586143f99a9901f8d82b02424e55632f7equalsmain's tree at25ab31c97c. Nothing in this list was deferred to tip CI.Not run: the smoke bench (
dev/bench.sh— this change touches neitherindex.jsnorsrc/host/), and the CIpackagejob's pack check, typecheck and actionlint.Checkpoint
{ "pr": 3172, "claim": "Dev", "issue": 3171, "summary": "A Project whose assistant Session already holds its 09:00 digest now adopts that task instead of writing a second one. The digest is identified by the Session, the title and a daily rule, so a task its owner paused is adopted and stays paused, while an ended (inactive) row is replaced. Only a miss writes, and the row read back after the write is found by the same identity. The stored scheduleId therefore always names a task that can still fire.", "files": ["plugins/project/src/project-assistant.js", "plugins/project/test/project-assistant.test.js", "docs/subsystems/project.md", "changelog.d/3114-digest-adopt.fixed.md"], "checks": { "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify", "result": "green", "at": "0accac2f9f2ad7b7259c9216cfe77bcaf965dca2" }, "next": "none — ready for review" }