@invictus-group-ai/orchestra 0.5.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/LICENSE +21 -0
- package/LICENSING.md +49 -0
- package/README.md +507 -0
- package/assets/settings-template.json +99 -0
- package/bin/invi.js +6 -0
- package/content-dist/LICENSE +95 -0
- package/content-dist/PIPELINE.md +823 -0
- package/content-dist/README.md +128 -0
- package/content-dist/agents/README.md +135 -0
- package/content-dist/agents/mapping.json +476 -0
- package/content-dist/agents/stacks/backend-django.md +66 -0
- package/content-dist/agents/stacks/backend-dotnet.md +72 -0
- package/content-dist/agents/stacks/backend-fastapi.md +66 -0
- package/content-dist/agents/stacks/backend-laravel.md +66 -0
- package/content-dist/agents/stacks/backend-node.md +66 -0
- package/content-dist/agents/stacks/backend-spring.md +66 -0
- package/content-dist/agents/stacks/desktop-delphi.md +73 -0
- package/content-dist/agents/stacks/frontend-angular.md +65 -0
- package/content-dist/agents/stacks/frontend-react.md +67 -0
- package/content-dist/agents/stacks/frontend-svelte.md +67 -0
- package/content-dist/agents/stacks/frontend-vue.md +66 -0
- package/content-dist/agents/stacks/mobile-flutter.md +68 -0
- package/content-dist/agents/stacks/wordpress.md +66 -0
- package/content-dist/agents/universal/invi-qa.md +57 -0
- package/content-dist/agents/universal/invi-reviewer.md +61 -0
- package/content-dist/agents/universal/invi-security.md +55 -0
- package/content-dist/agents/universal/invi-tester.md +55 -0
- package/content-dist/agents/universal/invi-ui.md +85 -0
- package/content-dist/fragments/base.md +37 -0
- package/content-dist/fragments/domain/api-publica-rate-limiting.md +83 -0
- package/content-dist/fragments/domain/autenticacao-enterprise.md +86 -0
- package/content-dist/fragments/domain/busca-elasticsearch.md +86 -0
- package/content-dist/fragments/domain/dashboard-admin-rbac.md +80 -0
- package/content-dist/fragments/domain/design-system.md +71 -0
- package/content-dist/fragments/domain/ecommerce-completo.md +86 -0
- package/content-dist/fragments/domain/filas-jobs.md +80 -0
- package/content-dist/fragments/domain/integracao-crm-erp.md +82 -0
- package/content-dist/fragments/domain/lgpd.md +84 -0
- package/content-dist/fragments/domain/multi-tenancy.md +79 -0
- package/content-dist/fragments/domain/notificacoes-multicanal.md +81 -0
- package/content-dist/fragments/domain/pagamentos-brasil.md +85 -0
- package/content-dist/fragments/domain/plataforma-conteudo.md +77 -0
- package/content-dist/fragments/domain/realtime-websockets.md +92 -0
- package/content-dist/fragments/domain/relatorios-analytics.md +80 -0
- package/content-dist/fragments/domain/saas-stripe-billing.md +79 -0
- package/content-dist/fragments/domain/sistema-pagamentos.md +81 -0
- package/content-dist/fragments/domain/upload-midia.md +81 -0
- package/content-dist/fragments/domain/whatsapp-business.md +82 -0
- package/content-dist/fragments/index.json +1670 -0
- package/content-dist/fragments/references/angular-ngrx/app-config-and-testing.md +81 -0
- package/content-dist/fragments/references/angular-ngrx/store-pattern.md +155 -0
- package/content-dist/fragments/references/ansible-server-setup/layout-and-config.md +143 -0
- package/content-dist/fragments/references/ansible-server-setup/roles.md +238 -0
- package/content-dist/fragments/references/api-publica-rate-limiting/patterns.md +68 -0
- package/content-dist/fragments/references/astro-static/content-and-islands.md +117 -0
- package/content-dist/fragments/references/autenticacao-enterprise/pitfalls.md +70 -0
- package/content-dist/fragments/references/busca-elasticsearch/patterns.md +100 -0
- package/content-dist/fragments/references/chrome-extension-mv3/messaging-and-storage.md +109 -0
- package/content-dist/fragments/references/cli-typescript-commander/commands-and-config.md +136 -0
- package/content-dist/fragments/references/cloud-run-gcp/build-and-deploy.md +127 -0
- package/content-dist/fragments/references/cloud-run-gcp/iam-secrets-networking.md +65 -0
- package/content-dist/fragments/references/computer-vision-yolo/serving-and-export.md +182 -0
- package/content-dist/fragments/references/computer-vision-yolo/training-and-validation.md +131 -0
- package/content-dist/fragments/references/convex-react/functions.md +117 -0
- package/content-dist/fragments/references/convex-react/react-and-storage.md +109 -0
- package/content-dist/fragments/references/dashboard-admin-rbac/patterns.md +73 -0
- package/content-dist/fragments/references/data-pipeline-airflow/dag-patterns.md +149 -0
- package/content-dist/fragments/references/data-pipeline-airflow/operations.md +74 -0
- package/content-dist/fragments/references/delphi-object-pascal/legacy-extraction.md +175 -0
- package/content-dist/fragments/references/django-drf-celery/celery-tasks.md +47 -0
- package/content-dist/fragments/references/django-drf-celery/viewsets-and-serializers.md +92 -0
- package/content-dist/fragments/references/docker-compose-dev/compose-files.md +146 -0
- package/content-dist/fragments/references/docker-compose-dev/dockerfile-and-proxy.md +108 -0
- package/content-dist/fragments/references/dotnet-aspnet/data-and-di.md +90 -0
- package/content-dist/fragments/references/dotnet-aspnet/web-layer.md +88 -0
- package/content-dist/fragments/references/ecommerce-completo/patterns.md +76 -0
- package/content-dist/fragments/references/electron-app/ipc-bridge.md +123 -0
- package/content-dist/fragments/references/electron-app/security-and-packaging.md +134 -0
- package/content-dist/fragments/references/elixir-phoenix/context-and-web.md +112 -0
- package/content-dist/fragments/references/elixir-phoenix/processes.md +65 -0
- package/content-dist/fragments/references/filas-jobs/patterns.md +116 -0
- package/content-dist/fragments/references/fine-tuning-huggingface/data-and-export.md +114 -0
- package/content-dist/fragments/references/fine-tuning-huggingface/training-and-lora.md +123 -0
- package/content-dist/fragments/references/flutter/platform-channels-and-goldens.md +68 -0
- package/content-dist/fragments/references/flutter/state-and-widgets.md +95 -0
- package/content-dist/fragments/references/github-actions-cicd/workflows.md +235 -0
- package/content-dist/fragments/references/go-chi-gorm/http-layer.md +87 -0
- package/content-dist/fragments/references/go-chi-gorm/service-layer.md +58 -0
- package/content-dist/fragments/references/graphql-apollo/resolvers-and-loaders.md +128 -0
- package/content-dist/fragments/references/hono-bun/patterns.md +144 -0
- package/content-dist/fragments/references/integracao-crm-erp/patterns.md +100 -0
- package/content-dist/fragments/references/kubernetes-helm/chart-templates.md +162 -0
- package/content-dist/fragments/references/kubernetes-helm/secrets-storage-deploy.md +78 -0
- package/content-dist/fragments/references/langchain-python-agent/agent-and-cost.md +120 -0
- package/content-dist/fragments/references/langchain-python-agent/memory-and-resilience.md +76 -0
- package/content-dist/fragments/references/laravel/eloquent-and-queues.md +126 -0
- package/content-dist/fragments/references/laravel/http-layer.md +110 -0
- package/content-dist/fragments/references/lgpd/patterns.md +110 -0
- package/content-dist/fragments/references/llm-ops-production/routing-and-budget.md +118 -0
- package/content-dist/fragments/references/llm-ops-production/tracing-eval-ab.md +102 -0
- package/content-dist/fragments/references/microservices-docker/compose-and-gateway.md +93 -0
- package/content-dist/fragments/references/microservices-docker/events-and-correlation.md +88 -0
- package/content-dist/fragments/references/ml-fastapi-serving/metrics-drift-docker.md +97 -0
- package/content-dist/fragments/references/ml-fastapi-serving/serving-core.md +155 -0
- package/content-dist/fragments/references/ml-training-pipeline/dvc-pipeline.md +102 -0
- package/content-dist/fragments/references/ml-training-pipeline/mlflow-registry-ci.md +139 -0
- package/content-dist/fragments/references/monitoring-observability/alerts-and-config.md +169 -0
- package/content-dist/fragments/references/monitoring-observability/instrumentation-node.md +139 -0
- package/content-dist/fragments/references/multi-tenancy/patterns.md +85 -0
- package/content-dist/fragments/references/nestjs-typescript/guards-and-decorators.md +103 -0
- package/content-dist/fragments/references/nestjs-typescript/modules-dtos-setup.md +106 -0
- package/content-dist/fragments/references/nextjs-app-router/patterns.md +177 -0
- package/content-dist/fragments/references/nextjs-prisma-postgres/billing.md +167 -0
- package/content-dist/fragments/references/nextjs-trpc-drizzle/data-and-auth.md +121 -0
- package/content-dist/fragments/references/nextjs-trpc-drizzle/trpc-setup.md +62 -0
- package/content-dist/fragments/references/nodejs-express-typescript/config-and-tokens.md +48 -0
- package/content-dist/fragments/references/nodejs-express-typescript/middleware.md +108 -0
- package/content-dist/fragments/references/notificacoes-multicanal/patterns.md +78 -0
- package/content-dist/fragments/references/nuxt3-tailwind/server-routes.md +79 -0
- package/content-dist/fragments/references/nuxt3-tailwind/state-and-fetching.md +129 -0
- package/content-dist/fragments/references/openai-api-integration/calls.md +210 -0
- package/content-dist/fragments/references/openai-api-integration/client-and-cost.md +71 -0
- package/content-dist/fragments/references/pagamentos-brasil/gateways-reconciliation.md +92 -0
- package/content-dist/fragments/references/pagamentos-brasil/pix-boleto.md +115 -0
- package/content-dist/fragments/references/plataforma-conteudo/patterns.md +74 -0
- package/content-dist/fragments/references/python-fastapi/dependency-injection.md +99 -0
- package/content-dist/fragments/references/python-fastapi/settings-and-tasks.md +47 -0
- package/content-dist/fragments/references/rag-pipeline/ingestion.md +92 -0
- package/content-dist/fragments/references/rag-pipeline/retrieval-and-eval.md +148 -0
- package/content-dist/fragments/references/react-express-monolith/auth-and-client.md +110 -0
- package/content-dist/fragments/references/react-express-monolith/monorepo.md +71 -0
- package/content-dist/fragments/references/react-native-expo/native-patterns.md +103 -0
- package/content-dist/fragments/references/react-native-expo/navigation-and-auth.md +55 -0
- package/content-dist/fragments/references/react-ts-zustand-query/store-and-query.md +152 -0
- package/content-dist/fragments/references/react-typescript/feature-module.md +64 -0
- package/content-dist/fragments/references/react-typescript/forms-and-state.md +69 -0
- package/content-dist/fragments/references/react-typescript/recipes.md +37 -0
- package/content-dist/fragments/references/react-typescript/testing.md +40 -0
- package/content-dist/fragments/references/realtime-websockets/patterns.md +92 -0
- package/content-dist/fragments/references/relatorios-analytics/patterns.md +81 -0
- package/content-dist/fragments/references/remix-express-full/auth-and-uploads.md +88 -0
- package/content-dist/fragments/references/remix-express-full/express-server.md +54 -0
- package/content-dist/fragments/references/remix-typescript/auth-and-db.md +68 -0
- package/content-dist/fragments/references/remix-typescript/loaders-and-actions.md +98 -0
- package/content-dist/fragments/references/rust-axum/error-and-state.md +99 -0
- package/content-dist/fragments/references/rust-axum/handlers.md +87 -0
- package/content-dist/fragments/references/saas-stripe-billing/patterns.md +86 -0
- package/content-dist/fragments/references/serverless-lambda/handler-patterns.md +107 -0
- package/content-dist/fragments/references/sistema-pagamentos/pitfalls.md +54 -0
- package/content-dist/fragments/references/spring-boot/service-and-data.md +96 -0
- package/content-dist/fragments/references/spring-boot/web-layer.md +100 -0
- package/content-dist/fragments/references/supabase-nextjs/clients-and-middleware.md +102 -0
- package/content-dist/fragments/references/supabase-nextjs/rls-and-storage.md +86 -0
- package/content-dist/fragments/references/svelte-sveltekit/hooks-and-state.md +67 -0
- package/content-dist/fragments/references/svelte-sveltekit/load-and-actions.md +80 -0
- package/content-dist/fragments/references/t3-stack/routers-and-callers.md +75 -0
- package/content-dist/fragments/references/t3-stack/trpc-setup.md +60 -0
- package/content-dist/fragments/references/terraform-aws/modules-and-ci.md +114 -0
- package/content-dist/fragments/references/terraform-aws/state-and-workspaces.md +66 -0
- package/content-dist/fragments/references/turborepo-monorepo/pipeline-and-packages.md +84 -0
- package/content-dist/fragments/references/upload-midia/patterns.md +80 -0
- package/content-dist/fragments/references/vector-search-pinecone/client-and-upsert.md +98 -0
- package/content-dist/fragments/references/vector-search-pinecone/query-and-hybrid.md +81 -0
- package/content-dist/fragments/references/vps-deploy-producao/compose-prod.md +97 -0
- package/content-dist/fragments/references/vps-deploy-producao/proxy-and-operations.md +118 -0
- package/content-dist/fragments/references/vscode-extension/activation-and-tree.md +98 -0
- package/content-dist/fragments/references/vscode-extension/webview-csp.md +57 -0
- package/content-dist/fragments/references/vue3-pinia-vite/components-and-stores.md +73 -0
- package/content-dist/fragments/references/vue3-pinia-vite/queries-forms-testing.md +100 -0
- package/content-dist/fragments/references/whatsapp-business/patterns.md +107 -0
- package/content-dist/fragments/references/wordpress/hooks-and-security.md +92 -0
- package/content-dist/fragments/references/wordpress/wp-cli-gates.md +64 -0
- package/content-dist/fragments/stack/angular-ngrx.md +75 -0
- package/content-dist/fragments/stack/ansible-server-setup.md +69 -0
- package/content-dist/fragments/stack/astro-static.md +72 -0
- package/content-dist/fragments/stack/chrome-extension-mv3.md +66 -0
- package/content-dist/fragments/stack/cli-typescript-commander.md +66 -0
- package/content-dist/fragments/stack/cloud-run-gcp.md +63 -0
- package/content-dist/fragments/stack/computer-vision-yolo.md +62 -0
- package/content-dist/fragments/stack/convex-react.md +65 -0
- package/content-dist/fragments/stack/data-pipeline-airflow.md +64 -0
- package/content-dist/fragments/stack/delphi-object-pascal.md +63 -0
- package/content-dist/fragments/stack/django-drf-celery.md +63 -0
- package/content-dist/fragments/stack/docker-compose-dev.md +69 -0
- package/content-dist/fragments/stack/dotnet-aspnet.md +62 -0
- package/content-dist/fragments/stack/electron-app.md +70 -0
- package/content-dist/fragments/stack/elixir-phoenix.md +65 -0
- package/content-dist/fragments/stack/fine-tuning-huggingface.md +69 -0
- package/content-dist/fragments/stack/flutter.md +61 -0
- package/content-dist/fragments/stack/github-actions-cicd.md +73 -0
- package/content-dist/fragments/stack/go-chi-gorm.md +73 -0
- package/content-dist/fragments/stack/graphql-apollo.md +70 -0
- package/content-dist/fragments/stack/hono-bun.md +62 -0
- package/content-dist/fragments/stack/kubernetes-helm.md +67 -0
- package/content-dist/fragments/stack/langchain-python-agent.md +64 -0
- package/content-dist/fragments/stack/laravel.md +64 -0
- package/content-dist/fragments/stack/llm-ops-production.md +63 -0
- package/content-dist/fragments/stack/microservices-docker.md +70 -0
- package/content-dist/fragments/stack/ml-fastapi-serving.md +64 -0
- package/content-dist/fragments/stack/ml-training-pipeline.md +67 -0
- package/content-dist/fragments/stack/monitoring-observability.md +68 -0
- package/content-dist/fragments/stack/nestjs-typescript.md +68 -0
- package/content-dist/fragments/stack/nextjs-app-router.md +65 -0
- package/content-dist/fragments/stack/nextjs-prisma-postgres.md +61 -0
- package/content-dist/fragments/stack/nextjs-trpc-drizzle.md +63 -0
- package/content-dist/fragments/stack/nodejs-express-typescript.md +60 -0
- package/content-dist/fragments/stack/nuxt3-tailwind.md +62 -0
- package/content-dist/fragments/stack/openai-api-integration.md +58 -0
- package/content-dist/fragments/stack/python-fastapi.md +64 -0
- package/content-dist/fragments/stack/rag-pipeline.md +62 -0
- package/content-dist/fragments/stack/react-express-monolith.md +61 -0
- package/content-dist/fragments/stack/react-native-expo.md +68 -0
- package/content-dist/fragments/stack/react-ts-zustand-query.md +64 -0
- package/content-dist/fragments/stack/react-typescript.md +73 -0
- package/content-dist/fragments/stack/remix-express-full.md +63 -0
- package/content-dist/fragments/stack/remix-typescript.md +66 -0
- package/content-dist/fragments/stack/rust-axum.md +63 -0
- package/content-dist/fragments/stack/serverless-lambda.md +65 -0
- package/content-dist/fragments/stack/spring-boot.md +63 -0
- package/content-dist/fragments/stack/supabase-nextjs.md +64 -0
- package/content-dist/fragments/stack/svelte-sveltekit.md +67 -0
- package/content-dist/fragments/stack/t3-stack.md +63 -0
- package/content-dist/fragments/stack/terraform-aws.md +65 -0
- package/content-dist/fragments/stack/turborepo-monorepo.md +61 -0
- package/content-dist/fragments/stack/vector-search-pinecone.md +63 -0
- package/content-dist/fragments/stack/vps-deploy-producao.md +64 -0
- package/content-dist/fragments/stack/vscode-extension.md +64 -0
- package/content-dist/fragments/stack/vue3-pinia-vite.md +65 -0
- package/content-dist/fragments/stack/wordpress.md +63 -0
- package/content-dist/skills/invi-commit/SKILL.md +85 -0
- package/content-dist/skills/invi-journal/SKILL.md +67 -0
- package/content-dist/skills/invi-map/SKILL.md +118 -0
- package/content-dist/skills/invi-mode/SKILL.md +176 -0
- package/content-dist/skills/invi-pr/SKILL.md +142 -0
- package/content-dist/skills/invi-qa/SKILL.md +75 -0
- package/content-dist/skills/invi-refactor-legacy/SKILL.md +90 -0
- package/content-dist/skills/invi-review/SKILL.md +83 -0
- package/content-dist/skills/invi-security/SKILL.md +89 -0
- package/content-dist/skills/invi-status/SKILL.md +72 -0
- package/content-dist/skills/invi-task/SKILL.md +143 -0
- package/content-dist/skills/invi-test/SKILL.md +97 -0
- package/content-dist/skills/po-handoff/SKILL.md +130 -0
- package/content-dist/skills/po-intake/SKILL.md +115 -0
- package/content-dist/skills/po-lint/SKILL.md +82 -0
- package/content-dist/skills/po-spec/SKILL.md +138 -0
- package/content-dist/skills/po-status/SKILL.md +130 -0
- package/content-dist/skills/po-verify/SKILL.md +124 -0
- package/content-dist/templates/requirements/REQ-TEMPLATE.md +110 -0
- package/content-dist/templates/requirements/constitution-TEMPLATE.md +77 -0
- package/dist/baseline.d.ts +21 -0
- package/dist/baseline.d.ts.map +1 -0
- package/dist/baseline.js +43 -0
- package/dist/baseline.js.map +1 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +345 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/doctor.d.ts +31 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +173 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/export.d.ts +49 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +95 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/gate.d.ts +42 -0
- package/dist/commands/gate.d.ts.map +1 -0
- package/dist/commands/gate.js +97 -0
- package/dist/commands/gate.js.map +1 -0
- package/dist/commands/init.d.ts +88 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +540 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/journalCmd.d.ts +47 -0
- package/dist/commands/journalCmd.d.ts.map +1 -0
- package/dist/commands/journalCmd.js +89 -0
- package/dist/commands/journalCmd.js.map +1 -0
- package/dist/commands/keys.d.ts +68 -0
- package/dist/commands/keys.d.ts.map +1 -0
- package/dist/commands/keys.js +240 -0
- package/dist/commands/keys.js.map +1 -0
- package/dist/commands/map.d.ts +123 -0
- package/dist/commands/map.d.ts.map +1 -0
- package/dist/commands/map.js +383 -0
- package/dist/commands/map.js.map +1 -0
- package/dist/commands/plan.d.ts +28 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +64 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/req.d.ts +92 -0
- package/dist/commands/req.d.ts.map +1 -0
- package/dist/commands/req.js +270 -0
- package/dist/commands/req.js.map +1 -0
- package/dist/commands/review.d.ts +40 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +101 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/run.d.ts +33 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +151 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/ship.d.ts +45 -0
- package/dist/commands/ship.d.ts.map +1 -0
- package/dist/commands/ship.js +252 -0
- package/dist/commands/ship.js.map +1 -0
- package/dist/commands/status.d.ts +36 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +152 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +91 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +331 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/syncCommits.d.ts +56 -0
- package/dist/commands/syncCommits.d.ts.map +1 -0
- package/dist/commands/syncCommits.js +97 -0
- package/dist/commands/syncCommits.js.map +1 -0
- package/dist/commands/task.d.ts +108 -0
- package/dist/commands/task.d.ts.map +1 -0
- package/dist/commands/task.js +217 -0
- package/dist/commands/task.js.map +1 -0
- package/dist/commands/update.d.ts +92 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +541 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/verifyTask.d.ts +50 -0
- package/dist/commands/verifyTask.d.ts.map +1 -0
- package/dist/commands/verifyTask.js +172 -0
- package/dist/commands/verifyTask.js.map +1 -0
- package/dist/content.d.ts +128 -0
- package/dist/content.d.ts.map +1 -0
- package/dist/content.js +177 -0
- package/dist/content.js.map +1 -0
- package/dist/detect.d.ts +122 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +594 -0
- package/dist/detect.js.map +1 -0
- package/dist/events.d.ts +36 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +76 -0
- package/dist/events.js.map +1 -0
- package/dist/frontmatter.d.ts +15 -0
- package/dist/frontmatter.d.ts.map +1 -0
- package/dist/frontmatter.js +74 -0
- package/dist/frontmatter.js.map +1 -0
- package/dist/i18n/en.d.ts +421 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +443 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/index.d.ts +40 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +66 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/pt-BR.d.ts +11 -0
- package/dist/i18n/pt-BR.d.ts.map +1 -0
- package/dist/i18n/pt-BR.js +435 -0
- package/dist/i18n/pt-BR.js.map +1 -0
- package/dist/identity.d.ts +78 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +152 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/insights.d.ts +86 -0
- package/dist/insights.d.ts.map +1 -0
- package/dist/insights.js +199 -0
- package/dist/insights.js.map +1 -0
- package/dist/interview.d.ts +81 -0
- package/dist/interview.d.ts.map +1 -0
- package/dist/interview.js +283 -0
- package/dist/interview.js.map +1 -0
- package/dist/inventory.d.ts +79 -0
- package/dist/inventory.d.ts.map +1 -0
- package/dist/inventory.js +86 -0
- package/dist/inventory.js.map +1 -0
- package/dist/journal.d.ts +22 -0
- package/dist/journal.d.ts.map +1 -0
- package/dist/journal.js +88 -0
- package/dist/journal.js.map +1 -0
- package/dist/migrations/legacyNames.d.ts +45 -0
- package/dist/migrations/legacyNames.d.ts.map +1 -0
- package/dist/migrations/legacyNames.js +118 -0
- package/dist/migrations/legacyNames.js.map +1 -0
- package/dist/plan.d.ts +42 -0
- package/dist/plan.d.ts.map +1 -0
- package/dist/plan.js +126 -0
- package/dist/plan.js.map +1 -0
- package/dist/render/agents.d.ts +327 -0
- package/dist/render/agents.d.ts.map +1 -0
- package/dist/render/agents.js +356 -0
- package/dist/render/agents.js.map +1 -0
- package/dist/render/claudeMd.d.ts +29 -0
- package/dist/render/claudeMd.d.ts.map +1 -0
- package/dist/render/claudeMd.js +110 -0
- package/dist/render/claudeMd.js.map +1 -0
- package/dist/render/githooks.d.ts +41 -0
- package/dist/render/githooks.d.ts.map +1 -0
- package/dist/render/githooks.js +168 -0
- package/dist/render/githooks.js.map +1 -0
- package/dist/render/markers.d.ts +13 -0
- package/dist/render/markers.d.ts.map +1 -0
- package/dist/render/markers.js +35 -0
- package/dist/render/markers.js.map +1 -0
- package/dist/render/requirements.d.ts +56 -0
- package/dist/render/requirements.d.ts.map +1 -0
- package/dist/render/requirements.js +86 -0
- package/dist/render/requirements.js.map +1 -0
- package/dist/render/settings.d.ts +43 -0
- package/dist/render/settings.d.ts.map +1 -0
- package/dist/render/settings.js +94 -0
- package/dist/render/settings.js.map +1 -0
- package/dist/render/transparency.d.ts +7 -0
- package/dist/render/transparency.d.ts.map +1 -0
- package/dist/render/transparency.js +164 -0
- package/dist/render/transparency.js.map +1 -0
- package/dist/requirements.d.ts +84 -0
- package/dist/requirements.d.ts.map +1 -0
- package/dist/requirements.js +229 -0
- package/dist/requirements.js.map +1 -0
- package/dist/sizing.d.ts +63 -0
- package/dist/sizing.d.ts.map +1 -0
- package/dist/sizing.js +104 -0
- package/dist/sizing.js.map +1 -0
- package/dist/tasks.d.ts +199 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +320 -0
- package/dist/tasks.js.map +1 -0
- package/dist/util/diff3.d.ts +26 -0
- package/dist/util/diff3.d.ts.map +1 -0
- package/dist/util/diff3.js +112 -0
- package/dist/util/diff3.js.map +1 -0
- package/dist/util/fsx.d.ts +33 -0
- package/dist/util/fsx.d.ts.map +1 -0
- package/dist/util/fsx.js +153 -0
- package/dist/util/fsx.js.map +1 -0
- package/dist/util/git.d.ts +58 -0
- package/dist/util/git.d.ts.map +1 -0
- package/dist/util/git.js +171 -0
- package/dist/util/git.js.map +1 -0
- package/dist/util/merge.d.ts +27 -0
- package/dist/util/merge.d.ts.map +1 -0
- package/dist/util/merge.js +78 -0
- package/dist/util/merge.js.map +1 -0
- package/dist/util/out.d.ts +18 -0
- package/dist/util/out.d.ts.map +1 -0
- package/dist/util/out.js +23 -0
- package/dist/util/out.js.map +1 -0
- package/dist/util/proc.d.ts +12 -0
- package/dist/util/proc.d.ts.map +1 -0
- package/dist/util/proc.js +45 -0
- package/dist/util/proc.js.map +1 -0
- package/dist/util/registry.d.ts +58 -0
- package/dist/util/registry.d.ts.map +1 -0
- package/dist/util/registry.js +240 -0
- package/dist/util/registry.js.map +1 -0
- package/dist/verify.d.ts +52 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +205 -0
- package/dist/verify.js.map +1 -0
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +18 -0
- package/dist/version.js.map +1 -0
- package/package.json +63 -0
package/dist/sizing.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auto-sizing router heuristics for `invi run` (ARCHITECTURE §8: the
|
|
3
|
+
* human never picks the weight class; content/PIPELINE.md §8.3 documents the
|
|
4
|
+
* matrix). Pure and deterministic: signals in, verdict + reason codes out.
|
|
5
|
+
* Reason codes are stable EN identifiers — the CLI renders them localized;
|
|
6
|
+
* the decision event stores the codes (metrics, never content).
|
|
7
|
+
*/
|
|
8
|
+
import { join } from 'node:path';
|
|
9
|
+
import { extractDocVariable } from './commands/map.js';
|
|
10
|
+
import { globToRegExp, readTextFile } from './util/fsx.js';
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Fragile areas
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
/**
|
|
15
|
+
* Optional marked section in `.invictus/codebase/CONCERNS.md` (the mapped
|
|
16
|
+
* home of fragile areas — /invi-map writes it): one path/glob per line.
|
|
17
|
+
* The manifest schema (core, strict) has no fragile-area field, so the
|
|
18
|
+
* concerns document is the machine-readable source; absent it, the defaults
|
|
19
|
+
* below apply — the same trio the rendered agents' FRAGILE_AREAS default
|
|
20
|
+
* names (auth, money/payment paths, data migrations).
|
|
21
|
+
*/
|
|
22
|
+
export const FRAGILE_PATHS_VAR = 'FRAGILE_PATHS';
|
|
23
|
+
/** Default fragile path fragments (case-insensitive substring match). */
|
|
24
|
+
export const DEFAULT_FRAGILE_PATTERNS = ['auth', 'payment', 'billing', 'checkout', 'money', 'migration'];
|
|
25
|
+
export function loadFragilePatterns(root) {
|
|
26
|
+
const concerns = readTextFile(join(root, '.invictus', 'codebase', 'CONCERNS.md'));
|
|
27
|
+
if (concerns !== null) {
|
|
28
|
+
const section = extractDocVariable(concerns, FRAGILE_PATHS_VAR);
|
|
29
|
+
if (section !== null) {
|
|
30
|
+
const patterns = section
|
|
31
|
+
.split('\n')
|
|
32
|
+
.map((l) => l.trim().replace(/^[-*]\s+/, '').replace(/`/g, ''))
|
|
33
|
+
.filter((l) => l !== '');
|
|
34
|
+
if (patterns.length > 0)
|
|
35
|
+
return { patterns, source: 'concerns-doc' };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return { patterns: [...DEFAULT_FRAGILE_PATTERNS], source: 'defaults' };
|
|
39
|
+
}
|
|
40
|
+
/** Files (changed or planned) intersected with the fragile patterns. */
|
|
41
|
+
export function fragileIntersection(files, patterns) {
|
|
42
|
+
const regexes = patterns.map((p) => (p.includes('*') ? globToRegExp(p) : null));
|
|
43
|
+
const hits = [];
|
|
44
|
+
for (const file of files) {
|
|
45
|
+
const lower = file.toLowerCase();
|
|
46
|
+
const hit = patterns.some((p, i) => {
|
|
47
|
+
const re = regexes[i] ?? null;
|
|
48
|
+
return re !== null ? re.test(file) : lower.includes(p.toLowerCase());
|
|
49
|
+
});
|
|
50
|
+
if (hit && !hits.includes(file))
|
|
51
|
+
hits.push(file);
|
|
52
|
+
}
|
|
53
|
+
return hits;
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Decision matrix (PIPELINE.md §8.3)
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
export const SIZING_VERDICTS = ['inline', 'quick', 'full-pipeline'];
|
|
59
|
+
/** Thresholds — exported so the docs/tests state the same numbers. */
|
|
60
|
+
export const SIZING_THRESHOLDS = {
|
|
61
|
+
manyCriteria: 4,
|
|
62
|
+
largeDiffFiles: 10,
|
|
63
|
+
largeDiffChurn: 400,
|
|
64
|
+
multiStepPlan: 4,
|
|
65
|
+
inlineMaxCriteria: 2,
|
|
66
|
+
inlineMaxFiles: 2,
|
|
67
|
+
};
|
|
68
|
+
/** Task types that qualify for inline handling when everything else is small. */
|
|
69
|
+
export const LIGHT_TYPES = ['docs', 'chore', 'style'];
|
|
70
|
+
export function decideSizing(s) {
|
|
71
|
+
const T = SIZING_THRESHOLDS;
|
|
72
|
+
// 1. Any escalator ⇒ full pipeline; ALL applicable reasons are stated.
|
|
73
|
+
const full = [];
|
|
74
|
+
if (s.fragileHits.length > 0)
|
|
75
|
+
full.push('fragile-intersection');
|
|
76
|
+
if (s.reqIds.length > 0)
|
|
77
|
+
full.push('req-linked');
|
|
78
|
+
if (s.type === 'hotfix')
|
|
79
|
+
full.push('hotfix');
|
|
80
|
+
if (s.criteria >= T.manyCriteria)
|
|
81
|
+
full.push('many-criteria');
|
|
82
|
+
if ((s.diffFiles ?? 0) >= T.largeDiffFiles || (s.diffChurn ?? 0) >= T.largeDiffChurn)
|
|
83
|
+
full.push('large-diff');
|
|
84
|
+
if (s.planSteps >= T.multiStepPlan)
|
|
85
|
+
full.push('multi-step-plan');
|
|
86
|
+
if (full.length > 0)
|
|
87
|
+
return { verdict: 'full-pipeline', reasons: full };
|
|
88
|
+
// 2. Inline needs EVERY qualifier: light type, tiny scope, tiny (or no) diff.
|
|
89
|
+
if (LIGHT_TYPES.includes(s.type) && s.criteria <= T.inlineMaxCriteria) {
|
|
90
|
+
if (s.diffFiles === null) {
|
|
91
|
+
return { verdict: 'inline', reasons: ['light-type', 'few-criteria', 'no-diff-signal'] };
|
|
92
|
+
}
|
|
93
|
+
if (s.diffFiles <= T.inlineMaxFiles) {
|
|
94
|
+
return { verdict: 'inline', reasons: ['light-type', 'few-criteria', 'small-diff'] };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// 3. Everything else is the middle weight.
|
|
98
|
+
const reasons = ['no-full-trigger'];
|
|
99
|
+
if (!LIGHT_TYPES.includes(s.type))
|
|
100
|
+
reasons.push('substantive-type');
|
|
101
|
+
reasons.push(s.criteria <= T.inlineMaxCriteria ? 'few-criteria' : 'moderate-criteria');
|
|
102
|
+
return { verdict: 'quick', reasons };
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=sizing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizing.js","sourceRoot":"","sources":["../src/sizing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAG3D,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAEjD,yEAAyE;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAU,CAAC;AAOlH,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;IAClF,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,CAAC,CAAC;QAChE,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YACrB,MAAM,QAAQ,GAAG,OAAO;iBACrB,KAAK,CAAC,IAAI,CAAC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CAAC"}
|
package/dist/tasks.d.ts
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task records + pipeline state machine (content/PIPELINE.md §1 and §3).
|
|
3
|
+
*
|
|
4
|
+
* Everything about one task lives in `.invictus/tasks/<id>/`:
|
|
5
|
+
* - `task.json` — canonical task JSON (§1), the authoritative record;
|
|
6
|
+
* unknown extra fields round-trip verbatim (PO-layer `req[]`, tracker
|
|
7
|
+
* extras) — the zod schema is passthrough by design.
|
|
8
|
+
* - `state.json` — DERIVED convenience view `{id, state, history[]}` (§3),
|
|
9
|
+
* safe to regenerate; rebuilt from `task.json` when missing or corrupt.
|
|
10
|
+
*
|
|
11
|
+
* The state machine here is the LAW of §3 — transitions not in
|
|
12
|
+
* LEGAL_TRANSITIONS are illegal and the CLI refuses them. Gate → state
|
|
13
|
+
* advancement (§2/§4) is encoded in GATE_ADVANCES so `invi gate` and the
|
|
14
|
+
* tests share one source.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
export declare const TASK_TYPES: readonly ["feat", "fix", "refactor", "test", "docs", "chore", "perf", "ci", "build", "style", "hotfix"];
|
|
18
|
+
export type TaskType = (typeof TASK_TYPES)[number];
|
|
19
|
+
export declare const TASK_STATES: readonly ["open", "in_progress", "security_ok", "tests_ok", "review_ok", "qa_ok", "pr_open", "done", "blocked"];
|
|
20
|
+
export type TaskState = (typeof TASK_STATES)[number];
|
|
21
|
+
export declare const TASK_SOURCES: readonly ["pasted", "file", "tracker", "generated"];
|
|
22
|
+
/**
|
|
23
|
+
* §3, verbatim: the linear ladder advances one step at a time; every state
|
|
24
|
+
* from `in_progress` through `pr_open` may fall to `blocked`; only a human
|
|
25
|
+
* decision resumes `blocked → in_progress`. `open` cannot block (nothing ran
|
|
26
|
+
* yet) and `done` is terminal.
|
|
27
|
+
*/
|
|
28
|
+
export declare const LEGAL_TRANSITIONS: Readonly<Record<TaskState, readonly TaskState[]>>;
|
|
29
|
+
export declare function isTaskState(value: string): value is TaskState;
|
|
30
|
+
export declare function isLegalTransition(from: TaskState, to: TaskState): boolean;
|
|
31
|
+
export declare function ladderIndex(state: TaskState): number;
|
|
32
|
+
/** Gate names as they appear in the §4 event payload. */
|
|
33
|
+
export declare const GATE_NAMES: readonly ["security", "tests", "review", "qa"];
|
|
34
|
+
export type GateName = (typeof GATE_NAMES)[number];
|
|
35
|
+
export declare const GATE_VERDICTS: readonly ["pass", "pass-with-reservations", "fail"];
|
|
36
|
+
export type GateVerdict = (typeof GATE_VERDICTS)[number];
|
|
37
|
+
/** §3: WITH_RESERVATIONS enters review_ok / qa_ok only. */
|
|
38
|
+
export declare const RESERVATION_GATES: readonly GateName[];
|
|
39
|
+
/** Gate → the state-machine step a passing verdict performs (§2 order). */
|
|
40
|
+
export declare const GATE_ADVANCES: Readonly<Record<GateName, {
|
|
41
|
+
from: TaskState;
|
|
42
|
+
to: TaskState;
|
|
43
|
+
}>>;
|
|
44
|
+
/** CLI convenience: `test` is accepted as an alias of the §4 name `tests`. */
|
|
45
|
+
export declare function normalizeGateName(raw: string): GateName | null;
|
|
46
|
+
/**
|
|
47
|
+
* The optional §4 payload extras `invi gate --details` accepts. Strict on
|
|
48
|
+
* purpose: unknown keys are refused so free text can never ride into the
|
|
49
|
+
* event log (metrics, never content).
|
|
50
|
+
*/
|
|
51
|
+
export declare const gateDetailsSchema: z.ZodObject<{
|
|
52
|
+
findings: z.ZodOptional<z.ZodObject<{
|
|
53
|
+
blocker: z.ZodNumber;
|
|
54
|
+
high: z.ZodNumber;
|
|
55
|
+
medium: z.ZodNumber;
|
|
56
|
+
low: z.ZodNumber;
|
|
57
|
+
}, "strict", z.ZodTypeAny, {
|
|
58
|
+
blocker: number;
|
|
59
|
+
high: number;
|
|
60
|
+
medium: number;
|
|
61
|
+
low: number;
|
|
62
|
+
}, {
|
|
63
|
+
blocker: number;
|
|
64
|
+
high: number;
|
|
65
|
+
medium: number;
|
|
66
|
+
low: number;
|
|
67
|
+
}>>;
|
|
68
|
+
criteria_ok: z.ZodOptional<z.ZodString>;
|
|
69
|
+
not_verified: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
+
}, "strict", z.ZodTypeAny, {
|
|
71
|
+
findings?: {
|
|
72
|
+
blocker: number;
|
|
73
|
+
high: number;
|
|
74
|
+
medium: number;
|
|
75
|
+
low: number;
|
|
76
|
+
} | undefined;
|
|
77
|
+
criteria_ok?: string | undefined;
|
|
78
|
+
not_verified?: boolean | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
findings?: {
|
|
81
|
+
blocker: number;
|
|
82
|
+
high: number;
|
|
83
|
+
medium: number;
|
|
84
|
+
low: number;
|
|
85
|
+
} | undefined;
|
|
86
|
+
criteria_ok?: string | undefined;
|
|
87
|
+
not_verified?: boolean | undefined;
|
|
88
|
+
}>;
|
|
89
|
+
export type GateDetails = z.infer<typeof gateDetailsSchema>;
|
|
90
|
+
/**
|
|
91
|
+
* §1 shape. `.passthrough()` implements the round-trip rule: unknown extra
|
|
92
|
+
* fields are preserved on normalization and ignored by consumers — notably
|
|
93
|
+
* the PO-layer `req[]` extension (validated when present) and tracker extras.
|
|
94
|
+
*/
|
|
95
|
+
export declare const taskJsonSchema: z.ZodObject<{
|
|
96
|
+
schema: z.ZodLiteral<1>;
|
|
97
|
+
id: z.ZodString;
|
|
98
|
+
type: z.ZodEnum<["feat", "fix", "refactor", "test", "docs", "chore", "perf", "ci", "build", "style", "hotfix"]>;
|
|
99
|
+
title: z.ZodString;
|
|
100
|
+
description: z.ZodString;
|
|
101
|
+
acceptance_criteria: z.ZodArray<z.ZodString, "many">;
|
|
102
|
+
module: z.ZodOptional<z.ZodString>;
|
|
103
|
+
status: z.ZodDefault<z.ZodEnum<["open", "in_progress", "security_ok", "tests_ok", "review_ok", "qa_ok", "pr_open", "done", "blocked"]>>;
|
|
104
|
+
url: z.ZodOptional<z.ZodString>;
|
|
105
|
+
source: z.ZodOptional<z.ZodEnum<["pasted", "file", "tracker", "generated"]>>;
|
|
106
|
+
req: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
107
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
108
|
+
schema: z.ZodLiteral<1>;
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
type: z.ZodEnum<["feat", "fix", "refactor", "test", "docs", "chore", "perf", "ci", "build", "style", "hotfix"]>;
|
|
111
|
+
title: z.ZodString;
|
|
112
|
+
description: z.ZodString;
|
|
113
|
+
acceptance_criteria: z.ZodArray<z.ZodString, "many">;
|
|
114
|
+
module: z.ZodOptional<z.ZodString>;
|
|
115
|
+
status: z.ZodDefault<z.ZodEnum<["open", "in_progress", "security_ok", "tests_ok", "review_ok", "qa_ok", "pr_open", "done", "blocked"]>>;
|
|
116
|
+
url: z.ZodOptional<z.ZodString>;
|
|
117
|
+
source: z.ZodOptional<z.ZodEnum<["pasted", "file", "tracker", "generated"]>>;
|
|
118
|
+
req: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
119
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
120
|
+
schema: z.ZodLiteral<1>;
|
|
121
|
+
id: z.ZodString;
|
|
122
|
+
type: z.ZodEnum<["feat", "fix", "refactor", "test", "docs", "chore", "perf", "ci", "build", "style", "hotfix"]>;
|
|
123
|
+
title: z.ZodString;
|
|
124
|
+
description: z.ZodString;
|
|
125
|
+
acceptance_criteria: z.ZodArray<z.ZodString, "many">;
|
|
126
|
+
module: z.ZodOptional<z.ZodString>;
|
|
127
|
+
status: z.ZodDefault<z.ZodEnum<["open", "in_progress", "security_ok", "tests_ok", "review_ok", "qa_ok", "pr_open", "done", "blocked"]>>;
|
|
128
|
+
url: z.ZodOptional<z.ZodString>;
|
|
129
|
+
source: z.ZodOptional<z.ZodEnum<["pasted", "file", "tracker", "generated"]>>;
|
|
130
|
+
req: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
131
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
132
|
+
export type TaskJson = z.infer<typeof taskJsonSchema>;
|
|
133
|
+
/**
|
|
134
|
+
* The id becomes a directory name under `.invictus/tasks/` — keep it to a
|
|
135
|
+
* filesystem-safe charset regardless of how permissive the project's
|
|
136
|
+
* ticketPattern is (no separators, no dot-leading names).
|
|
137
|
+
*/
|
|
138
|
+
export declare const SAFE_TASK_ID_RE: RegExp;
|
|
139
|
+
/** §1: headless skills mint `adhoc-<yyyymmdd>-<n>` when no id is recoverable. */
|
|
140
|
+
export declare const ADHOC_TASK_ID_RE: RegExp;
|
|
141
|
+
/**
|
|
142
|
+
* A ticketPattern that forces a literal character outside the SAFE_TASK_ID_RE
|
|
143
|
+
* charset (e.g. `#\d+` — GitHub-style with the `#` kept) can never produce a
|
|
144
|
+
* usable task id: `task create` would accept nothing but adhoc ids. Returns
|
|
145
|
+
* the first offending literal, or null when the pattern is compatible.
|
|
146
|
+
* Heuristic scan: literals inside character classes are alternatives, not
|
|
147
|
+
* required, so only literals in the main sequence are flagged.
|
|
148
|
+
*/
|
|
149
|
+
export declare function ticketPatternFsConflict(pattern: string): string | null;
|
|
150
|
+
/**
|
|
151
|
+
* Recover the task id from a branch name (`<type>/<id>-<slug>`, PIPELINE §2).
|
|
152
|
+
*
|
|
153
|
+
* THE ORDER IS THE WHOLE POINT. The adhoc form is tried first, anchored,
|
|
154
|
+
* because it CONTAINS digits: a project whose ticketPattern is `\d+` — the
|
|
155
|
+
* common case for trackers that number tickets — would otherwise match the
|
|
156
|
+
* date inside `adhoc-20260902-1` and hand back "20260902" as if it were a
|
|
157
|
+
* real ticket. That is worse than failing: the id resolves to a task
|
|
158
|
+
* directory that does not exist, the commit trailer carries a fabricated join
|
|
159
|
+
* key, and the traceability the id exists to provide is quietly wrong.
|
|
160
|
+
*
|
|
161
|
+
* Returns null when nothing matches — the caller decides what to do about it,
|
|
162
|
+
* because "this branch has no task" is a legitimate state (a hotfix, a branch
|
|
163
|
+
* created by hand) and not an error here.
|
|
164
|
+
*/
|
|
165
|
+
export declare function taskIdFromBranch(branch: string, ticketPattern: string): string | null;
|
|
166
|
+
/** Whole-id match against the manifest ticketPattern OR the adhoc form. */
|
|
167
|
+
export declare function idMatchesProject(id: string, ticketPattern: string): boolean;
|
|
168
|
+
export declare function tasksDir(root: string): string;
|
|
169
|
+
export declare function taskDir(root: string, id: string): string;
|
|
170
|
+
export declare function taskJsonPath(root: string, id: string): string;
|
|
171
|
+
export declare function stateJsonPath(root: string, id: string): string;
|
|
172
|
+
export interface StateHistoryEntry {
|
|
173
|
+
state: TaskState;
|
|
174
|
+
at: string;
|
|
175
|
+
}
|
|
176
|
+
export interface StateView {
|
|
177
|
+
id: string;
|
|
178
|
+
state: TaskState;
|
|
179
|
+
history: StateHistoryEntry[];
|
|
180
|
+
}
|
|
181
|
+
/** Read + validate a task record; null when absent, throws when invalid. */
|
|
182
|
+
export declare function readTask(root: string, id: string): TaskJson | null;
|
|
183
|
+
export declare function writeTask(root: string, task: TaskJson): void;
|
|
184
|
+
/** Ids of every task directory that carries a task.json, sorted. */
|
|
185
|
+
export declare function listTaskIds(root: string): string[];
|
|
186
|
+
/**
|
|
187
|
+
* Read the derived state view; when missing or corrupt it is rebuilt from
|
|
188
|
+
* the authoritative `task.json` status (history then starts at the current
|
|
189
|
+
* state — the full history lives in the event log).
|
|
190
|
+
*/
|
|
191
|
+
export declare function readStateView(root: string, id: string, taskStatus: TaskState, at: string): StateView;
|
|
192
|
+
export declare function writeStateView(root: string, view: StateView): void;
|
|
193
|
+
/**
|
|
194
|
+
* Perform one state transition on disk: `task.json` (authoritative status)
|
|
195
|
+
* plus the derived `state.json` history. Legality is the CALLER's check —
|
|
196
|
+
* this is the mechanical writer.
|
|
197
|
+
*/
|
|
198
|
+
export declare function recordTransition(root: string, task: TaskJson, to: TaskState, at: string): StateView;
|
|
199
|
+
//# sourceMappingURL=tasks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.d.ts","sourceRoot":"","sources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C,KAAK,EAAE,SAAS,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,iBAAiB,EAAE,CAAC;CAC9B;AAED,4EAA4E;AAC5E,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAIlE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAE5D;AAED,oEAAoE;AACpE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAOlD;AAUD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAKpG;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,IAAI,CAElE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAQnG"}
|
package/dist/tasks.js
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task records + pipeline state machine (content/PIPELINE.md §1 and §3).
|
|
3
|
+
*
|
|
4
|
+
* Everything about one task lives in `.invictus/tasks/<id>/`:
|
|
5
|
+
* - `task.json` — canonical task JSON (§1), the authoritative record;
|
|
6
|
+
* unknown extra fields round-trip verbatim (PO-layer `req[]`, tracker
|
|
7
|
+
* extras) — the zod schema is passthrough by design.
|
|
8
|
+
* - `state.json` — DERIVED convenience view `{id, state, history[]}` (§3),
|
|
9
|
+
* safe to regenerate; rebuilt from `task.json` when missing or corrupt.
|
|
10
|
+
*
|
|
11
|
+
* The state machine here is the LAW of §3 — transitions not in
|
|
12
|
+
* LEGAL_TRANSITIONS are illegal and the CLI refuses them. Gate → state
|
|
13
|
+
* advancement (§2/§4) is encoded in GATE_ADVANCES so `invi gate` and the
|
|
14
|
+
* tests share one source.
|
|
15
|
+
*/
|
|
16
|
+
import { readdirSync } from 'node:fs';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
import { REQ_ID_RE } from '@invictus-group-ai/core';
|
|
20
|
+
import { existsSync, isDir, readJsonFile, writeFileEnsuring } from './util/fsx.js';
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
// Enums (PIPELINE.md §1 / §3)
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
export const TASK_TYPES = [
|
|
25
|
+
'feat',
|
|
26
|
+
'fix',
|
|
27
|
+
'refactor',
|
|
28
|
+
'test',
|
|
29
|
+
'docs',
|
|
30
|
+
'chore',
|
|
31
|
+
'perf',
|
|
32
|
+
'ci',
|
|
33
|
+
'build',
|
|
34
|
+
'style',
|
|
35
|
+
'hotfix',
|
|
36
|
+
];
|
|
37
|
+
export const TASK_STATES = [
|
|
38
|
+
'open',
|
|
39
|
+
'in_progress',
|
|
40
|
+
'security_ok',
|
|
41
|
+
'tests_ok',
|
|
42
|
+
'review_ok',
|
|
43
|
+
'qa_ok',
|
|
44
|
+
'pr_open',
|
|
45
|
+
'done',
|
|
46
|
+
'blocked',
|
|
47
|
+
];
|
|
48
|
+
export const TASK_SOURCES = ['pasted', 'file', 'tracker', 'generated'];
|
|
49
|
+
/**
|
|
50
|
+
* §3, verbatim: the linear ladder advances one step at a time; every state
|
|
51
|
+
* from `in_progress` through `pr_open` may fall to `blocked`; only a human
|
|
52
|
+
* decision resumes `blocked → in_progress`. `open` cannot block (nothing ran
|
|
53
|
+
* yet) and `done` is terminal.
|
|
54
|
+
*/
|
|
55
|
+
export const LEGAL_TRANSITIONS = {
|
|
56
|
+
open: ['in_progress'],
|
|
57
|
+
in_progress: ['security_ok', 'blocked'],
|
|
58
|
+
security_ok: ['tests_ok', 'blocked'],
|
|
59
|
+
tests_ok: ['review_ok', 'blocked'],
|
|
60
|
+
review_ok: ['qa_ok', 'blocked'],
|
|
61
|
+
qa_ok: ['pr_open', 'blocked'],
|
|
62
|
+
pr_open: ['done', 'blocked'],
|
|
63
|
+
done: [],
|
|
64
|
+
blocked: ['in_progress'],
|
|
65
|
+
};
|
|
66
|
+
export function isTaskState(value) {
|
|
67
|
+
return TASK_STATES.includes(value);
|
|
68
|
+
}
|
|
69
|
+
export function isLegalTransition(from, to) {
|
|
70
|
+
return LEGAL_TRANSITIONS[from].includes(to);
|
|
71
|
+
}
|
|
72
|
+
/** Position on the §3 linear ladder (blocked is off-ladder ⇒ -1). */
|
|
73
|
+
const LADDER = [
|
|
74
|
+
'open',
|
|
75
|
+
'in_progress',
|
|
76
|
+
'security_ok',
|
|
77
|
+
'tests_ok',
|
|
78
|
+
'review_ok',
|
|
79
|
+
'qa_ok',
|
|
80
|
+
'pr_open',
|
|
81
|
+
'done',
|
|
82
|
+
];
|
|
83
|
+
export function ladderIndex(state) {
|
|
84
|
+
return LADDER.indexOf(state);
|
|
85
|
+
}
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// Gates (PIPELINE.md §2 / §4)
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
/** Gate names as they appear in the §4 event payload. */
|
|
90
|
+
export const GATE_NAMES = ['security', 'tests', 'review', 'qa'];
|
|
91
|
+
export const GATE_VERDICTS = ['pass', 'pass-with-reservations', 'fail'];
|
|
92
|
+
/** §3: WITH_RESERVATIONS enters review_ok / qa_ok only. */
|
|
93
|
+
export const RESERVATION_GATES = ['review', 'qa'];
|
|
94
|
+
/** Gate → the state-machine step a passing verdict performs (§2 order). */
|
|
95
|
+
export const GATE_ADVANCES = {
|
|
96
|
+
security: { from: 'in_progress', to: 'security_ok' },
|
|
97
|
+
tests: { from: 'security_ok', to: 'tests_ok' },
|
|
98
|
+
review: { from: 'tests_ok', to: 'review_ok' },
|
|
99
|
+
qa: { from: 'review_ok', to: 'qa_ok' },
|
|
100
|
+
};
|
|
101
|
+
/** CLI convenience: `test` is accepted as an alias of the §4 name `tests`. */
|
|
102
|
+
export function normalizeGateName(raw) {
|
|
103
|
+
const name = raw === 'test' ? 'tests' : raw;
|
|
104
|
+
return GATE_NAMES.includes(name) ? name : null;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The optional §4 payload extras `invi gate --details` accepts. Strict on
|
|
108
|
+
* purpose: unknown keys are refused so free text can never ride into the
|
|
109
|
+
* event log (metrics, never content).
|
|
110
|
+
*/
|
|
111
|
+
export const gateDetailsSchema = z
|
|
112
|
+
.object({
|
|
113
|
+
findings: z
|
|
114
|
+
.object({
|
|
115
|
+
blocker: z.number().int().nonnegative(),
|
|
116
|
+
high: z.number().int().nonnegative(),
|
|
117
|
+
medium: z.number().int().nonnegative(),
|
|
118
|
+
low: z.number().int().nonnegative(),
|
|
119
|
+
})
|
|
120
|
+
.strict()
|
|
121
|
+
.optional(),
|
|
122
|
+
criteria_ok: z.string().regex(/^\d+\/\d+$/, 'expected n/total like 5/6').optional(),
|
|
123
|
+
not_verified: z.boolean().optional(),
|
|
124
|
+
})
|
|
125
|
+
.strict();
|
|
126
|
+
// ---------------------------------------------------------------------------
|
|
127
|
+
// Canonical task JSON (PIPELINE.md §1)
|
|
128
|
+
// ---------------------------------------------------------------------------
|
|
129
|
+
/**
|
|
130
|
+
* §1 shape. `.passthrough()` implements the round-trip rule: unknown extra
|
|
131
|
+
* fields are preserved on normalization and ignored by consumers — notably
|
|
132
|
+
* the PO-layer `req[]` extension (validated when present) and tracker extras.
|
|
133
|
+
*/
|
|
134
|
+
export const taskJsonSchema = z
|
|
135
|
+
.object({
|
|
136
|
+
schema: z.literal(1),
|
|
137
|
+
id: z.string().min(1),
|
|
138
|
+
type: z.enum(TASK_TYPES),
|
|
139
|
+
title: z.string().min(1),
|
|
140
|
+
description: z.string().min(1),
|
|
141
|
+
acceptance_criteria: z.array(z.string().min(1)).min(1),
|
|
142
|
+
module: z.string().min(1).optional(),
|
|
143
|
+
status: z.enum(TASK_STATES).default('open'),
|
|
144
|
+
url: z.string().url().optional(),
|
|
145
|
+
source: z.enum(TASK_SOURCES).optional(),
|
|
146
|
+
req: z.array(z.string().regex(REQ_ID_RE, 'expected a requirement id like REQ-104')).optional(),
|
|
147
|
+
})
|
|
148
|
+
.passthrough();
|
|
149
|
+
/**
|
|
150
|
+
* The id becomes a directory name under `.invictus/tasks/` — keep it to a
|
|
151
|
+
* filesystem-safe charset regardless of how permissive the project's
|
|
152
|
+
* ticketPattern is (no separators, no dot-leading names).
|
|
153
|
+
*/
|
|
154
|
+
export const SAFE_TASK_ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
155
|
+
/** §1: headless skills mint `adhoc-<yyyymmdd>-<n>` when no id is recoverable. */
|
|
156
|
+
export const ADHOC_TASK_ID_RE = /^adhoc-\d{8}-\d+$/;
|
|
157
|
+
const FS_SAFE_LITERAL_RE = /[A-Za-z0-9._-]/;
|
|
158
|
+
const REGEX_METACHARS = new Set(['(', ')', '|', '+', '*', '?', '^', '$', '.', '{', '}']);
|
|
159
|
+
/**
|
|
160
|
+
* A ticketPattern that forces a literal character outside the SAFE_TASK_ID_RE
|
|
161
|
+
* charset (e.g. `#\d+` — GitHub-style with the `#` kept) can never produce a
|
|
162
|
+
* usable task id: `task create` would accept nothing but adhoc ids. Returns
|
|
163
|
+
* the first offending literal, or null when the pattern is compatible.
|
|
164
|
+
* Heuristic scan: literals inside character classes are alternatives, not
|
|
165
|
+
* required, so only literals in the main sequence are flagged.
|
|
166
|
+
*/
|
|
167
|
+
export function ticketPatternFsConflict(pattern) {
|
|
168
|
+
let inClass = false;
|
|
169
|
+
let inBrace = false;
|
|
170
|
+
for (let i = 0; i < pattern.length; i++) {
|
|
171
|
+
const ch = pattern[i];
|
|
172
|
+
if (ch === '\\') {
|
|
173
|
+
const next = pattern[i + 1];
|
|
174
|
+
i += 1;
|
|
175
|
+
// Escaped punctuation is a required literal (`\#`); escaped letters are
|
|
176
|
+
// classes/anchors (`\d`, `\b`) and every letter is fs-safe anyway.
|
|
177
|
+
if (!inClass && next !== undefined && !/[A-Za-z0-9]/.test(next) && !FS_SAFE_LITERAL_RE.test(next)) {
|
|
178
|
+
return next;
|
|
179
|
+
}
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
if (inClass) {
|
|
183
|
+
if (ch === ']')
|
|
184
|
+
inClass = false;
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
if (inBrace) {
|
|
188
|
+
if (ch === '}')
|
|
189
|
+
inBrace = false;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (ch === '[') {
|
|
193
|
+
inClass = true;
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
if (ch === '{') {
|
|
197
|
+
inBrace = true;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (REGEX_METACHARS.has(ch))
|
|
201
|
+
continue;
|
|
202
|
+
if (!FS_SAFE_LITERAL_RE.test(ch))
|
|
203
|
+
return ch;
|
|
204
|
+
}
|
|
205
|
+
return null;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Recover the task id from a branch name (`<type>/<id>-<slug>`, PIPELINE §2).
|
|
209
|
+
*
|
|
210
|
+
* THE ORDER IS THE WHOLE POINT. The adhoc form is tried first, anchored,
|
|
211
|
+
* because it CONTAINS digits: a project whose ticketPattern is `\d+` — the
|
|
212
|
+
* common case for trackers that number tickets — would otherwise match the
|
|
213
|
+
* date inside `adhoc-20260902-1` and hand back "20260902" as if it were a
|
|
214
|
+
* real ticket. That is worse than failing: the id resolves to a task
|
|
215
|
+
* directory that does not exist, the commit trailer carries a fabricated join
|
|
216
|
+
* key, and the traceability the id exists to provide is quietly wrong.
|
|
217
|
+
*
|
|
218
|
+
* Returns null when nothing matches — the caller decides what to do about it,
|
|
219
|
+
* because "this branch has no task" is a legitimate state (a hotfix, a branch
|
|
220
|
+
* created by hand) and not an error here.
|
|
221
|
+
*/
|
|
222
|
+
export function taskIdFromBranch(branch, ticketPattern) {
|
|
223
|
+
const afterType = branch.slice(branch.lastIndexOf('/') + 1);
|
|
224
|
+
const adhoc = /^adhoc-\d{8}-\d+/.exec(afterType);
|
|
225
|
+
if (adhoc !== null)
|
|
226
|
+
return adhoc[0];
|
|
227
|
+
try {
|
|
228
|
+
const match = new RegExp(`^(?:${ticketPattern})`).exec(afterType);
|
|
229
|
+
if (match === null || match[0].length === 0)
|
|
230
|
+
return null;
|
|
231
|
+
// A pattern can match a prefix that is not filesystem-safe as a whole id.
|
|
232
|
+
return SAFE_TASK_ID_RE.test(match[0]) ? match[0] : null;
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
/** Whole-id match against the manifest ticketPattern OR the adhoc form. */
|
|
239
|
+
export function idMatchesProject(id, ticketPattern) {
|
|
240
|
+
if (ADHOC_TASK_ID_RE.test(id))
|
|
241
|
+
return true;
|
|
242
|
+
try {
|
|
243
|
+
return new RegExp(`^(?:${ticketPattern})$`).test(id);
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
// ---------------------------------------------------------------------------
|
|
250
|
+
// Store (.invictus/tasks/<id>/)
|
|
251
|
+
// ---------------------------------------------------------------------------
|
|
252
|
+
export function tasksDir(root) {
|
|
253
|
+
return join(root, '.invictus', 'tasks');
|
|
254
|
+
}
|
|
255
|
+
export function taskDir(root, id) {
|
|
256
|
+
return join(tasksDir(root), id);
|
|
257
|
+
}
|
|
258
|
+
export function taskJsonPath(root, id) {
|
|
259
|
+
return join(taskDir(root, id), 'task.json');
|
|
260
|
+
}
|
|
261
|
+
export function stateJsonPath(root, id) {
|
|
262
|
+
return join(taskDir(root, id), 'state.json');
|
|
263
|
+
}
|
|
264
|
+
/** Read + validate a task record; null when absent, throws when invalid. */
|
|
265
|
+
export function readTask(root, id) {
|
|
266
|
+
const raw = readJsonFile(taskJsonPath(root, id));
|
|
267
|
+
if (raw === null)
|
|
268
|
+
return null;
|
|
269
|
+
return taskJsonSchema.parse(raw);
|
|
270
|
+
}
|
|
271
|
+
export function writeTask(root, task) {
|
|
272
|
+
writeFileEnsuring(taskJsonPath(root, task.id), JSON.stringify(task, null, 2) + '\n');
|
|
273
|
+
}
|
|
274
|
+
/** Ids of every task directory that carries a task.json, sorted. */
|
|
275
|
+
export function listTaskIds(root) {
|
|
276
|
+
const dir = tasksDir(root);
|
|
277
|
+
if (!isDir(dir))
|
|
278
|
+
return [];
|
|
279
|
+
return readdirSync(dir, { withFileTypes: true })
|
|
280
|
+
.filter((e) => e.isDirectory() && existsSync(join(dir, e.name, 'task.json')))
|
|
281
|
+
.map((e) => e.name)
|
|
282
|
+
.sort();
|
|
283
|
+
}
|
|
284
|
+
const stateViewSchema = z
|
|
285
|
+
.object({
|
|
286
|
+
id: z.string().min(1),
|
|
287
|
+
state: z.enum(TASK_STATES),
|
|
288
|
+
history: z.array(z.object({ state: z.enum(TASK_STATES), at: z.string().min(1) }).strict()),
|
|
289
|
+
})
|
|
290
|
+
.strict();
|
|
291
|
+
/**
|
|
292
|
+
* Read the derived state view; when missing or corrupt it is rebuilt from
|
|
293
|
+
* the authoritative `task.json` status (history then starts at the current
|
|
294
|
+
* state — the full history lives in the event log).
|
|
295
|
+
*/
|
|
296
|
+
export function readStateView(root, id, taskStatus, at) {
|
|
297
|
+
const raw = readJsonFile(stateJsonPath(root, id));
|
|
298
|
+
const parsed = stateViewSchema.safeParse(raw);
|
|
299
|
+
if (parsed.success && parsed.data.id === id && parsed.data.state === taskStatus)
|
|
300
|
+
return parsed.data;
|
|
301
|
+
return { id, state: taskStatus, history: [{ state: taskStatus, at }] };
|
|
302
|
+
}
|
|
303
|
+
export function writeStateView(root, view) {
|
|
304
|
+
writeFileEnsuring(stateJsonPath(root, view.id), JSON.stringify(view, null, 2) + '\n');
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Perform one state transition on disk: `task.json` (authoritative status)
|
|
308
|
+
* plus the derived `state.json` history. Legality is the CALLER's check —
|
|
309
|
+
* this is the mechanical writer.
|
|
310
|
+
*/
|
|
311
|
+
export function recordTransition(root, task, to, at) {
|
|
312
|
+
const from = task.status;
|
|
313
|
+
const view = readStateView(root, task.id, from, at);
|
|
314
|
+
task.status = to;
|
|
315
|
+
writeTask(root, task);
|
|
316
|
+
const next = { id: task.id, state: to, history: [...view.history, { state: to, at }] };
|
|
317
|
+
writeStateView(root, next);
|
|
318
|
+
return next;
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=tasks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks.js","sourceRoot":"","sources":["../src/tasks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEnF,8EAA8E;AAC9E,8BAA8B;AAC9B,8EAA8E;AAE9E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM;IACN,KAAK;IACL,UAAU;IACV,MAAM;IACN,MAAM;IACN,OAAO;IACP,MAAM;IACN,IAAI;IACJ,OAAO;IACP,OAAO;IACP,QAAQ;CACA,CAAC;AAGX,MAAM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