agentwheel 0.20.2 → 0.20.3

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/index.js CHANGED
@@ -9372,15 +9372,22 @@ async function observe(request, transport) {
9372
9372
  if (candidates.length !== 1) {
9373
9373
  throw new Error(`Destination Fleet manifest has ambiguous ownership for ${sourceEntry.path}.`);
9374
9374
  }
9375
- assertRetirableSourceEntry(sourceEntry);
9375
+ assertRetirableSourceEntry(sourceEntry, normalized.abandonIncompleteMergeOwner === true);
9376
9376
  const destinationEntry = candidates[0];
9377
- await assertContributionCoverage(sourceEntry, destinationEntry, normalized.targetRoot, transport);
9378
- const runtimeHash = await verifyManifestEntryRuntime(normalized.targetRoot, destinationEntry, transport);
9377
+ const coverage = await assertContributionCoverage(
9378
+ sourceEntry,
9379
+ destinationEntry,
9380
+ normalized.targetRoot,
9381
+ transport,
9382
+ normalized.abandonIncompleteMergeOwner === true
9383
+ );
9384
+ const runtimeHash = coverage === "abandoned-incomplete-merge" ? await transport.hashPath(containedArtifactPath(normalized.targetRoot, destinationEntry.path)) : await verifyManifestEntryRuntime(normalized.targetRoot, destinationEntry, transport);
9379
9385
  selected.push({
9380
9386
  path: sourceEntry.path,
9381
9387
  sourceEntryDigest: entryDigest(sourceEntry),
9382
9388
  destinationEntryDigest: entryDigest(destinationEntry),
9383
- runtimeHash
9389
+ runtimeHash,
9390
+ coverage
9384
9391
  });
9385
9392
  }
9386
9393
  selected.sort((a, b) => a.path.localeCompare(b.path) || a.sourceEntryDigest.localeCompare(b.sourceEntryDigest) || a.destinationEntryDigest.localeCompare(b.destinationEntryDigest));
@@ -9458,15 +9465,16 @@ async function requireManifest(request, stateKey, transport, label) {
9458
9465
  }
9459
9466
  return manifest;
9460
9467
  }
9461
- function assertRetirableSourceEntry(entry) {
9468
+ function assertRetirableSourceEntry(entry, abandonIncompleteMergeOwner) {
9462
9469
  if (entry.semanticPlugin || entry.semanticCommand || entry.executed) {
9463
9470
  throw new Error(`Cannot retire semantic source ownership at ${entry.path}.`);
9464
9471
  }
9465
- if (entry.mergeStrategy && !entry.mergeRemoval) {
9472
+ if (entry.mergeStrategy && !hasMergeRemovalContent(entry.mergeRemoval)) {
9473
+ if (abandonIncompleteMergeOwner) return;
9466
9474
  throw new Error(`Cannot retire incomplete merge ownership at ${entry.path}.`);
9467
9475
  }
9468
9476
  }
9469
- async function assertContributionCoverage(source, destination, targetRoot, transport) {
9477
+ async function assertContributionCoverage(source, destination, targetRoot, transport, abandonIncompleteMergeOwner) {
9470
9478
  const sourceManagedBlock = source.mode === "managed-block";
9471
9479
  const destinationManagedBlock = destination.mode === "managed-block";
9472
9480
  const sourceMerge = source.mergeStrategy !== void 0;
@@ -9478,24 +9486,29 @@ async function assertContributionCoverage(source, destination, targetRoot, trans
9478
9486
  `Destination Fleet ownership category ${destinationCategory} cannot replace stale source category ${sourceCategory} at ${source.path}.`
9479
9487
  );
9480
9488
  }
9481
- if (sourceCategory === "plain") return;
9489
+ if (sourceCategory === "plain") return "exact";
9482
9490
  if (sourceManagedBlock) {
9483
9491
  const sourceSelector = managedInstructionSelector(source.logicalSelector, source.artifactType, source.artifactName);
9484
9492
  const destinationSelector = managedInstructionSelector(destination.logicalSelector, destination.artifactType, destination.artifactName);
9485
9493
  if (!sourceManagedBlock || !destinationManagedBlock || sourceSelector !== destinationSelector) {
9486
9494
  throw new Error(`Destination Fleet does not exactly cover stale source managed block contribution at ${source.path}.`);
9487
9495
  }
9488
- return;
9496
+ return "exact";
9489
9497
  }
9490
9498
  if (source.mergeStrategy && destination.mergeStrategy) {
9491
- if (!source.mergeRemoval) throw new Error(`Cannot retire incomplete merge ownership at ${source.path}.`);
9492
- const exactlyCovered = destination.mergeStrategy === source.mergeStrategy && destination.mergeRemoval && contributionSelector(source) === contributionSelector(destination) && canonicalJson(source.mergeRemoval) === canonicalJson(destination.mergeRemoval);
9493
- if (exactlyCovered) return;
9499
+ if (!hasMergeRemovalContent(source.mergeRemoval)) {
9500
+ if (abandonIncompleteMergeOwner) return "abandoned-incomplete-merge";
9501
+ throw new Error(`Cannot retire incomplete merge ownership at ${source.path}.`);
9502
+ }
9503
+ const exactlyCovered = destination.mergeStrategy === source.mergeStrategy && hasMergeRemovalContent(destination.mergeRemoval) && contributionSelector(source) === contributionSelector(destination) && canonicalJson(source.mergeRemoval) === canonicalJson(destination.mergeRemoval);
9504
+ if (exactlyCovered) return "exact";
9494
9505
  const current = await transport.readFile(containedArtifactPath(targetRoot, source.path));
9495
9506
  if (!mergeContributionAbsent(source.mergeRemoval, source.mergeStrategy, current)) {
9496
9507
  throw new Error(`Destination Fleet does not exactly cover or replace stale source merge contribution at ${source.path}.`);
9497
9508
  }
9509
+ return "exact";
9498
9510
  }
9511
+ throw new Error(`Unsupported ownership coverage at ${source.path}.`);
9499
9512
  }
9500
9513
  function contributionSelector(entry) {
9501
9514
  return entry.logicalSelector ?? `${entry.artifactType}/${entry.artifactName}`;
@@ -12935,7 +12948,7 @@ ownershipCommand.command("handoff").description("transfer one managed artifact b
12935
12948
  console.log(`Manifest revision: ${result.manifestRevision}`);
12936
12949
  console.log(`Owner: ${result.fromOwner} -> ${result.toOwner}`);
12937
12950
  });
12938
- ownershipCommand.command("retire-stale").description("retire stale source-manifest ownership already covered by one Fleet manifest").requiredOption("--from-workspace-root <path>", "exact stale workspace owner root").requiredOption("--to-workspace-root <path>", "registered destination Fleet root").requiredOption("--source-state-key <key>", "exact source install-manifest state key").requiredOption("--fleet <id>", "registered destination Fleet").option("--adapter <adapter>", "built-in adapter").option("-i, --installation-type <type>", "installation type (for example local or user)").option("--adapter-config <path>", "adapter JSON/JSONC file").option("--adapter-module <path>", "local programmatic adapter module").option("--allow-adapter-code", "allow loading local adapter code", false).option("-t, --target-root <path>", "runtime/project root").option("--agent <name>", "named destination Fleet agent").option("--profile <name>", "destination Fleet profile resolving to one target").option("--plan-digest <sha256>", "reviewed plan digest; required with --apply").option("--expected-source-revision <sha256>", "reviewed source manifest revision; required with --apply").option("--expected-destination-revision <sha256>", "reviewed destination manifest revision; required with --apply").option("--expected-inventory-revision <sha256>", "reviewed runtime manifest inventory revision; required with --apply").option("--apply", "apply the exact reviewed metadata-only retirement", false).option("--json", "print the complete deterministic plan as JSON", false).action(async (options) => {
12951
+ ownershipCommand.command("retire-stale").description("retire stale source-manifest ownership already covered by one Fleet manifest").requiredOption("--from-workspace-root <path>", "exact stale workspace owner root").requiredOption("--to-workspace-root <path>", "registered destination Fleet root").requiredOption("--source-state-key <key>", "exact source install-manifest state key").requiredOption("--fleet <id>", "registered destination Fleet").option("--adapter <adapter>", "built-in adapter").option("-i, --installation-type <type>", "installation type (for example local or user)").option("--adapter-config <path>", "adapter JSON/JSONC file").option("--adapter-module <path>", "local programmatic adapter module").option("--allow-adapter-code", "allow loading local adapter code", false).option("-t, --target-root <path>", "runtime/project root").option("--agent <name>", "named destination Fleet agent").option("--profile <name>", "destination Fleet profile resolving to one target").option("--plan-digest <sha256>", "reviewed plan digest; required with --apply").option("--expected-source-revision <sha256>", "reviewed source manifest revision; required with --apply").option("--expected-destination-revision <sha256>", "reviewed destination manifest revision; required with --apply").option("--expected-inventory-revision <sha256>", "reviewed runtime manifest inventory revision; required with --apply").option("--abandon-incomplete-merge-owner", "explicitly retire incomplete legacy merge metadata without changing runtime bytes", false).option("--apply", "apply the exact reviewed metadata-only retirement", false).option("--json", "print the complete deterministic plan as JSON", false).action(async (options) => {
12939
12952
  const normalizedOptions = normalizeRuntimeScopeOptions(options);
12940
12953
  const fleet = await showRegisteredFleet(options.fleet);
12941
12954
  const toWorkspaceRoot = normalizeCliPath(options.toWorkspaceRoot);
@@ -12967,6 +12980,7 @@ ownershipCommand.command("retire-stale").description("retire stale source-manife
12967
12980
  expectedSourceRevision: options.expectedSourceRevision,
12968
12981
  expectedDestinationRevision: options.expectedDestinationRevision,
12969
12982
  expectedInventoryRevision: options.expectedInventoryRevision,
12983
+ abandonIncompleteMergeOwner: options.abandonIncompleteMergeOwner,
12970
12984
  transport: transportForTarget(target)
12971
12985
  };
12972
12986
  const result = options.apply ? await applyRetireStaleOwnership(request) : await planRetireStaleOwnership(request);
@@ -12989,6 +13003,7 @@ ownershipCommand.command("retire-stale").description("retire stale source-manife
12989
13003
  ...options.adapterConfig ? ["--adapter-config", options.adapterConfig] : [],
12990
13004
  ...options.adapterModule ? ["--adapter-module", options.adapterModule] : [],
12991
13005
  ...options.allowAdapterCode ? ["--allow-adapter-code"] : [],
13006
+ ...options.abandonIncompleteMergeOwner ? ["--abandon-incomplete-merge-owner"] : [],
12992
13007
  "--plan-digest",
12993
13008
  result.planDigest,
12994
13009
  "--expected-source-revision",
package/openpack.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "name": "NestDevLab/agentwheel",
4
- "version": "0.20.2",
4
+ "version": "0.20.3",
5
5
  "provides": [
6
6
  { "type": "skills", "path": "skills" }
7
7
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentwheel",
3
- "version": "0.20.2",
3
+ "version": "0.20.3",
4
4
  "description": "Weave skills, rules, and instructions across every AI agent.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -5,7 +5,7 @@ allowed-tools: [Bash]
5
5
  license: MIT
6
6
  metadata:
7
7
  author: NestDevLab
8
- version: "0.20.2"
8
+ version: "0.20.3"
9
9
  ---
10
10
 
11
11
  # agentwheel
@@ -5,7 +5,7 @@ allowed-tools: [Bash]
5
5
  license: MIT
6
6
  metadata:
7
7
  author: NestDevLab
8
- version: "0.20.2"
8
+ version: "0.20.3"
9
9
  ---
10
10
 
11
11
  # Agentwheel Discovery