agent-valley 4.13.1 → 4.14.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
3
3
  "name": "av",
4
- "version": "4.13.1",
4
+ "version": "4.14.0",
5
5
  "description": "Delegate repository goals to Agent Valley and inspect mission progress and verification evidence.",
6
6
  "author": {
7
7
  "name": "Agent Valley"
package/dist/index.js CHANGED
@@ -76367,13 +76367,17 @@ function taskDecompositionGuidance(mission, phase) {
76367
76367
  sharedOwnershipGuidance
76368
76368
  ].join(`
76369
76369
  `);
76370
+ const limit = mission.executionPolicy?.maxParallel ?? 1;
76370
76371
  return [
76371
- `For substantial work spanning real modules, services, domains or layers, divide tasks by independently owned deliverables when this improves execution. The saved workspace concurrency limit is ${mission.executionPolicy?.maxParallel ?? 1}; plan within it. Keep a small coherent request as one task and keep genuinely coupled changes together. Do not split work merely to fill parallel slots.`,
76372
+ `For substantial work spanning real modules, services, domains or layers, divide tasks by independently owned deliverables when this improves execution. The saved workspace concurrency limit is ${limit}; plan within it. Keep a small coherent request as one task and keep genuinely coupled changes together. Do not invent work to fill parallel slots.`,
76373
+ ...limit > 1 ? [
76374
+ `Up to ${limit} ready tasks run at once, and a wave with one ready task leaves the other slots idle for its whole duration. When the work is substantial, shape the plan so several tasks are ready together: split implementation by disjoint owned paths (package, module, surface) rather than by layer, role or step, and keep each unit's tests in the task that implements that unit instead of a later test-only task.`
76375
+ ] : [],
76372
76376
  "Reuse existing stable interfaces. If independent consumers need a missing or changing contract, assign a concise contract-producing task first to establish the shared types, API, protocol or artifact and its acceptance evidence. Consumers may then depend on that contract without waiting for unrelated implementation work.",
76373
76377
  "Document each task's boundaries in its existing instructions and acceptance: owned files, required input artifacts, output artifacts and interface expectations. Assign the writer for shared files. Record these details only in existing Task instructions/acceptance; do not introduce Task or response-root schema keys.",
76374
76378
  sharedOwnershipGuidance,
76375
76379
  "An independent verification or QA task delivers evidence: its acceptance is the accuracy, completeness and reproducibility of its report and receipts, never the absence of defects in another task's deliverable. A reproducible defect it finds is reported as a blocker for the owning implementation task; repairing the QA task cannot fix product code, so do not phrase QA acceptance as the blocker being cleared.",
76376
- "A dependency means the task needs an actual preceding deliverable. Do not chain tasks merely because of layer names, team roles or plan order, and do not remove a genuine dependency to force concurrency. Independent consumers of the same stable contract can share that prerequisite. Add an integration task only when real wiring or combined acceptance checks are needed, depending on the relevant implementations; retain the framework's independent task reviews and final verification.",
76380
+ "A dependency means the task needs an actual preceding deliverable; name that delivered file or interface in the dependent task's instructions. Do not chain tasks merely because of layer names, team roles or plan order, and do not remove a genuine dependency to force concurrency. Independent consumers of the same stable contract can share that prerequisite. Add an integration task only when real wiring or combined acceptance checks are needed, depending on the relevant implementations; retain the framework's independent task reviews and final verification.",
76377
76381
  ...phase === "replan" ? [
76378
76382
  "During recovery, reuse verified deliverables and retained interfaces. Repartition only the remaining work when it helps the original outcome; preserve every original acceptance obligation, the existing roster, Chief identity and spent budgets."
76379
76383
  ] : []
@@ -138749,6 +138753,67 @@ async function reportMission(context) {
138749
138753
 
138750
138754
  // ../../packages/core/src/chief/coordinator-preparation.ts
138751
138755
  init_execution();
138756
+
138757
+ // ../../packages/core/src/chief/parallel.ts
138758
+ function readyTaskWave(plan, states, limit) {
138759
+ if (!Number.isInteger(limit) || limit < 1 || limit > 20)
138760
+ throw new Error("Use a parallel Actor limit between 1 and 20.");
138761
+ const completed = new Set(states.filter((state) => state.status === "completed").map((state) => state.id));
138762
+ return plan.tasks.filter((task) => !completed.has(task.id) && task.dependencies.every((id) => completed.has(id))).slice(0, limit);
138763
+ }
138764
+ function planWaveWidths(tasks) {
138765
+ const completed = new Set;
138766
+ const widths = [];
138767
+ let remaining = [...tasks];
138768
+ while (remaining.length) {
138769
+ const ready = remaining.filter((task) => task.dependencies.every((id) => completed.has(id)));
138770
+ if (!ready.length)
138771
+ break;
138772
+ for (const task of ready)
138773
+ completed.add(task.id);
138774
+ remaining = remaining.filter((task) => !completed.has(task.id));
138775
+ widths.push(ready.length);
138776
+ }
138777
+ return widths;
138778
+ }
138779
+ async function runJoinedWave(items, run, signal, limit = Math.max(1, items.length)) {
138780
+ signal?.throwIfAborted();
138781
+ if (!Number.isInteger(limit) || limit < 1)
138782
+ throw new Error("Use a positive integer parallel Actor limit.");
138783
+ const children = items.map(() => new AbortController);
138784
+ const abort = () => {
138785
+ for (const child of children)
138786
+ child.abort(signal?.reason);
138787
+ };
138788
+ signal?.addEventListener("abort", abort, { once: true });
138789
+ try {
138790
+ if (signal?.aborted)
138791
+ abort();
138792
+ const results = new Array(items.length);
138793
+ let next = 0;
138794
+ const worker = async () => {
138795
+ while (next < items.length) {
138796
+ const index = next++;
138797
+ const child = children[index];
138798
+ const item = items[index];
138799
+ if (!child || item === undefined)
138800
+ throw new Error("Restore the parallel Actor wave before continuing.");
138801
+ try {
138802
+ child.signal.throwIfAborted();
138803
+ results[index] = { status: "fulfilled", value: await run(item, child.signal) };
138804
+ } catch (error) {
138805
+ results[index] = { status: "rejected", reason: error };
138806
+ }
138807
+ }
138808
+ };
138809
+ await Promise.all(Array.from({ length: Math.min(limit, items.length) }, () => worker()));
138810
+ return results;
138811
+ } finally {
138812
+ signal?.removeEventListener("abort", abort);
138813
+ }
138814
+ }
138815
+
138816
+ // ../../packages/core/src/chief/coordinator-preparation.ts
138752
138817
  async function resumeMission(context) {
138753
138818
  const { mission, ports, operatorGoal, operatorVerify, checkAbort, save } = context;
138754
138819
  finalizeAbandonedRuns(mission);
@@ -138815,7 +138880,9 @@ async function planMission(context) {
138815
138880
  });
138816
138881
  applyPlanningResult(mission, planned);
138817
138882
  contract.pin();
138818
- await save("plan", `Chief Director planned ${mission.tasks.length} tasks.`);
138883
+ const widths = planWaveWidths(planned.plan.tasks);
138884
+ const limit = mission.executionPolicy?.maxParallel ?? 1;
138885
+ await save("plan", `Chief Director planned ${mission.tasks.length} tasks${widths.length && limit > 1 ? ` in ${widths.length} dependency waves (widest ${Math.min(Math.max(...widths), limit)} of ${limit} slots; waves ${widths.join("-")})` : ""}.`);
138819
138886
  }
138820
138887
  if (mission.supervision?.pendingRecovery) {
138821
138888
  const pending = mission.supervision.pendingRecovery;
@@ -138857,52 +138924,6 @@ async function recordIntegrationCheck(mission, ports, states, save) {
138857
138924
 
138858
138925
  // ../../packages/core/src/chief/coordinator-parallel.ts
138859
138926
  init_execution();
138860
-
138861
- // ../../packages/core/src/chief/parallel.ts
138862
- function readyTaskWave(plan, states, limit) {
138863
- if (!Number.isInteger(limit) || limit < 1 || limit > 20)
138864
- throw new Error("Use a parallel Actor limit between 1 and 20.");
138865
- const completed = new Set(states.filter((state) => state.status === "completed").map((state) => state.id));
138866
- return plan.tasks.filter((task) => !completed.has(task.id) && task.dependencies.every((id) => completed.has(id))).slice(0, limit);
138867
- }
138868
- async function runJoinedWave(items, run, signal, limit = Math.max(1, items.length)) {
138869
- signal?.throwIfAborted();
138870
- if (!Number.isInteger(limit) || limit < 1)
138871
- throw new Error("Use a positive integer parallel Actor limit.");
138872
- const children = items.map(() => new AbortController);
138873
- const abort = () => {
138874
- for (const child of children)
138875
- child.abort(signal?.reason);
138876
- };
138877
- signal?.addEventListener("abort", abort, { once: true });
138878
- try {
138879
- if (signal?.aborted)
138880
- abort();
138881
- const results = new Array(items.length);
138882
- let next = 0;
138883
- const worker = async () => {
138884
- while (next < items.length) {
138885
- const index = next++;
138886
- const child = children[index];
138887
- const item = items[index];
138888
- if (!child || item === undefined)
138889
- throw new Error("Restore the parallel Actor wave before continuing.");
138890
- try {
138891
- child.signal.throwIfAborted();
138892
- results[index] = { status: "fulfilled", value: await run(item, child.signal) };
138893
- } catch (error) {
138894
- results[index] = { status: "rejected", reason: error };
138895
- }
138896
- }
138897
- };
138898
- await Promise.all(Array.from({ length: Math.min(limit, items.length) }, () => worker()));
138899
- return results;
138900
- } finally {
138901
- signal?.removeEventListener("abort", abort);
138902
- }
138903
- }
138904
-
138905
- // ../../packages/core/src/chief/coordinator-parallel.ts
138906
138927
  class ParallelTaskReviewRejected extends Error {
138907
138928
  }
138908
138929
  async function performParallelWave(mission, ports, wave, hooks) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-valley",
3
- "version": "4.13.1",
3
+ "version": "4.14.0",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=26.10.0",