Skip to content

feat(workboard): surface durable coordination projections - #97668

Closed
mjnkao wants to merge 7 commits into
openclaw:mainfrom
mjnkao:codex/openclaw-durable-batch-c-workboard-visibility
Closed

mjnkao wants to merge 7 commits into
openclaw:mainfrom
mjnkao:codex/openclaw-durable-batch-c-workboard-visibility

Conversation

@mjnkao

@mjnkao mjnkao commented Jun 29, 2026

Copy link
Copy Markdown

Depends on:

This PR makes durable coordination visible on the existing Workboard plugin. It is intentionally a plugin-side adapter: Workboard can accept a durable coordination projection, normalize it into card metadata, and update lifecycle status without making Durable Core depend on Workboard.

What changed:

  • Adds a Workboard durable adapter that maps durable coordination projection fields into a bounded metadata.durable shape.
  • Adds workboard.cards.applyDurableProjection gateway method.
  • Persists durable metadata on cards, including workflow/run identity, current step, recovery/status fields, child counts, and a timeline command hint.
  • Maps durable terminal/waiting/running statuses to Workboard lifecycle states.

Why this matters:

  • This is the first visible operator surface for the Durable Core work: long-running agent work can be tied back to Workboard cards that humans can inspect.
  • It keeps Workboard as the human operations board while Durable Core remains the lifecycle/audit/coordination layer.
  • The integration is generic and does not assume Discord, AICOS, or a specific agent team.

Boundaries:

  • Durable Core does not import Workboard.
  • Workboard accepts projection-like data and normalizes it locally.
  • Existing card metadata is preserved through the normal Workboard metadata normalization path.
  • This PR does not add a new scheduler or worker loop.

Review notes:

Validation:

  • node scripts/run-vitest.mjs run --config test/vitest/vitest.extensions.config.ts extensions/workboard/src/store.test.ts extensions/workboard/src/gateway.test.ts
  • Full stacked check also passed: node scripts/run-vitest.mjs run --config test/vitest/vitest.unit.config.ts src/durable src/tasks/task-flow-registry.test.ts
  • pnpm db:kysely:check

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime cli CLI command changes scripts Repository scripts commands Command implementations agents Agent runtime and tooling plugin: workboard triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. size: XL labels Jun 29, 2026
@clawsweeper

clawsweeper Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 29, 2026, 1:26 AM ET / 05:26 UTC.

Summary
Adds stacked durable workflow state, CLI/Gateway, and agent coordination code plus a Workboard adapter/RPC that maps durable coordination projections into card status and metadata.

PR surface: Source +5784, Tests +2280, Docs +14, Generated +306, Other +3. Total +8387 across 49 files.

Reproducibility: yes. for the blocking review findings: source inspection shows the Task Flow projection always replaces stateJson and the schema guard runs after durable workflow DDL. The feature request itself is not a bug reproduction target.

Review metrics: 3 noteworthy metrics.

  • Workboard Gateway API: 1 operator.write RPC added. A new card mutation method needs permission documentation and real behavior proof before merge.
  • Durable Env Controls: 4 env controls in stacked diff. The durable feature flag, heartbeat, recovery interval, and stale-turn controls affect operator behavior when enabled.
  • Shared SQLite Schema: 8 durable tables added in stacked diff. A schema lifecycle table plus seven workflow tables make upgrade, retention, backup, and doctor expectations material before merge.

Stored data model
Persistent data-model change detected: database schema: src/durable/sqlite-store.test.ts, database schema: src/state/openclaw-state-schema.generated.ts, database schema: src/state/openclaw-state-schema.sql, serialized state: src/agents/tools/sessions-spawn-tool.ts, serialized state: src/commands/durable.ts, serialized state: src/state/openclaw-state-db.generated.d.ts, and 21 more. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Root-cause cluster
Relationship: partial_overlap
Canonical: #97508
Summary: This PR is a stacked Workboard visibility follow-up for the durable coordination kernel; the base durable PR owns the core implementation and the later dependency PRs own upgrade/projection slices.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🧂 unranked krab
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix the Task Flow state preservation and schema-version guard findings in the owning durable slices.
  • [P1] Add redacted real behavior proof showing a durable projection updating a Workboard card.
  • Settle or rebase off the open durable base PRs so this can be reviewed as an isolated Workboard adapter.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Missing: the PR lists tests but no redacted terminal output, logs, screenshot, recording, or live output showing a durable projection updating a real Workboard card; after adding proof, update the PR body or ask for @clawsweeper re-review.

Mantis proof suggestion
A real UI or live-output proof showing a durable projection reflected on a Workboard card would materially improve review confidence. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis visual task: verify that a durable coordination projection updates a Workboard card status and durable metadata in the Control UI.

Risk before merge

  • [P1] Merging this branch as-is would bring in the full unresolved durable stack, including shared SQLite schema, env controls, startup/recovery behavior, and session/subagent coordination state, not only the intended Workboard adapter.
  • [P1] The stacked Task Flow projection can replace existing persisted stateJson when durable state syncs into a bound flow.
  • [P1] The durable store can mutate workflow tables/columns before rejecting a future schema version, weakening the upgrade-safety guarantee.
  • [P1] The contributor has not supplied redacted real behavior proof showing a durable projection updating a real Workboard card.
  • [P1] The new Workboard operator.write RPC is not documented in the Workboard plugin permission surface.

Maintainer options:

  1. Unstack And Repair Dependencies (recommended)
    Fix the durable schema and Task Flow state defects in their owning slices, settle the durable-kernel direction, then rebase this PR to the top-only Workboard adapter with fresh proof.
  2. Sponsor The Full Stack
    Maintainers can intentionally review and own the complete durable schema, startup, session-state, and Workboard integration risk in one merge, including the identified repairs.
  3. Pause Until Durable Direction Lands
    If maintainers are not ready to accept the durable coordination boundary, pause or close this adapter and keep the RFC/base PR as the decision point.

Next step before merge

  • [P1] Human review is needed for durable stack direction, upgrade/session-state risk, and contributor proof; the repairable defects are entangled with open dependency PRs.

Security
Cleared: No concrete security or supply-chain regression was found; the diff adds no dependencies, workflows, package scripts, or secret-access expansion.

Review findings

  • [P1] Preserve existing Task Flow state — src/durable/taskflow-bridge.ts:106
  • [P2] Check future schema versions before mutating — src/durable/sqlite-store.ts:525
  • [P3] Document the new Workboard projection RPC — extensions/workboard/src/gateway.ts:121
Review details

Best possible solution:

Settle or repair the durable base stack first, then rebase this as an isolated Workboard adapter with preserved Task Flow state, safe schema guards, documented RPC permissions, and redacted real behavior proof.

Do we have a high-confidence way to reproduce the issue?

Yes for the blocking review findings: source inspection shows the Task Flow projection always replaces stateJson and the schema guard runs after durable workflow DDL. The feature request itself is not a bug reproduction target.

Is this the best way to solve the issue?

No as currently stacked: the Workboard adapter boundary is plausible, but the branch should not merge until the durable base direction is accepted, stacked state defects are repaired, and the adapter is proven in a real Workboard setup.

Full review comments:

  • [P1] Preserve existing Task Flow state — src/durable/taskflow-bridge.ts:106
    buildDurableTaskFlowPatch always merges durable metadata into undefined, so every sync supplies a new stateJson and replaces any existing persisted flow state. Pass the current flow state into the merge and add a regression with pre-existing state keys.
    Confidence: 0.91
  • [P2] Check future schema versions before mutating — src/durable/sqlite-store.ts:525
    ensureDurableWorkflowSchema creates workflow tables/indexes and runs column backfills before checking durable_schema_migrations. An older binary opening a future durable DB can mutate the schema before throwing, so move the guard before workflow DDL and prove failed open is non-mutating.
    Confidence: 0.9
  • [P3] Document the new Workboard projection RPC — extensions/workboard/src/gateway.ts:121
    This adds a new operator.write Workboard Gateway method, but the Workboard plugin docs still omit it from the permission surface. Update the docs so operators and permission reviewers know the write RPC exists.
    Confidence: 0.82

Overall correctness: patch is incorrect
Overall confidence: 0.89

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 527f20f4b5e5.

Label changes

Label justifications:

  • P2: This is a substantial optional durable/Workboard feature with bounded default blast radius but concrete merge blockers.
  • merge-risk: 🚨 compatibility: The branch adds shared SQLite schema, env-gated durable behavior, Gateway/CLI surfaces, and a new Workboard write RPC that affect upgrade and operator expectations.
  • merge-risk: 🚨 session-state: The stack records and projects agent turns, subagent child links, run IDs, session keys, fan-in, recovery state, Task Flow state, and Workboard card metadata.
  • merge-risk: 🚨 availability: The inherited opt-in Gateway startup reconciliation and recovery worker can affect enabled Gateway runtime or recovery behavior.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🧂 unranked krab.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Missing: the PR lists tests but no redacted terminal output, logs, screenshot, recording, or live output showing a durable projection updating a real Workboard card; after adding proof, update the PR body or ask for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +5784, Tests +2280, Docs +14, Generated +306, Other +3. Total +8387 across 49 files.

View PR surface stats
Area Files Added Removed Net
Source 33 5786 2 +5784
Tests 12 2280 0 +2280
Docs 1 14 0 +14
Config 0 0 0 0
Generated 2 306 0 +306
Other 1 4 1 +3
Total 49 8390 3 +8387

What I checked:

  • Live PR state: The PR is open, external-authored, mergeable, and currently includes 49 files because it stacks the durable core, upgrade-safety, coordination-projection, and Workboard adapter slices; the body lists test commands but no real Workboard after-change proof. (17adc19bbe45)
  • Current main lacks durable Workboard projection: A current-main search found no durable workflow implementation or Workboard applyDurableProjection method, so this PR is not implemented on main or obsolete. (527f20f4b5e5)
  • New Workboard write RPC: The PR registers workboard.cards.applyDurableProjection as an operator.write Gateway method that builds a patch from projection data and updates a card. (extensions/workboard/src/gateway.ts:121, 17adc19bbe45)
  • Task Flow state overwrite in stacked diff: The stacked coordination projection code always merges durable metadata into undefined, so every sync supplies a fresh stateJson rather than preserving existing flow state. (src/durable/taskflow-bridge.ts:106, 17adc19bbe45)
  • Current Task Flow patch contract: Current main preserves stateJson only when a patch omits it; supplying a new stateJson replaces the persisted value, making the stacked overwrite source-reproducible. (src/tasks/task-flow-registry.ts:406, 527f20f4b5e5)
  • Future-schema guard runs after mutations: The durable store creates workflow tables/indexes and backfills columns before checking the durable_schema_migrations version, so opening a future-version DB can mutate before throwing. (src/durable/sqlite-store.ts:525, 17adc19bbe45)

Likely related people:

  • steipete: Recent history shows repeated Workboard orchestration, Workboard SQLite, and shared SQLite state changes on the same boundaries this PR extends. (role: recent Workboard and shared-state contributor; confidence: high; commits: 61031d1b1cec, a341ae27ece9, 8d6a6e9d0325; files: extensions/workboard/src/gateway.ts, extensions/workboard/src/store.ts, docs/plugins/workboard.md)
  • vincentkoc: Recent history includes task-backed Workboard runs, Workboard cleanup, and Gateway/session method work adjacent to the new durable and Workboard RPC paths. (role: recent Workboard/Task Flow/Gateway contributor; confidence: high; commits: 82d24b26ea93, 753ff967714c, 5571c786d3df; files: docs/plugins/workboard.md, extensions/workboard/src/store.ts, src/gateway/server-methods/agent.ts)
  • BunsDev: Recent Workboard store/controller work focused on lifecycle status persistence and stale lifecycle updates, directly adjacent to durable projection status writes. (role: recent Workboard lifecycle contributor; confidence: medium; commits: e07dbb27d91f, 60104fe25480; files: extensions/workboard/src/store.ts, extensions/workboard/src/gateway.test.ts)
  • giodl73-repo: Recent shared-state schema work is relevant to the new durable workflow tables inherited by this stack. (role: recent shared-state schema contributor; confidence: medium; commits: d1b917120a47; files: src/state/openclaw-state-schema.sql, src/state/openclaw-state-db.generated.d.ts)
  • ooiuuii: Recent restart-lifecycle work is adjacent to the opt-in durable startup/recovery behavior included in the stack. (role: recent Gateway restart lifecycle contributor; confidence: medium; commits: d20fdf3b3842; files: src/gateway/server-methods/agent.ts, src/cli/gateway-cli/run-loop.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jun 29, 2026
@mjnkao

mjnkao commented Jun 29, 2026

Copy link
Copy Markdown
Author

Automated reviewer stack note:

This is Batch C in the OpenClaw-X durable-core stack. It depends on #97507, #97508, Batch A #97666, and Batch B #97667. GitHub currently shows this PR against main, so the commit list may include dependency commits from prior batches. The intended unique review scope for Batch C is the Workboard durable projection visibility layer after #97667.

Internal mapping: Batch C = internal PR15.

@mjnkao

mjnkao commented Jul 1, 2026

Copy link
Copy Markdown
Author

Closing this follow-up batch for now to reduce reviewer noise while the durable core boundary is resolved in #97507 and #97508. This slice is not abandoned; it will be rebuilt or resubmitted only after the durable core base is accepted.

@mjnkao mjnkao closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. plugin: workboard rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant