ctxr-cli 0.9.0 → 0.10.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 +17 -7
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/publish-check.d.ts.map +1 -1
- package/dist/commands/publish-check.js +8 -0
- package/dist/commands/publish-check.js.map +1 -1
- package/dist/commands/publish-new.d.ts.map +1 -1
- package/dist/commands/publish-new.js +15 -0
- package/dist/commands/publish-new.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +33 -11
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/session-start.d.ts.map +1 -1
- package/dist/commands/session-start.js +9 -1
- package/dist/commands/session-start.js.map +1 -1
- package/dist/commands/source-check.d.ts.map +1 -1
- package/dist/commands/source-check.js +28 -3
- package/dist/commands/source-check.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +7 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/verify.d.ts +11 -2
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +86 -5
- package/dist/commands/verify.js.map +1 -1
- package/dist/commands/version.d.ts +31 -0
- package/dist/commands/version.d.ts.map +1 -0
- package/dist/commands/version.js +87 -0
- package/dist/commands/version.js.map +1 -0
- package/dist/config/defaults.d.ts +12 -2
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +9 -2
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/load.d.ts +2 -2
- package/dist/config/load.d.ts.map +1 -1
- package/dist/config/load.js +13 -3
- package/dist/config/load.js.map +1 -1
- package/dist/config/render.d.ts +0 -6
- package/dist/config/render.d.ts.map +1 -1
- package/dist/config/render.js +4 -27
- package/dist/config/render.js.map +1 -1
- package/dist/config/schema.d.ts +17 -66
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +59 -111
- package/dist/config/schema.js.map +1 -1
- package/dist/core/browse/nav.d.ts.map +1 -1
- package/dist/core/browse/nav.js +4 -1
- package/dist/core/browse/nav.js.map +1 -1
- package/dist/core/browse/preferences.d.ts +26 -0
- package/dist/core/browse/preferences.d.ts.map +1 -0
- package/dist/core/browse/preferences.js +74 -0
- package/dist/core/browse/preferences.js.map +1 -0
- package/dist/core/browse/routes.d.ts +10 -8
- package/dist/core/browse/routes.d.ts.map +1 -1
- package/dist/core/browse/routes.js +113 -24
- package/dist/core/browse/routes.js.map +1 -1
- package/dist/core/browse/templates.d.ts +14 -4
- package/dist/core/browse/templates.d.ts.map +1 -1
- package/dist/core/browse/templates.js +22 -4
- package/dist/core/browse/templates.js.map +1 -1
- package/dist/core/checks/harness-portability-checks.d.ts +21 -0
- package/dist/core/checks/harness-portability-checks.d.ts.map +1 -1
- package/dist/core/checks/harness-portability-checks.js +46 -1
- package/dist/core/checks/harness-portability-checks.js.map +1 -1
- package/dist/core/checks/integrity-checks.d.ts +0 -2
- package/dist/core/checks/integrity-checks.d.ts.map +1 -1
- package/dist/core/checks/integrity-checks.js +2 -27
- package/dist/core/checks/integrity-checks.js.map +1 -1
- package/dist/core/command.d.ts +6 -0
- package/dist/core/command.d.ts.map +1 -1
- package/dist/core/env.d.ts +5 -0
- package/dist/core/env.d.ts.map +1 -1
- package/dist/core/env.js +3 -0
- package/dist/core/env.js.map +1 -1
- package/dist/core/environment/probe.d.ts +12 -0
- package/dist/core/environment/probe.d.ts.map +1 -0
- package/dist/core/environment/probe.js +36 -0
- package/dist/core/environment/probe.js.map +1 -0
- package/dist/core/errors.d.ts +16 -3
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +41 -15
- package/dist/core/errors.js.map +1 -1
- package/dist/core/git/worktree.d.ts +22 -0
- package/dist/core/git/worktree.d.ts.map +1 -1
- package/dist/core/git/worktree.js +34 -0
- package/dist/core/git/worktree.js.map +1 -1
- package/dist/core/harness/isolated-run.d.ts +52 -0
- package/dist/core/harness/isolated-run.d.ts.map +1 -0
- package/dist/core/harness/isolated-run.js +100 -0
- package/dist/core/harness/isolated-run.js.map +1 -0
- package/dist/core/install-kind.d.ts +25 -0
- package/dist/core/install-kind.d.ts.map +1 -0
- package/dist/core/install-kind.js +56 -0
- package/dist/core/install-kind.js.map +1 -0
- package/dist/core/publish/script-check.d.ts +5 -2
- package/dist/core/publish/script-check.d.ts.map +1 -1
- package/dist/core/publish/script-check.js +5 -2
- package/dist/core/publish/script-check.js.map +1 -1
- package/dist/core/registry.d.ts +40 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/registry.js +55 -0
- package/dist/core/registry.js.map +1 -0
- package/dist/core/root.d.ts +11 -5
- package/dist/core/root.d.ts.map +1 -1
- package/dist/core/root.js +20 -8
- package/dist/core/root.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +7 -0
- package/dist/core/skills.js.map +1 -1
- package/dist/core/version-check.d.ts +63 -0
- package/dist/core/version-check.d.ts.map +1 -0
- package/dist/core/version-check.js +181 -0
- package/dist/core/version-check.js.map +1 -0
- package/dist/run.d.ts +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +38 -16
- package/dist/run.js.map +1 -1
- package/dist/version.d.ts +8 -1
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +8 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/canonical.md +1 -1
- package/templates/serve/shell.html +16 -2
- package/templates/serve/style.css +145 -3
- package/templates/skills/ctxr-session-lifecycle.md +20 -0
- package/templates/skills/ctxr-upgrade.md +44 -0
- package/dist/commands/migrate.d.ts +0 -30
- package/dist/commands/migrate.d.ts.map +0 -1
- package/dist/commands/migrate.js +0 -56
- package/dist/commands/migrate.js.map +0 -1
- package/dist/core/migrations/add-explanation-craft-skill.d.ts +0 -26
- package/dist/core/migrations/add-explanation-craft-skill.d.ts.map +0 -1
- package/dist/core/migrations/add-explanation-craft-skill.js +0 -94
- package/dist/core/migrations/add-explanation-craft-skill.js.map +0 -1
- package/dist/core/migrations/archive-destination-from-taxonomy.d.ts +0 -35
- package/dist/core/migrations/archive-destination-from-taxonomy.d.ts.map +0 -1
- package/dist/core/migrations/archive-destination-from-taxonomy.js +0 -109
- package/dist/core/migrations/archive-destination-from-taxonomy.js.map +0 -1
- package/dist/core/migrations/config-defaults-as-the-convention.d.ts +0 -21
- package/dist/core/migrations/config-defaults-as-the-convention.d.ts.map +0 -1
- package/dist/core/migrations/config-defaults-as-the-convention.js +0 -54
- package/dist/core/migrations/config-defaults-as-the-convention.js.map +0 -1
- package/dist/core/migrations/drop-access-axes.d.ts +0 -24
- package/dist/core/migrations/drop-access-axes.d.ts.map +0 -1
- package/dist/core/migrations/drop-access-axes.js +0 -54
- package/dist/core/migrations/drop-access-axes.js.map +0 -1
- package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts +0 -19
- package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts.map +0 -1
- package/dist/core/migrations/drop-forge-and-workspaces-external.js +0 -49
- package/dist/core/migrations/drop-forge-and-workspaces-external.js.map +0 -1
- package/dist/core/migrations/registry.d.ts +0 -16
- package/dist/core/migrations/registry.d.ts.map +0 -1
- package/dist/core/migrations/registry.js +0 -34
- package/dist/core/migrations/registry.js.map +0 -1
- package/dist/core/migrations/rename-conventions-path.d.ts +0 -26
- package/dist/core/migrations/rename-conventions-path.d.ts.map +0 -1
- package/dist/core/migrations/rename-conventions-path.js +0 -86
- package/dist/core/migrations/rename-conventions-path.js.map +0 -1
- package/dist/core/migrations/rename-procedures-path.d.ts +0 -17
- package/dist/core/migrations/rename-procedures-path.d.ts.map +0 -1
- package/dist/core/migrations/rename-procedures-path.js +0 -45
- package/dist/core/migrations/rename-procedures-path.js.map +0 -1
- package/dist/core/migrations/retain-captures-as-provenance.d.ts +0 -22
- package/dist/core/migrations/retain-captures-as-provenance.d.ts.map +0 -1
- package/dist/core/migrations/retain-captures-as-provenance.js +0 -133
- package/dist/core/migrations/retain-captures-as-provenance.js.map +0 -1
- package/dist/core/migrations/types.d.ts +0 -27
- package/dist/core/migrations/types.d.ts.map +0 -1
- package/dist/core/migrations/types.js +0 -2
- package/dist/core/migrations/types.js.map +0 -1
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { addExplanationCraftSkillMigration } from './add-explanation-craft-skill.js';
|
|
2
|
-
import { configDefaultsAsTheConventionMigration } from './config-defaults-as-the-convention.js';
|
|
3
|
-
import { archiveDestinationFromTaxonomyMigration } from './archive-destination-from-taxonomy.js';
|
|
4
|
-
import { dropAccessAxesMigration } from './drop-access-axes.js';
|
|
5
|
-
import { dropForgeAndWorkspacesExternalMigration } from './drop-forge-and-workspaces-external.js';
|
|
6
|
-
import { renameConventionsPathMigration } from './rename-conventions-path.js';
|
|
7
|
-
import { renameProceduresPathMigration } from './rename-procedures-path.js';
|
|
8
|
-
import { retainCapturesAsProvenanceMigration } from './retain-captures-as-provenance.js';
|
|
9
|
-
/**
|
|
10
|
-
* Every migration contexture ships, in ascending fromVersion order. Later
|
|
11
|
-
* phases append here, nothing else.
|
|
12
|
-
*
|
|
13
|
-
* The chain is deliberately NOT contiguous: the 1 -> 2 visibility-field
|
|
14
|
-
* rename was retired with the field itself (retire-the-access-axes D7), so a
|
|
15
|
-
* schema-1 store's first pending migration is the 2 -> 3 one, which guards on
|
|
16
|
-
* `schema_version < 3` and carries it straight there. `pendingMigrations`
|
|
17
|
-
* selects on `fromVersion >= current`, never on adjacency, so a gap costs
|
|
18
|
-
* nothing.
|
|
19
|
-
*/
|
|
20
|
-
export const MIGRATIONS = [
|
|
21
|
-
renameProceduresPathMigration,
|
|
22
|
-
renameConventionsPathMigration,
|
|
23
|
-
dropForgeAndWorkspacesExternalMigration,
|
|
24
|
-
archiveDestinationFromTaxonomyMigration,
|
|
25
|
-
addExplanationCraftSkillMigration,
|
|
26
|
-
dropAccessAxesMigration,
|
|
27
|
-
retainCapturesAsProvenanceMigration,
|
|
28
|
-
configDefaultsAsTheConventionMigration,
|
|
29
|
-
];
|
|
30
|
-
/** Every migration a store currently at `fromVersion` still needs to reach the CLI's supported version, in order. */
|
|
31
|
-
export function pendingMigrations(fromVersion) {
|
|
32
|
-
return MIGRATIONS.filter((m) => m.fromVersion >= fromVersion).slice().sort((a, b) => a.fromVersion - b.fromVersion);
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/core/migrations/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,sCAAsC,EAAE,MAAM,wCAAwC,CAAC;AAChG,OAAO,EAAE,uCAAuC,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,uCAAuC,EAAE,MAAM,yCAAyC,CAAC;AAClG,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,mCAAmC,EAAE,MAAM,oCAAoC,CAAC;AAGzF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,6BAA6B;IAC7B,8BAA8B;IAC9B,uCAAuC;IACvC,uCAAuC;IACvC,iCAAiC;IACjC,uBAAuB;IACvB,mCAAmC;IACnC,sCAAsC;CACvC,CAAC;AAEF,qHAAqH;AACrH,MAAM,UAAU,iBAAiB,CAAC,WAAmB;IACnD,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,IAAI,WAAW,CAAC,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC;AACtH,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { Migration } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* rename-conventions-path-to-guidance-path (compose-store-guidance-documents
|
|
4
|
-
* design.md D1/D7): unlike 0003's pure key rename, the key's *default value*
|
|
5
|
-
* also changes (`.contexture/conventions/` -> `.contexture/guidance/`), so a
|
|
6
|
-
* store that never customized the path needs its directory moved on disk,
|
|
7
|
-
* not merely its config key renamed. An operator-customized path is left
|
|
8
|
-
* exactly where it is — only the key spelling changes for them.
|
|
9
|
-
*
|
|
10
|
-
* Migrations only see `Store` (`root` + `config`, no `GitRunner` — see
|
|
11
|
-
* core/store.ts), so the directory move is a plain filesystem rename, not
|
|
12
|
-
* `git mv`. History is still preserved: whatever commits this migration's
|
|
13
|
-
* output (the normal session-submit flow) stages a coherent delete-old,
|
|
14
|
-
* add-new diff, which `git log --follow`'s content-similarity rename
|
|
15
|
-
* detection recognizes identically to an explicit `git mv` — git never
|
|
16
|
-
* records "this was a rename" as a distinct fact in its object model
|
|
17
|
-
* either way.
|
|
18
|
-
*
|
|
19
|
-
* Pending-ness is `store.config.schema_version < 4`, the same
|
|
20
|
-
* schema-version-not-key-presence rule 0003 established, for the same
|
|
21
|
-
* reason: `HarnessSchema`'s fallback transform already populates
|
|
22
|
-
* `guidance_path` on an unmigrated store, so its presence can't distinguish
|
|
23
|
-
* migrated from not.
|
|
24
|
-
*/
|
|
25
|
-
export declare const renameConventionsPathMigration: Migration;
|
|
26
|
-
//# sourceMappingURL=rename-conventions-path.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-conventions-path.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/rename-conventions-path.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAiB5D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,8BAA8B,EAAE,SA+C5C,CAAC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { rename } from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { readConfig } from '../../config/load.js';
|
|
5
|
-
import { renderStoreConfig } from '../../config/render.js';
|
|
6
|
-
import { writeFileAtomic } from '../fs/atomic.js';
|
|
7
|
-
const OLD_DEFAULT_GUIDANCE_PATH = '.contexture/conventions/';
|
|
8
|
-
const NEW_DEFAULT_GUIDANCE_PATH = '.contexture/guidance/';
|
|
9
|
-
const CONFIG_DELTA = {
|
|
10
|
-
path: 'contexture.yaml',
|
|
11
|
-
description: 'rename harness.conventions_path to harness.guidance_path and set schema_version to 4',
|
|
12
|
-
};
|
|
13
|
-
function directoryDelta() {
|
|
14
|
-
return {
|
|
15
|
-
path: NEW_DEFAULT_GUIDANCE_PATH,
|
|
16
|
-
description: `move the default-valued guidance directory from ${OLD_DEFAULT_GUIDANCE_PATH} to ${NEW_DEFAULT_GUIDANCE_PATH}`,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* rename-conventions-path-to-guidance-path (compose-store-guidance-documents
|
|
21
|
-
* design.md D1/D7): unlike 0003's pure key rename, the key's *default value*
|
|
22
|
-
* also changes (`.contexture/conventions/` -> `.contexture/guidance/`), so a
|
|
23
|
-
* store that never customized the path needs its directory moved on disk,
|
|
24
|
-
* not merely its config key renamed. An operator-customized path is left
|
|
25
|
-
* exactly where it is — only the key spelling changes for them.
|
|
26
|
-
*
|
|
27
|
-
* Migrations only see `Store` (`root` + `config`, no `GitRunner` — see
|
|
28
|
-
* core/store.ts), so the directory move is a plain filesystem rename, not
|
|
29
|
-
* `git mv`. History is still preserved: whatever commits this migration's
|
|
30
|
-
* output (the normal session-submit flow) stages a coherent delete-old,
|
|
31
|
-
* add-new diff, which `git log --follow`'s content-similarity rename
|
|
32
|
-
* detection recognizes identically to an explicit `git mv` — git never
|
|
33
|
-
* records "this was a rename" as a distinct fact in its object model
|
|
34
|
-
* either way.
|
|
35
|
-
*
|
|
36
|
-
* Pending-ness is `store.config.schema_version < 4`, the same
|
|
37
|
-
* schema-version-not-key-presence rule 0003 established, for the same
|
|
38
|
-
* reason: `HarnessSchema`'s fallback transform already populates
|
|
39
|
-
* `guidance_path` on an unmigrated store, so its presence can't distinguish
|
|
40
|
-
* migrated from not.
|
|
41
|
-
*/
|
|
42
|
-
export const renameConventionsPathMigration = {
|
|
43
|
-
id: '0004-rename-conventions-path-to-guidance-path',
|
|
44
|
-
fromVersion: 3,
|
|
45
|
-
toVersion: 4,
|
|
46
|
-
description: 'Rename the harness.conventions_path config key to harness.guidance_path, move the guidance directory when it sat at the old default, and bump schema_version to 4.',
|
|
47
|
-
async plan(store) {
|
|
48
|
-
if (store.config.schema_version >= 4)
|
|
49
|
-
return [];
|
|
50
|
-
const deltas = [CONFIG_DELTA];
|
|
51
|
-
if (store.config.harness.guidance_path === OLD_DEFAULT_GUIDANCE_PATH)
|
|
52
|
-
deltas.push(directoryDelta());
|
|
53
|
-
return deltas;
|
|
54
|
-
},
|
|
55
|
-
async apply(store) {
|
|
56
|
-
if (store.config.schema_version >= 4)
|
|
57
|
-
return [];
|
|
58
|
-
const configPath = path.join(store.root, 'contexture.yaml');
|
|
59
|
-
// readConfig() already resolves harness.guidance_path via HarnessSchema's
|
|
60
|
-
// fallback (from conventions_path if that's all the file has), so
|
|
61
|
-
// currentConfig.harness carries no conventions_path key at all —
|
|
62
|
-
// rendering it below writes only guidance_path to disk.
|
|
63
|
-
const currentConfig = await readConfig(store.root);
|
|
64
|
-
const appliedDeltas = [CONFIG_DELTA];
|
|
65
|
-
let guidancePath = currentConfig.harness.guidance_path;
|
|
66
|
-
if (guidancePath === OLD_DEFAULT_GUIDANCE_PATH) {
|
|
67
|
-
const oldDir = path.join(store.root, OLD_DEFAULT_GUIDANCE_PATH);
|
|
68
|
-
const newDir = path.join(store.root, NEW_DEFAULT_GUIDANCE_PATH);
|
|
69
|
-
// Absent when the store never carried any convention files — nothing
|
|
70
|
-
// to move on disk, only the config value changes.
|
|
71
|
-
if (existsSync(oldDir)) {
|
|
72
|
-
await rename(oldDir, newDir);
|
|
73
|
-
}
|
|
74
|
-
guidancePath = NEW_DEFAULT_GUIDANCE_PATH;
|
|
75
|
-
appliedDeltas.push(directoryDelta());
|
|
76
|
-
}
|
|
77
|
-
const nextConfig = {
|
|
78
|
-
...currentConfig,
|
|
79
|
-
schema_version: 4,
|
|
80
|
-
harness: { ...currentConfig.harness, guidance_path: guidancePath },
|
|
81
|
-
};
|
|
82
|
-
await writeFileAtomic(configPath, renderStoreConfig(nextConfig));
|
|
83
|
-
return appliedDeltas;
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
//# sourceMappingURL=rename-conventions-path.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-conventions-path.js","sourceRoot":"","sources":["../../../src/core/migrations/rename-conventions-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIlD,MAAM,yBAAyB,GAAG,0BAA0B,CAAC;AAC7D,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AAE1D,MAAM,YAAY,GAAmB;IACnC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,sFAAsF;CACpG,CAAC;AAEF,SAAS,cAAc;IACrB,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,WAAW,EAAE,mDAAmD,yBA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qEAAqE;YACrE,kDAAkD;YAClD,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBACvB,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC/B,CAAC;YACD,YAAY,GAAG,yBAAyB,CAAC;YACzC,aAAa,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;QACvC,CAAC;QAED,MAAM,UAAU,GAAG;YACjB,GAAG,aAAa;YAChB,cAAc,EAAE,CAAC;YACjB,OAAO,EAAE,EAAE,GAAG,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE;SACnE,CAAC;QACF,MAAM,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;QAEjE,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Migration } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* rename-procedures-to-skills (design.md D2): a single-delta migration —
|
|
4
|
-
* unlike the visibility-field rename, no note frontmatter is touched, since
|
|
5
|
-
* only the config key's spelling changes, never any store file's location
|
|
6
|
-
* (DEFAULT_SKILLS_PATH is already DEFAULT_PROCEDURES_PATH's old value).
|
|
7
|
-
*
|
|
8
|
-
* Pending-ness is `store.config.schema_version < 3`, NOT the presence or
|
|
9
|
-
* absence of `store.config.harness.skills_path` — that field is populated
|
|
10
|
-
* by HarnessSchema's fallback transform even on an unmigrated v2 store (so
|
|
11
|
-
* every command keeps working before `ctxr migrate` runs), which means its
|
|
12
|
-
* presence can never distinguish "already migrated" from "not yet
|
|
13
|
-
* migrated." `schema_version` is the one signal the fallback doesn't mask,
|
|
14
|
-
* and this migration is the only thing that ever sets it to 3.
|
|
15
|
-
*/
|
|
16
|
-
export declare const renameProceduresPathMigration: Migration;
|
|
17
|
-
//# sourceMappingURL=rename-procedures-path.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-procedures-path.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/rename-procedures-path.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAO5D;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAwB3C,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
|
-
import { readConfig } from '../../config/load.js';
|
|
3
|
-
import { renderStoreConfig } from '../../config/render.js';
|
|
4
|
-
import { writeFileAtomic } from '../fs/atomic.js';
|
|
5
|
-
const CONFIG_DELTA = {
|
|
6
|
-
path: 'contexture.yaml',
|
|
7
|
-
description: 'rename harness.procedures_path to harness.skills_path and set schema_version to 3',
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* rename-procedures-to-skills (design.md D2): a single-delta migration —
|
|
11
|
-
* unlike the visibility-field rename, no note frontmatter is touched, since
|
|
12
|
-
* only the config key's spelling changes, never any store file's location
|
|
13
|
-
* (DEFAULT_SKILLS_PATH is already DEFAULT_PROCEDURES_PATH's old value).
|
|
14
|
-
*
|
|
15
|
-
* Pending-ness is `store.config.schema_version < 3`, NOT the presence or
|
|
16
|
-
* absence of `store.config.harness.skills_path` — that field is populated
|
|
17
|
-
* by HarnessSchema's fallback transform even on an unmigrated v2 store (so
|
|
18
|
-
* every command keeps working before `ctxr migrate` runs), which means its
|
|
19
|
-
* presence can never distinguish "already migrated" from "not yet
|
|
20
|
-
* migrated." `schema_version` is the one signal the fallback doesn't mask,
|
|
21
|
-
* and this migration is the only thing that ever sets it to 3.
|
|
22
|
-
*/
|
|
23
|
-
export const renameProceduresPathMigration = {
|
|
24
|
-
id: '0003-rename-procedures-path-to-skills-path',
|
|
25
|
-
fromVersion: 2,
|
|
26
|
-
toVersion: 3,
|
|
27
|
-
description: 'Rename the harness.procedures_path config key to harness.skills_path, and bump schema_version to 3.',
|
|
28
|
-
async plan(store) {
|
|
29
|
-
return store.config.schema_version < 3 ? [CONFIG_DELTA] : [];
|
|
30
|
-
},
|
|
31
|
-
async apply(store) {
|
|
32
|
-
if (store.config.schema_version >= 3)
|
|
33
|
-
return [];
|
|
34
|
-
const configPath = path.join(store.root, 'contexture.yaml');
|
|
35
|
-
// readConfig() already resolves harness.skills_path via HarnessSchema's
|
|
36
|
-
// fallback (from procedures_path if that's all the file has), so
|
|
37
|
-
// currentConfig.harness carries no procedures_path key at all —
|
|
38
|
-
// rendering it below writes only skills_path to disk.
|
|
39
|
-
const currentConfig = await readConfig(store.root);
|
|
40
|
-
const nextConfig = { ...currentConfig, schema_version: 3 };
|
|
41
|
-
await writeFileAtomic(configPath, renderStoreConfig(nextConfig));
|
|
42
|
-
return [CONFIG_DELTA];
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
//# sourceMappingURL=rename-procedures-path.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename-procedures-path.js","sourceRoot":"","sources":["../../../src/core/migrations/rename-procedures-path.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIlD,MAAM,YAAY,GAAmB;IACnC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,mFAAmF;CACjG,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAc;IACtD,EAAE,EAAE,4CAA4C;IAChD,WAAW,EAAE,CAAC;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EAAE,qGAAqG;IAElH,KAAK,CAAC,IAAI,CAAC,KAAK;QACd,OAAO,KAAK,CAAC,MAAM,CAAC,cAAc,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,KAAK;QACf,IAAI,KAAK,CAAC,MAAM,CAAC,cAAc,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;QAEhD,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;QAC5D,wEAAwE;QACxE,iEAAiE;QACjE,gEAAgE;QAChE,sDAAsD;QACtD,MAAM,aAAa,GAAG,MAAM,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACnD,MAAM,UAAU,GAAG,EAAE,GAAG,aAAa,EAAE,cAAc,EAAE,CAAC,EAAE,CAAC;QAC3D,MAAM,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;QAEjE,OAAO,CAAC,YAAY,CAAC,CAAC;IACxB,CAAC;CACF,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Migration } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* retain-captures-as-provenance: captures stop being consumed by ingest and
|
|
4
|
-
* start being retained as the store's provenance ledger, which means they
|
|
5
|
-
* stop being notes. That needs three things on an existing store — a
|
|
6
|
-
* declared capture root, an inbox inside it, and the root excluded from
|
|
7
|
-
* retrieval — and this migration supplies all three.
|
|
8
|
-
*
|
|
9
|
-
* Modelled on 0006: adopt the new shipped default only where the value still
|
|
10
|
-
* sat at the old one, preserve an operator-chosen value verbatim, and move
|
|
11
|
-
* the directory when one exists. Pending-ness is `schema_version < 9`, not
|
|
12
|
-
* key presence, for the reason 0002/0004/0005/0006 all record: the schema's
|
|
13
|
-
* transform fills `capture_root` in on an unmigrated store too, so its
|
|
14
|
-
* presence cannot distinguish migrated from not.
|
|
15
|
-
*
|
|
16
|
-
* The directory move runs before the config write, so an interruption
|
|
17
|
-
* between them leaves the next run able to re-derive what is left: the
|
|
18
|
-
* config still reads schema 8 with the old inbox, the old directory is
|
|
19
|
-
* already gone, and the rename is skipped as done.
|
|
20
|
-
*/
|
|
21
|
-
export declare const retainCapturesAsProvenanceMigration: Migration;
|
|
22
|
-
//# sourceMappingURL=retain-captures-as-provenance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retain-captures-as-provenance.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/retain-captures-as-provenance.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAsD5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mCAAmC,EAAE,SAoEjD,CAAC"}
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { existsSync } from 'node:fs';
|
|
2
|
-
import { mkdir, rename } from 'node:fs/promises';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { DEFAULT_CAPTURE_ROOT, DEFAULT_INBOX_PATH } from '../../config/defaults.js';
|
|
5
|
-
import { readConfig } from '../../config/load.js';
|
|
6
|
-
import { renderStoreConfig } from '../../config/render.js';
|
|
7
|
-
import { CaptureRootUndeterminedError } from '../errors.js';
|
|
8
|
-
import { writeFileAtomic } from '../fs/atomic.js';
|
|
9
|
-
/**
|
|
10
|
-
* The inbox default as it stood before this migration. Pinned locally, never
|
|
11
|
-
* read from `defaults.ts`: a migration reasons about the value a store was
|
|
12
|
-
* born with, which must not drift when the shipped default moves again.
|
|
13
|
-
*/
|
|
14
|
-
const PREVIOUS_DEFAULT_INBOX_PATH = 'inbox/';
|
|
15
|
-
function normalize(prefix) {
|
|
16
|
-
return prefix.replace(/\/+$/, '');
|
|
17
|
-
}
|
|
18
|
-
/** The directory one level above `inboxPath`, or null when the inbox is already top-level. */
|
|
19
|
-
function parentDirectoryOf(inboxPath) {
|
|
20
|
-
const segments = normalize(inboxPath).split('/').filter((segment) => segment !== '');
|
|
21
|
-
if (segments.length < 2)
|
|
22
|
-
return null;
|
|
23
|
-
return `${segments.slice(0, -1).join('/')}/`;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Where this store's capture tier lands. Two cases and one refusal:
|
|
27
|
-
*
|
|
28
|
-
* 1. The store never customized its inbox, so it is ours to move: adopt the
|
|
29
|
-
* shipped `raw/inbox/` under `raw/`.
|
|
30
|
-
* 2. The store chose an inbox nested at least one level (`staging/inbox/`):
|
|
31
|
-
* the parent it already chose IS the capture root. The inbox is left
|
|
32
|
-
* exactly as the operator set it.
|
|
33
|
-
* 3. The store chose a top-level inbox of its own (`incoming/`): there is no
|
|
34
|
-
* parent to promote short of the store root, and excluding the store root
|
|
35
|
-
* from retrieval would empty the note list. Refuse before writing
|
|
36
|
-
* anything and let the operator choose, the same way `source check`
|
|
37
|
-
* refuses to guess among multiple matches.
|
|
38
|
-
*/
|
|
39
|
-
function resolveCaptureTier(inboxPath) {
|
|
40
|
-
if (normalize(inboxPath) === normalize(PREVIOUS_DEFAULT_INBOX_PATH)) {
|
|
41
|
-
return { inboxPath: DEFAULT_INBOX_PATH, captureRoot: DEFAULT_CAPTURE_ROOT, adoptsShippedDefault: true };
|
|
42
|
-
}
|
|
43
|
-
const parent = parentDirectoryOf(inboxPath);
|
|
44
|
-
if (parent === null)
|
|
45
|
-
throw new CaptureRootUndeterminedError(inboxPath);
|
|
46
|
-
return { inboxPath, captureRoot: parent, adoptsShippedDefault: false };
|
|
47
|
-
}
|
|
48
|
-
function alreadyExcluded(excludePaths, captureRoot) {
|
|
49
|
-
return excludePaths.some((excluded) => normalize(excluded) === normalize(captureRoot));
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* retain-captures-as-provenance: captures stop being consumed by ingest and
|
|
53
|
-
* start being retained as the store's provenance ledger, which means they
|
|
54
|
-
* stop being notes. That needs three things on an existing store — a
|
|
55
|
-
* declared capture root, an inbox inside it, and the root excluded from
|
|
56
|
-
* retrieval — and this migration supplies all three.
|
|
57
|
-
*
|
|
58
|
-
* Modelled on 0006: adopt the new shipped default only where the value still
|
|
59
|
-
* sat at the old one, preserve an operator-chosen value verbatim, and move
|
|
60
|
-
* the directory when one exists. Pending-ness is `schema_version < 9`, not
|
|
61
|
-
* key presence, for the reason 0002/0004/0005/0006 all record: the schema's
|
|
62
|
-
* transform fills `capture_root` in on an unmigrated store too, so its
|
|
63
|
-
* presence cannot distinguish migrated from not.
|
|
64
|
-
*
|
|
65
|
-
* The directory move runs before the config write, so an interruption
|
|
66
|
-
* between them leaves the next run able to re-derive what is left: the
|
|
67
|
-
* config still reads schema 8 with the old inbox, the old directory is
|
|
68
|
-
* already gone, and the rename is skipped as done.
|
|
69
|
-
*/
|
|
70
|
-
export const retainCapturesAsProvenanceMigration = {
|
|
71
|
-
id: '0009-retain-captures-as-provenance',
|
|
72
|
-
fromVersion: 8,
|
|
73
|
-
toVersion: 9,
|
|
74
|
-
description: 'Declare the capture tier: add ingest.capture_root, move a default-valued inbox inside it, exclude the capture root from retrieval, and bump schema_version to 9.',
|
|
75
|
-
async plan(store) {
|
|
76
|
-
if (store.config.schema_version >= 9)
|
|
77
|
-
return [];
|
|
78
|
-
const tier = resolveCaptureTier(store.config.ingest.inbox_path);
|
|
79
|
-
const deltas = [
|
|
80
|
-
{
|
|
81
|
-
path: 'contexture.yaml',
|
|
82
|
-
description: `add ingest.capture_root: ${tier.captureRoot} and set schema_version to 9`,
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
if (tier.adoptsShippedDefault) {
|
|
86
|
-
deltas.push({
|
|
87
|
-
path: 'contexture.yaml',
|
|
88
|
-
description: `adopt the shipped inbox default, moving ingest.inbox_path from ${PREVIOUS_DEFAULT_INBOX_PATH} to ${tier.inboxPath}`,
|
|
89
|
-
});
|
|
90
|
-
if (existsSync(path.join(store.root, PREVIOUS_DEFAULT_INBOX_PATH))) {
|
|
91
|
-
deltas.push({
|
|
92
|
-
path: tier.inboxPath,
|
|
93
|
-
description: `move the inbox directory from ${PREVIOUS_DEFAULT_INBOX_PATH} to ${tier.inboxPath}`,
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (!alreadyExcluded(store.config.retrieval.exclude_paths, tier.captureRoot)) {
|
|
98
|
-
deltas.push({
|
|
99
|
-
path: 'contexture.yaml',
|
|
100
|
-
description: `add ${tier.captureRoot} to retrieval.exclude_paths, so retained captures are never notes`,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
return deltas;
|
|
104
|
-
},
|
|
105
|
-
async apply(store) {
|
|
106
|
-
if (store.config.schema_version >= 9)
|
|
107
|
-
return [];
|
|
108
|
-
const currentConfig = await readConfig(store.root);
|
|
109
|
-
const tier = resolveCaptureTier(currentConfig.ingest.inbox_path);
|
|
110
|
-
const appliedDeltas = await this.plan({ ...store, config: currentConfig });
|
|
111
|
-
if (tier.adoptsShippedDefault) {
|
|
112
|
-
const oldDir = path.join(store.root, PREVIOUS_DEFAULT_INBOX_PATH);
|
|
113
|
-
const newDir = path.join(store.root, tier.inboxPath);
|
|
114
|
-
// Absent whenever nothing was ever captured — only the config changes.
|
|
115
|
-
if (existsSync(oldDir) && !existsSync(newDir)) {
|
|
116
|
-
await mkdir(path.dirname(newDir), { recursive: true });
|
|
117
|
-
await rename(oldDir, newDir);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
const excludePaths = alreadyExcluded(currentConfig.retrieval.exclude_paths, tier.captureRoot)
|
|
121
|
-
? [...currentConfig.retrieval.exclude_paths]
|
|
122
|
-
: [...currentConfig.retrieval.exclude_paths, tier.captureRoot];
|
|
123
|
-
const nextConfig = {
|
|
124
|
-
...currentConfig,
|
|
125
|
-
schema_version: 9,
|
|
126
|
-
retrieval: { ...currentConfig.retrieval, exclude_paths: excludePaths },
|
|
127
|
-
ingest: { ...currentConfig.ingest, inbox_path: tier.inboxPath, capture_root: tier.captureRoot },
|
|
128
|
-
};
|
|
129
|
-
await writeFileAtomic(path.join(store.root, 'contexture.yaml'), renderStoreConfig(nextConfig));
|
|
130
|
-
return appliedDeltas;
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
//# sourceMappingURL=retain-captures-as-provenance.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retain-captures-as-provenance.js","sourceRoot":"","sources":["../../../src/core/migrations/retain-captures-as-provenance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD;;;;GAIG;AACH,MAAM,2BAA2B,GAAG,QAAQ,CAAC;AAE7C,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACpC,CAAC;AAED,8FAA8F;AAC9F,SAAS,iBAAiB,CAAC,SAAiB;IAC1C,MAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC;IACrF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;AAC/C,CAAC;AASD;;;;;;;;;;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AG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YACrD,uEAAuE;YACvE,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC9C,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;gBACvD,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QAED,MAAM,YAAY,GAAG,eAAe,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC;YAC3F,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC;YAC5C,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAEjE,MAAM,UAAU,GAAG;YACjB,GAAG,aAAa;YAChB,cAAc,EAAE,CAAC;YACjB,SAAS,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE;YACtE,MAAM,EAAE,EAAE,GAAG,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,IAAI,CAAC,WAAW,EAAE;SAChG,CAAC;QACF,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC,CAAC;QAE/F,OAAO,aAAa,CAAC;IACvB,CAAC;CACF,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { Store } from '../store.js';
|
|
2
|
-
/** One concrete, reportable change a migration made (or would make). */
|
|
3
|
-
export interface MigrationDelta {
|
|
4
|
-
/** The file touched, relative to the store root — 'contexture.yaml' for the config itself. */
|
|
5
|
-
path: string;
|
|
6
|
-
description: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* store-lifecycle spec: "named, dry-runnable, resumable." A migration's
|
|
10
|
-
* `plan()` and `apply()` both re-derive what still needs doing from the
|
|
11
|
-
* store's CURRENT on-disk state, never from separately-tracked progress —
|
|
12
|
-
* so re-running `apply()` after an interruption naturally skips whatever
|
|
13
|
-
* was already done (it no longer matches the "needs migrating" condition)
|
|
14
|
-
* and finishes the rest, with no separate progress file to go stale or
|
|
15
|
-
* corrupt.
|
|
16
|
-
*/
|
|
17
|
-
export interface Migration {
|
|
18
|
-
id: string;
|
|
19
|
-
fromVersion: number;
|
|
20
|
-
toVersion: number;
|
|
21
|
-
description: string;
|
|
22
|
-
/** Computes exactly what apply() would change, without writing anything. */
|
|
23
|
-
plan(store: Store): Promise<MigrationDelta[]>;
|
|
24
|
-
/** Applies only what plan() would still report as pending; returns what it actually changed. */
|
|
25
|
-
apply(store: Store): Promise<MigrationDelta[]>;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEzC,wEAAwE;AACxE,MAAM,WAAW,cAAc;IAC7B,8FAA8F;IAC9F,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAC9C,gGAAgG;IAChG,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;CAChD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/migrations/types.ts"],"names":[],"mappings":""}
|