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 @@
1
+ {"version":3,"file":"harnessConfig.js","sourceRoot":"","sources":["../../src/generators/harnessConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,UAAU,EACV,eAAe,EACf,cAAc,EACd,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,eAAe,GAKhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,2BAA2B,EAC3B,UAAU,EACV,gBAAgB,GAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAwC,MAAM,sBAAsB,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAqC,MAAM,cAAc,CAAC;AAErG;;;;;;;;;;;;;;GAcG;AACH,MAAM,wBAAwB,GAAsB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEvE;;;GAGG;AACH,MAAM,GAAG,GAAG,6BAA6B,CAAC;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QAC7F,8FAA8F;QAC9F,gGAAgG;QAChG,8FAA8F;QAC9F,kFAAkF;QAClF,MAAM,YAAY,GAChB,YAAY,KAAK,QAAQ;YACvB,CAAC,CAAC,wHAAwH;YAC1H,CAAC,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC,oDAAoD,CAAC,CAAC,CAAC,2FAA2F,4DAA4D,CAAC;QAC1S,MAAM,WAAW,GAAG,0CAA0C,YAAY,kSAAkS,CAAC;QAC7W,2FAA2F;QAC3F,8FAA8F;QAC9F,mFAAmF;QACnF,iGAAiG;QACjG,4BAA4B;QAC5B,KAAK,CAAC,IAAI,CACR,MAAM;YACJ,CAAC,CAAC,GAAG,eAAe,gJAAgJ,eAAe,eAAe,WAAW,sgBAAsgB;YACntB,CAAC,CAAC,GAAG,eAAe,+HAA+H,eAAe,SAAS,WAAW,ybAAyb,CAClnB,CAAC;IACJ,CAAC;IAED,mGAAmG;IACnG,kGAAkG;IAClG,mGAAmG;IACnG,mGAAmG;IACnG,8FAA8F;IAC9F,sEAAsE;IACtE,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjG,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Generator: the machine-local push-notification settings `init --notifications` writes, and the
3
+ * one definition of where the notifier's two credential files are.
4
+ *
5
+ * **Why the credential lives outside the repository, and why it is not a plugin `userConfig`
6
+ * option.** The roadmap item that asked for this opt-in also asked for the token to go into the
7
+ * plugin's `userConfig` as a `sensitive` value. That half is reconciled rather than implemented,
8
+ * and this is where the reconciliation is recorded so it is not re-opened: `docs/development.md` §4
9
+ * and `docs/config.md` §2 both record, as a measured fact, that **the CLI cannot read plugin
10
+ * `userConfig` at all** — so a key declared there would not reach this command. The shipped
11
+ * delivery contract carries no token key either: `cli/templates/claude/push-notify.env.example`
12
+ * declares exactly {@link PUSH_URL_KEY} and {@link PUSH_CMD_KEY}. The credential-bearing value is
13
+ * therefore the push **URL**, and its home is the machine-local `push.env` that `docs/watcher.md`
14
+ * §6 already names as the first file the notifier reads. "Guided ntfy setup" ships accordingly as a
15
+ * vendor-neutral endpoint prompt whose guided line uses `https://ntfy.sh/<your-topic>` as the
16
+ * worked example rather than as the only thing that works.
17
+ *
18
+ * ## Three non-obvious choices, and where each comes from
19
+ *
20
+ * 1. **An opt-in with no endpoint writes nothing — and that is the whole point of the file.**
21
+ * `docs/watcher.md` §6's precedence is that the machine-local file wins and the repository's
22
+ * configured `pushEnvPath` is then **not read**. So an empty machine-local file is not a
23
+ * harmless placeholder: it satisfies "the first that exists wins" and *shadows* a repository-side
24
+ * file that already has values, turning an opt-in into a silent opt-out. When the answer to
25
+ * "where should notifications be posted" is nothing, this generator enqueues nothing and returns
26
+ * the guided setup as a note instead.
27
+ * 2. **The value is never logged back.** The run's action log names the path the write engine
28
+ * wrote, the note names the two keys, and neither says what the URL is — the same discipline
29
+ * `autonomous-notify.sh`'s header states for the delivery side ("NO VALUE IS EVER PRINTED, by
30
+ * this script or in a failure line — only paths and key names"). A push URL is a bearer
31
+ * credential for every endpoint worth pointing this at, and a terminal scrollback is not where
32
+ * it belongs.
33
+ * 3. **The precedence has exactly one definition on the TypeScript side**, {@link pushEnvCandidates},
34
+ * so a `doctor` check reporting which file is in effect reads that order rather than re-joining
35
+ * either path. Two derivations of a first-wins order is two answers to the one question anybody
36
+ * asks about these files, and the answers would differ exactly where it matters — on a machine
37
+ * that has both.
38
+ *
39
+ * Nothing here touches the filesystem: the generator plans, and `init` applies the plan once — so
40
+ * `--dry-run` writes no machine-local file for the same structural reason it writes nothing inside
41
+ * the repository.
42
+ */
43
+ import { join } from 'node:path';
44
+ import { CONFIG_FILENAME } from '../config/model.js';
45
+ import { machineConfigDir, MACHINE_DIR_MODE } from '../machine/paths.js';
46
+ /** The machine-local file's name, under {@link machineConfigDir}. `docs/watcher.md` §6 names it. */
47
+ export const PUSH_ENV_FILENAME = 'push.env';
48
+ /** The endpoint key. One of the two spellings the notifier recognises, and it recognises no others. */
49
+ export const PUSH_URL_KEY = 'HARNESS_PUSH_URL';
50
+ /** The local-command key, written empty here: a second delivery arm the operator may fill in later. */
51
+ export const PUSH_CMD_KEY = 'HARNESS_PUSH_CMD';
52
+ /** Mode of the written file: it holds a credential, so it is the owner's to read and nobody else's. */
53
+ const PUSH_ENV_MODE = 0o600;
54
+ /**
55
+ * The worked example in the guided setup — an endpoint that accepts a POST and needs no account.
56
+ *
57
+ * Exported so `init`'s prompt and this generator's guided note quote **one** example: two would be
58
+ * two answers to "what does a URL that works look like", and the prompt is where the question is
59
+ * first asked while the note is where an unanswered one is explained.
60
+ */
61
+ export const GUIDED_ENDPOINT_EXAMPLE = 'https://ntfy.sh/<your-topic>';
62
+ /** The machine-local push-notification settings file — the first file the notifier reads. */
63
+ export function machinePushEnvPath() {
64
+ return join(machineConfigDir(), PUSH_ENV_FILENAME);
65
+ }
66
+ /**
67
+ * The candidate settings files **in precedence order**: machine-local first, the repository's
68
+ * configured `pushEnvPath` second when there is one. The first that exists wins and the other is not
69
+ * read (`docs/watcher.md` §6, and `autonomous-notify.sh`'s header, which implement the same order
70
+ * once each on the shell side).
71
+ *
72
+ * The list is one long on a config with no `pushEnvPath`, for the reason
73
+ * {@link repositoryPushEnvPath} records: the shell half prints no repository candidate there either,
74
+ * so a caller walking this list names only files the notifier would actually open.
75
+ *
76
+ * Exported so a caller answering "which of these is in effect" — `doctor`'s standing check for
77
+ * these settings is the one this release plans — takes the order from here rather than from a
78
+ * second derivation of its own.
79
+ */
80
+ export function pushEnvCandidates(repoRoot, config) {
81
+ const repository = repositoryPushEnvPath(repoRoot, config);
82
+ return [
83
+ { path: machinePushEnvPath(), origin: 'machine' },
84
+ ...(repository === undefined ? [] : [{ path: repository, origin: 'repository' }]),
85
+ ];
86
+ }
87
+ /**
88
+ * The repository-side candidate on its own — the configured `pushEnvPath`, or `undefined` when the
89
+ * key is absent.
90
+ *
91
+ * **Absent is not the schema seed.** `pushEnvPath` has no schema default, and the shell half
92
+ * (`hr_push_env_files`, via `hr_push_env_path`'s empty fallback) prints no repository candidate at
93
+ * all when the key is empty — so seeding `.claude/push-notify.env` here would make a caller name a
94
+ * file the notifier never opens, which is the one way two derivations of a first-wins order could
95
+ * still differ. `init` writes the key into every config it generates, so the only way here is a
96
+ * config it was deleted from by hand.
97
+ *
98
+ * Private, and the one expression {@link pushEnvCandidates} and every note below share: the notes
99
+ * name this file because it is the one the machine-local file wins over, and a second join here
100
+ * would let the sentence and the precedence name different files.
101
+ */
102
+ function repositoryPushEnvPath(repoRoot, config) {
103
+ return config.pushEnvPath === undefined ? undefined : join(repoRoot, config.pushEnvPath);
104
+ }
105
+ /**
106
+ * The file's text: a header saying what it is and where its semantics are documented, then the two
107
+ * keys.
108
+ *
109
+ * It deliberately does **not** reuse `cli/templates/claude/push-notify.env.example`, whose header
110
+ * instructs the reader to copy it to the repository's `pushEnvPath` — the opposite of what this
111
+ * copy is. Nor does it restate what either key does: that is `autonomous-notify.sh`'s header, which
112
+ * is the one implementation of the delivery arms, and a second account of it here would be the copy
113
+ * that goes stale.
114
+ */
115
+ function pushEnvContent(url) {
116
+ return [
117
+ '# Push notifications for unattended runs — machine-local, written by',
118
+ '# `npx autonomous-sdlc-harness init --notifications`.',
119
+ '#',
120
+ '# This is the machine-local half of the pair `docs/watcher.md` §6 describes: it is read before',
121
+ "# any repository's configured `pushEnvPath`, and while it exists that one is not read at all.",
122
+ '# What each key means, what the two delivery arms do with it, and how a value already in the',
123
+ "# environment interacts with this file are `autonomous-notify.sh`'s header and that section;",
124
+ '# none of it is restated here.',
125
+ '#',
126
+ '# It holds a credential: it is created 0600 inside a 0700 directory, it is outside every',
127
+ '# repository so it cannot be committed by accident, and no command in this CLI prints a value',
128
+ '# from it back. Edit it freely — `init` creates it once and a later run leaves it as you left it.',
129
+ '',
130
+ `${PUSH_URL_KEY}=${url}`,
131
+ `${PUSH_CMD_KEY}=`,
132
+ '',
133
+ ].join('\n');
134
+ }
135
+ /**
136
+ * Enqueue the machine-local settings file, or explain why nothing was written.
137
+ *
138
+ * Three outcomes, and the middle one is the one to read first:
139
+ *
140
+ * - **opt-in not taken** — nothing is enqueued and a note records that delivery stays opt-in and
141
+ * defaults to nothing pushed, which is what every release before this one did;
142
+ * - **opt-in taken with no endpoint** — nothing is enqueued, and the note carries the guided setup:
143
+ * the path, the two key names and a worked example. Writing an empty file here would shadow a
144
+ * repository-side file that already has values (choice 1 in the module header);
145
+ * - **opt-in taken with an endpoint** — the directory at `0700` and the file at `0600`, both
146
+ * `allowOutsideRepo`, the file `create-if-absent` so a re-run leaves an edited one alone.
147
+ */
148
+ export function writeNotifications({ repoRoot, config, plan, enabled, pushUrl, }) {
149
+ const notes = [];
150
+ const warnings = [];
151
+ const target = machinePushEnvPath();
152
+ const repository = repositoryPushEnvPath(repoRoot, config);
153
+ // How the notes below name the repository-side half: its path when the config configures one, and
154
+ // what its absence means when it does not. Interpolating the value straight would print
155
+ // `undefined` in the middle of the sentence explaining where these settings live — and the two
156
+ // shapes differ by more than a path, because with the key unset there is nothing to fill in and
157
+ // the remedy is to configure it first.
158
+ const repositoryName = repository ?? 'any repository-side file (this repository configures none — `pushEnvPath` is unset)';
159
+ const repositoryRemedy = repository === undefined
160
+ ? `set \`pushEnvPath\` in ${CONFIG_FILENAME} and fill the file it names`
161
+ : `fill ${repository} in this repository`;
162
+ if (!enabled) {
163
+ if (pushUrl !== undefined) {
164
+ warnings.push('--push-url was given without --notifications, so it was not written anywhere: the endpoint is only ever written into the machine-local push-notification settings file, and that file is written only when the opt-in is taken — re-run with --notifications to take it and set the endpoint in the same run');
165
+ }
166
+ notes.push(`no push-notification settings were written and none were changed: delivery is opt-in and defaults to nothing pushed, so an unattended run's completed, parked and failed events reach a desktop banner where one is available and nothing else. Re-run with --notifications --push-url <url> to write ${target}, or ${repositoryRemedy} — the machine-local file is read first and the repository one only when it is absent (docs/watcher.md §6)`);
167
+ return { written: false, notes, warnings };
168
+ }
169
+ if (pushUrl === undefined) {
170
+ notes.push(`push notifications were asked for and no endpoint was given, so nothing was written — deliberately: the machine-local file is read before ${repositoryName} and while it exists that one is not read at all, so an empty ${target} would shadow values you may already have there and turn this opt-in into a silent opt-out. Re-run with --push-url <url>, naming any endpoint that accepts a POST (${GUIDED_ENDPOINT_EXAMPLE} is the worked example: choose a topic name nobody would guess, subscribe to it in an ntfy client, and that URL is the endpoint), or write ${target} yourself with ${PUSH_URL_KEY} set and ${PUSH_CMD_KEY} empty`);
171
+ return { written: false, notes, warnings };
172
+ }
173
+ plan.add({
174
+ path: machineConfigDir(),
175
+ policy: 'ensure-dir',
176
+ label: 'machine-local harness configuration directory',
177
+ mode: MACHINE_DIR_MODE,
178
+ allowOutsideRepo: true,
179
+ });
180
+ plan.add({
181
+ path: target,
182
+ policy: 'create-if-absent',
183
+ content: pushEnvContent(pushUrl),
184
+ label: 'machine-local push-notification settings',
185
+ mode: PUSH_ENV_MODE,
186
+ allowOutsideRepo: true,
187
+ });
188
+ notes.push(`${target} is the machine-local push-notification settings file, written to hold ${PUSH_URL_KEY} and an empty ${PUSH_CMD_KEY} — the endpoint itself is deliberately not printed here or anywhere else. It is machine-local rather than committed, and it is read before ${repositoryName}, which is then not read at all. It is create-if-absent: a file already there is kept exactly as you edited it and still carries the endpoint it was written with, so --push-url on a re-run sets nothing — to point it elsewhere, edit ${PUSH_URL_KEY} in it by hand, or re-run with --force, which copies it to a .bak sibling and re-writes it from this run's --push-url`);
189
+ return { written: true, notes, warnings };
190
+ }
191
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version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,CACR,ySAAyS,MAAM,QAAQ,gBAAgB,4GAA4G,CACpb,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC7C,CAAC;IAED,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CACR,6IAA6I,cAAc,iEAAiE,MAAM,sKAAsK,uBAAuB,8IAA8I,MAAM,kBAAkB,YAAY,YAAY,YAAY,QAAQ,CAClnB,CAAC;QACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAC7C,CAAC;IAED,IAAI,CAAC,GAAG,CAAC;QACP,IAAI,EAAE,gBAAgB,EAAE;QACxB,MAAM,EAAE,YAAY;QACpB,KAAK,EAAE,+CAA+C;QACtD,IAAI,EAAE,gBAAgB;QACtB,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC;QACP,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,kBAAkB;QAC1B,OAAO,EAAE,cAAc,CAAC,OAAO,CAAC;QAChC,KAAK,EAAE,0CAA0C;QACjD,IAAI,EAAE,aAAa;QACnB,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;IAEH,KAAK,CAAC,IAAI,CACR,GAAG,MAAM,0EAA0E,YAAY,iBAAiB,YAAY,8IAA8I,cAAc,2OAA2O,YAAY,uHAAuH,CACvoB,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Generator: the outer-loop scripts — the run watcher, the git wrappers, the worktree tooling and
3
+ * the shared library they all source — written into the adopter's configured `scriptsDir`.
4
+ *
5
+ * **The rule this module exists to enforce: {@link OUTER_LOOP_SCRIPTS} is the single declaration of
6
+ * which outer-loop files ship, where each one lands, what mode it carries and which of them an
7
+ * agent may be allowed to run.** A file is added to the set by adding its template and its row and
8
+ * nothing else: the template path, the write, the invocation string and the permission profile's
9
+ * decision are all derived from the row. A `.sh` name spelled as a string literal anywhere else in
10
+ * the CLI is a second source for this table and will drift from it.
11
+ *
12
+ * ## Three non-obvious choices, and where each comes from
13
+ *
14
+ * 1. **These templates carry no `{{token}}` and are copied verbatim.** The wrapper generator
15
+ * renders tokens because a wrapper's body is a *detected* value; nothing here is. Every one of
16
+ * these scripts reads `<repo_root>/harness.config.json` at run time through the one shared
17
+ * library the `lib` row below writes beside them, because a guard whose protected-branch set was
18
+ * frozen into a file when `init` ran enforces the wrong set the moment `protectedBranches` changes —
19
+ * and that failure is silent. Verbatim copies are also what makes the `create-if-absent` re-run
20
+ * contract trivial here: there is no generated content for a second run to disagree about.
21
+ * 2. **The set is written whatever the repository looks like — there is no selection rule.** The
22
+ * wrapper set has one (`selectWrapper`) because a wrapper exists only for a command that
23
+ * resolved. These scripts are the flow's own machinery rather than a view of the adopter's
24
+ * commands, so every row is written on every run, and the only question a consumer asks about a
25
+ * row is {@link OuterLoopScript.agentInvocable}.
26
+ * 3. **The invocation string comes from `scriptInvocation`, in `generators/scripts.ts`.** That is
27
+ * the single producer of `bash <scriptsDir>/<file>`, and the permission profile derives its
28
+ * three allow forms from that exact string. Formatting the same shape here would be a second
29
+ * producer, and the two would disagree the first time either is corrected.
30
+ *
31
+ * ## Scope this release
32
+ *
33
+ * This module is the **writer**. The set below grows one row at a time as each script's template
34
+ * lands, and the ordering rule is the one stated on {@link OUTER_LOOP_SCRIPTS}: a row arrives in
35
+ * the same change as its template, never before it, so a generated permission profile can never
36
+ * allow-list a file that was never written.
37
+ */
38
+ import { join } from 'node:path';
39
+ import { DEFAULTS } from '../config/model.js';
40
+ import { readTemplate } from '../core/paths.js';
41
+ import { normalizeRepoDir } from '../core/repoPaths.js';
42
+ import { scriptInvocation } from './scripts.js';
43
+ /**
44
+ * The run watcher's file name, named on its own because a second consumer needs it: `daemon/backend.ts`
45
+ * resolves the script the daemon runs as `<repoRoot>/<scriptsDir>/<this>`, and the daemon and the
46
+ * writer disagreeing about the name would install a unit whose program was never written.
47
+ *
48
+ * It is still one declaration — the row below is built from it — so the file is renamed here and
49
+ * nowhere else.
50
+ */
51
+ export const WATCHER_SCRIPT_NAME = 'autonomous-watcher.sh';
52
+ /**
53
+ * The notifier's file name, named on its own for the same reason {@link WATCHER_SCRIPT_NAME} is:
54
+ * `doctor --test-notification` runs this file, so the command and the writer would otherwise be two
55
+ * spellings of one name — the second source this module's header refuses.
56
+ *
57
+ * The row below is built from it, so the file is renamed here and nowhere else.
58
+ */
59
+ export const NOTIFY_SCRIPT_NAME = 'autonomous-notify.sh';
60
+ /**
61
+ * The whole outer-loop set, in the order `init` writes it: the shared library first, because every
62
+ * other row sources it.
63
+ *
64
+ * **Declared once, here.** One row is one line, and adding a script is adding its template plus its
65
+ * row — no condition threaded through the writer, no second list to keep in step.
66
+ */
67
+ export const OUTER_LOOP_SCRIPTS = Object.freeze([
68
+ Object.freeze({ file: 'harness-run-lib.sh', subdir: 'lib', mode: 0o644, agentInvocable: false }),
69
+ Object.freeze({ file: 'commit-on-branch.sh', mode: 0o755, agentInvocable: true }),
70
+ Object.freeze({ file: 'push-branch.sh', mode: 0o755, agentInvocable: true }),
71
+ Object.freeze({ file: 'refresh-branch.sh', mode: 0o755, agentInvocable: true }),
72
+ // The one row that executes an ARGUMENT, so its safety is in the script rather than in this flag:
73
+ // it runs a file only from `<state_dir>/scratch/` and refuses every other path. It carries NO
74
+ // `DENY_SCRIPT_BASENAMES` entry in the script-allowlist guard, and that omission is the decision —
75
+ // the guard route is what makes the runner reachable on an adoption whose profile has not been
76
+ // regenerated, which is the whole point of shipping it as a script rather than as an interpreter
77
+ // allow entry.
78
+ Object.freeze({ file: 'scratch-run.sh', mode: 0o755, agentInvocable: true }),
79
+ Object.freeze({ file: 'create-worktree.sh', mode: 0o755, agentInvocable: false }),
80
+ Object.freeze({ file: 'setup-worktree.sh', mode: 0o755, agentInvocable: false }),
81
+ Object.freeze({ file: 'cleanup-merged-worktrees.sh', mode: 0o755, agentInvocable: false }),
82
+ Object.freeze({ file: 'autonomous-format-stream.sh', mode: 0o755, agentInvocable: false }),
83
+ Object.freeze({ file: NOTIFY_SCRIPT_NAME, mode: 0o755, agentInvocable: false }),
84
+ Object.freeze({ file: WATCHER_SCRIPT_NAME, mode: 0o755, agentInvocable: false }),
85
+ Object.freeze({ file: 'restart-watcher.sh', mode: 0o755, agentInvocable: false }),
86
+ ]);
87
+ /** The templates' subdirectory under `cli/templates/`, addressed as {@link readTemplate} wants it. */
88
+ const TEMPLATE_DIR = 'scripts';
89
+ /**
90
+ * A row's path relative to `scriptsDir`, which is also its path under `cli/templates/scripts/`.
91
+ *
92
+ * Exported because the permission profile needs the same answer: its repo-root-absolute and
93
+ * sibling-worktree forms are that path joined to a root, and a row in a subdirectory is the case
94
+ * where re-deriving it from `file` alone would name a file that is not there.
95
+ */
96
+ export function outerLoopRelativePath(script) {
97
+ return script.subdir === undefined ? script.file : `${script.subdir}/${script.file}`;
98
+ }
99
+ /**
100
+ * The directory these scripts are written into: the configured `scriptsDir`, normalized, or the
101
+ * schema's default for an unset key.
102
+ *
103
+ * The one expression for it, because a reader that wanted the same answer would otherwise spell it
104
+ * again — and a resolver disagreeing with the writer by a trailing slash or by a default names a
105
+ * file that was never written there.
106
+ */
107
+ export function outerLoopScriptsDir(config) {
108
+ return normalizeRepoDir(config.scriptsDir ?? DEFAULTS.scriptsDir);
109
+ }
110
+ /**
111
+ * Where one of these scripts lands in a wired repository — `<repoRoot>/<scriptsDir>/<relativePath>`.
112
+ *
113
+ * `relativePath` is {@link outerLoopRelativePath}'s answer for the row, which for every row outside
114
+ * `lib/` is the file name itself. Both readers of a written script — `daemon/backend.ts` for the
115
+ * watcher the daemon runs, and `doctor` for the notifier `--test-notification` invokes — resolve it
116
+ * through this function rather than joining the three parts again, so no reader can look for a
117
+ * script somewhere the writer would not have put it.
118
+ */
119
+ export function outerLoopScriptPath(repoRoot, config, relativePath) {
120
+ return join(repoRoot, outerLoopScriptsDir(config), ...relativePath.split('/'));
121
+ }
122
+ /**
123
+ * Enqueue the outer-loop scripts for the configured `scriptsDir`: `ensure-dir` on the directory and
124
+ * on every subdirectory a row asks for, then one `create-if-absent` write per row, its content read
125
+ * from the matching template and copied through unchanged.
126
+ *
127
+ * `create-if-absent` is the re-run contract for this artifact, and it means what it says: an adopter
128
+ * who edited a generated script keeps that edit byte-for-byte on the next `init`. `--force`
129
+ * overwrites, and only after the write engine has taken a `.bak` of what was there.
130
+ *
131
+ * Nothing here touches the filesystem: the generator plans, and `init` applies the plan once.
132
+ */
133
+ export function writeOuterLoopScripts({ repoRoot, config, plan }) {
134
+ const scriptsDir = outerLoopScriptsDir(config);
135
+ const written = [];
136
+ const ensured = new Set();
137
+ plan.add({ path: join(repoRoot, scriptsDir), policy: 'ensure-dir', label: 'outer-loop scripts directory' });
138
+ for (const script of OUTER_LOOP_SCRIPTS) {
139
+ const { subdir } = script;
140
+ if (subdir !== undefined && !ensured.has(subdir)) {
141
+ ensured.add(subdir);
142
+ plan.add({
143
+ path: join(repoRoot, scriptsDir, subdir),
144
+ policy: 'ensure-dir',
145
+ label: `outer-loop scripts directory ${subdir}`,
146
+ });
147
+ }
148
+ const relative = outerLoopRelativePath(script);
149
+ plan.add({
150
+ path: join(repoRoot, scriptsDir, ...relative.split('/')),
151
+ policy: 'create-if-absent',
152
+ content: readTemplate(`${TEMPLATE_DIR}/${relative}`),
153
+ label: `outer-loop script ${relative}`,
154
+ mode: script.mode,
155
+ });
156
+ written.push({ ...script, invocation: scriptInvocation(scriptsDir, relative) });
157
+ }
158
+ const notes = written.length === 0
159
+ ? []
160
+ : [
161
+ `${written.length} outer-loop ${written.length === 1 ? 'script was' : 'scripts were'} written into ${scriptsDir}/: they are copied verbatim rather than generated, because each one reads harness.config.json at run time instead of carrying values frozen in when init ran — so a re-run leaves an edited copy exactly as it is, and --force regenerates it after copying the current file to <name>.bak`,
162
+ ];
163
+ return { scriptsDir, written, notes };
164
+ }
165
+ //# sourceMappingURL=outerLoopScripts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outerLoopScripts.js","sourceRoot":"","sources":["../../src/generators/outerLoopScripts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAsB,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AA8ChD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAEzD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAmC,MAAM,CAAC,MAAM,CAAC;IAC9E,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC;IAChG,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IACjF,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IAC5E,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;IAC/E,kGAAkG;IACl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