@zaip-ai/cli 3.4.0 → 3.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 (148) hide show
  1. package/dist/services/adapters.d.ts +1 -1
  2. package/dist/services/adapters.js +1 -1
  3. package/dist/services/stack-install.d.ts.map +1 -1
  4. package/dist/services/stack-install.js +19 -9
  5. package/dist/services/stack-install.js.map +1 -1
  6. package/dist/services/stack-node.d.ts.map +1 -1
  7. package/dist/services/stack-node.js +1 -1
  8. package/dist/services/stack-node.js.map +1 -1
  9. package/package.json +1 -1
  10. package/templates/.agents/config/agents/discovery.json +1 -1
  11. package/templates/.agents/dashboard/.zaip-managed.json +95 -51
  12. package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-BDQR0U4a.js +2938 -0
  13. package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-DRI_XwUf.css +1 -0
  14. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-B9GWkEyN.css → ProjectSettingsPage-CQMhvzvJ.css} +1 -1
  15. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-D46WWIKr.js +3 -0
  16. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-OulA4CoX.js +3 -0
  17. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-CqK3Psfy.js → TraceabilityWorkspace-BKBpJyLh.js} +1 -1
  18. package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-Ckxk_izu.js +1 -0
  19. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-Cl5EWx8R.js → index-Bas2TVju.js} +2 -2
  20. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CqfSgtk9.js +2 -0
  21. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CxrG_wRI.css +1 -0
  22. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-OBJXZOwe.css +1 -0
  23. package/templates/.agents/dashboard/apps/frontend/dist/index.html +2 -2
  24. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  25. package/templates/.agents/dashboard/apps/frontend/src/AppDashboardContent.tsx +0 -2
  26. package/templates/.agents/dashboard/apps/frontend/src/DashboardGlobalSettings.tsx +7 -0
  27. package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsCard.tsx +18 -0
  28. package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsField.tsx +21 -0
  29. package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.dom.test.ts +12 -1
  30. package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +16 -28
  31. package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +25 -4
  32. package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.test.tsx +26 -8
  33. package/templates/.agents/dashboard/apps/frontend/src/WorkspaceStatus.tsx +9 -28
  34. package/templates/.agents/dashboard/apps/frontend/src/cost-calculation-guide.css +1 -1
  35. package/templates/.agents/dashboard/apps/frontend/src/dashboard-help-dialog.css +2 -2
  36. package/templates/.agents/dashboard/apps/frontend/src/operations-entity-page-projection.ts +4 -1
  37. package/templates/.agents/dashboard/apps/frontend/src/operations-period-contract.test.ts +20 -9
  38. package/templates/.agents/dashboard/apps/frontend/src/pricing-settings-dialog.css +5 -5
  39. package/templates/.agents/dashboard/apps/frontend/src/project-settings-copy.ts +13 -4
  40. package/templates/.agents/dashboard/apps/frontend/src/project-settings-model.ts +25 -1
  41. package/templates/.agents/dashboard/apps/frontend/src/project-settings-workspace.css +28 -0
  42. package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +39 -0
  43. package/templates/.agents/dashboard/apps/frontend/src/use-app-work-board.test.ts +1 -1
  44. package/templates/.agents/dashboard/apps/frontend/src/workspace-status.css +1 -14
  45. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  46. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  47. package/templates/.agents/dashboard/modules/operations/src/react/OperationsEntityFilters.tsx +1 -1
  48. package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.tsx +2 -2
  49. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  50. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  51. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  52. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  53. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +2 -2
  54. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +73 -73
  55. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  56. package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs +38 -6
  57. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +2 -2
  58. package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +3 -4
  59. package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +1 -1
  60. package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.test.ts +2 -2
  61. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-filter-matrix.test.ts +1 -1
  62. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-pricing-provenance.test.ts +75 -0
  63. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-canonical.ts +2 -2
  64. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  65. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  66. package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +4 -6
  67. package/templates/.agents/dashboard/tests/e2e/specs/work-board-hydration.ts +38 -0
  68. package/templates/.agents/design/.zaip-managed.json +83 -51
  69. package/templates/.agents/design/apps/catalog/dist/assets/index-Cv4VfxTQ.js +72 -0
  70. package/templates/.agents/design/apps/catalog/dist/assets/index-D1JaPXfV.css +1 -0
  71. package/templates/.agents/design/apps/catalog/dist/assets/index-D2miO4-O.js +72 -0
  72. package/templates/.agents/design/apps/catalog/dist/assets/index-mvD5mwcC.js +72 -0
  73. package/templates/.agents/design/apps/catalog/dist/index.html +2 -2
  74. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{CatalogShell-CvaciY0C.js → CatalogShell-BJ8b4xZr.js} +1 -1
  75. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Color-6AOWCN3U-DwBV1A1Y.js → Color-6AOWCN3U-CQLHzznn.js} +1 -1
  76. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-kxWwSKin.js +146 -0
  77. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFilters.stories-Chm_dXV7.js +9 -0
  78. package/templates/.agents/design/apps/catalog/dist/storybook/assets/DashboardFiltersSpecimen-9CaCbGIZ.js +1 -0
  79. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DesignSystem.stories-2OCgtT0I.js → DesignSystem.stories-ED52wFjY.js} +1 -1
  80. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{DocsRenderer-JROSPFPF-CODg0rSl.js → DocsRenderer-JROSPFPF-BcLgM80v.js} +4 -4
  81. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{Primitives-BmeKjJW4.js → Primitives-DV6Bpudf.js} +1 -1
  82. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WithTooltip-7X4HQR7L-C5MI-3uZ.js → WithTooltip-7X4HQR7L-BKNiAz_E.js} +1 -1
  83. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{WorkspaceStatus.stories-Tb_iQqVK.js → WorkspaceStatus.stories-BL19HGOo.js} +2 -2
  84. package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-DQnSS6s9.js +1 -0
  85. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-DRQKCCAG-KSn75jcy.js → chunk-DRQKCCAG-DZBcXL-p.js} +1 -1
  86. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{chunk-W22LQPXL-C4LS1Thf.js → chunk-W22LQPXL-CF3y2mfo.js} +1 -1
  87. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{components-DV1BRgMY.js → components-BVjxMRGq.js} +5 -5
  88. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-Do9sjqiW.js +1 -0
  89. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{iframe-CBbPFx5G.js → iframe-CTWGZcEe.js} +4 -4
  90. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{react-18-C9IPGXtb.js → react-18-B9_a4mHb.js} +1 -1
  91. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-NrUxok8K.js +1 -0
  92. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{syntaxhighlighter-YFXUGROL-ZgDQjyWI.js → syntaxhighlighter-YFXUGROL-F_p8E2xc.js} +1 -1
  93. package/templates/.agents/design/apps/catalog/dist/storybook/assets/{theming-Cx9-gH6l.js → theming-fbSD9ZLF.js} +1 -1
  94. package/templates/.agents/design/apps/catalog/dist/storybook/iframe.html +1 -1
  95. package/templates/.agents/design/apps/catalog/dist/storybook/index.json +1 -1
  96. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/a11y-2/manager-bundle.js +3 -3
  97. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/docs-1/manager-bundle.js +4 -4
  98. package/templates/.agents/design/apps/catalog/dist/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +60 -60
  99. package/templates/.agents/design/apps/catalog/package.json +1 -1
  100. package/templates/.agents/design/apps/catalog/src/components/DashboardFiltersSpecimen.tsx +26 -21
  101. package/templates/.agents/design/apps/catalog/src/components/StackVersionFieldSpecimen.tsx +66 -0
  102. package/templates/.agents/design/apps/catalog/src/components/WorkspaceStatusSpecimen.tsx +23 -7
  103. package/templates/.agents/design/apps/catalog/src/pages/ComponentsPage.tsx +20 -6
  104. package/templates/.agents/design/apps/catalog/src/stories/Components.stories.tsx +14 -0
  105. package/templates/.agents/design/apps/catalog/src/stories/WorkspaceStatus.stories.tsx +5 -2
  106. package/templates/.agents/design/apps/catalog/src/styles/components.css +1 -1
  107. package/templates/.agents/design/apps/catalog/src/styles/stack-version-field.css +79 -0
  108. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  109. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  110. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  111. package/templates/.agents/requirements/comparative-audit.md +1 -1
  112. package/templates/.agents/requirements/context-engine.md +1 -1
  113. package/templates/.agents/requirements/cost-observability.md +1 -1
  114. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  115. package/templates/.agents/requirements/data-export.md +1 -1
  116. package/templates/.agents/requirements/design-system.md +1 -1
  117. package/templates/.agents/requirements/execution-engine.md +1 -1
  118. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  119. package/templates/.agents/requirements/model-orchestration.md +1 -1
  120. package/templates/.agents/requirements/public-distribution.md +1 -1
  121. package/templates/.agents/requirements/software-architecture.md +1 -1
  122. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  123. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  124. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  125. package/templates/.agents/rules/workflow.md +1 -1
  126. package/templates/.agents/runtime/VERSION +1 -1
  127. package/templates/.agents/runtime/bin/zaip.mjs +46 -15
  128. package/templates/.agents/runtime/checksums.sha256 +5 -5
  129. package/templates/.agents/runtime/manifest.json +1 -1
  130. package/templates/.agents/runtime/provenance.json +4 -4
  131. package/templates/.agents/runtime/sbom.cdx.json +1 -1
  132. package/templates/.agents/skills/zaip-skill-execution/SKILL.md +1 -0
  133. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +5 -4
  134. package/templates/.agents/skills/zaip-skill-github-deploy/agents/openai.yaml +1 -1
  135. package/templates/.agents/skills/zaip-skill-github-deploy/references/deployment-workflow.md +7 -7
  136. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.mjs +1 -2
  137. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.test.mjs +9 -1
  138. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs +25 -0
  139. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.mjs +2 -6
  140. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/preflight.test.mjs +15 -1
  141. package/templates/.agents/zaip-aios/VERSION +1 -1
  142. package/templates/template-manifest.json +216 -140
  143. package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-DVCPPV75.js +0 -3
  144. package/templates/.agents/dashboard/apps/frontend/dist/assets/index-Cwylbh_N.css +0 -1
  145. package/templates/.agents/design/apps/catalog/dist/storybook/assets/Components.stories-3dqK5g3e.js +0 -142
  146. package/templates/.agents/design/apps/catalog/dist/storybook/assets/WorkspaceStatusSpecimen-CD54pw0-.js +0 -1
  147. package/templates/.agents/design/apps/catalog/dist/storybook/assets/formatter-L2YTDE3Q-BU_68im1.js +0 -1
  148. package/templates/.agents/design/apps/catalog/dist/storybook/assets/react-CEv2qkJT.js +0 -1
@@ -1,11 +1,11 @@
1
1
  b146bd0c7c60b1ab43c4f71e0b1d2262c6df6da6f7053a0425f834ccb77a6b48 LICENSE
2
2
  bc02cba77e8d51e5c580f43668863dc868eda66f1ff663bfaa49fcf3ca16320e THIRD_PARTY_NOTICES.md
3
- f5e3e93e58ffc2a20a3ca53e8025bc50d7c1dccbef4b34e2388aa9bbf8678466 VERSION
4
- 8583ee1474bc30d9ac497c879729077aafaabc905422b9c738cb9632a7ebb013 bin/zaip.mjs
5
- ec9932ea72fc82824b5b472b252b0276797f7a52cc48db60c719ab828de53118 manifest.json
3
+ 138203e3f604a08fad0c4d0a297efe2c486219820dcdd053e72b7d843504c7a1 VERSION
4
+ 5ff46081c6dbcd011acdd6b6d182a512bc1263bc33d953a79e638aabcf12d740 bin/zaip.mjs
5
+ 2b8cc26507cc5108bb4f03f03b669f2119bcd9275a06fd67d476c2dfae94969d manifest.json
6
6
  7f89219d7c567c82a51679ad136d84364bded7ac659492537e125d33b1d58a7a migrations/001-layout-v1.json
7
7
  5f8c48b286d0b44d8fbb57a9a5d009a8a500439aa3148d750b8f193f72995c9f migrations/002-layout-v2.json
8
8
  2d738247131a923ea6e3a32d0d1d6de763866fd96a8a8dc75d127a343809b0aa pnpm-lock.sha256
9
- d1b096f8ae3e7e5b804205020a0e75d43e9393c0adc121fa362e2d64e9e11e39 provenance.json
10
- 0b19f004d8af24f71fa1d47489529026c1d86391a74dbfe2d11612b6e494713a sbom.cdx.json
9
+ dcdf66aed406bf0028d0690b1717d4e27fec5331b05c7c93c2f22bc835366c9a provenance.json
10
+ 58081aa9a5de145cf8aecdc6fb41fe57b7a8229aee48383081f0930be3a999f0 sbom.cdx.json
11
11
  b3ffedf9e146be802a15b4009f33e031dec3071ca1525e12c67606fd964a3067 schemas/contracts.schema.json
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "name": "zaip-aios",
4
- "version": "3.4.0",
4
+ "version": "3.6.0",
5
5
  "node": ">=22",
6
6
  "files": [
7
7
  "LICENSE",
@@ -2,10 +2,10 @@
2
2
  "schema_version": 1,
3
3
  "statement_type": "self_reported_build_integrity",
4
4
  "authenticity": "unverified",
5
- "version": "3.4.0",
5
+ "version": "3.6.0",
6
6
  "source_origin": "zaip-aios:local-build",
7
7
  "lockfile_sha256": "f8557f3600849eb880b8f245b63b80fed9a3e9addf2c5f2c6d492547af900219",
8
- "sbom_sha256": "0b19f004d8af24f71fa1d47489529026c1d86391a74dbfe2d11612b6e494713a",
9
- "runtime_sha256": "7c1cff8714c83874e79830afb133628232a384512c066db3ffd9ae4abf247045",
10
- "statement_sha256": "b025e30f1a337d75bf580808b164441310184e002d96345c7e3bafbc043f22ca"
8
+ "sbom_sha256": "58081aa9a5de145cf8aecdc6fb41fe57b7a8229aee48383081f0930be3a999f0",
9
+ "runtime_sha256": "caa822e66a147b9c767d37db827d6b5036d15992c27a2d7cc8d1c1ffbd3ae14b",
10
+ "statement_sha256": "9768509a13f540498ccc0e0427ce371334763a3f21cefa47e9d93e4b4c496d39"
11
11
  }
@@ -6,7 +6,7 @@
6
6
  "component": {
7
7
  "type": "application",
8
8
  "name": "zaip-aios",
9
- "version": "3.4.0"
9
+ "version": "3.6.0"
10
10
  }
11
11
  },
12
12
  "components": [
@@ -18,6 +18,7 @@ Use esta skill somente quando o usuário pedir execução. `prepare` não autori
18
18
  - Não encerre após criar/validar plano, sucessor, DAG ou Execution ativa. Não peça “continue execução” nem outra confirmação só porque a preparação consumiu tempo ou contexto; faça checkpoint/refresh e prossiga.
19
19
  - `spec execute`/`prd execute` ativam o macro e retornam `continuation.required`; isso é handoff obrigatório, não prova de implementação. Em runtime gerenciado, acione `execution run EXEC`; na colaboração nativa Codex, siga a seção de DAG nativa abaixo. Use somente um caminho de dispatch, com a mesma Execution e atribuição válida.
20
20
  - Depois de cada Task, execute as próximas elegíveis; ao terminar a DAG, realize os gates parentais e Gui. Só encerre com resultado observado ou impedimento concreto após recuperação permitida. Ramos independentes continuam somente quando a política de falha da DAG permitir.
21
+ - Comandos longos permanecem em primeiro plano ou em sessão durável acompanhada até saída terminal. Antes de dizer que um processo “ainda está em execução”, consulte novamente seu PID/sessão e registre a saída mais recente; processo encerrado com falha exige diagnóstico e continuação autorizada, nunca uma resposta final baseada no estado antigo. O primeiro Stop de uma Task própria em `executing` ou `verifying` deve ser bloqueado mesmo quando seu registro pertence a outro worktree Git registrado.
21
22
  - Falta real de autoridade, informação essencial, capacidade do host ou gates continua sendo bloqueio. Informe a causa e a condição de retomada; não invente sucesso, nova autorização, identidade ou ancestralidade para continuar.
22
23
 
23
24
  Antes de encerrar com trabalho pendente ou responder a uma falha, aplique [continuidade automática e parada justificada](references/autonomous-continuation.md). O perfil congelado e seu ledger decidem recuperação; reparação elegível usa a autorização existente, sem pedir outro turno.
@@ -13,6 +13,7 @@ Read [the deployment workflow](references/deployment-workflow.md) for the detail
13
13
 
14
14
  - The exact command “faça deploy” authorizes commits covering all versionable pending changes in the selected worktree, followed by push and Release, after secret, size and ignore checks. The selected worktree is the complete publication scope; other worktrees remain outside it.
15
15
  - Resolve dirty state, untracked files, generated projections, branch divergence and repairable local/remote failures automatically within that scope. Limit repairs to the evidenced cause, with up to five repair cycles; stop when the same root cause remains after two repairs.
16
+ - Treat the selected worktree's local branch, recovery branch or detached state as the source candidate only. The configured deploy branch is the remote target; a mismatch between source and target is not a blocker and never requires checking out the target locally.
16
17
  - Stop only for an unresolved index conflict after bounded repair, secrets, files at or above GitHub's 100 MB limit, unavailable authentication/authority, external outage, destructive requirement, or ambiguous scope expansion.
17
18
  - Never force push, rewrite history, replace remotes, change credentials or Git/SSH configuration, bypass checks, or deploy to another service.
18
19
  - Git-only publication of existing commits needs no artificial Task. Product edits or new product commits require real Task ownership; materialize missing authorized work before editing. Records/local-only snapshots are exempt.
@@ -24,9 +25,9 @@ Before the first Git mutation, retain sanitized authority in progress and the te
24
25
  ## Prepare the selected worktree
25
26
 
26
27
  1. Inspect Git status, pending paths and diff summary. Review every inventoried versionable file for secrets, size and ignore policy.
27
- 2. Read `.agents/config/project.yaml`. Resolve the explicit frontend/backend scope from `deploy.frontend.branch` or `deploy.backend.branch`; configured `main` is permitted. `deploy.database.branch` must remain literal `beta`. The legacy `deploy.branch` fallback remains non-production.
28
- 3. Prove folder-scoped SSH using `scripts/preflight.mjs --repository . --remote origin --scope frontend` (or the actual authorized scope). Run at most once per cycle; recheck only after an evidenced repair or changed target. Require SSH origin, configured key, Git identity and successful `ls-remote`; no process overrides or credential/config edits.
29
- 4. Fetch once per cycle and compute ahead/behind. Before reconciliation, create a recoverable branch reference and preserve tracked plus untracked changes in a named stash. Use bounded rebase by default. Restore with `git stash apply`; verify preservation, retain the stash until success, and combine conflicts from observed intent. Never reset or force.
28
+ 2. Read `.agents/config/project.yaml`. Resolve the explicit frontend/backend target from `deploy.frontend.branch` or `deploy.backend.branch`; configured `main` is permitted. `deploy.database.branch` must remain literal `beta`. The legacy `deploy.branch` fallback remains non-production. Record the local source branch or detached state separately from this target.
29
+ 3. Prove folder-scoped SSH using `scripts/preflight.mjs --repository . --remote origin --scope frontend` (or the actual authorized scope). Run at most once per cycle; recheck only after an evidenced repair or changed target. Require SSH origin, configured key, Git identity and successful `ls-remote`; no process overrides or credential/config edits. Preflight accepts a named recovery branch or detached source and returns it separately from the configured target.
30
+ 4. Fetch once per cycle and compute ahead/behind between the source candidate and configured remote target. Before reconciliation, create and verify a recoverable branch reference, including for detached HEAD, and preserve tracked plus untracked changes in a named stash. Use bounded rebase by default without switching to the target branch. Restore with `git stash apply`; verify preservation, retain the stash until success, and combine conflicts from observed intent. Never reset or force.
30
31
  5. Re-inventory after reconciliation. Stage the reviewed paths with `git add -- <explicit-pathspecs>`; never use `git add -A`, `git add -u`, broad globs or ignored files. Explicit deploy permits the whole inventoried selected worktree, without mandatory functional partitioning.
31
32
  6. Run required or evidenced gates only. Reuse unchanged valid evidence; bypass Turbo cache for the failed remote gate when repairing CI. A failed gate starts a new cycle only after a concrete repair or new remote evidence.
32
33
 
@@ -44,7 +45,7 @@ Every product commit requires causal Task/Change/Execution records and matching
44
45
  2. Resolve the previous Release, next canonical version and package identity using [release identity](references/release-identity.md). For the framework, `vN.N` maps to package `N.N.0`; only GitHub Actions publishes `@zaip-ai/cli` to npm.
45
46
  3. For `zaip-ai/zaip-aios`, use `scripts/local-release-deploy.mjs`. It prepares/verifies, pushes the exact SHA to configured `main`, uploads verified assets to a draft, then publishes the Release. Enable the thin publisher only after explicit rollout authority, public trust enrollment and signed local qualification. It validates published assets and runs one read-only installation smoke before npm; no private-draft pilot or write token is needed. GitHub Release publication and npm completion remain separate.
46
47
  4. Consumers use `scripts/consumer-release-preparation.mjs guarded-push` with their own policy and explicit branch, SHA and trusted receipt. They have no framework npm/TGZ requirement. See the preparation guide for bootstrap and guarded commands.
47
- 5. Immediately before delivery, reread the configured target; if changed, restart preparation. Helpers bind the exact candidate to `HEAD:refs/heads/<configured branch>` (or its equivalent immutable-SHA refspec); do not bypass them with a manual push.
48
+ 5. Immediately before delivery, reread the configured target; if changed, restart preparation. Helpers bind the exact candidate to `HEAD:refs/heads/<configured branch>` (or its equivalent immutable-SHA refspec) independently of the local source branch; do not bypass them with a manual push.
48
49
  6. After qualification, a missing Release is normal. Unless explicitly push-only, automatically create the draft for that SHA or resume a verified draft for the same SHA. Verify an already-published exact Release as a no-op; an API/authentication error never proves absence. Refuse conflicting tags/assets without overwrite.
49
50
  7. Review complete categorized UTF-8 notes and their exact-range inventory under [release notes](references/release-notes.md). Never use `--generate-notes` as the Release body. Validate the notes, publish with the reviewed notes file, and compare the published body byte-for-byte on readback. Preserve a configured human-only review policy where applicable.
50
51
 
@@ -1,6 +1,6 @@
1
1
  interface:
2
2
  display_name: "ZAIP GitHub Deploy"
3
3
  short_description: "Publicacao GitHub explicita, Git-only e verificavel"
4
- default_prompt: "Use $zaip-skill-github-deploy para pedidos explicitos de deploy, push, publicar ou publicacao GitHub; quando o usuario disser 'faca deploy', trate o worktree selecionado inteiro como escopo autorizado, incluindo arquivos novos, apos os gates de segredos, tamanho, conflitos e SSH; publique via SSH da pasta sem force push nem reescrita de historico."
4
+ default_prompt: "Use $zaip-skill-github-deploy para pedidos explicitos de deploy, push, publicar ou publicacao GitHub; quando o usuario disser 'faca deploy', trate o worktree selecionado inteiro como escopo autorizado, incluindo arquivos novos, apos os gates de segredos, tamanho, conflitos e SSH; trate a branch local ou detached como origem e a branch configurada como alvo remoto, publicando por refspec explicito via SSH da pasta sem force push nem reescrita de historico."
5
5
  policy:
6
6
  allow_implicit_invocation: true
@@ -30,12 +30,12 @@ For publication of existing commits, the conversation and terminal deploy report
30
30
  ## Multiple worktrees and divergent history
31
31
 
32
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. A clean worktree on another branch or a detached verification worktree does not join the deploy. 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 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. 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 for the publishing branch. If it is behind or diverged, automatically reconcile only the selected branch under this deploy authorization and continue; divergence is not a blocker by itself.
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
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. 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.
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
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.
40
40
 
41
41
  ## Repair-loop integrity
@@ -49,7 +49,7 @@ For publication of existing commits, the conversation and terminal deploy report
49
49
 
50
50
  ## Prove folder-scoped SSH first
51
51
 
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 never creates, renames, or switches a branch.
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.
53
53
 
54
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.
55
55
 
@@ -105,7 +105,7 @@ For a consumer repository, bootstrap its own Ed25519 trust store and define `con
105
105
 
106
106
  ## Synchronize and publish each cycle
107
107
 
108
- Fetch the selected remote and configured branch once per publication cycle, without SSH overrides. Compute ahead/behind against `<selected remote>/<configured branch>`. When local is behind or diverged, apply the recorded bounded reconciliation strategy and continue after successful verification; stop only if it cannot be completed safely within the bounded repair cycles. Never reset or force.
108
+ 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.
109
109
 
110
110
  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.
111
111
 
@@ -185,8 +185,7 @@ export async function prepare(input) {
185
185
  fail("SHA and GitHub version vN.N are required");
186
186
  const repository = resolve(input.repository),
187
187
  branch = await configuredBranch(repository, input.scope ?? "frontend");
188
- if (branch !== input.branch || git(repository, ["branch", "--show-current"]) !== branch)
189
- fail("checked out branch does not match configured branch");
188
+ if (branch !== input.branch) fail("requested target branch does not match configured branch");
190
189
  const policyDigest = await hash(input.policy),
191
190
  before = identity(repository, input.sha),
192
191
  required = policyFor(await json(input.policy), input);
@@ -46,7 +46,7 @@ test("resolves only the selected application scope from nested deploy configurat
46
46
  }
47
47
  });
48
48
 
49
- test("GitHub-only guard binds parsed config, policy, receipt expiry and fixed refspec", async () => {
49
+ test("GitHub-only guard binds target config and fixed refspec independently of source branch", async () => {
50
50
  const root = await mkdtemp(join(tmpdir(), "zaip-consumer-"));
51
51
  try {
52
52
  const repo = join(root, "repo");
@@ -96,6 +96,10 @@ test("GitHub-only guard binds parsed config, policy, receipt expiry and fixed re
96
96
  }),
97
97
  );
98
98
  await bootstrap({ trustStore: trust, publicKey: pub, keyId: "consumer" });
99
+ git(repo, "checkout", "-qb", "codex/recovery");
100
+ const recoveryPrepared = await prepare(input);
101
+ await verifyPreparation({ ...input, receipt: recoveryPrepared.receiptPath });
102
+ git(repo, "checkout", "--detach", sha);
99
103
  const prepared = await prepare(input);
100
104
  await verifyPreparation({ ...input, receipt: prepared.receiptPath });
101
105
  const calls = [];
@@ -105,6 +109,10 @@ test("GitHub-only guard binds parsed config, policy, receipt expiry and fixed re
105
109
  ["preflight", "push"],
106
110
  );
107
111
  assert.equal(calls[1].refspec, sha + ":refs/heads/main");
112
+ await assert.rejects(
113
+ () => prepare({ ...input, branch: "beta" }),
114
+ /requested target branch does not match configured branch/,
115
+ );
108
116
  await assert.rejects(
109
117
  () => prepare({ ...input, commands: [{ command: "node", args: ["-e", "process.exit(2)"] }] }),
110
118
  /differ/,
@@ -1,10 +1,32 @@
1
1
  import assert from "node:assert/strict";
2
+ import { createHash } from "node:crypto";
2
3
  import { readFile } from "node:fs/promises";
3
4
  import { resolve } from "node:path";
4
5
  import test from "node:test";
5
6
 
6
7
  const root = resolve(import.meta.dirname, "..", "..", "..");
7
8
  const skillRoot = resolve(root, "skills", "zaip-skill-github-deploy");
9
+ const managedDeployFiles = [
10
+ "rules/workflow.md",
11
+ "skills/zaip-skill-github-deploy/SKILL.md",
12
+ "skills/zaip-skill-github-deploy/agents/openai.yaml",
13
+ "skills/zaip-skill-github-deploy/references/deployment-workflow.md",
14
+ "skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.mjs",
15
+ "skills/zaip-skill-github-deploy/scripts/consumer-release-preparation.test.mjs",
16
+ "skills/zaip-skill-github-deploy/scripts/github-deploy-contract.test.mjs",
17
+ "skills/zaip-skill-github-deploy/scripts/preflight.mjs",
18
+ "skills/zaip-skill-github-deploy/scripts/preflight.test.mjs",
19
+ ];
20
+
21
+ test("framework lock matches the deploy guidance and executable contract", async () => {
22
+ const lock = await readFile(resolve(root, "config", "framework.lock.yaml"), "utf8");
23
+ for (const path of managedDeployFiles) {
24
+ const digest = createHash("sha256")
25
+ .update(await readFile(resolve(root, path)))
26
+ .digest("hex");
27
+ assert.ok(lock.includes(` .agents/${path}: ${digest}\n`), `${path} lock hash is stale`);
28
+ }
29
+ });
8
30
 
9
31
  test("explicit Git publication verbs select the guarded deploy skill", async () => {
10
32
  const [skill, openai, core] = await Promise.all([
@@ -49,7 +71,10 @@ test("deploy permission and reconciliation remain explicit and recoverable", asy
49
71
  assert.match(skill, /recoverable branch reference/);
50
72
  assert.match(skill, /preserve tracked plus untracked changes in a named stash/);
51
73
  assert.match(skill, /Restore with `git stash apply`/);
74
+ assert.match(skill, /local branch, recovery branch or detached state as the source candidate/);
75
+ assert.match(skill, /configured deploy branch is the remote target/);
52
76
  assert.match(openai, /worktree selecionado inteiro como escopo autorizado/);
77
+ assert.match(openai, /branch local ou detached como origem/);
53
78
  });
54
79
 
55
80
  test("workflow retains the explicit publication routing contract", async () => {
@@ -31,12 +31,7 @@ try {
31
31
  );
32
32
  process.exit(0);
33
33
  }
34
- const checkedOutBranch = git(repository, ["branch", "--show-current"]).trim();
35
- if (checkedOutBranch === "") fail("detached HEAD is not deployable");
36
- if (checkedOutBranch !== configuredBranch)
37
- fail(
38
- `checked out branch ${checkedOutBranch} does not match validation deploy.branch ${configuredBranch}; switch or create the configured validation branch manually before publishing`,
39
- );
34
+ const checkedOutBranch = git(repository, ["branch", "--show-current"]).trim() || null;
40
35
 
41
36
  for (const variable of ["GIT_SSH", "GIT_SSH_COMMAND"]) {
42
37
  if (process.env[variable]?.trim()) fail(`${variable} overrides folder-scoped Git SSH config`);
@@ -90,6 +85,7 @@ try {
90
85
  configured_branch: configuredBranch,
91
86
  production_branch: deployment.productionBranch,
92
87
  checked_out_branch: checkedOutBranch,
88
+ source_detached: checkedOutBranch === null,
93
89
  caller_branch: options.branch,
94
90
  upstream: upstream || null,
95
91
  remote: {
@@ -23,6 +23,8 @@ test("standalone consumer resolves fresh project targets without node_modules",
23
23
  windowsHide: true,
24
24
  env: { ...process.env, NODE_PATH: "" },
25
25
  });
26
+ const git = (...args) =>
27
+ spawnSync("git", args, { cwd: root, encoding: "utf8", windowsHide: true });
26
28
  const target = () => {
27
29
  const result = run("--resolve-branch");
28
30
  assert.equal(result.status, 0, result.stderr);
@@ -90,7 +92,19 @@ test("standalone consumer resolves fresh project targets without node_modules",
90
92
  assert.match(run("--resolve-branch").stderr, /non-empty|unsupported keys|malformed/);
91
93
  }
92
94
  config("deploy: { branch: staging, production_branch: production }\n");
93
- assert.match(run().stderr, /checked out branch codex\/working does not match/);
95
+ const recoveryBranch = run();
96
+ assert.notEqual(recoveryBranch.status, 0);
97
+ assert.doesNotMatch(recoveryBranch.stderr, /checked out branch|detached HEAD/i);
98
+ assert.match(recoveryBranch.stderr, /No such remote|remote get-url|push URL|core\.sshCommand/i);
99
+ assert.equal(git("config", "user.email", "x@y.invalid").status, 0);
100
+ assert.equal(git("config", "user.name", "x").status, 0);
101
+ assert.equal(git("add", ".").status, 0);
102
+ assert.equal(git("commit", "--quiet", "-m", "fixture").status, 0);
103
+ assert.equal(git("checkout", "--detach", "HEAD").status, 0);
104
+ const detached = run();
105
+ assert.notEqual(detached.status, 0);
106
+ assert.doesNotMatch(detached.stderr, /checked out branch|detached HEAD/i);
107
+ assert.match(detached.stderr, /No such remote|remote get-url|push URL|core\.sshCommand/i);
94
108
  for (const branch of [
95
109
  "bad..branch",
96
110
  "bad.lock/child",
@@ -1 +1 @@
1
- 3.4
1
+ 3.6