@cleocode/core 2026.10.3 → 2026.10.5-rc.ci.672
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/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +7 -37
- package/dist/bootstrap.js.map +1 -1
- package/dist/build-provenance.json +2 -2
- package/dist/caamp/adapter.d.ts.map +1 -1
- package/dist/caamp/adapter.js +5 -2
- package/dist/caamp/adapter.js.map +1 -1
- package/dist/changesets/parse-frontmatter.d.ts +1 -1
- package/dist/changesets/parse-frontmatter.d.ts.map +1 -1
- package/dist/changesets/parse-frontmatter.js +2 -1
- package/dist/changesets/parse-frontmatter.js.map +1 -1
- package/dist/changesets/parser.d.ts +1 -1
- package/dist/changesets/parser.d.ts.map +1 -1
- package/dist/changesets/parser.js +2 -1
- package/dist/changesets/parser.js.map +1 -1
- package/dist/changesets/writer.d.ts +8 -1
- package/dist/changesets/writer.d.ts.map +1 -1
- package/dist/changesets/writer.js +56 -5
- package/dist/changesets/writer.js.map +1 -1
- package/dist/cloud/keys.d.ts +9 -0
- package/dist/cloud/keys.d.ts.map +1 -1
- package/dist/cloud/keys.js +11 -0
- package/dist/cloud/keys.js.map +1 -1
- package/dist/cloud/nexus-attach.d.ts +17 -0
- package/dist/cloud/nexus-attach.d.ts.map +1 -1
- package/dist/cloud/nexus-attach.js +30 -9
- package/dist/cloud/nexus-attach.js.map +1 -1
- package/dist/cloud/nexus-auth.d.ts +7 -1
- package/dist/cloud/nexus-auth.d.ts.map +1 -1
- package/dist/cloud/nexus-auth.js +7 -1
- package/dist/cloud/nexus-auth.js.map +1 -1
- package/dist/cloud/nexus-cloud-activity.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud-activity.js +2 -1
- package/dist/cloud/nexus-cloud-activity.js.map +1 -1
- package/dist/cloud/nexus-cloud-conflicts.d.ts +48 -0
- package/dist/cloud/nexus-cloud-conflicts.d.ts.map +1 -0
- package/dist/cloud/nexus-cloud-conflicts.js +68 -0
- package/dist/cloud/nexus-cloud-conflicts.js.map +1 -0
- package/dist/cloud/nexus-cloud-status.d.ts +42 -6
- package/dist/cloud/nexus-cloud-status.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud-status.js +233 -19
- package/dist/cloud/nexus-cloud-status.js.map +1 -1
- package/dist/cloud/nexus-cloud.d.ts +18 -1
- package/dist/cloud/nexus-cloud.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud.js +56 -2
- package/dist/cloud/nexus-cloud.js.map +1 -1
- package/dist/cloud/nexus-credentials.d.ts +1 -1
- package/dist/cloud/nexus-credentials.d.ts.map +1 -1
- package/dist/cloud/nexus-credentials.js +1 -1
- package/dist/cloud/nexus-credentials.js.map +1 -1
- package/dist/cloud/nexus-enrol.d.ts +10 -1
- package/dist/cloud/nexus-enrol.d.ts.map +1 -1
- package/dist/cloud/nexus-enrol.js +47 -3
- package/dist/cloud/nexus-enrol.js.map +1 -1
- package/dist/cloud/nexus-first-run.d.ts +146 -0
- package/dist/cloud/nexus-first-run.d.ts.map +1 -0
- package/dist/cloud/nexus-first-run.js +358 -0
- package/dist/cloud/nexus-first-run.js.map +1 -0
- package/dist/cloud/nexus-link.d.ts +35 -4
- package/dist/cloud/nexus-link.d.ts.map +1 -1
- package/dist/cloud/nexus-link.js +172 -7
- package/dist/cloud/nexus-link.js.map +1 -1
- package/dist/cloud/nexus-presence-refresh.d.ts +65 -0
- package/dist/cloud/nexus-presence-refresh.d.ts.map +1 -0
- package/dist/cloud/nexus-presence-refresh.js +122 -0
- package/dist/cloud/nexus-presence-refresh.js.map +1 -0
- package/dist/cloud/nexus-project-history.d.ts +54 -0
- package/dist/cloud/nexus-project-history.d.ts.map +1 -0
- package/dist/cloud/nexus-project-history.js +108 -0
- package/dist/cloud/nexus-project-history.js.map +1 -0
- package/dist/cloud/nexus-project-names.d.ts +173 -0
- package/dist/cloud/nexus-project-names.d.ts.map +1 -0
- package/dist/cloud/nexus-project-names.js +314 -0
- package/dist/cloud/nexus-project-names.js.map +1 -0
- package/dist/cloud/nexus-vault-keys.d.ts +33 -2
- package/dist/cloud/nexus-vault-keys.d.ts.map +1 -1
- package/dist/cloud/nexus-vault-keys.js +144 -18
- package/dist/cloud/nexus-vault-keys.js.map +1 -1
- package/dist/cloud/nexus-vault.d.ts +7 -3
- package/dist/cloud/nexus-vault.d.ts.map +1 -1
- package/dist/cloud/nexus-vault.js +176 -29
- package/dist/cloud/nexus-vault.js.map +1 -1
- package/dist/cloud/presence.d.ts +1 -1
- package/dist/cloud/presence.d.ts.map +1 -1
- package/dist/cloud/presence.js +1 -1
- package/dist/cloud/presence.js.map +1 -1
- package/dist/cloud/projects.d.ts +7 -4
- package/dist/cloud/projects.d.ts.map +1 -1
- package/dist/cloud/projects.js +10 -1
- package/dist/cloud/projects.js.map +1 -1
- package/dist/cloud/signing.d.ts +14 -0
- package/dist/cloud/signing.d.ts.map +1 -1
- package/dist/cloud/signing.js +9 -0
- package/dist/cloud/signing.js.map +1 -1
- package/dist/conduit/cloud-endpoint.d.ts +96 -0
- package/dist/conduit/cloud-endpoint.d.ts.map +1 -0
- package/dist/conduit/cloud-endpoint.js +191 -0
- package/dist/conduit/cloud-endpoint.js.map +1 -0
- package/dist/conduit/conduit-client.d.ts.map +1 -1
- package/dist/conduit/conduit-client.js +2 -1
- package/dist/conduit/conduit-client.js.map +1 -1
- package/dist/conduit/factory.d.ts +4 -0
- package/dist/conduit/factory.d.ts.map +1 -1
- package/dist/conduit/factory.js +7 -1
- package/dist/conduit/factory.js.map +1 -1
- package/dist/conduit/http-transport.d.ts +12 -7
- package/dist/conduit/http-transport.d.ts.map +1 -1
- package/dist/conduit/http-transport.js +18 -11
- package/dist/conduit/http-transport.js.map +1 -1
- package/dist/conduit/index.d.ts +3 -1
- package/dist/conduit/index.d.ts.map +1 -1
- package/dist/conduit/index.js +3 -1
- package/dist/conduit/index.js.map +1 -1
- package/dist/conduit/sse-transport.d.ts +5 -1
- package/dist/conduit/sse-transport.d.ts.map +1 -1
- package/dist/conduit/sse-transport.js +10 -2
- package/dist/conduit/sse-transport.js.map +1 -1
- package/dist/config/registry.js +1 -1
- package/dist/config/registry.js.map +1 -1
- package/dist/core-paths.d.ts +13 -0
- package/dist/core-paths.d.ts.map +1 -0
- package/dist/core-paths.js +13 -0
- package/dist/core-paths.js.map +1 -0
- package/dist/decide/bench/source.js +1 -1
- package/dist/decide/bench/source.js.map +1 -1
- package/dist/decide/client.d.ts +1 -1
- package/dist/decide/client.d.ts.map +1 -1
- package/dist/decide/client.js +1 -1
- package/dist/decide/client.js.map +1 -1
- package/dist/decide/credentials.d.ts +1 -1
- package/dist/decide/credentials.d.ts.map +1 -1
- package/dist/decide/credentials.js +1 -1
- package/dist/decide/credentials.js.map +1 -1
- package/dist/decide/jev-wire.d.ts +1 -1
- package/dist/decide/jev-wire.d.ts.map +1 -1
- package/dist/decide/jev-wire.js +1 -1
- package/dist/decide/jev-wire.js.map +1 -1
- package/dist/decide/operations.d.ts +1 -1
- package/dist/decide/operations.d.ts.map +1 -1
- package/dist/decide/operations.js +1 -1
- package/dist/decide/operations.js.map +1 -1
- package/dist/decide/providers.d.ts +1 -1
- package/dist/decide/providers.d.ts.map +1 -1
- package/dist/decide/providers.js +1 -1
- package/dist/decide/providers.js.map +1 -1
- package/dist/decide/wizard.d.ts.map +1 -1
- package/dist/decide/wizard.js +1 -1
- package/dist/decide/wizard.js.map +1 -1
- package/dist/dispatch/config-domain-handler.d.ts +1 -1
- package/dist/dispatch/config-domain-handler.d.ts.map +1 -1
- package/dist/dispatch/config-domain-handler.js +1 -1
- package/dist/dispatch/config-domain-handler.js.map +1 -1
- package/dist/dispatch/contracts/derive-output-contract.d.ts +1 -1
- package/dist/dispatch/contracts/derive-output-contract.d.ts.map +1 -1
- package/dist/dispatch/contracts/derive-output-contract.js +2 -1
- package/dist/dispatch/contracts/derive-output-contract.js.map +1 -1
- package/dist/dispatch/contracts/ensures-schema.d.ts +1 -1
- package/dist/dispatch/contracts/ensures-schema.d.ts.map +1 -1
- package/dist/dispatch/contracts/ensures-schema.js +1 -1
- package/dist/dispatch/contracts/ensures-schema.js.map +1 -1
- package/dist/dispatch/contracts/input-contracts.d.ts +1 -1
- package/dist/dispatch/contracts/input-contracts.d.ts.map +1 -1
- package/dist/dispatch/contracts/input-contracts.js +3 -1
- package/dist/dispatch/contracts/input-contracts.js.map +1 -1
- package/dist/dispatch/contracts/output-contracts.d.ts +2 -1
- package/dist/dispatch/contracts/output-contracts.d.ts.map +1 -1
- package/dist/dispatch/contracts/output-contracts.js +1 -1
- package/dist/dispatch/contracts/output-contracts.js.map +1 -1
- package/dist/dispatch/describe-operation.d.ts +1 -1
- package/dist/dispatch/describe-operation.d.ts.map +1 -1
- package/dist/dispatch/describe-operation.js +1 -1
- package/dist/dispatch/describe-operation.js.map +1 -1
- package/dist/dispatch/mvi-projection.d.ts +1 -1
- package/dist/dispatch/mvi-projection.d.ts.map +1 -1
- package/dist/dispatch/mvi-projection.js +1 -1
- package/dist/dispatch/mvi-projection.js.map +1 -1
- package/dist/docs/display-alias.js +1 -1
- package/dist/docs/display-alias.js.map +1 -1
- package/dist/docs/docs-update.d.ts +1 -1
- package/dist/docs/docs-update.d.ts.map +1 -1
- package/dist/docs/docs-update.js +2 -1
- package/dist/docs/docs-update.js.map +1 -1
- package/dist/docs/export-document.js +14 -58410
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/publish-pr.js +1 -1
- package/dist/docs/publish-pr.js.map +1 -1
- package/dist/docs/supersede.js +1 -1
- package/dist/docs/supersede.js.map +1 -1
- package/dist/docs/validate-body.d.ts +1 -1
- package/dist/docs/validate-body.d.ts.map +1 -1
- package/dist/docs/validate-body.js +1 -1
- package/dist/docs/validate-body.js.map +1 -1
- package/dist/docs/writer-registry.js +1 -1
- package/dist/docs/writer-registry.js.map +1 -1
- package/dist/doctor/acceptance-drift.js +1 -1
- package/dist/doctor/acceptance-drift.js.map +1 -1
- package/dist/doctor/db-substrate.d.ts +7 -10
- package/dist/doctor/db-substrate.d.ts.map +1 -1
- package/dist/doctor/db-substrate.js +11 -15
- package/dist/doctor/db-substrate.js.map +1 -1
- package/dist/doctor/invariant-audit.js +1 -1
- package/dist/doctor/invariant-audit.js.map +1 -1
- package/dist/doctor/malformed-task-ids.js +1 -1
- package/dist/doctor/malformed-task-ids.js.map +1 -1
- package/dist/doctor/migrations.d.ts +18 -0
- package/dist/doctor/migrations.d.ts.map +1 -1
- package/dist/doctor/migrations.js +54 -2
- package/dist/doctor/migrations.js.map +1 -1
- package/dist/doctor/row-identity-refill.d.ts +43 -0
- package/dist/doctor/row-identity-refill.d.ts.map +1 -0
- package/dist/doctor/row-identity-refill.js +186 -0
- package/dist/doctor/row-identity-refill.js.map +1 -0
- package/dist/doctor/superseded-store.d.ts.map +1 -1
- package/dist/doctor/superseded-store.js +51 -2
- package/dist/doctor/superseded-store.js.map +1 -1
- package/dist/doctor/sync-repair.d.ts +39 -0
- package/dist/doctor/sync-repair.d.ts.map +1 -0
- package/dist/doctor/sync-repair.js +71 -0
- package/dist/doctor/sync-repair.js.map +1 -0
- package/dist/doctor/sync-triggers.d.ts +63 -4
- package/dist/doctor/sync-triggers.d.ts.map +1 -1
- package/dist/doctor/sync-triggers.js +352 -9
- package/dist/doctor/sync-triggers.js.map +1 -1
- package/dist/doctor/twin-collapse.js +1 -1
- package/dist/doctor/twin-collapse.js.map +1 -1
- package/dist/engine/engine-ops.d.ts.map +1 -1
- package/dist/engine/engine-ops.js +7 -1
- package/dist/engine/engine-ops.js.map +1 -1
- package/dist/engine-result.d.ts +1 -1
- package/dist/engine-result.d.ts.map +1 -1
- package/dist/engine-result.js +1 -1
- package/dist/engine-result.js.map +1 -1
- package/dist/error-catalog.js +1 -1
- package/dist/error-catalog.js.map +1 -1
- package/dist/error-registry.d.ts +1 -1
- package/dist/error-registry.d.ts.map +1 -1
- package/dist/error-registry.js +1 -1
- package/dist/error-registry.js.map +1 -1
- package/dist/errors-to-engine.d.ts +20 -0
- package/dist/errors-to-engine.d.ts.map +1 -1
- package/dist/errors-to-engine.js +37 -0
- package/dist/errors-to-engine.js.map +1 -1
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/gc/janitor.d.ts +23 -4
- package/dist/gc/janitor.d.ts.map +1 -1
- package/dist/gc/janitor.js +71 -11
- package/dist/gc/janitor.js.map +1 -1
- package/dist/goal/continuation.d.ts +1 -1
- package/dist/goal/continuation.d.ts.map +1 -1
- package/dist/goal/continuation.js +1 -1
- package/dist/goal/continuation.js.map +1 -1
- package/dist/goal/judge.d.ts.map +1 -1
- package/dist/goal/judge.js +2 -1
- package/dist/goal/judge.js.map +1 -1
- package/dist/hooks/handlers/session-hooks.d.ts.map +1 -1
- package/dist/hooks/handlers/session-hooks.js +1 -1
- package/dist/hooks/handlers/session-hooks.js.map +1 -1
- package/dist/init/engine-ops.js +1 -1
- package/dist/init/engine-ops.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +22 -37
- package/dist/init.js.map +1 -1
- package/dist/inject/index.js +1 -1
- package/dist/inject/index.js.map +1 -1
- package/dist/injection.d.ts.map +1 -1
- package/dist/injection.js +13 -0
- package/dist/injection.js.map +1 -1
- package/dist/internal.d.ts +4 -3
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +7 -4
- package/dist/internal.js.map +1 -1
- package/dist/issue/create.js +1 -1
- package/dist/issue/create.js.map +1 -1
- package/dist/json-schema-validator.js +1 -1
- package/dist/json-schema-validator.js.map +1 -1
- package/dist/lifecycle/index.d.ts +2 -23
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/index.js +5 -112
- package/dist/lifecycle/index.js.map +1 -1
- package/dist/lifecycle/kind-requirements.d.ts +1 -1
- package/dist/lifecycle/kind-requirements.d.ts.map +1 -1
- package/dist/lifecycle/kind-requirements.js +1 -1
- package/dist/lifecycle/kind-requirements.js.map +1 -1
- package/dist/lifecycle/pipeline.js +1 -1
- package/dist/lifecycle/pipeline.js.map +1 -1
- package/dist/lifecycle/resume.js +2 -2
- package/dist/lifecycle/resume.js.map +1 -1
- package/dist/lifecycle/state-machine.js +1 -1
- package/dist/lifecycle/state-machine.js.map +1 -1
- package/dist/lifecycle/status.d.ts +46 -0
- package/dist/lifecycle/status.d.ts.map +1 -0
- package/dist/lifecycle/status.js +147 -0
- package/dist/lifecycle/status.js.map +1 -0
- package/dist/lifecycle/verification/satisfies-validator.js +1 -1
- package/dist/lifecycle/verification/satisfies-validator.js.map +1 -1
- package/dist/llm/catalog-seeder.d.ts +1 -1
- package/dist/llm/catalog-seeder.d.ts.map +1 -1
- package/dist/llm/catalog-seeder.js +1 -1
- package/dist/llm/catalog-seeder.js.map +1 -1
- package/dist/llm/cli-ops.d.ts +1 -2
- package/dist/llm/cli-ops.d.ts.map +1 -1
- package/dist/llm/cli-ops.js +2 -1
- package/dist/llm/cli-ops.js.map +1 -1
- package/dist/llm/conversation.d.ts.map +1 -1
- package/dist/llm/conversation.js +15 -4
- package/dist/llm/conversation.js.map +1 -1
- package/dist/llm/credential-seeders/claude-code-seeder.js +1 -1
- package/dist/llm/credential-seeders/claude-code-seeder.js.map +1 -1
- package/dist/llm/credential-seeders/cleo-pkce-seeder.js +1 -1
- package/dist/llm/credential-seeders/cleo-pkce-seeder.js.map +1 -1
- package/dist/llm/credential-writeback.js +1 -1
- package/dist/llm/credential-writeback.js.map +1 -1
- package/dist/llm/entity-ops.d.ts +1 -1
- package/dist/llm/entity-ops.d.ts.map +1 -1
- package/dist/llm/entity-ops.js +2 -1
- package/dist/llm/entity-ops.js.map +1 -1
- package/dist/llm/llm-queue-admit.d.ts +1 -1
- package/dist/llm/llm-queue-admit.d.ts.map +1 -1
- package/dist/llm/llm-queue-admit.js +2 -1
- package/dist/llm/llm-queue-admit.js.map +1 -1
- package/dist/llm/onboarding/login-engine.js +1 -1
- package/dist/llm/onboarding/login-engine.js.map +1 -1
- package/dist/llm/pi/pi-errors.d.ts +1 -1
- package/dist/llm/pi/pi-errors.d.ts.map +1 -1
- package/dist/llm/pi/pi-errors.js +1 -1
- package/dist/llm/pi/pi-errors.js.map +1 -1
- package/dist/llm/plugin-facade.d.ts.map +1 -1
- package/dist/llm/plugin-facade.js +14 -93651
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/llm/system-key.d.ts +1 -1
- package/dist/llm/system-key.d.ts.map +1 -1
- package/dist/llm/system-key.js +1 -1
- package/dist/llm/system-key.js.map +1 -1
- package/dist/llm/system-of-use-registry.d.ts +1 -1
- package/dist/llm/system-of-use-registry.d.ts.map +1 -1
- package/dist/llm/system-of-use-registry.js +1 -1
- package/dist/llm/system-of-use-registry.js.map +1 -1
- package/dist/llm/system-resolver.js +1 -1
- package/dist/llm/system-resolver.js.map +1 -1
- package/dist/llm/transports/bedrock.d.ts +1 -0
- package/dist/llm/transports/bedrock.d.ts.map +1 -1
- package/dist/llm/transports/bedrock.js +30 -12
- package/dist/llm/transports/bedrock.js.map +1 -1
- package/dist/memory/brain-host.d.ts +71 -0
- package/dist/memory/brain-host.d.ts.map +1 -0
- package/dist/memory/brain-host.js +84 -0
- package/dist/memory/brain-host.js.map +1 -0
- package/dist/memory/brain-writer-handlers.d.ts.map +1 -1
- package/dist/memory/brain-writer-handlers.js +24 -7
- package/dist/memory/brain-writer-handlers.js.map +1 -1
- package/dist/memory/brain-writer-thread.d.ts +66 -6
- package/dist/memory/brain-writer-thread.d.ts.map +1 -1
- package/dist/memory/brain-writer-thread.js +67 -10
- package/dist/memory/brain-writer-thread.js.map +1 -1
- package/dist/memory/brain-writer-worker.js +7 -0
- package/dist/memory/brain-writer-worker.js.map +1 -1
- package/dist/memory/decision-contradiction.d.ts.map +1 -1
- package/dist/memory/decision-contradiction.js +10 -5
- package/dist/memory/decision-contradiction.js.map +1 -1
- package/dist/memory/decisions.js +2 -1
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/dialectic-evaluator.d.ts.map +1 -1
- package/dist/memory/dialectic-evaluator.js +4 -1
- package/dist/memory/dialectic-evaluator.js.map +1 -1
- package/dist/memory/embedding-backfill.d.ts +70 -0
- package/dist/memory/embedding-backfill.d.ts.map +1 -0
- package/dist/memory/embedding-backfill.js +110 -0
- package/dist/memory/embedding-backfill.js.map +1 -0
- package/dist/memory/index.js +1 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/manifest-identity.js +1 -1
- package/dist/memory/manifest-identity.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts +23 -0
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +82 -36
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/memory/transcript-extractor.d.ts.map +1 -1
- package/dist/memory/transcript-extractor.js +3 -2
- package/dist/memory/transcript-extractor.js.map +1 -1
- package/dist/metrics/model-provider-registry.d.ts.map +1 -1
- package/dist/metrics/model-provider-registry.js +6 -0
- package/dist/metrics/model-provider-registry.js.map +1 -1
- package/dist/metrics/token-service.d.ts +33 -0
- package/dist/metrics/token-service.d.ts.map +1 -1
- package/dist/metrics/token-service.js +35 -0
- package/dist/metrics/token-service.js.map +1 -1
- package/dist/migration/index.js +1 -1
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/manual/T10165-backfill-adr-index.js +1 -1
- package/dist/migration/manual/T10165-backfill-adr-index.js.map +1 -1
- package/dist/nexus/api-contracts.d.ts.map +1 -1
- package/dist/nexus/api-contracts.js +27 -11
- package/dist/nexus/api-contracts.js.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.d.ts +2 -2
- package/dist/nexus/api-extractors/http-extractor.d.ts.map +1 -1
- package/dist/nexus/api-extractors/http-extractor.js +3 -3
- package/dist/nexus/api-extractors/http-extractor.js.map +1 -1
- package/dist/nexus/assessment-projection.d.ts +1 -1
- package/dist/nexus/assessment-projection.d.ts.map +1 -1
- package/dist/nexus/assessment-projection.js +1 -1
- package/dist/nexus/assessment-projection.js.map +1 -1
- package/dist/nexus/clusters.js +1 -1
- package/dist/nexus/clusters.js.map +1 -1
- package/dist/nexus/deps.d.ts +1 -1
- package/dist/nexus/deps.d.ts.map +1 -1
- package/dist/nexus/deps.js +1 -1
- package/dist/nexus/deps.js.map +1 -1
- package/dist/nexus/diff.d.ts +1 -1
- package/dist/nexus/diff.d.ts.map +1 -1
- package/dist/nexus/diff.js +3 -2
- package/dist/nexus/diff.js.map +1 -1
- package/dist/nexus/fleet-status.d.ts +1 -1
- package/dist/nexus/fleet-status.d.ts.map +1 -1
- package/dist/nexus/fleet-status.js +1 -1
- package/dist/nexus/fleet-status.js.map +1 -1
- package/dist/nexus/flows.js +1 -1
- package/dist/nexus/flows.js.map +1 -1
- package/dist/nexus/identity.d.ts +8 -0
- package/dist/nexus/identity.d.ts.map +1 -1
- package/dist/nexus/identity.js +17 -1
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/index.d.ts +1 -1
- package/dist/nexus/index.d.ts.map +1 -1
- package/dist/nexus/index.js +2 -2
- package/dist/nexus/index.js.map +1 -1
- package/dist/nexus/nexus-bridge.d.ts.map +1 -1
- package/dist/nexus/nexus-bridge.js +5 -5
- package/dist/nexus/nexus-bridge.js.map +1 -1
- package/dist/nexus/permissions.d.ts +1 -1
- package/dist/nexus/permissions.d.ts.map +1 -1
- package/dist/nexus/permissions.js +1 -1
- package/dist/nexus/permissions.js.map +1 -1
- package/dist/nexus/query-dsl.js +1 -1
- package/dist/nexus/query-dsl.js.map +1 -1
- package/dist/nexus/query.d.ts +1 -2
- package/dist/nexus/query.d.ts.map +1 -1
- package/dist/nexus/query.js +1 -1
- package/dist/nexus/query.js.map +1 -1
- package/dist/nexus/registry-errors.js +1 -1
- package/dist/nexus/registry-errors.js.map +1 -1
- package/dist/nexus/registry.d.ts +23 -1
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +77 -2
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/workspace.js +1 -1
- package/dist/nexus/workspace.js.map +1 -1
- package/dist/orchestrate/pivot.d.ts.map +1 -1
- package/dist/orchestrate/pivot.js +2 -1
- package/dist/orchestrate/pivot.js.map +1 -1
- package/dist/orchestrate/query-ops.js +1 -1
- package/dist/orchestrate/query-ops.js.map +1 -1
- package/dist/orchestrate/spawn-ops.js +1 -1
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/atomicity.d.ts +1 -1
- package/dist/orchestration/atomicity.d.ts.map +1 -1
- package/dist/orchestration/atomicity.js +1 -1
- package/dist/orchestration/atomicity.js.map +1 -1
- package/dist/orchestration/classify.js +1 -1
- package/dist/orchestration/classify.js.map +1 -1
- package/dist/orchestration/index.js +1 -1
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/parallel.js +1 -1
- package/dist/orchestration/parallel.js.map +1 -1
- package/dist/orchestration/protocol-validators.d.ts +1 -1
- package/dist/orchestration/protocol-validators.d.ts.map +1 -1
- package/dist/orchestration/protocol-validators.js +1 -1
- package/dist/orchestration/protocol-validators.js.map +1 -1
- package/dist/orchestration/skill-ops.js +1 -1
- package/dist/orchestration/skill-ops.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts +9 -0
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +13 -2
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/orchestration/spawn.js +1 -1
- package/dist/orchestration/spawn.js.map +1 -1
- package/dist/paths.d.ts +3 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +4 -2
- package/dist/paths.js.map +1 -1
- package/dist/phases/deps.js +1 -1
- package/dist/phases/deps.js.map +1 -1
- package/dist/phases/index.js +1 -1
- package/dist/phases/index.js.map +1 -1
- package/dist/project-lifecycle.js +3 -3
- package/dist/project-lifecycle.js.map +1 -1
- package/dist/project-scope.js +1 -1
- package/dist/project-scope.js.map +1 -1
- package/dist/project-tombstone.js +1 -1
- package/dist/project-tombstone.js.map +1 -1
- package/dist/registrations.d.ts +30 -0
- package/dist/registrations.d.ts.map +1 -0
- package/dist/registrations.js +30 -0
- package/dist/registrations.js.map +1 -0
- package/dist/release/changesets-aggregator.js +1 -1
- package/dist/release/changesets-aggregator.js.map +1 -1
- package/dist/release/ci-evidence.d.ts +68 -2
- package/dist/release/ci-evidence.d.ts.map +1 -1
- package/dist/release/ci-evidence.js +203 -39
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/release/invariants/archive-reason-invariant.d.ts +1 -1
- package/dist/release/invariants/archive-reason-invariant.d.ts.map +1 -1
- package/dist/release/invariants/archive-reason-invariant.js +1 -1
- package/dist/release/invariants/archive-reason-invariant.js.map +1 -1
- package/dist/release/invariants/registry.d.ts +1 -1
- package/dist/release/invariants/registry.d.ts.map +1 -1
- package/dist/release/invariants/registry.js +1 -1
- package/dist/release/invariants/registry.js.map +1 -1
- package/dist/release/open.d.ts +4 -7
- package/dist/release/open.d.ts.map +1 -1
- package/dist/release/open.js +62 -24
- package/dist/release/open.js.map +1 -1
- package/dist/release/plan.d.ts +1 -2
- package/dist/release/plan.d.ts.map +1 -1
- package/dist/release/plan.js +4 -1
- package/dist/release/plan.js.map +1 -1
- package/dist/release/pr-evidence.d.ts +1 -1
- package/dist/release/pr-evidence.d.ts.map +1 -1
- package/dist/release/pr-evidence.js +2 -2
- package/dist/release/pr-evidence.js.map +1 -1
- package/dist/release/preflight-skip.d.ts +74 -10
- package/dist/release/preflight-skip.d.ts.map +1 -1
- package/dist/release/preflight-skip.js +254 -47
- package/dist/release/preflight-skip.js.map +1 -1
- package/dist/release/reconcile.d.ts +1 -1
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +19 -3
- package/dist/release/reconcile.js.map +1 -1
- package/dist/release/version-bump.d.ts +1 -1
- package/dist/release/version-bump.d.ts.map +1 -1
- package/dist/release/version-bump.js +1 -1
- package/dist/release/version-bump.js.map +1 -1
- package/dist/render/colors.js +1 -19
- package/dist/render/colors.js.map +1 -1
- package/dist/render/tasks/colors.js +1 -1
- package/dist/render/tasks/colors.js.map +1 -1
- package/dist/resources/admission-ledger.d.ts +587 -0
- package/dist/resources/admission-ledger.d.ts.map +1 -0
- package/dist/resources/admission-ledger.js +1401 -0
- package/dist/resources/admission-ledger.js.map +1 -0
- package/dist/resources/backend.d.ts +37 -1
- package/dist/resources/backend.d.ts.map +1 -1
- package/dist/resources/backend.js +1 -1
- package/dist/resources/darwin-backend.d.ts +152 -26
- package/dist/resources/darwin-backend.d.ts.map +1 -1
- package/dist/resources/darwin-backend.js +217 -34
- package/dist/resources/darwin-backend.js.map +1 -1
- package/dist/resources/governor.d.ts +36 -27
- package/dist/resources/governor.d.ts.map +1 -1
- package/dist/resources/governor.js +144 -49
- package/dist/resources/governor.js.map +1 -1
- package/dist/resources/heavy-command-hook-delivery.d.ts +144 -0
- package/dist/resources/heavy-command-hook-delivery.d.ts.map +1 -0
- package/dist/resources/heavy-command-hook-delivery.js +204 -0
- package/dist/resources/heavy-command-hook-delivery.js.map +1 -0
- package/dist/resources/heavy-command.d.ts +69 -0
- package/dist/resources/heavy-command.d.ts.map +1 -1
- package/dist/resources/heavy-command.js +479 -7
- package/dist/resources/heavy-command.js.map +1 -1
- package/dist/resources/pressure-gate.d.ts +148 -0
- package/dist/resources/pressure-gate.d.ts.map +1 -0
- package/dist/resources/pressure-gate.js +273 -0
- package/dist/resources/pressure-gate.js.map +1 -0
- package/dist/resources/run-admission.d.ts +33 -45
- package/dist/resources/run-admission.d.ts.map +1 -1
- package/dist/resources/run-admission.js +50 -118
- package/dist/resources/run-admission.js.map +1 -1
- package/dist/resources/run-class.d.ts +60 -4
- package/dist/resources/run-class.d.ts.map +1 -1
- package/dist/resources/run-class.js +474 -6
- package/dist/resources/run-class.js.map +1 -1
- package/dist/resources/run-governed.d.ts +43 -11
- package/dist/resources/run-governed.d.ts.map +1 -1
- package/dist/resources/run-governed.js +139 -99
- package/dist/resources/run-governed.js.map +1 -1
- package/dist/resources/slot-holder.d.ts +12 -4
- package/dist/resources/slot-holder.d.ts.map +1 -1
- package/dist/resources/slot-holder.js +19 -14
- package/dist/resources/slot-holder.js.map +1 -1
- package/dist/resources/spawn-wrapper.js +1 -1
- package/dist/resources/spawn-wrapper.js.map +1 -1
- package/dist/resources/supervisor-admit.d.ts +1 -1
- package/dist/resources/supervisor-admit.d.ts.map +1 -1
- package/dist/resources/supervisor-admit.js +2 -1
- package/dist/resources/supervisor-admit.js.map +1 -1
- package/dist/routing/build-command-groups.d.ts +1 -1
- package/dist/routing/build-command-groups.d.ts.map +1 -1
- package/dist/routing/build-command-groups.js +4 -1
- package/dist/routing/build-command-groups.js.map +1 -1
- package/dist/runtime/openapi/generate-openapi.d.ts +1 -1
- package/dist/runtime/openapi/generate-openapi.d.ts.map +1 -1
- package/dist/runtime/openapi/generate-openapi.js +1 -1
- package/dist/runtime/openapi/generate-openapi.js.map +1 -1
- package/dist/sagas/index.d.ts +3 -1
- package/dist/sagas/index.d.ts.map +1 -1
- package/dist/sagas/index.js +2 -5
- package/dist/sagas/index.js.map +1 -1
- package/dist/scaffold/ensure-skills.d.ts.map +1 -1
- package/dist/scaffold/ensure-skills.js +58 -2
- package/dist/scaffold/ensure-skills.js.map +1 -1
- package/dist/scaffold/project-identity.js +1 -1
- package/dist/scaffold/project-identity.js.map +1 -1
- package/dist/sdk/validator-attest.d.ts +1 -1
- package/dist/sdk/validator-attest.d.ts.map +1 -1
- package/dist/sdk/validator-attest.js +1 -1
- package/dist/sdk/validator-attest.js.map +1 -1
- package/dist/sdk/validator-reject.d.ts +1 -1
- package/dist/sdk/validator-reject.d.ts.map +1 -1
- package/dist/sdk/validator-reject.js +1 -1
- package/dist/sdk/validator-reject.js.map +1 -1
- package/dist/security/input-sanitization.js +2 -1
- package/dist/security/input-sanitization.js.map +1 -1
- package/dist/security/override-cap.js +1 -1
- package/dist/security/override-cap.js.map +1 -1
- package/dist/security/owner-override-auth.js +1 -1
- package/dist/security/owner-override-auth.js.map +1 -1
- package/dist/security/shared-evidence-tracker.js +1 -1
- package/dist/security/shared-evidence-tracker.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +35 -93136
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sentient/daemon.d.ts.map +1 -1
- package/dist/sentient/daemon.js +3 -0
- package/dist/sentient/daemon.js.map +1 -1
- package/dist/sentient/tick.d.ts +7 -0
- package/dist/sentient/tick.d.ts.map +1 -1
- package/dist/sentient/tick.js +11 -0
- package/dist/sentient/tick.js.map +1 -1
- package/dist/sequence/index.js +1 -1
- package/dist/sequence/index.js.map +1 -1
- package/dist/session/engine-ops.d.ts +3 -45
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +63 -112
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/session/status-op.d.ts +40 -0
- package/dist/session/status-op.d.ts.map +1 -0
- package/dist/session/status-op.js +71 -0
- package/dist/session/status-op.js.map +1 -0
- package/dist/session/task-current.d.ts +31 -0
- package/dist/session/task-current.d.ts.map +1 -0
- package/dist/session/task-current.js +59 -0
- package/dist/session/task-current.js.map +1 -0
- package/dist/sessions/assumptions.d.ts +1 -1
- package/dist/sessions/assumptions.d.ts.map +1 -1
- package/dist/sessions/assumptions.js +1 -1
- package/dist/sessions/assumptions.js.map +1 -1
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +11 -0
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/context-inject.js +1 -1
- package/dist/sessions/context-inject.js.map +1 -1
- package/dist/sessions/decisions.d.ts +1 -1
- package/dist/sessions/decisions.d.ts.map +1 -1
- package/dist/sessions/decisions.js +1 -1
- package/dist/sessions/decisions.js.map +1 -1
- package/dist/sessions/focus-state-store.d.ts.map +1 -1
- package/dist/sessions/focus-state-store.js +2 -1
- package/dist/sessions/focus-state-store.js.map +1 -1
- package/dist/sessions/handoff.js +1 -1
- package/dist/sessions/handoff.js.map +1 -1
- package/dist/sessions/index.d.ts +1 -2
- package/dist/sessions/index.d.ts.map +1 -1
- package/dist/sessions/index.js +3 -2
- package/dist/sessions/index.js.map +1 -1
- package/dist/sessions/session-drift.js +1 -1
- package/dist/sessions/session-drift.js.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.d.ts +4 -0
- package/dist/sessions/session-end-snapshot-entry.d.ts.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.js +11 -0
- package/dist/sessions/session-end-snapshot-entry.js.map +1 -1
- package/dist/sessions/session-end-snapshot.d.ts.map +1 -1
- package/dist/sessions/session-end-snapshot.js +4 -0
- package/dist/sessions/session-end-snapshot.js.map +1 -1
- package/dist/sessions/session-enforcement.js +1 -1
- package/dist/sessions/session-enforcement.js.map +1 -1
- package/dist/sessions/session-show.d.ts +1 -2
- package/dist/sessions/session-show.d.ts.map +1 -1
- package/dist/sessions/session-show.js +1 -1
- package/dist/sessions/session-show.js.map +1 -1
- package/dist/sessions/session-stats.js +1 -1
- package/dist/sessions/session-stats.js.map +1 -1
- package/dist/sessions/session-suspend.d.ts +1 -2
- package/dist/sessions/session-suspend.d.ts.map +1 -1
- package/dist/sessions/session-suspend.js +1 -1
- package/dist/sessions/session-suspend.js.map +1 -1
- package/dist/sessions/session-switch.js +1 -1
- package/dist/sessions/session-switch.js.map +1 -1
- package/dist/sessions/snapshot.js +1 -1
- package/dist/sessions/snapshot.js.map +1 -1
- package/dist/sessions/terminal-identity.d.ts +1 -1
- package/dist/sessions/terminal-identity.d.ts.map +1 -1
- package/dist/sessions/terminal-identity.js +1 -1
- package/dist/sessions/terminal-identity.js.map +1 -1
- package/dist/setup/sections/integrations.d.ts.map +1 -1
- package/dist/setup/sections/integrations.js +9 -0
- package/dist/setup/sections/integrations.js.map +1 -1
- package/dist/setup/sections/models-roles.js +1 -1
- package/dist/setup/sections/models-roles.js.map +1 -1
- package/dist/setup/sections/verification.d.ts.map +1 -1
- package/dist/setup/sections/verification.js +8 -2
- package/dist/setup/sections/verification.js.map +1 -1
- package/dist/shutdown.d.ts +24 -0
- package/dist/shutdown.d.ts.map +1 -1
- package/dist/shutdown.js +30 -1
- package/dist/shutdown.js.map +1 -1
- package/dist/skills/agents/install.d.ts +46 -6
- package/dist/skills/agents/install.d.ts.map +1 -1
- package/dist/skills/agents/install.js +86 -17
- package/dist/skills/agents/install.js.map +1 -1
- package/dist/skills/injection/subagent.js +1 -1
- package/dist/skills/injection/subagent.js.map +1 -1
- package/dist/skills/manifests/research.d.ts.map +1 -1
- package/dist/skills/manifests/research.js +2 -1
- package/dist/skills/manifests/research.js.map +1 -1
- package/dist/skills/orchestrator/spawn.js +1 -1
- package/dist/skills/orchestrator/spawn.js.map +1 -1
- package/dist/skills/orchestrator/validator.js +1 -1
- package/dist/skills/orchestrator/validator.js.map +1 -1
- package/dist/snapshot/index.d.ts.map +1 -1
- package/dist/snapshot/index.js +13 -0
- package/dist/snapshot/index.js.map +1 -1
- package/dist/spawn/agent-identity.js +1 -1
- package/dist/spawn/agent-identity.js.map +1 -1
- package/dist/stats/index.d.ts.map +1 -1
- package/dist/stats/index.js +2 -1
- package/dist/stats/index.js.map +1 -1
- package/dist/store/agent-install.d.ts.map +1 -1
- package/dist/store/agent-install.js +2 -1
- package/dist/store/agent-install.js.map +1 -1
- package/dist/store/agent-registry-accessor.d.ts +1 -0
- package/dist/store/agent-registry-accessor.d.ts.map +1 -1
- package/dist/store/agent-registry-accessor.js +3 -1
- package/dist/store/agent-registry-accessor.js.map +1 -1
- package/dist/store/atomic.js +1 -1
- package/dist/store/atomic.js.map +1 -1
- package/dist/store/attachment-store.js +1 -1
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/audit-log-schema.d.ts +645 -0
- package/dist/store/audit-log-schema.d.ts.map +1 -0
- package/dist/store/audit-log-schema.js +30 -0
- package/dist/store/audit-log-schema.js.map +1 -0
- package/dist/store/background-ops.d.ts +26 -0
- package/dist/store/background-ops.d.ts.map +1 -1
- package/dist/store/background-ops.js +46 -0
- package/dist/store/background-ops.js.map +1 -1
- package/dist/store/backup-recover.d.ts +36 -1
- package/dist/store/backup-recover.d.ts.map +1 -1
- package/dist/store/backup-recover.js +99 -1
- package/dist/store/backup-recover.js.map +1 -1
- package/dist/store/backup-verify.d.ts +1 -1
- package/dist/store/backup-verify.d.ts.map +1 -1
- package/dist/store/backup-verify.js +6 -1
- package/dist/store/backup-verify.js.map +1 -1
- package/dist/store/backup.js +1 -1
- package/dist/store/backup.js.map +1 -1
- package/dist/store/conduit-sqlite.d.ts.map +1 -1
- package/dist/store/conduit-sqlite.js +2 -26
- package/dist/store/conduit-sqlite.js.map +1 -1
- package/dist/store/converters.js +1 -1
- package/dist/store/converters.js.map +1 -1
- package/dist/store/db-helpers.js +1 -1
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/dependency-cycles.js +1 -1
- package/dist/store/dependency-cycles.js.map +1 -1
- package/dist/store/display-id-alias.d.ts +2 -2
- package/dist/store/display-id-alias.d.ts.map +1 -1
- package/dist/store/display-id-alias.js +5 -28
- package/dist/store/display-id-alias.js.map +1 -1
- package/dist/store/drizzle-node-sqlite.d.ts +56 -0
- package/dist/store/drizzle-node-sqlite.d.ts.map +1 -0
- package/dist/store/drizzle-node-sqlite.js +87 -0
- package/dist/store/drizzle-node-sqlite.js.map +1 -0
- package/dist/store/dual-scope-db.d.ts +26 -33
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +416 -122
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/abort-events.d.ts +134 -0
- package/dist/store/exodus/abort-events.d.ts.map +1 -1
- package/dist/store/exodus/abort-events.js +201 -0
- package/dist/store/exodus/abort-events.js.map +1 -1
- package/dist/store/exodus/migrate.d.ts +7 -0
- package/dist/store/exodus/migrate.d.ts.map +1 -1
- package/dist/store/exodus/migrate.js +156 -118
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/on-open.d.ts +36 -0
- package/dist/store/exodus/on-open.d.ts.map +1 -1
- package/dist/store/exodus/on-open.js +102 -27
- package/dist/store/exodus/on-open.js.map +1 -1
- package/dist/store/exodus/prior-recoveries.d.ts +75 -0
- package/dist/store/exodus/prior-recoveries.d.ts.map +1 -0
- package/dist/store/exodus/prior-recoveries.js +122 -0
- package/dist/store/exodus/prior-recoveries.js.map +1 -0
- package/dist/store/exodus/reconcile.d.ts.map +1 -1
- package/dist/store/exodus/reconcile.js +188 -24
- package/dist/store/exodus/reconcile.js.map +1 -1
- package/dist/store/exodus/runtime-targets.d.ts +3 -3
- package/dist/store/exodus/runtime-targets.js +3 -3
- package/dist/store/exodus/task-id-collision-sql.d.ts +52 -0
- package/dist/store/exodus/task-id-collision-sql.d.ts.map +1 -0
- package/dist/store/exodus/task-id-collision-sql.js +97 -0
- package/dist/store/exodus/task-id-collision-sql.js.map +1 -0
- package/dist/store/exodus/task-id-remap.d.ts +113 -0
- package/dist/store/exodus/task-id-remap.d.ts.map +1 -0
- package/dist/store/exodus/task-id-remap.js +301 -0
- package/dist/store/exodus/task-id-remap.js.map +1 -0
- package/dist/store/exodus/verify-migration.js +1 -1
- package/dist/store/exodus/verify-migration.js.map +1 -1
- package/dist/store/exodus/write-guard.d.ts +136 -0
- package/dist/store/exodus/write-guard.d.ts.map +1 -0
- package/dist/store/exodus/write-guard.js +289 -0
- package/dist/store/exodus/write-guard.js.map +1 -0
- package/dist/store/identity-share.d.ts +31 -0
- package/dist/store/identity-share.d.ts.map +1 -0
- package/dist/store/identity-share.js +54 -0
- package/dist/store/identity-share.js.map +1 -0
- package/dist/store/import-remap.js +1 -1
- package/dist/store/import-remap.js.map +1 -1
- package/dist/store/import-sort.js +1 -1
- package/dist/store/import-sort.js.map +1 -1
- package/dist/store/json.js +1 -1
- package/dist/store/json.js.map +1 -1
- package/dist/store/legacy-tasks-lineage.js +3 -3
- package/dist/store/legacy-tasks-lineage.js.map +1 -1
- package/dist/store/lock.d.ts +17 -0
- package/dist/store/lock.d.ts.map +1 -1
- package/dist/store/lock.js +18 -1
- package/dist/store/lock.js.map +1 -1
- package/dist/store/memory-sqlite.d.ts.map +1 -1
- package/dist/store/memory-sqlite.js +2 -25
- package/dist/store/memory-sqlite.js.map +1 -1
- package/dist/store/migration-files.d.ts +30 -0
- package/dist/store/migration-files.d.ts.map +1 -0
- package/dist/store/migration-files.js +59 -0
- package/dist/store/migration-files.js.map +1 -0
- package/dist/store/migration-manager.d.ts.map +1 -1
- package/dist/store/migration-manager.js +14 -14
- package/dist/store/migration-manager.js.map +1 -1
- package/dist/store/migration-runner.d.ts.map +1 -1
- package/dist/store/migration-runner.js +2 -2
- package/dist/store/migration-runner.js.map +1 -1
- package/dist/store/migration-sqlite.d.ts +1 -1
- package/dist/store/migration-sqlite.d.ts.map +1 -1
- package/dist/store/migration-sqlite.js +290 -355
- package/dist/store/migration-sqlite.js.map +1 -1
- package/dist/store/open-cleo-db.d.ts.map +1 -1
- package/dist/store/open-cleo-db.js +4 -2
- package/dist/store/open-cleo-db.js.map +1 -1
- package/dist/store/pid-alive.d.ts +15 -0
- package/dist/store/pid-alive.d.ts.map +1 -0
- package/dist/store/pid-alive.js +24 -0
- package/dist/store/pid-alive.js.map +1 -0
- package/dist/store/portable-bundle-scan.d.ts +1 -1
- package/dist/store/portable-bundle-scan.d.ts.map +1 -1
- package/dist/store/portable-bundle-scan.js +1 -1
- package/dist/store/portable-bundle-scan.js.map +1 -1
- package/dist/store/portable-bundle.d.ts +10 -1
- package/dist/store/portable-bundle.d.ts.map +1 -1
- package/dist/store/portable-bundle.js +10 -1
- package/dist/store/portable-bundle.js.map +1 -1
- package/dist/store/recover-malformed-db.d.ts +1 -1
- package/dist/store/recover-malformed-db.d.ts.map +1 -1
- package/dist/store/recover-malformed-db.js +1 -1
- package/dist/store/recover-malformed-db.js.map +1 -1
- package/dist/store/repair-malformed-dbs.d.ts +1 -1
- package/dist/store/repair-malformed-dbs.d.ts.map +1 -1
- package/dist/store/repair-malformed-dbs.js +1 -1
- package/dist/store/repair-malformed-dbs.js.map +1 -1
- package/dist/store/restore-marker.d.ts +89 -0
- package/dist/store/restore-marker.d.ts.map +1 -0
- package/dist/store/restore-marker.js +197 -0
- package/dist/store/restore-marker.js.map +1 -0
- package/dist/store/restore-store.d.ts +85 -0
- package/dist/store/restore-store.d.ts.map +1 -0
- package/dist/store/restore-store.js +391 -0
- package/dist/store/restore-store.js.map +1 -0
- package/dist/store/row-identity.d.ts +123 -1
- package/dist/store/row-identity.d.ts.map +1 -1
- package/dist/store/row-identity.js +454 -80
- package/dist/store/row-identity.js.map +1 -1
- package/dist/store/schema/agent-registry-schema.d.ts +1 -1
- package/dist/store/schema/agent-registry-schema.d.ts.map +1 -1
- package/dist/store/schema/agent-registry-schema.js +5 -1
- package/dist/store/schema/agent-registry-schema.js.map +1 -1
- package/dist/store/schema/cleo-global/agent-registry.d.ts +1 -1
- package/dist/store/schema/cleo-global/agent-registry.d.ts.map +1 -1
- package/dist/store/schema/cleo-global/agent-registry.js +9 -5
- package/dist/store/schema/cleo-global/agent-registry.js.map +1 -1
- package/dist/store/schema/cleo-global/models-catalog.js +1 -1
- package/dist/store/schema/cleo-global/models-catalog.js.map +1 -1
- package/dist/store/schema/cleo-global/nexus.js +1 -1
- package/dist/store/schema/cleo-global/nexus.js.map +1 -1
- package/dist/store/schema/cleo-project/provenance-commits.d.ts +1 -1
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts +1 -1
- package/dist/store/schema/cleo-project/provenance-orphans.d.ts.map +1 -1
- package/dist/store/schema/cleo-project/provenance-orphans.js +9 -2
- package/dist/store/schema/cleo-project/provenance-orphans.js.map +1 -1
- package/dist/store/schema/cleo-project/provenance-rest.d.ts +1 -1
- package/dist/store/schema/cleo-project/provenance-rest.js +1 -1
- package/dist/store/schema/cleo-project/provenance-rest.js.map +1 -1
- package/dist/store/schema/cleo-shared/brain.js +1 -1
- package/dist/store/schema/cleo-shared/brain.js.map +1 -1
- package/dist/store/schema/memory-schema.d.ts +1 -1
- package/dist/store/schema/memory-schema.d.ts.map +1 -1
- package/dist/store/schema/memory-schema.js +1 -1
- package/dist/store/schema/memory-schema.js.map +1 -1
- package/dist/store/schema/nexus-schema.js +1 -1
- package/dist/store/schema/nexus-schema.js.map +1 -1
- package/dist/store/service-host-matcher.d.ts +1 -1
- package/dist/store/service-host-matcher.d.ts.map +1 -1
- package/dist/store/service-host-matcher.js +1 -1
- package/dist/store/service-host-matcher.js.map +1 -1
- package/dist/store/service-oauth.js +1 -1
- package/dist/store/service-oauth.js.map +1 -1
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +7 -1
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +1 -1
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +1 -1
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +52 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +95 -22
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/sqlite-native.d.ts.map +1 -1
- package/dist/store/sqlite-native.js +9 -9
- package/dist/store/sqlite-native.js.map +1 -1
- package/dist/store/sqlite-pragmas.d.ts +12 -5
- package/dist/store/sqlite-pragmas.d.ts.map +1 -1
- package/dist/store/sqlite-pragmas.js +13 -2
- package/dist/store/sqlite-pragmas.js.map +1 -1
- package/dist/store/sqlite.d.ts.map +1 -1
- package/dist/store/sqlite.js +7 -32
- package/dist/store/sqlite.js.map +1 -1
- package/dist/store/status-registry.d.ts +1 -1
- package/dist/store/status-registry.d.ts.map +1 -1
- package/dist/store/status-registry.js +1 -1
- package/dist/store/status-registry.js.map +1 -1
- package/dist/store/sync/apply/applier.d.ts +119 -0
- package/dist/store/sync/apply/applier.d.ts.map +1 -0
- package/dist/store/sync/apply/applier.js +1239 -0
- package/dist/store/sync/apply/applier.js.map +1 -0
- package/dist/store/sync/apply/fk.d.ts +47 -0
- package/dist/store/sync/apply/fk.d.ts.map +1 -0
- package/dist/store/sync/apply/fk.js +89 -0
- package/dist/store/sync/apply/fk.js.map +1 -0
- package/dist/store/sync/apply/footprints.d.ts +60 -0
- package/dist/store/sync/apply/footprints.d.ts.map +1 -0
- package/dist/store/sync/apply/footprints.js +235 -0
- package/dist/store/sync/apply/footprints.js.map +1 -0
- package/dist/store/sync/apply/frame.d.ts +80 -0
- package/dist/store/sync/apply/frame.d.ts.map +1 -0
- package/dist/store/sync/apply/frame.js +127 -0
- package/dist/store/sync/apply/frame.js.map +1 -0
- package/dist/store/sync/apply/index.d.ts +11 -0
- package/dist/store/sync/apply/index.d.ts.map +1 -0
- package/dist/store/sync/apply/index.js +11 -0
- package/dist/store/sync/apply/index.js.map +1 -0
- package/dist/store/sync/apply/parent-delete.d.ts +38 -0
- package/dist/store/sync/apply/parent-delete.d.ts.map +1 -0
- package/dist/store/sync/apply/parent-delete.js +41 -0
- package/dist/store/sync/apply/parent-delete.js.map +1 -0
- package/dist/store/sync/apply/post-apply.d.ts +67 -0
- package/dist/store/sync/apply/post-apply.d.ts.map +1 -0
- package/dist/store/sync/apply/post-apply.js +118 -0
- package/dist/store/sync/apply/post-apply.js.map +1 -0
- package/dist/store/sync/apply/refs.d.ts +60 -0
- package/dist/store/sync/apply/refs.d.ts.map +1 -0
- package/dist/store/sync/apply/refs.js +90 -0
- package/dist/store/sync/apply/refs.js.map +1 -0
- package/dist/store/sync/apply/write-api.d.ts +195 -0
- package/dist/store/sync/apply/write-api.d.ts.map +1 -0
- package/dist/store/sync/apply/write-api.js +416 -0
- package/dist/store/sync/apply/write-api.js.map +1 -0
- package/dist/store/sync/apply-intent.d.ts +117 -0
- package/dist/store/sync/apply-intent.d.ts.map +1 -0
- package/dist/store/sync/apply-intent.js +225 -0
- package/dist/store/sync/apply-intent.js.map +1 -0
- package/dist/store/sync/capture.d.ts +32 -2
- package/dist/store/sync/capture.d.ts.map +1 -1
- package/dist/store/sync/capture.js +47 -13
- package/dist/store/sync/capture.js.map +1 -1
- package/dist/store/sync/conflicts.d.ts +81 -0
- package/dist/store/sync/conflicts.d.ts.map +1 -0
- package/dist/store/sync/conflicts.js +98 -0
- package/dist/store/sync/conflicts.js.map +1 -0
- package/dist/store/sync/field-leave.d.ts +146 -0
- package/dist/store/sync/field-leave.d.ts.map +1 -0
- package/dist/store/sync/field-leave.js +241 -0
- package/dist/store/sync/field-leave.js.map +1 -0
- package/dist/store/sync/flags.d.ts +119 -0
- package/dist/store/sync/flags.d.ts.map +1 -1
- package/dist/store/sync/flags.js +360 -0
- package/dist/store/sync/flags.js.map +1 -1
- package/dist/store/sync/held.d.ts +197 -0
- package/dist/store/sync/held.d.ts.map +1 -0
- package/dist/store/sync/held.js +314 -0
- package/dist/store/sync/held.js.map +1 -0
- package/dist/store/sync/identity-fill.d.ts.map +1 -1
- package/dist/store/sync/identity-fill.js +10 -2
- package/dist/store/sync/identity-fill.js.map +1 -1
- package/dist/store/sync/inbox.d.ts +114 -0
- package/dist/store/sync/inbox.d.ts.map +1 -0
- package/dist/store/sync/inbox.js +222 -0
- package/dist/store/sync/inbox.js.map +1 -0
- package/dist/store/sync/inherit.d.ts +36 -0
- package/dist/store/sync/inherit.d.ts.map +1 -0
- package/dist/store/sync/inherit.js +38 -0
- package/dist/store/sync/inherit.js.map +1 -0
- package/dist/store/sync/merge/engine.d.ts +114 -0
- package/dist/store/sync/merge/engine.d.ts.map +1 -0
- package/dist/store/sync/merge/engine.js +698 -0
- package/dist/store/sync/merge/engine.js.map +1 -0
- package/dist/store/sync/merge/index.d.ts +11 -0
- package/dist/store/sync/merge/index.d.ts.map +1 -0
- package/dist/store/sync/merge/index.js +11 -0
- package/dist/store/sync/merge/index.js.map +1 -0
- package/dist/store/sync/merge/rules.d.ts +91 -0
- package/dist/store/sync/merge/rules.d.ts.map +1 -0
- package/dist/store/sync/merge/rules.js +151 -0
- package/dist/store/sync/merge/rules.js.map +1 -0
- package/dist/store/sync/merge/types.d.ts +206 -0
- package/dist/store/sync/merge/types.d.ts.map +1 -0
- package/dist/store/sync/merge/types.js +15 -0
- package/dist/store/sync/merge/types.js.map +1 -0
- package/dist/store/sync/migration-hooks.d.ts +47 -0
- package/dist/store/sync/migration-hooks.d.ts.map +1 -0
- package/dist/store/sync/migration-hooks.js +74 -0
- package/dist/store/sync/migration-hooks.js.map +1 -0
- package/dist/store/sync/netting.d.ts +5 -0
- package/dist/store/sync/netting.d.ts.map +1 -1
- package/dist/store/sync/netting.js +29 -2
- package/dist/store/sync/netting.js.map +1 -1
- package/dist/store/sync/remap.d.ts +72 -0
- package/dist/store/sync/remap.d.ts.map +1 -0
- package/dist/store/sync/remap.js +209 -0
- package/dist/store/sync/remap.js.map +1 -0
- package/dist/store/sync/repair.d.ts +180 -0
- package/dist/store/sync/repair.d.ts.map +1 -0
- package/dist/store/sync/repair.js +499 -0
- package/dist/store/sync/repair.js.map +1 -0
- package/dist/store/sync/replica-registry.d.ts +54 -0
- package/dist/store/sync/replica-registry.d.ts.map +1 -1
- package/dist/store/sync/replica-registry.js +72 -2
- package/dist/store/sync/replica-registry.js.map +1 -1
- package/dist/store/sync/replica.d.ts +71 -9
- package/dist/store/sync/replica.d.ts.map +1 -1
- package/dist/store/sync/replica.js +95 -11
- package/dist/store/sync/replica.js.map +1 -1
- package/dist/store/sync/row-meta.d.ts +148 -0
- package/dist/store/sync/row-meta.d.ts.map +1 -0
- package/dist/store/sync/row-meta.js +200 -0
- package/dist/store/sync/row-meta.js.map +1 -0
- package/dist/store/sync/schema.d.ts +13 -5
- package/dist/store/sync/schema.d.ts.map +1 -1
- package/dist/store/sync/schema.js +34 -7
- package/dist/store/sync/schema.js.map +1 -1
- package/dist/store/sync/sealer-values.d.ts.map +1 -1
- package/dist/store/sync/sealer-values.js +1 -0
- package/dist/store/sync/sealer-values.js.map +1 -1
- package/dist/store/sync/sealer.d.ts +96 -0
- package/dist/store/sync/sealer.d.ts.map +1 -1
- package/dist/store/sync/sealer.js +532 -58
- package/dist/store/sync/sealer.js.map +1 -1
- package/dist/store/sync/sequencing.d.ts +175 -0
- package/dist/store/sync/sequencing.d.ts.map +1 -0
- package/dist/store/sync/sequencing.js +295 -0
- package/dist/store/sync/sequencing.js.map +1 -0
- package/dist/store/sync/structural.d.ts +30 -2
- package/dist/store/sync/structural.d.ts.map +1 -1
- package/dist/store/sync/structural.js +64 -2
- package/dist/store/sync/structural.js.map +1 -1
- package/dist/store/sync/timestamp-canon.d.ts +44 -0
- package/dist/store/sync/timestamp-canon.d.ts.map +1 -0
- package/dist/store/sync/timestamp-canon.js +102 -0
- package/dist/store/sync/timestamp-canon.js.map +1 -0
- package/dist/store/sync/timestamps.d.ts +1 -30
- package/dist/store/sync/timestamps.d.ts.map +1 -1
- package/dist/store/sync/timestamps.js +2 -89
- package/dist/store/sync/timestamps.js.map +1 -1
- package/dist/store/sync/trigger-classes.d.ts +8 -0
- package/dist/store/sync/trigger-classes.d.ts.map +1 -1
- package/dist/store/sync/trigger-classes.js +13 -0
- package/dist/store/sync/trigger-classes.js.map +1 -1
- package/dist/store/sync/write-actor.d.ts +58 -0
- package/dist/store/sync/write-actor.d.ts.map +1 -0
- package/dist/store/sync/write-actor.js +67 -0
- package/dist/store/sync/write-actor.js.map +1 -0
- package/dist/store/table-classification.d.ts +27 -0
- package/dist/store/table-classification.d.ts.map +1 -1
- package/dist/store/table-classification.js +116 -0
- package/dist/store/table-classification.js.map +1 -1
- package/dist/store/task-claim.d.ts +1 -1
- package/dist/store/task-claim.d.ts.map +1 -1
- package/dist/store/task-claim.js +1 -1
- package/dist/store/task-claim.js.map +1 -1
- package/dist/store/task-reference-columns.d.ts +27 -0
- package/dist/store/task-reference-columns.d.ts.map +1 -0
- package/dist/store/task-reference-columns.js +65 -0
- package/dist/store/task-reference-columns.js.map +1 -0
- package/dist/store/task-version.d.ts +1 -1
- package/dist/store/task-version.d.ts.map +1 -1
- package/dist/store/task-version.js +1 -1
- package/dist/store/task-version.js.map +1 -1
- package/dist/store/tasks-schema.d.ts +2 -1
- package/dist/store/tasks-schema.d.ts.map +1 -1
- package/dist/store/tasks-schema.js +5 -4
- package/dist/store/tasks-schema.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +1 -1
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +3 -1
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/twin-collapse.d.ts +43 -14
- package/dist/store/twin-collapse.d.ts.map +1 -1
- package/dist/store/twin-collapse.js +373 -32
- package/dist/store/twin-collapse.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +44 -674
- package/dist/store/validation-schemas.d.ts.map +1 -1
- package/dist/store/validation-schemas.js +2 -22
- package/dist/store/validation-schemas.js.map +1 -1
- package/dist/store/vault-manifest.d.ts +6 -2
- package/dist/store/vault-manifest.d.ts.map +1 -1
- package/dist/store/vault-manifest.js +10 -3
- package/dist/store/vault-manifest.js.map +1 -1
- package/dist/store/worktree-build-guard.js +1 -1
- package/dist/store/worktree-build-guard.js.map +1 -1
- package/dist/store/worktree-isolation-guard.js +1 -1
- package/dist/store/worktree-isolation-guard.js.map +1 -1
- package/dist/store/writer-lease.d.ts.map +1 -1
- package/dist/store/writer-lease.js +1 -11
- package/dist/store/writer-lease.js.map +1 -1
- package/dist/store/zod-schema-factory.d.ts +16 -0
- package/dist/store/zod-schema-factory.d.ts.map +1 -0
- package/dist/store/zod-schema-factory.js +23 -0
- package/dist/store/zod-schema-factory.js.map +1 -0
- package/dist/system/backup.d.ts +106 -0
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +295 -19
- package/dist/system/backup.js.map +1 -1
- package/dist/system/cleanup.js +1 -1
- package/dist/system/cleanup.js.map +1 -1
- package/dist/system/health.d.ts +13 -0
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +96 -1
- package/dist/system/health.js.map +1 -1
- package/dist/system/labels.js +1 -1
- package/dist/system/labels.js.map +1 -1
- package/dist/system/migrate.js +1 -1
- package/dist/system/migrate.js.map +1 -1
- package/dist/system/safestop.d.ts.map +1 -1
- package/dist/system/safestop.js +1 -1
- package/dist/system/safestop.js.map +1 -1
- package/dist/task-work/current.d.ts +34 -0
- package/dist/task-work/current.d.ts.map +1 -0
- package/dist/task-work/current.js +34 -0
- package/dist/task-work/current.js.map +1 -0
- package/dist/task-work/index.d.ts +2 -19
- package/dist/task-work/index.d.ts.map +1 -1
- package/dist/task-work/index.js +6 -20
- package/dist/task-work/index.js.map +1 -1
- package/dist/tasks/ac-identity.d.ts +28 -0
- package/dist/tasks/ac-identity.d.ts.map +1 -0
- package/dist/tasks/ac-identity.js +43 -0
- package/dist/tasks/ac-identity.js.map +1 -0
- package/dist/tasks/ac-immutability.d.ts +1 -1
- package/dist/tasks/ac-immutability.d.ts.map +1 -1
- package/dist/tasks/ac-immutability.js +1 -1
- package/dist/tasks/ac-immutability.js.map +1 -1
- package/dist/tasks/ac-table.d.ts +2 -14
- package/dist/tasks/ac-table.d.ts.map +1 -1
- package/dist/tasks/ac-table.js +6 -29
- package/dist/tasks/ac-table.js.map +1 -1
- package/dist/tasks/acceptance-input.js +1 -1
- package/dist/tasks/acceptance-input.js.map +1 -1
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +3 -1
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +100 -19
- package/dist/tasks/affected-packages.d.ts.map +1 -1
- package/dist/tasks/affected-packages.js +169 -32
- package/dist/tasks/affected-packages.js.map +1 -1
- package/dist/tasks/affected-template.d.ts +93 -0
- package/dist/tasks/affected-template.d.ts.map +1 -0
- package/dist/tasks/affected-template.js +198 -0
- package/dist/tasks/affected-template.js.map +1 -0
- package/dist/tasks/archive.d.ts.map +1 -1
- package/dist/tasks/archive.js +1 -1
- package/dist/tasks/archive.js.map +1 -1
- package/dist/tasks/axis-filters.d.ts.map +1 -1
- package/dist/tasks/axis-filters.js +2 -1
- package/dist/tasks/axis-filters.js.map +1 -1
- package/dist/tasks/child-disposition.js +1 -1
- package/dist/tasks/child-disposition.js.map +1 -1
- package/dist/tasks/collection.js +1 -1
- package/dist/tasks/collection.js.map +1 -1
- package/dist/tasks/command-line.d.ts +4 -1
- package/dist/tasks/command-line.d.ts.map +1 -1
- package/dist/tasks/command-line.js +7 -2
- package/dist/tasks/command-line.js.map +1 -1
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +2 -1
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/decompose.js +1 -1
- package/dist/tasks/decompose.js.map +1 -1
- package/dist/tasks/delete.js +1 -1
- package/dist/tasks/delete.js.map +1 -1
- package/dist/tasks/done-plan.d.ts +2 -1
- package/dist/tasks/done-plan.d.ts.map +1 -1
- package/dist/tasks/done-plan.js +21 -21
- package/dist/tasks/done-plan.js.map +1 -1
- package/dist/tasks/done-record.d.ts +1 -1
- package/dist/tasks/done-record.d.ts.map +1 -1
- package/dist/tasks/done-record.js +1 -1
- package/dist/tasks/done-record.js.map +1 -1
- package/dist/tasks/duplicate-detector.d.ts.map +1 -1
- package/dist/tasks/duplicate-detector.js +11 -5
- package/dist/tasks/duplicate-detector.js.map +1 -1
- package/dist/tasks/enforcement.d.ts +2 -1
- package/dist/tasks/enforcement.d.ts.map +1 -1
- package/dist/tasks/enforcement.js +1 -1
- package/dist/tasks/enforcement.js.map +1 -1
- package/dist/tasks/engine-wrap-ops.js +1 -1
- package/dist/tasks/engine-wrap-ops.js.map +1 -1
- package/dist/tasks/engine-wrap.d.ts.map +1 -1
- package/dist/tasks/engine-wrap.js +7 -3
- package/dist/tasks/engine-wrap.js.map +1 -1
- package/dist/tasks/epic-enforcement.js +1 -1
- package/dist/tasks/epic-enforcement.js.map +1 -1
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +216 -20
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/find.js +1 -1
- package/dist/tasks/find.js.map +1 -1
- package/dist/tasks/gate-result-cache.js +1 -1
- package/dist/tasks/gate-result-cache.js.map +1 -1
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +1 -1
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/heavy-tool-env.d.ts +454 -19
- package/dist/tasks/heavy-tool-env.d.ts.map +1 -1
- package/dist/tasks/heavy-tool-env.js +818 -42
- package/dist/tasks/heavy-tool-env.js.map +1 -1
- package/dist/tasks/index.d.ts +3 -3
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +3 -3
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/labels.js +1 -1
- package/dist/tasks/labels.js.map +1 -1
- package/dist/tasks/nexus-impact-gate.js +1 -1
- package/dist/tasks/nexus-impact-gate.js.map +1 -1
- package/dist/tasks/pipeline-stage.js +1 -1
- package/dist/tasks/pipeline-stage.js.map +1 -1
- package/dist/tasks/population.js +1 -1
- package/dist/tasks/population.js.map +1 -1
- package/dist/tasks/ranking-audit.js +1 -1
- package/dist/tasks/ranking-audit.js.map +1 -1
- package/dist/tasks/reconcile-scope.js +1 -1
- package/dist/tasks/reconcile-scope.js.map +1 -1
- package/dist/tasks/relates.js +1 -1
- package/dist/tasks/relates.js.map +1 -1
- package/dist/tasks/req.d.ts.map +1 -1
- package/dist/tasks/req.js +2 -1
- package/dist/tasks/req.js.map +1 -1
- package/dist/tasks/severity-attestation.d.ts +1 -1
- package/dist/tasks/severity-attestation.d.ts.map +1 -1
- package/dist/tasks/severity-attestation.js +1 -1
- package/dist/tasks/severity-attestation.js.map +1 -1
- package/dist/tasks/show.d.ts.map +1 -1
- package/dist/tasks/show.js +47 -3
- package/dist/tasks/show.js.map +1 -1
- package/dist/tasks/task-import.js +1 -1
- package/dist/tasks/task-import.js.map +1 -1
- package/dist/tasks/task-reparent.d.ts.map +1 -1
- package/dist/tasks/task-reparent.js +2 -1
- package/dist/tasks/task-reparent.js.map +1 -1
- package/dist/tasks/test-run-binding.d.ts.map +1 -1
- package/dist/tasks/test-run-binding.js +9 -2
- package/dist/tasks/test-run-binding.js.map +1 -1
- package/dist/tasks/tool-cache-env.d.ts +20 -13
- package/dist/tasks/tool-cache-env.d.ts.map +1 -1
- package/dist/tasks/tool-cache-env.js +27 -48
- package/dist/tasks/tool-cache-env.js.map +1 -1
- package/dist/tasks/tool-cache.d.ts +30 -7
- package/dist/tasks/tool-cache.d.ts.map +1 -1
- package/dist/tasks/tool-cache.js +74 -20
- package/dist/tasks/tool-cache.js.map +1 -1
- package/dist/tasks/tool-resolver.d.ts +8 -0
- package/dist/tasks/tool-resolver.d.ts.map +1 -1
- package/dist/tasks/tool-resolver.js +15 -1
- package/dist/tasks/tool-resolver.js.map +1 -1
- package/dist/tasks/tool-runner-guard.d.ts +131 -0
- package/dist/tasks/tool-runner-guard.d.ts.map +1 -0
- package/dist/tasks/tool-runner-guard.js +141 -0
- package/dist/tasks/tool-runner-guard.js.map +1 -0
- package/dist/tasks/tool-semaphore.d.ts +106 -302
- package/dist/tasks/tool-semaphore.d.ts.map +1 -1
- package/dist/tasks/tool-semaphore.js +132 -558
- package/dist/tasks/tool-semaphore.js.map +1 -1
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +2 -1
- package/dist/tasks/update.js.map +1 -1
- package/dist/upgrade.d.ts.map +1 -1
- package/dist/upgrade.js +35 -31
- package/dist/upgrade.js.map +1 -1
- package/dist/validation/doctor/checks.d.ts +41 -0
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +251 -0
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/validation/doctor/index.d.ts +1 -1
- package/dist/validation/doctor/index.d.ts.map +1 -1
- package/dist/validation/doctor/index.js +1 -1
- package/dist/validation/doctor/index.js.map +1 -1
- package/dist/validation/engine-ops.js +1 -1
- package/dist/validation/engine-ops.js.map +1 -1
- package/dist/validation/engine.d.ts +1 -1
- package/dist/validation/engine.d.ts.map +1 -1
- package/dist/validation/engine.js +2 -1
- package/dist/validation/engine.js.map +1 -1
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/validation/operation-gate-validators.js +1 -1
- package/dist/validation/operation-gate-validators.js.map +1 -1
- package/dist/validation/protocol-common.js +1 -1
- package/dist/validation/protocol-common.js.map +1 -1
- package/dist/validation/protocols/_shared.js +1 -1
- package/dist/validation/protocols/_shared.js.map +1 -1
- package/dist/validation/validate-ops.js +1 -1
- package/dist/validation/validate-ops.js.map +1 -1
- package/dist/validation/verification.js +1 -1
- package/dist/validation/verification.js.map +1 -1
- package/dist/workgraph/index.d.ts +1 -1
- package/dist/workgraph/index.d.ts.map +1 -1
- package/dist/workgraph/index.js +1 -1
- package/dist/workgraph/index.js.map +1 -1
- package/dist/workgraph/reparent-preflight.d.ts +1 -2
- package/dist/workgraph/reparent-preflight.d.ts.map +1 -1
- package/dist/workgraph/reparent-preflight.js +1 -1
- package/dist/workgraph/reparent-preflight.js.map +1 -1
- package/dist/workgraph/scaffold-validate.js +1 -1
- package/dist/workgraph/scaffold-validate.js.map +1 -1
- package/dist/worktree/force-unlock.d.ts +1 -1
- package/dist/worktree/force-unlock.d.ts.map +1 -1
- package/dist/worktree/force-unlock.js +1 -1
- package/dist/worktree/force-unlock.js.map +1 -1
- package/dist/worktree/isolation.d.ts +1 -1
- package/dist/worktree/isolation.d.ts.map +1 -1
- package/dist/worktree/isolation.js +1 -1
- package/dist/worktree/isolation.js.map +1 -1
- package/dist/worktree/list.d.ts +1 -1
- package/dist/worktree/list.d.ts.map +1 -1
- package/dist/worktree/list.js +1 -1
- package/dist/worktree/list.js.map +1 -1
- package/dist/worktree/prune.d.ts +1 -1
- package/dist/worktree/prune.d.ts.map +1 -1
- package/dist/worktree/prune.js +1 -1
- package/dist/worktree/prune.js.map +1 -1
- package/dist/worktree/worktree-adopt.d.ts +1 -2
- package/dist/worktree/worktree-adopt.d.ts.map +1 -1
- package/dist/worktree/worktree-adopt.js +1 -1
- package/dist/worktree/worktree-adopt.js.map +1 -1
- package/migrations/sync-journal/20261004120000_t12757-apply-intent/migration.sql +21 -0
- package/migrations/sync-journal/20261005120000_t12344-inbox/migration.sql +67 -0
- package/migrations/sync-journal/20261006120000_t13193-rebase-undo/migration.sql +51 -0
- package/migrations/sync-journal/20261006130000_t13193-rebase-state/migration.sql +17 -0
- package/migrations/sync-journal/20261006140000_t13193-held-rows/migration.sql +24 -0
- package/package.json +13 -13
- package/schemas/project-context.schema.json +19 -1
- package/templates/CLEO-INJECTION.md +11 -11
- package/templates/CLEO-REFERENCE.md +2 -2
- package/templates/workflows/release-prepare.yml.tmpl +10 -10
|
@@ -28,18 +28,49 @@
|
|
|
28
28
|
* |---|---|---|
|
|
29
29
|
* | `NODE_OPTIONS=--max-old-space-size=N` | Heap ceiling for EVERY node process in the tree, inherited | node docs; appended, never clobbered |
|
|
30
30
|
* | `VITEST_MAX_WORKERS=N` | `if (process.env.VITEST_MAX_WORKERS) resolved.maxWorkers = parseInt(...)` — overrides the resolved config, so it binds projects that set their own | read out of vitest 4.1.4 `dist/chunks/coverage.*.js` |
|
|
31
|
-
* | `npm_config_workspace_concurrency=N` | Bounds `pnpm -r` fan-out across workspace packages | `npm_config_workspace_concurrency=1 pnpm config get workspace-concurrency` → `1` |
|
|
31
|
+
* | `npm_config_workspace_concurrency=N` / `pnpm_config_workspace_concurrency=N` | Bounds `pnpm -r` fan-out across workspace packages (pnpm 10 reads the first, pnpm 11+ the second) | `npm_config_workspace_concurrency=1 pnpm config get workspace-concurrency` → `1` on pnpm 10.30; `pnpm_config_…` → `1` on pnpm 12.6 (T13122) |
|
|
32
32
|
*
|
|
33
33
|
* Together these bound the product the semaphore could not see:
|
|
34
34
|
* `packages in flight × workers per run × heap per worker`.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* The worker levers apply ONLY to `test` / `build`, the tools that fork.
|
|
37
|
+
* `typecheck` and `lint` are single processes, but not cheap ones: one
|
|
38
|
+
* TypeScript program on a large monorepo holds 2–5 GB (a live `tsc --noEmit`
|
|
39
|
+
* held 4.7 GB on 2026-10-03), so since T13123 they get the heap ceiling and the
|
|
40
|
+
* workspace-concurrency bound too ({@link isMemoryBoundTool}), and no worker
|
|
41
|
+
* variables, which nothing they run reads.
|
|
38
42
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
43
|
+
* ## An inherited value can tighten the plan, never loosen it (T13122)
|
|
44
|
+
*
|
|
45
|
+
* The overlay is merged over the CALLER's environment: whatever the shell
|
|
46
|
+
* profile, the agent harness or a parent process exported. Until T13122 an
|
|
47
|
+
* inherited value always won, on the theory that "a deliberate setting beats our
|
|
48
|
+
* default". A shell profile is not a per-project decision: on 2026-10-03 a
|
|
49
|
+
* `~/.zprofile` export of `NODE_OPTIONS=--max-old-space-size=8192` reached a
|
|
50
|
+
* `cleo verify --evidence tool:test`, and the run got 6 workers × 8 GiB = all of
|
|
51
|
+
* a 48 GiB Mac, because the worker count was sized for a 4 GiB heap it was not
|
|
52
|
+
* getting.
|
|
53
|
+
*
|
|
54
|
+
* So the run has a heap budget — the default worker count times the default heap
|
|
55
|
+
* ({@link heavyRunBudgetMb}) — and the overlay is planned against it
|
|
56
|
+
* ({@link planHeavyToolEnv}):
|
|
57
|
+
*
|
|
58
|
+
* - an inherited `NODE_OPTIONS` heap that fits the budget is kept, and the
|
|
59
|
+
* worker count shrinks so `workers × heap` still fits; one above the budget
|
|
60
|
+
* is clamped to it;
|
|
61
|
+
* - an inherited worker count or workspace concurrency at or below the plan
|
|
62
|
+
* is kept; one above it is clamped;
|
|
63
|
+
* - only an explicit CLEO override asks for more: `CLEO_HEAVY_HEAP_MB`,
|
|
64
|
+
* `CLEO_HEAVY_WORKERS`, `CLEO_HEAVY_WORKSPACE_CONCURRENCY`.
|
|
65
|
+
*
|
|
66
|
+
* A project that wants more for its own suite still sets it in its own script
|
|
67
|
+
* (`"test": "NODE_OPTIONS=… vitest run"`) or config: that runs below the
|
|
68
|
+
* overlay and is untouched by it. The plan, and every value it clamped, is
|
|
69
|
+
* reported by `cleo verify` and `cleo run`.
|
|
41
70
|
*
|
|
42
71
|
* @task T12096
|
|
72
|
+
* @task T13122
|
|
73
|
+
* @task T13123
|
|
43
74
|
*/
|
|
44
75
|
import { totalmem } from 'node:os';
|
|
45
76
|
/**
|
|
@@ -56,6 +87,85 @@ export const GIB_PER_WORKER = 6;
|
|
|
56
87
|
export const MAX_HEAVY_WORKERS = 6;
|
|
57
88
|
/** Never grant fewer than this many — one worker must always be able to run. */
|
|
58
89
|
export const MIN_HEAVY_WORKERS = 1;
|
|
90
|
+
const GIB_BYTES = 1024 ** 3;
|
|
91
|
+
/**
|
|
92
|
+
* RAM the admission ledger never hands out: the OS, resident apps, VMs and
|
|
93
|
+
* agent CLIs — `max(4 GiB, 25%)`.
|
|
94
|
+
*
|
|
95
|
+
* @param totalBytes - physical RAM in bytes.
|
|
96
|
+
* @task T13133
|
|
97
|
+
*/
|
|
98
|
+
export function admissionReserveBytes(totalBytes) {
|
|
99
|
+
return Math.max(4 * GIB_BYTES, totalBytes * 0.25);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The machine-wide budget the admission ledger shares between heavy runs, in
|
|
103
|
+
* bytes (at least 1 GiB): total RAM minus {@link admissionReserveBytes}.
|
|
104
|
+
*
|
|
105
|
+
* @param totalBytes - physical RAM. @defaultValue os.totalmem()
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* admissionCapacityBytes(48 * 1024 ** 3); // 36 GiB
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
112
|
+
* @task T13133
|
|
113
|
+
*/
|
|
114
|
+
export function admissionCapacityBytes(totalBytes = totalmem()) {
|
|
115
|
+
return Math.max(GIB_BYTES, totalBytes - admissionReserveBytes(totalBytes));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Share of the admission budget one heavy run plans its workers for (T13132).
|
|
119
|
+
* A whole-suite run sized to the entire budget left nothing for anyone else:
|
|
120
|
+
* on a 48 GiB Mac it planned 6 workers × 6 GiB = all 36 GiB, and 49 single-file
|
|
121
|
+
* runs queued behind it for 17 minutes. Planning for half keeps the other half
|
|
122
|
+
* open, at the cost of a slower whole-suite run.
|
|
123
|
+
*/
|
|
124
|
+
export const PER_RUN_BUDGET_SHARE = 0.5;
|
|
125
|
+
/** Overrides the per-run share: a number in `(0, 1]` (e.g. `1` on a dedicated box). */
|
|
126
|
+
export const PER_RUN_SHARE_ENV = 'CLEO_PER_RUN_SHARE';
|
|
127
|
+
/**
|
|
128
|
+
* Variables a hosted CI runner sets, each with the value that marks it. A bare
|
|
129
|
+
* `CI` is not trusted: agent harnesses and devcontainers export it locally.
|
|
130
|
+
*/
|
|
131
|
+
const CI_RUNNER_MARKERS = [
|
|
132
|
+
['GITHUB_ACTIONS', 'true'],
|
|
133
|
+
['GITLAB_CI', null],
|
|
134
|
+
['BUILDKITE', 'true'],
|
|
135
|
+
['CIRCLECI', 'true'],
|
|
136
|
+
['TF_BUILD', 'True'],
|
|
137
|
+
];
|
|
138
|
+
/**
|
|
139
|
+
* Share of the admission budget one heavy run plans for:
|
|
140
|
+
* `CLEO_PER_RUN_SHARE` when it is a number in `(0, 1]`; the whole budget on a
|
|
141
|
+
* hosted CI runner (GitHub Actions, GitLab CI, Buildkite, CircleCI, Azure
|
|
142
|
+
* Pipelines), which is single-tenant, so CI keeps its parallelism (2 workers on
|
|
143
|
+
* a 16 GiB GitHub runner, as before T13132); else {@link PER_RUN_BUDGET_SHARE}.
|
|
144
|
+
* Fixed per environment, so the worker count in the tool cache key is stable.
|
|
145
|
+
*
|
|
146
|
+
* @param env - the environment.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* perRunBudgetShare({}); // 0.5
|
|
151
|
+
* perRunBudgetShare({ GITHUB_ACTIONS: 'true' }); // 1
|
|
152
|
+
* perRunBudgetShare({ CI: '1' }); // 0.5 (a bare CI is not trusted)
|
|
153
|
+
* perRunBudgetShare({ CLEO_PER_RUN_SHARE: '1' }); // 1
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
156
|
+
export function perRunBudgetShare(env) {
|
|
157
|
+
const raw = env[PER_RUN_SHARE_ENV]?.trim();
|
|
158
|
+
if (raw !== undefined && raw !== '') {
|
|
159
|
+
const n = Number(raw);
|
|
160
|
+
if (Number.isFinite(n) && n > 0 && n <= 1)
|
|
161
|
+
return n;
|
|
162
|
+
}
|
|
163
|
+
const onRunner = CI_RUNNER_MARKERS.some(([name, value]) => {
|
|
164
|
+
const v = env[name];
|
|
165
|
+
return v !== undefined && v !== '' && (value === null || v === value);
|
|
166
|
+
});
|
|
167
|
+
return onRunner ? 1 : PER_RUN_BUDGET_SHARE;
|
|
168
|
+
}
|
|
59
169
|
/**
|
|
60
170
|
* Workspace packages allowed to run their test/build script concurrently.
|
|
61
171
|
*
|
|
@@ -64,6 +174,87 @@ export const MIN_HEAVY_WORKERS = 1;
|
|
|
64
174
|
* memory-bound box does not finish at all.
|
|
65
175
|
*/
|
|
66
176
|
export const WORKSPACE_CONCURRENCY = 1;
|
|
177
|
+
/**
|
|
178
|
+
* The default heap never drops below this, in MiB, however small the machine —
|
|
179
|
+
* one worker must be able to run a real suite.
|
|
180
|
+
*
|
|
181
|
+
* @task T13122
|
|
182
|
+
*/
|
|
183
|
+
export const MIN_HEAVY_HEAP_MB = 1024;
|
|
184
|
+
/**
|
|
185
|
+
* Fraction of total RAM the DEFAULT heap may reach. {@link HEAVY_TOOL_HEAP_MB}
|
|
186
|
+
* on an 8 GiB laptop is half the machine; on a 4 GiB box it would be all of it,
|
|
187
|
+
* which is no ceiling at all. Machines of 8 GiB and up are unaffected.
|
|
188
|
+
*
|
|
189
|
+
* @task T13122
|
|
190
|
+
*/
|
|
191
|
+
export const HEAVY_HEAP_RAM_FRACTION = 0.5;
|
|
192
|
+
/**
|
|
193
|
+
* Explicit heap ceiling for heavy tools, in MiB. The only way to ask for a heap
|
|
194
|
+
* above the run's budget: unlike an inherited `NODE_OPTIONS`, it is never
|
|
195
|
+
* clamped.
|
|
196
|
+
*
|
|
197
|
+
* @task T13122
|
|
198
|
+
*/
|
|
199
|
+
export const HEAVY_HEAP_ENV = 'CLEO_HEAVY_HEAP_MB';
|
|
200
|
+
/**
|
|
201
|
+
* Explicit worker count for heavy tools. Replaces the planned count for every
|
|
202
|
+
* runner variable, even when that puts the run over its budget.
|
|
203
|
+
*
|
|
204
|
+
* @task T13122
|
|
205
|
+
*/
|
|
206
|
+
export const HEAVY_WORKERS_ENV = 'CLEO_HEAVY_WORKERS';
|
|
207
|
+
/**
|
|
208
|
+
* Explicit workspace concurrency for heavy tools (`pnpm -r` packages in flight).
|
|
209
|
+
*
|
|
210
|
+
* @task T13122
|
|
211
|
+
*/
|
|
212
|
+
export const HEAVY_WORKSPACE_CONCURRENCY_ENV = 'CLEO_HEAVY_WORKSPACE_CONCURRENCY';
|
|
213
|
+
/**
|
|
214
|
+
* The two spellings of pnpm's `workspace-concurrency` in the environment. pnpm
|
|
215
|
+
* 10 reads only `npm_config_workspace_concurrency`; pnpm 11+ reads only
|
|
216
|
+
* `pnpm_config_workspace_concurrency` (measured: pnpm 10.30.0 and 12.6.0 each
|
|
217
|
+
* report `undefined` for the other spelling). Setting one bounded `pnpm -r`
|
|
218
|
+
* fan-out on one pnpm major and silently nothing on the other, so the overlay
|
|
219
|
+
* sets both — for every launcher, because an `npm test` script that runs
|
|
220
|
+
* `pnpm -r` still reads them. Both are read case-insensitively, and an
|
|
221
|
+
* uppercase spelling outranks the lowercase one, so an inherited
|
|
222
|
+
* `NPM_CONFIG_WORKSPACE_CONCURRENCY` is planned and overlaid as well
|
|
223
|
+
* ({@link workspaceConcurrencyNames}).
|
|
224
|
+
*
|
|
225
|
+
* @task T13122
|
|
226
|
+
*/
|
|
227
|
+
export const WORKSPACE_CONCURRENCY_VARS = [
|
|
228
|
+
'npm_config_workspace_concurrency',
|
|
229
|
+
'pnpm_config_workspace_concurrency',
|
|
230
|
+
];
|
|
231
|
+
/**
|
|
232
|
+
* Every environment name that sets pnpm's workspace concurrency in `env`: the
|
|
233
|
+
* two canonical spellings, plus any case or dash variant of them present (pnpm
|
|
234
|
+
* reads these case-insensitively, uppercase first, and `workspace-concurrency`
|
|
235
|
+
* with a dash as readily).
|
|
236
|
+
*
|
|
237
|
+
* @param env - The caller's environment.
|
|
238
|
+
* @returns The names to plan and overlay, canonical first.
|
|
239
|
+
* @task T13122
|
|
240
|
+
*/
|
|
241
|
+
export function workspaceConcurrencyNames(env) {
|
|
242
|
+
const canonical = [...WORKSPACE_CONCURRENCY_VARS];
|
|
243
|
+
const wanted = new Set(canonical);
|
|
244
|
+
const variants = Object.keys(env).filter((name) => !wanted.has(name) && wanted.has(name.toLowerCase().replace(/-/g, '_')));
|
|
245
|
+
return [...canonical, ...variants.sort()];
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* V8 young-generation (semi-space) ceiling a plan allows, in MiB: Node 24's own
|
|
249
|
+
* default on a 64-bit host. `heap_size_limit` is old space plus three
|
|
250
|
+
* semi-spaces (measured on Node 24: `--max-old-space-size=4096` with
|
|
251
|
+
* `--max-semi-space-size=4096` reports 16384 MiB), so an inherited large
|
|
252
|
+
* semi-space would multiply the planned heap without touching the old-space
|
|
253
|
+
* flag; above this it is clamped.
|
|
254
|
+
*
|
|
255
|
+
* @task T13122
|
|
256
|
+
*/
|
|
257
|
+
export const MAX_SEMI_SPACE_MB = 64;
|
|
67
258
|
/**
|
|
68
259
|
* Canonical tools treated as HEAVY — the ones that fork.
|
|
69
260
|
*
|
|
@@ -97,6 +288,35 @@ const HEAVY_TOOLS = new Set(['test', 'build']);
|
|
|
97
288
|
export function isHeavyTool(canonical) {
|
|
98
289
|
return HEAVY_TOOLS.has(canonical);
|
|
99
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Canonical tools whose memory must be bounded: the heavy ones, plus the
|
|
293
|
+
* single-process tools that build a whole TypeScript program (T13123).
|
|
294
|
+
*/
|
|
295
|
+
const MEMORY_BOUND_TOOLS = new Set(['test', 'build', 'typecheck', 'lint']);
|
|
296
|
+
/**
|
|
297
|
+
* Whether a canonical tool's memory is bounded: a heap ceiling and workspace
|
|
298
|
+
* concurrency in its spawn env, and a RAM-derived machine-wide slot count that
|
|
299
|
+
* shrinks under pressure.
|
|
300
|
+
*
|
|
301
|
+
* A superset of {@link isHeavyTool}. `typecheck` and `lint` were treated as
|
|
302
|
+
* cheap (`max(2, cpus/2)` slots, no ceiling) until T13123: nine concurrent
|
|
303
|
+
* `tsc` runs of 2–5 GB each on an 18-core box is most of 48 GB. `audit` and
|
|
304
|
+
* `security-scan` stay unbounded — they are network-bound and small.
|
|
305
|
+
*
|
|
306
|
+
* @param canonical - the tool in question.
|
|
307
|
+
* @returns `true` for `test`, `build`, `typecheck` and `lint`.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```ts
|
|
311
|
+
* isMemoryBoundTool('typecheck'); // true
|
|
312
|
+
* isMemoryBoundTool('audit'); // false
|
|
313
|
+
* ```
|
|
314
|
+
*
|
|
315
|
+
* @task T13123
|
|
316
|
+
*/
|
|
317
|
+
export function isMemoryBoundTool(canonical) {
|
|
318
|
+
return MEMORY_BOUND_TOOLS.has(canonical);
|
|
319
|
+
}
|
|
100
320
|
/**
|
|
101
321
|
* Per-runner worker-count variables, keyed by the env var each runner reads.
|
|
102
322
|
*
|
|
@@ -126,22 +346,369 @@ const WORKER_COUNT_VARS = [
|
|
|
126
346
|
'PYTEST_XDIST_AUTO_NUM_WORKERS',
|
|
127
347
|
];
|
|
128
348
|
/**
|
|
129
|
-
*
|
|
349
|
+
* Default worker count one heavy run plans for, given {@link GIB_PER_WORKER}:
|
|
350
|
+
* {@link perRunBudgetShare} of the admission budget
|
|
351
|
+
* ({@link admissionCapacityBytes}) — half on a shared machine, so a
|
|
352
|
+
* whole-suite run never takes the budget other runs need (T13132), the whole
|
|
353
|
+
* budget on a single-tenant CI runner. Fixed per machine and environment, so
|
|
354
|
+
* the worker count — part of the tool cache key (T12989) — is stable.
|
|
355
|
+
*
|
|
356
|
+
* The planned count ({@link planHeavyToolEnv}) never exceeds this: a small
|
|
357
|
+
* inherited heap does not buy extra workers, because each worker also costs
|
|
358
|
+
* memory outside its heap.
|
|
130
359
|
*
|
|
131
360
|
* @param totalRamGib - total RAM in GiB; defaults to a live reading.
|
|
361
|
+
* @param env - the environment ({@link perRunBudgetShare}). @defaultValue process.env
|
|
132
362
|
* @returns a value in `[MIN_HEAVY_WORKERS, MAX_HEAVY_WORKERS]`.
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```ts
|
|
366
|
+
* heavyToolWorkers(48, {}); // 3 (half of the 36 GiB budget)
|
|
367
|
+
* heavyToolWorkers(16, {}); // 1
|
|
368
|
+
* heavyToolWorkers(16, { GITHUB_ACTIONS: 'true' }); // 2 (the whole 12 GiB budget)
|
|
369
|
+
* ```
|
|
133
370
|
*/
|
|
134
|
-
export function heavyToolWorkers(totalRamGib = totalmem() / 1024 ** 3) {
|
|
135
|
-
const
|
|
371
|
+
export function heavyToolWorkers(totalRamGib = totalmem() / 1024 ** 3, env = process.env) {
|
|
372
|
+
const capacityGib = admissionCapacityBytes(Math.max(0, totalRamGib) * GIB_BYTES) / GIB_BYTES;
|
|
373
|
+
const byRam = Math.floor((capacityGib * perRunBudgetShare(env)) / GIB_PER_WORKER);
|
|
136
374
|
return Math.min(MAX_HEAVY_WORKERS, Math.max(MIN_HEAVY_WORKERS, byRam));
|
|
137
375
|
}
|
|
138
376
|
/**
|
|
139
|
-
*
|
|
377
|
+
* Default heap ceiling per Node process, in MiB: {@link HEAVY_TOOL_HEAP_MB},
|
|
378
|
+
* lowered to {@link HEAVY_HEAP_RAM_FRACTION} of RAM on a machine under 8 GiB
|
|
379
|
+
* (never below {@link MIN_HEAVY_HEAP_MB}).
|
|
140
380
|
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
381
|
+
* @param totalRamGib - total RAM in GiB; defaults to a live reading.
|
|
382
|
+
* @returns the default heap in MiB.
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* ```ts
|
|
386
|
+
* defaultHeavyHeapMb(64); // → 4096
|
|
387
|
+
* defaultHeavyHeapMb(4); // → 2048
|
|
388
|
+
* ```
|
|
389
|
+
*
|
|
390
|
+
* @task T13122
|
|
391
|
+
*/
|
|
392
|
+
export function defaultHeavyHeapMb(totalRamGib = totalmem() / 1024 ** 3) {
|
|
393
|
+
const byRam = Math.floor(totalRamGib * 1024 * HEAVY_HEAP_RAM_FRACTION);
|
|
394
|
+
return Math.min(HEAVY_TOOL_HEAP_MB, Math.max(MIN_HEAVY_HEAP_MB, byRam));
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Default heap ceiling for a single-process tool (`typecheck`, `lint`), in MiB:
|
|
398
|
+
* {@link defaultHeavyHeapMb}, but never above a quarter of RAM — V8's own
|
|
399
|
+
* default old space on a machine under 16 GiB (measured 4288 MiB with no flags
|
|
400
|
+
* on a 64 GiB host, the capped default) — so the plan never RAISES a `tsc`'s
|
|
401
|
+
* ceiling on a small machine (review of #1810). Never below
|
|
402
|
+
* {@link MIN_HEAVY_HEAP_MB}.
|
|
403
|
+
*
|
|
404
|
+
* @param totalRamGib - total RAM in GiB; defaults to a live reading.
|
|
405
|
+
* @returns the default heap in MiB.
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* ```ts
|
|
409
|
+
* defaultSingleProcessHeapMb(64); // → 4096
|
|
410
|
+
* defaultSingleProcessHeapMb(8); // → 2048
|
|
411
|
+
* ```
|
|
412
|
+
*
|
|
413
|
+
* @task T13123
|
|
414
|
+
*/
|
|
415
|
+
export function defaultSingleProcessHeapMb(totalRamGib = totalmem() / 1024 ** 3) {
|
|
416
|
+
const quarter = Math.max(MIN_HEAVY_HEAP_MB, Math.floor((totalRamGib * 1024) / 4));
|
|
417
|
+
return Math.min(defaultHeavyHeapMb(totalRamGib), quarter);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* Heap budget for one heavy run, in MiB: the default worker count times the
|
|
421
|
+
* default heap. `workspace concurrency × workers × heap` must fit in it.
|
|
422
|
+
*
|
|
423
|
+
* Since T13132 the worker count is half the admission budget's worth
|
|
424
|
+
* ({@link heavyToolWorkers}); an inherited heap is planned against the budget
|
|
425
|
+
* instead of multiplying it (T13122).
|
|
426
|
+
*
|
|
427
|
+
* @param totalRamGib - total RAM in GiB; defaults to a live reading.
|
|
428
|
+
* @param env - the environment ({@link perRunBudgetShare}). @defaultValue process.env
|
|
429
|
+
* @returns the budget in MiB.
|
|
430
|
+
*
|
|
431
|
+
* @example
|
|
432
|
+
* ```ts
|
|
433
|
+
* heavyRunBudgetMb(64, {}); // → 16384 (4 workers × 4096)
|
|
434
|
+
* heavyRunBudgetMb(16, {}); // → 4096 (1 worker × 4096)
|
|
435
|
+
* ```
|
|
436
|
+
*
|
|
437
|
+
* @task T13122
|
|
438
|
+
* @task T13132
|
|
439
|
+
*/
|
|
440
|
+
export function heavyRunBudgetMb(totalRamGib = totalmem() / 1024 ** 3, env = process.env) {
|
|
441
|
+
return heavyToolWorkers(totalRamGib, env) * defaultHeavyHeapMb(totalRamGib);
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* `NODE_OPTIONS` flags that set a V8 heap limit. `max-old-space-size` and its
|
|
445
|
+
* percentage form decide the old-space ceiling; `max-semi-space-size` sizes the
|
|
446
|
+
* young generation, three of which count toward the limit, and is capped at
|
|
447
|
+
* {@link MAX_SEMI_SPACE_MB}.
|
|
448
|
+
*
|
|
449
|
+
* @task T12989
|
|
450
|
+
* @task T13122
|
|
451
|
+
*/
|
|
452
|
+
export const HEAP_FLAG_NAMES = new Set([
|
|
453
|
+
'max-old-space-size',
|
|
454
|
+
'max-old-space-size-percentage',
|
|
455
|
+
'max-semi-space-size',
|
|
456
|
+
]);
|
|
457
|
+
/** The two flags that set the old-space ceiling, which a plan replaces. */
|
|
458
|
+
const OLD_SPACE_FLAGS = new Set([
|
|
459
|
+
'max-old-space-size',
|
|
460
|
+
'max-old-space-size-percentage',
|
|
461
|
+
]);
|
|
462
|
+
/** The young-generation flag, capped at {@link MAX_SEMI_SPACE_MB}. */
|
|
463
|
+
const SEMI_SPACE_FLAG = new Set(['max-semi-space-size']);
|
|
464
|
+
function spannedWords(text) {
|
|
465
|
+
return [...text.matchAll(/\S+/g)].map((m) => ({
|
|
466
|
+
text: m[0],
|
|
467
|
+
start: m.index,
|
|
468
|
+
end: m.index + m[0].length,
|
|
469
|
+
}));
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Remove the heap flags named in `names` from a `NODE_OPTIONS` value, cutting
|
|
473
|
+
* their spans (and the whitespace before each) out of the original string, so
|
|
474
|
+
* every other byte — quoted paths with runs of spaces included — is kept.
|
|
475
|
+
*/
|
|
476
|
+
function cutHeapFlags(text, names) {
|
|
477
|
+
const words = spannedWords(text);
|
|
478
|
+
const tokens = words.map((w) => w.text);
|
|
479
|
+
let out = '';
|
|
480
|
+
let cursor = 0;
|
|
481
|
+
for (let i = 0; i < words.length; i++) {
|
|
482
|
+
const flag = heapTokenAt(tokens, i);
|
|
483
|
+
if (flag === null || !names.has(flag.name))
|
|
484
|
+
continue;
|
|
485
|
+
const first = words[i];
|
|
486
|
+
const last = words[i + flag.width - 1];
|
|
487
|
+
if (first === undefined || last === undefined)
|
|
488
|
+
continue;
|
|
489
|
+
// Drop the whitespace before the flag along with it.
|
|
490
|
+
let from = first.start;
|
|
491
|
+
while (from > cursor && /\s/.test(text[from - 1] ?? ''))
|
|
492
|
+
from--;
|
|
493
|
+
out += text.slice(cursor, from);
|
|
494
|
+
cursor = last.end;
|
|
495
|
+
i += flag.width - 1;
|
|
496
|
+
}
|
|
497
|
+
return (out + text.slice(cursor)).trim();
|
|
498
|
+
}
|
|
499
|
+
function heapTokenAt(tokens, i) {
|
|
500
|
+
const token = tokens[i] ?? '';
|
|
501
|
+
if (!token.startsWith('--'))
|
|
502
|
+
return null;
|
|
503
|
+
const eq = token.indexOf('=');
|
|
504
|
+
const name = (eq === -1 ? token.slice(2) : token.slice(2, eq)).replace(/_/g, '-');
|
|
505
|
+
if (!HEAP_FLAG_NAMES.has(name))
|
|
506
|
+
return null;
|
|
507
|
+
const next = tokens[i + 1];
|
|
508
|
+
if (eq === -1 && next !== undefined && /^\d+(\.\d+)?$/.test(next)) {
|
|
509
|
+
return { name, value: next, width: 2 };
|
|
510
|
+
}
|
|
511
|
+
return { name, value: eq === -1 ? '' : token.slice(eq + 1), width: 1 };
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* The V8 heap flags a `NODE_OPTIONS` value sets, by name, with the value in
|
|
515
|
+
* effect.
|
|
516
|
+
*
|
|
517
|
+
* V8 reads flags left to right and a later value replaces an earlier one, so
|
|
518
|
+
* the LAST occurrence of each flag is the effective one. Underscores in a flag
|
|
519
|
+
* name read as dashes, as they do to V8, and the space-separated spelling
|
|
520
|
+
* (`--max-old-space-size 4096`) is read too.
|
|
521
|
+
*
|
|
522
|
+
* @param nodeOptions - A `NODE_OPTIONS` value, if any.
|
|
523
|
+
* @returns flag name → effective value, in first-seen order.
|
|
524
|
+
*
|
|
525
|
+
* @task T12989
|
|
526
|
+
* @task T13122
|
|
527
|
+
*/
|
|
528
|
+
export function parseHeapFlags(nodeOptions) {
|
|
529
|
+
const tokens = (nodeOptions ?? '').trim().split(/\s+/).filter(Boolean);
|
|
530
|
+
const values = new Map();
|
|
531
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
532
|
+
const flag = heapTokenAt(tokens, i);
|
|
533
|
+
if (flag === null)
|
|
534
|
+
continue;
|
|
535
|
+
values.set(flag.name, flag.value);
|
|
536
|
+
i += flag.width - 1;
|
|
537
|
+
}
|
|
538
|
+
return values;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* The old-space heap ceiling a `NODE_OPTIONS` value asks for, in MiB, or
|
|
542
|
+
* `null` when it sets none (or sets one Node could not use).
|
|
543
|
+
*
|
|
544
|
+
* `--max-old-space-size-percentage` wins over `--max-old-space-size` whatever
|
|
545
|
+
* their order (measured on Node 24.21: `=10` beside `=2048` gave a 6745 MiB
|
|
546
|
+
* limit on a 64 GiB machine either way round), and resolves against total RAM.
|
|
547
|
+
*
|
|
548
|
+
* @param nodeOptions - A `NODE_OPTIONS` value, if any.
|
|
549
|
+
* @param totalRamMb - Total RAM in MiB, for the percentage form.
|
|
550
|
+
* @returns the requested heap in MiB, or `null`.
|
|
551
|
+
*
|
|
552
|
+
* @example
|
|
553
|
+
* ```ts
|
|
554
|
+
* inheritedHeapMb('--max-old-space-size=8192', 65536); // → 8192
|
|
555
|
+
* inheritedHeapMb('--max-old-space-size-percentage=25', 65536); // → 16384
|
|
556
|
+
* inheritedHeapMb('--enable-source-maps', 65536); // → null
|
|
557
|
+
* ```
|
|
558
|
+
*
|
|
559
|
+
* @task T13122
|
|
560
|
+
*/
|
|
561
|
+
export function inheritedHeapMb(nodeOptions, totalRamMb) {
|
|
562
|
+
const flags = parseHeapFlags(nodeOptions);
|
|
563
|
+
const pct = Number(flags.get('max-old-space-size-percentage') ?? Number.NaN);
|
|
564
|
+
if (Number.isFinite(pct) && pct > 0 && pct <= 100) {
|
|
565
|
+
return Math.floor((totalRamMb * pct) / 100);
|
|
566
|
+
}
|
|
567
|
+
const mb = Number(flags.get('max-old-space-size') ?? Number.NaN);
|
|
568
|
+
return Number.isFinite(mb) && mb >= 1 ? Math.floor(mb) : null;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Set the old-space heap ceiling in a `NODE_OPTIONS` value: every existing
|
|
572
|
+
* `--max-old-space-size` and `--max-old-space-size-percentage` is cut out and
|
|
573
|
+
* one `--max-old-space-size=<heapMb>` appended. Every other byte survives — a
|
|
574
|
+
* project may rely on `--experimental-*` or a quoted `--require` path there.
|
|
575
|
+
*
|
|
576
|
+
* Removing the percentage form is required, not tidiness: it outranks the size
|
|
577
|
+
* form whatever the order, so leaving it would silently undo the ceiling.
|
|
578
|
+
*
|
|
579
|
+
* @param existing - current `NODE_OPTIONS`, if any.
|
|
580
|
+
* @param heapMb - ceiling to apply.
|
|
581
|
+
* @returns the rewritten value.
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ```ts
|
|
585
|
+
* withHeapCeiling('--enable-source-maps --max-old-space-size=8192', 4096);
|
|
586
|
+
* // → '--enable-source-maps --max-old-space-size=4096'
|
|
587
|
+
* ```
|
|
588
|
+
*
|
|
589
|
+
* @task T13122
|
|
590
|
+
*/
|
|
591
|
+
export function withHeapCeiling(existing, heapMb) {
|
|
592
|
+
const rest = cutHeapFlags(existing ?? '', OLD_SPACE_FLAGS);
|
|
593
|
+
const flag = `--max-old-space-size=${heapMb}`;
|
|
594
|
+
return rest.length > 0 ? `${rest} ${flag}` : flag;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* Cap the semi-space (young generation) flag of a `NODE_OPTIONS` value at
|
|
598
|
+
* {@link MAX_SEMI_SPACE_MB}: a larger `--max-semi-space-size` is cut out and the
|
|
599
|
+
* cap appended. A value at or under the cap is left alone.
|
|
600
|
+
*
|
|
601
|
+
* @param existing - `NODE_OPTIONS`, if any.
|
|
602
|
+
* @returns The value to use, and the inherited semi-space it clamped (or `null`).
|
|
603
|
+
*
|
|
604
|
+
* @example
|
|
605
|
+
* ```ts
|
|
606
|
+
* withSemiSpaceCap('--max-semi-space-size=4096'); // → { value: '--max-semi-space-size=64', clampedFrom: 4096 }
|
|
607
|
+
* ```
|
|
608
|
+
*
|
|
609
|
+
* @task T13122
|
|
610
|
+
*/
|
|
611
|
+
export function withSemiSpaceCap(existing) {
|
|
612
|
+
const raw = parseHeapFlags(existing).get('max-semi-space-size');
|
|
613
|
+
const semi = Number(raw ?? Number.NaN);
|
|
614
|
+
if (raw === undefined || (Number.isFinite(semi) && semi <= MAX_SEMI_SPACE_MB)) {
|
|
615
|
+
return { value: existing, clampedFrom: null };
|
|
616
|
+
}
|
|
617
|
+
const rest = cutHeapFlags(existing ?? '', SEMI_SPACE_FLAG);
|
|
618
|
+
const flag = `--max-semi-space-size=${MAX_SEMI_SPACE_MB}`;
|
|
619
|
+
return {
|
|
620
|
+
value: rest.length > 0 ? `${rest} ${flag}` : flag,
|
|
621
|
+
clampedFrom: Number.isFinite(semi) ? semi : null,
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Bound an inherited `MAKEFLAGS` to `workers` jobs.
|
|
626
|
+
*
|
|
627
|
+
* Absent: `-j<workers>` (GNU make sizes a bare `-j` off nproc). Carrying a
|
|
628
|
+
* jobserver (`--jobserver-auth=` / `--jobserver-fds=`): kept, since inside a
|
|
629
|
+
* `make` recipe the parent's jobserver already bounds the jobs. Otherwise any
|
|
630
|
+
* `-j`, `-jN`, `--jobs[=N]`, a short cluster ending in j (`-sj18`) or make's
|
|
631
|
+
* dash-less first word (`j18`) above `workers` (a bare one is unlimited) is
|
|
632
|
+
* replaced by `-j<workers>`, keeping every other flag — a profile-wide
|
|
633
|
+
* `export MAKEFLAGS=-j18` no longer outruns the plan.
|
|
634
|
+
*
|
|
635
|
+
* @param raw - The inherited `MAKEFLAGS`.
|
|
636
|
+
* @param workers - The planned worker count.
|
|
637
|
+
* @returns The value to set, or `null` to keep the inherited one.
|
|
638
|
+
* @task T13122
|
|
639
|
+
*/
|
|
640
|
+
export function boundMakeflags(raw, workers) {
|
|
641
|
+
if (raw === undefined || raw.trim() === '')
|
|
642
|
+
return `-j${workers}`;
|
|
643
|
+
const words = raw.trim().split(/\s+/);
|
|
644
|
+
if (words.some((w) => /^--jobserver-(auth|fds)=/.test(w)))
|
|
645
|
+
return null;
|
|
646
|
+
const kept = [];
|
|
647
|
+
let over = false;
|
|
648
|
+
for (let i = 0; i < words.length; i++) {
|
|
649
|
+
const word = words[i] ?? '';
|
|
650
|
+
const long = /^--jobs(?:=(\d*))?$/.exec(word);
|
|
651
|
+
// A short-flag cluster ending in j (`-j18`, `-sj18`, `-kj`), or make's own
|
|
652
|
+
// dash-less letter form as the first word (`j18`, `kj`). Only make's
|
|
653
|
+
// argument-less short flags may precede the j: in `-Ij18` the `j18` is
|
|
654
|
+
// -I's directory, and splitting it would hand -I the `-j` (review of #1824).
|
|
655
|
+
const short = long === null ? /^(-?)([BbdehikLnpqrRsStvw]*)j(\d*)$/.exec(word) : null;
|
|
656
|
+
const isShort = short !== null && (short[1] === '-' || i === 0);
|
|
657
|
+
if (long === null && !isShort) {
|
|
658
|
+
kept.push(word);
|
|
659
|
+
continue;
|
|
660
|
+
}
|
|
661
|
+
let count = long !== null ? (long[1] ?? '') : (short?.[3] ?? '');
|
|
662
|
+
const takesNext = long !== null ? long[1] === undefined : count === '';
|
|
663
|
+
const next = words[i + 1];
|
|
664
|
+
if (count === '' && takesNext && next !== undefined && /^\d+$/.test(next)) {
|
|
665
|
+
count = next;
|
|
666
|
+
i++;
|
|
667
|
+
}
|
|
668
|
+
// The cluster's other letters (`s`, `k`) are flags of their own: keep them.
|
|
669
|
+
if (isShort && short?.[2])
|
|
670
|
+
kept.push(`-${short[2]}`);
|
|
671
|
+
if (count === '' || Number(count) > workers)
|
|
672
|
+
over = true;
|
|
673
|
+
else
|
|
674
|
+
kept.push(`-j${count}`);
|
|
675
|
+
}
|
|
676
|
+
return over ? [...kept.filter((w) => !/^-j\d+$/.test(w)), `-j${workers}`].join(' ') : null;
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Remove npm's `Unknown env config` warnings from captured output.
|
|
680
|
+
*
|
|
681
|
+
* npm warns once per run for every `npm_config_*` variable it does not know,
|
|
682
|
+
* including `npm_config_workspace_concurrency`, which the overlay sets for the
|
|
683
|
+
* `pnpm -r` an `npm test` script may run. The warning would otherwise sit in
|
|
684
|
+
* the stderr tail CLEO quotes when a tool fails and push the real error out of
|
|
685
|
+
* it; the variable itself stays, because dropping it for npm unbounded those
|
|
686
|
+
* child `pnpm -r` runs (review of #1808).
|
|
687
|
+
*
|
|
688
|
+
* @param text - Captured stderr.
|
|
689
|
+
* @returns The text without those warning lines.
|
|
690
|
+
* @task T13122
|
|
691
|
+
*/
|
|
692
|
+
export function withoutNpmEnvConfigWarnings(text) {
|
|
693
|
+
if (!text.includes('Unknown env config'))
|
|
694
|
+
return text;
|
|
695
|
+
return text
|
|
696
|
+
.split('\n')
|
|
697
|
+
.filter(
|
|
698
|
+
// A coloured npm (FORCE_COLOR, color=always) prefixes ANSI codes.
|
|
699
|
+
(line) => !/^npm (warn|WARN) Unknown env config\b/.test(line.replace(ANSI_SGR, '')))
|
|
700
|
+
.join('\n');
|
|
701
|
+
}
|
|
702
|
+
/** ANSI select-graphic-rendition escapes (colours), stripped before matching npm's warning. */
|
|
703
|
+
const ANSI_SGR = /\u001b\[[0-9;]*m/g;
|
|
704
|
+
/**
|
|
705
|
+
* Append `--max-old-space-size` to an existing `NODE_OPTIONS`, or create it,
|
|
706
|
+
* leaving an existing `--max-old-space-size` alone.
|
|
707
|
+
*
|
|
708
|
+
* @deprecated Since T13122 the heavy-tool overlay plans the heap against the
|
|
709
|
+
* run's budget instead of letting any inherited value win; use
|
|
710
|
+
* {@link planHeavyToolEnv} (or {@link withHeapCeiling} to set a ceiling).
|
|
711
|
+
* Kept for SDK consumers.
|
|
145
712
|
*
|
|
146
713
|
* @param existing - current `NODE_OPTIONS`, if any.
|
|
147
714
|
* @param heapMb - ceiling to apply.
|
|
@@ -154,50 +721,259 @@ export function mergeNodeOptions(existing, heapMb) {
|
|
|
154
721
|
const flag = `--max-old-space-size=${heapMb}`;
|
|
155
722
|
return current.length > 0 ? `${current} ${flag}` : flag;
|
|
156
723
|
}
|
|
724
|
+
/** A strictly positive base-10 integer, or `null` (`'50%'`, `'0'`, `'-1'`, `'4x'` are all `null`). */
|
|
725
|
+
function positiveInt(raw) {
|
|
726
|
+
const text = (raw ?? '').trim();
|
|
727
|
+
if (!/^\d+$/.test(text))
|
|
728
|
+
return null;
|
|
729
|
+
const n = Number.parseInt(text, 10);
|
|
730
|
+
return n > 0 ? n : null;
|
|
731
|
+
}
|
|
732
|
+
/** An explicit `CLEO_HEAVY_*` override, or `null`; an unusable value is noted and ignored. */
|
|
733
|
+
function readOverride(env, name, ignored) {
|
|
734
|
+
const raw = env[name];
|
|
735
|
+
if (raw === undefined || raw.trim() === '')
|
|
736
|
+
return null;
|
|
737
|
+
const n = positiveInt(raw);
|
|
738
|
+
if (n === null)
|
|
739
|
+
ignored.push(`${name}=${JSON.stringify(raw)} (not a positive integer)`);
|
|
740
|
+
return n;
|
|
741
|
+
}
|
|
742
|
+
/** The heap flags of a `NODE_OPTIONS` value as one readable string, e.g. `--max-old-space-size=8192`. */
|
|
743
|
+
function heapFlagsText(nodeOptions) {
|
|
744
|
+
return [...parseHeapFlags(nodeOptions)]
|
|
745
|
+
.filter(([name]) => OLD_SPACE_FLAGS.has(name))
|
|
746
|
+
.map(([name, value]) => `--${name}=${value}`)
|
|
747
|
+
.join(' ');
|
|
748
|
+
}
|
|
749
|
+
function chooseHeap(env, override, maxHeapMb, totalRamMb, defaultHeapMb) {
|
|
750
|
+
const inherited = inheritedHeapMb(env.NODE_OPTIONS, totalRamMb);
|
|
751
|
+
if (override !== null)
|
|
752
|
+
return { heapMb: override, source: 'override', inherited };
|
|
753
|
+
// The default heap never shrinks to fit an explicit workspace concurrency: a
|
|
754
|
+
// run asked for that way is reported over budget instead (`overBudget`).
|
|
755
|
+
if (inherited === null)
|
|
756
|
+
return { heapMb: defaultHeapMb, source: 'default', inherited };
|
|
757
|
+
if (inherited <= maxHeapMb)
|
|
758
|
+
return { heapMb: inherited, source: 'inherited', inherited };
|
|
759
|
+
return { heapMb: maxHeapMb, source: 'clamped', inherited };
|
|
760
|
+
}
|
|
761
|
+
/** One worker-count variable: keep an inherited value within the plan, else overlay the plan. */
|
|
762
|
+
function planCount(name, raw, planned, forced, overlay, clamped, kept) {
|
|
763
|
+
const inherited = positiveInt(raw);
|
|
764
|
+
if (!forced && inherited !== null && inherited <= planned) {
|
|
765
|
+
kept.push(`${name}=${inherited}`);
|
|
766
|
+
return;
|
|
767
|
+
}
|
|
768
|
+
overlay[name] = String(planned);
|
|
769
|
+
if (!forced && raw !== undefined && raw !== '') {
|
|
770
|
+
clamped.push({ name, from: raw, to: String(planned) });
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
/** A tool that runs as one process: nothing to size. */
|
|
774
|
+
const SINGLE_PROCESS = {
|
|
775
|
+
workers: 1,
|
|
776
|
+
source: 'plan',
|
|
777
|
+
reason: 'one process, no worker pool',
|
|
778
|
+
};
|
|
157
779
|
/**
|
|
158
|
-
*
|
|
780
|
+
* The worker count of a forking tool — `CLEO_HEAVY_WORKERS`, else as many as
|
|
781
|
+
* fit (`fit`, the budget over packages × heap), never above the default — written
|
|
782
|
+
* to every runner variable and to `MAKEFLAGS`.
|
|
783
|
+
*/
|
|
784
|
+
function planWorkers(env, fit, defaultWorkers, ledger) {
|
|
785
|
+
const override = readOverride(env, HEAVY_WORKERS_ENV, ledger.ignored);
|
|
786
|
+
const workers = override ?? Math.max(MIN_HEAVY_WORKERS, Math.min(defaultWorkers, Math.floor(fit)));
|
|
787
|
+
for (const key of WORKER_COUNT_VARS) {
|
|
788
|
+
planCount(key, env[key], workers, override !== null, ledger.overlay, ledger.clamped, ledger.kept);
|
|
789
|
+
}
|
|
790
|
+
// GNU make sizes `-j` off nproc when told `-j` with no argument; an explicit
|
|
791
|
+
// job count bounds a Makefile-driven test/build target too.
|
|
792
|
+
const makeflags = boundMakeflags(env.MAKEFLAGS, workers);
|
|
793
|
+
if (makeflags !== null) {
|
|
794
|
+
ledger.overlay.MAKEFLAGS = makeflags;
|
|
795
|
+
if (env.MAKEFLAGS && env.MAKEFLAGS.trim() !== '' && override === null) {
|
|
796
|
+
ledger.clamped.push({ name: 'MAKEFLAGS', from: env.MAKEFLAGS, to: makeflags });
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
if (override !== null)
|
|
800
|
+
return { workers, source: 'override', reason: HEAVY_WORKERS_ENV };
|
|
801
|
+
return {
|
|
802
|
+
workers,
|
|
803
|
+
source: 'plan',
|
|
804
|
+
reason: workers < defaultWorkers
|
|
805
|
+
? `fewer than the default ${defaultWorkers} so the run fits its budget`
|
|
806
|
+
: 'default for this RAM',
|
|
807
|
+
};
|
|
808
|
+
}
|
|
809
|
+
function heapReason(choice) {
|
|
810
|
+
switch (choice.source) {
|
|
811
|
+
case 'override':
|
|
812
|
+
return HEAVY_HEAP_ENV;
|
|
813
|
+
case 'inherited':
|
|
814
|
+
return 'inherited NODE_OPTIONS';
|
|
815
|
+
case 'clamped':
|
|
816
|
+
return `inherited NODE_OPTIONS asked for ${choice.inherited} MiB, more than the budget allows`;
|
|
817
|
+
default:
|
|
818
|
+
return 'CLEO default';
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Plan a heavy or memory-bound tool spawn: the environment overlay, and the
|
|
823
|
+
* resource plan behind it (T13122, T13123).
|
|
824
|
+
*
|
|
825
|
+
* The heap is chosen first — `CLEO_HEAVY_HEAP_MB`, else the inherited
|
|
826
|
+
* `NODE_OPTIONS` heap when it fits the budget (clamped to it otherwise), else
|
|
827
|
+
* {@link defaultHeavyHeapMb}. The worker count then derives from the heap
|
|
828
|
+
* actually in effect, `⌊budget / (packages × heap)⌋`, never above
|
|
829
|
+
* {@link heavyToolWorkers}, so `packages × workers × heap` stays within
|
|
830
|
+
* {@link heavyRunBudgetMb}. Inherited worker counts and workspace concurrency
|
|
831
|
+
* are kept at or below the plan and clamped above it; `CLEO_HEAVY_WORKERS` and
|
|
832
|
+
* `CLEO_HEAVY_WORKSPACE_CONCURRENCY` override.
|
|
159
833
|
*
|
|
160
|
-
*
|
|
161
|
-
*
|
|
834
|
+
* A single-process memory-bound tool (`typecheck`, `lint`) gets the same heap
|
|
835
|
+
* ceiling and workspace concurrency, and no worker variables: its plan is one
|
|
836
|
+
* process (T13123).
|
|
162
837
|
*
|
|
163
838
|
* @param canonical - the canonical tool about to be spawned.
|
|
164
839
|
* @param env - the environment the child would otherwise inherit.
|
|
165
840
|
* @param totalRamGib - total RAM in GiB; injectable for deterministic tests.
|
|
166
|
-
* @
|
|
841
|
+
* @param maxWorkers - at most this many workers (a run that names its test
|
|
842
|
+
* files needs no more than one per file, T13132). @defaultValue no limit
|
|
843
|
+
* @returns the overlay and plan; an empty overlay and `null` plan for a tool
|
|
844
|
+
* that is not memory-bound (`audit`, `security-scan`).
|
|
167
845
|
*
|
|
168
846
|
* @example
|
|
169
847
|
* ```ts
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* //
|
|
174
|
-
*
|
|
848
|
+
* // A shell profile exported an 8 GiB heap on a 64 GiB machine:
|
|
849
|
+
* const { overlay, resources } = planHeavyToolEnv(
|
|
850
|
+
* 'test', { NODE_OPTIONS: '--max-old-space-size=8192' }, 64);
|
|
851
|
+
* overlay.VITEST_MAX_WORKERS; // → '2' (2 × 8192 = the 16384 MiB budget)
|
|
852
|
+
* resources?.heapSource; // → 'inherited'
|
|
175
853
|
* ```
|
|
176
854
|
*
|
|
177
855
|
* @task T12096
|
|
856
|
+
* @task T13122
|
|
857
|
+
* @task T13123
|
|
858
|
+
* @task T13132
|
|
178
859
|
*/
|
|
179
|
-
export function
|
|
180
|
-
if (!
|
|
181
|
-
return {};
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
860
|
+
export function planHeavyToolEnv(canonical, env = process.env, totalRamGib = totalmem() / 1024 ** 3, maxWorkers) {
|
|
861
|
+
if (!isMemoryBoundTool(canonical))
|
|
862
|
+
return { overlay: {}, resources: null };
|
|
863
|
+
const totalRamMb = Math.floor(totalRamGib * 1024);
|
|
864
|
+
const defaultWorkers = Math.min(heavyToolWorkers(totalRamGib, env), Math.max(MIN_HEAVY_WORKERS, Math.floor(maxWorkers ?? Number.POSITIVE_INFINITY)));
|
|
865
|
+
// A single process starts from Node's own default ceiling on its machine; a
|
|
866
|
+
// forking tool from the heavy default. Both share the heavy run's budget.
|
|
867
|
+
const defaultHeapMb = isHeavyTool(canonical)
|
|
868
|
+
? defaultHeavyHeapMb(totalRamGib)
|
|
869
|
+
: defaultSingleProcessHeapMb(totalRamGib);
|
|
870
|
+
const budgetMb = defaultWorkers * defaultHeavyHeapMb(totalRamGib);
|
|
871
|
+
const overlay = {};
|
|
872
|
+
const clamped = [];
|
|
873
|
+
const kept = [];
|
|
874
|
+
const ignored = [];
|
|
875
|
+
// Packages in flight first: the heap ceiling an inherited value may keep is
|
|
876
|
+
// the budget shared between them.
|
|
877
|
+
const packagesOverride = readOverride(env, HEAVY_WORKSPACE_CONCURRENCY_ENV, ignored);
|
|
878
|
+
const packages = packagesOverride ?? WORKSPACE_CONCURRENCY;
|
|
879
|
+
const packageNames = workspaceConcurrencyNames(env);
|
|
880
|
+
for (const name of packageNames) {
|
|
881
|
+
planCount(name, env[name], packages, packagesOverride !== null, overlay, clamped, kept);
|
|
192
882
|
}
|
|
193
|
-
|
|
194
|
-
|
|
883
|
+
// What the child gets: the overlay's value, or the inherited one it kept —
|
|
884
|
+
// the largest across every spelling, since which one pnpm reads depends on
|
|
885
|
+
// its version and the case.
|
|
886
|
+
const packagesInFlight = Math.max(...packageNames.map((name) => positiveInt(overlay[name] ?? env[name]) ?? packages));
|
|
887
|
+
const heap = chooseHeap(env, readOverride(env, HEAVY_HEAP_ENV, ignored), Math.max(1, Math.floor(budgetMb / packagesInFlight)), totalRamMb, defaultHeapMb);
|
|
888
|
+
// Young generation first: three semi-spaces count toward the heap limit.
|
|
889
|
+
const semi = withSemiSpaceCap(env.NODE_OPTIONS);
|
|
890
|
+
if (semi.clampedFrom !== null) {
|
|
891
|
+
clamped.push({
|
|
892
|
+
name: 'NODE_OPTIONS',
|
|
893
|
+
from: `--max-semi-space-size=${semi.clampedFrom}`,
|
|
894
|
+
to: `--max-semi-space-size=${MAX_SEMI_SPACE_MB}`,
|
|
895
|
+
});
|
|
195
896
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
897
|
+
overlay.NODE_OPTIONS = withHeapCeiling(semi.value, heap.heapMb);
|
|
898
|
+
if (heap.source === 'clamped') {
|
|
899
|
+
clamped.push({
|
|
900
|
+
name: 'NODE_OPTIONS',
|
|
901
|
+
from: heapFlagsText(env.NODE_OPTIONS),
|
|
902
|
+
to: `--max-old-space-size=${heap.heapMb}`,
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
// A single-process tool (typecheck, lint) has no worker pool to size.
|
|
906
|
+
const pool = isHeavyTool(canonical)
|
|
907
|
+
? planWorkers(env, budgetMb / (packagesInFlight * heap.heapMb), defaultWorkers, {
|
|
908
|
+
overlay,
|
|
909
|
+
clamped,
|
|
910
|
+
kept,
|
|
911
|
+
ignored,
|
|
912
|
+
})
|
|
913
|
+
: SINGLE_PROCESS;
|
|
914
|
+
const { workers } = pool;
|
|
915
|
+
const product = packagesInFlight * workers * heap.heapMb;
|
|
916
|
+
const overBudget = product > budgetMb;
|
|
917
|
+
const parts = [
|
|
918
|
+
`heap ${heap.heapMb} MiB (${heapReason(heap)}) × ${workers} worker(s) (${pool.reason}) × ` +
|
|
919
|
+
`${packagesInFlight} workspace package(s) at once = ${product} MiB of a ${budgetMb} MiB budget ` +
|
|
920
|
+
`(${Math.round(totalRamMb / 1024)} GiB RAM)`,
|
|
921
|
+
];
|
|
922
|
+
if (clamped.length > 0) {
|
|
923
|
+
parts.push(`clamped ${clamped.map((c) => `${c.name} ${c.from} → ${c.to}`).join(', ')}; ` +
|
|
924
|
+
`set ${HEAVY_HEAP_ENV}, ${HEAVY_WORKERS_ENV} or ${HEAVY_WORKSPACE_CONCURRENCY_ENV} to ask for more`);
|
|
200
925
|
}
|
|
201
|
-
|
|
926
|
+
if (overBudget)
|
|
927
|
+
parts.push('OVER budget by an explicit CLEO_HEAVY_* override');
|
|
928
|
+
if (ignored.length > 0)
|
|
929
|
+
parts.push(`ignored ${ignored.join(', ')}`);
|
|
930
|
+
return {
|
|
931
|
+
overlay,
|
|
932
|
+
resources: {
|
|
933
|
+
heapMb: heap.heapMb,
|
|
934
|
+
heapSource: heap.source,
|
|
935
|
+
inheritedHeapMb: heap.inherited,
|
|
936
|
+
workers,
|
|
937
|
+
workersSource: pool.source,
|
|
938
|
+
workspaceConcurrency: packagesInFlight,
|
|
939
|
+
budgetMb,
|
|
940
|
+
totalRamMb,
|
|
941
|
+
clamped,
|
|
942
|
+
kept,
|
|
943
|
+
overBudget,
|
|
944
|
+
summary: parts.join('; '),
|
|
945
|
+
},
|
|
946
|
+
};
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Build the environment overlay for a heavy or memory-bound tool spawn: the
|
|
950
|
+
* `overlay` of {@link planHeavyToolEnv}.
|
|
951
|
+
*
|
|
952
|
+
* Returns an empty object for a tool that is not memory-bound, so the caller
|
|
953
|
+
* can merge unconditionally.
|
|
954
|
+
*
|
|
955
|
+
* @param canonical - the canonical tool about to be spawned.
|
|
956
|
+
* @param env - the environment the child would otherwise inherit.
|
|
957
|
+
* @param totalRamGib - total RAM in GiB; injectable for deterministic tests.
|
|
958
|
+
* @returns variables to overlay; inherited values within the plan are kept.
|
|
959
|
+
*
|
|
960
|
+
* @example
|
|
961
|
+
* ```ts
|
|
962
|
+
* const overlay = heavyToolEnv('test', {}, 62);
|
|
963
|
+
* // { NODE_OPTIONS: '--max-old-space-size=4096',
|
|
964
|
+
* // VITEST_MAX_WORKERS: '6',
|
|
965
|
+
* // npm_config_workspace_concurrency: '1', … }
|
|
966
|
+
* heavyToolEnv('typecheck', {}, 62);
|
|
967
|
+
* // { NODE_OPTIONS: '--max-old-space-size=4096',
|
|
968
|
+
* // npm_config_workspace_concurrency: '1', pnpm_config_workspace_concurrency: '1' }
|
|
969
|
+
* heavyToolEnv('audit', process.env, 62); // → {}
|
|
970
|
+
* ```
|
|
971
|
+
*
|
|
972
|
+
* @task T12096
|
|
973
|
+
* @task T13122
|
|
974
|
+
* @task T13123
|
|
975
|
+
*/
|
|
976
|
+
export function heavyToolEnv(canonical, env = process.env, totalRamGib = totalmem() / 1024 ** 3) {
|
|
977
|
+
return planHeavyToolEnv(canonical, env, totalRamGib).overlay;
|
|
202
978
|
}
|
|
203
979
|
//# sourceMappingURL=heavy-tool-env.js.map
|