@sjawhar/opencode-legion-envoy 1.47.0 → 1.49.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.
@@ -15053,6 +15053,9 @@ class DispatchClient {
15053
15053
  async syncArchitectureSource(project) {
15054
15054
  return this.#json("POST", ["api", "v1", "projects", project, "architecture-source", "sync"]);
15055
15055
  }
15056
+ async getArchitectureSource(project) {
15057
+ return this.#json("GET", ["api", "v1", "projects", project, "architecture-source"]);
15058
+ }
15056
15059
  async resolveAsk(id, input) {
15057
15060
  return this.#json("POST", ["api", "v1", "asks", id, "resolve"], input);
15058
15061
  }
@@ -15571,6 +15574,20 @@ function componentsChange(input, after) {
15571
15574
  return "components -> inherit";
15572
15575
  }
15573
15576
  }
15577
+ var architectureComponentsAction = 'Review the `dispatch` skill, "Architecture components", to attach it to the parts it changes or mark it as non-architectural with a reason.';
15578
+ async function architectureGuidance(client, project, components) {
15579
+ if (components.mode === "none" || components.ids.length > 0)
15580
+ return;
15581
+ try {
15582
+ await client.getArchitectureSource(project);
15583
+ return `Project ${project} has an architecture model, but this issue is not linked to any of its current components. ${architectureComponentsAction}`;
15584
+ } catch (error) {
15585
+ if (error instanceof DispatchServiceError && error.status === 404 && error.code === "SOURCE_NOT_FOUND") {
15586
+ return;
15587
+ }
15588
+ return `Could not check whether project ${project} has an architecture model: ${messageFor(error)}. ${architectureComponentsAction}`;
15589
+ }
15590
+ }
15574
15591
  function isDuplicateCandidate(value) {
15575
15592
  if (typeof value !== "object" || value === null)
15576
15593
  return false;
@@ -16394,9 +16411,13 @@ async function executeDispatchTool(input) {
16394
16411
  ...Array.isArray(labels) ? { labels } : {},
16395
16412
  actor
16396
16413
  });
16397
- const adviceLines = renderAdvice(input.tool, created.key, created.advice, {
16398
- isPrimarySpec: spec !== undefined
16399
- });
16414
+ const componentGuidance = await architectureGuidance(client, created.project, created.components);
16415
+ const adviceLines = [
16416
+ ...renderAdvice(input.tool, created.key, created.advice, {
16417
+ isPrimarySpec: spec !== undefined
16418
+ }),
16419
+ ...componentGuidance === undefined ? [] : [componentGuidance]
16420
+ ];
16400
16421
  return {
16401
16422
  text: [
16402
16423
  `Created ${created.key}: ${created.title} ${notSubscribed(issueTopic(created.key))}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/opencode-legion-envoy",
3
- "version": "1.47.0",
3
+ "version": "1.49.0",
4
4
  "type": "module",
5
5
  "main": "dist/src/server.js",
6
6
  "exports": {
@@ -302,7 +302,9 @@ that follow from it:
302
302
  the question carries `dispatch://KEY/artifact/<slug>` (or `ref`), never just its filename. Text
303
303
  they must read to decide belongs in the spec in the first place — see [Artifacts](#artifacts).
304
304
 
305
- Attach an issue to the architecture components it changes, before decomposing it — children inherit the parent's attachment unless they choose their own, so attaching the root once classifies the whole tree:
305
+ ## Architecture components
306
+
307
+ Attach every architectural issue to the components it changes. Attach the root before decomposing it: children inherit the root's effective attachment unless they deliberately set their own, so one root attachment classifies the whole tree.
306
308
 
307
309
  ```
308
310
  dispatch_issue({ project: "CORE", title: "...", components: { mode: "explicit", ids: ["dispatch-server", "web"] } })
@@ -311,7 +313,9 @@ dispatch_issue_update({ issue: "CORE-13", components: { mode: "none", reason: "h
311
313
  dispatch_issue_update({ issue: "CORE-14", components: { mode: "inherit" } }) // back to the parent chain's attachment
312
314
  ```
313
315
 
314
- Component ids are the file names under the repository's `.dispatch/architecture/` (`web.md` → `web`); an id the model lacks, or an `external` component, is refused with `COMPONENTS_INPUT`. A closed issue can be classified without reopening. Two rules: declare and attach before decomposing work, and change code and its architecture description (`.dispatch/architecture/<id>.md`) in the same review — the tree at `GET /api/v1/projects/{key}/architecture` counts every issue whose effective set names a component or anything it contains.
316
+ No native Dispatch tool lists component ids. Read the configured model with `GET /api/v1/projects/{key}/architecture` and use each non-external `components[].id`; when its source repository is your checkout, those ids are the file names under `.dispatch/architecture/` (`web.md` → `web`). An id absent from the model, or an `external` component, is refused with `COMPONENTS_INPUT`.
317
+
318
+ Use `mode: "none"` with a concrete reason only when the work is genuinely non-architectural (for example hiring, process, or operations work). A closed issue can be classified without reopening. Change code and its architecture description (`.dispatch/architecture/<id>.md`) in the same review.
315
319
 
316
320
  Import a project's architecture model from its configured source repository now (a human configures the source in Settings):
317
321
  ```ts