@frankzhang2026/opencode-android-orchestrator 0.2.0 → 0.4.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 (62) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/README.md +85 -43
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/dist/cli.js +127 -10
  5. package/dist/cli.js.map +1 -1
  6. package/dist/doctor/installation.d.ts.map +1 -1
  7. package/dist/doctor/installation.js +29 -4
  8. package/dist/doctor/installation.js.map +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/index.js.map +1 -1
  13. package/dist/installer/adaptive-templates.d.ts +25 -3
  14. package/dist/installer/adaptive-templates.d.ts.map +1 -1
  15. package/dist/installer/adaptive-templates.js +75 -9
  16. package/dist/installer/adaptive-templates.js.map +1 -1
  17. package/dist/installer/index.d.ts +2 -2
  18. package/dist/installer/index.d.ts.map +1 -1
  19. package/dist/installer/index.js +2 -2
  20. package/dist/installer/index.js.map +1 -1
  21. package/dist/installer/init.d.ts +2 -1
  22. package/dist/installer/init.d.ts.map +1 -1
  23. package/dist/installer/init.js +11 -2
  24. package/dist/installer/init.js.map +1 -1
  25. package/dist/installer/opencode-config.d.ts +4 -3
  26. package/dist/installer/opencode-config.d.ts.map +1 -1
  27. package/dist/installer/opencode-config.js +10 -4
  28. package/dist/installer/opencode-config.js.map +1 -1
  29. package/dist/installer/upgrade.d.ts +5 -0
  30. package/dist/installer/upgrade.d.ts.map +1 -1
  31. package/dist/installer/upgrade.js +44 -10
  32. package/dist/installer/upgrade.js.map +1 -1
  33. package/docs/MIGRATION.md +25 -14
  34. package/docs/SECURITY.md +29 -5
  35. package/docs/TROUBLESHOOTING.md +25 -6
  36. package/package.json +1 -1
  37. package/templates/.opencode/agents/scheduled-coder.md +3 -0
  38. package/templates/.opencode/agents/scheduled-reviewer.md +5 -4
  39. package/templates/.opencode/skills/scheduled-quality-coder/SKILL.md +10 -6
  40. package/templates/.opencode/skills/scheduled-quality-reviewer/SKILL.md +7 -4
  41. package/templates/AGENTS.md.fragment +4 -0
  42. package/templates/README.md +5 -2
  43. package/templates/automation/config.json +18 -0
  44. package/templates/automation/config.schema.json +31 -0
  45. package/templates/automation/task-contract.schema.json +22 -1
  46. package/templates/automation/tasks/TASK-TEMPLATE.json.example +5 -1
  47. package/templates/scripts/automation/abort-task.sh +5 -10
  48. package/templates/scripts/automation/accept-and-integrate.sh +1 -1
  49. package/templates/scripts/automation/acceptance-report.sh +2 -9
  50. package/templates/scripts/automation/approve-and-run.sh +3 -0
  51. package/templates/scripts/automation/claim-task.sh +6 -6
  52. package/templates/scripts/automation/lib.sh +403 -8
  53. package/templates/scripts/automation/orchestrate-task.sh +1 -1
  54. package/templates/scripts/automation/preflight.sh +1 -1
  55. package/templates/scripts/automation/record-red.sh +7 -9
  56. package/templates/scripts/automation/scope-gate.sh +12 -9
  57. package/templates/scripts/automation/show-acceptance-review.sh +1 -1
  58. package/templates/scripts/automation/status.sh +4 -0
  59. package/templates/scripts/automation/tests/run-tests.sh +164 -9
  60. package/templates/scripts/automation/validate-contract.sh +16 -5
  61. package/templates/scripts/automation/verify-integration.sh +12 -11
  62. package/templates/scripts/automation/verify-task.sh +13 -28
package/CHANGELOG.md CHANGED
@@ -1,6 +1,35 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.0 - Unreleased
3
+ ## 0.4.0 - 2026-08-29
4
+
5
+ - Add the human-maintained `.automation-worktree-allowlist` for exact local
6
+ file paths that must not block orchestration. Approved tasks snapshot the
7
+ validated list and exclude those changes consistently from scope, hashes,
8
+ evidence, archival, and deterministic commits, including when the local
9
+ entries were already staged.
10
+ - Reject patterns, directories, duplicates, unsafe paths, symlinks, oversized
11
+ control files, and protected orchestration, Gradle, Git, or planning paths;
12
+ treat renames as separate source and destination paths; expand the audited
13
+ Shell transaction suite from 38 to 42 cases.
14
+
15
+ ## 0.3.0 - 2026-08-28
16
+
17
+ - Add `all` and `primary` module scopes and make all-module task contracts the
18
+ default for new installations. Multi-application projects no longer require
19
+ a primary selection; upgrades from configurations without the scope field
20
+ remain in `primary` mode unless explicitly widened.
21
+ - Add configurable Gradle verification task matrices to `init` and `upgrade`,
22
+ and bind focused-test contract entries to both an allowed Gradle task and a
23
+ test filter.
24
+ - Harden task-contract validation, source-scope enforcement, RED evidence,
25
+ verification output, and integration checks while preserving protected
26
+ Gradle and orchestration files.
27
+ - Retry OpenCode configuration discovery only for its known transient SQLite
28
+ checkpoint failure.
29
+ - Expand multi-module, lifecycle, CLI, schema, migration, and compatibility
30
+ coverage to 124 Node tests and the audited 38-case Shell suite.
31
+
32
+ ## 0.2.0 - 2026-08-26
4
33
 
5
34
  - Add the complete MIT license, packaged third-party notices, public repository
6
35
  metadata, draft release notes, and a fail-closed `0.2.0` authorization record.
package/README.md CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Reusable OpenCode orchestration for macOS Android projects.
4
4
 
5
- > **Release warning:** `0.2.0` is still an unpublished development version.
6
- > Do not run the `npx` examples against a production repository until the
7
- > release and two-version acceptance gates are complete. Published `0.1.0` is
8
- > an early scaffold without a working installer.
5
+ Version `0.2.0` is the first published lifecycle release. Version `0.3.0` adds
6
+ default all-module orchestration and stronger verification contracts. Version
7
+ `0.4.0` adds a validated, exact-path worktree allowlist for intentional local
8
+ changes while retaining the same certified OpenCode compatibility range.
9
9
 
10
10
  ## Documentation
11
11
 
@@ -33,22 +33,59 @@ Run lifecycle commands from the project root or a directory below it. Use a
33
33
  clean branch and preserve an independent backup before the first installation,
34
34
  even though the installer maintains its own verified recovery data.
35
35
 
36
- ## Quick start after release
36
+ ## Quick start
37
37
 
38
38
  ```sh
39
- npx @frankzhang2026/opencode-android-orchestrator@0.2.0 init .
40
- npx @frankzhang2026/opencode-android-orchestrator@0.2.0 doctor .
39
+ npx @frankzhang2026/opencode-android-orchestrator@0.4.0 init .
40
+ npx @frankzhang2026/opencode-android-orchestrator@0.4.0 doctor .
41
41
  opencode --agent scheduled-planner .
42
42
  ```
43
43
 
44
- If more than one Android application module is detected, select the intended
45
- primary module explicitly:
44
+ New installations use all-module scope by default. Every detected Android
45
+ module's `src/main`, `src/test`, and `src/androidTest` trees can be included in
46
+ a task contract without selecting a primary module. To intentionally restrict
47
+ generated contracts to one module, opt into primary-module scope:
46
48
 
47
49
  ```sh
48
- npx @frankzhang2026/opencode-android-orchestrator@0.2.0 init . \
50
+ npx @frankzhang2026/opencode-android-orchestrator@0.4.0 init . \
51
+ --module-scope primary \
49
52
  --primary-module :mobile
50
53
  ```
51
54
 
55
+ In all-module scope, `--primary-module` is optional and only chooses the
56
+ default module used by the focused-test placeholder; it does not narrow which
57
+ detected modules may be modified.
58
+
59
+ ### Allow intentional local worktree changes
60
+
61
+ If one or more files must stay locally modified while orchestration runs,
62
+ create `.automation-worktree-allowlist` in the Git repository root and edit it
63
+ as a normal text file:
64
+
65
+ ```text
66
+ # One exact repository-relative file path per line
67
+ local/operator-note.txt
68
+ config/developer-overrides.json
69
+ ```
70
+
71
+ Blank lines and lines beginning with `#` are ignored. Entries must be exact
72
+ file paths; directory entries and glob patterns are rejected. The control file
73
+ itself is automatically ignored by orchestration, so it does not need a
74
+ `.gitignore` rule merely to pass preflight.
75
+
76
+ Allowlisted tracked, untracked, and staged changes do not block startup and are
77
+ excluded from task scope, diff hashes, acceptance/abort evidence, and
78
+ deterministic commits. Existing staged entries remain staged instead of being
79
+ consumed by task or recovery commits. A rename has two paths, so both the old
80
+ and new exact path must be listed if the whole rename should remain local.
81
+ Protected orchestration, Gradle, Git, and planning paths cannot be allowlisted.
82
+ Use this only for files that the task must not modify; remove an entry before
83
+ starting a task that should change that file. The list is snapshotted at
84
+ contract approval, so edits made during a running task apply to the next task.
85
+ Task status exposes the effective snapshot to Coder and Reviewer sessions; an
86
+ isolated task worktree receives an empty effective list so task-local edits are
87
+ never hidden by source-worktree exclusions.
88
+
52
89
  The install transaction manages 45 project-local paths:
53
90
 
54
91
  | Resource group | Count | Installation behavior |
@@ -67,9 +104,10 @@ does not register Scheduler or launchd jobs.
67
104
 
68
105
  ## Status
69
106
 
70
- Version `0.1.0` was published as an early scaffold and does not provide a
71
- working installer. Development now targets `0.2.0`; it must not be published
72
- until the installer lifecycle and release gates are complete.
107
+ Version `0.1.0` was an early scaffold without a working installer. Version
108
+ `0.2.0` introduced the complete managed lifecycle, `0.3.0` added all-module
109
+ defaults and stronger verification contracts, and `0.4.0` adds the bounded
110
+ worktree allowlist described above.
73
111
 
74
112
  The cross-version plugin entry, OpenCode version doctor, Android/Gradle project
75
113
  discovery, audited V3 resources, and all deterministic V3 Shell transactions
@@ -86,8 +124,7 @@ only unchanged managed resources, carries original pre-install backups
86
124
  forward, and restores the complete previous installation if verification
87
125
  fails. The `uninstall` command now restores unchanged original files, removes
88
126
  unchanged plugin-created files, and retains any content, permission, or
89
- deletion drift for manual review. Version `0.2.0` is still local-only and has
90
- not passed the release gates.
127
+ deletion drift for manual review.
91
128
 
92
129
  Implemented checks include:
93
130
 
@@ -106,9 +143,10 @@ Implemented checks include:
106
143
  gates consume detected source-set paths instead of a fixed module name
107
144
  - a portable automation configuration source, both Schemas, contract example,
108
145
  plan guide, and bounded AGENTS managed block
109
- - adaptive configuration for every detected Android module, an unambiguous or
110
- explicitly selected primary module, exact protected build files, production
111
- and test source sets, and a namespace-aware focused-test placeholder
146
+ - adaptive configuration for every detected Android module, default
147
+ all-module task paths, opt-in primary-module restriction, exact protected
148
+ build files, production/test source sets, and a namespace-aware focused-test
149
+ placeholder
112
150
  - removal of the legacy Scheduler dependency and all local absolute paths from
113
151
  shipped templates
114
152
  - read-only `opencode.json`/`opencode.jsonc` merge planning that preserves
@@ -128,7 +166,7 @@ Implemented checks include:
128
166
  - a write-capable `init` transaction that installs 45 managed files, preserves
129
167
  Shell executable modes, merges OpenCode JSON/JSONC and one bounded AGENTS
130
168
  block, and is byte-idempotent for an unchanged installed version
131
- - write-before-complete verification using the 38-case automation suite and a
169
+ - write-before-complete verification using the 42-case automation suite and a
132
170
  read-only shadow run; any failure restores original files before reporting
133
171
  the error
134
172
  - an installation-aware, read-only doctor that authenticates the 45-file
@@ -146,9 +184,10 @@ Implemented checks include:
146
184
  evidence, and automatically restores the installed state on pre-commit
147
185
  failure
148
186
 
149
- The planners deliberately avoid filesystem writes. The adaptive planner also
150
- blocks ambiguous primary modules, paths outside the Git root, and nested Gradle
151
- roots that the current root-relative transaction scripts cannot safely run.
187
+ The planners deliberately avoid filesystem writes. The adaptive planner blocks
188
+ ambiguous primary-module selections only in `primary` scope, as well as paths
189
+ outside the Git root and nested Gradle roots that the current root-relative
190
+ transaction scripts cannot safely run.
152
191
  The transaction layer writes only installer control state and recovery
153
192
  evidence until `init`, `upgrade`, or `uninstall` explicitly applies a validated
154
193
  plan.
@@ -161,7 +200,8 @@ import {
161
200
  } from "@frankzhang2026/opencode-android-orchestrator";
162
201
 
163
202
  const plan = planAdaptiveProjectTemplates("/path/to/android-project", {
164
- primaryModule: ":mobile", // optional when exactly one application is found
203
+ moduleScope: "all", // optional; this is the default
204
+ primaryModule: ":mobile", // optional focused-test default in all mode
165
205
  });
166
206
 
167
207
  console.log(plan.automationConfigContent);
@@ -204,14 +244,18 @@ preparation alone as resource installation;
204
244
  ## Init
205
245
 
206
246
  ```sh
207
- npx @frankzhang2026/opencode-android-orchestrator@0.2.0 init .
247
+ npx @frankzhang2026/opencode-android-orchestrator@0.4.0 init .
208
248
  opencode --agent scheduled-planner .
209
249
  ```
210
250
 
211
- For a multi-application project, select the primary module explicitly:
251
+ All detected modules are enabled by default, including multi-application
252
+ projects. Use the restrictive mode only when a task contract must stay within
253
+ one module:
212
254
 
213
255
  ```sh
214
- opencode-android-orchestrator init . --primary-module :mobile
256
+ opencode-android-orchestrator init . \
257
+ --module-scope primary \
258
+ --primary-module :mobile
215
259
  ```
216
260
 
217
261
  Before writing, `init` requires a compatible OpenCode version, a Git-backed
@@ -223,16 +267,15 @@ Android Gradle project, an executable Gradle Wrapper, `git`, `jq`, `rg`,
223
267
  2. rejects all unresolved content or mode conflicts;
224
268
  3. backs up every existing managed path and publishes a `prepared` manifest;
225
269
  4. writes missing or approved merged files with verified hashes and modes;
226
- 5. runs the 38 automation tests and `shadow-run.sh`;
270
+ 5. runs the 42 automation tests and `shadow-run.sh`;
227
271
  6. marks the manifest `installed` only after both checks pass.
228
272
 
229
273
  Verification failure automatically restores originals and records rollback
230
274
  history; recovery backups remain below `.automation-plugin/backups/`. Repeating
231
275
  `init` on an unchanged, healthy installation performs no managed-file writes.
232
276
 
233
- Version `0.2.0` has not been published, so the `npx` example is the intended
234
- post-release command rather than an instruction to publish or switch a live
235
- project now.
277
+ Pin the exact package version in long-lived repositories and review the
278
+ generated installation diff before starting the scheduled planner.
236
279
 
237
280
  ## Doctor
238
281
 
@@ -287,7 +330,8 @@ preflight verifies both resolved permissions and tool discovery.
287
330
 
288
331
  ### Phase 2 mutating-tool decision
289
332
 
290
- The 2026-08-25 evaluation is **NO-GO for mutating custom tools in `0.2.0`**.
333
+ The 2026-08-25 evaluation remains **NO-GO for mutating custom tools in
334
+ `0.4.0`**.
291
335
  The fixed Shell allowlist remains the only entry point for state transitions,
292
336
  Git mutations, and agent launches. OpenCode custom tools provide typed arguments
293
337
  and workspace context, but a normal permission prompt is not the workflow's
@@ -314,7 +358,7 @@ the immediately preceding `question` result and bind at least the approval
314
358
  kind, task ID, session, message, relevant sealed SHA/branch, timestamp, and
315
359
  nonce. It must also retain fixed-script authentication, strict state
316
360
  preconditions, project/worktree bounds, abort propagation that terminates child
317
- processes, bounded structured output, exact per-agent permissions, the 38-case
361
+ processes, bounded structured output, exact per-agent permissions, the 42-case
318
362
  transaction suite, and real `1.14.22`/`1.15.13` integration tests. Internal
319
363
  Coder/Reviewer transition scripts remain private orchestration details rather
320
364
  than public tools.
@@ -323,14 +367,19 @@ than public tools.
323
367
 
324
368
  ```sh
325
369
  opencode-android-orchestrator upgrade /path/to/android-project
326
- opencode-android-orchestrator upgrade . --primary-module :mobile --json
370
+ opencode-android-orchestrator upgrade . --module-scope all --json
327
371
  ```
328
372
 
329
373
  `upgrade` accepts either the Git root or a directory below it. It first validates
330
374
  the installed manifest, every managed file, and every original-file backup. It
331
375
  refuses downgrades, user-modified managed resources, damaged backups, ambiguous
332
- Android modules, same-version resource rewrites, and an unfinished upgrade
333
- marker before creating recovery state.
376
+ Android modules in restrictive `primary` scope, same-version resource rewrites,
377
+ and an unfinished upgrade marker before creating recovery state.
378
+
379
+ Upgrade preserves the installed module scope. Installations created before the
380
+ scope field existed are interpreted as `primary` so an upgrade cannot silently
381
+ widen write access; pass `--module-scope all` during a real version upgrade to
382
+ opt in explicitly.
334
383
 
335
384
  For an older healthy installation, the command:
336
385
 
@@ -342,7 +391,7 @@ For an older healthy installation, the command:
342
391
  backup set;
343
392
  4. writes only changed managed resources and restores or removes resources no
344
393
  longer managed by the new version;
345
- 5. runs the 38 automation tests and a mutation-free shadow run before swapping
394
+ 5. runs the 42 automation tests and a mutation-free shadow run before swapping
346
395
  the active manifest;
347
396
  6. records upgrade history below `.automation-plugin/history/`.
348
397
 
@@ -352,9 +401,6 @@ the command again on the current, unchanged version is byte-idempotent: it
352
401
  rechecks prerequisites and post-install verification without creating upgrade
353
402
  history or recovery state.
354
403
 
355
- Version `0.2.0` has not been published. These commands document the intended
356
- post-release lifecycle and are not instructions to upgrade a live project yet.
357
-
358
404
  ## Uninstall
359
405
 
360
406
  ```sh
@@ -384,10 +430,6 @@ installation backups and uninstall evidence are intentionally retained for
384
430
  audit and manual recovery; user-created or pre-existing empty directories are
385
431
  never guessed at or recursively removed.
386
432
 
387
- Version `0.2.0` has not been published. This command documents the intended
388
- post-release lifecycle and is not an instruction to uninstall a live project
389
- through the unpublished package.
390
-
391
433
  ## Development
392
434
 
393
435
  The package root exports only the default OpenCode plugin factory because the
@@ -1,6 +1,6 @@
1
1
  # Third-Party Notices
2
2
 
3
- Last reviewed for `0.2.0` on 2026-08-26.
3
+ Last reviewed for `0.4.0` on 2026-08-29.
4
4
 
5
5
  The published package does not vendor `node_modules`, third-party binaries, or
6
6
  third-party Skill source. Its compiled JavaScript imports the direct runtime
package/dist/cli.js CHANGED
@@ -1,8 +1,11 @@
1
1
  #!/usr/bin/env node
2
+ import { readFileSync } from "node:fs";
3
+ import { resolve } from "node:path";
2
4
  import process from "node:process";
3
5
  import { INSTALLER_COMMANDS } from "./commands/index.js";
4
6
  import { formatDoctorReport, runDoctor } from "./doctor/index.js";
5
7
  import { formatProjectInitializationResult, runProjectInitialization, } from "./installer/init.js";
8
+ import { isModuleScope, } from "./installer/adaptive-templates.js";
6
9
  import { formatProjectUpgradeResult, runProjectUpgrade, } from "./installer/upgrade.js";
7
10
  import { formatProjectUninstallResult, runProjectUninstall, } from "./installer/uninstall.js";
8
11
  function printHelp() {
@@ -18,7 +21,8 @@ function printHelp() {
18
21
  function printInitHelp() {
19
22
  process.stdout.write(`OpenCode Android Orchestrator init\n\n`);
20
23
  process.stdout.write(`Usage:\n`);
21
- process.stdout.write(` opencode-android-orchestrator init [directory] [--primary-module <gradle-path>] [--json]\n`);
24
+ process.stdout.write(` opencode-android-orchestrator init [directory] [--module-scope <all|primary>] [--primary-module <gradle-path>] [--gradle-verification-config <json-path>] [--json]\n`);
25
+ process.stdout.write(`\nDefault module scope: all\n`);
22
26
  }
23
27
  function printDoctorHelp() {
24
28
  process.stdout.write(`OpenCode Android Orchestrator doctor\n\n`);
@@ -28,7 +32,8 @@ function printDoctorHelp() {
28
32
  function printUpgradeHelp() {
29
33
  process.stdout.write(`OpenCode Android Orchestrator upgrade\n\n`);
30
34
  process.stdout.write(`Usage:\n`);
31
- process.stdout.write(` opencode-android-orchestrator upgrade [directory] [--primary-module <gradle-path>] [--json]\n`);
35
+ process.stdout.write(` opencode-android-orchestrator upgrade [directory] [--module-scope <all|primary>] [--primary-module <gradle-path>] [--gradle-verification-config <json-path>] [--json]\n`);
36
+ process.stdout.write(`\nPreserves the installed module scope; legacy installations default to primary.\n`);
32
37
  }
33
38
  function printUninstallHelp() {
34
39
  process.stdout.write(`OpenCode Android Orchestrator uninstall\n\n`);
@@ -58,6 +63,16 @@ function printCommandError(error) {
58
63
  process.stderr.write(` ${detail}\n`);
59
64
  }
60
65
  }
66
+ function readGradleVerificationConfiguration(path) {
67
+ const absolutePath = resolve(path);
68
+ try {
69
+ return JSON.parse(readFileSync(absolutePath, "utf8"));
70
+ }
71
+ catch (error) {
72
+ const detail = error instanceof Error ? error.message : String(error);
73
+ throw new Error(`Unable to read Gradle verification configuration ${absolutePath}: ${detail}`);
74
+ }
75
+ }
61
76
  const [command, ...commandArguments] = process.argv.slice(2);
62
77
  if (command === undefined || command === "--help" || command === "-h") {
63
78
  printHelp();
@@ -69,7 +84,9 @@ else if (command === "init") {
69
84
  }
70
85
  else {
71
86
  let targetDirectory;
87
+ let moduleScope;
72
88
  let primaryModule;
89
+ let gradleVerificationConfigPath;
73
90
  let json = false;
74
91
  const unexpected = [];
75
92
  for (let index = 0; index < commandArguments.length; index += 1) {
@@ -77,6 +94,30 @@ else if (command === "init") {
77
94
  if (argument === "--json") {
78
95
  json = true;
79
96
  }
97
+ else if (argument === "--module-scope") {
98
+ const value = commandArguments[index + 1];
99
+ if (value === undefined || value.startsWith("-")) {
100
+ unexpected.push(argument);
101
+ }
102
+ else {
103
+ if (isModuleScope(value)) {
104
+ moduleScope = value;
105
+ }
106
+ else {
107
+ unexpected.push(`${argument} ${value}`);
108
+ }
109
+ index += 1;
110
+ }
111
+ }
112
+ else if (argument.startsWith("--module-scope=")) {
113
+ const value = argument.slice("--module-scope=".length);
114
+ if (isModuleScope(value)) {
115
+ moduleScope = value;
116
+ }
117
+ else {
118
+ unexpected.push(argument);
119
+ }
120
+ }
80
121
  else if (argument === "--primary-module") {
81
122
  const value = commandArguments[index + 1];
82
123
  if (value === undefined || value.startsWith("-")) {
@@ -96,6 +137,25 @@ else if (command === "init") {
96
137
  primaryModule = value;
97
138
  }
98
139
  }
140
+ else if (argument === "--gradle-verification-config") {
141
+ const value = commandArguments[index + 1];
142
+ if (value === undefined || value.startsWith("-")) {
143
+ unexpected.push(argument);
144
+ }
145
+ else {
146
+ gradleVerificationConfigPath = value;
147
+ index += 1;
148
+ }
149
+ }
150
+ else if (argument.startsWith("--gradle-verification-config=")) {
151
+ const value = argument.slice("--gradle-verification-config=".length);
152
+ if (value.length === 0) {
153
+ unexpected.push(argument);
154
+ }
155
+ else {
156
+ gradleVerificationConfigPath = value;
157
+ }
158
+ }
99
159
  else if (argument.startsWith("-")) {
100
160
  unexpected.push(argument);
101
161
  }
@@ -111,11 +171,17 @@ else if (command === "init") {
111
171
  process.exitCode = 2;
112
172
  }
113
173
  else {
114
- const options = {};
115
- if (primaryModule !== undefined) {
116
- options.primaryModule = primaryModule;
117
- }
118
174
  try {
175
+ const options = {};
176
+ if (moduleScope !== undefined) {
177
+ options.moduleScope = moduleScope;
178
+ }
179
+ if (primaryModule !== undefined) {
180
+ options.primaryModule = primaryModule;
181
+ }
182
+ if (gradleVerificationConfigPath !== undefined) {
183
+ options.gradleVerification = readGradleVerificationConfiguration(gradleVerificationConfigPath);
184
+ }
119
185
  const result = runProjectInitialization(targetDirectory ?? process.cwd(), options);
120
186
  process.stdout.write(json
121
187
  ? `${JSON.stringify(result, null, 2)}\n`
@@ -136,7 +202,9 @@ else if (command === "upgrade") {
136
202
  }
137
203
  else {
138
204
  let targetDirectory;
205
+ let moduleScope;
139
206
  let primaryModule;
207
+ let gradleVerificationConfigPath;
140
208
  let json = false;
141
209
  const unexpected = [];
142
210
  for (let index = 0; index < commandArguments.length; index += 1) {
@@ -144,6 +212,30 @@ else if (command === "upgrade") {
144
212
  if (argument === "--json") {
145
213
  json = true;
146
214
  }
215
+ else if (argument === "--module-scope") {
216
+ const value = commandArguments[index + 1];
217
+ if (value === undefined || value.startsWith("-")) {
218
+ unexpected.push(argument);
219
+ }
220
+ else {
221
+ if (isModuleScope(value)) {
222
+ moduleScope = value;
223
+ }
224
+ else {
225
+ unexpected.push(`${argument} ${value}`);
226
+ }
227
+ index += 1;
228
+ }
229
+ }
230
+ else if (argument.startsWith("--module-scope=")) {
231
+ const value = argument.slice("--module-scope=".length);
232
+ if (isModuleScope(value)) {
233
+ moduleScope = value;
234
+ }
235
+ else {
236
+ unexpected.push(argument);
237
+ }
238
+ }
147
239
  else if (argument === "--primary-module") {
148
240
  const value = commandArguments[index + 1];
149
241
  if (value === undefined || value.startsWith("-")) {
@@ -163,6 +255,25 @@ else if (command === "upgrade") {
163
255
  primaryModule = value;
164
256
  }
165
257
  }
258
+ else if (argument === "--gradle-verification-config") {
259
+ const value = commandArguments[index + 1];
260
+ if (value === undefined || value.startsWith("-")) {
261
+ unexpected.push(argument);
262
+ }
263
+ else {
264
+ gradleVerificationConfigPath = value;
265
+ index += 1;
266
+ }
267
+ }
268
+ else if (argument.startsWith("--gradle-verification-config=")) {
269
+ const value = argument.slice("--gradle-verification-config=".length);
270
+ if (value.length === 0) {
271
+ unexpected.push(argument);
272
+ }
273
+ else {
274
+ gradleVerificationConfigPath = value;
275
+ }
276
+ }
166
277
  else if (argument.startsWith("-")) {
167
278
  unexpected.push(argument);
168
279
  }
@@ -178,11 +289,17 @@ else if (command === "upgrade") {
178
289
  process.exitCode = 2;
179
290
  }
180
291
  else {
181
- const options = {};
182
- if (primaryModule !== undefined) {
183
- options.primaryModule = primaryModule;
184
- }
185
292
  try {
293
+ const options = {};
294
+ if (moduleScope !== undefined) {
295
+ options.moduleScope = moduleScope;
296
+ }
297
+ if (primaryModule !== undefined) {
298
+ options.primaryModule = primaryModule;
299
+ }
300
+ if (gradleVerificationConfigPath !== undefined) {
301
+ options.gradleVerification = readGradleVerificationConfiguration(gradleVerificationConfigPath);
302
+ }
186
303
  const result = runProjectUpgrade(targetDirectory ?? process.cwd(), options);
187
304
  process.stdout.write(json
188
305
  ? `${JSON.stringify(result, null, 2)}\n`
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot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CAAC,oBAAoB,OAAO,MAAM,CAAC,CAAC;IACxD,SAAS,EAAE,CAAC;IACZ,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/doctor/installation.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAsiB9C,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,MAAM,GACtB,SAAS,WAAW,EAAE,CA4DxB"}
1
+ {"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../src/doctor/installation.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAgkB9C,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,MAAM,GACtB,SAAS,WAAW,EAAE,CA4DxB"}
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
2
2
  import { lstatSync, readFileSync, } from "node:fs";
3
3
  import { join } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
- import { planAdaptiveProjectTemplates, } from "../installer/adaptive-templates.js";
5
+ import { isModuleScope, planAdaptiveProjectTemplates, } from "../installer/adaptive-templates.js";
6
6
  import { planAgentsConfigMerge } from "../installer/agents-config.js";
7
7
  import { INSTALLATION_MANIFEST_RELATIVE_PATH, readInstallationManifest, verifyInstallationIntegrity, } from "../installer/install-manifest.js";
8
8
  import { ORCHESTRATOR_PACKAGE_NAME, ORCHESTRATOR_PACKAGE_VERSION, mergeOpenCodeConfigText, } from "../installer/opencode-config.js";
@@ -393,18 +393,43 @@ function managedConfigurationCheck(targetDirectory, manifest, inspections) {
393
393
  if (typeof primaryModule !== "string") {
394
394
  throw new Error("androidProject.primaryModule must be a string");
395
395
  }
396
+ const configuredModuleScope = automationConfig.androidProject.moduleScope;
397
+ let moduleScope;
398
+ let comparableAutomationConfig = automationConfig;
399
+ if (configuredModuleScope === undefined) {
400
+ moduleScope = "primary";
401
+ comparableAutomationConfig = {
402
+ ...automationConfig,
403
+ androidProject: {
404
+ ...automationConfig.androidProject,
405
+ moduleScope,
406
+ },
407
+ };
408
+ }
409
+ else if (isModuleScope(configuredModuleScope)) {
410
+ moduleScope = configuredModuleScope;
411
+ }
412
+ else {
413
+ throw new Error("androidProject.moduleScope must be either all or primary");
414
+ }
415
+ if (!isRecord(automationConfig.gradleVerification)) {
416
+ throw new Error("automation config must contain a gradleVerification object");
417
+ }
396
418
  const expected = planAdaptiveProjectTemplates(targetDirectory, {
419
+ moduleScope,
397
420
  primaryModule,
421
+ gradleVerification: automationConfig.gradleVerification,
398
422
  });
399
- if (!jsonMatches(automationConfig, expected.automationConfig)) {
423
+ if (!jsonMatches(comparableAutomationConfig, expected.automationConfig)) {
400
424
  failures.push("automation/config.json: configuration no longer matches the detected Android project and packaged safe defaults.");
401
425
  }
402
426
  else {
403
- details.push(`Automation primary module: ${primaryModule}`);
427
+ details.push(`Automation module scope: ${moduleScope}`);
428
+ details.push(`Automation default module: ${primaryModule}`);
404
429
  }
405
430
  const taskExample = JSON.parse(inspectedText("automation/tasks/TASK-TEMPLATE.json.example", inspections));
406
431
  if (!jsonMatches(taskExample, expected.taskContractExample)) {
407
- failures.push("automation/tasks/TASK-TEMPLATE.json.example: example no longer matches the detected primary module.");
432
+ failures.push("automation/tasks/TASK-TEMPLATE.json.example: example no longer matches the detected module scope.");
408
433
  }
409
434
  }
410
435
  catch (error) {