Skip to content

fix(authority): fence async execution ownership - #89

Merged
trvon merged 3 commits into
masterfrom
fix/execution-identity-authority
Sep 5, 2026
Merged

fix(authority): fence async execution ownership#89
trvon merged 3 commits into
masterfrom
fix/execution-identity-authority

Conversation

@trvon

@trvon trvon commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • fence delayed orchestration creation and cancellation by Store, actor, runtime, and generation
  • classify malformed successful spawns as uncertain instead of retryable failure
  • require exact workflow execution identity and monitor lease ownership

Validation

  • focused authority suites: 227 tests passed
  • full branch suite: 913 tests passed

Stack

2 of 6. Base: fix/lock-publication-authority.

Copilot AI lite review requested due to automatic review settings September 5, 2026 01:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Two updated error paths can return misleading messages due to validation ordering and broadened attach failure causes, which should be corrected to match the new authority fencing behavior.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR hardens authority boundaries around asynchronous workflow/orchestration operations by fencing mutations to the correct session/runtime context and by requiring exact workflow execution identity for transitions and monitor attachment.

Changes:

  • Require workflow transitions to include the current execution identity (state/seq/revision/execution id) to prevent delayed/stale callers from settling reissued work.
  • Fence orchestration creation/cancellation/expiry paths to the initiating store + actor + generation, and treat malformed spawn “success” as uncertain.
  • Require monitor attachment to match workflow definition/execution identity and to be owned by the current execution lease.
File summaries
File Description
test/workflow-admission.test.ts Updates transition calls to include current workflow identity.
test/store.test.ts Updates workflow transition + monitor attachment tests for identity/lease requirements.
test/scheduler.test.ts Updates scheduler-driven transition/monitor tests to pass identity.
test/orchestration-tools.test.ts Adds regression test for provider probe completing after session rebinding.
test/orchestration-runtime.test.ts Adds fencing tests for delayed cancellation and malformed spawn replies.
test/monitor-tools.test.ts Adds test that a foreign runtime cannot attach a monitor under another lease; updates helper wiring.
test/loop-command.test.ts Updates transition calls to pass current workflow identity.
test/helpers/workflow-identity.ts Adds helpers to capture current workflow/monitor attachment identity from a store entry.
test/astra-identity-store.test.ts Adds file-backed regressions for monitor attachment and transition CAS after reissue.
src/tools/workflow-tools.ts Makes workflow transition identity parameter required in the store-like interface.
src/tools/subagent-orchestration-tools.ts Fences orchestration creation across async provider probing by store/actor/generation.
src/tools/monitor-tools.ts Passes expanded identity + actor into workflow monitor attachment.
src/store.ts Enforces identity checks for transitions; enforces identity + lease ownership for monitor attachment.
src/runtime/subagent-orchestration-runtime.ts Adds fencing for delayed cancellation/expiry and classifies malformed spawn success as uncertain.
src/index.ts Exposes workflow actor (session/runtime) to monitor tools.
Review details

Suppressed comments (1)

src/tools/monitor-tools.ts:138

  • attachWorkflowMonitor can now fail due to lease/identity fencing (not just because the workflow changed). The current error text and summary incorrectly attribute all failures to workflow changes, which can mislead users when the real cause is missing/foreign lease ownership.
      if (!attached) {
        void getMonitorManager().stop(entry.id);
        return Promise.resolve(textResult(`Monitor #${entry.id} stopped because workflow #${workflow.id} changed before ownership could be attached.`, {
          kind: "monitor", action: "create", tone: "error", summary: `Workflow #${workflow.id} changed`, expanded: [],
        }));
  • Files reviewed: 15/15 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/store.ts Outdated
@trvon
trvon force-pushed the fix/execution-identity-authority branch from 0bc7425 to bfcf093 Compare September 5, 2026 02:19
Base automatically changed from fix/lock-publication-authority to master September 5, 2026 02:51
@trvon
trvon force-pushed the fix/execution-identity-authority branch from bfcf093 to 5671a8c Compare September 5, 2026 02:51
@trvon
trvon merged commit e6ead72 into master Sep 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants