@zaip-ai/cli 4.6.0 → 4.8.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 (123) hide show
  1. package/dist/commands/init.js +1 -1
  2. package/dist/commands/init.js.map +1 -1
  3. package/dist/services/adapters.d.ts +1 -1
  4. package/dist/services/adapters.d.ts.map +1 -1
  5. package/dist/services/adapters.js +3 -3
  6. package/dist/services/adapters.js.map +1 -1
  7. package/dist/services/codex-config-overlay.d.ts.map +1 -1
  8. package/dist/services/codex-config-overlay.js +27 -10
  9. package/dist/services/codex-config-overlay.js.map +1 -1
  10. package/dist/services/codex-hook-activation.d.ts.map +1 -1
  11. package/dist/services/codex-hook-activation.js +12 -0
  12. package/dist/services/codex-hook-activation.js.map +1 -1
  13. package/dist/services/codex-pre-tool-hook-template.js +1 -1
  14. package/dist/services/codex-pre-tool-hook-template.test.js +37 -1
  15. package/dist/services/codex-pre-tool-hook-template.test.js.map +1 -1
  16. package/dist/services/global-codex-config-migration-rollback.test.d.ts +2 -0
  17. package/dist/services/global-codex-config-migration-rollback.test.d.ts.map +1 -0
  18. package/dist/services/global-codex-config-migration-rollback.test.js +88 -0
  19. package/dist/services/global-codex-config-migration-rollback.test.js.map +1 -0
  20. package/dist/services/global-codex-config-migration.test.js +69 -82
  21. package/dist/services/global-codex-config-migration.test.js.map +1 -1
  22. package/dist/services/global-codex-config-transaction.test.js +5 -1
  23. package/dist/services/global-codex-config-transaction.test.js.map +1 -1
  24. package/dist/services/global-codex-config.d.ts.map +1 -1
  25. package/dist/services/global-codex-config.js +34 -54
  26. package/dist/services/global-codex-config.js.map +1 -1
  27. package/dist/services/global-codex-config.test.js +3 -1
  28. package/dist/services/global-codex-config.test.js.map +1 -1
  29. package/dist/services/global-codex-toml.d.ts +9 -0
  30. package/dist/services/global-codex-toml.d.ts.map +1 -0
  31. package/dist/services/global-codex-toml.js +53 -0
  32. package/dist/services/global-codex-toml.js.map +1 -0
  33. package/dist/services/hook-readiness.d.ts.map +1 -1
  34. package/dist/services/hook-readiness.js.map +1 -1
  35. package/dist/services/install-agents-template.js +2 -2
  36. package/dist/services/install-agents-template.js.map +1 -1
  37. package/dist/services/logger.d.ts +1 -1
  38. package/dist/services/logger.d.ts.map +1 -1
  39. package/dist/services/logger.js +1 -1
  40. package/dist/services/logger.js.map +1 -1
  41. package/dist/services/logger.test.js +11 -5
  42. package/dist/services/logger.test.js.map +1 -1
  43. package/dist/services/runtime-template-integrity.test.d.ts +2 -0
  44. package/dist/services/runtime-template-integrity.test.d.ts.map +1 -0
  45. package/dist/services/runtime-template-integrity.test.js +26 -0
  46. package/dist/services/runtime-template-integrity.test.js.map +1 -0
  47. package/dist/services/runtime-template-test-support.d.ts.map +1 -1
  48. package/dist/services/runtime-template-test-support.js.map +1 -1
  49. package/dist/services/runtime-template.test.js +18 -21
  50. package/dist/services/runtime-template.test.js.map +1 -1
  51. package/package.json +1 -1
  52. package/templates/.agents/config/agents/discovery.json +1 -1
  53. package/templates/.agents/dashboard/.zaip-managed.json +62 -46
  54. package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-BRtiPijr.js → CostCalculationGuidePage-BW7Vy1cp.js} +1 -1
  55. package/templates/.agents/dashboard/apps/frontend/dist/assets/{DashboardHelpDialog-BR4ZeYpE.js → DashboardHelpDialog-BN8KQPrr.js} +2 -2
  56. package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Dr4QDFmn.js → PricingSettingsDialog-Prcs-ydy.js} +1 -1
  57. package/templates/.agents/dashboard/apps/frontend/dist/assets/{ProjectSettingsPage-BG0N5dw_.js → ProjectSettingsPage-HqGUImIG.js} +1 -1
  58. package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-BvoM-YQ0.js → TraceabilityWorkspace-CNpmQMO4.js} +1 -1
  59. package/templates/.agents/dashboard/apps/frontend/dist/assets/{cost-monitor-fTQhSL85.js → cost-monitor-Co2Jiuzh.js} +2 -2
  60. package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-Bc6vux5t.js → icons-vendor-DOhy6D2-.js} +1 -1
  61. package/templates/.agents/dashboard/apps/frontend/dist/assets/{index-BMfzKaAR.js → index-DX65Ufuu.js} +2 -2
  62. package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-DNJQFov3.js → react-vendor-CkPC-yMz.js} +1 -1
  63. package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-B7tjIB7W.js → traceability-BEdGoIDm.js} +1 -1
  64. package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
  65. package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
  66. package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
  67. package/templates/.agents/dashboard/modules/operations/package.json +1 -1
  68. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.macro-metrics.test.ts +8 -2
  69. package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +6 -6
  70. package/templates/.agents/dashboard/modules/operations/src/react/overview-duration-hint.ts +12 -0
  71. package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
  72. package/templates/.agents/dashboard/packages/branding/package.json +1 -1
  73. package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
  74. package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
  75. package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +238 -171
  76. package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +227 -160
  77. package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
  78. package/templates/.agents/dashboard/packages/local-runtime/server.mjs +240 -173
  79. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-summary-elapsed.ts +107 -0
  80. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-query-summary.ts +41 -54
  81. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-canonical.ts +7 -7
  82. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-counts-every-root-execution-day-returns.test.ts +5 -5
  83. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +4 -4
  84. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-schema.ts +3 -1
  85. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-base-views.ts +9 -7
  86. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-schema-dashboard-views.ts +10 -8
  87. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-spec-root-elapsed-view.ts +61 -0
  88. package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-spec-root-elapsed.test.ts +210 -0
  89. package/templates/.agents/dashboard/packages/ui/package.json +1 -1
  90. package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
  91. package/templates/.agents/design/.zaip-managed.json +3 -3
  92. package/templates/.agents/design/apps/catalog/package.json +1 -1
  93. package/templates/.agents/design/packages/local-runtime/package.json +1 -1
  94. package/templates/.agents/requirements/autonomous-assurance.md +1 -1
  95. package/templates/.agents/requirements/cloud-hostinger-autonomy.md +1 -1
  96. package/templates/.agents/requirements/comparative-audit.md +1 -1
  97. package/templates/.agents/requirements/context-engine.md +1 -1
  98. package/templates/.agents/requirements/cost-observability.md +1 -1
  99. package/templates/.agents/requirements/dashboard-launch.md +1 -1
  100. package/templates/.agents/requirements/data-export.md +1 -1
  101. package/templates/.agents/requirements/design-system.md +1 -1
  102. package/templates/.agents/requirements/execution-engine.md +1 -1
  103. package/templates/.agents/requirements/kanban-dashboard.md +1 -1
  104. package/templates/.agents/requirements/model-orchestration.md +1 -1
  105. package/templates/.agents/requirements/public-distribution.md +11 -9
  106. package/templates/.agents/requirements/software-architecture.md +1 -1
  107. package/templates/.agents/requirements/strategic-improvements.md +1 -1
  108. package/templates/.agents/requirements/work-lifecycle.md +1 -1
  109. package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
  110. package/templates/.agents/runtime/VERSION +1 -1
  111. package/templates/.agents/runtime/bin/zaip.mjs +22 -11
  112. package/templates/.agents/runtime/checksums.sha256 +5 -5
  113. package/templates/.agents/runtime/manifest.json +1 -1
  114. package/templates/.agents/runtime/provenance.json +4 -4
  115. package/templates/.agents/runtime/sbom.cdx.json +1 -1
  116. package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +2 -0
  117. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.mjs +16 -3
  118. package/templates/.agents/skills/zaip-skill-github-deploy/scripts/deploy-contract.test.mjs +29 -0
  119. package/templates/.agents/skills/zaip-skill-release-qualification/SKILL.md +2 -0
  120. package/templates/.agents/skills/zaip-skill-release-qualification/references/local-preparation.md +9 -0
  121. package/templates/.agents/zaip-aios/VERSION +1 -1
  122. package/templates/.agents/zaip-aios/guides/14-troubleshooting.md +1 -1
  123. package/templates/template-manifest.json +99 -83
@@ -0,0 +1,210 @@
1
+ import { mkdir, mkdtemp, writeFile } from "node:fs/promises";
2
+ import { join, resolve } from "node:path";
3
+ import { DatabaseSync } from "node:sqlite";
4
+ import { afterEach, expect, it } from "vitest";
5
+ import { rebuildSqliteReadModel, SqliteReadModelFileSystem } from "./sqlite-read-model.js";
6
+
7
+ const roots: string[] = [];
8
+ afterEach(async () => {
9
+ await Promise.all(
10
+ roots
11
+ .splice(0)
12
+ .map((root) =>
13
+ import("node:fs/promises").then(({ rm }) => rm(root, { recursive: true, force: true })),
14
+ ),
15
+ );
16
+ });
17
+
18
+ it("shows a 21-hour source-observed SPEC root and splits Cost elapsed without child double counting", async () => {
19
+ const temp = resolve(import.meta.dirname, "../../../../../..", ".tmp", "sqlite-read-model-tests");
20
+ await mkdir(temp, { recursive: true });
21
+ const root = await mkdtemp(join(temp, "spec-elapsed-"));
22
+ roots.push(root);
23
+ const records = join(root, ".agents", "records");
24
+ await mkdir(join(records, "runs", "2026", "09"), { recursive: true });
25
+ await mkdir(join(records, "specs", "2026", "09"), { recursive: true });
26
+ await mkdir(join(root, ".agents", "config"), { recursive: true });
27
+ await writeFile(join(root, ".agents", "config", "project.yaml"), "zaip:\n enabled: true\n");
28
+ for (const id of ["SPEC-ROOT", "SPEC-CHILD"])
29
+ await writeFile(
30
+ join(records, "specs", "2026", "09", `${id}.md`),
31
+ `---\nid: ${id}\ntitle: ${id}\nstatus: active\nrisk: standard\ncreated_at: 2026-09-30T22:00:00.000Z\n---\n# ${id}\n`,
32
+ );
33
+
34
+ const sourceStart = "2026-09-30T22:41:41.072Z";
35
+ const sourceEnd = "2026-10-01T19:55:46.569Z";
36
+ const run = (id: string, specId: string, start: string, end: string, parent: string | null) => {
37
+ const invocation = `AINV-${id}`;
38
+ return [
39
+ {
40
+ schema_version: 2,
41
+ event_id: `${id}:1`,
42
+ run_id: id,
43
+ sequence: 1,
44
+ occurred_at: start,
45
+ type: "run.started",
46
+ attribution_status: "attributed",
47
+ phase: "execution",
48
+ run_role: parent === null ? "orchestrator" : "subagent",
49
+ run_purpose: "execution",
50
+ requires_finalizer: false,
51
+ execution_kind: "delivery",
52
+ execution_eligibility: ["delivery"],
53
+ entrypoint: "spec",
54
+ work_type: "new",
55
+ storage_mode: "tracked_sanitized",
56
+ client: "codex",
57
+ agent: "agent",
58
+ agent_name: "agent",
59
+ provider: "openai",
60
+ model: "gpt-6-sol",
61
+ reasoning_effort: null,
62
+ client_thread_id: `thread-${id}`,
63
+ client_turn_id: `turn-${id}`,
64
+ conversation_id: "CONV-SPEC",
65
+ execution_id: "EXEC-SPEC",
66
+ task_id: null,
67
+ spec_id: specId,
68
+ prd_id: null,
69
+ change_id: null,
70
+ parent_run_id: parent,
71
+ continuation_of_run_id: null,
72
+ retry_of_run_id: null,
73
+ agent_invocation_id: invocation,
74
+ root_agent_invocation_id: parent === null ? invocation : "AINV-RUN-ROOT",
75
+ parent_agent_invocation_id: parent === null ? null : "AINV-RUN-ROOT",
76
+ invocation_kind: parent === null ? "orchestrator" : "delegated",
77
+ delegation_depth: parent === null ? 0 : 1,
78
+ },
79
+ {
80
+ schema_version: 2,
81
+ event_id: `${id}:2`,
82
+ run_id: id,
83
+ sequence: 2,
84
+ occurred_at: end,
85
+ type: "usage.recorded",
86
+ phase: "execution",
87
+ activity_kind: "model_usage",
88
+ classification_source: "explicit",
89
+ tokens: {
90
+ input: 100,
91
+ cached_input: 0,
92
+ output: 20,
93
+ reasoning: 0,
94
+ total: 120,
95
+ source: "provider_reported",
96
+ },
97
+ cost: { usd: 1, brl: 5, fx_rate: 5 },
98
+ provider: "openai",
99
+ model: "gpt-6-sol",
100
+ source_segment_key: id,
101
+ model_call_id: `MCALL-${id}`,
102
+ runtime: { reasoning_effort: null, service_tier: null },
103
+ supersedes_event_id: null,
104
+ source_occurred_at: end,
105
+ source_started_at: start,
106
+ source_finished_at: end,
107
+ duration_ms: null,
108
+ duration_provenance: null,
109
+ },
110
+ ];
111
+ };
112
+ for (const [id, specId, start, end, parent] of [
113
+ ["RUN-ROOT", "SPEC-ROOT", sourceStart, sourceEnd, null],
114
+ ["RUN-OVERLAP", "SPEC-ROOT", "2026-10-01T04:30:00.000Z", "2026-10-01T05:30:00.000Z", null],
115
+ ["RUN-CHILD", "SPEC-CHILD", "2026-10-01T04:00:00.000Z", "2026-10-01T05:00:00.000Z", "RUN-ROOT"],
116
+ ["RUN-UNKNOWN", "SPEC-CHILD", "2026-10-02T12:00:00.000Z", "2026-10-02T12:00:00.000Z", null],
117
+ ] as const)
118
+ await writeFile(
119
+ join(records, "runs", "2026", "09", `${id}.jsonl`),
120
+ `${run(id, specId, start, end, parent)
121
+ .map((event) => JSON.stringify(event))
122
+ .join("\n")}\n`,
123
+ );
124
+
125
+ await rebuildSqliteReadModel(root);
126
+ const db = new DatabaseSync(resolve(root, ".local/sqlite/zaip-aios-dashboard.sqlite"), {
127
+ readOnly: true,
128
+ });
129
+ const observed = Date.parse(sourceEnd) - Date.parse(sourceStart);
130
+ expect(observed).toBe(76_445_497);
131
+ expect(
132
+ db.prepare("SELECT source_duration_ms FROM zaip_aios_activities WHERE run_id='RUN-ROOT'").get(),
133
+ ).toEqual({ source_duration_ms: observed });
134
+ expect(
135
+ db
136
+ .prepare("SELECT spec_id, total_duration_ms FROM zaip_vw_spec_root_elapsed ORDER BY spec_id")
137
+ .all(),
138
+ ).toEqual([{ spec_id: "SPEC-ROOT", total_duration_ms: observed }]);
139
+ expect(
140
+ db
141
+ .prepare(
142
+ "SELECT entity_id, total_duration_ms FROM zaip_vw_first_fold_top_specs_all_time ORDER BY rank LIMIT 1",
143
+ )
144
+ .get(),
145
+ ).toEqual({ entity_id: "SPEC-ROOT", total_duration_ms: observed });
146
+ expect(
147
+ db.prepare("SELECT total_duration_ms FROM zaip_vw_first_fold_spec_metrics_all_time").get(),
148
+ ).toEqual({ total_duration_ms: observed });
149
+ expect(
150
+ db
151
+ .prepare("SELECT period_key, total_duration FROM zaip_vw_cost_daily ORDER BY period_key")
152
+ .all(),
153
+ ).toEqual([
154
+ { period_key: "2026-09-30", total_duration: 15_498_928 },
155
+ { period_key: "2026-10-01", total_duration: 60_946_569 },
156
+ { period_key: "2026-10-02", total_duration: null },
157
+ ]);
158
+ db.close();
159
+ const filesystem = new SqliteReadModelFileSystem(root);
160
+ const allTimeCost = filesystem.costMonitorSummaryAggregate({ from: null, to: null });
161
+ expect(allTimeCost.cost_monitor_daily_duration).toMatchObject({
162
+ "2026-09-30": { known_sum: 15_498_928 },
163
+ "2026-10-01": { known_sum: 60_946_569 },
164
+ "2026-10-02": { known_sum: 0, known_runs: 0, eligible_runs: 1 },
165
+ });
166
+ expect(allTimeCost.daily_rows).toContainEqual(
167
+ expect.objectContaining({ key: "2026-10-02", total_duration: null }),
168
+ );
169
+ const unknownFiltered = filesystem.costMonitorSummaryAggregate({
170
+ from: "2026-10-02",
171
+ to: "2026-10-02",
172
+ specs: ["SPEC-CHILD"],
173
+ });
174
+ expect(unknownFiltered.cost_monitor_daily_duration).toMatchObject({
175
+ "2026-10-02": { known_sum: 0, known_runs: 0, eligible_runs: 1 },
176
+ });
177
+ expect(unknownFiltered.daily_rows).toContainEqual(
178
+ expect.objectContaining({ key: "2026-10-02", total_duration: null }),
179
+ );
180
+ const secondDayCost = filesystem.costMonitorSummaryAggregate({
181
+ from: "2026-10-01",
182
+ to: "2026-10-01",
183
+ });
184
+ expect(secondDayCost.cost_monitor_daily_duration).toMatchObject({
185
+ "2026-10-01": { known_sum: 60_946_569 },
186
+ });
187
+ expect(secondDayCost.cost_monitor_daily_duration).not.toHaveProperty("2026-09-30");
188
+ const filteredCost = filesystem.costMonitorSummaryAggregate({
189
+ from: "2026-10-01",
190
+ to: "2026-10-01",
191
+ specs: ["SPEC-ROOT"],
192
+ });
193
+ expect(filteredCost.cost_monitor_daily_duration).toMatchObject({
194
+ "2026-10-01": { known_sum: 60_946_569 },
195
+ });
196
+ const unknownDay = { from: "2026-10-02", to: "2026-10-02" };
197
+ expect(
198
+ filesystem.costMonitorSummaryAggregate(unknownDay).cost_monitor_daily_duration,
199
+ ).toMatchObject({
200
+ "2026-10-02": { known_sum: 0, eligible_runs: 1, known_runs: 0 },
201
+ });
202
+ expect(
203
+ filesystem.costMonitorSummaryAggregate({ ...unknownDay, specs: ["SPEC-CHILD"] })
204
+ .cost_monitor_daily_duration,
205
+ ).toMatchObject({ "2026-10-02": { known_sum: 0, eligible_runs: 1, known_runs: 0 } });
206
+ expect(filesystem.summaryPage("spec", { from: null, to: null }, 0, 10).rows).toContainEqual(
207
+ expect.objectContaining({ id: "SPEC-ROOT", total_duration: observed }),
208
+ );
209
+ filesystem.close();
210
+ });
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-ui",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/dashboard-e2e",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "files": [
5
5
  {
6
6
  "path": "DESIGN.md",
@@ -276,7 +276,7 @@
276
276
  },
277
277
  {
278
278
  "path": "apps/catalog/package.json",
279
- "sha256": "0ed200d08a2191952a59278b928e820ff26cda08eb4ecea29cfcc99f897c662e"
279
+ "sha256": "042f7b0a8b2fcfae031c268bfc07f41c96957ce3a6724b9ca8f0c8bd5ce4f3ab"
280
280
  },
281
281
  {
282
282
  "path": "apps/catalog/public/logo_novo_azul.png",
@@ -408,7 +408,7 @@
408
408
  },
409
409
  {
410
410
  "path": "packages/local-runtime/package.json",
411
- "sha256": "1420f11696db43314383a04628d3ab3bdbe359b5b07e08ca7b71fe07f5411216"
411
+ "sha256": "95c9a31264d488e61280b0f3b6955a9c4c3c96aa388c8c2f9b92dc84092dd920"
412
412
  },
413
413
  {
414
414
  "path": "packages/local-runtime/runtime.mjs",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/design-catalog",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaip-ai/design-local-runtime",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "scripts": {
@@ -6,7 +6,7 @@ title: Garantia adaptativa e execução autônoma
6
6
  status: active
7
7
  version: 3
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Garantia adaptativa e execução autônoma
@@ -6,7 +6,7 @@ title: Autonomia delimitada para Cloudflare e Hostinger
6
6
  status: proposed
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Cloudflare e Hostinger (proposta de requisito)
@@ -6,7 +6,7 @@ title: Auditoria comparativa e plano de evolução
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Auditoria comparativa e plano de evolução
@@ -6,7 +6,7 @@ title: Contexto mínimo, seguro e navegável
6
6
  status: active
7
7
  version: 8
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Context engine
@@ -6,7 +6,7 @@ title: Tokens, custos e cobertura
6
6
  status: active
7
7
  version: 10
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Cost observability
@@ -6,7 +6,7 @@ title: Inicialização e hidratação confiável do dashboard
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Inicialização e hidratação confiável do dashboard
@@ -6,7 +6,7 @@ title: Exportação contextual de dados para Excel
6
6
  status: proposed
7
7
  version: 2
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Exportação contextual de dados
@@ -6,7 +6,7 @@ title: Contrato visual e catálogo executável
6
6
  status: active
7
7
  version: 5
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Design system
@@ -6,7 +6,7 @@ title: Preparação, materialização e DAG
6
6
  status: active
7
7
  version: 11
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Execution engine
@@ -6,7 +6,7 @@ title: Projeções operacionais e analíticas
6
6
  status: active
7
7
  version: 14
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Kanban and dashboard
@@ -6,7 +6,7 @@ title: Seleção automática e observável de modelo e effort
6
6
  status: active
7
7
  version: 10
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Orquestração de modelos
@@ -4,9 +4,9 @@ id: REQUIREMENTS-PUBLIC-DISTRIBUTION
4
4
  area: public-distribution
5
5
  title: Distribuição pública e ativação
6
6
  status: active
7
- version: 9
7
+ version: 10
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Distribuição pública e ativação
@@ -44,15 +44,17 @@ Restrições explícitas prevalecem. No init sem force, catálogo oficial legado
44
44
  ser atualizado e passa a integrar o lock; catálogo personalizado permanece protegido. Discovery
45
45
  gerenciada é uma projeção única, regenerada a partir do catálogo da versão instalada.
46
46
 
47
- ## REQ-DIST-003 — Configuração global portátil do Codex
47
+ ## REQ-DIST-003 — Hooks do Codex restritos ao projeto
48
48
 
49
- O CLI público deve descobrir o diretório inicial do usuário em execução e reconciliar a proteção
50
- global do Codex sem apagar preferências, integrações ou identidades canônicas do usuário e sem
51
- introduzir paths ou identidades locais fixas.
49
+ O CLI público deve instalar a proteção do Codex exclusivamente no projeto em instalação,
50
+ por meio de `.codex/config.toml` e `.codex/hooks`. A migração pode remover hooks globais
51
+ legados comprovadamente pertencentes ao ZAIP após backup recuperável, preservando as demais
52
+ preferências globais, identidades canônicas, integrações e hooks de terceiros. Nenhum caminho
53
+ ou identidade do ambiente de build pode ser fixado no pacote.
52
54
 
53
- - `AC-DIST-003-01`: em uma instalação limpa ou existente, o CLI preserva as configurações globais e identidades canônicas, remove somente aliases `codex_name` obsoletos declarados pelo catálogo instalado e adiciona o hook portátil canônico, sem referência a nome de usuário ou path absoluto do ambiente de build.
54
- - `AC-DIST-003-02`: se a escrita global falhar, o CLI conclui a instalação do projeto sem ocultar a falha, informa o destino exato e o erro, e mantém na documentação os passos de reconciliação manual que preservam a configuração existente.
55
- - `AC-DIST-003-03`: a reconciliação substitui todo hook `PreToolUse` identificado como ZAIP por exatamente um bloco canônico e preserva hooks de terceiros; reexecuções são idempotentes.
55
+ - `AC-DIST-003-01`: em instalação limpa ou atualização, o CLI registra exatamente o hook canônico do ZAIP no `.codex/config.toml` do projeto e instala seu script em `.codex/hooks`; não cria nem atualiza hook global como fallback, não altera preferências ou identidades globais e não embute nome de usuário ou caminho absoluto do ambiente de build.
56
+ - `AC-DIST-003-02`: a migração identifica por assinatura/ownership os registros globais legados de hooks do ZAIP, verifica primeiro os hooks canônicos do projeto, produz e verifica backup recuperável antes de remover somente essas entradas reconhecidas da configuração global, e preserva integralmente hooks de terceiros e as demais configurações globais. Se a verificação local falhar, preserva também o hook global legado e relata a pendência; conteúdo global sem prova de ownership permanece intacto para revisão manual.
57
+ - `AC-DIST-003-03`: a instalação e a migração são idempotentes; falha ao gravar o hook do projeto, verificar o backup ou limpar um legado reconhecido é informada com destino, erro, estado parcial e passos de recuperação, sem declarar proteção concluída nem recorrer a um hook global.
56
58
 
57
59
  ## Verificação
58
60
 
@@ -6,7 +6,7 @@ title: Layout modular e limites de código-fonte
6
6
  status: active
7
7
  version: 5
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Software architecture
@@ -6,7 +6,7 @@ title: Melhorias estratégicas de custo, qualidade e resiliência
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Melhorias estratégicas de custo, qualidade e resiliência
@@ -6,7 +6,7 @@ title: Ciclo de vida do trabalho
6
6
  status: active
7
7
  version: 26
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Work lifecycle
@@ -6,7 +6,7 @@ title: Evidências, custo por Task e autonomia por SPEC
6
6
  status: active
7
7
  version: 1
8
8
  source_change: null
9
- source_release: "4.6.0"
9
+ source_release: "4.8.0"
10
10
  ---
11
11
 
12
12
  # Evidências, custo por Task e autonomia por SPEC
@@ -1 +1 @@
1
- 4.6.0
1
+ 4.8.0