@loomhelm/multi-task-flow 0.2.6 → 0.2.7

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.
Files changed (93) hide show
  1. package/README.md +3 -3
  2. package/package.json +1 -1
  3. package/toolkit/artifact-manifest.json +330 -26
  4. package/toolkit/package.json +1 -1
  5. package/toolkit/skills/docs-migrate/scripts/_runtime/compatibility_cli.ts +12 -0
  6. package/toolkit/skills/docs-migrate/scripts/_runtime/compatibility_docs.ts +115 -0
  7. package/toolkit/skills/docs-migrate/scripts/_runtime/compatibility_shared.ts +230 -0
  8. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/checks/replay.ts +336 -0
  9. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/git.ts +54 -0
  10. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/hardware_ingest.ts +377 -0
  11. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/hardware_locks.ts +181 -0
  12. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/legacy_spec_id.ts +131 -0
  13. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/migration_common.ts +291 -0
  14. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/next_plan.ts +199 -0
  15. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/next_plan_support.ts +245 -0
  16. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_contract.ts +299 -0
  17. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift.ts +387 -0
  18. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_helpers.ts +381 -0
  19. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_legacy.ts +376 -0
  20. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_paths.ts +3 -0
  21. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_types.ts +27 -0
  22. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_validation.ts +251 -0
  23. package/toolkit/skills/docs-migrate/scripts/_runtime/modules/docs/spec_migration.ts +191 -0
  24. package/toolkit/skills/docs-migrate/scripts/gen_legacy_spec_id.ts +1 -1
  25. package/toolkit/skills/docs-migrate/scripts/specs_migrate_guard.ts +1 -1
  26. package/toolkit/skills/find-next-plan/scripts/_runtime/compatibility_cli.ts +12 -0
  27. package/toolkit/skills/find-next-plan/scripts/_runtime/compatibility_docs.ts +115 -0
  28. package/toolkit/skills/find-next-plan/scripts/_runtime/compatibility_shared.ts +230 -0
  29. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/checks/replay.ts +336 -0
  30. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/git.ts +54 -0
  31. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/hardware_ingest.ts +377 -0
  32. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/hardware_locks.ts +181 -0
  33. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/legacy_spec_id.ts +131 -0
  34. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/migration_common.ts +291 -0
  35. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/next_plan.ts +199 -0
  36. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/next_plan_support.ts +245 -0
  37. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_contract.ts +299 -0
  38. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift.ts +387 -0
  39. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_helpers.ts +381 -0
  40. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_legacy.ts +376 -0
  41. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_paths.ts +3 -0
  42. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_types.ts +27 -0
  43. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_validation.ts +251 -0
  44. package/toolkit/skills/find-next-plan/scripts/_runtime/modules/docs/spec_migration.ts +191 -0
  45. package/toolkit/skills/find-next-plan/scripts/find_next_plan.ts +1 -1
  46. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/compatibility_cli.ts +12 -0
  47. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/compatibility_docs.ts +115 -0
  48. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/compatibility_shared.ts +230 -0
  49. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/checks/replay.ts +336 -0
  50. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/git.ts +54 -0
  51. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/hardware_ingest.ts +377 -0
  52. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/hardware_locks.ts +181 -0
  53. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/legacy_spec_id.ts +131 -0
  54. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/migration_common.ts +291 -0
  55. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/next_plan.ts +199 -0
  56. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/next_plan_support.ts +245 -0
  57. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_contract.ts +299 -0
  58. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift.ts +387 -0
  59. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_helpers.ts +381 -0
  60. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_legacy.ts +376 -0
  61. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_paths.ts +3 -0
  62. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_types.ts +27 -0
  63. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_validation.ts +251 -0
  64. package/toolkit/skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_migration.ts +191 -0
  65. package/toolkit/skills/hardware-doc-ingest/scripts/ingest_mineru_extract.ts +1 -1
  66. package/toolkit/skills/hardware-doc-ingest/scripts/verify_doc_locks.ts +1 -1
  67. package/toolkit/skills/multi-task-flow/dist/app.js +66 -66
  68. package/toolkit/skills/multi-task-flow/lib/view.ts +6 -2
  69. package/toolkit/skills/multi-task-flow/web/app.ts +2 -2
  70. package/toolkit/skills/multi-task-flow/web/graph-layout.ts +3 -3
  71. package/toolkit/skills/source-manifest.json +315 -11
  72. package/toolkit/skills/spec-sync/SKILL.md +1 -1
  73. package/toolkit/skills/spec-sync/scripts/_runtime/compatibility_cli.ts +12 -0
  74. package/toolkit/skills/spec-sync/scripts/_runtime/compatibility_docs.ts +115 -0
  75. package/toolkit/skills/spec-sync/scripts/_runtime/compatibility_shared.ts +230 -0
  76. package/toolkit/skills/spec-sync/scripts/_runtime/modules/checks/replay.ts +336 -0
  77. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/git.ts +54 -0
  78. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/hardware_ingest.ts +377 -0
  79. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/hardware_locks.ts +181 -0
  80. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/legacy_spec_id.ts +131 -0
  81. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/migration_common.ts +291 -0
  82. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/next_plan.ts +199 -0
  83. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/next_plan_support.ts +245 -0
  84. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_contract.ts +299 -0
  85. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_drift.ts +387 -0
  86. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_helpers.ts +381 -0
  87. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_legacy.ts +376 -0
  88. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_paths.ts +3 -0
  89. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_types.ts +27 -0
  90. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_validation.ts +251 -0
  91. package/toolkit/skills/spec-sync/scripts/_runtime/modules/docs/spec_migration.ts +191 -0
  92. package/toolkit/skills/spec-sync/scripts/spec_drift_check.ts +1 -1
  93. package/toolkit/skills/support-manifest.json +77 -1
@@ -697,6 +697,10 @@ export function buildView(
697
697
  scope: { kind: "task" as const, task_id: node.ref_id ?? node.id, delivery_unit_id: task?.group_id ?? node.group_id ?? "unassigned" },
698
698
  };
699
699
  });
700
+ const legacyAtomicNodeIds = new Map<string, string>([
701
+ ...plan.atoms.map((atom) => [atom.id, atom.task_id] as const),
702
+ ...plan.group_atoms.map((atom) => [atom.id, atom.group_id] as const),
703
+ ]);
700
704
  const nodeData = plan.nodes.map((node) => ({
701
705
  ...node,
702
706
  planned_group_id: node.group_id,
@@ -717,7 +721,7 @@ export function buildView(
717
721
  const declaredAtomicEdges: AtomicEdge[] = plan.atomic_edges.map((edge) =>
718
722
  "from_node_id" in edge
719
723
  ? edge
720
- : { id: edge.id, from_node_id: edge.from_atom_id, to_node_id: edge.to_atom_id, requires: { kind: "source_terminal_success" as const } },
724
+ : { id: edge.id, from_node_id: legacyAtomicNodeIds.get(edge.from_atom_id) ?? edge.from_atom_id, to_node_id: legacyAtomicNodeIds.get(edge.to_atom_id) ?? edge.to_atom_id, requires: { kind: "source_terminal_success" as const } },
721
725
  );
722
726
  const legacyAtomicEdges: AtomicEdge[] = plan.edges
723
727
  .filter((edge) => canonicalAtomicNodeIds.has(edge.from_node_id) && canonicalAtomicNodeIds.has(edge.to_node_id))
@@ -949,7 +953,7 @@ export function buildView(
949
953
  selected_plan_id: plan.id,
950
954
  nodes: canonicalDisplayNodes,
951
955
  edges: canonicalDisplayEdges,
952
- atomic_edges: plan.atomic_edges,
956
+ atomic_edges: canonicalAtomicEdges,
953
957
  atomic_nodes: canonicalAtomicNodes,
954
958
  canonical_atomic_edges: canonicalAtomicEdges,
955
959
  planned_intervals: plannedIntervals(plan, ledger.config.max_running_tasks),
@@ -638,7 +638,7 @@ async function refresh(): Promise<void> {
638
638
  taskNotice.textContent = missingTask ? `任务 ${requestedTask} 不存在或已不可用。` : "";
639
639
  if (!hydrated && requestedTask && !missingTask && viewState.detail) viewState = { ...viewState, query: "", group: "", kind: "", state: "" };
640
640
  viewState = sanitizeViewState(viewState, stateValidation()); selectedTask = viewState.selected?.kind === "task" ? viewState.selected.id : null; selectedGroup = viewState.selected?.kind === "group" ? viewState.selected.id : null; selectedMilestone = viewState.selected?.kind === "milestone" ? viewState.selected.id : null; activePlan = viewState.plan ?? data.selected_plan_id;
641
- if (previousPhase === "planning" && currentPhase === "execution") phaseTransition = true; phase = currentPhase; const shouldFocusRestoredDetails = !hydrated && viewState.detail; hydrated = true; if (shouldFocusRestoredDetails) focusDetailsOnNextRender = true; syncUrl(); connection(deriveConnectionStatus(connected, result.watching)); $("load-error").hidden = true; render();
641
+ if (previousPhase === "planning" && currentPhase === "execution") phaseTransition = true; phase = currentPhase; const shouldFocusRestoredDetails = !hydrated && viewState.detail; hydrated = true; if (shouldFocusRestoredDetails) focusDetailsOnNextRender = true; syncUrl(); connection(result.watching ? "live" : "stale"); $("load-error").hidden = true; render();
642
642
  if (shouldFocusRestoredDetails && selectedTask) {
643
643
  const card = document.querySelector<HTMLElement>(`[data-task-id="${CSS.escape(selectedTask)}"]`);
644
644
  card?.scrollIntoView({ block: "center", inline: "center" });
@@ -671,7 +671,7 @@ window.addEventListener("resize", () => { refreshResponsiveDetails(); syncPlanIn
671
671
  anyHoverCapability.addEventListener("change", refreshResponsiveDetails); anyFinePointerCapability.addEventListener("change", refreshResponsiveDetails);
672
672
  const stream = new EventSource("api/events"); stream.addEventListener("open", () => { connected = true; connection("live"); void refresh(); }); stream.addEventListener("revision", () => void refresh()); stream.addEventListener("stale", () => { connected = false; connection("stale"); }); stream.addEventListener("heartbeat", (event) => { try { if (JSON.parse((event as MessageEvent).data).watching && !connected) { connected = true; void refresh(); } } catch { connection("stale"); } }); stream.addEventListener("error", () => { connected = false; connection("stale"); });
673
673
  hoverBridge = createHoverPreviewBridge($("hover-preview"), dismissHoverPreview);
674
- window.setInterval(refreshCardDurations, 60_000);
674
+ window.setInterval(refreshCardDurations, 60_000); window.setInterval(() => { if (!connected) void refresh(); }, 5_000);
675
675
  connection("connecting"); void loadTheme(); void refresh();
676
676
 
677
677
  stream.addEventListener("agent-output", event => {
@@ -1,5 +1,5 @@
1
1
  import ELK, { type ElkNode, type ElkExtendedEdge } from 'elkjs/lib/elk.bundled.js';
2
- import type { GraphProjection, GraphProjectionNode } from './graph-projection';
2
+ import type { GraphDependencyPath, GraphProjection, GraphProjectionNode } from './graph-projection';
3
3
 
4
4
  export const CARD_WIDTH = 184;
5
5
  export const CARD_HEIGHT = 76;
@@ -14,7 +14,7 @@ export function cardSize(title: string): {width:number;height:number} {
14
14
  }
15
15
  export type Direction = 'DOWN' | 'RIGHT';
16
16
  export type PlacedNode = { node: GraphProjectionNode; x: number; y: number; width: number; height: number };
17
- export type RoutedEdge = { id: string; source: string; target: string; path: string };
17
+ export type RoutedEdge = { id: string; source: string; target: string; path: string; paths: GraphDependencyPath[] };
18
18
  export type GraphLayout = { nodes: PlacedNode[]; edges: RoutedEdge[]; width: number; height: number };
19
19
  const elk = new ELK();
20
20
 
@@ -74,7 +74,7 @@ export async function layoutProjection(projection: GraphProjection, direction: D
74
74
  return points.map((p, i) => `${i ? 'L' : 'M'} ${p.x + origin.x} ${p.y + origin.y}`).join(' ');
75
75
  }).join(' ');
76
76
  if (!path) throw new Error(`No route for dependency ${e.id}`);
77
- routed.push({ id: e.id, source: edge.source, target: edge.target, path });
77
+ routed.push({ id: e.id, source: edge.source, target: edge.target, path, paths: edge.paths });
78
78
  }
79
79
  for (const child of container.children ?? []) {
80
80
  const px = x + (child.x ?? 0), py = y + (child.y ?? 0);
@@ -4783,7 +4783,7 @@
4783
4783
  "path": "skills/docs-migrate/scripts/gen_legacy_spec_id.ts",
4784
4784
  "sourceBlob": "6bcf8926418380aafe14afabd512a010faafdf40",
4785
4785
  "sourceSha256": "b70dad1c77198005f963ed9920f2a33179feebcd9ad10aa5656109fe096674dc",
4786
- "installedSha256": "c72026d4319fca4f6f27fc396d57702d162642c1b7f9a4a148aefb47ebdb272b",
4786
+ "installedSha256": "c9d4a1504c7a5094db8363eadb0cf74456956defffa2e399a8c339d88f88f123",
4787
4787
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
4788
4788
  },
4789
4789
  {
@@ -4791,7 +4791,7 @@
4791
4791
  "path": "skills/docs-migrate/scripts/specs_migrate_guard.ts",
4792
4792
  "sourceBlob": "5ce28b4bbe3d07397b7114778a77f536d0ffb0bb",
4793
4793
  "sourceSha256": "33882907d111bfc45275e363f37689113a41a5029fe03969e3d4e33b00b9f7c3",
4794
- "installedSha256": "31f0435d3d2cec6a235aa9b5bcda0db4c6760c5147418a8b648b7fce6baee90d",
4794
+ "installedSha256": "4d24cc436c53dc31da652298a91acc88eb70d1d10efa6128e3b91d797ee530cf",
4795
4795
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
4796
4796
  },
4797
4797
  {
@@ -13639,7 +13639,7 @@
13639
13639
  "path": "skills/find-next-plan/scripts/find_next_plan.ts",
13640
13640
  "sourceBlob": "68728b262d1ca7acf1d53679764f9e1ee73e8c56",
13641
13641
  "sourceSha256": "3e4cc07c6153d708b36c5adeb558a4908a986bbcd13c91ab8ed79426dcd5df1a",
13642
- "installedSha256": "158191fed490ba633eb5e6d0b1401f3c76fc715846c0da911063541b89a5cee0",
13642
+ "installedSha256": "d04443d9d3149edb89df0a5fc4f403d1afcd64e6725c01c921aa439d54daa09b",
13643
13643
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
13644
13644
  },
13645
13645
  {
@@ -13823,7 +13823,7 @@
13823
13823
  "path": "skills/hardware-doc-ingest/scripts/ingest_mineru_extract.ts",
13824
13824
  "sourceBlob": "1074e6c64e0d03efe7fbc7155efc16fcc5351df5",
13825
13825
  "sourceSha256": "d648b7cb63b5c483713bdc1d7431c25ee2d8f8e182f3a2594c8407d4826bf003",
13826
- "installedSha256": "348f5eccb4c26b2cab90c72d5b1142e47c06594f66037b26e8953423f81de222",
13826
+ "installedSha256": "adec761af4c672eb765213d6240d7c5a0362a4c3ca6d7e4ad674873ef091309e",
13827
13827
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
13828
13828
  },
13829
13829
  {
@@ -13831,7 +13831,7 @@
13831
13831
  "path": "skills/hardware-doc-ingest/scripts/verify_doc_locks.ts",
13832
13832
  "sourceBlob": "95ed496227be9431235072e649148b51e0befbf7",
13833
13833
  "sourceSha256": "8b4cf4fac788e5e881584e44bfe6ff1398698788bc93dc72ea7bc0c696c253ff",
13834
- "installedSha256": "55ee706f272fc49b0d625354442355321f3610293dcfe8fab699b7484565aa1f",
13834
+ "installedSha256": "51d59ff3de744de6fe645e3c55d88cf4588df0b7f35d4b106521acb368854edb",
13835
13835
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
13836
13836
  },
13837
13837
  {
@@ -14447,7 +14447,7 @@
14447
14447
  "path": "skills/multi-task-flow/lib/view.ts",
14448
14448
  "sourceBlob": "b00e4b31ea1ae1dce408e0c2f45cd103bf958299",
14449
14449
  "sourceSha256": "0a2018fac0ed8b824e1d8c5c709d0ed6e7a851035950e8ed74aa5e846f6be80f",
14450
- "installedSha256": "be52009ff2efc06399df0363d2797df327191be3f4b1b8c61b71c253c72d4d73",
14450
+ "installedSha256": "0d53bfde1b57b74b70e683f9d6e601cf57f51cc94e6a65771ef01b241fd9f16f",
14451
14451
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
14452
14452
  },
14453
14453
  {
@@ -14951,7 +14951,7 @@
14951
14951
  "path": "skills/multi-task-flow/web/app.ts",
14952
14952
  "sourceBlob": "ad0cd71bd39e30cda7091c443db26e7b00452d56",
14953
14953
  "sourceSha256": "7de5958eda17175d1e68f79f07093bdd6f545228eb9fadd4b7e21c43a9a25940",
14954
- "installedSha256": "a3bb5a07419ce78c096b5e55c4b4d28aef2c731b5abc41146fc8a033e993834a",
14954
+ "installedSha256": "2cca4ae9a88b0045ec11094178cfcb5900fb2e0f106c8ddf3ea1c87edc54f088",
14955
14955
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
14956
14956
  },
14957
14957
  {
@@ -15383,7 +15383,7 @@
15383
15383
  "path": "skills/spec-sync/SKILL.md",
15384
15384
  "sourceBlob": "1c058da70a873a7d1425f19337d38c22787ce307",
15385
15385
  "sourceSha256": "074704e78693e5750d5b99b4bbe6ff8e67d93be5ab4c8cb8f3da76efe25ca449",
15386
- "installedSha256": "101142f40a1e7945f9d8422a60be4e159390ec52d958710c8eb823f43adcabfd",
15386
+ "installedSha256": "61903ef699acec12246e5c728652e69e075672fd25f34f06b076cadcb568f34d",
15387
15387
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
15388
15388
  },
15389
15389
  {
@@ -15407,7 +15407,7 @@
15407
15407
  "path": "skills/spec-sync/scripts/spec_drift_check.ts",
15408
15408
  "sourceBlob": "780164ae33fcdd77be2083556e65f255ef74dc1b",
15409
15409
  "sourceSha256": "52a22b230acb70c7a860815761ab25d073b8d3503318cbe96237ce799e2c318e",
15410
- "installedSha256": "132e6d35869e25f4f7c1acba2e716483e433b1ac597b7c1e52dd36271e58cb97",
15410
+ "installedSha256": "d6f381d2f5834350af28e097bc02d608d445a1ea55f384f3ea2037c0f6f115b8",
15411
15411
  "adaptation": "loomhelm-runtime-path-or-contract-adaptation"
15412
15412
  },
15413
15413
  {
@@ -15814,7 +15814,7 @@
15814
15814
  },
15815
15815
  {
15816
15816
  "path": "skills/multi-task-flow/web/graph-layout.ts",
15817
- "installedSha256": "8531cdaf5f22eb64836ae89274daf62c5f1cab5bdcd85306aab41b20811fb2a6"
15817
+ "installedSha256": "9ad5f77628c365b9c8a7f6332287fd6d2a37eef48cb3f46b808dcaad5e6c9c3b"
15818
15818
  },
15819
15819
  {
15820
15820
  "path": "skills/multi-task-flow/web/graph-view.tsx",
@@ -15899,7 +15899,7 @@
15899
15899
  },
15900
15900
  {
15901
15901
  "path": "skills/support-manifest.json",
15902
- "installedSha256": "bab89370c2877d854cbff187eb3c96e67f103d182c0cb1e69289c7d4b50203d8"
15902
+ "installedSha256": "be3e17b0311084e508b199210aa4b5b93eda803ecc684fe4c7cef9098ee6b6e8"
15903
15903
  },
15904
15904
  {
15905
15905
  "path": "skills/docs/vendor/dot-codex/specs/multi-task-flow/assets/output-tooltip-boundary.png",
@@ -15980,6 +15980,310 @@
15980
15980
  {
15981
15981
  "path": "skills/multi-task-flow/tests/task-kind.test.ts",
15982
15982
  "installedSha256": "9ec45fe7dd7209cec6cac9b392071c052f9d3f97533bcaf380fc1bfc2c5c8df3"
15983
+ },
15984
+ {
15985
+ "path": "skills/docs-migrate/scripts/_runtime/compatibility_docs.ts",
15986
+ "installedSha256": "9667a37ae7704fce28b7d967ac671f2d02d39309acad2d906b28849b91fa6420"
15987
+ },
15988
+ {
15989
+ "path": "skills/docs-migrate/scripts/_runtime/compatibility_shared.ts",
15990
+ "installedSha256": "dac757da193b15f7b8c5c31cae0f44acc5eb370336bcbd31dce3c26b710e39e3"
15991
+ },
15992
+ {
15993
+ "path": "skills/docs-migrate/scripts/_runtime/compatibility_cli.ts",
15994
+ "installedSha256": "01ec1aebde5a63a5e0c8d125583bc3ab7e2efa81e36fb6690822dd8f31c244f0"
15995
+ },
15996
+ {
15997
+ "path": "skills/docs-migrate/scripts/_runtime/modules/checks/replay.ts",
15998
+ "installedSha256": "22905c9504bf3a304618f582ea15ecfae5e9c6e51599d2839d32965e21fadef8"
15999
+ },
16000
+ {
16001
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_helpers.ts",
16002
+ "installedSha256": "039f0928fe42365ef380091ca8f5a8c72d5127c23f6870072ad4f2fce7d0b3de"
16003
+ },
16004
+ {
16005
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/hardware_ingest.ts",
16006
+ "installedSha256": "b84b43ae3c33a8d5e056a92b550769a9347b5c1af631a9ac56c3369e53c671c7"
16007
+ },
16008
+ {
16009
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/next_plan.ts",
16010
+ "installedSha256": "e14addce4a45a25bbea58fad9aa5e41c513735130b4df5ba9f37a66176b72337"
16011
+ },
16012
+ {
16013
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_contract.ts",
16014
+ "installedSha256": "1e3cf99cb7bfa63baf8dae3f3d8d37fbf8eee846e8262af61dfbfcdfe1c7c075"
16015
+ },
16016
+ {
16017
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift.ts",
16018
+ "installedSha256": "74e348ed8e97a77cb3d7e4d3fe4bfffec0f4b29aa49086767c0f3f50a4d29b81"
16019
+ },
16020
+ {
16021
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/next_plan_support.ts",
16022
+ "installedSha256": "da64c49f508a31b720d80c84eb1fadf7b7cd51a59e6b25a2d1f9cd222b535f4f"
16023
+ },
16024
+ {
16025
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_types.ts",
16026
+ "installedSha256": "d1bd27dd615b78b882a662a5f2366ddaca710ff803e68dd368a1791aaea47189"
16027
+ },
16028
+ {
16029
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_legacy.ts",
16030
+ "installedSha256": "2dc7e8319afdd2ad50a05d0b8af45f6dfdcee08990bcff06be11098113366e6d"
16031
+ },
16032
+ {
16033
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_migration.ts",
16034
+ "installedSha256": "06094de16ee7fefbd34b2022be16649a98af52347a1dd750f8fbfd27a6ceb4d5"
16035
+ },
16036
+ {
16037
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/migration_common.ts",
16038
+ "installedSha256": "db4a608795b98718fc2ca0cc9e326f071cf80c842fee88137227cf2c6a623f21"
16039
+ },
16040
+ {
16041
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_validation.ts",
16042
+ "installedSha256": "32eaaa686239c47f16f87ae677c8c806cfb43d4763bb5b3f7d48b0e8573823e2"
16043
+ },
16044
+ {
16045
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/legacy_spec_id.ts",
16046
+ "installedSha256": "04b130ea1d696f8c4f0e77efc7587615a9fcf37ebda86a797035f250b8fde8c2"
16047
+ },
16048
+ {
16049
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/hardware_locks.ts",
16050
+ "installedSha256": "5b9e4211b5c5537a88dc6f06482f6d689e043c642bb676a8c640f3814f164d16"
16051
+ },
16052
+ {
16053
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/git.ts",
16054
+ "installedSha256": "c9800c610e230f0ab274885e0ee927680d9c2062ec203c556117f06c8e74d0d3"
16055
+ },
16056
+ {
16057
+ "path": "skills/docs-migrate/scripts/_runtime/modules/docs/spec_drift_paths.ts",
16058
+ "installedSha256": "58df37350488de3e85906d22bc461a00de17293f57d73cfc126012df25d0d187"
16059
+ },
16060
+ {
16061
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/compatibility_docs.ts",
16062
+ "installedSha256": "9667a37ae7704fce28b7d967ac671f2d02d39309acad2d906b28849b91fa6420"
16063
+ },
16064
+ {
16065
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/compatibility_shared.ts",
16066
+ "installedSha256": "dac757da193b15f7b8c5c31cae0f44acc5eb370336bcbd31dce3c26b710e39e3"
16067
+ },
16068
+ {
16069
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/compatibility_cli.ts",
16070
+ "installedSha256": "01ec1aebde5a63a5e0c8d125583bc3ab7e2efa81e36fb6690822dd8f31c244f0"
16071
+ },
16072
+ {
16073
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/checks/replay.ts",
16074
+ "installedSha256": "22905c9504bf3a304618f582ea15ecfae5e9c6e51599d2839d32965e21fadef8"
16075
+ },
16076
+ {
16077
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_helpers.ts",
16078
+ "installedSha256": "039f0928fe42365ef380091ca8f5a8c72d5127c23f6870072ad4f2fce7d0b3de"
16079
+ },
16080
+ {
16081
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/hardware_ingest.ts",
16082
+ "installedSha256": "b84b43ae3c33a8d5e056a92b550769a9347b5c1af631a9ac56c3369e53c671c7"
16083
+ },
16084
+ {
16085
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/next_plan.ts",
16086
+ "installedSha256": "e14addce4a45a25bbea58fad9aa5e41c513735130b4df5ba9f37a66176b72337"
16087
+ },
16088
+ {
16089
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_contract.ts",
16090
+ "installedSha256": "1e3cf99cb7bfa63baf8dae3f3d8d37fbf8eee846e8262af61dfbfcdfe1c7c075"
16091
+ },
16092
+ {
16093
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift.ts",
16094
+ "installedSha256": "74e348ed8e97a77cb3d7e4d3fe4bfffec0f4b29aa49086767c0f3f50a4d29b81"
16095
+ },
16096
+ {
16097
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/next_plan_support.ts",
16098
+ "installedSha256": "da64c49f508a31b720d80c84eb1fadf7b7cd51a59e6b25a2d1f9cd222b535f4f"
16099
+ },
16100
+ {
16101
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_types.ts",
16102
+ "installedSha256": "d1bd27dd615b78b882a662a5f2366ddaca710ff803e68dd368a1791aaea47189"
16103
+ },
16104
+ {
16105
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_legacy.ts",
16106
+ "installedSha256": "2dc7e8319afdd2ad50a05d0b8af45f6dfdcee08990bcff06be11098113366e6d"
16107
+ },
16108
+ {
16109
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_migration.ts",
16110
+ "installedSha256": "06094de16ee7fefbd34b2022be16649a98af52347a1dd750f8fbfd27a6ceb4d5"
16111
+ },
16112
+ {
16113
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/migration_common.ts",
16114
+ "installedSha256": "db4a608795b98718fc2ca0cc9e326f071cf80c842fee88137227cf2c6a623f21"
16115
+ },
16116
+ {
16117
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_validation.ts",
16118
+ "installedSha256": "32eaaa686239c47f16f87ae677c8c806cfb43d4763bb5b3f7d48b0e8573823e2"
16119
+ },
16120
+ {
16121
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/legacy_spec_id.ts",
16122
+ "installedSha256": "04b130ea1d696f8c4f0e77efc7587615a9fcf37ebda86a797035f250b8fde8c2"
16123
+ },
16124
+ {
16125
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/hardware_locks.ts",
16126
+ "installedSha256": "5b9e4211b5c5537a88dc6f06482f6d689e043c642bb676a8c640f3814f164d16"
16127
+ },
16128
+ {
16129
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/git.ts",
16130
+ "installedSha256": "c9800c610e230f0ab274885e0ee927680d9c2062ec203c556117f06c8e74d0d3"
16131
+ },
16132
+ {
16133
+ "path": "skills/hardware-doc-ingest/scripts/_runtime/modules/docs/spec_drift_paths.ts",
16134
+ "installedSha256": "58df37350488de3e85906d22bc461a00de17293f57d73cfc126012df25d0d187"
16135
+ },
16136
+ {
16137
+ "path": "skills/spec-sync/scripts/_runtime/compatibility_docs.ts",
16138
+ "installedSha256": "9667a37ae7704fce28b7d967ac671f2d02d39309acad2d906b28849b91fa6420"
16139
+ },
16140
+ {
16141
+ "path": "skills/spec-sync/scripts/_runtime/compatibility_shared.ts",
16142
+ "installedSha256": "dac757da193b15f7b8c5c31cae0f44acc5eb370336bcbd31dce3c26b710e39e3"
16143
+ },
16144
+ {
16145
+ "path": "skills/spec-sync/scripts/_runtime/compatibility_cli.ts",
16146
+ "installedSha256": "01ec1aebde5a63a5e0c8d125583bc3ab7e2efa81e36fb6690822dd8f31c244f0"
16147
+ },
16148
+ {
16149
+ "path": "skills/spec-sync/scripts/_runtime/modules/checks/replay.ts",
16150
+ "installedSha256": "22905c9504bf3a304618f582ea15ecfae5e9c6e51599d2839d32965e21fadef8"
16151
+ },
16152
+ {
16153
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_helpers.ts",
16154
+ "installedSha256": "039f0928fe42365ef380091ca8f5a8c72d5127c23f6870072ad4f2fce7d0b3de"
16155
+ },
16156
+ {
16157
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/hardware_ingest.ts",
16158
+ "installedSha256": "b84b43ae3c33a8d5e056a92b550769a9347b5c1af631a9ac56c3369e53c671c7"
16159
+ },
16160
+ {
16161
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/next_plan.ts",
16162
+ "installedSha256": "e14addce4a45a25bbea58fad9aa5e41c513735130b4df5ba9f37a66176b72337"
16163
+ },
16164
+ {
16165
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_contract.ts",
16166
+ "installedSha256": "1e3cf99cb7bfa63baf8dae3f3d8d37fbf8eee846e8262af61dfbfcdfe1c7c075"
16167
+ },
16168
+ {
16169
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_drift.ts",
16170
+ "installedSha256": "74e348ed8e97a77cb3d7e4d3fe4bfffec0f4b29aa49086767c0f3f50a4d29b81"
16171
+ },
16172
+ {
16173
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/next_plan_support.ts",
16174
+ "installedSha256": "da64c49f508a31b720d80c84eb1fadf7b7cd51a59e6b25a2d1f9cd222b535f4f"
16175
+ },
16176
+ {
16177
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_types.ts",
16178
+ "installedSha256": "d1bd27dd615b78b882a662a5f2366ddaca710ff803e68dd368a1791aaea47189"
16179
+ },
16180
+ {
16181
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_legacy.ts",
16182
+ "installedSha256": "2dc7e8319afdd2ad50a05d0b8af45f6dfdcee08990bcff06be11098113366e6d"
16183
+ },
16184
+ {
16185
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_migration.ts",
16186
+ "installedSha256": "06094de16ee7fefbd34b2022be16649a98af52347a1dd750f8fbfd27a6ceb4d5"
16187
+ },
16188
+ {
16189
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/migration_common.ts",
16190
+ "installedSha256": "db4a608795b98718fc2ca0cc9e326f071cf80c842fee88137227cf2c6a623f21"
16191
+ },
16192
+ {
16193
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_validation.ts",
16194
+ "installedSha256": "32eaaa686239c47f16f87ae677c8c806cfb43d4763bb5b3f7d48b0e8573823e2"
16195
+ },
16196
+ {
16197
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/legacy_spec_id.ts",
16198
+ "installedSha256": "04b130ea1d696f8c4f0e77efc7587615a9fcf37ebda86a797035f250b8fde8c2"
16199
+ },
16200
+ {
16201
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/hardware_locks.ts",
16202
+ "installedSha256": "5b9e4211b5c5537a88dc6f06482f6d689e043c642bb676a8c640f3814f164d16"
16203
+ },
16204
+ {
16205
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/git.ts",
16206
+ "installedSha256": "c9800c610e230f0ab274885e0ee927680d9c2062ec203c556117f06c8e74d0d3"
16207
+ },
16208
+ {
16209
+ "path": "skills/spec-sync/scripts/_runtime/modules/docs/spec_drift_paths.ts",
16210
+ "installedSha256": "58df37350488de3e85906d22bc461a00de17293f57d73cfc126012df25d0d187"
16211
+ },
16212
+ {
16213
+ "path": "skills/find-next-plan/scripts/_runtime/compatibility_docs.ts",
16214
+ "installedSha256": "9667a37ae7704fce28b7d967ac671f2d02d39309acad2d906b28849b91fa6420"
16215
+ },
16216
+ {
16217
+ "path": "skills/find-next-plan/scripts/_runtime/compatibility_shared.ts",
16218
+ "installedSha256": "dac757da193b15f7b8c5c31cae0f44acc5eb370336bcbd31dce3c26b710e39e3"
16219
+ },
16220
+ {
16221
+ "path": "skills/find-next-plan/scripts/_runtime/compatibility_cli.ts",
16222
+ "installedSha256": "01ec1aebde5a63a5e0c8d125583bc3ab7e2efa81e36fb6690822dd8f31c244f0"
16223
+ },
16224
+ {
16225
+ "path": "skills/find-next-plan/scripts/_runtime/modules/checks/replay.ts",
16226
+ "installedSha256": "22905c9504bf3a304618f582ea15ecfae5e9c6e51599d2839d32965e21fadef8"
16227
+ },
16228
+ {
16229
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_helpers.ts",
16230
+ "installedSha256": "039f0928fe42365ef380091ca8f5a8c72d5127c23f6870072ad4f2fce7d0b3de"
16231
+ },
16232
+ {
16233
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/hardware_ingest.ts",
16234
+ "installedSha256": "b84b43ae3c33a8d5e056a92b550769a9347b5c1af631a9ac56c3369e53c671c7"
16235
+ },
16236
+ {
16237
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/next_plan.ts",
16238
+ "installedSha256": "e14addce4a45a25bbea58fad9aa5e41c513735130b4df5ba9f37a66176b72337"
16239
+ },
16240
+ {
16241
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_contract.ts",
16242
+ "installedSha256": "1e3cf99cb7bfa63baf8dae3f3d8d37fbf8eee846e8262af61dfbfcdfe1c7c075"
16243
+ },
16244
+ {
16245
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift.ts",
16246
+ "installedSha256": "74e348ed8e97a77cb3d7e4d3fe4bfffec0f4b29aa49086767c0f3f50a4d29b81"
16247
+ },
16248
+ {
16249
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/next_plan_support.ts",
16250
+ "installedSha256": "da64c49f508a31b720d80c84eb1fadf7b7cd51a59e6b25a2d1f9cd222b535f4f"
16251
+ },
16252
+ {
16253
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_types.ts",
16254
+ "installedSha256": "d1bd27dd615b78b882a662a5f2366ddaca710ff803e68dd368a1791aaea47189"
16255
+ },
16256
+ {
16257
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_legacy.ts",
16258
+ "installedSha256": "2dc7e8319afdd2ad50a05d0b8af45f6dfdcee08990bcff06be11098113366e6d"
16259
+ },
16260
+ {
16261
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_migration.ts",
16262
+ "installedSha256": "06094de16ee7fefbd34b2022be16649a98af52347a1dd750f8fbfd27a6ceb4d5"
16263
+ },
16264
+ {
16265
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/migration_common.ts",
16266
+ "installedSha256": "db4a608795b98718fc2ca0cc9e326f071cf80c842fee88137227cf2c6a623f21"
16267
+ },
16268
+ {
16269
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_validation.ts",
16270
+ "installedSha256": "32eaaa686239c47f16f87ae677c8c806cfb43d4763bb5b3f7d48b0e8573823e2"
16271
+ },
16272
+ {
16273
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/legacy_spec_id.ts",
16274
+ "installedSha256": "04b130ea1d696f8c4f0e77efc7587615a9fcf37ebda86a797035f250b8fde8c2"
16275
+ },
16276
+ {
16277
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/hardware_locks.ts",
16278
+ "installedSha256": "5b9e4211b5c5537a88dc6f06482f6d689e043c642bb676a8c640f3814f164d16"
16279
+ },
16280
+ {
16281
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/git.ts",
16282
+ "installedSha256": "c9800c610e230f0ab274885e0ee927680d9c2062ec203c556117f06c8e74d0d3"
16283
+ },
16284
+ {
16285
+ "path": "skills/find-next-plan/scripts/_runtime/modules/docs/spec_drift_paths.ts",
16286
+ "installedSha256": "58df37350488de3e85906d22bc461a00de17293f57d73cfc126012df25d0d187"
15983
16287
  }
15984
16288
  ],
15985
16289
  "exclusions": [
@@ -35,7 +35,7 @@ Keep topic-level specs in `docs/specs/` aligned with behavior, contracts, and ac
35
35
  - `Spec同步证据=<spec_paths@sha_csv|未检查>`
36
36
  - `结束原因=<one-line>`
37
37
  - When a canonical `SPEC.md` contains `## Related ADRs`, the detector validates that the section is either exactly `None` or path-sorted, duplicate-free Markdown links to existing `docs/adr/<NNNN>-<slug>.md` files. A missing ADR status is compatible with `accepted`; explicit `superseded` or `deprecated`, another non-accepted status, or an invalid target blocks sync. Specs without the section remain readable compatibility inputs.
38
- - When a canonical `SPEC.md` is new or modified, run `bun --no-install skills/bin/spec_contract_check.ts --path <SPEC.md>` in addition to the drift detector. Untouched legacy and external Specs remain readable compatibility inputs.
38
+ - When a canonical `SPEC.md` is new or modified, run `bun --no-install skills/spec-sync/scripts/spec_contract_check.ts --path <SPEC.md>` in addition to the drift detector. Untouched legacy and external Specs remain readable compatibility inputs.
39
39
 
40
40
  ## Workflow
41
41
 
@@ -0,0 +1,12 @@
1
+ import { basename } from "node:path";
2
+ import { docs } from "./compatibility_docs";
3
+
4
+ export async function runCompatibilityCli(name: string, argv: string[] = process.argv.slice(2)): Promise<number> {
5
+ const smoke = argv.includes("--compatibility-smoke");
6
+ const help = argv.includes("--help") || argv.includes("-h");
7
+ if (help && !smoke) { console.log(`Usage: bun ${name}.ts [options]`); return 0; }
8
+ const result = docs(basename(name).replace(/\.ts$/, ""), argv.filter(value => value !== "--compatibility-smoke"));
9
+ if (smoke && (result === 0 || help)) console.log(`SMOKE dispatched=${basename(name).replace(/\.ts$/, "")}`);
10
+ if (help) { if (result === 0) return 0; console.log(`Usage: bun ${name}.ts [options]`); return 0; }
11
+ return result;
12
+ }
@@ -0,0 +1,115 @@
1
+ import { verifyDocLocks } from "./modules/docs/hardware_locks";
2
+ import { ingestExtract } from "./modules/docs/hardware_ingest";
3
+ import { findNextPlan } from "./modules/docs/next_plan";
4
+ import { generateLegacySpecIds } from "./modules/docs/legacy_spec_id";
5
+ import { parseSpecDriftArgs, runSpecDrift } from "./modules/docs/spec_drift";
6
+ import {
7
+ planSpecsHygiene,
8
+ planSpecsMigration,
9
+ } from "./modules/docs/spec_migration";
10
+ import { json, option, rootFor } from "./compatibility_shared";
11
+
12
+ export function docs(name: string, argv: string[]): number {
13
+ if (name === "verify_doc_locks") {
14
+ const result = verifyDocLocks(rootFor(argv), {
15
+ strictPdf: argv.includes("--strict-pdf"),
16
+ checkPerms: !argv.includes("--no-check-perms"),
17
+ });
18
+ result.lines.forEach((line) => console.log(line));
19
+ return result.exitCode;
20
+ }
21
+ if (name === "find_next_plan") {
22
+ json(findNextPlan(option(argv, "repo", process.cwd())!));
23
+ return 0;
24
+ }
25
+ if (name === "gen_legacy_spec_id") return legacyId(argv);
26
+ if (name === "specs_migrate_guard") return migrateGuard(argv);
27
+ if (name === "spec_drift_check") return drift(argv);
28
+ if (name === "ingest_mineru_extract") return ingest(argv);
29
+ return 2;
30
+ }
31
+
32
+ function legacyId(argv: string[]): number {
33
+ const args: Parameters<typeof generateLegacySpecIds>[0] = {
34
+ repoRoot: option(argv, "repo", process.cwd())!,
35
+ legacyCompat: argv.includes("--legacy-compat"),
36
+ count: Number(option(argv, "count", "1")),
37
+ length: Number(option(argv, "length", "5")),
38
+ };
39
+ const alphabet = option(argv, "alphabet");
40
+ if (alphabet !== undefined) args.alphabet = alphabet;
41
+ const result = generateLegacySpecIds(args);
42
+ process.stdout.write(result.stdout);
43
+ process.stderr.write(result.stderr);
44
+ return result.exitCode;
45
+ }
46
+
47
+ function migrateGuard(argv: string[]): number {
48
+ const repo = option(argv, "repo", process.cwd())!;
49
+ const source = option(argv, "source")!;
50
+ const branch = option(argv, "branch");
51
+ const legacyId = option(argv, "legacy-id");
52
+ const topic = option(argv, "topic");
53
+ const options = {
54
+ ...(branch === undefined ? {} : { branch }),
55
+ ...(legacyId === undefined ? {} : { legacyId }),
56
+ ...(topic === undefined ? {} : { topic }),
57
+ };
58
+ const result =
59
+ option(argv, "mode") === "specs-hygiene"
60
+ ? planSpecsHygiene(repo, source, {
61
+ ...options,
62
+ renameConfirmed: argv.includes("--rename-confirmed"),
63
+ })
64
+ : planSpecsMigration(repo, source, options);
65
+ json(result);
66
+ return result.blocked_reason ? 1 : 0;
67
+ }
68
+
69
+ function drift(argv: string[]): number {
70
+ const parsed = parseSpecDriftArgs(argv);
71
+ if (parsed.error) {
72
+ console.error(parsed.error);
73
+ return 2;
74
+ }
75
+ if (parsed.help) {
76
+ console.log(
77
+ "Usage: spec_drift_check.ts [--base-ref <ref>] [--spec-path <path>]...",
78
+ );
79
+ return 0;
80
+ }
81
+ const result = runSpecDrift(parsed.options);
82
+ json(result);
83
+ return result.exitCode;
84
+ }
85
+
86
+ function ingest(argv: string[]): number {
87
+ try {
88
+ const args: Parameters<typeof ingestExtract>[0] = {
89
+ extractPath: option(argv, "extract-path")!,
90
+ destDir: option(argv, "dest-dir")!,
91
+ slug: option(argv, "slug")!,
92
+ overwrite: argv.includes("--overwrite"),
93
+ addHeader: argv.includes("--add-header"),
94
+ keepMineruJson: argv.includes("--keep-mineru-json"),
95
+ writeLock: !argv.includes("--no-write-lock"),
96
+ lockGenerated: !argv.includes("--writable-generated"),
97
+ createReadme: !argv.includes("--no-readme"),
98
+ };
99
+ for (const [key, flag] of [
100
+ ["docSubdir", "doc-subdir"],
101
+ ["sourceUrl", "source-url"],
102
+ ["docType", "doc-type"],
103
+ ["vendor", "vendor"],
104
+ ["part", "part"],
105
+ ] as const) {
106
+ const value = option(argv, flag);
107
+ if (value !== undefined) args[key] = value;
108
+ }
109
+ ingestExtract(args).lines.forEach((line) => console.log(line));
110
+ return 0;
111
+ } catch (error) {
112
+ console.error(error instanceof Error ? error.message : String(error));
113
+ return 1;
114
+ }
115
+ }