@zaip-ai/cli 4.8.0 → 5.0.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 (195) hide show
  1. package/dist/services/adapter-hook-sources.d.ts +3 -0
  2. package/dist/services/adapter-hook-sources.d.ts.map +1 -1
  3. package/dist/services/adapter-hook-sources.js +3 -0
  4. package/dist/services/adapter-hook-sources.js.map +1 -1
  5. package/dist/services/adapters.d.ts +1 -1
  6. package/dist/services/adapters.d.ts.map +1 -1
  7. package/dist/services/adapters.js +5 -2
  8. package/dist/services/adapters.js.map +1 -1
  9. package/dist/services/adapters.test.js +1 -1
  10. package/dist/services/adapters.test.js.map +1 -1
  11. package/dist/services/codex-conversation-lifecycle-hook.d.ts.map +1 -1
  12. package/dist/services/codex-conversation-lifecycle-hook.js +16 -6
  13. package/dist/services/codex-conversation-lifecycle-hook.js.map +1 -1
  14. package/dist/services/codex-hook-activation.d.ts +1 -1
  15. package/dist/services/codex-hook-activation.d.ts.map +1 -1
  16. package/dist/services/codex-hook-activation.js +116 -10
  17. package/dist/services/codex-hook-activation.js.map +1 -1
  18. package/dist/services/codex-pre-tool-cli-capture-template.d.ts +2 -0
  19. package/dist/services/codex-pre-tool-cli-capture-template.d.ts.map +1 -0
  20. package/dist/services/codex-pre-tool-cli-capture-template.js +104 -0
  21. package/dist/services/codex-pre-tool-cli-capture-template.js.map +1 -0
  22. package/dist/services/codex-pre-tool-cloud-template.d.ts +2 -0
  23. package/dist/services/codex-pre-tool-cloud-template.d.ts.map +1 -0
  24. package/dist/services/codex-pre-tool-cloud-template.js +190 -0
  25. package/dist/services/codex-pre-tool-cloud-template.js.map +1 -0
  26. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts +2 -0
  27. package/dist/services/codex-pre-tool-dependencies.test-support.d.ts.map +1 -0
  28. package/dist/services/codex-pre-tool-dependencies.test-support.js +9 -0
  29. package/dist/services/codex-pre-tool-dependencies.test-support.js.map +1 -0
  30. package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts +5 -0
  31. package/dist/services/codex-pre-tool-hook-fixture.test-support.d.ts.map +1 -0
  32. package/dist/services/codex-pre-tool-hook-fixture.test-support.js +19 -0
  33. package/dist/services/codex-pre-tool-hook-fixture.test-support.js.map +1 -0
  34. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts +2 -0
  35. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.d.ts.map +1 -0
  36. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js +107 -0
  37. package/dist/services/codex-pre-tool-hook-template-bootstrap.test.js.map +1 -0
  38. package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
  39. package/dist/services/codex-pre-tool-hook-template.js +152 -190
  40. package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
  41. package/dist/services/codex-pre-tool-hook-template.test.js +63 -75
  42. package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
  43. package/dist/services/codex-pre-tool-host-context-template.d.ts +2 -0
  44. package/dist/services/codex-pre-tool-host-context-template.d.ts.map +1 -0
  45. package/dist/services/codex-pre-tool-host-context-template.js +139 -0
  46. package/dist/services/codex-pre-tool-host-context-template.js.map +1 -0
  47. package/dist/services/codex-pre-tool-support-template.d.ts.map +1 -1
  48. package/dist/services/codex-pre-tool-support-template.js +77 -100
  49. package/dist/services/codex-pre-tool-support-template.js.map +1 -1
  50. package/dist/services/codex-subagent-hook-template.d.ts +1 -1
  51. package/dist/services/codex-subagent-hook-template.d.ts.map +1 -1
  52. package/dist/services/codex-subagent-hook-template.js +59 -15
  53. package/dist/services/codex-subagent-hook-template.js.map +1 -1
  54. package/dist/services/codex-validation-runtime-template.d.ts.map +1 -1
  55. package/dist/services/codex-validation-runtime-template.js +37 -10
  56. package/dist/services/codex-validation-runtime-template.js.map +1 -1
  57. package/dist/services/runtime-template-test-support.d.ts +1 -0
  58. package/dist/services/runtime-template-test-support.d.ts.map +1 -1
  59. package/dist/services/runtime-template-test-support.js +23 -2
  60. package/dist/services/runtime-template-test-support.js.map +1 -1
  61. package/dist/services/runtime-template.test.js +7 -24
  62. package/dist/services/runtime-template.test.js.map +1 -1
  63. package/package.json +1 -1
  64. package/templates/.agents/README-ENG.md +49 -7
  65. package/templates/.agents/README.md +41 -10
  66. package/templates/.agents/config/agents/discovery.json +1 -1
  67. package/templates/.agents/dashboard/.zaip-managed.json +125 -73
  68. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BW7Vy1cp.js → CostCalculationGuidePage-w6pjt4OM.js} +1 -1
  69. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BN8KQPrr.js → DashboardHelpDialog-DhlntQcR.js} +117 -17
  70. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Prcs-ydy.js → PricingSettingsDialog-BHoZT2an.js} +1 -1
  71. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-HqGUImIG.js → ProjectSettingsPage-IcncIZ9Y.js} +1 -1
  72. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-CNpmQMO4.js → TraceabilityWorkspace-C6rORjpr.js} +1 -1
  73. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-uPnOBShc.js +68 -0
  74. package/templates/.agents/dashboard/apps/frontend/dist/assets/{dashboard-localization-CF7B1Hjn.js → dashboard-localization-DWXjEIgc.js} +49 -7
  75. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DOhy6D2-.js → icons-vendor-Hc9fp_gs.js} +1 -1
  76. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-DX65Ufuu.js → index-BqeOEZW5.js} +2 -2
  77. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CkPC-yMz.js → react-vendor-C9ta_O10.js} +1 -1
  78. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-BEdGoIDm.js → traceability-IcefoTOv.js} +1 -1
  79. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  80. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  81. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  82. package/templates/.agents/dashboard/modules/cost-monitor/src/contracts.ts +10 -3
  83. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.run-page.test.ts +5 -1
  84. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostGroupsTable.period-values.test.tsx +2 -2
  85. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables-keeps-legacy-codex-identity-fields-blank.test.ts +5 -5
  86. package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +36 -43
  87. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-loaders.ts +1 -0
  88. package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-table-formatters.ts +6 -4
  89. package/templates/.agents/dashboard/modules/cost-monitor/src/server/aggregate.ts +2 -2
  90. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.ts +1 -1
  91. package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +11 -25
  92. package/templates/.agents/dashboard/modules/cost-monitor/src/server/cost-summary-defaults.ts +26 -0
  93. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  94. package/templates/.agents/dashboard/modules/operations/src/contracts.ts +11 -16
  95. package/templates/.agents/dashboard/modules/operations/src/planning-contracts.ts +14 -0
  96. package/templates/.agents/dashboard/modules/operations/src/react/DecisionTable.tsx +65 -0
  97. package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +5 -71
  98. package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +10 -36
  99. package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +7 -2
  100. package/templates/.agents/dashboard/modules/operations/src/react/use-operations-filter-sync.ts +66 -0
  101. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  102. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  103. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  104. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  105. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +229 -222
  106. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +167 -167
  107. package/templates/.agents/dashboard/packages/local-runtime/package.json +3 -3
  108. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +229 -222
  109. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.test.ts +38 -0
  110. package/templates/.agents/dashboard/packages/local-runtime/src/active-capture-failure.ts +35 -0
  111. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.test.ts +69 -6
  112. package/templates/.agents/dashboard/packages/local-runtime/src/active-codex-telemetry.ts +62 -15
  113. package/templates/.agents/dashboard/packages/local-runtime/src/manifest-runs.ts +8 -2
  114. package/templates/.agents/dashboard/packages/local-runtime/src/server-capture-projection-order.test.ts +118 -0
  115. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.test.ts +90 -0
  116. package/templates/.agents/dashboard/packages/local-runtime/src/server-cost-run-search.ts +86 -0
  117. package/templates/.agents/dashboard/packages/local-runtime/src/server-operations-routes.ts +8 -1
  118. package/templates/.agents/dashboard/packages/local-runtime/src/server-projection-loaders.ts +13 -0
  119. package/templates/.agents/dashboard/packages/local-runtime/src/server-projections.ts +30 -74
  120. package/templates/.agents/dashboard/packages/local-runtime/src/server-route-handlers.ts +42 -0
  121. package/templates/.agents/dashboard/packages/local-runtime/src/server-routes.test.ts +60 -0
  122. package/templates/.agents/dashboard/packages/local-runtime/src/server-run-projections.test.ts +12 -2
  123. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-command.test.ts +29 -4
  124. package/templates/.agents/dashboard/packages/local-runtime/src/server-telemetry-refresh.ts +7 -0
  125. package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +51 -54
  126. package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +37 -48
  127. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +5 -0
  128. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.test.ts +49 -0
  129. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.ts +44 -1
  130. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-cached-cost-page.ts +11 -10
  131. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +1 -1
  132. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-work-item-index.test.ts +18 -1
  133. package/templates/.agents/dashboard/packages/local-runtime/vitest.config.ts +12 -0
  134. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  135. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  136. package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-pagination.spec.ts +13 -6
  137. package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +1 -1
  138. package/templates/.agents/design/.zaip-managed.json +3 -3
  139. package/templates/.agents/design/apps/catalog/package.json +1 -1
  140. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  141. package/templates/.agents/requirements/autonomous-assurance.md +39 -3
  142. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  143. package/templates/.agents/requirements/comparative-audit.md +1 -1
  144. package/templates/.agents/requirements/context-engine.md +3 -3
  145. package/templates/.agents/requirements/cost-observability.md +1 -1
  146. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  147. package/templates/.agents/requirements/data-export.md +1 -1
  148. package/templates/.agents/requirements/design-system.md +1 -1
  149. package/templates/.agents/requirements/execution-engine.md +11 -2
  150. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  151. package/templates/.agents/requirements/model-orchestration.md +1 -1
  152. package/templates/.agents/requirements/public-distribution.md +1 -1
  153. package/templates/.agents/requirements/software-architecture.md +1 -1
  154. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  155. package/templates/.agents/requirements/work-lifecycle.md +2 -1
  156. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  157. package/templates/.agents/rules/cloud-hostinger-autonomy.md +1 -1
  158. package/templates/.agents/rules/production-readiness.md +24 -0
  159. package/templates/.agents/rules/run-lifecycle-closure.md +2 -1
  160. package/templates/.agents/rules/security.md +2 -2
  161. package/templates/.agents/rules/workflow.md +4 -3
  162. package/templates/.agents/runtime/VERSION +1 -1
  163. package/templates/.agents/runtime/bin/zaip.mjs +1185 -610
  164. package/templates/.agents/runtime/checksums.sha256 +6 -6
  165. package/templates/.agents/runtime/manifest.json +1 -1
  166. package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
  167. package/templates/.agents/runtime/provenance.json +5 -5
  168. package/templates/.agents/runtime/sbom.cdx.json +71 -71
  169. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +4 -2
  170. package/templates/.agents/skills/zaip-skill-execution/references/controlled-release-recovery.md +44 -0
  171. package/templates/.agents/skills/zaip-skill-execution/references/runtime-governance.md +1 -1
  172. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +7 -1
  173. package/templates/.agents/skills/zaip-skill-github-deploy/references/release-gate-matrix.md +15 -20
  174. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +38 -2
  175. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +62 -4
  176. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +8 -6
  177. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/guarded-commits.mjs +5 -3
  178. package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +7 -0
  179. package/templates/.agents/skills/zaip-skill-maintenance-enter/SKILL.md +23 -0
  180. package/templates/.agents/skills/zaip-skill-maintenance-enter/agents/openai.yaml +4 -0
  181. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.mjs +213 -0
  182. package/templates/.agents/skills/zaip-skill-maintenance-enter/scripts/maintenance.test.mjs +207 -0
  183. package/templates/.agents/skills/zaip-skill-maintenance-exit/SKILL.md +21 -0
  184. package/templates/.agents/skills/zaip-skill-maintenance-exit/agents/openai.yaml +4 -0
  185. package/templates/.agents/skills/zaip-skill-prd/SKILL.md +6 -0
  186. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +26 -0
  187. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +46 -11
  188. package/templates/.agents/skills/zaip-skill-spec/SKILL.md +9 -0
  189. package/templates/.agents/skills/zaip-skill-testing-strategy/SKILL.md +15 -0
  190. package/templates/.agents/zaip-aios/VERSION +1 -1
  191. package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +22 -0
  192. package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +1 -1
  193. package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +52 -5
  194. package/templates/template-manifest.json +210 -126
  195. package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Co2Jiuzh.js +0 -68
@@ -5,10 +5,20 @@ description: Qualify a release candidate after deploy mode resolution or an expl
5
5
 
6
6
  # Qualify a release candidate
7
7
 
8
+ For new release evaluations, use the versioned binary `proportional-acceptance-v1` contract in `@zaip-ai/specs` and `docs/quality/production-readiness.md` through `zaip plan acceptance --input <contract.json>`. This command only checks self-reported data and never authorizes publication; authenticated pipeline receipts remain the gate. Map each mandatory outcome to its origin, applicability, sufficient proof, owner and stop condition; bind release proof to the exact candidate. Optional improvements do not block. The historical technical grade remains informative and unchanged. Local qualification uses the declared Windows host; the GitHub Linux smoke is a remote publication check. Do not require local Docker, WSL or another OS by inference.
9
+
8
10
  Use after `$zaip-skill-github-deploy` resolves release mode, or when local preparation/qualification is explicitly requested. Resolve deploy mode first using [the deployment contract](../zaip-skill-github-deploy/references/deployment-workflow.md). Generic consumer deploy under auto and explicit commits mode use scoped checks and `guarded-commits.mjs`; they do not acquire a release gate from this skill.
9
11
 
10
12
  Preparation, verification and dry-run do not publish. The request's resolved route supplies publication authority separately.
11
13
 
14
+ For readiness grades, load `RULE-PRODUCTION-READINESS` and apply
15
+ `technical-essential-v1` from `docs/quality/production-readiness.md`. Grade 9
16
+ requires the six essential criteria; grade 10 adds reviewed concurrency,
17
+ process interruption/recovery and representative load. There is no minimum
18
+ observation period or production-cycle count. This technical assessment never
19
+ waives the distribution gates below, changes a historical audit, or proves
20
+ long-term stability. Keep operational history and publication status separate.
21
+
12
22
  ## Select the distribution surface
13
23
 
14
24
  - Verified ZAIP builder requires approved `zaip-ai/zaip-aios` origin and both `@zaip-ai/aios` root/`@zaip-ai/cli` public CLI package identities. Apply `zaip-skill-update-version-doc`; root manifest defines candidate `N.N.0`, aligned to GitHub `vN.N`.
@@ -23,8 +33,16 @@ Local builder preparation defaults to signed `essential-v3`: deterministic sourc
23
33
 
24
34
  These dense distribution checks are release gates. Change validation outside release remains targeted, with installer/security checks selected when directly impacted. Do not automatically run the full suite for generic commits, impose a test-count ceiling or classify a Task by wallclock duration.
25
35
 
36
+ For a multi-Task delivery, verify changed code and affected dashboard flows by
37
+ impact during the Tasks, integrate modified contracts, and run full package
38
+ qualification once against the final candidate before publication. Reuse
39
+ prior evidence only when candidate identity, environment and contract remain
40
+ valid; later changes revalidate affected proof.
41
+
26
42
  Use `--profile full` for explicitly requested extended `full-v2` qualification, including full source, browser and XLSX coverage. Changed dashboard/export behavior still needs its relevant tests in the current Change. Rapid impact checks emit no signed release receipt and cannot substitute for release qualification.
27
43
 
44
+ Post-receipt rapid group reuse follows `docs/quality/v49-deploy-cache-controls.md`. Only a reviewed Git-versioned group proof may yield a HIT; promote a failed result as the latest tombstone before retry. This never replaces signed candidate qualification.
45
+
28
46
  The framework helper uses an isolated exact-SHA clone, builds once, verifies the exact TGZ and signs a receipt. Cache validity requires matching candidate, policy, gate definitions, runtime, channel, version, trusted key, expiry and artifact digests. Failed/timed-out gates emit no successful receipt; changed candidates or invalid evidence require new qualification.
29
47
 
30
48
  Resolve builder signing material from the configured stable private directory and run `scripts/local-release-key.mjs preflight` before expensive gates. Inspect actual key/trust/policy configuration before claiming absence. Missing/mismatched required material fails closed; never generate replacement keys, rotate trust or remove signatures during routine deploy.
@@ -43,10 +61,18 @@ Where the legacy path remains configured, retain its separate exact-candidate qu
43
61
 
44
62
  Recover under the frozen Task autonomy profile: balanced permits 10 executions total and 3 replans. Individual tests/tool calls and elapsed time are not executions, and continuation never resets the ledger.
45
63
 
64
+ Use eligible recovery before a terminal block: the three balanced replans use
65
+ Sol/high, Sol/high and Astra/high and each releases up to three repairs. A real
66
+ authority/access/capability blocker may stop earlier; do not manufacture three
67
+ attempts against an unchanged unavailable prerequisite. Keep the exhausted
68
+ ledger, actual findings and resume condition; never lower acceptance criteria.
69
+
46
70
  The framework release cut uses `node scripts/release-cycle-gate.mjs freeze --repository ROOT --version N.N --release-task TASK-ID --release-run RUN-ID`. The exceptional coordinator is the critical, release-only Task at the end of the owner SPEC's exact Execution DAG. Every predecessor Task must be completed; only the release Task may still execute. Its delegated Task orchestrator Run must be active under that SPEC's active macro Run. `audit` and `advance` recheck predecessor status and authenticate the same Task, Run, SPEC, Execution and committed candidate records; only the release Task and owner SPEC are exempt from the open-work gate. Unrelated work remains blocked. The candidate commits the frozen cycle before qualification. The deploy helper checks its exact SHA, pushes only `main`, and requires successful CI on that SHA before publication.
47
71
 
48
72
  For an authorized Task-first request that combines a product fix and its release in one direct Task root, use the explicit `--integrated-task` freeze option with that Task and active root Run. The Task must be critical, target the current release, own the release-cycle config scope and have a delivery Execution bound to its Change. `audit` and `advance` authenticate its committed Task and Run start, while all other current-release work, secondary worktrees and remote branches still block. This route avoids creating a second root Run or asking the user for a new turn solely to publish already authorized work. Do not use it for a delegated SPEC release Task or as a general waiver for release checks.
49
73
 
74
+ For an authorized SPEC whose final critical Task combines implementation and publication, use the separate explicit `--integrated-spec-task` option with its delegated delivery Run. It requires the exact active macro Run, SPEC, Change and delivery Execution, a unique terminal Task in the committed DAG, all predecessors completed, the current target release and the literal `.agents/config/release-cycle.json` write scope. The persisted `integrated_spec_task` mode is rechecked at audit and advance; unknown modes fail closed. It cannot be combined with `--integrated-task`, which remains exclusive to direct Task roots. Broad product scopes alone never grant this mode. Clean candidate, committed coordinator records, unrelated open-work exclusion, exact-SHA CI, signed artifact and npm gates remain mandatory.
75
+
50
76
  For the one-time 4.5→4.6 recovery, `adopt-published` requires the published 4.5 tag to be an ancestor of remote `main`, remote `main` to be an ancestor of clean local `main`, and observed stable GitHub Release/npm integrity. Pass the exact owner `--owner-spec`, `--owner-execution`, `--owner-run`, planned `--release-task` and active delegated Task orchestrator `--actor-run`. That actor must own the release Task's unique direct predecessor; all earlier DAG Tasks must be completed. Only the actor Task, planned release Task and owner SPEC are exempt from the open-work gate. After review/Evidence and a clean metadata checkpoint, perform adoption while that predecessor Task and its actor Run are still active. Then use `spec retarget-release SPEC --from 4.5 --to 4.6 --run DELEGATED_TASK_RUN` with the same actor Run. Close the predecessor Task through Gui only after retarget; start the release Task afterward. The revision records adoption SHA and actor Run, and the release Task's missing target resolves through its owner SPEC. Do not edit records directly to retarget.
51
77
 
52
78
  After exact Release, npm and candidate CI are observed, `advance --from N.N --to NEXT --sha CANDIDATE --ci-run-id ID` opens the next cycle while the coordinator remains active. Bind Task/SPEC Evidence to the immutable published candidate before Gui, then close Task and parent SPEC. Make one reviewed metadata-only closure commit; push that exact local main SHA through `scripts/local-release-deploy.mjs push-closure` with published SHA, expected remote SHA and the exact metadata path inventory. The tag remains on the published candidate. Confirm CI on the new main SHA; local closure alone is not complete publication. This contract does not prove provider deployment.
@@ -6,7 +6,7 @@ Preparation does not authorize publication. Use guarded delivery only for the re
6
6
 
7
7
  The project-owned `.agents/config/deploy-policy.json` (schema version 1, `default_mode: auto|commits|release`) is separate from the builder's signed qualification policy below. Installing skills in a consumer never grants builder capability or requires builder keys/protected settings.
8
8
  Store keys, trust stores, receipts and artifacts outside the repository. Commit and synchronize first;
9
- every gate is bound to the resulting clean SHA. Repair changes require a new candidate.
9
+ every gate is bound to the resulting clean SHA. Before expensive gates, validate the active coordinator route: release-only, direct `--integrated-task`, or final SPEC `--integrated-spec-task` as defined in the canonical qualification skill. Repair changes require a new candidate.
10
10
  Qualification uses an independent local Git clone at that exact SHA, with copied
11
11
  objects and complete commit history, not a worktree sharing the caller's registry.
12
12
  This prevents dashboard source discovery from importing the main checkout or other
@@ -15,7 +15,7 @@ unchanged. Cleanup retries transient Windows locks and preserves the original ga
15
15
  error if cleanup also fails. A cleanup failure never produces a success receipt.
16
16
 
17
17
  When the ZAIP Codex PreToolUse hook is enabled, run release preparation, verification and
18
- guarded delivery as separate literal commands. Its external-path exception is limited to
18
+ guarded delivery as separate literal commands. In repository-restricted profiles, its external-path exception is limited to
19
19
  the reviewed release helpers, the declared SHA and version, the matching candidate
20
20
  directory under `~/.codex/release-candidates/zaip-aios/`, and key material under
21
21
  `~/.codex/release-keys/zaip-aios/<key-id>/`. It does not permit arbitrary home
@@ -24,10 +24,19 @@ unrelated path or compound command is an intentional safety decision, not a fail
24
24
  release gate. Persistent repository edits additionally require a current Task Run with
25
25
  the exact Codex thread and turn correlation.
26
26
 
27
+ The configured `zaip-aios-full-access` profile also permits ordinary external
28
+ read/write/execute, working-directory, and network access. The restrictions above
29
+ describe the narrow exception for repository-restricted profiles, not a blanket
30
+ denial of configured full access. Neither profile bypasses secret protection,
31
+ destructive-operation controls, lifecycle authority, stricter child permissions,
32
+ or the ban on computer power/session actions. Release helpers still verify
33
+ their exact repository, candidate, signing material, receipt, and authorization.
34
+
27
35
  For native `exec_command`, the hook validates both the chat's `cwd` and the command's
28
36
  explicit absolute `workdir`. A registered worktree may be the execution root even
29
37
  when the chat remains in the primary checkout. Unregistered roots, links, relative
30
- overrides and missing exact worktree Run authority remain blocked; a primary
38
+ overrides remain subject to the configured access profile. Missing exact worktree
39
+ Run authority for governed product mutations remains blocked; a primary
31
40
  checkout's Task is never a global fallback for mutations in another checkout.
32
41
 
33
42
  Some hosts present these commands as `Bash` without exposing a workdir override.
@@ -35,14 +44,15 @@ In that case, invoke the literal reviewed helper from the chat checkout and pass
35
44
  the registered worktree in `--repository`. Only the helper may target that explicit
36
45
  root, after physical-root, Git registration and common-directory verification;
37
46
  its own preflight checks the exact clean SHA before any gate. This is not an
38
- exception for arbitrary commands or filesystem access.
47
+ exception for arbitrary commands or filesystem access in a restricted profile.
39
48
 
40
49
  ## Verified builder signing material
41
50
 
42
51
  The following key and protected-policy requirements apply only to the verified ZAIP builder, not ordinary consumer GitHub releases.
43
52
 
44
53
  The signing key ID is the trusted identity, not a filename. Resolve it with
45
- `gh variable get ZAIP_LOCAL_RELEASE_TRUSTED_KEY_ID --repo zaip-ai/zaip-aios`.
54
+ `gh variable get ZAIP_LOCAL_RELEASE_TRUSTED_KEY_ID` from the verified builder
55
+ checkout after checking its configured origin.
46
56
  By default, the private key lives at
47
57
  `~/.codex/release-keys/zaip-aios/<key-id>/release-private.pem` and its local
48
58
  trust store at `~/.codex/release-keys/zaip-aios/<key-id>/trust/` on the current
@@ -121,6 +131,9 @@ doctor/SQLite/API smoke. It does not run browser navigation across every dashboa
121
131
  exports. `--profile full` explicitly selects `full-v2`, which also runs the full source suite,
122
132
  browser and XLSX qualification. Dense distribution checks belong to builder release; a normal
123
133
  Change runs targeted validation, including installer/security regressions when directly impacted.
134
+ The essential source-size gate reports 401–800-line debt and stale warning ceilings as visible
135
+ warnings, while files above 800 lines and provenance or baseline tampering remain blocking.
136
+ The explicit `full-v2` profile keeps the strict source-size debt gate.
124
137
  Individual process/test timeouts remain technical limits, not a Task wallclock or abandonment rule.
125
138
  Retain failed-gate evidence and cleanup outcomes; a failed/timed-out gate emits no success receipt.
126
139
  Receipts bind the selected profile and fixed gate list, so stale receipts require requalification.
@@ -131,9 +144,12 @@ critical baseline and affected consumers without a test-count cap. An unmapped i
131
144
  an evidenced broader selection; it does not make every generic commits deploy run the full suite.
132
145
  Rapid checks never prove full release qualification. Observe pending commands through the host's
133
146
  wait mechanism instead of treating elapsed Task time as a result.
134
- Retain Windows/Linux Node 22.16.0 and 24.x matrix outcomes against the same exact TGZ,
135
- recording the actual Node patch version and digest. A configured matrix is not proof that
136
- its jobs ran; unavailable runtime execution remains unverified, never passed.
147
+ Qualify the exact TGZ on the authorized local host and record its actual OS, Node patch
148
+ version and digest. The GitHub publisher performs the bounded Linux smoke on that same
149
+ digest before npm publication. A configured matrix is not proof that its jobs ran;
150
+ unavailable runtime execution remains unverified, never passed. The Windows/Linux
151
+ Node 22.16.0 and 24.x matrix remains historical v4.6 evidence, not a default gate
152
+ for each later release.
137
153
  Reuse an existing output directory only with its complete valid signed candidate; an invalid cache
138
154
  is refused. Choose a new output path after repair instead of deleting or overwriting evidence.
139
155
 
@@ -167,8 +183,11 @@ node scripts/local-release-preparation.mjs stage-inputs --sha <40-character-sha>
167
183
 
168
184
  `stage-inputs` accepts no source, receipt, output, home, key or policy path flags. It
169
185
  derives the candidate directory, verifies clean `main`, canonical origin, the signed
170
- receipt, v4.6 essential profile, trusted `maintainer-v4` key and policy digest, the
171
- exact release inventory, and a direct human request resolved as builder Release 4.6.
186
+ receipt, the selected essential profile, trusted `maintainer-v4` key and policy digest,
187
+ the exact release inventory, and a direct human request resolved as that builder Release.
188
+ Explicit major transitions such as `4.9 → 5.0` are supported. The inventory must
189
+ start at the highest canonical stable ancestor tag below the requested version;
190
+ prerelease, unmerged, future and stale-range tags cannot substitute for it.
172
191
  It installs `deploy-request.txt`, `release-notes.md`, `release-inventory.json` and
173
192
  `deploy-contract.json` inside that candidate directory with complete-byte readback,
174
193
  idempotent retry and conflict rejection. The protected release helper reads the
@@ -185,11 +204,27 @@ node scripts/local-release-deploy.mjs --repository <absolute-repository> --expec
185
204
  `--dry-run` prepares and verifies without sending. The live command verifies again around
186
205
  delivery, sends the exact SHA, verifies the remote, creates a draft GitHub Release, uploads all
187
206
  four assets and publishes the release. Existing incompatible tags/assets fail without overwrite.
188
- The helper never invokes local npm publication.
207
+ The helper never invokes local npm publication. Durable `release-stage-*.json`
208
+ observations bind SHA/version/receipt digest and never replace fresh verification.
209
+ A retry recognizes an exact remote push, uploads only absent matching assets and
210
+ does not republish an already public matching Release. Conflicts fail closed.
211
+ The four assets must be regular files in the real candidate directory. The helper
212
+ observes npm version, latest and exact TGZ SRI with bounded propagation retries.
189
213
  Notes and inventory must satisfy [the release notes contract](../../zaip-skill-github-deploy/references/release-notes.md).
190
214
  For the first release, replace `--from` with explicit `--initial`. The helper validates the notes
191
215
  against the Git range before push and compares the draft and published bodies with those notes.
192
216
 
217
+ After release-cycle advancement and formal closure, the single metadata-only commit uses:
218
+
219
+ ```text
220
+ node scripts/local-release-deploy.mjs push-closure --repository ROOT --expected-repository zaip-ai/zaip-aios --branch main --version N.N --published-sha CANDIDATE --closure-sha CLOSURE --expected-remote-sha CANDIDATE --metadata-paths-file REVIEWED_JSON --receipt RECEIPT --tarball TGZ --policy POLICY --trust-store TRUST --notes-file NOTES --output-dir CANDIDATE_DIR
221
+ ```
222
+
223
+ This rechecks the valid signed receipt against the immutable published Git tree,
224
+ exact Release assets/body/latest, registry SRI/latest, recorded published CI and
225
+ reviewed metadata diff. Remote main may already equal CLOSURE after interruption;
226
+ retry then observes its CI without another push. Receipt expiry remains enforced.
227
+
193
228
  ## Installed consumer: independent GitHub release
194
229
 
195
230
  Auto mode defaults to commits plus push in a consumer. It needs scoped project checks and
@@ -5,6 +5,13 @@ description: Create, refine, prepare, or analyze a technical ZAIP SPEC on explic
5
5
 
6
6
  # Trabalhar com SPECs
7
7
 
8
+ Antes de promover uma SPEC ou sua DAG nova, avalie suficiência pelo contrato binário `proportional-acceptance-v1` de `@zaip-ai/specs` (`docs/quality/production-readiness.md`) via `zaip plan build --acceptance <contrato.json>` e valide o plano embutido. Cada AC obrigatório registra origem, aplicabilidade, resultado observável, prova suficiente, responsável e parada; toda dependência da DAG tem resultado verificável. Critério local fora do ambiente declarado falha no preparo. Pendência opcional não bloqueia; finding novo ou candidato alterado justifica outra rodada. Snapshots antigos só mudam por migração explícita versionada e atribuída.
9
+
10
+ Mapeie cada mudança da DAG a testes de código e aos fluxos de dashboard
11
+ afetados. Integre contratos modificados antes do release; qualifique o pacote
12
+ completo uma vez no candidato final antes de publicar, revalidando provas
13
+ atingidas por correções posteriores.
14
+
8
15
  SPEC é opcional para trabalho técnico amplo; Task-first continua válida para uma mudança pontual. A SPEC permanece em Planejamento com `status: draft` durante criação, revisão, refinamento e `prepare`.
9
16
 
10
17
  ## Limite de autoridade
@@ -25,6 +32,8 @@ SPEC é opcional para trabalho técnico amplo; Task-first continua válida para
25
32
  6. A criação, o rework e o prepare da SPEC exigem uma Run delegada e ativa do Rafa (`zaip-agent-builder`), com propósito `execution`, sob o orquestrador do turno raiz atual; passe essa Run em `--run`, ou em `--spec-run` quando a SPEC for materializada por `prd create --plan`. Não aceite replay histórico nem a Run da Bia como autoria técnica. Não crie registros Task, Change ou Execution antes de `ready|execute`; vincule sempre a Run realmente observada e o `creation_run_id` à SPEC e agregue telemetria somente quando observada ou reconciliada.
26
33
  7. Depois de materialização, use rework rastreável e preserve snapshots/tentativas.
27
34
 
35
+ Para o defeito específico de versão de `pnpm` em snapshot já materializado, a [revisão controlada](../zaip-skill-execution/references/controlled-release-recovery.md) altera somente a versão comprovada em `package.json` e sua descrição, com Decision humana exata, revisão esperada e histórico de implementação. Não edite o frontmatter diretamente.
36
+
28
37
  ## Prepare
29
38
 
30
39
  1. Valide referências, cobertura de AC, IDs, ciclos, conflitos de paralelismo, comandos de verificação e o snapshot de stack contra a configuração atual do projeto.
@@ -28,6 +28,21 @@ requires its relevant integrity and regression checks outside release. Consumer
28
28
  its own project checks, without builder npm, signing-key or protected-policy requirements.
29
29
  Preparation is evidence, never publication authority.
30
30
 
31
+ When defining PRD, SPEC and ACs, map each changed behavior to focused code
32
+ checks and dashboard flows actually affected. Integrate modified contracts
33
+ before release, then qualify the full package once on the final candidate
34
+ before publication. Reuse proof only when candidate identity, environment,
35
+ contract and impact still match; code checks do not establish served behavior.
36
+
37
+ For the 4.9 consolidation, the recovery Task proves changed code with focused
38
+ regressions, independent review and finalization. Operational collection and
39
+ project settings without served proof remain `unverified`. Integrate only
40
+ changed flows and contracts in the integration phase; run full package
41
+ qualification once on the final candidate before publication. Preserve exact
42
+ candidate and applicable critical assurance requirements. See Decisions
43
+ `DEC-AI-2026-10-03-22-18-TAREFA2-ACEITE-CODIGO-XFQFBLLYRN` and
44
+ `DEC-AI-2026-10-03-22-16-QUALIFICACAO-FINAL-UNICA-UPQGEC6JJV`.
45
+
31
46
  Keep failure evidence and recover within the frozen Task profile. Balanced allows 10 executions
32
47
  total and 3 replans; individual tests, tool calls and elapsed time are not executions, and a
33
48
  continuation does not reset the ledger. Individual test/tool timeouts remain technical limits;
@@ -1 +1 @@
1
- 4.8
1
+ 5.0
@@ -19,6 +19,28 @@ exportações e contas preservam `null`/cobertura, sem somar esse zero visual.
19
19
 
20
20
  ## Contagem de autonomia e consultas compactas
21
21
 
22
+ ### Tempo observado, duração ativa e distribuição por dia
23
+
24
+ O Top 5 SPECs usa a união dos intervalos observados das Runs-raiz vinculadas a
25
+ cada SPEC. Não soma novamente os filhos e não substitui o tempo decorrido pela
26
+ duração ativa atribuída a tokens. O subtítulo é **“Tempo observado por SPEC.”**;
27
+ as explicações de cálculo pertencem ao guia e aos detalhes da métrica.
28
+ SPECs distintas podem compartilhar intervalos: a soma por SPEC não é tempo
29
+ global exclusivo. Nenhuma hora é criada a partir do tempo de processamento do
30
+ print sem timestamps e vínculo observáveis.
31
+
32
+ No Monitor de Custos, o tempo diário é a união dos intervalos das atividades
33
+ elegíveis, divididos nas viradas de dia de São Paulo, sem duplicar sobreposições.
34
+ Filtros de dimensão são aplicados antes da união; atividades sem duração
35
+ conhecida mantêm cobertura parcial. Uma execução de cerca de 21 horas que cruza
36
+ a meia-noite pode aparecer distribuída em dois dias, sem exigir 21 horas em cada
37
+ linha. Tempo decorrido, duração ativa e soma de invocações são métricas diferentes.
38
+
39
+ A correção entregue na v4.7 e preservada na v4.8 percorre fonte canônica,
40
+ SQLite, API e UI. Regressões incluem uma Run-raiz de aproximadamente 21 horas,
41
+ seus filhos e a divisão diária. Números e screenshots históricos continuam
42
+ vinculados à execução observada; não são prova automática de um novo candidato.
43
+
22
44
  ### Leitura dos números do Dashboard
23
45
 
24
46
  O total operacional de Tasks, a distribuição por risco e as contagens temporais
@@ -44,7 +44,7 @@ com o hook ativo e compare o motivo, a sessão e o turno da nova execução.
44
44
  | Caso | Comportamento esperado e teste |
45
45
  | --- | --- |
46
46
  | Stop com `invalid stop hook JSON output` | A saída usa `{}` ou `decision: block` com `reason`, nunca um `hookSpecificOutput` de Stop. Testar todos os caminhos de saída, inclusive erro e continuação. |
47
- | Resposta útil substituída por aviso de telemetria no Stop | Pendência de transcript, contabilização, lock ou CLI fica no recibo e retorna `{}`, sem criar outro prompt. Somente estado de Task própria comprovado nesta invocação pode pedir uma continuação; `stop_hook_active` impede repetição. |
47
+ | Resposta útil substituída por aviso de telemetria no Stop | Pendência de transcript, contabilização, lock ou CLI fica no recibo e retorna `{}`, sem criar outro prompt. Stop nunca pede continuação automática nem substitui a resposta; o responsável recupera a execução autorizada antes de encerrar, ou informa um bloqueio real com condição de retomada. |
48
48
  | Transcript local `\\?\C:\...` | Normalizar o namespace local nas duas camadas de verificação. UNC de rede, devices, links e sessão divergente continuam recusados. |
49
49
  | Executor nativo bloqueado por correlação | Conferir sessão do pai + turno do filho, além da sessão nativa do filho. Registrar somente vínculo comprovado; não usar a Task global mais recente. |
50
50
  | Busca textual por `AC-...`, `Remove-Item` ou `;` | Diferenciar argumento literal de comando executável. Leituras literais não viram mutação por palavras na pesquisa; redirecionamentos e composição destrutiva continuam protegidos. |
@@ -30,9 +30,12 @@ impacto; instalador/segurança diretamente alterados mantêm seus testes discrim
30
30
  Somente o SHA limpo aprovado recebe recibo assinado, manifesto, SBOM e TGZ.
31
31
  Falha ou dados incompletos não produzem aprovação.
32
32
 
33
- No GitHub, checks de fonte (`quality.yml`), commits (`commit-policy.yml`) e matriz
34
- completa (`qualify-cli.yml`) ficam manuais. As mesmas validações principais são
35
- executadas localmente pelo Codex/scripts antes da release.
33
+ No GitHub, os workflows separados de fonte (`quality.yml`), commits
34
+ (`commit-policy.yml`) e matriz completa (`qualify-cli.yml`) ficam manuais.
35
+ Isso não desativa `pre-main-candidate.yml`: cada push em `main` dispara checks de
36
+ integridade, lint, tipos, identidade dos commits e regressões selecionadas por impacto.
37
+ Os checks locais antecedem o push; o CI do SHA enviado precisa terminar verde
38
+ antes de publicar a Release, sem criar branch remota candidata.
36
39
 
37
40
  Após qualificação local assinada e cadastro autorizado da chave pública/política,
38
41
  o mantenedor ativa `ZAIP_LOCAL_RELEASE_ENABLED=true`. O deploy publica os quatro
@@ -61,6 +64,18 @@ inválida ou integridade diferente impedem publicar. Após uma publicação
61
64
  autorizada, a confirmação do mesmo tarball usa retry finito de propagação.
62
65
  Esse controle não publica automaticamente quando a qualificação local passa.
63
66
 
67
+ Na v5.0, o publisher mantém checkpoints por SHA, versão e hash do recibo para
68
+ prepare/push/CI/assets/Release/npm/closure. A retomada sempre consulta o estado
69
+ remoto e revalida a assinatura: efeitos já confirmados não são reenviados.
70
+ Assets são quatro arquivos regulares no diretório real do candidato, com digest
71
+ exato no GitHub; links simbólicos e conflitos bloqueiam. A transição explícita
72
+ `4.9 → 5.0` usa a maior tag estável canônica ancestral como início do inventário.
73
+ O fechamento exige recibo/TGZ/política/trust/notas/diretório, confere a árvore Git
74
+ publicada e SRI/latest npm e aceita somente um commit revisado de metadados.
75
+ Se `main` já estiver nesse fechamento, apenas observa seu CI. A validade temporal
76
+ do recibo permanece obrigatória. Consulte a referência canônica
77
+ `zaip-skill-release-qualification/references/local-preparation.md` para os comandos.
78
+
64
79
  | Objetivo | Comando da raiz e alcance |
65
80
  | --- | --- |
66
81
  | Preparar artefatos | `corepack pnpm release:artifacts` compila e gera runtime/template. Não publica nem qualifica por si só. |
@@ -246,10 +261,42 @@ com testes de correção e uma release publicada não comprovam economia ou SLA.
246
261
  Não repita automaticamente a matriz histórica falha: preserve o diagnóstico e
247
262
  defina uma medição independente com artefatos identificados e falhas observadas.
248
263
 
264
+ ## Evolução de confiabilidade e documentação
265
+
266
+ A [matriz de evolução](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v50-documentacao-editorial.md)
267
+ vincula as dez frentes aos seus comandos, provas, rollback e limitações.
268
+ READMEs PT/EN descrevem o mesmo contrato: `essential-v3` por padrão,
269
+ `full-v2` somente quando selecionado, CI na `main` exata antes da Release,
270
+ smoke Linux do TGZ assinado antes do npm e confirmação da integridade publicada.
271
+ Preparar e validar localmente não comprovam publicação ou ativação dos hooks.
272
+
273
+ Uma Task explicitamente editorial `lite` aceita README literal ou Markdown
274
+ em escopo documental estreito, como `docs/quality/**`; `docs/**` amplo,
275
+ código, configuração e controles de agente não recebem a exceção. A dispensa
276
+ da Decision de seis etapas conserva candidato, check, Evidence, revisão e Gui.
277
+ Alterar esse mecanismo continua sendo trabalho crítico quando houver sinal de
278
+ segurança. `draft` persiste blueprints; `ready` materializa Tasks `planned`;
279
+ `execute` inicia o menor grão autorizado, sem inferir conclusão dos blueprints.
280
+
281
+ O resolver reconhece o pedido direto de retomar a SPEC até finalizar as Tasks
282
+ e publicar a versão explícita. Citação, negação, pergunta ou condição de
283
+ aprovação não concedem publicação. O override vale somente para o pedido.
284
+ Manutenção usa o mesmo `maintenance.mjs` da skill de entrada com `enter|exit`;
285
+ tracking fica ligado e a saída exige observação nativa. `full-access` conserva
286
+ proteções de segredos, destruição, lifecycle, filhos restritos e energia do PC.
287
+
249
288
  ## Ciclo corrente, limpeza e CI da main antes da Release
250
289
 
251
290
  O manifesto versionado `.agents/config/release-cycle.json` identifica `current_release` e estado `open`/`frozen` (4.5 e 4.5.0 são normalizados). Drafts de PRD/SPEC futuros são permitidos; ready/execução, novas Tasks e código exigem o release corrente. Depois de conciliar Tasks atuais, prove `main`, branches, worktrees e registros antes do candidato. Branch/worktree isolados são fechados com backup local recuperável; checkout compartilhado com diff de proveniência mista bloqueia. A existência de `main` ou de um teste verde isolado não qualifica a release.
252
291
 
253
- Para congelar, use `node scripts/release-cycle-gate.mjs freeze --repository ROOT --version 4.5`. Se uma Task de coordenação de release precisa ficar em execução durante o corte, ela deve ser crítica, alvo corrente, ter escopos exclusivos de release e Run raiz ativa; declare seus IDs com `--release-task TASK-ID --release-run RUN-ID`. Esses IDs ficam no manifesto frozen. Finalize Task/Run e inclua seus records no commit candidato final antes de `audit`; `audit` e `advance` verificam estado concluído e conteúdo exato desses records no SHA. Uma Task genérica com escopos amplos não recebe exceção.
292
+ Para congelar, use `node scripts/release-cycle-gate.mjs freeze --repository ROOT --version VERSAO`. A exceção da Task de coordenação exige risco crítico, alvo corrente, IDs explícitos `--release-task TASK-ID --release-run RUN-ID` e vínculos canônicos válidos. O manifesto frozen registra esses IDs. Há três contratos distintos:
293
+
294
+ - **Coordenação simples:** escopos exclusivos de release e Run raiz; após freeze, conclua Task/Run e integre os records antes de `audit`. `audit` e `advance` exigem estado concluído.
295
+ - **Coordenação integrada:** acrescente `--integrated-task` ao freeze. A Task raiz de delivery fica `executing`, sua Run permanece ativa e os escopos incluem a configuração do ciclo. O manifesto registra `release_mode: integrated_task`; `audit` e `advance` verificam os records da Task no SHA e excluem somente a coordenação declarada do gate de trabalho aberto. Essa modalidade admite ajustes do corte nos escopos autorizados, sem fingir conclusão antes da publicação.
296
+ - **Coordenação delegada de SPEC:** o gate verifica ancestralidade, Execution, SPEC e predecessores concluídos. A Task/Run responsável permanece ativa durante publicação/avanço; os records de coordenação exigidos precisam estar integrados no SHA. A exceção não se estende a outras Tasks ou SPECs abertas.
297
+
298
+ Nos modos ativos, depois das provas de publicação, registre validações e Evidence, realize revisão quando exigida e obtenha Gui como último filho. O host autorizado persiste a decisão real e o fechamento. Um commit posterior somente de records/metadata pode guardar esse encerramento; ele não requalifica o produto nem move a tag. O contrato executável está em `scripts/release-cycle-coordination.mjs` e `scripts/release-cycle-gate.mjs` no repositório mantenedor.
299
+
300
+ Com candidato limpo em SHA exato, execute `node scripts/release-cycle-gate.mjs audit --repository ROOT --version VERSAO --sha SHA`. O deploy crítico/de release executa os checks locais nesse SHA, envia apenas `main` ao GitHub e espera `pre-main-candidate.yml` verde para o push exato antes da Release. Falha local bloqueia o push; falha de CI ou credenciais bloqueia a Release e exige reparo autorizado em `main`. Após observar tag, GitHub Release, main e CI exatos, `node scripts/release-cycle-gate.mjs advance --repository ROOT --from VERSAO --to PROXIMA --sha SHA --ci-run-id ID` registra a transição. As outras Tasks correntes devem estar terminais; somente a coordenação ativa validada acima pode permanecer aberta. Cada superfície, inclusive npm ou provedor, tem prova própria. O avanço não conclui automaticamente a Task de coordenação nem permite iniciar trabalho futuro antes da transição auditada.
254
301
 
255
- Com candidato limpo em SHA exato, execute `node scripts/release-cycle-gate.mjs audit --repository ROOT --version 4.5 --sha SHA`. O deploy crítico/de release executa os checks locais fixos nesse SHA, envia apenas `main` ao GitHub e espera o workflow `pre-main-candidate` verde para o push exato antes de publicar a Release. Falha dos checks locais bloqueia o push; falha de CI ou credenciais indisponíveis bloqueia a Release e exige reparo em `main`. Após tag, GitHub Release, main e CI exatos serem observados e todas as Tasks correntes ficarem terminais, `node scripts/release-cycle-gate.mjs advance --repository ROOT --from 4.5 --to 4.6 --sha SHA --ci-run-id ID` registra a transição. Isso não afirma deploy de provedor nem publicação npm; cada superfície tem prova própria. Esta seção descreve o contrato, não declara 4.5 congelada ou publicada.
302
+ Uma Task final de SPEC que combine implementação e publicação usa o modo explícito `--integrated-spec-task`, descrito na skill canônica de qualificação. Verifique essa elegibilidade antes dos gates caros; mantenha os predecessores concluídos e as provas válidas. Consulte [o diagnóstico v5.0](https://github.com/zaip-ai/zaip-aios/blob/main/docs/quality/v50-retrabalho-e-publicacao.md).