@atolis-hq/wake 0.4.103 → 0.4.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/activities/agent/agent-activity.js +3 -0
- package/dist/src/activities/contracts/activity.d.ts +16 -0
- package/dist/src/bootstrap/artifact-mcp.js +20 -1
- package/dist/src/bootstrap/config/root-schema.d.ts +16 -0
- package/dist/src/bootstrap/delegation-authority.js +17 -0
- package/dist/src/bootstrap/surface-api-delivery.js +25 -0
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +3 -1
- package/dist/src/control-plane/application/advance-once-dispatch.js +4 -2
- package/dist/src/execution/application/candidate-workspaces.d.ts +13 -0
- package/dist/src/execution/application/candidate-workspaces.js +75 -0
- package/dist/src/execution/application/execution-service.js +27 -11
- package/dist/src/execution/application/run-lifecycle.js +1 -0
- package/dist/src/execution/contracts/candidate.d.ts +31 -0
- package/dist/src/execution/contracts/candidate.js +40 -0
- package/dist/src/execution/contracts/commands.d.ts +2 -0
- package/dist/src/execution/contracts/events.d.ts +11 -0
- package/dist/src/execution/contracts/events.js +2 -0
- package/dist/src/execution/contracts/repository-assignment.d.ts +5 -0
- package/dist/src/execution/contracts/repository-assignment.js +8 -0
- package/dist/src/execution/contracts/views.d.ts +2 -0
- package/dist/src/execution/contracts/vocabulary.d.ts +5 -0
- package/dist/src/execution/contracts/vocabulary.js +4 -0
- package/dist/src/execution/contracts/workspace.d.ts +6 -0
- package/dist/src/execution/index.d.ts +1 -0
- package/dist/src/execution/index.js +1 -0
- package/dist/src/execution/infrastructure/workspace/git-source.d.ts +2 -2
- package/dist/src/execution/infrastructure/workspace/git-source.js +18 -1
- package/dist/src/execution/infrastructure/workspace/git-workspace.d.ts +2 -4
- package/dist/src/execution/infrastructure/workspace/git-workspace.js +12 -1
- package/dist/src/orchestration/application/conversation-command-reactor.js +25 -0
- package/dist/src/orchestration/application/delegated-work.d.ts +14 -0
- package/dist/src/orchestration/application/delegated-work.js +63 -20
- package/dist/src/orchestration/application/delegation-attention-escalations.d.ts +11 -0
- package/dist/src/orchestration/application/delegation-attention-escalations.js +36 -0
- package/dist/src/orchestration/application/delegation-attention-state.d.ts +53 -0
- package/dist/src/orchestration/application/delegation-attention-state.js +194 -0
- package/dist/src/orchestration/application/delegation-attention.d.ts +58 -0
- package/dist/src/orchestration/application/delegation-attention.js +206 -0
- package/dist/src/orchestration/application/delegation-commands.d.ts +18 -1
- package/dist/src/orchestration/application/delegation-commands.js +18 -1
- package/dist/src/orchestration/application/delegation-gate.d.ts +4 -1
- package/dist/src/orchestration/application/delegation-gate.js +15 -3
- package/dist/src/orchestration/application/delivery-coordinator.d.ts +279 -0
- package/dist/src/orchestration/application/delivery-coordinator.js +213 -0
- package/dist/src/orchestration/application/delivery-facts-reader.d.ts +9 -0
- package/dist/src/orchestration/application/delivery-facts-reader.js +46 -0
- package/dist/src/orchestration/application/delivery-preparation.d.ts +15 -0
- package/dist/src/orchestration/application/delivery-preparation.js +100 -0
- package/dist/src/orchestration/application/delivery-sources.d.ts +10 -0
- package/dist/src/orchestration/application/delivery-sources.js +41 -0
- package/dist/src/orchestration/application/orchestration-repository.d.ts +3 -1
- package/dist/src/orchestration/application/orchestration-repository.js +10 -1
- package/dist/src/orchestration/application/orchestration-service.d.ts +284 -1
- package/dist/src/orchestration/application/orchestration-service.js +71 -5
- package/dist/src/orchestration/contracts/config.d.ts +16 -0
- package/dist/src/orchestration/contracts/config.js +7 -1
- package/dist/src/orchestration/contracts/delegation-ports.d.ts +4 -0
- package/dist/src/orchestration/contracts/delegation.d.ts +76 -2
- package/dist/src/orchestration/contracts/delegation.js +54 -1
- package/dist/src/orchestration/contracts/delivery-ports.d.ts +9 -0
- package/dist/src/orchestration/contracts/delivery-ports.js +1 -0
- package/dist/src/orchestration/contracts/delivery.d.ts +252 -0
- package/dist/src/orchestration/contracts/delivery.js +134 -0
- package/dist/src/orchestration/contracts/event-decoder.js +17 -2
- package/dist/src/orchestration/contracts/event-factory.js +13 -1
- package/dist/src/orchestration/contracts/events.d.ts +23 -1
- package/dist/src/orchestration/contracts/events.js +6 -0
- package/dist/src/orchestration/contracts/views.d.ts +9 -0
- package/dist/src/orchestration/contracts/vocabulary.d.ts +65 -0
- package/dist/src/orchestration/contracts/vocabulary.js +59 -0
- package/dist/src/orchestration/domain/compiler.js +2 -0
- package/dist/src/orchestration/domain/delivery-candidate.d.ts +9 -0
- package/dist/src/orchestration/domain/delivery-candidate.js +92 -0
- package/dist/src/orchestration/domain/delivery-facts.d.ts +83 -0
- package/dist/src/orchestration/domain/delivery-facts.js +34 -0
- package/dist/src/orchestration/domain/delivery-qa.d.ts +32 -0
- package/dist/src/orchestration/domain/delivery-qa.js +77 -0
- package/dist/src/orchestration/domain/delivery-replacement.d.ts +9 -0
- package/dist/src/orchestration/domain/delivery-replacement.js +54 -0
- package/dist/src/orchestration/domain/delivery-selection.d.ts +17 -0
- package/dist/src/orchestration/domain/delivery-selection.js +132 -0
- package/dist/src/orchestration/domain/delivery-workflow-policy.d.ts +4 -0
- package/dist/src/orchestration/domain/delivery-workflow-policy.js +13 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +24 -13
- package/dist/src/orchestration/domain/workflow-instance-events.d.ts +2 -0
- package/dist/src/orchestration/domain/workflow-instance-events.js +39 -0
- package/dist/src/orchestration/index.d.ts +5 -3
- package/dist/src/orchestration/index.js +3 -2
- package/dist/src/surfaces/api/contracts/work.d.ts +16 -0
- package/dist/src/surfaces/mcp/delegation.js +51 -1
- package/dist/src/surfaces/web-assets/assets/index-BfhxlN_h.js +1192 -0
- package/dist/src/surfaces/web-assets/index.html +1 -1
- package/package.json +1 -1
- package/dist/src/surfaces/web-assets/assets/index-C5R-aWzH.js +0 -1192
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ActivityOutcomeKind } from '../../activities/index.js';
|
|
4
|
+
import { DelegationAttentionError, } from '../contracts/delegation.js';
|
|
5
|
+
import { OrchestrationEventType } from '../contracts/events.js';
|
|
6
|
+
import { DelegationAttentionRejection, DelegationBlockerKind, WorkflowStatus, } from '../contracts/vocabulary.js';
|
|
7
|
+
import { isNeedsClarificationResumeEligible } from '../domain/interpreter.js';
|
|
8
|
+
import { delegationDraft } from './delegation-ledger.js';
|
|
9
|
+
export function digest(value) {
|
|
10
|
+
return createHash('sha256').update(value).digest('hex').slice(0, 16);
|
|
11
|
+
}
|
|
12
|
+
export const failedBlockerId = (child) => `${child.grantId}:failed`;
|
|
13
|
+
/** Only a child blocked on an agent clarification (never a human gate) is answerable. */
|
|
14
|
+
export function contextBlockerId(child, view) {
|
|
15
|
+
if (view.status !== WorkflowStatus.Blocked || !isNeedsClarificationResumeEligible(view))
|
|
16
|
+
return undefined;
|
|
17
|
+
const pending = view.pendingActivation;
|
|
18
|
+
return pending === undefined ? undefined : `${child.grantId}:context:${pending.activationId}`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A child parked by its own routing: blocked (for example retries exhausted) or waiting on a
|
|
22
|
+
* human route after a failed outcome. Identified by the activation it is parked on.
|
|
23
|
+
*/
|
|
24
|
+
export function parkedBlockerId(child, view) {
|
|
25
|
+
const pending = view.pendingActivation;
|
|
26
|
+
if (pending === undefined)
|
|
27
|
+
return undefined;
|
|
28
|
+
const parked = view.status === WorkflowStatus.Blocked ||
|
|
29
|
+
(view.status === WorkflowStatus.Waiting &&
|
|
30
|
+
view.waitingFor !== undefined &&
|
|
31
|
+
view.lastOutcome?.kind === ActivityOutcomeKind.Failed);
|
|
32
|
+
return parked ? `${child.grantId}:parked:${pending.activationId}` : undefined;
|
|
33
|
+
}
|
|
34
|
+
/** The unresolved reason for one member, from its recorded blocker or its live workflow state. */
|
|
35
|
+
export function blockerOf(child, recorded, view) {
|
|
36
|
+
const base = { childWorkItemId: child.workItemId };
|
|
37
|
+
if (recorded !== undefined)
|
|
38
|
+
return {
|
|
39
|
+
...base,
|
|
40
|
+
blockerId: failedBlockerId(child),
|
|
41
|
+
kind: DelegationBlockerKind.Failed,
|
|
42
|
+
reason: recorded,
|
|
43
|
+
};
|
|
44
|
+
if (view === null)
|
|
45
|
+
return undefined;
|
|
46
|
+
const context = contextBlockerId(child, view);
|
|
47
|
+
if (context !== undefined)
|
|
48
|
+
return {
|
|
49
|
+
...base,
|
|
50
|
+
blockerId: context,
|
|
51
|
+
kind: DelegationBlockerKind.Context,
|
|
52
|
+
reason: view.blockReason ?? 'Child needs assignment clarification',
|
|
53
|
+
};
|
|
54
|
+
const parked = parkedBlockerId(child, view);
|
|
55
|
+
return parked === undefined
|
|
56
|
+
? undefined
|
|
57
|
+
: {
|
|
58
|
+
...base,
|
|
59
|
+
blockerId: parked,
|
|
60
|
+
kind: DelegationBlockerKind.Failed,
|
|
61
|
+
reason: view.blockReason ?? 'Child is parked after a failed outcome',
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export const MaxAssessmentAttempts = 3;
|
|
65
|
+
const structuredBlockSchema = z
|
|
66
|
+
.object({
|
|
67
|
+
status: z.string().min(1),
|
|
68
|
+
message: z.string().optional(),
|
|
69
|
+
question: z.string().optional(),
|
|
70
|
+
unverifiedCompletionReason: z.string().optional(),
|
|
71
|
+
})
|
|
72
|
+
.passthrough();
|
|
73
|
+
const failureDataSchema = z
|
|
74
|
+
.object({ reason: z.string().optional(), message: z.string().optional() })
|
|
75
|
+
.passthrough();
|
|
76
|
+
/**
|
|
77
|
+
* A structured blocked/needs-clarification result, or a deliberate `FAILED` the agent reports
|
|
78
|
+
* itself, is a human-visible escalation. A failed, rejected or infrastructure-blocked run (runner
|
|
79
|
+
* failure, authentication, ambiguous or unverified completion) is only a failed assessment: it
|
|
80
|
+
* must never cancel or settle the cohort.
|
|
81
|
+
*/
|
|
82
|
+
export function attentionVerdict(outcome) {
|
|
83
|
+
if (outcome.kind === ActivityOutcomeKind.Done)
|
|
84
|
+
return {};
|
|
85
|
+
const question = humanQuestion(outcome);
|
|
86
|
+
return question === undefined
|
|
87
|
+
? { failure: runFailure(outcome) }
|
|
88
|
+
: { escalation: question, outcome };
|
|
89
|
+
}
|
|
90
|
+
/** The agent's own structured block or failure, unless the run could not verify completion. */
|
|
91
|
+
function humanQuestion(outcome) {
|
|
92
|
+
if (outcome.kind !== ActivityOutcomeKind.Blocked && outcome.kind !== ActivityOutcomeKind.Failed)
|
|
93
|
+
return undefined;
|
|
94
|
+
const parsed = structuredBlockSchema.safeParse(outcome.data);
|
|
95
|
+
if (!parsed.success || parsed.data.unverifiedCompletionReason !== undefined)
|
|
96
|
+
return undefined;
|
|
97
|
+
return parsed.data.question ?? parsed.data.message ?? parsed.data.status;
|
|
98
|
+
}
|
|
99
|
+
function runFailure(outcome) {
|
|
100
|
+
const structured = structuredBlockSchema.safeParse(outcome.data);
|
|
101
|
+
if (structured.success && structured.data.unverifiedCompletionReason !== undefined)
|
|
102
|
+
return structured.data.unverifiedCompletionReason;
|
|
103
|
+
const detail = failureDataSchema.safeParse(outcome.data);
|
|
104
|
+
return (detail.success ? (detail.data.reason ?? detail.data.message) : undefined) ?? outcome.kind;
|
|
105
|
+
}
|
|
106
|
+
/** Resolution never settles the cohort: it restores the wait, with the outcome when it asks a human. */
|
|
107
|
+
export function resolutionDrafts(context, parentId, attention, verdict) {
|
|
108
|
+
const drafts = [];
|
|
109
|
+
if (verdict.escalation !== undefined && verdict.outcome !== undefined)
|
|
110
|
+
drafts.push(delegationDraft(context, `attention-outcome:${attention.activationId}`, {
|
|
111
|
+
eventType: OrchestrationEventType.ActivityOutcomeAccepted,
|
|
112
|
+
payload: { activationId: attention.activationId, outcome: verdict.outcome },
|
|
113
|
+
}, parentId));
|
|
114
|
+
drafts.push(delegationDraft(context, `attention-resolved:${attention.activationId}`, {
|
|
115
|
+
eventType: OrchestrationEventType.DelegationAttentionResolved,
|
|
116
|
+
payload: {
|
|
117
|
+
cohortId: attention.cohortId,
|
|
118
|
+
attentionKey: attention.attentionKey,
|
|
119
|
+
activationId: attention.activationId,
|
|
120
|
+
...(verdict.escalation === undefined ? {} : { escalation: verdict.escalation }),
|
|
121
|
+
...(verdict.failure === undefined ? {} : { assessmentFailure: verdict.failure }),
|
|
122
|
+
},
|
|
123
|
+
}, parentId));
|
|
124
|
+
if (verdict.failure !== undefined)
|
|
125
|
+
drafts.push(delegationDraft(context, `attention-failed:${attention.activationId}`, {
|
|
126
|
+
eventType: OrchestrationEventType.DelegationReconciliationFailed,
|
|
127
|
+
payload: {
|
|
128
|
+
cohortId: attention.cohortId,
|
|
129
|
+
reason: `Parent attention assessment failed (${verdict.failure}); the cohort is unchanged`,
|
|
130
|
+
},
|
|
131
|
+
}, parentId));
|
|
132
|
+
// The last allowed retry leaves one inspectable operator escalation, not a quiet stop.
|
|
133
|
+
if (verdict.failure !== undefined && verdict.exhausted === true)
|
|
134
|
+
drafts.push(delegationDraft(context, `attention-exhausted:${digest(attention.attentionKey)}`, {
|
|
135
|
+
eventType: OrchestrationEventType.DelegationReconciliationFailed,
|
|
136
|
+
payload: {
|
|
137
|
+
cohortId: attention.cohortId,
|
|
138
|
+
reason: `Parent attention assessment failed ${MaxAssessmentAttempts} times (${verdict.failure}); an operator must inspect the blockers`,
|
|
139
|
+
},
|
|
140
|
+
}, parentId));
|
|
141
|
+
return drafts;
|
|
142
|
+
}
|
|
143
|
+
/** Blockers already put to a parent assessment; each is raised once, never polled. */
|
|
144
|
+
export function assessedBlockers(events, reservation) {
|
|
145
|
+
const ours = events.filter(({ stream, event }) => stream.id === reservation.parentWorkflowInstanceId &&
|
|
146
|
+
'cohortId' in event.payload &&
|
|
147
|
+
event.payload.cohortId === reservation.cohortId);
|
|
148
|
+
// A failed assessment run leaves its blockers unassessed so a later pass re-raises them, but
|
|
149
|
+
// only a bounded number of times: repeated failures stay visible as diagnostics, never a loop.
|
|
150
|
+
const failures = new Map();
|
|
151
|
+
const resolved = new Set();
|
|
152
|
+
for (const { event } of ours) {
|
|
153
|
+
if (event.eventType !== OrchestrationEventType.DelegationAttentionResolved)
|
|
154
|
+
continue;
|
|
155
|
+
const key = event.payload.attentionKey;
|
|
156
|
+
if (event.payload.assessmentFailure === undefined)
|
|
157
|
+
resolved.add(key);
|
|
158
|
+
else {
|
|
159
|
+
failures.set(key, (failures.get(key) ?? 0) + 1);
|
|
160
|
+
if ((failures.get(key) ?? 0) >= MaxAssessmentAttempts)
|
|
161
|
+
resolved.add(key);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return new Set(ours.flatMap(({ event }) => event.eventType === OrchestrationEventType.DelegationAttentionRequested &&
|
|
165
|
+
resolved.has(event.payload.attentionKey)
|
|
166
|
+
? event.payload.blockers.map((blocker) => blocker.blockerId)
|
|
167
|
+
: []));
|
|
168
|
+
}
|
|
169
|
+
export function attentionKeyOf(reservation, blockerIds) {
|
|
170
|
+
return `${reservation.cohortId}@${reservation.planRevision ?? 1}:${[...blockerIds].sort().join(',')}`;
|
|
171
|
+
}
|
|
172
|
+
export function reject(code, message) {
|
|
173
|
+
return new DelegationAttentionError(code, message);
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Every boundary Wake relies on before accepting a reply: the Run-bound activation, the exact
|
|
177
|
+
* blocker and its kind, and the assignment revision. Returns the earlier identical reply, if any.
|
|
178
|
+
*/
|
|
179
|
+
export function assertReplyAllowed(parent, attention, caller, reply) {
|
|
180
|
+
if (attention === null || parent.delegationAttention?.activationId !== caller.activationId)
|
|
181
|
+
throw reject(DelegationAttentionRejection.NoAttention, 'No parent attention is open for this activation');
|
|
182
|
+
const blocker = attention.blockers.find((entry) => entry.blockerId === reply.blockerId && entry.childWorkItemId === reply.childWorkItemId);
|
|
183
|
+
if (blocker === undefined)
|
|
184
|
+
throw reject(DelegationAttentionRejection.UnknownBlocker, 'The reply names a child or blocker outside this attention request');
|
|
185
|
+
// Terminal failures and human-only gates are never answered through this channel.
|
|
186
|
+
if (blocker.kind !== DelegationBlockerKind.Context)
|
|
187
|
+
throw reject(DelegationAttentionRejection.NotAnswerable, 'Only an assignment-context blocker accepts a reply; use follow-up work or escalate');
|
|
188
|
+
if (reply.expectedRevision !== attention.revision)
|
|
189
|
+
throw reject(DelegationAttentionRejection.StaleRevision, 'The assignment revision changed; inspect before replying');
|
|
190
|
+
const prior = attention.responses.find((entry) => entry.blockerId === reply.blockerId);
|
|
191
|
+
if (prior !== undefined && JSON.stringify(prior.references) !== JSON.stringify(reply.references))
|
|
192
|
+
throw reject(DelegationAttentionRejection.Duplicate, 'This blocker already has a different accepted reply');
|
|
193
|
+
return prior;
|
|
194
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type CommandContext } from '@atolis-hq/eventing';
|
|
2
|
+
import { type ActivityName } from '../../activities/index.js';
|
|
3
|
+
import type { DelegationArtifacts } from '../contracts/delegation-ports.js';
|
|
4
|
+
import type { DelegationAttentionBlocker, DelegationAttentionReply, DelegationCaller, DelegationReservation } from '../contracts/delegation.js';
|
|
5
|
+
import { type WorkflowOrchestrationEvent } from '../contracts/events.js';
|
|
6
|
+
import type { WorkflowInstanceId } from '../contracts/identifiers.js';
|
|
7
|
+
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
8
|
+
import { type AttentionVerdict, type OpenAttention } from './delegation-attention-state.js';
|
|
9
|
+
import { type DelegationLedger } from './delegation-ledger.js';
|
|
10
|
+
import type { OrchestrationRepository } from './orchestration-repository.js';
|
|
11
|
+
export interface DelegationAttentionDependencies {
|
|
12
|
+
readonly artifacts: DelegationArtifacts;
|
|
13
|
+
/** True when the delegating activity can handle a typed attention activation. */
|
|
14
|
+
readonly supportsAttention: (activity: ActivityName) => boolean;
|
|
15
|
+
/** Resumes a child workflow blocked for clarification; idempotent per command id. */
|
|
16
|
+
readonly resumeChild: (id: WorkflowInstanceId, context: CommandContext) => Promise<WorkflowInstanceView | null>;
|
|
17
|
+
/** Work items whose artifacts the parent may reference (its own hierarchy). */
|
|
18
|
+
readonly contextWorkItems: (parent: WorkflowInstanceView) => Promise<ReadonlySet<string>>;
|
|
19
|
+
/** Run end and delivery availability gate every attention continuation, like the join. */
|
|
20
|
+
readonly canContinue: (reservation: DelegationReservation) => Promise<boolean>;
|
|
21
|
+
}
|
|
22
|
+
/** Durable cohort/blocker state for the parent attention protocol. */
|
|
23
|
+
export declare class DelegationAttention {
|
|
24
|
+
private readonly repository;
|
|
25
|
+
private readonly ledger;
|
|
26
|
+
private readonly dependencies;
|
|
27
|
+
constructor(repository: OrchestrationRepository, ledger: DelegationLedger, dependencies: DelegationAttentionDependencies);
|
|
28
|
+
/** Unresolved reasons for the cohort: recorded child blockers plus live clarification requests. */
|
|
29
|
+
blockers(reservation: DelegationReservation, events: readonly WorkflowOrchestrationEvent[]): Promise<DelegationAttentionBlocker[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Starts one coalesced assessment at the delegating stage when an unassessed reason exists.
|
|
32
|
+
* Join and attention share the parent's single activation: this only acts from the cohort wait.
|
|
33
|
+
* Callers settle fully terminal batches through the ordinary unsuccessful continuation instead.
|
|
34
|
+
*/
|
|
35
|
+
raise(reservation: DelegationReservation, context: CommandContext): Promise<void>;
|
|
36
|
+
/** Only the parked cohort wait may start an assessment; a running one coalesces new reasons. */
|
|
37
|
+
private canRequest;
|
|
38
|
+
/** Returns false when a concurrent append won and the caller must re-read. */
|
|
39
|
+
private request;
|
|
40
|
+
/** The open attention request for a parent, with the replies already accepted. */
|
|
41
|
+
current(parent: WorkflowInstanceView): Promise<OpenAttention | null>;
|
|
42
|
+
/**
|
|
43
|
+
* Accepts a parent reply for one context blocker. Everything Wake relies on is re-derived here;
|
|
44
|
+
* a restart replays an accepted reply to completion because each step is idempotent.
|
|
45
|
+
*/
|
|
46
|
+
respond(caller: DelegationCaller, reply: DelegationAttentionReply, context: CommandContext): Promise<void>;
|
|
47
|
+
/** Ends the assessment and restores the unresolved wait; a pending join then proceeds. */
|
|
48
|
+
resolve(parentId: WorkflowInstanceId, attentionActivation: string, context: CommandContext, verdict?: AttentionVerdict): Promise<WorkflowInstanceView>;
|
|
49
|
+
private priorFailures;
|
|
50
|
+
/**
|
|
51
|
+
* Children whose assignment-context blocker the parent escalated to a human and which are still
|
|
52
|
+
* blocked on it. A human reply on the parent is routed to exactly these, so a published question
|
|
53
|
+
* always has an answer path that moves the delivery without settling or joining the cohort.
|
|
54
|
+
*/
|
|
55
|
+
escalatedTargets(parent: WorkflowInstanceView): Promise<readonly {
|
|
56
|
+
readonly childWorkItemId: string;
|
|
57
|
+
}[]>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { WrongExpectedSequenceError } from '@atolis-hq/eventing';
|
|
2
|
+
import { activationId } from '../../activities/index.js';
|
|
3
|
+
import { OrchestrationEventType } from '../contracts/events.js';
|
|
4
|
+
import { DelegationAttentionRejection, WorkflowStatus } from '../contracts/vocabulary.js';
|
|
5
|
+
import { nextOrdinal } from '../domain/decision-events.js';
|
|
6
|
+
import { escalatedTargets } from './delegation-attention-escalations.js';
|
|
7
|
+
import { assertReplyAllowed, assessedBlockers, attentionKeyOf, blockerOf, contextBlockerId, digest, MaxAssessmentAttempts, reject, resolutionDrafts, } from './delegation-attention-state.js';
|
|
8
|
+
import { delegationDraft, isSettled } from './delegation-ledger.js';
|
|
9
|
+
/** Durable cohort/blocker state for the parent attention protocol. */
|
|
10
|
+
export class DelegationAttention {
|
|
11
|
+
repository;
|
|
12
|
+
ledger;
|
|
13
|
+
dependencies;
|
|
14
|
+
constructor(repository, ledger, dependencies) {
|
|
15
|
+
this.repository = repository;
|
|
16
|
+
this.ledger = ledger;
|
|
17
|
+
this.dependencies = dependencies;
|
|
18
|
+
}
|
|
19
|
+
/** Unresolved reasons for the cohort: recorded child blockers plus live clarification requests. */
|
|
20
|
+
async blockers(reservation, events) {
|
|
21
|
+
const blockers = [];
|
|
22
|
+
for (const child of reservation.children) {
|
|
23
|
+
const recorded = events.flatMap(({ event }) => event.eventType === OrchestrationEventType.DelegationChildBlocked &&
|
|
24
|
+
event.payload.childWorkItemId === child.workItemId
|
|
25
|
+
? [event.payload.reason]
|
|
26
|
+
: [])[0];
|
|
27
|
+
const view = recorded === undefined ? (await this.repository.load(child.workflowInstanceId)).view : null;
|
|
28
|
+
const blocker = blockerOf(child, recorded, view);
|
|
29
|
+
if (blocker !== undefined)
|
|
30
|
+
blockers.push(blocker);
|
|
31
|
+
}
|
|
32
|
+
return blockers;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Starts one coalesced assessment at the delegating stage when an unassessed reason exists.
|
|
36
|
+
* Join and attention share the parent's single activation: this only acts from the cohort wait.
|
|
37
|
+
* Callers settle fully terminal batches through the ordinary unsuccessful continuation instead.
|
|
38
|
+
*/
|
|
39
|
+
async raise(reservation, context) {
|
|
40
|
+
const events = await this.ledger.events();
|
|
41
|
+
if (isSettled(events, reservation))
|
|
42
|
+
return;
|
|
43
|
+
const blockers = await this.blockers(reservation, events);
|
|
44
|
+
const assessed = assessedBlockers(events, reservation);
|
|
45
|
+
if (!blockers.some((blocker) => !assessed.has(blocker.blockerId)))
|
|
46
|
+
return;
|
|
47
|
+
if (!(await this.dependencies.canContinue(reservation)))
|
|
48
|
+
return;
|
|
49
|
+
const attentionKey = attentionKeyOf(reservation, blockers.map((blocker) => blocker.blockerId));
|
|
50
|
+
for (;;) {
|
|
51
|
+
const loaded = await this.repository.loadRequired(reservation.parentWorkflowInstanceId);
|
|
52
|
+
if (!this.canRequest(loaded.view, reservation))
|
|
53
|
+
return;
|
|
54
|
+
if (await this.request(reservation, loaded, { attentionKey, blockers }, context))
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Only the parked cohort wait may start an assessment; a running one coalesces new reasons. */
|
|
59
|
+
canRequest(view, reservation) {
|
|
60
|
+
return (view.status === WorkflowStatus.Waiting &&
|
|
61
|
+
view.delegationWait?.cohortId === reservation.cohortId &&
|
|
62
|
+
view.delegationAttention === undefined);
|
|
63
|
+
}
|
|
64
|
+
/** Returns false when a concurrent append won and the caller must re-read. */
|
|
65
|
+
async request(reservation, loaded, input, context) {
|
|
66
|
+
const id = reservation.parentWorkflowInstanceId;
|
|
67
|
+
const { events } = await this.repository.history(id);
|
|
68
|
+
const original = events.find((entry) => entry.event.eventType === OrchestrationEventType.ActivityRequested &&
|
|
69
|
+
entry.event.payload.activationId === reservation.activationId);
|
|
70
|
+
if (original?.event.eventType !== OrchestrationEventType.ActivityRequested)
|
|
71
|
+
throw new Error('Missing delegating activation');
|
|
72
|
+
const requested = original.event.payload;
|
|
73
|
+
const keyId = digest(input.attentionKey);
|
|
74
|
+
if (!this.dependencies.supportsAttention(requested.activity)) {
|
|
75
|
+
await this.ledger.appendOnce(id, context, `attention-unsupported:${keyId}`, {
|
|
76
|
+
eventType: OrchestrationEventType.DelegationReconciliationFailed,
|
|
77
|
+
payload: {
|
|
78
|
+
cohortId: reservation.cohortId,
|
|
79
|
+
reason: 'Child work needs attention but the delegating activity cannot assess it; ' +
|
|
80
|
+
'an operator must inspect the blockers',
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
const ordinal = nextOrdinal(loaded.view);
|
|
86
|
+
const attentionActivation = activationId(`${id}:activity:${ordinal}`);
|
|
87
|
+
try {
|
|
88
|
+
await this.repository.append(id, loaded.sequence, [
|
|
89
|
+
delegationDraft(context, `attention:${keyId}:${ordinal}`, {
|
|
90
|
+
eventType: OrchestrationEventType.DelegationAttentionRequested,
|
|
91
|
+
payload: {
|
|
92
|
+
cohortId: reservation.cohortId,
|
|
93
|
+
attentionKey: input.attentionKey,
|
|
94
|
+
activationId: attentionActivation,
|
|
95
|
+
revision: reservation.planRevision ?? 1,
|
|
96
|
+
blockers: input.blockers,
|
|
97
|
+
},
|
|
98
|
+
}, id),
|
|
99
|
+
delegationDraft(context, `attention-activity:${keyId}:${ordinal}`, {
|
|
100
|
+
eventType: OrchestrationEventType.ActivityRequested,
|
|
101
|
+
payload: {
|
|
102
|
+
...requested,
|
|
103
|
+
activationId: attentionActivation,
|
|
104
|
+
ordinal,
|
|
105
|
+
sessionPolicy: 'fresh',
|
|
106
|
+
},
|
|
107
|
+
}, id),
|
|
108
|
+
]);
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
if (error instanceof WrongExpectedSequenceError)
|
|
113
|
+
return false;
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/** The open attention request for a parent, with the replies already accepted. */
|
|
118
|
+
async current(parent) {
|
|
119
|
+
const attention = parent.delegationAttention;
|
|
120
|
+
if (attention === undefined)
|
|
121
|
+
return null;
|
|
122
|
+
const { events } = await this.repository.history(parent.workflowInstanceId);
|
|
123
|
+
const request = events.flatMap(({ event }) => event.eventType === OrchestrationEventType.DelegationAttentionRequested &&
|
|
124
|
+
event.payload.attentionKey === attention.attentionKey
|
|
125
|
+
? [event.payload]
|
|
126
|
+
: [])[0];
|
|
127
|
+
if (request === undefined)
|
|
128
|
+
return null;
|
|
129
|
+
const responses = events.flatMap(({ event }) => event.eventType === OrchestrationEventType.DelegationAttentionResponded &&
|
|
130
|
+
event.payload.attentionKey === attention.attentionKey
|
|
131
|
+
? [event.payload]
|
|
132
|
+
: []);
|
|
133
|
+
return { ...request, responses };
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Accepts a parent reply for one context blocker. Everything Wake relies on is re-derived here;
|
|
137
|
+
* a restart replays an accepted reply to completion because each step is idempotent.
|
|
138
|
+
*/
|
|
139
|
+
async respond(caller, reply, context) {
|
|
140
|
+
const parent = (await this.repository.loadRequired(caller.workflowInstanceId)).view;
|
|
141
|
+
const attention = await this.current(parent);
|
|
142
|
+
const prior = assertReplyAllowed(parent, attention, caller, reply);
|
|
143
|
+
const reservation = (await this.ledger.reservations()).find((entry) => entry.parentWorkflowInstanceId === parent.workflowInstanceId &&
|
|
144
|
+
entry.cohortId === attention.cohortId);
|
|
145
|
+
const child = reservation?.children.find((entry) => entry.workItemId === reply.childWorkItemId);
|
|
146
|
+
if (reservation === undefined || child === undefined)
|
|
147
|
+
throw reject(DelegationAttentionRejection.UnknownBlocker, 'Unknown delegated child');
|
|
148
|
+
const allowed = await this.dependencies.contextWorkItems(parent);
|
|
149
|
+
if (reply.references.some((reference) => !allowed.has(reference.workItemId)))
|
|
150
|
+
throw reject(DelegationAttentionRejection.OutsideHierarchy, 'Delegation context is outside the parent hierarchy');
|
|
151
|
+
const childView = (await this.repository.load(child.workflowInstanceId)).view;
|
|
152
|
+
const stillBlocked = childView !== null && contextBlockerId(child, childView) === reply.blockerId;
|
|
153
|
+
if (!stillBlocked && prior === undefined)
|
|
154
|
+
throw reject(DelegationAttentionRejection.NotBlocked, 'The child is no longer blocked for this assignment context');
|
|
155
|
+
await this.dependencies.artifacts.validateInputs(parent, reply.references);
|
|
156
|
+
const key = digest(reply.blockerId);
|
|
157
|
+
await this.ledger.appendOnce(parent.workflowInstanceId, context, `response:${key}`, {
|
|
158
|
+
eventType: OrchestrationEventType.DelegationAttentionResponded,
|
|
159
|
+
payload: { cohortId: attention.cohortId, attentionKey: attention.attentionKey, ...reply },
|
|
160
|
+
});
|
|
161
|
+
await this.dependencies.artifacts.registerChild({
|
|
162
|
+
delegationId: `${child.grantId}:response:${key}`,
|
|
163
|
+
parentWorkItemId: reservation.parentWorkItemId,
|
|
164
|
+
childWorkItemId: child.workItemId,
|
|
165
|
+
childReferences: reply.references,
|
|
166
|
+
}, context);
|
|
167
|
+
if (stillBlocked)
|
|
168
|
+
await this.dependencies.resumeChild(child.workflowInstanceId, {
|
|
169
|
+
...context,
|
|
170
|
+
commandId: `delegation-response:${key}`,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/** Ends the assessment and restores the unresolved wait; a pending join then proceeds. */
|
|
174
|
+
async resolve(parentId, attentionActivation, context, verdict = {}) {
|
|
175
|
+
for (;;) {
|
|
176
|
+
const loaded = await this.repository.loadRequired(parentId);
|
|
177
|
+
const attention = loaded.view.delegationAttention;
|
|
178
|
+
if (attention === undefined || attention.activationId !== attentionActivation)
|
|
179
|
+
return loaded.view;
|
|
180
|
+
const exhausted = verdict.failure !== undefined &&
|
|
181
|
+
(await this.priorFailures(parentId, attention.attentionKey)) + 1 >= MaxAssessmentAttempts;
|
|
182
|
+
try {
|
|
183
|
+
await this.repository.append(parentId, loaded.sequence, resolutionDrafts(context, parentId, attention, { ...verdict, exhausted }));
|
|
184
|
+
return (await this.repository.loadRequired(parentId)).view;
|
|
185
|
+
}
|
|
186
|
+
catch (error) {
|
|
187
|
+
if (!(error instanceof WrongExpectedSequenceError))
|
|
188
|
+
throw error;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async priorFailures(parentId, attentionKey) {
|
|
193
|
+
const { events } = await this.repository.history(parentId);
|
|
194
|
+
return events.filter(({ event }) => event.eventType === OrchestrationEventType.DelegationAttentionResolved &&
|
|
195
|
+
event.payload.attentionKey === attentionKey &&
|
|
196
|
+
event.payload.assessmentFailure !== undefined).length;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Children whose assignment-context blocker the parent escalated to a human and which are still
|
|
200
|
+
* blocked on it. A human reply on the parent is routed to exactly these, so a published question
|
|
201
|
+
* always has an answer path that moves the delivery without settling or joining the cohort.
|
|
202
|
+
*/
|
|
203
|
+
escalatedTargets(parent) {
|
|
204
|
+
return escalatedTargets(this.repository, this.ledger, parent);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommandContext } from '@atolis-hq/eventing';
|
|
2
2
|
import type { WorkService } from '../../work/index.js';
|
|
3
3
|
import type { DelegationAuthority } from '../contracts/delegation-ports.js';
|
|
4
|
-
import { type DelegationCaller, type DelegationSubmission } from '../contracts/delegation.js';
|
|
4
|
+
import { type DelegationAttentionReply, type DelegationCaller, type DelegationSubmission } from '../contracts/delegation.js';
|
|
5
5
|
import type { WorkflowInstanceView } from '../contracts/views.js';
|
|
6
6
|
import type { DelegatedWork } from './delegated-work.js';
|
|
7
7
|
import type { OrchestrationRepository } from './orchestration-repository.js';
|
|
@@ -56,6 +56,10 @@ export declare class DelegationCommands {
|
|
|
56
56
|
cohortId?: string | undefined;
|
|
57
57
|
useAsBase?: boolean | undefined;
|
|
58
58
|
}[] | undefined;
|
|
59
|
+
replaces?: {
|
|
60
|
+
cohortId: string;
|
|
61
|
+
assignmentId: string;
|
|
62
|
+
} | undefined;
|
|
59
63
|
repository?: {
|
|
60
64
|
resourceId: string;
|
|
61
65
|
sourceRef: string;
|
|
@@ -67,6 +71,9 @@ export declare class DelegationCommands {
|
|
|
67
71
|
planRevision?: number | undefined;
|
|
68
72
|
maxConcurrentRuns?: number | undefined;
|
|
69
73
|
}>;
|
|
74
|
+
/** Run-bound reply to a coalesced attention request; authority is the caller's own activation. */
|
|
75
|
+
respond(caller: DelegationCaller, input: DelegationAttentionReply, context: CommandContext): Promise<import("./delegation-attention-state.js").OpenAttention | null>;
|
|
76
|
+
private attentionView;
|
|
70
77
|
inspect(caller: DelegationCaller, context: CommandContext): Promise<{
|
|
71
78
|
policy: {
|
|
72
79
|
workflows: string[];
|
|
@@ -74,9 +81,15 @@ export declare class DelegationCommands {
|
|
|
74
81
|
maxDescendants: number;
|
|
75
82
|
maxConcurrentRuns: number;
|
|
76
83
|
repositories?: string[] | undefined;
|
|
84
|
+
completion?: "qa-approved" | "merge-required" | undefined;
|
|
85
|
+
qa?: {
|
|
86
|
+
stage: string;
|
|
87
|
+
recipe?: string | undefined;
|
|
88
|
+
} | undefined;
|
|
77
89
|
} | null;
|
|
78
90
|
repositories: string[];
|
|
79
91
|
planRevision: number;
|
|
92
|
+
attention: import("./delegation-attention-state.js").OpenAttention | null;
|
|
80
93
|
tree: {
|
|
81
94
|
settled: boolean;
|
|
82
95
|
failureReason: string | undefined;
|
|
@@ -139,6 +152,10 @@ export declare class DelegationCommands {
|
|
|
139
152
|
cohortId?: string | undefined;
|
|
140
153
|
useAsBase?: boolean | undefined;
|
|
141
154
|
}[] | undefined;
|
|
155
|
+
replaces?: {
|
|
156
|
+
cohortId: string;
|
|
157
|
+
assignmentId: string;
|
|
158
|
+
} | undefined;
|
|
142
159
|
repository?: {
|
|
143
160
|
resourceId: string;
|
|
144
161
|
sourceRef: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { delegationSubmissionSchema, } from '../contracts/delegation.js';
|
|
1
|
+
import { delegationAttentionReplySchema, delegationSubmissionSchema, } from '../contracts/delegation.js';
|
|
2
2
|
import { WorkflowStatus } from '../contracts/vocabulary.js';
|
|
3
3
|
/** Agent inputs describe work; authority comes from the current Run and workflow. */
|
|
4
4
|
export class DelegationCommands {
|
|
@@ -62,6 +62,21 @@ export class DelegationCommands {
|
|
|
62
62
|
maxConcurrentRuns: policy.maxConcurrentRuns,
|
|
63
63
|
}, command.expectedPlanRevision);
|
|
64
64
|
}
|
|
65
|
+
/** Run-bound reply to a coalesced attention request; authority is the caller's own activation. */
|
|
66
|
+
async respond(caller, input, context) {
|
|
67
|
+
const reply = delegationAttentionReplySchema.parse(input);
|
|
68
|
+
const parent = (await this.repository.loadRequired(caller.workflowInstanceId)).view;
|
|
69
|
+
await this.authority.assertCaller(caller, parent);
|
|
70
|
+
const availability = (await this.work.deliverySnapshot()).availability(parent.workItemId);
|
|
71
|
+
if (availability.reason !== undefined)
|
|
72
|
+
throw new Error(availability.reason);
|
|
73
|
+
await this.delegated.attention.respond(caller, reply, context);
|
|
74
|
+
return this.attentionView(caller.workflowInstanceId);
|
|
75
|
+
}
|
|
76
|
+
async attentionView(id) {
|
|
77
|
+
const parent = (await this.repository.loadRequired(id)).view;
|
|
78
|
+
return this.delegated.attention.current(parent);
|
|
79
|
+
}
|
|
65
80
|
async inspect(caller, context) {
|
|
66
81
|
const parent = (await this.repository.loadRequired(caller.workflowInstanceId)).view;
|
|
67
82
|
await this.authority.assertCaller(caller, parent);
|
|
@@ -72,6 +87,8 @@ export class DelegationCommands {
|
|
|
72
87
|
// Resource IDs an explicit repository selection may name; empty when none is authorized.
|
|
73
88
|
repositories: policy === undefined ? [] : (await this.scopeFor(parent, policy, context)).permitted,
|
|
74
89
|
planRevision: tree.length,
|
|
90
|
+
// The open coalesced assessment for this activation, if any; replies name its blockers.
|
|
91
|
+
attention: await this.delegated.attention.current(parent),
|
|
75
92
|
tree,
|
|
76
93
|
};
|
|
77
94
|
}
|
|
@@ -15,11 +15,14 @@ export declare class DelegationGate {
|
|
|
15
15
|
/** Commit-boundary check for one instance; batches use `filterAvailable`. */
|
|
16
16
|
unavailable(view: WorkflowInstanceView): Promise<boolean>;
|
|
17
17
|
allows(view: WorkflowInstanceView): boolean;
|
|
18
|
+
/** The attention activation is the one parent activation a fenced cohort may dispatch. */
|
|
19
|
+
private dispatchable;
|
|
18
20
|
fenced(id: WorkflowInstanceId): Promise<boolean>;
|
|
19
21
|
/** The subset of `ids` whose workflow is fenced or held, against one Work synchronisation. */
|
|
20
22
|
fencedAmong(ids: readonly WorkflowInstanceId[]): Promise<ReadonlySet<WorkflowInstanceId>>;
|
|
21
23
|
run<T>(id: WorkflowInstanceId, operation: () => Promise<T>): Promise<T>;
|
|
22
|
-
outcome<T>(id: WorkflowInstanceId, activationId: ActivationId, operation: () => Promise<T>, held: () => Promise<T>, historical: (view: WorkflowInstanceView) => Promise<T>): Promise<T>;
|
|
24
|
+
outcome<T>(id: WorkflowInstanceId, activationId: ActivationId, operation: () => Promise<T>, held: () => Promise<T>, historical: (view: WorkflowInstanceView) => Promise<T>, attention?: () => Promise<T>): Promise<T>;
|
|
25
|
+
private fencedOutcome;
|
|
23
26
|
/**
|
|
24
27
|
* Admits the items whose workflow may advance, against one synchronisation
|
|
25
28
|
* with Work however many items there are. Nothing is read when none are
|
|
@@ -28,6 +28,12 @@ export class DelegationGate {
|
|
|
28
28
|
allows(view) {
|
|
29
29
|
return view.delegationFence === undefined;
|
|
30
30
|
}
|
|
31
|
+
/** The attention activation is the one parent activation a fenced cohort may dispatch. */
|
|
32
|
+
dispatchable(view) {
|
|
33
|
+
return (this.allows(view) ||
|
|
34
|
+
(view.delegationAttention !== undefined &&
|
|
35
|
+
view.delegationAttention.activationId === view.pendingActivation?.activationId));
|
|
36
|
+
}
|
|
31
37
|
async fenced(id) {
|
|
32
38
|
const view = (await this.repository.load(id)).view;
|
|
33
39
|
return view !== null && (!this.allows(view) || (await this.unavailable(view)));
|
|
@@ -55,7 +61,7 @@ export class DelegationGate {
|
|
|
55
61
|
throw new DelegationPendingError(id);
|
|
56
62
|
return operation();
|
|
57
63
|
}
|
|
58
|
-
async outcome(id, activationId, operation, held, historical) {
|
|
64
|
+
async outcome(id, activationId, operation, held, historical, attention) {
|
|
59
65
|
const view = (await this.repository.load(id)).view;
|
|
60
66
|
if (view === null)
|
|
61
67
|
return operation();
|
|
@@ -67,10 +73,16 @@ export class DelegationGate {
|
|
|
67
73
|
return historical(view);
|
|
68
74
|
if (admission?.reason !== undefined)
|
|
69
75
|
throw new DelegationPendingError(id);
|
|
76
|
+
// An attention outcome restores the cohort wait; it never reaches ordinary routing.
|
|
77
|
+
if (attention !== undefined && view.delegationAttention?.activationId === activationId)
|
|
78
|
+
return attention();
|
|
79
|
+
return this.fencedOutcome(view, activationId, operation, held);
|
|
80
|
+
}
|
|
81
|
+
fencedOutcome(view, activationId, operation, held) {
|
|
70
82
|
if (this.allows(view))
|
|
71
83
|
return operation();
|
|
72
84
|
if (view.delegationFence?.activationId !== activationId)
|
|
73
|
-
throw new DelegationPendingError(
|
|
85
|
+
throw new DelegationPendingError(view.workflowInstanceId);
|
|
74
86
|
return held();
|
|
75
87
|
}
|
|
76
88
|
/**
|
|
@@ -81,7 +93,7 @@ export class DelegationGate {
|
|
|
81
93
|
async filterAvailable(items, viewOf) {
|
|
82
94
|
const unfenced = items.filter((item) => {
|
|
83
95
|
const view = viewOf(item);
|
|
84
|
-
return view !== null && this.
|
|
96
|
+
return view !== null && this.dispatchable(view);
|
|
85
97
|
});
|
|
86
98
|
if (unfenced.length === 0)
|
|
87
99
|
return [];
|