@zaip-ai/cli 1.0.8 → 1.3.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.
- package/README.md +1 -1
- package/dist/services/adapters.d.ts +1 -1
- package/dist/services/adapters.js +1 -1
- package/dist/services/agent-adapters.js +2 -2
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/agent-adapters.test.js +5 -0
- package/dist/services/agent-adapters.test.js.map +1 -1
- package/dist/services/logger.test.js +2 -2
- package/dist/services/runtime-template.test.js +6 -6
- package/dist/services/template-manifest.d.ts.map +1 -1
- package/dist/services/template-manifest.js +5 -0
- package/dist/services/template-manifest.js.map +1 -1
- package/package.json +1 -1
- package/templates/.agents/architecture/software-architecture.md +131 -0
- package/templates/.agents/branding/brandbook.docx +0 -0
- package/templates/.agents/branding/brandbook.md +60 -0
- package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +1 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-orchestrator.toml +1 -1
- package/templates/.agents/dashboard/.tmp-run-list.json +254 -0
- package/templates/.agents/dashboard/.zaip-managed.json +252 -136
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-Z60df2r-.js → CostCalculationGuidePage-DxR_pgSV.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-4jZLTWE_.js +2156 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Coc6pA-1.js → PricingSettingsDialog-CKcsqb-r.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-BomxqCBU.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-DmmJD2Th.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-BwtitWa_.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-N5Csr0RP.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DFBuc_qp.js → icons-vendor-C0fj2uU9.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-C4aIB1PV.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CCQOHdVI.js → react-vendor-BEsJ-FYH.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-pC2_0J8x.js → traceability-B6y6Gw12.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +5 -5
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +204 -32
- package/templates/.agents/dashboard/apps/frontend/src/DashboardAlternateContent.tsx +11 -11
- package/templates/.agents/dashboard/apps/frontend/src/ProjectSettingsPage.tsx +14 -7
- package/templates/.agents/dashboard/apps/frontend/src/ProjectStackEditor.tsx +4 -2
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.test.ts +3 -1
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.tsx +14 -11
- package/templates/.agents/dashboard/apps/frontend/src/cost-period-refresh.test.ts +19 -4
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.test.ts +24 -2
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +22 -1
- package/templates/.agents/dashboard/apps/frontend/src/overview-status-page.test.ts +3 -1
- package/templates/.agents/dashboard/apps/frontend/src/project-settings-page.css +36 -26
- package/templates/.agents/dashboard/apps/frontend/src/project-settings.test.ts +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-banner-semantics.test.ts +40 -6
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +39 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +89 -23
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +219 -29
- package/templates/.agents/dashboard/apps/frontend/src/use-app-effects.ts +61 -7
- package/templates/.agents/dashboard/apps/frontend/src/use-app-operations-pages.ts +3 -6
- package/templates/.agents/dashboard/apps/frontend/src/work-list-pagination.test.ts +2 -2
- package/templates/.agents/dashboard/apps/frontend/src/work-list-pagination.ts +3 -4
- package/templates/.agents/dashboard/apps/frontend/vite.config.ts +4 -1
- package/templates/.agents/dashboard/modules/cost-monitor/package.json +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.test.ts +89 -19
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CompactLifecycleCostTable.tsx +31 -16
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.test.ts +43 -14
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostCharts.tsx +5 -5
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.tsx +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorContent.tsx +67 -42
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +115 -39
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +188 -38
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +75 -17
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +147 -58
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor.css +5 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/index.ts +2 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/period-cost-groups.ts +2 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-compact-cost-page.ts +18 -7
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.ts +95 -9
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-run-page.ts +29 -17
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-monitor-projection.test.ts +0 -24
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.test.ts +225 -424
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-projection.ts +24 -15
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/build-cost-summary-terminal-day.test.ts +6 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/source-size-cost-server/build-cost-monitor-projection-agents.test.ts +31 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/server/source-size-cost-server/build-cost-summary-projection-duration.test.ts +414 -0
- package/templates/.agents/dashboard/modules/operations/package.json +1 -1
- package/templates/.agents/dashboard/modules/operations/src/contracts.ts +26 -23
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +31 -11
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +3 -1
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +51 -21
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +47 -5
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageNavigation.tsx +1 -4
- package/templates/.agents/dashboard/modules/operations/src/react/PeriodSummaryTable.tsx +32 -10
- package/templates/.agents/dashboard/modules/operations/src/react/TaskDetailsDialog.tsx +9 -3
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkBoard.tsx +13 -5
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.test.ts +12 -4
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.tsx +1 -4
- package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.ts +1 -2
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +385 -4
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +481 -61
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +14 -1
- package/templates/.agents/dashboard/modules/operations/src/react/export/xlsx-runtime-e2e.test.ts +248 -0
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.test.ts +4 -4
- package/templates/.agents/dashboard/modules/operations/src/react/operation-duration.ts +6 -4
- package/templates/.agents/dashboard/modules/operations/src/react/operations-global-filters.test.ts +4 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview-period-filter.test.ts +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.status-cards.test.ts +1 -1
- package/templates/.agents/dashboard/modules/operations/src/react/operations-page-contract.ts +46 -6
- package/templates/.agents/dashboard/modules/operations/src/react/operations-view-order.test.ts +1 -4
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.test.ts +82 -6
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.test.ts +2 -1
- package/templates/.agents/dashboard/modules/operations/src/react/work-board-model.ts +1 -1
- package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.test.ts +19 -7
- package/templates/.agents/dashboard/modules/operations/src/server/execution-relationship-counts.ts +4 -1
- package/templates/.agents/dashboard/modules/operations/src/server/quick-daily-operations-projection.ts +11 -5
- package/templates/.agents/dashboard/modules/traceability/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/package.json +1 -1
- package/templates/.agents/dashboard/packages/branding/src/index.ts +1 -1
- package/templates/.agents/dashboard/packages/contracts/package.json +1 -1
- package/templates/.agents/dashboard/packages/contracts/src/index.ts +1 -0
- package/templates/.agents/dashboard/packages/data-export/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs +152 -149
- package/templates/.agents/dashboard/packages/local-runtime/dist/server.cjs.metafile.json +7333 -0
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +149 -146
- package/templates/.agents/dashboard/packages/local-runtime/package.json +1 -1
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-dashboard.mjs +15 -7
- package/templates/.agents/dashboard/packages/local-runtime/scripts/build-sqlite-runtime.mjs +44 -13
- package/templates/.agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs +5 -2
- package/templates/.agents/dashboard/packages/local-runtime/scripts/source-size-runtime-scripts/sqlite-read-model-fixture.mjs +397 -0
- package/templates/.agents/dashboard/packages/local-runtime/scripts/test-sqlite-read-model.mjs +472 -145
- package/templates/.agents/dashboard/packages/local-runtime/scripts/test-unix-launchers.mjs +15 -3
- package/templates/.agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs +129 -31
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +153 -150
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.test.ts +6 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/project-settings.ts +3 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.test.ts +55 -16
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.ts +23 -13
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +19 -4
- package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +7 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +132 -9
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +126 -60
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-metric-contract.ts +16 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +1861 -350
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.ts +1218 -352
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +119 -42
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +45 -20
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +7 -5
- package/templates/.agents/design/.zaip-managed.json +3 -3
- package/templates/.agents/design/apps/catalog/package.json +1 -1
- package/templates/.agents/design/packages/local-runtime/package.json +1 -1
- package/templates/.agents/growth/estrategia-bootstrap-90-dias.md +169 -0
- package/templates/.agents/growth/strategy.md +27 -0
- package/templates/.agents/marketing/estrategia-marketing-zaip-90-dias.md +197 -0
- package/templates/.agents/marketing/strategy.md +29 -0
- package/templates/.agents/requirements/autonomous-assurance.md +1 -1
- package/templates/.agents/requirements/comparative-audit.md +1 -1
- package/templates/.agents/requirements/context-engine.md +1 -1
- package/templates/.agents/requirements/cost-observability.md +1 -1
- package/templates/.agents/requirements/dashboard-launch.md +1 -1
- package/templates/.agents/requirements/data-export.md +1 -1
- package/templates/.agents/requirements/design-system.md +1 -1
- package/templates/.agents/requirements/execution-engine.md +1 -1
- package/templates/.agents/requirements/kanban-dashboard.md +1 -1
- package/templates/.agents/requirements/model-orchestration.md +1 -1
- package/templates/.agents/requirements/public-distribution.md +1 -1
- package/templates/.agents/requirements/software-architecture.md +1 -1
- package/templates/.agents/requirements/strategic-improvements.md +1 -1
- package/templates/.agents/requirements/work-lifecycle.md +1 -1
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +30 -29
- package/templates/.agents/runtime/checksums.sha256 +6 -6
- package/templates/.agents/runtime/manifest.json +1 -1
- package/templates/.agents/runtime/pnpm-lock.sha256 +1 -1
- package/templates/.agents/runtime/provenance.json +5 -5
- package/templates/.agents/runtime/sbom.cdx.json +3 -3
- package/templates/.agents/sales/playbook.md +32 -0
- package/templates/.agents/sales/roteiro-comercial-zaip.md +252 -0
- package/templates/.agents/skills/zaip-aios/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-brand-governance/SKILL.md +9 -2
- package/templates/.agents/skills/zaip-skill-brand-governance/references/brandbook-framework.md +39 -0
- package/templates/.agents/skills/zaip-skill-brand-governance/references/brandbook-standards.md +1 -1
- package/templates/.agents/skills/zaip-skill-enforce-architecture/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-growth-strategy-revops/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +39 -82
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +13 -8
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +44 -14
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.mjs +19 -9
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-remeasurement.test.mjs +29 -5
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/source-size-telemetry/model-identity-reconciliation.mjs +77 -0
- package/templates/.agents/skills/zaip-skill-sales-methodology/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/scripts/ensure-node.mjs +28 -5
- package/templates/.agents/zaip-aios/INDEX.md +10 -0
- package/templates/.agents/zaip-aios/README.md +2 -1
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/18-catalogo-de-agentes.md +76 -0
- package/templates/.agents/zaip-aios/guides/19-assurance-e-autonomia.md +72 -0
- package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +330 -0
- package/templates/.agents/zaip-aios/guides/21-telemetria-monitor-custos.md +52 -0
- package/templates/.agents/zaip-aios/guides/22-fluxos-e-roteamento.md +69 -0
- package/templates/.agents/zaip-aios/guides/23-orquestracao-de-modelos.md +483 -0
- package/templates/.agents/zaip-aios/guides/24-calculo-de-custos-openai.md +85 -0
- package/templates/.agents/zaip-aios/guides/25-fontes-de-precos-openai.md +18 -0
- package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +44 -0
- package/templates/.agents/zaip-aios/guides/27-telemetria-git-native.md +167 -0
- package/templates/.agents/zaip-aios/guides/28-lifecycle-completo.md +144 -0
- package/templates/.agents/zaip-aios/guides/assets/diagrams/lifecycles-task-spec-prd.png +0 -0
- package/templates/.agents/zaip-aios/guides/assets/diagrams/prd-lifecycle.png +0 -0
- package/templates/.agents/zaip-aios/guides/assets/diagrams/spec-lifecycle.png +0 -0
- package/templates/.agents/zaip-aios/guides/assets/diagrams/task-lifecycle.png +0 -0
- package/templates/template-manifest.json +313 -177
- package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-Cs6dzDmW.js +0 -1505
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-QE1k9yZB.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/ProjectSettingsPage-_Pf5DA_A.js +0 -3
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-BVlz3DLZ.js +0 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-Cf9ctPVt.js +0 -68
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-8A4DcNXM.js +0 -2
package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
2
|
import {
|
|
3
|
+
AGENT_INVOCATION_EXPORT_COLUMNS,
|
|
4
|
+
COMPACT_LIFECYCLE_EXPORT_COLUMNS,
|
|
5
|
+
COST_GROUP_EXPORT_COLUMNS,
|
|
6
|
+
EXECUTION_EXPORT_COLUMNS,
|
|
3
7
|
EXPORT_SUCCESS_TOAST_MS,
|
|
4
|
-
|
|
8
|
+
exportAgentInvocationRows,
|
|
9
|
+
exportCompactLifecycleRows,
|
|
10
|
+
exportCostGroupRows,
|
|
11
|
+
exportExecutionRows,
|
|
12
|
+
exportHeadersForView,
|
|
5
13
|
exportPageSourceRows,
|
|
6
14
|
exportRowsWithDurationHours,
|
|
15
|
+
exportWorkRows,
|
|
16
|
+
KANBAN_EXPORT_COLUMNS,
|
|
17
|
+
WORK_EXPORT_COLUMNS,
|
|
7
18
|
} from "./ExcelExportAction.js";
|
|
8
19
|
|
|
9
20
|
describe("ExcelExportAction duration mapper", () => {
|
|
@@ -26,6 +37,83 @@ describe("ExcelExportAction duration mapper", () => {
|
|
|
26
37
|
},
|
|
27
38
|
]);
|
|
28
39
|
});
|
|
40
|
+
|
|
41
|
+
it("maps populated monthly facts to fixed XLSX columns and retains unavailable values as null", () => {
|
|
42
|
+
expect(
|
|
43
|
+
exportRowsWithDurationHours([
|
|
44
|
+
{
|
|
45
|
+
key: "2026-07",
|
|
46
|
+
prds: 12,
|
|
47
|
+
specs: 58,
|
|
48
|
+
tasksCreated: 648,
|
|
49
|
+
runs: 1419,
|
|
50
|
+
tests: 2,
|
|
51
|
+
evidences: 547,
|
|
52
|
+
durationMs: 7_200_000,
|
|
53
|
+
tokens: 5_490_000_000,
|
|
54
|
+
costBrl: 36_925.24,
|
|
55
|
+
},
|
|
56
|
+
{ key: "2026-08", durationMs: null, costBrl: null },
|
|
57
|
+
]),
|
|
58
|
+
).toEqual([
|
|
59
|
+
{
|
|
60
|
+
key: "2026-07",
|
|
61
|
+
prds: 12,
|
|
62
|
+
specs: 58,
|
|
63
|
+
tasks: 648,
|
|
64
|
+
runs: 1419,
|
|
65
|
+
tests: 2,
|
|
66
|
+
evidences: 547,
|
|
67
|
+
duration_hours: 2,
|
|
68
|
+
tokens: 5_490_000_000,
|
|
69
|
+
cost: 36_925.24,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
key: "2026-08",
|
|
73
|
+
prds: undefined,
|
|
74
|
+
specs: undefined,
|
|
75
|
+
tasks: undefined,
|
|
76
|
+
runs: undefined,
|
|
77
|
+
tests: undefined,
|
|
78
|
+
evidences: undefined,
|
|
79
|
+
duration_hours: null,
|
|
80
|
+
tokens: undefined,
|
|
81
|
+
cost: null,
|
|
82
|
+
},
|
|
83
|
+
]);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("maps the canonical annual SQLite aliases into populated period columns", () => {
|
|
87
|
+
expect(
|
|
88
|
+
exportRowsWithDurationHours([
|
|
89
|
+
{
|
|
90
|
+
period_key: "2026",
|
|
91
|
+
prd_count: 13,
|
|
92
|
+
spec_count: 59,
|
|
93
|
+
task_count: 920,
|
|
94
|
+
total_run_count: 1_751,
|
|
95
|
+
validation_count: 17,
|
|
96
|
+
evidence_count: 648,
|
|
97
|
+
operations_total_duration: 619_958_763,
|
|
98
|
+
total_tokens: 7_342_609_361,
|
|
99
|
+
total_cost_brl: 47_588.9452,
|
|
100
|
+
},
|
|
101
|
+
]),
|
|
102
|
+
).toEqual([
|
|
103
|
+
{
|
|
104
|
+
key: "2026",
|
|
105
|
+
prds: 13,
|
|
106
|
+
specs: 59,
|
|
107
|
+
tasks: 920,
|
|
108
|
+
runs: 1_751,
|
|
109
|
+
tests: 17,
|
|
110
|
+
evidences: 648,
|
|
111
|
+
duration_hours: 172.2107675,
|
|
112
|
+
tokens: 7_342_609_361,
|
|
113
|
+
cost: 47_588.9452,
|
|
114
|
+
},
|
|
115
|
+
]);
|
|
116
|
+
});
|
|
29
117
|
});
|
|
30
118
|
|
|
31
119
|
it("exports every paginated row once instead of only the visible page", async () => {
|
|
@@ -52,6 +140,30 @@ it("exports every paginated row once instead of only the visible page", async ()
|
|
|
52
140
|
]);
|
|
53
141
|
});
|
|
54
142
|
|
|
143
|
+
it("exports a complete paginated annual snapshot with factual numeric duration hours", async () => {
|
|
144
|
+
const exported: Record<string, unknown>[] = [];
|
|
145
|
+
for await (const page of exportPageSourceRows({
|
|
146
|
+
totalRows: 3,
|
|
147
|
+
pages: async function* () {
|
|
148
|
+
yield [
|
|
149
|
+
{ key: "2026", run_count: 2, duration_ms: 7_200_000 },
|
|
150
|
+
{ key: "2025", run_count: 1, duration_ms: null },
|
|
151
|
+
];
|
|
152
|
+
yield [
|
|
153
|
+
{ key: "2025", run_count: 1, duration_ms: null },
|
|
154
|
+
{ key: "2024", run_count: 3, duration_ms: 3_600_000 },
|
|
155
|
+
];
|
|
156
|
+
},
|
|
157
|
+
}))
|
|
158
|
+
exported.push(...exportRowsWithDurationHours(page));
|
|
159
|
+
|
|
160
|
+
expect(exported).toEqual([
|
|
161
|
+
expect.objectContaining({ key: "2026", runs: 2, duration_hours: 2 }),
|
|
162
|
+
expect.objectContaining({ key: "2025", runs: 1, duration_hours: null }),
|
|
163
|
+
expect.objectContaining({ key: "2024", runs: 3, duration_hours: 1 }),
|
|
164
|
+
]);
|
|
165
|
+
});
|
|
166
|
+
|
|
55
167
|
it("keeps success feedback duration at four seconds", () => {
|
|
56
168
|
expect(EXPORT_SUCCESS_TOAST_MS).toBe(4_000);
|
|
57
169
|
});
|
|
@@ -70,12 +182,281 @@ it("uses a prepared total when rows continue beyond the visible first fold", asy
|
|
|
70
182
|
expect(prepared.totalRows).toBe(3);
|
|
71
183
|
});
|
|
72
184
|
|
|
73
|
-
it("
|
|
74
|
-
expect(KANBAN_EXPORT_COLUMNS).toEqual(
|
|
75
|
-
|
|
185
|
+
it("uses the compact work schema for Kanban and Work List", () => {
|
|
186
|
+
expect(KANBAN_EXPORT_COLUMNS).toEqual(WORK_EXPORT_COLUMNS);
|
|
187
|
+
expect(WORK_EXPORT_COLUMNS).toEqual([
|
|
188
|
+
"type",
|
|
189
|
+
"id",
|
|
190
|
+
"title",
|
|
191
|
+
"status",
|
|
192
|
+
"risk",
|
|
193
|
+
"occurred_at",
|
|
194
|
+
"duration_hours",
|
|
195
|
+
"tokens",
|
|
196
|
+
"cost_brl",
|
|
197
|
+
]);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
it("normalizes Tasks and macros into the same populated work columns", () => {
|
|
201
|
+
expect(
|
|
202
|
+
exportWorkRows([
|
|
203
|
+
{
|
|
204
|
+
kind: "task",
|
|
205
|
+
id: "TASK-1",
|
|
206
|
+
title: "Export Task",
|
|
207
|
+
status: "executing",
|
|
208
|
+
risk: "standard",
|
|
209
|
+
occurred_at: "2026-08-21T00:00:00.000Z",
|
|
210
|
+
telemetry: { duration_ms: 3_600_000, tokens: 123, cost_brl: 4.5 },
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
kind: "spec",
|
|
214
|
+
id: "SPEC-1",
|
|
215
|
+
title: "Export Spec",
|
|
216
|
+
work_status: "planning",
|
|
217
|
+
occurred_at: "2026-08-20T00:00:00.000Z",
|
|
218
|
+
total_duration: 7_200_000,
|
|
219
|
+
total_tokens: 456,
|
|
220
|
+
total_cost_brl: 7.5,
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
kind: "prd",
|
|
224
|
+
id: "PRD-1",
|
|
225
|
+
title: "Export PRD",
|
|
226
|
+
status: "ready",
|
|
227
|
+
occurred_at: "2026-08-19T00:00:00.000Z",
|
|
228
|
+
metrics: {
|
|
229
|
+
duration: { known_sum: 10_800_000 },
|
|
230
|
+
total_tokens: { known_sum: 789 },
|
|
231
|
+
cost: { known_sum: 9.5 },
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
]),
|
|
235
|
+
).toEqual([
|
|
236
|
+
{
|
|
237
|
+
type: "task",
|
|
238
|
+
id: "TASK-1",
|
|
239
|
+
title: "Export Task",
|
|
240
|
+
status: "executing",
|
|
241
|
+
risk: "standard",
|
|
242
|
+
occurred_at: "2026-08-21T00:00:00.000Z",
|
|
243
|
+
duration_hours: 1,
|
|
244
|
+
tokens: 123,
|
|
245
|
+
cost_brl: 4.5,
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
type: "spec",
|
|
249
|
+
id: "SPEC-1",
|
|
250
|
+
title: "Export Spec",
|
|
251
|
+
status: "planning",
|
|
252
|
+
risk: null,
|
|
253
|
+
occurred_at: "2026-08-20T00:00:00.000Z",
|
|
254
|
+
duration_hours: 2,
|
|
255
|
+
tokens: 456,
|
|
256
|
+
cost_brl: 7.5,
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: "prd",
|
|
260
|
+
id: "PRD-1",
|
|
261
|
+
title: "Export PRD",
|
|
262
|
+
status: "ready",
|
|
263
|
+
risk: null,
|
|
264
|
+
occurred_at: "2026-08-19T00:00:00.000Z",
|
|
265
|
+
duration_hours: 3,
|
|
266
|
+
tokens: 789,
|
|
267
|
+
cost_brl: 9.5,
|
|
268
|
+
},
|
|
269
|
+
]);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
it("uses populated entity columns for executions instead of period-summary columns", () => {
|
|
273
|
+
expect(EXECUTION_EXPORT_COLUMNS).toEqual([
|
|
274
|
+
"id",
|
|
275
|
+
"kind",
|
|
276
|
+
"status",
|
|
277
|
+
"origin",
|
|
278
|
+
"task_id",
|
|
279
|
+
"conversation_id",
|
|
280
|
+
"created_at",
|
|
281
|
+
"finished_at",
|
|
282
|
+
"duration_hours",
|
|
283
|
+
"tokens",
|
|
284
|
+
"cost_brl",
|
|
285
|
+
"invocations",
|
|
286
|
+
]);
|
|
287
|
+
expect(
|
|
288
|
+
exportExecutionRows([
|
|
289
|
+
{
|
|
290
|
+
execution_id: "EXEC-42",
|
|
291
|
+
execution_kind: "delivery",
|
|
292
|
+
status: "completed",
|
|
293
|
+
origin_type: "task",
|
|
294
|
+
task_id: "TASK-42",
|
|
295
|
+
started_at: "2026-08-21T00:00:00.000Z",
|
|
296
|
+
finished_at: "2026-08-21T01:00:00.000Z",
|
|
297
|
+
duration_ms: 3_600_000,
|
|
298
|
+
total_tokens: 123,
|
|
299
|
+
total_cost_brl: 4.5,
|
|
300
|
+
invocation_count: 2,
|
|
301
|
+
},
|
|
302
|
+
]),
|
|
303
|
+
).toEqual([
|
|
304
|
+
{
|
|
305
|
+
id: "EXEC-42",
|
|
306
|
+
kind: "delivery",
|
|
307
|
+
status: "completed",
|
|
308
|
+
origin: "task",
|
|
309
|
+
task_id: "TASK-42",
|
|
310
|
+
conversation_id: null,
|
|
311
|
+
created_at: "2026-08-21T00:00:00.000Z",
|
|
312
|
+
finished_at: "2026-08-21T01:00:00.000Z",
|
|
313
|
+
duration_hours: 1,
|
|
314
|
+
tokens: 123,
|
|
315
|
+
cost_brl: 4.5,
|
|
316
|
+
invocations: 2,
|
|
317
|
+
},
|
|
318
|
+
]);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it("exports Agent Invocations with populated fields instead of the result fallback", () => {
|
|
322
|
+
expect(AGENT_INVOCATION_EXPORT_COLUMNS).not.toContain("result");
|
|
323
|
+
expect(
|
|
324
|
+
exportAgentInvocationRows([
|
|
325
|
+
{
|
|
326
|
+
run_id: "RUN-42",
|
|
327
|
+
execution_id: "EXEC-42",
|
|
328
|
+
task_id: "TASK-42",
|
|
329
|
+
origin: "task",
|
|
330
|
+
run_role: "orchestrator",
|
|
331
|
+
run_purpose: "execution",
|
|
332
|
+
phase: "execution",
|
|
333
|
+
status: "completed",
|
|
334
|
+
agent: "zaip-agent-task-executor",
|
|
335
|
+
provider: "openai",
|
|
336
|
+
model: "gpt-5.6-terra",
|
|
337
|
+
started_at: "2026-08-21T00:00:00.000Z",
|
|
338
|
+
duration_ms: 3_600_000,
|
|
339
|
+
total_tokens: 123,
|
|
340
|
+
estimated_usd: 0.1,
|
|
341
|
+
estimated_brl: 0.5,
|
|
342
|
+
},
|
|
343
|
+
]),
|
|
344
|
+
).toEqual([
|
|
345
|
+
expect.objectContaining({
|
|
346
|
+
run_id: "RUN-42",
|
|
347
|
+
duration_hours: 1,
|
|
348
|
+
total_tokens: 123,
|
|
349
|
+
estimated_usd: 0.1,
|
|
350
|
+
estimated_brl: 0.5,
|
|
351
|
+
}),
|
|
352
|
+
]);
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
it("exports compact Task, SPEC, PRD, and Conversation rows with entity columns", () => {
|
|
356
|
+
expect(COMPACT_LIFECYCLE_EXPORT_COLUMNS).toEqual([
|
|
357
|
+
"id",
|
|
358
|
+
"title",
|
|
359
|
+
"status",
|
|
360
|
+
"occurred_at",
|
|
361
|
+
"invocations",
|
|
362
|
+
"duration_hours",
|
|
363
|
+
"tokens",
|
|
364
|
+
"cost_brl",
|
|
365
|
+
]);
|
|
366
|
+
expect(
|
|
367
|
+
exportCompactLifecycleRows([
|
|
368
|
+
{
|
|
369
|
+
id: "TASK-42",
|
|
370
|
+
title: "Export",
|
|
371
|
+
kind: "task",
|
|
372
|
+
status: "completed",
|
|
373
|
+
risk: "standard",
|
|
374
|
+
occurred_at: "2026-08-21T00:00:00.000Z",
|
|
375
|
+
parent_id: null,
|
|
376
|
+
run_count: 2,
|
|
377
|
+
metrics: {
|
|
378
|
+
duration: { known_sum: 3_600_000 },
|
|
379
|
+
total_tokens: { known_sum: 123 },
|
|
380
|
+
cost: { known_sum: 4.5 },
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
]),
|
|
384
|
+
).toEqual([
|
|
385
|
+
{
|
|
386
|
+
id: "TASK-42",
|
|
387
|
+
title: "Export",
|
|
388
|
+
status: "completed",
|
|
389
|
+
occurred_at: "2026-08-21T00:00:00.000Z",
|
|
390
|
+
invocations: 2,
|
|
391
|
+
duration_hours: 1,
|
|
392
|
+
tokens: 123,
|
|
393
|
+
cost_brl: 4.5,
|
|
394
|
+
},
|
|
395
|
+
]);
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
it("keeps cost-executions headers and exported row keys in the compact lifecycle schema", () => {
|
|
399
|
+
const source = {
|
|
400
|
+
id: "RUN-42",
|
|
401
|
+
title: "Cost execution",
|
|
402
|
+
status: "completed",
|
|
403
|
+
occurred_at: "2026-08-21T00:00:00.000Z",
|
|
404
|
+
parent_id: "raw-parent-must-not-export",
|
|
405
|
+
raw_duration_ms: 99_999,
|
|
406
|
+
metrics: {
|
|
407
|
+
duration: { known_sum: 3_600_000 },
|
|
408
|
+
total_tokens: { known_sum: 123 },
|
|
409
|
+
cost: { known_sum: 4.5 },
|
|
410
|
+
},
|
|
411
|
+
};
|
|
412
|
+
const rows = exportCompactLifecycleRows([source]);
|
|
413
|
+
expect(exportHeadersForView("cost-executions", [source])).toEqual(
|
|
414
|
+
COMPACT_LIFECYCLE_EXPORT_COLUMNS,
|
|
415
|
+
);
|
|
416
|
+
expect(Object.keys(rows[0] ?? {})).toEqual(COMPACT_LIFECYCLE_EXPORT_COLUMNS);
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
it("does not append raw keys to any explicitly schema-bound Cost view", () => {
|
|
420
|
+
const raw = [{ id: "ROW-1", internal_only: "must-not-be-a-header" }];
|
|
421
|
+
expect(exportHeadersForView("cost-tasks", raw)).toEqual(COMPACT_LIFECYCLE_EXPORT_COLUMNS);
|
|
422
|
+
expect(exportHeadersForView("cost-specs", raw)).toEqual(COMPACT_LIFECYCLE_EXPORT_COLUMNS);
|
|
423
|
+
expect(exportHeadersForView("cost-prds", raw)).toEqual(COMPACT_LIFECYCLE_EXPORT_COLUMNS);
|
|
424
|
+
expect(exportHeadersForView("cost-conversations", raw)).toEqual(COMPACT_LIFECYCLE_EXPORT_COLUMNS);
|
|
425
|
+
expect(exportHeadersForView("cost-agents", raw)).toEqual(COST_GROUP_EXPORT_COLUMNS);
|
|
426
|
+
expect(exportHeadersForView("cost-agent-calls", raw)).toEqual(AGENT_INVOCATION_EXPORT_COLUMNS);
|
|
427
|
+
expect(exportHeadersForView("operations-conversations", raw)).toEqual(
|
|
428
|
+
expect.not.arrayContaining(["internal_only"]),
|
|
76
429
|
);
|
|
77
430
|
});
|
|
78
431
|
|
|
432
|
+
it("exports model, provider, and ZAIP Agent groups with their populated metrics", () => {
|
|
433
|
+
expect(COST_GROUP_EXPORT_COLUMNS).not.toContain("result");
|
|
434
|
+
expect(
|
|
435
|
+
exportCostGroupRows([
|
|
436
|
+
{
|
|
437
|
+
key: "gpt-5.6-terra",
|
|
438
|
+
label: "gpt-5.6-terra",
|
|
439
|
+
run_count: 3,
|
|
440
|
+
task_count: 1,
|
|
441
|
+
prd_count: 1,
|
|
442
|
+
spec_count: 1,
|
|
443
|
+
total_tokens: 123,
|
|
444
|
+
estimated_usd: 0.1,
|
|
445
|
+
estimated_brl: 0.5,
|
|
446
|
+
duration_ms: 3_600_000,
|
|
447
|
+
},
|
|
448
|
+
]),
|
|
449
|
+
).toEqual([
|
|
450
|
+
expect.objectContaining({
|
|
451
|
+
key: "gpt-5.6-terra",
|
|
452
|
+
invocations: 3,
|
|
453
|
+
tokens: 123,
|
|
454
|
+
cost_brl: 0.5,
|
|
455
|
+
duration_hours: 1,
|
|
456
|
+
}),
|
|
457
|
+
]);
|
|
458
|
+
});
|
|
459
|
+
|
|
79
460
|
it("clears pending success when a new export starts", () => {
|
|
80
461
|
expect("running").not.toBe("completed");
|
|
81
462
|
});
|