Repository navigation
Conversation
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
A new recipe page, Report an Execution's Outcome to Another Execution (
docs/content/crafting-tasks/report-outcomes.md), added to the nav after Child Invocation. Postgres Conductor dropped the plannedonSettledoption in favour of this pattern. The page covers:ctx.invoke→ctx.waitForResult→ctx.signalWithStartwith{ executionId, outcome }. It explains that a finished, short-lived target is started again for the report.ctx.signalWithStartis memoized, butctx.sendSignalruns again on every replay, so a signal id derived from the watched execution makes it store once. The target still dedupes by id, because delivery is at least once.cancelWithParentwatcher on its caller, which sends ashutdownsignal (or callsctx.cancel) when the caller fails or is cancelled.ctx.waitForAnywith an{ execution: id }branch, using an approval card as the example.Retention rule (tested)
New test in
wait-for-result.test.ts: the watched execution settles and is removed at settlement (removeOnComplete: true, orremoveOnFail: truewith a failure) before the wait registers.ctx.waitForResult, thewaitForAnyexecution branch andconductor.waitForResultall throwExecution <id> not found. None of them hangs, and no wait subscription is left behind.The page tells readers to keep the watched task's retention longer than the wait, or to start the wait before the work can finish. It also points out that the supervisor races against immediate removal: a tool that finishes between
invokeandwaitForResultis already gone.Fixes found along the way
retention.mdandapi/conductor.mdsaidremoveOnComplete: trueremoves executions "at the next maintenance run". In fact it maps to0days and removes the execution when it settles (the new test relies on this). Both pages are corrected.Verification
tests/integration/outcome-recipe.test.tscompiles and runs the page's examples (supervisor with completed and failed outcomes plus a session restart, watcher shutdown on caller cancel, approval-card race).just lint,just format,pnpm typecheckand the fullpnpm testpass. The one failure in the full run was a race in the new test, which is fixed: it now waits for the first session to finish.uv run zensical buildbuilds the page, and all cross-page anchors resolve.Follow-ups
docs/zensical.tomlliststask-execution/rate-limiting.md, which does not exist (outside this PR's scope).