@sjawhar/pi-legion 19.29.5 → 19.30.0

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 CHANGED
@@ -26415,7 +26415,8 @@ var EnvelopeResponseSchema = EnvelopeSchema.extend({
26415
26415
  });
26416
26416
  var PublishResponseSchema = EnvelopeResponseSchema.extend({
26417
26417
  kept: boolean2().optional(),
26418
- kept_reason: _enum2(["unclaimed", "holder_lapsed"]).optional()
26418
+ kept_reason: _enum2(["unclaimed", "holder_lapsed"]).optional(),
26419
+ kept_until: number2().int().optional()
26419
26420
  });
26420
26421
  var DeliveryRefusalSchema = object({
26421
26422
  mode: string2(),
@@ -26658,7 +26659,7 @@ function createEnvoyClient(config) {
26658
26659
  confirmed: response.recipient !== undefined,
26659
26660
  recipientState: response.recipient_state ?? "live",
26660
26661
  state: response.state === "stopped" ? "stopped" : "connected",
26661
- ...response.last_seen === undefined || response.last_seen <= 0 ? {} : { lastSeen: response.last_seen },
26662
+ ...lastSeenOf(response.last_seen),
26662
26663
  duplicate: response.duplicate === true
26663
26664
  };
26664
26665
  },
@@ -26678,10 +26679,12 @@ function createEnvoyClient(config) {
26678
26679
  envelope: response,
26679
26680
  ...response.holder === undefined ? {} : { holder: response.holder },
26680
26681
  ...response.holder_state === undefined ? {} : { holderState: response.holder_state },
26682
+ ...lastSeenOf(response.last_seen),
26681
26683
  ...response.recipients === undefined ? {} : { recipients: response.recipients },
26682
26684
  ...response.recipients_connected === undefined ? {} : { recipientsConnected: response.recipients_connected },
26683
26685
  ...response.kept === undefined ? {} : { kept: response.kept },
26684
- ...response.kept_reason === undefined ? {} : { keptReason: response.kept_reason }
26686
+ ...response.kept_reason === undefined ? {} : { keptReason: response.kept_reason },
26687
+ ...response.kept_until === undefined ? {} : { keptUntil: response.kept_until }
26685
26688
  };
26686
26689
  },
26687
26690
  unregisterSession: async (input) => {
@@ -26748,6 +26751,9 @@ function messageMetadata(input) {
26748
26751
  function sourceSession(sessionID) {
26749
26752
  return sessionID === undefined || sessionID === "" ? {} : { source_session: sessionID };
26750
26753
  }
26754
+ function lastSeenOf(lastSeen) {
26755
+ return lastSeen === undefined || lastSeen <= 0 ? {} : { lastSeen };
26756
+ }
26751
26757
 
26752
26758
  // ../contracts/src/legion-claim-recovery.ts
26753
26759
  var nonEmptyString = string2().min(1);
@@ -28403,12 +28409,15 @@ function createPhaseReminder(deps) {
28403
28409
  lastMessage
28404
28410
  }),
28405
28411
  idempotencyKey: key,
28406
- sourceSessionID: claim.sessionID,
28407
- keep: false
28412
+ sourceSessionID: claim.sessionID
28408
28413
  });
28409
28414
  if (reportKey !== key)
28410
28415
  return;
28411
28416
  if (answer.kept === true) {
28417
+ if (answer.keptUntil === undefined) {
28418
+ reportKey = undefined;
28419
+ writeEntry();
28420
+ }
28412
28421
  deps.log.debug("legion: the listener kept the architect notice; telling it again later", {
28413
28422
  issue: claim.issue,
28414
28423
  reminders
@@ -29763,7 +29772,7 @@ import { logger as logger3 } from "@oh-my-pi/pi-utils";
29763
29772
  // package.json
29764
29773
  var package_default = {
29765
29774
  name: "@sjawhar/pi-legion",
29766
- version: "19.29.5",
29775
+ version: "19.30.0",
29767
29776
  license: "Apache-2.0",
29768
29777
  type: "module",
29769
29778
  omp: {
@@ -30886,8 +30895,7 @@ function createStallTeller(deps) {
30886
30895
  message: input.message,
30887
30896
  payload: input.payload,
30888
30897
  idempotencyKey: input.key,
30889
- sourceSessionID: claim.sessionID,
30890
- keep: false
30898
+ sourceSessionID: claim.sessionID
30891
30899
  });
30892
30900
  if (answer.kept === true) {
30893
30901
  deps.log.warn("legion: the listener kept the stall notice; no owner has taken it", {
@@ -53,11 +53,14 @@ The work goes to whoever already owns that code. You file an issue only when nob
53
53
  `notifications.role.<issues.<KEY>.architect.locator.claim>`. The architect decides whether it
54
54
  is a child of the tree or part of an open issue's work. Reply `Handed dispatch://<that KEY>`
55
55
  under the evidence only when a live holder took the publish. When the root has no locator, or
56
- the listener kept the publish for the role's next holder, reply nothing: no architect reads a
57
- comment on its root, so the evidence stays unhandled, and catch-up step 4 lists it again at
58
- your next start. Publish it again at your next wake. Once the root leaves `admission.trees`,
59
- no running tree owns the code, and step 4 files it. File nothing while a tree owns it: a
60
- second issue splits the work.
56
+ the listener kept the publish because no live session holds the role, reply nothing: no
57
+ architect reads a comment on its root, so the evidence stays unhandled, and catch-up step 4
58
+ lists it again at your next start. A kept publish waits one hour, until the `kept_until` its
59
+ answer names, for the role's next live holder. If no session takes it in that hour, Envoy
60
+ drops it, and when your publish named your session, sends your session a message that names
61
+ it, unless it dropped it more than an hour late. Publish it again at your next wake.
62
+ Once the root leaves `admission.trees`, no running tree owns the code, and step 4 files it.
63
+ File nothing while a tree owns it: a second issue splits the work.
61
64
  4. No running tree owns that code: file it on the repository where the fix belongs, in the
62
65
  project that repository maps to:
63
66
 
@@ -18,10 +18,12 @@ If the deployment instructions (the `# Deployment instructions` part of your sys
18
18
  `oracle` task agent), send your question to it first with
19
19
  `envoy_publish(topic="notifications.role.<name>", expects_reply="required")`, because that role may
20
20
  already hold the answer. Then end your turn: the reply arrives as a delivery that starts your next
21
- one, and research before it duplicates the role's work. If no session holds the role, the publish
22
- answers that Envoy kept the question for the session that claims the role next, which is handed it
23
- once within the hour. Nobody can answer you now, so put that kept answer in your output and
24
- research at once rather than wait for it.
21
+ one, and research before it duplicates the role's work. If no live session holds the role, the
22
+ publish answers that Envoy kept the question for one hour, until its `kept_until`, and the next
23
+ session to hold the role live in that hour is handed it once. If none does, Envoy drops it, and
24
+ when your publish named your session, sends your session a message that names it, unless it
25
+ dropped it more than an hour late. Nobody can answer you now, so put that kept answer in your
26
+ output and research at once rather than wait for it.
25
27
 
26
28
  Run steps 1 and 2, in parallel if you choose, since neither needs the other's result. Run step 3
27
29
  when the question names a library, and step 4 when it asks for general practice, each only when
@@ -77,17 +77,17 @@ next look of its own.
77
77
  The controller topic is a live wake: a message published while no controller runs reaches nobody
78
78
  at the time. `envoy_publish`'s own answer tells you whether one took it. A publish to a role
79
79
  answers with its live `holder`, and with no count of recipients: the listener forwards a role
80
- message to its holder alone. With no claim on `legion-<project>-controller` at all, the answer
81
- says Envoy kept the message instead (`packages/envoy/cmd/listener`, the test "unheld role is kept
82
- and answered 202 without publishing on the role topic"): the next session that claims the role is
83
- handed each kept message once, within one hour of the keep. A keep is not a delivery: a
84
- controller can stay away for the whole hour, and a message kept longer than an hour is dropped
85
- unread, so a kept finding can reach nobody. It fails with `role legion-<project>-controller
86
- holder <session> lapsed; claim retained`, naming the holder, its `holder_state` and its
87
- `last_seen`, when a controller holds the role and its session has not registered within the live
88
- window: an `unresponsive` controller is not a stopped one, so release nothing, take nothing from
89
- it, and publish no second copy.
90
- Treat a kept answer as a controller not taking it. Either way the finding has not been taken yet,
80
+ message to its holder alone. When no live session holds `legion-<project>-controller`, because
81
+ nobody claims it or its holder has not registered within the live window, the answer says Envoy
82
+ kept the message for one hour, and its `kept_until` is the time that hour ends. The next session
83
+ to hold the role live in that hour is handed it once. A keep is not a delivery: a controller can
84
+ stay away for the whole hour, and Envoy then drops the message unread, so a kept finding can
85
+ reach nobody. When your publish named your session, Envoy also sends your session a message that
86
+ names the dropped one, unless it dropped it more than an hour late. For a holder that is not
87
+ live, the answer also names that holder, its `holder_state` and its `last_seen`: an
88
+ `unresponsive` controller is not a stopped one, so release nothing, take nothing from it, and
89
+ publish no second copy.
90
+ Treat a kept answer as a controller not taking it. The finding has not been taken yet,
91
91
  so make it an ask, as
92
92
  [What the ask says](#what-the-ask-says) spells it, on the first
93
93
  of these that holds, so a person sees it and the controller finds it when it returns:
@@ -146,7 +146,7 @@ the three `-alone` ones among them - runs on a pull request labelled `full-ci`,
146
146
  queue and nightly, and the `alone` job that holds the wall-clock rows is gated on it
147
147
  (`if: inputs.lane == 'full'` under `alone:` in `.github/workflows/dispatch-browser.yaml`), so no
148
148
  unlabelled pull request runs a wall-clock row at all. One spec needs
149
- the same stack as all of them: a Postgres with pgvector. On a digest
149
+ the same stack as all the specs: a Postgres with pgvector. On a digest
150
150
  carrying `legion-testpg`, use the pod's own server
151
151
  (`skill://legion-worker/references/tools.md#the-database-your-tests-use`) and
152
152
  unpack nothing. On a digest without it, the way
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion",
3
- "version": "19.29.5",
3
+ "version": "19.30.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {