autonomous-sdlc-harness 0.1.0

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 (171) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +7 -0
  3. package/README.md +24 -0
  4. package/dist/cli.js +194 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/commands/config.js +561 -0
  7. package/dist/commands/config.js.map +1 -0
  8. package/dist/commands/daemon.js +791 -0
  9. package/dist/commands/daemon.js.map +1 -0
  10. package/dist/commands/doctor.js +336 -0
  11. package/dist/commands/doctor.js.map +1 -0
  12. package/dist/commands/init.js +2023 -0
  13. package/dist/commands/init.js.map +1 -0
  14. package/dist/commands/registry.js +42 -0
  15. package/dist/commands/registry.js.map +1 -0
  16. package/dist/config/check.js +505 -0
  17. package/dist/config/check.js.map +1 -0
  18. package/dist/config/io.js +177 -0
  19. package/dist/config/io.js.map +1 -0
  20. package/dist/config/model.js +406 -0
  21. package/dist/config/model.js.map +1 -0
  22. package/dist/core/errors.js +71 -0
  23. package/dist/core/errors.js.map +1 -0
  24. package/dist/core/git.js +537 -0
  25. package/dist/core/git.js.map +1 -0
  26. package/dist/core/json.js +125 -0
  27. package/dist/core/json.js.map +1 -0
  28. package/dist/core/layerCoverage.js +141 -0
  29. package/dist/core/layerCoverage.js.map +1 -0
  30. package/dist/core/layerGapRemedy.js +62 -0
  31. package/dist/core/layerGapRemedy.js.map +1 -0
  32. package/dist/core/nameList.js +23 -0
  33. package/dist/core/nameList.js.map +1 -0
  34. package/dist/core/paths.js +153 -0
  35. package/dist/core/paths.js.map +1 -0
  36. package/dist/core/prompt.js +206 -0
  37. package/dist/core/prompt.js.map +1 -0
  38. package/dist/core/repoPaths.js +55 -0
  39. package/dist/core/repoPaths.js.map +1 -0
  40. package/dist/core/report.js +150 -0
  41. package/dist/core/report.js.map +1 -0
  42. package/dist/core/templating.js +88 -0
  43. package/dist/core/templating.js.map +1 -0
  44. package/dist/core/writer.js +479 -0
  45. package/dist/core/writer.js.map +1 -0
  46. package/dist/daemon/backend.js +180 -0
  47. package/dist/daemon/backend.js.map +1 -0
  48. package/dist/daemon/units.js +380 -0
  49. package/dist/daemon/units.js.map +1 -0
  50. package/dist/detect/nestedApplication.js +79 -0
  51. package/dist/detect/nestedApplication.js.map +1 -0
  52. package/dist/detect/presets.js +2033 -0
  53. package/dist/detect/presets.js.map +1 -0
  54. package/dist/detect/signals.js +1368 -0
  55. package/dist/detect/signals.js.map +1 -0
  56. package/dist/doctor/checks.js +3530 -0
  57. package/dist/doctor/checks.js.map +1 -0
  58. package/dist/generators/claudeContext.js +588 -0
  59. package/dist/generators/claudeContext.js.map +1 -0
  60. package/dist/generators/githooks.js +446 -0
  61. package/dist/generators/githooks.js.map +1 -0
  62. package/dist/generators/harnessConfig.js +632 -0
  63. package/dist/generators/harnessConfig.js.map +1 -0
  64. package/dist/generators/notifications.js +191 -0
  65. package/dist/generators/notifications.js.map +1 -0
  66. package/dist/generators/outerLoopScripts.js +165 -0
  67. package/dist/generators/outerLoopScripts.js.map +1 -0
  68. package/dist/generators/permissionProfile.js +1172 -0
  69. package/dist/generators/permissionProfile.js.map +1 -0
  70. package/dist/generators/projectSettings.js +322 -0
  71. package/dist/generators/projectSettings.js.map +1 -0
  72. package/dist/generators/repoRoot.js +417 -0
  73. package/dist/generators/repoRoot.js.map +1 -0
  74. package/dist/generators/scripts.js +557 -0
  75. package/dist/generators/scripts.js.map +1 -0
  76. package/dist/generators/stateDir.js +221 -0
  77. package/dist/generators/stateDir.js.map +1 -0
  78. package/dist/machine/paths.js +111 -0
  79. package/dist/machine/paths.js.map +1 -0
  80. package/dist/machine/plugins.js +224 -0
  81. package/dist/machine/plugins.js.map +1 -0
  82. package/dist/machine/registry.js +330 -0
  83. package/dist/machine/registry.js.map +1 -0
  84. package/package.json +23 -0
  85. package/scripts/README.md +13 -0
  86. package/scripts/daemon/launchd.plist.template +59 -0
  87. package/scripts/daemon/systemd.service.template +58 -0
  88. package/templates/README.md +15 -0
  89. package/templates/claude/CLAUDE.md +54 -0
  90. package/templates/claude/README.md +5 -0
  91. package/templates/claude/context/api.md +29 -0
  92. package/templates/claude/context/conventions.md +23 -0
  93. package/templates/claude/context/data-layer.md +28 -0
  94. package/templates/claude/context/data-storage.md +29 -0
  95. package/templates/claude/context/docs-catalog.md +29 -0
  96. package/templates/claude/context/domain.md +28 -0
  97. package/templates/claude/context/layer.md +20 -0
  98. package/templates/claude/context/module.md +30 -0
  99. package/templates/claude/context/package.md +29 -0
  100. package/templates/claude/context/presentation.md +32 -0
  101. package/templates/claude/context/state-slices.md +28 -0
  102. package/templates/claude/context/tests.md +28 -0
  103. package/templates/claude/harness-task-offer.md +58 -0
  104. package/templates/claude/push-notify.env.example +21 -0
  105. package/templates/claude/qa-accounts.env.example +38 -0
  106. package/templates/claude/qa_test_scenarios.md +110 -0
  107. package/templates/claude/settings.autonomous.json +93 -0
  108. package/templates/claude/settings.autonomous.qa.json +36 -0
  109. package/templates/githooks/README.md +3 -0
  110. package/templates/githooks/pre-push +72 -0
  111. package/templates/repo/README.md +3 -0
  112. package/templates/repo/gitattributes +16 -0
  113. package/templates/repo/gitignore +61 -0
  114. package/templates/repo/gitignore.qa +25 -0
  115. package/templates/repo/mcp.json +17 -0
  116. package/templates/scripts/README.md +5 -0
  117. package/templates/scripts/autonomous-format-stream.sh +95 -0
  118. package/templates/scripts/autonomous-notify.sh +337 -0
  119. package/templates/scripts/autonomous-watcher.sh +3087 -0
  120. package/templates/scripts/cleanup-merged-worktrees.sh +327 -0
  121. package/templates/scripts/commit-on-branch.sh +288 -0
  122. package/templates/scripts/create-worktree.sh +360 -0
  123. package/templates/scripts/deploy.sh +47 -0
  124. package/templates/scripts/lib/harness-run-lib.sh +1481 -0
  125. package/templates/scripts/push-branch.sh +140 -0
  126. package/templates/scripts/refresh-branch.sh +244 -0
  127. package/templates/scripts/restart-watcher.sh +401 -0
  128. package/templates/scripts/scratch-run.sh +302 -0
  129. package/templates/scripts/setup-worktree.sh +262 -0
  130. package/templates/scripts/start-dev-server.sh +99 -0
  131. package/templates/scripts/test.sh +50 -0
  132. package/templates/scripts/typecheck.sh +50 -0
  133. package/templates/state-dir/README-root.md +13 -0
  134. package/templates/state-dir/README.md +9 -0
  135. package/templates/state-dir/architecture_branch_review_point_reviews/README.md +9 -0
  136. package/templates/state-dir/architecture_branch_reviews/README.md +9 -0
  137. package/templates/state-dir/architecture_reviews/README.md +9 -0
  138. package/templates/state-dir/architecture_user_review_reviews/README.md +9 -0
  139. package/templates/state-dir/autonomous_inbox/README.md +9 -0
  140. package/templates/state-dir/autonomous_logs/README.md +9 -0
  141. package/templates/state-dir/branch_statistics/README.md +9 -0
  142. package/templates/state-dir/business_parity_branch_review_point_reviews/README.md +9 -0
  143. package/templates/state-dir/business_parity_branch_reviews/README.md +9 -0
  144. package/templates/state-dir/business_parity_reviews/README.md +9 -0
  145. package/templates/state-dir/business_parity_user_review_reviews/README.md +9 -0
  146. package/templates/state-dir/clarification_digests/README.md +9 -0
  147. package/templates/state-dir/clarifications/README.md +9 -0
  148. package/templates/state-dir/code_reviews/README.md +9 -0
  149. package/templates/state-dir/dispatch_additions/README.md +19 -0
  150. package/templates/state-dir/docs_catalog/README.md +9 -0
  151. package/templates/state-dir/flow_progress/README.md +9 -0
  152. package/templates/state-dir/improvement_observations/README.md +19 -0
  153. package/templates/state-dir/improvement_suggestions.md +29 -0
  154. package/templates/state-dir/lessons.md +23 -0
  155. package/templates/state-dir/qa_review_point_reviews/README.md +9 -0
  156. package/templates/state-dir/qa_reviews/README.md +9 -0
  157. package/templates/state-dir/review_plan_point_reviews/README.md +9 -0
  158. package/templates/state-dir/review_plan_reviews/README.md +9 -0
  159. package/templates/state-dir/scratch/README.md +11 -0
  160. package/templates/state-dir/skeptic_review_plan_reviews/README.md +9 -0
  161. package/templates/state-dir/skeptic_review_point_reviews/README.md +9 -0
  162. package/templates/state-dir/skeptic_reviews/README.md +9 -0
  163. package/templates/state-dir/story_plans/README.md +9 -0
  164. package/templates/state-dir/task_plan_point_reviews/README.md +9 -0
  165. package/templates/state-dir/task_plan_reviews/README.md +9 -0
  166. package/templates/state-dir/task_plans/README.md +9 -0
  167. package/templates/state-dir/task_prompts/README.md +9 -0
  168. package/templates/state-dir/ui_test_plan_reviews/README.md +9 -0
  169. package/templates/state-dir/ui_test_plans/README.md +9 -0
  170. package/templates/state-dir/user_review_fix_plan_point_reviews/README.md +9 -0
  171. package/templates/state-dir/user_reviews/README.md +9 -0
@@ -0,0 +1,79 @@
1
+ /**
2
+ * One question, asked nowhere else: **does a direct subdirectory of the repository root look like the
3
+ * application?**
4
+ *
5
+ * It is a module of its own rather than a widening of `detect/signals.ts` or `detect/presets.ts`
6
+ * because it is a new responsibility with a hard boundary: **nothing is derived from what it finds.**
7
+ * No preset, no layer, no command line and no config value may ever be taken from this answer. Its one
8
+ * consumer is a note `init` prints — the directory it found, the manifest it found there, and the
9
+ * `--app-dir` re-run that would point detection at that tree — and the adopter decides.
10
+ *
11
+ * A **single** hit or nothing. Zero hits is silence for the obvious reason; two or more is silence
12
+ * because a repository holding several applications is undefined here, and naming one of them would be
13
+ * a recommendation this module has no basis for making.
14
+ */
15
+ import { DetectContext, findAnyReadManifest } from './signals.js';
16
+ /**
17
+ * Direct subdirectories never treated as the application, skipped before a probe is spent on them.
18
+ *
19
+ * **This module's own list, deliberately not `detect/signals.ts`'s `NON_PACKAGE_DIR_NAMES`.** That one
20
+ * answers a different question — which child is the importable Python package — and this one has an
21
+ * exclusion that question does not need: a build-output or dependency tree legitimately contains a
22
+ * manifest (a dependency's own `package.json`, a vendored module, a staged `dist/`), and that is precisely
23
+ * where a false *single* hit would come from. Sharing a list would tie each question's exclusions to
24
+ * the other's.
25
+ */
26
+ const NON_APPLICATION_DIR_NAMES = new Set([
27
+ 'build',
28
+ 'dist',
29
+ 'docs',
30
+ 'examples',
31
+ 'node_modules',
32
+ 'out',
33
+ 'target',
34
+ 'test',
35
+ 'tests',
36
+ 'vendor',
37
+ 'venv',
38
+ ]);
39
+ /**
40
+ * The one direct subdirectory of `repoRoot` that carries a manifest `init` reads, or `undefined`.
41
+ *
42
+ * The probe is `findAnyReadManifest` over a `DetectContext(repoRoot, child)` — the same manifest table
43
+ * detection itself uses, so a directory named here is one a re-run with `--app-dir` would actually
44
+ * detect. Children come from `DetectContext.childDirNames`, which is sorted and excludes
45
+ * dot-directories, so the scan is deterministic regardless of directory order on disk.
46
+ *
47
+ * **The residual, and the gate that removes it.** A child context's `manifestRoots` is
48
+ * `[child, '.']`, and `findAnyReadManifest` walks its locator list **locator-first**, each locator
49
+ * over both entries, answering the first hit. So a locator answering from the `.` leg — a manifest at
50
+ * the root, or one a locator finds under a root subdirectory it scans of its own — pre-empts a later
51
+ * locator's genuine hit inside `<child>/`, and a real nested application would read as no hit. The
52
+ * locator list is not exported and the module holding it is fenced, so it cannot be walked here.
53
+ * Instead the root is probed **once, before the children**: if `findAnyReadManifest` answers anything
54
+ * for `DetectContext(repoRoot, '.')`, this probe is **inconclusive** and the function answers
55
+ * `undefined` — printing nothing is the conservative failure, never a wrong note. If it answers
56
+ * `undefined`, no locator can answer from the `.` leg of any child context either, and the per-child
57
+ * prefix test below is provably sound.
58
+ */
59
+ export function findNestedApplicationDir(repoRoot) {
60
+ const root = new DetectContext(repoRoot);
61
+ if (findAnyReadManifest(root) !== undefined)
62
+ return undefined;
63
+ let found;
64
+ for (const dir of root.childDirNames('.')) {
65
+ if (NON_APPLICATION_DIR_NAMES.has(dir))
66
+ continue;
67
+ const manifest = findAnyReadManifest(new DetectContext(repoRoot, dir));
68
+ // A manifest reached through the `.` leg is the repository's, not this directory's — and the gate
69
+ // above has already established that no such manifest exists, which is what makes the prefix test
70
+ // an exact statement about `<dir>/` rather than a guess.
71
+ if (manifest === undefined || !manifest.startsWith(`${dir}/`))
72
+ continue;
73
+ if (found !== undefined)
74
+ return undefined;
75
+ found = { dir, manifest };
76
+ }
77
+ return found;
78
+ }
79
+ //# sourceMappingURL=nestedApplication.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestedApplication.js","sourceRoot":"","sources":["../../src/detect/nestedApplication.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAUlE;;;;;;;;;GASG;AACH,MAAM,yBAAyB,GAAwB,IAAI,GAAG,CAAC;IAC7D,OAAO;IACP,MAAM;IACN,MAAM;IACN,UAAU;IACV,cAAc;IACd,KAAK;IACL,QAAQ;IACR,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;CACP,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,wBAAwB,CAAC,QAAgB;IACvD,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;IACzC,IAAI,mBAAmB,CAAC,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAE9D,IAAI,KAAoC,CAAC;IACzC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;QAC1C,IAAI,yBAAyB,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QACjD,MAAM,QAAQ,GAAG,mBAAmB,CAAC,IAAI,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC;QACvE,kGAAkG;QAClG,kGAAkG;QAClG,yDAAyD;QACzD,IAAI,QAAQ,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,GAAG,GAAG,CAAC;YAAE,SAAS;QACxE,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QAC1C,KAAK,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}