open-wiki-spec 0.1.0
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 +294 -0
- package/bin/open-wiki-spec.js +2 -0
- package/dist/cli/commands/apply.d.ts +3 -0
- package/dist/cli/commands/apply.d.ts.map +1 -0
- package/dist/cli/commands/apply.js +60 -0
- package/dist/cli/commands/apply.js.map +1 -0
- package/dist/cli/commands/archive.d.ts +20 -0
- package/dist/cli/commands/archive.d.ts.map +1 -0
- package/dist/cli/commands/archive.js +87 -0
- package/dist/cli/commands/archive.js.map +1 -0
- package/dist/cli/commands/continue.d.ts +6 -0
- package/dist/cli/commands/continue.d.ts.map +1 -0
- package/dist/cli/commands/continue.js +35 -0
- package/dist/cli/commands/continue.js.map +1 -0
- package/dist/cli/commands/formatters.d.ts +9 -0
- package/dist/cli/commands/formatters.d.ts.map +1 -0
- package/dist/cli/commands/formatters.js +55 -0
- package/dist/cli/commands/formatters.js.map +1 -0
- package/dist/cli/commands/init.d.ts +6 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +36 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/list.d.ts +28 -0
- package/dist/cli/commands/list.d.ts.map +1 -0
- package/dist/cli/commands/list.js +85 -0
- package/dist/cli/commands/list.js.map +1 -0
- package/dist/cli/commands/migrate.d.ts +6 -0
- package/dist/cli/commands/migrate.d.ts.map +1 -0
- package/dist/cli/commands/migrate.js +103 -0
- package/dist/cli/commands/migrate.js.map +1 -0
- package/dist/cli/commands/propose.d.ts +3 -0
- package/dist/cli/commands/propose.d.ts.map +1 -0
- package/dist/cli/commands/propose.js +64 -0
- package/dist/cli/commands/propose.js.map +1 -0
- package/dist/cli/commands/query.d.ts +3 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +62 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/status.d.ts +30 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +144 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/verify.d.ts +3 -0
- package/dist/cli/commands/verify.d.ts.map +1 -0
- package/dist/cli/commands/verify.js +38 -0
- package/dist/cli/commands/verify.js.map +1 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +40 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init/init-engine.d.ts +6 -0
- package/dist/cli/init/init-engine.d.ts.map +1 -0
- package/dist/cli/init/init-engine.js +107 -0
- package/dist/cli/init/init-engine.js.map +1 -0
- package/dist/cli/init/meta-files.d.ts +9 -0
- package/dist/cli/init/meta-files.d.ts.map +1 -0
- package/dist/cli/init/meta-files.js +156 -0
- package/dist/cli/init/meta-files.js.map +1 -0
- package/dist/cli/init/skill-generator.d.ts +11 -0
- package/dist/cli/init/skill-generator.d.ts.map +1 -0
- package/dist/cli/init/skill-generator.js +753 -0
- package/dist/cli/init/skill-generator.js.map +1 -0
- package/dist/cli/init/types.d.ts +27 -0
- package/dist/cli/init/types.d.ts.map +1 -0
- package/dist/cli/init/types.js +5 -0
- package/dist/cli/init/types.js.map +1 -0
- package/dist/cli/vault-discovery.d.ts +9 -0
- package/dist/cli/vault-discovery.d.ts.map +1 -0
- package/dist/cli/vault-discovery.js +31 -0
- package/dist/cli/vault-discovery.js.map +1 -0
- package/dist/core/config/index.d.ts +2 -0
- package/dist/core/config/index.d.ts.map +1 -0
- package/dist/core/config/index.js +3 -0
- package/dist/core/config/index.js.map +1 -0
- package/dist/core/index/build.d.ts +10 -0
- package/dist/core/index/build.d.ts.map +1 -0
- package/dist/core/index/build.js +190 -0
- package/dist/core/index/build.js.map +1 -0
- package/dist/core/index/index.d.ts +7 -0
- package/dist/core/index/index.d.ts.map +1 -0
- package/dist/core/index/index.js +7 -0
- package/dist/core/index/index.js.map +1 -0
- package/dist/core/index/resolve.d.ts +41 -0
- package/dist/core/index/resolve.d.ts.map +1 -0
- package/dist/core/index/resolve.js +63 -0
- package/dist/core/index/resolve.js.map +1 -0
- package/dist/core/index/reverse.d.ts +7 -0
- package/dist/core/index/reverse.d.ts.map +1 -0
- package/dist/core/index/reverse.js +24 -0
- package/dist/core/index/reverse.js.map +1 -0
- package/dist/core/index/scan.d.ts +16 -0
- package/dist/core/index/scan.d.ts.map +1 -0
- package/dist/core/index/scan.js +19 -0
- package/dist/core/index/scan.js.map +1 -0
- package/dist/core/index/schema-version.d.ts +5 -0
- package/dist/core/index/schema-version.d.ts.map +1 -0
- package/dist/core/index/schema-version.js +19 -0
- package/dist/core/index/schema-version.js.map +1 -0
- package/dist/core/index/validate.d.ts +14 -0
- package/dist/core/index/validate.d.ts.map +1 -0
- package/dist/core/index/validate.js +77 -0
- package/dist/core/index/validate.js.map +1 -0
- package/dist/core/migrate/change-converter.d.ts +18 -0
- package/dist/core/migrate/change-converter.d.ts.map +1 -0
- package/dist/core/migrate/change-converter.js +475 -0
- package/dist/core/migrate/change-converter.js.map +1 -0
- package/dist/core/migrate/index.d.ts +8 -0
- package/dist/core/migrate/index.d.ts.map +1 -0
- package/dist/core/migrate/index.js +7 -0
- package/dist/core/migrate/index.js.map +1 -0
- package/dist/core/migrate/migrate.d.ts +15 -0
- package/dist/core/migrate/migrate.d.ts.map +1 -0
- package/dist/core/migrate/migrate.js +149 -0
- package/dist/core/migrate/migrate.js.map +1 -0
- package/dist/core/migrate/scanner.d.ts +10 -0
- package/dist/core/migrate/scanner.d.ts.map +1 -0
- package/dist/core/migrate/scanner.js +188 -0
- package/dist/core/migrate/scanner.js.map +1 -0
- package/dist/core/migrate/source-converter.d.ts +6 -0
- package/dist/core/migrate/source-converter.d.ts.map +1 -0
- package/dist/core/migrate/source-converter.js +63 -0
- package/dist/core/migrate/source-converter.js.map +1 -0
- package/dist/core/migrate/spec-converter.d.ts +16 -0
- package/dist/core/migrate/spec-converter.d.ts.map +1 -0
- package/dist/core/migrate/spec-converter.js +157 -0
- package/dist/core/migrate/spec-converter.js.map +1 -0
- package/dist/core/migrate/system-inferrer.d.ts +23 -0
- package/dist/core/migrate/system-inferrer.d.ts.map +1 -0
- package/dist/core/migrate/system-inferrer.js +118 -0
- package/dist/core/migrate/system-inferrer.js.map +1 -0
- package/dist/core/migrate/types.d.ts +125 -0
- package/dist/core/migrate/types.d.ts.map +1 -0
- package/dist/core/migrate/types.js +5 -0
- package/dist/core/migrate/types.js.map +1 -0
- package/dist/core/parser/delta-summary-parser.d.ts +10 -0
- package/dist/core/parser/delta-summary-parser.d.ts.map +1 -0
- package/dist/core/parser/delta-summary-parser.js +101 -0
- package/dist/core/parser/delta-summary-parser.js.map +1 -0
- package/dist/core/parser/frontmatter-parser.d.ts +21 -0
- package/dist/core/parser/frontmatter-parser.d.ts.map +1 -0
- package/dist/core/parser/frontmatter-parser.js +87 -0
- package/dist/core/parser/frontmatter-parser.js.map +1 -0
- package/dist/core/parser/index.d.ts +9 -0
- package/dist/core/parser/index.d.ts.map +1 -0
- package/dist/core/parser/index.js +8 -0
- package/dist/core/parser/index.js.map +1 -0
- package/dist/core/parser/note-parser.d.ts +9 -0
- package/dist/core/parser/note-parser.d.ts.map +1 -0
- package/dist/core/parser/note-parser.js +106 -0
- package/dist/core/parser/note-parser.js.map +1 -0
- package/dist/core/parser/requirement-parser.d.ts +13 -0
- package/dist/core/parser/requirement-parser.d.ts.map +1 -0
- package/dist/core/parser/requirement-parser.js +127 -0
- package/dist/core/parser/requirement-parser.js.map +1 -0
- package/dist/core/parser/section-parser.d.ts +15 -0
- package/dist/core/parser/section-parser.d.ts.map +1 -0
- package/dist/core/parser/section-parser.js +90 -0
- package/dist/core/parser/section-parser.js.map +1 -0
- package/dist/core/parser/task-parser.d.ts +9 -0
- package/dist/core/parser/task-parser.d.ts.map +1 -0
- package/dist/core/parser/task-parser.js +35 -0
- package/dist/core/parser/task-parser.js.map +1 -0
- package/dist/core/parser/types.d.ts +94 -0
- package/dist/core/parser/types.d.ts.map +1 -0
- package/dist/core/parser/types.js +2 -0
- package/dist/core/parser/types.js.map +1 -0
- package/dist/core/parser/wikilink-parser.d.ts +19 -0
- package/dist/core/parser/wikilink-parser.d.ts.map +1 -0
- package/dist/core/parser/wikilink-parser.js +74 -0
- package/dist/core/parser/wikilink-parser.js.map +1 -0
- package/dist/core/retrieval/classify.d.ts +11 -0
- package/dist/core/retrieval/classify.d.ts.map +1 -0
- package/dist/core/retrieval/classify.js +92 -0
- package/dist/core/retrieval/classify.js.map +1 -0
- package/dist/core/retrieval/constants.d.ts +49 -0
- package/dist/core/retrieval/constants.d.ts.map +1 -0
- package/dist/core/retrieval/constants.js +29 -0
- package/dist/core/retrieval/constants.js.map +1 -0
- package/dist/core/retrieval/graph-expand.d.ts +7 -0
- package/dist/core/retrieval/graph-expand.d.ts.map +1 -0
- package/dist/core/retrieval/graph-expand.js +20 -0
- package/dist/core/retrieval/graph-expand.js.map +1 -0
- package/dist/core/retrieval/helpers.d.ts +15 -0
- package/dist/core/retrieval/helpers.d.ts.map +1 -0
- package/dist/core/retrieval/helpers.js +36 -0
- package/dist/core/retrieval/helpers.js.map +1 -0
- package/dist/core/retrieval/index.d.ts +11 -0
- package/dist/core/retrieval/index.d.ts.map +1 -0
- package/dist/core/retrieval/index.js +9 -0
- package/dist/core/retrieval/index.js.map +1 -0
- package/dist/core/retrieval/lexical.d.ts +8 -0
- package/dist/core/retrieval/lexical.d.ts.map +1 -0
- package/dist/core/retrieval/lexical.js +107 -0
- package/dist/core/retrieval/lexical.js.map +1 -0
- package/dist/core/retrieval/retrieve.d.ts +16 -0
- package/dist/core/retrieval/retrieve.d.ts.map +1 -0
- package/dist/core/retrieval/retrieve.js +58 -0
- package/dist/core/retrieval/retrieve.js.map +1 -0
- package/dist/core/retrieval/scoring.d.ts +14 -0
- package/dist/core/retrieval/scoring.d.ts.map +1 -0
- package/dist/core/retrieval/scoring.js +169 -0
- package/dist/core/retrieval/scoring.js.map +1 -0
- package/dist/core/retrieval/warnings.d.ts +16 -0
- package/dist/core/retrieval/warnings.d.ts.map +1 -0
- package/dist/core/retrieval/warnings.js +73 -0
- package/dist/core/retrieval/warnings.js.map +1 -0
- package/dist/core/schema/base.schema.d.ts +31 -0
- package/dist/core/schema/base.schema.d.ts.map +1 -0
- package/dist/core/schema/base.schema.js +32 -0
- package/dist/core/schema/base.schema.js.map +1 -0
- package/dist/core/schema/change.schema.d.ts +96 -0
- package/dist/core/schema/change.schema.d.ts.map +1 -0
- package/dist/core/schema/change.schema.js +64 -0
- package/dist/core/schema/change.schema.js.map +1 -0
- package/dist/core/schema/decision.schema.d.ts +33 -0
- package/dist/core/schema/decision.schema.d.ts.map +1 -0
- package/dist/core/schema/decision.schema.js +19 -0
- package/dist/core/schema/decision.schema.js.map +1 -0
- package/dist/core/schema/delta-summary.d.ts +57 -0
- package/dist/core/schema/delta-summary.d.ts.map +1 -0
- package/dist/core/schema/delta-summary.js +38 -0
- package/dist/core/schema/delta-summary.js.map +1 -0
- package/dist/core/schema/feature.schema.d.ts +40 -0
- package/dist/core/schema/feature.schema.d.ts.map +1 -0
- package/dist/core/schema/feature.schema.js +25 -0
- package/dist/core/schema/feature.schema.js.map +1 -0
- package/dist/core/schema/frontmatter.d.ts +207 -0
- package/dist/core/schema/frontmatter.d.ts.map +1 -0
- package/dist/core/schema/frontmatter.js +23 -0
- package/dist/core/schema/frontmatter.js.map +1 -0
- package/dist/core/schema/index.d.ts +235 -0
- package/dist/core/schema/index.d.ts.map +1 -0
- package/dist/core/schema/index.js +52 -0
- package/dist/core/schema/index.js.map +1 -0
- package/dist/core/schema/query.schema.d.ts +39 -0
- package/dist/core/schema/query.schema.d.ts.map +1 -0
- package/dist/core/schema/query.schema.js +20 -0
- package/dist/core/schema/query.schema.js.map +1 -0
- package/dist/core/schema/requirement.d.ts +69 -0
- package/dist/core/schema/requirement.d.ts.map +1 -0
- package/dist/core/schema/requirement.js +35 -0
- package/dist/core/schema/requirement.js.map +1 -0
- package/dist/core/schema/source.schema.d.ts +33 -0
- package/dist/core/schema/source.schema.d.ts.map +1 -0
- package/dist/core/schema/source.schema.js +24 -0
- package/dist/core/schema/source.schema.js.map +1 -0
- package/dist/core/schema/system.schema.d.ts +27 -0
- package/dist/core/schema/system.schema.d.ts.map +1 -0
- package/dist/core/schema/system.schema.js +17 -0
- package/dist/core/schema/system.schema.js.map +1 -0
- package/dist/core/schema/templates.d.ts +14 -0
- package/dist/core/schema/templates.d.ts.map +1 -0
- package/dist/core/schema/templates.js +220 -0
- package/dist/core/schema/templates.js.map +1 -0
- package/dist/core/schema/validation-constants.d.ts +5 -0
- package/dist/core/schema/validation-constants.d.ts.map +1 -0
- package/dist/core/schema/validation-constants.js +5 -0
- package/dist/core/schema/validation-constants.js.map +1 -0
- package/dist/core/sequencing/analyze.d.ts +13 -0
- package/dist/core/sequencing/analyze.d.ts.map +1 -0
- package/dist/core/sequencing/analyze.js +107 -0
- package/dist/core/sequencing/analyze.js.map +1 -0
- package/dist/core/sequencing/index.d.ts +8 -0
- package/dist/core/sequencing/index.d.ts.map +1 -0
- package/dist/core/sequencing/index.js +8 -0
- package/dist/core/sequencing/index.js.map +1 -0
- package/dist/core/sequencing/ordering.d.ts +11 -0
- package/dist/core/sequencing/ordering.d.ts.map +1 -0
- package/dist/core/sequencing/ordering.js +148 -0
- package/dist/core/sequencing/ordering.js.map +1 -0
- package/dist/core/sequencing/out-of-order-detector.d.ts +9 -0
- package/dist/core/sequencing/out-of-order-detector.d.ts.map +1 -0
- package/dist/core/sequencing/out-of-order-detector.js +42 -0
- package/dist/core/sequencing/out-of-order-detector.js.map +1 -0
- package/dist/core/sequencing/priority-queue.d.ts +18 -0
- package/dist/core/sequencing/priority-queue.d.ts.map +1 -0
- package/dist/core/sequencing/priority-queue.js +31 -0
- package/dist/core/sequencing/priority-queue.js.map +1 -0
- package/dist/core/sequencing/requirement-conflict-detector.d.ts +9 -0
- package/dist/core/sequencing/requirement-conflict-detector.d.ts.map +1 -0
- package/dist/core/sequencing/requirement-conflict-detector.js +90 -0
- package/dist/core/sequencing/requirement-conflict-detector.js.map +1 -0
- package/dist/core/sequencing/stale-detector.d.ts +9 -0
- package/dist/core/sequencing/stale-detector.d.ts.map +1 -0
- package/dist/core/sequencing/stale-detector.js +49 -0
- package/dist/core/sequencing/stale-detector.js.map +1 -0
- package/dist/core/sequencing/touches-analyzer.d.ts +8 -0
- package/dist/core/sequencing/touches-analyzer.d.ts.map +1 -0
- package/dist/core/sequencing/touches-analyzer.js +91 -0
- package/dist/core/sequencing/touches-analyzer.js.map +1 -0
- package/dist/core/vault/index.d.ts +2 -0
- package/dist/core/vault/index.d.ts.map +1 -0
- package/dist/core/vault/index.js +3 -0
- package/dist/core/vault/index.js.map +1 -0
- package/dist/core/workflow/apply/apply.d.ts +17 -0
- package/dist/core/workflow/apply/apply.d.ts.map +1 -0
- package/dist/core/workflow/apply/apply.js +302 -0
- package/dist/core/workflow/apply/apply.js.map +1 -0
- package/dist/core/workflow/apply/delta-parser.d.ts +11 -0
- package/dist/core/workflow/apply/delta-parser.d.ts.map +1 -0
- package/dist/core/workflow/apply/delta-parser.js +164 -0
- package/dist/core/workflow/apply/delta-parser.js.map +1 -0
- package/dist/core/workflow/apply/feature-updater.d.ts +12 -0
- package/dist/core/workflow/apply/feature-updater.d.ts.map +1 -0
- package/dist/core/workflow/apply/feature-updater.js +75 -0
- package/dist/core/workflow/apply/feature-updater.js.map +1 -0
- package/dist/core/workflow/apply/index.d.ts +7 -0
- package/dist/core/workflow/apply/index.d.ts.map +1 -0
- package/dist/core/workflow/apply/index.js +6 -0
- package/dist/core/workflow/apply/index.js.map +1 -0
- package/dist/core/workflow/apply/stale-checker.d.ts +17 -0
- package/dist/core/workflow/apply/stale-checker.d.ts.map +1 -0
- package/dist/core/workflow/apply/stale-checker.js +99 -0
- package/dist/core/workflow/apply/stale-checker.js.map +1 -0
- package/dist/core/workflow/apply/types.d.ts +112 -0
- package/dist/core/workflow/apply/types.d.ts.map +1 -0
- package/dist/core/workflow/apply/types.js +2 -0
- package/dist/core/workflow/apply/types.js.map +1 -0
- package/dist/core/workflow/apply/verify-apply.d.ts +16 -0
- package/dist/core/workflow/apply/verify-apply.d.ts.map +1 -0
- package/dist/core/workflow/apply/verify-apply.js +81 -0
- package/dist/core/workflow/apply/verify-apply.js.map +1 -0
- package/dist/core/workflow/continue/continue.d.ts +17 -0
- package/dist/core/workflow/continue/continue.d.ts.map +1 -0
- package/dist/core/workflow/continue/continue.js +213 -0
- package/dist/core/workflow/continue/continue.js.map +1 -0
- package/dist/core/workflow/continue/decision-promoter.d.ts +20 -0
- package/dist/core/workflow/continue/decision-promoter.d.ts.map +1 -0
- package/dist/core/workflow/continue/decision-promoter.js +36 -0
- package/dist/core/workflow/continue/decision-promoter.js.map +1 -0
- package/dist/core/workflow/continue/index.d.ts +6 -0
- package/dist/core/workflow/continue/index.d.ts.map +1 -0
- package/dist/core/workflow/continue/index.js +5 -0
- package/dist/core/workflow/continue/index.js.map +1 -0
- package/dist/core/workflow/continue/next-action.d.ts +13 -0
- package/dist/core/workflow/continue/next-action.d.ts.map +1 -0
- package/dist/core/workflow/continue/next-action.js +129 -0
- package/dist/core/workflow/continue/next-action.js.map +1 -0
- package/dist/core/workflow/continue/section-checker.d.ts +18 -0
- package/dist/core/workflow/continue/section-checker.d.ts.map +1 -0
- package/dist/core/workflow/continue/section-checker.js +114 -0
- package/dist/core/workflow/continue/section-checker.js.map +1 -0
- package/dist/core/workflow/continue/types.d.ts +113 -0
- package/dist/core/workflow/continue/types.d.ts.map +1 -0
- package/dist/core/workflow/continue/types.js +2 -0
- package/dist/core/workflow/continue/types.js.map +1 -0
- package/dist/core/workflow/index.d.ts +11 -0
- package/dist/core/workflow/index.d.ts.map +1 -0
- package/dist/core/workflow/index.js +12 -0
- package/dist/core/workflow/index.js.map +1 -0
- package/dist/core/workflow/propose/index.d.ts +6 -0
- package/dist/core/workflow/propose/index.d.ts.map +1 -0
- package/dist/core/workflow/propose/index.js +5 -0
- package/dist/core/workflow/propose/index.js.map +1 -0
- package/dist/core/workflow/propose/note-creator.d.ts +35 -0
- package/dist/core/workflow/propose/note-creator.d.ts.map +1 -0
- package/dist/core/workflow/propose/note-creator.js +178 -0
- package/dist/core/workflow/propose/note-creator.js.map +1 -0
- package/dist/core/workflow/propose/prerequisites.d.ts +17 -0
- package/dist/core/workflow/propose/prerequisites.d.ts.map +1 -0
- package/dist/core/workflow/propose/prerequisites.js +78 -0
- package/dist/core/workflow/propose/prerequisites.js.map +1 -0
- package/dist/core/workflow/propose/propose.d.ts +13 -0
- package/dist/core/workflow/propose/propose.d.ts.map +1 -0
- package/dist/core/workflow/propose/propose.js +204 -0
- package/dist/core/workflow/propose/propose.js.map +1 -0
- package/dist/core/workflow/propose/query-normalizer.d.ts +7 -0
- package/dist/core/workflow/propose/query-normalizer.d.ts.map +1 -0
- package/dist/core/workflow/propose/query-normalizer.js +77 -0
- package/dist/core/workflow/propose/query-normalizer.js.map +1 -0
- package/dist/core/workflow/propose/types.d.ts +71 -0
- package/dist/core/workflow/propose/types.d.ts.map +1 -0
- package/dist/core/workflow/propose/types.js +2 -0
- package/dist/core/workflow/propose/types.js.map +1 -0
- package/dist/core/workflow/query/index.d.ts +6 -0
- package/dist/core/workflow/query/index.d.ts.map +1 -0
- package/dist/core/workflow/query/index.js +5 -0
- package/dist/core/workflow/query/index.js.map +1 -0
- package/dist/core/workflow/query/noteworthiness.d.ts +14 -0
- package/dist/core/workflow/query/noteworthiness.d.ts.map +1 -0
- package/dist/core/workflow/query/noteworthiness.js +48 -0
- package/dist/core/workflow/query/noteworthiness.js.map +1 -0
- package/dist/core/workflow/query/query-note-creator.d.ts +13 -0
- package/dist/core/workflow/query/query-note-creator.d.ts.map +1 -0
- package/dist/core/workflow/query/query-note-creator.js +168 -0
- package/dist/core/workflow/query/query-note-creator.js.map +1 -0
- package/dist/core/workflow/query/query-search.d.ts +19 -0
- package/dist/core/workflow/query/query-search.d.ts.map +1 -0
- package/dist/core/workflow/query/query-search.js +252 -0
- package/dist/core/workflow/query/query-search.js.map +1 -0
- package/dist/core/workflow/query/query.d.ts +18 -0
- package/dist/core/workflow/query/query.d.ts.map +1 -0
- package/dist/core/workflow/query/query.js +29 -0
- package/dist/core/workflow/query/query.js.map +1 -0
- package/dist/core/workflow/query/types.d.ts +67 -0
- package/dist/core/workflow/query/types.d.ts.map +1 -0
- package/dist/core/workflow/query/types.js +2 -0
- package/dist/core/workflow/query/types.js.map +1 -0
- package/dist/core/workflow/verify/coherence.d.ts +30 -0
- package/dist/core/workflow/verify/coherence.d.ts.map +1 -0
- package/dist/core/workflow/verify/coherence.js +206 -0
- package/dist/core/workflow/verify/coherence.js.map +1 -0
- package/dist/core/workflow/verify/completeness.d.ts +24 -0
- package/dist/core/workflow/verify/completeness.d.ts.map +1 -0
- package/dist/core/workflow/verify/completeness.js +172 -0
- package/dist/core/workflow/verify/completeness.js.map +1 -0
- package/dist/core/workflow/verify/correctness.d.ts +38 -0
- package/dist/core/workflow/verify/correctness.d.ts.map +1 -0
- package/dist/core/workflow/verify/correctness.js +352 -0
- package/dist/core/workflow/verify/correctness.js.map +1 -0
- package/dist/core/workflow/verify/index.d.ts +7 -0
- package/dist/core/workflow/verify/index.d.ts.map +1 -0
- package/dist/core/workflow/verify/index.js +6 -0
- package/dist/core/workflow/verify/index.js.map +1 -0
- package/dist/core/workflow/verify/vault-integrity.d.ts +45 -0
- package/dist/core/workflow/verify/vault-integrity.d.ts.map +1 -0
- package/dist/core/workflow/verify/vault-integrity.js +141 -0
- package/dist/core/workflow/verify/vault-integrity.js.map +1 -0
- package/dist/core/workflow/verify/verify.d.ts +23 -0
- package/dist/core/workflow/verify/verify.d.ts.map +1 -0
- package/dist/core/workflow/verify/verify.js +122 -0
- package/dist/core/workflow/verify/verify.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/types/delta.d.ts +17 -0
- package/dist/types/delta.d.ts.map +1 -0
- package/dist/types/delta.js +2 -0
- package/dist/types/delta.js.map +1 -0
- package/dist/types/frontmatter.d.ts +51 -0
- package/dist/types/frontmatter.d.ts.map +1 -0
- package/dist/types/frontmatter.js +2 -0
- package/dist/types/frontmatter.js.map +1 -0
- package/dist/types/index-record.d.ts +46 -0
- package/dist/types/index-record.d.ts.map +1 -0
- package/dist/types/index-record.js +2 -0
- package/dist/types/index-record.js.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/next-action.d.ts +10 -0
- package/dist/types/next-action.d.ts.map +1 -0
- package/dist/types/next-action.js +2 -0
- package/dist/types/next-action.js.map +1 -0
- package/dist/types/notes.d.ts +9 -0
- package/dist/types/notes.d.ts.map +1 -0
- package/dist/types/notes.js +2 -0
- package/dist/types/notes.js.map +1 -0
- package/dist/types/requirement.d.ts +19 -0
- package/dist/types/requirement.d.ts.map +1 -0
- package/dist/types/requirement.js +2 -0
- package/dist/types/requirement.js.map +1 -0
- package/dist/types/retrieval.d.ts +32 -0
- package/dist/types/retrieval.d.ts.map +1 -0
- package/dist/types/retrieval.js +2 -0
- package/dist/types/retrieval.js.map +1 -0
- package/dist/types/sequencing.d.ts +83 -0
- package/dist/types/sequencing.d.ts.map +1 -0
- package/dist/types/sequencing.js +2 -0
- package/dist/types/sequencing.js.map +1 -0
- package/dist/types/task.d.ts +7 -0
- package/dist/types/task.d.ts.map +1 -0
- package/dist/types/task.js +2 -0
- package/dist/types/task.js.map +1 -0
- package/dist/types/verify.d.ts +23 -0
- package/dist/types/verify.d.ts.map +1 -0
- package/dist/types/verify.js +2 -0
- package/dist/types/verify.js.map +1 -0
- package/dist/utils/hash.d.ts +6 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +9 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/id-generator.d.ts +17 -0
- package/dist/utils/id-generator.d.ts.map +1 -0
- package/dist/utils/id-generator.js +24 -0
- package/dist/utils/id-generator.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/normalize.d.ts +11 -0
- package/dist/utils/normalize.d.ts.map +1 -0
- package/dist/utils/normalize.js +15 -0
- package/dist/utils/normalize.js.map +1 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
# open-wiki-spec
|
|
2
|
+
|
|
3
|
+
### OpenSpec's structured change management × [Karpathy's LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) — a persistent, agent-maintained knowledge layer for your codebase.
|
|
4
|
+
|
|
5
|
+
<!-- Badges -->
|
|
6
|
+
[](https://www.npmjs.com/package/open-wiki-spec)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](#)
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
> *"The LLM is not a search engine — it's a programmer. Give it a wiki, not a filesystem."*
|
|
13
|
+
>
|
|
14
|
+
> Inspired by [Karpathy's vision](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f): an LLM should maintain a continuously updated wiki rather than re-scanning raw sources every session.
|
|
15
|
+
|
|
16
|
+
## What is this?
|
|
17
|
+
|
|
18
|
+
**open-wiki-spec** (`ows`) fuses two powerful ideas into one system:
|
|
19
|
+
|
|
20
|
+
1. **[Karpathy's LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f)** — an LLM maintains a persistent, accumulating wiki as a knowledge layer. The wiki is not a query-time RAG artifact; it's a living document that gets refined over time. Obsidian becomes the IDE where humans inspect what the LLM maintains.
|
|
21
|
+
|
|
22
|
+
2. **[OpenSpec](https://github.com/Fission-AI/OpenSpec)'s change management** — separate the canonical state from proposed changes. Track work as independent units with evidence, validation, and lifecycle. Never mix "what is" with "what we're changing."
|
|
23
|
+
|
|
24
|
+
The result: a **typed markdown vault** where your codebase knowledge lives as interconnected notes (Features, Changes, Systems, Decisions, Sources, Queries), managed by an agent workflow engine with **deterministic retrieval** — not LLM guesswork.
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Obsidian is the IDE.
|
|
28
|
+
The LLM is the programmer.
|
|
29
|
+
The wiki is the codebase-level knowledge layer.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
No Obsidian app required at runtime — it's plain markdown. But open the `wiki/` folder in Obsidian and you get a fully navigable knowledge graph with backlinks, graph view, and search for free.
|
|
33
|
+
|
|
34
|
+
## Why this exists
|
|
35
|
+
|
|
36
|
+
### The problem
|
|
37
|
+
|
|
38
|
+
Every agent session starts from zero:
|
|
39
|
+
|
|
40
|
+
1. Read the filesystem from scratch
|
|
41
|
+
2. Find relevant files (maybe miss some)
|
|
42
|
+
3. Reconstruct context that existed in a previous session
|
|
43
|
+
4. Perform the task, then lose all that context
|
|
44
|
+
|
|
45
|
+
Knowledge stays trapped in chat history. Past decisions, design rationale, related features, and investigation results vanish between sessions.
|
|
46
|
+
|
|
47
|
+
### The Karpathy insight
|
|
48
|
+
|
|
49
|
+
> *An LLM doesn't have to re-search raw sources every time. It can maintain a continuously updated wiki — a persistent artifact that accumulates and gets refined.*
|
|
50
|
+
|
|
51
|
+
This is the foundation. But a wiki without structure becomes chaos. That's where OpenSpec comes in.
|
|
52
|
+
|
|
53
|
+
### The OpenSpec discipline
|
|
54
|
+
|
|
55
|
+
OpenSpec brings rigor to agent-driven development:
|
|
56
|
+
- **Separate current state from proposed changes** — know what "is" vs what "will be"
|
|
57
|
+
- **Changes are independent, trackable units** — with evidence, impact scope, and validation
|
|
58
|
+
- **Lifecycle management** — propose → plan → implement → apply → verify → archive
|
|
59
|
+
|
|
60
|
+
### What ows combines
|
|
61
|
+
|
|
62
|
+
| From Karpathy's LLM Wiki | From OpenSpec |
|
|
63
|
+
|--------------------------|---------------|
|
|
64
|
+
| Persistent, accumulating knowledge | Structured change management |
|
|
65
|
+
| Wiki as the primary working surface | Current state vs proposed changes separation |
|
|
66
|
+
| LLM maintains the wiki, human reviews | Agent workflows with explicit stages |
|
|
67
|
+
| `index.md`, `log.md` for navigation | Verification and validation before apply |
|
|
68
|
+
| Obsidian as the human-facing IDE | Evidence-based, traceable work |
|
|
69
|
+
|
|
70
|
+
**The key innovation**: ows adds a **deterministic retrieval engine** that neither Karpathy's pattern nor OpenSpec had. Before creating anything, the system searches, scores, and classifies — mechanically, not by LLM guesswork.
|
|
71
|
+
|
|
72
|
+
## How it works
|
|
73
|
+
|
|
74
|
+
### Plain Vault Mode
|
|
75
|
+
|
|
76
|
+
open-wiki-spec reads and writes markdown/frontmatter/wikilinks directly from the vault directory. No Obsidian app APIs, no plugins required. It works in CLI, CI, automation, and agent tooling -- even when Obsidian is closed.
|
|
77
|
+
|
|
78
|
+
### 6 Note Types
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
Feature ── canonical spec for current behavior (replaces OpenSpec's spec.md)
|
|
82
|
+
Change ── proposed or in-progress work unit
|
|
83
|
+
System ── technical boundary / component context
|
|
84
|
+
Decision ── design decision and its rationale
|
|
85
|
+
Source ── evidence: PRDs, issues, meeting notes, code-reading notes
|
|
86
|
+
Query ── investigation notes and captured analysis
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Status Lifecycle
|
|
90
|
+
|
|
91
|
+
Changes flow through a deterministic lifecycle:
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
proposed ──> planned ──> in_progress ──> applied ──> (archived)
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
- **proposed**: Initial description, retrieval scan completed
|
|
98
|
+
- **planned**: Why, Delta Summary, Tasks, and Validation sections filled
|
|
99
|
+
- **in_progress**: Implementation underway, tasks being checked off
|
|
100
|
+
- **applied**: Canonical Feature notes updated to reflect the change
|
|
101
|
+
|
|
102
|
+
### Retrieval Subagent Architecture
|
|
103
|
+
|
|
104
|
+
This is the key differentiator from OpenSpec. Before creating any new work, `ows propose` runs a **mandatory preflight retrieval scan** -- a deterministic pipeline that scores existing vault notes against the new request:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
User Request
|
|
108
|
+
|
|
|
109
|
+
v
|
|
110
|
+
+-------------------------------------+
|
|
111
|
+
| Main Agent (Claude Code) |
|
|
112
|
+
| |
|
|
113
|
+
| 1. Interpret user request |
|
|
114
|
+
| 2. Invoke retrieval subagent -------+--> Retrieval Subagent (ows CLI)
|
|
115
|
+
| 4. Read classification + candidates | |
|
|
116
|
+
| 5. Make final workflow decision | a. Build vault index
|
|
117
|
+
| (create/update/continue/ask) | b. Normalize query
|
|
118
|
+
+-------------------------------------+ c. Lexical retrieval
|
|
119
|
+
d. Graph expansion (1-hop)
|
|
120
|
+
e. Score candidates
|
|
121
|
+
f. Classify
|
|
122
|
+
g. Return structured result
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The retrieval pipeline uses **weighted scoring signals**, not free-form LLM judgment:
|
|
126
|
+
|
|
127
|
+
| Signal | Weight |
|
|
128
|
+
|--------|--------|
|
|
129
|
+
| Exact title match | +40 |
|
|
130
|
+
| Alias match | +35 |
|
|
131
|
+
| Active change overlap | +25 |
|
|
132
|
+
| Same system | +20 |
|
|
133
|
+
| Same feature link | +20 |
|
|
134
|
+
| Full-text match | +15 |
|
|
135
|
+
| Shared source | +10 |
|
|
136
|
+
| Shared decision | +10 |
|
|
137
|
+
| Backlink proximity | +10 |
|
|
138
|
+
|
|
139
|
+
Classification is rule-based with thresholds:
|
|
140
|
+
|
|
141
|
+
| Classification | Meaning |
|
|
142
|
+
|---------------|---------|
|
|
143
|
+
| `existing_change` | An active Change with the same purpose exists. Continue it. |
|
|
144
|
+
| `existing_feature` | A matching Feature exists. Create a new Change attached to it. |
|
|
145
|
+
| `new_feature` | Nothing similar found. Create new Feature + Change. |
|
|
146
|
+
| `needs_confirmation` | Ambiguous results. Ask the user to choose. |
|
|
147
|
+
|
|
148
|
+
Results are deterministic, explainable, and debuggable. No embedding service required.
|
|
149
|
+
|
|
150
|
+
## Key differences from OpenSpec
|
|
151
|
+
|
|
152
|
+
| Aspect | OpenSpec | open-wiki-spec |
|
|
153
|
+
|--------|---------|----------------|
|
|
154
|
+
| Storage | Fixed filesystem directories | Typed markdown vault with frontmatter + wikilinks |
|
|
155
|
+
| Canonical spec | `spec.md` file | `Feature` note with `## Requirements` section |
|
|
156
|
+
| Identity | Filepath/filename | Immutable `id` in frontmatter (survives rename/move) |
|
|
157
|
+
| Similarity detection | Free-form LLM reasoning | Deterministic retrieval subagent with scored signals |
|
|
158
|
+
| Pre-investigation | Prompt-driven, varies by session | Mandatory preflight scan before `propose` |
|
|
159
|
+
| Note relationships | Directory nesting | Typed graph: wikilinks, backlinks, frontmatter links |
|
|
160
|
+
| Completion model | Archive-first file movement | Status lifecycle + deferred archive |
|
|
161
|
+
| Verification | Spec-level validation | 4-dimension verify: completeness, correctness, coherence, vault integrity |
|
|
162
|
+
| Conflict detection | Manual | Automatic sequencing: `depends_on`, `touches`, requirement-level delta |
|
|
163
|
+
|
|
164
|
+
### What we gained
|
|
165
|
+
|
|
166
|
+
- `id`-based stability that survives rename and move
|
|
167
|
+
- Richer graph signals via wikilinks, backlinks, and typed notes
|
|
168
|
+
- `Decision` notes that outlive individual Changes
|
|
169
|
+
- Machine-verifiable `Requirements` with `SHALL`/`MUST` and `WHEN`/`THEN` scenarios
|
|
170
|
+
- Machine-readable `Delta Summary` with stale-base detection
|
|
171
|
+
- Deterministic conflict detection across parallel Changes
|
|
172
|
+
|
|
173
|
+
### What we intentionally changed
|
|
174
|
+
|
|
175
|
+
- No fixed directory-centric navigation (graph-first instead)
|
|
176
|
+
- No direct `spec.md`/`change.md` file format compatibility
|
|
177
|
+
- No archive-first completion (status lifecycle with deferred archive instead)
|
|
178
|
+
|
|
179
|
+
## Quick start
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# Install
|
|
183
|
+
npm install -g open-wiki-spec
|
|
184
|
+
|
|
185
|
+
# Initialize a vault in your project
|
|
186
|
+
cd your-project
|
|
187
|
+
ows init
|
|
188
|
+
|
|
189
|
+
# Propose a change (runs preflight retrieval automatically)
|
|
190
|
+
ows propose "Add user authentication"
|
|
191
|
+
|
|
192
|
+
# Check status of active changes
|
|
193
|
+
ows status
|
|
194
|
+
|
|
195
|
+
# Verify vault consistency
|
|
196
|
+
ows verify
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
`ows init` creates the vault structure and generates 10 Claude Code skill files (`.claude/commands/ows-*.md`) so you can invoke workflows directly:
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
/ows-propose /ows-continue /ows-apply /ows-verify
|
|
203
|
+
/ows-query /ows-status /ows-retrieve /ows-archive
|
|
204
|
+
/ows-init /ows-migrate
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Vault structure
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
wiki/
|
|
211
|
+
00-meta/ # Vault metadata (schema, log, conventions)
|
|
212
|
+
01-sources/ # External references and documentation
|
|
213
|
+
02-systems/ # System/component architecture
|
|
214
|
+
03-features/ # Feature specifications with requirements
|
|
215
|
+
04-changes/ # Active changes (proposed -> applied)
|
|
216
|
+
05-decisions/ # Design decisions and rationale
|
|
217
|
+
06-queries/ # Investigation notes
|
|
218
|
+
99-archive/ # Completed changes
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### CLI commands
|
|
222
|
+
|
|
223
|
+
| Command | Description |
|
|
224
|
+
|---------|-------------|
|
|
225
|
+
| `ows init` | Initialize a new vault |
|
|
226
|
+
| `ows propose` | Propose a new change (with preflight retrieval) |
|
|
227
|
+
| `ows continue` | Continue work on an existing change |
|
|
228
|
+
| `ows apply` | Apply a change to canonical Feature notes |
|
|
229
|
+
| `ows verify` | Verify vault consistency (4 dimensions) |
|
|
230
|
+
| `ows query` | Search the vault graph |
|
|
231
|
+
| `ows status` | Show change state and next action |
|
|
232
|
+
| `ows list` | List active changes |
|
|
233
|
+
| `ows archive` | Archive an applied change |
|
|
234
|
+
| `ows migrate` | Migrate from OpenSpec format |
|
|
235
|
+
|
|
236
|
+
## Migrating from OpenSpec
|
|
237
|
+
|
|
238
|
+
Already using OpenSpec? Migrate in 3 steps:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# 1. Preview what will be converted (no files written)
|
|
242
|
+
ows migrate ./openspec --dry-run
|
|
243
|
+
|
|
244
|
+
# 2. Run the migration
|
|
245
|
+
ows migrate ./openspec
|
|
246
|
+
|
|
247
|
+
# 3. Verify everything converted correctly
|
|
248
|
+
ows verify
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**What gets converted:**
|
|
252
|
+
|
|
253
|
+
| OpenSpec | ows |
|
|
254
|
+
|----------|-----|
|
|
255
|
+
| `specs/<capability>/spec.md` | `wiki/03-features/<capability>.md` — Requirements + Scenarios preserved |
|
|
256
|
+
| `changes/<name>/` (4 files) | `wiki/04-changes/<name>.md` — single note with all sections |
|
|
257
|
+
| `changes/archive/<date>-<name>/` | `wiki/99-archive/<date>-<name>.md` — status: applied |
|
|
258
|
+
| `config.yaml` context | `wiki/01-sources/project-context.md` |
|
|
259
|
+
| Substantial `design.md` | `wiki/05-decisions/` — promoted to Decision notes |
|
|
260
|
+
|
|
261
|
+
**Command equivalents:**
|
|
262
|
+
|
|
263
|
+
| OpenSpec | ows | Key difference |
|
|
264
|
+
|----------|-----|----------------|
|
|
265
|
+
| `/opsx:propose` | `/ows-propose` | + mandatory preflight similarity scan |
|
|
266
|
+
| `/opsx:continue` | `/ows-continue` | section-based, not artifact-based |
|
|
267
|
+
| `/opsx:apply` | `/ows-apply` | + stale detection, atomic delta order |
|
|
268
|
+
| `/opsx:verify` | `/ows-verify` | 4-dimension verification |
|
|
269
|
+
| `/opsx:explore` | `/ows-query` | results saved as Query notes |
|
|
270
|
+
| `/opsx:archive` | `/ows-archive` | status-first, then file move |
|
|
271
|
+
|
|
272
|
+
See the full **[Migration Guide](docs/migration.md)** for detailed steps, conversion rules, and post-migration workflow.
|
|
273
|
+
|
|
274
|
+
## Documentation
|
|
275
|
+
|
|
276
|
+
- **[Installation](docs/installation.md)** -- prerequisites, install methods, build from source
|
|
277
|
+
- **[Getting Started](docs/getting-started.md)** -- step-by-step tutorial
|
|
278
|
+
- **[Core Concepts](docs/concepts.md)** -- note types, requirements, delta summary, lifecycle
|
|
279
|
+
- **[CLI Commands](docs/commands.md)** -- all 10 commands + 10 skill files
|
|
280
|
+
- **[Migration Guide](docs/migration.md)** -- OpenSpec to ows conversion
|
|
281
|
+
- **[Subagent Architecture](docs/subagent-architecture.md)** -- how retrieval works
|
|
282
|
+
- **Module Reference** (docs/modules/):
|
|
283
|
+
- [Types](docs/modules/01-types.md) | [Schemas](docs/modules/02-schemas.md) | [Vault Parser](docs/modules/03-vault-parser.md)
|
|
284
|
+
- [Index Engine](docs/modules/04-index-engine.md) | [Retrieval Engine](docs/modules/05-retrieval-engine.md) | [Sequencing Engine](docs/modules/06-sequencing-engine.md)
|
|
285
|
+
- [Propose](docs/modules/07-workflow-propose.md) | [Continue](docs/modules/08-workflow-continue.md) | [Apply](docs/modules/09-workflow-apply.md)
|
|
286
|
+
- [Verify](docs/modules/10-workflow-verify.md) | [Query](docs/modules/11-workflow-query.md) | [CLI Init](docs/modules/12-cli-init.md)
|
|
287
|
+
|
|
288
|
+
## Requirements
|
|
289
|
+
|
|
290
|
+
- Node.js >= 20.0.0
|
|
291
|
+
|
|
292
|
+
## License
|
|
293
|
+
|
|
294
|
+
[MIT](./LICENSE)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/apply.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuD3D"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI handler for `ows apply`.
|
|
3
|
+
*/
|
|
4
|
+
import * as path from 'node:path';
|
|
5
|
+
import { discoverVaultPath } from '../vault-discovery.js';
|
|
6
|
+
import { appendLogEntry } from '../init/meta-files.js';
|
|
7
|
+
export function registerApplyCommand(program) {
|
|
8
|
+
program
|
|
9
|
+
.command('apply <changeId>')
|
|
10
|
+
.description('Apply a Change to canonical Feature notes')
|
|
11
|
+
.option('--json', 'Output result as JSON')
|
|
12
|
+
.option('--dry-run', 'Validate without writing')
|
|
13
|
+
.option('--force-stale', 'Apply even with stale base fingerprints')
|
|
14
|
+
.action(async (changeId, opts) => {
|
|
15
|
+
try {
|
|
16
|
+
const vaultPath = discoverVaultPath();
|
|
17
|
+
const { buildIndex } = await import('../../core/index/index.js');
|
|
18
|
+
const { parseNote } = await import('../../core/parser/index.js');
|
|
19
|
+
const { applyChange } = await import('../../core/workflow/apply/index.js');
|
|
20
|
+
const { writeFileSync, readFileSync, existsSync, mkdirSync, renameSync } = await import('node:fs');
|
|
21
|
+
const { dirname } = await import('node:path');
|
|
22
|
+
const index = await buildIndex(vaultPath);
|
|
23
|
+
const result = applyChange({
|
|
24
|
+
changeId,
|
|
25
|
+
vaultRoot: vaultPath,
|
|
26
|
+
dryRun: opts.dryRun,
|
|
27
|
+
forceStale: opts.forceStale,
|
|
28
|
+
}, index, {
|
|
29
|
+
parseNote,
|
|
30
|
+
writeFile: (p, c) => writeFileSync(p, c, 'utf-8'),
|
|
31
|
+
readFile: (p) => readFileSync(p, 'utf-8'),
|
|
32
|
+
fileExists: (p) => existsSync(p),
|
|
33
|
+
moveFile: (from, to) => renameSync(from, to),
|
|
34
|
+
ensureDir: (d) => mkdirSync(d, { recursive: true }),
|
|
35
|
+
});
|
|
36
|
+
if (result.statusTransitioned) {
|
|
37
|
+
appendLogEntry(path.join(vaultPath, 'wiki'), 'apply', changeId);
|
|
38
|
+
}
|
|
39
|
+
if (opts.json) {
|
|
40
|
+
console.log(JSON.stringify(result, (_key, value) => value instanceof Map ? Object.fromEntries(value) : value, 2));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
if (result.success) {
|
|
44
|
+
console.log(`Change "${changeId}" applied successfully.`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
console.log(`Change "${changeId}" could not be applied.`);
|
|
48
|
+
for (const err of result.errors) {
|
|
49
|
+
console.log(` - ${err}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
console.error(`Error: ${err.message}`);
|
|
56
|
+
process.exitCode = 1;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=apply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/cli/commands/apply.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,OAAO;SACJ,OAAO,CAAC,kBAAkB,CAAC;SAC3B,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,QAAQ,EAAE,uBAAuB,CAAC;SACzC,MAAM,CAAC,WAAW,EAAE,0BAA0B,CAAC;SAC/C,MAAM,CAAC,eAAe,EAAE,yCAAyC,CAAC;SAClE,MAAM,CAAC,KAAK,EAAE,QAAgB,EAAE,IAAgE,EAAE,EAAE;QACnG,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,iBAAiB,EAAE,CAAC;YACtC,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC;YACjE,MAAM,E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AAC;YAED,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CACjD,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,EAC1D,CAAC,CAAC,CAAC,CAAC;YACN,CAAC;iBAAM,CAAC;gBACN,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,yBAAyB,CAAC,CAAC;gBAC5D,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,GAAG,CAAC,WAAW,QAAQ,yBAAyB,CAAC,CAAC;oBAC1D,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;wBAChC,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;oBAC5B,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { VaultIndex } from '../../types/index.js';
|
|
2
|
+
export interface ArchiveResult {
|
|
3
|
+
changeId: string;
|
|
4
|
+
oldPath: string;
|
|
5
|
+
newPath: string;
|
|
6
|
+
verifyPassed: boolean;
|
|
7
|
+
warnings: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Archive an applied change.
|
|
11
|
+
* Moves the file from 04-changes/ to 99-archive/ and appends to log.md.
|
|
12
|
+
*/
|
|
13
|
+
export declare function archiveChange(changeId: string, index: VaultIndex, vaultPath: string, options?: {
|
|
14
|
+
force?: boolean;
|
|
15
|
+
}): ArchiveResult;
|
|
16
|
+
/**
|
|
17
|
+
* Register the archive command with Commander.
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerArchiveCommand(program: import('commander').Command): void;
|
|
20
|
+
//# sourceMappingURL=archive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/archive.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAC5B,aAAa,CA+Cf;AAGD;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,WAAW,EAAE,OAAO,GAAG,IAAI,CAiCjF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Archive command: moves applied Changes to 99-archive/.
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from 'node:fs';
|
|
5
|
+
import * as path from 'node:path';
|
|
6
|
+
import { verify } from '../../core/workflow/verify/verify.js';
|
|
7
|
+
import { appendLogEntry } from '../init/meta-files.js';
|
|
8
|
+
/**
|
|
9
|
+
* Archive an applied change.
|
|
10
|
+
* Moves the file from 04-changes/ to 99-archive/ and appends to log.md.
|
|
11
|
+
*/
|
|
12
|
+
export function archiveChange(changeId, index, vaultPath, options) {
|
|
13
|
+
const change = index.records.get(changeId);
|
|
14
|
+
if (!change) {
|
|
15
|
+
throw new Error(`Change "${changeId}" not found in the vault index.`);
|
|
16
|
+
}
|
|
17
|
+
if (change.status !== 'applied') {
|
|
18
|
+
throw new Error(`Only applied changes can be archived. "${changeId}" has status "${change.status}".`);
|
|
19
|
+
}
|
|
20
|
+
// Run verify to confirm cleanly applied
|
|
21
|
+
const verifyResult = verify(index, { changeId });
|
|
22
|
+
const warnings = [];
|
|
23
|
+
if (!verifyResult.pass) {
|
|
24
|
+
if (!options?.force) {
|
|
25
|
+
const errorCount = verifyResult.issues.filter((i) => i.severity === 'error').length;
|
|
26
|
+
throw new Error(`Verify found ${errorCount} error(s) for change "${changeId}". Use --force to archive anyway.`);
|
|
27
|
+
}
|
|
28
|
+
warnings.push(`Archived despite ${verifyResult.issues.length} verify issue(s).`);
|
|
29
|
+
}
|
|
30
|
+
// Move the file
|
|
31
|
+
const oldRelPath = change.path;
|
|
32
|
+
const fileName = path.basename(oldRelPath);
|
|
33
|
+
const newRelPath = `wiki/99-archive/${fileName}`;
|
|
34
|
+
// Resolve to absolute paths using vaultPath (project root)
|
|
35
|
+
const oldAbsPath = path.join(vaultPath, oldRelPath);
|
|
36
|
+
const newAbsPath = path.join(vaultPath, newRelPath);
|
|
37
|
+
// Ensure 99-archive/ exists
|
|
38
|
+
fs.mkdirSync(path.join(vaultPath, 'wiki', '99-archive'), { recursive: true });
|
|
39
|
+
fs.renameSync(oldAbsPath, newAbsPath);
|
|
40
|
+
// Append to log.md (appendLogEntry expects the wiki directory)
|
|
41
|
+
appendLogEntry(path.join(vaultPath, 'wiki'), 'archive', changeId);
|
|
42
|
+
return {
|
|
43
|
+
changeId,
|
|
44
|
+
oldPath: oldRelPath,
|
|
45
|
+
newPath: newRelPath,
|
|
46
|
+
verifyPassed: verifyResult.pass,
|
|
47
|
+
warnings,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Register the archive command with Commander.
|
|
52
|
+
*/
|
|
53
|
+
export function registerArchiveCommand(program) {
|
|
54
|
+
program
|
|
55
|
+
.command('archive <changeId>')
|
|
56
|
+
.description('Archive an applied Change to 99-archive/')
|
|
57
|
+
.option('--json', 'Output result as JSON')
|
|
58
|
+
.option('--force', 'Archive even if verify finds errors')
|
|
59
|
+
.action(async (changeId, opts) => {
|
|
60
|
+
try {
|
|
61
|
+
const { discoverVaultPath } = await import('../vault-discovery.js');
|
|
62
|
+
const { buildIndex } = await import('../../core/index/index.js');
|
|
63
|
+
const vaultPath = discoverVaultPath();
|
|
64
|
+
const index = await buildIndex(vaultPath);
|
|
65
|
+
const result = archiveChange(changeId, index, vaultPath, { force: opts.force });
|
|
66
|
+
if (opts.json) {
|
|
67
|
+
console.log(JSON.stringify(result, null, 2));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
console.log(`Archived change "${changeId}"`);
|
|
71
|
+
console.log(` From: ${result.oldPath}`);
|
|
72
|
+
console.log(` To: ${result.newPath}`);
|
|
73
|
+
if (!result.verifyPassed) {
|
|
74
|
+
console.log(` Warning: verify did not pass.`);
|
|
75
|
+
}
|
|
76
|
+
for (const w of result.warnings) {
|
|
77
|
+
console.log(` Warning: ${w}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
console.error(`Error: ${err.message}`);
|
|
83
|
+
process.exitCode = 1;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=archive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive.js","sourceRoot":"","sources":["../../../src/cli/commands/archive.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,E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
|
+
import { discoverVaultPath } from '../vault-discovery.js';
|
|
2
|
+
export function registerContinueCommand(program) {
|
|
3
|
+
program
|
|
4
|
+
.command('continue [changeId]')
|
|
5
|
+
.description('Continue work on an existing Change')
|
|
6
|
+
.option('--json', 'Output result as JSON')
|
|
7
|
+
.action(async (changeId, opts) => {
|
|
8
|
+
try {
|
|
9
|
+
const vaultPath = discoverVaultPath();
|
|
10
|
+
const { buildIndex } = await import('../../core/index/index.js');
|
|
11
|
+
const { analyzeSequencing } = await import('../../core/sequencing/index.js');
|
|
12
|
+
const { parseNote } = await import('../../core/parser/index.js');
|
|
13
|
+
const { continueChange } = await import('../../core/workflow/continue/index.js');
|
|
14
|
+
const { writeFileSync, readFileSync } = await import('node:fs');
|
|
15
|
+
const index = await buildIndex(vaultPath);
|
|
16
|
+
const result = continueChange(index, {
|
|
17
|
+
analyzeSequencing,
|
|
18
|
+
parseNote,
|
|
19
|
+
writeFile: (p, c) => writeFileSync(p, c, 'utf-8'),
|
|
20
|
+
readFile: (p) => readFileSync(p, 'utf-8'),
|
|
21
|
+
}, changeId ? { changeName: changeId } : undefined);
|
|
22
|
+
if (opts.json) {
|
|
23
|
+
console.log(JSON.stringify(result, null, 2));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
console.log(result.summary);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
console.error(`Error: ${err.message}`);
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=continue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continue.js","sourceRoot":"","sources":["../../../src/cli/commands/continue.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,MAAM,UAAU,uBAAuB,CAAC,OAAgB;IACtD,OAAO;SACJ,OAAO,CAAC,qBAAqB,CAAC;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MAAM,CAAC,OAAO,CAAC,CAAC;YAC9B,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatters for CLI commands.
|
|
3
|
+
*/
|
|
4
|
+
import type { VerifyReport } from '../../types/verify.js';
|
|
5
|
+
/**
|
|
6
|
+
* Format a VerifyReport as human-readable text.
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatVerifyReport(report: VerifyReport): string;
|
|
9
|
+
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/formatters.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAoD/D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a VerifyReport as human-readable text.
|
|
3
|
+
*/
|
|
4
|
+
export function formatVerifyReport(report) {
|
|
5
|
+
const lines = [];
|
|
6
|
+
lines.push(`Verify Report (${report.scanned_at})`);
|
|
7
|
+
lines.push(`Total notes scanned: ${report.total_notes}`);
|
|
8
|
+
lines.push(`Result: ${report.pass ? 'PASS' : 'FAIL'}`);
|
|
9
|
+
lines.push('');
|
|
10
|
+
// Summary
|
|
11
|
+
for (const [dim, counts] of Object.entries(report.summary)) {
|
|
12
|
+
if (counts.errors === 0 && counts.warnings === 0 && counts.info === 0)
|
|
13
|
+
continue;
|
|
14
|
+
lines.push(` ${dim}: ${counts.errors} errors, ${counts.warnings} warnings, ${counts.info} info`);
|
|
15
|
+
}
|
|
16
|
+
if (report.issues.length > 0) {
|
|
17
|
+
lines.push('');
|
|
18
|
+
lines.push('Issues:');
|
|
19
|
+
// Errors first
|
|
20
|
+
const errors = report.issues.filter((i) => i.severity === 'error');
|
|
21
|
+
if (errors.length > 0) {
|
|
22
|
+
lines.push('');
|
|
23
|
+
lines.push(' ERRORS:');
|
|
24
|
+
for (const issue of errors) {
|
|
25
|
+
lines.push(` [${issue.code}] ${issue.message}`);
|
|
26
|
+
if (issue.note_path)
|
|
27
|
+
lines.push(` at: ${issue.note_path}`);
|
|
28
|
+
if (issue.suggestion)
|
|
29
|
+
lines.push(` fix: ${issue.suggestion}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Warnings
|
|
33
|
+
const warnings = report.issues.filter((i) => i.severity === 'warning');
|
|
34
|
+
if (warnings.length > 0) {
|
|
35
|
+
lines.push('');
|
|
36
|
+
lines.push(' WARNINGS:');
|
|
37
|
+
for (const issue of warnings) {
|
|
38
|
+
lines.push(` [${issue.code}] ${issue.message}`);
|
|
39
|
+
if (issue.suggestion)
|
|
40
|
+
lines.push(` fix: ${issue.suggestion}`);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
// Info
|
|
44
|
+
const infos = report.issues.filter((i) => i.severity === 'info');
|
|
45
|
+
if (infos.length > 0) {
|
|
46
|
+
lines.push('');
|
|
47
|
+
lines.push(' INFO:');
|
|
48
|
+
for (const issue of infos) {
|
|
49
|
+
lines.push(` [${issue.code}] ${issue.message}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return lines.join('\n');
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=formatters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.js","sourceRoot":"","sources":["../../../src/cli/commands/formatters.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,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