@sjawhar/pi-envoy 10.17.6 → 10.17.8

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/dispatch.js CHANGED
@@ -15027,13 +15027,34 @@ function machineID() {
15027
15027
 
15028
15028
  // ../envoy-client/src/dispatch-cwd.ts
15029
15029
  var execFileAsync = promisify(execFile);
15030
- var defaultExec = (file2, args, options) => execFileAsync(file2, args, { cwd: options.cwd, timeout: 5000 });
15031
- async function tryExec(exec, file2, args, cwd) {
15030
+ var defaultExec = (file2, args, { cwd, signal }) => {
15031
+ const call = execFileAsync(file2, args, { cwd, signal });
15032
+ const kill = () => call.child.kill("SIGKILL");
15033
+ if (signal.aborted)
15034
+ kill();
15035
+ else
15036
+ signal.addEventListener("abort", kill, { once: true });
15037
+ return call;
15038
+ };
15039
+ var REMOTE_LOOKUP_MS = 5000;
15040
+ var TMUX_PANE_LOOKUP_MS = 1000;
15041
+ async function tryExec(exec, file2, args, cwd, limitMs) {
15042
+ const controller = new AbortController;
15043
+ const expired = Promise.withResolvers();
15044
+ const timer = setTimeout(() => {
15045
+ controller.abort();
15046
+ expired.resolve(null);
15047
+ }, limitMs);
15032
15048
  try {
15033
- const { stdout } = await exec(file2, args, { cwd });
15034
- return stdout;
15049
+ const answer = await Promise.race([
15050
+ exec(file2, args, { cwd, signal: controller.signal }),
15051
+ expired.promise
15052
+ ]);
15053
+ return answer?.stdout ?? null;
15035
15054
  } catch {
15036
15055
  return null;
15056
+ } finally {
15057
+ clearTimeout(timer);
15037
15058
  }
15038
15059
  }
15039
15060
  function parseRemoteList(stdout) {
@@ -15072,12 +15093,12 @@ function parseGitHubRemoteUrl(url2) {
15072
15093
  return null;
15073
15094
  }
15074
15095
  async function resolveCwdRepo(cwd, exec) {
15075
- const jjOutput = await tryExec(exec, "jj", ["git", "remote", "list"], cwd);
15096
+ const jjOutput = await tryExec(exec, "jj", ["git", "remote", "list"], cwd, REMOTE_LOOKUP_MS);
15076
15097
  if (jjOutput !== null) {
15077
15098
  const url2 = selectRemoteUrl(parseRemoteList(jjOutput));
15078
15099
  return url2 ? parseGitHubRemoteUrl(url2) : null;
15079
15100
  }
15080
- const originUrl = await tryExec(exec, "git", ["remote", "get-url", "origin"], cwd);
15101
+ const originUrl = await tryExec(exec, "git", ["remote", "get-url", "origin"], cwd, REMOTE_LOOKUP_MS);
15081
15102
  return originUrl ? parseGitHubRemoteUrl(originUrl) : null;
15082
15103
  }
15083
15104
  async function resolveOrigin(env, exec, cwd) {
@@ -15087,7 +15108,7 @@ async function resolveOrigin(env, exec, cwd) {
15087
15108
  };
15088
15109
  const pane = env.TMUX_PANE;
15089
15110
  if (pane) {
15090
- const output = await tryExec(exec, "tmux", ["display-message", "-p", "-t", pane, "#S:#I.#P #{pane_id}"], cwd);
15111
+ const output = await tryExec(exec, "tmux", ["display-message", "-p", "-t", pane, "#S:#I.#P #{pane_id}"], cwd, TMUX_PANE_LOOKUP_MS);
15091
15112
  const [target, paneId] = output?.trim().split(" ") ?? [];
15092
15113
  if (target)
15093
15114
  origin.tmux = target;
@@ -98,6 +98,8 @@ Outside Legion, the session doing the work moves its issue and the children it o
98
98
 
99
99
  A design decision a document records is a decision block in it, at every phase, approved or not. A block in an approved document makes the approval stale until its answer. A Legion phase worker sends the decision to its architect (`skill://legion-worker`). A to-do or permission only a human can give, or a decision with no document, is a `dispatch ask`. The gates apply to both.
100
100
 
101
+ In a Legion session, a role or any of its subagents that finds a problem outside its own issue never files an issue for it (the issue creation in [Your owner](#your-owner) included). It opens a `dispatch ask` as `skill://legion-worker/references/findings.md` says, on the issue that reference names. That overrides "Ask on your own issue" in gate 1, and gate 4's rule to ask nothing beside what the human asked for.
102
+
101
103
  ### Before you ask
102
104
 
103
105
  1. **Does it need the human's authority, taste or risk appetite?** Your lane decides schema shapes, field names and migration internals. Decide them in the plan or code, not in the spec. Settle a two-lane contract over Envoy, with no ask. A halt condition passes the gate. That is an IAM change, deleting or exposing production data, or anything that reaches a customer. Ask on your own issue.
@@ -28,6 +28,7 @@ dispatch search --query 'reviewer threads OR review comments'
28
28
  - **Question already decided:** the answered ask is the record. Cite it (`dispatch://KEY/ask/<id>`) where you rely on it. Do not ask again.
29
29
  - **Duplicate found:** keep the issue with the spec and the discussion, and copy over what only the duplicate has. Then close it: `dispatch issue-update --issue <KEY> --status done --reason 'Duplicate of dispatch://KEY.'`. If it has the `legion` label, or another session or a human holds its claim, comment on it with the survivor's name. Do not close it.
30
30
  - **Every ask and message stands alone:** the reader sees only that text. Put the facts, the options and your recommendation in it. Link what you cite (`dispatch://…`). Never write "see above" or "my earlier message".
31
+ - **In a Legion session, a finding outside your own issue is never an issue you file.** A Legion role, and each of its subagents, opens a `dispatch ask` as `skill://legion-worker/references/findings.md` says, in place of filing above.
31
32
 
32
33
  ## Design in the spec
33
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-envoy",
3
- "version": "10.17.6",
3
+ "version": "10.17.8",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {