@sjawhar/pi-legion 18.45.0 → 18.46.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.
Files changed (2) hide show
  1. package/dist/legion.js +10 -3
  2. package/package.json +1 -1
package/dist/legion.js CHANGED
@@ -14335,7 +14335,7 @@ import { logger as logger3 } from "@oh-my-pi/pi-utils";
14335
14335
  // package.json
14336
14336
  var package_default = {
14337
14337
  name: "@sjawhar/pi-legion",
14338
- version: "18.45.0",
14338
+ version: "18.46.0",
14339
14339
  license: "Apache-2.0",
14340
14340
  type: "module",
14341
14341
  omp: {
@@ -15850,7 +15850,7 @@ function phaseOpParameters(zod) {
15850
15850
  }
15851
15851
  var PHASE_OP_SENTENCES = {
15852
15852
  readRecord: "read_record returns the record of `issue` from the daemon's state. ",
15853
- 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 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. ",
15853
+ 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. ",
15854
15854
  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. "
15855
15855
  };
15856
15856
  function legionToolDescription(host) {
@@ -15960,13 +15960,19 @@ async function releaseRecords(runtime, since) {
15960
15960
  }
15961
15961
  let releasedMs = 0;
15962
15962
  let wokenSoon = 0;
15963
+ let suspendedNoRole = 0;
15963
15964
  for (const release of records.releases) {
15965
+ if (release.roles.length === 0) {
15966
+ suspendedNoRole += 1;
15967
+ continue;
15968
+ }
15964
15969
  const from = Date.parse(release.at);
15965
15970
  const woken = wokenAt.get(release.id);
15966
15971
  releasedMs += Math.max((woken ?? asOf.getTime()) - from, 0);
15967
15972
  if (woken !== undefined && woken - from <= WOKEN_SOON_MS)
15968
15973
  wokenSoon += 1;
15969
15974
  }
15975
+ const wakeable = records.releases.length - suspendedNoRole;
15970
15976
  const waits = records.resumes.flatMap((resume) => resume.firstTurnAt === undefined ? [] : [(Date.parse(resume.firstTurnAt) - Date.parse(resume.at)) / 1000]).sort((one, other) => one - other);
15971
15977
  const whole = (value) => value === null ? null : Math.round(value);
15972
15978
  return {
@@ -15977,6 +15983,7 @@ async function releaseRecords(runtime, since) {
15977
15983
  holds: records.holds,
15978
15984
  counts: {
15979
15985
  releases: records.releases.length,
15986
+ releasesSuspendingNoRole: suspendedNoRole,
15980
15987
  resumes: records.resumes.length,
15981
15988
  resumesByKind: countedBy(records.resumes, (resume) => resume.kind),
15982
15989
  holds: records.holds.length,
@@ -15985,7 +15992,7 @@ async function releaseRecords(runtime, since) {
15985
15992
  podHoursReleased: Math.round(releasedMs / 3600000 * 100) / 100,
15986
15993
  wokenWithinTenMinutes: {
15987
15994
  releases: wokenSoon,
15988
- share: records.releases.length === 0 ? 0 : Math.round(wokenSoon / records.releases.length * 1000) / 1000
15995
+ share: wakeable === 0 ? 0 : Math.round(wokenSoon / wakeable * 1000) / 1000
15989
15996
  },
15990
15997
  wakeToFirstTurnSeconds: {
15991
15998
  measured: waits.length,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion",
3
- "version": "18.45.0",
3
+ "version": "18.46.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {