@cleocode/core 2026.4.5 → 2026.4.7
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/discovery.d.ts +69 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1643 -2349
- package/dist/index.js.map +4 -4
- package/dist/init.d.ts +51 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/internal.d.ts +9 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/lifecycle/default-chain.d.ts +8 -2
- package/dist/lifecycle/default-chain.d.ts.map +1 -1
- package/dist/lifecycle/index.d.ts +1 -0
- package/dist/lifecycle/index.d.ts.map +1 -1
- package/dist/lifecycle/stage-guidance.d.ts +140 -0
- package/dist/lifecycle/stage-guidance.d.ts.map +1 -0
- package/dist/orchestration/protocol-validators.d.ts +122 -3
- package/dist/orchestration/protocol-validators.d.ts.map +1 -1
- package/dist/paths.d.ts +91 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/scaffold.d.ts +31 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/skills/dispatch.d.ts +1 -1
- package/dist/skills/skill-paths.d.ts +9 -6
- package/dist/skills/skill-paths.d.ts.map +1 -1
- package/dist/validation/protocols/_shared.d.ts +40 -0
- package/dist/validation/protocols/_shared.d.ts.map +1 -0
- package/dist/validation/protocols/architecture-decision.d.ts +23 -0
- package/dist/validation/protocols/architecture-decision.d.ts.map +1 -0
- package/dist/validation/protocols/artifact-publish.d.ts +22 -0
- package/dist/validation/protocols/artifact-publish.d.ts.map +1 -0
- package/dist/validation/protocols/consensus.d.ts +11 -17
- package/dist/validation/protocols/consensus.d.ts.map +1 -1
- package/dist/validation/protocols/contribution.d.ts +12 -17
- package/dist/validation/protocols/contribution.d.ts.map +1 -1
- package/dist/validation/protocols/decomposition.d.ts +18 -21
- package/dist/validation/protocols/decomposition.d.ts.map +1 -1
- package/dist/validation/protocols/implementation.d.ts +9 -17
- package/dist/validation/protocols/implementation.d.ts.map +1 -1
- package/dist/validation/protocols/provenance.d.ts +23 -0
- package/dist/validation/protocols/provenance.d.ts.map +1 -0
- package/dist/validation/protocols/release.d.ts +25 -0
- package/dist/validation/protocols/release.d.ts.map +1 -0
- package/dist/validation/protocols/research.d.ts +9 -17
- package/dist/validation/protocols/research.d.ts.map +1 -1
- package/dist/validation/protocols/specification.d.ts +7 -17
- package/dist/validation/protocols/specification.d.ts.map +1 -1
- package/dist/validation/protocols/testing.d.ts +22 -0
- package/dist/validation/protocols/testing.d.ts.map +1 -0
- package/dist/validation/protocols/validation.d.ts +22 -0
- package/dist/validation/protocols/validation.d.ts.map +1 -0
- package/package.json +7 -7
- package/src/discovery.ts +235 -0
- package/src/index.ts +16 -0
- package/src/init.ts +196 -0
- package/src/internal.ts +31 -1
- package/src/lifecycle/default-chain.ts +11 -2
- package/src/lifecycle/index.ts +10 -0
- package/src/lifecycle/stage-guidance.ts +282 -0
- package/src/orchestration/__tests__/protocol-validators.test.ts +259 -7
- package/src/orchestration/protocol-validators.ts +419 -4
- package/src/paths.ts +110 -0
- package/src/scaffold.ts +240 -4
- package/src/skills/dispatch.ts +6 -6
- package/src/skills/skill-paths.ts +27 -23
- package/src/validation/protocols/_shared.ts +88 -0
- package/src/validation/protocols/architecture-decision.ts +52 -0
- package/src/validation/protocols/artifact-publish.ts +49 -0
- package/src/validation/protocols/consensus.ts +44 -74
- package/src/validation/protocols/contribution.ts +28 -65
- package/src/validation/protocols/decomposition.ts +37 -64
- package/src/validation/protocols/implementation.ts +25 -65
- package/src/validation/protocols/protocols-markdown/architecture-decision.md +303 -0
- package/src/validation/protocols/protocols-markdown/artifact-publish.md +600 -0
- package/src/validation/protocols/protocols-markdown/consensus.md +322 -0
- package/src/validation/protocols/protocols-markdown/contribution.md +388 -0
- package/src/validation/protocols/protocols-markdown/decomposition.md +421 -0
- package/src/validation/protocols/protocols-markdown/implementation.md +357 -0
- package/src/validation/protocols/protocols-markdown/provenance.md +613 -0
- package/src/validation/protocols/protocols-markdown/release.md +783 -0
- package/src/validation/protocols/protocols-markdown/research.md +261 -0
- package/src/validation/protocols/protocols-markdown/specification.md +300 -0
- package/src/validation/protocols/protocols-markdown/testing.md +287 -0
- package/src/validation/protocols/protocols-markdown/validation.md +242 -0
- package/src/validation/protocols/provenance.ts +50 -0
- package/src/validation/protocols/release.ts +44 -0
- package/src/validation/protocols/research.ts +25 -87
- package/src/validation/protocols/specification.ts +27 -89
- package/src/validation/protocols/testing.ts +46 -0
- package/src/validation/protocols/validation.ts +46 -0
- package/dist/cant/approval.d.ts +0 -110
- package/dist/cant/approval.d.ts.map +0 -1
- package/dist/cant/context-builder.d.ts +0 -79
- package/dist/cant/context-builder.d.ts.map +0 -1
- package/dist/cant/discretion.d.ts +0 -95
- package/dist/cant/discretion.d.ts.map +0 -1
- package/dist/cant/index.d.ts +0 -25
- package/dist/cant/index.d.ts.map +0 -1
- package/dist/cant/parallel-runner.d.ts +0 -38
- package/dist/cant/parallel-runner.d.ts.map +0 -1
- package/dist/cant/types.d.ts +0 -127
- package/dist/cant/types.d.ts.map +0 -1
- package/dist/cant/workflow-executor.d.ts +0 -105
- package/dist/cant/workflow-executor.d.ts.map +0 -1
- package/dist/validation/protocols/release-protocol.d.ts +0 -27
- package/dist/validation/protocols/release-protocol.d.ts.map +0 -1
- package/dist/validation/protocols/testing-protocol.d.ts +0 -27
- package/dist/validation/protocols/testing-protocol.d.ts.map +0 -1
- package/dist/validation/protocols/validation-protocol.d.ts +0 -27
- package/dist/validation/protocols/validation-protocol.d.ts.map +0 -1
- package/schemas/agent-configs.schema.json +0 -120
- package/schemas/agent-registry.schema.json +0 -132
- package/schemas/archive.schema.json +0 -450
- package/schemas/brain-decision.schema.json +0 -69
- package/schemas/brain-learning.schema.json +0 -57
- package/schemas/brain-pattern.schema.json +0 -72
- package/schemas/critical-path.schema.json +0 -246
- package/schemas/deps-cache.schema.json +0 -97
- package/schemas/doctor-output.schema.json +0 -283
- package/schemas/error.schema.json +0 -161
- package/schemas/global-config.schema.json +0 -219
- package/schemas/grade.schema.json +0 -49
- package/schemas/log.schema.json +0 -250
- package/schemas/metrics.schema.json +0 -328
- package/schemas/migrations.schema.json +0 -150
- package/schemas/nexus-registry.schema.json +0 -90
- package/schemas/operation-constitution.schema.json +0 -438
- package/schemas/output.schema.json +0 -164
- package/schemas/projects-registry.schema.json +0 -107
- package/schemas/protocol-frontmatter.schema.json +0 -72
- package/schemas/rcasd-consensus-report.schema.json +0 -10
- package/schemas/rcasd-evidence.schema.json +0 -42
- package/schemas/rcasd-gate-result.schema.json +0 -46
- package/schemas/rcasd-hitl-resolution.schema.json +0 -10
- package/schemas/rcasd-index.schema.json +0 -10
- package/schemas/rcasd-manifest.schema.json +0 -10
- package/schemas/rcasd-research-output.schema.json +0 -10
- package/schemas/rcasd-spec-frontmatter.schema.json +0 -10
- package/schemas/rcasd-stage-transition.schema.json +0 -38
- package/schemas/releases.schema.json +0 -267
- package/schemas/skills-manifest.schema.json +0 -91
- package/schemas/spec-index.schema.json +0 -196
- package/schemas/system-flow-atlas.schema.json +0 -125
- package/src/__tests__/audit-prune.test.d.ts.map +0 -1
- package/src/__tests__/audit-prune.test.js +0 -162
- package/src/__tests__/audit-prune.test.js.map +0 -1
- package/src/__tests__/caamp-skill-install.test.d.ts.map +0 -1
- package/src/__tests__/caamp-skill-install.test.js +0 -147
- package/src/__tests__/caamp-skill-install.test.js.map +0 -1
- package/src/__tests__/cli-parity.test.d.ts.map +0 -1
- package/src/__tests__/cli-parity.test.js +0 -209
- package/src/__tests__/cli-parity.test.js.map +0 -1
- package/src/__tests__/config.test.d.ts.map +0 -1
- package/src/__tests__/config.test.js +0 -144
- package/src/__tests__/config.test.js.map +0 -1
- package/src/__tests__/core-parity.test.d.ts.map +0 -1
- package/src/__tests__/core-parity.test.js +0 -645
- package/src/__tests__/core-parity.test.js.map +0 -1
- package/src/__tests__/error-catalog.test.d.ts.map +0 -1
- package/src/__tests__/error-catalog.test.js +0 -127
- package/src/__tests__/error-catalog.test.js.map +0 -1
- package/src/__tests__/golden-parity.test.d.ts.map +0 -1
- package/src/__tests__/golden-parity.test.js +0 -212
- package/src/__tests__/golden-parity.test.js.map +0 -1
- package/src/__tests__/hooks.test.d.ts.map +0 -1
- package/src/__tests__/hooks.test.js +0 -201
- package/src/__tests__/hooks.test.js.map +0 -1
- package/src/__tests__/human-output.test.d.ts.map +0 -1
- package/src/__tests__/human-output.test.js +0 -158
- package/src/__tests__/human-output.test.js.map +0 -1
- package/src/__tests__/index-api-compat.test.d.ts.map +0 -1
- package/src/__tests__/index-api-compat.test.js +0 -16
- package/src/__tests__/index-api-compat.test.js.map +0 -1
- package/src/__tests__/init-e2e.test.d.ts.map +0 -1
- package/src/__tests__/init-e2e.test.js +0 -221
- package/src/__tests__/init-e2e.test.js.map +0 -1
- package/src/__tests__/injection-chain.test.d.ts.map +0 -1
- package/src/__tests__/injection-chain.test.js +0 -234
- package/src/__tests__/injection-chain.test.js.map +0 -1
- package/src/__tests__/injection-mvi-tiers.test.d.ts.map +0 -1
- package/src/__tests__/injection-mvi-tiers.test.js +0 -152
- package/src/__tests__/injection-mvi-tiers.test.js.map +0 -1
- package/src/__tests__/injection-shared.test.d.ts.map +0 -1
- package/src/__tests__/injection-shared.test.js +0 -194
- package/src/__tests__/injection-shared.test.js.map +0 -1
- package/src/__tests__/lafs-conformance.test.d.ts.map +0 -1
- package/src/__tests__/lafs-conformance.test.js +0 -786
- package/src/__tests__/lafs-conformance.test.js.map +0 -1
- package/src/__tests__/logger.test.d.ts.map +0 -1
- package/src/__tests__/logger.test.js +0 -75
- package/src/__tests__/logger.test.js.map +0 -1
- package/src/__tests__/paths.test.d.ts.map +0 -1
- package/src/__tests__/paths.test.js +0 -327
- package/src/__tests__/paths.test.js.map +0 -1
- package/src/__tests__/project-info.test.d.ts.map +0 -1
- package/src/__tests__/project-info.test.js +0 -156
- package/src/__tests__/project-info.test.js.map +0 -1
- package/src/__tests__/rcsd-pipeline-e2e.test.d.ts.map +0 -1
- package/src/__tests__/rcsd-pipeline-e2e.test.js +0 -263
- package/src/__tests__/rcsd-pipeline-e2e.test.js.map +0 -1
- package/src/__tests__/remote.test.d.ts.map +0 -1
- package/src/__tests__/remote.test.js +0 -149
- package/src/__tests__/remote.test.js.map +0 -1
- package/src/__tests__/scaffold.test.d.ts.map +0 -1
- package/src/__tests__/scaffold.test.js +0 -474
- package/src/__tests__/scaffold.test.js.map +0 -1
- package/src/__tests__/schema-management.test.d.ts.map +0 -1
- package/src/__tests__/schema-management.test.js +0 -287
- package/src/__tests__/schema-management.test.js.map +0 -1
- package/src/__tests__/schema.test.d.ts.map +0 -1
- package/src/__tests__/schema.test.js +0 -51
- package/src/__tests__/schema.test.js.map +0 -1
- package/src/__tests__/sharing.test.d.ts.map +0 -1
- package/src/__tests__/sharing.test.js +0 -160
- package/src/__tests__/sharing.test.js.map +0 -1
- package/src/__tests__/snapshot.test.d.ts.map +0 -1
- package/src/__tests__/snapshot.test.js +0 -72
- package/src/__tests__/snapshot.test.js.map +0 -1
- package/src/__tests__/upgrade.test.d.ts.map +0 -1
- package/src/__tests__/upgrade.test.js +0 -321
- package/src/__tests__/upgrade.test.js.map +0 -1
- package/src/adapters/__tests__/discovery.test.d.ts.map +0 -1
- package/src/adapters/__tests__/discovery.test.js +0 -56
- package/src/adapters/__tests__/discovery.test.js.map +0 -1
- package/src/adapters/__tests__/manager.test.d.ts.map +0 -1
- package/src/adapters/__tests__/manager.test.js +0 -260
- package/src/adapters/__tests__/manager.test.js.map +0 -1
- package/src/agents/__tests__/agent-registry.test.d.ts.map +0 -1
- package/src/agents/__tests__/agent-registry.test.js +0 -262
- package/src/agents/__tests__/agent-registry.test.js.map +0 -1
- package/src/agents/__tests__/capacity.test.d.ts.map +0 -1
- package/src/agents/__tests__/capacity.test.js +0 -173
- package/src/agents/__tests__/capacity.test.js.map +0 -1
- package/src/agents/__tests__/execution-learning.test.d.ts.map +0 -1
- package/src/agents/__tests__/execution-learning.test.js +0 -533
- package/src/agents/__tests__/execution-learning.test.js.map +0 -1
- package/src/agents/__tests__/health-monitor.test.d.ts.map +0 -1
- package/src/agents/__tests__/health-monitor.test.js +0 -259
- package/src/agents/__tests__/health-monitor.test.js.map +0 -1
- package/src/agents/__tests__/registry.test.d.ts.map +0 -1
- package/src/agents/__tests__/registry.test.js +0 -373
- package/src/agents/__tests__/registry.test.js.map +0 -1
- package/src/agents/__tests__/retry.test.d.ts.map +0 -1
- package/src/agents/__tests__/retry.test.js +0 -225
- package/src/agents/__tests__/retry.test.js.map +0 -1
- package/src/cant/__tests__/cant-agent-parse.test.d.ts.map +0 -1
- package/src/cant/__tests__/cant-agent-parse.test.js +0 -77
- package/src/cant/__tests__/cant-agent-parse.test.js.map +0 -1
- package/src/cant/__tests__/cant-agent-parse.test.ts +0 -94
- package/src/cant/approval.ts +0 -218
- package/src/cant/context-builder.ts +0 -135
- package/src/cant/discretion.ts +0 -149
- package/src/cant/index.ts +0 -58
- package/src/cant/parallel-runner.ts +0 -205
- package/src/cant/types.ts +0 -158
- package/src/cant/workflow-executor.ts +0 -618
- package/src/compliance/__tests__/sync.test.d.ts.map +0 -1
- package/src/compliance/__tests__/sync.test.js +0 -119
- package/src/compliance/__tests__/sync.test.js.map +0 -1
- package/src/conduit/__tests__/dual-api-e2e.test.d.ts.map +0 -1
- package/src/conduit/__tests__/dual-api-e2e.test.js +0 -178
- package/src/conduit/__tests__/dual-api-e2e.test.js.map +0 -1
- package/src/conduit/__tests__/dual-api-e2e.test.ts +0 -212
- package/src/conduit/__tests__/local-credential-flow.test.d.ts.map +0 -1
- package/src/conduit/__tests__/local-credential-flow.test.js +0 -185
- package/src/conduit/__tests__/local-credential-flow.test.js.map +0 -1
- package/src/conduit/__tests__/local-transport.test.d.ts.map +0 -1
- package/src/conduit/__tests__/local-transport.test.js +0 -404
- package/src/conduit/__tests__/local-transport.test.js.map +0 -1
- package/src/conduit/__tests__/sse-transport.test.d.ts.map +0 -1
- package/src/conduit/__tests__/sse-transport.test.js +0 -291
- package/src/conduit/__tests__/sse-transport.test.js.map +0 -1
- package/src/hooks/__tests__/provider-hooks.test.d.ts.map +0 -1
- package/src/hooks/__tests__/provider-hooks.test.js +0 -33
- package/src/hooks/__tests__/provider-hooks.test.js.map +0 -1
- package/src/hooks/__tests__/registry.test.d.ts.map +0 -1
- package/src/hooks/__tests__/registry.test.js +0 -37
- package/src/hooks/__tests__/registry.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/error-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/error-hooks.test.js +0 -90
- package/src/hooks/handlers/__tests__/error-hooks.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/file-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/file-hooks.test.js +0 -128
- package/src/hooks/handlers/__tests__/file-hooks.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js +0 -501
- package/src/hooks/handlers/__tests__/hook-automation-e2e.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/session-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/session-hooks.test.js +0 -54
- package/src/hooks/handlers/__tests__/session-hooks.test.js.map +0 -1
- package/src/hooks/handlers/__tests__/task-hooks.test.d.ts.map +0 -1
- package/src/hooks/handlers/__tests__/task-hooks.test.js +0 -77
- package/src/hooks/handlers/__tests__/task-hooks.test.js.map +0 -1
- package/src/intelligence/__tests__/adaptive-validation.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/adaptive-validation.test.js +0 -517
- package/src/intelligence/__tests__/adaptive-validation.test.js.map +0 -1
- package/src/intelligence/__tests__/impact.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/impact.test.js +0 -515
- package/src/intelligence/__tests__/impact.test.js.map +0 -1
- package/src/intelligence/__tests__/patterns.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/patterns.test.js +0 -370
- package/src/intelligence/__tests__/patterns.test.js.map +0 -1
- package/src/intelligence/__tests__/prediction.test.d.ts.map +0 -1
- package/src/intelligence/__tests__/prediction.test.js +0 -314
- package/src/intelligence/__tests__/prediction.test.js.map +0 -1
- package/src/lib/__tests__/retry.test.d.ts.map +0 -1
- package/src/lib/__tests__/retry.test.js +0 -225
- package/src/lib/__tests__/retry.test.js.map +0 -1
- package/src/lifecycle/__tests__/chain-store.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/chain-store.test.js +0 -243
- package/src/lifecycle/__tests__/chain-store.test.js.map +0 -1
- package/src/lifecycle/__tests__/consolidate-rcasd.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/consolidate-rcasd.test.js +0 -210
- package/src/lifecycle/__tests__/consolidate-rcasd.test.js.map +0 -1
- package/src/lifecycle/__tests__/default-chain.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/default-chain.test.js +0 -74
- package/src/lifecycle/__tests__/default-chain.test.js.map +0 -1
- package/src/lifecycle/__tests__/frontmatter.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/frontmatter.test.js +0 -229
- package/src/lifecycle/__tests__/frontmatter.test.js.map +0 -1
- package/src/lifecycle/__tests__/lifecycle.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/lifecycle.test.js +0 -126
- package/src/lifecycle/__tests__/lifecycle.test.js.map +0 -1
- package/src/lifecycle/__tests__/pipeline.integration.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/pipeline.integration.test.js +0 -977
- package/src/lifecycle/__tests__/pipeline.integration.test.js.map +0 -1
- package/src/lifecycle/__tests__/rcasd-paths.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/rcasd-paths.test.js +0 -206
- package/src/lifecycle/__tests__/rcasd-paths.test.js.map +0 -1
- package/src/lifecycle/__tests__/resume-schema-contract.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/resume-schema-contract.test.js +0 -246
- package/src/lifecycle/__tests__/resume-schema-contract.test.js.map +0 -1
- package/src/lifecycle/__tests__/stage-record-provenance.integration.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/stage-record-provenance.integration.test.js +0 -95
- package/src/lifecycle/__tests__/stage-record-provenance.integration.test.js.map +0 -1
- package/src/lifecycle/__tests__/tessera-engine.test.d.ts.map +0 -1
- package/src/lifecycle/__tests__/tessera-engine.test.js +0 -392
- package/src/lifecycle/__tests__/tessera-engine.test.js.map +0 -1
- package/src/memory/__tests__/auto-extract.test.d.ts.map +0 -1
- package/src/memory/__tests__/auto-extract.test.js +0 -197
- package/src/memory/__tests__/auto-extract.test.js.map +0 -1
- package/src/memory/__tests__/brain-automation.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-automation.test.js +0 -730
- package/src/memory/__tests__/brain-automation.test.js.map +0 -1
- package/src/memory/__tests__/brain-embedding.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-embedding.test.js +0 -92
- package/src/memory/__tests__/brain-embedding.test.js.map +0 -1
- package/src/memory/__tests__/brain-links.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-links.test.js +0 -221
- package/src/memory/__tests__/brain-links.test.js.map +0 -1
- package/src/memory/__tests__/brain-migration.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-migration.test.js +0 -180
- package/src/memory/__tests__/brain-migration.test.js.map +0 -1
- package/src/memory/__tests__/brain-retrieval.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-retrieval.test.js +0 -701
- package/src/memory/__tests__/brain-retrieval.test.js.map +0 -1
- package/src/memory/__tests__/brain-search.test.d.ts.map +0 -1
- package/src/memory/__tests__/brain-search.test.js +0 -180
- package/src/memory/__tests__/brain-search.test.js.map +0 -1
- package/src/memory/__tests__/claude-mem-migration.test.d.ts.map +0 -1
- package/src/memory/__tests__/claude-mem-migration.test.js +0 -424
- package/src/memory/__tests__/claude-mem-migration.test.js.map +0 -1
- package/src/memory/__tests__/decisions.test.d.ts.map +0 -1
- package/src/memory/__tests__/decisions.test.js +0 -253
- package/src/memory/__tests__/decisions.test.js.map +0 -1
- package/src/memory/__tests__/engine-compat.test.d.ts.map +0 -1
- package/src/memory/__tests__/engine-compat.test.js +0 -331
- package/src/memory/__tests__/engine-compat.test.js.map +0 -1
- package/src/memory/__tests__/memory-bridge.test.d.ts.map +0 -1
- package/src/memory/__tests__/memory-bridge.test.js +0 -231
- package/src/memory/__tests__/memory-bridge.test.js.map +0 -1
- package/src/memory/__tests__/pipeline-manifest-sqlite.test.d.ts.map +0 -1
- package/src/memory/__tests__/pipeline-manifest-sqlite.test.js +0 -516
- package/src/memory/__tests__/pipeline-manifest-sqlite.test.js.map +0 -1
- package/src/memory/__tests__/session-memory.test.d.ts.map +0 -1
- package/src/memory/__tests__/session-memory.test.js +0 -387
- package/src/memory/__tests__/session-memory.test.js.map +0 -1
- package/src/metrics/__tests__/model-provider-registry.test.d.ts.map +0 -1
- package/src/metrics/__tests__/model-provider-registry.test.js +0 -45
- package/src/metrics/__tests__/model-provider-registry.test.js.map +0 -1
- package/src/metrics/__tests__/provider-detection.test.d.ts.map +0 -1
- package/src/metrics/__tests__/provider-detection.test.js +0 -111
- package/src/metrics/__tests__/provider-detection.test.js.map +0 -1
- package/src/migration/__tests__/checksum.test.d.ts.map +0 -1
- package/src/migration/__tests__/checksum.test.js +0 -216
- package/src/migration/__tests__/checksum.test.js.map +0 -1
- package/src/migration/__tests__/logger.test.d.ts.map +0 -1
- package/src/migration/__tests__/logger.test.js +0 -256
- package/src/migration/__tests__/logger.test.js.map +0 -1
- package/src/migration/__tests__/migration-failure.integration.test.d.ts.map +0 -1
- package/src/migration/__tests__/migration-failure.integration.test.js +0 -515
- package/src/migration/__tests__/migration-failure.integration.test.js.map +0 -1
- package/src/migration/__tests__/migration.test.d.ts.map +0 -1
- package/src/migration/__tests__/migration.test.js +0 -82
- package/src/migration/__tests__/migration.test.js.map +0 -1
- package/src/migration/__tests__/state.test.d.ts.map +0 -1
- package/src/migration/__tests__/state.test.js +0 -330
- package/src/migration/__tests__/state.test.js.map +0 -1
- package/src/migration/__tests__/validate.test.d.ts.map +0 -1
- package/src/migration/__tests__/validate.test.js +0 -258
- package/src/migration/__tests__/validate.test.js.map +0 -1
- package/src/nexus/__tests__/deps.test.d.ts.map +0 -1
- package/src/nexus/__tests__/deps.test.js +0 -283
- package/src/nexus/__tests__/deps.test.js.map +0 -1
- package/src/nexus/__tests__/nexus-e2e.test.d.ts.map +0 -1
- package/src/nexus/__tests__/nexus-e2e.test.js +0 -1220
- package/src/nexus/__tests__/nexus-e2e.test.js.map +0 -1
- package/src/nexus/__tests__/permissions.test.d.ts.map +0 -1
- package/src/nexus/__tests__/permissions.test.js +0 -119
- package/src/nexus/__tests__/permissions.test.js.map +0 -1
- package/src/nexus/__tests__/query.test.d.ts.map +0 -1
- package/src/nexus/__tests__/query.test.js +0 -168
- package/src/nexus/__tests__/query.test.js.map +0 -1
- package/src/nexus/__tests__/reconcile.test.d.ts.map +0 -1
- package/src/nexus/__tests__/reconcile.test.js +0 -135
- package/src/nexus/__tests__/reconcile.test.js.map +0 -1
- package/src/nexus/__tests__/registry.test.d.ts.map +0 -1
- package/src/nexus/__tests__/registry.test.js +0 -229
- package/src/nexus/__tests__/registry.test.js.map +0 -1
- package/src/nexus/__tests__/transfer.test.d.ts.map +0 -1
- package/src/nexus/__tests__/transfer.test.js +0 -372
- package/src/nexus/__tests__/transfer.test.js.map +0 -1
- package/src/observability/__tests__/index.test.d.ts.map +0 -1
- package/src/observability/__tests__/index.test.js +0 -288
- package/src/observability/__tests__/index.test.js.map +0 -1
- package/src/observability/__tests__/log-filter.test.d.ts.map +0 -1
- package/src/observability/__tests__/log-filter.test.js +0 -151
- package/src/observability/__tests__/log-filter.test.js.map +0 -1
- package/src/observability/__tests__/log-parser.test.d.ts.map +0 -1
- package/src/observability/__tests__/log-parser.test.js +0 -170
- package/src/observability/__tests__/log-parser.test.js.map +0 -1
- package/src/observability/__tests__/log-reader.test.d.ts.map +0 -1
- package/src/observability/__tests__/log-reader.test.js +0 -150
- package/src/observability/__tests__/log-reader.test.js.map +0 -1
- package/src/orchestration/__tests__/autonomous-spec.test.d.ts.map +0 -1
- package/src/orchestration/__tests__/autonomous-spec.test.js +0 -419
- package/src/orchestration/__tests__/autonomous-spec.test.js.map +0 -1
- package/src/orchestration/__tests__/orchestration.test.d.ts.map +0 -1
- package/src/orchestration/__tests__/orchestration.test.js +0 -205
- package/src/orchestration/__tests__/orchestration.test.js.map +0 -1
- package/src/orchestration/__tests__/protocol-validators.test.d.ts.map +0 -1
- package/src/orchestration/__tests__/protocol-validators.test.js +0 -382
- package/src/orchestration/__tests__/protocol-validators.test.js.map +0 -1
- package/src/phases/__tests__/deps.test.d.ts.map +0 -1
- package/src/phases/__tests__/deps.test.js +0 -210
- package/src/phases/__tests__/deps.test.js.map +0 -1
- package/src/phases/__tests__/phases.test.d.ts.map +0 -1
- package/src/phases/__tests__/phases.test.js +0 -215
- package/src/phases/__tests__/phases.test.js.map +0 -1
- package/src/release/__tests__/artifacts.test.d.ts.map +0 -1
- package/src/release/__tests__/artifacts.test.js +0 -65
- package/src/release/__tests__/artifacts.test.js.map +0 -1
- package/src/release/__tests__/cancel-release.test.d.ts.map +0 -1
- package/src/release/__tests__/cancel-release.test.js +0 -154
- package/src/release/__tests__/cancel-release.test.js.map +0 -1
- package/src/release/__tests__/changelog-writer.test.d.ts.map +0 -1
- package/src/release/__tests__/changelog-writer.test.js +0 -132
- package/src/release/__tests__/changelog-writer.test.js.map +0 -1
- package/src/release/__tests__/push-policy.test.d.ts.map +0 -1
- package/src/release/__tests__/push-policy.test.js +0 -142
- package/src/release/__tests__/push-policy.test.js.map +0 -1
- package/src/release/__tests__/release.test.d.ts.map +0 -1
- package/src/release/__tests__/release.test.js +0 -25
- package/src/release/__tests__/release.test.js.map +0 -1
- package/src/sequence/__tests__/allocate.test.d.ts.map +0 -1
- package/src/sequence/__tests__/allocate.test.js +0 -113
- package/src/sequence/__tests__/allocate.test.js.map +0 -1
- package/src/sessions/__tests__/briefing-blocked.test.d.ts.map +0 -1
- package/src/sessions/__tests__/briefing-blocked.test.js +0 -117
- package/src/sessions/__tests__/briefing-blocked.test.js.map +0 -1
- package/src/sessions/__tests__/briefing.test.d.ts.map +0 -1
- package/src/sessions/__tests__/briefing.test.js +0 -336
- package/src/sessions/__tests__/briefing.test.js.map +0 -1
- package/src/sessions/__tests__/handoff-integration.test.d.ts.map +0 -1
- package/src/sessions/__tests__/handoff-integration.test.js +0 -264
- package/src/sessions/__tests__/handoff-integration.test.js.map +0 -1
- package/src/sessions/__tests__/handoff.test.d.ts.map +0 -1
- package/src/sessions/__tests__/handoff.test.js +0 -435
- package/src/sessions/__tests__/handoff.test.js.map +0 -1
- package/src/sessions/__tests__/index.test.d.ts.map +0 -1
- package/src/sessions/__tests__/index.test.js +0 -82
- package/src/sessions/__tests__/index.test.js.map +0 -1
- package/src/sessions/__tests__/session-cleanup.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-cleanup.test.js +0 -201
- package/src/sessions/__tests__/session-cleanup.test.js.map +0 -1
- package/src/sessions/__tests__/session-edge-cases.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-edge-cases.test.js +0 -251
- package/src/sessions/__tests__/session-edge-cases.test.js.map +0 -1
- package/src/sessions/__tests__/session-find.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-find.test.js +0 -210
- package/src/sessions/__tests__/session-find.test.js.map +0 -1
- package/src/sessions/__tests__/session-grade.integration.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-grade.integration.test.js +0 -287
- package/src/sessions/__tests__/session-grade.integration.test.js.map +0 -1
- package/src/sessions/__tests__/session-grade.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-grade.test.js +0 -630
- package/src/sessions/__tests__/session-grade.test.js.map +0 -1
- package/src/sessions/__tests__/session-memory-bridge.test.d.ts.map +0 -1
- package/src/sessions/__tests__/session-memory-bridge.test.js +0 -52
- package/src/sessions/__tests__/session-memory-bridge.test.js.map +0 -1
- package/src/sessions/__tests__/sessions.test.d.ts.map +0 -1
- package/src/sessions/__tests__/sessions.test.js +0 -113
- package/src/sessions/__tests__/sessions.test.js.map +0 -1
- package/src/skills/__tests__/discovery.test.d.ts.map +0 -1
- package/src/skills/__tests__/discovery.test.js +0 -171
- package/src/skills/__tests__/discovery.test.js.map +0 -1
- package/src/skills/__tests__/dispatch.test.d.ts.map +0 -1
- package/src/skills/__tests__/dispatch.test.js +0 -99
- package/src/skills/__tests__/dispatch.test.js.map +0 -1
- package/src/skills/__tests__/dynamic-skill-generator.test.d.ts.map +0 -1
- package/src/skills/__tests__/dynamic-skill-generator.test.js +0 -77
- package/src/skills/__tests__/dynamic-skill-generator.test.js.map +0 -1
- package/src/skills/__tests__/manifests.test.d.ts.map +0 -1
- package/src/skills/__tests__/manifests.test.js +0 -121
- package/src/skills/__tests__/manifests.test.js.map +0 -1
- package/src/skills/__tests__/precedence.test.d.ts.map +0 -1
- package/src/skills/__tests__/precedence.test.js +0 -325
- package/src/skills/__tests__/precedence.test.js.map +0 -1
- package/src/skills/__tests__/routing-table.test.d.ts.map +0 -1
- package/src/skills/__tests__/routing-table.test.js +0 -91
- package/src/skills/__tests__/routing-table.test.js.map +0 -1
- package/src/skills/__tests__/skill-paths.test.d.ts.map +0 -1
- package/src/skills/__tests__/skill-paths.test.js +0 -71
- package/src/skills/__tests__/skill-paths.test.js.map +0 -1
- package/src/skills/__tests__/test-utility.test.d.ts.map +0 -1
- package/src/skills/__tests__/test-utility.test.js +0 -59
- package/src/skills/__tests__/test-utility.test.js.map +0 -1
- package/src/skills/__tests__/token.test.d.ts.map +0 -1
- package/src/skills/__tests__/token.test.js +0 -135
- package/src/skills/__tests__/token.test.js.map +0 -1
- package/src/skills/__tests__/validation.test.d.ts.map +0 -1
- package/src/skills/__tests__/validation.test.js +0 -108
- package/src/skills/__tests__/validation.test.js.map +0 -1
- package/src/skills/__tests__/version.test.d.ts.map +0 -1
- package/src/skills/__tests__/version.test.js +0 -71
- package/src/skills/__tests__/version.test.js.map +0 -1
- package/src/skills/injection/__tests__/subagent.test.d.ts.map +0 -1
- package/src/skills/injection/__tests__/subagent.test.js +0 -122
- package/src/skills/injection/__tests__/subagent.test.js.map +0 -1
- package/src/skills/orchestrator/__tests__/spawn-tier.test.d.ts.map +0 -1
- package/src/skills/orchestrator/__tests__/spawn-tier.test.js +0 -228
- package/src/skills/orchestrator/__tests__/spawn-tier.test.js.map +0 -1
- package/src/spawn/__tests__/adapter-registry.test.d.ts.map +0 -1
- package/src/spawn/__tests__/adapter-registry.test.js +0 -76
- package/src/spawn/__tests__/adapter-registry.test.js.map +0 -1
- package/src/stats/__tests__/stats.test.d.ts.map +0 -1
- package/src/stats/__tests__/stats.test.js +0 -374
- package/src/stats/__tests__/stats.test.js.map +0 -1
- package/src/sticky/__tests__/purge.test.d.ts.map +0 -1
- package/src/sticky/__tests__/purge.test.js +0 -64
- package/src/sticky/__tests__/purge.test.js.map +0 -1
- package/src/store/__tests__/atomic.test.d.ts.map +0 -1
- package/src/store/__tests__/atomic.test.js +0 -81
- package/src/store/__tests__/atomic.test.js.map +0 -1
- package/src/store/__tests__/backup.test.d.ts.map +0 -1
- package/src/store/__tests__/backup.test.js +0 -131
- package/src/store/__tests__/backup.test.js.map +0 -1
- package/src/store/__tests__/brain-accessor-pageindex.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-accessor-pageindex.test.js +0 -179
- package/src/store/__tests__/brain-accessor-pageindex.test.js.map +0 -1
- package/src/store/__tests__/brain-accessor.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-accessor.test.js +0 -398
- package/src/store/__tests__/brain-accessor.test.js.map +0 -1
- package/src/store/__tests__/brain-pageindex.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-pageindex.test.js +0 -137
- package/src/store/__tests__/brain-pageindex.test.js.map +0 -1
- package/src/store/__tests__/brain-schema.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-schema.test.js +0 -137
- package/src/store/__tests__/brain-schema.test.js.map +0 -1
- package/src/store/__tests__/brain-vec.test.d.ts.map +0 -1
- package/src/store/__tests__/brain-vec.test.js +0 -100
- package/src/store/__tests__/brain-vec.test.js.map +0 -1
- package/src/store/__tests__/collision-detection.test.d.ts.map +0 -1
- package/src/store/__tests__/collision-detection.test.js +0 -165
- package/src/store/__tests__/collision-detection.test.js.map +0 -1
- package/src/store/__tests__/data-safety-central.test.d.ts.map +0 -1
- package/src/store/__tests__/data-safety-central.test.js +0 -408
- package/src/store/__tests__/data-safety-central.test.js.map +0 -1
- package/src/store/__tests__/db-helpers.test.d.ts.map +0 -1
- package/src/store/__tests__/db-helpers.test.js +0 -101
- package/src/store/__tests__/db-helpers.test.js.map +0 -1
- package/src/store/__tests__/e2e-safety-integration.test.d.ts.map +0 -1
- package/src/store/__tests__/e2e-safety-integration.test.js +0 -402
- package/src/store/__tests__/e2e-safety-integration.test.js.map +0 -1
- package/src/store/__tests__/git-checkpoint.test.d.ts.map +0 -1
- package/src/store/__tests__/git-checkpoint.test.js +0 -133
- package/src/store/__tests__/git-checkpoint.test.js.map +0 -1
- package/src/store/__tests__/idempotent-migration.test.d.ts.map +0 -1
- package/src/store/__tests__/idempotent-migration.test.js +0 -172
- package/src/store/__tests__/idempotent-migration.test.js.map +0 -1
- package/src/store/__tests__/import-logging.test.d.ts.map +0 -1
- package/src/store/__tests__/import-logging.test.js +0 -92
- package/src/store/__tests__/import-logging.test.js.map +0 -1
- package/src/store/__tests__/import-sort.test.d.ts.map +0 -1
- package/src/store/__tests__/import-sort.test.js +0 -109
- package/src/store/__tests__/import-sort.test.js.map +0 -1
- package/src/store/__tests__/json.test.d.ts.map +0 -1
- package/src/store/__tests__/json.test.js +0 -98
- package/src/store/__tests__/json.test.js.map +0 -1
- package/src/store/__tests__/lifecycle-schema-parity.test.d.ts.map +0 -1
- package/src/store/__tests__/lifecycle-schema-parity.test.js +0 -90
- package/src/store/__tests__/lifecycle-schema-parity.test.js.map +0 -1
- package/src/store/__tests__/migration-integration.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-integration.test.js +0 -238
- package/src/store/__tests__/migration-integration.test.js.map +0 -1
- package/src/store/__tests__/migration-retry.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-retry.test.js +0 -178
- package/src/store/__tests__/migration-retry.test.js.map +0 -1
- package/src/store/__tests__/migration-safety.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-safety.test.js +0 -756
- package/src/store/__tests__/migration-safety.test.js.map +0 -1
- package/src/store/__tests__/migration-sqlite.test.d.ts.map +0 -1
- package/src/store/__tests__/migration-sqlite.test.js +0 -544
- package/src/store/__tests__/migration-sqlite.test.js.map +0 -1
- package/src/store/__tests__/performance-safety.test.d.ts.map +0 -1
- package/src/store/__tests__/performance-safety.test.js +0 -157
- package/src/store/__tests__/performance-safety.test.js.map +0 -1
- package/src/store/__tests__/project-detect.test.d.ts.map +0 -1
- package/src/store/__tests__/project-detect.test.js +0 -609
- package/src/store/__tests__/project-detect.test.js.map +0 -1
- package/src/store/__tests__/project-registry.test.d.ts.map +0 -1
- package/src/store/__tests__/project-registry.test.js +0 -28
- package/src/store/__tests__/project-registry.test.js.map +0 -1
- package/src/store/__tests__/provider.test.d.ts.map +0 -1
- package/src/store/__tests__/provider.test.js +0 -15
- package/src/store/__tests__/provider.test.js.map +0 -1
- package/src/store/__tests__/relations.test.d.ts.map +0 -1
- package/src/store/__tests__/relations.test.js +0 -318
- package/src/store/__tests__/relations.test.js.map +0 -1
- package/src/store/__tests__/safety-accessor.test.d.ts.map +0 -1
- package/src/store/__tests__/safety-accessor.test.js +0 -219
- package/src/store/__tests__/safety-accessor.test.js.map +0 -1
- package/src/store/__tests__/sequence-validation.test.d.ts.map +0 -1
- package/src/store/__tests__/sequence-validation.test.js +0 -94
- package/src/store/__tests__/sequence-validation.test.js.map +0 -1
- package/src/store/__tests__/session-store.test.d.ts.map +0 -1
- package/src/store/__tests__/session-store.test.js +0 -463
- package/src/store/__tests__/session-store.test.js.map +0 -1
- package/src/store/__tests__/sqlite-backup.test.d.ts.map +0 -1
- package/src/store/__tests__/sqlite-backup.test.js +0 -72
- package/src/store/__tests__/sqlite-backup.test.js.map +0 -1
- package/src/store/__tests__/sqlite.test.d.ts.map +0 -1
- package/src/store/__tests__/sqlite.test.js +0 -256
- package/src/store/__tests__/sqlite.test.js.map +0 -1
- package/src/store/__tests__/task-store.test.d.ts.map +0 -1
- package/src/store/__tests__/task-store.test.js +0 -514
- package/src/store/__tests__/task-store.test.js.map +0 -1
- package/src/store/__tests__/test-db-helper.d.ts.map +0 -1
- package/src/store/__tests__/test-db-helper.js +0 -110
- package/src/store/__tests__/test-db-helper.js.map +0 -1
- package/src/store/__tests__/write-verification.test.d.ts.map +0 -1
- package/src/store/__tests__/write-verification.test.js +0 -185
- package/src/store/__tests__/write-verification.test.js.map +0 -1
- package/src/system/__tests__/cleanup.test.d.ts.map +0 -1
- package/src/system/__tests__/cleanup.test.js +0 -87
- package/src/system/__tests__/cleanup.test.js.map +0 -1
- package/src/system/__tests__/health.test.d.ts.map +0 -1
- package/src/system/__tests__/health.test.js +0 -55
- package/src/system/__tests__/health.test.js.map +0 -1
- package/src/task-work/__tests__/start-deps.test.d.ts.map +0 -1
- package/src/task-work/__tests__/start-deps.test.js +0 -152
- package/src/task-work/__tests__/start-deps.test.js.map +0 -1
- package/src/tasks/__tests__/add.test.d.ts.map +0 -1
- package/src/tasks/__tests__/add.test.js +0 -226
- package/src/tasks/__tests__/add.test.js.map +0 -1
- package/src/tasks/__tests__/archive.test.d.ts.map +0 -1
- package/src/tasks/__tests__/archive.test.js +0 -196
- package/src/tasks/__tests__/archive.test.js.map +0 -1
- package/src/tasks/__tests__/assignee.test.d.ts.map +0 -1
- package/src/tasks/__tests__/assignee.test.js +0 -125
- package/src/tasks/__tests__/assignee.test.js.map +0 -1
- package/src/tasks/__tests__/atomicity.test.d.ts.map +0 -1
- package/src/tasks/__tests__/atomicity.test.js +0 -192
- package/src/tasks/__tests__/atomicity.test.js.map +0 -1
- package/src/tasks/__tests__/cancel-ops.test.d.ts.map +0 -1
- package/src/tasks/__tests__/cancel-ops.test.js +0 -115
- package/src/tasks/__tests__/cancel-ops.test.js.map +0 -1
- package/src/tasks/__tests__/complete-unblocks.test.d.ts.map +0 -1
- package/src/tasks/__tests__/complete-unblocks.test.js +0 -151
- package/src/tasks/__tests__/complete-unblocks.test.js.map +0 -1
- package/src/tasks/__tests__/complete.test.d.ts.map +0 -1
- package/src/tasks/__tests__/complete.test.js +0 -230
- package/src/tasks/__tests__/complete.test.js.map +0 -1
- package/src/tasks/__tests__/delete.test.d.ts.map +0 -1
- package/src/tasks/__tests__/delete.test.js +0 -183
- package/src/tasks/__tests__/delete.test.js.map +0 -1
- package/src/tasks/__tests__/dependency-check.test.d.ts.map +0 -1
- package/src/tasks/__tests__/dependency-check.test.js +0 -293
- package/src/tasks/__tests__/dependency-check.test.js.map +0 -1
- package/src/tasks/__tests__/deps-ready.test.d.ts.map +0 -1
- package/src/tasks/__tests__/deps-ready.test.js +0 -68
- package/src/tasks/__tests__/deps-ready.test.js.map +0 -1
- package/src/tasks/__tests__/epic-enforcement.test.d.ts.map +0 -1
- package/src/tasks/__tests__/epic-enforcement.test.js +0 -669
- package/src/tasks/__tests__/epic-enforcement.test.js.map +0 -1
- package/src/tasks/__tests__/find.test.d.ts.map +0 -1
- package/src/tasks/__tests__/find.test.js +0 -163
- package/src/tasks/__tests__/find.test.js.map +0 -1
- package/src/tasks/__tests__/graph-ops.test.d.ts.map +0 -1
- package/src/tasks/__tests__/graph-ops.test.js +0 -174
- package/src/tasks/__tests__/graph-ops.test.js.map +0 -1
- package/src/tasks/__tests__/hierarchy-policy.test.d.ts.map +0 -1
- package/src/tasks/__tests__/hierarchy-policy.test.js +0 -399
- package/src/tasks/__tests__/hierarchy-policy.test.js.map +0 -1
- package/src/tasks/__tests__/hierarchy.test.d.ts.map +0 -1
- package/src/tasks/__tests__/hierarchy.test.js +0 -302
- package/src/tasks/__tests__/hierarchy.test.js.map +0 -1
- package/src/tasks/__tests__/id-generator.test.d.ts.map +0 -1
- package/src/tasks/__tests__/id-generator.test.js +0 -59
- package/src/tasks/__tests__/id-generator.test.js.map +0 -1
- package/src/tasks/__tests__/labels.test.d.ts.map +0 -1
- package/src/tasks/__tests__/labels.test.js +0 -173
- package/src/tasks/__tests__/labels.test.js.map +0 -1
- package/src/tasks/__tests__/list.test.d.ts.map +0 -1
- package/src/tasks/__tests__/list.test.js +0 -272
- package/src/tasks/__tests__/list.test.js.map +0 -1
- package/src/tasks/__tests__/minimal-test.test.d.ts.map +0 -1
- package/src/tasks/__tests__/minimal-test.test.js +0 -25
- package/src/tasks/__tests__/minimal-test.test.js.map +0 -1
- package/src/tasks/__tests__/phase-tracking.test.d.ts.map +0 -1
- package/src/tasks/__tests__/phase-tracking.test.js +0 -209
- package/src/tasks/__tests__/phase-tracking.test.js.map +0 -1
- package/src/tasks/__tests__/pipeline-stage.test.d.ts.map +0 -1
- package/src/tasks/__tests__/pipeline-stage.test.js +0 -277
- package/src/tasks/__tests__/pipeline-stage.test.js.map +0 -1
- package/src/tasks/__tests__/plan-priority.test.d.ts.map +0 -1
- package/src/tasks/__tests__/plan-priority.test.js +0 -133
- package/src/tasks/__tests__/plan-priority.test.js.map +0 -1
- package/src/tasks/__tests__/priority-normalization.test.d.ts.map +0 -1
- package/src/tasks/__tests__/priority-normalization.test.js +0 -117
- package/src/tasks/__tests__/priority-normalization.test.js.map +0 -1
- package/src/tasks/__tests__/relates.test.d.ts.map +0 -1
- package/src/tasks/__tests__/relates.test.js +0 -84
- package/src/tasks/__tests__/relates.test.js.map +0 -1
- package/src/tasks/__tests__/show-deps.test.d.ts.map +0 -1
- package/src/tasks/__tests__/show-deps.test.js +0 -182
- package/src/tasks/__tests__/show-deps.test.js.map +0 -1
- package/src/tasks/__tests__/show.test.d.ts.map +0 -1
- package/src/tasks/__tests__/show.test.js +0 -126
- package/src/tasks/__tests__/show.test.js.map +0 -1
- package/src/tasks/__tests__/staleness.test.d.ts.map +0 -1
- package/src/tasks/__tests__/staleness.test.js +0 -154
- package/src/tasks/__tests__/staleness.test.js.map +0 -1
- package/src/tasks/__tests__/task-ops-depends.test.d.ts.map +0 -1
- package/src/tasks/__tests__/task-ops-depends.test.js +0 -118
- package/src/tasks/__tests__/task-ops-depends.test.js.map +0 -1
- package/src/tasks/__tests__/update.test.d.ts.map +0 -1
- package/src/tasks/__tests__/update.test.js +0 -320
- package/src/tasks/__tests__/update.test.js.map +0 -1
- package/src/validation/__tests__/chain-validation.test.d.ts.map +0 -1
- package/src/validation/__tests__/chain-validation.test.js +0 -204
- package/src/validation/__tests__/chain-validation.test.js.map +0 -1
- package/src/validation/__tests__/compliance.test.d.ts.map +0 -1
- package/src/validation/__tests__/compliance.test.js +0 -83
- package/src/validation/__tests__/compliance.test.js.map +0 -1
- package/src/validation/__tests__/docs-sync.test.d.ts.map +0 -1
- package/src/validation/__tests__/docs-sync.test.js +0 -243
- package/src/validation/__tests__/docs-sync.test.js.map +0 -1
- package/src/validation/__tests__/doctor-gitignore.test.d.ts.map +0 -1
- package/src/validation/__tests__/doctor-gitignore.test.js +0 -154
- package/src/validation/__tests__/doctor-gitignore.test.js.map +0 -1
- package/src/validation/__tests__/doctor-injection.test.d.ts.map +0 -1
- package/src/validation/__tests__/doctor-injection.test.js +0 -230
- package/src/validation/__tests__/doctor-injection.test.js.map +0 -1
- package/src/validation/__tests__/doctor.test.d.ts.map +0 -1
- package/src/validation/__tests__/doctor.test.js +0 -202
- package/src/validation/__tests__/doctor.test.js.map +0 -1
- package/src/validation/__tests__/engine.test.d.ts.map +0 -1
- package/src/validation/__tests__/engine.test.js +0 -346
- package/src/validation/__tests__/engine.test.js.map +0 -1
- package/src/validation/__tests__/manifest.test.d.ts.map +0 -1
- package/src/validation/__tests__/manifest.test.js +0 -244
- package/src/validation/__tests__/manifest.test.js.map +0 -1
- package/src/validation/__tests__/protocol-common.test.d.ts.map +0 -1
- package/src/validation/__tests__/protocol-common.test.js +0 -112
- package/src/validation/__tests__/protocol-common.test.js.map +0 -1
- package/src/validation/__tests__/verification.test.d.ts.map +0 -1
- package/src/validation/__tests__/verification.test.js +0 -277
- package/src/validation/__tests__/verification.test.js.map +0 -1
- package/src/validation/protocols/release-protocol.ts +0 -80
- package/src/validation/protocols/testing-protocol.ts +0 -93
- package/src/validation/protocols/validation-protocol.ts +0 -93
|
@@ -1,786 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* LAFS conformance testing - verifies all command outputs produce valid LAFS envelopes.
|
|
3
|
-
*
|
|
4
|
-
* Uses @cleocode/lafs's validateEnvelope() and runEnvelopeConformance()
|
|
5
|
-
* for canonical validation instead of hand-rolled checks.
|
|
6
|
-
*
|
|
7
|
-
* @task T4672
|
|
8
|
-
* @task T4673
|
|
9
|
-
* @task T4668
|
|
10
|
-
* @task T4669
|
|
11
|
-
* @task T4670
|
|
12
|
-
* @task T4671
|
|
13
|
-
* @task T4701
|
|
14
|
-
* @task T4702
|
|
15
|
-
* @epic T4663
|
|
16
|
-
*/
|
|
17
|
-
import { runEnvelopeConformance, validateEnvelope } from '@cleocode/lafs';
|
|
18
|
-
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
|
19
|
-
import { enforceBudget, isWithinBudget } from '../../mcp/lib/budget.js';
|
|
20
|
-
import { createGatewayMeta } from '../../mcp/lib/gateway-meta.js';
|
|
21
|
-
import { createTestDb, makeTaskFile, } from '../store/__tests__/test-db-helper.js';
|
|
22
|
-
import { ExitCode, getExitCodeName, isErrorCode, isSuccessCode } from '@cleocode/contracts';
|
|
23
|
-
import { getCleoErrorRegistry, getRegistryEntry, isCleoRegisteredCode } from '../error-registry.js';
|
|
24
|
-
import { CleoError } from '../errors.js';
|
|
25
|
-
import { formatError, formatSuccess, pushWarning } from '../output.js';
|
|
26
|
-
import { createPage, paginate } from '../pagination.js';
|
|
27
|
-
import { validateHierarchyPlacement } from '../tasks/hierarchy-policy.js';
|
|
28
|
-
// ============================
|
|
29
|
-
// FULL LAFS ENVELOPE VALIDATION
|
|
30
|
-
// ============================
|
|
31
|
-
/**
|
|
32
|
-
* Validate a full LAFS envelope has required structural fields.
|
|
33
|
-
*
|
|
34
|
-
* @task T4672
|
|
35
|
-
*/
|
|
36
|
-
function isValidLafsEnvelope(json) {
|
|
37
|
-
try {
|
|
38
|
-
const parsed = JSON.parse(json);
|
|
39
|
-
if (typeof parsed.$schema !== 'string') {
|
|
40
|
-
return { valid: false, error: 'Missing $schema field' };
|
|
41
|
-
}
|
|
42
|
-
if (!parsed._meta || typeof parsed._meta !== 'object') {
|
|
43
|
-
return { valid: false, error: 'Missing _meta object' };
|
|
44
|
-
}
|
|
45
|
-
if (typeof parsed.success !== 'boolean') {
|
|
46
|
-
return { valid: false, error: 'Missing or non-boolean "success" field' };
|
|
47
|
-
}
|
|
48
|
-
if (parsed.success) {
|
|
49
|
-
if (!('result' in parsed)) {
|
|
50
|
-
return { valid: false, error: 'Success envelope missing "result" field' };
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
if (!parsed.error || typeof parsed.error !== 'object') {
|
|
55
|
-
return { valid: false, error: 'Error envelope missing "error" object' };
|
|
56
|
-
}
|
|
57
|
-
if (typeof parsed.error.message !== 'string') {
|
|
58
|
-
return { valid: false, error: 'Error envelope missing string "error.message"' };
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return { valid: true };
|
|
62
|
-
}
|
|
63
|
-
catch (e) {
|
|
64
|
-
return { valid: false, error: `Invalid JSON: ${e}` };
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// ============================
|
|
68
|
-
// PROTOCOL-BASED CONFORMANCE
|
|
69
|
-
// ============================
|
|
70
|
-
describe('LAFS Protocol Conformance (full envelope)', () => {
|
|
71
|
-
describe('formatSuccess with explicit operation', () => {
|
|
72
|
-
it('passes protocol validateEnvelope()', () => {
|
|
73
|
-
const json = formatSuccess({ task: { id: 'T001' } }, undefined, 'tasks.show');
|
|
74
|
-
const envelope = JSON.parse(json);
|
|
75
|
-
const result = validateEnvelope(envelope);
|
|
76
|
-
expect(result.valid).toBe(true);
|
|
77
|
-
});
|
|
78
|
-
it('includes $schema field', () => {
|
|
79
|
-
const json = formatSuccess({ id: 'T001' }, undefined, 'tasks.add');
|
|
80
|
-
const parsed = JSON.parse(json);
|
|
81
|
-
expect(parsed.$schema).toBe('https://lafs.dev/schemas/v1/envelope.schema.json');
|
|
82
|
-
});
|
|
83
|
-
it('includes _meta with all required LAFS fields', () => {
|
|
84
|
-
const json = formatSuccess({ count: 5 }, undefined, 'tasks.list');
|
|
85
|
-
const parsed = JSON.parse(json);
|
|
86
|
-
expect(parsed._meta).toBeDefined();
|
|
87
|
-
expect(parsed._meta.specVersion).toBe('1.2.3');
|
|
88
|
-
expect(parsed._meta.timestamp).toBeDefined();
|
|
89
|
-
expect(parsed._meta.operation).toBe('tasks.list');
|
|
90
|
-
expect(parsed._meta.requestId).toBeDefined();
|
|
91
|
-
expect(parsed._meta.transport).toBe('cli');
|
|
92
|
-
expect(parsed._meta.strict).toBe(true);
|
|
93
|
-
});
|
|
94
|
-
it('sets success=true and result field', () => {
|
|
95
|
-
const json = formatSuccess({ id: 'T001' }, undefined, 'tasks.add');
|
|
96
|
-
const parsed = JSON.parse(json);
|
|
97
|
-
expect(parsed.success).toBe(true);
|
|
98
|
-
expect(parsed.result).toEqual({ id: 'T001' });
|
|
99
|
-
// In strict mode, error is omitted rather than set to null
|
|
100
|
-
expect(parsed.error).toBeUndefined();
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
describe('formatSuccess without operation (defaults to cli.output)', () => {
|
|
104
|
-
it('produces full LAFS envelope with default operation', () => {
|
|
105
|
-
const json = formatSuccess({ task: { id: 'T001', title: 'Test' } });
|
|
106
|
-
const parsed = JSON.parse(json);
|
|
107
|
-
expect(parsed.$schema).toBe('https://lafs.dev/schemas/v1/envelope.schema.json');
|
|
108
|
-
expect(parsed._meta).toBeDefined();
|
|
109
|
-
expect(parsed._meta.operation).toBe('cli.output');
|
|
110
|
-
expect(parsed.success).toBe(true);
|
|
111
|
-
expect(parsed.result).toEqual({ task: { id: 'T001', title: 'Test' } });
|
|
112
|
-
});
|
|
113
|
-
it('passes protocol validateEnvelope() even without explicit operation', () => {
|
|
114
|
-
const json = formatSuccess({ items: [1, 2] });
|
|
115
|
-
const envelope = JSON.parse(json);
|
|
116
|
-
const result = validateEnvelope(envelope);
|
|
117
|
-
expect(result.valid).toBe(true);
|
|
118
|
-
});
|
|
119
|
-
it('includes optional message', () => {
|
|
120
|
-
const result = formatSuccess({ id: 'T001' }, 'Task created');
|
|
121
|
-
const parsed = JSON.parse(result);
|
|
122
|
-
expect(parsed.message).toBe('Task created');
|
|
123
|
-
});
|
|
124
|
-
it('handles null data', () => {
|
|
125
|
-
const result = formatSuccess(null);
|
|
126
|
-
expect(isValidLafsEnvelope(result).valid).toBe(true);
|
|
127
|
-
});
|
|
128
|
-
it('handles array data', () => {
|
|
129
|
-
const result = formatSuccess([1, 2, 3]);
|
|
130
|
-
expect(isValidLafsEnvelope(result).valid).toBe(true);
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
describe('formatError with explicit operation', () => {
|
|
134
|
-
it('passes protocol validateEnvelope()', () => {
|
|
135
|
-
const err = new CleoError(ExitCode.NOT_FOUND, 'Task not found');
|
|
136
|
-
const json = formatError(err, 'tasks.show');
|
|
137
|
-
const envelope = JSON.parse(json);
|
|
138
|
-
const result = validateEnvelope(envelope);
|
|
139
|
-
expect(result.valid).toBe(true);
|
|
140
|
-
});
|
|
141
|
-
it('produces LAFS error shape with category', () => {
|
|
142
|
-
const err = new CleoError(ExitCode.NOT_FOUND, 'Task not found');
|
|
143
|
-
const json = formatError(err, 'tasks.show');
|
|
144
|
-
const parsed = JSON.parse(json);
|
|
145
|
-
expect(parsed.success).toBe(false);
|
|
146
|
-
expect(parsed.result).toBeNull(); // result is required by schema even for errors
|
|
147
|
-
expect(parsed.error.code).toMatch(/^E_/);
|
|
148
|
-
expect(parsed.error.category).toBe('NOT_FOUND');
|
|
149
|
-
expect(typeof parsed.error.retryable).toBe('boolean');
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
describe('formatError without operation (defaults to cli.output)', () => {
|
|
153
|
-
it('produces full LAFS envelope with default operation', () => {
|
|
154
|
-
const err = new CleoError(ExitCode.NOT_FOUND, 'Task not found');
|
|
155
|
-
const json = formatError(err);
|
|
156
|
-
const parsed = JSON.parse(json);
|
|
157
|
-
expect(parsed.$schema).toBe('https://lafs.dev/schemas/v1/envelope.schema.json');
|
|
158
|
-
expect(parsed._meta).toBeDefined();
|
|
159
|
-
expect(parsed._meta.operation).toBe('cli.output');
|
|
160
|
-
expect(parsed.success).toBe(false);
|
|
161
|
-
expect(parsed.error.code).toMatch(/^E_/);
|
|
162
|
-
});
|
|
163
|
-
it('passes protocol validateEnvelope() even without explicit operation', () => {
|
|
164
|
-
const err = new CleoError(ExitCode.NOT_FOUND, 'Task not found');
|
|
165
|
-
const json = formatError(err);
|
|
166
|
-
const envelope = JSON.parse(json);
|
|
167
|
-
const result = validateEnvelope(envelope);
|
|
168
|
-
expect(result.valid).toBe(true);
|
|
169
|
-
});
|
|
170
|
-
it('includes LAFS error details', () => {
|
|
171
|
-
const err = new CleoError(ExitCode.NOT_FOUND, 'Task not found', {
|
|
172
|
-
fix: 'Use cleo list to find tasks',
|
|
173
|
-
alternatives: [
|
|
174
|
-
{ action: 'List tasks', command: 'cleo list' },
|
|
175
|
-
{ action: 'Search', command: 'cleo find query' },
|
|
176
|
-
],
|
|
177
|
-
});
|
|
178
|
-
const json = formatError(err);
|
|
179
|
-
const parsed = JSON.parse(json);
|
|
180
|
-
expect(parsed.error.details.fix).toBe('Use cleo list to find tasks');
|
|
181
|
-
expect(parsed.error.details.alternatives).toHaveLength(2);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
describe('runEnvelopeConformance()', () => {
|
|
185
|
-
it('full conformance suite passes for success envelope', () => {
|
|
186
|
-
const json = formatSuccess({ items: [1, 2] }, undefined, 'system.health');
|
|
187
|
-
const envelope = JSON.parse(json);
|
|
188
|
-
const report = runEnvelopeConformance(envelope);
|
|
189
|
-
expect(report.ok).toBe(true);
|
|
190
|
-
const failedChecks = report.checks.filter((c) => !c.pass);
|
|
191
|
-
expect(failedChecks).toHaveLength(0);
|
|
192
|
-
});
|
|
193
|
-
it('full conformance suite passes for error envelope (except code registry)', () => {
|
|
194
|
-
const err = new CleoError(ExitCode.VALIDATION_ERROR, 'Bad input');
|
|
195
|
-
const json = formatError(err, 'tasks.add');
|
|
196
|
-
const envelope = JSON.parse(json);
|
|
197
|
-
const report = runEnvelopeConformance(envelope);
|
|
198
|
-
// CLEO error codes aren't in the default LAFS registry, so
|
|
199
|
-
// error_code_registered and transport_mapping_consistent are expected
|
|
200
|
-
// to fail (CLEO has its own error code → exit code mapping).
|
|
201
|
-
const knownExclusions = new Set(['error_code_registered', 'transport_mapping_consistent']);
|
|
202
|
-
const failedChecks = report.checks.filter((c) => !c.pass && !knownExclusions.has(c.name));
|
|
203
|
-
expect(failedChecks).toHaveLength(0);
|
|
204
|
-
});
|
|
205
|
-
it('conformance passes for envelope without explicit operation', () => {
|
|
206
|
-
const json = formatSuccess({ data: 'test' });
|
|
207
|
-
const envelope = JSON.parse(json);
|
|
208
|
-
const report = runEnvelopeConformance(envelope);
|
|
209
|
-
expect(report.ok).toBe(true);
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
// ============================
|
|
214
|
-
// MCP GATEWAY META CONFORMANCE
|
|
215
|
-
// ============================
|
|
216
|
-
describe('MCP Gateway Meta', () => {
|
|
217
|
-
it('createGatewayMeta includes all LAFS fields', () => {
|
|
218
|
-
const startTime = Date.now();
|
|
219
|
-
const meta = createGatewayMeta('query', 'tasks', 'list', startTime);
|
|
220
|
-
expect(meta.specVersion).toBe('1.2.3');
|
|
221
|
-
expect(meta.schemaVersion).toBe('2026.2.1');
|
|
222
|
-
expect(meta.timestamp).toBeDefined();
|
|
223
|
-
expect(meta.operation).toBe('list');
|
|
224
|
-
expect(meta.requestId).toBeDefined();
|
|
225
|
-
expect(meta.transport).toBe('sdk');
|
|
226
|
-
expect(meta.strict).toBe(true);
|
|
227
|
-
expect(meta.mvi).toBe('standard');
|
|
228
|
-
expect(meta.contextVersion).toBe(1);
|
|
229
|
-
});
|
|
230
|
-
it('createGatewayMeta includes CLEO gateway extensions', () => {
|
|
231
|
-
const startTime = Date.now();
|
|
232
|
-
const meta = createGatewayMeta('mutate', 'session', 'start', startTime);
|
|
233
|
-
expect(meta.gateway).toBe('mutate');
|
|
234
|
-
expect(meta.domain).toBe('session');
|
|
235
|
-
expect(typeof meta.duration_ms).toBe('number');
|
|
236
|
-
});
|
|
237
|
-
it('gateway meta produces unique requestId per call', () => {
|
|
238
|
-
const now = Date.now();
|
|
239
|
-
const m1 = createGatewayMeta('q', 'd', 'op', now);
|
|
240
|
-
const m2 = createGatewayMeta('q', 'd', 'op', now);
|
|
241
|
-
expect(m1.requestId).not.toBe(m2.requestId);
|
|
242
|
-
});
|
|
243
|
-
});
|
|
244
|
-
// ============================
|
|
245
|
-
// CLEO ERROR -> LAFS ERROR
|
|
246
|
-
// ============================
|
|
247
|
-
describe('CleoError LAFS Shape', () => {
|
|
248
|
-
it('toLAFSError() produces protocol-conformant error', () => {
|
|
249
|
-
const err = new CleoError(ExitCode.NOT_FOUND, 'Task not found');
|
|
250
|
-
const lafsErr = err.toLAFSError();
|
|
251
|
-
expect(lafsErr.code).toMatch(/^E_CLEO_NOT_FOUND/);
|
|
252
|
-
expect(lafsErr.category).toBe('NOT_FOUND');
|
|
253
|
-
expect(typeof lafsErr.retryable).toBe('boolean');
|
|
254
|
-
expect(lafsErr.message).toBe('Task not found');
|
|
255
|
-
});
|
|
256
|
-
it('toLAFSError() marks recoverable codes as retryable', () => {
|
|
257
|
-
const err = new CleoError(ExitCode.LOCK_TIMEOUT, 'Lock held');
|
|
258
|
-
const lafsErr = err.toLAFSError();
|
|
259
|
-
expect(lafsErr.retryable).toBe(true);
|
|
260
|
-
});
|
|
261
|
-
it('toLAFSError() includes details with exitCode', () => {
|
|
262
|
-
const err = new CleoError(ExitCode.VALIDATION_ERROR, 'Bad field', {
|
|
263
|
-
fix: 'Check field lengths',
|
|
264
|
-
});
|
|
265
|
-
const lafsErr = err.toLAFSError();
|
|
266
|
-
expect(lafsErr.details).toBeDefined();
|
|
267
|
-
expect(lafsErr.details.exitCode).toBe(ExitCode.VALIDATION_ERROR);
|
|
268
|
-
expect(lafsErr.details.fix).toBe('Check field lengths');
|
|
269
|
-
});
|
|
270
|
-
it('backward-compat toJSON() still produces old shape', () => {
|
|
271
|
-
const err = new CleoError(ExitCode.VALIDATION_ERROR, 'Invalid input');
|
|
272
|
-
const json = err.toJSON();
|
|
273
|
-
expect(json.success).toBe(false);
|
|
274
|
-
expect(json.error.code).toBe(ExitCode.VALIDATION_ERROR);
|
|
275
|
-
expect(json.error.name).toBe('VALIDATION_ERROR');
|
|
276
|
-
});
|
|
277
|
-
});
|
|
278
|
-
// ============================
|
|
279
|
-
// EXIT CODE TAXONOMY
|
|
280
|
-
// ============================
|
|
281
|
-
describe('Exit Code Taxonomy', () => {
|
|
282
|
-
it('all error codes are in range 1-99', () => {
|
|
283
|
-
const errorCodes = Object.values(ExitCode).filter((v) => typeof v === 'number' && v >= 1 && v < 100);
|
|
284
|
-
for (const code of errorCodes) {
|
|
285
|
-
expect(isErrorCode(code)).toBe(true);
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
it('success codes are 0 or 100+', () => {
|
|
289
|
-
expect(isSuccessCode(ExitCode.SUCCESS)).toBe(true);
|
|
290
|
-
expect(isSuccessCode(ExitCode.NO_DATA)).toBe(true);
|
|
291
|
-
expect(isSuccessCode(ExitCode.ALREADY_EXISTS)).toBe(true);
|
|
292
|
-
expect(isSuccessCode(ExitCode.NO_CHANGE)).toBe(true);
|
|
293
|
-
});
|
|
294
|
-
it('all exit codes have names', () => {
|
|
295
|
-
const allCodes = Object.values(ExitCode).filter((v) => typeof v === 'number');
|
|
296
|
-
for (const code of allCodes) {
|
|
297
|
-
const name = getExitCodeName(code);
|
|
298
|
-
expect(name).not.toBe('UNKNOWN');
|
|
299
|
-
expect(name.length).toBeGreaterThan(0);
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
});
|
|
303
|
-
// ============================
|
|
304
|
-
// INTEGRATION TESTS
|
|
305
|
-
// ============================
|
|
306
|
-
describe('LAFS Integration with Core Modules', () => {
|
|
307
|
-
let env;
|
|
308
|
-
let accessor;
|
|
309
|
-
beforeEach(async () => {
|
|
310
|
-
env = await createTestDb();
|
|
311
|
-
accessor = env.accessor;
|
|
312
|
-
const taskFile = makeTaskFile([
|
|
313
|
-
{
|
|
314
|
-
id: 'T001',
|
|
315
|
-
title: 'Test task',
|
|
316
|
-
status: 'pending',
|
|
317
|
-
priority: 'medium',
|
|
318
|
-
phase: 'core',
|
|
319
|
-
createdAt: '2026-01-01T00:00:00Z',
|
|
320
|
-
},
|
|
321
|
-
]);
|
|
322
|
-
taskFile.project = {
|
|
323
|
-
name: 'Test',
|
|
324
|
-
phases: { core: { order: 1, name: 'Core', status: 'active' } },
|
|
325
|
-
};
|
|
326
|
-
await accessor.saveTaskFile(taskFile);
|
|
327
|
-
});
|
|
328
|
-
afterEach(async () => {
|
|
329
|
-
await env.cleanup();
|
|
330
|
-
});
|
|
331
|
-
it('addTask result produces valid full LAFS envelope (no operation)', async () => {
|
|
332
|
-
const { addTask } = await import('../tasks/add.js');
|
|
333
|
-
const result = await addTask({ title: 'New task' }, env.tempDir, accessor);
|
|
334
|
-
const json = formatSuccess({ task: result.task });
|
|
335
|
-
expect(isValidLafsEnvelope(json).valid).toBe(true);
|
|
336
|
-
const envelope = JSON.parse(json);
|
|
337
|
-
const validation = validateEnvelope(envelope);
|
|
338
|
-
expect(validation.valid).toBe(true);
|
|
339
|
-
});
|
|
340
|
-
it('addTask result produces valid full LAFS envelope (explicit operation)', async () => {
|
|
341
|
-
const { addTask } = await import('../tasks/add.js');
|
|
342
|
-
const result = await addTask({ title: 'Full LAFS task' }, env.tempDir, accessor);
|
|
343
|
-
const json = formatSuccess({ task: result.task }, undefined, 'tasks.add');
|
|
344
|
-
const envelope = JSON.parse(json);
|
|
345
|
-
const validation = validateEnvelope(envelope);
|
|
346
|
-
expect(validation.valid).toBe(true);
|
|
347
|
-
});
|
|
348
|
-
it('listPhases result produces valid LAFS', async () => {
|
|
349
|
-
const { listPhases } = await import('../phases/index.js');
|
|
350
|
-
const result = await listPhases(env.tempDir, accessor);
|
|
351
|
-
const json = formatSuccess(result);
|
|
352
|
-
expect(isValidLafsEnvelope(json).valid).toBe(true);
|
|
353
|
-
});
|
|
354
|
-
it('error from showTask produces valid LAFS', async () => {
|
|
355
|
-
const { showTask } = await import('../tasks/show.js');
|
|
356
|
-
try {
|
|
357
|
-
await showTask('T999', env.tempDir, accessor);
|
|
358
|
-
}
|
|
359
|
-
catch (err) {
|
|
360
|
-
if (err instanceof CleoError) {
|
|
361
|
-
const json = formatError(err);
|
|
362
|
-
expect(isValidLafsEnvelope(json).valid).toBe(true);
|
|
363
|
-
const envelope = JSON.parse(json);
|
|
364
|
-
const validation = validateEnvelope(envelope);
|
|
365
|
-
expect(validation.valid).toBe(true);
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
|
-
});
|
|
370
|
-
// ============================
|
|
371
|
-
// T4668: PAGINATION
|
|
372
|
-
// ============================
|
|
373
|
-
describe('LAFSPage Pagination (T4668)', () => {
|
|
374
|
-
it('createPage returns mode:"none" when no limit/offset', () => {
|
|
375
|
-
const page = createPage({ total: 100 });
|
|
376
|
-
expect(page.mode).toBe('none');
|
|
377
|
-
});
|
|
378
|
-
it('createPage returns offset page with hasMore=true when more data exists', () => {
|
|
379
|
-
const page = createPage({ total: 100, limit: 20, offset: 0 });
|
|
380
|
-
expect(page.mode).toBe('offset');
|
|
381
|
-
if (page.mode === 'offset') {
|
|
382
|
-
expect(page.hasMore).toBe(true);
|
|
383
|
-
expect(page.total).toBe(100);
|
|
384
|
-
expect(page.limit).toBe(20);
|
|
385
|
-
expect(page.offset).toBe(0);
|
|
386
|
-
}
|
|
387
|
-
});
|
|
388
|
-
it('createPage returns hasMore=false on last page', () => {
|
|
389
|
-
const page = createPage({ total: 100, limit: 20, offset: 80 });
|
|
390
|
-
expect(page.mode).toBe('offset');
|
|
391
|
-
if (page.mode === 'offset') {
|
|
392
|
-
expect(page.hasMore).toBe(false);
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
it('paginate slices array and returns page metadata', () => {
|
|
396
|
-
const items = Array.from({ length: 50 }, (_, i) => i);
|
|
397
|
-
const result = paginate(items, 10, 5);
|
|
398
|
-
expect(result.items).toHaveLength(10);
|
|
399
|
-
expect(result.items[0]).toBe(5);
|
|
400
|
-
expect(result.page.mode).toBe('offset');
|
|
401
|
-
if (result.page.mode === 'offset') {
|
|
402
|
-
expect(result.page.hasMore).toBe(true);
|
|
403
|
-
expect(result.page.total).toBe(50);
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
it('paginate returns all items when no pagination specified', () => {
|
|
407
|
-
const items = [1, 2, 3];
|
|
408
|
-
const result = paginate(items);
|
|
409
|
-
expect(result.items).toEqual([1, 2, 3]);
|
|
410
|
-
expect(result.page.mode).toBe('none');
|
|
411
|
-
});
|
|
412
|
-
it('formatSuccess includes page field when provided', () => {
|
|
413
|
-
const page = createPage({ total: 100, limit: 20, offset: 0 });
|
|
414
|
-
const json = formatSuccess({ tasks: [] }, undefined, { operation: 'tasks.list', page });
|
|
415
|
-
const parsed = JSON.parse(json);
|
|
416
|
-
expect(parsed.page).toBeDefined();
|
|
417
|
-
expect(parsed.page.mode).toBe('offset');
|
|
418
|
-
expect(parsed.page.hasMore).toBe(true);
|
|
419
|
-
});
|
|
420
|
-
});
|
|
421
|
-
// ============================
|
|
422
|
-
// T4669: WARNINGS
|
|
423
|
-
// ============================
|
|
424
|
-
describe('_meta.warnings Deprecation Support (T4669)', () => {
|
|
425
|
-
it('pushWarning adds warning to next envelope', () => {
|
|
426
|
-
pushWarning({
|
|
427
|
-
code: 'DEPRECATED_FLAG',
|
|
428
|
-
message: '--legacy flag is deprecated',
|
|
429
|
-
deprecated: '--legacy',
|
|
430
|
-
replacement: '--modern',
|
|
431
|
-
removeBy: '2027.1.0',
|
|
432
|
-
});
|
|
433
|
-
const json = formatSuccess({ ok: true });
|
|
434
|
-
const parsed = JSON.parse(json);
|
|
435
|
-
expect(parsed._meta.warnings).toBeDefined();
|
|
436
|
-
expect(parsed._meta.warnings).toHaveLength(1);
|
|
437
|
-
expect(parsed._meta.warnings[0].code).toBe('DEPRECATED_FLAG');
|
|
438
|
-
expect(parsed._meta.warnings[0].replacement).toBe('--modern');
|
|
439
|
-
});
|
|
440
|
-
it('warnings are drained after consumption', () => {
|
|
441
|
-
pushWarning({ code: 'TEST', message: 'test warning' });
|
|
442
|
-
formatSuccess({ ok: true }); // consumes
|
|
443
|
-
const json = formatSuccess({ ok: true }); // no warnings
|
|
444
|
-
const parsed = JSON.parse(json);
|
|
445
|
-
expect(parsed._meta.warnings).toBeUndefined();
|
|
446
|
-
});
|
|
447
|
-
it('envelope with warnings still passes validation', () => {
|
|
448
|
-
pushWarning({ code: 'W001', message: 'test warning' });
|
|
449
|
-
const json = formatSuccess({ data: 1 }, undefined, 'system.test');
|
|
450
|
-
const envelope = JSON.parse(json);
|
|
451
|
-
const result = validateEnvelope(envelope);
|
|
452
|
-
expect(result.valid).toBe(true);
|
|
453
|
-
});
|
|
454
|
-
});
|
|
455
|
-
// ============================
|
|
456
|
-
// T4670: EXTENSIONS
|
|
457
|
-
// ============================
|
|
458
|
-
describe('_extensions CLEO Metadata (T4670)', () => {
|
|
459
|
-
it('formatSuccess includes _extensions when provided', () => {
|
|
460
|
-
const json = formatSuccess({ ok: true }, undefined, {
|
|
461
|
-
operation: 'system.status',
|
|
462
|
-
extensions: {
|
|
463
|
-
cleoVersion: '2026.2.5',
|
|
464
|
-
activeSession: 'sess-123',
|
|
465
|
-
focusTask: 'T001',
|
|
466
|
-
},
|
|
467
|
-
});
|
|
468
|
-
const parsed = JSON.parse(json);
|
|
469
|
-
expect(parsed._extensions).toBeDefined();
|
|
470
|
-
expect(parsed._extensions.cleoVersion).toBe('2026.2.5');
|
|
471
|
-
expect(parsed._extensions.activeSession).toBe('sess-123');
|
|
472
|
-
expect(parsed._extensions.focusTask).toBe('T001');
|
|
473
|
-
});
|
|
474
|
-
it('_extensions omitted when empty', () => {
|
|
475
|
-
const json = formatSuccess({ ok: true }, undefined, {
|
|
476
|
-
operation: 'test',
|
|
477
|
-
extensions: {},
|
|
478
|
-
});
|
|
479
|
-
const parsed = JSON.parse(json);
|
|
480
|
-
expect(parsed._extensions).toBeUndefined();
|
|
481
|
-
});
|
|
482
|
-
it('envelope with _extensions still passes validation', () => {
|
|
483
|
-
const json = formatSuccess({ data: 1 }, undefined, {
|
|
484
|
-
operation: 'system.test',
|
|
485
|
-
extensions: { foo: 'bar' },
|
|
486
|
-
});
|
|
487
|
-
const envelope = JSON.parse(json);
|
|
488
|
-
const result = validateEnvelope(envelope);
|
|
489
|
-
expect(result.valid).toBe(true);
|
|
490
|
-
});
|
|
491
|
-
});
|
|
492
|
-
// ============================
|
|
493
|
-
// T4671: ERROR REGISTRY
|
|
494
|
-
// ============================
|
|
495
|
-
describe('CLEO Error Registry (T4671)', () => {
|
|
496
|
-
it('registry contains entries for common exit codes', () => {
|
|
497
|
-
expect(getRegistryEntry(ExitCode.NOT_FOUND)).toBeDefined();
|
|
498
|
-
expect(getRegistryEntry(ExitCode.VALIDATION_ERROR)).toBeDefined();
|
|
499
|
-
expect(getRegistryEntry(ExitCode.LOCK_TIMEOUT)).toBeDefined();
|
|
500
|
-
expect(getRegistryEntry(ExitCode.SESSION_NOT_FOUND)).toBeDefined();
|
|
501
|
-
});
|
|
502
|
-
it('registry entries have valid LAFS code format', () => {
|
|
503
|
-
const registry = getCleoErrorRegistry();
|
|
504
|
-
for (const entry of registry) {
|
|
505
|
-
expect(entry.lafsCode).toMatch(/^E_CLEO_/);
|
|
506
|
-
expect(entry.category).toBeDefined();
|
|
507
|
-
expect(typeof entry.retryable).toBe('boolean');
|
|
508
|
-
expect(typeof entry.httpStatus).toBe('number');
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
it('isCleoRegisteredCode returns true for valid codes', () => {
|
|
512
|
-
expect(isCleoRegisteredCode('E_CLEO_NOT_FOUND')).toBe(true);
|
|
513
|
-
expect(isCleoRegisteredCode('E_CLEO_VALIDATION')).toBe(true);
|
|
514
|
-
});
|
|
515
|
-
it('isCleoRegisteredCode returns false for unknown codes', () => {
|
|
516
|
-
expect(isCleoRegisteredCode('E_NONEXISTENT')).toBe(false);
|
|
517
|
-
});
|
|
518
|
-
it('lookup by LAFS code matches lookup by exit code', () => {
|
|
519
|
-
const byExit = getRegistryEntry(ExitCode.NOT_FOUND);
|
|
520
|
-
expect(byExit).toBeDefined();
|
|
521
|
-
expect(byExit.lafsCode).toBe('E_CLEO_NOT_FOUND');
|
|
522
|
-
expect(byExit.category).toBe('NOT_FOUND');
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
// ============================
|
|
526
|
-
// T4701: BUDGET ENFORCEMENT
|
|
527
|
-
// ============================
|
|
528
|
-
describe('LAFS Budget Enforcement (T4701)', () => {
|
|
529
|
-
it('enforceBudget passes small responses within budget', () => {
|
|
530
|
-
const response = {
|
|
531
|
-
_meta: {
|
|
532
|
-
specVersion: '1.2.3',
|
|
533
|
-
schemaVersion: '2026.2.1',
|
|
534
|
-
timestamp: new Date().toISOString(),
|
|
535
|
-
operation: 'test',
|
|
536
|
-
requestId: 'r1',
|
|
537
|
-
transport: 'sdk',
|
|
538
|
-
strict: true,
|
|
539
|
-
mvi: 'standard',
|
|
540
|
-
contextVersion: 1,
|
|
541
|
-
},
|
|
542
|
-
success: true,
|
|
543
|
-
data: { task: { id: 'T001', title: 'Test' } },
|
|
544
|
-
};
|
|
545
|
-
const { enforcement } = enforceBudget(response, 10000);
|
|
546
|
-
expect(enforcement.withinBudget).toBe(true);
|
|
547
|
-
expect(enforcement.truncated).toBe(false);
|
|
548
|
-
});
|
|
549
|
-
it('isWithinBudget returns true for small responses', () => {
|
|
550
|
-
const response = { success: true, data: { ok: true } };
|
|
551
|
-
expect(isWithinBudget(response, 10000)).toBe(true);
|
|
552
|
-
});
|
|
553
|
-
it('isWithinBudget returns false for large responses with tiny budget', () => {
|
|
554
|
-
const response = {
|
|
555
|
-
success: true,
|
|
556
|
-
data: { items: Array(100).fill({ id: 'T001', title: 'x'.repeat(200) }) },
|
|
557
|
-
};
|
|
558
|
-
expect(isWithinBudget(response, 10)).toBe(false);
|
|
559
|
-
});
|
|
560
|
-
it('enforceBudget adds budget metadata to _meta', () => {
|
|
561
|
-
const response = {
|
|
562
|
-
_meta: {
|
|
563
|
-
specVersion: '1.2.3',
|
|
564
|
-
schemaVersion: '2026.2.1',
|
|
565
|
-
timestamp: new Date().toISOString(),
|
|
566
|
-
operation: 'test',
|
|
567
|
-
requestId: 'r1',
|
|
568
|
-
transport: 'sdk',
|
|
569
|
-
strict: true,
|
|
570
|
-
mvi: 'standard',
|
|
571
|
-
contextVersion: 1,
|
|
572
|
-
},
|
|
573
|
-
success: true,
|
|
574
|
-
data: { ok: true },
|
|
575
|
-
};
|
|
576
|
-
const { response: enforced } = enforceBudget(response, 5000);
|
|
577
|
-
const meta = enforced['_meta'];
|
|
578
|
-
expect(meta['_budgetEnforcement']).toBeDefined();
|
|
579
|
-
const be = meta['_budgetEnforcement'];
|
|
580
|
-
expect(typeof be['estimatedTokens']).toBe('number');
|
|
581
|
-
expect(be['budget']).toBe(5000);
|
|
582
|
-
});
|
|
583
|
-
});
|
|
584
|
-
// ============================
|
|
585
|
-
// T4702: SESSION ID IN _META
|
|
586
|
-
// ============================
|
|
587
|
-
describe('Session ID in _meta (T4702)', () => {
|
|
588
|
-
it('sessionId included in CLI meta when session is active', () => {
|
|
589
|
-
const origEnv = process.env['CLEO_SESSION'];
|
|
590
|
-
process.env['CLEO_SESSION'] = 'test-session-42';
|
|
591
|
-
try {
|
|
592
|
-
const json = formatSuccess({ ok: true });
|
|
593
|
-
const parsed = JSON.parse(json);
|
|
594
|
-
expect(parsed._meta.sessionId).toBe('test-session-42');
|
|
595
|
-
}
|
|
596
|
-
finally {
|
|
597
|
-
if (origEnv !== undefined) {
|
|
598
|
-
process.env['CLEO_SESSION'] = origEnv;
|
|
599
|
-
}
|
|
600
|
-
else {
|
|
601
|
-
delete process.env['CLEO_SESSION'];
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
it('sessionId omitted from CLI meta when no session', () => {
|
|
606
|
-
const origEnv = process.env['CLEO_SESSION'];
|
|
607
|
-
delete process.env['CLEO_SESSION'];
|
|
608
|
-
try {
|
|
609
|
-
const json = formatSuccess({ ok: true });
|
|
610
|
-
const parsed = JSON.parse(json);
|
|
611
|
-
// sessionId may or may not be present depending on .current-session file
|
|
612
|
-
// but should not throw
|
|
613
|
-
expect(parsed._meta).toBeDefined();
|
|
614
|
-
}
|
|
615
|
-
finally {
|
|
616
|
-
if (origEnv !== undefined) {
|
|
617
|
-
process.env['CLEO_SESSION'] = origEnv;
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
});
|
|
621
|
-
it('sessionId included in gateway meta when session is active', () => {
|
|
622
|
-
const origEnv = process.env['CLEO_SESSION'];
|
|
623
|
-
process.env['CLEO_SESSION'] = 'gw-session-99';
|
|
624
|
-
try {
|
|
625
|
-
const meta = createGatewayMeta('query', 'tasks', 'list', Date.now());
|
|
626
|
-
expect(meta.sessionId).toBe('gw-session-99');
|
|
627
|
-
}
|
|
628
|
-
finally {
|
|
629
|
-
if (origEnv !== undefined) {
|
|
630
|
-
process.env['CLEO_SESSION'] = origEnv;
|
|
631
|
-
}
|
|
632
|
-
else {
|
|
633
|
-
delete process.env['CLEO_SESSION'];
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
});
|
|
637
|
-
});
|
|
638
|
-
// ============================
|
|
639
|
-
// T4673: FULL CONFORMANCE CI SUITE
|
|
640
|
-
// ============================
|
|
641
|
-
describe('runEnvelopeConformance() CI Suite (T4673)', () => {
|
|
642
|
-
const OPERATIONS = [
|
|
643
|
-
'tasks.list',
|
|
644
|
-
'tasks.show',
|
|
645
|
-
'tasks.add',
|
|
646
|
-
'tasks.find',
|
|
647
|
-
'session.status',
|
|
648
|
-
'system.version',
|
|
649
|
-
'system.dash',
|
|
650
|
-
'cli.output',
|
|
651
|
-
];
|
|
652
|
-
for (const operation of OPERATIONS) {
|
|
653
|
-
it(`success envelope for ${operation} passes full conformance`, () => {
|
|
654
|
-
const json = formatSuccess({ data: 'test' }, undefined, operation);
|
|
655
|
-
const envelope = JSON.parse(json);
|
|
656
|
-
const report = runEnvelopeConformance(envelope);
|
|
657
|
-
expect(report.ok).toBe(true);
|
|
658
|
-
});
|
|
659
|
-
}
|
|
660
|
-
it('all error envelopes pass conformance (except code registry)', () => {
|
|
661
|
-
// CLEO error codes aren't in the default LAFS registry, so
|
|
662
|
-
// error_code_registered and transport_mapping_consistent are expected
|
|
663
|
-
// to fail (CLEO has its own error code → exit code mapping).
|
|
664
|
-
const knownExclusions = new Set(['error_code_registered', 'transport_mapping_consistent']);
|
|
665
|
-
const errorCodes = [
|
|
666
|
-
ExitCode.NOT_FOUND,
|
|
667
|
-
ExitCode.VALIDATION_ERROR,
|
|
668
|
-
ExitCode.LOCK_TIMEOUT,
|
|
669
|
-
ExitCode.SESSION_NOT_FOUND,
|
|
670
|
-
ExitCode.DEPTH_EXCEEDED,
|
|
671
|
-
];
|
|
672
|
-
for (const code of errorCodes) {
|
|
673
|
-
const err = new CleoError(code, `Test error ${code}`);
|
|
674
|
-
const json = formatError(err, 'test.error');
|
|
675
|
-
const envelope = JSON.parse(json);
|
|
676
|
-
const report = runEnvelopeConformance(envelope);
|
|
677
|
-
const nonRegistryFails = report.checks.filter((c) => !c.pass && !knownExclusions.has(c.name));
|
|
678
|
-
expect(nonRegistryFails).toHaveLength(0);
|
|
679
|
-
}
|
|
680
|
-
});
|
|
681
|
-
it('envelope with page passes conformance', () => {
|
|
682
|
-
const page = createPage({ total: 50, limit: 10, offset: 0 });
|
|
683
|
-
const json = formatSuccess({ tasks: [] }, undefined, { operation: 'tasks.list', page });
|
|
684
|
-
const envelope = JSON.parse(json);
|
|
685
|
-
const result = validateEnvelope(envelope);
|
|
686
|
-
expect(result.valid).toBe(true);
|
|
687
|
-
});
|
|
688
|
-
it('envelope with _extensions passes conformance', () => {
|
|
689
|
-
const json = formatSuccess({ ok: true }, undefined, {
|
|
690
|
-
operation: 'system.info',
|
|
691
|
-
extensions: { cleoVersion: '2026.2.5' },
|
|
692
|
-
});
|
|
693
|
-
const envelope = JSON.parse(json);
|
|
694
|
-
const result = validateEnvelope(envelope);
|
|
695
|
-
expect(result.valid).toBe(true);
|
|
696
|
-
});
|
|
697
|
-
it('envelope with warnings passes conformance', () => {
|
|
698
|
-
pushWarning({ code: 'DEPRECATED', message: 'old feature' });
|
|
699
|
-
const json = formatSuccess({ ok: true }, undefined, 'system.test');
|
|
700
|
-
const envelope = JSON.parse(json);
|
|
701
|
-
const result = validateEnvelope(envelope);
|
|
702
|
-
expect(result.valid).toBe(true);
|
|
703
|
-
});
|
|
704
|
-
});
|
|
705
|
-
// ============================
|
|
706
|
-
// T5001: HIERARCHY POLICY CONFORMANCE
|
|
707
|
-
// ============================
|
|
708
|
-
describe('hierarchy policy conformance', () => {
|
|
709
|
-
it('validateHierarchyPlacement returns well-formed result with all required fields', () => {
|
|
710
|
-
const tasks = [
|
|
711
|
-
{
|
|
712
|
-
id: 'T001',
|
|
713
|
-
title: 'Root',
|
|
714
|
-
status: 'pending',
|
|
715
|
-
priority: 'medium',
|
|
716
|
-
createdAt: '2026-01-01T00:00:00Z',
|
|
717
|
-
},
|
|
718
|
-
];
|
|
719
|
-
const policy = {
|
|
720
|
-
maxDepth: 3,
|
|
721
|
-
maxSiblings: 7,
|
|
722
|
-
maxActiveSiblings: 3,
|
|
723
|
-
countDoneInLimit: false,
|
|
724
|
-
enforcementProfile: 'human-cognitive',
|
|
725
|
-
};
|
|
726
|
-
// Valid placement
|
|
727
|
-
const successResult = validateHierarchyPlacement('T001', tasks, policy);
|
|
728
|
-
expect(successResult).toHaveProperty('valid');
|
|
729
|
-
expect(typeof successResult.valid).toBe('boolean');
|
|
730
|
-
// Error placement (parent not found)
|
|
731
|
-
const errorResult = validateHierarchyPlacement('T999', tasks, policy);
|
|
732
|
-
expect(errorResult).toHaveProperty('valid', false);
|
|
733
|
-
expect(errorResult).toHaveProperty('error');
|
|
734
|
-
expect(errorResult.error).toHaveProperty('code');
|
|
735
|
-
expect(errorResult.error).toHaveProperty('message');
|
|
736
|
-
expect(typeof errorResult.error.code).toBe('string');
|
|
737
|
-
expect(typeof errorResult.error.message).toBe('string');
|
|
738
|
-
});
|
|
739
|
-
it('hierarchy error codes follow E_ prefix convention', () => {
|
|
740
|
-
const tasks = [
|
|
741
|
-
{
|
|
742
|
-
id: 'T001',
|
|
743
|
-
title: 'Root',
|
|
744
|
-
status: 'pending',
|
|
745
|
-
priority: 'medium',
|
|
746
|
-
createdAt: '2026-01-01T00:00:00Z',
|
|
747
|
-
},
|
|
748
|
-
];
|
|
749
|
-
const policy = {
|
|
750
|
-
maxDepth: 3,
|
|
751
|
-
maxSiblings: 7,
|
|
752
|
-
maxActiveSiblings: 3,
|
|
753
|
-
countDoneInLimit: false,
|
|
754
|
-
enforcementProfile: 'human-cognitive',
|
|
755
|
-
};
|
|
756
|
-
const result = validateHierarchyPlacement('T999', tasks, policy);
|
|
757
|
-
expect(result.error.code).toMatch(/^E_/);
|
|
758
|
-
});
|
|
759
|
-
it('hierarchy error flows through LAFS-structured formatError envelope', () => {
|
|
760
|
-
const err = new CleoError(ExitCode.DEPTH_EXCEEDED, 'Maximum nesting depth exceeded');
|
|
761
|
-
const json = formatError(err, 'tasks.add');
|
|
762
|
-
const parsed = JSON.parse(json);
|
|
763
|
-
// Verify LAFS structure
|
|
764
|
-
expect(parsed.success).toBe(false);
|
|
765
|
-
expect(parsed.error).toBeDefined();
|
|
766
|
-
expect(typeof parsed.error.message).toBe('string');
|
|
767
|
-
expect(parsed._meta).toBeDefined();
|
|
768
|
-
expect(parsed._meta.specVersion).toBeDefined();
|
|
769
|
-
expect(parsed._meta.strict).toBe(true);
|
|
770
|
-
expect(parsed._meta.transport).toBeDefined();
|
|
771
|
-
// Passes protocol validation
|
|
772
|
-
const validation = validateEnvelope(parsed);
|
|
773
|
-
expect(validation.valid).toBe(true);
|
|
774
|
-
});
|
|
775
|
-
it('sibling limit error produces valid LAFS error envelope', () => {
|
|
776
|
-
const err = new CleoError(ExitCode.SIBLING_LIMIT, 'Parent has too many children');
|
|
777
|
-
const json = formatError(err, 'tasks.add');
|
|
778
|
-
const parsed = JSON.parse(json);
|
|
779
|
-
expect(parsed.success).toBe(false);
|
|
780
|
-
expect(parsed.error.code).toMatch(/^E_/);
|
|
781
|
-
expect(parsed._meta).toBeDefined();
|
|
782
|
-
const validation = validateEnvelope(parsed);
|
|
783
|
-
expect(validation.valid).toBe(true);
|
|
784
|
-
});
|
|
785
|
-
});
|
|
786
|
-
//# sourceMappingURL=lafs-conformance.test.js.map
|