@topogram/cli 0.3.72 → 0.3.73

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 (81) hide show
  1. package/README.md +24 -195
  2. package/package.json +1 -1
  3. package/src/adoption/plan/index.js +2 -1
  4. package/src/agent-brief.js +46 -2
  5. package/src/archive/archive.js +1 -1
  6. package/src/archive/jsonl.js +18 -8
  7. package/src/archive/resolver-bridge.js +34 -1
  8. package/src/archive/schema.js +1 -1
  9. package/src/archive/unarchive.js +26 -0
  10. package/src/cli/command-parsers/sdlc.js +66 -0
  11. package/src/cli/commands/import/help.js +1 -0
  12. package/src/cli/commands/import/plan.js +9 -0
  13. package/src/cli/commands/import/workspace.js +3 -0
  14. package/src/cli/commands/query/definitions.js +11 -10
  15. package/src/cli/commands/query/workspace.js +23 -2
  16. package/src/cli/commands/sdlc.js +213 -5
  17. package/src/cli/dispatcher.js +8 -0
  18. package/src/cli/help.js +14 -2
  19. package/src/cli/options.js +1 -0
  20. package/src/generator/context/shared/domain-sdlc.js +27 -0
  21. package/src/generator/context/shared/relationships.js +2 -1
  22. package/src/generator/context/shared/types.d.ts +1 -0
  23. package/src/generator/context/shared.d.ts +2 -0
  24. package/src/generator/context/shared.js +2 -0
  25. package/src/generator/context/slice/core.js +3 -0
  26. package/src/generator/context/slice/sdlc.js +57 -2
  27. package/src/generator/context/task-mode.js +7 -0
  28. package/src/generator/sdlc/board.js +2 -0
  29. package/src/generator/sdlc/traceability-matrix.js +5 -1
  30. package/src/import/core/context.js +1 -1
  31. package/src/import/core/contracts.js +3 -3
  32. package/src/import/core/registry.js +3 -0
  33. package/src/import/core/runner/candidates.js +7 -0
  34. package/src/import/core/runner/reports.js +9 -1
  35. package/src/import/core/runner/tracks.js +3 -0
  36. package/src/import/extractors/cli/generic.js +340 -0
  37. package/src/new-project/project-files.js +10 -3
  38. package/src/resolver/enrich/task.js +3 -1
  39. package/src/resolver/index.js +6 -0
  40. package/src/resolver/normalize.js +31 -0
  41. package/src/resolver/projections-cli.js +158 -0
  42. package/src/sdlc/adopt.js +4 -1
  43. package/src/sdlc/check.js +24 -2
  44. package/src/sdlc/complete.js +47 -0
  45. package/src/sdlc/dod/index.js +2 -0
  46. package/src/sdlc/dod/plan.js +15 -0
  47. package/src/sdlc/dod/task.js +7 -3
  48. package/src/sdlc/explain.js +53 -1
  49. package/src/sdlc/gate.js +352 -0
  50. package/src/sdlc/history.d.ts +7 -0
  51. package/src/sdlc/history.js +50 -5
  52. package/src/sdlc/link.js +172 -0
  53. package/src/sdlc/paths.d.ts +4 -0
  54. package/src/sdlc/paths.js +8 -0
  55. package/src/sdlc/plan-steps.js +71 -0
  56. package/src/sdlc/plan.js +245 -0
  57. package/src/sdlc/policy.js +249 -0
  58. package/src/sdlc/prep.js +186 -0
  59. package/src/sdlc/scaffold.js +4 -2
  60. package/src/sdlc/status-filter.js +2 -0
  61. package/src/sdlc/transitions/index.js +3 -0
  62. package/src/sdlc/transitions/plan.js +32 -0
  63. package/src/validator/common.js +25 -4
  64. package/src/validator/index.js +10 -0
  65. package/src/validator/kinds.d.ts +7 -0
  66. package/src/validator/kinds.js +32 -0
  67. package/src/validator/per-kind/plan.js +128 -0
  68. package/src/validator/per-kind/task.js +19 -0
  69. package/src/validator/projections/cli.js +267 -0
  70. package/src/validator.d.ts +1 -0
  71. package/src/workflows/import-app/shared.js +1 -1
  72. package/src/workflows/reconcile/adoption-plan/build.js +3 -1
  73. package/src/workflows/reconcile/adoption-plan/reasons.js +5 -0
  74. package/src/workflows/reconcile/bundle-core/index.js +3 -0
  75. package/src/workflows/reconcile/candidate-model.js +15 -0
  76. package/src/workflows/reconcile/gap-report.js +4 -2
  77. package/src/workflows/reconcile/impacts/adoption-plan.js +13 -0
  78. package/src/workflows/reconcile/renderers.js +82 -0
  79. package/src/workflows/reconcile/summary.js +4 -0
  80. package/src/workflows/reconcile/workflow.js +2 -1
  81. package/src/workspace-paths.js +26 -2
@@ -57,6 +57,11 @@ const WORKSPACE_SIGNAL_DIRS = new Set([
57
57
  * @property {boolean} bootstrappedTopoRoot
58
58
  */
59
59
 
60
+ /**
61
+ * @typedef {Object} WorkspaceResolutionOptions
62
+ * @property {boolean} [ignoreAncestorConfig]
63
+ */
64
+
60
65
  /**
61
66
  * @param {string} candidatePath
62
67
  * @returns {boolean}
@@ -225,9 +230,10 @@ function signalWorkspaceCandidates(root) {
225
230
 
226
231
  /**
227
232
  * @param {string} inputPath
233
+ * @param {WorkspaceResolutionOptions} [options]
228
234
  * @returns {WorkspaceResolution}
229
235
  */
230
- export function resolveWorkspaceContext(inputPath = ".") {
236
+ export function resolveWorkspaceContext(inputPath = ".", options = {}) {
231
237
  const absolute = path.resolve(inputPath || ".");
232
238
  if (isDirectory(absolute) && path.basename(absolute) === LEGACY_WORKSPACE_FOLDER_NAME && isWorkspaceSignalRoot(absolute)) {
233
239
  throw new Error("Legacy workspace folders are not supported. Use topo/ or configure topogram.project.json workspace to a non-legacy relative path.");
@@ -250,7 +256,25 @@ export function resolveWorkspaceContext(inputPath = ".") {
250
256
  };
251
257
  }
252
258
 
253
- const configInfo = findProjectRoot(absolute);
259
+ const directDefaultCandidate = path.join(absolute, DEFAULT_TOPO_FOLDER_NAME);
260
+ if (
261
+ isDirectory(absolute) &&
262
+ !fs.existsSync(path.join(absolute, PROJECT_CONFIG_FILE)) &&
263
+ isDirectory(directDefaultCandidate) &&
264
+ isWorkspaceSignalRoot(directDefaultCandidate)
265
+ ) {
266
+ return {
267
+ inputRoot: absolute,
268
+ topoRoot: directDefaultCandidate,
269
+ projectRoot: absolute,
270
+ configPath: null,
271
+ fromConfig: false,
272
+ fromSignal: false,
273
+ bootstrappedTopoRoot: false
274
+ };
275
+ }
276
+
277
+ const configInfo = options.ignoreAncestorConfig ? null : findProjectRoot(absolute);
254
278
  if (configInfo) {
255
279
  const topoRoot = resolveProjectWorkspace(configInfo.config, configInfo.configDir);
256
280
  return {