@frankzhang2026/opencode-android-orchestrator 0.10.0 → 1.0.1

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 (109) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +48 -51
  3. package/dist/cli.js +14 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/config/android-sdk.d.ts +10 -0
  6. package/dist/config/android-sdk.d.ts.map +1 -0
  7. package/dist/config/android-sdk.js +50 -0
  8. package/dist/config/android-sdk.js.map +1 -0
  9. package/dist/config/queue-policy.d.ts +12 -0
  10. package/dist/config/queue-policy.d.ts.map +1 -0
  11. package/dist/config/queue-policy.js +18 -0
  12. package/dist/config/queue-policy.js.map +1 -0
  13. package/dist/config/verification-policy.d.ts +8 -3
  14. package/dist/config/verification-policy.d.ts.map +1 -1
  15. package/dist/config/verification-policy.js +48 -14
  16. package/dist/config/verification-policy.js.map +1 -1
  17. package/dist/doctor/index.d.ts.map +1 -1
  18. package/dist/doctor/index.js +3 -49
  19. package/dist/doctor/index.js.map +1 -1
  20. package/dist/doctor/installation.d.ts.map +1 -1
  21. package/dist/doctor/installation.js +3 -0
  22. package/dist/doctor/installation.js.map +1 -1
  23. package/dist/installer/adaptive-templates.d.ts +3 -1
  24. package/dist/installer/adaptive-templates.d.ts.map +1 -1
  25. package/dist/installer/adaptive-templates.js +2 -0
  26. package/dist/installer/adaptive-templates.js.map +1 -1
  27. package/dist/installer/install-manifest.d.ts +1 -0
  28. package/dist/installer/install-manifest.d.ts.map +1 -1
  29. package/dist/installer/install-manifest.js +6 -1
  30. package/dist/installer/install-manifest.js.map +1 -1
  31. package/dist/installer/opencode-config.d.ts +3 -3
  32. package/dist/installer/opencode-config.d.ts.map +1 -1
  33. package/dist/installer/opencode-config.js +1 -1
  34. package/dist/installer/opencode-config.js.map +1 -1
  35. package/dist/installer/uninstall.d.ts.map +1 -1
  36. package/dist/installer/uninstall.js +5 -0
  37. package/dist/installer/uninstall.js.map +1 -1
  38. package/dist/installer/upgrade.d.ts.map +1 -1
  39. package/dist/installer/upgrade.js +13 -1
  40. package/dist/installer/upgrade.js.map +1 -1
  41. package/dist/plugin/index.d.ts.map +1 -1
  42. package/dist/plugin/index.js +11 -5
  43. package/dist/plugin/index.js.map +1 -1
  44. package/dist/queue/approvals.d.ts +49 -0
  45. package/dist/queue/approvals.d.ts.map +1 -0
  46. package/dist/queue/approvals.js +68 -0
  47. package/dist/queue/approvals.js.map +1 -0
  48. package/dist/queue/cli.d.ts +3 -0
  49. package/dist/queue/cli.d.ts.map +1 -0
  50. package/dist/queue/cli.js +115 -0
  51. package/dist/queue/cli.js.map +1 -0
  52. package/dist/queue/executor.d.ts +24 -0
  53. package/dist/queue/executor.d.ts.map +1 -0
  54. package/dist/queue/executor.js +445 -0
  55. package/dist/queue/executor.js.map +1 -0
  56. package/dist/queue/lifecycle.d.ts +3 -0
  57. package/dist/queue/lifecycle.d.ts.map +1 -0
  58. package/dist/queue/lifecycle.js +24 -0
  59. package/dist/queue/lifecycle.js.map +1 -0
  60. package/dist/queue/queue.d.ts +171 -0
  61. package/dist/queue/queue.d.ts.map +1 -0
  62. package/dist/queue/queue.js +506 -0
  63. package/dist/queue/queue.js.map +1 -0
  64. package/dist/queue/service.d.ts +15 -0
  65. package/dist/queue/service.d.ts.map +1 -0
  66. package/dist/queue/service.js +152 -0
  67. package/dist/queue/service.js.map +1 -0
  68. package/dist/queue/storage.d.ts +32 -0
  69. package/dist/queue/storage.d.ts.map +1 -0
  70. package/dist/queue/storage.js +180 -0
  71. package/dist/queue/storage.js.map +1 -0
  72. package/dist/queue/tools.d.ts +12 -0
  73. package/dist/queue/tools.d.ts.map +1 -0
  74. package/dist/queue/tools.js +155 -0
  75. package/dist/queue/tools.js.map +1 -0
  76. package/docs/MIGRATION.md +32 -11
  77. package/docs/QUEUE.md +151 -0
  78. package/docs/SECURITY.md +38 -31
  79. package/docs/TROUBLESHOOTING.md +34 -11
  80. package/package.json +1 -1
  81. package/templates/.opencode/agents/scheduled-planner.md +64 -131
  82. package/templates/.opencode/commands/abort-task.md +6 -15
  83. package/templates/.opencode/commands/acceptance.md +6 -15
  84. package/templates/.opencode/commands/change.md +3 -1
  85. package/templates/.opencode/commands/resume-review.md +6 -14
  86. package/templates/.opencode/commands/resume-task.md +6 -23
  87. package/templates/.opencode/skills/scheduled-quality-orchestrator/SKILL.md +72 -248
  88. package/templates/AGENTS.md.fragment +8 -0
  89. package/templates/automation/config.json +8 -2
  90. package/templates/automation/config.schema.json +218 -46
  91. package/templates/scripts/automation/abort-task.sh +2 -1
  92. package/templates/scripts/automation/accept-and-integrate.sh +5 -0
  93. package/templates/scripts/automation/acceptance-report.sh +4 -2
  94. package/templates/scripts/automation/approve-and-run.sh +4 -0
  95. package/templates/scripts/automation/begin-review.sh +1 -0
  96. package/templates/scripts/automation/block-task.sh +1 -0
  97. package/templates/scripts/automation/claim-task.sh +1 -0
  98. package/templates/scripts/automation/lib.sh +94 -1
  99. package/templates/scripts/automation/orchestrate-task.sh +11 -0
  100. package/templates/scripts/automation/preflight.sh +14 -4
  101. package/templates/scripts/automation/prepare-contract-review.sh +4 -0
  102. package/templates/scripts/automation/quality-gate.sh +1 -0
  103. package/templates/scripts/automation/record-red.sh +1 -0
  104. package/templates/scripts/automation/resume-review-fix.sh +1 -0
  105. package/templates/scripts/automation/resume-review.sh +1 -0
  106. package/templates/scripts/automation/resume-task.sh +1 -0
  107. package/templates/scripts/automation/scope-gate.sh +10 -2
  108. package/templates/scripts/automation/submit-review.sh +8 -2
  109. package/templates/scripts/automation/verify-task.sh +13 -0
@@ -14,6 +14,10 @@ fi
14
14
 
15
15
  automation_validate_task_id "$task_id"
16
16
  automation_require_orchestrated
17
+ [[ "$(automation_config_value '.schemaVersion')" != "6" ]] || {
18
+ automation_die "use android_orchestrator_intake draft to seal artifacts in the independent inbox"
19
+ exit 1
20
+ }
17
21
  automation_require_approval proposal "$approval"
18
22
  automation_assert_repository_lease_available "$task_id"
19
23
  "$SCRIPT_DIR/validate-contract.sh" "$task_id" >/dev/null
@@ -8,6 +8,7 @@ source "$SCRIPT_DIR/lib.sh"
8
8
  task_id="${1:-}"
9
9
  [[ -n "$task_id" ]] || { printf 'Usage: %s TASK-ID\n' "$0" >&2; exit 2; }
10
10
  automation_validate_task_id "$task_id"
11
+ automation_require_queue_execution "$task_id"
11
12
  [[ "$(automation_read_state "$task_id")" == "CODING" ]] || automation_die "$task_id is not CODING"
12
13
  "$SCRIPT_DIR/validate-contract.sh" "$task_id" >/dev/null
13
14
 
@@ -16,6 +16,7 @@ if [[ -z "$task_id" || -z "$expected" || "$separator" != "--" || -z "$filter" ||
16
16
  fi
17
17
 
18
18
  automation_validate_task_id "$task_id"
19
+ automation_require_queue_execution "$task_id"
19
20
  automation_validate_test_filter "$filter"
20
21
  [[ ${#expected} -ge 3 ]] || automation_die "expected failure text is too short"
21
22
  [[ "$(automation_read_state "$task_id")" == "CODING" ]] || automation_die "$task_id is not CODING"
@@ -8,6 +8,7 @@ source "$SCRIPT_DIR/lib.sh"
8
8
  task_id="${1:-}"
9
9
  [[ "$#" -eq 1 ]] || { printf 'Usage: %s TASK-ID\n' "$0" >&2; exit 2; }
10
10
  automation_validate_task_id "$task_id"
11
+ automation_require_queue_execution "$task_id"
11
12
  [[ "$(automation_read_state "$task_id")" == "CHANGES_REQUESTED" ]] || automation_die "$task_id is not CHANGES_REQUESTED"
12
13
 
13
14
  workspace_file="$(automation_workspace_path "$task_id")"
@@ -8,6 +8,7 @@ source "$SCRIPT_DIR/lib.sh"
8
8
  task_id="${1:-}"
9
9
  [[ "$#" -eq 1 ]] || { printf 'Usage: %s TASK-ID\n' "$0" >&2; exit 2; }
10
10
  automation_validate_task_id "$task_id"
11
+ automation_require_queue_execution "$task_id"
11
12
  automation_require_orchestrated
12
13
 
13
14
  workspace_file="$(automation_workspace_path "$task_id")"
@@ -13,6 +13,7 @@ if [[ "$#" -ne 2 ]]; then
13
13
  fi
14
14
 
15
15
  automation_validate_task_id "$task_id"
16
+ automation_require_queue_execution "$task_id"
16
17
  automation_require_orchestrated
17
18
  automation_require_approval resume "$approval"
18
19
 
@@ -17,9 +17,17 @@ baseline_meta="$evidence_dir/baseline.json"
17
17
 
18
18
  baseline_head="$(jq -er '.head' "$baseline_meta")"
19
19
  current_head="$(git -C "$AUTOMATION_ROOT" rev-parse HEAD)"
20
- [[ "$baseline_head" == "$current_head" ]] || { automation_die "HEAD changed after baseline"; exit 40; }
21
-
22
20
  workspace_file="$(automation_workspace_path "$task_id")"
21
+ if [[ "$baseline_head" != "$current_head" ]]; then
22
+ automation_require_queue_execution "$task_id"
23
+ jq -e --arg original "$baseline_head" --arg current "$current_head" \
24
+ '.queueKey != null and .workspaceStrategy == "isolatedWorktree" and
25
+ .originalBaselineHead == $original and .baselineHead == $current and
26
+ .revalidationRunId != null' "$workspace_file" >/dev/null || {
27
+ automation_die "HEAD changed after baseline"
28
+ exit 40
29
+ }
30
+ fi
23
31
  planning_commit_policy="$(jq -r '.planningArtifactsCommitPolicy // "legacyCommittedSeparately"' "$workspace_file")"
24
32
  if [[ "$planning_commit_policy" == "withProductChanges" ]]; then
25
33
  automation_assert_planning_artifacts_sealed "$task_id" "$AUTOMATION_ROOT" || exit 40
@@ -16,6 +16,7 @@ if [[ -z "$task_id" || -z "$decision" || -z "$summary" ]]; then
16
16
  fi
17
17
 
18
18
  automation_validate_task_id "$task_id"
19
+ automation_require_queue_execution "$task_id"
19
20
  [[ "$decision" == "APPROVED" || "$decision" == "CHANGES_REQUESTED" ]] || automation_die "invalid review decision: $decision"
20
21
  [[ ${#summary} -ge 20 ]] || automation_die "review summary must contain at least 20 characters"
21
22
  [[ "$(automation_read_state "$task_id")" == "REVIEWING" ]] || automation_die "$task_id is not REVIEWING"
@@ -64,8 +65,13 @@ jq -nc \
64
65
  | automation_append_json "$evidence_dir/reviews.jsonl"
65
66
 
66
67
  if [[ "$decision" == "APPROVED" ]]; then
67
- automation_transition_state "$task_id" "REVIEWING" "AWAITING_HUMAN" "reviewer" "independent review approved; human acceptance required"
68
- automation_info "$task_id approved and awaiting human acceptance"
68
+ workspace_file="$(automation_workspace_path "$task_id")"
69
+ if [[ -n "${AUTOMATION_QUEUE_RUN_ID:-}" && "$(jq -r '.commitPolicy // "humanApproval"' "$workspace_file")" == "autoCommit" ]]; then
70
+ automation_transition_state "$task_id" "REVIEWING" "READY_TO_COMMIT" "reviewer" "independent review approved; sealed automatic local commit authorization must be verified"
71
+ else
72
+ automation_transition_state "$task_id" "REVIEWING" "AWAITING_HUMAN" "reviewer" "independent review approved; human acceptance required"
73
+ automation_info "$task_id approved and awaiting human acceptance"
74
+ fi
69
75
  else
70
76
  automation_transition_state "$task_id" "REVIEWING" "CHANGES_REQUESTED" "reviewer" "$summary"
71
77
  automation_warn "$task_id requires changes"
@@ -30,3 +30,16 @@ if [[ "$(jq -r '.deviceTestsRequired' "$contract")" == "true" ]]; then
30
30
  fi
31
31
 
32
32
  automation_info "all deterministic verification commands passed"
33
+ if [[ -n "${AUTOMATION_QUEUE_RUN_ID:-}" ]]; then
34
+ [[ -n "${AUTOMATION_FULL_TEST_LOG:-}" ]] || automation_die "fresh full unit-test evidence is missing"
35
+ jq -n \
36
+ --arg taskId "$task_id" \
37
+ --arg runId "$AUTOMATION_QUEUE_RUN_ID" \
38
+ --arg diffSha256 "$(automation_worktree_diff_sha)" \
39
+ --arg log "$AUTOMATION_FULL_TEST_LOG" \
40
+ --argjson elapsedSeconds "$AUTOMATION_FULL_TEST_ELAPSED" \
41
+ --argjson tasks "$(jq -c '.gradleVerification.fullUnitTestTasks' "$AUTOMATION_CONFIG")" \
42
+ '{taskId: $taskId, runId: $runId, diffSha256: $diffSha256,
43
+ fullTestsExecuted: true, tasks: $tasks, log: $log, elapsedSeconds: $elapsedSeconds}' \
44
+ | automation_record_json "$evidence_dir/full-test-verification.json"
45
+ fi