Преглед изворни кода

fix(content): backfill the 13 dependency edges only registry.json declared

These edges were hand-authored straight into registry.json and existed in no
agent file and no sidecar entry, so generating the registry from content
would have deleted them — shipping externalscout without the Context7 skill
it is built around. Backfilled into oac.dependencies in registry's exact
declaration order, since the emitter maps positionally and order is a
byte-diff risk for the drift gate. Emitted registry now loses zero edges
(committed declares 55, emitted 76; the 21 additions are pre-existing
registry staleness the emitter corrects).

All 12 unique refs resolve live — nothing dead was laundered into canonical
data. context:context-system (bare) is live and is NOT the known dead ref;
that one is context:context-system/* (wildcard), which exists only in
profiles.advanced and is not among the 13.

Bodies are byte-identical (SHA-256 verified, 33/33); the diff is frontmatter
only.
darrenhinde пре 2 недеља
родитељ
комит
02ff35bb99

+ 10 - 1
content/agents/subagents/core/contextscout.md

@@ -29,7 +29,16 @@ oac:
     - context
     - discovery
     - search
-  dependencies: []
+  dependencies:
+    - command:check-context-deps
+    - context:registry-dependencies
+    - context:context-system
+    - context:mvi
+    - context:structure
+    - context:workflows
+    - subagent:externalscout
+    - context:root-navigation
+    - context:context-paths-config
   targets:
     - opencode
     - claude-code

+ 3 - 1
content/agents/subagents/core/externalscout.md

@@ -28,7 +28,9 @@ oac:
     - external
     - documentation
     - search
-  dependencies: []
+  dependencies:
+    - skill:context7
+    - context:context-system
   targets:
     - opencode
     - claude-code

+ 2 - 1
content/agents/subagents/system-builder/context-organizer.md

@@ -22,7 +22,8 @@ oac:
     - context
     - organization
     - structure
-  dependencies: []
+  dependencies:
+    - context:core/context-system/*
   targets:
     - opencode
 ---

+ 2 - 1
content/agents/subagents/utils/image-specialist.md

@@ -14,7 +14,8 @@ oac:
     - images
     - editing
     - generation
-  dependencies: []
+  dependencies:
+    - tool:gemini
   targets:
     - opencode
 ---

+ 37 - 19
packages/compatibility-layer/tests/unit/core/RegistryEmitter.test.ts

@@ -74,17 +74,21 @@ const MISSING_FROM_REGISTRY = [
 ] as const;
 
 /**
- * Dependency edges that exist ONLY in `registry.json` — no agent file and no sidecar entry
- * declares them, so generating from the canonical tree DROPS them.
+ * Dependency edges that were once authored ONLY in `registry.json` — no agent file and no
+ * sidecar entry declared them, so generating from the canonical tree used to DROP them.
  *
- * This is a real regression, not a cleanup: `install.sh` resolves these transitively today
- * (`resolve_dependencies`, install.sh:420), so installing `subagent:externalscout` currently
- * pulls in `skill:context7` and would stop doing so. They were hand-authored straight into
+ * That was a real regression, not a cleanup: `install.sh` resolves these transitively
+ * (`resolve_dependencies`, install.sh:420), so installing `subagent:externalscout` pulls in
+ * `skill:context7` and would have stopped doing so. They were hand-authored straight into
  * `registry.json` and never made it into any file, which is precisely the drift this refactor
- * exists to end — but the fix is to backfill `oac.dependencies` in `content/agents/**`, not to
- * let the emitter delete them silently.
+ * exists to end.
  *
- * Pinned here so subtask 10 cannot emit for real while the loss is unresolved.
+ * Subtask 09b backfilled all 13 into `oac.dependencies` in `content/agents/**`, in the exact
+ * order `registry.json` declares them, so the emitter now reproduces every one. This list is
+ * therefore no longer a snapshot of a loss — it is the guard that the backfill stays put. Each
+ * edge was verified to resolve against the registry before being carried over; the sibling dead
+ * ref `context:context-system/*` (profiles-only, expands to 0) was deliberately NOT introduced
+ * here — see `tests/unit/build/reference-resolution.test.ts`.
  */
 const REGISTRY_ONLY_DEPENDENCIES: Readonly<Record<string, readonly string[]>> = {
   contextscout: [
@@ -409,27 +413,41 @@ describe("registry defects", () => {
     expect(byId(document, "subagents").has("batch-executor")).toBe(true);
   });
 
-  it("still drops the dependency edges that only registry.json declares", async () => {
-    // A SNAPSHOT OF A KNOWN REGRESSION, not an invariant. These edges are hand-authored in
-    // registry.json and absent from both the agent files and agent-metadata.json, so
-    // generating from the canonical tree loses them. When subtask 05 backfills
-    // `oac.dependencies` in `content/agents/**`, this test turns red — which is correct:
-    // repairing the loss must be a deliberate edit here, never a silent drift.
+  it("preserves the dependency edges that only registry.json used to declare", async () => {
+    // These edges were hand-authored in registry.json and absent from both the agent files and
+    // agent-metadata.json, so generating from the canonical tree used to lose them. Subtask 09b
+    // backfilled them into `oac.dependencies`. This asserts the round trip: every edge the
+    // committed registry declares is still declared by the generated one, so `install.sh`
+    // resolves exactly what it resolves today.
     const document = await new RegistryEmitter(repoPath()).emit();
     const subagents = byId(document, "subagents");
 
-    for (const [id, lost] of Object.entries(REGISTRY_ONLY_DEPENDENCIES)) {
+    for (const [id, backfilled] of Object.entries(REGISTRY_ONLY_DEPENDENCIES)) {
       const before = new Set(byId(COMMITTED, "subagents").get(id)?.dependencies ?? []);
       const after = new Set(subagents.get(id)?.dependencies ?? []);
 
-      for (const dependency of lost) {
+      for (const dependency of backfilled) {
         expect(before.has(dependency), `${id} -> ${dependency} vanished from registry.json`).toBe(
           true
         );
-        expect(after.has(dependency), `${id} -> ${dependency} is no longer lost — update this snapshot`).toBe(
-          false
-        );
+        expect(
+          after.has(dependency),
+          `${id} -> ${dependency} was dropped — backfill it into content/agents/, do not weaken this test`
+        ).toBe(true);
       }
     }
   });
+
+  it("emits the backfilled edges in the order registry.json declares them", async () => {
+    // Order is not cosmetic: the emitter maps `oac.dependencies` positionally, and the
+    // subtask-11 `oac build && git diff --exit-code` gate compares bytes. A reordered list is a
+    // spurious diff, so the canonical files must carry registry.json's own order.
+    const subagents = byId(await new RegistryEmitter(repoPath()).emit(), "subagents");
+
+    for (const id of Object.keys(REGISTRY_ONLY_DEPENDENCIES)) {
+      expect(subagents.get(id)?.dependencies, `${id} dependency order drifted`).toEqual(
+        byId(COMMITTED, "subagents").get(id)?.dependencies
+      );
+    }
+  });
 });