@sjawhar/pi-legion 18.50.2 → 18.50.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/legion.js +15 -7
- package/package.json +1 -1
package/dist/legion.js
CHANGED
|
@@ -14337,7 +14337,7 @@ import { logger as logger3 } from "@oh-my-pi/pi-utils";
|
|
|
14337
14337
|
// package.json
|
|
14338
14338
|
var package_default = {
|
|
14339
14339
|
name: "@sjawhar/pi-legion",
|
|
14340
|
-
version: "18.50.
|
|
14340
|
+
version: "18.50.3",
|
|
14341
14341
|
license: "Apache-2.0",
|
|
14342
14342
|
type: "module",
|
|
14343
14343
|
omp: {
|
|
@@ -15803,12 +15803,13 @@ var operation = (op, shape) => strictObject({ op: literal(op), ...shape }, {
|
|
|
15803
15803
|
error: (issue) => issue.code === "unrecognized_keys" ? issue.keys.map((key) => `${op} does not accept field "${key}"`).join("; ") : undefined
|
|
15804
15804
|
});
|
|
15805
15805
|
var PhaseOpArguments = discriminatedUnion("op", [
|
|
15806
|
-
operation("read_record", { issue:
|
|
15806
|
+
operation("read_record", { issue: string2().optional() }),
|
|
15807
15807
|
operation("read_release_records", {
|
|
15808
15808
|
since: windowStart
|
|
15809
15809
|
}),
|
|
15810
15810
|
operation("handoff_complete", {
|
|
15811
15811
|
summary: requiredString("handoff_complete", "summary"),
|
|
15812
|
+
issue: string2().optional(),
|
|
15812
15813
|
verdict: _enum(["pass", "pending", "fail"], {
|
|
15813
15814
|
error: "handoff_complete's verdict is pass, pending or fail"
|
|
15814
15815
|
}).optional(),
|
|
@@ -15851,7 +15852,7 @@ function phaseOpParameters(zod) {
|
|
|
15851
15852
|
return byField;
|
|
15852
15853
|
}
|
|
15853
15854
|
var PHASE_OP_SENTENCES = {
|
|
15854
|
-
readRecord: "read_record returns the record of `issue` from the daemon's state. ",
|
|
15855
|
+
readRecord: "read_record returns the record of `issue` from the daemon's state, your own issue when you leave `issue` out. ",
|
|
15855
15856
|
readReleaseRecords: "read_release_records returns this deployment's idle-release records from `since` (an RFC 3339 time) on, read with this session's own claim: " + "every release, resume and hold the daemon recorded, and over them the counts of releases, of the releases among them that suspended no " + "role, of resumes by wake kind and of holds by reason, the pod-hours released, the share of releases woken again within ten minutes, and " + "the median, 90th percentile and maximum seconds from a wake to the woken role's first turn. A release that suspended no role is woken by " + "nothing, so the pod-hours released and the woken share count the releases that suspended a role alone. ",
|
|
15856
15857
|
requestBackwardMove: "request_backward_move returns an issue to an earlier phase (`to`, `reason`): a phase worker moves its own issue; " + "the tree's architect moves an issue in accepting, named by `issue`, back to implementing or testing, which counts a review round. "
|
|
15857
15858
|
};
|
|
@@ -15889,12 +15890,19 @@ async function executePhaseOp(runtime, input) {
|
|
|
15889
15890
|
}
|
|
15890
15891
|
const args = parsed.data;
|
|
15891
15892
|
switch (args.op) {
|
|
15892
|
-
case "read_record":
|
|
15893
|
-
|
|
15893
|
+
case "read_record": {
|
|
15894
|
+
const issue = args.issue !== undefined && args.issue.trim() !== "" ? args.issue : claim.issue;
|
|
15895
|
+
return { record: recordFrom(await daemon.state(), issue) };
|
|
15896
|
+
}
|
|
15894
15897
|
case "read_release_records":
|
|
15895
15898
|
return releaseRecords(runtime, args.since);
|
|
15896
|
-
case "handoff_complete":
|
|
15899
|
+
case "handoff_complete": {
|
|
15900
|
+
const named = args.issue?.trim() ?? "";
|
|
15901
|
+
if (named !== "" && named !== claim.issue) {
|
|
15902
|
+
throw new Error(`handoff_complete reports this session's own issue ${claim.issue}; leave issue out, or name ${claim.issue}, not ${named}`);
|
|
15903
|
+
}
|
|
15897
15904
|
return retryWhileDaemonRestarts("handoff_complete", () => completeHandoff(runtime, args), runtime.restart);
|
|
15905
|
+
}
|
|
15898
15906
|
case "request_backward_move": {
|
|
15899
15907
|
let issue;
|
|
15900
15908
|
if (claim.role === "architect") {
|
|
@@ -16157,7 +16165,7 @@ function createLegionTool(deps) {
|
|
|
16157
16165
|
label: "legion",
|
|
16158
16166
|
description: legionToolDescription({
|
|
16159
16167
|
envoyPublish: "envoy_publish",
|
|
16160
|
-
before: PHASE_OP_SENTENCES.readReleaseRecords,
|
|
16168
|
+
before: PHASE_OP_SENTENCES.readRecord + PHASE_OP_SENTENCES.readReleaseRecords,
|
|
16161
16169
|
after: PHASE_OP_SENTENCES.requestBackwardMove + "sign_off is the architect's acceptance of an issue in accepting, moving it to retro; the daemon refuses it in every " + "other phase (SIGNOFF_OUTSIDE_ACCEPTING) and while an issue beneath it is still in the workflow " + "(SIGNOFF_CHILD_IN_WORKFLOW, naming each one), since a parent's head proves its children's merged work: take each one " + "to done, or out of the workflow with park_child, and sign off again. close_root is refused the same way and with the " + "same code while an issue beneath the root is still in the workflow, since closing it would stop that work mid-turn. " + "release_children and rerun_child are refused for a child whose ancestor is in retro, merging or awaiting_merge " + "(CHILD_UNDER_ACCEPTED_PARENT, naming the ancestor), since that ancestor's approved head cannot carry work released " + "under it now: wait for the ancestor to close, then release it. " + "The controller's read_state returns the daemon's whole state and set_status moves an issue to todo, backlog or icebox. " + "fresh_session (issue, role) has one claim leave the session it runs in behind and start again in a new one: the daemon " + "stops the agent if it runs, forgets the session, and starts the claim, which loses everything that session held. A " + "phase worker that comes back owing no task is started through its issue's current phase, so it has that phase's work. " + "The answer is empty when the claim came back and nothing else is to be said, and names why nothing restarted the " + "phase (phaseNotRestarted) when the claim came back owing no task and the workflow refused that restart: the claim is " + "running, and no work was handed to it. " + "The daemon refuses it for a claim it records as working, which may be in a turn " + "(CLAIM_IN_A_TURN), for a claim left working over a process the daemon's last report " + "of it found gone, where no turn is running (CLAIM_IN_A_TURN as well), for a claim a " + "suspension is held over, in whatever state the hold found it (CLAIM_IN_A_TURN where " + "the claim is working, CLAIM_UNSETTLED where it is not), for a claim between states \u2014 " + "one queued, one whose launch is in flight, and one left working under a relaunch the " + "wake pacing parked (CLAIM_UNSETTLED) \u2014 and for role controller. " + "compact (issue, role) shortens one claim's session instead: the daemon has Oh My Pi write a text summary of the " + "session so far, and the claim keeps its session, its workspace and everything it knows of its issue and is sent " + "whatever task it owes again. Try compact before fresh_session for a claim that stays stuck. The answer says " + "whether the session was compacted and, when it was not, why; the claim is back either way. The daemon refuses " + "it for a claim that is suspended, failed or retired (CLAIM_NOT_RUNNING: fresh_session " + "reaches that one), for a claim it records as working, which may be in a turn " + "(CLAIM_IN_A_TURN), for a claim left working over a process the daemon's last report " + "of it found gone, where no turn is running (CLAIM_IN_A_TURN), for a claim a " + "suspension is held over (CLAIM_IN_A_TURN where the claim is working, CLAIM_UNSETTLED " + "where it is not), for a claim between states \u2014 one queued, one whose launch is in " + "flight, one whose agent has registered and is not ready yet, which fresh_session " + "reaches, and one left working under a relaunch the wake pacing parked " + "(CLAIM_UNSETTLED) \u2014 for a claim whose role runs on Claude Code (CLAIM_NOT_ON_OMP) " + "and for role controller. " + "Each refusal says what the claim does now and which operation reaches each state. It " + "names no moment to come back at: ask again later, and read the claim's state in " + "read_state. "
|
|
16162
16170
|
}),
|
|
16163
16171
|
defaultInactive: true,
|