ctxr-cli 0.4.1 → 0.6.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/dist/adapter.d.ts +0 -1
- package/dist/adapter.d.ts.map +1 -1
- package/dist/adapter.js.map +1 -1
- package/dist/adapters/builtin/index.d.ts.map +1 -1
- package/dist/adapters/builtin/index.js +2 -2
- package/dist/adapters/builtin/index.js.map +1 -1
- package/dist/adapters/harness/claude-code.d.ts.map +1 -1
- package/dist/adapters/harness/claude-code.js +30 -14
- package/dist/adapters/harness/claude-code.js.map +1 -1
- package/dist/adapters/harness/hermes-agent.d.ts +9 -0
- package/dist/adapters/harness/hermes-agent.d.ts.map +1 -0
- package/dist/adapters/harness/hermes-agent.js +13 -0
- package/dist/adapters/harness/hermes-agent.js.map +1 -0
- package/dist/adapters/types.d.ts +39 -18
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/adapters/types.js +3 -3
- package/dist/adapters/types.js.map +1 -1
- package/dist/commands/adapters-generate.d.ts +4 -2
- package/dist/commands/adapters-generate.d.ts.map +1 -1
- package/dist/commands/adapters-generate.js +14 -6
- package/dist/commands/adapters-generate.js.map +1 -1
- package/dist/commands/archive.d.ts +4 -2
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +5 -3
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/check.d.ts.map +1 -1
- package/dist/commands/check.js +1 -6
- package/dist/commands/check.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +132 -18
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/publish-check.d.ts +23 -0
- package/dist/commands/publish-check.d.ts.map +1 -0
- package/dist/commands/publish-check.js +116 -0
- package/dist/commands/publish-check.js.map +1 -0
- package/dist/commands/publish-gather.d.ts +37 -0
- package/dist/commands/publish-gather.d.ts.map +1 -0
- package/dist/commands/publish-gather.js +92 -0
- package/dist/commands/publish-gather.js.map +1 -0
- package/dist/commands/publish-new.d.ts +18 -0
- package/dist/commands/publish-new.d.ts.map +1 -0
- package/dist/commands/publish-new.js +86 -0
- package/dist/commands/publish-new.js.map +1 -0
- package/dist/commands/rollup-write.d.ts.map +1 -1
- package/dist/commands/rollup-write.js +8 -0
- package/dist/commands/rollup-write.js.map +1 -1
- package/dist/commands/serve.d.ts +32 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +170 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/update.js +3 -3
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/verify.d.ts +9 -2
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +46 -23
- package/dist/commands/verify.js.map +1 -1
- package/dist/config/defaults.d.ts +53 -15
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +54 -19
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/schema.d.ts +49 -12
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +115 -23
- package/dist/config/schema.js.map +1 -1
- package/dist/core/agents-doc.d.ts +63 -12
- package/dist/core/agents-doc.d.ts.map +1 -1
- package/dist/core/agents-doc.js +191 -41
- package/dist/core/agents-doc.js.map +1 -1
- package/dist/core/browse/link-resolver.d.ts +12 -0
- package/dist/core/browse/link-resolver.d.ts.map +1 -0
- package/dist/core/browse/link-resolver.js +12 -0
- package/dist/core/browse/link-resolver.js.map +1 -0
- package/dist/core/browse/render.d.ts +5 -0
- package/dist/core/browse/render.d.ts.map +1 -0
- package/dist/core/browse/render.js +66 -0
- package/dist/core/browse/render.js.map +1 -0
- package/dist/core/browse/routes.d.ts +31 -0
- package/dist/core/browse/routes.d.ts.map +1 -0
- package/dist/core/browse/routes.js +56 -0
- package/dist/core/browse/routes.js.map +1 -0
- package/dist/core/browse/templates.d.ts +4 -0
- package/dist/core/browse/templates.d.ts.map +1 -0
- package/dist/core/browse/templates.js +26 -0
- package/dist/core/browse/templates.js.map +1 -0
- package/dist/core/checks/harness-portability-checks.d.ts +12 -0
- package/dist/core/checks/harness-portability-checks.d.ts.map +1 -0
- package/dist/core/checks/harness-portability-checks.js +39 -0
- package/dist/core/checks/harness-portability-checks.js.map +1 -0
- package/dist/core/checks/integrity-checks.d.ts +43 -3
- package/dist/core/checks/integrity-checks.d.ts.map +1 -1
- package/dist/core/checks/integrity-checks.js +191 -13
- package/dist/core/checks/integrity-checks.js.map +1 -1
- package/dist/core/checks/manifest.d.ts.map +1 -1
- package/dist/core/checks/manifest.js +2 -0
- package/dist/core/checks/manifest.js.map +1 -1
- package/dist/core/checks/organize-checks.d.ts +21 -1
- package/dist/core/checks/organize-checks.d.ts.map +1 -1
- package/dist/core/checks/organize-checks.js +64 -4
- package/dist/core/checks/organize-checks.js.map +1 -1
- package/dist/core/convention-doc.d.ts +32 -0
- package/dist/core/convention-doc.d.ts.map +1 -0
- package/dist/core/convention-doc.js +137 -0
- package/dist/core/convention-doc.js.map +1 -0
- package/dist/core/conventions.d.ts +25 -5
- package/dist/core/conventions.d.ts.map +1 -1
- package/dist/core/conventions.js +65 -3
- package/dist/core/conventions.js.map +1 -1
- package/dist/core/disclosure/model.d.ts +11 -0
- package/dist/core/disclosure/model.d.ts.map +1 -1
- package/dist/core/disclosure/model.js +24 -0
- package/dist/core/disclosure/model.js.map +1 -1
- package/dist/core/errors.d.ts +27 -41
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +76 -119
- package/dist/core/errors.js.map +1 -1
- package/dist/core/fs/fenced-region.d.ts +38 -0
- package/dist/core/fs/fenced-region.d.ts.map +1 -1
- package/dist/core/fs/fenced-region.js +88 -2
- package/dist/core/fs/fenced-region.js.map +1 -1
- package/dist/core/git/repo.d.ts +0 -6
- package/dist/core/git/repo.d.ts.map +1 -1
- package/dist/core/git/repo.js +0 -13
- package/dist/core/git/repo.js.map +1 -1
- package/dist/core/git/worktree.d.ts +4 -7
- package/dist/core/git/worktree.d.ts.map +1 -1
- package/dist/core/git/worktree.js +4 -10
- package/dist/core/git/worktree.js.map +1 -1
- package/dist/core/graph/model.d.ts +14 -0
- package/dist/core/graph/model.d.ts.map +1 -1
- package/dist/core/graph/model.js +30 -14
- package/dist/core/graph/model.js.map +1 -1
- package/dist/core/harness/bridge.d.ts +30 -0
- package/dist/core/harness/bridge.d.ts.map +1 -0
- package/dist/core/harness/bridge.js +178 -0
- package/dist/core/harness/bridge.js.map +1 -0
- package/dist/core/json-config-merge.d.ts.map +1 -1
- package/dist/core/json-config-merge.js +30 -7
- package/dist/core/json-config-merge.js.map +1 -1
- package/dist/core/migrations/archive-destination-from-taxonomy.d.ts +35 -0
- package/dist/core/migrations/archive-destination-from-taxonomy.d.ts.map +1 -0
- package/dist/core/migrations/archive-destination-from-taxonomy.js +109 -0
- package/dist/core/migrations/archive-destination-from-taxonomy.js.map +1 -0
- package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts +19 -0
- package/dist/core/migrations/drop-forge-and-workspaces-external.d.ts.map +1 -0
- package/dist/core/migrations/drop-forge-and-workspaces-external.js +49 -0
- package/dist/core/migrations/drop-forge-and-workspaces-external.js.map +1 -0
- package/dist/core/migrations/registry.d.ts.map +1 -1
- package/dist/core/migrations/registry.js +10 -1
- package/dist/core/migrations/registry.js.map +1 -1
- package/dist/core/migrations/rename-conventions-path.d.ts +26 -0
- package/dist/core/migrations/rename-conventions-path.d.ts.map +1 -0
- package/dist/core/migrations/rename-conventions-path.js +86 -0
- package/dist/core/migrations/rename-conventions-path.js.map +1 -0
- package/dist/core/notes/list.d.ts.map +1 -1
- package/dist/core/notes/list.js +7 -3
- package/dist/core/notes/list.js.map +1 -1
- package/dist/core/publish/script-check.d.ts +12 -0
- package/dist/core/publish/script-check.d.ts.map +1 -0
- package/dist/core/publish/script-check.js +39 -0
- package/dist/core/publish/script-check.js.map +1 -0
- package/dist/core/reconcile.d.ts +3 -0
- package/dist/core/reconcile.d.ts.map +1 -1
- package/dist/core/reconcile.js +43 -6
- package/dist/core/reconcile.js.map +1 -1
- package/dist/core/rollup.d.ts +2 -2
- package/dist/core/rollup.d.ts.map +1 -1
- package/dist/core/rollup.js +24 -3
- package/dist/core/rollup.js.map +1 -1
- package/dist/core/session.d.ts +9 -9
- package/dist/core/session.js +9 -9
- package/dist/core/skills.d.ts +36 -0
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +154 -29
- package/dist/core/skills.js.map +1 -1
- package/dist/core/write-lifecycle/path-gate.d.ts.map +1 -1
- package/dist/core/write-lifecycle/path-gate.js +5 -3
- package/dist/core/write-lifecycle/path-gate.js.map +1 -1
- package/dist/prompt/inquirer-prompter.d.ts.map +1 -1
- package/dist/prompt/inquirer-prompter.js +11 -1
- package/dist/prompt/inquirer-prompter.js.map +1 -1
- package/dist/prompt/prompter.d.ts +16 -0
- package/dist/prompt/prompter.d.ts.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +61 -55
- package/dist/run.js.map +1 -1
- package/dist/taxonomy/profiles.d.ts +11 -0
- package/dist/taxonomy/profiles.d.ts.map +1 -1
- package/dist/taxonomy/profiles.js +1 -0
- package/dist/taxonomy/profiles.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -1
- package/templates/agents/canonical.md +2 -8
- package/templates/agents/{store-conventions.md → conventions.md} +2 -4
- package/templates/agents/mission.md +5 -0
- package/templates/conventions/baseline-conventions.md +60 -0
- package/templates/conventions/house-conventions-seed.md +34 -0
- package/templates/hooks/pre-push.sh +1 -1
- package/templates/serve/shell.html +15 -0
- package/templates/serve/style.css +88 -0
- package/templates/skills/ctxr-land.md +32 -18
- package/templates/skills/ctxr-organize-audit.md +1 -1
- package/templates/skills/ctxr-publish.md +79 -0
- package/templates/skills/ctxr-session-capture.md +44 -1
- package/templates/skills/ctxr-session-lifecycle.md +20 -1
- package/templates/skills/ctxr-submit.md +15 -11
- package/templates/vendor/frontend-design/LICENSE.txt +177 -0
- package/templates/vendor/frontend-design/SKILL.md +55 -0
- package/templates/vendor/frontend-design/provenance.json +7 -0
- package/dist/adapters/forge/github.d.ts +0 -12
- package/dist/adapters/forge/github.d.ts.map +0 -1
- package/dist/adapters/forge/github.js +0 -76
- package/dist/adapters/forge/github.js.map +0 -1
- package/dist/adapters/forge/types.d.ts +0 -46
- package/dist/adapters/forge/types.d.ts.map +0 -1
- package/dist/adapters/forge/types.js +0 -2
- package/dist/adapters/forge/types.js.map +0 -1
- package/dist/commands/session-abandon.d.ts +0 -13
- package/dist/commands/session-abandon.d.ts.map +0 -1
- package/dist/commands/session-abandon.js +0 -22
- package/dist/commands/session-abandon.js.map +0 -1
- package/dist/commands/session-land.d.ts +0 -45
- package/dist/commands/session-land.d.ts.map +0 -1
- package/dist/commands/session-land.js +0 -171
- package/dist/commands/session-land.js.map +0 -1
- package/dist/commands/session-reap.d.ts +0 -22
- package/dist/commands/session-reap.d.ts.map +0 -1
- package/dist/commands/session-reap.js +0 -52
- package/dist/commands/session-reap.js.map +0 -1
- package/dist/commands/session-submit.d.ts +0 -29
- package/dist/commands/session-submit.d.ts.map +0 -1
- package/dist/commands/session-submit.js +0 -72
- package/dist/commands/session-submit.js.map +0 -1
- package/templates/agents/store-conventions-empty.md +0 -7
|
@@ -0,0 +1,49 @@
|
|
|
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: 'strip any legacy kind: forge adapter declarations and the session.workspaces_external key, and set schema_version to 5',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* session-keeps-only-what-git-cannot-do (design D2): `ctxr session
|
|
11
|
+
* submit`/`land`/`abandon`/`reap` and the `forge` adapter kind are removed;
|
|
12
|
+
* `session.workspaces_external` goes with them, its skill-rendering half
|
|
13
|
+
* never having worked as shipped. Both legacy shapes are ALREADY stripped
|
|
14
|
+
* by the time `readConfig` returns — the adapters field's lenient schema
|
|
15
|
+
* transform drops a `kind: forge` entry (session-keeps-only-what-git-cannot-do
|
|
16
|
+
* D2), and `SessionSchema`'s default strip-unknown-keys behavior drops
|
|
17
|
+
* `workspaces_external` — so this migration's only real work is bumping
|
|
18
|
+
* `schema_version` and writing the already-clean config back to disk.
|
|
19
|
+
*
|
|
20
|
+
* Pending-ness is `schema_version < 5`, not key presence — the same rule
|
|
21
|
+
* 0002 and 0004 established, for the same reason: an unmigrated store
|
|
22
|
+
* already parses as though the legacy shape were gone, so its presence in
|
|
23
|
+
* the parsed config can't distinguish migrated from not.
|
|
24
|
+
*/
|
|
25
|
+
export const dropForgeAndWorkspacesExternalMigration = {
|
|
26
|
+
id: '0005-drop-forge-and-workspaces-external',
|
|
27
|
+
fromVersion: 4,
|
|
28
|
+
toVersion: 5,
|
|
29
|
+
description: 'Strip any legacy kind: forge adapter declarations and the session.workspaces_external key from contexture.yaml, and bump schema_version to 5.',
|
|
30
|
+
async plan(store) {
|
|
31
|
+
if (store.config.schema_version >= 5)
|
|
32
|
+
return [];
|
|
33
|
+
return [CONFIG_DELTA];
|
|
34
|
+
},
|
|
35
|
+
async apply(store) {
|
|
36
|
+
if (store.config.schema_version >= 5)
|
|
37
|
+
return [];
|
|
38
|
+
const configPath = path.join(store.root, 'contexture.yaml');
|
|
39
|
+
// readConfig() already applies the lenient schema — a raw `kind: forge`
|
|
40
|
+
// entry and a raw `session.workspaces_external` key are both gone from
|
|
41
|
+
// this object before this line runs; writing it back is what removes
|
|
42
|
+
// them from disk.
|
|
43
|
+
const currentConfig = await readConfig(store.root);
|
|
44
|
+
const nextConfig = { ...currentConfig, schema_version: 5 };
|
|
45
|
+
await writeFileAtomic(configPath, renderStoreConfig(nextConfig));
|
|
46
|
+
return [CONFIG_DELTA];
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=drop-forge-and-workspaces-external.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drop-forge-and-workspaces-external.js","sourceRoot":"","sources":["../../../src/core/migrations/drop-forge-and-workspaces-external.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;AAGlD,MAAM,YAAY,GAAmB;IACnC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,wHAAwH;CACtI,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAc;IAChE,EAAE,EAAE,yCAAyC;IAC7C,WAAW,EAAE,CAAC;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EACT,+IAA+I;IAEjJ,KAAK,CAAC,IAAI,CAAC,KAAK;QACd,IAAI,KAAK,CAAC,MAAM,CAAC,cAAc,IAAI,CAAC;YAAE,OAAO,EAAE,CAAC;QAChD,OAAO,CAAC,YAAY,CAAC,CAAC;IACxB,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,uEAAuE;QACvE,qEAAqE;QACrE,kBAAkB;QAClB,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/core/migrations/registry.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,gHAAgH;AAChH,eAAO,MAAM,UAAU,EAAE,SAAS,SAAS,EAM1C,CAAC;AAEF,qHAAqH;AACrH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,EAAE,CAElE"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { archiveDestinationFromTaxonomyMigration } from './archive-destination-from-taxonomy.js';
|
|
2
|
+
import { dropForgeAndWorkspacesExternalMigration } from './drop-forge-and-workspaces-external.js';
|
|
3
|
+
import { renameConventionsPathMigration } from './rename-conventions-path.js';
|
|
1
4
|
import { renameProceduresPathMigration } from './rename-procedures-path.js';
|
|
2
5
|
import { renameVisibilityFieldMigration } from './rename-visibility-field.js';
|
|
3
6
|
/** Every migration contexture ships, in ascending fromVersion order. Later phases append here, nothing else. */
|
|
4
|
-
export const MIGRATIONS = [
|
|
7
|
+
export const MIGRATIONS = [
|
|
8
|
+
renameVisibilityFieldMigration,
|
|
9
|
+
renameProceduresPathMigration,
|
|
10
|
+
renameConventionsPathMigration,
|
|
11
|
+
dropForgeAndWorkspacesExternalMigration,
|
|
12
|
+
archiveDestinationFromTaxonomyMigration,
|
|
13
|
+
];
|
|
5
14
|
/** Every migration a store currently at `fromVersion` still needs to reach the CLI's supported version, in order. */
|
|
6
15
|
export function pendingMigrations(fromVersion) {
|
|
7
16
|
return MIGRATIONS.filter((m) => m.fromVersion >= fromVersion).slice().sort((a, b) => a.fromVersion - b.fromVersion);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/core/migrations/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAG9E,gHAAgH;AAChH,MAAM,CAAC,MAAM,UAAU,GAAyB,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/core/migrations/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uCAAuC,EAAE,MAAM,wCAAwC,CAAC;AACjG,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,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAG9E,gHAAgH;AAChH,MAAM,CAAC,MAAM,UAAU,GAAyB;IAC9C,8BAA8B;IAC9B,6BAA6B;IAC7B,8BAA8B;IAC9B,uCAAuC;IACvC,uCAAuC;CACxC,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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,yBAAyB,OAAO,yBAAyB,EAAE;KAC5H,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAc;IACvD,EAAE,EAAE,+CAA+C;IACnD,WAAW,EAAE,CAAC;IACd,SAAS,EAAE,CAAC;IACZ,WAAW,EACT,oKAAoK;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;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/core/notes/list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,IAAI;IACnB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACjD,IAAI,EAAE,MAAM,CAAC;CACd;
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../src/core/notes/list.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;;;;;;;;GASG;AACH,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,IAAI;IACnB,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACjD,IAAI,EAAE,MAAM,CAAC;CACd;AA0CD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAYjE;AAkCD,wGAAwG;AACxG,wBAAsB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,GAAE,SAAc,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAO9G"}
|
package/dist/core/notes/list.js
CHANGED
|
@@ -23,7 +23,9 @@ const ALWAYS_SKIP_FILES = new Set(['AGENTS.md']);
|
|
|
23
23
|
*/
|
|
24
24
|
function harnessEntryFiles(config) {
|
|
25
25
|
try {
|
|
26
|
-
return new Set(configuredAdapters(config, 'harness-generation')
|
|
26
|
+
return new Set(configuredAdapters(config, 'harness-generation')
|
|
27
|
+
.map((a) => a.entryFileName)
|
|
28
|
+
.filter((name) => name !== undefined));
|
|
27
29
|
}
|
|
28
30
|
catch {
|
|
29
31
|
return new Set();
|
|
@@ -41,9 +43,11 @@ export function excludedPrefixesFor(config) {
|
|
|
41
43
|
...config.derived.paths,
|
|
42
44
|
config.session.worktrees_path,
|
|
43
45
|
config.catalog.path,
|
|
44
|
-
//
|
|
46
|
+
// Published pages are authored-but-tool-owned output, never a note (context-store spec).
|
|
47
|
+
config.publish.path,
|
|
48
|
+
// Tool-owned instruction docs (skills, guidance) are never notes, wherever they live.
|
|
45
49
|
config.harness.skills_path,
|
|
46
|
-
config.harness.
|
|
50
|
+
config.harness.guidance_path,
|
|
47
51
|
];
|
|
48
52
|
}
|
|
49
53
|
async function walk(dir, root, excludePrefixes, skipRootFiles, results) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/core/notes/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,Y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AAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC;IAC1H,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;AAChH,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ScriptSyntaxError {
|
|
2
|
+
index: number;
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* publish spec: the sole spawn site for `node --check` (single-source-
|
|
7
|
+
* literals guard), the same discipline core/git/exec.ts applies to git and
|
|
8
|
+
* adapters/forge/github.ts applies to gh — one dedicated module per
|
|
9
|
+
* external tool, never ad hoc subprocess spawning scattered across commands.
|
|
10
|
+
*/
|
|
11
|
+
export declare function checkScriptSyntax(scripts: readonly string[]): Promise<ScriptSyntaxError[]>;
|
|
12
|
+
//# sourceMappingURL=script-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-check.d.ts","sourceRoot":"","sources":["../../../src/core/publish/script-check.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAuBhG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { mkdtemp, rm, writeFile } from 'node:fs/promises';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
/**
|
|
8
|
+
* publish spec: the sole spawn site for `node --check` (single-source-
|
|
9
|
+
* literals guard), the same discipline core/git/exec.ts applies to git and
|
|
10
|
+
* adapters/forge/github.ts applies to gh — one dedicated module per
|
|
11
|
+
* external tool, never ad hoc subprocess spawning scattered across commands.
|
|
12
|
+
*/
|
|
13
|
+
export async function checkScriptSyntax(scripts) {
|
|
14
|
+
if (scripts.length === 0)
|
|
15
|
+
return [];
|
|
16
|
+
const dir = await mkdtemp(path.join(tmpdir(), 'ctxr-publish-check-'));
|
|
17
|
+
try {
|
|
18
|
+
const errors = [];
|
|
19
|
+
for (const [index, script] of scripts.entries()) {
|
|
20
|
+
const file = path.join(dir, `block-${index}.js`);
|
|
21
|
+
await writeFile(file, script, 'utf8');
|
|
22
|
+
try {
|
|
23
|
+
await execFileAsync(process.execPath, ['--check', file]);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
const stderr = err instanceof Error && 'stderr' in err ? String(err.stderr) : String(err);
|
|
27
|
+
const lines = stderr.trim().split('\n');
|
|
28
|
+
const location = lines[0] ?? '';
|
|
29
|
+
const errorLine = lines.find((line) => /Error:/.test(line)) ?? lines[lines.length - 1] ?? '';
|
|
30
|
+
errors.push({ index, message: `${location} — ${errorLine}`.trim() });
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return errors;
|
|
34
|
+
}
|
|
35
|
+
finally {
|
|
36
|
+
await rm(dir, { recursive: true, force: true });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=script-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-check.js","sourceRoot":"","sources":["../../../src/core/publish/script-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kB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ChC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC7F,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,QAAQ,MAAM,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;AACH,CAAC"}
|
package/dist/core/reconcile.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { StoreConfig } from '../config/schema.js';
|
|
2
2
|
import type { RunEnv } from './env.js';
|
|
3
|
+
import type { Finding } from './envelope.js';
|
|
3
4
|
export declare const WORKTREES_GITIGNORE_FENCE: import("./markers.js").Fence;
|
|
4
5
|
export interface ReconcileResult {
|
|
5
6
|
/** Store-relative paths written this run (an up-to-date store yields none). */
|
|
6
7
|
changed: string[];
|
|
8
|
+
/** e.g. a vendored skill left in place because it was modified locally. */
|
|
9
|
+
findings: Finding[];
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Brings every contexture-OWNED file in a store to the installed package's
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../src/core/reconcile.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"reconcile.d.ts","sourceRoot":"","sources":["../../src/core/reconcile.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAWvC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAQ7C,eAAO,MAAM,yBAAyB,8BAA4B,CAAC;AAwBnE,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CA6D7G"}
|
package/dist/core/reconcile.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { DEFAULT_BASELINE_CONVENTIONS_FILE_NAME } from '../config/defaults.js';
|
|
3
|
+
import { CLI_VERSION } from '../version.js';
|
|
4
|
+
import { agentsMdPath, AGENTS_MD_SECTION_ORDER, buildAgentsCanonicalSection, buildAgentsCaptureSection, buildAgentsConventionsSection, buildAgentsLegRoutingSection, buildAgentsMissionSection, buildAgentsPlacementSection, } from './agents-doc.js';
|
|
5
|
+
import { syncBaselineConventions } from './convention-doc.js';
|
|
6
|
+
import { removeFencedRegionFromFile, reorderFencedRegionsInFile, upsertFencedRegionInFile } from './fs/fenced-region.js';
|
|
7
|
+
import { bridgeHarnessSkills } from './harness/bridge.js';
|
|
4
8
|
import { configureHooksPath, installHooks } from './hooks.js';
|
|
5
9
|
import { commentFence, DERIVED_GITIGNORE_FENCE, htmlCommentFence } from './markers.js';
|
|
6
|
-
import { syncShippedSkills } from './skills.js';
|
|
10
|
+
import { syncShippedSkills, syncVendoredSkills } from './skills.js';
|
|
7
11
|
export const WORKTREES_GITIGNORE_FENCE = commentFence('worktrees');
|
|
8
12
|
/**
|
|
9
13
|
* remove-agent-identity: AGENTS.md's old "Agent identity" section is an
|
|
@@ -15,6 +19,16 @@ export const WORKTREES_GITIGNORE_FENCE = commentFence('worktrees');
|
|
|
15
19
|
* contexture issue #14 tracks.
|
|
16
20
|
*/
|
|
17
21
|
const RETIRED_AGENTS_MD_IDENTITY_FENCE = htmlCommentFence('agent-identity');
|
|
22
|
+
/**
|
|
23
|
+
* compose-store-guidance-documents: the conventions fence was renamed from
|
|
24
|
+
* `store-conventions` to `conventions` (dropping the redundant "store-"
|
|
25
|
+
* prefix — every sibling fence/template already omits it, e.g. `canonical`,
|
|
26
|
+
* `placement`, `mission`). Same one-time cleanup shape as the identity
|
|
27
|
+
* retirement above: `buildAgentsConventionsSection` already writes the new
|
|
28
|
+
* `contexture:conventions` fence via the loop below, so this only needs to
|
|
29
|
+
* remove the orphaned old one.
|
|
30
|
+
*/
|
|
31
|
+
const RETIRED_AGENTS_MD_STORE_CONVENTIONS_FENCE = htmlCommentFence('store-conventions');
|
|
18
32
|
/**
|
|
19
33
|
* Brings every contexture-OWNED file in a store to the installed package's
|
|
20
34
|
* version: the managed .gitignore blocks, every generated AGENTS.md
|
|
@@ -32,15 +46,30 @@ export async function reconcileStore(env, root, config) {
|
|
|
32
46
|
const gitignorePath = path.join(root, '.gitignore');
|
|
33
47
|
note('.gitignore', (await upsertFencedRegionInFile(gitignorePath, DERIVED_GITIGNORE_FENCE, config.derived.paths)).changed);
|
|
34
48
|
note('.gitignore', (await upsertFencedRegionInFile(gitignorePath, WORKTREES_GITIGNORE_FENCE, [config.session.worktrees_path])).changed);
|
|
35
|
-
//
|
|
36
|
-
//
|
|
49
|
+
// The owned skill copies are refreshed unconditionally here — not because
|
|
50
|
+
// any AGENTS.md section reads them anymore (inline-conventions-and-mission
|
|
51
|
+
// removed the skill index), but because init/update must still deliver
|
|
52
|
+
// the skill files to disk regardless of what AGENTS.md renders.
|
|
37
53
|
changed.push(...(await syncShippedSkills(root, config)));
|
|
54
|
+
const vendoredResult = await syncVendoredSkills(root, config, CLI_VERSION);
|
|
55
|
+
changed.push(...vendoredResult.changed);
|
|
56
|
+
const findings = [...vendoredResult.findings];
|
|
57
|
+
// Bridges every declared harness's skills directory to the canonical
|
|
58
|
+
// path (creating, or repairing a broken one) — after the skills
|
|
59
|
+
// themselves are current, so a freshly created bridge or copy reflects
|
|
60
|
+
// this run's content, not a stale one.
|
|
61
|
+
changed.push(...(await bridgeHarnessSkills(root, config)).map((r) => r.path));
|
|
62
|
+
// Same reason, same ordering constraint as skills: the shipped baseline
|
|
63
|
+
// convention file must be current on disk BEFORE buildAgentsConventionsSection
|
|
64
|
+
// scans the guidance directory and inlines it (compose-store-guidance-documents).
|
|
65
|
+
note(path.join(config.harness.guidance_path, DEFAULT_BASELINE_CONVENTIONS_FILE_NAME).split(path.sep).join('/'), (await syncBaselineConventions(root, config)).changed);
|
|
38
66
|
let agentsChanged = false;
|
|
39
67
|
for (const build of [
|
|
40
68
|
buildAgentsLegRoutingSection,
|
|
41
69
|
buildAgentsCaptureSection,
|
|
42
70
|
buildAgentsPlacementSection,
|
|
43
71
|
buildAgentsCanonicalSection,
|
|
72
|
+
buildAgentsMissionSection,
|
|
44
73
|
buildAgentsConventionsSection,
|
|
45
74
|
]) {
|
|
46
75
|
if ((await build(root, config)).changed)
|
|
@@ -48,10 +77,18 @@ export async function reconcileStore(env, root, config) {
|
|
|
48
77
|
}
|
|
49
78
|
if ((await removeFencedRegionFromFile(agentsMdPath(root), RETIRED_AGENTS_MD_IDENTITY_FENCE)).changed)
|
|
50
79
|
agentsChanged = true;
|
|
80
|
+
if ((await removeFencedRegionFromFile(agentsMdPath(root), RETIRED_AGENTS_MD_STORE_CONVENTIONS_FENCE)).changed)
|
|
81
|
+
agentsChanged = true;
|
|
82
|
+
// harness-portability spec "Generated sections render in a fixed order":
|
|
83
|
+
// reorders once every section fence above has been written/refreshed, so
|
|
84
|
+
// a first-time init and a subsequent update converge on the same layout.
|
|
85
|
+
// A no-op when the fences aren't all contiguous — see `reorderFencedRegions`.
|
|
86
|
+
if ((await reorderFencedRegionsInFile(agentsMdPath(root), AGENTS_MD_SECTION_ORDER)).changed)
|
|
87
|
+
agentsChanged = true;
|
|
51
88
|
note('AGENTS.md', agentsChanged);
|
|
52
89
|
const { changed: hookFiles } = await installHooks(root, config.git.default_branch);
|
|
53
90
|
changed.push(...hookFiles);
|
|
54
91
|
await configureHooksPath(env.git, root);
|
|
55
|
-
return { changed: [...new Set(changed)] };
|
|
92
|
+
return { changed: [...new Set(changed)], findings };
|
|
56
93
|
}
|
|
57
94
|
//# sourceMappingURL=reconcile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../../src/core/reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../../src/core/reconcile.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,sCAAsC,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,6BAA6B,EAC7B,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACzH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,M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I,CAAC,MAAM,0BAA0B,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,OAAO;QAAE,aAAa,GAAG,IAAI,CAAC;IAClH,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAEjC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACnF,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;IAC3B,MAAM,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAExC,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;AACtD,CAAC"}
|
package/dist/core/rollup.d.ts
CHANGED
|
@@ -35,8 +35,8 @@ export declare function checkRollupStaleness(git: GitRunner, root: string, entit
|
|
|
35
35
|
export declare function checkMissionStaleness(note: Note, staleDays: number, now: Date): StaleRollupEntry | null;
|
|
36
36
|
/**
|
|
37
37
|
* Every entity with a rollup section (optionally narrowed to one), reported
|
|
38
|
-
* stale per `checkRollupStaleness`, plus — when `missionPath` names a
|
|
39
|
-
* that exists
|
|
38
|
+
* stale per `checkRollupStaleness`, plus — when `missionPath` names a
|
|
39
|
+
* document that exists on disk — that one path via `checkMissionStaleness`
|
|
40
40
|
* instead of the backlink-based entity scan, even when it carries no
|
|
41
41
|
* `ROLLUP_FENCE` yet (an unwritten mission document must surface as
|
|
42
42
|
* needing its first write, not be silently excluded by `hasRollupSection`).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.d.ts","sourceRoot":"","sources":["../../src/core/rollup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAi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AgB,EAAE,CAAC,CAsB7B"}
|
package/dist/core/rollup.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { extractLinkTargets } from './graph/model.js';
|
|
3
3
|
import { htmlCommentFence } from './markers.js';
|
|
4
|
+
import { parseNote } from './notes/parse.js';
|
|
4
5
|
/** The single fenced region `rollup write` writes into, and the frontmatter timestamp it stamps alongside it. */
|
|
5
6
|
export const ROLLUP_FENCE = htmlCommentFence('rollup');
|
|
6
7
|
export const ROLLED_UP_FIELD = 'rolled_up';
|
|
@@ -67,10 +68,30 @@ export function checkMissionStaleness(note, staleDays, now) {
|
|
|
67
68
|
return null;
|
|
68
69
|
return { entity: note.path, rolledUp, newestBacklink: null };
|
|
69
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* compose-store-guidance-documents: the mission document typically lives
|
|
73
|
+
* under the guidance directory, which is excluded from the store's note
|
|
74
|
+
* listing (tool-owned instruction docs are never notes — see
|
|
75
|
+
* `excludedPrefixesFor`), so it is read directly by path here rather than
|
|
76
|
+
* looked up in the `notes` array `findStaleRollups` already has. A missing
|
|
77
|
+
* file (never seeded, or a hand-configured path that doesn't exist yet)
|
|
78
|
+
* yields no candidate, the same as the old array-lookup did when nothing
|
|
79
|
+
* matched.
|
|
80
|
+
*/
|
|
81
|
+
async function readMissionNote(root, missionPath) {
|
|
82
|
+
try {
|
|
83
|
+
return await parseNote(path.join(root, missionPath), missionPath);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
if (err.code === 'ENOENT')
|
|
87
|
+
return null;
|
|
88
|
+
throw err;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
70
91
|
/**
|
|
71
92
|
* Every entity with a rollup section (optionally narrowed to one), reported
|
|
72
|
-
* stale per `checkRollupStaleness`, plus — when `missionPath` names a
|
|
73
|
-
* that exists
|
|
93
|
+
* stale per `checkRollupStaleness`, plus — when `missionPath` names a
|
|
94
|
+
* document that exists on disk — that one path via `checkMissionStaleness`
|
|
74
95
|
* instead of the backlink-based entity scan, even when it carries no
|
|
75
96
|
* `ROLLUP_FENCE` yet (an unwritten mission document must surface as
|
|
76
97
|
* needing its first write, not be silently excluded by `hasRollupSection`).
|
|
@@ -88,7 +109,7 @@ export async function findStaleRollups(git, root, notes, options = {}, staleDays
|
|
|
88
109
|
byPath.set(entry.entity, entry);
|
|
89
110
|
}
|
|
90
111
|
if (options.missionPath && (!options.entity || options.entity === options.missionPath)) {
|
|
91
|
-
const missionNote =
|
|
112
|
+
const missionNote = await readMissionNote(root, options.missionPath);
|
|
92
113
|
if (missionNote) {
|
|
93
114
|
const entry = checkMissionStaleness(missionNote, staleDays, now);
|
|
94
115
|
// The mission rule OWNS this path once configured: it overrides the
|
package/dist/core/rollup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../src/core/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"rollup.js","sourceRoot":"","sources":["../../src/core/rollup.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,iHAAiH;AACjH,MAAM,CAAC,MAAM,YAAY,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;AAE3C,MAAM,UAAU,gBAAgB,CAAC,IAAU;IACzC,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY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ig } from '../config/schema.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* write-lifecycle spec: session branch names are prefixed (configurable —
|
|
4
4
|
* default "session/") and unique. Sortable by creation time, since that's
|
|
5
|
-
* useful for
|
|
5
|
+
* useful for `session list`'s ordering without needing to consult git history.
|
|
6
6
|
*/
|
|
7
7
|
export declare function generateSessionBranchName(config: StoreConfig, now?: Date): string;
|
|
8
8
|
export declare function isSessionBranch(config: StoreConfig, branch: string): boolean;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* write-lifecycle spec: a worktree is ALSO recognized as a session by where
|
|
11
|
+
* it lives, not only by its branch's name — the `ctxr-submit` skill may
|
|
12
|
+
* rename a session's branch by hand (`git branch -m <name>`) before it
|
|
13
|
+
* reaches the forge, out from under the configured prefix, and a renamed
|
|
14
|
+
* session must stay recognizable to `session list`.
|
|
14
15
|
*
|
|
15
16
|
* Deliberately independent of any particular `store.root`: the worktree's
|
|
16
17
|
* OWN path shape is the durable identity — its immediate parent directory
|
|
17
|
-
* is named after the configured worktrees path — because
|
|
18
|
-
*
|
|
19
|
-
* would
|
|
20
|
-
* would make a storeRoot-relative comparison meaningless.
|
|
18
|
+
* is named after the configured worktrees path — because a caller checking
|
|
19
|
+
* this may itself be running from inside the very worktree in question,
|
|
20
|
+
* which would make a storeRoot-relative comparison meaningless.
|
|
21
21
|
*/
|
|
22
22
|
export declare function isSessionWorktreePath(config: StoreConfig, worktreePath: string): boolean;
|
|
23
23
|
/** A branch name may contain "/"; a directory name may not treat that as a separator. */
|
package/dist/core/session.js
CHANGED
|
@@ -3,7 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
/**
|
|
4
4
|
* write-lifecycle spec: session branch names are prefixed (configurable —
|
|
5
5
|
* default "session/") and unique. Sortable by creation time, since that's
|
|
6
|
-
* useful for
|
|
6
|
+
* useful for `session list`'s ordering without needing to consult git history.
|
|
7
7
|
*/
|
|
8
8
|
export function generateSessionBranchName(config, now = new Date()) {
|
|
9
9
|
const stamp = now
|
|
@@ -18,17 +18,17 @@ export function isSessionBranch(config, branch) {
|
|
|
18
18
|
return branch.startsWith(config.session.branch_prefix);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
21
|
+
* write-lifecycle spec: a worktree is ALSO recognized as a session by where
|
|
22
|
+
* it lives, not only by its branch's name — the `ctxr-submit` skill may
|
|
23
|
+
* rename a session's branch by hand (`git branch -m <name>`) before it
|
|
24
|
+
* reaches the forge, out from under the configured prefix, and a renamed
|
|
25
|
+
* session must stay recognizable to `session list`.
|
|
25
26
|
*
|
|
26
27
|
* Deliberately independent of any particular `store.root`: the worktree's
|
|
27
28
|
* OWN path shape is the durable identity — its immediate parent directory
|
|
28
|
-
* is named after the configured worktrees path — because
|
|
29
|
-
*
|
|
30
|
-
* would
|
|
31
|
-
* would make a storeRoot-relative comparison meaningless.
|
|
29
|
+
* is named after the configured worktrees path — because a caller checking
|
|
30
|
+
* this may itself be running from inside the very worktree in question,
|
|
31
|
+
* which would make a storeRoot-relative comparison meaningless.
|
|
32
32
|
*/
|
|
33
33
|
export function isSessionWorktreePath(config, worktreePath) {
|
|
34
34
|
const worktreesDirName = path.basename(config.session.worktrees_path);
|