mancode 0.3.12 → 0.3.14

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/cli.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  replaceManagedBlock,
21
21
  stageV3Adapter,
22
22
  v3AdapterTargetPath
23
- } from "./chunk-CFC3HBNA.js";
23
+ } from "./chunk-L3TKSX6R.js";
24
24
  import {
25
25
  PROJECT_MANIFESTS,
26
26
  V3ContextStore,
@@ -123,10 +123,10 @@ import {
123
123
  workflowMetadataDigest,
124
124
  writeOperationReservation,
125
125
  writeProjectFacts
126
- } from "./chunk-O3QAKAPJ.js";
126
+ } from "./chunk-LMXUPBCN.js";
127
127
 
128
128
  // src/cli.ts
129
- import { program } from "commander";
129
+ import { Option, program } from "commander";
130
130
 
131
131
  // src/context/publish-promote.ts
132
132
  import { lstat as lstat5, mkdir as mkdir11, rename as rename5, rm as rm5, writeFile as writeFile11 } from "fs/promises";
@@ -1459,23 +1459,27 @@ function parseV3AdapterFileAction(value) {
1459
1459
  "beforeContent",
1460
1460
  "targetContent"
1461
1461
  ],
1462
- "operation recovery V3 adapter action"
1462
+ "operation recovery mancode adapter action"
1463
1463
  );
1464
1464
  if (value.kind !== "v3_adapter_file" || !V3_ADAPTER_TARGETS.has(value.target)) {
1465
- throw new Error("operation recovery V3 adapter action is invalid");
1465
+ throw new Error("operation recovery mancode adapter action is invalid");
1466
1466
  }
1467
1467
  const target = value.target;
1468
- const beforeContent = value.beforeContent === null ? null : parseText(value.beforeContent, "V3 adapter beforeContent");
1468
+ const beforeContent = value.beforeContent === null ? null : parseText(value.beforeContent, "mancode adapter beforeContent");
1469
1469
  const beforeDigest = parseDigestOrNull(value.beforeDigest, "beforeDigest");
1470
1470
  if (beforeDigest !== adapterFileContentDigest(target, beforeContent)) {
1471
- throw new Error("operation recovery V3 adapter before digest is invalid");
1471
+ throw new Error(
1472
+ "operation recovery mancode adapter before digest is invalid"
1473
+ );
1472
1474
  }
1473
1475
  const targetContent = parseText(
1474
1476
  value.targetContent,
1475
- "V3 adapter targetContent"
1477
+ "mancode adapter targetContent"
1476
1478
  );
1477
1479
  if (!targetContent.trim()) {
1478
- throw new Error("operation recovery V3 adapter target content is invalid");
1480
+ throw new Error(
1481
+ "operation recovery mancode adapter target content is invalid"
1482
+ );
1479
1483
  }
1480
1484
  adapterFileContentDigest(target, targetContent);
1481
1485
  return {
@@ -5168,7 +5172,7 @@ function parseQuarantineCandidate(value) {
5168
5172
  function assertSourcePlacement(purpose, sourceTaskRef, candidateTaskRef) {
5169
5173
  if (purpose === "legacy_migration" && sourceTaskRef !== null) {
5170
5174
  throw new Error(
5171
- "legacy migration quarantine cannot claim a V3 source TaskRef"
5175
+ "legacy migration quarantine cannot claim a current mancode source TaskRef"
5172
5176
  );
5173
5177
  }
5174
5178
  if (purpose === "publish_promote") {
@@ -11236,7 +11240,7 @@ async function activateLegacyMigration(input) {
11236
11240
  if (session === null || session.status !== "active") {
11237
11241
  throw new Error("MANCODE_SESSION_NOT_FOUND");
11238
11242
  }
11239
- const store = new (await import("./store-JUB2KAFT.js")).V3ContextStore(root);
11243
+ const store = new (await import("./store-DCTOW75Z.js")).V3ContextStore(root);
11240
11244
  const project = await store.readProjectSnapshot();
11241
11245
  const stage = await readMigrationStage(root, input.stageId);
11242
11246
  if (stage.state !== "staged" || stage.revision !== input.expectedStageRevision) {
@@ -11499,7 +11503,7 @@ async function activateLegacyMigration(input) {
11499
11503
  for (const action of payload.actions.filter(
11500
11504
  (action2) => action2.kind === "v3_adapter_file"
11501
11505
  )) {
11502
- const { applyV3AdapterFilePlan: applyV3AdapterFilePlan2 } = await import("./v3-adapter-DDZB3Y6S.js");
11506
+ const { applyV3AdapterFilePlan: applyV3AdapterFilePlan2 } = await import("./v3-adapter-CPZNFTJR.js");
11503
11507
  await applyV3AdapterFilePlan2(root, action);
11504
11508
  }
11505
11509
  journal = await completeActivationStep(
@@ -19835,7 +19839,7 @@ async function contextBeta(rootDir, options) {
19835
19839
  return printV3Error(
19836
19840
  options.json,
19837
19841
  v3ErrorCode(error, "MANCODE_BETA_GATE_FAILED"),
19838
- error instanceof Error ? error.message : "Unable to evaluate Beta readiness."
19842
+ error instanceof Error ? error.message : "Unable to evaluate release readiness."
19839
19843
  );
19840
19844
  }
19841
19845
  }
@@ -19953,7 +19957,7 @@ async function contextWorktreeRegister(rootDir, options) {
19953
19957
  return printV3Error(
19954
19958
  options.json,
19955
19959
  v3ErrorCode(error, "MANCODE_WORKTREE_REGISTER_FAILED"),
19956
- error instanceof Error ? error.message : "Unable to register this worktree for V3 coordination."
19960
+ error instanceof Error ? error.message : "Unable to register this worktree for mancode coordination."
19957
19961
  );
19958
19962
  }
19959
19963
  }
@@ -20098,7 +20102,7 @@ async function contextCompact(rootDir, options) {
20098
20102
  return printV3Error(
20099
20103
  options.json,
20100
20104
  v3ErrorCode(error, "MANCODE_CONTEXT_COMPACT_FAILED"),
20101
- error instanceof Error ? error.message : "Unable to compact V3 context."
20105
+ error instanceof Error ? error.message : "Unable to compact mancode context."
20102
20106
  );
20103
20107
  }
20104
20108
  }
@@ -20151,7 +20155,7 @@ async function contextPublish(rootDir, task, options) {
20151
20155
  return printV3Error(
20152
20156
  options.json,
20153
20157
  v3ErrorCode(error, "MANCODE_CONTEXT_PUBLISH_FAILED"),
20154
- error instanceof Error ? error.message : "Unable to preview the local V3 task publish."
20158
+ error instanceof Error ? error.message : "Unable to preview the local mancode task publish."
20155
20159
  );
20156
20160
  }
20157
20161
  }
@@ -20181,7 +20185,7 @@ async function contextPublish(rootDir, task, options) {
20181
20185
  return printV3Error(
20182
20186
  options.json,
20183
20187
  v3ErrorCode(error, "MANCODE_CONTEXT_PUBLISH_FAILED"),
20184
- error instanceof Error ? error.message : "Unable to publish the local V3 task."
20188
+ error instanceof Error ? error.message : "Unable to publish the local mancode task."
20185
20189
  );
20186
20190
  }
20187
20191
  }
@@ -20251,7 +20255,7 @@ async function contextReconcileTaskHead(rootDir, task, options) {
20251
20255
  return printV3Error(
20252
20256
  options.json,
20253
20257
  v3ErrorCode(error, "MANCODE_CONTEXT_RECONCILE_TASK_HEAD_FAILED"),
20254
- error instanceof Error ? error.message : "Unable to reconcile the V3 task head."
20258
+ error instanceof Error ? error.message : "Unable to reconcile the mancode task head."
20255
20259
  );
20256
20260
  }
20257
20261
  }
@@ -24790,7 +24794,7 @@ async function init(rootDir = process5.cwd(), options = {}) {
24790
24794
  }
24791
24795
  if (authority === "legacy" && await pathExists6(v3SchemaFile)) {
24792
24796
  console.error(
24793
- "\u2717 V3 authority is already present; refusing to create legacy state.json."
24797
+ "\u2717 mancode authority is already present; refusing to create legacy state.json."
24794
24798
  );
24795
24799
  console.error(
24796
24800
  " Use `mancode status` or `mancode install <platform>` to inspect or repair this project."
@@ -25216,14 +25220,14 @@ async function init(rootDir = process5.cwd(), options = {}) {
25216
25220
  async function initializeV3(rootDir, options) {
25217
25221
  if (options.force) {
25218
25222
  console.error(
25219
- "\u2717 --force is not supported for journaled V3 initialization."
25223
+ "\u2717 --force is not supported for journaled mancode initialization."
25220
25224
  );
25221
25225
  return EXIT_INIT_FAILED;
25222
25226
  }
25223
25227
  if (options.style !== void 0) {
25224
25228
  console.error("\u2717 --style is only supported by `mancode init --legacy`.");
25225
25229
  console.error(
25226
- " V3 detects project facts; run `mancode refresh-style` after initialization to refresh local style tokens."
25230
+ " mancode detects project facts; run `mancode refresh-style` after initialization to refresh local style tokens."
25227
25231
  );
25228
25232
  return EXIT_INIT_FAILED;
25229
25233
  }
@@ -25241,7 +25245,7 @@ async function initializeV3(rootDir, options) {
25241
25245
  }
25242
25246
  existingV3 = true;
25243
25247
  if (options.platform === void 0) {
25244
- console.log("\u2139\uFE0F mancode V3 is already initialized.");
25248
+ console.log("\u2139\uFE0F mancode is already initialized.");
25245
25249
  return EXIT_ALREADY_INITIALIZED;
25246
25250
  }
25247
25251
  } catch (error) {
@@ -25275,10 +25279,10 @@ async function initializeV3(rootDir, options) {
25275
25279
  for (const platform of selectedPlatforms) {
25276
25280
  await installV3Adapter(rootDir, platform);
25277
25281
  }
25278
- console.log("\u2139\uFE0F mancode V3 is already initialized.");
25282
+ console.log("\u2139\uFE0F mancode is already initialized.");
25279
25283
  if (selectedPlatforms.length > 0) {
25280
25284
  console.log(
25281
- ` V3 bootstrap repaired: ${selectedPlatforms.join(", ")}`
25285
+ ` mancode bootstrap repaired: ${selectedPlatforms.join(", ")}`
25282
25286
  );
25283
25287
  }
25284
25288
  return EXIT_ALREADY_INITIALIZED;
@@ -25290,7 +25294,7 @@ async function initializeV3(rootDir, options) {
25290
25294
  for (const platform of selectedPlatforms) {
25291
25295
  await installV3Adapter(rootDir, platform);
25292
25296
  }
25293
- console.log("\u2713 Initialized mancode V3 greenfield project.");
25297
+ console.log("\u2713 Initialized mancode project.");
25294
25298
  console.log(` workspace: ${result2.runtime.workspaceId}`);
25295
25299
  console.log(` operation: ${result2.journal.operationId}`);
25296
25300
  if (options.team !== void 0) {
@@ -25303,7 +25307,7 @@ async function initializeV3(rootDir, options) {
25303
25307
  " No platform bootstrap selected. Run `mancode install <platform>`."
25304
25308
  );
25305
25309
  } else {
25306
- console.log(` V3 bootstrap: ${selectedPlatforms.join(", ")}`);
25310
+ console.log(` mancode bootstrap: ${selectedPlatforms.join(", ")}`);
25307
25311
  }
25308
25312
  return EXIT_OK;
25309
25313
  } catch (error) {
@@ -25312,7 +25316,7 @@ async function initializeV3(rootDir, options) {
25312
25316
  }
25313
25317
  }
25314
25318
  function printV3InitError(error) {
25315
- const message = error instanceof Error ? error.message : "V3 initialization failed";
25319
+ const message = error instanceof Error ? error.message : "mancode initialization failed";
25316
25320
  console.error(`\u2717 ${message}`);
25317
25321
  if (message === "MANCODE_LEGACY_AUTHORITY_PRESENT") {
25318
25322
  console.error(" Run `mancode migrate context --dry-run` instead.");
@@ -25690,7 +25694,9 @@ async function install(rootDir = process6.cwd(), platform = "claude-code", optio
25690
25694
  }
25691
25695
  if (options.shadow) {
25692
25696
  console.error("\u2717 MANCODE_V3_ADAPTER_SHADOW_REQUIRES_V3");
25693
- console.error(" Adapter shadow staging requires a V3 dual-read project.");
25697
+ console.error(
25698
+ " Adapter shadow staging requires a mancode dual-read project."
25699
+ );
25694
25700
  return EXIT_INSTALL_FAILED;
25695
25701
  }
25696
25702
  if (!await pathExists7(stateFile)) {
@@ -25787,7 +25793,7 @@ async function installV3(rootDir, platform, options) {
25787
25793
  }
25788
25794
  const staged = await stageV3Adapter(rootDir, installer.name);
25789
25795
  console.log(
25790
- `\u2713 ${formatPlatformName(platform)} V3 bootstrap and original mode entries staged for shadow comparison.`
25796
+ `\u2713 ${formatPlatformName(platform)} mancode bootstrap and original mode entries staged for shadow comparison.`
25791
25797
  );
25792
25798
  console.log(` ${staged.stagingTarget}`);
25793
25799
  for (const entry of staged.modeEntries) {
@@ -25800,17 +25806,19 @@ async function installV3(rootDir, platform, options) {
25800
25806
  }
25801
25807
  if (options.minimal) {
25802
25808
  console.log(
25803
- "\u2139\uFE0F V3 adapters are already bootstrap-only; --minimal has no additional effect."
25809
+ "\u2139\uFE0F mancode adapters are already bootstrap-only; --minimal has no additional effect."
25804
25810
  );
25805
25811
  }
25806
25812
  const installed = await installV3Adapter(rootDir, installer.name);
25807
- console.log(`\u2713 ${formatPlatformName(platform)} V3 bootstrap installed.`);
25813
+ console.log(
25814
+ `\u2713 ${formatPlatformName(platform)} mancode bootstrap installed.`
25815
+ );
25808
25816
  console.log(` ${installed.target}`);
25809
25817
  return EXIT_OK2;
25810
25818
  } catch (err) {
25811
25819
  const message = err instanceof Error ? err.message : String(err);
25812
25820
  console.error(
25813
- `\u2717 ${formatPlatformName(platform)} V3 adapter install failed: ${message}`
25821
+ `\u2717 ${formatPlatformName(platform)} mancode adapter install failed: ${message}`
25814
25822
  );
25815
25823
  return EXIT_INSTALL_FAILED;
25816
25824
  }
@@ -25920,7 +25928,7 @@ async function listV3Platforms(rootDir) {
25920
25928
  platforms.map((platform) => inspectV3Adapter(rootDir, platform.name))
25921
25929
  );
25922
25930
  console.log("");
25923
- console.log("Available platforms (V3 bootstrap):");
25931
+ console.log("Available platforms (mancode bootstrap):");
25924
25932
  for (const [index, platform] of platforms.entries()) {
25925
25933
  const status2 = statuses[index];
25926
25934
  if (status2 === void 0) {
@@ -25928,7 +25936,7 @@ async function listV3Platforms(rootDir) {
25928
25936
  }
25929
25937
  const marker = status2.installed ? "\u2713" : "\u25CB";
25930
25938
  console.log(
25931
- ` ${marker} ${platform.name.padEnd(12)} ${platform.displayName.padEnd(16)} V3 bootstrap; explicit session identity`
25939
+ ` ${marker} ${platform.name.padEnd(12)} ${platform.displayName.padEnd(16)} mancode bootstrap; explicit session identity`
25932
25940
  );
25933
25941
  }
25934
25942
  console.log("");
@@ -26375,9 +26383,7 @@ function readTodoIssues(abs, rel, offset) {
26375
26383
  const lines = content.split("\n");
26376
26384
  const issues = [];
26377
26385
  for (let i = 0; i < lines.length && issues.length < 2; i++) {
26378
- if (/\b(TODO|FIXME|HACK|XXX|deprecated|legacy|temporary|workaround)\b/i.test(
26379
- lines[i] ?? ""
26380
- )) {
26386
+ if (isMaintenanceMarker(lines[i] ?? "")) {
26381
26387
  issues.push({
26382
26388
  id: `todo-${offset + issues.length + 1}`,
26383
26389
  severity: "P2",
@@ -26394,6 +26400,12 @@ function readTodoIssues(abs, rel, offset) {
26394
26400
  return [];
26395
26401
  }
26396
26402
  }
26403
+ function isMaintenanceMarker(line) {
26404
+ const trimmed = line.trim();
26405
+ return /(?:^|\s)(?:\/\/|#|\/\*|\*|<!--)\s*(?:TODO|FIXME|HACK|XXX)\b/i.test(
26406
+ trimmed
26407
+ );
26408
+ }
26397
26409
  function scanTestGaps(files) {
26398
26410
  const sourceFiles = files.filter(
26399
26411
  (file) => file.startsWith("src/") && /\.(ts|tsx|js|jsx)$/.test(file) && !file.endsWith(".d.ts") && !file.includes("/templates/")
@@ -26893,7 +26905,7 @@ async function manps(rootDir, area = "all", options = {}) {
26893
26905
  const v3SchemaPath = path50.join(rootDir, ".mancode", "schema.json");
26894
26906
  const v3Activation = await readV3ActivationState(v3SchemaPath);
26895
26907
  if (v3Activation !== null && v3Activation !== "v3_active" && v3Activation !== "dual_read") {
26896
- const message = `manps is unavailable while V3 activation is ${v3Activation}`;
26908
+ const message = `manps is unavailable while mancode activation is ${v3Activation}`;
26897
26909
  if (options.json) {
26898
26910
  console.log(JSON.stringify({ error: "scan failed", message }, null, 2));
26899
26911
  } else {
@@ -27404,17 +27416,17 @@ async function refreshV3Project(rootDir) {
27404
27416
  revision: (project.projectFacts?.revision ?? 0) + 1
27405
27417
  });
27406
27418
  await writeProjectFacts(rootDir, facts);
27407
- console.log("\u2713 V3 project facts refreshed.");
27419
+ console.log("\u2713 mancode project facts refreshed.");
27408
27420
  console.log(
27409
27421
  ` Kind: ${facts.profile.projectKind} | Stack: ${[...facts.profile.languages, ...facts.profile.frameworks].join(" + ") || "unknown"}`
27410
27422
  );
27411
27423
  console.log(
27412
- " V3 adapters remain unchanged because their bootstrap is static."
27424
+ " mancode adapters remain unchanged because their bootstrap is static."
27413
27425
  );
27414
27426
  return EXIT_OK6;
27415
27427
  } catch (error) {
27416
27428
  const message = error instanceof Error ? error.message : String(error);
27417
- console.error(`\u2717 V3 project facts refresh failed: ${message}`);
27429
+ console.error(`\u2717 mancode project facts refresh failed: ${message}`);
27418
27430
  return EXIT_REFRESH_FAILED;
27419
27431
  }
27420
27432
  }
@@ -27663,7 +27675,7 @@ async function refreshV3Style(rootDir) {
27663
27675
  if (project.manifest.activationState !== "v3_active") {
27664
27676
  throw new Error("MANCODE_V3_REFRESH_REQUIRES_ACTIVE");
27665
27677
  }
27666
- console.log("\u2713 \u5237\u65B0 V3 \u9879\u76EE profile...");
27678
+ console.log("\u2713 \u5237\u65B0 mancode \u9879\u76EE profile...");
27667
27679
  const profile = await detectProjectProfile(rootDir);
27668
27680
  const uiLibraryHint = primaryUiLibrary(profile);
27669
27681
  await writeProjectFacts(
@@ -27687,7 +27699,7 @@ async function refreshV3Style(rootDir) {
27687
27699
  console.log(
27688
27700
  "\u2139\uFE0F No UI assets detected in project profile. Skipping style scan."
27689
27701
  );
27690
- console.log(" Updated V3 project facts.");
27702
+ console.log(" Updated mancode project facts.");
27691
27703
  return EXIT_OK7;
27692
27704
  }
27693
27705
  console.log("\u2713 \u626B\u63CF\u9879\u76EE\u8BBE\u8BA1 token...");
@@ -27707,7 +27719,7 @@ async function refreshV3Style(rootDir) {
27707
27719
  return EXIT_OK7;
27708
27720
  } catch (error) {
27709
27721
  const message = error instanceof Error ? error.message : String(error);
27710
- console.error(`\u2717 V3 style refresh failed: ${message}`);
27722
+ console.error(`\u2717 mancode style refresh failed: ${message}`);
27711
27723
  return EXIT_V3_REFRESH_FAILED;
27712
27724
  }
27713
27725
  }
@@ -28398,11 +28410,11 @@ function printText(r) {
28398
28410
  }
28399
28411
  function printV3Text(result2) {
28400
28412
  console.log("");
28401
- console.log(`mancode v${result2.version} (V3 authority)`);
28413
+ console.log(`mancode v${result2.version}`);
28402
28414
  console.log("");
28403
28415
  console.log(`Project: ${result2.project}`);
28404
28416
  console.log(
28405
- `Activation: ${result2.activation.state} (epoch ${result2.activation.epoch})`
28417
+ `Activation: ${formatActivationState(result2.activation.state)} (epoch ${result2.activation.epoch})`
28406
28418
  );
28407
28419
  console.log(
28408
28420
  `Runtime: ${result2.runtime.binding}${result2.runtime.error ? ` (${result2.runtime.error})` : ""}`
@@ -28424,19 +28436,27 @@ function printV3Text(result2) {
28424
28436
  console.log(
28425
28437
  `Identity: ${result2.localIdentity.displayName ?? "not configured"}`
28426
28438
  );
28439
+ const sessionEvidenceDetail = result2.sessionEvidence.ready ? "ready" : [
28440
+ ...result2.sessionEvidence.explicitRequiredPlatforms,
28441
+ ...result2.sessionEvidence.missingPlatforms.filter(
28442
+ (platform) => !result2.sessionEvidence.explicitRequiredPlatforms.includes(
28443
+ platform
28444
+ )
28445
+ )
28446
+ ].join(", ") || "none recorded";
28427
28447
  console.log(
28428
- `Session evidence: ${result2.sessionEvidence.ready ? "ready" : `explicit required (${result2.sessionEvidence.explicitRequiredPlatforms.join(", ")})`}`
28448
+ `Session evidence: ${result2.sessionEvidence.ready ? "ready" : `explicit required (${sessionEvidenceDetail})`}`
28429
28449
  );
28430
28450
  if (result2.compatibility.failures.length > 0) {
28431
28451
  console.log(`Compatibility: ${result2.compatibility.failures.join(", ")}`);
28432
28452
  }
28433
28453
  if (result2.legacyAuthorityPresent) {
28434
28454
  console.log(
28435
- "Legacy: legacy authority detected; V3 writes may be blocked."
28455
+ "Legacy: legacy authority detected; mancode writes may be blocked."
28436
28456
  );
28437
28457
  }
28438
28458
  console.log("");
28439
- console.log("V3 adapter status:");
28459
+ console.log("mancode adapter status:");
28440
28460
  for (const platform of getPlatformInstallers()) {
28441
28461
  const adapter = result2.adapters[platform.name];
28442
28462
  const marker = adapter.installed ? "\u2713" : "\u25CB";
@@ -28448,11 +28468,14 @@ function printV3Text(result2) {
28448
28468
  if (result2.runtime.binding !== "ready") {
28449
28469
  console.log("");
28450
28470
  console.log(
28451
- "Run `mancode context worktree register` in this checkout before V3 mutations."
28471
+ "Run `mancode context worktree register` in this checkout before mancode mutations."
28452
28472
  );
28453
28473
  }
28454
28474
  console.log("");
28455
28475
  }
28476
+ function formatActivationState(state) {
28477
+ return state.replace(/^v3_/, "").replaceAll("_", " ");
28478
+ }
28456
28479
  function formatTeamStatus(team) {
28457
28480
  if (team.forced) return `forced (${team.contributors} contributors)`;
28458
28481
  if (team.isTeam) return `detected (${team.contributors} contributors)`;
@@ -36898,9 +36921,9 @@ async function uninstall(rootDir = process11.cwd(), platform, options = {}) {
36898
36921
  }
36899
36922
  async function uninstallV3(rootDir, platform, options) {
36900
36923
  if (!platform || options.all) {
36901
- console.error("\u2717 V3 authority is protected from bulk uninstall.");
36924
+ console.error("\u2717 mancode authority is protected from bulk uninstall.");
36902
36925
  console.error(
36903
- " Remove a single bootstrap with `mancode uninstall <platform>`, or complete an explicit V3 archive/migration workflow first."
36926
+ " Remove a single bootstrap with `mancode uninstall <platform>`. Inspect runtime retention with `mancode context compact --dry-run`; V3 workflow authority is not bulk-deleted."
36904
36927
  );
36905
36928
  return EXIT_V3_AUTHORITY_PROTECTED;
36906
36929
  }
@@ -36914,17 +36937,21 @@ async function uninstallV3(rootDir, platform, options) {
36914
36937
  }
36915
36938
  if (!options.force) {
36916
36939
  console.log(
36917
- `\u2139\uFE0F This will remove only the ${formatPlatformName(platform)} V3 bootstrap.`
36940
+ `\u2139\uFE0F This will remove only the ${formatPlatformName(platform)} mancode bootstrap.`
36941
+ );
36942
+ console.log(
36943
+ " mancode task, session, and shared authority are preserved."
36918
36944
  );
36919
- console.log(" V3 task, session, and shared authority are preserved.");
36920
36945
  }
36921
36946
  try {
36922
36947
  await removeV3Adapter(rootDir, installer.name);
36923
- console.log(`\u2713 Removed ${formatPlatformName(platform)} V3 bootstrap.`);
36948
+ console.log(
36949
+ `\u2713 Removed ${formatPlatformName(platform)} mancode bootstrap.`
36950
+ );
36924
36951
  return EXIT_OK9;
36925
36952
  } catch (error) {
36926
36953
  const message = error instanceof Error ? error.message : String(error);
36927
- console.error(`\u2717 V3 bootstrap removal failed: ${message}`);
36954
+ console.error(`\u2717 mancode bootstrap removal failed: ${message}`);
36928
36955
  return EXIT_V3_AUTHORITY_PROTECTED;
36929
36956
  }
36930
36957
  }
@@ -41364,6 +41391,80 @@ function compareUtf816(left, right) {
41364
41391
  return Buffer.from(left, "utf8").compare(Buffer.from(right, "utf8"));
41365
41392
  }
41366
41393
 
41394
+ // src/commands/requirements-input.ts
41395
+ function normalizeRequirementsInput(value, requestedTaskRef, now = /* @__PURE__ */ new Date()) {
41396
+ if (isRecord13(value) && "schemaVersion" in value) {
41397
+ return parseRequirementsLedger(value);
41398
+ }
41399
+ const serialized = JSON.stringify(value);
41400
+ if (serialized === void 0) {
41401
+ throw new Error("requirements input must be valid JSON");
41402
+ }
41403
+ const semantic = parseRequirementsLedger2(serialized);
41404
+ return buildCanonicalRequirements(semantic, requestedTaskRef, now);
41405
+ }
41406
+ function buildCanonicalRequirements(semantic, requestedTaskRef, now) {
41407
+ const taskRef = parseTaskRefValue(requestedTaskRef);
41408
+ let allocatedIds = 0;
41409
+ const allocateId = () => createUlid(now.getTime() + allocatedIds++);
41410
+ const draft = {
41411
+ schemaVersion: 1,
41412
+ canonicalizationVersion: "mancode-jcs-v1",
41413
+ taskRef,
41414
+ revision: 1,
41415
+ status: semantic.blockingUnknowns.length === 0 ? "confirmed" : "draft",
41416
+ goal: semantic.goal,
41417
+ functionalScope: {
41418
+ inScope: semantic.confirmedScope,
41419
+ outOfScope: semantic.excludedScope
41420
+ },
41421
+ technicalDecisions: semantic.technicalDecisions.map((statement, index) => ({
41422
+ displayId: `TD-${index + 1}`,
41423
+ legacyId: null,
41424
+ decisionId: allocateId(),
41425
+ statement
41426
+ })),
41427
+ defaults: semantic.defaults.map((statement, index) => ({
41428
+ displayId: `D-${index + 1}`,
41429
+ legacyId: null,
41430
+ defaultId: allocateId(),
41431
+ statement
41432
+ })),
41433
+ coverage: semantic.coverage.map((item) => ({
41434
+ coverageId: allocateId(),
41435
+ ...item
41436
+ })),
41437
+ requirements: [],
41438
+ acceptanceCriteria: semantic.acceptanceCriteria.map((item) => ({
41439
+ displayId: item.id,
41440
+ legacyId: item.id,
41441
+ criterionId: allocateId(),
41442
+ requirementIds: [],
41443
+ statement: item.description,
41444
+ required: item.required,
41445
+ verificationRequirement: item.method
41446
+ })),
41447
+ blockingUnknowns: semantic.blockingUnknowns.map((statement, index) => ({
41448
+ displayId: `U-${index + 1}`,
41449
+ legacyId: null,
41450
+ unknownId: allocateId(),
41451
+ statement,
41452
+ status: "open"
41453
+ })),
41454
+ legacySource: null,
41455
+ contentDigest: "",
41456
+ lastOperationId: null,
41457
+ updatedAt: now.toISOString()
41458
+ };
41459
+ return parseRequirementsLedger({
41460
+ ...draft,
41461
+ contentDigest: requirementsLedgerDigest(draft)
41462
+ });
41463
+ }
41464
+ function isRecord13(value) {
41465
+ return typeof value === "object" && value !== null && !Array.isArray(value);
41466
+ }
41467
+
41367
41468
  // src/commands/workflow.ts
41368
41469
  var EXIT_OK10 = 0;
41369
41470
  var EXIT_NOT_INITIALIZED7 = 1;
@@ -41378,7 +41479,7 @@ async function workflow(rootDir, subcommand, args = [], options = {}) {
41378
41479
  return printV3Error(
41379
41480
  options.json,
41380
41481
  "MANCODE_V3_WRITE_REQUIRES_ACTIVATION",
41381
- "This project has staged V3 context but remains in dual-read migration. Use legacy workflows until activation."
41482
+ "This project has staged mancode context but remains in dual-read migration. Use legacy workflows until activation."
41382
41483
  );
41383
41484
  }
41384
41485
  if (options.json) {
@@ -41429,6 +41530,15 @@ async function workflow(rootDir, subcommand, args = [], options = {}) {
41429
41530
  }
41430
41531
  }
41431
41532
  async function workflowV3(rootDir, subcommand, args, options) {
41533
+ if (subcommand === "list") {
41534
+ return workflowListV3(rootDir, args, options);
41535
+ }
41536
+ if (subcommand === "show") {
41537
+ return workflowShowV3(rootDir, args, options);
41538
+ }
41539
+ if (subcommand === "clean") {
41540
+ return workflowCleanV3(options);
41541
+ }
41432
41542
  if (subcommand === "create") {
41433
41543
  return workflowCreateV3(rootDir, args, options);
41434
41544
  }
@@ -41465,9 +41575,129 @@ async function workflowV3(rootDir, subcommand, args, options) {
41465
41575
  return printV3Error(
41466
41576
  options.json,
41467
41577
  "MANCODE_V3_OPERATION_NOT_IMPLEMENTED",
41468
- `workflow ${subcommand} is not yet implemented for V3 authority.`
41578
+ `workflow ${subcommand} is not yet implemented for mancode authority.`
41579
+ );
41580
+ }
41581
+ async function workflowListV3(rootDir, args, options) {
41582
+ if (args.length !== 0) {
41583
+ return printV3Error(
41584
+ options.json,
41585
+ "MANCODE_WORKFLOW_LIST_ARGUMENT_INVALID",
41586
+ "Use: workflow list [--json].",
41587
+ EXIT_INVALID_ARG3
41588
+ );
41589
+ }
41590
+ try {
41591
+ const project = await readV3CommandProject(rootDir);
41592
+ const workflows = await project.store.listWorkflowMetadata();
41593
+ if (options.json) {
41594
+ return printV3Result(true, {
41595
+ schemaVersion: 1,
41596
+ workflows
41597
+ });
41598
+ }
41599
+ if (workflows.length === 0) {
41600
+ console.log("No mancode workflows.");
41601
+ return EXIT_OK10;
41602
+ }
41603
+ const active = workflows.filter(
41604
+ (item) => ["in_progress", "planned", "blocked"].includes(item.status)
41605
+ ).length;
41606
+ console.log(
41607
+ `mancode workflows (${workflows.length} total, ${active} active)`
41608
+ );
41609
+ console.log("");
41610
+ for (const metadata of workflows) {
41611
+ console.log(formatV3WorkflowRow(metadata));
41612
+ }
41613
+ return EXIT_OK10;
41614
+ } catch (error) {
41615
+ return printV3Error(
41616
+ options.json,
41617
+ v3ErrorCode(error, "MANCODE_V3_WORKFLOW_LIST_FAILED"),
41618
+ error instanceof Error ? error.message : "Unable to list mancode workflows."
41619
+ );
41620
+ }
41621
+ }
41622
+ async function workflowShowV3(rootDir, args, options) {
41623
+ const requested = args[0];
41624
+ if (!requested || args.length !== 1) {
41625
+ return printV3Error(
41626
+ options.json,
41627
+ "MANCODE_WORKFLOW_SHOW_ARGUMENT_INVALID",
41628
+ "Use: workflow show <namespace:ULID> [--json].",
41629
+ EXIT_INVALID_ARG3
41630
+ );
41631
+ }
41632
+ try {
41633
+ const project = await readV3CommandProject(rootDir);
41634
+ const location = await project.store.locateTask(requested);
41635
+ const [snapshot, activeChildren] = await Promise.all([
41636
+ project.store.readTaskSnapshot(location.taskRef),
41637
+ project.store.listActiveChildTaskRefs(location.taskRef)
41638
+ ]);
41639
+ const result2 = {
41640
+ schemaVersion: 1,
41641
+ taskRef: location.taskRef,
41642
+ metadata: snapshot.metadata,
41643
+ aggregate: snapshot.aggregate,
41644
+ aggregateError: snapshot.aggregateError,
41645
+ activeChildren
41646
+ };
41647
+ if (options.json) return printV3Result(true, result2);
41648
+ const metadata = snapshot.metadata;
41649
+ console.log(`Workflow: ${formatTaskRef(metadata.taskRef)}`);
41650
+ console.log(`Task: ${metadata.task}`);
41651
+ console.log(`Mode: ${metadata.workflowMode}`);
41652
+ console.log(`Status: ${metadata.status}`);
41653
+ console.log(
41654
+ `Current step: ${metadata.currentStep}/${maxV3WorkflowStep(metadata.workflowMode)}`
41655
+ );
41656
+ console.log(`Revision: ${metadata.revision}`);
41657
+ console.log(`Visibility: ${metadata.visibility}`);
41658
+ console.log(`Coordination: ${metadata.coordination}`);
41659
+ console.log(`Updated: ${metadata.updatedAt}`);
41660
+ if (metadata.blockingReason !== null) {
41661
+ console.log(`Blocked: ${metadata.blockingReason}`);
41662
+ }
41663
+ if (activeChildren.length > 0) {
41664
+ console.log(
41665
+ `Children: ${activeChildren.map(formatTaskRef).join(", ")}`
41666
+ );
41667
+ }
41668
+ if (snapshot.aggregateError !== null) {
41669
+ console.log(`Aggregate: ${snapshot.aggregateError}`);
41670
+ }
41671
+ return EXIT_OK10;
41672
+ } catch (error) {
41673
+ return printV3Error(
41674
+ options.json,
41675
+ v3ErrorCode(error, "MANCODE_V3_WORKFLOW_SHOW_FAILED"),
41676
+ error instanceof Error ? error.message : "Unable to show the mancode workflow."
41677
+ );
41678
+ }
41679
+ }
41680
+ function workflowCleanV3(options) {
41681
+ return printV3Error(
41682
+ options.json,
41683
+ "MANCODE_V3_WORKFLOW_CLEAN_UNSUPPORTED",
41684
+ "V3 workflow authority is durable and is not deleted by workflow clean. Use `mancode context compact --dry-run` to inspect eligible runtime retention records.",
41685
+ EXIT_INVALID_ARG3
41469
41686
  );
41470
41687
  }
41688
+ function formatV3WorkflowRow(metadata) {
41689
+ return [
41690
+ formatTaskRef(metadata.taskRef),
41691
+ metadata.workflowMode,
41692
+ metadata.status,
41693
+ `Step ${metadata.currentStep}/${maxV3WorkflowStep(metadata.workflowMode)}`,
41694
+ `r${metadata.revision}`,
41695
+ metadata.task
41696
+ ].join(" ");
41697
+ }
41698
+ function maxV3WorkflowStep(mode) {
41699
+ return mode === "manba" ? 5 : 9;
41700
+ }
41471
41701
  async function workflowUpdateV3(rootDir, args, options) {
41472
41702
  const task = args[0];
41473
41703
  if (!task || args.length !== 1) {
@@ -41482,7 +41712,7 @@ async function workflowUpdateV3(rootDir, args, options) {
41482
41712
  return printV3Error(
41483
41713
  options.json,
41484
41714
  "MANCODE_WORKFLOW_UPDATE_EMPTY",
41485
- "V3 workflow update requires --status or --blocking-reason.",
41715
+ "Workflow update requires --status or --blocking-reason.",
41486
41716
  EXIT_INVALID_ARG3
41487
41717
  );
41488
41718
  }
@@ -41490,7 +41720,7 @@ async function workflowUpdateV3(rootDir, args, options) {
41490
41720
  return printV3Error(
41491
41721
  options.json,
41492
41722
  "MANCODE_V3_WORKFLOW_UPDATE_FIELD_UNSUPPORTED",
41493
- "V3 workflow update only changes lifecycle status and a blocked reason. Use the dedicated requirements, plan, review, verification, scope, complete, or promote command for governed fields.",
41723
+ "Workflow update only changes lifecycle status and a blocked reason. Use the dedicated requirements, plan, review, verification, scope, complete, or promote command for governed fields.",
41494
41724
  EXIT_INVALID_ARG3
41495
41725
  );
41496
41726
  }
@@ -41499,7 +41729,7 @@ async function workflowUpdateV3(rootDir, args, options) {
41499
41729
  return printV3Error(
41500
41730
  options.json,
41501
41731
  "MANCODE_EXPECTED_REVISION_REQUIRED",
41502
- "V3 workflow update requires --expected-revision <positive integer>.",
41732
+ "Workflow update requires --expected-revision <positive integer>.",
41503
41733
  EXIT_INVALID_ARG3
41504
41734
  );
41505
41735
  }
@@ -41554,7 +41784,7 @@ async function workflowUpdateV3(rootDir, args, options) {
41554
41784
  return printV3Error(
41555
41785
  options.json,
41556
41786
  v3ErrorCode(error, "MANCODE_V3_WORKFLOW_UPDATE_FAILED"),
41557
- error instanceof Error ? error.message : "Unable to update the V3 workflow lifecycle."
41787
+ error instanceof Error ? error.message : "Unable to update the mancode workflow lifecycle."
41558
41788
  );
41559
41789
  }
41560
41790
  }
@@ -41606,7 +41836,7 @@ async function workflowChildResultMergeV3(rootDir, args, options) {
41606
41836
  return printV3Error(
41607
41837
  options.json,
41608
41838
  v3ErrorCode(error, "MANCODE_V3_CHILD_RESULT_MERGE_FAILED"),
41609
- error instanceof Error ? error.message : "Unable to merge the V3 child diagnostic result."
41839
+ error instanceof Error ? error.message : "Unable to merge the mancode child diagnostic result."
41610
41840
  );
41611
41841
  }
41612
41842
  }
@@ -41663,7 +41893,7 @@ async function workflowSoloHandoffV3(rootDir, args, options) {
41663
41893
  return printV3Error(
41664
41894
  options.json,
41665
41895
  v3ErrorCode(error, "MANCODE_V3_SOLO_HANDOFF_FAILED"),
41666
- error instanceof Error ? error.message : "Unable to run the V3 solo handoff."
41896
+ error instanceof Error ? error.message : "Unable to run the mancode solo handoff."
41667
41897
  );
41668
41898
  }
41669
41899
  }
@@ -41723,7 +41953,7 @@ async function workflowPromoteV3(rootDir, args, options) {
41723
41953
  return printV3Error(
41724
41954
  options.json,
41725
41955
  v3ErrorCode(error, "MANCODE_V3_WORKFLOW_PROMOTE_FAILED"),
41726
- error instanceof Error ? error.message : "Unable to preview the V3 workflow promotion."
41956
+ error instanceof Error ? error.message : "Unable to preview the mancode workflow promotion."
41727
41957
  );
41728
41958
  }
41729
41959
  }
@@ -41753,7 +41983,7 @@ async function workflowPromoteV3(rootDir, args, options) {
41753
41983
  return printV3Error(
41754
41984
  options.json,
41755
41985
  v3ErrorCode(error, "MANCODE_V3_WORKFLOW_PROMOTE_FAILED"),
41756
- error instanceof Error ? error.message : "Unable to promote the local V3 workflow."
41986
+ error instanceof Error ? error.message : "Unable to promote the local mancode workflow."
41757
41987
  );
41758
41988
  }
41759
41989
  }
@@ -41835,7 +42065,7 @@ async function workflowScopeChangeV3(rootDir, args, options) {
41835
42065
  return printV3Error(
41836
42066
  options.json,
41837
42067
  v3ErrorCode(error, "MANCODE_V3_SCOPE_CHANGE_FAILED"),
41838
- error instanceof Error ? error.message : "Unable to change the V3 workflow scope."
42068
+ error instanceof Error ? error.message : "Unable to change the mancode workflow scope."
41839
42069
  );
41840
42070
  }
41841
42071
  }
@@ -41908,7 +42138,7 @@ async function workflowCompleteV3(rootDir, args, options) {
41908
42138
  return printV3Error(
41909
42139
  options.json,
41910
42140
  v3ErrorCode(error, "MANCODE_V3_TASK_COMPLETE_FAILED"),
41911
- error instanceof Error ? error.message : "Unable to complete the V3 task."
42141
+ error instanceof Error ? error.message : "Unable to complete the mancode task."
41912
42142
  );
41913
42143
  }
41914
42144
  }
@@ -41958,7 +42188,7 @@ async function workflowVerifyV3(rootDir, args, options) {
41958
42188
  return printV3Error(
41959
42189
  options.json,
41960
42190
  v3ErrorCode(error, "MANCODE_V3_VERIFICATION_RECORD_FAILED"),
41961
- error instanceof Error ? error.message : "Unable to record V3 verification."
42191
+ error instanceof Error ? error.message : "Unable to record mancode verification."
41962
42192
  );
41963
42193
  }
41964
42194
  }
@@ -42009,7 +42239,7 @@ async function workflowReviewV3(rootDir, args, options) {
42009
42239
  return printV3Error(
42010
42240
  options.json,
42011
42241
  v3ErrorCode(error, "MANCODE_V3_REVIEW_APPLY_FAILED"),
42012
- error instanceof Error ? error.message : "Unable to apply the V3 review."
42242
+ error instanceof Error ? error.message : "Unable to apply the mancode review."
42013
42243
  );
42014
42244
  }
42015
42245
  }
@@ -42083,7 +42313,7 @@ async function workflowPlanV3(rootDir, args, options) {
42083
42313
  return printV3Error(
42084
42314
  options.json,
42085
42315
  v3ErrorCode(error, "MANCODE_V3_PLAN_REVISION_FAILED"),
42086
- error instanceof Error ? error.message : "Unable to revise the V3 plan."
42316
+ error instanceof Error ? error.message : "Unable to revise the mancode plan."
42087
42317
  );
42088
42318
  }
42089
42319
  }
@@ -42110,13 +42340,15 @@ async function workflowRequirementsV3(rootDir, args, options) {
42110
42340
  try {
42111
42341
  const project = await readV3CommandProject(rootDir);
42112
42342
  const session = await resolveV3CommandSession(project, options);
42113
- const requirements = await readWorkflowJsonInputFile(
42343
+ const taskRef = parseTaskRef(task);
42344
+ const requirementsInput = await readWorkflowJsonInputFile(
42114
42345
  project.projectRoot,
42115
42346
  options.file
42116
42347
  );
42348
+ const requirements = normalizeRequirementsInput(requirementsInput, taskRef);
42117
42349
  const result2 = await finalizeV3Requirements({
42118
42350
  projectRoot: project.projectRoot,
42119
- taskRef: parseTaskRef(task),
42351
+ taskRef,
42120
42352
  sessionId: session.sessionId,
42121
42353
  expectedTaskRevision,
42122
42354
  requirements
@@ -42136,7 +42368,7 @@ async function workflowRequirementsV3(rootDir, args, options) {
42136
42368
  return printV3Error(
42137
42369
  options.json,
42138
42370
  v3ErrorCode(error, "MANCODE_V3_REQUIREMENTS_FINALIZE_FAILED"),
42139
- error instanceof Error ? error.message : "Unable to finalize V3 requirements."
42371
+ error instanceof Error ? error.message : "Unable to finalize mancode requirements."
42140
42372
  );
42141
42373
  }
42142
42374
  }
@@ -42230,7 +42462,7 @@ async function workflowCreateV3(rootDir, args, options) {
42230
42462
  return printV3Error(
42231
42463
  options.json,
42232
42464
  v3ErrorCode(error, "MANCODE_V3_WORKFLOW_CREATE_FAILED"),
42233
- error instanceof Error ? error.message : "Unable to create V3 workflow."
42465
+ error instanceof Error ? error.message : "Unable to create mancode workflow."
42234
42466
  );
42235
42467
  }
42236
42468
  }
@@ -43405,7 +43637,7 @@ async function pathExists16(p) {
43405
43637
  program.name("mancode").description(
43406
43638
  "AI coding agent harness. Modes: solo, man, manba, manteam, manps."
43407
43639
  ).version(VERSION);
43408
- program.command("init").description("Initialize mancode in the current project").option("--force", "Reinstall even if already initialized").option("--yes", "Skip all confirmations (CI mode)").option("--team", "Force enable team mode (MVP-2)").option("--no-team", "Force disable team mode (MVP-2)").option("--style <name>", "Specify aesthetic style (MVP-2)").option("--platform <platforms>", "Adapters: comma-separated names or all").option("--empty", "Initialize a safe empty directory as a generic project").option("--v3", "Use V3 authority explicitly (the CLI default)").option("--legacy", "Use the legacy state.json initializer").option("--lang <locale>", "Initialization language: zh-CN or en").action(async (options) => {
43640
+ program.command("init").description("Initialize mancode in the current project").option("--force", "Reinstall even if already initialized").option("--yes", "Skip all confirmations (CI mode)").option("--team", "Force enable team mode (MVP-2)").option("--no-team", "Force disable team mode (MVP-2)").option("--style <name>", "Specify aesthetic style (MVP-2)").option("--platform <platforms>", "Adapters: comma-separated names or all").option("--empty", "Initialize a safe empty directory as a generic project").addOption(new Option("--v3").hideHelp()).option("--legacy", "Use the legacy state.json initializer").option("--lang <locale>", "Initialization language: zh-CN or en").action(async (options) => {
43409
43641
  const code = await init(process.cwd(), {
43410
43642
  ...options,
43411
43643
  fromCli: true,
@@ -43417,7 +43649,7 @@ program.command("install [platform]").description(
43417
43649
  "Install platform adapter (claude-code, cursor, codex, copilot, zcode)"
43418
43650
  ).option("--force", "Reinstall even if already installed").option("--minimal", "Minimal install (MVP-2)").option(
43419
43651
  "--shadow",
43420
- "Stage a V3 bootstrap candidate without changing live files"
43652
+ "Stage a mancode bootstrap candidate without changing live files"
43421
43653
  ).action(async (platform, options) => {
43422
43654
  const code = await install(
43423
43655
  process.cwd(),
@@ -43441,15 +43673,15 @@ program.command("uninstall [platform]").description("Remove platform adapter or
43441
43673
  program.command("workflow <subcommand> [args...]").description("Manage mancode workflows").option("--dry-run", "Preview clean without deleting").option("--older-than <duration>", "Clean workflows older than (e.g. 30d)").option("--step <n>", "Update workflow current step").option("--status <status>", "Update workflow status").option(
43442
43674
  "--parent-task <taskId>",
43443
43675
  "Parent /man or /manteam workflow for manba"
43444
- ).option("--parent <namespace:id>", "V3 parent TaskRef for a manba child").option(
43676
+ ).option("--parent <namespace:id>", "Parent TaskRef for a manba child").option(
43445
43677
  "--participant <actorId>",
43446
43678
  "Invite a joined team participant",
43447
43679
  collectOption,
43448
43680
  []
43449
- ).option("--visibility <visibility>", "V3: local or shared").option("--coordination <coordination>", "V3: single or team").option("--session <id>", "V3 session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "V3 client identity (default: mancode-cli)").option("--expected-revision <n>", "V3 expected task revision for mutations").option("--child-revision <n>", "V3 expected child task revision for merge").option("--summary <text>", "Privacy-screened child result summary").option("--next-action <text>", "Next parent action after a child merge").option("--sync", "Publish shared V3 mutations through git-ref transport").option(
43681
+ ).option("--visibility <visibility>", "Task visibility: local or shared").option("--coordination <coordination>", "Task coordination: single or team").option("--session <id>", "mancode session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--expected-revision <n>", "Expected task revision for mutations").option("--child-revision <n>", "Expected child task revision for merge").option("--summary <text>", "Privacy-screened child result summary").option("--next-action <text>", "Next parent action after a child merge").option("--sync", "Publish shared mutations through git-ref transport").option(
43450
43682
  "--confirm-shared",
43451
- "Confirm that task metadata may enter shared V3 authority"
43452
- ).option("--blocking-reason <reason>", "Explain why a workflow is blocked").option("--outcome <outcome>", "Set manba outcome when completing a V3 task").option("--plan-version <n>", "Set the next man/manteam plan revision").option(
43683
+ "Confirm that task metadata may enter shared mancode authority"
43684
+ ).option("--blocking-reason <reason>", "Explain why a workflow is blocked").option("--outcome <outcome>", "Set manba outcome when completing a task").option("--plan-version <n>", "Set the next man/manteam plan revision").option(
43453
43685
  "--requirements-status <status>",
43454
43686
  "Planning readiness: ready or needs_clarification"
43455
43687
  ).option(
@@ -43464,21 +43696,24 @@ program.command("workflow <subcommand> [args...]").description("Manage mancode w
43464
43696
  ).option("--blockers <ids>", "Comma-separated blocker ids found by a review").option(
43465
43697
  "--resolved <ids>",
43466
43698
  "Comma-separated blocker ids resolved in remediation"
43467
- ).option("--file <path>", "Structured requirements JSON input file").option("--acceptance <id>", "Acceptance criterion id (for example AC-1)").option("--method <method>", "Verification method: automated or manual").option("--result <result>", "Verification result").option("--evidence <text>", "Verification evidence or user confirmation").option("--command <command>", "Command used for automated verification").option("--exit-code <code>", "Exit code from automated verification").option("--evidence-file <path>", "Existing verification report or artifact").option("--reason <reason>", "Reason for an explicit review skip").option("--json", "Output as JSON (for scripts)").action(async (subcommand, args, options) => {
43699
+ ).option(
43700
+ "--file <path>",
43701
+ "Semantic or canonical structured requirements JSON input file"
43702
+ ).option("--acceptance <id>", "Acceptance criterion id (for example AC-1)").option("--method <method>", "Verification method: automated or manual").option("--result <result>", "Verification result").option("--evidence <text>", "Verification evidence or user confirmation").option("--command <command>", "Command used for automated verification").option("--exit-code <code>", "Exit code from automated verification").option("--evidence-file <path>", "Existing verification report or artifact").option("--reason <reason>", "Reason for an explicit review skip").option("--json", "Output as JSON (for scripts)").action(async (subcommand, args, options) => {
43468
43703
  const code = await workflow(process.cwd(), subcommand, args ?? [], {
43469
43704
  ...options,
43470
43705
  participants: options.participant.length === 0 ? void 0 : options.participant
43471
43706
  });
43472
43707
  process.exitCode = code;
43473
43708
  });
43474
- var contextProgram = program.command("context").description("Resolve V3 task context and manage explicit sessions");
43475
- contextProgram.command("show").description("Resolve one V3 Context Pack").option("--task <namespace:id>", "Explicit TaskRef").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--level <level>", "bootstrap, task, or full").option(
43709
+ var contextProgram = program.command("context").description("Resolve mancode task context and manage explicit sessions");
43710
+ contextProgram.command("show").description("Resolve one mancode Context Pack").option("--task <namespace:id>", "Explicit TaskRef").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--level <level>", "bootstrap, task, or full").option(
43476
43711
  "--purpose <purpose>",
43477
43712
  "orient, plan, implement, review, verify, or handoff"
43478
43713
  ).option("--json", "Output as JSON (for scripts)").action(async (options) => {
43479
43714
  process.exitCode = await contextShow(process.cwd(), options);
43480
43715
  });
43481
- var contextSessionProgram = contextProgram.command("session").description("Manage V3 session identities");
43716
+ var contextSessionProgram = contextProgram.command("session").description("Manage mancode session identities");
43482
43717
  contextSessionProgram.command("new").description("Create an explicit bootstrap session").requiredOption("--client <name>", "Client identity").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43483
43718
  process.exitCode = await contextSessionNew(process.cwd(), options);
43484
43719
  });
@@ -43509,13 +43744,13 @@ contextSessionProgram.command("spike").description("Record real-host session evi
43509
43744
  ).option("--json", "Output as JSON (for scripts)").action(async (options) => {
43510
43745
  process.exitCode = await contextSessionSpike(process.cwd(), options);
43511
43746
  });
43512
- contextProgram.command("resume <namespace:id>").description("Validate and bind the current session to a V3 TaskRef").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--sync", "Publish shared V3 mutations through git-ref transport").option("--json", "Output as JSON (for scripts)").action(async (task, options) => {
43747
+ contextProgram.command("resume <namespace:id>").description("Validate and bind the current session to a mancode TaskRef").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--sync", "Publish shared mutations through git-ref transport").option("--json", "Output as JSON (for scripts)").action(async (task, options) => {
43513
43748
  process.exitCode = await contextResume(process.cwd(), task, options);
43514
43749
  });
43515
43750
  contextProgram.command("close").description("Close one explicit session without affecting other sessions").requiredOption("--session <id>", "Session ID").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43516
43751
  process.exitCode = await contextClose(process.cwd(), options);
43517
43752
  });
43518
- contextProgram.command("doctor").description("Inspect unfinished V3 operations or repair one explicitly").option(
43753
+ contextProgram.command("doctor").description("Inspect unfinished mancode operations or repair one explicitly").option(
43519
43754
  "--repair <operationId>",
43520
43755
  "Repair this operation with its original session"
43521
43756
  ).option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--json", "Output as JSON (for scripts)").action(async (options) => {
@@ -43524,10 +43759,10 @@ contextProgram.command("doctor").description("Inspect unfinished V3 operations o
43524
43759
  contextProgram.command("diagnostics [action]").description("Show or configure local aggregate diagnostics").option("--json", "Output as JSON (for scripts)").action(async (action, options) => {
43525
43760
  process.exitCode = await contextDiagnostics(process.cwd(), action, options);
43526
43761
  });
43527
- contextProgram.command("compact").description("List and remove eligible V3 runtime retention candidates").option("--task <namespace:id>", "Compact checkpoints for one completed task").option("--dry-run", "Show the deletion list without changing files").option("--apply-shared", "Permit deletion for shared completed tasks").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43762
+ contextProgram.command("compact").description("List and remove eligible mancode runtime retention candidates").option("--task <namespace:id>", "Compact checkpoints for one completed task").option("--dry-run", "Show the deletion list without changing files").option("--apply-shared", "Permit deletion for shared completed tasks").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43528
43763
  process.exitCode = await contextCompact(process.cwd(), options);
43529
43764
  });
43530
- contextProgram.command("beta").description("Evaluate hard V3 Beta readiness gates").requiredOption(
43765
+ contextProgram.command("beta", { hidden: true }).description("Evaluate internal release-evidence gates").requiredOption(
43531
43766
  "--release-candidate <id>",
43532
43767
  "Release candidate that must match every platform evidence record"
43533
43768
  ).option("--json", "Output as JSON (for scripts)").action(async (options) => {
@@ -43554,11 +43789,13 @@ contextProgram.command("reconcile-task-head <shared:id>").description(
43554
43789
  options
43555
43790
  );
43556
43791
  });
43557
- var contextWorktreeProgram = contextProgram.command("worktree").description("Register and inspect the current V3 checkout binding");
43558
- contextWorktreeProgram.command("register").description("Register this linked worktree before using V3 coordination").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43792
+ var contextWorktreeProgram = contextProgram.command("worktree").description("Register and inspect the current mancode checkout binding");
43793
+ contextWorktreeProgram.command("register").description(
43794
+ "Register this linked worktree before using mancode coordination"
43795
+ ).option("--json", "Output as JSON (for scripts)").action(async (options) => {
43559
43796
  process.exitCode = await contextWorktreeRegister(process.cwd(), options);
43560
43797
  });
43561
- var operationProgram = program.command("operation").description("Inspect and recover durable V3 operations");
43798
+ var operationProgram = program.command("operation").description("Inspect and recover durable mancode operations");
43562
43799
  operationProgram.command("show <operationId>").description("Show one operation journal and its recovery disposition").option("--json", "Output as JSON (for scripts)").action(async (operationId, options) => {
43563
43800
  process.exitCode = await operationShow(process.cwd(), operationId, options);
43564
43801
  });
@@ -43578,11 +43815,11 @@ operationProgram.command("abort <operationId>").description(
43578
43815
  options
43579
43816
  );
43580
43817
  });
43581
- var teamProgram = program.command("team").description("Manage V3 local identity and local-team membership");
43582
- teamProgram.command("status").description("Show V3 team policy, transport, and local identity state").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43818
+ var teamProgram = program.command("team").description("Manage mancode local identity and local-team membership");
43819
+ teamProgram.command("status").description("Show mancode team policy, transport, and local identity state").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43583
43820
  process.exitCode = await teamStatus(process.cwd(), options);
43584
43821
  });
43585
- teamProgram.command("policy <mode>").description("Set the V3 team recommendation policy with a revision CAS").requiredOption("--expected-revision <n>", "Current team policy revision").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--json", "Output as JSON (for scripts)").action(async (policy, options) => {
43822
+ teamProgram.command("policy <mode>").description("Set the mancode team recommendation policy with a revision CAS").requiredOption("--expected-revision <n>", "Current team policy revision").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--json", "Output as JSON (for scripts)").action(async (policy, options) => {
43586
43823
  process.exitCode = await teamPolicy(process.cwd(), {
43587
43824
  ...options,
43588
43825
  policy
@@ -43656,7 +43893,7 @@ teamProgram.command("join").description(
43656
43893
  ).requiredOption("--name <displayName>", "Must match the local actor identity").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--sync", "Request explicit remote sync when transport supports it").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43657
43894
  process.exitCode = await teamJoin(process.cwd(), options);
43658
43895
  });
43659
- teamProgram.command("checkpoint <namespace:id>").description("Create a journaled immutable checkpoint for a shared V3 task").requiredOption(
43896
+ teamProgram.command("checkpoint <namespace:id>").description("Create a journaled immutable checkpoint for a shared task").requiredOption(
43660
43897
  "--expected-task-revision <n>",
43661
43898
  "Current shared task revision"
43662
43899
  ).requiredOption("--kind <kind>", "Checkpoint kind").requiredOption("--summary <text>", "Privacy-safe checkpoint summary").option("--next-action <text>", "Next action for the receiving workflow").option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--json", "Output as JSON (for scripts)").action(async (task, options) => {
@@ -43665,7 +43902,7 @@ teamProgram.command("checkpoint <namespace:id>").description("Create a journaled
43665
43902
  task
43666
43903
  });
43667
43904
  });
43668
- teamProgram.command("claim <namespace:id>").description("Acquire a scoped claim for a shared V3 task").requiredOption(
43905
+ teamProgram.command("claim <namespace:id>").description("Acquire a scoped claim for a shared task").requiredOption(
43669
43906
  "--expected-task-revision <n>",
43670
43907
  "Current shared task revision"
43671
43908
  ).option("--path <glob>", "Repository-relative path glob", collectOption, []).option("--module <name>", "Implementation module", collectOption, []).option("--api <name>", "Public API boundary", collectOption, []).option("--schema <name>", "Shared schema boundary", collectOption, []).option("--session <id>", "Session ID (otherwise MANCODE_SESSION_ID)").option("--client <name>", "Client identity (default: mancode-cli)").option("--sync", "Publish through the active git-ref authority").option("--json", "Output as JSON (for scripts)").action(async (task, options) => {
@@ -43742,18 +43979,21 @@ teamHandoffProgram.command("cancel <handoffId>").description("Cancel a draft or
43742
43979
  handoffId
43743
43980
  });
43744
43981
  });
43745
- var migrateProgram = program.command("migrate").description("Inspect and migrate legacy mancode context into V3 staging");
43746
- var migrateContextProgram = migrateProgram.command("context").description("Manage the isolated legacy-to-V3 context migration stage").option("--dry-run", "Inspect legacy authority without writing files").option("--stage", "Create or refresh an isolated local migration stage").option("--status", "Show local migration stages").option("--activate", "Attempt the journaled V3 activation").option("--rollback <operationId>", "Roll back an untouched V3 activation").option("--stage-id <id>", "Migration stage ID (required if more than one)").option(
43982
+ var migrateProgram = program.command("migrate").description("Inspect and migrate legacy context into mancode staging");
43983
+ var migrateContextProgram = migrateProgram.command("context").description("Manage the isolated legacy-to-mancode context migration stage").option("--dry-run", "Inspect legacy authority without writing files").option("--stage", "Create or refresh an isolated local migration stage").option("--status", "Show local migration stages").option("--activate", "Attempt the journaled mancode activation").option(
43984
+ "--rollback <operationId>",
43985
+ "Roll back an untouched mancode activation"
43986
+ ).option("--stage-id <id>", "Migration stage ID (required if more than one)").option(
43747
43987
  "--expected-stage-revision <n>",
43748
43988
  "Expected stage revision for activation"
43749
- ).option("--session <id>", "Active session required for activation").option("--confirm", "Explicitly confirm the V3 cutover").option("--confirm-shared", "Confirm promotion of staged shared authority").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43989
+ ).option("--session <id>", "Active session required for activation").option("--confirm", "Explicitly confirm the mancode cutover").option("--confirm-shared", "Confirm promotion of staged shared authority").option("--json", "Output as JSON (for scripts)").action(async (options) => {
43750
43990
  const code = await migrateContext(process.cwd(), options);
43751
43991
  process.exitCode = code;
43752
43992
  });
43753
43993
  migrateContextProgram.command("resolve <legacyTaskId>").description("Resolve missing owner or implementation scope in one stage").requiredOption(
43754
43994
  "--expected-stage-revision <n>",
43755
43995
  "Expected local migration stage revision"
43756
- ).option("--stage-id <id>", "Migration stage ID (required if more than one)").option("--owner <actorId>", "Explicit V3 owner actor ID").option(
43996
+ ).option("--stage-id <id>", "Migration stage ID (required if more than one)").option("--owner <actorId>", "Explicit owner actor ID").option(
43757
43997
  "--scope-file <path>",
43758
43998
  "JSON implementation scope {include,exclude,modules}"
43759
43999
  ).option("--json", "Output as JSON (for scripts)").action(async (legacyTaskId, options) => {