@cleocode/core 2026.9.8 → 2026.9.9
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/audit/reconstruct.d.ts +13 -43
- package/dist/audit/reconstruct.d.ts.map +1 -1
- package/dist/audit/reconstruct.js +295 -290
- package/dist/audit/reconstruct.js.map +1 -1
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +8 -2
- package/dist/bootstrap.js.map +1 -1
- package/dist/dispatch/mutate-projection.d.ts.map +1 -1
- package/dist/dispatch/mutate-projection.js +12 -0
- package/dist/dispatch/mutate-projection.js.map +1 -1
- package/dist/dispatch/mvi-projection.d.ts +29 -6
- package/dist/dispatch/mvi-projection.d.ts.map +1 -1
- package/dist/dispatch/mvi-projection.js +109 -139
- package/dist/dispatch/mvi-projection.js.map +1 -1
- package/dist/docs/docs-read-model.d.ts +3 -2
- package/dist/docs/docs-read-model.d.ts.map +1 -1
- package/dist/docs/docs-read-model.js +4 -3
- package/dist/docs/docs-read-model.js.map +1 -1
- package/dist/docs/export-document.js +5100 -2297
- package/dist/docs/export-document.js.map +3 -3
- package/dist/docs/projection.d.ts +67 -0
- package/dist/docs/projection.d.ts.map +1 -0
- package/dist/docs/projection.js +370 -0
- package/dist/docs/projection.js.map +1 -0
- package/dist/doctor/acceptance-drift.d.ts +6 -2
- package/dist/doctor/acceptance-drift.d.ts.map +1 -1
- package/dist/doctor/acceptance-drift.js +43 -5
- package/dist/doctor/acceptance-drift.js.map +1 -1
- package/dist/doctor/knowledge-summary.d.ts +41 -0
- package/dist/doctor/knowledge-summary.d.ts.map +1 -0
- package/dist/doctor/knowledge-summary.js +81 -0
- package/dist/doctor/knowledge-summary.js.map +1 -0
- package/dist/doctor/knowledge.d.ts +192 -0
- package/dist/doctor/knowledge.d.ts.map +1 -0
- package/dist/doctor/knowledge.js +1864 -0
- package/dist/doctor/knowledge.js.map +1 -0
- package/dist/git/work-tree.d.ts +64 -0
- package/dist/git/work-tree.d.ts.map +1 -0
- package/dist/git/work-tree.js +111 -0
- package/dist/git/work-tree.js.map +1 -0
- package/dist/hooks/handlers/task-hooks.d.ts +8 -5
- package/dist/hooks/handlers/task-hooks.d.ts.map +1 -1
- package/dist/hooks/handlers/task-hooks.js +15 -60
- package/dist/hooks/handlers/task-hooks.js.map +1 -1
- package/dist/identity/cleo-identity.d.ts +13 -0
- package/dist/identity/cleo-identity.d.ts.map +1 -1
- package/dist/identity/cleo-identity.js +20 -6
- package/dist/identity/cleo-identity.js.map +1 -1
- package/dist/injection.d.ts.map +1 -1
- package/dist/injection.js +29 -13
- package/dist/injection.js.map +1 -1
- package/dist/internal.d.ts +2 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +2 -0
- package/dist/internal.js.map +1 -1
- package/dist/lifecycle/verification/satisfies-validator.d.ts.map +1 -1
- package/dist/lifecycle/verification/satisfies-validator.js +124 -120
- package/dist/lifecycle/verification/satisfies-validator.js.map +1 -1
- package/dist/llm/plugin-facade.js +4018 -1726
- package/dist/llm/plugin-facade.js.map +3 -3
- package/dist/memory/brain-backfill.d.ts +27 -12
- package/dist/memory/brain-backfill.d.ts.map +1 -1
- package/dist/memory/brain-backfill.js +325 -134
- package/dist/memory/brain-backfill.js.map +1 -1
- package/dist/memory/brain-doctor.d.ts +21 -0
- package/dist/memory/brain-doctor.d.ts.map +1 -1
- package/dist/memory/brain-doctor.js +111 -53
- package/dist/memory/brain-doctor.js.map +1 -1
- package/dist/memory/brain-links.d.ts.map +1 -1
- package/dist/memory/brain-links.js +31 -4
- package/dist/memory/brain-links.js.map +1 -1
- package/dist/memory/brain-reasoning.d.ts.map +1 -1
- package/dist/memory/brain-reasoning.js +28 -2
- package/dist/memory/brain-reasoning.js.map +1 -1
- package/dist/memory/brain-reconciler.d.ts +14 -19
- package/dist/memory/brain-reconciler.d.ts.map +1 -1
- package/dist/memory/brain-reconciler.js +70 -97
- package/dist/memory/brain-reconciler.js.map +1 -1
- package/dist/memory/brain-search.d.ts +2 -0
- package/dist/memory/brain-search.d.ts.map +1 -1
- package/dist/memory/brain-search.js +59 -29
- package/dist/memory/brain-search.js.map +1 -1
- package/dist/memory/brain-similarity.d.ts.map +1 -1
- package/dist/memory/brain-similarity.js +5 -4
- package/dist/memory/brain-similarity.js.map +1 -1
- package/dist/memory/brain-stub-prune.d.ts +31 -9
- package/dist/memory/brain-stub-prune.d.ts.map +1 -1
- package/dist/memory/brain-stub-prune.js +65 -18
- package/dist/memory/brain-stub-prune.js.map +1 -1
- package/dist/memory/brain-writer-handlers.d.ts +10 -1
- package/dist/memory/brain-writer-handlers.d.ts.map +1 -1
- package/dist/memory/brain-writer-handlers.js +23 -3
- package/dist/memory/brain-writer-handlers.js.map +1 -1
- package/dist/memory/brain-writer-thread.d.ts +11 -1
- package/dist/memory/brain-writer-thread.d.ts.map +1 -1
- package/dist/memory/brain-writer-thread.js +87 -20
- package/dist/memory/brain-writer-thread.js.map +1 -1
- package/dist/memory/brain-writer-worker.js +8 -1
- package/dist/memory/brain-writer-worker.js.map +1 -1
- package/dist/memory/decision-cross-link.d.ts +39 -0
- package/dist/memory/decision-cross-link.d.ts.map +1 -1
- package/dist/memory/decision-cross-link.js +316 -0
- package/dist/memory/decision-cross-link.js.map +1 -1
- package/dist/memory/decisions.d.ts +4 -1
- package/dist/memory/decisions.d.ts.map +1 -1
- package/dist/memory/decisions.js +7 -24
- package/dist/memory/decisions.js.map +1 -1
- package/dist/memory/dispatch-trace.d.ts +12 -5
- package/dist/memory/dispatch-trace.d.ts.map +1 -1
- package/dist/memory/dispatch-trace.js +17 -7
- package/dist/memory/dispatch-trace.js.map +1 -1
- package/dist/memory/eligibility.d.ts +51 -0
- package/dist/memory/eligibility.d.ts.map +1 -0
- package/dist/memory/eligibility.js +77 -0
- package/dist/memory/eligibility.js.map +1 -0
- package/dist/memory/engine-compat.d.ts +2 -0
- package/dist/memory/engine-compat.d.ts.map +1 -1
- package/dist/memory/engine-compat.js +10 -0
- package/dist/memory/engine-compat.js.map +1 -1
- package/dist/memory/extraction-gate.d.ts +21 -7
- package/dist/memory/extraction-gate.d.ts.map +1 -1
- package/dist/memory/extraction-gate.js +178 -216
- package/dist/memory/extraction-gate.js.map +1 -1
- package/dist/memory/graph-auto-populate.d.ts +38 -5
- package/dist/memory/graph-auto-populate.d.ts.map +1 -1
- package/dist/memory/graph-auto-populate.js +182 -60
- package/dist/memory/graph-auto-populate.js.map +1 -1
- package/dist/memory/graph-memory-bridge.d.ts +14 -1
- package/dist/memory/graph-memory-bridge.d.ts.map +1 -1
- package/dist/memory/graph-memory-bridge.js +66 -28
- package/dist/memory/graph-memory-bridge.js.map +1 -1
- package/dist/memory/index.d.ts +1 -19
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +1 -50
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/learnings.d.ts.map +1 -1
- package/dist/memory/learnings.js +2 -23
- package/dist/memory/learnings.js.map +1 -1
- package/dist/memory/manifest-filter.d.ts +21 -0
- package/dist/memory/manifest-filter.d.ts.map +1 -0
- package/dist/memory/manifest-filter.js +51 -0
- package/dist/memory/manifest-filter.js.map +1 -0
- package/dist/memory/manifest-ingestion.d.ts +28 -30
- package/dist/memory/manifest-ingestion.d.ts.map +1 -1
- package/dist/memory/manifest-ingestion.js +104 -235
- package/dist/memory/manifest-ingestion.js.map +1 -1
- package/dist/memory/observer-reflector.d.ts +2 -0
- package/dist/memory/observer-reflector.d.ts.map +1 -1
- package/dist/memory/observer-reflector.js +6 -49
- package/dist/memory/observer-reflector.js.map +1 -1
- package/dist/memory/patterns.d.ts +10 -0
- package/dist/memory/patterns.d.ts.map +1 -1
- package/dist/memory/patterns.js +25 -33
- package/dist/memory/patterns.js.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.d.ts +72 -9
- package/dist/memory/pipeline-manifest-sqlite.d.ts.map +1 -1
- package/dist/memory/pipeline-manifest-sqlite.js +508 -412
- package/dist/memory/pipeline-manifest-sqlite.js.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.d.ts.map +1 -1
- package/dist/memory/retrieval/build-retrieval-bundle.js +16 -15
- package/dist/memory/retrieval/build-retrieval-bundle.js.map +1 -1
- package/dist/memory/retrieval/fetch.d.ts +7 -0
- package/dist/memory/retrieval/fetch.d.ts.map +1 -1
- package/dist/memory/retrieval/fetch.js +14 -11
- package/dist/memory/retrieval/fetch.js.map +1 -1
- package/dist/memory/retrieval/observe.d.ts +7 -1
- package/dist/memory/retrieval/observe.d.ts.map +1 -1
- package/dist/memory/retrieval/observe.js +58 -4
- package/dist/memory/retrieval/observe.js.map +1 -1
- package/dist/memory/retrieval/search.d.ts +14 -1
- package/dist/memory/retrieval/search.d.ts.map +1 -1
- package/dist/memory/retrieval/search.js +133 -69
- package/dist/memory/retrieval/search.js.map +1 -1
- package/dist/memory/retrieval/telemetry.d.ts +31 -0
- package/dist/memory/retrieval/telemetry.d.ts.map +1 -0
- package/dist/memory/retrieval/telemetry.js +53 -0
- package/dist/memory/retrieval/telemetry.js.map +1 -0
- package/dist/nexus/analyze-orchestrator.d.ts +41 -9
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +257 -58
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/api-contracts.d.ts +2 -6
- package/dist/nexus/api-contracts.d.ts.map +1 -1
- package/dist/nexus/api-contracts.js +11 -2
- package/dist/nexus/api-contracts.js.map +1 -1
- package/dist/nexus/context.d.ts.map +1 -1
- package/dist/nexus/context.js +14 -37
- package/dist/nexus/context.js.map +1 -1
- package/dist/nexus/diff.d.ts.map +1 -1
- package/dist/nexus/diff.js +2 -1
- package/dist/nexus/diff.js.map +1 -1
- package/dist/nexus/identity.d.ts +29 -3
- package/dist/nexus/identity.d.ts.map +1 -1
- package/dist/nexus/identity.js +63 -12
- package/dist/nexus/identity.js.map +1 -1
- package/dist/nexus/impact.d.ts +21 -19
- package/dist/nexus/impact.d.ts.map +1 -1
- package/dist/nexus/impact.js +96 -192
- package/dist/nexus/impact.js.map +1 -1
- package/dist/nexus/knowledge.d.ts +80 -0
- package/dist/nexus/knowledge.d.ts.map +1 -0
- package/dist/nexus/knowledge.js +786 -0
- package/dist/nexus/knowledge.js.map +1 -0
- package/dist/nexus/living-brain.d.ts +8 -5
- package/dist/nexus/living-brain.d.ts.map +1 -1
- package/dist/nexus/living-brain.js +252 -188
- package/dist/nexus/living-brain.js.map +1 -1
- package/dist/nexus/registry.d.ts +11 -2
- package/dist/nexus/registry.d.ts.map +1 -1
- package/dist/nexus/registry.js +144 -128
- package/dist/nexus/registry.js.map +1 -1
- package/dist/nexus/source-roots.d.ts +16 -0
- package/dist/nexus/source-roots.d.ts.map +1 -0
- package/dist/nexus/source-roots.js +174 -0
- package/dist/nexus/source-roots.js.map +1 -0
- package/dist/nexus/task-evidence.d.ts +22 -0
- package/dist/nexus/task-evidence.d.ts.map +1 -0
- package/dist/nexus/task-evidence.js +210 -0
- package/dist/nexus/task-evidence.js.map +1 -0
- package/dist/nexus/tasks-bridge.d.ts +14 -7
- package/dist/nexus/tasks-bridge.d.ts.map +1 -1
- package/dist/nexus/tasks-bridge.js +81 -40
- package/dist/nexus/tasks-bridge.js.map +1 -1
- package/dist/orchestrate/lifecycle-ops.d.ts.map +1 -1
- package/dist/orchestrate/lifecycle-ops.js +170 -120
- package/dist/orchestrate/lifecycle-ops.js.map +1 -1
- package/dist/orchestrate/query-ops.d.ts +6 -7
- package/dist/orchestrate/query-ops.d.ts.map +1 -1
- package/dist/orchestrate/query-ops.js +509 -532
- package/dist/orchestrate/query-ops.js.map +1 -1
- package/dist/orchestration/bootstrap.d.ts +15 -1
- package/dist/orchestration/bootstrap.d.ts.map +1 -1
- package/dist/orchestration/bootstrap.js +21 -10
- package/dist/orchestration/bootstrap.js.map +1 -1
- package/dist/orchestration/index.d.ts +35 -3
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +64 -35
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/lead-rollup.d.ts +24 -1
- package/dist/orchestration/lead-rollup.d.ts.map +1 -1
- package/dist/orchestration/lead-rollup.js +31 -11
- package/dist/orchestration/lead-rollup.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +16 -41
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/orchestration/unblock.d.ts +15 -1
- package/dist/orchestration/unblock.d.ts.map +1 -1
- package/dist/orchestration/unblock.js +23 -12
- package/dist/orchestration/unblock.js.map +1 -1
- package/dist/orchestration/validate-spawn.d.ts.map +1 -1
- package/dist/orchestration/validate-spawn.js +3 -3
- package/dist/orchestration/validate-spawn.js.map +1 -1
- package/dist/orchestration/waves.d.ts +29 -13
- package/dist/orchestration/waves.d.ts.map +1 -1
- package/dist/orchestration/waves.js +43 -55
- package/dist/orchestration/waves.js.map +1 -1
- package/dist/paths.d.ts +17 -163
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +145 -496
- package/dist/paths.js.map +1 -1
- package/dist/project-info.d.ts +2 -11
- package/dist/project-info.d.ts.map +1 -1
- package/dist/project-info.js +3 -31
- package/dist/project-info.js.map +1 -1
- package/dist/project-scope.d.ts +239 -0
- package/dist/project-scope.d.ts.map +1 -0
- package/dist/project-scope.js +473 -0
- package/dist/project-scope.js.map +1 -0
- package/dist/release/pr-evidence.d.ts +16 -3
- package/dist/release/pr-evidence.d.ts.map +1 -1
- package/dist/release/pr-evidence.js +53 -7
- package/dist/release/pr-evidence.js.map +1 -1
- package/dist/render/nexus/graph/index.d.ts.map +1 -1
- package/dist/render/nexus/graph/index.js +4 -2
- package/dist/render/nexus/graph/index.js.map +1 -1
- package/dist/render/orchestration/audit-reconstruct.d.ts +11 -0
- package/dist/render/orchestration/audit-reconstruct.d.ts.map +1 -1
- package/dist/render/orchestration/audit-reconstruct.js +21 -6
- package/dist/render/orchestration/audit-reconstruct.js.map +1 -1
- package/dist/render/tasks/show.js +2 -1
- package/dist/render/tasks/show.js.map +1 -1
- package/dist/resources/spawn-wrapper.d.ts +82 -14
- package/dist/resources/spawn-wrapper.d.ts.map +1 -1
- package/dist/resources/spawn-wrapper.js +585 -27
- package/dist/resources/spawn-wrapper.js.map +1 -1
- package/dist/selfimprove/fix-gen.js +4026 -1734
- package/dist/selfimprove/fix-gen.js.map +3 -3
- package/dist/sequence/index.d.ts.map +1 -1
- package/dist/sequence/index.js +76 -68
- package/dist/sequence/index.js.map +1 -1
- package/dist/session/canon-lint.d.ts +24 -3
- package/dist/session/canon-lint.d.ts.map +1 -1
- package/dist/session/canon-lint.js +72 -31
- package/dist/session/canon-lint.js.map +1 -1
- package/dist/session/engine-ops.d.ts +1 -4
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +6 -2
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/sessions/briefing.d.ts +11 -1
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +76 -8
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/handoff.d.ts +3 -1
- package/dist/sessions/handoff.d.ts.map +1 -1
- package/dist/sessions/handoff.js +2 -0
- package/dist/sessions/handoff.js.map +1 -1
- package/dist/shutdown-deadline.d.ts +24 -33
- package/dist/shutdown-deadline.d.ts.map +1 -1
- package/dist/shutdown-deadline.js +71 -14
- package/dist/shutdown-deadline.js.map +1 -1
- package/dist/shutdown.d.ts +21 -10
- package/dist/shutdown.d.ts.map +1 -1
- package/dist/shutdown.js +89 -42
- package/dist/shutdown.js.map +1 -1
- package/dist/skills/index.d.ts +1 -1
- package/dist/skills/index.d.ts.map +1 -1
- package/dist/skills/index.js +1 -1
- package/dist/skills/index.js.map +1 -1
- package/dist/skills/orchestrator/validator.d.ts +87 -20
- package/dist/skills/orchestrator/validator.d.ts.map +1 -1
- package/dist/skills/orchestrator/validator.js +330 -241
- package/dist/skills/orchestrator/validator.js.map +1 -1
- package/dist/store/agent-resolver.d.ts.map +1 -1
- package/dist/store/agent-resolver.js +16 -9
- package/dist/store/agent-resolver.js.map +1 -1
- package/dist/store/attachment-store.d.ts +4 -1
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +20 -3
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/background-jobs.d.ts +426 -105
- package/dist/store/background-jobs.d.ts.map +1 -1
- package/dist/store/background-jobs.js +1208 -252
- package/dist/store/background-jobs.js.map +1 -1
- package/dist/store/background-ops.d.ts +145 -8
- package/dist/store/background-ops.d.ts.map +1 -1
- package/dist/store/background-ops.js +459 -15
- package/dist/store/background-ops.js.map +1 -1
- package/dist/store/backup-inspect.d.ts +48 -4
- package/dist/store/backup-inspect.d.ts.map +1 -1
- package/dist/store/backup-inspect.js +384 -4
- package/dist/store/backup-inspect.js.map +1 -1
- package/dist/store/converters.d.ts.map +1 -1
- package/dist/store/converters.js +19 -2
- package/dist/store/converters.js.map +1 -1
- package/dist/store/data-accessor.d.ts +9 -1
- package/dist/store/data-accessor.d.ts.map +1 -1
- package/dist/store/data-accessor.js +22 -5
- package/dist/store/data-accessor.js.map +1 -1
- package/dist/store/data-safety-central.d.ts.map +1 -1
- package/dist/store/data-safety-central.js +272 -232
- package/dist/store/data-safety-central.js.map +1 -1
- package/dist/store/db-helpers.d.ts +19 -3
- package/dist/store/db-helpers.d.ts.map +1 -1
- package/dist/store/db-helpers.js +42 -58
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/dual-scope-db.d.ts +63 -4
- package/dist/store/dual-scope-db.d.ts.map +1 -1
- package/dist/store/dual-scope-db.js +166 -19
- package/dist/store/dual-scope-db.js.map +1 -1
- package/dist/store/exodus/archive.d.ts +21 -7
- package/dist/store/exodus/archive.d.ts.map +1 -1
- package/dist/store/exodus/archive.js +60 -18
- package/dist/store/exodus/archive.js.map +1 -1
- package/dist/store/exodus/migrate.d.ts.map +1 -1
- package/dist/store/exodus/migrate.js +27 -23
- package/dist/store/exodus/migrate.js.map +1 -1
- package/dist/store/exodus/on-open.d.ts +16 -27
- package/dist/store/exodus/on-open.d.ts.map +1 -1
- package/dist/store/exodus/on-open.js +121 -169
- package/dist/store/exodus/on-open.js.map +1 -1
- package/dist/store/exodus/recovery.d.ts +90 -0
- package/dist/store/exodus/recovery.d.ts.map +1 -0
- package/dist/store/exodus/recovery.js +434 -0
- package/dist/store/exodus/recovery.js.map +1 -0
- package/dist/store/exodus/types.d.ts +15 -0
- package/dist/store/exodus/types.d.ts.map +1 -1
- package/dist/store/memory-accessor.d.ts +52 -3
- package/dist/store/memory-accessor.d.ts.map +1 -1
- package/dist/store/memory-accessor.js +122 -7
- package/dist/store/memory-accessor.js.map +1 -1
- package/dist/store/nexus-sqlite.d.ts +24 -6
- package/dist/store/nexus-sqlite.d.ts.map +1 -1
- package/dist/store/nexus-sqlite.js +39 -20
- package/dist/store/nexus-sqlite.js.map +1 -1
- package/dist/store/ports/domain-binding.d.ts.map +1 -1
- package/dist/store/ports/domain-binding.js +27 -5
- package/dist/store/ports/domain-binding.js.map +1 -1
- package/dist/store/schema/background-jobs.d.ts +181 -2
- package/dist/store/schema/background-jobs.d.ts.map +1 -1
- package/dist/store/schema/background-jobs.js +27 -3
- package/dist/store/schema/background-jobs.js.map +1 -1
- package/dist/store/schema/cleo-global/skills.d.ts +2 -2
- package/dist/store/schema/cleo-project/lifecycle.d.ts +2 -2
- package/dist/store/schema/cleo-project/runtime.d.ts +1 -1
- package/dist/store/schema/cleo-project/tasks-core.d.ts +1 -1
- package/dist/store/schema/lifecycle.d.ts +2 -2
- package/dist/store/schema/skills-schema.d.ts +2 -2
- package/dist/store/schema/tasks.d.ts +1 -1
- package/dist/store/session-store.d.ts +3 -1
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +252 -207
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts +39 -4
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +689 -527
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/store/tasks-sqlite.d.ts +3 -1
- package/dist/store/tasks-sqlite.d.ts.map +1 -1
- package/dist/store/tasks-sqlite.js +309 -279
- package/dist/store/tasks-sqlite.js.map +1 -1
- package/dist/store/validation-schemas.d.ts +8 -8
- package/dist/store/writer-lease.d.ts +80 -8
- package/dist/store/writer-lease.d.ts.map +1 -1
- package/dist/store/writer-lease.js +503 -134
- package/dist/store/writer-lease.js.map +1 -1
- package/dist/system/audit.d.ts +2 -1
- package/dist/system/audit.d.ts.map +1 -1
- package/dist/system/audit.js +118 -71
- package/dist/system/audit.js.map +1 -1
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +5 -5
- package/dist/system/backup.js.map +1 -1
- package/dist/system/inject-generate.js +1 -1
- package/dist/task-work/index.d.ts +3 -0
- package/dist/task-work/index.d.ts.map +1 -1
- package/dist/task-work/index.js +34 -37
- package/dist/task-work/index.js.map +1 -1
- package/dist/tasks/ac-coverage-gate.d.ts.map +1 -1
- package/dist/tasks/ac-coverage-gate.js +4 -0
- package/dist/tasks/ac-coverage-gate.js.map +1 -1
- package/dist/tasks/ac-immutability.d.ts +7 -4
- package/dist/tasks/ac-immutability.d.ts.map +1 -1
- package/dist/tasks/ac-immutability.js +19 -17
- package/dist/tasks/ac-immutability.js.map +1 -1
- package/dist/tasks/ac-table.d.ts +5 -5
- package/dist/tasks/ac-table.d.ts.map +1 -1
- package/dist/tasks/ac-table.js +26 -12
- package/dist/tasks/ac-table.js.map +1 -1
- package/dist/tasks/acceptance-input.d.ts +52 -0
- package/dist/tasks/acceptance-input.d.ts.map +1 -0
- package/dist/tasks/acceptance-input.js +259 -0
- package/dist/tasks/acceptance-input.js.map +1 -0
- package/dist/tasks/add.d.ts +67 -29
- package/dist/tasks/add.d.ts.map +1 -1
- package/dist/tasks/add.js +255 -97
- package/dist/tasks/add.js.map +1 -1
- package/dist/tasks/complete.d.ts +16 -1
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +152 -55
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/decompose.d.ts +103 -0
- package/dist/tasks/decompose.d.ts.map +1 -0
- package/dist/tasks/decompose.js +224 -0
- package/dist/tasks/decompose.js.map +1 -0
- package/dist/tasks/delete.d.ts +5 -8
- package/dist/tasks/delete.d.ts.map +1 -1
- package/dist/tasks/delete.js +4 -3
- package/dist/tasks/delete.js.map +1 -1
- package/dist/tasks/dependency-check.d.ts +59 -0
- package/dist/tasks/dependency-check.d.ts.map +1 -1
- package/dist/tasks/dependency-check.js +73 -0
- package/dist/tasks/dependency-check.js.map +1 -1
- package/dist/tasks/deps-ready.d.ts +13 -1
- package/dist/tasks/deps-ready.d.ts.map +1 -1
- package/dist/tasks/deps-ready.js +16 -5
- package/dist/tasks/deps-ready.js.map +1 -1
- package/dist/tasks/engine-converters.d.ts +7 -0
- package/dist/tasks/engine-converters.d.ts.map +1 -1
- package/dist/tasks/engine-converters.js +8 -1
- package/dist/tasks/engine-converters.js.map +1 -1
- package/dist/tasks/evidence.d.ts +54 -26
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +292 -40
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/find.d.ts +16 -12
- package/dist/tasks/find.d.ts.map +1 -1
- package/dist/tasks/find.js +107 -93
- package/dist/tasks/find.js.map +1 -1
- package/dist/tasks/gate-runner.d.ts +88 -14
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +596 -253
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/hierarchy-policy.d.ts +8 -0
- package/dist/tasks/hierarchy-policy.d.ts.map +1 -1
- package/dist/tasks/hierarchy-policy.js +9 -2
- package/dist/tasks/hierarchy-policy.js.map +1 -1
- package/dist/tasks/hierarchy.d.ts +67 -1
- package/dist/tasks/hierarchy.d.ts.map +1 -1
- package/dist/tasks/hierarchy.js +81 -1
- package/dist/tasks/hierarchy.js.map +1 -1
- package/dist/tasks/index.d.ts +3 -0
- package/dist/tasks/index.d.ts.map +1 -1
- package/dist/tasks/index.js +3 -0
- package/dist/tasks/index.js.map +1 -1
- package/dist/tasks/infer-add-params.d.ts +1 -20
- package/dist/tasks/infer-add-params.d.ts.map +1 -1
- package/dist/tasks/infer-add-params.js +2 -203
- package/dist/tasks/infer-add-params.js.map +1 -1
- package/dist/tasks/list.d.ts +7 -2
- package/dist/tasks/list.d.ts.map +1 -1
- package/dist/tasks/list.js +24 -36
- package/dist/tasks/list.js.map +1 -1
- package/dist/tasks/ops.d.ts +6 -61
- package/dist/tasks/ops.d.ts.map +1 -1
- package/dist/tasks/ops.js +5 -53
- package/dist/tasks/ops.js.map +1 -1
- package/dist/tasks/plan.d.ts +15 -1
- package/dist/tasks/plan.d.ts.map +1 -1
- package/dist/tasks/plan.js +23 -25
- package/dist/tasks/plan.js.map +1 -1
- package/dist/tasks/population.d.ts +46 -0
- package/dist/tasks/population.d.ts.map +1 -0
- package/dist/tasks/population.js +88 -0
- package/dist/tasks/population.js.map +1 -0
- package/dist/tasks/reconcile-scope.d.ts +157 -0
- package/dist/tasks/reconcile-scope.d.ts.map +1 -0
- package/dist/tasks/reconcile-scope.js +242 -0
- package/dist/tasks/reconcile-scope.js.map +1 -0
- package/dist/tasks/req.d.ts +51 -12
- package/dist/tasks/req.d.ts.map +1 -1
- package/dist/tasks/req.js +125 -69
- package/dist/tasks/req.js.map +1 -1
- package/dist/tasks/session-scope.d.ts +6 -31
- package/dist/tasks/session-scope.d.ts.map +1 -1
- package/dist/tasks/session-scope.js +3 -17
- package/dist/tasks/session-scope.js.map +1 -1
- package/dist/tasks/severity-attestation.d.ts +39 -10
- package/dist/tasks/severity-attestation.d.ts.map +1 -1
- package/dist/tasks/severity-attestation.js +75 -36
- package/dist/tasks/severity-attestation.js.map +1 -1
- package/dist/tasks/task-next.d.ts +5 -0
- package/dist/tasks/task-next.d.ts.map +1 -1
- package/dist/tasks/task-next.js +10 -9
- package/dist/tasks/task-next.js.map +1 -1
- package/dist/tasks/task-reparent.d.ts.map +1 -1
- package/dist/tasks/task-reparent.js +3 -13
- package/dist/tasks/task-reparent.js.map +1 -1
- package/dist/tasks/update.d.ts +20 -43
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +64 -49
- package/dist/tasks/update.js.map +1 -1
- package/dist/validation/engine-ops.d.ts +17 -1
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +149 -11
- package/dist/validation/engine-ops.js.map +1 -1
- package/dist/workgraph/reparent-preflight.d.ts +1 -1
- package/dist/workgraph/reparent-preflight.d.ts.map +1 -1
- package/dist/workgraph/reparent-preflight.js +6 -1
- package/dist/workgraph/reparent-preflight.js.map +1 -1
- package/dist/workgraph/scaffold-apply.d.ts.map +1 -1
- package/dist/workgraph/scaffold-apply.js +81 -76
- package/dist/workgraph/scaffold-apply.js.map +1 -1
- package/dist/workgraph/structure-validation.d.ts +1 -1
- package/dist/workgraph/structure-validation.d.ts.map +1 -1
- package/dist/workgraph/structure-validation.js +6 -1
- package/dist/workgraph/structure-validation.js.map +1 -1
- package/migrations/drizzle-tasks/20260919180000_t12263-job-ownership-fences/migration.sql +34 -0
- package/migrations/drizzle-tasks/20260919184500_t12265-durable-pending-proposals/migration.sql +4 -0
- package/package.json +18 -13
- package/schemas/config.schema.json +2 -2
- package/templates/CLEO-INJECTION.md +103 -101
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Containment-aware scope reconciliation across a saga or epic.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this exists
|
|
5
|
+
*
|
|
6
|
+
* `duplicate-detector.ts` runs at INSERT time over a FLAT candidate set — it
|
|
7
|
+
* queries `{status: [pending, active, blocked], limit}` with no parent or saga
|
|
8
|
+
* scoping — and its verdict is binary: reject, or insert. Two consequences,
|
|
9
|
+
* both reported from the field on large projects:
|
|
10
|
+
*
|
|
11
|
+
* 1. **Partial overlap is invisible.** Two tasks that share part of their
|
|
12
|
+
* scope are neither duplicates nor unrelated, and the insert-time check
|
|
13
|
+
* has no vocabulary for that. They both get created and quietly compete.
|
|
14
|
+
* 2. **Nothing is ever re-examined.** Overlap mostly emerges AFTER filing, as
|
|
15
|
+
* scope drifts during execution and several agents extend adjacent tasks
|
|
16
|
+
* toward the same middle. The insert-time check has long since run.
|
|
17
|
+
*
|
|
18
|
+
* `cleo reconcile` already existed but only covers release tags. The `relates`
|
|
19
|
+
* vocabulary (`duplicates`, `absorbs`, `supersedes`) already existed too, and
|
|
20
|
+
* nothing produced or consumed it — it was declarable by hand and never by a
|
|
21
|
+
* workflow.
|
|
22
|
+
*
|
|
23
|
+
* This module supplies the missing sweep: retro-active, scoped to a container,
|
|
24
|
+
* and classifying each overlapping pair into a concrete ACTION rather than a
|
|
25
|
+
* duplicate yes/no.
|
|
26
|
+
*
|
|
27
|
+
* ## Deliberately deterministic
|
|
28
|
+
*
|
|
29
|
+
* Detection reuses `computeLexicalSimilarity` and `computeJaccardWordSimilarity`
|
|
30
|
+
* from the duplicate detector. No LLM call, no embedding provider. A sweep an
|
|
31
|
+
* agent is expected to run repeatedly must be cheap, offline, and give the same
|
|
32
|
+
* answer twice — an LLM-scored sweep that reshuffles its own findings between
|
|
33
|
+
* runs cannot be acted on incrementally.
|
|
34
|
+
*
|
|
35
|
+
* @task T12299
|
|
36
|
+
*/
|
|
37
|
+
import { ExitCode } from '@cleocode/contracts';
|
|
38
|
+
import { engineSuccess } from '../engine-result.js';
|
|
39
|
+
import { CleoError } from '../errors.js';
|
|
40
|
+
import { cleoErrorToEngineResult } from '../errors-to-engine.js';
|
|
41
|
+
import { getTaskAccessor } from '../store/data-accessor.js';
|
|
42
|
+
import { computeJaccardWordSimilarity, computeLexicalSimilarity } from './duplicate-detector.js';
|
|
43
|
+
/** Statuses that represent live work. Terminal rows are history, not competition. */
|
|
44
|
+
const LIVE_STATUSES = new Set(['pending', 'active', 'blocked']);
|
|
45
|
+
/**
|
|
46
|
+
* Pairs are O(n²). Above this many live nodes the sweep reports a bounded scan
|
|
47
|
+
* rather than silently comparing a subset — a truncated sweep that reads as
|
|
48
|
+
* complete is worse than one that says what it skipped.
|
|
49
|
+
*/
|
|
50
|
+
export const MAX_SWEEP_NODES = 400;
|
|
51
|
+
/** At or above this combined score two tasks describe the same deliverable. */
|
|
52
|
+
export const MERGE_THRESHOLD = 0.9;
|
|
53
|
+
/**
|
|
54
|
+
* At or above this two tasks share enough scope to need a decision.
|
|
55
|
+
*
|
|
56
|
+
* Calibrated against real data, not chosen: swept saga T9977 in this repo (144
|
|
57
|
+
* live tasks, 10,160 pairs) and counted findings by threshold —
|
|
58
|
+
*
|
|
59
|
+
* ```
|
|
60
|
+
* >= 0.55: 427 >= 0.70: 7
|
|
61
|
+
* >= 0.60: 128 >= 0.75: 5
|
|
62
|
+
* >= 0.65: 32 >= 0.85: 2
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* 0.55 returns 427 findings, which is not a report anyone acts on. 0.65 returns
|
|
66
|
+
* 32 from 144 tasks, which is reviewable.
|
|
67
|
+
*
|
|
68
|
+
* The residual false positives are instructive and worth knowing before
|
|
69
|
+
* lowering this again: on a codebase with naming conventions, titles share
|
|
70
|
+
* vocabulary without sharing scope. `Route createAgentWorktree through core SDK`
|
|
71
|
+
* vs `Route destroyAgentWorktree through core SDK` scores 0.852 and is two
|
|
72
|
+
* genuinely different pieces of work. That is why high-confidence actions
|
|
73
|
+
* (`merge`/`absorb`) sit at {@link MERGE_THRESHOLD} and additionally require a
|
|
74
|
+
* tier/parent match — on that same real sweep they fired ZERO times, while
|
|
75
|
+
* firing correctly on a synthetic control with true duplicates.
|
|
76
|
+
*/
|
|
77
|
+
export const OVERLAP_THRESHOLD = 0.65;
|
|
78
|
+
/**
|
|
79
|
+
* Classify one overlapping pair into an action.
|
|
80
|
+
*
|
|
81
|
+
* The tier and parent relationship decide the action, not the score alone. Two
|
|
82
|
+
* near-identical siblings are a merge; a near-identical pair in DIFFERENT
|
|
83
|
+
* containers is an absorb, because merging across containers silently moves
|
|
84
|
+
* work between epics; and moderate overlap is a split when the two sit apart
|
|
85
|
+
* (extract the shared part) or a link when they are already siblings under one
|
|
86
|
+
* parent, where the overlap is usually intended sequencing.
|
|
87
|
+
*/
|
|
88
|
+
function classify(a, b, score) {
|
|
89
|
+
const sameParent = (a.parentId ?? null) === (b.parentId ?? null);
|
|
90
|
+
const sameTier = (a.type ?? 'task') === (b.type ?? 'task');
|
|
91
|
+
if (score >= MERGE_THRESHOLD && sameParent && sameTier) {
|
|
92
|
+
return {
|
|
93
|
+
action: 'merge',
|
|
94
|
+
relation: 'duplicates',
|
|
95
|
+
rationale: `Same tier, same parent, ${(score * 100).toFixed(0)}% scope match — these describe one deliverable.`,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (score >= MERGE_THRESHOLD) {
|
|
99
|
+
return {
|
|
100
|
+
action: 'absorb',
|
|
101
|
+
relation: 'absorbs',
|
|
102
|
+
rationale: `${(score * 100).toFixed(0)}% scope match across different containers — fold the later into the earlier rather than merging across parents.`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (!sameParent) {
|
|
106
|
+
return {
|
|
107
|
+
action: 'split',
|
|
108
|
+
relation: 'related',
|
|
109
|
+
rationale: `${(score * 100).toFixed(0)}% shared scope in different containers — extract the shared part so neither owns it by accident.`,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
action: 'link',
|
|
114
|
+
relation: 'related',
|
|
115
|
+
rationale: `${(score * 100).toFixed(0)}% shared scope between siblings — usually intended sequencing; record the link rather than restructuring.`,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Sweep a container for tasks whose scope overlaps, and propose what to do.
|
|
120
|
+
*
|
|
121
|
+
* Read-only unless `apply` is set. Even with `apply`, the ONLY mutation is
|
|
122
|
+
* writing `relates` edges — nothing is merged, retitled, reparented or deleted.
|
|
123
|
+
* A sweep that restructured the graph on its own reading of a similarity score
|
|
124
|
+
* would be acting on exactly the judgement it is least qualified to make; the
|
|
125
|
+
* edges make the overlap visible and leave the decision with the caller.
|
|
126
|
+
*
|
|
127
|
+
* Idempotent: `addRelation` upserts, so a second run over an unchanged graph
|
|
128
|
+
* writes the same edges and changes nothing.
|
|
129
|
+
*
|
|
130
|
+
* @param options - Sweep inputs; see {@link ReconcileScopeOptions}.
|
|
131
|
+
* @param cwd - Project root. Defaults to the resolved CLEO project.
|
|
132
|
+
* @param accessor - Optional pre-bound data accessor.
|
|
133
|
+
* @returns The overlaps found, worst first, and how many edges were written.
|
|
134
|
+
* @throws {@link CleoError} `E_NOT_FOUND` when the root does not exist.
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const r = await reconcileScope({ rootId: 'T12243' });
|
|
139
|
+
* for (const o of r.overlaps) console.log(o.action, o.keepId, o.otherId, o.rationale);
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
export async function reconcileScope(options, cwd, accessor) {
|
|
143
|
+
const acc = accessor ?? (await getTaskAccessor(cwd));
|
|
144
|
+
const threshold = options.threshold ?? OVERLAP_THRESHOLD;
|
|
145
|
+
// Reject rather than clamp. A threshold that quietly became something else
|
|
146
|
+
// would make two runs of the same command disagree with no way to tell why,
|
|
147
|
+
// and this sweep is meant to be run repeatedly and compared.
|
|
148
|
+
if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
|
|
149
|
+
throw new CleoError(ExitCode.VALIDATION_ERROR, `threshold must be a number between 0 and 1 (got ${JSON.stringify(options.threshold)})`, {
|
|
150
|
+
fix: 'Pass --threshold with a value in [0,1], e.g. --threshold 0.6',
|
|
151
|
+
details: { field: 'threshold', expected: '0 <= threshold <= 1', actual: options.threshold },
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
const root = await acc.loadSingleTask(options.rootId);
|
|
155
|
+
if (!root) {
|
|
156
|
+
throw new CleoError(ExitCode.NOT_FOUND, `Task not found: ${options.rootId}`, {
|
|
157
|
+
fix: `cleo find "${options.rootId}"`,
|
|
158
|
+
details: { field: 'rootId', actual: options.rootId },
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
const subtree = await acc.getSubtree(options.rootId);
|
|
162
|
+
// The root itself is not a candidate — a container never competes with the
|
|
163
|
+
// work it contains, however closely its title matches.
|
|
164
|
+
const live = subtree
|
|
165
|
+
.filter((t) => t.id !== options.rootId && LIVE_STATUSES.has(t.status))
|
|
166
|
+
.sort((a, b) => a.createdAt.localeCompare(b.createdAt));
|
|
167
|
+
const truncated = live.length > MAX_SWEEP_NODES ? { limit: MAX_SWEEP_NODES, liveNodes: live.length } : undefined;
|
|
168
|
+
const nodes = truncated ? live.slice(0, MAX_SWEEP_NODES) : live;
|
|
169
|
+
const overlaps = [];
|
|
170
|
+
let pairs = 0;
|
|
171
|
+
for (let i = 0; i < nodes.length; i++) {
|
|
172
|
+
for (let j = i + 1; j < nodes.length; j++) {
|
|
173
|
+
const a = nodes[i];
|
|
174
|
+
const b = nodes[j];
|
|
175
|
+
if (!a || !b)
|
|
176
|
+
continue;
|
|
177
|
+
// Containment is not competition: a subtask legitimately restates its
|
|
178
|
+
// parent's scope, which is what a decomposition IS.
|
|
179
|
+
if (a.parentId === b.id || b.parentId === a.id)
|
|
180
|
+
continue;
|
|
181
|
+
pairs++;
|
|
182
|
+
// Both scorers weight the title internally; description and labels add
|
|
183
|
+
// signal without letting a long shared boilerplate description swamp two
|
|
184
|
+
// genuinely different deliverables.
|
|
185
|
+
const score = Math.max(computeLexicalSimilarity(a.title, a.description ?? '', b.title, b.description ?? ''), computeJaccardWordSimilarity(a.title, a.description ?? '', a.labels ?? [], b.title, b.description ?? '', b.labels ?? []));
|
|
186
|
+
if (score < threshold)
|
|
187
|
+
continue;
|
|
188
|
+
// `nodes` is createdAt-ascending, so `a` is always the earlier task and
|
|
189
|
+
// therefore the survivor — a stable rule beats "whichever looks better",
|
|
190
|
+
// and it makes the sweep's output reproducible.
|
|
191
|
+
const { action, relation, rationale } = classify(a, b, score);
|
|
192
|
+
overlaps.push({
|
|
193
|
+
keepId: a.id,
|
|
194
|
+
keepTitle: a.title,
|
|
195
|
+
otherId: b.id,
|
|
196
|
+
otherTitle: b.title,
|
|
197
|
+
action,
|
|
198
|
+
score: Number(score.toFixed(4)),
|
|
199
|
+
relation,
|
|
200
|
+
rationale,
|
|
201
|
+
sameParent: (a.parentId ?? null) === (b.parentId ?? null),
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
overlaps.sort((x, y) => y.score - x.score);
|
|
206
|
+
let applied = 0;
|
|
207
|
+
if (options.apply) {
|
|
208
|
+
for (const o of overlaps) {
|
|
209
|
+
await acc.addRelation(o.otherId, o.keepId, o.relation, o.rationale);
|
|
210
|
+
applied++;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
rootId: options.rootId,
|
|
215
|
+
scanned: nodes.length,
|
|
216
|
+
pairs,
|
|
217
|
+
overlaps,
|
|
218
|
+
applied,
|
|
219
|
+
...(truncated && { truncated }),
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Dispatch-layer wrapper for {@link reconcileScope}.
|
|
224
|
+
*
|
|
225
|
+
* Mirrors `taskDecompose`: converts thrown {@link CleoError}s into an
|
|
226
|
+
* {@link EngineResult} so the gateway renders a LAFS envelope, preserving the
|
|
227
|
+
* original LAFS code rather than blanket-labelling every failure.
|
|
228
|
+
*
|
|
229
|
+
* @param projectRoot - Absolute path to the CLEO project root.
|
|
230
|
+
* @param options - Sweep inputs; see {@link ReconcileScopeOptions}.
|
|
231
|
+
* @returns Engine result carrying the overlaps and applied-edge count.
|
|
232
|
+
*/
|
|
233
|
+
export async function taskReconcileScope(projectRoot, options) {
|
|
234
|
+
try {
|
|
235
|
+
const accessor = await getTaskAccessor(projectRoot);
|
|
236
|
+
return engineSuccess(await reconcileScope(options, projectRoot, accessor));
|
|
237
|
+
}
|
|
238
|
+
catch (err) {
|
|
239
|
+
return cleoErrorToEngineResult(err, 'E_INTERNAL', 'Failed to reconcile scope');
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=reconcile-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile-scope.js","sourceRoot":"","sources":["../../src/tasks/reconcile-scope.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAqB,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEjG,qFAAqF;AACrF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,+EAA+E;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAmDtC;;;;;;;;;GASG;AACH,SAAS,QAAQ,CACf,CAAO,EACP,CAAO,EACP,KAAa;IAEb,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,IAAI,I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E,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,KAAK,CAAC,MAAM;QACrB,KAAK;QACL,QAAQ;QACR,OAAO;QACP,GAAG,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,CAAC;KAChC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,WAAmB,EACnB,OAA8B;IAE9B,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,CAAC;QACpD,OAAO,aAAa,CAAC,MAAM,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC7E,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,uBAAuB,CAAC,GAAG,EAAE,YAAY,EAAE,2BAA2B,CAAC,CAAC;IACjF,CAAC;AACH,CAAC"}
|
package/dist/tasks/req.d.ts
CHANGED
|
@@ -38,22 +38,37 @@ export interface MigrationProposal {
|
|
|
38
38
|
}
|
|
39
39
|
/** Result of `reqMigrate` with `apply: true`. */
|
|
40
40
|
export interface MigrationApplyResult {
|
|
41
|
+
/** Proposed replacements evaluated against the transaction snapshot. */
|
|
41
42
|
proposals: MigrationProposal[];
|
|
43
|
+
/** Number of free-text criteria replaced by validated gates. */
|
|
42
44
|
applied: number;
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Add a typed `AcceptanceGate` (with a REQ-ID) to a task's acceptance array.
|
|
46
48
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Validates before opening storage. Reading existing acceptance, checking REQ-ID
|
|
51
|
+
* uniqueness and persisting the task/AC projection share one transaction, so
|
|
52
|
+
* competing appends cannot overwrite each other. This records a gate; it does
|
|
53
|
+
* not execute it or record passing verification evidence.
|
|
54
|
+
*
|
|
55
|
+
* @returns The committed acceptance array and its owning task identity.
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const gate: AcceptanceGate = {
|
|
59
|
+
* kind: 'test', command: 'node', args: ['verify.mjs'], expect: 'exit0',
|
|
60
|
+
* req: 'PARTNER-121', description: 'Task-specific checks pass',
|
|
61
|
+
* };
|
|
62
|
+
* await reqAdd(projectRoot, 'T121', gate, undefined);
|
|
63
|
+
* ```
|
|
49
64
|
*
|
|
50
65
|
* @param projectRoot - Absolute path to project root
|
|
51
66
|
* @param taskId - Target task ID
|
|
52
|
-
* @param gate -
|
|
67
|
+
* @param gate - Typed gate; runtime schema validation also applies to SDK callers
|
|
53
68
|
* @param accessor - Optional pre-created accessor (for testing)
|
|
54
69
|
*
|
|
55
|
-
* @throws
|
|
56
|
-
* @throws
|
|
70
|
+
* @throws CleoError E_NOT_FOUND when the task does not exist
|
|
71
|
+
* @throws CleoError E_VALIDATION when the REQ-ID already exists on the task
|
|
57
72
|
*
|
|
58
73
|
* @task T782
|
|
59
74
|
*/
|
|
@@ -66,15 +81,21 @@ export declare function reqAdd(projectRoot: string, taskId: string, gate: Accept
|
|
|
66
81
|
/**
|
|
67
82
|
* List all REQ-ID–addressed acceptance gates on a task.
|
|
68
83
|
*
|
|
69
|
-
*
|
|
70
|
-
* they have no REQ-ID.
|
|
71
|
-
*
|
|
84
|
+
* @remarks
|
|
85
|
+
* Free-text strings are skipped because they have no REQ-ID. This summary does
|
|
86
|
+
* not execute gates or establish verification; full payloads remain on the task.
|
|
87
|
+
*
|
|
88
|
+
* @returns Requirement identity, index, kind and description for each named gate.
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* const { gates } = await reqList(projectRoot, 'T121', undefined);
|
|
92
|
+
* ```
|
|
72
93
|
*
|
|
73
94
|
* @param projectRoot - Absolute path to project root
|
|
74
95
|
* @param taskId - Target task ID
|
|
75
96
|
* @param accessor - Optional pre-created accessor (for testing)
|
|
76
97
|
*
|
|
77
|
-
* @throws
|
|
98
|
+
* @throws CleoError E_NOT_FOUND when the task does not exist
|
|
78
99
|
*
|
|
79
100
|
* @task T782
|
|
80
101
|
*/
|
|
@@ -86,19 +107,27 @@ export declare function reqList(projectRoot: string, taskId: string, accessor?:
|
|
|
86
107
|
* Heuristic migrator: reads free-text acceptance strings and proposes typed
|
|
87
108
|
* `AcceptanceGate` replacements.
|
|
88
109
|
*
|
|
110
|
+
* @remarks
|
|
89
111
|
* Without `apply: true` only proposals are returned. With `apply: true` the
|
|
90
112
|
* matched strings are replaced in the task's acceptance array and the updated
|
|
91
113
|
* array is persisted.
|
|
92
114
|
*
|
|
93
115
|
* Auto-generated REQ-IDs use the pattern `MIGRATED-001`, `MIGRATED-002`, etc.
|
|
94
|
-
*
|
|
116
|
+
* Existing structured gates and their requirement identities are preserved.
|
|
117
|
+
* Apply plans and persists under one transaction; preview does not write.
|
|
118
|
+
*
|
|
119
|
+
* @returns Proposed replacements and, when applied, the committed replacement count.
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const preview = await reqMigrate(projectRoot, 'T121', false, undefined);
|
|
123
|
+
* ```
|
|
95
124
|
*
|
|
96
125
|
* @param projectRoot - Absolute path to project root
|
|
97
126
|
* @param taskId - Target task ID
|
|
98
127
|
* @param apply - When true, writes the proposals back to the task
|
|
99
128
|
* @param accessor - Optional pre-created accessor (for testing)
|
|
100
129
|
*
|
|
101
|
-
* @throws
|
|
130
|
+
* @throws CleoError E_NOT_FOUND when the task does not exist
|
|
102
131
|
*
|
|
103
132
|
* @task T782
|
|
104
133
|
*/
|
|
@@ -112,9 +141,19 @@ export declare function reqMigrate(projectRoot: string, taskId: string, apply: b
|
|
|
112
141
|
* Returns the parsed `AcceptanceGate` on success or throws a `CleoError`
|
|
113
142
|
* with exit code `E_VALIDATION` on failure.
|
|
114
143
|
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* Uses the same schema boundary as direct SDK writes and rejects unsupported
|
|
146
|
+
* fields, including nested fields that the schema would otherwise strip.
|
|
147
|
+
*
|
|
148
|
+
* @returns The validated gate without executing its command.
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const raw = '{"kind":"manual","description":"Review","prompt":"Approve?"}';
|
|
152
|
+
* const gate = parseGateJson(raw);
|
|
153
|
+
* ```
|
|
115
154
|
* @param raw - Raw JSON string from `--gate` CLI flag
|
|
116
155
|
*
|
|
117
|
-
* @throws
|
|
156
|
+
* @throws CleoError E_VALIDATION when JSON is malformed or schema invalid
|
|
118
157
|
*
|
|
119
158
|
* @task T782
|
|
120
159
|
*/
|
package/dist/tasks/req.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"req.d.ts","sourceRoot":"","sources":["../../src/tasks/req.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"req.d.ts","sourceRoot":"","sources":["../../src/tasks/req.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAG/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAa9D,mCAAmC;AACnC,MAAM,WAAW,YAAY;IAC3B,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;IACd,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,8BAA8B;IAC9B,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,kCAAkC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,QAAQ,EAAE,cAA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