Skip to content

Add the offline cross-runtime collaboration harness - #201

Merged
hsliuustc0106 merged 2 commits into
mainfrom
feat/offline-interop
Oct 17, 2026
Merged

hsliuustc0106 merged 2 commits into
mainfrom
feat/offline-interop

Conversation

@hsliuustc0106

@hsliuustc0106 hsliuustc0106 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #200. Refs #198 and the design in #199.

Add a development-only offline collaboration harness with distinct synthetic owners, independent delivery/execution approvals, dedicated task sessions, clarification and explicit simulated requester acceptance. The versioned codec, durable inbox/turn journal, scripted runtime and fake clock cover isolation, conflicting/duplicate/out-of-order events, revocation, recovery, cancellation and persisted budgets. Same-owner friendship stays forbidden; no shipped runtime or authorization path is added.

Recover only explicit RuntimeRecoveryError transport/evidence failures as uncertain; assertion, storage and programming errors propagate. Cancellation races record a stopped outcome without reviving work. Document that result-ready tasks intentionally free their execution slot while remaining within the 64-task journal bound.

Verification at b05157a01997d3c608b6cc13ca29a3166508f4dc:

  • DSH_HARNESS=/workspace/FlyBot/core/dev/harness npm run verify: pass, 1,054 tests (32 interop tests), 0 failed/skipped.
  • Demo, pack, strict API typecheck (TypeScript 5.9.3), actionlint 1.7.7, changelog and diff checks: pass.
  • The new unexpected-error regressions failed on the reviewed tip because exceptions were swallowed, then passed after the fix. Existing lost-reply/offline/ambiguous-history and cancellation tests remain green.
  • Not run: real Bot Social/OpenCode, real models, smoke/Desktop, OS power-loss/SIGKILL or non-Linux durability tests. Mock outcomes are not live interoperability, authentication, sandboxing or human-acceptance evidence.

For external review of this tip; #198, real-runtime work and team-mode gates remain open.

Fixes #200. Refs #198. Simulate distinct-owner task handoff, staged approvals, persistent dedupe and recovery, cancellation and bounded execution without a live runtime or model.

@hsliuustc0106 hsliuustc0106 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for the offline slice: scope stays in dev/interop/, fail-closed contract, and CI is green. Two non-blocking nits inline; keep draft until #198 / real-runtime gaps are tracked, not claimed.

Comment thread dev/interop/harness.mjs
}
const current = this.task(task.id)
this.checkEvent(current, event)
this.runtime.submit(current.sessionId, event.turnId, contentOf(event))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: bare catch also swallows unexpected requireValue failures after a successful submit. Prefer treating only known transport/recovery errors as uncertain and rethrowing the rest.

Comment thread dev/interop/harness.mjs
for (const key of Object.keys(budget)) requireValue(Number.isSafeInteger(budget[key]) && budget[key] > 0 && budget[key] <= DEFAULTS[key], 'invalid budget')
return this.journal.transaction(state => {
requireValue(!get(state.tasks, id) && Object.keys(state.tasks).length < 64, 'duplicate task or journal full')
requireValue(Object.values(state.tasks).filter(t => !TERMINAL.has(t.status) && t.status !== 'result-ready').length < 2, 'concurrency limit')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: concurrency ignores result-ready, so many unfinished accepts won’t block new enrolls. Fine if intentional — worth one README line.

@hsliuustc0106
hsliuustc0106 marked this pull request as ready for review October 17, 2026 15:55
Refs #200. Restrict uncertain recovery to explicit transport or reconciliation errors; retain cancellation races as stopped outcomes and clarify result-ready execution slots.
@hsliuustc0106
hsliuustc0106 added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 4470c1e Oct 17, 2026
6 checks passed
@hsliuustc0106
hsliuustc0106 deleted the feat/offline-interop branch October 17, 2026 16:12
@hsliuustc0106 hsliuustc0106 added the status:done Scoped task completed and merged; does not imply parent acceptance is complete label Oct 17, 2026 — with ChatGPT Codex Connector
Birfy pushed a commit to Birfy/FlyBot that referenced this pull request Oct 18, 2026
…sions (ThinkFlowLab#317)

Fixes ThinkFlowLab#316. Refs ThinkFlowLab#198 (first P0 box: align this issue, the pilot doc and
the offline scope).

Docs-only. `docs/interop/opencode-pilot.md` now states the settled
decisions (decision comment on ThinkFlowLab#198, 2026-10-18) instead of
contradicting them: phase 1 is single-owner same-room on the fixture
task (edit + run tests, no network; human approval for outbound
network/credentials/budget top-up/final acceptance), A2A stays
non-required, and the OpenCode process is a FlyBot-driver-owned
supervised child rather than an operator-started server.
`docs/interop/room-participants.md` records the same phase-1 decisions
and replaces the operator-controlled binding with the supervised-child
responsibility. The DM/offline experiment's own constraints (Bot Social
same-owner rejection, distinct synthetic owners) are kept and clearly
scoped to the cross-home path; slices updated (slice 1 merged as ThinkFlowLab#201,
slice 2 marked cross-home, slice 4 re-scoped single-owner). The v1
codec/journal/budget/projection contract is untouched.

What I ran at tip `ecb6e04`: full `TZ=UTC npm run verify` — all suites
green except the 3 known macOS-only `room-collaboration.test.js`
failures caused by the tmpdir-symlink bug fixed in ThinkFlowLab#315 (this branch
intentionally does not carry that code change; CI runs Linux and is
unaffected). What I did not run: smoke test and bench (no code change).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:done Scoped task completed and merged; does not imply parent acceptance is complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build the offline cross-runtime collaboration harness

1 participant