@zaip-ai/cli 4.4.0 → 4.6.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 (214) hide show
  1. package/README.md +2 -0
  2. package/dist/services/adapters.d.ts +1 -1
  3. package/dist/services/adapters.js +4 -4
  4. package/dist/services/adapters.js.map +1 -1
  5. package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
  6. package/dist/services/codex-conversation-lifecycle-hook.js +24 -5
  7. package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
  8. package/dist/services/codex-native-tool-authority-template.d.ts.map +1 -1
  9. package/dist/services/codex-native-tool-authority-template.js +188 -9
  10. package/dist/services/codex-native-tool-authority-template.js.map +1 -1
  11. package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
  12. package/dist/services/codex-pre-tool-hook-template.js +50 -128
  13. package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
  14. package/dist/services/codex-pre-tool-hook-template.test.js +4 -0
  15. package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
  16. package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
  17. package/dist/services/codex-pre-tool-support-template.js +1 -4
  18. package/dist/services/codex-pre-tool-support-template.js.map +1 -1
  19. package/dist/services/codex-stale-git-lock-template.d.ts +2 -0
  20. package/dist/services/codex-stale-git-lock-template.d.ts.map +1 -0
  21. package/dist/services/codex-stale-git-lock-template.js +64 -0
  22. package/dist/services/codex-stale-git-lock-template.js.map +1 -0
  23. package/dist/services/global-codex-config-migration.test.js +1 -4
  24. package/dist/services/global-codex-config-migration.test.js.map +1 -1
  25. package/dist/services/install-template-policy.d.ts.map +1 -1
  26. package/dist/services/install-template-policy.js +2 -0
  27. package/dist/services/install-template-policy.js.map +1 -1
  28. package/dist/services/logger.js +2 -1
  29. package/dist/services/logger.js.map +1 -1
  30. package/dist/services/logger.test.js +71 -0
  31. package/dist/services/logger.test.js.map +1 -1
  32. package/dist/services/runtime-template-test-support.d.ts +3 -0
  33. package/dist/services/runtime-template-test-support.d.ts.map +1 -0
  34. package/dist/services/runtime-template-test-support.js +32 -0
  35. package/dist/services/runtime-template-test-support.js.map +1 -0
  36. package/dist/services/runtime-template.test.js +23 -31
  37. package/dist/services/runtime-template.test.js.map +1 -1
  38. package/package.json +1 -1
  39. package/templates/.agents/README.md +8 -0
  40. package/templates/.agents/config/agents/discovery.json +1 -1
  41. package/templates/.agents/config/deploy-policy.json +5 -0
  42. package/templates/.agents/dashboard/.zaip-managed.json +211 -75
  43. package/templates/.agents/dashboard/README.md +2 -0
  44. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-f4ZGJRg3.js → CostCalculationGuidePage-BRtiPijr.js} +1 -1
  45. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-CkQ_y8kg.js → DashboardHelpDialog-BR4ZeYpE.js} +99 -10
  46. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-v9zGRTlk.js → PricingSettingsDialog-Dr4QDFmn.js} +1 -1
  47. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-doIMhei7.js → ProjectSettingsPage-BG0N5dw_.js} +1 -1
  48. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-C_4ftjyB.js → TraceabilityWorkspace-BvoM-YQ0.js} +1 -1
  49. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-fTQhSL85.js +68 -0
  50. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-Cv3WBFIF.js → icons-vendor-Bc6vux5t.js} +1 -1
  51. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-BMfzKaAR.js +2 -0
  52. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-DZhppOIk.css +1 -0
  53. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-mHgsmxb6.js → react-vendor-DNJQFov3.js} +1 -1
  54. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-B0CPyEVq.js → traceability-B7tjIB7W.js} +1 -1
  55. package/templates/.agents/dashboard/apps/frontend/dist/index.html +6 -6
  56. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  57. package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +6 -34
  58. package/templates/.agents/dashboard/apps/frontend/src/ReconciliationFeedback.dom.test.ts +130 -0
  59. package/templates/.agents/dashboard/apps/frontend/src/ReconciliationFeedback.tsx +226 -0
  60. package/templates/.agents/dashboard/apps/frontend/src/dashboard-api-sqlite-view.ts +45 -0
  61. package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +15 -0
  62. package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +17 -46
  63. package/templates/.agents/dashboard/apps/frontend/src/reconciliation-feedback-fixtures.ts +23 -0
  64. package/templates/.agents/dashboard/apps/frontend/src/reconciliation-feedback-model.test.ts +69 -0
  65. package/templates/.agents/dashboard/apps/frontend/src/reconciliation-feedback-model.ts +59 -0
  66. package/templates/.agents/dashboard/apps/frontend/src/reconciliation-feedback.css +131 -0
  67. package/templates/.agents/dashboard/apps/frontend/src/styles.css +0 -32
  68. package/templates/.agents/dashboard/apps/frontend/src/use-dashboard-app-model.tsx +2 -2
  69. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  70. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +2 -2
  71. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +1 -1
  72. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  73. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +1 -4
  74. package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.navigation.test.ts +236 -0
  75. package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.tsx +1 -24
  76. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +3 -2
  77. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  78. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  79. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  80. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  81. package/templates/.agents/dashboard/packages/local-runtime/DIAGNOSTICS.md +42 -0
  82. package/templates/.agents/dashboard/packages/local-runtime/dashboard-diagnostics.d.mts +10 -0
  83. package/templates/.agents/dashboard/packages/local-runtime/dashboard-diagnostics.mjs +101 -0
  84. package/templates/.agents/dashboard/packages/local-runtime/dashboard-diagnostics.test.mjs +58 -0
  85. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +232 -217
  86. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +201 -188
  87. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  88. package/templates/.agents/dashboard/packages/local-runtime/scripts/test-sqlite-dashboard-startup.mjs +233 -0
  89. package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-provider-nonzero.mjs +45 -0
  90. package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-dashboard-executable-startup.mjs +107 -0
  91. package/templates/.agents/dashboard/packages/local-runtime/scripts/verify-dashboard-reconciliation-executable.mjs +271 -0
  92. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +232 -217
  93. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +78 -12
  94. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +36 -56
  95. package/templates/.agents/dashboard/packages/local-runtime/src/canonical-source-revision-cache.test.ts +125 -0
  96. package/templates/.agents/dashboard/packages/local-runtime/src/canonical-source-revision-cache.ts +168 -0
  97. package/templates/.agents/dashboard/packages/local-runtime/src/dashboard-diagnostics.test.ts +57 -0
  98. package/templates/.agents/dashboard/packages/local-runtime/src/server-agent-catalog-routes.ts +76 -0
  99. package/templates/.agents/dashboard/packages/local-runtime/src/server-dual-reads-manifest-summaries-without-losing.test.ts +5 -0
  100. package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-diagnostics.test.ts +118 -0
  101. package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-result.test.ts +35 -6
  102. package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-route.ts +105 -0
  103. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.test.ts +64 -9
  104. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-synchronization.ts +19 -27
  105. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-command.test.ts +111 -0
  106. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-refresh.test.ts +59 -0
  107. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-refresh.ts +44 -0
  108. package/templates/.agents/dashboard/packages/local-runtime/src/server-work-reconciliation.test.ts +20 -0
  109. package/templates/.agents/dashboard/packages/local-runtime/src/server-work-reconciliation.ts +12 -7
  110. package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +48 -6
  111. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +2 -2
  112. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +126 -134
  113. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-agent-page.ts +14 -2
  114. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-dashboard-startup.test.ts +163 -0
  115. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-dashboard-startup.ts +78 -0
  116. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-header-timestamp.test.ts +31 -0
  117. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-provider-nonzero.test.ts +271 -0
  118. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-provider-visibility.ts +32 -0
  119. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-operations-duration.ts +58 -0
  120. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-provider-dimension.ts +12 -3
  121. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-view-page.ts +9 -58
  122. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-rebuild.ts +9 -35
  123. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +10 -8
  124. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-source-fingerprint.ts +43 -45
  125. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +5 -9
  126. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.ts +5 -1
  127. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-startup-seed.test.ts +87 -0
  128. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-logging.mjs +6 -2
  129. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-server.mjs +7 -1
  130. package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +4 -5
  131. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  132. package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.test.mjs +33 -4
  133. package/templates/.agents/dashboard/packages/ui/src/DashboardHeader.tsx +8 -7
  134. package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +46 -3
  135. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  136. package/templates/.agents/dashboard/tests/e2e/qualify-kanban-popup.mjs +56 -0
  137. package/templates/.agents/dashboard/tests/e2e/specs/dashboard-update-label.spec.ts +49 -0
  138. package/templates/.agents/design/.zaip-managed.json +17 -5
  139. package/templates/.agents/design/apps/catalog/dist/assets/index-D3uhpycC.js +72 -0
  140. package/templates/.agents/design/apps/catalog/dist/index.html +1 -1
  141. package/templates/.agents/design/apps/catalog/package.json +1 -1
  142. package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +13 -1
  143. package/templates/.agents/design/apps/catalog/src/specimens/ReconciliationSpecimen.stories.tsx +6 -0
  144. package/templates/.agents/design/apps/catalog/src/specimens/ReconciliationSpecimen.tsx +101 -0
  145. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  146. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  147. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  148. package/templates/.agents/requirements/comparative-audit.md +1 -1
  149. package/templates/.agents/requirements/context-engine.md +1 -1
  150. package/templates/.agents/requirements/cost-observability.md +1 -1
  151. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  152. package/templates/.agents/requirements/data-export.md +1 -1
  153. package/templates/.agents/requirements/design-system.md +1 -1
  154. package/templates/.agents/requirements/execution-engine.md +1 -1
  155. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  156. package/templates/.agents/requirements/model-orchestration.md +21 -6
  157. package/templates/.agents/requirements/public-distribution.md +4 -4
  158. package/templates/.agents/requirements/software-architecture.md +1 -1
  159. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  160. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  161. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  162. package/templates/.agents/rules/core.md +3 -1
  163. package/templates/.agents/rules/workflow.md +3 -2
  164. package/templates/.agents/runtime/VERSION +1 -1
  165. package/templates/.agents/runtime/bin/zaip.mjs +705 -516
  166. package/templates/.agents/runtime/checksums.sha256 +5 -5
  167. package/templates/.agents/runtime/manifest.json +1 -1
  168. package/templates/.agents/runtime/provenance.json +4 -4
  169. package/templates/.agents/runtime/sbom.cdx.json +1 -1
  170. package/templates/.agents/skills/zaip-skill-config/SKILL.md +25 -3
  171. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +4 -0
  172. package/templates/.agents/skills/zaip-skill-execution/references/autonomous-continuation.md +4 -0
  173. package/templates/.agents/skills/zaip-skill-execution/references/candidate-workflow.md +1 -1
  174. package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +2 -2
  175. package/templates/.agents/skills/zaip-skill-general-operations/SKILL.md +1 -0
  176. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +36 -48
  177. package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +2 -2
  178. package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +67 -99
  179. package/templates/.agents/skills/zaip-skill-github-deploy/references/release-identity.md +33 -30
  180. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +303 -0
  181. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +334 -0
  182. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +41 -28
  183. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/guarded-commits.mjs +212 -0
  184. package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +4 -0
  185. package/templates/.agents/skills/zaip-skill-prd/SKILL.md +4 -0
  186. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +44 -68
  187. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +91 -44
  188. package/templates/.agents/skills/zaip-skill-send-email/SKILL.md +15 -0
  189. package/templates/.agents/skills/zaip-skill-send-email/agents/openai.yaml +4 -0
  190. package/templates/.agents/skills/zaip-skill-setup/SKILL.md +5 -2
  191. package/templates/.agents/skills/zaip-skill-spec/SKILL.md +4 -0
  192. package/templates/.agents/skills/zaip-skill-task/SKILL.md +4 -0
  193. package/templates/.agents/skills/zaip-skill-testing-strategy/SKILL.md +19 -0
  194. package/templates/.agents/skills/zaip-skill-tool-setup/SKILL.md +2 -0
  195. package/templates/.agents/skills/zaip-skill-use-connectors/SKILL.md +15 -0
  196. package/templates/.agents/skills/zaip-skill-use-connectors/agents/openai.yaml +4 -0
  197. package/templates/.agents/skills/zaip-skill-use-connectors/scripts/connector-guidance.test.mjs +29 -0
  198. package/templates/.agents/skills/zaip-skill-use-connectors/scripts/verify-connector-lock.mjs +30 -0
  199. package/templates/.agents/tools/cloud-runner.integration.test.mjs +3 -0
  200. package/templates/.agents/zaip-aios/VERSION +1 -1
  201. package/templates/.agents/zaip-aios/guides/03-tasks.md +6 -0
  202. package/templates/.agents/zaip-aios/guides/04-specs.md +6 -0
  203. package/templates/.agents/zaip-aios/guides/05-prds.md +4 -0
  204. package/templates/.agents/zaip-aios/guides/06-execucao.md +6 -0
  205. package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +6 -0
  206. package/templates/.agents/zaip-aios/guides/19-assurance-e-autonomia.md +4 -0
  207. package/templates/.agents/zaip-aios/guides/22-fluxos-e-roteamento.md +6 -0
  208. package/templates/.agents/zaip-aios/guides/23-orquestracao-de-modelos.md +36 -4
  209. package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +15 -4
  210. package/templates/.agents/zaip-aios/guides/28-lifecycle-completo.md +8 -0
  211. package/templates/template-manifest.json +330 -142
  212. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-D7PrDZy9.js +0 -68
  213. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-OBJXZOwe.css +0 -1
  214. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Rbmpz4UO.js +0 -2
@@ -1,139 +1,107 @@
1
+ # GitHub deploy contract
1
2
 
2
- # Deploy and repair GitHub publication
3
+ Resolve mode and scope before selecting validation or changing Git. An affirmative deployment request authorizes its resolved route; discussion, a quoted command or a negated release is not publication authority. Generic “faça deploy” follows project policy without a routine confirmation or an extra warning about existing pipelines. Actual integrity, authentication, destructive-action and scope blockers remain.
3
4
 
4
- The exact command “faça deploy” authorizes publication of everything versionable in the selected worktree, including tracked and untracked files, after the safety gates below. It does not authorize provider deployment.
5
+ ## Project policy and reviewed resolver
5
6
 
6
- An explicit current-turn request to `deploy`, `push`, `publicar`, `publicação` or GitHub publication selects this skill. For the verified `zaip-ai/zaip-aios` source, a default “faça deploy” includes the guarded Git push, GitHub Release and terminal observation of the npm workflow it triggers. Consumer repositories remain GitHub-only. Discussing or editing deployment does not authorize publication, and neither route authorizes provider deployment.
7
+ `.agents/config/deploy-policy.json` is a separate project-owned preference seeded silently once at installation. Its fields are `schema_version: 1`, `default_mode: auto|commits|release` (default `auto`) and `default_scope: current-work`. Preserve it on upgrades; never add mode fields to `project.yaml#deploy` or save `all-worktree` as a default.
7
8
 
8
- ## Authorization
9
+ Use the portable, versioned resolver from the selected checkout:
9
10
 
10
- - Require an explicit deploy, push, publicar, publicação, GitHub publication, or failed-deploy repair request in the current turn.
11
- - The request authorizes the initial publication, automatic reconciliation needed to publish the selected branch, commits covering all versionable pending changes in the selected worktree, and up to five repair cycles needed to make required local and remote GitHub checks pass. Do not stop merely because the worktree is dirty, history is behind/diverged, generated files are pending, or a local gate has a repairable failure.
12
- - Limit repairs to the intended repository state and the evidenced failure. Do not add unrelated features or broaden product scope.
13
- - Never force push, rewrite history, replace remotes, change credentials or Git/SSH configuration, bypass checks, or deploy to another service.
14
- - Do not create lifecycle artifacts merely to publish already-existing commits. The deploy authorization permits staging every inventoried versionable path in the selected worktree after secret, size, and ignore checks; it never authorizes changes outside that worktree.
15
- - Every product commit needs its evidenced Task and canonical Task title, including Task-first. If ownership is missing, materialize the authorized work before editing/committing; never borrow the latest global Task. Only records/local-only snapshots are exempt. Omit nonexistent PRD/SPEC lineage. Explicit deploy authorizes reviewed path staging, never force, destructive reset, history rewrite, or credential changes.
16
-
17
- ## Mandatory authorization record
18
-
19
- Before the first Git mutation, retain a sanitized authorization record in the task's visible progress and terminal report. It must state:
20
-
21
- 1. the user's current-turn publication intent;
22
- 2. repository, remote, branch and selected worktree;
23
- 3. whether the grant is simple push or partitioned commit plus push;
24
- 4. the bounded history-reconciliation strategy (`rebase` by default, or user-selected `merge`);
25
- 5. allowed repair cycles, excluded worktrees/scopes and prohibited actions;
26
- 6. the preflight result and the recoverable preservation reference used before reconciliation.
27
-
28
- For publication of existing commits, the conversation and terminal deploy report are the authority record; no artificial Task is needed. New product edits or commits require Task ownership under the workflow and commit policy. Never store credentials, private-key contents, tokens or environment values. Request only authority actually missing from the current request.
11
+ ```text
12
+ node .agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs --repository <ROOT> --request-file <FILE> [--plan-file <FILE>]
13
+ ```
29
14
 
30
- ## Multiple worktrees and divergent history
15
+ The request file is UTF-8 plain text containing the real human request. The resolver reads the project's policy and manifest/origin identity and writes a JSON plan binding mode, phase, scope and their digests. Save paths, pending commits, configured branch and work attribution separately as observed evidence; those are not invented request-file fields. The resolver is a planning step, not a publication command. Invalid policy, contradictory repository identity or missing work attribution cannot be replaced with guessed defaults.
31
16
 
32
- 1. Resolve the selected publishing worktree and inspect its `git status --porcelain`; use `git worktree list --porcelain` only to detect a path collision, never to scan every worktree.
33
- 2. Select exactly one publishing worktree. Its named branch, recovery branch or detached HEAD is the source candidate; `deploy.<scope>.branch` is the remote target. A different local branch or detached source does not join another worktree and is not a blocker. The selected worktree is the complete publication scope.
34
- 3. Report a detected path collision, but do not block solely because the selected worktree is dirty, detached, on a recovery branch or contains mixed changes; the explicit “faça deploy” authorization includes those changes. Stop only for an unresolved index conflict, secret/oversize file, authentication failure, or destructive/rewrite requirement.
35
- 4. Prunable or missing worktrees are reported but never pruned automatically. Unselected dirty detached or temporary worktrees are never deleted, reset, stashed or copied into the publishing worktree implicitly.
36
- 5. Fetch once and compute ahead/behind between the source candidate and the configured remote target. If it is behind or diverged, automatically reconcile only the selected source under this deploy authorization and continue; divergence is not a blocker by itself.
37
- 6. Before reconciliation, create a recoverable branch reference and preserve tracked plus untracked changes in a named stash. Verify both references before proceeding. Use `rebase` unless the user explicitly selected `merge`.
38
- 7. Apply the bounded reconciliation without force and without checking out the configured target branch locally. Restore with `git stash apply`, retain the stash until publication succeeds, and resolve generated aggregate conflicts by regenerating them from canonical sources. For ordinary textual conflicts, combine both sides when safe; use the selected worktree's intended version only when the diff and commit history establish that it supersedes the remote version.
39
- 8. After restoration, prove that no unmerged paths remain, re-inventory the diff, and only then begin functional partitioning. Continue automatically through recoverable conflicts and pending repairs; stop only for a genuine terminal blocker defined below.
17
+ | Affirmative request or saved preference | Result |
18
+ | --- | --- |
19
+ | Generic deploy with `default_mode: auto`, verified builder | Release plus npm through GitHub Actions |
20
+ | Generic deploy with `default_mode: auto`, consumer | Commits plus exact-SHA push |
21
+ | Generic deploy with saved `commits` or `release` | That saved mode, subject to repository capabilities |
22
+ | “faça deploy apenas commits”, “sem release”, explicit push-only | Commits for this request |
23
+ | “deploy com release”, “próxima versão”, “novo release” | Release for this request |
24
+ | Prepare/qualify only, discuss release or negate publication | No publication authority |
40
25
 
41
- ## Repair-loop integrity
26
+ Overrides apply once. “Sempre faça deploy com release” is an explicit preference change; a single “deploy com release” does not save that preference. Consumers stay GitHub-only even when release is selected.
42
27
 
43
- - A publication cycle is: run deploy preflight, inventory the intended pending diff, synchronize, create any required functional commits with explicit pathspecs, push, and verify the remote hash. When no intended pending diff exists, publish already-formed commits. Run only gates required or evidenced by repository Rules, the active Change, or failed remote CI.
44
- - Inventory the complete pending diff, run the safety gates, then stage the reviewed inventory with `git add -- <explicit-pathspecs>` and commit it. Generate pathspecs from the reviewed tracked and untracked inventory; do not use `git add -A`, broad globs, or paths outside the selected worktree. Do not require functional partitioning for this explicit broad-deploy mode.
45
- - Run each diagnostic, gate, fetch, stage, commit, push, and hash verification at most once per cycle, except the single documented transient push retry below.
46
- - Start a new cycle only after a repository change or new remote evidence. Never repeat an unchanged failing command hoping for a different result.
47
- - Continue until all required checks pass or a terminal blocker occurs. Stop after five repair cycles, or when the same root cause remains after two repairs.
48
- - Treat authentication, unavailable credentials, unresolved conflicts after bounded repair, secret exposure, destructive changes, GitHub outages, and ambiguous scope expansion as terminal blockers. Ordinary branch divergence, dirty state, untracked versionable files, generated projections, lint/format failures, and other repairable pending work are not blockers: repair them within the selected worktree and continue under the same authorization.
28
+ Recognize builder only through the approved `zaip-ai/zaip-aios` origin, root `@zaip-ai/aios` manifest and public CLI `@zaip-ai/cli` manifest together. A consumer may install these skills but does not acquire builder npm capability. Conflicting builder signals must fail closed rather than silently downgrade.
49
29
 
50
- ## Prove folder-scoped SSH first
30
+ ## Scope and authority evidence
51
31
 
52
- From the repository root, read `.agents/config/project.yaml` immediately before deployment. `deploy.frontend.branch` and `deploy.backend.branch` are persistent authorization and may be `main`; pass their explicit `--scope`. `deploy.database.branch` is literal `beta`, never falls back to `main`, and requires `--scope database`. The internal `--scope framework` and a legacy preflight without `--scope` use `deploy.branch`, which must remain non-production. A malformed config is a terminal preflight failure. Preflight reports the local source branch or detached state separately, treats the configured branch only as the remote target, and never creates, renames or switches a branch.
32
+ Default `current-work` covers the attributable files and commits of the current authorized work, including causally required projections. A generic deploy never absorbs unrelated dirty files or already-formed unrelated commits. A commit containing mixed ownership requires safe reconciliation before publication; a path filter alone cannot scope the contents of a pushed SHA.
53
33
 
54
- For a database migration request, the database worktree may push only `HEAD:refs/heads/request/<id>` to open its PR against `beta`. That route never targets `main`, never applies SQL, and does not provision a beta branch or Supabase resource.
34
+ Only explicit “deploy de tudo” selects `all-worktree`: inventory all versionable work in exactly the selected checkout, preserve attribution and apply secret, size and ignore checks. Other worktrees remain outside the grant.
55
35
 
56
- ```powershell
57
- node .agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs --repository . --remote origin
58
- ```
36
+ Before mutation record actual intent, policy source, mode, scope, selected worktree, local source branch/detached SHA, remote and configured target, reviewed file/commit inventory, valid checks, reconciliation strategy and preservation refs. Keep these details in evidence, not a long chat report. Never record credential values.
59
37
 
60
- The preflight must prove that the push URL uses SSH, no process override is active, the effective `core.sshCommand` comes from repository-local or matching folder configuration, its private key exists, Git identity exists, and `git ls-remote` succeeds.
38
+ New product commits require their real Task/Change/Execution and write scopes. Existing commits need no synthetic Task. Records/local-only snapshots retain their exemption; conversation capture is not product attribution. Never select the latest global Task as a fallback.
61
39
 
62
- Run preflight once at the start of the authorized deployment. Classify a failure before stopping: authentication, SSH configuration, unavailable authority, or an external access failure is a terminal blocker; an evidenced repository-content or missing-prerequisite failure within the authorized scope may be repaired in the bounded cycle and then rechecked. Do not edit Git/SSH configuration, use `git -c core.sshCommand=...`, set an environment override, or invoke `ssh -i` directly. Retain the sanitized result as evidence.
40
+ ## Branch and access
63
41
 
64
- ## Environment and access contract
42
+ Read `.agents/config/project.yaml` for the actual application target. Frontend/backend follow `deploy.frontend.branch`/`deploy.backend.branch`, including configured `main`. These explicit targets take precedence over a legacy generic `deploy.branch`. Do not create beta or assume production promotion is needed for a configured application main.
65
43
 
66
- - `READ-ONLY-BETA` and `READ-ONLY-PROD` are explicit query-only identities. They must have separate credentials and targets, remain unable to apply migrations, mutate backend data, change provider settings, or publish Git refs, and must never be substituted for a deploy credential.
67
- - Database automation publishes only the literal `beta` branch through reviewed migration PRs. Backend follows `deploy.backend.branch`, including `main` when configured. Database production promotion remains a human GitHub merge after review and required checks.
68
- - Frontend and site can publish their own validation builds from the configured validation branch. Their provider configuration remains project-owned and separate from production; this Git-only skill does not authorize a provider deployment.
69
- - A central database repository is optional and configured by the consuming project. Do not infer a repository name, remote, service target, or credential from another repository.
44
+ Database alone retains literal `beta`, reviewed request-branch PRs and human production promotion. A migration request may publish its authorized `request/<id>` ref for a PR against beta; it never applies SQL or provisions resources. Read-only beta/production credentials cannot publish Git or mutate services.
70
45
 
71
- ## Validation budget
46
+ Run the reviewed folder-scoped SSH preflight for the selected application scope:
72
47
 
73
- Guarded local framework preparation requires the signed `essential-v3` receipt. It excludes
74
- dashboard-tab and XLSX certification; select `--profile full` explicitly when that extended
75
- coverage is required.
76
- The default legacy GitHub publisher accepts its separate exact-candidate qualification
77
- receipt only after the remote full gate and TGZ matrix. Explicit administrator activation after signed local qualification switches the
78
- publisher to the verified local receipt. One read-only install smoke then gates npm;
79
- no private-draft pilot is required. Activation is never implicit.
80
- Follow [local preparation](../../zaip-skill-release-qualification/references/local-preparation.md)
81
- for exact-candidate evidence, deadlines and rapid-preparation limits. Impact selection has
82
- no test-count ceiling; rapid results are not release receipts. Preserve consumer policy
83
- boundaries and reuse only valid matching evidence. On timeout, terminate the command tree,
84
- retain the failed gate and repair its evidenced cause; never omit gates to obtain success.
48
+ ```text
49
+ node .agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs --repository <ROOT> --remote origin --scope frontend
50
+ ```
85
51
 
86
- ## Review and validate
52
+ Use backend when that is the actual scope. Require SSH origin, repository-local or matching folder `core.sshCommand`, an existing key, Git identity and successful `ls-remote`. Do not change Git/SSH configuration, keys, remotes, accounts or transport; do not use process overrides. A configured remote target differs legitimately from a recovery branch or detached source.
87
53
 
88
- 1. Snapshot `git status --short --branch`, file names, and the diff summary.
89
- 2. Inspect suspicious environment, key, certificate, state, or credential files without printing secret values. Block secrets and files at or above GitHub's 100 MB limit.
90
- 3. Reuse valid evidence for unchanged work. Run only gates required by repository Rules, the active Change, or the failed GitHub job.
91
- - Turbo cache hits are valid only when the active work did not originate from a failed remote CI gate.
92
- - When repairing failed CI, reproduce the exact failed gate once per repair cycle with Turbo cache bypassed when applicable.
93
- 4. If a local gate fails, capture the exact failing command and error, make the smallest authorized repair, update lifecycle evidence, and start the next cycle without asking for another deploy authorization.
94
- 5. After all required local gates pass, stage each reviewed selected-worktree path with `git add -- <explicit-pathspecs>`. If a file is secret, oversized, ignored by policy, or outside the selected worktree, exclude it and report the reason; otherwise include it.
54
+ ## Preserve and reconcile
95
55
 
96
- ## Consumer release preparation
56
+ 1. Inspect selected status, intended tracked/untracked paths, index and pending commits. Check ignores, secrets and GitHub's 100 MB file limit without printing secrets.
57
+ 2. Fetch the target and compute ahead/behind for the authorized source. Before reconciliation, create and verify a recoverable ref and named stash covering tracked/untracked changes. Preserve concurrent index entries.
58
+ 3. Rebase by default, or merge when the user chose it, within authorized scope. Do not switch locally to the target, force, reset or rewrite published history. Restore with `stash apply`, retain it until preservation is verified and reconcile generated aggregates from canonical inputs.
59
+ 4. Re-inventory after repair. Stage explicit reviewed paths only, never `git add -A`, `git add -u` or broad globs. Functional partitioning is useful when ownership requires it, not a universal extra step.
60
+ 5. Use causal Task commit identity, hook and range validation. `CODEX|CLAUDE` and compact P/S/T lineage must be observed; standalone Task uses `[Task-first:XXXX]`. Subject is at most 96 characters with full IDs in trailers. See [commit policy](../../zaip-skill-task/references/commit-policy.md).
97
61
 
98
- Every authorized deploy must first compose `$zaip-skill-release-qualification` and use its guarded delivery entrypoint. Complete synchronization and commits before preparing the exact clean candidate. See [the executable preparation guide](../../zaip-skill-release-qualification/references/local-preparation.md). A prose review or an unsigned test result does not replace preparation.
62
+ Dirty state, recovery branches, missing generated files and repairable divergence do not require a second authorization. Unresolved integrity/authentication failures, secrets, destructive requirements or necessary scope expansion are blockers.
99
63
 
100
- For `zaip-ai/zaip-aios` framework releases, use `scripts/local-release-deploy.mjs`: it prepares and verifies the candidate, pushes the exact SHA to `main`, uploads the verified assets to a draft release, and publishes that release. npm publication remains exclusively in GitHub Actions. Run the folder-scoped SSH preflight with the explicitly configured frontend scope before this entrypoint.
64
+ ## Select checks and deliver
101
65
 
102
- Before classifying a missing signer as a blocker, inspect the configured external signing-key path, trust store, policy and protected GitHub release variables without exposing secret contents. The private Ed25519 release key is distinct from the Git SSH key and a local `.env` npm token; the latter does not automatically reach Actions. If a required key or protected setting truly is absent, stop with its exact name and recovery action. Do not generate a replacement, rotate public trust or publish locally without separate authority. The user's 2026-09-23 standing authorization permits routine version-specific updates of **only** `ZAIP_LOCAL_RELEASE_POLICY_B64` in the verified `zaip-ai/zaip-aios` repository. When the enrolled policy names an older release, prepare a reviewed policy for the exact new version and fixed qualification profile; preserve repository, branch, channel, publication mode, non-force/non-replacement controls and trusted key. After successful signed local qualification and before Release publication, set that one variable to the exact UTF-8 policy bytes encoded in base64 and read it back byte-for-byte. A missing key, changed trust, weaker policy, failed readback or insufficient GitHub permission remains a blocker, not a reason to ask again for the already-authorized routine version update.
66
+ **Commits mode:** use `scripts/guarded-commits.mjs` with its reviewed CLI. It validates scoped checks and binds delivery to the exact candidate and configured branch refspec. Select checks from changed behavior, acceptance criteria and observed failures. Do not require a release receipt, version bump, signing key, TGZ, dense distribution gate or full suite just to push commits. Direct installer/security impact still requires its relevant integrity or regression checks.
103
67
 
104
- After exact-candidate qualification, a missing GitHub Release is normal. Unless the request is explicitly push-only, use the configured entrypoint to create a draft for that SHA or resume a verified draft for the same SHA; do not recreate an existing Release. A published Release for the exact SHA is verified as a no-op, or its failed checks are repaired within the bounded cycle. An authentication or API error does not prove that a Release is absent.
68
+ ```text
69
+ node .agents/skills/zaip-skill-github-deploy/scripts/guarded-commits.mjs --repository <ROOT> --sha <SHA> --branch <BRANCH> --scope frontend --request-file <FILE> --plan-file <FILE> --checks-file <FILE>
70
+ ```
105
71
 
106
- For a consumer repository, bootstrap its own Ed25519 trust store and define `configured_branch`, GitHub version `vN.N`, and `required_commands` in its project policy. `prepare` runs only those policy commands and signs a receipt after the Git identity is unchanged before and after them. `verify` checks the configured branch, exact SHA/tree, policy digest and trusted key. `guarded-push` runs prepare and verify before its explicit push command; a failed required command, dirty checkout, changed SHA/policy, or unavailable key prevents that command from running. This consumer flow is GitHub-only: it has no npm channel, package manifest version, or TGZ contract.
72
+ Use the resolver's same plain-text request and JSON plan. The checks file is a JSON array of objects with `command` and `args`, selected for this work; for example, `[{"command":"node","args":["--test","path/to/affected.test.mjs"]}]`. It is not an array of argv arrays. Backend uses its actual scope. Complete Task-owned commits before calling the helper; it sends an already-committed exact SHA and does not create product commits.
107
73
 
108
- ## Synchronize and publish each cycle
74
+ **Release mode:** follow [release identity](release-identity.md), then [local preparation](../../zaip-skill-release-qualification/references/local-preparation.md). Synchronize and commit the candidate before exact-SHA qualification. Check published SHA before allocating a new version: unchanged published SHA is a no-op.
109
75
 
110
- Fetch the selected remote and configured target branch once per publication cycle, without SSH overrides. Compute ahead/behind from the selected source candidate against `<selected remote>/<configured branch>`. When the source is behind or diverged, apply the recorded bounded reconciliation strategy in place and continue after successful verification; do not switch to the target branch merely to satisfy publication. Stop only if reconciliation cannot be completed safely within the bounded repair cycles. Never reset or force.
76
+ - Verified builder uses `scripts/local-release-deploy.mjs` and its protected signed preparation. Resolve mode locally first; perform signed preparation only for release mode. Once preparation has created its receipt directory, save the UTF-8 human request at `<output-dir>/deploy-request.txt` and generate the final-candidate contract at `<output-dir>/deploy-contract.json` using the resolver's `--request-file` and `--plan-file`. Do not pre-create the preparation directory for these inputs. The protected helper reads these fixed paths before reusing preparation or using credentials; no new request/plan CLI arguments expand the installed hook allowlist. Only GitHub Actions publishes `@zaip-ai/cli`.
77
+ - The private Ed25519 release key is distinct from the Git SSH key and a local `.env` npm token. Never substitute credentials or print them; existing builder trust and protected policy remain mandatory for Release, not for commits.
78
+ - Consumer release uses only its project's GitHub checks and reviewed release route. Do not demand builder Ed25519 material, protected GitHub variables, npm channel, package version or TGZ. An existing project-specific signed consumer helper may be used only under that project's adopted policy.
79
+ - `prepare`, `verify` and dry-run never authorize or perform publication.
80
+ - Immediately before sending, recheck policy, scope, target, candidate and checks. Changed identity or stale evidence requires renewed preparation. Use the guarded route; never bypass it with manual push.
81
+ - Use immutable `<sha>:refs/heads/<configured-branch>`. After push, compare that SHA with the remote ref. A local branch name is not the proof.
111
82
 
112
- Commits created during Task execution use `[CODEX|CLAUDE] [P:XXXX] [S:XXXX] [T:XXXX] <Task title>`: the effective executing-agent prefix followed by compact lineage.
83
+ Detailed reviewed notes belong only in the GitHub Release. Observe the complete previous-Release-to-candidate Git diff and commit range; retain the full range/inventory as source and evidence. It is not limited to the current Task or chat. Group meaningful final outcomes, validate [release notes](release-notes.md), publish the reviewed UTF-8 body and read it back byte-for-byte. A compare link or generated notes alone is insufficient.
113
84
 
114
- - Codex: `[CODEX] [P:XXXX] [S:XXXX] [T:XXXX] <Task title>`
115
- - Claude: `[CLAUDE] [P:XXXX] [S:XXXX] [T:XXXX] <Task title>`
85
+ ## Recovery and verification
116
86
 
117
- The effective provider is `CODEX` or `CLAUDE`. P/S/T blocks require evidence; standalone Tasks use `[Task-first:XXXX]` followed by their canonical title. The subject remains ≤96 characters with title truncation at word boundaries; full IDs remain in `ZAIP-*` trailers. All product commits require a real Task, matching causal records and write scopes. Only `.agents/records/**` and `.local/**` changes are exempt; conversation capture does not authorize commits. Run `commit validate` and preserve the installed `commit-msg` hook. See `docs/task-commit-policy.md`. Explicit deploy never authorizes broad staging, force, destructive reset or squashing.
87
+ Use the frozen Task autonomy profile, not a deploy-specific repair cap. Balanced permits 1 initial plus 9 repairs (10 executions total) and 3 replans. Tests, tool calls and elapsed time are not executions; continuation preserves the ledger. Persistent and essential retain their own configured limits. There is no independent five-cycle/two-repair stop or Task wallclock rule.
118
88
 
119
- Immediately before delivery, re-read the configured target with preflight and the explicit scope. If it changed, restart preparation for the new target. Consumer frontend/backend publication must use `consumer-release-preparation.mjs guarded-push`; framework publication must use `scripts/local-release-deploy.mjs`. These entrypoints bind preparation to the exact SHA and explicit branch refspec. Do not bypass them with a manual push. The separately authorized database request-branch PR route retains its database-specific gates and is outside these release helpers. A default deploy completes the Release flow; only an explicit push-only request stops after the push. If there is no unpushed commit or pending release after reconciliation and review, report a no-op.
89
+ Run diagnostics/checks once per unchanged state and retry only after a concrete repair or new remote evidence. A transport ambiguity requires reading remote state first; a documented transient retry must stay within the existing attempt. Inspect exact failed CI steps, bypass stale cache only for the affected gate and never weaken checks.
120
90
 
121
- - If a push result is uncertain, read the remote state before acting. Reconcile a non-fast-forward through the existing bounded policy; retry one documented transient server or transport failure per cycle. Authentication, authorization, configuration, or other external-access failures are terminal blockers.
122
- - Never switch keys, accounts, remotes, or transport, and never pass SSH/config overrides or force options.
91
+ Observe required checks for the exact SHA with concise progress while pending. Keep waiting through an active remote run; a tool timeout is not Task abandonment. Unavailable authentication/API access is a real blocker, never evidence that a Release, tag or check does not exist. Report push success separately from unconfirmed CI.
123
92
 
124
- ## Verify and monitor GitHub checks
93
+ ## Completion and brief chat result
125
94
 
126
- 1. After every push, compare `git rev-parse HEAD` with one `git ls-remote <remote> refs/heads/<configured branch>` result.
127
- 2. Inspect required GitHub checks for that exact commit using an available authenticated GitHub CLI, API, connector, or browser session. Wait up to 20 minutes for terminal status and provide a concise progress update at least once per minute.
128
- 3. If all required checks pass, confirm the remote hash, commit title, SSH identity source, key path, and worktree status.
129
- 4. If a check fails, read the exact job and step logs before editing. Do not weaken or remove the check merely to obtain green status.
130
- 5. Repair the evidenced cause, complete lifecycle records, and start the next cycle under the same user authorization.
131
- 6. If checks cannot be observed, report the push as successful but CI as unconfirmed; never claim the deployment is fully validated.
95
+ | Resolved mode | Required observed result |
96
+ | --- | --- |
97
+ | Commits | Scoped exact SHA on configured remote branch and valid required checks |
98
+ | Consumer release | Commits result plus exact tag/SHA, Release URL and reviewed-body readback |
99
+ | Builder release | Release result plus protected assets, terminal `publish-cli.yml` success and npm version/dist-tag/artifact integrity |
132
100
 
133
- ## Release identity
101
+ Verify preservation of unrelated files and index entries; require a clean owned candidate, not deletion or inclusion of unrelated work to make the whole checkout clean. Retry/resume an existing Release only with its original SHA/identity. Never create an empty new Release for an already-published candidate.
134
102
 
135
- Unless the request is push-only, resolve the release identity before mutation using the verified candidate SHA and tag list. Follow [the release identity contract](release-identity.md): consumer GitHub releases stay independent; framework `vN.N` maps to package `N.N.0`, and only qualified GitHub Actions can publish `@zaip-ai/cli` to npm.
103
+ Chat reports the mode, branch/SHA, Release link when applicable and actual blocker/pending check briefly. Detailed change notes stay in the Release; evidence retains authority, full Git range and verification. Formal Task closure remains the responsible orchestrator/finalizer's work. GitHub publication does not authorize provider deployment, SQL, paid provisioning or host power actions.
136
104
 
137
- ## Success condition
105
+ ## Current release and pre-main candidate
138
106
 
139
- For a full framework deploy, finish only when the local and remote hashes match, the intended worktree is clean, the exact Release identity/assets/body are verified, the associated `publish-cli.yml` run reaches success, and the npm registry confirms the intended `@zaip-ai/cli@N.N.0` version, dist-tag and artifact integrity. The workflow uses its configured GitHub credential/environment; a local `.env` does not publish the package. A published Release with failed or unobserved npm is partial, never a completed deploy. For a consumer or an explicit push-only request, apply only its authorized GitHub scope. Otherwise report the exact terminal blocker and repair cycles consumed.
107
+ For builder release or a critical Task, reconcile attributed branches/worktrees first. An isolated terminal Task closes only after verified bundle/snapshot backup; a shared checkout with mixed product changes blocks for attribution. The current release's frozen manifest and exact SHA audit precede fixed local candidate checks. The only open-work exception is the authenticated critical release-only coordinator Task and its owner SPEC; its Task Run remains active during audit and advance, with exact SPEC/Execution/macro ancestry and candidate records. All other open current-release work blocks. Push only `main`, then require the successful `pre-main-candidate.yml` push run on that exact SHA before Release publication. Never create a remote CI candidate branch. Failed local checks block the push; failed remote CI or unavailable credentials block Release publication and require repair on `main`. After Release/npm and advance, bind closure Evidence to the published candidate, close Task and SPEC, then push one exact main metadata-only commit through `local-release-deploy.mjs push-closure` and observe CI on the new main SHA. PRD/SPEC drafts for a later release may remain.
@@ -1,49 +1,52 @@
1
1
  # Release identity contract
2
2
 
3
- Use the helper before a GitHub Release decision. It accepts a verified candidate SHA and either a verified tag list or an explicit canonical product version:
3
+ Read only after the deploy resolver selects release, or for an explicitly requested local release preparation. Commits mode has no release version decision. Preparation alone never authorizes publication.
4
4
 
5
- ```powershell
5
+ ## Observe before allocating
6
+
7
+ Verify the repository's actual published Release and tag SHAs, draft state and candidate SHA through authenticated sources. An API/authentication error does not establish absence.
8
+
9
+ If the current candidate is already the published SHA, verify that delivery as a no-op. Do not bump a version or create an empty Release. Resume a verified draft or retry an observed incomplete pipeline only with the exact same SHA, tag, version and reviewed body. A different candidate cannot reuse that identity or inherit its receipt.
10
+
11
+ For a new candidate, select the numeric maximum canonical `vN.N` among observed tags, including prereleases, and increment the minor numerically by default: `v1.9` becomes `v1.10`. Initial release is `v1.0`; major changes require an explicit human request. Never move, delete, overwrite or recreate an existing tag. A conflicting tag needs the next allowed identity and a newly qualified candidate.
12
+
13
+ Use the reviewed identity helper with a verified SHA and tag inventory or explicit candidate product version:
14
+
15
+ ```text
6
16
  node .agents/skills/zaip-skill-github-deploy/scripts/resolve-release-identity.mjs --sha <sha> --channel <validation|production> --tags-json <verified-json>
7
17
  node .agents/skills/zaip-skill-github-deploy/scripts/resolve-release-identity.mjs --sha <sha> --channel <validation|production> --version <N.N>
8
18
  ```
9
19
 
10
- - Product tags use canonical `vN.N`: begin at `v1.0`, increment the numeric minor by default, and change major only on an explicit request. The helper selects the numeric maximum across verified tags, including prereleases.
11
- - A retry may reuse a tag only when it belongs to the exact candidate SHA. Never move, delete, or recreate a tag.
12
- - Create a validation release only after preparing and validating the reviewed Markdown body required by the [release-notes contract](release-notes.md): `gh release create <tag> --repo <owner/repo> --target <sha> --title <title> --notes-file <reviewed-notes.md> --prerelease --latest=false`. Never use `--generate-notes`; a compare link alone does not describe a release. Read the published body back with `gh release view <tag> --repo <owner/repo> --json body` and validate it against the same inventory before declaring success. Production is human-promoted, has a new SHA, and must qualify and version again.
13
- - Record the product version, tag, exact SHA, channel, prerelease flag, and GitHub Release URL. GitHub checks, registry integrity, smoke, and lifecycle closure remain separate evidence.
20
+ Frontend/backend follow their configured application branch, including main. Do not infer beta creation or a human promotion gate from main alone. Where the project selects a beta release, use prerelease without a version suffix. Database production retains its separate human-promotion requirement.
21
+
22
+ ## Reviewed notes and immutable delivery
23
+
24
+ Observe the entire previous-Release-tag-to-candidate Git range, or explicit initial inventory when no prior tag exists. Follow [release notes](release-notes.md); keep detailed change notes in the Release and the full Git range in source/evidence.
25
+
26
+ Create or resume the Release only for the verified candidate, using its reviewed UTF-8 notes file. Do not use generated notes alone. Resolve the tag's commit separately from `targetCommitish`, which may contain a branch name, and read back the body byte-for-byte.
27
+
28
+ Record version, tag, exact SHA, channel, prerelease state, Release URL, range and inventory. Local qualification, GitHub checks, registry proof and lifecycle closure are separate evidence. A missing prior tag is normal for initial mode, not a blocker.
14
29
 
15
- ## Deterministic recovery
30
+ ## Consumer boundary
16
31
 
17
- Resolve the candidate identity before any release mutation. A missing Release after exact-candidate qualification is normal: for a default deploy, create a new draft for the candidate SHA or resume an existing verified draft for that SHA. A published Release on that exact SHA must be verified as a no-op; retry only its observed failed CI within the bounded repair policy, never recreate the Release.
32
+ A consumer release is GitHub-only. Qualify its own actual checks and adopt its reviewed release route; never require framework package manifests, TGZ, npm channel, builder signing keys or protected builder policy. If that project already requires the signed consumer helper, use its own trust and commands under that policy; do not create a new signing requirement merely because release was selected.
18
33
 
19
- If the intended tag resolves to another SHA, never move, delete, or recreate it. For a consumer, select the next allowed minor under its release policy, then prepare its new exact candidate. For the framework, select the next allowed minor, update all required package manifests, commit the version change, and prepare and qualify the resulting candidate on its configured release branch. A changed candidate never inherits its predecessor's qualification.
34
+ Generic consumer deploy under auto selects commits. Only release mode enters this identity contract. One-shot explicit release does not change the saved preference.
20
35
 
21
- For a missing or expired receipt, use the candidate's configured preparation mechanism: a consumer runs its existing local `prepare` and `verify`; the framework uses its local release helper and receipt; a legacy remote qualification workflow runs only where the configured pipeline requires it, on the exact candidate SHA, branch, and channel. Observe a pending run; repair an observed failure under the existing limit of five cycles, stopping when the same cause remains after two repairs. Authentication, authorization, transport, or API failures do not establish that a Release, tag, receipt, or workflow run is absent; report them as access blockers. Keep exact-SHA readiness gates, protected trust rules, and human-only production promotion intact. A push-only request creates no Release; otherwise the deploy completes the Release flow.
36
+ ## Verified builder package and protected publisher
22
37
 
23
- For a first release, prepare the missing local notes and inventory in initial mode and validate them with `--initial`; absence of a prior tag is not a blocker.
38
+ Recognize framework source only through approved origin `zaip-ai/zaip-aios`, root package `@zaip-ai/aios` and public CLI package `@zaip-ai/cli`. Names or installed framework files do not prove builder identity; contradictory signals block classification.
24
39
 
25
- ## Framework package contract
40
+ Select the next allowed `N.N` from observed release history, then update canonical root `package.json#version` to `N.N.0` and align the declared public/CLI manifests through the version tooling before committing and qualifying. The root manifest is the candidate's version source. Do not allocate an independent GitHub tag or replace version strings broadly. Retries retain the already-assigned version.
26
41
 
27
- Consumer repositories remain GitHub-only and independent. Recognize the framework source only when the approved `origin` is `zaip-ai/zaip-aios`, the root package is `@zaip-ai/aios` and `public-cli/packages/cli/package.json` identifies `@zaip-ai/cli`. Read the versions from the root, `public-cli/package.json` and CLI package manifests; require the same canonical `N.N.0` version, then call the helper with explicit `--version N.N`. Never allocate an independent GitHub version in this repository. A version change must update the declared package metadata before the candidate is committed and qualified; do not replace version strings broadly.
42
+ Protected delivery uses `scripts/local-release-deploy.mjs`. First resolve mode in the Task's local area; only release mode may run signed `local-release-preparation.mjs prepare`. After that preparation successfully creates the receipt directory, save the actual UTF-8 human request at `<output-dir>/deploy-request.txt` and resolve its final-candidate contract to `<output-dir>/deploy-contract.json`. Do not pre-create the output directory just to write these files: preparation treats an existing directory as an immutable receipt cache. The resolver retains `--repository ROOT --request-file FILE --plan-file FILE`; the release helper reads only those fixed paths before reusing preparation or using publication credentials. Do not add request/plan CLI arguments or expand the installed hook allowlist. Resolve against the final committed candidate identity; stale contracts block delivery.
28
43
 
29
- Publishing a GitHub Release in this framework triggers its npm workflow. Report this consequence in the GitHub publication scope and follow the configured pipeline through terminal status; no second npm skill or local publication step is needed. A push-only request does not create a Release or publish npm. A successful GitHub Release with failed/unobserved npm checks is a partial result.
44
+ Only qualified GitHub Actions may publish `@zaip-ai/cli`. Never run local `npm publish`, `pnpm publish` or equivalents. Bind SHA, tag, package version and artifact digest.
30
45
 
31
- `qualify-cli.yml` is manual-only. It does not run on every push. For an explicitly
32
- requested extended qualification, dispatch it on the configured branch with the exact
33
- current head `sha` and matching `npm_channel`. This extended path qualifies source
34
- and the runtime matrix; it does not publish npm or create a Release.
46
+ With explicitly enabled `ZAIP_LOCAL_RELEASE_ENABLED=true`, use the signed local `essential-v3` receipt and enrolled public trust. GitHub verifies the published assets and runs one read-only exact-TGZ installation/doctor smoke before the isolated npm job. No legacy qualification receipt or private-draft pilot is required on that configured path.
35
47
 
36
- With explicitly enabled `ZAIP_LOCAL_RELEASE_ENABLED=true`, guarded delivery uses
37
- the signed local `essential-v3` receipt and enrolled public trust. It does not require a
38
- legacy `qualify-cli.yml` receipt or a private-draft pilot. GitHub verifies the
39
- published assets and runs one read-only exact-TGZ installation/doctor smoke before
40
- the separate npm publication job. Extended full qualification remains an explicit local option.
48
+ When the reduced path is disabled, retain the legacy publisher's exact-candidate qualification receipt and runtime matrix. `qualify-cli.yml` is manual-only; dispatch it only when that configured release path or an explicit extended qualification requires it. `github-readiness.mjs` binds repository, SHA, branch, channel, qualifying run/attempt, receipt lifetime and artifact digests. Maximum receipt lifetime remains seven days. Missing/failed/stale evidence never permits fallback publication.
41
49
 
42
- Only when the reduced path is disabled does the legacy publisher require
43
- `github-readiness.mjs` with `--workflow-path .github/workflows/qualify-cli.yml`
44
- and `--checks-json '["receipt"]'` for the exact repository, SHA, branch and channel.
45
- It verifies the qualifying run/attempt, receipt lifetime and artifact digests.
46
- Missing or failed evidence never permits fallback publication. Receipts have a
47
- maximum seven-day lifetime; a changed candidate requires new qualification.
50
+ Inspect configured signing paths, trust and protected policy before declaring a builder credential missing. Preserve the existing authority for routine version-specific updates of only `ZAIP_LOCAL_RELEASE_POLICY_B64`, with exact bytes and readback, described in [local preparation](../../zaip-skill-release-qualification/references/local-preparation.md). Trust rotation, changed protected settings or weaker gates require their own authority.
48
51
 
49
- Only the qualified GitHub Actions workflow may publish `@zaip-ai/cli` to npm. Never run `npm publish`, `pnpm publish`, or an equivalent local publication command. The workflow must bind the publication to the exact qualified SHA, tag, package version, and artifact digest.
52
+ A published builder Release with failed/unobserved npm is partial. Continue its observed recovery under the frozen Task profile, balanced 10 executions/3 replans, without a new Release for the same SHA or a separate five-cycle cap.