devcontour-harness 0.0.0-stage → 0.1.0-alpha.6
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/README.md +183 -2
- package/docs/architecture.md +473 -0
- package/docs/compatibility-versions.md +56 -0
- package/docs/compatibility.md +192 -0
- package/docs/connectors.md +323 -0
- package/docs/contracts.md +603 -0
- package/docs/integrations/hindsight.md +148 -0
- package/docs/quickstart.md +182 -0
- package/docs/release-notes/0.1.0-alpha.6.md +238 -0
- package/docs/review-probes.md +120 -0
- package/docs/review-protocol.md +251 -0
- package/docs/toolchains.md +167 -0
- package/docs/turbo-starter.md +269 -0
- package/docs/upgrade.md +202 -0
- package/examples/README.md +27 -0
- package/examples/external-connector/README.md +19 -0
- package/examples/external-connector/connector.mjs +55 -0
- package/examples/files-only/README.md +28 -0
- package/examples/files-only/context/norms/rules.md +4 -0
- package/examples/files-only/graph.json +23 -0
- package/examples/files-only/policy.json +30 -0
- package/examples/one-vendor/README.md +19 -0
- package/examples/one-vendor/policy.json +27 -0
- package/examples/single-task/README.md +18 -0
- package/examples/single-task/graph.json +27 -0
- package/examples/single-task/policy-same-vendor.json +55 -0
- package/examples/single-task/policy.json +52 -0
- package/examples/single-task/src/.gitkeep +0 -0
- package/examples/single-task/test/run.js +19 -0
- package/examples/toolchains/README.md +32 -0
- package/examples/toolchains/go/bad/label/label.go +9 -0
- package/examples/toolchains/go/good/label/label.go +9 -0
- package/examples/toolchains/go/policy.json +79 -0
- package/examples/toolchains/go/repo/REQUIREMENTS.md +9 -0
- package/examples/toolchains/go/repo/_gitignore +1 -0
- package/examples/toolchains/go/repo/go.mod +5 -0
- package/examples/toolchains/go/repo/go.sum +2 -0
- package/examples/toolchains/go/repo/label/label.go +9 -0
- package/examples/toolchains/go/repo/label/label_test.go +27 -0
- package/examples/toolchains/go/repo/label/version.go +9 -0
- package/examples/toolchains/go/task.json +25 -0
- package/examples/toolchains/mixed-go/bad/backend/label/label.go +9 -0
- package/examples/toolchains/mixed-go/bad/frontend/src/label.js +4 -0
- package/examples/toolchains/mixed-go/good/backend/label/label.go +9 -0
- package/examples/toolchains/mixed-go/good/frontend/src/label.js +4 -0
- package/examples/toolchains/mixed-go/policy.json +126 -0
- package/examples/toolchains/mixed-go/repo/REQUIREMENTS.md +9 -0
- package/examples/toolchains/mixed-go/repo/_gitignore +6 -0
- package/examples/toolchains/mixed-go/repo/backend/go.mod +3 -0
- package/examples/toolchains/mixed-go/repo/backend/label/label.go +9 -0
- package/examples/toolchains/mixed-go/repo/backend/label/label_test.go +30 -0
- package/examples/toolchains/mixed-go/repo/contract/check.mjs +17 -0
- package/examples/toolchains/mixed-go/repo/contract/label.json +9 -0
- package/examples/toolchains/mixed-go/repo/frontend/package.json +15 -0
- package/examples/toolchains/mixed-go/repo/frontend/pnpm-lock.yaml +22 -0
- package/examples/toolchains/mixed-go/repo/frontend/src/label.js +4 -0
- package/examples/toolchains/mixed-go/repo/frontend/test/label.test.js +11 -0
- package/examples/toolchains/mixed-go/task.json +25 -0
- package/examples/toolchains/mixed-python/bad/backend/src/fx_backend/__init__.py +6 -0
- package/examples/toolchains/mixed-python/bad/frontend/src/label.js +4 -0
- package/examples/toolchains/mixed-python/good/backend/src/fx_backend/__init__.py +6 -0
- package/examples/toolchains/mixed-python/good/frontend/src/label.js +4 -0
- package/examples/toolchains/mixed-python/policy.json +121 -0
- package/examples/toolchains/mixed-python/repo/REQUIREMENTS.md +9 -0
- package/examples/toolchains/mixed-python/repo/_gitignore +6 -0
- package/examples/toolchains/mixed-python/repo/backend/.python-version +1 -0
- package/examples/toolchains/mixed-python/repo/backend/pyproject.toml +19 -0
- package/examples/toolchains/mixed-python/repo/backend/src/fx_backend/__init__.py +6 -0
- package/examples/toolchains/mixed-python/repo/backend/tests/test_label.py +11 -0
- package/examples/toolchains/mixed-python/repo/backend/uv.lock +108 -0
- package/examples/toolchains/mixed-python/repo/contract/check.mjs +17 -0
- package/examples/toolchains/mixed-python/repo/contract/label.json +9 -0
- package/examples/toolchains/mixed-python/repo/frontend/package.json +15 -0
- package/examples/toolchains/mixed-python/repo/frontend/pnpm-lock.yaml +22 -0
- package/examples/toolchains/mixed-python/repo/frontend/src/label.js +4 -0
- package/examples/toolchains/mixed-python/repo/frontend/test/label.test.js +11 -0
- package/examples/toolchains/mixed-python/task.json +25 -0
- package/examples/toolchains/npm/bad/src/label.js +4 -0
- package/examples/toolchains/npm/good/src/label.js +4 -0
- package/examples/toolchains/npm/policy.json +82 -0
- package/examples/toolchains/npm/repo/REQUIREMENTS.md +9 -0
- package/examples/toolchains/npm/repo/_gitignore +4 -0
- package/examples/toolchains/npm/repo/package-lock.json +22 -0
- package/examples/toolchains/npm/repo/package.json +13 -0
- package/examples/toolchains/npm/repo/src/label.js +4 -0
- package/examples/toolchains/npm/repo/test/label.test.js +13 -0
- package/examples/toolchains/npm/task.json +25 -0
- package/examples/toolchains/pnpm/bad/packages/label/src/label.js +4 -0
- package/examples/toolchains/pnpm/good/packages/label/src/label.js +4 -0
- package/examples/toolchains/pnpm/policy.json +85 -0
- package/examples/toolchains/pnpm/repo/REQUIREMENTS.md +9 -0
- package/examples/toolchains/pnpm/repo/_gitignore +4 -0
- package/examples/toolchains/pnpm/repo/package.json +10 -0
- package/examples/toolchains/pnpm/repo/packages/checker/check.mjs +5 -0
- package/examples/toolchains/pnpm/repo/packages/checker/package.json +9 -0
- package/examples/toolchains/pnpm/repo/packages/label/package.json +14 -0
- package/examples/toolchains/pnpm/repo/packages/label/src/label.js +4 -0
- package/examples/toolchains/pnpm/repo/packages/label/test/label.test.js +13 -0
- package/examples/toolchains/pnpm/repo/pnpm-lock.yaml +29 -0
- package/examples/toolchains/pnpm/repo/pnpm-workspace.yaml +2 -0
- package/examples/toolchains/pnpm/task.json +25 -0
- package/examples/toolchains/python/bad/src/fx_label/__init__.py +6 -0
- package/examples/toolchains/python/good/src/fx_label/__init__.py +6 -0
- package/examples/toolchains/python/policy.json +80 -0
- package/examples/toolchains/python/repo/.python-version +1 -0
- package/examples/toolchains/python/repo/REQUIREMENTS.md +9 -0
- package/examples/toolchains/python/repo/_gitignore +5 -0
- package/examples/toolchains/python/repo/pyproject.toml +19 -0
- package/examples/toolchains/python/repo/src/fx_label/__init__.py +6 -0
- package/examples/toolchains/python/repo/tests/test_label.py +13 -0
- package/examples/toolchains/python/repo/uv.lock +108 -0
- package/examples/toolchains/python/task.json +25 -0
- package/examples/toolchains/turbo/bad/packages/label/src/label.js +4 -0
- package/examples/toolchains/turbo/good/packages/label/src/label.js +4 -0
- package/examples/toolchains/turbo/policy.json +110 -0
- package/examples/toolchains/turbo/repo/REQUIREMENTS.md +9 -0
- package/examples/toolchains/turbo/repo/_gitignore +4 -0
- package/examples/toolchains/turbo/repo/package.json +13 -0
- package/examples/toolchains/turbo/repo/packages/checker/check.mjs +5 -0
- package/examples/toolchains/turbo/repo/packages/checker/package.json +9 -0
- package/examples/toolchains/turbo/repo/packages/label/package.json +14 -0
- package/examples/toolchains/turbo/repo/packages/label/src/label.js +4 -0
- package/examples/toolchains/turbo/repo/packages/label/test/label.test.js +13 -0
- package/examples/toolchains/turbo/repo/pnpm-lock.yaml +94 -0
- package/examples/toolchains/turbo/repo/pnpm-workspace.yaml +2 -0
- package/examples/toolchains/turbo/repo/turbo.json +7 -0
- package/examples/toolchains/turbo/task.json +25 -0
- package/examples/turbo-starter/README.md +16 -0
- package/examples/turbo-starter/changes/issued-at-consumer-only.patch +12 -0
- package/examples/turbo-starter/changes/issued-at.patch +130 -0
- package/examples/turbo-starter/cleanup.mjs +58 -0
- package/examples/turbo-starter/graph.json +32 -0
- package/examples/turbo-starter/harness/acceptance/db-isolation.test.mjs +97 -0
- package/examples/turbo-starter/harness/acceptance/env-probe.test.mjs +75 -0
- package/examples/turbo-starter/harness/acceptance/generation.test.mjs +54 -0
- package/examples/turbo-starter/harness/acceptance/issued-at.test.mjs +43 -0
- package/examples/turbo-starter/harness/acceptance/lifecycle-probe.test.mjs +47 -0
- package/examples/turbo-starter/harness/compose-bridge.mjs +593 -0
- package/examples/turbo-starter/harness/compose.acceptance.yml +23 -0
- package/examples/turbo-starter/harness/env/backend.env.template +7 -0
- package/examples/turbo-starter/harness/env/compose.env.template +6 -0
- package/examples/turbo-starter/policy.json +109 -0
- package/examples/turbo-starter/policy.lifecycle.json +114 -0
- package/examples/turbo-starter/setup.mjs +352 -0
- package/examples/two-vendors/policy.json +30 -0
- package/lib/agents/cli-adapter.d.ts +48 -0
- package/lib/agents/cli-adapter.js +386 -0
- package/lib/agents/inspect.d.ts +6 -0
- package/lib/agents/inspect.js +46 -0
- package/lib/agents/probe-server.d.ts +2 -0
- package/lib/agents/probe-server.js +13 -0
- package/lib/agents/review-probe.d.ts +295 -0
- package/lib/agents/review-probe.js +872 -0
- package/lib/agents/runtime-events.d.ts +11 -0
- package/lib/agents/runtime-events.js +21 -0
- package/lib/agents/schemas.d.ts +217 -0
- package/lib/agents/schemas.js +124 -0
- package/lib/agents/usage.d.ts +8 -0
- package/lib/agents/usage.js +83 -0
- package/lib/cli.d.ts +2 -0
- package/lib/cli.js +491 -0
- package/lib/connectors/files.d.ts +108 -0
- package/lib/connectors/files.js +133 -0
- package/lib/contracts/checks.d.ts +307 -0
- package/lib/contracts/checks.js +181 -0
- package/lib/contracts/cli.d.ts +3895 -0
- package/lib/contracts/cli.js +664 -0
- package/lib/contracts/context.d.ts +135 -0
- package/lib/contracts/context.js +129 -0
- package/lib/contracts/digest.d.ts +9 -0
- package/lib/contracts/digest.js +22 -0
- package/lib/contracts/errors.d.ts +81 -0
- package/lib/contracts/errors.js +70 -0
- package/lib/contracts/events.d.ts +827 -0
- package/lib/contracts/events.js +258 -0
- package/lib/contracts/execution.d.ts +3216 -0
- package/lib/contracts/execution.js +872 -0
- package/lib/contracts/failure.d.ts +67 -0
- package/lib/contracts/failure.js +127 -0
- package/lib/contracts/index.d.ts +18 -0
- package/lib/contracts/index.js +18 -0
- package/lib/contracts/policy.d.ts +1080 -0
- package/lib/contracts/policy.js +544 -0
- package/lib/contracts/ports.d.ts +417 -0
- package/lib/contracts/ports.js +1 -0
- package/lib/contracts/primitives.d.ts +63 -0
- package/lib/contracts/primitives.js +73 -0
- package/lib/contracts/profiles.d.ts +336 -0
- package/lib/contracts/profiles.js +109 -0
- package/lib/contracts/published.d.ts +3237 -0
- package/lib/contracts/published.js +34 -0
- package/lib/contracts/result.d.ts +1280 -0
- package/lib/contracts/result.js +311 -0
- package/lib/contracts/review.d.ts +441 -0
- package/lib/contracts/review.js +477 -0
- package/lib/contracts/toolchain.d.ts +96 -0
- package/lib/contracts/toolchain.js +89 -0
- package/lib/contracts/version.d.ts +17 -0
- package/lib/contracts/version.js +17 -0
- package/lib/contracts/work.d.ts +173 -0
- package/lib/contracts/work.js +178 -0
- package/lib/control/base-move.d.ts +44 -0
- package/lib/control/base-move.js +90 -0
- package/lib/control/doctor.d.ts +50 -0
- package/lib/control/doctor.js +113 -0
- package/lib/control/harness.d.ts +1125 -0
- package/lib/control/harness.js +741 -0
- package/lib/control/provenance.d.ts +17 -0
- package/lib/control/provenance.js +25 -0
- package/lib/control/recovery.d.ts +237 -0
- package/lib/control/recovery.js +236 -0
- package/lib/control/review.d.ts +62 -0
- package/lib/control/review.js +178 -0
- package/lib/control/workflow.d.ts +247 -0
- package/lib/control/workflow.js +259 -0
- package/lib/engine/budget.d.ts +345 -0
- package/lib/engine/budget.js +278 -0
- package/lib/engine/classify.d.ts +8 -0
- package/lib/engine/classify.js +32 -0
- package/lib/engine/engine.d.ts +1527 -0
- package/lib/engine/engine.js +2259 -0
- package/lib/engine/failure.d.ts +1 -0
- package/lib/engine/failure.js +3 -0
- package/lib/engine/joint-runner.d.ts +257 -0
- package/lib/engine/joint-runner.js +254 -0
- package/lib/engine/measured.d.ts +15 -0
- package/lib/engine/measured.js +82 -0
- package/lib/engine/prompt.d.ts +66 -0
- package/lib/engine/prompt.js +131 -0
- package/lib/engine/property-recovery.d.ts +50 -0
- package/lib/engine/property-recovery.js +171 -0
- package/lib/engine/repair.d.ts +33 -0
- package/lib/engine/repair.js +82 -0
- package/lib/engine/result.d.ts +9 -0
- package/lib/engine/result.js +218 -0
- package/lib/engine/reuse.d.ts +80 -0
- package/lib/engine/reuse.js +102 -0
- package/lib/engine/runner.d.ts +360 -0
- package/lib/engine/runner.js +1836 -0
- package/lib/engine/standalone.d.ts +6 -0
- package/lib/engine/standalone.js +48 -0
- package/lib/engine/usage.d.ts +87 -0
- package/lib/engine/usage.js +165 -0
- package/lib/environment/isolation.d.ts +110 -0
- package/lib/environment/isolation.js +238 -0
- package/lib/environment/lifecycle.d.ts +40 -0
- package/lib/environment/lifecycle.js +197 -0
- package/lib/environment/live-calls.d.ts +14 -0
- package/lib/environment/live-calls.js +73 -0
- package/lib/environment/os-tools.d.ts +16 -0
- package/lib/environment/os-tools.js +35 -0
- package/lib/environment/process.d.ts +32 -0
- package/lib/environment/process.js +369 -0
- package/lib/environment/redaction.d.ts +22 -0
- package/lib/environment/redaction.js +102 -0
- package/lib/environment/resources.d.ts +31 -0
- package/lib/environment/resources.js +120 -0
- package/lib/index.d.ts +65 -0
- package/lib/index.js +67 -0
- package/lib/integrations/connector/commands.d.ts +358 -0
- package/lib/integrations/connector/commands.js +428 -0
- package/lib/integrations/connector/config.d.ts +215 -0
- package/lib/integrations/connector/config.js +214 -0
- package/lib/integrations/connector/delivery.d.ts +107 -0
- package/lib/integrations/connector/delivery.js +591 -0
- package/lib/integrations/connector/fake.d.ts +291 -0
- package/lib/integrations/connector/fake.js +786 -0
- package/lib/integrations/connector/history.d.ts +124 -0
- package/lib/integrations/connector/history.js +497 -0
- package/lib/integrations/connector/index.d.ts +16 -0
- package/lib/integrations/connector/index.js +16 -0
- package/lib/integrations/connector/redact.d.ts +19 -0
- package/lib/integrations/connector/redact.js +91 -0
- package/lib/integrations/connector/registry.d.ts +15 -0
- package/lib/integrations/connector/registry.js +43 -0
- package/lib/integrations/connector/snapshot.d.ts +131 -0
- package/lib/integrations/connector/snapshot.js +422 -0
- package/lib/integrations/connector/source.d.ts +37 -0
- package/lib/integrations/connector/source.js +73 -0
- package/lib/integrations/connector/steps.d.ts +71 -0
- package/lib/integrations/connector/steps.js +188 -0
- package/lib/integrations/connector/store.d.ts +140 -0
- package/lib/integrations/connector/store.js +277 -0
- package/lib/integrations/connector/summary.d.ts +38 -0
- package/lib/integrations/connector/summary.js +59 -0
- package/lib/integrations/connector/testing-worker.d.ts +1 -0
- package/lib/integrations/connector/testing-worker.js +81 -0
- package/lib/integrations/connector/testing.d.ts +205 -0
- package/lib/integrations/connector/testing.js +1615 -0
- package/lib/integrations/connector/transport.d.ts +240 -0
- package/lib/integrations/connector/transport.js +28 -0
- package/lib/integrations/memory/context.d.ts +120 -0
- package/lib/integrations/memory/context.js +239 -0
- package/lib/integrations/memory/index.d.ts +8 -0
- package/lib/integrations/memory/index.js +8 -0
- package/lib/integrations/memory/provider.d.ts +79 -0
- package/lib/integrations/memory/provider.js +22 -0
- package/lib/integrations/memory/sink.d.ts +56 -0
- package/lib/integrations/memory/sink.js +116 -0
- package/lib/integrations/memory/testing.d.ts +44 -0
- package/lib/integrations/memory/testing.js +61 -0
- package/lib/integrations/relay-v1/index.d.ts +122 -0
- package/lib/integrations/relay-v1/index.js +860 -0
- package/lib/integrations/relay-v2/index.d.ts +145 -0
- package/lib/integrations/relay-v2/index.js +752 -0
- package/lib/integrations/relay-v2/process.d.ts +32 -0
- package/lib/integrations/relay-v2/process.js +112 -0
- package/lib/integrations/relay-v2/protocol.d.ts +172 -0
- package/lib/integrations/relay-v2/protocol.js +142 -0
- package/lib/package.d.ts +2 -0
- package/lib/package.js +3 -0
- package/lib/profiles/resolve.d.ts +190 -0
- package/lib/profiles/resolve.js +273 -0
- package/lib/storage/document.d.ts +1234 -0
- package/lib/storage/document.js +80 -0
- package/lib/storage/sqlite.d.ts +35 -0
- package/lib/storage/sqlite.js +260 -0
- package/lib/testing/index.d.ts +5 -0
- package/lib/testing/index.js +5 -0
- package/lib/testing/store-contract.d.ts +8 -0
- package/lib/testing/store-contract.js +167 -0
- package/lib/toolchains/index.d.ts +9 -0
- package/lib/toolchains/index.js +9 -0
- package/lib/toolchains/inspect.d.ts +105 -0
- package/lib/toolchains/inspect.js +831 -0
- package/lib/toolchains/manifests.d.ts +67 -0
- package/lib/toolchains/manifests.js +238 -0
- package/lib/toolchains/probe.d.ts +28 -0
- package/lib/toolchains/probe.js +54 -0
- package/lib/toolchains/recipes.d.ts +33 -0
- package/lib/toolchains/recipes.js +51 -0
- package/lib/validate.d.ts +36 -0
- package/lib/validate.js +175 -0
- package/lib/verification/acceptance.d.ts +284 -0
- package/lib/verification/acceptance.js +670 -0
- package/lib/verification/checks.d.ts +72 -0
- package/lib/verification/checks.js +190 -0
- package/lib/verification/confirm.d.ts +125 -0
- package/lib/verification/confirm.js +411 -0
- package/lib/verification/corpus.d.ts +1303 -0
- package/lib/verification/corpus.js +744 -0
- package/lib/verification/dependencies.d.ts +66 -0
- package/lib/verification/dependencies.js +144 -0
- package/lib/verification/gates.d.ts +160 -0
- package/lib/verification/gates.js +600 -0
- package/lib/verification/joint.d.ts +63 -0
- package/lib/verification/joint.js +121 -0
- package/lib/verification/proof.d.ts +54 -0
- package/lib/verification/proof.js +96 -0
- package/lib/verification/property.d.ts +86 -0
- package/lib/verification/property.js +214 -0
- package/lib/verification/requirements.d.ts +25 -0
- package/lib/verification/requirements.js +69 -0
- package/lib/verification/self-check.d.ts +29 -0
- package/lib/verification/self-check.js +99 -0
- package/lib/verification/spike.d.ts +79 -0
- package/lib/verification/spike.js +124 -0
- package/package.json +100 -4
- package/profiles/expo-mobile.json +15 -0
- package/profiles/go-api.json +15 -0
- package/profiles/go-gotestsum.json +21 -0
- package/profiles/mobile-maestro.json +29 -0
- package/profiles/nest-api.json +26 -0
- package/profiles/next-product.json +72 -0
- package/profiles/node-checks.json +77 -0
- package/profiles/npm-ci.json +22 -0
- package/profiles/pnpm-frozen.json +24 -0
- package/profiles/python-api.json +32 -0
- package/profiles/python-uv.json +26 -0
- package/profiles/react-native.json +50 -0
- package/profiles/react-vite-admin.json +71 -0
- package/schemas/context-snapshot.schema.json +231 -0
- package/schemas/contract-document.schema.json +385 -0
- package/schemas/execution-document.schema.json +3695 -0
- package/schemas/execution-policy.schema.json +2196 -0
- package/schemas/joint-verification.schema.json +617 -0
- package/schemas/result-envelope.schema.json +1652 -0
- package/schemas/review-record.schema.json +177 -0
- package/schemas/run-event.schema.json +2458 -0
- package/schemas/run-result.schema.json +1570 -0
- package/schemas/stack-profile.schema.json +535 -0
- package/schemas/work-graph.schema.json +381 -0
- package/schemas/work-order.schema.json +256 -0
- package/skills/harness/SKILL.md +64 -0
- package/templates/AGENTS.md +13 -0
- package/templates/controller-mode/AGENTS.controller.md +58 -0
- package/templates/controller-mode/README.md +44 -0
- package/templates/graph.json +22 -0
- package/templates/policy.json +28 -0
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Профиль стека — переносимый файл, из которого собирается описание
|
|
4
|
+
* репозитория в политике: gates, подготовка, окружение, lifecycle,
|
|
5
|
+
* защищённые пути, роли и инструкции стека. Профиль только описывает:
|
|
6
|
+
* разрешение читает манифесты и не исполняет ни одной команды проекта.
|
|
7
|
+
*
|
|
8
|
+
* Форма файла совпадает с профилями, которые уже закреплены у потребителей
|
|
9
|
+
* (их digest — sha256 байтов файла), поэтому встроенные профили переносятся
|
|
10
|
+
* побайтно.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PROFILE_FILE_LIMIT = 131072;
|
|
13
|
+
export declare const PROFILE_FILES_LIMIT = 32;
|
|
14
|
+
export declare const PROFILE_DEPTH_LIMIT = 16;
|
|
15
|
+
/** Привязка runtime в профиле: кто пишет или проверяет у роли. */
|
|
16
|
+
export declare const profileBindingSchema: z.ZodObject<{
|
|
17
|
+
runtime: z.ZodEnum<{
|
|
18
|
+
codex: "codex";
|
|
19
|
+
claude: "claude";
|
|
20
|
+
}>;
|
|
21
|
+
model: z.ZodOptional<z.ZodString>;
|
|
22
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
23
|
+
low: "low";
|
|
24
|
+
medium: "medium";
|
|
25
|
+
high: "high";
|
|
26
|
+
xhigh: "xhigh";
|
|
27
|
+
}>>;
|
|
28
|
+
toolProfile: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strict>;
|
|
30
|
+
/** Роль, которую требует поверхность стека. `title` — подпись для людей, harness её не читает. */
|
|
31
|
+
export declare const profileRoleSchema: z.ZodObject<{
|
|
32
|
+
runtime: z.ZodEnum<{
|
|
33
|
+
codex: "codex";
|
|
34
|
+
claude: "claude";
|
|
35
|
+
}>;
|
|
36
|
+
model: z.ZodOptional<z.ZodString>;
|
|
37
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
low: "low";
|
|
39
|
+
medium: "medium";
|
|
40
|
+
high: "high";
|
|
41
|
+
xhigh: "xhigh";
|
|
42
|
+
}>>;
|
|
43
|
+
toolProfile: z.ZodOptional<z.ZodString>;
|
|
44
|
+
writePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
45
|
+
reviewer: z.ZodOptional<z.ZodObject<{
|
|
46
|
+
runtime: z.ZodEnum<{
|
|
47
|
+
codex: "codex";
|
|
48
|
+
claude: "claude";
|
|
49
|
+
}>;
|
|
50
|
+
model: z.ZodOptional<z.ZodString>;
|
|
51
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
52
|
+
low: "low";
|
|
53
|
+
medium: "medium";
|
|
54
|
+
high: "high";
|
|
55
|
+
xhigh: "xhigh";
|
|
56
|
+
}>>;
|
|
57
|
+
toolProfile: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
title: z.ZodOptional<z.ZodString>;
|
|
60
|
+
requiresContract: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
/**
|
|
63
|
+
* Инструкции стека: файлы, которые хост закрепляет как контекст ролей
|
|
64
|
+
* (`files` — вкладываются в запрос, `references` — только называются).
|
|
65
|
+
* Harness их не читает и не копирует: закреплять их — дело ContextSource.
|
|
66
|
+
*/
|
|
67
|
+
export declare const profileContextPackSchema: z.ZodObject<{
|
|
68
|
+
id: z.ZodString;
|
|
69
|
+
version: z.ZodString;
|
|
70
|
+
repositoryId: z.ZodOptional<z.ZodString>;
|
|
71
|
+
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
72
|
+
files: z.ZodArray<z.ZodString>;
|
|
73
|
+
references: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
74
|
+
}, z.core.$strict>;
|
|
75
|
+
/** Gate в профиле: та же форма, что в политике; отсутствие JUnit у test gate называется явно. */
|
|
76
|
+
export declare const profileGateSchema: z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
kind: z.ZodEnum<{
|
|
79
|
+
check: "check";
|
|
80
|
+
test: "test";
|
|
81
|
+
}>;
|
|
82
|
+
command: z.ZodArray<z.ZodString>;
|
|
83
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
84
|
+
report: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
type: z.ZodLiteral<"junit">;
|
|
86
|
+
path: z.ZodString;
|
|
87
|
+
}, z.core.$strict>>;
|
|
88
|
+
property: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
path: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$strict>>;
|
|
91
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
93
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
export declare const stackProfileSchema: z.ZodObject<{
|
|
96
|
+
id: z.ZodString;
|
|
97
|
+
version: z.ZodString;
|
|
98
|
+
extends: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
|
+
capabilities: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
100
|
+
gates: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
101
|
+
id: z.ZodString;
|
|
102
|
+
kind: z.ZodEnum<{
|
|
103
|
+
check: "check";
|
|
104
|
+
test: "test";
|
|
105
|
+
}>;
|
|
106
|
+
command: z.ZodArray<z.ZodString>;
|
|
107
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
108
|
+
report: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
type: z.ZodLiteral<"junit">;
|
|
110
|
+
path: z.ZodString;
|
|
111
|
+
}, z.core.$strict>>;
|
|
112
|
+
property: z.ZodOptional<z.ZodObject<{
|
|
113
|
+
path: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
116
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
117
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
}, z.core.$strict>>>;
|
|
119
|
+
prepare: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
120
|
+
id: z.ZodString;
|
|
121
|
+
command: z.ZodArray<z.ZodString>;
|
|
122
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
123
|
+
}, z.core.$strict>>>;
|
|
124
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
125
|
+
inherit: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
126
|
+
values: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
127
|
+
secrets: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
128
|
+
}, z.core.$strict>>;
|
|
129
|
+
lifecycle: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
setup: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
command: z.ZodArray<z.ZodString>;
|
|
133
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
134
|
+
}, z.core.$strict>>>;
|
|
135
|
+
ready: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
command: z.ZodArray<z.ZodString>;
|
|
138
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
139
|
+
}, z.core.$strict>>>;
|
|
140
|
+
teardown: z.ZodArray<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
command: z.ZodArray<z.ZodString>;
|
|
143
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
toolchain: z.ZodOptional<z.ZodObject<{
|
|
147
|
+
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
148
|
+
packageManagers: z.ZodDefault<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<".">, z.ZodString]>, z.ZodEnum<{
|
|
149
|
+
npm: "npm";
|
|
150
|
+
pnpm: "pnpm";
|
|
151
|
+
}>>>;
|
|
152
|
+
}, z.core.$strict>>;
|
|
153
|
+
protectedPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
154
|
+
generatedPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
155
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
runTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
roles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
158
|
+
runtime: z.ZodEnum<{
|
|
159
|
+
codex: "codex";
|
|
160
|
+
claude: "claude";
|
|
161
|
+
}>;
|
|
162
|
+
model: z.ZodOptional<z.ZodString>;
|
|
163
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
164
|
+
low: "low";
|
|
165
|
+
medium: "medium";
|
|
166
|
+
high: "high";
|
|
167
|
+
xhigh: "xhigh";
|
|
168
|
+
}>>;
|
|
169
|
+
toolProfile: z.ZodOptional<z.ZodString>;
|
|
170
|
+
writePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
171
|
+
reviewer: z.ZodOptional<z.ZodObject<{
|
|
172
|
+
runtime: z.ZodEnum<{
|
|
173
|
+
codex: "codex";
|
|
174
|
+
claude: "claude";
|
|
175
|
+
}>;
|
|
176
|
+
model: z.ZodOptional<z.ZodString>;
|
|
177
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
178
|
+
low: "low";
|
|
179
|
+
medium: "medium";
|
|
180
|
+
high: "high";
|
|
181
|
+
xhigh: "xhigh";
|
|
182
|
+
}>>;
|
|
183
|
+
toolProfile: z.ZodOptional<z.ZodString>;
|
|
184
|
+
}, z.core.$strict>>;
|
|
185
|
+
title: z.ZodOptional<z.ZodString>;
|
|
186
|
+
requiresContract: z.ZodOptional<z.ZodBoolean>;
|
|
187
|
+
}, z.core.$strict>>>;
|
|
188
|
+
contextPacks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
189
|
+
id: z.ZodString;
|
|
190
|
+
version: z.ZodString;
|
|
191
|
+
repositoryId: z.ZodOptional<z.ZodString>;
|
|
192
|
+
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
193
|
+
files: z.ZodArray<z.ZodString>;
|
|
194
|
+
references: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
195
|
+
}, z.core.$strict>>>;
|
|
196
|
+
}, z.core.$strict>;
|
|
197
|
+
export type StackProfile = z.infer<typeof stackProfileSchema>;
|
|
198
|
+
export declare const profileSourceSchema: z.ZodObject<{
|
|
199
|
+
repositoryId: z.ZodString;
|
|
200
|
+
path: z.ZodString;
|
|
201
|
+
}, z.core.$strict>;
|
|
202
|
+
/** Закрепление профиля: digest — по байтам листа (один файл) или по замыканию слоёв. */
|
|
203
|
+
export declare const profilePinSchema: z.ZodObject<{
|
|
204
|
+
id: z.ZodString;
|
|
205
|
+
version: z.ZodString;
|
|
206
|
+
digest: z.ZodString;
|
|
207
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
208
|
+
repositoryId: z.ZodString;
|
|
209
|
+
path: z.ZodString;
|
|
210
|
+
}, z.core.$strict>>;
|
|
211
|
+
}, z.core.$strict>;
|
|
212
|
+
export type ProfilePin = z.infer<typeof profilePinSchema>;
|
|
213
|
+
/** Разрешённый профиль: слои сложены, gates упорядочены и проверены. */
|
|
214
|
+
export declare const resolvedProfileSchema: z.ZodObject<{
|
|
215
|
+
id: z.ZodString;
|
|
216
|
+
version: z.ZodString;
|
|
217
|
+
digest: z.ZodString;
|
|
218
|
+
capabilities: z.ZodArray<z.ZodString>;
|
|
219
|
+
gates: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
220
|
+
kind: z.ZodLiteral<"test">;
|
|
221
|
+
report: z.ZodObject<{
|
|
222
|
+
type: z.ZodLiteral<"junit">;
|
|
223
|
+
path: z.ZodString;
|
|
224
|
+
}, z.core.$strict>;
|
|
225
|
+
id: z.ZodString;
|
|
226
|
+
command: z.ZodArray<z.ZodString>;
|
|
227
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
228
|
+
property: z.ZodOptional<z.ZodObject<{
|
|
229
|
+
path: z.ZodOptional<z.ZodString>;
|
|
230
|
+
}, z.core.$strict>>;
|
|
231
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
232
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
233
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
234
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
235
|
+
kind: z.ZodLiteral<"check">;
|
|
236
|
+
report: z.ZodOptional<z.ZodObject<{
|
|
237
|
+
type: z.ZodLiteral<"junit">;
|
|
238
|
+
path: z.ZodString;
|
|
239
|
+
}, z.core.$strict>>;
|
|
240
|
+
id: z.ZodString;
|
|
241
|
+
command: z.ZodArray<z.ZodString>;
|
|
242
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
243
|
+
property: z.ZodOptional<z.ZodObject<{
|
|
244
|
+
path: z.ZodOptional<z.ZodString>;
|
|
245
|
+
}, z.core.$strict>>;
|
|
246
|
+
dependsOn: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
247
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
248
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
249
|
+
}, z.core.$strict>], "kind">>;
|
|
250
|
+
prepare: z.ZodArray<z.ZodObject<{
|
|
251
|
+
id: z.ZodString;
|
|
252
|
+
command: z.ZodArray<z.ZodString>;
|
|
253
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
254
|
+
}, z.core.$strict>>;
|
|
255
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
inherit: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
257
|
+
values: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
258
|
+
secrets: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
259
|
+
}, z.core.$strict>>;
|
|
260
|
+
lifecycle: z.ZodOptional<z.ZodObject<{
|
|
261
|
+
setup: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
262
|
+
id: z.ZodString;
|
|
263
|
+
command: z.ZodArray<z.ZodString>;
|
|
264
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
265
|
+
}, z.core.$strict>>>;
|
|
266
|
+
ready: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
267
|
+
id: z.ZodString;
|
|
268
|
+
command: z.ZodArray<z.ZodString>;
|
|
269
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
270
|
+
}, z.core.$strict>>>;
|
|
271
|
+
teardown: z.ZodArray<z.ZodObject<{
|
|
272
|
+
id: z.ZodString;
|
|
273
|
+
command: z.ZodArray<z.ZodString>;
|
|
274
|
+
timeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
275
|
+
}, z.core.$strict>>;
|
|
276
|
+
}, z.core.$strict>>;
|
|
277
|
+
toolchain: z.ZodOptional<z.ZodObject<{
|
|
278
|
+
tools: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
279
|
+
packageManagers: z.ZodDefault<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<".">, z.ZodString]>, z.ZodEnum<{
|
|
280
|
+
npm: "npm";
|
|
281
|
+
pnpm: "pnpm";
|
|
282
|
+
}>>>;
|
|
283
|
+
}, z.core.$strict>>;
|
|
284
|
+
protectedPaths: z.ZodArray<z.ZodString>;
|
|
285
|
+
generatedPaths: z.ZodArray<z.ZodString>;
|
|
286
|
+
concurrency: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
runTimeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
288
|
+
roles: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
289
|
+
runtime: z.ZodEnum<{
|
|
290
|
+
codex: "codex";
|
|
291
|
+
claude: "claude";
|
|
292
|
+
}>;
|
|
293
|
+
model: z.ZodOptional<z.ZodString>;
|
|
294
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
295
|
+
low: "low";
|
|
296
|
+
medium: "medium";
|
|
297
|
+
high: "high";
|
|
298
|
+
xhigh: "xhigh";
|
|
299
|
+
}>>;
|
|
300
|
+
toolProfile: z.ZodOptional<z.ZodString>;
|
|
301
|
+
writePaths: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
302
|
+
reviewer: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
runtime: z.ZodEnum<{
|
|
304
|
+
codex: "codex";
|
|
305
|
+
claude: "claude";
|
|
306
|
+
}>;
|
|
307
|
+
model: z.ZodOptional<z.ZodString>;
|
|
308
|
+
effort: z.ZodOptional<z.ZodEnum<{
|
|
309
|
+
low: "low";
|
|
310
|
+
medium: "medium";
|
|
311
|
+
high: "high";
|
|
312
|
+
xhigh: "xhigh";
|
|
313
|
+
}>>;
|
|
314
|
+
toolProfile: z.ZodOptional<z.ZodString>;
|
|
315
|
+
}, z.core.$strict>>;
|
|
316
|
+
title: z.ZodOptional<z.ZodString>;
|
|
317
|
+
requiresContract: z.ZodOptional<z.ZodBoolean>;
|
|
318
|
+
}, z.core.$strict>>;
|
|
319
|
+
contextPacks: z.ZodArray<z.ZodObject<{
|
|
320
|
+
id: z.ZodString;
|
|
321
|
+
version: z.ZodString;
|
|
322
|
+
repositoryId: z.ZodOptional<z.ZodString>;
|
|
323
|
+
roles: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
324
|
+
files: z.ZodArray<z.ZodString>;
|
|
325
|
+
references: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
326
|
+
}, z.core.$strict>>;
|
|
327
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
repositoryId: z.ZodString;
|
|
329
|
+
path: z.ZodString;
|
|
330
|
+
}, z.core.$strict>>;
|
|
331
|
+
closure: z.ZodArray<z.ZodObject<{
|
|
332
|
+
ref: z.ZodString;
|
|
333
|
+
digest: z.ZodString;
|
|
334
|
+
}, z.core.$strict>>;
|
|
335
|
+
}, z.core.$strict>;
|
|
336
|
+
export type ResolvedProfile = z.infer<typeof resolvedProfileSchema>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { idSchema, relativePathSchema, roleIdSchema } from "./primitives.js";
|
|
3
|
+
import { environmentSchema, gateSchema, lifecycleSchema, stepSchema } from "./policy.js";
|
|
4
|
+
import { toolchainSchema } from "./toolchain.js";
|
|
5
|
+
/**
|
|
6
|
+
* Профиль стека — переносимый файл, из которого собирается описание
|
|
7
|
+
* репозитория в политике: gates, подготовка, окружение, lifecycle,
|
|
8
|
+
* защищённые пути, роли и инструкции стека. Профиль только описывает:
|
|
9
|
+
* разрешение читает манифесты и не исполняет ни одной команды проекта.
|
|
10
|
+
*
|
|
11
|
+
* Форма файла совпадает с профилями, которые уже закреплены у потребителей
|
|
12
|
+
* (их digest — sha256 байтов файла), поэтому встроенные профили переносятся
|
|
13
|
+
* побайтно.
|
|
14
|
+
*/
|
|
15
|
+
export const PROFILE_FILE_LIMIT = 131072;
|
|
16
|
+
export const PROFILE_FILES_LIMIT = 32;
|
|
17
|
+
export const PROFILE_DEPTH_LIMIT = 16;
|
|
18
|
+
const profileVersionSchema = z.string().regex(/^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?$/);
|
|
19
|
+
const profileRuntimeSchema = z.enum(['codex', 'claude']);
|
|
20
|
+
/** Привязка runtime в профиле: кто пишет или проверяет у роли. */
|
|
21
|
+
export const profileBindingSchema = z.strictObject({
|
|
22
|
+
runtime: profileRuntimeSchema,
|
|
23
|
+
model: z.string().min(1).max(200).optional(),
|
|
24
|
+
effort: z.enum(['low', 'medium', 'high', 'xhigh']).optional(),
|
|
25
|
+
toolProfile: idSchema.optional(),
|
|
26
|
+
});
|
|
27
|
+
/** Роль, которую требует поверхность стека. `title` — подпись для людей, harness её не читает. */
|
|
28
|
+
export const profileRoleSchema = profileBindingSchema.extend({
|
|
29
|
+
writePaths: z.array(relativePathSchema).min(1).optional(),
|
|
30
|
+
reviewer: profileBindingSchema.optional(),
|
|
31
|
+
title: z.string().trim().min(2).max(40).optional(),
|
|
32
|
+
requiresContract: z.boolean().optional(),
|
|
33
|
+
});
|
|
34
|
+
/**
|
|
35
|
+
* Инструкции стека: файлы, которые хост закрепляет как контекст ролей
|
|
36
|
+
* (`files` — вкладываются в запрос, `references` — только называются).
|
|
37
|
+
* Harness их не читает и не копирует: закреплять их — дело ContextSource.
|
|
38
|
+
*/
|
|
39
|
+
export const profileContextPackSchema = z.strictObject({
|
|
40
|
+
id: idSchema,
|
|
41
|
+
version: z.string().min(1).max(80),
|
|
42
|
+
repositoryId: idSchema.optional(),
|
|
43
|
+
roles: z.array(roleIdSchema).default([]),
|
|
44
|
+
files: z.array(relativePathSchema).min(1).max(30),
|
|
45
|
+
references: z.array(relativePathSchema).max(60).default([]),
|
|
46
|
+
});
|
|
47
|
+
/** Gate в профиле: та же форма, что в политике; отсутствие JUnit у test gate называется явно. */
|
|
48
|
+
export const profileGateSchema = z.strictObject({
|
|
49
|
+
id: idSchema,
|
|
50
|
+
kind: z.enum(['check', 'test']),
|
|
51
|
+
command: z.array(z.string().min(1)).min(1),
|
|
52
|
+
timeoutMs: z.number().positive().default(120000),
|
|
53
|
+
report: z.strictObject({ type: z.literal('junit'), path: relativePathSchema }).optional(),
|
|
54
|
+
property: z.strictObject({ path: relativePathSchema.optional() }).optional(),
|
|
55
|
+
dependsOn: z.array(idSchema).optional(),
|
|
56
|
+
cwd: relativePathSchema.optional(),
|
|
57
|
+
resources: z.array(idSchema).optional(),
|
|
58
|
+
});
|
|
59
|
+
export const stackProfileSchema = z.strictObject({
|
|
60
|
+
id: idSchema,
|
|
61
|
+
version: profileVersionSchema,
|
|
62
|
+
/** Встроенный ID или относительный `./file.json` внутри репозитория. */
|
|
63
|
+
extends: z.array(z.string().min(1)).max(PROFILE_DEPTH_LIMIT).default([]),
|
|
64
|
+
capabilities: z.array(z.string().min(1).max(100)).max(100).default([]),
|
|
65
|
+
gates: z.array(profileGateSchema).max(100).default([]),
|
|
66
|
+
prepare: z.array(stepSchema).max(100).default([]),
|
|
67
|
+
environment: environmentSchema.optional(),
|
|
68
|
+
lifecycle: lifecycleSchema.optional(),
|
|
69
|
+
/** Версии инструментов и выбор менеджера пакетов; слои объединяются без противоречий. */
|
|
70
|
+
toolchain: toolchainSchema.optional(),
|
|
71
|
+
protectedPaths: z.array(relativePathSchema).max(100).default([]),
|
|
72
|
+
generatedPaths: z.array(relativePathSchema).max(100).default([]),
|
|
73
|
+
concurrency: z.number().int().min(1).max(4).optional(),
|
|
74
|
+
/** Сколько времени стек отводит одной попытке; слои берут наибольший предел. */
|
|
75
|
+
runTimeoutMs: z.number().int().min(60_000).max(7_200_000).optional(),
|
|
76
|
+
roles: z.record(roleIdSchema, profileRoleSchema).default({}),
|
|
77
|
+
contextPacks: z.array(profileContextPackSchema).max(50).default([]),
|
|
78
|
+
});
|
|
79
|
+
export const profileSourceSchema = z.strictObject({
|
|
80
|
+
repositoryId: idSchema,
|
|
81
|
+
path: relativePathSchema,
|
|
82
|
+
});
|
|
83
|
+
/** Закрепление профиля: digest — по байтам листа (один файл) или по замыканию слоёв. */
|
|
84
|
+
export const profilePinSchema = z.strictObject({
|
|
85
|
+
id: idSchema,
|
|
86
|
+
version: profileVersionSchema,
|
|
87
|
+
digest: z.string().regex(/^[a-f0-9]{64}$/),
|
|
88
|
+
source: profileSourceSchema.optional(),
|
|
89
|
+
});
|
|
90
|
+
/** Разрешённый профиль: слои сложены, gates упорядочены и проверены. */
|
|
91
|
+
export const resolvedProfileSchema = z.strictObject({
|
|
92
|
+
id: idSchema,
|
|
93
|
+
version: profileVersionSchema,
|
|
94
|
+
digest: z.string().regex(/^[a-f0-9]{64}$/),
|
|
95
|
+
capabilities: z.array(z.string()),
|
|
96
|
+
gates: z.array(gateSchema),
|
|
97
|
+
prepare: z.array(stepSchema),
|
|
98
|
+
environment: environmentSchema.optional(),
|
|
99
|
+
lifecycle: lifecycleSchema.optional(),
|
|
100
|
+
toolchain: toolchainSchema.optional(),
|
|
101
|
+
protectedPaths: z.array(relativePathSchema),
|
|
102
|
+
generatedPaths: z.array(relativePathSchema),
|
|
103
|
+
concurrency: z.number().int().optional(),
|
|
104
|
+
runTimeoutMs: z.number().int().optional(),
|
|
105
|
+
roles: z.record(roleIdSchema, profileRoleSchema),
|
|
106
|
+
contextPacks: z.array(profileContextPackSchema),
|
|
107
|
+
source: profileSourceSchema.optional(),
|
|
108
|
+
closure: z.array(z.strictObject({ ref: z.string(), digest: z.string().regex(/^[a-f0-9]{64}$/) })),
|
|
109
|
+
});
|