@cleocode/core 2026.10.27 → 2026.11.1-canary.3
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/README.md +2 -0
- package/binaries/README.md +30 -10
- package/dist/.source-stamp.json +4 -0
- package/dist/audit/reconstruct.d.ts.map +1 -1
- package/dist/audit/reconstruct.js +3 -13
- package/dist/audit/reconstruct.js.map +1 -1
- package/dist/build-provenance.json +2 -2
- package/dist/cloud/nexus-cloud.d.ts.map +1 -1
- package/dist/cloud/nexus-cloud.js +3 -3
- package/dist/cloud/nexus-cloud.js.map +1 -1
- package/dist/cloud/nexus-device.d.ts +1 -1
- package/dist/cloud/nexus-link.d.ts +18 -2
- package/dist/cloud/nexus-link.d.ts.map +1 -1
- package/dist/cloud/nexus-link.js +26 -6
- package/dist/cloud/nexus-link.js.map +1 -1
- package/dist/cloud/nexus-vault.d.ts.map +1 -1
- package/dist/cloud/nexus-vault.js +3 -9
- package/dist/cloud/nexus-vault.js.map +1 -1
- package/dist/decide/sites/registry.d.ts +40 -0
- package/dist/decide/sites/registry.d.ts.map +1 -1
- package/dist/decide/sites/registry.js +38 -0
- package/dist/decide/sites/registry.js.map +1 -1
- package/dist/docs/adr-allocator.d.ts +3 -3
- package/dist/docs/adr-allocator.d.ts.map +1 -1
- package/dist/docs/adr-allocator.js +8 -5
- package/dist/docs/adr-allocator.js.map +1 -1
- package/dist/docs/blob-consolidation.d.ts.map +1 -1
- package/dist/docs/blob-consolidation.js +3 -2
- package/dist/docs/blob-consolidation.js.map +1 -1
- package/dist/docs/derive-links.d.ts +12 -0
- package/dist/docs/derive-links.d.ts.map +1 -1
- package/dist/docs/derive-links.js +19 -0
- package/dist/docs/derive-links.js.map +1 -1
- package/dist/docs/doc-name-rule.d.ts +105 -0
- package/dist/docs/doc-name-rule.d.ts.map +1 -0
- package/dist/docs/doc-name-rule.js +212 -0
- package/dist/docs/doc-name-rule.js.map +1 -0
- package/dist/docs/docs-inconsistency-detector.d.ts.map +1 -1
- package/dist/docs/docs-inconsistency-detector.js +4 -3
- package/dist/docs/docs-inconsistency-detector.js.map +1 -1
- package/dist/docs/docs-ops.d.ts +27 -5
- package/dist/docs/docs-ops.d.ts.map +1 -1
- package/dist/docs/docs-ops.js +149 -17
- package/dist/docs/docs-ops.js.map +1 -1
- package/dist/docs/docs-read-model.d.ts +45 -15
- package/dist/docs/docs-read-model.d.ts.map +1 -1
- package/dist/docs/docs-read-model.js +22 -102
- package/dist/docs/docs-read-model.js.map +1 -1
- package/dist/docs/docs-update.d.ts.map +1 -1
- package/dist/docs/docs-update.js +8 -2
- package/dist/docs/docs-update.js.map +1 -1
- package/dist/docs/doctor.d.ts +71 -4
- package/dist/docs/doctor.d.ts.map +1 -1
- package/dist/docs/doctor.js +324 -23
- package/dist/docs/doctor.js.map +1 -1
- package/dist/docs/duplicate-check.d.ts +138 -0
- package/dist/docs/duplicate-check.d.ts.map +1 -0
- package/dist/docs/duplicate-check.js +286 -0
- package/dist/docs/duplicate-check.js.map +1 -0
- package/dist/docs/fetch-result.d.ts.map +1 -1
- package/dist/docs/fetch-result.js +27 -0
- package/dist/docs/fetch-result.js.map +1 -1
- package/dist/docs/import/scanner.d.ts +2 -0
- package/dist/docs/import/scanner.d.ts.map +1 -1
- package/dist/docs/import/scanner.js +3 -1
- package/dist/docs/import/scanner.js.map +1 -1
- package/dist/docs/lineage.d.ts +66 -0
- package/dist/docs/lineage.d.ts.map +1 -0
- package/dist/docs/lineage.js +190 -0
- package/dist/docs/lineage.js.map +1 -0
- package/dist/docs/modernize/apply.d.ts +139 -0
- package/dist/docs/modernize/apply.d.ts.map +1 -0
- package/dist/docs/modernize/apply.js +760 -0
- package/dist/docs/modernize/apply.js.map +1 -0
- package/dist/docs/modernize/guard.d.ts +92 -0
- package/dist/docs/modernize/guard.d.ts.map +1 -0
- package/dist/docs/modernize/guard.js +214 -0
- package/dist/docs/modernize/guard.js.map +1 -0
- package/dist/docs/modernize/index.d.ts +68 -0
- package/dist/docs/modernize/index.d.ts.map +1 -0
- package/dist/docs/modernize/index.js +97 -0
- package/dist/docs/modernize/index.js.map +1 -0
- package/dist/docs/modernize/judge.d.ts +85 -0
- package/dist/docs/modernize/judge.d.ts.map +1 -0
- package/dist/docs/modernize/judge.js +186 -0
- package/dist/docs/modernize/judge.js.map +1 -0
- package/dist/docs/modernize/plan.d.ts +77 -0
- package/dist/docs/modernize/plan.d.ts.map +1 -0
- package/dist/docs/modernize/plan.js +510 -0
- package/dist/docs/modernize/plan.js.map +1 -0
- package/dist/docs/modernize/restore.d.ts +41 -0
- package/dist/docs/modernize/restore.d.ts.map +1 -0
- package/dist/docs/modernize/restore.js +103 -0
- package/dist/docs/modernize/restore.js.map +1 -0
- package/dist/docs/modernize/rules.d.ts +197 -0
- package/dist/docs/modernize/rules.d.ts.map +1 -0
- package/dist/docs/modernize/rules.js +510 -0
- package/dist/docs/modernize/rules.js.map +1 -0
- package/dist/docs/modernize/store.d.ts +64 -0
- package/dist/docs/modernize/store.d.ts.map +1 -0
- package/dist/docs/modernize/store.js +390 -0
- package/dist/docs/modernize/store.js.map +1 -0
- package/dist/docs/publications-store.d.ts +16 -2
- package/dist/docs/publications-store.d.ts.map +1 -1
- package/dist/docs/publications-store.js +23 -2
- package/dist/docs/publications-store.js.map +1 -1
- package/dist/docs/publish-pr.d.ts.map +1 -1
- package/dist/docs/publish-pr.js +12 -1
- package/dist/docs/publish-pr.js.map +1 -1
- package/dist/docs/rot.d.ts +94 -0
- package/dist/docs/rot.d.ts.map +1 -0
- package/dist/docs/rot.js +298 -0
- package/dist/docs/rot.js.map +1 -0
- package/dist/docs/similarity-check.d.ts +2 -0
- package/dist/docs/similarity-check.d.ts.map +1 -1
- package/dist/docs/similarity-check.js +6 -49
- package/dist/docs/similarity-check.js.map +1 -1
- package/dist/docs/slug-rename.d.ts +84 -0
- package/dist/docs/slug-rename.d.ts.map +1 -0
- package/dist/docs/slug-rename.js +166 -0
- package/dist/docs/slug-rename.js.map +1 -0
- package/dist/docs/slug-similarity.d.ts +24 -0
- package/dist/docs/slug-similarity.d.ts.map +1 -0
- package/dist/docs/slug-similarity.js +63 -0
- package/dist/docs/slug-similarity.js.map +1 -0
- package/dist/docs/wikilinks.d.ts +20 -4
- package/dist/docs/wikilinks.d.ts.map +1 -1
- package/dist/docs/wikilinks.js +52 -7
- package/dist/docs/wikilinks.js.map +1 -1
- package/dist/docs/writer-registry.d.ts.map +1 -1
- package/dist/docs/writer-registry.js +33 -0
- package/dist/docs/writer-registry.js.map +1 -1
- package/dist/doctor/type-matrix-repair.d.ts +194 -0
- package/dist/doctor/type-matrix-repair.d.ts.map +1 -0
- package/dist/doctor/type-matrix-repair.js +662 -0
- package/dist/doctor/type-matrix-repair.js.map +1 -0
- package/dist/gateway-client/generated/index.d.ts +2 -2
- package/dist/gateway-client/generated/index.d.ts.map +1 -1
- package/dist/gateway-client/generated/index.js +1 -1
- package/dist/gateway-client/generated/index.js.map +1 -1
- package/dist/gateway-client/generated/namespaces.gen.d.ts +5 -0
- package/dist/gateway-client/generated/namespaces.gen.d.ts.map +1 -1
- package/dist/gateway-client/generated/namespaces.gen.js +6 -1
- package/dist/gateway-client/generated/namespaces.gen.js.map +1 -1
- package/dist/gateway-client/generated/sdk.gen.d.ts +21 -1
- package/dist/gateway-client/generated/sdk.gen.d.ts.map +1 -1
- package/dist/gateway-client/generated/sdk.gen.js +55 -0
- package/dist/gateway-client/generated/sdk.gen.js.map +1 -1
- package/dist/gateway-client/generated/types.gen.d.ts +222 -0
- package/dist/gateway-client/generated/types.gen.d.ts.map +1 -1
- package/dist/gc/gc-subsystem.d.ts +4 -0
- package/dist/gc/gc-subsystem.d.ts.map +1 -1
- package/dist/gc/gc-subsystem.js +16 -0
- package/dist/gc/gc-subsystem.js.map +1 -1
- package/dist/git/work-tree.d.ts +48 -0
- package/dist/git/work-tree.d.ts.map +1 -1
- package/dist/git/work-tree.js +63 -1
- package/dist/git/work-tree.js.map +1 -1
- package/dist/hooks/handlers/session-hooks.d.ts +5 -4
- package/dist/hooks/handlers/session-hooks.d.ts.map +1 -1
- package/dist/hooks/handlers/session-hooks.js +5 -21
- package/dist/hooks/handlers/session-hooks.js.map +1 -1
- package/dist/internal.d.ts +5 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +5 -1
- package/dist/internal.js.map +1 -1
- package/dist/memory/brain-doctor.d.ts.map +1 -1
- package/dist/memory/brain-doctor.js +6 -1
- package/dist/memory/brain-doctor.js.map +1 -1
- package/dist/memory/engine-compat.d.ts.map +1 -1
- package/dist/memory/engine-compat.js +6 -0
- package/dist/memory/engine-compat.js.map +1 -1
- package/dist/nexus/analyze-orchestrator.d.ts +24 -0
- package/dist/nexus/analyze-orchestrator.d.ts.map +1 -1
- package/dist/nexus/analyze-orchestrator.js +43 -5
- package/dist/nexus/analyze-orchestrator.js.map +1 -1
- package/dist/nexus/user-profile.d.ts +2 -1
- package/dist/nexus/user-profile.d.ts.map +1 -1
- package/dist/nexus/user-profile.js +13 -5
- package/dist/nexus/user-profile.js.map +1 -1
- package/dist/orchestrate/admission.d.ts +8 -0
- package/dist/orchestrate/admission.d.ts.map +1 -1
- package/dist/orchestrate/admission.js +3 -1
- package/dist/orchestrate/admission.js.map +1 -1
- package/dist/orchestrate/query-ops.d.ts.map +1 -1
- package/dist/orchestrate/query-ops.js +15 -4
- package/dist/orchestrate/query-ops.js.map +1 -1
- package/dist/orchestrate/spawn-ops.d.ts.map +1 -1
- package/dist/orchestrate/spawn-ops.js +43 -2
- package/dist/orchestrate/spawn-ops.js.map +1 -1
- package/dist/orchestration/index.d.ts +6 -0
- package/dist/orchestration/index.d.ts.map +1 -1
- package/dist/orchestration/index.js +3 -0
- package/dist/orchestration/index.js.map +1 -1
- package/dist/orchestration/spawn-prompt.d.ts.map +1 -1
- package/dist/orchestration/spawn-prompt.js +3 -1
- package/dist/orchestration/spawn-prompt.js.map +1 -1
- package/dist/paths.d.ts +43 -1
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +51 -1
- package/dist/paths.js.map +1 -1
- package/dist/project-lifecycle.d.ts.map +1 -1
- package/dist/project-lifecycle.js +31 -0
- package/dist/project-lifecycle.js.map +1 -1
- package/dist/release/authorization.d.ts +156 -0
- package/dist/release/authorization.d.ts.map +1 -0
- package/dist/release/authorization.js +460 -0
- package/dist/release/authorization.js.map +1 -0
- package/dist/release/ci-evidence.d.ts +55 -4
- package/dist/release/ci-evidence.d.ts.map +1 -1
- package/dist/release/ci-evidence.js +251 -22
- package/dist/release/ci-evidence.js.map +1 -1
- package/dist/release/ci-run-evidence.d.ts +107 -0
- package/dist/release/ci-run-evidence.d.ts.map +1 -0
- package/dist/release/ci-run-evidence.js +234 -0
- package/dist/release/ci-run-evidence.js.map +1 -0
- package/dist/release/cut.d.ts +231 -0
- package/dist/release/cut.d.ts.map +1 -0
- package/dist/release/cut.js +775 -0
- package/dist/release/cut.js.map +1 -0
- package/dist/release/deploy-evidence.d.ts +173 -0
- package/dist/release/deploy-evidence.d.ts.map +1 -0
- package/dist/release/deploy-evidence.js +381 -0
- package/dist/release/deploy-evidence.js.map +1 -0
- package/dist/release/engine-ops.d.ts.map +1 -1
- package/dist/release/engine-ops.js +10 -4
- package/dist/release/engine-ops.js.map +1 -1
- package/dist/release/index.d.ts +3 -0
- package/dist/release/index.d.ts.map +1 -1
- package/dist/release/index.js +2 -0
- package/dist/release/index.js.map +1 -1
- package/dist/release/invariants/archive-reason-invariant.d.ts.map +1 -1
- package/dist/release/invariants/archive-reason-invariant.js +4 -1
- package/dist/release/invariants/archive-reason-invariant.js.map +1 -1
- package/dist/release/open.d.ts.map +1 -1
- package/dist/release/open.js +2 -6
- package/dist/release/open.js.map +1 -1
- package/dist/release/plan.d.ts +34 -2
- package/dist/release/plan.d.ts.map +1 -1
- package/dist/release/plan.js +30 -6
- package/dist/release/plan.js.map +1 -1
- package/dist/release/preflight-skip.d.ts +4 -19
- package/dist/release/preflight-skip.d.ts.map +1 -1
- package/dist/release/preflight-skip.js +5 -110
- package/dist/release/preflight-skip.js.map +1 -1
- package/dist/release/reconcile-latest.d.ts +29 -0
- package/dist/release/reconcile-latest.d.ts.map +1 -0
- package/dist/release/reconcile-latest.js +71 -0
- package/dist/release/reconcile-latest.js.map +1 -0
- package/dist/release/reconcile.d.ts +3 -1
- package/dist/release/reconcile.d.ts.map +1 -1
- package/dist/release/reconcile.js +18 -6
- package/dist/release/reconcile.js.map +1 -1
- package/dist/release/release-published.d.ts +27 -0
- package/dist/release/release-published.d.ts.map +1 -0
- package/dist/release/release-published.js +35 -0
- package/dist/release/release-published.js.map +1 -0
- package/dist/release/tty-confirm.d.ts +23 -0
- package/dist/release/tty-confirm.d.ts.map +1 -0
- package/dist/release/tty-confirm.js +50 -0
- package/dist/release/tty-confirm.js.map +1 -0
- package/dist/remote/index.js +1 -1
- package/dist/remote/index.js.map +1 -1
- package/dist/resources/admission-ledger.d.ts +103 -1
- package/dist/resources/admission-ledger.d.ts.map +1 -1
- package/dist/resources/admission-ledger.js +200 -17
- package/dist/resources/admission-ledger.js.map +1 -1
- package/dist/resources/agent-lease.d.ts +82 -0
- package/dist/resources/agent-lease.d.ts.map +1 -0
- package/dist/resources/agent-lease.js +167 -0
- package/dist/resources/agent-lease.js.map +1 -0
- package/dist/resources/governor.d.ts +27 -1
- package/dist/resources/governor.d.ts.map +1 -1
- package/dist/resources/governor.js +88 -4
- package/dist/resources/governor.js.map +1 -1
- package/dist/resources/hook-footprint.d.ts +13 -1
- package/dist/resources/hook-footprint.d.ts.map +1 -1
- package/dist/resources/hook-footprint.js +33 -7
- package/dist/resources/hook-footprint.js.map +1 -1
- package/dist/resources/run-governed.d.ts +25 -0
- package/dist/resources/run-governed.d.ts.map +1 -1
- package/dist/resources/run-governed.js +44 -3
- package/dist/resources/run-governed.js.map +1 -1
- package/dist/sagas/reconcile.d.ts.map +1 -1
- package/dist/sagas/reconcile.js +11 -0
- package/dist/sagas/reconcile.js.map +1 -1
- package/dist/scaffold/ensure-dirs.d.ts.map +1 -1
- package/dist/scaffold/ensure-dirs.js +8 -6
- package/dist/scaffold/ensure-dirs.js.map +1 -1
- package/dist/security/override-cap-setting.d.ts +132 -0
- package/dist/security/override-cap-setting.d.ts.map +1 -1
- package/dist/security/override-cap-setting.js +88 -10
- package/dist/security/override-cap-setting.js.map +1 -1
- package/dist/security/owner-override-authority.d.ts.map +1 -1
- package/dist/security/owner-override-authority.js +5 -1
- package/dist/security/owner-override-authority.js.map +1 -1
- package/dist/selfimprove/draft-pr.d.ts.map +1 -1
- package/dist/selfimprove/draft-pr.js +4 -1
- package/dist/selfimprove/draft-pr.js.map +1 -1
- package/dist/session/engine-ops.d.ts.map +1 -1
- package/dist/session/engine-ops.js +4 -16
- package/dist/session/engine-ops.js.map +1 -1
- package/dist/sessions/briefing.d.ts +6 -0
- package/dist/sessions/briefing.d.ts.map +1 -1
- package/dist/sessions/briefing.js +34 -0
- package/dist/sessions/briefing.js.map +1 -1
- package/dist/sessions/session-end-snapshot-entry.js +2 -2
- package/dist/sessions/session-end-snapshot-entry.js.map +1 -1
- package/dist/sessions/session-end-snapshot.js +4 -4
- package/dist/sessions/session-end-snapshot.js.map +1 -1
- package/dist/skills/injection/token.d.ts.map +1 -1
- package/dist/skills/injection/token.js +3 -6
- package/dist/skills/injection/token.js.map +1 -1
- package/dist/skills/orchestrator/spawn.d.ts.map +1 -1
- package/dist/skills/orchestrator/spawn.js +3 -4
- package/dist/skills/orchestrator/spawn.js.map +1 -1
- package/dist/skills/propose-patch.d.ts.map +1 -1
- package/dist/skills/propose-patch.js +4 -1
- package/dist/skills/propose-patch.js.map +1 -1
- package/dist/spawn/branch-integration.d.ts.map +1 -1
- package/dist/spawn/branch-integration.js +5 -2
- package/dist/spawn/branch-integration.js.map +1 -1
- package/dist/store/attachment-repair.d.ts.map +1 -1
- package/dist/store/attachment-repair.js +5 -4
- package/dist/store/attachment-repair.js.map +1 -1
- package/dist/store/attachment-store.d.ts +6 -0
- package/dist/store/attachment-store.d.ts.map +1 -1
- package/dist/store/attachment-store.js +19 -2
- package/dist/store/attachment-store.js.map +1 -1
- package/dist/store/blob-ops.d.ts +1 -1
- package/dist/store/blob-ops.d.ts.map +1 -1
- package/dist/store/blob-ops.js +7 -3
- package/dist/store/blob-ops.js.map +1 -1
- package/dist/store/conduit-doc-history.d.ts +15 -1
- package/dist/store/conduit-doc-history.d.ts.map +1 -1
- package/dist/store/conduit-doc-history.js +16 -10
- package/dist/store/conduit-doc-history.js.map +1 -1
- package/dist/store/db-helpers.d.ts +29 -0
- package/dist/store/db-helpers.d.ts.map +1 -1
- package/dist/store/db-helpers.js +89 -1
- package/dist/store/db-helpers.js.map +1 -1
- package/dist/store/decision-adr-links.d.ts.map +1 -1
- package/dist/store/decision-adr-links.js +5 -2
- package/dist/store/decision-adr-links.js.map +1 -1
- package/dist/store/git-checkpoint.d.ts +11 -1
- package/dist/store/git-checkpoint.d.ts.map +1 -1
- package/dist/store/git-checkpoint.js +14 -3
- package/dist/store/git-checkpoint.js.map +1 -1
- package/dist/store/llmtxt-blob-adapter.d.ts.map +1 -1
- package/dist/store/llmtxt-blob-adapter.js +4 -1
- package/dist/store/llmtxt-blob-adapter.js.map +1 -1
- package/dist/store/schema/attachments.d.ts +7 -5
- package/dist/store/schema/attachments.d.ts.map +1 -1
- package/dist/store/schema/attachments.js +5 -2
- package/dist/store/schema/attachments.js.map +1 -1
- package/dist/store/session-store.d.ts.map +1 -1
- package/dist/store/session-store.js +6 -0
- package/dist/store/session-store.js.map +1 -1
- package/dist/store/sqlite-backup.d.ts +6 -1
- package/dist/store/sqlite-backup.d.ts.map +1 -1
- package/dist/store/sqlite-backup.js +9 -5
- package/dist/store/sqlite-backup.js.map +1 -1
- package/dist/store/sqlite-data-accessor.d.ts.map +1 -1
- package/dist/store/sqlite-data-accessor.js +63 -36
- package/dist/store/sqlite-data-accessor.js.map +1 -1
- package/dist/system/backup.d.ts +29 -0
- package/dist/system/backup.d.ts.map +1 -1
- package/dist/system/backup.js +240 -37
- package/dist/system/backup.js.map +1 -1
- package/dist/system/dependencies.d.ts +22 -0
- package/dist/system/dependencies.d.ts.map +1 -1
- package/dist/system/dependencies.js +49 -2
- package/dist/system/dependencies.js.map +1 -1
- package/dist/system/health.d.ts.map +1 -1
- package/dist/system/health.js +23 -1
- package/dist/system/health.js.map +1 -1
- package/dist/task-work/claims.d.ts.map +1 -1
- package/dist/task-work/claims.js +14 -0
- package/dist/task-work/claims.js.map +1 -1
- package/dist/task-work/index.d.ts.map +1 -1
- package/dist/task-work/index.js +22 -0
- package/dist/task-work/index.js.map +1 -1
- package/dist/tasks/ac-coverage-gate.d.ts +27 -0
- package/dist/tasks/ac-coverage-gate.d.ts.map +1 -1
- package/dist/tasks/ac-coverage-gate.js +63 -28
- package/dist/tasks/ac-coverage-gate.js.map +1 -1
- package/dist/tasks/affected-packages.d.ts +26 -30
- package/dist/tasks/affected-packages.d.ts.map +1 -1
- package/dist/tasks/affected-packages.js +27 -50
- package/dist/tasks/affected-packages.js.map +1 -1
- package/dist/tasks/affected-scope.d.ts +13 -3
- package/dist/tasks/affected-scope.d.ts.map +1 -1
- package/dist/tasks/affected-scope.js +29 -11
- package/dist/tasks/affected-scope.js.map +1 -1
- package/dist/tasks/change-set.d.ts.map +1 -1
- package/dist/tasks/change-set.js +39 -20
- package/dist/tasks/change-set.js.map +1 -1
- package/dist/tasks/command-gate-cmd.d.ts +33 -0
- package/dist/tasks/command-gate-cmd.d.ts.map +1 -0
- package/dist/tasks/command-gate-cmd.js +45 -0
- package/dist/tasks/command-gate-cmd.js.map +1 -0
- package/dist/tasks/complete-ci.d.ts +9 -0
- package/dist/tasks/complete-ci.d.ts.map +1 -1
- package/dist/tasks/complete-ci.js +21 -4
- package/dist/tasks/complete-ci.js.map +1 -1
- package/dist/tasks/complete.d.ts.map +1 -1
- package/dist/tasks/complete.js +14 -0
- package/dist/tasks/complete.js.map +1 -1
- package/dist/tasks/component-pr.d.ts +37 -0
- package/dist/tasks/component-pr.d.ts.map +1 -1
- package/dist/tasks/component-pr.js +106 -14
- package/dist/tasks/component-pr.js.map +1 -1
- package/dist/tasks/done-plan.d.ts +14 -1
- package/dist/tasks/done-plan.d.ts.map +1 -1
- package/dist/tasks/done-plan.js +125 -15
- package/dist/tasks/done-plan.js.map +1 -1
- package/dist/tasks/done-record.d.ts.map +1 -1
- package/dist/tasks/done-record.js +4 -0
- package/dist/tasks/done-record.js.map +1 -1
- package/dist/tasks/engine-converters.d.ts.map +1 -1
- package/dist/tasks/engine-converters.js +2 -0
- package/dist/tasks/engine-converters.js.map +1 -1
- package/dist/tasks/evidence-tree.d.ts +28 -1
- package/dist/tasks/evidence-tree.d.ts.map +1 -1
- package/dist/tasks/evidence-tree.js +66 -2
- package/dist/tasks/evidence-tree.js.map +1 -1
- package/dist/tasks/evidence.d.ts +39 -27
- package/dist/tasks/evidence.d.ts.map +1 -1
- package/dist/tasks/evidence.js +382 -188
- package/dist/tasks/evidence.js.map +1 -1
- package/dist/tasks/gate-notes.d.ts +17 -0
- package/dist/tasks/gate-notes.d.ts.map +1 -1
- package/dist/tasks/gate-notes.js.map +1 -1
- package/dist/tasks/gate-preview.d.ts +7 -1
- package/dist/tasks/gate-preview.d.ts.map +1 -1
- package/dist/tasks/gate-preview.js +30 -4
- package/dist/tasks/gate-preview.js.map +1 -1
- package/dist/tasks/gate-runner.d.ts +42 -0
- package/dist/tasks/gate-runner.d.ts.map +1 -1
- package/dist/tasks/gate-runner.js +234 -94
- package/dist/tasks/gate-runner.js.map +1 -1
- package/dist/tasks/manifest-scope.d.ts +115 -0
- package/dist/tasks/manifest-scope.d.ts.map +1 -0
- package/dist/tasks/manifest-scope.js +352 -0
- package/dist/tasks/manifest-scope.js.map +1 -0
- package/dist/tasks/merge-close.d.ts +376 -0
- package/dist/tasks/merge-close.d.ts.map +1 -0
- package/dist/tasks/merge-close.js +1497 -0
- package/dist/tasks/merge-close.js.map +1 -0
- package/dist/tasks/qa-run-binding.d.ts +5 -0
- package/dist/tasks/qa-run-binding.d.ts.map +1 -1
- package/dist/tasks/qa-run-binding.js +6 -1
- package/dist/tasks/qa-run-binding.js.map +1 -1
- package/dist/tasks/req.d.ts.map +1 -1
- package/dist/tasks/req.js +29 -1
- package/dist/tasks/req.js.map +1 -1
- package/dist/tasks/review-verdict.d.ts +159 -0
- package/dist/tasks/review-verdict.d.ts.map +1 -0
- package/dist/tasks/review-verdict.js +442 -0
- package/dist/tasks/review-verdict.js.map +1 -0
- package/dist/tasks/task-reparent.d.ts.map +1 -1
- package/dist/tasks/task-reparent.js +22 -3
- package/dist/tasks/task-reparent.js.map +1 -1
- package/dist/tasks/test-report-counts.d.ts +274 -0
- package/dist/tasks/test-report-counts.d.ts.map +1 -0
- package/dist/tasks/test-report-counts.js +746 -0
- package/dist/tasks/test-report-counts.js.map +1 -0
- package/dist/tasks/test-run-binding.d.ts +20 -45
- package/dist/tasks/test-run-binding.d.ts.map +1 -1
- package/dist/tasks/test-run-binding.js +34 -119
- package/dist/tasks/test-run-binding.js.map +1 -1
- package/dist/tasks/update.d.ts.map +1 -1
- package/dist/tasks/update.js +42 -0
- package/dist/tasks/update.js.map +1 -1
- package/dist/tasks/verification-policy.d.ts +12 -0
- package/dist/tasks/verification-policy.d.ts.map +1 -1
- package/dist/tasks/verification-policy.js +13 -0
- package/dist/tasks/verification-policy.js.map +1 -1
- package/dist/tasks/workspace-resolution.d.ts +225 -0
- package/dist/tasks/workspace-resolution.d.ts.map +1 -0
- package/dist/tasks/workspace-resolution.js +497 -0
- package/dist/tasks/workspace-resolution.js.map +1 -0
- package/dist/validation/doctor/checks.d.ts +20 -0
- package/dist/validation/doctor/checks.d.ts.map +1 -1
- package/dist/validation/doctor/checks.js +112 -0
- package/dist/validation/doctor/checks.js.map +1 -1
- package/dist/validation/engine-ops.d.ts.map +1 -1
- package/dist/validation/engine-ops.js +37 -3
- package/dist/validation/engine-ops.js.map +1 -1
- package/dist/validation/validate-ops.d.ts +4 -0
- package/dist/validation/validate-ops.d.ts.map +1 -1
- package/dist/validation/validate-ops.js +79 -2
- package/dist/validation/validate-ops.js.map +1 -1
- package/dist/worktree/list.d.ts +4 -21
- package/dist/worktree/list.d.ts.map +1 -1
- package/dist/worktree/list.js +14 -44
- package/dist/worktree/list.js.map +1 -1
- package/dist/worktree/merged-cleanup.d.ts +63 -0
- package/dist/worktree/merged-cleanup.d.ts.map +1 -0
- package/dist/worktree/merged-cleanup.js +571 -0
- package/dist/worktree/merged-cleanup.js.map +1 -0
- package/dist/worktree/prune.d.ts +64 -2
- package/dist/worktree/prune.d.ts.map +1 -1
- package/dist/worktree/prune.js +151 -6
- package/dist/worktree/prune.js.map +1 -1
- package/dist/worktree/sentinel-index.d.ts +14 -0
- package/dist/worktree/sentinel-index.d.ts.map +1 -1
- package/dist/worktree/sentinel-index.js +17 -0
- package/dist/worktree/sentinel-index.js.map +1 -1
- package/dist/worktree/worktree-adopt.d.ts +1 -13
- package/dist/worktree/worktree-adopt.d.ts.map +1 -1
- package/dist/worktree/worktree-adopt.js +2 -17
- package/dist/worktree/worktree-adopt.js.map +1 -1
- package/package.json +12 -12
- package/schemas/project-context.schema.json +33 -0
- package/templates/CLEO-INJECTION.md +6 -16
- package/templates/CLEO-REFERENCE.md +27 -4
- package/templates/git-hooks/legacy-hashes.json +2 -1
- package/templates/git-hooks/pre-commit +43 -11
- package/templates/workflows/release-prepare.yml.tmpl +9 -88
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure rules for `cleo docs modernize` (T14113): classify a file into a
|
|
3
|
+
* taxonomy kind, derive its stable slug, measure how alike two docs are, and
|
|
4
|
+
* rewrite links to wikilinks.
|
|
5
|
+
*
|
|
6
|
+
* No I/O here. The planner (`plan.ts`) feeds these rules the scanned files and
|
|
7
|
+
* asks System One (`judge.ts`) only where a rule is unsure.
|
|
8
|
+
*
|
|
9
|
+
* @task T14113
|
|
10
|
+
* @epic T14106
|
|
11
|
+
*/
|
|
12
|
+
import { WIKILINK_PATTERN } from '../derive-links.js';
|
|
13
|
+
import { DOC_NAME_MAX_LENGTH, docNameViolation, subjectSlug } from '../doc-name-rule.js';
|
|
14
|
+
/** Confidence at or above which a classify rule acts without asking System One. */
|
|
15
|
+
export const MODERNIZE_CLASSIFY_FLOOR = 0.75;
|
|
16
|
+
/** Similarity at or above which two docs merge without asking System One. */
|
|
17
|
+
export const MODERNIZE_MERGE_SURE = 0.8;
|
|
18
|
+
/** Similarity below which two docs are kept apart without asking System One. */
|
|
19
|
+
export const MODERNIZE_MERGE_APART = 0.4;
|
|
20
|
+
/** Longest slug modernize proposes, in characters. */
|
|
21
|
+
export const MODERNIZE_SLUG_MAX = DOC_NAME_MAX_LENGTH;
|
|
22
|
+
/**
|
|
23
|
+
* Folder-name aliases that name a kind under another spelling (the T14107
|
|
24
|
+
* taxonomy's "absorbs" column). An alias only fires when its kind is
|
|
25
|
+
* registered, so kinds a project has not adopted fall through to the rules.
|
|
26
|
+
*/
|
|
27
|
+
const FOLDER_ALIASES = {
|
|
28
|
+
adrs: 'adr',
|
|
29
|
+
decisions: 'adr',
|
|
30
|
+
specs: 'spec',
|
|
31
|
+
specifications: 'spec',
|
|
32
|
+
handoffs: 'handoff',
|
|
33
|
+
plans: 'plan',
|
|
34
|
+
notes: 'note',
|
|
35
|
+
releases: 'release-note',
|
|
36
|
+
analysis: 'research',
|
|
37
|
+
audits: 'research',
|
|
38
|
+
audit: 'research',
|
|
39
|
+
reports: 'research',
|
|
40
|
+
guides: 'guide',
|
|
41
|
+
examples: 'guide',
|
|
42
|
+
'owner-ci': 'guide',
|
|
43
|
+
concepts: 'concept',
|
|
44
|
+
architecture: 'concept',
|
|
45
|
+
design: 'concept',
|
|
46
|
+
api: 'reference',
|
|
47
|
+
'cli-reference': 'reference',
|
|
48
|
+
registry: 'reference',
|
|
49
|
+
skills: 'reference',
|
|
50
|
+
migrations: 'migration',
|
|
51
|
+
};
|
|
52
|
+
/** Filename words that name a kind. */
|
|
53
|
+
const NAME_HINTS = [
|
|
54
|
+
[/^adr-\d+/, 'adr'],
|
|
55
|
+
[/(^|-)handoff(-|$)/, 'handoff'],
|
|
56
|
+
[/(^|-)spec(ification)?(-|$)/, 'spec'],
|
|
57
|
+
[/(^|-)plan(-|$)/, 'plan'],
|
|
58
|
+
[/(^|-)(research|report|audit|analysis)(-|$)/, 'research'],
|
|
59
|
+
[/(^|-)release-notes?(-|$)/, 'release-note'],
|
|
60
|
+
];
|
|
61
|
+
/** Body shapes that name a kind. */
|
|
62
|
+
const BODY_HINTS = [
|
|
63
|
+
[/^#{1,3}\s+(context|status)\b[\s\S]*^#{1,3}\s+decision\b/im, 'adr'],
|
|
64
|
+
[/^#{1,3}\s+(handoff|next steps for the next agent)\b/im, 'handoff'],
|
|
65
|
+
[/^#{1,3}\s+(requirements|acceptance criteria)\b/im, 'spec'],
|
|
66
|
+
[/^#{1,3}\s+(findings|methodology|summary of findings)\b/im, 'research'],
|
|
67
|
+
];
|
|
68
|
+
/**
|
|
69
|
+
* Read a front-matter scalar (`key: value`) from a markdown file.
|
|
70
|
+
*
|
|
71
|
+
* @param content - File text.
|
|
72
|
+
* @param key - Front-matter key.
|
|
73
|
+
* @returns The trimmed, unquoted value, or null.
|
|
74
|
+
*/
|
|
75
|
+
export function readFrontMatterValue(content, key) {
|
|
76
|
+
const match = /^---\r?\n([\s\S]*?)\r?\n---/.exec(content);
|
|
77
|
+
if (!match?.[1])
|
|
78
|
+
return null;
|
|
79
|
+
const line = new RegExp(`^${key}:\\s*(.+)$`, 'm').exec(match[1]);
|
|
80
|
+
if (!line?.[1])
|
|
81
|
+
return null;
|
|
82
|
+
return line[1].trim().replace(/^['"]|['"]$/g, '') || null;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* The first H1 of a markdown file, or null.
|
|
86
|
+
*
|
|
87
|
+
* @param content - File text.
|
|
88
|
+
* @returns The heading text without the `#`.
|
|
89
|
+
*/
|
|
90
|
+
export function readTitle(content) {
|
|
91
|
+
const fm = readFrontMatterValue(content, 'title');
|
|
92
|
+
if (fm)
|
|
93
|
+
return fm;
|
|
94
|
+
const match = /^#\s+(.+?)\s*#*\s*$/m.exec(content);
|
|
95
|
+
return match?.[1]?.trim() || null;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Resolve a folder or word to a registered kind.
|
|
99
|
+
*
|
|
100
|
+
* @param word - A folder name or filename word.
|
|
101
|
+
* @param kinds - Registered kind ids.
|
|
102
|
+
* @returns The kind, or null when none matches.
|
|
103
|
+
*/
|
|
104
|
+
function kindForWord(word, kinds) {
|
|
105
|
+
const lower = word.toLowerCase();
|
|
106
|
+
if (kinds.has(lower))
|
|
107
|
+
return lower;
|
|
108
|
+
const alias = FOLDER_ALIASES[lower];
|
|
109
|
+
if (alias && kinds.has(alias))
|
|
110
|
+
return alias;
|
|
111
|
+
if (lower.endsWith('s') && kinds.has(lower.slice(0, -1)))
|
|
112
|
+
return lower.slice(0, -1);
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The kind a folder name stands for (its own name or a T14107 alias).
|
|
117
|
+
*
|
|
118
|
+
* @param folder - One folder name.
|
|
119
|
+
* @param kinds - The registry's kinds.
|
|
120
|
+
* @returns The kind, or null.
|
|
121
|
+
*/
|
|
122
|
+
export function folderKind(folder, kinds) {
|
|
123
|
+
return kindForWord(folder, new Set(kinds.map((k) => k.kind)));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Classify one file by rules: front matter, folder, filename, then body shape.
|
|
127
|
+
*
|
|
128
|
+
* @param relPath - Path relative to the modernize root.
|
|
129
|
+
* @param content - File text.
|
|
130
|
+
* @param kinds - The registry's kinds.
|
|
131
|
+
* @returns The classification; `note` at low confidence when nothing fires.
|
|
132
|
+
*/
|
|
133
|
+
export function classifyDocByRules(relPath, content, kinds) {
|
|
134
|
+
const ids = new Set(kinds.map((k) => k.kind));
|
|
135
|
+
for (const key of ['kind', 'type']) {
|
|
136
|
+
const declared = readFrontMatterValue(content, key);
|
|
137
|
+
const kind = declared ? kindForWord(declared, ids) : null;
|
|
138
|
+
if (kind)
|
|
139
|
+
return { kind, confidence: 1, reason: `front matter declares ${key}: ${declared}` };
|
|
140
|
+
}
|
|
141
|
+
const segments = relPath.split('/');
|
|
142
|
+
const base = (segments.pop() ?? '').replace(/\.[^.]+$/, '').toLowerCase();
|
|
143
|
+
if (ids.has('adr') && /^adr-\d+/.test(base)) {
|
|
144
|
+
return { kind: 'adr', confidence: 0.95, reason: 'filename carries an ADR number' };
|
|
145
|
+
}
|
|
146
|
+
for (let i = segments.length - 1; i >= 0; i -= 1) {
|
|
147
|
+
const segment = segments[i] ?? '';
|
|
148
|
+
const kind = kindForWord(segment, ids);
|
|
149
|
+
if (kind)
|
|
150
|
+
return { kind, confidence: 0.9, reason: `sits in the ${segment}/ folder` };
|
|
151
|
+
}
|
|
152
|
+
for (const [pattern, kind] of NAME_HINTS) {
|
|
153
|
+
if (ids.has(kind) && pattern.test(base)) {
|
|
154
|
+
return { kind, confidence: 0.7, reason: `filename names a ${kind}` };
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
for (const [pattern, kind] of BODY_HINTS) {
|
|
158
|
+
if (ids.has(kind) && pattern.test(content)) {
|
|
159
|
+
return { kind, confidence: 0.6, reason: `headings read like a ${kind}` };
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const fallback = ids.has('note') ? 'note' : (kinds[0]?.kind ?? 'note');
|
|
163
|
+
return { kind: fallback, confidence: 0.3, reason: 'no folder, name or heading rule fired' };
|
|
164
|
+
}
|
|
165
|
+
/** Words a slug derived from a name or title has. */
|
|
166
|
+
function wordCount(slug) {
|
|
167
|
+
return slug === 'doc' ? 0 : slug.split('-').filter(Boolean).length;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* The stable slug for a file, under the T14107 naming rule:
|
|
171
|
+
*
|
|
172
|
+
* - a file name that already passes {@link docNameViolation} for its kind is
|
|
173
|
+
* kept unchanged (a release note's `v2026.10.28`, a clean `adr-001-store`);
|
|
174
|
+
* - otherwise the slug is {@link subjectSlug} of the name, or of the title
|
|
175
|
+
* when the name has too few words left (two; one after an ADR number);
|
|
176
|
+
* - an ADR keeps its number as an `adr-NNN-` prefix.
|
|
177
|
+
*
|
|
178
|
+
* @param relPath - Path relative to the modernize root.
|
|
179
|
+
* @param content - File text.
|
|
180
|
+
* @param kind - The file's kind.
|
|
181
|
+
* @returns A slug that passes the naming rule.
|
|
182
|
+
*/
|
|
183
|
+
export function stableSlugFor(relPath, content, kind) {
|
|
184
|
+
const base = (relPath.split('/').pop() ?? '').replace(/\.[^.]+$/, '');
|
|
185
|
+
if (base && docNameViolation(base, kind) === null)
|
|
186
|
+
return base;
|
|
187
|
+
const adr = kind === 'adr' ? /^adr-?(\d+)/i.exec(base) : null;
|
|
188
|
+
const prefix = adr ? `adr-${adr[1]?.padStart(3, '0')}-` : '';
|
|
189
|
+
const room = MODERNIZE_SLUG_MAX - prefix.length;
|
|
190
|
+
let words = subjectSlug(adr ? base.slice(adr[0].length) : base, room);
|
|
191
|
+
if (wordCount(words) < (adr ? 1 : 2)) {
|
|
192
|
+
const title = readTitle(content)?.replace(/^adr[\s-]?\d+[:\s.-]*/i, '');
|
|
193
|
+
const fromTitle = title ? subjectSlug(title, room) : 'doc';
|
|
194
|
+
if (wordCount(fromTitle) >= Math.max(2, wordCount(words) + 1))
|
|
195
|
+
words = fromTitle;
|
|
196
|
+
}
|
|
197
|
+
if (wordCount(words) === 0)
|
|
198
|
+
words = subjectSlug(kind, room);
|
|
199
|
+
return `${prefix}${words}`;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* The version a filename claims (`-v2` → 2), or 0.
|
|
203
|
+
*
|
|
204
|
+
* @param relPath - Path relative to the root.
|
|
205
|
+
* @returns The version number.
|
|
206
|
+
*/
|
|
207
|
+
export function versionOf(relPath) {
|
|
208
|
+
const match = /(?:^|[-_])v(\d+)(?=[-_.]|$)/i.exec(relPath.split('/').pop() ?? '');
|
|
209
|
+
return match?.[1] ? Number(match[1]) : 0;
|
|
210
|
+
}
|
|
211
|
+
/** Normalised non-empty lines of a doc, for similarity. */
|
|
212
|
+
function lineSet(content) {
|
|
213
|
+
const out = new Set();
|
|
214
|
+
for (const raw of content.split('\n')) {
|
|
215
|
+
const line = raw.trim().toLowerCase().replace(/\s+/g, ' ');
|
|
216
|
+
if (line.length > 2 && !/^[-=*_`#>|]+$/.test(line))
|
|
217
|
+
out.add(line);
|
|
218
|
+
}
|
|
219
|
+
return out;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Jaccard similarity of two docs' normalised lines (0..1).
|
|
223
|
+
*
|
|
224
|
+
* @param a - First doc text.
|
|
225
|
+
* @param b - Second doc text.
|
|
226
|
+
* @returns 1 for the same lines, 0 for none shared.
|
|
227
|
+
*/
|
|
228
|
+
export function docSimilarity(a, b) {
|
|
229
|
+
const left = lineSet(a);
|
|
230
|
+
const right = lineSet(b);
|
|
231
|
+
if (left.size === 0 && right.size === 0)
|
|
232
|
+
return 1;
|
|
233
|
+
let shared = 0;
|
|
234
|
+
for (const line of left)
|
|
235
|
+
if (right.has(line))
|
|
236
|
+
shared += 1;
|
|
237
|
+
return shared / (left.size + right.size - shared);
|
|
238
|
+
}
|
|
239
|
+
/** Collapse whitespace so formatting-only differences do not count as content. */
|
|
240
|
+
function normalizeBlock(text) {
|
|
241
|
+
return text.replace(/\s+/g, ' ').trim().toLowerCase();
|
|
242
|
+
}
|
|
243
|
+
/** Split a doc into its preamble (before the first `##`) and its `##` sections. */
|
|
244
|
+
function splitSections(text) {
|
|
245
|
+
const parts = text.split(/^(?=##\s)/m);
|
|
246
|
+
const first = parts[0] ?? '';
|
|
247
|
+
return first.startsWith('## ')
|
|
248
|
+
? { preamble: '', sections: parts }
|
|
249
|
+
: { preamble: first, sections: parts.slice(1) };
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Fold a duplicate into its survivor without losing any of its content.
|
|
253
|
+
*
|
|
254
|
+
* - A `##` section whose heading the survivor lacks is appended as is.
|
|
255
|
+
* - A section whose heading the survivor has, but whose body differs, is
|
|
256
|
+
* appended under `<heading> (from [[slug]])`.
|
|
257
|
+
* - The preamble (everything before the first `##`, which is the whole doc
|
|
258
|
+
* when it has no `##` headings) is appended under `## From [[slug]]` unless
|
|
259
|
+
* the survivor already contains it; a lone `# Title` line equal to the
|
|
260
|
+
* survivor's title is dropped as the same title.
|
|
261
|
+
*
|
|
262
|
+
* Every non-blank line of the duplicate is therefore in the result, either
|
|
263
|
+
* because the survivor already had the block or because it was appended.
|
|
264
|
+
*
|
|
265
|
+
* @param survivor - The kept doc's text.
|
|
266
|
+
* @param duplicate - The merged doc's text.
|
|
267
|
+
* @param duplicateRef - How the merged doc is cited on what was appended: a
|
|
268
|
+
* resolvable slug, already formatted (`` `slug` `` or `[[slug]]`).
|
|
269
|
+
* @returns The merged text (the survivor unchanged when nothing is new).
|
|
270
|
+
*/
|
|
271
|
+
export function mergeDocBodies(survivor, duplicate, duplicateRef) {
|
|
272
|
+
const own = splitSections(survivor);
|
|
273
|
+
const ownBlocks = new Set(own.sections.map(normalizeBlock));
|
|
274
|
+
const ownByHeading = new Map();
|
|
275
|
+
for (const section of own.sections) {
|
|
276
|
+
const heading = /^##\s+(.+)$/m.exec(section)?.[1]?.trim().toLowerCase() ?? '';
|
|
277
|
+
ownByHeading.set(heading, normalizeBlock(section));
|
|
278
|
+
}
|
|
279
|
+
const whole = normalizeBlock(survivor);
|
|
280
|
+
const appended = [];
|
|
281
|
+
const dup = splitSections(duplicate);
|
|
282
|
+
const ownTitle = /^#\s+(.+)$/m.exec(survivor)?.[1]?.trim().toLowerCase();
|
|
283
|
+
const preamble = dup.preamble
|
|
284
|
+
.split('\n')
|
|
285
|
+
.filter((line) => !(ownTitle && line.trim().toLowerCase() === `# ${ownTitle}`))
|
|
286
|
+
.join('\n')
|
|
287
|
+
.trim();
|
|
288
|
+
if (preamble && !whole.includes(normalizeBlock(preamble))) {
|
|
289
|
+
appended.push(`## From ${duplicateRef}\n\n${preamble}\n`);
|
|
290
|
+
}
|
|
291
|
+
for (const section of dup.sections) {
|
|
292
|
+
const headingLine = /^##\s+(.+)$/m.exec(section)?.[1]?.trim() ?? '';
|
|
293
|
+
const key = headingLine.toLowerCase();
|
|
294
|
+
if (ownBlocks.has(normalizeBlock(section)))
|
|
295
|
+
continue;
|
|
296
|
+
if (!ownByHeading.has(key)) {
|
|
297
|
+
appended.push(section.trimEnd());
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
appended.push(section.replace(/^##\s+.+$/m, `## ${headingLine} (from ${duplicateRef})`).trimEnd());
|
|
301
|
+
}
|
|
302
|
+
if (appended.length === 0)
|
|
303
|
+
return survivor;
|
|
304
|
+
return `${survivor.trimEnd()}\n\n<!-- merged from ${duplicateRef} by cleo docs modernize -->\n\n${appended.join('\n\n')}\n`;
|
|
305
|
+
}
|
|
306
|
+
/** Inline markdown links and images: `[label](href)` / ``; group 2 is the href. */
|
|
307
|
+
const MARKDOWN_LINK = /(!?\[[^\]\n]*\])\(([^)\s]+)\)/g;
|
|
308
|
+
/** Whether an href is a relative path (not a URL, an absolute path or a bare anchor). */
|
|
309
|
+
function isRelativeHref(href) {
|
|
310
|
+
return !/^[a-z][a-z0-9+.-]*:/i.test(href) && !href.startsWith('/') && !href.startsWith('#');
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Resolve a relative href against a root-relative file path.
|
|
314
|
+
*
|
|
315
|
+
* @param fromPath - The linking file's path relative to the root.
|
|
316
|
+
* @param href - The relative href (fragment allowed).
|
|
317
|
+
* @returns The target's root-relative path, or null when it leaves the root.
|
|
318
|
+
*/
|
|
319
|
+
function resolveRelative(fromPath, href) {
|
|
320
|
+
const parts = fromPath.split('/').slice(0, -1);
|
|
321
|
+
for (const part of href.split('#')[0]?.split('/') ?? []) {
|
|
322
|
+
if (part === '' || part === '.')
|
|
323
|
+
continue;
|
|
324
|
+
if (part === '..') {
|
|
325
|
+
if (parts.length === 0)
|
|
326
|
+
return null;
|
|
327
|
+
parts.pop();
|
|
328
|
+
}
|
|
329
|
+
else
|
|
330
|
+
parts.push(decodeURIComponent(part));
|
|
331
|
+
}
|
|
332
|
+
return parts.join('/');
|
|
333
|
+
}
|
|
334
|
+
/** A root-relative path expressed relative to a directory (POSIX). */
|
|
335
|
+
function relativeHref(fromDir, to) {
|
|
336
|
+
const target = to.split('/');
|
|
337
|
+
let common = 0;
|
|
338
|
+
while (common < fromDir.length && fromDir[common] === target[common])
|
|
339
|
+
common += 1;
|
|
340
|
+
const up = fromDir.slice(common).map(() => '..');
|
|
341
|
+
return [...up, ...target.slice(common)].join('/') || '.';
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Where one relative href points after a move, or null when it stays as is
|
|
345
|
+
* (a URL, an anchor, a link leaving the root, or nothing moved).
|
|
346
|
+
*/
|
|
347
|
+
function repointHref(href, fromOld, newDir, moved, finalPathOf) {
|
|
348
|
+
if (!isRelativeHref(href))
|
|
349
|
+
return null;
|
|
350
|
+
const target = resolveRelative(fromOld, href);
|
|
351
|
+
if (target === null)
|
|
352
|
+
return null;
|
|
353
|
+
const final = finalPathOf.get(target) ?? target;
|
|
354
|
+
if (!moved && final === target)
|
|
355
|
+
return null;
|
|
356
|
+
const fragment = href.includes('#') ? href.slice(href.indexOf('#')) : '';
|
|
357
|
+
let next = relativeHref(newDir, final);
|
|
358
|
+
if (href.startsWith('./') && !next.startsWith('.'))
|
|
359
|
+
next = `./${next}`;
|
|
360
|
+
next = `${next.split('/').map(encodeURIComponent).join('/')}${fragment}`;
|
|
361
|
+
return next === href ? null : next;
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Re-point relative markdown links (and images) after a move, keeping them
|
|
365
|
+
* plain markdown so they still render on GitHub (T14185).
|
|
366
|
+
*
|
|
367
|
+
* A link's target is resolved from the file's OLD path. A target in the plan
|
|
368
|
+
* maps to its final path (a merged or deleted file maps to its survivor's),
|
|
369
|
+
* and any other target keeps its location; the href is then rewritten
|
|
370
|
+
* relative to the file's NEW path. Links that leave the root, URLs and
|
|
371
|
+
* anchors are left alone, and so is a link whose href would not change.
|
|
372
|
+
*
|
|
373
|
+
* @param content - Doc text.
|
|
374
|
+
* @param fromOld - The file's path before the move, relative to the root.
|
|
375
|
+
* @param toNew - The file's path after the move.
|
|
376
|
+
* @param finalPathOf - Root-relative old path → final path, for every planned file.
|
|
377
|
+
* @returns The text with every relative link pointing at the right place.
|
|
378
|
+
*/
|
|
379
|
+
export function repointMarkdownLinks(content, fromOld, toNew, finalPathOf) {
|
|
380
|
+
const newDir = toNew.split('/').slice(0, -1);
|
|
381
|
+
return content.replace(MARKDOWN_LINK, (whole, label, href) => {
|
|
382
|
+
const next = repointHref(href, fromOld, newDir, fromOld !== toNew, finalPathOf);
|
|
383
|
+
return next === null ? whole : `${label}(${next})`;
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* The href edits a file that stays where it is needs because link targets
|
|
388
|
+
* move: the `link-fix` rows of a plan's kept files (T14185). Each distinct
|
|
389
|
+
* href is listed once.
|
|
390
|
+
*
|
|
391
|
+
* @param content - Doc text.
|
|
392
|
+
* @param path - The file's path, relative to the root (it does not move).
|
|
393
|
+
* @param finalPathOf - Root-relative old path → final path, for every planned file.
|
|
394
|
+
* @returns `{ href, newHref }` pairs, in order of first appearance.
|
|
395
|
+
*/
|
|
396
|
+
export function markdownLinkFixes(content, path, finalPathOf) {
|
|
397
|
+
const newDir = path.split('/').slice(0, -1);
|
|
398
|
+
const fixes = new Map();
|
|
399
|
+
for (const match of content.matchAll(MARKDOWN_LINK)) {
|
|
400
|
+
const href = match[2] ?? '';
|
|
401
|
+
if (fixes.has(href))
|
|
402
|
+
continue;
|
|
403
|
+
const next = repointHref(href, path, newDir, false, finalPathOf);
|
|
404
|
+
if (next !== null)
|
|
405
|
+
fixes.set(href, next);
|
|
406
|
+
}
|
|
407
|
+
return [...fixes].map(([href, newHref]) => ({ href, newHref }));
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* Apply `link-fix` rows to a kept file: only the listed hrefs of markdown
|
|
411
|
+
* links change, every other byte stays as it was (T14185).
|
|
412
|
+
*
|
|
413
|
+
* @param content - Doc text.
|
|
414
|
+
* @param fixes - The plan's fixes for this file.
|
|
415
|
+
* @returns The text with exactly those hrefs replaced.
|
|
416
|
+
*/
|
|
417
|
+
export function applyLinkFixes(content, fixes) {
|
|
418
|
+
if (fixes.length === 0)
|
|
419
|
+
return content;
|
|
420
|
+
const byHref = new Map(fixes.map((f) => [f.href, f.newHref]));
|
|
421
|
+
return content.replace(MARKDOWN_LINK, (whole, label, href) => {
|
|
422
|
+
const next = byHref.get(href);
|
|
423
|
+
return next === undefined ? whole : `${label}(${next})`;
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Where every planned file ends up: a survivor at its target, a merged or
|
|
428
|
+
* deleted file at its survivor's target (T14185).
|
|
429
|
+
*
|
|
430
|
+
* @param rows - The plan rows.
|
|
431
|
+
* @returns Root-relative old path → final path.
|
|
432
|
+
*/
|
|
433
|
+
export function finalPaths(rows) {
|
|
434
|
+
const survivorBySlug = new Map(rows
|
|
435
|
+
.filter((r) => r.disposition === 'keep' || r.disposition === 'rename')
|
|
436
|
+
.map((r) => [r.slug, r]));
|
|
437
|
+
const finalPathOf = new Map();
|
|
438
|
+
for (const row of rows) {
|
|
439
|
+
if (row.disposition === 'keep' || row.disposition === 'rename') {
|
|
440
|
+
finalPathOf.set(row.path, row.target ?? row.path);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
const survivor = row.target ? survivorBySlug.get(row.target) : undefined;
|
|
444
|
+
if (survivor)
|
|
445
|
+
finalPathOf.set(row.path, survivor.target ?? survivor.path);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return finalPathOf;
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Turn relative markdown links to planned files into `[[slug]]` /
|
|
452
|
+
* `[[slug|label]]` wikilinks: the opt-in `--wikilinks` mode (T14185). Only a
|
|
453
|
+
* planned file's final slug is ever written, so every wikilink resolves.
|
|
454
|
+
*
|
|
455
|
+
* @param content - Doc text.
|
|
456
|
+
* @param fromPath - The doc's own path relative to the root (resolves `../x.md`).
|
|
457
|
+
* @param slugByPath - Every scanned file's path → its final slug.
|
|
458
|
+
* @returns The rewritten text; links to files outside the plan are left as they are.
|
|
459
|
+
*/
|
|
460
|
+
export function rewriteDocLinks(content, fromPath, slugByPath) {
|
|
461
|
+
return content.replace(/\[([^\]\n]*)\]\(([^)\s]+\.(?:md|txt))(#[^)\s]*)?\)/gi, (whole, label, href) => {
|
|
462
|
+
if (!isRelativeHref(href))
|
|
463
|
+
return whole;
|
|
464
|
+
const target = resolveRelative(fromPath, href);
|
|
465
|
+
const slug = target ? slugByPath.get(target) : undefined;
|
|
466
|
+
if (!slug)
|
|
467
|
+
return whole;
|
|
468
|
+
return label && label !== slug ? `[[${slug}|${label}]]` : `[[${slug}]]`;
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Re-point existing `[[old-name]]` wikilinks to the final slug of the file
|
|
473
|
+
* they named. Only names in `slugRename` change, and its values are planned
|
|
474
|
+
* slugs, so a rewritten wikilink always resolves (T14185).
|
|
475
|
+
*
|
|
476
|
+
* @param content - Doc text.
|
|
477
|
+
* @param slugRename - Old name → final slug.
|
|
478
|
+
* @returns The text with renamed wikilinks.
|
|
479
|
+
*/
|
|
480
|
+
export function renameWikilinks(content, slugRename) {
|
|
481
|
+
return content.replace(WIKILINK_PATTERN, (whole, target) => {
|
|
482
|
+
const renamed = slugRename.get(target.trim());
|
|
483
|
+
return renamed ? whole.replace(target, renamed) : whole;
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* The planned slugs a body links to: its `[[wikilinks]]` plus the final slug
|
|
488
|
+
* of every planned file its relative markdown links point at (resolved from
|
|
489
|
+
* the file's final path). Feeds the `links-to` graph edges in both link modes.
|
|
490
|
+
*
|
|
491
|
+
* @param content - The body as written.
|
|
492
|
+
* @param atPath - The file's final path, relative to the root.
|
|
493
|
+
* @param slugByFinalPath - Final path → slug, for every planned survivor.
|
|
494
|
+
* @param wikilinkTargets - The body's `[[wikilink]]` targets.
|
|
495
|
+
* @returns Linked slugs, unique, sorted.
|
|
496
|
+
*/
|
|
497
|
+
export function linkedSlugs(content, atPath, slugByFinalPath, wikilinkTargets) {
|
|
498
|
+
const out = new Set(wikilinkTargets);
|
|
499
|
+
for (const m of content.matchAll(MARKDOWN_LINK)) {
|
|
500
|
+
const href = m[2] ?? '';
|
|
501
|
+
if (!isRelativeHref(href))
|
|
502
|
+
continue;
|
|
503
|
+
const target = resolveRelative(atPath, href);
|
|
504
|
+
const slug = target ? slugByFinalPath.get(target) : undefined;
|
|
505
|
+
if (slug)
|
|
506
|
+
out.add(slug);
|
|
507
|
+
}
|
|
508
|
+
return [...out].sort();
|
|
509
|
+
}
|
|
510
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../src/docs/modernize/rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEzF,mFAAmF;AACnF,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAAC;AAE7C,6EAA6E;AAC7E,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAC;AAExC,gFAAgF;AAChF,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAEzC,sDAAsD;AACtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;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AAU,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9C,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1D,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACzB,OAAe,EACf,MAAc,EACd,eAA4C,EAC5C,eAAkC;IAElC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,CAAC;IACrC,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YAAE,SAAS;QACpC,MAAM,MAAM,GAAG,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC9D,IAAI,IAAI;YAAE,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cleo docs modernize --store` (T14118): modernize the docs already in the
|
|
3
|
+
* store, not a folder.
|
|
4
|
+
*
|
|
5
|
+
* Plan, per stored doc:
|
|
6
|
+
*
|
|
7
|
+
* - **Kind.** Untyped rows, and rows the legacy `docs import` typed `spec`
|
|
8
|
+
* wholesale (owned by the `__project__` sentinel), are re-classified with
|
|
9
|
+
* the tree-mode rules over the slug and body; a rule below the floor is
|
|
10
|
+
* judged by System One (`docs.modernize.classify`), up to
|
|
11
|
+
* {@link MODERNIZE_STORE_JUDGE_LIMIT} asks per run.
|
|
12
|
+
* - **Slug.** A slug that breaks the T14107 naming rule gets the stable
|
|
13
|
+
* slug; the old slug stays resolvable as an alias (`renameDocSlug`). Task
|
|
14
|
+
* ids it named become task refs on the doc.
|
|
15
|
+
* - **ADR numbers.** When several ADRs share a number, the earliest keeps it
|
|
16
|
+
* and each later one is renumbered past the highest number in use.
|
|
17
|
+
*
|
|
18
|
+
* Apply runs the plan with a receipt (`rekind`, `reslug`, `link-task` ops)
|
|
19
|
+
* and one graph rebuild; rollback walks the receipt backwards.
|
|
20
|
+
*
|
|
21
|
+
* @task T14118
|
|
22
|
+
* @epic T14106
|
|
23
|
+
*/
|
|
24
|
+
import type { DocsModernizePlan, DocsModernizeReceipt, DocsModernizeReceiptOp } from '@cleocode/contracts';
|
|
25
|
+
import type { DecideOptions } from '../../decide/client.js';
|
|
26
|
+
import type { DecisionSiteMode } from '../../decide/site.js';
|
|
27
|
+
/** System One asks per store run; past it the rule acts and the row says so. */
|
|
28
|
+
export declare const MODERNIZE_STORE_JUDGE_LIMIT = 200;
|
|
29
|
+
/** Options for {@link planDocsStoreModernize}. */
|
|
30
|
+
export interface PlanDocsStoreModernizeOptions {
|
|
31
|
+
/** Project root. */
|
|
32
|
+
readonly projectRoot: string;
|
|
33
|
+
/** Explicit System One mode (tests). */
|
|
34
|
+
readonly mode?: DecisionSiteMode;
|
|
35
|
+
/** Provider wiring (tests). */
|
|
36
|
+
readonly decide?: DecideOptions;
|
|
37
|
+
/** Clock (tests). */
|
|
38
|
+
readonly now?: () => Date;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Plan a store-mode modernize run.
|
|
42
|
+
*
|
|
43
|
+
* @param options - Project root and System One overrides.
|
|
44
|
+
* @returns A plan with `mode: 'store'` and one `storeRows` entry per doc that changes.
|
|
45
|
+
*/
|
|
46
|
+
export declare function planDocsStoreModernize(options: PlanDocsStoreModernizeOptions): Promise<DocsModernizePlan>;
|
|
47
|
+
/**
|
|
48
|
+
* Apply a store-mode plan with a receipt.
|
|
49
|
+
*
|
|
50
|
+
* @param plan - A `mode: 'store'` plan.
|
|
51
|
+
* @param projectRoot - Project root.
|
|
52
|
+
* @param now - Clock (tests).
|
|
53
|
+
* @returns The receipt.
|
|
54
|
+
*/
|
|
55
|
+
export declare function applyDocsStoreModernize(plan: DocsModernizePlan, projectRoot: string, now?: () => Date): Promise<DocsModernizeReceipt>;
|
|
56
|
+
/**
|
|
57
|
+
* Reverse one store-mode op (called by the shared rollback walk).
|
|
58
|
+
*
|
|
59
|
+
* @param projectRoot - Project root.
|
|
60
|
+
* @param op - A `rekind`, `reslug` or `link-task` op.
|
|
61
|
+
* @returns Whether the op was a store-mode op.
|
|
62
|
+
*/
|
|
63
|
+
export declare function reverseStoreOp(projectRoot: string, op: DocsModernizeReceiptOp): Promise<boolean>;
|
|
64
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/docs/modernize/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAKH,OAAO,KAAK,EAGV,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EAEvB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAW7D,gFAAgF;AAChF,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAK/C,kDAAkD;AAClD,MAAM,WAAW,6BAA6B;IAC5C,oBAAoB;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,qBAAqB;IACrB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAyGD;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,6BAA6B,GACrC,OAAO,CAAC,iBAAiB,CAAC,CA0I5B;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,iBAAiB,EACvB,WAAW,EAAE,MAAM,EACnB,GAAG,GAAE,MAAM,IAAuB,GACjC,OAAO,CAAC,oBAAoB,CAAC,CAsE/B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,sBAAsB,GACzB,OAAO,CAAC,OAAO,CAAC,CA+BlB"}
|