@paths.design/caws-cli 11.1.6 → 11.1.8

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 (190) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +55 -58
  3. package/dist/init/hook-packs/manifest-claude-code.d.ts +1 -1
  4. package/dist/init/hook-packs/manifest-claude-code.d.ts.map +1 -1
  5. package/dist/init/hook-packs/manifest-claude-code.js +317 -6
  6. package/dist/init/hook-packs/manifest-claude-code.js.map +1 -1
  7. package/dist/init/hook-packs/types.js +1 -1
  8. package/dist/init/hook-packs/types.js.map +1 -1
  9. package/dist/shell/binding/resolve-binding.d.ts.map +1 -1
  10. package/dist/shell/binding/resolve-binding.js +105 -1
  11. package/dist/shell/binding/resolve-binding.js.map +1 -1
  12. package/dist/shell/binding/types.d.ts +47 -3
  13. package/dist/shell/binding/types.d.ts.map +1 -1
  14. package/dist/shell/command-metadata.d.ts +93 -0
  15. package/dist/shell/command-metadata.d.ts.map +1 -0
  16. package/dist/shell/command-metadata.js +687 -0
  17. package/dist/shell/command-metadata.js.map +1 -0
  18. package/dist/shell/commands/agents.d.ts +48 -0
  19. package/dist/shell/commands/agents.d.ts.map +1 -0
  20. package/dist/shell/commands/agents.js +577 -0
  21. package/dist/shell/commands/agents.js.map +1 -0
  22. package/dist/shell/commands/claim.d.ts +16 -0
  23. package/dist/shell/commands/claim.d.ts.map +1 -1
  24. package/dist/shell/commands/claim.js +88 -30
  25. package/dist/shell/commands/claim.js.map +1 -1
  26. package/dist/shell/commands/events.d.ts +106 -0
  27. package/dist/shell/commands/events.d.ts.map +1 -0
  28. package/dist/shell/commands/events.js +510 -0
  29. package/dist/shell/commands/events.js.map +1 -0
  30. package/dist/shell/commands/gates.d.ts +2 -2
  31. package/dist/shell/commands/gates.d.ts.map +1 -1
  32. package/dist/shell/commands/gates.js +106 -25
  33. package/dist/shell/commands/gates.js.map +1 -1
  34. package/dist/shell/commands/init.d.ts.map +1 -1
  35. package/dist/shell/commands/init.js +26 -0
  36. package/dist/shell/commands/init.js.map +1 -1
  37. package/dist/shell/commands/prepush.d.ts +26 -0
  38. package/dist/shell/commands/prepush.d.ts.map +1 -0
  39. package/dist/shell/commands/prepush.js +373 -0
  40. package/dist/shell/commands/prepush.js.map +1 -0
  41. package/dist/shell/commands/scope.d.ts.map +1 -1
  42. package/dist/shell/commands/scope.js +31 -1
  43. package/dist/shell/commands/scope.js.map +1 -1
  44. package/dist/shell/commands/specs.d.ts +44 -3
  45. package/dist/shell/commands/specs.d.ts.map +1 -1
  46. package/dist/shell/commands/specs.js +411 -15
  47. package/dist/shell/commands/specs.js.map +1 -1
  48. package/dist/shell/commands/status.d.ts +12 -0
  49. package/dist/shell/commands/status.d.ts.map +1 -1
  50. package/dist/shell/commands/status.js +236 -21
  51. package/dist/shell/commands/status.js.map +1 -1
  52. package/dist/shell/commands/worktree.d.ts +9 -0
  53. package/dist/shell/commands/worktree.d.ts.map +1 -1
  54. package/dist/shell/commands/worktree.js +353 -1
  55. package/dist/shell/commands/worktree.js.map +1 -1
  56. package/dist/shell/gates/disposition.d.ts.map +1 -1
  57. package/dist/shell/gates/disposition.js +43 -2
  58. package/dist/shell/gates/disposition.js.map +1 -1
  59. package/dist/shell/index.d.ts +14 -6
  60. package/dist/shell/index.d.ts.map +1 -1
  61. package/dist/shell/index.js +32 -1
  62. package/dist/shell/index.js.map +1 -1
  63. package/dist/shell/legacy-command-map.js +832 -0
  64. package/dist/shell/push-range/classify-range.d.ts +99 -0
  65. package/dist/shell/push-range/classify-range.d.ts.map +1 -0
  66. package/dist/shell/push-range/classify-range.js +155 -0
  67. package/dist/shell/push-range/classify-range.js.map +1 -0
  68. package/dist/shell/push-range/scope-match.d.ts +13 -0
  69. package/dist/shell/push-range/scope-match.d.ts.map +1 -0
  70. package/dist/shell/push-range/scope-match.js +53 -0
  71. package/dist/shell/push-range/scope-match.js.map +1 -0
  72. package/dist/shell/register.d.ts.map +1 -1
  73. package/dist/shell/register.js +350 -165
  74. package/dist/shell/register.js.map +1 -1
  75. package/dist/shell/registered-command-groups.js +48 -0
  76. package/dist/shell/render/status.d.ts +7 -1
  77. package/dist/shell/render/status.d.ts.map +1 -1
  78. package/dist/shell/render/status.js +72 -0
  79. package/dist/shell/render/status.js.map +1 -1
  80. package/dist/shell/rules.d.ts +19 -0
  81. package/dist/shell/rules.d.ts.map +1 -1
  82. package/dist/shell/rules.js +27 -0
  83. package/dist/shell/rules.js.map +1 -1
  84. package/dist/shell/session/resolve-session.d.ts +29 -1
  85. package/dist/shell/session/resolve-session.d.ts.map +1 -1
  86. package/dist/shell/session/resolve-session.js +817 -11
  87. package/dist/shell/session/resolve-session.js.map +1 -1
  88. package/dist/shell/session/types.d.ts +127 -1
  89. package/dist/shell/session/types.d.ts.map +1 -1
  90. package/dist/shell/session/types.js +10 -4
  91. package/dist/shell/session/types.js.map +1 -1
  92. package/dist/store/agents-store.d.ts.map +1 -1
  93. package/dist/store/agents-store.js +9 -0
  94. package/dist/store/agents-store.js.map +1 -1
  95. package/dist/store/apply-patch.d.ts.map +1 -1
  96. package/dist/store/apply-patch.js +15 -0
  97. package/dist/store/apply-patch.js.map +1 -1
  98. package/dist/store/doctor-snapshot.d.ts.map +1 -1
  99. package/dist/store/doctor-snapshot.js +169 -3
  100. package/dist/store/doctor-snapshot.js.map +1 -1
  101. package/dist/store/events-migration.d.ts +207 -0
  102. package/dist/store/events-migration.d.ts.map +1 -0
  103. package/dist/store/events-migration.js +358 -0
  104. package/dist/store/events-migration.js.map +1 -0
  105. package/dist/store/events-store.d.ts +47 -1
  106. package/dist/store/events-store.d.ts.map +1 -1
  107. package/dist/store/events-store.js +278 -0
  108. package/dist/store/events-store.js.map +1 -1
  109. package/dist/store/git-autocommit.d.ts +46 -0
  110. package/dist/store/git-autocommit.d.ts.map +1 -0
  111. package/dist/store/git-autocommit.js +198 -0
  112. package/dist/store/git-autocommit.js.map +1 -0
  113. package/dist/store/git-sparse-checkout.d.ts +25 -0
  114. package/dist/store/git-sparse-checkout.d.ts.map +1 -0
  115. package/dist/store/git-sparse-checkout.js +101 -0
  116. package/dist/store/git-sparse-checkout.js.map +1 -0
  117. package/dist/store/index.d.ts +6 -1
  118. package/dist/store/index.d.ts.map +1 -1
  119. package/dist/store/index.js +16 -1
  120. package/dist/store/index.js.map +1 -1
  121. package/dist/store/leases-store.d.ts +89 -0
  122. package/dist/store/leases-store.d.ts.map +1 -0
  123. package/dist/store/leases-store.js +427 -0
  124. package/dist/store/leases-store.js.map +1 -0
  125. package/dist/store/lifecycle-transaction.d.ts.map +1 -1
  126. package/dist/store/lifecycle-transaction.js +34 -1
  127. package/dist/store/lifecycle-transaction.js.map +1 -1
  128. package/dist/store/rules.d.ts +74 -1
  129. package/dist/store/rules.d.ts.map +1 -1
  130. package/dist/store/rules.js +76 -0
  131. package/dist/store/rules.js.map +1 -1
  132. package/dist/store/specs-migration.d.ts +128 -0
  133. package/dist/store/specs-migration.d.ts.map +1 -0
  134. package/dist/store/specs-migration.js +481 -0
  135. package/dist/store/specs-migration.js.map +1 -0
  136. package/dist/store/specs-store.d.ts.map +1 -1
  137. package/dist/store/specs-store.js +14 -2
  138. package/dist/store/specs-store.js.map +1 -1
  139. package/dist/store/specs-writer.d.ts +130 -3
  140. package/dist/store/specs-writer.d.ts.map +1 -1
  141. package/dist/store/specs-writer.js +941 -102
  142. package/dist/store/specs-writer.js.map +1 -1
  143. package/dist/store/types.d.ts +31 -1
  144. package/dist/store/types.d.ts.map +1 -1
  145. package/dist/store/waivers-store.d.ts.map +1 -1
  146. package/dist/store/waivers-store.js +8 -1
  147. package/dist/store/waivers-store.js.map +1 -1
  148. package/dist/store/worktrees-migration.d.ts +141 -0
  149. package/dist/store/worktrees-migration.d.ts.map +1 -0
  150. package/dist/store/worktrees-migration.js +356 -0
  151. package/dist/store/worktrees-migration.js.map +1 -0
  152. package/dist/store/worktrees-writer.d.ts +28 -0
  153. package/dist/store/worktrees-writer.d.ts.map +1 -1
  154. package/dist/store/worktrees-writer.js +147 -13
  155. package/dist/store/worktrees-writer.js.map +1 -1
  156. package/package.json +5 -2
  157. package/templates/hook-packs/claude-code/CLAUDE.md +11 -5
  158. package/templates/hook-packs/claude-code/agent-heartbeat.sh +131 -0
  159. package/templates/hook-packs/claude-code/agent-register.sh +62 -0
  160. package/templates/hook-packs/claude-code/agent-stop.sh +51 -0
  161. package/templates/hook-packs/claude-code/audit.sh +1 -1
  162. package/templates/hook-packs/claude-code/block-dangerous.sh +1 -1
  163. package/templates/hook-packs/claude-code/classify_command.py +1 -1
  164. package/templates/hook-packs/claude-code/cwd-guard.sh +30 -0
  165. package/templates/hook-packs/claude-code/dispatch/post_tool_use.sh +15 -4
  166. package/templates/hook-packs/claude-code/dispatch/pre_tool_use.sh +19 -2
  167. package/templates/hook-packs/claude-code/dispatch/session_start.sh +6 -2
  168. package/templates/hook-packs/claude-code/dispatch/stop.sh +7 -2
  169. package/templates/hook-packs/claude-code/duplicate-export-check.sh +156 -0
  170. package/templates/hook-packs/claude-code/god-object-check.sh +102 -0
  171. package/templates/hook-packs/claude-code/guard-strikes.sh +1 -1
  172. package/templates/hook-packs/claude-code/lib/parse-input.sh +115 -1
  173. package/templates/hook-packs/claude-code/lib/run-handlers.sh +1 -1
  174. package/templates/hook-packs/claude-code/loc-delta-check.sh +91 -0
  175. package/templates/hook-packs/claude-code/naming-check.sh +128 -0
  176. package/templates/hook-packs/claude-code/plan-transcript-finalize.sh +59 -0
  177. package/templates/hook-packs/claude-code/plan-transcript-snapshot.sh +86 -0
  178. package/templates/hook-packs/claude-code/protected-paths.sh +59 -0
  179. package/templates/hook-packs/claude-code/quiet-merge.sh +68 -0
  180. package/templates/hook-packs/claude-code/reset-danger-latch.sh +1 -1
  181. package/templates/hook-packs/claude-code/reset-strikes.sh +1 -1
  182. package/templates/hook-packs/claude-code/runtime-paths.sh +1 -1
  183. package/templates/hook-packs/claude-code/scan-secrets.sh +98 -0
  184. package/templates/hook-packs/claude-code/scope-guard.sh +47 -65
  185. package/templates/hook-packs/claude-code/session-caws-status.sh +7 -1
  186. package/templates/hook-packs/claude-code/session-log.sh +1 -1
  187. package/templates/hook-packs/claude-code/session_log_renderer.py +956 -0
  188. package/templates/hook-packs/claude-code/shortcut-language-check.sh +147 -0
  189. package/templates/hook-packs/claude-code/worktree-guard.sh +130 -4
  190. package/templates/hook-packs/claude-code/worktree-write-guard.sh +133 -18
@@ -1 +1 @@
1
- {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/store/rules.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW;;;;IAOtB,+EAA+E;;;;IAI/E,0BAA0B;;IAE1B,0BAA0B;;;IAK1B,+EAA+E;;IAI/E,4EAA4E;;IAE5E,2EAA2E;;IAE3E,gDAAgD;;IAIhD,sEAAsE;;IAItE,8EAA8E;;IAE9E,kDAAkD;;IAElD,oDAAoD;;IAEpD,4CAA4C;;IAE5C,sEAAsE;;IAEtE,2DAA2D;;IAI3D,mEAAmE;;IAEnE,6EAA6E;;IAE7E,uEAAuE;;IAEvE,uEAAuE;;IAEvE,uEAAuE;;IAIvE,iEAAiE;;IAEjE,wEAAwE;;IAIxE,yEAAyE;;IAEzE,0EAA0E;;IAE1E,gFAAgF;;IAEhF,0EAA0E;;IAG1E;8EAC0E;;IAG1E;2DACuD;;IAEvD,+EAA+E;;CAEvE,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE,eAAO,MAAM,mBAAmB,mJAStB,CAAC"}
1
+ {"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/store/rules.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW;;;;IAOtB,+EAA+E;;;;IAI/E,0BAA0B;;IAE1B,0BAA0B;;;IAK1B,+EAA+E;;IAI/E,4EAA4E;;IAE5E,2EAA2E;;IAE3E,gDAAgD;;IAIhD,sEAAsE;;IAItE,8EAA8E;;IAE9E,kDAAkD;;IAElD,oDAAoD;;IAEpD,4CAA4C;;IAE5C,sEAAsE;;IAEtE,2DAA2D;;IAI3D,mEAAmE;;IAEnE,6EAA6E;;IAE7E,uEAAuE;;IAEvE,uEAAuE;;IAEvE,uEAAuE;;IAEvE;8DAC0D;;IAE1D;;;+CAG2C;;IAG3C;;;;;;;;;uBASmB;;IAGnB;;sDAEkD;;IAElD;;+BAE2B;;IAG3B;;yEAEqE;;IAKrE;;4DAEwD;;IAExD;wDACoD;;IAEpD;oDACgD;;IAEhD;;6EAEyE;;IAGzE;;oCAEgC;;IAEhC;;mDAE+C;;IAK/C,iEAAiE;;IAEjE,wEAAwE;;IAIxE,yEAAyE;;IAEzE,0EAA0E;;IAE1E,gFAAgF;;IAEhF,0EAA0E;;IAG1E;8EAC0E;;IAG1E;2DACuD;;IAEvD,+EAA+E;;IAI/E;;8CAE0C;;IAE1C;;6DAEyD;;IAEzD,qEAAqE;;IAErE;oDACgD;;IAEhD;gFAC4E;;IAE5E;;0EAEsE;;CAE9D,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEvE,eAAO,MAAM,mBAAmB,oKAUtB,CAAC"}
@@ -59,6 +59,60 @@ exports.STORE_RULES = {
59
59
  EVENTS_LOCK_CONTENTION: 'store.events.lock_contention',
60
60
  /** prepareAppend rejected the body. Carries the kernel diagnostics. */
61
61
  EVENTS_PREPARE_APPEND_REJECTED: 'store.events.prepare_append_rejected',
62
+ /** rotateEvents was called against a missing or empty events.jsonl.
63
+ * There is nothing to archive; the operation refuses. */
64
+ EVENTS_ROTATE_NOTHING_TO_ROTATE: 'store.events.rotate.nothing_to_rotate',
65
+ /** rotateEvents was called against a clean v11 chain (all entries have
66
+ * structured actor) without the explicit --allow-clean / allowClean
67
+ * flag. Friction guard to prevent casual log rotation that could hide
68
+ * evidence behind an archive boundary. */
69
+ EVENTS_ROTATE_CLEAN_CHAIN_REQUIRES_ALLOW_CLEAN: 'store.events.rotate.clean_chain_requires_allow_clean',
70
+ /** rotateEvents was called against a log that has some unparseable
71
+ * lines alongside parseable ones. 'parseable_unverified' cannot
72
+ * honestly label such a chain; rotating would archive a partially
73
+ * corrupt log under a status that implies all lines parsed.
74
+ * Refuses by default. A future operator-facing escape hatch (e.g.
75
+ * --allow-corrupt-archive paired with a new schema enum value) may
76
+ * be added in a later slice if recovery from partial corruption is
77
+ * needed; not in v11.2 scope. The fully-unparseable case is
78
+ * handled separately (the planner refuses earlier with its own
79
+ * diagnostic). */
80
+ EVENTS_ROTATE_PARTIAL_CORRUPTION: 'store.events.rotate.partial_corruption',
81
+ /** verify-archive recomputed the archive file's sha256 and it did not
82
+ * match the prior_file_digest committed in the most recent
83
+ * chain_rotated event. Tamper detection trip. */
84
+ EVENTS_ARCHIVE_DIGEST_MISMATCH: 'store.events.archive.digest_mismatch',
85
+ /** verify-archive recomputed the archive file's line count and it did
86
+ * not match the prior_line_count committed in the most recent
87
+ * chain_rotated event. */
88
+ EVENTS_ARCHIVE_LINE_COUNT_MISMATCH: 'store.events.archive.line_count_mismatch',
89
+ /** events migrate --apply refused because v10 spec YAMLs were detected
90
+ * and --allow-partial-upgrade was not passed. The half-upgrade refusal
91
+ * is structural (see CAWS-MIGRATE-V10-EVENTS-001 A10 invariant). */
92
+ EVENTS_MIGRATE_PARTIAL_UPGRADE_REFUSED: 'store.events.migrate.partial_upgrade_refused',
93
+ // ---- specs migration (CAWS-MIGRATE-V10-SPECS-001) -----------------------
94
+ /** Scan failed to read .caws/specs/ directory. Structural — refuses
95
+ * rather than silently returning an empty scan (so apply-default
96
+ * bypass can't masquerade as "no v10 specs found"). */
97
+ SPECS_MIGRATE_SCAN_FAILED: 'store.specs.migrate.scan_failed',
98
+ /** A YAML file in .caws/specs/ could not be parsed during scan;
99
+ * recorded per-file but does not stop the scan. */
100
+ SPECS_MIGRATE_PARSE_FAILED: 'store.specs.migrate.parse_failed',
101
+ /** --apply (no --partial) refused because at least one spec hit a
102
+ * refused verdict; ZERO files were written. */
103
+ SPECS_MIGRATE_REFUSALS_PRESENT: 'store.specs.migrate.refusals_present',
104
+ /** A post-write validation of the transformer's output rejected the
105
+ * spec; the write for that file was rolled back. Other files in
106
+ * the batch are NOT rolled back per non_functional reliability rule. */
107
+ SPECS_MIGRATE_POST_WRITE_VALIDATION_FAILED: 'store.specs.migrate.post_write_validation_failed',
108
+ /** Writing a migrated spec file to disk failed (atomic write rejected
109
+ * by filesystem). The other writes proceeded; the report records
110
+ * which files were skipped. */
111
+ SPECS_MIGRATE_WRITE_FAILED: 'store.specs.migrate.write_failed',
112
+ /** Writing the durable migration report to disk failed AFTER spec
113
+ * writes succeeded. The migrations are on disk; only the audit
114
+ * trail failed. Operator must investigate. */
115
+ SPECS_MIGRATE_REPORT_WRITE_FAILED: 'store.specs.migrate.report_write_failed',
62
116
  // ---- init (slice 7b) ----------------------------------------------------
63
117
  /** A legacy file (e.g., working-spec.yaml) blocks vNext init. */
64
118
  INIT_LEGACY_RESIDUE: 'store.init.legacy_residue',
@@ -81,6 +135,27 @@ exports.STORE_RULES = {
81
135
  YAML_PATCH_AMBIGUOUS: 'store.yaml_patch.ambiguous',
82
136
  /** yaml-patch refused because the target key was not found in the document. */
83
137
  YAML_PATCH_KEY_NOT_FOUND: 'store.yaml_patch.key_not_found',
138
+ // ---- leases (MULTI-AGENT-ACTIVITY-REGISTRY-001) -------------------------
139
+ /** Lease directory exists but is unreadable (permission denied, etc).
140
+ * Only failure mode for loadLeases — per-file failures are degraded
141
+ * to diagnostics inside an ok result. */
142
+ LEASE_DIR_UNREADABLE: 'store.leases.dir_unreadable',
143
+ /** Per-file lease load failure: JSON parse, not-an-object, filename/payload
144
+ * session_id mismatch, or unreadable file. The file is excluded from the
145
+ * returned registry but loadLeases still returns ok. */
146
+ LEASE_FILE_MALFORMED: 'store.leases.file_malformed',
147
+ /** Atomic lease write failed (directory creation, write, rename). */
148
+ LEASE_WRITE_FAILED: 'store.leases.write_failed',
149
+ /** session_id is empty, the literal 'unknown', or not a string. Refused
150
+ * at the I/O boundary by safeLeaseFilename. */
151
+ LEASE_SESSION_ID_INVALID: 'store.leases.session_id_invalid',
152
+ /** session_id contains characters outside the strict allowlist
153
+ * ^[A-Za-z0-9._:-]+$. Refused at the I/O boundary by safeLeaseFilename. */
154
+ LEASE_SESSION_ID_UNSAFE: 'store.leases.session_id_unsafe',
155
+ /** mark_stopped patch received but no prior lease exists for the session.
156
+ * Warning, not error — the store does NOT fabricate a historical record;
157
+ * the caller is told that the stop is a lifecycle mismatch no-op. */
158
+ LEASE_STOP_NO_PRIOR_LEASE: 'store.leases.stop_no_prior_lease',
84
159
  };
85
160
  exports.STORE_RULE_PREFIXES = [
86
161
  'store.repo_root.',
@@ -91,5 +166,6 @@ exports.STORE_RULE_PREFIXES = [
91
166
  'store.registry.',
92
167
  'store.events.',
93
168
  'store.init.',
169
+ 'store.leases.',
94
170
  ];
95
171
  //# sourceMappingURL=rules.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/store/rules.ts"],"names":[],"mappings":";AAAA,yDAAyD;AACzD,EAAE;AACF,yEAAyE;AACzE,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;;;AAE3D,QAAA,WAAW,GAAG;IACzB,4EAA4E;IAC5E,wBAAwB,EAAE,gCAAgC;IAC1D,+BAA+B,EAAE,uCAAuC;IACxE,0BAA0B,EAAE,kCAAkC;IAE9D,6EAA6E;IAC7E,+EAA+E;IAC/E,iBAAiB,EAAE,yBAAyB;IAC5C,eAAe,EAAE,uBAAuB;IACxC,cAAc,EAAE,sBAAsB;IACtC,0BAA0B;IAC1B,iBAAiB,EAAE,yBAAyB;IAC5C,0BAA0B;IAC1B,iBAAiB,EAAE,yBAAyB;IAE5C,6EAA6E;IAC7E,eAAe,EAAE,uBAAuB;IACxC,+EAA+E;IAC/E,0BAA0B,EAAE,kCAAkC;IAE9D,6E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EAAE,6BAA6B;IACnD,qEAAqE;IACrE,kBAAkB,EAAE,2BAA2B;IAC/C;oDACgD;IAChD,wBAAwB,EAAE,iCAAiC;IAC3D;gFAC4E;IAC5E,uBAAuB,EAAE,gCAAgC;IACzD;;0EAEsE;IACtE,yBAAyB,EAAE,kCAAkC;CACrD,CAAC;AAIE,QAAA,mBAAmB,GAAG;IACjC,kBAAkB;IAClB,aAAa;IACb,cAAc;IACd,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,eAAe;IACf,aAAa;IACb,eAAe;CACP,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { type Diagnostic, type LifecycleMapping, type MigrateOutcome, type Result } from '@paths.design/caws-kernel';
2
+ /**
3
+ * Schema_version 1 of the durable migration report.
4
+ * Stable contract per contract spec-v10-migration-output.
5
+ */
6
+ export declare const MIGRATION_REPORT_SCHEMA_VERSION = 1;
7
+ export interface NonYamlObservation {
8
+ readonly file: string;
9
+ readonly kind: 'markdown_sidecar' | 'unknown_non_yaml';
10
+ }
11
+ export interface ScanEntry {
12
+ /** Path relative to cawsDir, e.g. ".caws/specs/X.yaml". */
13
+ readonly file: string;
14
+ /** Best-effort spec id from the parsed object (null if absent). */
15
+ readonly spec_id: string | null;
16
+ /** sha256 hex of the original YAML bytes. */
17
+ readonly old_digest: string;
18
+ /** Outcome from the kernel transformer. */
19
+ readonly outcome: MigrateOutcome;
20
+ /** Original source bytes — threaded to apply for write + digest reuse. */
21
+ readonly raw: string;
22
+ }
23
+ export interface ScanReport {
24
+ readonly cawsDir: string;
25
+ readonly entries: ReadonlyArray<ScanEntry>;
26
+ readonly distribution: {
27
+ readonly migrated: number;
28
+ readonly migrated_with_warnings: number;
29
+ readonly refused: number;
30
+ readonly total: number;
31
+ };
32
+ readonly non_yaml: ReadonlyArray<NonYamlObservation>;
33
+ /** Parse errors keyed by file path (does not block scan). */
34
+ readonly parse_errors: ReadonlyArray<{
35
+ file: string;
36
+ diagnostics: ReadonlyArray<Diagnostic>;
37
+ }>;
38
+ }
39
+ export type ReportVerdict = 'migrated' | 'migrated_with_warnings' | 'refused' | 'post_write_validation_failed';
40
+ export interface ReportEntry {
41
+ readonly file: string;
42
+ readonly spec_id: string | null;
43
+ readonly old_digest: string;
44
+ readonly new_digest: string | null;
45
+ readonly verdict: ReportVerdict;
46
+ readonly safe_renames: ReadonlyArray<{
47
+ from: string;
48
+ to: string;
49
+ }>;
50
+ readonly coercions: ReadonlyArray<{
51
+ field: string;
52
+ from: unknown;
53
+ to: unknown;
54
+ }>;
55
+ readonly mode_source: 'mode' | 'type' | 'unresolvable' | null;
56
+ readonly lifecycle_mapping_used: LifecycleMapping[string] | null;
57
+ readonly report_only_fields: Record<string, unknown>;
58
+ readonly refusal_reasons: ReadonlyArray<string>;
59
+ readonly post_write_validation_errors: ReadonlyArray<Diagnostic>;
60
+ }
61
+ export interface MigrationReport {
62
+ readonly schema_version: typeof MIGRATION_REPORT_SCHEMA_VERSION;
63
+ readonly generated_at: string;
64
+ readonly command: string;
65
+ readonly cwd: string;
66
+ readonly distribution: ScanReport['distribution'] & {
67
+ readonly post_write_validation_failed: number;
68
+ };
69
+ readonly non_yaml_observations: ReadonlyArray<NonYamlObservation>;
70
+ readonly entries: ReadonlyArray<ReportEntry>;
71
+ }
72
+ export interface ApplyResult {
73
+ readonly cawsDir: string;
74
+ readonly partial: boolean;
75
+ /** Path of the written report; null on dry-run. */
76
+ readonly report_path: string | null;
77
+ readonly report: MigrationReport;
78
+ }
79
+ export interface ScanOptions {
80
+ readonly cawsDir: string;
81
+ readonly from: 'v10';
82
+ readonly lifecycleMapping?: LifecycleMapping;
83
+ }
84
+ export interface ApplyOptions extends ScanOptions {
85
+ readonly apply: boolean;
86
+ readonly partial: boolean;
87
+ readonly now: Date;
88
+ }
89
+ /**
90
+ * Read-only scan of .caws/specs/. Classifies each YAML via the kernel
91
+ * detectSpecVersion + migrateSpecV10 pipeline; reports non-YAML files
92
+ * as observations (markdown_sidecar for *.md, unknown_non_yaml for the
93
+ * rest, EXCEPT registry.json which is the CLI's own bookkeeping and is
94
+ * silently ignored).
95
+ *
96
+ * Per A8: explicitly excludes .archive/ if present. Does NOT recurse.
97
+ * The scan is read-only — no files are modified and no events are appended.
98
+ *
99
+ * Failure mode: if the specs directory cannot be listed (permission
100
+ * denied, etc.), returns err with SPECS_MIGRATE_SCAN_FAILED. Refuses
101
+ * rather than returning an empty scan so an apply-default can't masquerade
102
+ * as "no v10 specs found."
103
+ */
104
+ export declare function runSpecsMigrateScan(opts: ScanOptions): Result<ScanReport>;
105
+ /**
106
+ * Run a scan, then optionally write the migrated YAMLs to disk + a
107
+ * durable migration report.
108
+ *
109
+ * apply=false (dry-run): produces an in-memory MigrationReport but
110
+ * writes NOTHING to disk (no spec writes, no report file).
111
+ *
112
+ * apply=true, partial=false: refuses if any scan entry is 'refused';
113
+ * no writes occur. Returns err with SPECS_MIGRATE_REFUSALS_PRESENT
114
+ * naming the first refused file and count.
115
+ *
116
+ * apply=true, partial=true: writes only the auto-migratable specs.
117
+ * Each write is preceded by post-write validation via the canonical
118
+ * parseAndValidateSpec; failure rolls back that single file (the
119
+ * on-disk YAML is byte-identical to the pre-call state) and records
120
+ * verdict='post_write_validation_failed' in the report. Other files
121
+ * in the batch are NOT rolled back (per non_functional reliability).
122
+ *
123
+ * The report is written ATOMICALLY via writeFileAtomic to
124
+ * .caws/migrations/v10-specs/<ISO>.json, ONCE per apply invocation,
125
+ * AFTER all per-file decisions are recorded.
126
+ */
127
+ export declare function runSpecsMigrateApply(opts: ApplyOptions): Result<ApplyResult>;
128
+ //# sourceMappingURL=specs-migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specs-migration.d.ts","sourceRoot":"","sources":["../../src/store/specs-migration.ts"],"names":[],"mappings":"AA0BA,OAAO,EASL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,MAAM,EACZ,MAAM,2BAA2B,CAAC;AAOnC;;;GAGG;AACH,eAA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