agent-valley 4.12.1 → 4.13.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.
@@ -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.12.1",
4
+ "version": "4.13.1",
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
@@ -76494,7 +76494,7 @@ var VERIFICATION_TIMEOUT_RULE = "mission.verificationCheckTimeoutMs is the per-c
76494
76494
  var DIRECT_DELIVERY_RULE = "No changeSet or isolated workspace record accompanies this delivery: the Actor edited the mission worktree directly, so the worktree and index are the deliverable. AV captures changeSets and deliveryTrees only for isolated Actor workspaces; their absence here is expected, is not a provenance failure, and must not be a finding or a reason to demand framework-generated capture.";
76495
76495
  var BUILD_AUTHORIZATION_RULE = "Build authorization: when the mission goal, charter, verification contract or operator notes authorize or require building, compiling or running tests, that is the explicit build request. Actors compile and run the relevant checks before delivering, task instructions must not prohibit those steps, and a delivery that was never compiled or tested does not satisfy its acceptance.";
76496
76496
  var HANDOFF_PATH_RULE = "Handoff transport: files move between task workspaces only as Git-visible changes; there is no separate artifact channel. A file written under a path the repository ignores (build output, caches, local result folders) is not delivered from an isolated task workspace, so reviewers and later tasks never see it. Put every deliverable or handoff file that a reviewer or another task must read at a non-ignored path; a deliverable missing for this reason is repaired by writing it at a non-ignored path.";
76497
- var INTEGRATION_CHECK_RULE = "integrationCheck is what AV itself observed by running the verification contract's commands on the integrated tree after this delivery, before this review. Treat it as executed evidence. A failing test or lint that existed before, or that covers code this delivery or its wave changed, is a blocking finding for this task: name the failing check and the repair. The Actor of the task under review repairs such a failure in this task; do not direct it to another owner or to the Chief. A command that fails only because a later planned task has not yet delivered the files it names is not a finding; say so in the summary.";
76497
+ var INTEGRATION_CHECK_RULE = "integrationCheck is what AV itself observed by running the operator's integration command, or otherwise the verification contract's commands, on the integrated tree after this delivery, before this review. Treat it as executed evidence. A failing test or lint that existed before, or that covers code this delivery or its wave changed, is a blocking finding for this task: name the failing check and the repair. The Actor of the task under review repairs such a failure in this task; do not direct it to another owner or to the Chief. A command that fails only because a later planned task has not yet delivered the files it names is not a finding; say so in the summary.";
76498
76498
  var OWN_REPAIR_RULE = "Repair ownership: when a review finding, integrationCheck or your own run shows a failing test, lint or build in this repository, repair it in this task even when the failing code was delivered by an earlier task or lies outside this task's stated files. Recording the failure for another owner or for the Chief is not a repair and will be rejected again. Hand back only a prerequisite you cannot change from this workspace, such as missing credentials or an external service.";
76499
76499
  var OPERATOR_NOTES_RULE = "mission.operatorNotes are operator instructions recorded after earlier attempts. When a note reports an environment or prerequisite change, re-run the affected check in the current environment instead of relying on evidence that predates the note; a note never changes the goal, acceptance criteria or verification command.";
76500
76500
  function workPrompt(mission, task, state, persona) {
@@ -79680,6 +79680,43 @@ init_parallel_contract();
79680
79680
  import { randomUUID as randomUUID17 } from "node:crypto";
79681
79681
  import { rm as rm8, writeFile as writeFile11 } from "node:fs/promises";
79682
79682
  import { dirname as dirname9, join as join39 } from "node:path";
79683
+ var imageKey = (image) => image ? `${image.mode} ${image.oid}` : "absent";
79684
+ async function acceptedLineageImages(baselinePath, commit, sourceHead, paths) {
79685
+ const images = new Map;
79686
+ for (let start = 0;start < paths.length; start += 200) {
79687
+ const out = await parallelGit(baselinePath, [
79688
+ "log",
79689
+ "--first-parent",
79690
+ "--diff-merges=first-parent",
79691
+ "--no-renames",
79692
+ "--raw",
79693
+ "--no-abbrev",
79694
+ "-z",
79695
+ "--format=",
79696
+ commit,
79697
+ "--not",
79698
+ sourceHead,
79699
+ "--",
79700
+ ...paths.slice(start, start + 200)
79701
+ ], { GIT_LITERAL_PATHSPECS: "1" });
79702
+ const tokens = out.split("\x00");
79703
+ for (let index = 0;index + 1 < tokens.length; index++) {
79704
+ const meta = tokens[index]?.trim() ?? "";
79705
+ if (!meta.startsWith(":"))
79706
+ continue;
79707
+ const [oldMode = "", newMode = "", oldOid = "", newOid = ""] = meta.slice(1).split(" ");
79708
+ const path = tokens[++index] ?? "";
79709
+ const seen = images.get(path) ?? new Set;
79710
+ for (const [mode, oid] of [
79711
+ [oldMode, oldOid],
79712
+ [newMode, newOid]
79713
+ ])
79714
+ seen.add(/^0+$/.test(mode ?? "") ? "absent" : `${mode} ${oid}`);
79715
+ images.set(path, seen);
79716
+ }
79717
+ }
79718
+ return images;
79719
+ }
79683
79720
  async function synchronizeContinuousBaselineWithSource(operation, baseline = operation.baseline, signal) {
79684
79721
  signal?.throwIfAborted();
79685
79722
  const policy = operation.sourceIntegrationPolicy;
@@ -79699,6 +79736,7 @@ async function synchronizeContinuousBaselineWithSource(operation, baseline = ope
79699
79736
  const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
79700
79737
  const removed = [];
79701
79738
  const upserted = [];
79739
+ const contested = [];
79702
79740
  for (const path of [...new Set([...baseImages.keys(), ...headImages.keys()])].sort()) {
79703
79741
  if (!productPath(path))
79704
79742
  continue;
@@ -79711,11 +79749,24 @@ async function synchronizeContinuousBaselineWithSource(operation, baseline = ope
79711
79749
  const existing = baselineImages.get(path) ?? null;
79712
79750
  if (same(existing, after))
79713
79751
  continue;
79714
- if (!after)
79752
+ if (!same(existing, before))
79753
+ contested.push({ path, after });
79754
+ else if (!after)
79715
79755
  removed.push(path);
79716
79756
  else
79717
79757
  upserted.push({ path, image: after });
79718
79758
  }
79759
+ if (contested.length) {
79760
+ const lineage = await acceptedLineageImages(current.path, current.commit, policy.head, contested.map((entry) => entry.path));
79761
+ for (const { path, after } of contested) {
79762
+ if (lineage.get(path)?.has(imageKey(after)))
79763
+ continue;
79764
+ if (!after)
79765
+ removed.push(path);
79766
+ else
79767
+ upserted.push({ path, image: after });
79768
+ }
79769
+ }
79719
79770
  let nextTree = current.baselineTree;
79720
79771
  if (removed.length || upserted.length) {
79721
79772
  const index = join39(current.path, ".git", `av-sync-index-${randomUUID17()}`);
@@ -82201,15 +82252,33 @@ function unattendedVerificationGuidance(stage) {
82201
82252
 
82202
82253
  // ../../packages/core/src/chief/runtime-integration-check.ts
82203
82254
  var INTEGRATION_CHECK_ENV = "AV_INTEGRATION_CHECK";
82204
- function integrationCheckEnabled(source = process.env) {
82205
- return source[INTEGRATION_CHECK_ENV] === "1";
82255
+ var INTEGRATION_CHECK_COMMAND_ENV = "AV_INTEGRATION_CHECK_COMMAND";
82256
+ function integrationCheckCommand(source = process.env) {
82257
+ return source[INTEGRATION_CHECK_COMMAND_ENV]?.trim() || undefined;
82206
82258
  }
82207
- async function runIntegrationCheck(mission, active, signal) {
82208
- if (!mission.verificationContract)
82259
+ function integrationCheckEnabled(source = process.env) {
82260
+ return source[INTEGRATION_CHECK_ENV] === "1" || integrationCheckCommand(source) !== undefined;
82261
+ }
82262
+ function operatorIntegrationResult(command, result) {
82263
+ const verdict = result.ok ? "PASS: the operator's integration command exited zero." : result.timedOut ? "FAIL: the operator's integration command timed out." : "FAIL: the operator's integration command exited nonzero. Output tail:";
82264
+ const tail = result.ok ? "" : `
82265
+ ${(result.output ?? "").slice(-6000)}`;
82266
+ return { ok: result.ok, output: `${command.slice(0, 600)}
82267
+ ${verdict}${tail}`.slice(0, 8000) };
82268
+ }
82269
+ async function runIntegrationCheck(mission, active, signal, source = process.env) {
82270
+ const command = integrationCheckCommand(source);
82271
+ if (!command && !mission.verificationContract)
82209
82272
  return;
82210
82273
  await assertMissionWorkspace(mission);
82211
82274
  active.begin("verify");
82212
82275
  try {
82276
+ if (command)
82277
+ return operatorIntegrationResult(command, await runVerificationGate(mission.workspace, command, {
82278
+ timeoutSec: mission.timeoutSec,
82279
+ signal,
82280
+ onSpawned: (pid) => active.spawned(pid, process.platform !== "win32")
82281
+ }));
82213
82282
  return await executeCommandChecks(mission.verificationContract, mission.workspace.path, {
82214
82283
  successCriteria: mission.goalBrief?.successCriteria ?? [],
82215
82284
  timeoutMs: mission.timeoutSec * 1000,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-valley",
3
- "version": "4.12.1",
3
+ "version": "4.13.1",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=26.10.0",