@zaip-ai/cli 1.0.8 → 1.3.1
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 +3 -3
- package/dist/services/agent-adapters.js.map +1 -1
- package/dist/services/agent-adapters.test.js +7 -1
- package/dist/services/agent-adapters.test.js.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.d.ts.map +1 -1
- package/dist/services/codex-pre-tool-hook-template.js +89 -7
- package/dist/services/codex-pre-tool-hook-template.js.map +1 -1
- package/dist/services/codex-rules.d.ts +1 -1
- package/dist/services/codex-rules.d.ts.map +1 -1
- package/dist/services/codex-rules.js +7 -0
- package/dist/services/codex-rules.js.map +1 -1
- package/dist/services/install-agents-template.d.ts.map +1 -1
- package/dist/services/install-agents-template.js +1 -0
- package/dist/services/install-agents-template.js.map +1 -1
- package/dist/services/logger.test.js +2 -2
- package/dist/services/runtime-template.test.js +31 -7
- package/dist/services/runtime-template.test.js.map +1 -1
- package/dist/services/template-manifest.d.ts.map +1 -1
- package/dist/services/template-manifest.js +12 -3
- 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/agents/catalog.yaml +7 -7
- package/templates/.agents/config/clients/codex/agents/zaip-agent-backend.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-designer.toml +2 -2
- package/templates/.agents/config/clients/codex/agents/zaip-agent-finalizer.toml +1 -1
- package/templates/.agents/config/clients/codex/agents/zaip-agent-frontend.toml +8 -8
- 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 +457 -173
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{CostCalculationGuidePage-Z60df2r-.js → CostCalculationGuidePage-ovxurkIk.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/DashboardHelpDialog-BgVgrfhQ.js +2310 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{PricingSettingsDialog-Coc6pA-1.js → PricingSettingsDialog-vSvvOHQp.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-zH758vfs.js +3 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/TraceabilityWorkspace-DLn-Mz2M.js +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{TraceabilityWorkspace-CaKwQP43.css → TraceabilityWorkspace-DvvavDLY.css} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-DKwP1stV.js +68 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/cost-monitor-PoJA2PI1.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{icons-vendor-DFBuc_qp.js → icons-vendor-B_lDDHn1.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-B31GMG5O.css +1 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/index-CZQlsLV9.js +2 -0
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{react-vendor-CCQOHdVI.js → react-vendor-B3TJrD4O.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/assets/{traceability-pC2_0J8x.js → traceability-7f1j5wx3.js} +1 -1
- package/templates/.agents/dashboard/apps/frontend/dist/index.html +7 -7
- package/templates/.agents/dashboard/apps/frontend/package.json +1 -1
- package/templates/.agents/dashboard/apps/frontend/playwright.dom.config.ts +32 -0
- package/templates/.agents/dashboard/apps/frontend/src/App.tsx +199 -140
- package/templates/.agents/dashboard/apps/frontend/src/AppOverlays.tsx +0 -21
- package/templates/.agents/dashboard/apps/frontend/src/DashboardAlternateContent.tsx +20 -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.dom.e2e.ts +56 -0
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.test.ts +21 -2
- package/templates/.agents/dashboard/apps/frontend/src/TraceabilityWorkspace.tsx +89 -19
- 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 +49 -3
- package/templates/.agents/dashboard/apps/frontend/src/dashboard-api.ts +29 -10
- package/templates/.agents/dashboard/apps/frontend/src/operations-period-render.test.ts +4 -4
- package/templates/.agents/dashboard/apps/frontend/src/overview-status-page.test.ts +4 -2
- 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 +47 -6
- package/templates/.agents/dashboard/apps/frontend/src/snapshot-coherence.test.ts +59 -9
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.test.ts +32 -0
- package/templates/.agents/dashboard/apps/frontend/src/sqlite-page-export.ts +21 -0
- package/templates/.agents/dashboard/apps/frontend/src/styles.css +19 -0
- package/templates/.agents/dashboard/apps/frontend/src/traceability-task-pagination.test.ts +32 -0
- package/templates/.agents/dashboard/apps/frontend/src/traceability-task-pagination.ts +36 -0
- package/templates/.agents/dashboard/apps/frontend/src/traceability-workspace.css +6 -2
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.test.ts +137 -23
- package/templates/.agents/dashboard/apps/frontend/src/use-app-cost-loaders.ts +229 -35
- 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/use-app-trace-documents.ts +7 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-list-page.test.ts +163 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-app-work-list-page.ts +136 -0
- package/templates/.agents/dashboard/apps/frontend/src/use-operations-detail-export.ts +76 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-load-dedup.test.ts +23 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-load-dedup.ts +27 -0
- package/templates/.agents/dashboard/apps/frontend/src/work-list-pagination.test.ts +39 -15
- 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/CostDeveloperAttributionPanel.tsx +60 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostDeveloperAttributionTable.tsx +191 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.loading.test.ts +14 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.run-page.test.ts +18 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostFilters.tsx +18 -3
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostModelsAuditTable.tsx +1 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorContent.tsx +75 -44
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorLoadErrors.tsx +35 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.test.ts +162 -40
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostMonitorPage.tsx +221 -79
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableLoading.test.ts +132 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTableLoading.tsx +70 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.test.ts +203 -155
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/CostTables.tsx +164 -125
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-copy.ts +2 -0
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor-views.ts +3 -1
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-monitor.css +5 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/cost-page-range.ts +35 -0
- 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 +32 -9
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.test.ts +37 -2
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-group-page.ts +131 -9
- package/templates/.agents/dashboard/modules/cost-monitor/src/react/use-cost-run-page.ts +34 -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 +46 -26
- package/templates/.agents/dashboard/modules/operations/src/react/DeveloperAttributionPanel.test.ts +54 -0
- package/templates/.agents/dashboard/modules/operations/src/react/DeveloperAttributionPanel.tsx +247 -0
- package/templates/.agents/dashboard/modules/operations/src/react/EntityTables.tsx +31 -11
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsMainContent.tsx +39 -13
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.helpers.tsx +107 -2
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.macro-metrics.test.ts +55 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.test.ts +23 -29
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverview.tsx +211 -184
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsOverviewTopPanel.tsx +127 -0
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPage.tsx +60 -51
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageNavigation.tsx +1 -4
- package/templates/.agents/dashboard/modules/operations/src/react/OperationsPageOverview.tsx +3 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.test.tsx +43 -0
- package/templates/.agents/dashboard/modules/operations/src/react/PagedWorkList.tsx +181 -0
- 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 +16 -6
- package/templates/.agents/dashboard/modules/operations/src/react/UnifiedWorkList.tsx +14 -4
- package/templates/.agents/dashboard/modules/operations/src/react/conversation-rows.ts +1 -2
- package/templates/.agents/dashboard/modules/operations/src/react/developer-identities.test.ts +18 -0
- package/templates/.agents/dashboard/modules/operations/src/react/developer-identities.ts +30 -0
- package/templates/.agents/dashboard/modules/operations/src/react/execution-metrics.ts +1 -0
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.test.ts +393 -4
- package/templates/.agents/dashboard/modules/operations/src/react/export/ExcelExportAction.tsx +484 -61
- package/templates/.agents/dashboard/modules/operations/src/react/export/export-layout.test.ts +23 -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/index.ts +1 -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-coverage-toast.test.ts +4 -3
- package/templates/.agents/dashboard/modules/operations/src/react/operations-date-filters.css +1 -1
- 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 +22 -12
- package/templates/.agents/dashboard/modules/operations/src/react/operations-overview.css +4 -0
- 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 +53 -6
- package/templates/.agents/dashboard/modules/operations/src/react/operations-view-order.test.ts +2 -4
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.test.ts +82 -6
- package/templates/.agents/dashboard/modules/operations/src/react/period-summary.ts +1 -0
- 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/metric-coverage.ts +1 -0
- 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 +533 -338
- package/templates/.agents/dashboard/packages/local-runtime/dist/sqlite-read-model.cjs +506 -311
- package/templates/.agents/dashboard/packages/local-runtime/gitignore.template +2 -0
- 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 +8 -3
- 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 +141 -33
- package/templates/.agents/dashboard/packages/local-runtime/server.mjs +533 -338
- 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 +89 -16
- package/templates/.agents/dashboard/packages/local-runtime/src/server-board.ts +33 -16
- package/templates/.agents/dashboard/packages/local-runtime/src/server-classification-page.test.ts +87 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.test.ts +44 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-period-macro-metric.ts +125 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-reconciliation-refresh.test.ts +66 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-request-authority.test.ts +61 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-request-authority.ts +18 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-run-projections.test.ts +42 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot-refresh.ts +97 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-snapshot.test.ts +22 -5
- package/templates/.agents/dashboard/packages/local-runtime/src/server-sqlite-task-trace.ts +91 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server-workspace.ts +7 -3
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test-fixtures.ts +36 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/server.test.ts +230 -132
- package/templates/.agents/dashboard/packages/local-runtime/src/server.ts +224 -182
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-artifact-counts.ts +28 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-agent-page.test.ts +63 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-agent-page.ts +109 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-aggregates.ts +497 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-fast-page-parity.test-support.ts +65 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-group-page.test.ts +176 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-group-page.ts +119 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-group-projection.ts +41 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.test.ts +16 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-cost-invocation-page.ts +29 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-cache.ts +355 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-persistence.ts +121 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-first-fold-timing.ts +27 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-metric-contract.ts +16 -2
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-projection.ts +15 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.test.ts +223 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-operations-work-list.ts +304 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-cache.test-support.ts +23 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-first-fold-types.ts +89 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider-fixture.ts +227 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-multi-provider.test.ts +691 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model-source-fingerprint.ts +81 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.test.ts +1655 -567
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-read-model.ts +2168 -1268
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-cache.ts +129 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-install.test.ts +26 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-install.ts +28 -0
- package/templates/.agents/dashboard/packages/local-runtime/src/sqlite-snapshot-seed.test.ts +116 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.mjs +146 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-launch-page.test.mjs +165 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard-refresh.mjs +140 -0
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.mjs +255 -289
- package/templates/.agents/dashboard/packages/local-runtime/start-dashboard.test.mjs +94 -88
- package/templates/.agents/dashboard/packages/ui/package.json +1 -1
- package/templates/.agents/dashboard/packages/windows-launcher/Program.cs +5 -2
- package/templates/.agents/dashboard/tests/e2e/package.json +1 -1
- package/templates/.agents/dashboard/tests/e2e/playwright.config.ts +4 -1
- package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-loading.spec.ts +142 -0
- package/templates/.agents/dashboard/tests/e2e/specs/cost-monitor-pagination.spec.ts +232 -0
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard-performance-matrix.spec.ts +743 -0
- package/templates/.agents/dashboard/tests/e2e/specs/dashboard.spec.ts +189 -214
- package/templates/.agents/dashboard/zaip-dashboard-windows.exe +0 -0
- 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 +6 -6
- 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 +3 -3
- package/templates/.agents/requirements/kanban-dashboard.md +10 -2
- 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 +4 -4
- package/templates/.agents/requirements/zaip-strategic-95.md +1 -1
- package/templates/.agents/rules/dashboard-ui-consistency.md +14 -0
- package/templates/.agents/rules/frontend-lite.md +4 -4
- package/templates/.agents/rules/run-lifecycle-closure.md +4 -4
- package/templates/.agents/runtime/VERSION +1 -1
- package/templates/.agents/runtime/bin/zaip.mjs +1142 -1041
- 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/criar-pasta-obsidian/scripts/generate-obsidian-vault.test.mjs +20 -16
- package/templates/.agents/skills/zaip-aios/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-agent-catalog/SKILL.md +22 -0
- package/templates/.agents/skills/zaip-skill-agent-catalog/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-author-skills/SKILL.md +3 -2
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/audit-skill-catalog.mjs +49 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/author-skill-scripts.test.mjs +27 -0
- package/templates/.agents/skills/zaip-skill-author-skills/scripts/run-skill-tests.mjs +37 -0
- package/templates/.agents/skills/zaip-skill-backend/SKILL.md +1 -0
- 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-change/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-change/references/observable-evidence.md +83 -0
- package/templates/.agents/skills/zaip-skill-dashboard-diagnostics/SKILL.md +22 -0
- package/templates/.agents/skills/zaip-skill-dashboard-diagnostics/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-enforce-architecture/SKILL.md +2 -0
- package/templates/.agents/skills/zaip-skill-execution/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-frontend/SKILL.md +4 -3
- package/templates/.agents/skills/zaip-skill-frontend/agents/openai.yaml +2 -2
- package/templates/.agents/skills/zaip-skill-github-deploy/SKILL.md +10 -10
- package/templates/.agents/skills/zaip-skill-growth-strategy-revops/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/SKILL.md +27 -0
- package/templates/.agents/skills/zaip-skill-lifecycle-closure/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-marketing/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-prd/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-local-telemetry.mjs +111 -104
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-explicit-recovery.mjs +223 -0
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.mjs +55 -9
- package/templates/.agents/skills/zaip-skill-reconcile-telemetry/scripts/reconcile-telemetry-lib.test.mjs +145 -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 +82 -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-release-qualification/SKILL.md +20 -0
- package/templates/.agents/skills/zaip-skill-release-qualification/agents/openai.yaml +4 -0
- package/templates/.agents/skills/zaip-skill-review/SKILL.md +5 -0
- package/templates/.agents/skills/zaip-skill-rules/SKILL.md +1 -1
- package/templates/.agents/skills/zaip-skill-sales-methodology/SKILL.md +6 -0
- package/templates/.agents/skills/zaip-skill-spec/SKILL.md +4 -0
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/SKILL.md +22 -90
- package/templates/.agents/skills/zaip-skill-sqlite-read-model/scripts/ensure-node.mjs +28 -5
- package/templates/.agents/zaip-aios/INDEX.md +57 -22
- package/templates/.agents/zaip-aios/README.md +24 -13
- package/templates/.agents/zaip-aios/VERSION +1 -1
- package/templates/.agents/zaip-aios/guides/02-requirements.md +5 -0
- package/templates/.agents/zaip-aios/guides/06-execucao.md +13 -4
- package/templates/.agents/zaip-aios/guides/07-revisao-e-validacao.md +7 -0
- package/templates/.agents/zaip-aios/guides/10-seguranca.md +23 -0
- package/templates/.agents/zaip-aios/guides/11-observabilidade-e-custos.md +6 -6
- package/templates/.agents/zaip-aios/guides/13-boas-praticas.md +3 -0
- package/templates/.agents/zaip-aios/guides/16-lifecycle-e-reconciliacao.md +12 -3
- package/templates/.agents/zaip-aios/guides/17-como-o-custo-e-calculado.md +5 -5
- package/templates/.agents/zaip-aios/guides/18-catalogo-de-agentes.md +76 -0
- package/templates/.agents/zaip-aios/guides/19-assurance-e-autonomia.md +95 -0
- package/templates/.agents/zaip-aios/guides/20-instalacao-detalhada.md +366 -0
- package/templates/.agents/zaip-aios/guides/21-telemetria-monitor-custos.md +46 -0
- package/templates/.agents/zaip-aios/guides/22-fluxos-e-roteamento.md +74 -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 +19 -0
- package/templates/.agents/zaip-aios/guides/26-qualidade-e-release.md +111 -0
- package/templates/.agents/zaip-aios/guides/27-telemetria-git-native.md +172 -0
- package/templates/.agents/zaip-aios/guides/28-lifecycle-completo.md +149 -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 +756 -235
- 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-BZ5WdaMN.css +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/apps/frontend/dist/assets/index-DK_enB5Z.css +0 -1
- package/templates/.agents/dashboard/apps/frontend/src/use-idle-cost-prefetch.ts +0 -45
|
@@ -11,8 +11,9 @@ import {
|
|
|
11
11
|
duplicateUsageImpact,
|
|
12
12
|
exactCompletedSegment,
|
|
13
13
|
exactRemeasurementSegment,
|
|
14
|
-
jsonLines,
|
|
15
14
|
isExactDuplicateUsageGroup,
|
|
15
|
+
jsonLines,
|
|
16
|
+
loadSegments,
|
|
16
17
|
pricingFor,
|
|
17
18
|
recordSequence,
|
|
18
19
|
recordType,
|
|
@@ -27,7 +28,28 @@ const roots = [];
|
|
|
27
28
|
after(async () => Promise.all(roots.map((root) => rm(root, { recursive: true, force: true }))));
|
|
28
29
|
|
|
29
30
|
test("sums duplicate assignment impact without inventing duration", () => {
|
|
30
|
-
assert.deepEqual(
|
|
31
|
+
assert.deepEqual(
|
|
32
|
+
duplicateUsageImpact([
|
|
33
|
+
{
|
|
34
|
+
usage: {
|
|
35
|
+
tokens: { input: 2, output: 3, total: 5 },
|
|
36
|
+
cost: { usd: 1, brl: 5 },
|
|
37
|
+
source_started_at: "2026-01-01T00:00:00Z",
|
|
38
|
+
source_finished_at: "2026-01-01T00:00:01Z",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
]),
|
|
42
|
+
{
|
|
43
|
+
assignments: 1,
|
|
44
|
+
input_tokens: 2,
|
|
45
|
+
output_tokens: 3,
|
|
46
|
+
total_tokens: 5,
|
|
47
|
+
cost_usd: 1,
|
|
48
|
+
cost_brl: 5,
|
|
49
|
+
duration_ms: 1000,
|
|
50
|
+
duration_assignments: 1,
|
|
51
|
+
},
|
|
52
|
+
);
|
|
31
53
|
});
|
|
32
54
|
|
|
33
55
|
test("never supersedes usage recorded after run.finished", () => {
|
|
@@ -188,6 +210,106 @@ test("selects only one completed local segment for an exact Run turn", () => {
|
|
|
188
210
|
);
|
|
189
211
|
});
|
|
190
212
|
|
|
213
|
+
test("matches an observed internal Codex subturn to its enclosing local interval", async () => {
|
|
214
|
+
const root = await mkdtemp(join(tmpdir(), "zaip-reconcile-internal-turn-"));
|
|
215
|
+
roots.push(root);
|
|
216
|
+
const sessionFile = join(root, "internal-subturn.jsonl");
|
|
217
|
+
await writeFile(
|
|
218
|
+
sessionFile,
|
|
219
|
+
[
|
|
220
|
+
{
|
|
221
|
+
timestamp: "2026-08-12T04:30:25.797Z",
|
|
222
|
+
type: "session_meta",
|
|
223
|
+
payload: { id: "session-1", cwd: root },
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
timestamp: "2026-08-12T04:30:26.435Z",
|
|
227
|
+
type: "event_msg",
|
|
228
|
+
payload: { type: "task_started", turn_id: "outer-turn" },
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
timestamp: "2026-08-12T04:31:00.000Z",
|
|
232
|
+
type: "response_item",
|
|
233
|
+
payload: {
|
|
234
|
+
type: "reasoning",
|
|
235
|
+
internal_chat_message_metadata_passthrough: { turn_id: "internal-subturn" },
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
timestamp: "2026-08-12T04:32:00.000Z",
|
|
240
|
+
type: "event_msg",
|
|
241
|
+
payload: {
|
|
242
|
+
type: "token_count",
|
|
243
|
+
info: {
|
|
244
|
+
last_token_usage: {
|
|
245
|
+
input_tokens: 10,
|
|
246
|
+
cached_input_tokens: 0,
|
|
247
|
+
output_tokens: 2,
|
|
248
|
+
reasoning_output_tokens: 0,
|
|
249
|
+
total_tokens: 12,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
timestamp: "2026-08-12T04:33:00.000Z",
|
|
256
|
+
type: "event_msg",
|
|
257
|
+
payload: { type: "task_complete", turn_id: "outer-turn" },
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
timestamp: "2026-08-12T04:35:46.804Z",
|
|
261
|
+
type: "event_msg",
|
|
262
|
+
payload: { type: "task_started", turn_id: "enclosing-turn" },
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
timestamp: "2026-08-12T04:36:00.000Z",
|
|
266
|
+
type: "response_item",
|
|
267
|
+
payload: {
|
|
268
|
+
type: "reasoning",
|
|
269
|
+
internal_chat_message_metadata_passthrough: { turn_id: "internal-subturn" },
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
timestamp: "2026-08-12T04:37:00.000Z",
|
|
274
|
+
type: "event_msg",
|
|
275
|
+
payload: {
|
|
276
|
+
type: "token_count",
|
|
277
|
+
info: {
|
|
278
|
+
last_token_usage: {
|
|
279
|
+
input_tokens: 20,
|
|
280
|
+
cached_input_tokens: 0,
|
|
281
|
+
output_tokens: 4,
|
|
282
|
+
reasoning_output_tokens: 0,
|
|
283
|
+
total_tokens: 24,
|
|
284
|
+
},
|
|
285
|
+
},
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
timestamp: "2026-08-12T04:39:10.716Z",
|
|
290
|
+
type: "event_msg",
|
|
291
|
+
payload: { type: "turn_aborted", turn_id: "enclosing-turn", completed_at: 1786509550 },
|
|
292
|
+
},
|
|
293
|
+
]
|
|
294
|
+
.map((record) => JSON.stringify(record))
|
|
295
|
+
.join("\n") + "\n",
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
const [outerSegment, segment] = await loadSegments(root, [sessionFile]);
|
|
299
|
+
assert.deepEqual(outerSegment.internal_turn_ids, ["internal-subturn"]);
|
|
300
|
+
assert.deepEqual(segment.internal_turn_ids, ["internal-subturn"]);
|
|
301
|
+
assert.equal(outerSegment.finished_at, "2026-08-12T04:33:00.000Z");
|
|
302
|
+
assert.equal(segment.started_at, "2026-08-12T04:35:46.804Z");
|
|
303
|
+
assert.equal(segment.finished_at, "2026-08-12T04:39:10.716Z");
|
|
304
|
+
assert.deepEqual(
|
|
305
|
+
exactCompletedSegment(
|
|
306
|
+
{ client_turn_id: "internal-subturn", occurred_at: "2026-08-12T04:39:07.934Z" },
|
|
307
|
+
[outerSegment, segment],
|
|
308
|
+
),
|
|
309
|
+
{ segment, ambiguous: false },
|
|
310
|
+
);
|
|
311
|
+
});
|
|
312
|
+
|
|
191
313
|
test("remeasurement falls back only to the exact persisted source segment key", () => {
|
|
192
314
|
const target = {
|
|
193
315
|
key: "c:/users/test/.codex/sessions/2026/07/25/child.jsonl#1",
|
|
@@ -318,11 +440,10 @@ test("detects only exact duplicate segment assignments across Runs", () => {
|
|
|
318
440
|
const groups = duplicateUsageAssignments([duplicate, legitimateDelta, first]);
|
|
319
441
|
|
|
320
442
|
assert.equal(groups.length, 1);
|
|
321
|
-
assert.deepEqual(
|
|
322
|
-
|
|
323
|
-
"RUN-DUPLICATE",
|
|
324
|
-
|
|
325
|
-
]);
|
|
443
|
+
assert.deepEqual(
|
|
444
|
+
groups[0].map(({ run: item }) => item.started.run_id),
|
|
445
|
+
["RUN-FIRST", "RUN-DUPLICATE", "RUN-DELTA"],
|
|
446
|
+
);
|
|
326
447
|
assert.equal(groups[0][0].base_segment_key, "sessions/2026/07/17/session.jsonl#1");
|
|
327
448
|
});
|
|
328
449
|
|
|
@@ -350,7 +471,15 @@ test("keeps duplicate reconciliation unavailable and protected from backfill", (
|
|
|
350
471
|
test("prefers later current-context assignment over earlier legacy assignment", () => {
|
|
351
472
|
const run = (id, occurred_at, client_turn_id, classification_source, total) => ({
|
|
352
473
|
started: { run_id: id, occurred_at, client_turn_id },
|
|
353
|
-
usage: [
|
|
474
|
+
usage: [
|
|
475
|
+
{
|
|
476
|
+
event_id: `${id}:usage`,
|
|
477
|
+
source_segment_key: "sessions/x.jsonl#1",
|
|
478
|
+
supersedes_event_id: null,
|
|
479
|
+
classification_source,
|
|
480
|
+
tokens: { input: total - 1, output: 1, total },
|
|
481
|
+
},
|
|
482
|
+
],
|
|
354
483
|
});
|
|
355
484
|
const [group] = duplicateUsageAssignments([
|
|
356
485
|
run("XCHW", "2026-07-01T00:00:00.000Z", "legacy-turn", "legacy_inferred", 9_278_701),
|
|
@@ -363,12 +492,14 @@ test("prefers later current-context assignment over earlier legacy assignment",
|
|
|
363
492
|
test("keeps canonical aliases in review instead of making them apply candidates", () => {
|
|
364
493
|
const run = (id, source_segment_key) => ({
|
|
365
494
|
started: { run_id: id, occurred_at: "2026-07-01T00:00:00.000Z" },
|
|
366
|
-
usage: [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
495
|
+
usage: [
|
|
496
|
+
{
|
|
497
|
+
event_id: `${id}:usage`,
|
|
498
|
+
source_segment_key,
|
|
499
|
+
supersedes_event_id: null,
|
|
500
|
+
tokens: { input: 1, output: 1, total: 2 },
|
|
501
|
+
},
|
|
502
|
+
],
|
|
372
503
|
});
|
|
373
504
|
const [aliasGroup] = duplicateUsageAssignments([
|
|
374
505
|
run("RUN-A", "sessions/x.jsonl#1@RUN-A"),
|
|
@@ -172,18 +172,26 @@ export async function appendRetrospectiveUsage(file, expectedRecords, event) {
|
|
|
172
172
|
const beforeFinish = persisted.slice(0, finishIndex);
|
|
173
173
|
const finish = persisted[finishIndex];
|
|
174
174
|
const historicalCorrections = persisted.slice(finishIndex + 1);
|
|
175
|
-
const updated = [...beforeFinish, ...historicalCorrections, event, finish].map(
|
|
176
|
-
withSequence(record, index + 1),
|
|
175
|
+
const updated = [...beforeFinish, ...historicalCorrections, event, finish].map(
|
|
176
|
+
(record, index) => withSequence(record, index + 1),
|
|
177
177
|
);
|
|
178
178
|
const temporary = `${file}.remeasure.tmp`;
|
|
179
|
-
await writeFile(
|
|
179
|
+
await writeFile(
|
|
180
|
+
temporary,
|
|
181
|
+
`${updated.map((record) => JSON.stringify(record)).join("\n")}\n`,
|
|
182
|
+
"utf8",
|
|
183
|
+
);
|
|
180
184
|
await rename(temporary, file);
|
|
181
185
|
} finally {
|
|
182
186
|
await rm(lockPath, { force: true });
|
|
183
187
|
}
|
|
184
188
|
}
|
|
185
189
|
|
|
186
|
-
export function assertRetrospectiveAppend(
|
|
190
|
+
export function assertRetrospectiveAppend(
|
|
191
|
+
records,
|
|
192
|
+
event,
|
|
193
|
+
{ allowPostTerminalCorrections = false } = {},
|
|
194
|
+
) {
|
|
187
195
|
const finishIndex = records.findIndex((record) => recordType(record) === "run.finished");
|
|
188
196
|
const finished = records[finishIndex];
|
|
189
197
|
const target = records.find(
|
|
@@ -193,11 +201,13 @@ export function assertRetrospectiveAppend(records, event, { allowPostTerminalCor
|
|
|
193
201
|
recordType(finished) !== "run.finished" ||
|
|
194
202
|
(!allowPostTerminalCorrections && finishIndex !== records.length - 1) ||
|
|
195
203
|
(allowPostTerminalCorrections &&
|
|
196
|
-
records
|
|
197
|
-
(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
204
|
+
records
|
|
205
|
+
.slice(finishIndex + 1)
|
|
206
|
+
.some(
|
|
207
|
+
(record) =>
|
|
208
|
+
usageView(record)?.activity_kind !== "retrospective_local_remeasurement" ||
|
|
209
|
+
usageView(record)?.retrospective_correction !== true,
|
|
210
|
+
)) ||
|
|
201
211
|
event.type !== "usage.recorded" ||
|
|
202
212
|
event.retrospective_correction !== true ||
|
|
203
213
|
event.activity_kind !== "retrospective_local_remeasurement" ||
|
|
@@ -3,6 +3,7 @@ import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { after, test } from "node:test";
|
|
6
|
+
import { planExplicitTurnRecovery } from "./reconcile-telemetry-explicit-recovery.mjs";
|
|
6
7
|
import { jsonLines, usageStatus, usageView } from "./reconcile-telemetry-lib.mjs";
|
|
7
8
|
import {
|
|
8
9
|
appendRetrospectiveUsage,
|
|
@@ -36,6 +37,58 @@ test("selects completed native Runs for default timing-only backfill", () => {
|
|
|
36
37
|
assert.deepEqual([...selected], ["RUN-NATIVE"]);
|
|
37
38
|
});
|
|
38
39
|
|
|
40
|
+
test("explicit recovery requires exact session identity, unused turns, model/effort, and SPEC text", () => {
|
|
41
|
+
const run = {
|
|
42
|
+
started: {
|
|
43
|
+
run_id: "RUN-EXPLICIT",
|
|
44
|
+
client_thread_id: "/root/agent",
|
|
45
|
+
model: "gpt-test",
|
|
46
|
+
reasoning_effort: "medium",
|
|
47
|
+
},
|
|
48
|
+
records: [
|
|
49
|
+
{ type: "run.started" },
|
|
50
|
+
{ type: "usage.recorded", event_id: "RUN-EXPLICIT:old", source_segment_key: "old" },
|
|
51
|
+
{ type: "run.finished" },
|
|
52
|
+
],
|
|
53
|
+
usage: [{ event_id: "RUN-EXPLICIT:old", source_segment_key: "old", tokens: { total: 1 } }],
|
|
54
|
+
};
|
|
55
|
+
const segment = {
|
|
56
|
+
key: "session#5",
|
|
57
|
+
turn_id: "turn-r7qk",
|
|
58
|
+
internal_turn_ids: ["turn-r7qk"],
|
|
59
|
+
session_agent_path: "/root/agent",
|
|
60
|
+
model: "gpt-test",
|
|
61
|
+
effort: "medium",
|
|
62
|
+
started_at: "2026-08-22T22:56:58.553Z",
|
|
63
|
+
finished_at: "2026-08-22T23:05:26.121Z",
|
|
64
|
+
raw: "SPEC-R7QK observed",
|
|
65
|
+
usage: [
|
|
66
|
+
{
|
|
67
|
+
input_tokens: 8,
|
|
68
|
+
cached_input_tokens: 3,
|
|
69
|
+
output_tokens: 2,
|
|
70
|
+
reasoning_output_tokens: 1,
|
|
71
|
+
total_tokens: 10,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
const plan = planExplicitTurnRecovery({
|
|
76
|
+
run,
|
|
77
|
+
segments: [segment],
|
|
78
|
+
mappings: [{ spec_id: "SPEC-R7QK", turn_id: "turn-r7qk", total: 10, usd: 1, brl: 5 }],
|
|
79
|
+
});
|
|
80
|
+
assert.equal(plan.eligible, true);
|
|
81
|
+
assert.equal(plan.turns[0].tokens.total, 10);
|
|
82
|
+
assert.equal(
|
|
83
|
+
planExplicitTurnRecovery({
|
|
84
|
+
run,
|
|
85
|
+
segments: [{ ...segment, session_agent_path: "/root/root", key: "old" }],
|
|
86
|
+
mappings: [{ spec_id: "SPEC-R7QK", turn_id: "turn-r7qk", total: 10, usd: 1, brl: 5 }],
|
|
87
|
+
}).eligible,
|
|
88
|
+
false,
|
|
89
|
+
);
|
|
90
|
+
});
|
|
91
|
+
|
|
39
92
|
test("inserts a correction before the terminal event under an exclusive lock", async () => {
|
|
40
93
|
const root = await mkdtemp(join(tmpdir(), "zaip-remeasure-append-"));
|
|
41
94
|
roots.push(root);
|
|
@@ -63,7 +116,10 @@ test("inserts a correction before the terminal event under an exclusive lock", a
|
|
|
63
116
|
const events = jsonLines(persisted);
|
|
64
117
|
assert.equal(events.at(-2).event_id, correction.event_id);
|
|
65
118
|
assert.equal(events.at(-1).type, "run.finished");
|
|
66
|
-
assert.deepEqual(
|
|
119
|
+
assert.deepEqual(
|
|
120
|
+
events.map((event) => event.sequence),
|
|
121
|
+
[1, 2, 3, 4],
|
|
122
|
+
);
|
|
67
123
|
});
|
|
68
124
|
|
|
69
125
|
test("restores historical retrospective corrections before the terminal event", async () => {
|
|
@@ -74,13 +130,34 @@ test("restores historical retrospective corrections before the terminal event",
|
|
|
74
130
|
{ type: "run.started", event_id: "RUN:1", sequence: 1, phase: "execution" },
|
|
75
131
|
{ type: "usage.recorded", event_id: "RUN:2", sequence: 2, phase: "execution" },
|
|
76
132
|
{ type: "run.finished", event_id: "RUN:3", sequence: 3, phase: "execution" },
|
|
77
|
-
{
|
|
133
|
+
{
|
|
134
|
+
type: "usage.recorded",
|
|
135
|
+
event_id: "RUN:4",
|
|
136
|
+
sequence: 4,
|
|
137
|
+
phase: "execution",
|
|
138
|
+
activity_kind: "retrospective_local_remeasurement",
|
|
139
|
+
retrospective_correction: true,
|
|
140
|
+
},
|
|
78
141
|
];
|
|
79
142
|
await writeFile(file, `${records.map((record) => JSON.stringify(record)).join("\n")}\n`, "utf8");
|
|
80
|
-
await appendRetrospectiveUsage(file, records, {
|
|
143
|
+
await appendRetrospectiveUsage(file, records, {
|
|
144
|
+
type: "usage.recorded",
|
|
145
|
+
event_id: "RUN:5",
|
|
146
|
+
sequence: 5,
|
|
147
|
+
phase: "execution",
|
|
148
|
+
activity_kind: "retrospective_local_remeasurement",
|
|
149
|
+
supersedes_event_id: "RUN:2",
|
|
150
|
+
retrospective_correction: true,
|
|
151
|
+
});
|
|
81
152
|
const events = jsonLines(await readFile(file, "utf8"));
|
|
82
|
-
assert.deepEqual(
|
|
83
|
-
|
|
153
|
+
assert.deepEqual(
|
|
154
|
+
events.map((event) => event.event_id),
|
|
155
|
+
["RUN:1", "RUN:2", "RUN:4", "RUN:5", "RUN:3"],
|
|
156
|
+
);
|
|
157
|
+
assert.deepEqual(
|
|
158
|
+
events.map((event) => event.sequence),
|
|
159
|
+
[1, 2, 3, 4, 5],
|
|
160
|
+
);
|
|
84
161
|
});
|
|
85
162
|
|
|
86
163
|
test("an unavailable lock leaves the original history byte-identical", async () => {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { rename, writeFile } from "node:fs/promises";
|
|
2
|
+
|
|
3
|
+
export async function reconcileGenericModelIdentities({
|
|
4
|
+
applyBackfill,
|
|
5
|
+
pricingFor,
|
|
6
|
+
runs,
|
|
7
|
+
segments,
|
|
8
|
+
usageView,
|
|
9
|
+
withSequence,
|
|
10
|
+
workspace,
|
|
11
|
+
}) {
|
|
12
|
+
const segmentsByKey = new Map(segments.map((segment) => [segment.key, segment]));
|
|
13
|
+
const genericModel = (model) => typeof model === "string" && /^gpt-5$/i.test(model.trim());
|
|
14
|
+
let correctionsCount = 0;
|
|
15
|
+
for (const run of runs) {
|
|
16
|
+
const superseded = new Set(run.usage.map((usage) => usage.supersedes_event_id).filter(Boolean));
|
|
17
|
+
const effective = run.usage.filter((usage) => !superseded.has(usage.event_id));
|
|
18
|
+
const corrections = effective.flatMap((usage) => {
|
|
19
|
+
if (!genericModel(usage.model ?? run.started.model)) return [];
|
|
20
|
+
const segment = usage.source_segment_key
|
|
21
|
+
? (segmentsByKey.get(usage.source_segment_key) ?? null)
|
|
22
|
+
: null;
|
|
23
|
+
return segment?.model && !genericModel(segment.model) ? [{ usage, segment }] : [];
|
|
24
|
+
});
|
|
25
|
+
correctionsCount += corrections.length;
|
|
26
|
+
if (!applyBackfill || corrections.length === 0) continue;
|
|
27
|
+
|
|
28
|
+
const correctionByTarget = new Map(corrections.map((item) => [item.usage.event_id, item]));
|
|
29
|
+
const updated = [];
|
|
30
|
+
let correctionIndex = run.usage.filter(
|
|
31
|
+
(usage) => usage.activity_kind === "model_identity_reconciliation",
|
|
32
|
+
).length;
|
|
33
|
+
for (const record of run.records) {
|
|
34
|
+
updated.push(record);
|
|
35
|
+
const original = usageView(record);
|
|
36
|
+
const correction = original ? correctionByTarget.get(original.event_id) : null;
|
|
37
|
+
if (!correction) continue;
|
|
38
|
+
correctionIndex += 1;
|
|
39
|
+
const cost = await pricingFor(workspace, correction.segment.model, original.tokens);
|
|
40
|
+
updated.push({
|
|
41
|
+
schema_version: 2,
|
|
42
|
+
event_id: `${run.started.run_id}:model:${String(correctionIndex).padStart(6, "0")}`,
|
|
43
|
+
run_id: run.started.run_id,
|
|
44
|
+
sequence: 0,
|
|
45
|
+
occurred_at: original.occurred_at,
|
|
46
|
+
type: "usage.recorded",
|
|
47
|
+
phase: original.phase,
|
|
48
|
+
activity_kind: "model_identity_reconciliation",
|
|
49
|
+
classification_source: original.classification_source ?? "current_context",
|
|
50
|
+
tokens: original.tokens,
|
|
51
|
+
cost,
|
|
52
|
+
provider: original.provider ?? run.started.provider ?? "openai",
|
|
53
|
+
model: correction.segment.model,
|
|
54
|
+
source_segment_key: original.source_segment_key,
|
|
55
|
+
supersedes_event_id: original.event_id,
|
|
56
|
+
source_occurred_at:
|
|
57
|
+
original.source_occurred_at ??
|
|
58
|
+
correction.segment.finished_at ??
|
|
59
|
+
correction.segment.started_at,
|
|
60
|
+
...(original.context_stats === undefined ? {} : { context_stats: original.context_stats }),
|
|
61
|
+
runtime: {
|
|
62
|
+
reasoning_effort: correction.segment.effort ?? original.runtime?.reasoning_effort ?? null,
|
|
63
|
+
service_tier: correction.segment.service_tier ?? original.runtime?.service_tier ?? null,
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
const resequenced = updated.map((record, index) => withSequence(record, index + 1));
|
|
68
|
+
const temporary = `${run.file}.model.tmp`;
|
|
69
|
+
await writeFile(
|
|
70
|
+
temporary,
|
|
71
|
+
`${resequenced.map((record) => JSON.stringify(record)).join("\n")}\n`,
|
|
72
|
+
"utf8",
|
|
73
|
+
);
|
|
74
|
+
await rename(temporary, run.file);
|
|
75
|
+
}
|
|
76
|
+
return correctionsCount;
|
|
77
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: zaip-skill-release-qualification
|
|
3
|
+
description: Qualify an exact ZAIP release candidate through source-template-package parity, cleanroom, smoke, and candidate-specific evidence; use before a release or publication decision.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Qualify a release candidate
|
|
7
|
+
|
|
8
|
+
Use before deciding whether a concrete candidate is ready. It does not publish.
|
|
9
|
+
|
|
10
|
+
1. Identify the exact candidate revision, version, and intended distribution surface.
|
|
11
|
+
Do not substitute current working-tree checks for candidate evidence.
|
|
12
|
+
2. Validate framework lock, source-to-public-template parity, generated artifacts,
|
|
13
|
+
package contents, and version alignment. Treat any source/template/package drift as
|
|
14
|
+
a failed candidate.
|
|
15
|
+
3. Run the relevant smoke and cleanroom checks against that candidate and preserve the
|
|
16
|
+
commands, revision, outcomes, and unresolved limits as evidence.
|
|
17
|
+
4. Separate local qualification, remote GitHub CI, registry publication, and formal
|
|
18
|
+
lifecycle closure. A matching SHA or passing local gate does not prove terminal CI.
|
|
19
|
+
5. Route an explicit push, deploy, or GitHub publication request to
|
|
20
|
+
`$zaip-skill-github-deploy`; never publish as part of qualification.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "ZAIP Release Qualification"
|
|
3
|
+
short_description: "Qualify an exact release candidate without publishing it."
|
|
4
|
+
default_prompt: "Use $zaip-skill-release-qualification to qualify this exact ZAIP release candidate for source-template-package parity, smoke, and cleanroom evidence."
|
|
@@ -16,3 +16,8 @@ Esta skill é read-only. Um pedido de revisão não autoriza corrigir, concluir
|
|
|
16
16
|
7. Correções aprovadas exigem autorização separada e começam uma nova Task. Inicie seu Run com `--work-type rework`, relacione somente IDs já conhecidos e deixe ancestral desconhecido como `null`; nunca leia todo o histórico para adivinhar vínculos. A revisão original permanece imutável.
|
|
17
17
|
8. Valide o perfil quantitativo e semântico por mínimos, sem quotas máximas: `lite` exige pelo menos uma validação e uma Evidence, normalmente uma de cada, mas aceita extras legítimos; `standard` exige pelo menos duas validações no perfil base ou três no elevado e ao menos uma Evidence consolidada; `critical` exige três ou mais validações, quality review independente e somente os controles acionados pelos sinais persistidos; SPEC/PRD exigem três ou mais validações e Evidences parentais, matriz, integração e review independente.
|
|
18
18
|
9. Para cleanroom, ambiente representativo ou produção, confira hash do candidato, identidade do ambiente, reviewer independente e Run observado; teste local não promove esses estados.
|
|
19
|
+
10. Leia [o contrato de prova observável](../zaip-skill-change/references/observable-evidence.md) e confronte cenário, expectativa e observação por AC. Diferencie prova confirmada, limitada, pendente, reprovada e modalidade não aplicável; observações não substituem Validation/Evidence aprovadas. Não transfira aprovação entre Runs nem conte uma limitação como prova suficiente.
|
|
20
|
+
|
|
21
|
+
# Revisão visual condicional
|
|
22
|
+
|
|
23
|
+
Não aprove UI visual apenas por source ou typecheck: exija render de cada consumidor e bundle servido quando aplicável, além de screenshot real examinado do estado pedido. Após o fallback finito, browser indisponível deixa browser proof como unknown e o AC visual pendente, sem bloquear prova técnica ou trabalho independente. Ausência de impacto visual admite N/A justificado, não ausência de ferramenta.
|
|
@@ -10,7 +10,7 @@ description: Create and validate project ZAIP Rules while preserving core Rules.
|
|
|
10
10
|
3. Crie ou refine `.agents/rules/<nome>.md` com ID `RULE-*` único; `load` em `always`, `auto`, `file_match` ou `manual`; `priority` em `critical`, `high`, `medium` ou `low`; `max_context_tokens` positivo; `requires` com IDs existentes. Exija `globs` não vazios quando `load: file_match`.
|
|
11
11
|
4. Escreva regras pequenas, imperativas e verificáveis; mova explicações extensas para Requirements ou documentação.
|
|
12
12
|
5. Detecte contradições, ciclos de `requires`, duplicação de IDs e budgets excessivos.
|
|
13
|
-
6. Rode `zaip doctor` e `zaip context
|
|
13
|
+
6. Rode `zaip doctor` e use `zaip context inventory`, `zaip context build` ou `zaip context inspect` conforme o cenário da Rule; quando a orientação publicada mudar, rode `zaip adapters build` e `zaip adapters check`.
|
|
14
14
|
|
|
15
15
|
## Ownership
|
|
16
16
|
|
|
@@ -5,6 +5,12 @@ description: Design evidence-backed sales processes, qualification playbooks, an
|
|
|
5
5
|
|
|
6
6
|
# Metodologia comercial
|
|
7
7
|
|
|
8
|
+
## Localização canônica
|
|
9
|
+
|
|
10
|
+
Salve processos comerciais, playbooks, scripts internos, matrizes de objeções e materiais de enablement em `.agents/sales/`. Não salve esses artefatos em `docs/`, na raiz do repositório ou em diretórios de brand, marketing ou growth.
|
|
11
|
+
|
|
12
|
+
O arquivo central da área é `.agents/sales/playbook.md`; atualize-o quando uma decisão mudar o processo comercial, qualificação, handoff ou narrativa sales-facing. Materiais específicos podem ser arquivos adicionais na mesma pasta.
|
|
13
|
+
|
|
8
14
|
1. Delimite empresa, oferta, ICP, persona, canal, origem inbound/outbound, etapa, nível de awareness, complexidade, ticket, ciclo, regiões, compliance e autoridade. Separe fato, evidência, hipótese e decisão; não fabrique consciência, urgência, prova, ROI, preço ou autoridade.
|
|
9
15
|
2. Desenhe um playbook por etapa com objetivo, dono, entrada, abertura, perguntas, evidência, campos SPIN/BANT, transição, objeções, prova autorizada, microcompromisso, saída, CRM, handoff/SLA e próximo passo. Inclua caminhos de not-qualified, nurture e no-decision.
|
|
10
16
|
3. Use as três etapas ZAIP: descoberta/pré-qualificação (tipicamente SDR), alinhamento/qualificação com handoff definido para closer, e fechamento/negociação pelo closer. O preço só pode ser apresentado como aprovado; proposta e contrato seguem o handoff autorizado.
|
|
@@ -43,3 +43,7 @@ SPEC é opcional para trabalho técnico amplo; Task-first continua válida para
|
|
|
43
43
|
1. Antes de entregar uma SPEC, construa a matriz parental completa de ACs e produza pelo menos três validações e três Evidences próprias; resultados das Tasks não substituem esta camada.
|
|
44
44
|
2. As modalidades mínimas são integração, spec review e quality review. O review é de autor e Run diferentes, e todos os artefatos usam o commit final esperado.
|
|
45
45
|
3. Uma SPEC com Tasks `lite` continua usando rigor parental: a redução vale para a Task avulsa, não para a alegação integrada da SPEC.
|
|
46
|
+
|
|
47
|
+
# UI visual condicional
|
|
48
|
+
|
|
49
|
+
Quando a SPEC afetar UI, declare cada consumidor e gates de render exato; inclua bundle servido apenas se a distribuição/preview for afetada.
|
|
@@ -1,96 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: zaip-skill-sqlite-read-model
|
|
3
|
-
description: Install
|
|
3
|
+
description: Install, refresh, validate, or rebuild the disposable SQLite read model from canonical ZAIP records; use for schema drift or local dashboard data failures.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# SQLite read model
|
|
7
7
|
|
|
8
|
-
Use this skill
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
If Windows reports `EPERM` or `EBUSY` replacing
|
|
32
|
-
`.local/dashboard-sqlite/read-model.sqlite`, a live dashboard owns that file.
|
|
33
|
-
Do not treat its old schema as validation evidence. Rebuild and validate an
|
|
34
|
-
isolated generation instead:
|
|
35
|
-
|
|
36
|
-
```powershell
|
|
37
|
-
$env:ZAIP_SQLITE_DB_PATH = (Join-Path $PWD '.local/dashboard-sqlite/read-model-verify.sqlite')
|
|
38
|
-
node .agents/dashboard/packages/local-runtime/scripts/rebuild-sqlite-read-model.mjs
|
|
39
|
-
node .agents/dashboard/packages/local-runtime/scripts/validate-sqlite-read-model.mjs
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Clear `ZAIP_SQLITE_DB_PATH` after the isolated check when the shell will start
|
|
43
|
-
the normal dashboard again.
|
|
44
|
-
|
|
45
|
-
## Current persisted schema and objective verification
|
|
46
|
-
|
|
47
|
-
The current generator (`packages/local-runtime/src/sqlite-read-model.ts`) owns
|
|
48
|
-
the schema. At schema version 60 it persists exactly these tables:
|
|
49
|
-
|
|
50
|
-
- `zaip_aios_activities`
|
|
51
|
-
- `zaip_dim_zaip_agent`
|
|
52
|
-
- `zaip_dim_llm_model`
|
|
53
|
-
- `zaip_dim_provider`
|
|
54
|
-
- `cost_invocation_dimension_facts`
|
|
55
|
-
|
|
56
|
-
Temporary staging tables and compatibility aliases are connection-local and are
|
|
57
|
-
not persisted. Persisted views use exactly one `zaip_vw_` prefix; query them
|
|
58
|
-
through the documented runtime view names rather than creating duplicate
|
|
59
|
-
unprefixed objects. The generator also requires the activity, cost-dimension,
|
|
60
|
-
and unique run indexes listed below.
|
|
61
|
-
|
|
62
|
-
After every full rebuild, run this check against the same database generation.
|
|
63
|
-
It verifies database integrity, the exact table inventory, view namespace and
|
|
64
|
-
compilability, and the required indexes. It exits non-zero on drift.
|
|
65
|
-
|
|
66
|
-
```powershell
|
|
67
|
-
@'
|
|
68
|
-
import assert from 'node:assert/strict';
|
|
69
|
-
import { DatabaseSync } from 'node:sqlite';
|
|
70
|
-
import { resolve } from 'node:path';
|
|
71
|
-
|
|
72
|
-
const databasePath = process.env.ZAIP_SQLITE_DB_PATH ?? resolve('.local/dashboard-sqlite/read-model.sqlite');
|
|
73
|
-
const database = new DatabaseSync(databasePath, { readOnly: true });
|
|
74
|
-
try {
|
|
75
|
-
assert.equal(database.prepare('PRAGMA integrity_check').get().integrity_check, 'ok');
|
|
76
|
-
const objects = database.prepare("SELECT name, type FROM sqlite_master WHERE type IN ('table', 'view') AND name NOT LIKE 'sqlite_%'").all();
|
|
77
|
-
const tables = objects.filter(({ type }) => type === 'table').map(({ name }) => name).sort();
|
|
78
|
-
assert.deepEqual(tables, ['cost_invocation_dimension_facts', 'zaip_aios_activities', 'zaip_dim_llm_model', 'zaip_dim_provider', 'zaip_dim_zaip_agent']);
|
|
79
|
-
const views = objects.filter(({ type }) => type === 'view').map(({ name }) => name);
|
|
80
|
-
assert.ok(views.length > 0, 'no persisted views');
|
|
81
|
-
assert.ok(views.every((name) => name.startsWith('zaip_vw_') && !name.startsWith('zaip_vw_vw_')), 'invalid persisted-view prefix');
|
|
82
|
-
for (const name of views) database.prepare(`SELECT * FROM main."${name.replaceAll('"', '""')}" LIMIT 0`).all();
|
|
83
|
-
const indexes = new Set(database.prepare("SELECT name FROM sqlite_master WHERE type='index'").all().map(({ name }) => name));
|
|
84
|
-
for (const name of ['zaip_activities_agent_run', 'zaip_activities_task_day', 'zaip_activities_spec_day', 'zaip_activities_prd_day', 'zaip_activities_run_id', 'zaip_activities_period_invocation', 'cost_dimension_facts_day_model', 'cost_dimension_facts_day_provider', 'cost_dimension_facts_invocation']) assert.ok(indexes.has(name), `missing index ${name}`);
|
|
85
|
-
console.log(JSON.stringify({ databasePath, tableCount: tables.length, viewCount: views.length, requiredIndexCount: 9 }));
|
|
86
|
-
} finally {
|
|
87
|
-
database.close();
|
|
88
|
-
}
|
|
89
|
-
'@ | node --input-type=module
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
The checked-in `validate-sqlite-read-model.mjs` and
|
|
93
|
-
`test-sqlite-read-model.mjs` are the installation gates for schema 60. They
|
|
94
|
-
assert the five persisted tables, the `zaip_vw_` view namespace and required
|
|
95
|
-
indexes against a freshly rebuilt database. Do not use an old database or
|
|
96
|
-
weaken those assertions to hide a schema mismatch.
|
|
8
|
+
Use this skill for the disposable read model. Its only canonical inputs are
|
|
9
|
+
`.agents/records` and `.agents/config`; never use dashboard projections or lifecycle
|
|
10
|
+
overviews as an input.
|
|
11
|
+
|
|
12
|
+
1. Confirm Node.js 22 or newer. Install its LTS only when the user authorized a
|
|
13
|
+
prerequisite installation.
|
|
14
|
+
2. Build the local runtime before rebuilding SQLite so the generated database and
|
|
15
|
+
validation code come from the same runtime revision.
|
|
16
|
+
3. Prefer normal incremental refresh at dashboard startup. Rebuild only after a
|
|
17
|
+
persisted-contract change or a validation failure.
|
|
18
|
+
4. Keep database files under `.local` (or another disposable ignored location).
|
|
19
|
+
If Windows reports `EPERM` or `EBUSY`, identify the owning dashboard and validate
|
|
20
|
+
an isolated generation instead of treating the locked database as evidence.
|
|
21
|
+
5. Run the checked-in rebuild and validation scripts from the local runtime. They
|
|
22
|
+
are the authority for the current schema version, persisted objects, integrity,
|
|
23
|
+
views and indexes; do not duplicate those volatile values in this skill.
|
|
24
|
+
6. Rebuild the dashboard artifact when the served runtime is part of the acceptance
|
|
25
|
+
path, then verify the served health endpoint and the exact affected API/query.
|
|
26
|
+
|
|
27
|
+
The read model is read-only. A successful database check is technical evidence only;
|
|
28
|
+
browser behavior and lifecycle closure need their own evidence.
|