@sjawhar/pi-legion-envoy 1.58.0 → 1.59.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/envoy.js CHANGED
@@ -32251,6 +32251,9 @@ class DispatchClient {
32251
32251
  async syncArchitectureSource(project) {
32252
32252
  return this.#json("POST", ["api", "v1", "projects", project, "architecture-source", "sync"]);
32253
32253
  }
32254
+ async getArchitectureSource(project) {
32255
+ return this.#json("GET", ["api", "v1", "projects", project, "architecture-source"]);
32256
+ }
32254
32257
  async resolveAsk(id, input) {
32255
32258
  return this.#json("POST", ["api", "v1", "asks", id, "resolve"], input);
32256
32259
  }
@@ -32746,6 +32749,20 @@ function componentsChange(input, after) {
32746
32749
  return "components -> inherit";
32747
32750
  }
32748
32751
  }
32752
+ 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.';
32753
+ async function architectureGuidance(client, project, components) {
32754
+ if (components.mode === "none" || components.ids.length > 0)
32755
+ return;
32756
+ try {
32757
+ await client.getArchitectureSource(project);
32758
+ return `Project ${project} has an architecture model, but this issue is not linked to any of its current components. ${architectureComponentsAction}`;
32759
+ } catch (error) {
32760
+ if (error instanceof DispatchServiceError && error.status === 404 && error.code === "SOURCE_NOT_FOUND") {
32761
+ return;
32762
+ }
32763
+ return `Could not check whether project ${project} has an architecture model: ${messageFor(error)}. ${architectureComponentsAction}`;
32764
+ }
32765
+ }
32749
32766
  function isDuplicateCandidate(value) {
32750
32767
  if (typeof value !== "object" || value === null)
32751
32768
  return false;
@@ -33569,9 +33586,13 @@ async function executeDispatchTool(input) {
33569
33586
  ...Array.isArray(labels) ? { labels } : {},
33570
33587
  actor
33571
33588
  });
33572
- const adviceLines = renderAdvice(input.tool, created.key, created.advice, {
33573
- isPrimarySpec: spec !== undefined
33574
- });
33589
+ const componentGuidance = await architectureGuidance(client, created.project, created.components);
33590
+ const adviceLines = [
33591
+ ...renderAdvice(input.tool, created.key, created.advice, {
33592
+ isPrimarySpec: spec !== undefined
33593
+ }),
33594
+ ...componentGuidance === undefined ? [] : [componentGuidance]
33595
+ ];
33575
33596
  return {
33576
33597
  text: [
33577
33598
  `Created ${created.key}: ${created.title} ${notSubscribed(issueTopic(created.key))}`,
package/dist/legion.js CHANGED
@@ -16145,7 +16145,7 @@ import { logger } from "@oh-my-pi/pi-utils";
16145
16145
  // package.json
16146
16146
  var package_default = {
16147
16147
  name: "@sjawhar/pi-legion-envoy",
16148
- version: "1.58.0",
16148
+ version: "1.59.0",
16149
16149
  type: "module",
16150
16150
  omp: {
16151
16151
  extensions: [
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-legion-envoy",
3
- "version": "1.58.0",
3
+ "version": "1.59.0",
4
4
  "type": "module",
5
5
  "omp": {
6
6
  "extensions": [