@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
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TRANSPARENCY.md — the LGPD disclosure installed in every client repo
|
|
3
|
+
* (DECISIONS D-002; ARCHITECTURE §1 tenet 5: metrics, never content).
|
|
4
|
+
* Rendered in pt-BR when the render language is pt-BR (D-003), EN otherwise.
|
|
5
|
+
*/
|
|
6
|
+
export function renderTransparencyMd(lang, kitVersion) {
|
|
7
|
+
return lang.toLowerCase().startsWith('pt') ? ptBR(kitVersion) : en(kitVersion);
|
|
8
|
+
}
|
|
9
|
+
function ptBR(kitVersion) {
|
|
10
|
+
return `# Transparência de dados — Invictus AI Kit v${kitVersion}
|
|
11
|
+
|
|
12
|
+
Este arquivo é instalado pelo \`invi init\` e descreve exatamente quais dados o kit
|
|
13
|
+
registra, por quê, quem acessa e por quanto tempo — em conformidade com a LGPD
|
|
14
|
+
(Lei 13.709/2018). Regra de ouro do kit: **métricas, nunca conteúdo**.
|
|
15
|
+
|
|
16
|
+
## O que é coletado
|
|
17
|
+
|
|
18
|
+
1. **Log de eventos local** (\`.invictus/log/<devId>.jsonl\`, dentro deste repositório):
|
|
19
|
+
eventos de sessão, checkpoints de tarefas, decisões e notas de diário registrados
|
|
20
|
+
pela equipe via \`invi journal\`. O texto dessas notas fica neste repositório
|
|
21
|
+
e **só sai dele se o time habilitar o \`invi sync\`** (item 3).
|
|
22
|
+
2. **Trailer de commit** (\`Invictus: v1.<payload>.<hmac>\`): contadores compactos por
|
|
23
|
+
commit — tokens (entrada/saída/cache), custo estimado em centavos, mix de modelos,
|
|
24
|
+
linhas adicionadas/removidas, quantidade de prompts e chamadas de ferramenta,
|
|
25
|
+
aceites/rejeições de edição, duração, IDs de requisito (REQ-###) e o ID
|
|
26
|
+
pseudônimo do desenvolvedor. **Sem texto livre.**
|
|
27
|
+
3. **\`invi sync\`** (opcional; exige provisionamento explícito via
|
|
28
|
+
\`invi keys provision\`): envia os eventos do log **exatamente como foram
|
|
29
|
+
registrados** — a integridade é garantida por uma cadeia de hashes, então nada
|
|
30
|
+
pode ser reescrito no envio. Isso significa que o texto de notas de diário
|
|
31
|
+
registrado via \`invi journal\` também trafega quando o sync está habilitado;
|
|
32
|
+
a regra do kit continua sendo gravar métricas (nunca conteúdo) nos eventos, e a
|
|
33
|
+
plataforma **rejeita** qualquer evento que contenha um campo \`email\`.
|
|
34
|
+
Envia também, para os commits alcançáveis a partir do branch atual: o SHA, a
|
|
35
|
+
data do commit, o nome do branch e **somente as linhas \`Invictus:\`** — assunto,
|
|
36
|
+
corpo e demais trailers da mensagem ficam nesta máquina. Depois de provisionado,
|
|
37
|
+
o sync roda sozinho no \`git push\` e, no máximo a cada 10 minutos, ao abrir uma
|
|
38
|
+
sessão (\`INVICTUS_SKIP_SYNC=1\` desliga).
|
|
39
|
+
|
|
40
|
+
## O que NUNCA é coletado
|
|
41
|
+
|
|
42
|
+
- Texto de prompts ou respostas do agente.
|
|
43
|
+
- Conteúdo de arquivos do repositório.
|
|
44
|
+
- E-mail, nome, hostname ou qualquer identificador direto — em nenhum artefato que
|
|
45
|
+
entre no histórico do git (histórico é imutável; LGPD art. 18).
|
|
46
|
+
|
|
47
|
+
## Pseudonimização
|
|
48
|
+
|
|
49
|
+
Cada desenvolvedor recebe um ID pseudônimo (\`d_xxxxxxxx\`) derivado de
|
|
50
|
+
\`sha256(salt-do-cliente : e-mail-git)\`. O salt fica em \`.invictus/local/\`
|
|
51
|
+
(**fora do git** — está no .gitignore) e tem duas origens possíveis: gerado
|
|
52
|
+
aleatoriamente nesta máquina no primeiro \`invi init\`, ou — quando a
|
|
53
|
+
plataforma está em uso — derivado deterministicamente da master key do cliente
|
|
54
|
+
pelo \`invi keys provision\`, para que o mesmo e-mail gere o mesmo ID em
|
|
55
|
+
todas as máquinas provisionadas. Nos dois casos o salt e o mapa e-mail↔ID
|
|
56
|
+
permanecem somente no lado do cliente; nada disso entra no git nem na
|
|
57
|
+
plataforma. Para exercer o direito de eliminação (LGPD art. 18), basta apagar
|
|
58
|
+
o salt e o mapa local: os IDs históricos ficam órfãos e deixam de ser
|
|
59
|
+
vinculáveis.
|
|
60
|
+
|
|
61
|
+
## Por que coletamos
|
|
62
|
+
|
|
63
|
+
Custo por requisito, adoção do kit e saúde do fluxo de desenvolvimento — os
|
|
64
|
+
indicadores que o contratante usa para auditar o uso de IA no time. Telemetria bruta
|
|
65
|
+
é commodity; a ligação métrica↔requisito é o valor (Decisão D-002).
|
|
66
|
+
|
|
67
|
+
## Quem acessa
|
|
68
|
+
|
|
69
|
+
- **O time**: tudo — o log de eventos e o diário estão neste repositório, legíveis
|
|
70
|
+
por qualquer pessoa com acesso a ele. Desenvolvedores sempre podem ler os próprios dados.
|
|
71
|
+
- **O contratante (owner)**: o dashboard da plataforma privada, alimentado por
|
|
72
|
+
\`invi sync\` e pelos trailers de commit — somente métricas pseudônimas.
|
|
73
|
+
- **Invictus AI**: as mesmas métricas pseudônimas, para operação da plataforma.
|
|
74
|
+
|
|
75
|
+
## Retenção
|
|
76
|
+
|
|
77
|
+
- Log de eventos e diário: vivem no repositório, sob o controle e a política de
|
|
78
|
+
retenção do próprio cliente.
|
|
79
|
+
- Trailers de commit: imutáveis no histórico do git — por isso carregam apenas
|
|
80
|
+
dados pseudônimos e numéricos.
|
|
81
|
+
- Plataforma: métricas retidas enquanto o contrato estiver ativo; eliminação
|
|
82
|
+
mediante solicitação do cliente.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
Gerado pelo \`invi init\`. Dúvidas: contato@invictusai.com.br
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
function en(kitVersion) {
|
|
90
|
+
return `# Data transparency — Invictus AI Kit v${kitVersion}
|
|
91
|
+
|
|
92
|
+
Installed by \`invi init\`. Describes exactly what the kit records, why, who can
|
|
93
|
+
access it, and for how long — per LGPD (Brazilian law 13.709/2018). Golden rule:
|
|
94
|
+
**metrics, never content**.
|
|
95
|
+
|
|
96
|
+
## What is collected
|
|
97
|
+
|
|
98
|
+
1. **Local event log** (\`.invictus/log/<devId>.jsonl\`, inside this repo): session
|
|
99
|
+
events, task checkpoints, decisions, and journal notes written via
|
|
100
|
+
\`invi journal\`. Note text stays in this repo and **only leaves it if the
|
|
101
|
+
team enables \`invi sync\`** (item 3).
|
|
102
|
+
2. **Commit trailer** (\`Invictus: v1.<payload>.<hmac>\`): compact per-commit counters —
|
|
103
|
+
tokens (in/out/cache), estimated cost in cents, model mix, lines added/removed,
|
|
104
|
+
prompt and tool-call counts, edit accepts/rejects, duration, requirement IDs
|
|
105
|
+
(REQ-###), and the developer's pseudonymous ID. **No free text.**
|
|
106
|
+
3. **\`invi sync\`** (optional; requires explicit provisioning via
|
|
107
|
+
\`invi keys provision\`): ships event-log entries **exactly as recorded** —
|
|
108
|
+
integrity is enforced by a hash chain, so nothing can be rewritten in flight.
|
|
109
|
+
That means journal-note text written via \`invi journal\` also travels when
|
|
110
|
+
sync is enabled; the kit's rule remains to record metrics (never content) in
|
|
111
|
+
events, and the platform **rejects** any event carrying an \`email\` field.
|
|
112
|
+
It also sends, for the commits reachable from the current branch: the SHA, the
|
|
113
|
+
commit date, the branch name and **only the \`Invictus:\` lines** — subject, body
|
|
114
|
+
and every other trailer of the message stay on this machine. Once provisioned,
|
|
115
|
+
sync runs by itself on \`git push\` and, at most every 10 minutes, when a
|
|
116
|
+
session opens (\`INVICTUS_SKIP_SYNC=1\` turns it off).
|
|
117
|
+
|
|
118
|
+
## What is NEVER collected
|
|
119
|
+
|
|
120
|
+
- Prompt text or agent responses.
|
|
121
|
+
- Repository file contents.
|
|
122
|
+
- Email, name, hostname, or any direct identifier — in anything that enters git
|
|
123
|
+
history (history is immutable; LGPD art. 18).
|
|
124
|
+
|
|
125
|
+
## Pseudonymization
|
|
126
|
+
|
|
127
|
+
Each developer gets a pseudonymous ID (\`d_xxxxxxxx\`) derived from
|
|
128
|
+
\`sha256(client-salt : git-email)\`. The salt lives in \`.invictus/local/\`
|
|
129
|
+
(**gitignored**) and has two possible origins: randomly generated on this
|
|
130
|
+
machine at the first \`invi init\`, or — when the platform is in use —
|
|
131
|
+
derived deterministically from the client master key by \`invi keys
|
|
132
|
+
provision\`, so the same git email yields the same ID on every provisioned
|
|
133
|
+
machine. Either way the salt and the email↔ID map stay client-side; neither
|
|
134
|
+
ever enters git or the platform. To exercise erasure (LGPD art. 18), delete
|
|
135
|
+
the local salt and map: historical IDs are orphaned and can no longer be
|
|
136
|
+
linked.
|
|
137
|
+
|
|
138
|
+
## Why
|
|
139
|
+
|
|
140
|
+
Cost per requirement, kit adoption, and dev-flow health — the indicators the owner
|
|
141
|
+
uses to audit AI usage. Raw telemetry is a commodity; the requirement↔cost link is
|
|
142
|
+
the value (Decision D-002).
|
|
143
|
+
|
|
144
|
+
## Who accesses
|
|
145
|
+
|
|
146
|
+
- **The team**: everything — the event log and journal live in this repo. Developers
|
|
147
|
+
can always read their own data.
|
|
148
|
+
- **The owner**: the private platform dashboard, fed by \`invi sync\` and commit
|
|
149
|
+
trailers — pseudonymous metrics only.
|
|
150
|
+
- **Invictus AI**: the same pseudonymous metrics, to operate the platform.
|
|
151
|
+
|
|
152
|
+
## Retention
|
|
153
|
+
|
|
154
|
+
- Event log and journal: live in the repo under the client's own retention policy.
|
|
155
|
+
- Commit trailers: immutable in git history — which is why they carry only
|
|
156
|
+
pseudonymous, numeric data.
|
|
157
|
+
- Platform: metrics retained while the contract is active; erased on client request.
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
Generated by \`invi init\`. Questions: contato@invictusai.com.br
|
|
162
|
+
`;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=transparency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transparency.js","sourceRoot":"","sources":["../../src/render/transparency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,UAAkB;IACnE,OAAO,IAAI,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;AACjF,CAAC;AAED,SAAS,IAAI,CAAC,UAAkB;IAC9B,OAAO,+CAA+C,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EjE,CAAC;AACF,CAAC;AAED,SAAS,EAAE,CAAC,UAAkB;IAC5B,OAAO,0CAA0C,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwE5D,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REQ records (content/PIPELINE.md §7, content/templates/requirements/
|
|
3
|
+
* REQ-TEMPLATE.md). Deterministic half of the PO layer: parse the REQ file
|
|
4
|
+
* format, run the MECHANICAL checks (id format, status enum, AC ids, EARS
|
|
5
|
+
* keyword shape, failure-twin heuristic), and enforce the §7.2 lifecycle.
|
|
6
|
+
* Judgment (writing criteria, deciding approval) stays in the po-* skills —
|
|
7
|
+
* `po-lint` remains the semantic gate; this module is the machine floor
|
|
8
|
+
* under it.
|
|
9
|
+
*
|
|
10
|
+
* Findings are structured `{code, params}` pairs so the CLI can render them
|
|
11
|
+
* localized (D-003) while `--json` output stays EN/stable.
|
|
12
|
+
*/
|
|
13
|
+
export declare const REQ_STATUSES: readonly ["draft", "approved", "in_progress", "delivered"];
|
|
14
|
+
export type ReqStatus = (typeof REQ_STATUSES)[number];
|
|
15
|
+
/** §7.3 event kinds. `approved` is minted only by `invi req approve`. */
|
|
16
|
+
export declare const REQ_EVENTS: readonly ["approved", "handoff", "ac_result", "delivered", "reopened"];
|
|
17
|
+
export type ReqEventKind = (typeof REQ_EVENTS)[number];
|
|
18
|
+
export declare const AC_VERDICTS: readonly ["pass", "fail", "not-verified"];
|
|
19
|
+
export type AcVerdict = (typeof AC_VERDICTS)[number];
|
|
20
|
+
/**
|
|
21
|
+
* Which REQ statuses each event is legal from, and the status it sets
|
|
22
|
+
* (null = no change). Mirrors the §7.2 table:
|
|
23
|
+
* draft → approved → in_progress → delivered (→ reopened → in_progress).
|
|
24
|
+
* `handoff` is also legal from `in_progress` (multi-task REQs, fix handoffs).
|
|
25
|
+
*/
|
|
26
|
+
export declare const REQ_EVENT_RULES: Readonly<Record<ReqEventKind, {
|
|
27
|
+
from: readonly ReqStatus[];
|
|
28
|
+
to: ReqStatus | null;
|
|
29
|
+
}>>;
|
|
30
|
+
export declare const AC_ID_RE: RegExp;
|
|
31
|
+
export declare const REQUIREMENTS_DIR_REL = ".invictus/requirements";
|
|
32
|
+
export declare function requirementsDir(root: string): string;
|
|
33
|
+
export declare function reqPath(root: string, id: string): string;
|
|
34
|
+
/** Ids of every REQ-*.md under .invictus/requirements/, sorted. */
|
|
35
|
+
export declare function listReqIds(root: string): string[];
|
|
36
|
+
export interface ReqCriterion {
|
|
37
|
+
/** `AC-104.1` */
|
|
38
|
+
id: string;
|
|
39
|
+
/** Criterion text after the id (EARS sentence, EN or pt-BR). */
|
|
40
|
+
text: string;
|
|
41
|
+
/** EARS pattern detected mechanically, or null when no keyword matched. */
|
|
42
|
+
ears: 'ubiquitous' | 'event' | 'state' | 'unwanted' | 'optional' | null;
|
|
43
|
+
withdrawn: boolean;
|
|
44
|
+
/** `(no failure mode: …)` explicit marker present. */
|
|
45
|
+
noFailureMode: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface ParsedReq {
|
|
48
|
+
/** Front-matter fields as parsed (scalars + string lists). */
|
|
49
|
+
frontMatter: Record<string, unknown>;
|
|
50
|
+
id: string | null;
|
|
51
|
+
status: string | null;
|
|
52
|
+
/** From the `# REQ-104 — title` heading, or null. */
|
|
53
|
+
title: string | null;
|
|
54
|
+
criteria: ReqCriterion[];
|
|
55
|
+
/** Unchecked `- [ ]` items under "Open questions". */
|
|
56
|
+
openQuestions: number;
|
|
57
|
+
body: string;
|
|
58
|
+
}
|
|
59
|
+
/** EARS keyword classification — EN and pt-BR keywords map 1:1 (template). */
|
|
60
|
+
export declare function classifyEars(text: string): ReqCriterion['ears'];
|
|
61
|
+
export declare function parseReqFile(content: string): ParsedReq;
|
|
62
|
+
export interface ReqFinding {
|
|
63
|
+
/** Stable EN code — rendered localized by the CLI, kept as-is in --json. */
|
|
64
|
+
code: 'front-matter-missing' | 'id-format' | 'status-unknown' | 'field-missing' | 'no-criteria' | 'ac-req-mismatch' | 'ac-duplicate' | 'not-ears' | 'no-failure-twin' | 'open-questions';
|
|
65
|
+
params: Record<string, string | number>;
|
|
66
|
+
}
|
|
67
|
+
export interface ReqValidation {
|
|
68
|
+
req: ParsedReq;
|
|
69
|
+
errors: ReqFinding[];
|
|
70
|
+
warnings: ReqFinding[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The mechanical floor (id format, status enum, AC ids, EARS keyword shape,
|
|
74
|
+
* failure-twin heuristic, open questions). Anything requiring judgment
|
|
75
|
+
* (vague adverbs in context, testability, glossary resolution) belongs to
|
|
76
|
+
* /po-lint and is NOT checked here.
|
|
77
|
+
*/
|
|
78
|
+
export declare function validateReq(content: string): ReqValidation;
|
|
79
|
+
/**
|
|
80
|
+
* Rewrite ONLY the front-matter `status:` line, byte-preserving everything
|
|
81
|
+
* else. Returns null when no status line is found.
|
|
82
|
+
*/
|
|
83
|
+
export declare function replaceReqStatus(content: string, to: ReqStatus): string | null;
|
|
84
|
+
//# sourceMappingURL=requirements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../src/requirements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,eAAO,MAAM,YAAY,4DAA6D,CAAC;AACvF,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,yEAAyE;AACzE,eAAO,MAAM,UAAU,wEAAyE,CAAC;AACjG,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,WAAW,2CAA4C,CAAC;AACrE,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CACpC,MAAM,CAAC,YAAY,EAAE;IAAE,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CAAA;CAAE,CAAC,CAO3E,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAsB,CAAC;AAM5C,eAAO,MAAM,oBAAoB,2BAA2B,CAAC;AAE7D,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAOjD;AAMD,MAAM,WAAW,YA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OAAO,EAAE,MAAM,GAAG,aAAa,CAuD1D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAO9E"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* REQ records (content/PIPELINE.md §7, content/templates/requirements/
|
|
3
|
+
* REQ-TEMPLATE.md). Deterministic half of the PO layer: parse the REQ file
|
|
4
|
+
* format, run the MECHANICAL checks (id format, status enum, AC ids, EARS
|
|
5
|
+
* keyword shape, failure-twin heuristic), and enforce the §7.2 lifecycle.
|
|
6
|
+
* Judgment (writing criteria, deciding approval) stays in the po-* skills —
|
|
7
|
+
* `po-lint` remains the semantic gate; this module is the machine floor
|
|
8
|
+
* under it.
|
|
9
|
+
*
|
|
10
|
+
* Findings are structured `{code, params}` pairs so the CLI can render them
|
|
11
|
+
* localized (D-003) while `--json` output stays EN/stable.
|
|
12
|
+
*/
|
|
13
|
+
import { readdirSync } from 'node:fs';
|
|
14
|
+
import { join } from 'node:path';
|
|
15
|
+
import { REQ_ID_RE } from '@invictus-group-ai/core';
|
|
16
|
+
import { isDir, readTextFile } from './util/fsx.js';
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// Lifecycle (PIPELINE.md §7.2)
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
export const REQ_STATUSES = ['draft', 'approved', 'in_progress', 'delivered'];
|
|
21
|
+
/** §7.3 event kinds. `approved` is minted only by `invi req approve`. */
|
|
22
|
+
export const REQ_EVENTS = ['approved', 'handoff', 'ac_result', 'delivered', 'reopened'];
|
|
23
|
+
export const AC_VERDICTS = ['pass', 'fail', 'not-verified'];
|
|
24
|
+
/**
|
|
25
|
+
* Which REQ statuses each event is legal from, and the status it sets
|
|
26
|
+
* (null = no change). Mirrors the §7.2 table:
|
|
27
|
+
* draft → approved → in_progress → delivered (→ reopened → in_progress).
|
|
28
|
+
* `handoff` is also legal from `in_progress` (multi-task REQs, fix handoffs).
|
|
29
|
+
*/
|
|
30
|
+
export const REQ_EVENT_RULES = {
|
|
31
|
+
approved: { from: ['draft'], to: 'approved' },
|
|
32
|
+
handoff: { from: ['approved', 'in_progress'], to: 'in_progress' },
|
|
33
|
+
ac_result: { from: ['in_progress'], to: null },
|
|
34
|
+
delivered: { from: ['in_progress'], to: 'delivered' },
|
|
35
|
+
reopened: { from: ['delivered'], to: 'in_progress' },
|
|
36
|
+
};
|
|
37
|
+
export const AC_ID_RE = /^AC-(\d+)\.(\d+)$/;
|
|
38
|
+
// ---------------------------------------------------------------------------
|
|
39
|
+
// Store (.invictus/requirements/)
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
export const REQUIREMENTS_DIR_REL = '.invictus/requirements';
|
|
42
|
+
export function requirementsDir(root) {
|
|
43
|
+
return join(root, '.invictus', 'requirements');
|
|
44
|
+
}
|
|
45
|
+
export function reqPath(root, id) {
|
|
46
|
+
return join(requirementsDir(root), `${id}.md`);
|
|
47
|
+
}
|
|
48
|
+
/** Ids of every REQ-*.md under .invictus/requirements/, sorted. */
|
|
49
|
+
export function listReqIds(root) {
|
|
50
|
+
const dir = requirementsDir(root);
|
|
51
|
+
if (!isDir(dir))
|
|
52
|
+
return [];
|
|
53
|
+
return readdirSync(dir)
|
|
54
|
+
.filter((f) => /^REQ-\d+\.md$/.test(f))
|
|
55
|
+
.map((f) => f.replace(/\.md$/, ''))
|
|
56
|
+
.sort();
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Tolerant front-matter parser for REQ files: top-level `key: value` scalars
|
|
60
|
+
* plus block sequences (`key:` followed by `- "item"` lines) — the subset the
|
|
61
|
+
* REQ template uses (`non_goals`). Unparseable lines are skipped, never
|
|
62
|
+
* fatal: the mechanical checks report on what IS parseable.
|
|
63
|
+
*/
|
|
64
|
+
function parseReqFrontMatter(block) {
|
|
65
|
+
const fm = {};
|
|
66
|
+
const lines = block.split('\n');
|
|
67
|
+
for (let i = 0; i < lines.length; i++) {
|
|
68
|
+
const line = lines[i];
|
|
69
|
+
if (!line.trim() || line.trim().startsWith('#'))
|
|
70
|
+
continue;
|
|
71
|
+
const kv = line.match(/^([A-Za-z_][\w-]*):(.*)$/);
|
|
72
|
+
if (!kv)
|
|
73
|
+
continue;
|
|
74
|
+
const key = kv[1];
|
|
75
|
+
const rest = kv[2].trim();
|
|
76
|
+
if (rest !== '') {
|
|
77
|
+
fm[key] = unquote(rest);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
const items = [];
|
|
81
|
+
while (i + 1 < lines.length && /^\s+-\s+/.test(lines[i + 1])) {
|
|
82
|
+
i++;
|
|
83
|
+
items.push(unquote(lines[i].replace(/^\s+-\s+/, '').trim()));
|
|
84
|
+
}
|
|
85
|
+
fm[key] = items;
|
|
86
|
+
}
|
|
87
|
+
return fm;
|
|
88
|
+
}
|
|
89
|
+
function unquote(s) {
|
|
90
|
+
if (s.length >= 2 && s.startsWith('"') && s.endsWith('"')) {
|
|
91
|
+
try {
|
|
92
|
+
return JSON.parse(s);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return s;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return s;
|
|
99
|
+
}
|
|
100
|
+
/** EARS keyword classification — EN and pt-BR keywords map 1:1 (template). */
|
|
101
|
+
export function classifyEars(text) {
|
|
102
|
+
const t = text.trim();
|
|
103
|
+
if (/^(when|quando)\b/i.test(t))
|
|
104
|
+
return 'event';
|
|
105
|
+
if (/^(if|se)\b/i.test(t) && /\b(then|ent[aã]o)\b/i.test(t))
|
|
106
|
+
return 'unwanted';
|
|
107
|
+
if (/^(while|enquanto)\b/i.test(t))
|
|
108
|
+
return 'state';
|
|
109
|
+
if (/^(where|onde)\b/i.test(t))
|
|
110
|
+
return 'optional';
|
|
111
|
+
if (/\b(shall|deve(m)?)\b/i.test(t))
|
|
112
|
+
return 'ubiquitous';
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
export function parseReqFile(content) {
|
|
116
|
+
const m = content.match(/^---\n([\s\S]*?)\n---\n?/);
|
|
117
|
+
const frontMatter = m ? parseReqFrontMatter(m[1]) : {};
|
|
118
|
+
const body = m ? content.slice(m[0].length) : content;
|
|
119
|
+
const rawId = typeof frontMatter['id'] === 'string' ? frontMatter['id'] : null;
|
|
120
|
+
const rawStatus = typeof frontMatter['status'] === 'string' ? frontMatter['status'] : null;
|
|
121
|
+
const titleMatch = body.match(/^#\s+REQ-\d+\s*[—–-]\s*(.+)$/m);
|
|
122
|
+
const criteria = [];
|
|
123
|
+
for (const line of body.split('\n')) {
|
|
124
|
+
const ac = line.match(/^\s*[-*]\s+\*\*(AC-\d+\.\d+)\*\*\s*[—–:-]\s*(.+)$/);
|
|
125
|
+
if (!ac)
|
|
126
|
+
continue;
|
|
127
|
+
const text = ac[2].trim();
|
|
128
|
+
criteria.push({
|
|
129
|
+
id: ac[1],
|
|
130
|
+
text,
|
|
131
|
+
ears: classifyEars(text),
|
|
132
|
+
withdrawn: /\(withdrawn:/i.test(text),
|
|
133
|
+
noFailureMode: /\(no failure mode:/i.test(text),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// Unchecked open questions ("- [ ] …") inside the "Open questions" section.
|
|
137
|
+
let openQuestions = 0;
|
|
138
|
+
const bodyLines = body.split('\n');
|
|
139
|
+
const oqStart = bodyLines.findIndex((l) => /^##\s+open questions\s*$/i.test(l.trim()));
|
|
140
|
+
if (oqStart !== -1) {
|
|
141
|
+
for (let i = oqStart + 1; i < bodyLines.length; i++) {
|
|
142
|
+
if (/^##\s/.test(bodyLines[i]))
|
|
143
|
+
break;
|
|
144
|
+
if (/^\s*[-*]\s+\[ \]/.test(bodyLines[i]))
|
|
145
|
+
openQuestions++;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
frontMatter,
|
|
150
|
+
id: rawId,
|
|
151
|
+
status: rawStatus,
|
|
152
|
+
title: titleMatch ? titleMatch[1].trim() : null,
|
|
153
|
+
criteria,
|
|
154
|
+
openQuestions,
|
|
155
|
+
body,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The mechanical floor (id format, status enum, AC ids, EARS keyword shape,
|
|
160
|
+
* failure-twin heuristic, open questions). Anything requiring judgment
|
|
161
|
+
* (vague adverbs in context, testability, glossary resolution) belongs to
|
|
162
|
+
* /po-lint and is NOT checked here.
|
|
163
|
+
*/
|
|
164
|
+
export function validateReq(content) {
|
|
165
|
+
const req = parseReqFile(content);
|
|
166
|
+
const errors = [];
|
|
167
|
+
const warnings = [];
|
|
168
|
+
if (!content.startsWith('---\n')) {
|
|
169
|
+
errors.push({ code: 'front-matter-missing', params: {} });
|
|
170
|
+
}
|
|
171
|
+
if (req.id === null || !REQ_ID_RE.test(req.id)) {
|
|
172
|
+
errors.push({ code: 'id-format', params: { id: req.id ?? '(missing)' } });
|
|
173
|
+
}
|
|
174
|
+
if (req.status === null || !REQ_STATUSES.includes(req.status)) {
|
|
175
|
+
errors.push({ code: 'status-unknown', params: { status: req.status ?? '(missing)' } });
|
|
176
|
+
}
|
|
177
|
+
for (const field of ['owner', 'priority', 'created']) {
|
|
178
|
+
if (typeof req.frontMatter[field] !== 'string' || req.frontMatter[field] === '') {
|
|
179
|
+
warnings.push({ code: 'field-missing', params: { field } });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (req.criteria.length === 0) {
|
|
183
|
+
errors.push({ code: 'no-criteria', params: {} });
|
|
184
|
+
}
|
|
185
|
+
const reqNumber = req.id !== null && REQ_ID_RE.test(req.id) ? req.id.slice('REQ-'.length) : null;
|
|
186
|
+
const seen = new Set();
|
|
187
|
+
const hasUnwanted = req.criteria.some((c) => c.ears === 'unwanted' && !c.withdrawn);
|
|
188
|
+
for (const c of req.criteria) {
|
|
189
|
+
const acm = c.id.match(AC_ID_RE);
|
|
190
|
+
if (reqNumber !== null && acm !== null && Number(acm[1]) !== Number(reqNumber)) {
|
|
191
|
+
errors.push({ code: 'ac-req-mismatch', params: { ac: c.id, id: req.id ?? '' } });
|
|
192
|
+
}
|
|
193
|
+
if (seen.has(c.id)) {
|
|
194
|
+
errors.push({ code: 'ac-duplicate', params: { ac: c.id } });
|
|
195
|
+
}
|
|
196
|
+
seen.add(c.id);
|
|
197
|
+
if (c.withdrawn)
|
|
198
|
+
continue;
|
|
199
|
+
if (c.ears === null) {
|
|
200
|
+
warnings.push({ code: 'not-ears', params: { ac: c.id } });
|
|
201
|
+
}
|
|
202
|
+
// Failure-twin heuristic: an event-driven criterion in a REQ with no
|
|
203
|
+
// unwanted-behavior criterion at all, and no explicit no-failure-mode
|
|
204
|
+
// marker, is missing its If…Then twin (template rule 2). Pairing a
|
|
205
|
+
// specific When with a specific If is judgment — po-lint's job.
|
|
206
|
+
if (c.ears === 'event' && !hasUnwanted && !c.noFailureMode) {
|
|
207
|
+
warnings.push({ code: 'no-failure-twin', params: { ac: c.id } });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (req.openQuestions > 0) {
|
|
211
|
+
warnings.push({ code: 'open-questions', params: { n: req.openQuestions } });
|
|
212
|
+
}
|
|
213
|
+
return { req, errors, warnings };
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Rewrite ONLY the front-matter `status:` line, byte-preserving everything
|
|
217
|
+
* else. Returns null when no status line is found.
|
|
218
|
+
*/
|
|
219
|
+
export function replaceReqStatus(content, to) {
|
|
220
|
+
const m = content.match(/^---\n[\s\S]*?\n---\n?/);
|
|
221
|
+
if (!m)
|
|
222
|
+
return null;
|
|
223
|
+
const fmBlock = m[0];
|
|
224
|
+
if (!/^status:.*$/m.test(fmBlock))
|
|
225
|
+
return null;
|
|
226
|
+
const next = fmBlock.replace(/^status:.*$/m, `status: ${to}`);
|
|
227
|
+
return next + content.slice(fmBlock.length);
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=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,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAClD,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,OAAO,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;IAC9D,OAAO,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AAC9C,CAAC"}
|
package/dist/sizing.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
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 type { TaskType } from './tasks.js';
|
|
9
|
+
/**
|
|
10
|
+
* Optional marked section in `.invictus/codebase/CONCERNS.md` (the mapped
|
|
11
|
+
* home of fragile areas — /invi-map writes it): one path/glob per line.
|
|
12
|
+
* The manifest schema (core, strict) has no fragile-area field, so the
|
|
13
|
+
* concerns document is the machine-readable source; absent it, the defaults
|
|
14
|
+
* below apply — the same trio the rendered agents' FRAGILE_AREAS default
|
|
15
|
+
* names (auth, money/payment paths, data migrations).
|
|
16
|
+
*/
|
|
17
|
+
export declare const FRAGILE_PATHS_VAR = "FRAGILE_PATHS";
|
|
18
|
+
/** Default fragile path fragments (case-insensitive substring match). */
|
|
19
|
+
export declare const DEFAULT_FRAGILE_PATTERNS: readonly ["auth", "payment", "billing", "checkout", "money", "migration"];
|
|
20
|
+
export interface FragilePatterns {
|
|
21
|
+
patterns: string[];
|
|
22
|
+
source: 'concerns-doc' | 'defaults';
|
|
23
|
+
}
|
|
24
|
+
export declare function loadFragilePatterns(root: string): FragilePatterns;
|
|
25
|
+
/** Files (changed or planned) intersected with the fragile patterns. */
|
|
26
|
+
export declare function fragileIntersection(files: string[], patterns: string[]): string[];
|
|
27
|
+
export declare const SIZING_VERDICTS: readonly ["inline", "quick", "full-pipeline"];
|
|
28
|
+
export type SizingVerdict = (typeof SIZING_VERDICTS)[number];
|
|
29
|
+
export type SizingReason = 'fragile-intersection' | 'req-linked' | 'hotfix' | 'many-criteria' | 'large-diff' | 'multi-step-plan' | 'light-type' | 'few-criteria' | 'small-diff' | 'no-diff-signal' | 'no-full-trigger' | 'substantive-type' | 'moderate-criteria';
|
|
30
|
+
/** Thresholds — exported so the docs/tests state the same numbers. */
|
|
31
|
+
export declare const SIZING_THRESHOLDS: {
|
|
32
|
+
readonly manyCriteria: 4;
|
|
33
|
+
readonly largeDiffFiles: 10;
|
|
34
|
+
readonly largeDiffChurn: 400;
|
|
35
|
+
readonly multiStepPlan: 4;
|
|
36
|
+
readonly inlineMaxCriteria: 2;
|
|
37
|
+
readonly inlineMaxFiles: 2;
|
|
38
|
+
};
|
|
39
|
+
/** Task types that qualify for inline handling when everything else is small. */
|
|
40
|
+
export declare const LIGHT_TYPES: readonly TaskType[];
|
|
41
|
+
export interface SizingSignals {
|
|
42
|
+
type: TaskType;
|
|
43
|
+
/** acceptance_criteria.length */
|
|
44
|
+
criteria: number;
|
|
45
|
+
/** task.json `req[]` non-empty (PO-linked). */
|
|
46
|
+
reqIds: string[];
|
|
47
|
+
planState: 'missing' | 'blockers' | 'ok';
|
|
48
|
+
planSteps: number;
|
|
49
|
+
/** Task branch found (null = none). */
|
|
50
|
+
branch: string | null;
|
|
51
|
+
/** Branch-delta file count; null when no branch/diff signal. */
|
|
52
|
+
diffFiles: number | null;
|
|
53
|
+
/** Insertions + deletions; null when no diff signal. */
|
|
54
|
+
diffChurn: number | null;
|
|
55
|
+
/** Changed (or planned) files ∩ fragile patterns. */
|
|
56
|
+
fragileHits: string[];
|
|
57
|
+
}
|
|
58
|
+
export interface SizingDecision {
|
|
59
|
+
verdict: SizingVerdict;
|
|
60
|
+
reasons: SizingReason[];
|
|
61
|
+
}
|
|
62
|
+
export declare function decideSizing(s: SizingSignals): SizingDecision;
|
|
63
|
+
//# sourceMappingURL=sizing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizing.d.ts","sourceRoot":"","sources":["../src/sizing.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM3C;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AAEjD,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,2EAA4E,CAAC;AAElH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,cAAc,GAAG,UAAU,CAAC;CACrC;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,CAajE;AAED,wEAAwE;AACxE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAYjF;AAMD,eAAO,MAAM,eAAe,+CAAgD,CAAC;AAC7E,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,MAAM,MAAM,YAAY,GAEpB,sBAAsB,GACtB,YAAY,GACZ,QAAQ,GACR,eAAe,GACf,YAAY,GACZ,iBAAiB,GAEjB,YAAY,GACZ,cAAc,GACd,YAAY,GACZ,gBAAgB,GAEhB,iBAAiB,GACjB,kBAAkB,GAClB,mBAAmB,CAAC;AAExB,sEAAsE;AACtE,eAAO,MAAM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