@sjawhar/opencode-legion-envoy 5.6.5 → 5.7.1

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.
@@ -15449,6 +15449,32 @@ function renderAdvice(tool, key, advice, opts) {
15449
15449
  }
15450
15450
  return lines;
15451
15451
  }
15452
+ function renderSuggestions(suggestions, configUrl) {
15453
+ if (suggestions === undefined)
15454
+ return [];
15455
+ if (suggestions.missing !== undefined) {
15456
+ return [`Related-item search was skipped: ${suggestions.missing}.`];
15457
+ }
15458
+ const lines = [];
15459
+ if (suggestions.related.length > 0) {
15460
+ lines.push("Possibly related, found by search:");
15461
+ for (const item of suggestions.related) {
15462
+ lines.push(`- ${suggestionLabel(item)} \u2192 ${new URL(item.href, configUrl).toString()}`);
15463
+ }
15464
+ }
15465
+ if (suggestions.decision !== undefined) {
15466
+ const item = suggestions.decision;
15467
+ const when = item.answered_at === undefined ? "" : ` on ${item.answered_at}`;
15468
+ lines.push(`A past decision may already answer this: ${suggestionLabel(item)}, answered by ${item.answered_by}${when} \u2192 ${new URL(item.href, configUrl).toString()}`);
15469
+ }
15470
+ return lines;
15471
+ }
15472
+ function suggestionLabel(item) {
15473
+ if (item.owner.kind === "issue") {
15474
+ return `${item.owner.key} [${item.owner.status}] ${item.owner.title}`;
15475
+ }
15476
+ return `${item.owner.name} (${item.owner.project}/${item.owner.slug})`;
15477
+ }
15452
15478
  function documentResultDetails(artifact) {
15453
15479
  return {
15454
15480
  project: artifact.project,
@@ -16626,7 +16652,8 @@ async function executeDispatchTool(input) {
16626
16652
  ...renderAdvice(input.tool, created.key, created.advice, {
16627
16653
  isPrimarySpec: spec !== undefined
16628
16654
  }),
16629
- ...componentGuidance === undefined ? [] : [componentGuidance]
16655
+ ...componentGuidance === undefined ? [] : [componentGuidance],
16656
+ ...renderSuggestions(created.advice?.suggestions, configUrl)
16630
16657
  ];
16631
16658
  return {
16632
16659
  text: [
@@ -16906,7 +16933,10 @@ async function executeDispatchTool(input) {
16906
16933
  };
16907
16934
  const ask = resolved?.owner.kind === "project" ? await client.artifactAsk(resolved.artifact.id, askInput) : await client.ask(issue2(), askInput);
16908
16935
  const askOwner = ask.issue_key !== null ? issueTopic(ask.issue_key) : resolved === undefined ? issueTopic(issue2()) : documentTopic(resolved.artifact);
16909
- const adviceLines = renderAdvice(input.tool, askOwner.label, ask.advice, {});
16936
+ const adviceLines = [
16937
+ ...renderAdvice(input.tool, askOwner.label, ask.advice, {}),
16938
+ ...renderSuggestions(ask.advice?.suggestions, configUrl)
16939
+ ];
16910
16940
  return {
16911
16941
  text: [
16912
16942
  `Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "5.6.5",
3
+ "version": "5.7.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "dist/src/server.js",
@@ -27,6 +27,10 @@ parent's children and the issue's `Components:` line show where the rest of that
27
27
 
28
28
  ## What to do with what you find
29
29
 
30
+ Filing an issue or opening an ask also searches for you: the result's `advice.suggestions` names
31
+ likely duplicates or a decision that may already settle it. Treat a hit there the same as one you
32
+ found yourself.
33
+
30
34
  - **The work is already tracked: extend that issue.** Put the finding on it (a comment, a message,
31
35
  or an edit to its spec) instead of filing another. File a new issue only when no hit covers the
32
36
  work, and cite the nearest one you ruled out (`dispatch://KEY`).
@@ -250,8 +250,10 @@ The daemon keeps this order from its fixed table; you start none of its steps:
250
250
 
251
251
  1. tester green and review cycles complete;
252
252
  2. on a clean review, the reviewer approves the head by SHA, and the daemon moves the issue to
253
- `retro`. No role pushes a `.legion/` deletion: the approved head still carries `.legion/`, and
254
- the operator removes it from the default branch in a follow-up pull request after the merge;
253
+ `retro`. No role pushes a `.legion/` deletion: the approved head still carries `.legion/`. The
254
+ daemon strips whatever `.legion/` main still carries from the next issue's branch before any of
255
+ its roles start, so that tree's own merge carries the removal onto the default branch; no
256
+ operator sweep follows;
255
257
  3. retro commits its learnings under `docs/solutions/` on top of the approved head; that
256
258
  commit does not void the approval and never returns the tree to the tester or reviewer;
257
259
  4. the merger verifies the current head is the reviewer-approved head plus only commits that
@@ -19,7 +19,9 @@ retrospective's durable output.
19
19
 
20
20
  1. Tester green and all code-review cycles finish.
21
21
  2. The reviewer approves the head. It still carries `.legion/`: no role removes it before the
22
- merge, and the operator removes it from the default branch after the merge.
22
+ merge. The daemon strips whatever `.legion/` main still carries from the next issue's branch
23
+ before any of its roles start, so that tree's own merge carries the removal onto the default
24
+ branch; no operator sweep follows.
23
25
  3. Run this retro: commit durable learnings to `docs/solutions/` and post the retro message on
24
26
  the Dispatch issue.
25
27
  Retro writes **no `.legion` file**, so it never changes the approved head's handoffs.
@@ -397,9 +397,11 @@ pushes nothing.
397
397
 
398
398
  Do not report phase completion until the write, existence check, handoff commit, and push
399
399
  succeed. This is the committed copy the next phase reads after revival. No phase removes
400
- `.legion/`: the reviewer approves a head that carries it, and the operator removes it from the
401
- default branch after the merge. Retro and the post-merge production check write no
402
- `.legion/<phase>.json`, commit no handoff, and report with `handoff_complete` alone (below).
400
+ `.legion/`: the reviewer approves a head that carries it. The daemon strips any `.legion/` still on
401
+ main from the next issue's branch before any of its roles start (dispatch://LEGION-565), so that
402
+ tree's own merge carries the removal onto the default branch; no operator sweep follows. Retro and
403
+ the post-merge production check write no `.legion/<phase>.json`, commit no handoff, and report with
404
+ `handoff_complete` alone (below).
403
405
 
404
406
  ## Completion: report to the architect, then stay
405
407
 
@@ -6,11 +6,13 @@ path it cites is in sjawhar/legion.
6
6
 
7
7
  The order, in full: the tester's evidence green → the reviewer's approval of the head →
8
8
  retro → the merger's READY → the human merge → the implementer's production check. No role
9
- removes `.legion/` before the merge: the approved head carries it, and the operator removes it
10
- from the default branch after the merge. After the approval, only retro's `docs/solutions/`
11
- commit leaves it standing on its own (*Retro*, below). A conflict-forced merge goes back to the
12
- reviewer for a confirmation or a new round, as the fingerprint decides (*The reviewer*, below,
13
- and `skill://legion-worker/references/conflicts-and-rewrites.md`), and any other change voids it.
9
+ removes `.legion/` before the merge: the approved head carries it. The daemon strips whatever
10
+ `.legion/` main still carries from the next issue's branch before any of its roles start
11
+ (dispatch://LEGION-565), so that tree's own merge carries the removal onto the default branch; no
12
+ operator sweep follows. After the approval, only retro's `docs/solutions/` commit leaves it
13
+ standing on its own (*Retro*, below). A conflict-forced merge goes back to the reviewer for a
14
+ confirmation or a new round, as the fingerprint decides (*The reviewer*, below, and
15
+ `skill://legion-worker/references/conflicts-and-rewrites.md`), and any other change voids it.
14
16
 
15
17
  ## The reviewer
16
18