@ordewell/core 0.12.1 → 0.12.3
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/{ModeResolver-CA2fUU9h.d.mts → ModeResolver-CkZnbIqs.d.mts} +1 -1
- package/dist/{ModeResolver-B64aUZXJ.d.ts → ModeResolver-DS-aCVOP.d.ts} +1 -1
- package/dist/{Task-CxGgN6I0.d.mts → Task-D3O49EUo.d.mts} +43 -6
- package/dist/{Task-CxGgN6I0.d.ts → Task-D3O49EUo.d.ts} +43 -6
- package/dist/{chunk-RZ23BMVR.mjs → chunk-3S5IVTZM.mjs} +80 -22
- package/dist/chunk-3S5IVTZM.mjs.map +1 -0
- package/dist/{chunk-FX33UKAD.mjs → chunk-IOYBL3E5.mjs} +3 -3
- package/dist/{chunk-UDUATSCJ.mjs → chunk-MJKCU4U7.mjs} +1 -1
- package/dist/{chunk-UDUATSCJ.mjs.map → chunk-MJKCU4U7.mjs.map} +1 -1
- package/dist/{chunk-PKJTN2PD.mjs → chunk-POD3KZQW.mjs} +7 -1
- package/dist/chunk-POD3KZQW.mjs.map +1 -0
- package/dist/{chunk-2IFKPYPO.mjs → chunk-YZDWWXCB.mjs} +58 -17
- package/dist/chunk-YZDWWXCB.mjs.map +1 -0
- package/dist/{eventStore-CTCSKS9E.d.ts → eventStore-BcoMsZtU.d.mts} +23 -7
- package/dist/{eventStore-CcB8yELZ.d.mts → eventStore-CSFKy48Y.d.ts} +23 -7
- package/dist/index.d.mts +248 -112
- package/dist/index.d.ts +248 -112
- package/dist/index.js +2576 -1104
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2240 -866
- package/dist/index.mjs.map +1 -1
- package/dist/parsing.d.mts +2 -2
- package/dist/parsing.d.ts +2 -2
- package/dist/parsing.js +43 -15
- package/dist/parsing.js.map +1 -1
- package/dist/parsing.mjs +3 -3
- package/dist/plan-utils.d.mts +27 -5
- package/dist/plan-utils.d.ts +27 -5
- package/dist/plan-utils.js +99 -14
- package/dist/plan-utils.js.map +1 -1
- package/dist/plan-utils.mjs +47 -3
- package/dist/plan-utils.mjs.map +1 -1
- package/dist/{runSettingsText-DFVpe6aU.d.mts → runSettingsText-C6eto6Uv.d.ts} +550 -26
- package/dist/{runSettingsText-lKLDsyli.d.ts → runSettingsText-DnzSrB0c.d.mts} +550 -26
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js.map +1 -1
- package/dist/testing.mjs +2 -2
- package/docker/task.Dockerfile +7 -4
- package/package.json +1 -1
- package/dist/chunk-2IFKPYPO.mjs.map +0 -1
- package/dist/chunk-PKJTN2PD.mjs.map +0 -1
- package/dist/chunk-RZ23BMVR.mjs.map +0 -1
- /package/dist/{chunk-FX33UKAD.mjs.map → chunk-IOYBL3E5.mjs.map} +0 -0
|
@@ -212,6 +212,11 @@ declare function parsePlanPath(written: string): {
|
|
|
212
212
|
path: string;
|
|
213
213
|
rest: string;
|
|
214
214
|
} | undefined;
|
|
215
|
+
/** A later page of what a report left out, `#4@2/from:101`: the task as a plan reads it, and the entry the page starts at (ADR-0057 R2). A caller tries the text whole first, since a title may end in anything. */
|
|
216
|
+
declare function parseListingPage(written: string): {
|
|
217
|
+
rest: string;
|
|
218
|
+
from: number;
|
|
219
|
+
} | undefined;
|
|
215
220
|
/** A node's path as a reader writes it: `root/3/2` is `3/2`. */
|
|
216
221
|
declare function nodeText(node: string): string;
|
|
217
222
|
/**
|
|
@@ -399,8 +404,16 @@ declare function pinReference(plan: readonly Task[], producerId: string, pins: H
|
|
|
399
404
|
declare function checkHandoff<H extends Handoff>(handoff: H, producerId: string, plan: readonly Task[], pins?: HandoffPins): HandoffCheck<H>;
|
|
400
405
|
|
|
401
406
|
interface TaskDiffRead {
|
|
402
|
-
/**
|
|
403
|
-
|
|
407
|
+
/**
|
|
408
|
+
* Only the changed paths, joined by NUL: what a verdict reads (ADR-0055 D6). It
|
|
409
|
+
* holds every path the task's work changes, Ordewell state and `.git`-named
|
|
410
|
+
* paths included, as a landing takes them: `allowedPath` decides what a person
|
|
411
|
+
* is shown, and a path hidden from a verdict would land past a protected path.
|
|
412
|
+
* A commit takes the whole worktree, so that reaches past a workspace that is a
|
|
413
|
+
* folder of its repository: see {@link changeNames}. `'both'` asks for both of a
|
|
414
|
+
* path's names, for a read that goes by a protected path alone (D7).
|
|
415
|
+
*/
|
|
416
|
+
names?: boolean | 'both';
|
|
404
417
|
repo?: string;
|
|
405
418
|
path?: string;
|
|
406
419
|
}
|
|
@@ -1097,8 +1110,9 @@ interface IWorktreeIsolation {
|
|
|
1097
1110
|
*/
|
|
1098
1111
|
verifyRepair(task: Task, run: IsolationRun): Promise<RepairEvidence>;
|
|
1099
1112
|
/**
|
|
1100
|
-
* The paths a repair brings onto the integration tip,
|
|
1101
|
-
*
|
|
1113
|
+
* The paths a repair brings onto the integration tip, each under every name a
|
|
1114
|
+
* protected path may give it (`changeNames`), since nothing else reads them:
|
|
1115
|
+
* `repairBase` to the branch where the landing changed a repo, and
|
|
1102
1116
|
* the task's tip to it where it did not, since a repair can still edit that
|
|
1103
1117
|
* repo. Read after {@link verifyRepair} commits, before `integrate` moves the tip.
|
|
1104
1118
|
*/
|
|
@@ -1520,10 +1534,11 @@ type ExecutionActor = {
|
|
|
1520
1534
|
kind: 'autorun';
|
|
1521
1535
|
leavesFailed?: ReadonlySet<string>;
|
|
1522
1536
|
}
|
|
1523
|
-
/** Every turn of a child plan's planner (ADR-0056 M6)
|
|
1537
|
+
/** Every turn of a child plan's planner (ADR-0056 M6), a person's message opening it or not (ADR-0055 D20): its grants alone answer. `depth` is its level, the root being 0; `person` is a control a person pressed on its task, kept for the record and worth no authority. */
|
|
1524
1538
|
| {
|
|
1525
1539
|
kind: 'subplanner';
|
|
1526
1540
|
depth: number;
|
|
1541
|
+
person?: true;
|
|
1527
1542
|
};
|
|
1528
1543
|
/** Whose authority an actor's work runs under: a child has no user, so a subplanner's is a supervisor's (ADR-0056 M6). */
|
|
1529
1544
|
declare function actorAuthority(actor: ExecutionActor['kind']): TurnAuthority;
|
|
@@ -1563,6 +1578,8 @@ interface ExecutionRecord {
|
|
|
1563
1578
|
actor: ExecutionActor['kind'];
|
|
1564
1579
|
/** Present when the supervisor asked. */
|
|
1565
1580
|
level?: SupervisorLevel;
|
|
1581
|
+
/** A person pressed it on a child plan's task, under that plan's subplanner (ADR-0055 D20). */
|
|
1582
|
+
person?: true;
|
|
1566
1583
|
/** `ref` is how the plan numbers it: "#4", or "#4.1" for a subtask. */
|
|
1567
1584
|
task?: {
|
|
1568
1585
|
id: string;
|
|
@@ -2757,6 +2774,8 @@ interface PendingPlanTurn {
|
|
|
2757
2774
|
tasks?: string[];
|
|
2758
2775
|
/** It goes with the next turn and opens none (ADR-0057 R6). */
|
|
2759
2776
|
rides?: true;
|
|
2777
|
+
/** Who a message comes from where the conversation cannot tell (ADR-0055 D20): it stands or falls with its message, and a turn says it once. */
|
|
2778
|
+
aside?: string;
|
|
2760
2779
|
}
|
|
2761
2780
|
/**
|
|
2762
2781
|
* The run's own copy of the user's run settings (ADR-0030): taken when the
|
|
@@ -2821,6 +2840,20 @@ interface PlannerContextPause {
|
|
|
2821
2840
|
/** More such calls ran than `done` keeps: the refusal could not list all of them, and a retry without the live context stays refused. */
|
|
2822
2841
|
doneTruncated?: true;
|
|
2823
2842
|
}
|
|
2843
|
+
/**
|
|
2844
|
+
* A harness planner's own session, as far as a later process needs it: a hint,
|
|
2845
|
+
* taken up only under the runner, model, effort and folder it was opened with.
|
|
2846
|
+
* The transcript stays authoritative (ADR-0009 T4).
|
|
2847
|
+
*/
|
|
2848
|
+
interface PlannerNativeSession {
|
|
2849
|
+
runner: string;
|
|
2850
|
+
sessionId: string;
|
|
2851
|
+
cwd: string;
|
|
2852
|
+
model?: string;
|
|
2853
|
+
effort?: string;
|
|
2854
|
+
/** What was counted of its running cost, so taking it up counts nothing twice (ADR-0056 M10). */
|
|
2855
|
+
cost?: RunnerSessionCost;
|
|
2856
|
+
}
|
|
2824
2857
|
interface LegacyPlanState {
|
|
2825
2858
|
/** Research profiles the planner approved as they landed: lifting one withdraws its approval (ADR-0037 R4). */
|
|
2826
2859
|
researchApprovals?: string[];
|
|
@@ -2835,6 +2868,10 @@ interface LegacyPlanState {
|
|
|
2835
2868
|
researchLog?: ResearchLogEntry[];
|
|
2836
2869
|
/** The planner dialogue — user messages and assistant messages, in order (ADR-0002). */
|
|
2837
2870
|
conversationHistory?: ConversationMessage[];
|
|
2871
|
+
/** The subplanner's native session, for a Continue to take up (ADR-0055 D17): `heard` is how much of the Model context it holds. Absent on a root plan. */
|
|
2872
|
+
plannerSession?: PlannerNativeSession & {
|
|
2873
|
+
heard: number;
|
|
2874
|
+
};
|
|
2838
2875
|
/** Full markdown PRD once written by the planner (PRD mode), also saved to .scratch/<slug>/PRD.md. */
|
|
2839
2876
|
prdMarkdown?: string;
|
|
2840
2877
|
/** Planner turn inputs no turn has answered yet (ADR-0029); a reload replays them. */
|
|
@@ -2954,4 +2991,4 @@ type ApprovalRecord = Pick<LegacyPlanState, 'approved' | 'approvedTasks'>;
|
|
|
2954
2991
|
*/
|
|
2955
2992
|
declare function waitsForApproval(task: Pick<Task, 'id' | 'type' | 'status'>, record: ApprovalRecord): boolean;
|
|
2956
2993
|
|
|
2957
|
-
export { type IsolationLanding as $, type ApprovalRecord as A, BUILTIN_SKILL_NAMES as B, type CheckWord as C, DEFAULT_LOOP_ROUNDS as D, type EffectRules as E, FLOOR_GRANTS as F, GRANTS as G, HANDOFF_LIMITS as H, type HandoffCheck as I, type HandoffCommit as J, type HandoffDigest as K, type HandoffEvidence as L, type HandoffFinding as M, type HandoffLogs as N, type HandoffPatch as O, type HandoffPins as P, type HandoffPreviewOptions as Q, type HandoffTaskName as R, type IIsolationPreview as S, type IWorktreeIsolation as T, type IntegrationDisposal as U, type InvalidSkill as V, type IsolationAvailability as W, type IsolationHandoff as X, type IsolationHandoffRepo as Y, type IsolationInactiveReason as Z, type IsolationLandedTask as _, type AttemptUsage as a, type
|
|
2994
|
+
export { type IsolationLanding as $, type ApprovalRecord as A, BUILTIN_SKILL_NAMES as B, type CheckWord as C, DEFAULT_LOOP_ROUNDS as D, type EffectRules as E, FLOOR_GRANTS as F, GRANTS as G, HANDOFF_LIMITS as H, type HandoffCheck as I, type HandoffCommit as J, type HandoffDigest as K, type HandoffEvidence as L, type HandoffFinding as M, type HandoffLogs as N, type HandoffPatch as O, type HandoffPins as P, type HandoffPreviewOptions as Q, type HandoffTaskName as R, type IIsolationPreview as S, type IWorktreeIsolation as T, type IntegrationDisposal as U, type InvalidSkill as V, type IsolationAvailability as W, type IsolationHandoff as X, type IsolationHandoffRepo as Y, type IsolationInactiveReason as Z, type IsolationLandedTask as _, type AttemptUsage as a, type ResearchToolType as a$, type IsolationMergeBlock as a0, type IsolationMergeBlockReason as a1, type IsolationMergeResult as a2, type IsolationOutcome as a3, type IsolationPreview as a4, type IsolationPruneResult as a5, type IsolationRemoval as a6, type IsolationRepo as a7, type IsolationRepoRevert as a8, type IsolationRevertResult as a9, type PlanUsage as aA, type PlannerAllowlist as aB, type PlannerCompaction as aC, type PlannerCompactionOutcome as aD, type PlannerContextPause as aE, type PlannerNativeSession as aF, type PlannerResendState as aG, type PlannerUsage as aH, type PrepareIntent as aI, type PreparedTask as aJ, type PreservedWork as aK, type PreviewRepo as aL, type PreviousWork as aM, REPORT_MAX_CHARS as aN, ROOT_NODE as aO, type RefusedRemoval as aP, type RepairEvidence as aQ, type RepairWait as aR, type ReplyRun as aS, type RepoGroupLayout as aT, type RepoHead as aU, type ReportItem as aV, type ReportedWindow as aW, type ResearchLogEntry as aX, type ResearchProgress as aY, type ResearchStep as aZ, type ResearchStepOutcome as a_, type IsolationRevertTask as aa, type IsolationRun as ab, type IsolationTaskRecord as ac, type IsolationTaskRef as ad, type IsolationTaskRepo as ae, type IsolationTaskStatus as af, type IsolationView as ag, type LandedTask as ah, type LandedWork as ai, type LegacyPlanState as aj, type LoopSubject as ak, MAX_LOOP_ROUNDS as al, type Mandate as am, type MandateExclusions as an, type MandateLimits as ao, type MandateRefusal as ap, type MandateRequest as aq, type ModelUsage as ar, type Narrowed as as, type NodeAuthority as at, type PatchFlag as au, type PatchView as av, type PendingPlanTurn as aw, type PlanIsolation as ax, type PlanState as ay, type PlanStatus as az, type AwaitingReason as b, contextMeterTitle as b$, type RevertCommand as b0, type RevertWatch as b1, type RootSettings as b2, type RunSettings as b3, type RunnerId as b4, type RunnerSessionCost as b5, SEVERITY_LABEL as b6, SHAPE_LIMITS as b7, type ScriptBody as b8, type ScriptConsent as b9, type TaskSkillSnapshot as bA, type TaskSnapshot as bB, type TaskStatus as bC, type TaskType as bD, type TaskUsageSummary as bE, type TreeSnapshot as bF, type UsageLine as bG, type UsageRecord as bH, type UsageTotals as bI, type Verdict as bJ, type VerificationCheck as bK, type WrittenTaskRef as bL, actorAuthority as bM, addAttemptUsage as bN, addModelUsage as bO, addPlannerUsage as bP, addUsage as bQ, addUsageTotals as bR, artifactLines as bS, betweenRounds as bT, boundedHandoffLines as bU, byteSize as bV, checkHandoff as bW, checkOf as bX, commandAllowedBy as bY, commandLine as bZ, contextMeterText as b_, type ScriptResult as ba, type SessionBilling as bb, type SetupFailure as bc, type ShadowedSkill as bd, type SkillAppliesTo as be, type SkillCatalog as bf, type SkillInfo as bg, type SkillLoad as bh, type SkillLoadNotice as bi, type SkillMetadata as bj, type SkillSource as bk, SkillsService as bl, type StoredHandoff as bm, type SubagentOutcome as bn, type SubtreeReport as bo, type SupervisorLevel as bp, type Task as bq, type TaskDiffRead as br, type TaskDiffResult as bs, type TaskEvidence as bt, type TaskIsolation as bu, type TaskIsolationState as bv, type TaskLoop as bw, type TaskModelAssignment as bx, type TaskReportTo as by, type TaskSkillNotice as bz, type BelowPlan as c, scriptBodyOf as c$, costText as c0, countedSessionCost as c1, createEmptyPlan as c2, createSkillsService as c3, createTask as c4, effectRuleFor as c5, endAttemptUsage as c6, findingLines as c7, findingRefText as c8, flattenTasks as c9, parseAllowlist as cA, parseEffectAllowlist as cB, parseFindingRef as cC, parseListingPage as cD, parsePlanPath as cE, partedPromptUsage as cF, patchChangesText as cG, patchFlagText as cH, patchLines as cI, patchLinesText as cJ, patchText as cK, patchView as cL, pausedOnLimit as cM, pinReference as cN, planUsage as cO, plannerContextFill as cP, readableTaskIds as cQ, rejoinPlanTree as cR, removedAttempt as cS, resolveWrittenRef as cT, resumedSessionWindow as cU, rootAuthority as cV, rootMandate as cW, savedPatchOf as cX, savedPatchView as cY, savedPatchViews as cZ, scopeAllowed as c_, flattenTasksWithParents as ca, formatCost as cb, formatTokenCount as cc, handoffDigest as cd, handoffLines as ce, handoffPreviewLines as cf, handoffReferenceText as cg, handoffWakeLines as ch, heldHandoff as ci, heldMandate as cj, heldWords as ck, inLoop as cl, isAwaitingReason as cm, isMeasured as cn, isSupervisorLevel as co, isUserMessage as cp, loopRemovalRefusal as cq, loopRoundOf as cr, mandateRefusalText as cs, migratePlanState as ct, modelCostTitle as cu, namedHandoff as cv, narrow as cw, nodeText as cx, openingLines as cy, outOfRounds as cz, type ChildTaskCounts as d, scriptBodyText as d0, scriptTaskText as d1, severityLabel as d2, spentTokens as d3, startAttemptUsage as d4, storedHandoff as d5, subagentCostTitle as d6, taskUsageSummary as d7, tasksTotalText as d8, timeLimitText as d9, toolAllowed as da, usageLine as db, usageText as dc, waitsForApproval as dd, withPatch as de, wordsFrom as df, worstSeverity as dg, type CommandWords as e, type ContextCheckpoint as f, type ContextFill as g, type ConversationMessage as h, type CostProvenance as i, DEFAULT_PLANNER_ALLOWLIST as j, DEFAULT_RUNNERS as k, DEFAULT_SCRIPT_TIMEOUT_MS as l, DEFAULT_SUPERVISOR_RETRY_LIMIT as m, DIGEST_FINDINGS as n, type DelegatedRow as o, type DiscoveredModel as p, type ExecutionActor as q, type ExecutionCommandName as r, type ExecutionRecord as s, type FindingSeverity as t, type Grant as u, type GuardTarget as v, type GuardTrip as w, HANDOFF_PUSH_CHARS as x, type Handoff as y, type HandoffArtifact as z };
|
|
@@ -212,6 +212,11 @@ declare function parsePlanPath(written: string): {
|
|
|
212
212
|
path: string;
|
|
213
213
|
rest: string;
|
|
214
214
|
} | undefined;
|
|
215
|
+
/** A later page of what a report left out, `#4@2/from:101`: the task as a plan reads it, and the entry the page starts at (ADR-0057 R2). A caller tries the text whole first, since a title may end in anything. */
|
|
216
|
+
declare function parseListingPage(written: string): {
|
|
217
|
+
rest: string;
|
|
218
|
+
from: number;
|
|
219
|
+
} | undefined;
|
|
215
220
|
/** A node's path as a reader writes it: `root/3/2` is `3/2`. */
|
|
216
221
|
declare function nodeText(node: string): string;
|
|
217
222
|
/**
|
|
@@ -399,8 +404,16 @@ declare function pinReference(plan: readonly Task[], producerId: string, pins: H
|
|
|
399
404
|
declare function checkHandoff<H extends Handoff>(handoff: H, producerId: string, plan: readonly Task[], pins?: HandoffPins): HandoffCheck<H>;
|
|
400
405
|
|
|
401
406
|
interface TaskDiffRead {
|
|
402
|
-
/**
|
|
403
|
-
|
|
407
|
+
/**
|
|
408
|
+
* Only the changed paths, joined by NUL: what a verdict reads (ADR-0055 D6). It
|
|
409
|
+
* holds every path the task's work changes, Ordewell state and `.git`-named
|
|
410
|
+
* paths included, as a landing takes them: `allowedPath` decides what a person
|
|
411
|
+
* is shown, and a path hidden from a verdict would land past a protected path.
|
|
412
|
+
* A commit takes the whole worktree, so that reaches past a workspace that is a
|
|
413
|
+
* folder of its repository: see {@link changeNames}. `'both'` asks for both of a
|
|
414
|
+
* path's names, for a read that goes by a protected path alone (D7).
|
|
415
|
+
*/
|
|
416
|
+
names?: boolean | 'both';
|
|
404
417
|
repo?: string;
|
|
405
418
|
path?: string;
|
|
406
419
|
}
|
|
@@ -1097,8 +1110,9 @@ interface IWorktreeIsolation {
|
|
|
1097
1110
|
*/
|
|
1098
1111
|
verifyRepair(task: Task, run: IsolationRun): Promise<RepairEvidence>;
|
|
1099
1112
|
/**
|
|
1100
|
-
* The paths a repair brings onto the integration tip,
|
|
1101
|
-
*
|
|
1113
|
+
* The paths a repair brings onto the integration tip, each under every name a
|
|
1114
|
+
* protected path may give it (`changeNames`), since nothing else reads them:
|
|
1115
|
+
* `repairBase` to the branch where the landing changed a repo, and
|
|
1102
1116
|
* the task's tip to it where it did not, since a repair can still edit that
|
|
1103
1117
|
* repo. Read after {@link verifyRepair} commits, before `integrate` moves the tip.
|
|
1104
1118
|
*/
|
|
@@ -1520,10 +1534,11 @@ type ExecutionActor = {
|
|
|
1520
1534
|
kind: 'autorun';
|
|
1521
1535
|
leavesFailed?: ReadonlySet<string>;
|
|
1522
1536
|
}
|
|
1523
|
-
/** Every turn of a child plan's planner (ADR-0056 M6)
|
|
1537
|
+
/** Every turn of a child plan's planner (ADR-0056 M6), a person's message opening it or not (ADR-0055 D20): its grants alone answer. `depth` is its level, the root being 0; `person` is a control a person pressed on its task, kept for the record and worth no authority. */
|
|
1524
1538
|
| {
|
|
1525
1539
|
kind: 'subplanner';
|
|
1526
1540
|
depth: number;
|
|
1541
|
+
person?: true;
|
|
1527
1542
|
};
|
|
1528
1543
|
/** Whose authority an actor's work runs under: a child has no user, so a subplanner's is a supervisor's (ADR-0056 M6). */
|
|
1529
1544
|
declare function actorAuthority(actor: ExecutionActor['kind']): TurnAuthority;
|
|
@@ -1563,6 +1578,8 @@ interface ExecutionRecord {
|
|
|
1563
1578
|
actor: ExecutionActor['kind'];
|
|
1564
1579
|
/** Present when the supervisor asked. */
|
|
1565
1580
|
level?: SupervisorLevel;
|
|
1581
|
+
/** A person pressed it on a child plan's task, under that plan's subplanner (ADR-0055 D20). */
|
|
1582
|
+
person?: true;
|
|
1566
1583
|
/** `ref` is how the plan numbers it: "#4", or "#4.1" for a subtask. */
|
|
1567
1584
|
task?: {
|
|
1568
1585
|
id: string;
|
|
@@ -2757,6 +2774,8 @@ interface PendingPlanTurn {
|
|
|
2757
2774
|
tasks?: string[];
|
|
2758
2775
|
/** It goes with the next turn and opens none (ADR-0057 R6). */
|
|
2759
2776
|
rides?: true;
|
|
2777
|
+
/** Who a message comes from where the conversation cannot tell (ADR-0055 D20): it stands or falls with its message, and a turn says it once. */
|
|
2778
|
+
aside?: string;
|
|
2760
2779
|
}
|
|
2761
2780
|
/**
|
|
2762
2781
|
* The run's own copy of the user's run settings (ADR-0030): taken when the
|
|
@@ -2821,6 +2840,20 @@ interface PlannerContextPause {
|
|
|
2821
2840
|
/** More such calls ran than `done` keeps: the refusal could not list all of them, and a retry without the live context stays refused. */
|
|
2822
2841
|
doneTruncated?: true;
|
|
2823
2842
|
}
|
|
2843
|
+
/**
|
|
2844
|
+
* A harness planner's own session, as far as a later process needs it: a hint,
|
|
2845
|
+
* taken up only under the runner, model, effort and folder it was opened with.
|
|
2846
|
+
* The transcript stays authoritative (ADR-0009 T4).
|
|
2847
|
+
*/
|
|
2848
|
+
interface PlannerNativeSession {
|
|
2849
|
+
runner: string;
|
|
2850
|
+
sessionId: string;
|
|
2851
|
+
cwd: string;
|
|
2852
|
+
model?: string;
|
|
2853
|
+
effort?: string;
|
|
2854
|
+
/** What was counted of its running cost, so taking it up counts nothing twice (ADR-0056 M10). */
|
|
2855
|
+
cost?: RunnerSessionCost;
|
|
2856
|
+
}
|
|
2824
2857
|
interface LegacyPlanState {
|
|
2825
2858
|
/** Research profiles the planner approved as they landed: lifting one withdraws its approval (ADR-0037 R4). */
|
|
2826
2859
|
researchApprovals?: string[];
|
|
@@ -2835,6 +2868,10 @@ interface LegacyPlanState {
|
|
|
2835
2868
|
researchLog?: ResearchLogEntry[];
|
|
2836
2869
|
/** The planner dialogue — user messages and assistant messages, in order (ADR-0002). */
|
|
2837
2870
|
conversationHistory?: ConversationMessage[];
|
|
2871
|
+
/** The subplanner's native session, for a Continue to take up (ADR-0055 D17): `heard` is how much of the Model context it holds. Absent on a root plan. */
|
|
2872
|
+
plannerSession?: PlannerNativeSession & {
|
|
2873
|
+
heard: number;
|
|
2874
|
+
};
|
|
2838
2875
|
/** Full markdown PRD once written by the planner (PRD mode), also saved to .scratch/<slug>/PRD.md. */
|
|
2839
2876
|
prdMarkdown?: string;
|
|
2840
2877
|
/** Planner turn inputs no turn has answered yet (ADR-0029); a reload replays them. */
|
|
@@ -2954,4 +2991,4 @@ type ApprovalRecord = Pick<LegacyPlanState, 'approved' | 'approvedTasks'>;
|
|
|
2954
2991
|
*/
|
|
2955
2992
|
declare function waitsForApproval(task: Pick<Task, 'id' | 'type' | 'status'>, record: ApprovalRecord): boolean;
|
|
2956
2993
|
|
|
2957
|
-
export { type IsolationLanding as $, type ApprovalRecord as A, BUILTIN_SKILL_NAMES as B, type CheckWord as C, DEFAULT_LOOP_ROUNDS as D, type EffectRules as E, FLOOR_GRANTS as F, GRANTS as G, HANDOFF_LIMITS as H, type HandoffCheck as I, type HandoffCommit as J, type HandoffDigest as K, type HandoffEvidence as L, type HandoffFinding as M, type HandoffLogs as N, type HandoffPatch as O, type HandoffPins as P, type HandoffPreviewOptions as Q, type HandoffTaskName as R, type IIsolationPreview as S, type IWorktreeIsolation as T, type IntegrationDisposal as U, type InvalidSkill as V, type IsolationAvailability as W, type IsolationHandoff as X, type IsolationHandoffRepo as Y, type IsolationInactiveReason as Z, type IsolationLandedTask as _, type AttemptUsage as a, type
|
|
2994
|
+
export { type IsolationLanding as $, type ApprovalRecord as A, BUILTIN_SKILL_NAMES as B, type CheckWord as C, DEFAULT_LOOP_ROUNDS as D, type EffectRules as E, FLOOR_GRANTS as F, GRANTS as G, HANDOFF_LIMITS as H, type HandoffCheck as I, type HandoffCommit as J, type HandoffDigest as K, type HandoffEvidence as L, type HandoffFinding as M, type HandoffLogs as N, type HandoffPatch as O, type HandoffPins as P, type HandoffPreviewOptions as Q, type HandoffTaskName as R, type IIsolationPreview as S, type IWorktreeIsolation as T, type IntegrationDisposal as U, type InvalidSkill as V, type IsolationAvailability as W, type IsolationHandoff as X, type IsolationHandoffRepo as Y, type IsolationInactiveReason as Z, type IsolationLandedTask as _, type AttemptUsage as a, type ResearchToolType as a$, type IsolationMergeBlock as a0, type IsolationMergeBlockReason as a1, type IsolationMergeResult as a2, type IsolationOutcome as a3, type IsolationPreview as a4, type IsolationPruneResult as a5, type IsolationRemoval as a6, type IsolationRepo as a7, type IsolationRepoRevert as a8, type IsolationRevertResult as a9, type PlanUsage as aA, type PlannerAllowlist as aB, type PlannerCompaction as aC, type PlannerCompactionOutcome as aD, type PlannerContextPause as aE, type PlannerNativeSession as aF, type PlannerResendState as aG, type PlannerUsage as aH, type PrepareIntent as aI, type PreparedTask as aJ, type PreservedWork as aK, type PreviewRepo as aL, type PreviousWork as aM, REPORT_MAX_CHARS as aN, ROOT_NODE as aO, type RefusedRemoval as aP, type RepairEvidence as aQ, type RepairWait as aR, type ReplyRun as aS, type RepoGroupLayout as aT, type RepoHead as aU, type ReportItem as aV, type ReportedWindow as aW, type ResearchLogEntry as aX, type ResearchProgress as aY, type ResearchStep as aZ, type ResearchStepOutcome as a_, type IsolationRevertTask as aa, type IsolationRun as ab, type IsolationTaskRecord as ac, type IsolationTaskRef as ad, type IsolationTaskRepo as ae, type IsolationTaskStatus as af, type IsolationView as ag, type LandedTask as ah, type LandedWork as ai, type LegacyPlanState as aj, type LoopSubject as ak, MAX_LOOP_ROUNDS as al, type Mandate as am, type MandateExclusions as an, type MandateLimits as ao, type MandateRefusal as ap, type MandateRequest as aq, type ModelUsage as ar, type Narrowed as as, type NodeAuthority as at, type PatchFlag as au, type PatchView as av, type PendingPlanTurn as aw, type PlanIsolation as ax, type PlanState as ay, type PlanStatus as az, type AwaitingReason as b, contextMeterTitle as b$, type RevertCommand as b0, type RevertWatch as b1, type RootSettings as b2, type RunSettings as b3, type RunnerId as b4, type RunnerSessionCost as b5, SEVERITY_LABEL as b6, SHAPE_LIMITS as b7, type ScriptBody as b8, type ScriptConsent as b9, type TaskSkillSnapshot as bA, type TaskSnapshot as bB, type TaskStatus as bC, type TaskType as bD, type TaskUsageSummary as bE, type TreeSnapshot as bF, type UsageLine as bG, type UsageRecord as bH, type UsageTotals as bI, type Verdict as bJ, type VerificationCheck as bK, type WrittenTaskRef as bL, actorAuthority as bM, addAttemptUsage as bN, addModelUsage as bO, addPlannerUsage as bP, addUsage as bQ, addUsageTotals as bR, artifactLines as bS, betweenRounds as bT, boundedHandoffLines as bU, byteSize as bV, checkHandoff as bW, checkOf as bX, commandAllowedBy as bY, commandLine as bZ, contextMeterText as b_, type ScriptResult as ba, type SessionBilling as bb, type SetupFailure as bc, type ShadowedSkill as bd, type SkillAppliesTo as be, type SkillCatalog as bf, type SkillInfo as bg, type SkillLoad as bh, type SkillLoadNotice as bi, type SkillMetadata as bj, type SkillSource as bk, SkillsService as bl, type StoredHandoff as bm, type SubagentOutcome as bn, type SubtreeReport as bo, type SupervisorLevel as bp, type Task as bq, type TaskDiffRead as br, type TaskDiffResult as bs, type TaskEvidence as bt, type TaskIsolation as bu, type TaskIsolationState as bv, type TaskLoop as bw, type TaskModelAssignment as bx, type TaskReportTo as by, type TaskSkillNotice as bz, type BelowPlan as c, scriptBodyOf as c$, costText as c0, countedSessionCost as c1, createEmptyPlan as c2, createSkillsService as c3, createTask as c4, effectRuleFor as c5, endAttemptUsage as c6, findingLines as c7, findingRefText as c8, flattenTasks as c9, parseAllowlist as cA, parseEffectAllowlist as cB, parseFindingRef as cC, parseListingPage as cD, parsePlanPath as cE, partedPromptUsage as cF, patchChangesText as cG, patchFlagText as cH, patchLines as cI, patchLinesText as cJ, patchText as cK, patchView as cL, pausedOnLimit as cM, pinReference as cN, planUsage as cO, plannerContextFill as cP, readableTaskIds as cQ, rejoinPlanTree as cR, removedAttempt as cS, resolveWrittenRef as cT, resumedSessionWindow as cU, rootAuthority as cV, rootMandate as cW, savedPatchOf as cX, savedPatchView as cY, savedPatchViews as cZ, scopeAllowed as c_, flattenTasksWithParents as ca, formatCost as cb, formatTokenCount as cc, handoffDigest as cd, handoffLines as ce, handoffPreviewLines as cf, handoffReferenceText as cg, handoffWakeLines as ch, heldHandoff as ci, heldMandate as cj, heldWords as ck, inLoop as cl, isAwaitingReason as cm, isMeasured as cn, isSupervisorLevel as co, isUserMessage as cp, loopRemovalRefusal as cq, loopRoundOf as cr, mandateRefusalText as cs, migratePlanState as ct, modelCostTitle as cu, namedHandoff as cv, narrow as cw, nodeText as cx, openingLines as cy, outOfRounds as cz, type ChildTaskCounts as d, scriptBodyText as d0, scriptTaskText as d1, severityLabel as d2, spentTokens as d3, startAttemptUsage as d4, storedHandoff as d5, subagentCostTitle as d6, taskUsageSummary as d7, tasksTotalText as d8, timeLimitText as d9, toolAllowed as da, usageLine as db, usageText as dc, waitsForApproval as dd, withPatch as de, wordsFrom as df, worstSeverity as dg, type CommandWords as e, type ContextCheckpoint as f, type ContextFill as g, type ConversationMessage as h, type CostProvenance as i, DEFAULT_PLANNER_ALLOWLIST as j, DEFAULT_RUNNERS as k, DEFAULT_SCRIPT_TIMEOUT_MS as l, DEFAULT_SUPERVISOR_RETRY_LIMIT as m, DIGEST_FINDINGS as n, type DelegatedRow as o, type DiscoveredModel as p, type ExecutionActor as q, type ExecutionCommandName as r, type ExecutionRecord as s, type FindingSeverity as t, type Grant as u, type GuardTarget as v, type GuardTrip as w, HANDOFF_PUSH_CHARS as x, type Handoff as y, type HandoffArtifact as z };
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
betweenRounds,
|
|
10
10
|
checkOf,
|
|
11
11
|
checkPlanInvariants,
|
|
12
|
+
checksOfBodies,
|
|
12
13
|
clearedBodyFields,
|
|
13
14
|
commandLine,
|
|
14
15
|
detectCycle,
|
|
@@ -31,7 +32,7 @@ import {
|
|
|
31
32
|
stripTrailingCommas,
|
|
32
33
|
taggedReadOnlyMode,
|
|
33
34
|
taskWhere
|
|
34
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-YZDWWXCB.mjs";
|
|
35
36
|
import {
|
|
36
37
|
SELF_REPO,
|
|
37
38
|
addTaskToPlan,
|
|
@@ -50,12 +51,13 @@ import {
|
|
|
50
51
|
taskOrderLabel,
|
|
51
52
|
taskPlacement,
|
|
52
53
|
taskRefOf,
|
|
54
|
+
taskRefsOf,
|
|
53
55
|
titledTaskRef,
|
|
54
56
|
titledTaskRefOf,
|
|
55
57
|
updateTaskInPlan,
|
|
56
58
|
waitsMidAttempt,
|
|
57
59
|
walkPlan
|
|
58
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-POD3KZQW.mjs";
|
|
59
61
|
|
|
60
62
|
// src/models/Usage.ts
|
|
61
63
|
function partedPromptUsage(parts) {
|
|
@@ -629,7 +631,8 @@ function handoffDigest(handoff) {
|
|
|
629
631
|
};
|
|
630
632
|
}
|
|
631
633
|
function namedHandoff(plan, handoff) {
|
|
632
|
-
|
|
634
|
+
let taskRefs;
|
|
635
|
+
const named = (refs) => refs.map((r) => r.kind === "task" && r.label === void 0 ? { ...r, task: (taskRefs ??= taskRefsOf(plan)).get(r.task) ?? r.task } : r);
|
|
633
636
|
return {
|
|
634
637
|
...handoff,
|
|
635
638
|
findings: handoff.findings.map((f) => f.evidence ? { ...f, evidence: named(f.evidence) } : f),
|
|
@@ -642,6 +645,11 @@ function parsePlanPath(written) {
|
|
|
642
645
|
const [, path, rest] = PLAN_PATH.exec(written) ?? [];
|
|
643
646
|
return path === void 0 ? void 0 : { path, rest };
|
|
644
647
|
}
|
|
648
|
+
var LISTING_PAGE = /^(.+)\/from:([1-9][0-9]*)$/s;
|
|
649
|
+
function parseListingPage(written) {
|
|
650
|
+
const [, rest, from] = LISTING_PAGE.exec(written) ?? [];
|
|
651
|
+
return rest === void 0 ? void 0 : { rest, from: Number(from) };
|
|
652
|
+
}
|
|
645
653
|
function nodeText(node) {
|
|
646
654
|
return node.startsWith(`${ROOT_NODE}/`) ? node.slice(ROOT_NODE.length + 1) : node;
|
|
647
655
|
}
|
|
@@ -898,6 +906,17 @@ function readableTaskIds(plan, taskId) {
|
|
|
898
906
|
return readable;
|
|
899
907
|
}
|
|
900
908
|
var RESEND = "Fix or drop each reference named, then call task_complete again; nothing was recorded.";
|
|
909
|
+
function latestHandoff(task, logs) {
|
|
910
|
+
if (task.handoff) {
|
|
911
|
+
const latest = task.handoff.attempt ?? logs?.attempts(task.id).at(-1);
|
|
912
|
+
return { digest: task.handoff, ...latest !== void 0 ? { latest } : {} };
|
|
913
|
+
}
|
|
914
|
+
for (const attempt of [...logs?.attempts(task.id) ?? []].reverse()) {
|
|
915
|
+
const digest = logs?.handoff(task.id, attempt);
|
|
916
|
+
if (digest) return { latest: attempt, digest };
|
|
917
|
+
}
|
|
918
|
+
return {};
|
|
919
|
+
}
|
|
901
920
|
function pinIn(scope, producer, ref, written, field, refuse) {
|
|
902
921
|
const { plan, readable, logs, node, crossing } = scope;
|
|
903
922
|
const kept = (taskId) => crossing ? taskRefOf(plan, taskId) ?? taskId : void 0;
|
|
@@ -936,10 +955,10 @@ function pinIn(scope, producer, ref, written, field, refuse) {
|
|
|
936
955
|
const given = oneFinding(resolved.finding);
|
|
937
956
|
if (!given) return void 0;
|
|
938
957
|
const { finding } = given;
|
|
939
|
-
const latest
|
|
958
|
+
const { latest, digest } = latestHandoff(target, logs);
|
|
940
959
|
const own = target.id === producer.id && producer.attempt !== void 0 && (resolved.attempt ?? producer.attempt) === producer.attempt;
|
|
941
960
|
const attempt = own ? producer.attempt : resolved.attempt ?? latest;
|
|
942
|
-
const held = resolved.attempt === void 0 || resolved.attempt === latest ?
|
|
961
|
+
const held = resolved.attempt === void 0 || resolved.attempt === latest ? digest : logs?.handoff(target.id, resolved.attempt);
|
|
943
962
|
if (!own && resolved.attempt !== void 0 && resolved.attempt !== latest && !logs?.attempts(target.id).includes(resolved.attempt)) {
|
|
944
963
|
refuse(`${field}.task: ${named} has no saved attempt ${resolved.attempt}.`);
|
|
945
964
|
return void 0;
|
|
@@ -2737,7 +2756,8 @@ var automergeSummary = (run) => `Merge automatically (gates, end of run): ${onOf
|
|
|
2737
2756
|
var PLANNED_WITH_LABEL = "Planned-with line in commits Ordewell writes";
|
|
2738
2757
|
var trailerSummary = (run) => `${PLANNED_WITH_LABEL}: ${onOff(run.plannedWithTrailer)}`;
|
|
2739
2758
|
var autorunSummary = (run) => `Autorun: ${onOff(run.autorun)}`;
|
|
2740
|
-
var delegationSummary = (run) => `Delegation: ${run.delegationTokens > 0 ? `on, ${run.delegationTokens} tokens for a tree` : "off"}`;
|
|
2759
|
+
var delegationSummary = (run) => `Delegation: ${run.delegationTokens > 0 ? `on, ${run.delegationTokens} tokens for a tree` : run.delegationBudget > 0 ? `off, ${run.delegationBudget} tokens kept for a tree` : "off"}`;
|
|
2760
|
+
var keptDelegationBudget = (run) => run.delegationBudget > 0 ? run.delegationBudget : null;
|
|
2741
2761
|
var DELEGATION_ENV = "ORDEWELL_DELEGATION";
|
|
2742
2762
|
function delegationSwitchedOn({ env, moduleDir, exists }) {
|
|
2743
2763
|
if (env !== "1" || moduleDir === null) return false;
|
|
@@ -2765,6 +2785,13 @@ function containersOffered(place = placeHere(CONTAINERS_ENV)) {
|
|
|
2765
2785
|
var ACT_RISK = "Tasks it adds run too, ops tasks included, which can act on real systems unattended.";
|
|
2766
2786
|
var AUTORUN_RISK = "Plans start without review, ops tasks included, which can act on real systems unattended. In Full nobody is asked at all: the planner may start anything, script tasks included, from a plan no person read.";
|
|
2767
2787
|
var DELEGATION_RISK = "A subplanner approves and runs its own plan, and no person reads it. Its change tasks keep the network they have in a flat run, so an instruction injected into something a subplanner read can become a plan nobody read, and run with that network. Delegation starts no container of its own: containers are opt-in, and only that setting runs a child's tasks in one.";
|
|
2788
|
+
function rememberDelegationBudget(changes) {
|
|
2789
|
+
if (changes.delegationBudget !== void 0 || !((changes.delegationTokens ?? 0) > 0)) return changes;
|
|
2790
|
+
return { ...changes, delegationBudget: changes.delegationTokens };
|
|
2791
|
+
}
|
|
2792
|
+
var SUBPLANNER_SCOPE = "Lets a plan hand a separable part of its goal to a subplanner working on its own branch. A subplanner stays inside the mandate it is given and cannot widen it; this setting grants nothing else.";
|
|
2793
|
+
var SUBPLANNER_ACCOUNTING = "The budget is one allowance of tokens for the whole tree, counted approximately from what runners report: usage arrives after a call, so a tree can pass it a little.";
|
|
2794
|
+
var SUBPLANNER_CHILD = "A subplanner plans in Act with autorun: it approves and runs its own plan, and no person reads it. You confirm once, when you turn Subplanners on.";
|
|
2768
2795
|
function parseSwitch(arg) {
|
|
2769
2796
|
return arg === "on" ? true : arg === "off" ? false : null;
|
|
2770
2797
|
}
|
|
@@ -2971,6 +2998,11 @@ function continuability(task) {
|
|
|
2971
2998
|
}
|
|
2972
2999
|
return { ok: true, sessionId: task.runnerSessionId };
|
|
2973
3000
|
}
|
|
3001
|
+
function reopenMessage(task, message) {
|
|
3002
|
+
return task.parkedQuestion ? `${message}
|
|
3003
|
+
|
|
3004
|
+
A restart lost the question its subplanner asked, unanswered: "${task.parkedQuestion}"` : message;
|
|
3005
|
+
}
|
|
2974
3006
|
function canContinue(task) {
|
|
2975
3007
|
return continuability(task).ok;
|
|
2976
3008
|
}
|
|
@@ -3118,7 +3150,7 @@ function surfaceTask({ attemptSkills, subtasks, runnerSessionId: _runnerSessionI
|
|
|
3118
3150
|
subtasks: (subtasks ?? []).map(surfaceTask)
|
|
3119
3151
|
};
|
|
3120
3152
|
}
|
|
3121
|
-
function surfacePlan({ queuedMessages: _carriedOverAtLoad, ...plan }) {
|
|
3153
|
+
function surfacePlan({ queuedMessages: _carriedOverAtLoad, plannerSession: _hint, ...plan }) {
|
|
3122
3154
|
return {
|
|
3123
3155
|
...plan,
|
|
3124
3156
|
tasks: plan.tasks.map(surfaceTask),
|
|
@@ -4205,6 +4237,10 @@ function createWakePolicy(options) {
|
|
|
4205
4237
|
return batch;
|
|
4206
4238
|
},
|
|
4207
4239
|
dueAt,
|
|
4240
|
+
nextLookAt(now) {
|
|
4241
|
+
const windowEnd = (attention[0]?.at ?? Number.NEGATIVE_INFINITY) + debounceMs;
|
|
4242
|
+
return now < windowEnd && attention.every(isHeldEvent) ? windowEnd : dueAt();
|
|
4243
|
+
},
|
|
4208
4244
|
snapshot() {
|
|
4209
4245
|
return { attention: [...attention], sinceLast: [...sinceLast] };
|
|
4210
4246
|
},
|
|
@@ -4532,7 +4568,7 @@ function taskChatAvailable(task) {
|
|
|
4532
4568
|
if (task.type === "user") return false;
|
|
4533
4569
|
return task.attempted === true || (task.attemptUsage?.length ?? 0) > 0;
|
|
4534
4570
|
}
|
|
4535
|
-
var refsOf = (ids,
|
|
4571
|
+
var refsOf = (ids, reading) => ids.map((id) => reading?.refs.get(id) ?? id);
|
|
4536
4572
|
var namedRepo = (repo) => repo && repo !== "." ? repo : null;
|
|
4537
4573
|
var namedRepos = (repos) => (repos ?? []).filter((r) => r !== ".");
|
|
4538
4574
|
var filesOf = (files) => files?.length ? capConflictFiles(files) : null;
|
|
@@ -4543,32 +4579,48 @@ var asBlocking = (tasks) => tasks.map((t) => ({
|
|
|
4543
4579
|
subtasks: asBlocking(t.subtasks ?? []),
|
|
4544
4580
|
...t.loop ? { loop: t.loop, loopRound: t.loopRound, ...t.verdict ? { verdict: t.verdict } : {} } : {}
|
|
4545
4581
|
}));
|
|
4582
|
+
function readPlan(tasks) {
|
|
4583
|
+
return {
|
|
4584
|
+
blocks: planBlocks(asBlocking(tasks)),
|
|
4585
|
+
refs: taskRefsOf(tasks),
|
|
4586
|
+
byId: new Map(tasks.map((t) => [t.id, t])),
|
|
4587
|
+
checks: checksOfBodies(tasks)
|
|
4588
|
+
};
|
|
4589
|
+
}
|
|
4590
|
+
var readings = /* @__PURE__ */ new WeakMap();
|
|
4591
|
+
function readingOf(task, tasks) {
|
|
4592
|
+
if (!tasks?.length) return null;
|
|
4593
|
+
const plan = readings.get(tasks) ?? readPlan(tasks);
|
|
4594
|
+
readings.set(tasks, plan);
|
|
4595
|
+
const own = task.loop && plan.byId.get(task.id);
|
|
4596
|
+
if (!own || own.status === task.status && own.loopRound === task.loopRound && own.verdict === task.verdict) return plan;
|
|
4597
|
+
return readPlan(tasks.map((t) => t.id === task.id ? { ...t, status: task.status, loopRound: task.loopRound, verdict: task.verdict } : t));
|
|
4598
|
+
}
|
|
4546
4599
|
function blockedBy(task, reading) {
|
|
4547
4600
|
if (!reading || !NOT_STARTED.has(task.status)) return [];
|
|
4548
4601
|
return reading.blocks.blocked.get(task.id) ?? [];
|
|
4549
4602
|
}
|
|
4550
4603
|
function strandedDetail(check, dependencies, reading) {
|
|
4551
|
-
const status = (id) => reading?.
|
|
4604
|
+
const status = (id) => reading?.byId.get(id)?.status;
|
|
4552
4605
|
const landed = reading && check.loop.body.every((id) => status(id) === "completed");
|
|
4553
4606
|
const finished = dependencies.every((id) => [void 0, "completed", "skipped"].includes(status(id)));
|
|
4554
4607
|
return landed && finished ? `Nothing runs it now: start it for round ${loopRoundOf(check) + 1} of ${check.loop.maxRounds}` : "Nothing runs it now: execute the plan and the loop goes on";
|
|
4555
4608
|
}
|
|
4556
4609
|
function loopOf(task, reading) {
|
|
4557
|
-
const tasks = reading?.tasks;
|
|
4558
4610
|
if (task.loop) {
|
|
4559
4611
|
const check2 = { id: task.id, status: task.status, loop: task.loop, loopRound: task.loopRound, ...task.verdict ? { verdict: task.verdict } : {} };
|
|
4560
4612
|
const state = loopCheckState(check2, !task.loopStranded && (reading ? reading.blocks.repeating.has(task.id) : true));
|
|
4561
|
-
const body = refsOf(task.loop.body,
|
|
4613
|
+
const body = refsOf(task.loop.body, reading);
|
|
4562
4614
|
const halted = reading ? task.loop.body.filter((id) => {
|
|
4563
|
-
const status = reading.
|
|
4615
|
+
const status = reading.byId.get(id)?.status;
|
|
4564
4616
|
return status === "failed" || status === "skipped" || reading.blocks.blocked.has(id);
|
|
4565
4617
|
}) : [];
|
|
4566
|
-
const detail = state === "repeating" ? `Found problems: runs again once ${body.join(", ")} ${body.length === 1 ? "has" : "have"} landed` : state === "stopped" ? task.loopStranded ? strandedDetail(check2, task.dependencies, reading) : `${refsOf(halted,
|
|
4618
|
+
const detail = state === "repeating" ? `Found problems: runs again once ${body.join(", ")} ${body.length === 1 ? "has" : "have"} landed` : state === "stopped" ? task.loopStranded ? strandedDetail(check2, task.dependencies, reading) : `${refsOf(halted, reading).join(", ")} did not pass: retry ${halted.length === 1 ? "it" : "them"} and the loop goes on` : null;
|
|
4567
4619
|
return { role: "check", state, label: loopCheckLabel(check2, state), detail, body };
|
|
4568
4620
|
}
|
|
4569
|
-
const owner = reading
|
|
4621
|
+
const owner = reading?.checks.get(task.id);
|
|
4570
4622
|
if (!owner?.loop) return null;
|
|
4571
|
-
const [check] = refsOf([owner.id],
|
|
4623
|
+
const [check] = refsOf([owner.id], reading);
|
|
4572
4624
|
const round = loopBodyRound({ status: owner.status ?? "", loopRound: owner.loopRound }, task.status);
|
|
4573
4625
|
return { role: "body", label: loopBodyLabel(check, round, owner.loop.maxRounds), check, round };
|
|
4574
4626
|
}
|
|
@@ -4592,8 +4644,7 @@ function taskRowView(task, context = {}) {
|
|
|
4592
4644
|
const isolation = task.isolation && task.isolation.state !== "none" ? task.isolation : null;
|
|
4593
4645
|
const spend = taskUsageSummary(task);
|
|
4594
4646
|
const latestAttempt = task.attemptUsage?.at(-1);
|
|
4595
|
-
const
|
|
4596
|
-
const reading = tasks?.length ? { tasks, blocks: planBlocks(asBlocking(tasks)) } : null;
|
|
4647
|
+
const reading = readingOf(task, context.tasks);
|
|
4597
4648
|
const blocked = blockedBy(task, reading);
|
|
4598
4649
|
const loop = loopOf(task, reading);
|
|
4599
4650
|
return {
|
|
@@ -4617,18 +4668,18 @@ function taskRowView(task, context = {}) {
|
|
|
4617
4668
|
...flagOf(task, context.runnerScope),
|
|
4618
4669
|
autonomous: task.type === "ai" && context.modes?.find((m) => m.id === task.taskMode)?.autonomous === true,
|
|
4619
4670
|
repos: namedRepos(isolation?.repos),
|
|
4620
|
-
conflict: isolation?.state === "conflict" && !isolation.repairWaits ? { repo: namedRepo(isolation.conflictRepo), files: filesOf(isolation.conflictFiles), resolver: isolation.resolver ? refsOf([isolation.resolver],
|
|
4671
|
+
conflict: isolation?.state === "conflict" && !isolation.repairWaits ? { repo: namedRepo(isolation.conflictRepo), files: filesOf(isolation.conflictFiles), resolver: isolation.resolver ? refsOf([isolation.resolver], reading)[0] : null } : null,
|
|
4621
4672
|
repairWaiting: isolation?.state === "conflict" && isolation.repairWaits ? { label: repairWaitLabel(isolation.repairWaits), files: filesOf(isolation.conflictFiles) } : null,
|
|
4622
4673
|
repairing: isolation?.state === "repairing" ? { files: filesOf(isolation.conflictFiles), attempt: isolation.repair ?? null } : null,
|
|
4623
4674
|
repaired: isolation?.repairedFiles?.length ? { files: capConflictFiles(isolation.repairedFiles), landed: isolation.state === "integrated" } : null,
|
|
4624
|
-
mergeGate: task.mergeGate?.length ? refsOf(task.mergeGate,
|
|
4625
|
-
blockedBy: blocked.length > 0 ? refsOf(blocked,
|
|
4675
|
+
mergeGate: task.mergeGate?.length ? refsOf(task.mergeGate, reading) : null,
|
|
4676
|
+
blockedBy: blocked.length > 0 ? refsOf(blocked, reading) : null,
|
|
4626
4677
|
skipReason: task.status === "skipped" ? task.skipReason ?? null : null,
|
|
4627
4678
|
opsChangedFiles: task.status === "awaiting_user" && task.awaitingReason === "files-changed",
|
|
4628
4679
|
forcedPastGate: task.forcedPastGate?.length ? task.forcedPastGate : null,
|
|
4629
4680
|
loop,
|
|
4630
4681
|
handoff: handoffOf2(task),
|
|
4631
|
-
dependencies: refsOf(task.dependencies,
|
|
4682
|
+
dependencies: refsOf(task.dependencies, reading),
|
|
4632
4683
|
// A block read off the plan offers what a stored one does: Skip among them.
|
|
4633
4684
|
actions: taskRowActions({ ...task, ...blocked.length > 0 ? { status: "blocked" } : {}, ...isolation?.repairWaits ? { repairWaits: isolation.repairWaits } : {} }, context.placement ?? (parent ? "subtask" : "task")),
|
|
4634
4685
|
// Read off the mark itself: a task with merges left and no record has state `none`.
|
|
@@ -4779,6 +4830,7 @@ export {
|
|
|
4779
4830
|
handoffDigest,
|
|
4780
4831
|
namedHandoff,
|
|
4781
4832
|
parsePlanPath,
|
|
4833
|
+
parseListingPage,
|
|
4782
4834
|
nodeText,
|
|
4783
4835
|
parseFindingRef,
|
|
4784
4836
|
resolveWrittenRef,
|
|
@@ -4882,11 +4934,16 @@ export {
|
|
|
4882
4934
|
trailerSummary,
|
|
4883
4935
|
autorunSummary,
|
|
4884
4936
|
delegationSummary,
|
|
4937
|
+
keptDelegationBudget,
|
|
4885
4938
|
DELEGATION_OFFERED,
|
|
4886
4939
|
containersOffered,
|
|
4887
4940
|
ACT_RISK,
|
|
4888
4941
|
AUTORUN_RISK,
|
|
4889
4942
|
DELEGATION_RISK,
|
|
4943
|
+
rememberDelegationBudget,
|
|
4944
|
+
SUBPLANNER_SCOPE,
|
|
4945
|
+
SUBPLANNER_ACCOUNTING,
|
|
4946
|
+
SUBPLANNER_CHILD,
|
|
4890
4947
|
parseSwitch,
|
|
4891
4948
|
parseDelegation,
|
|
4892
4949
|
parseCount,
|
|
@@ -4909,6 +4966,7 @@ export {
|
|
|
4909
4966
|
mergePastChecksConfirmation,
|
|
4910
4967
|
sessionOwner,
|
|
4911
4968
|
continuability,
|
|
4969
|
+
reopenMessage,
|
|
4912
4970
|
canContinue,
|
|
4913
4971
|
blockingFailures,
|
|
4914
4972
|
repeatingChecks,
|
|
@@ -4995,4 +5053,4 @@ export {
|
|
|
4995
5053
|
logResumes,
|
|
4996
5054
|
taskLogHeaderView
|
|
4997
5055
|
};
|
|
4998
|
-
//# sourceMappingURL=chunk-
|
|
5056
|
+
//# sourceMappingURL=chunk-3S5IVTZM.mjs.map
|