Guides: the wait for a commit's outcome reads payload.trigger.commitOid (#1)
jonas, 2026-11-28 21:25 UTC · b65083ab653ccc53d993d2b91ed4f1c092e1147c · parent 2c82f1c
2 files changed
M onboarding/look.md
@@ -52,17 +52,27 @@ const next = css .replace(/^(\s*)--primary:.*$/m, `$1--primary: ${colour};`) .replace(/^(\s*)--sidebar-primary:.*$/m, `$1--sidebar-primary: ${colour};`); +const root = itx.cd("/"); +// where the root's log ends now, before the commit +const head = (await root.readEvents(Number.MAX_SAFE_INTEGER, 1)).scannedThroughOffset; const { commitOid } = await repo.commitFiles({ message: "Look: a green primary colour", parent: tip, changes: [{ path: "apps/theme.css", content: next }], }); -return await itx.cd("/").waitForEvent({ - type: ["events.iterate.com/mind/worker-updated", "events.iterate.com/mind/worker-update-failed"], - payload: { commitOid }, - afterOffset: 0, - timeoutMs: 60000, -}); +// The outcome names its commit in `payload.trigger.commitOid`. A `payload` filter compares +// top-level fields alone, so take each outcome after `head` until one names this commit. +let outcome; +let after = head; +do { + outcome = await root.waitForEvent({ + type: ["events.iterate.com/mind/worker-updated", "events.iterate.com/mind/worker-update-failed"], + afterOffset: after, + timeoutMs: 60000, + }); + after = outcome.offset; +} while (outcome.payload.trigger?.commitOid !== commitOid); +return outcome; ``` The icon, by the subagent, the same way: commit one square SVG as `profile/icon.svg` with the
M onboarding/website.md
@@ -43,10 +43,16 @@ search, only what matches them. What the owner said in the sign-up is private: it tells you what the page is for, and none of their words, plans or work details go on the page. Never an email address, a phone number, a home address, or a guess. No tool, no form, no list that keeps data."; -- "Commit with `itx.repos.get('/repos/config').commitFiles`, the tip as `parent`. Wait for the - outcome: `await itx.cd('/').waitForEvent({ type: ['events.iterate.com/mind/worker-updated', -'events.iterate.com/mind/worker-update-failed'], payload: { commitOid }, afterOffset: 0, -timeoutMs: 60000 })`. On a failure, fix it and commit again. Then fetch the address with +- "Before the commit, read where the root's log ends: + `const head = (await itx.cd('/').readEvents(Number.MAX_SAFE_INTEGER, 1)).scannedThroughOffset`. + Commit with `itx.repos.get('/repos/config').commitFiles`, the tip as `parent`. Wait for the + outcome. It names its commit in `payload.trigger.commitOid`, and a `payload` filter compares + top-level fields alone, so take each outcome after `head` until one names your commit: + `let outcome, after = head; do { outcome = await itx.cd('/').waitForEvent({ type: +['events.iterate.com/mind/worker-updated', 'events.iterate.com/mind/worker-update-failed'], +afterOffset: after, timeoutMs: 60000 }); after = outcome.offset; } while +(outcome.payload.trigger?.commitOid !== commitOid)`. On a failure (`outcome.payload.error`), fix + it and commit again. Then fetch the address with `itx.fetch`, with no sign-in: 200, with your page's own words. A 401 or a sign-in page means it is not public: fix it."; - the report rule of `onboarding/subagents.md`.