ctxr-cli 0.3.0 → 0.4.1
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/adapters/harness/claude-code.d.ts +0 -6
- package/dist/adapters/harness/claude-code.d.ts.map +1 -1
- package/dist/adapters/harness/claude-code.js +44 -25
- package/dist/adapters/harness/claude-code.js.map +1 -1
- package/dist/adapters/types.d.ts +28 -9
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/commands/adapters-generate.d.ts.map +1 -1
- package/dist/commands/adapters-generate.js +16 -7
- package/dist/commands/adapters-generate.js.map +1 -1
- package/dist/commands/adapters-write-gate.d.ts +20 -0
- package/dist/commands/adapters-write-gate.d.ts.map +1 -0
- package/dist/commands/adapters-write-gate.js +77 -0
- package/dist/commands/adapters-write-gate.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -7
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/rollup-stale.d.ts.map +1 -1
- package/dist/commands/rollup-stale.js +1 -1
- package/dist/commands/rollup-stale.js.map +1 -1
- package/dist/commands/session-land.d.ts.map +1 -1
- package/dist/commands/session-land.js +55 -24
- package/dist/commands/session-land.js.map +1 -1
- package/dist/commands/session-reap.d.ts.map +1 -1
- package/dist/commands/session-reap.js +4 -0
- package/dist/commands/session-reap.js.map +1 -1
- package/dist/commands/verify.js +17 -17
- package/dist/commands/verify.js.map +1 -1
- package/dist/config/defaults.d.ts +4 -2
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +4 -2
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/schema.d.ts +20 -4
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +53 -4
- package/dist/config/schema.js.map +1 -1
- package/dist/core/agents-doc.d.ts +13 -9
- package/dist/core/agents-doc.d.ts.map +1 -1
- package/dist/core/agents-doc.js +69 -107
- package/dist/core/agents-doc.js.map +1 -1
- package/dist/core/checks/integrity-checks.d.ts +14 -0
- package/dist/core/checks/integrity-checks.d.ts.map +1 -1
- package/dist/core/checks/integrity-checks.js +77 -1
- package/dist/core/checks/integrity-checks.js.map +1 -1
- package/dist/core/conventions.d.ts +1 -1
- package/dist/core/errors.d.ts +9 -0
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +18 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/git/repo.d.ts +10 -0
- package/dist/core/git/repo.d.ts.map +1 -1
- package/dist/core/git/repo.js +28 -0
- package/dist/core/git/repo.js.map +1 -1
- package/dist/core/git/worktree.d.ts +8 -0
- package/dist/core/git/worktree.d.ts.map +1 -1
- package/dist/core/git/worktree.js +11 -0
- package/dist/core/git/worktree.js.map +1 -1
- package/dist/core/hooks.d.ts +10 -0
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/hooks.js +37 -10
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/json-config-merge.d.ts +26 -2
- package/dist/core/json-config-merge.d.ts.map +1 -1
- package/dist/core/json-config-merge.js +61 -7
- package/dist/core/json-config-merge.js.map +1 -1
- package/dist/core/markers.d.ts +7 -0
- package/dist/core/markers.d.ts.map +1 -1
- package/dist/core/markers.js +9 -0
- package/dist/core/markers.js.map +1 -1
- package/dist/core/migrations/registry.d.ts.map +1 -1
- package/dist/core/migrations/registry.js +2 -1
- package/dist/core/migrations/registry.js.map +1 -1
- package/dist/core/migrations/rename-procedures-path.d.ts +17 -0
- package/dist/core/migrations/rename-procedures-path.d.ts.map +1 -0
- package/dist/core/migrations/rename-procedures-path.js +45 -0
- package/dist/core/migrations/rename-procedures-path.js.map +1 -0
- package/dist/core/notes/list.d.ts.map +1 -1
- package/dist/core/notes/list.js +9 -5
- package/dist/core/notes/list.js.map +1 -1
- package/dist/core/reconcile.js +2 -2
- package/dist/core/reconcile.js.map +1 -1
- package/dist/core/rollup.d.ts +25 -2
- package/dist/core/rollup.d.ts.map +1 -1
- package/dist/core/rollup.js +51 -5
- package/dist/core/rollup.js.map +1 -1
- package/dist/core/{procedures.d.ts → skills.d.ts} +12 -12
- package/dist/core/skills.d.ts.map +1 -0
- package/dist/core/{procedures.js → skills.js} +55 -41
- package/dist/core/skills.js.map +1 -0
- package/dist/core/templates.d.ts +20 -0
- package/dist/core/templates.d.ts.map +1 -0
- package/dist/core/templates.js +68 -0
- package/dist/core/templates.js.map +1 -0
- package/dist/core/write-lifecycle/path-gate.d.ts +28 -0
- package/dist/core/write-lifecycle/path-gate.d.ts.map +1 -1
- package/dist/core/write-lifecycle/path-gate.js +78 -22
- package/dist/core/write-lifecycle/path-gate.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +12 -1
- package/dist/run.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/templates/agents/canonical.md +26 -0
- package/templates/agents/capture-and-ingest.md +17 -0
- package/templates/agents/placement-no-layers.md +5 -0
- package/templates/agents/placement.md +7 -0
- package/templates/agents/retrieval-leg-routing.md +14 -0
- package/templates/agents/store-conventions-empty.md +7 -0
- package/templates/agents/store-conventions.md +7 -0
- package/templates/hooks/claude-code-write-gate.sh +15 -0
- package/templates/skills/ctxr-connection-finding.md +1 -1
- package/templates/skills/ctxr-ingest-orchestration.md +1 -1
- package/templates/skills/ctxr-land.md +11 -6
- package/templates/skills/ctxr-mission.md +36 -0
- package/templates/skills/ctxr-session-lifecycle.md +1 -2
- package/dist/core/procedures.d.ts.map +0 -1
- package/dist/core/procedures.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { StoreConfig } from '../config/schema.js';
|
|
2
2
|
import { type ScannedDoc } from './conventions.js';
|
|
3
|
+
export declare function agentsMdPath(root: string): string;
|
|
3
4
|
/**
|
|
4
5
|
* context-retrieval spec (task 4.5): the leg-routing rule that tells an
|
|
5
6
|
* agent which of its two retrieval legs to use for a given question — the
|
|
6
7
|
* catalog/graph (contexture-built-and-maintained) or its own direct content
|
|
7
8
|
* matching (grep, scoped by the store's declared exclusion paths). This is
|
|
8
9
|
* one fenced region within AGENTS.md; Phase 8 adds the canonical template's
|
|
9
|
-
* other sections (root-resolution, frontmatter schema, write-path,
|
|
10
|
+
* other sections (root-resolution, frontmatter schema, write-path, skill
|
|
10
11
|
* index) as sibling regions in the same file, never touching this one.
|
|
11
12
|
*/
|
|
12
13
|
export declare const AGENTS_MD_LEG_ROUTING_FENCE: import("./markers.js").Fence;
|
|
13
|
-
export declare function agentsMdPath(root: string): string;
|
|
14
14
|
export declare function renderLegRoutingSection(config: StoreConfig): string[];
|
|
15
15
|
/** Idempotently reconciles AGENTS.md's leg-routing section from current config — called at init and on re-init. */
|
|
16
16
|
export declare function buildAgentsLegRoutingSection(root: string, config: StoreConfig): Promise<{
|
|
@@ -30,12 +30,14 @@ export declare function buildAgentsCaptureSection(root: string, config: StoreCon
|
|
|
30
30
|
changed: boolean;
|
|
31
31
|
}>;
|
|
32
32
|
/**
|
|
33
|
-
* context-organize spec (task 7.1): the placement
|
|
34
|
-
*
|
|
35
|
-
* hardcoded layout —
|
|
33
|
+
* context-organize spec (task 7.1): the placement skill's documentation is
|
|
34
|
+
* driven entirely by the configured taxonomy, never a
|
|
35
|
+
* hardcoded layout — the layer list is generated purely from
|
|
36
36
|
* `config.taxonomy.layers`, so it reads correctly under PARA, Zettelkasten,
|
|
37
37
|
* Diátaxis, or any custom taxonomy without a single layer name appearing in
|
|
38
|
-
* this file's own source.
|
|
38
|
+
* this file's own source. A store with no declared layers gets its own
|
|
39
|
+
* template rather than a swapped-out middle, so both variants read as
|
|
40
|
+
* complete documents.
|
|
39
41
|
*/
|
|
40
42
|
export declare const AGENTS_MD_PLACEMENT_FENCE: import("./markers.js").Fence;
|
|
41
43
|
export declare function renderPlacementSection(config: StoreConfig): string[];
|
|
@@ -45,12 +47,12 @@ export declare function buildAgentsPlacementSection(root: string, config: StoreC
|
|
|
45
47
|
/**
|
|
46
48
|
* harness-portability spec (task 8.5): the canonical template's four
|
|
47
49
|
* required pieces — root-resolution rule, frontmatter schema pointer,
|
|
48
|
-
* write-path rule, and a
|
|
50
|
+
* write-path rule, and a skill index — so an agent that has read only
|
|
49
51
|
* this file, with no harness-specific context, has everything it needs
|
|
50
52
|
* (the spec's own "Reading only AGENTS.md is sufficient" scenario).
|
|
51
53
|
*/
|
|
52
54
|
export declare const AGENTS_MD_CANONICAL_FENCE: import("./markers.js").Fence;
|
|
53
|
-
export declare function renderCanonicalSection(config: StoreConfig,
|
|
55
|
+
export declare function renderCanonicalSection(config: StoreConfig, skills: readonly ScannedDoc[]): string[];
|
|
54
56
|
export declare function buildAgentsCanonicalSection(root: string, config: StoreConfig): Promise<{
|
|
55
57
|
changed: boolean;
|
|
56
58
|
}>;
|
|
@@ -58,7 +60,9 @@ export declare function buildAgentsCanonicalSection(root: string, config: StoreC
|
|
|
58
60
|
* entry-doc-generation spec: operator conventions as referenced documents.
|
|
59
61
|
* The index lists what is actually on disk at the configured conventions
|
|
60
62
|
* path; contexture ships no seeds here — conventions are definitionally
|
|
61
|
-
* operator-authored, so an empty store
|
|
63
|
+
* operator-authored, so an empty store gets its own template explaining the
|
|
64
|
+
* mechanism. Both templates end with the same harness-specific-note
|
|
65
|
+
* paragraph; a test asserts they stay byte-identical.
|
|
62
66
|
*/
|
|
63
67
|
export declare const AGENTS_MD_CONVENTIONS_FENCE: import("./markers.js").Fence;
|
|
64
68
|
export declare function renderConventionsSection(config: StoreConfig, conventions: readonly ScannedDoc[]): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-doc.d.ts","sourceRoot":"","sources":["../../src/core/agents-doc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"agents-doc.d.ts","sourceRoot":"","sources":["../../src/core/agents-doc.ts"],"names":[],"mappings":"AACA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AAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAGlH;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,2BAA2B,8BAAwC,CAAC;AAEjF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,EAAE,CAW1G;AAED,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAGpH"}
|
package/dist/core/agents-doc.js
CHANGED
|
@@ -3,40 +3,40 @@ import { GRAPH_DOCUMENT_RELATIVE_PATH } from './graph/persist.js';
|
|
|
3
3
|
import { CONFIG_FILE_NAME } from './root.js';
|
|
4
4
|
import { excludedPrefixesFor } from './notes/list.js';
|
|
5
5
|
import { scanConventions } from './conventions.js';
|
|
6
|
-
import {
|
|
6
|
+
import { scanSkills } from './skills.js';
|
|
7
7
|
import { upsertFencedRegionInFile } from './fs/fenced-region.js';
|
|
8
8
|
import { htmlCommentFence } from './markers.js';
|
|
9
|
+
import { packagedTemplate, substituteBlock } from './templates.js';
|
|
10
|
+
/**
|
|
11
|
+
* extract-agents-doc-templates: each generated AGENTS.md section's prose
|
|
12
|
+
* lives in `templates/agents/<fence-slug>.md`, named for the fence it lands
|
|
13
|
+
* in, so the file a reviewer opens and the region it writes share a name.
|
|
14
|
+
* Only genuinely per-store data — the exclusion list, the taxonomy layers,
|
|
15
|
+
* the scanned indexes — is computed here and substituted in.
|
|
16
|
+
*/
|
|
17
|
+
function agentsTemplate(name) {
|
|
18
|
+
return packagedTemplate('agents', name);
|
|
19
|
+
}
|
|
20
|
+
/** The one index-entry format both the skill and convention indexes use. */
|
|
21
|
+
function docIndexEntry(doc) {
|
|
22
|
+
return `- [${doc.title}](${doc.path})${doc.description ? ` — ${doc.description}` : ''}`;
|
|
23
|
+
}
|
|
24
|
+
export function agentsMdPath(root) {
|
|
25
|
+
return path.join(root, 'AGENTS.md');
|
|
26
|
+
}
|
|
9
27
|
/**
|
|
10
28
|
* context-retrieval spec (task 4.5): the leg-routing rule that tells an
|
|
11
29
|
* agent which of its two retrieval legs to use for a given question — the
|
|
12
30
|
* catalog/graph (contexture-built-and-maintained) or its own direct content
|
|
13
31
|
* matching (grep, scoped by the store's declared exclusion paths). This is
|
|
14
32
|
* one fenced region within AGENTS.md; Phase 8 adds the canonical template's
|
|
15
|
-
* other sections (root-resolution, frontmatter schema, write-path,
|
|
33
|
+
* other sections (root-resolution, frontmatter schema, write-path, skill
|
|
16
34
|
* index) as sibling regions in the same file, never touching this one.
|
|
17
35
|
*/
|
|
18
36
|
export const AGENTS_MD_LEG_ROUTING_FENCE = htmlCommentFence('retrieval-leg-routing');
|
|
19
|
-
export function agentsMdPath(root) {
|
|
20
|
-
return path.join(root, 'AGENTS.md');
|
|
21
|
-
}
|
|
22
37
|
export function renderLegRoutingSection(config) {
|
|
23
38
|
const exclusions = [...new Set(excludedPrefixesFor(config))];
|
|
24
|
-
return
|
|
25
|
-
'## Retrieval: which leg to use',
|
|
26
|
-
'',
|
|
27
|
-
'contexture builds and maintains two retrieval tools ahead of time — consult them first:',
|
|
28
|
-
'',
|
|
29
|
-
'- **Catalog** (`ctxr catalog show --section <id>`): a curated, coverage-guaranteed index of every retrievable note, one section per taxonomy layer.',
|
|
30
|
-
'- **Graph** (`ctxr graph query ...`): the wikilink graph between notes — neighbors, shortest path, hubs, orphans, clusters, bridges; `--type <relation>` follows one configured relation.',
|
|
31
|
-
`- **Graph document** (\`${GRAPH_DOCUMENT_RELATIVE_PATH}\`, rebuilt by \`ctxr graph build\`): hub notes by cluster, cross-cluster bridges, and orphans — read it for cluster context before writing.`,
|
|
32
|
-
'',
|
|
33
|
-
'For a literal or entity question the catalog and graph do not answer (a specific string, an exact identifier, a phrase),',
|
|
34
|
-
'use your own direct content-matching tool (e.g. grep/ripgrep) against the store, scoped to exclude:',
|
|
35
|
-
'',
|
|
36
|
-
...exclusions.map((prefix) => `- \`${prefix}\``),
|
|
37
|
-
'',
|
|
38
|
-
'There is no `ctxr search` command. Ranked or semantic search is deferred to a future version — do not look for one.',
|
|
39
|
-
];
|
|
39
|
+
return substituteBlock(agentsTemplate('retrieval-leg-routing').replaceAll('__GRAPH_DOCUMENT_PATH__', GRAPH_DOCUMENT_RELATIVE_PATH), '__EXCLUSION_PATHS__', exclusions.map((prefix) => `- \`${prefix}\``)).split('\n');
|
|
40
40
|
}
|
|
41
41
|
/** Idempotently reconciles AGENTS.md's leg-routing section from current config — called at init and on re-init. */
|
|
42
42
|
export async function buildAgentsLegRoutingSection(root, config) {
|
|
@@ -52,61 +52,31 @@ export async function buildAgentsLegRoutingSection(root, config) {
|
|
|
52
52
|
*/
|
|
53
53
|
export const AGENTS_MD_CAPTURE_FENCE = htmlCommentFence('capture-and-ingest');
|
|
54
54
|
export function renderCaptureSection(config) {
|
|
55
|
-
return
|
|
56
|
-
'## Capturing and ingesting new material',
|
|
57
|
-
'',
|
|
58
|
-
`To capture something new, write a plain markdown file directly into \`${config.ingest.inbox_path}\` —`,
|
|
59
|
-
'no CLI command wraps this. That file MUST NOT contain any of these frontmatter fields; contexture assigns',
|
|
60
|
-
'them once, at ingest, and never before:',
|
|
61
|
-
'',
|
|
62
|
-
'- `source_type`',
|
|
63
|
-
'- `source_id`',
|
|
64
|
-
'- `source_hash`',
|
|
65
|
-
'- `ingested`',
|
|
66
|
-
'',
|
|
67
|
-
'Before ingesting, run `ctxr source check <path> --source-id <id>` to get one of four verdicts:',
|
|
68
|
-
'`new`, `already_ingested`, `alternate_source_match`, or `multiple_matches` — the last one means stop and',
|
|
69
|
-
'resolve the ambiguity yourself rather than guessing which existing note it is.',
|
|
70
|
-
'',
|
|
71
|
-
'To ingest, run `ctxr ingest <path> --source-type <type> --source-id <id>`. It stamps the four fields',
|
|
72
|
-
'above onto the file in place and rebuilds the catalog, so the result already has a catalog entry.',
|
|
73
|
-
];
|
|
55
|
+
return agentsTemplate('capture-and-ingest').replaceAll('__INBOX_PATH__', config.ingest.inbox_path).split('\n');
|
|
74
56
|
}
|
|
75
57
|
export async function buildAgentsCaptureSection(root, config) {
|
|
76
58
|
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CAPTURE_FENCE, renderCaptureSection(config));
|
|
77
59
|
}
|
|
78
60
|
/**
|
|
79
|
-
* context-organize spec (task 7.1): the placement
|
|
80
|
-
*
|
|
81
|
-
* hardcoded layout —
|
|
61
|
+
* context-organize spec (task 7.1): the placement skill's documentation is
|
|
62
|
+
* driven entirely by the configured taxonomy, never a
|
|
63
|
+
* hardcoded layout — the layer list is generated purely from
|
|
82
64
|
* `config.taxonomy.layers`, so it reads correctly under PARA, Zettelkasten,
|
|
83
65
|
* Diátaxis, or any custom taxonomy without a single layer name appearing in
|
|
84
|
-
* this file's own source.
|
|
66
|
+
* this file's own source. A store with no declared layers gets its own
|
|
67
|
+
* template rather than a swapped-out middle, so both variants read as
|
|
68
|
+
* complete documents.
|
|
85
69
|
*/
|
|
86
70
|
export const AGENTS_MD_PLACEMENT_FENCE = htmlCommentFence('placement');
|
|
87
71
|
export function renderPlacementSection(config) {
|
|
88
72
|
const { layers } = config.taxonomy;
|
|
89
|
-
if (layers.length === 0)
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
'',
|
|
93
|
-
'This store\'s taxonomy declares no top-level layers — place new notes directly at the store root (or',
|
|
94
|
-
'wherever related notes already live) and rely on wikilinks and `ctxr graph` for organization,',
|
|
95
|
-
'rather than a folder hierarchy.',
|
|
96
|
-
];
|
|
97
|
-
}
|
|
98
|
-
const lines = [
|
|
99
|
-
'## Placing a new note',
|
|
100
|
-
'',
|
|
101
|
-
'This store\'s taxonomy declares these layers — choose the one whose description best matches the note:',
|
|
102
|
-
'',
|
|
103
|
-
];
|
|
104
|
-
for (const layer of layers) {
|
|
73
|
+
if (layers.length === 0)
|
|
74
|
+
return agentsTemplate('placement-no-layers').split('\n');
|
|
75
|
+
const layerLines = layers.map((layer) => {
|
|
105
76
|
const directoryDefault = Object.entries(config.visibility.directory_defaults).find(([prefix]) => prefix === layer.path || prefix === `${layer.path}/`)?.[1];
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return lines;
|
|
77
|
+
return `- **${layer.name}** (\`${layer.path}/\`): ${layer.description}${directoryDefault ? ` Notes here default to visibility "${directoryDefault}" unless given an explicit value.` : ''}`;
|
|
78
|
+
});
|
|
79
|
+
return substituteBlock(agentsTemplate('placement'), '__LAYER_LIST__', layerLines).split('\n');
|
|
110
80
|
}
|
|
111
81
|
export async function buildAgentsPlacementSection(root, config) {
|
|
112
82
|
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_PLACEMENT_FENCE, renderPlacementSection(config));
|
|
@@ -114,67 +84,59 @@ export async function buildAgentsPlacementSection(root, config) {
|
|
|
114
84
|
/**
|
|
115
85
|
* harness-portability spec (task 8.5): the canonical template's four
|
|
116
86
|
* required pieces — root-resolution rule, frontmatter schema pointer,
|
|
117
|
-
* write-path rule, and a
|
|
87
|
+
* write-path rule, and a skill index — so an agent that has read only
|
|
118
88
|
* this file, with no harness-specific context, has everything it needs
|
|
119
89
|
* (the spec's own "Reading only AGENTS.md is sufficient" scenario).
|
|
120
90
|
*/
|
|
121
91
|
export const AGENTS_MD_CANONICAL_FENCE = htmlCommentFence('canonical');
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
'- Disclosure audience tags (optional, hand-written): `audience: [<name>, ...]`.',
|
|
138
|
-
'',
|
|
139
|
-
'### Write path',
|
|
140
|
-
'',
|
|
141
|
-
'Every write to this store happens inside a session worktree, never directly on the default branch: `ctxr ' +
|
|
142
|
-
'session start` creates one, then `ctxr session submit` validates, commits, pushes, and opens (or ' +
|
|
143
|
-
'reports how to open) a pull request. Do not edit files in the store root directly.',
|
|
144
|
-
'',
|
|
145
|
-
'### Procedure index',
|
|
146
|
-
'',
|
|
147
|
-
'Judgment-driven operations, documented as portable markdown under ' +
|
|
148
|
-
`\`${config.harness.procedures_path}\` — read one directly, no harness-specific discovery required:`,
|
|
92
|
+
/**
|
|
93
|
+
* context-organize spec: when `organize.mission_path` is configured, the
|
|
94
|
+
* canonical section names it as a document to load at session start,
|
|
95
|
+
* immediately after the identity-boundary paragraph. Content is written and
|
|
96
|
+
* its staleness reported through the existing rollup mechanism (`ctxr
|
|
97
|
+
* rollup write` / `ctxr rollup stale`) — this pointer only names the path,
|
|
98
|
+
* it names no mechanism of its own. Nothing is rendered when unset: the
|
|
99
|
+
* `__MISSION_POINTER__` template line disappears entirely (via
|
|
100
|
+
* `substituteBlock`'s empty-list case), not a placeholder.
|
|
101
|
+
*/
|
|
102
|
+
function renderMissionPointer(config) {
|
|
103
|
+
const { mission_path: missionPath } = config.organize;
|
|
104
|
+
if (!missionPath)
|
|
105
|
+
return [];
|
|
106
|
+
return [
|
|
149
107
|
'',
|
|
108
|
+
`Load \`${missionPath}\` at the start of every session — this store's standing current-state document, ` +
|
|
109
|
+
'kept current by the mission skill (see the skill index below) and written through `ctxr rollup write`.',
|
|
150
110
|
];
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
111
|
+
}
|
|
112
|
+
export function renderCanonicalSection(config, skills) {
|
|
113
|
+
const text = substituteBlock(agentsTemplate('canonical')
|
|
114
|
+
.replaceAll('__CONFIG_FILE_NAME__', CONFIG_FILE_NAME)
|
|
115
|
+
.replaceAll('__VISIBILITY_FIELD__', config.fields.visibility)
|
|
116
|
+
.replaceAll('__DEFAULT_CONTEXT__', config.visibility.default_context)
|
|
117
|
+
.replaceAll('__SKILLS_PATH__', config.harness.skills_path), '__MISSION_POINTER__', renderMissionPointer(config));
|
|
118
|
+
return substituteBlock(text, '__SKILL_INDEX__', skills.map(docIndexEntry)).split('\n');
|
|
155
119
|
}
|
|
156
120
|
export async function buildAgentsCanonicalSection(root, config) {
|
|
157
|
-
const
|
|
158
|
-
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CANONICAL_FENCE, renderCanonicalSection(config,
|
|
121
|
+
const skills = await scanSkills(root, config);
|
|
122
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CANONICAL_FENCE, renderCanonicalSection(config, skills));
|
|
159
123
|
}
|
|
160
124
|
/**
|
|
161
125
|
* entry-doc-generation spec: operator conventions as referenced documents.
|
|
162
126
|
* The index lists what is actually on disk at the configured conventions
|
|
163
127
|
* path; contexture ships no seeds here — conventions are definitionally
|
|
164
|
-
* operator-authored, so an empty store
|
|
128
|
+
* operator-authored, so an empty store gets its own template explaining the
|
|
129
|
+
* mechanism. Both templates end with the same harness-specific-note
|
|
130
|
+
* paragraph; a test asserts they stay byte-identical.
|
|
165
131
|
*/
|
|
166
132
|
export const AGENTS_MD_CONVENTIONS_FENCE = htmlCommentFence('store-conventions');
|
|
167
133
|
export function renderConventionsSection(config, conventions) {
|
|
168
|
-
const lines = ['## Store conventions', ''];
|
|
169
134
|
if (conventions.length === 0) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
lines.push('Operator-authored conventions for this store — read the ones relevant to your task:', '');
|
|
174
|
-
for (const doc of conventions) {
|
|
175
|
-
lines.push(`- [${doc.title}](${doc.path})${doc.description ? ` — ${doc.description}` : ''}`);
|
|
135
|
+
return agentsTemplate('store-conventions-empty')
|
|
136
|
+
.replaceAll('__CONVENTIONS_PATH__', config.harness.conventions_path)
|
|
137
|
+
.split('\n');
|
|
176
138
|
}
|
|
177
|
-
return
|
|
139
|
+
return substituteBlock(agentsTemplate('store-conventions'), '__CONVENTION_INDEX__', conventions.map(docIndexEntry)).split('\n');
|
|
178
140
|
}
|
|
179
141
|
export async function buildAgentsConventionsSection(root, config) {
|
|
180
142
|
const conventions = await scanConventions(root, config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-doc.js","sourceRoot":"","sources":["../../src/core/agents-doc.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"agents-doc.js","sourceRoot":"","sources":["../../src/core/agents-doc.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,4BAA4B,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAmB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEnE;;;;;;GAMG;AACH,SAAS,cAAc,CAAC,IAAY;IAClC,OAAO,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,4EAA4E;AAC5E,SAAS,aAAa,CAAC,GAAe;IACpC,OAAO,MAAM,GAAG,CAAC,KAAK,KAAK,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,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;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;AAEjF,MAAM,UAAU,wBAAwB,CAAC,MAAmB,EAAE,WAAkC;IAC9F,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,cAAc,CAAC,yBAAyB,CAAC;aAC7C,UAAU,CAAC,sBAAsB,EAAE,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;aACnE,KAAK,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IACD,OAAO,eAAe,CACpB,cAAc,CAAC,mBAAmB,CAAC,EACnC,sBAAsB,EACtB,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAC/B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,6BAA6B,CAAC,IAAY,EAAE,MAAmB;IACnF,MAAM,WAAW,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxD,OAAO,wBAAwB,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,2BAA2B,EAAE,wBAAwB,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC;AAClI,CAAC"}
|
|
@@ -19,6 +19,20 @@ export declare const graphDanglingLinksCheck: import("./types.js").CheckDefiniti
|
|
|
19
19
|
export declare const schemaVersionCurrencyCheck: import("./types.js").CheckDefinition;
|
|
20
20
|
/** store-integrity spec: "adapter compatibility (per adapters)." */
|
|
21
21
|
export declare const adapterCompatibilityCheck: import("./types.js").CheckDefinition;
|
|
22
|
+
/**
|
|
23
|
+
* harness-portability spec: "A harness-specific entry file only imports" —
|
|
24
|
+
* SHALL contain nothing beyond the adapter's own managed import plus that
|
|
25
|
+
* harness's own extras, and SHALL NOT duplicate canonical content. Exact
|
|
26
|
+
* prose duplication is undecidable to check in general (paraphrase, partial
|
|
27
|
+
* copy, reordering), so this catches the concrete failure mode the
|
|
28
|
+
* requirement is aimed at: a section heading also present in AGENTS.md,
|
|
29
|
+
* copy-pasted into the entry file outside its managed fence — the way an
|
|
30
|
+
* operator reaching for "where do I put a Claude-only note" might otherwise
|
|
31
|
+
* duplicate a whole AGENTS.md section into CLAUDE.md instead of writing a
|
|
32
|
+
* harness-specific extra beneath the import (see the `store-conventions`
|
|
33
|
+
* fence's own guidance in `agents-doc.ts`).
|
|
34
|
+
*/
|
|
35
|
+
export declare const harnessEntryNoDuplicateConventionTextCheck: import("./types.js").CheckDefinition;
|
|
22
36
|
/** store-integrity spec: "no unrecognized top-level config keys." */
|
|
23
37
|
export declare const noUnrecognizedConfigKeysCheck: import("./types.js").CheckDefinition;
|
|
24
38
|
export declare const INTEGRITY_CHECKS: import("./types.js").CheckDefinition[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrity-checks.d.ts","sourceRoot":"","sources":["../../../src/core/checks/integrity-checks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integrity-checks.d.ts","sourceRoot":"","sources":["../../../src/core/checks/integrity-checks.ts"],"names":[],"mappings":"AAwBA;;;;;;;GAOG;AACH,eAAO,MAAM,6BAA6B,sCAkCxC,CAAC;AAEH;;;;;;GAMG;AAGH,eAAO,MAAM,uBAAuB,sCAoBlC,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,0BAA0B,sCAsBrC,CAAC;AAEH,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,sCAuBpC,CAAC;AAYH;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0CAA0C,sCAgDrD,CAAC;AAEH,qEAAqE;AACrE,eAAO,MAAM,6BAA6B,sCAgBxC,CAAC;AAEH,eAAO,MAAM,gBAAgB,wCAO5B,CAAC"}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { configuredAdapters, resolveAdapter } from '../../adapters/registry.js';
|
|
2
4
|
import { StoreConfigSchema, SUPPORTED_SCHEMA_VERSION } from '../../config/schema.js';
|
|
5
|
+
import { agentsMdPath } from '../agents-doc.js';
|
|
3
6
|
import { checkCatalogStale } from '../catalog/build.js';
|
|
7
|
+
import { removeFencedRegion } from '../fs/fenced-region.js';
|
|
4
8
|
import { buildGraphFromNotes, graphBuildOptions } from '../graph/model.js';
|
|
9
|
+
import { harnessEntryFence } from '../markers.js';
|
|
5
10
|
import { defineCheck } from './types.js';
|
|
6
11
|
/**
|
|
7
12
|
* store-integrity spec: "unrecognized top-level config keys." StoreConfigSchema
|
|
@@ -134,6 +139,76 @@ export const adapterCompatibilityCheck = defineCheck({
|
|
|
134
139
|
return { status: findings.length > 0 ? 'fail' : 'pass', findings };
|
|
135
140
|
},
|
|
136
141
|
});
|
|
142
|
+
const MARKDOWN_HEADING_RE = /^#{1,6}\s+(.+)$/gm;
|
|
143
|
+
function headingsOf(text) {
|
|
144
|
+
const headings = new Set();
|
|
145
|
+
for (const match of text.matchAll(MARKDOWN_HEADING_RE)) {
|
|
146
|
+
headings.add(match[1].trim().toLowerCase());
|
|
147
|
+
}
|
|
148
|
+
return headings;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* harness-portability spec: "A harness-specific entry file only imports" —
|
|
152
|
+
* SHALL contain nothing beyond the adapter's own managed import plus that
|
|
153
|
+
* harness's own extras, and SHALL NOT duplicate canonical content. Exact
|
|
154
|
+
* prose duplication is undecidable to check in general (paraphrase, partial
|
|
155
|
+
* copy, reordering), so this catches the concrete failure mode the
|
|
156
|
+
* requirement is aimed at: a section heading also present in AGENTS.md,
|
|
157
|
+
* copy-pasted into the entry file outside its managed fence — the way an
|
|
158
|
+
* operator reaching for "where do I put a Claude-only note" might otherwise
|
|
159
|
+
* duplicate a whole AGENTS.md section into CLAUDE.md instead of writing a
|
|
160
|
+
* harness-specific extra beneath the import (see the `store-conventions`
|
|
161
|
+
* fence's own guidance in `agents-doc.ts`).
|
|
162
|
+
*/
|
|
163
|
+
export const harnessEntryNoDuplicateConventionTextCheck = defineCheck({
|
|
164
|
+
id: 'adapters.harness_entry_no_duplicate_convention_text',
|
|
165
|
+
title: 'A harness entry file carries no convention text already indexed in AGENTS.md',
|
|
166
|
+
severity: 'invariant',
|
|
167
|
+
capability: 'harness-portability',
|
|
168
|
+
scopes: ['store'],
|
|
169
|
+
async run(ctx) {
|
|
170
|
+
const adapters = configuredAdapters(ctx.config, 'harness-generation');
|
|
171
|
+
if (adapters.length === 0) {
|
|
172
|
+
return { status: 'pass', findings: [] };
|
|
173
|
+
}
|
|
174
|
+
let agentsMdContent;
|
|
175
|
+
try {
|
|
176
|
+
agentsMdContent = await readFile(agentsMdPath(ctx.storeRoot), 'utf8');
|
|
177
|
+
}
|
|
178
|
+
catch (err) {
|
|
179
|
+
if (err.code === 'ENOENT') {
|
|
180
|
+
return { status: 'skip', skipReason: 'AGENTS.md has not been generated yet — run `ctxr update`', findings: [] };
|
|
181
|
+
}
|
|
182
|
+
throw err;
|
|
183
|
+
}
|
|
184
|
+
const agentsMdHeadings = headingsOf(agentsMdContent);
|
|
185
|
+
const findings = [];
|
|
186
|
+
for (const adapter of adapters) {
|
|
187
|
+
let entryContent;
|
|
188
|
+
try {
|
|
189
|
+
entryContent = await readFile(path.join(ctx.storeRoot, adapter.entryFileName), 'utf8');
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
if (err.code === 'ENOENT')
|
|
193
|
+
continue; // nothing generated for this adapter yet
|
|
194
|
+
throw err;
|
|
195
|
+
}
|
|
196
|
+
const extra = removeFencedRegion(entryContent, harnessEntryFence(adapter.id)).text;
|
|
197
|
+
for (const heading of headingsOf(extra)) {
|
|
198
|
+
if (agentsMdHeadings.has(heading)) {
|
|
199
|
+
findings.push({
|
|
200
|
+
code: 'adapters.harness_entry_duplicates_agents_md',
|
|
201
|
+
severity: 'error',
|
|
202
|
+
message: `"${adapter.entryFileName}" duplicates AGENTS.md's "${heading}" section outside its managed import — canonical content belongs only in AGENTS.md; a harness-specific extra belongs below the import instead.`,
|
|
203
|
+
subject: adapter.entryFileName,
|
|
204
|
+
details: { heading },
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return { status: findings.length > 0 ? 'fail' : 'pass', findings };
|
|
210
|
+
},
|
|
211
|
+
});
|
|
137
212
|
/** store-integrity spec: "no unrecognized top-level config keys." */
|
|
138
213
|
export const noUnrecognizedConfigKeysCheck = defineCheck({
|
|
139
214
|
id: 'store.no_unrecognized_config_keys',
|
|
@@ -157,6 +232,7 @@ export const INTEGRITY_CHECKS = [
|
|
|
157
232
|
graphDanglingLinksCheck,
|
|
158
233
|
schemaVersionCurrencyCheck,
|
|
159
234
|
adapterCompatibilityCheck,
|
|
235
|
+
harnessEntryNoDuplicateConventionTextCheck,
|
|
160
236
|
noUnrecognizedConfigKeysCheck,
|
|
161
237
|
];
|
|
162
238
|
//# sourceMappingURL=integrity-checks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrity-checks.js","sourceRoot":"","sources":["../../../src/core/checks/integrity-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"integrity-checks.js","sourceRoot":"","sources":["../../../src/core/checks/integrity-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE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C,CAAC;YACrD,IAAI,EAAE,+BAA+B;YACrC,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,oCAAoC,GAAG,kMAAkM;YAClP,OAAO,EAAE,GAAG;SACb,CAAC,CAAC,CAAC;QACJ,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;IACrE,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,6BAA6B;IAC7B,uBAAuB;IACvB,0BAA0B;IAC1B,yBAAyB;IACzB,0CAA0C;IAC1C,6BAA6B;CAC9B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { StoreConfig } from '../config/schema.js';
|
|
2
2
|
/**
|
|
3
3
|
* harness-portability spec (entry-doc-generation): operator-authored
|
|
4
|
-
* convention documents and (via
|
|
4
|
+
* convention documents and (via scanSkills in skills.ts) skill
|
|
5
5
|
* files are indexed from what is actually on disk — adding a file is the
|
|
6
6
|
* entire integration. Metadata extraction order: frontmatter title →
|
|
7
7
|
* first `# ` heading → filename stem; description only from frontmatter.
|
package/dist/core/errors.d.ts
CHANGED
|
@@ -42,6 +42,15 @@ export declare class SessionNotFoundError extends ContextureError {
|
|
|
42
42
|
export declare class SessionValidationFailedError extends ContextureError {
|
|
43
43
|
constructor(findings: Finding[]);
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* write-lifecycle spec: `session.workspaces_external: true` marks a store
|
|
47
|
+
* whose worktrees are created/removed by a process outside `ctxr` — `ctxr
|
|
48
|
+
* session reap` refuses before inspecting or modifying any worktree, rather
|
|
49
|
+
* than reclaiming something it does not own.
|
|
50
|
+
*/
|
|
51
|
+
export declare class SessionReapWorkspacesExternalError extends ContextureError {
|
|
52
|
+
constructor();
|
|
53
|
+
}
|
|
45
54
|
export declare class NoRemoteConfiguredError extends Context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,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,EAUjF;CACF;AAED,qBAAa,2BAA4B,SAAQ,eAAe;IAC9D,YAAY,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,MAAM,EAAE,EAQrD;CACF"}
|
package/dist/core/errors.js
CHANGED
|
@@ -99,6 +99,22 @@ export class SessionValidationFailedError extends ContextureError {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* write-lifecycle spec: `session.workspaces_external: true` marks a store
|
|
104
|
+
* whose worktrees are created/removed by a process outside `ctxr` — `ctxr
|
|
105
|
+
* session reap` refuses before inspecting or modifying any worktree, rather
|
|
106
|
+
* than reclaiming something it does not own.
|
|
107
|
+
*/
|
|
108
|
+
export class SessionReapWorkspacesExternalError extends ContextureError {
|
|
109
|
+
constructor() {
|
|
110
|
+
super(ExitCode.Usage, {
|
|
111
|
+
code: 'session.reap.workspaces_external',
|
|
112
|
+
severity: 'error',
|
|
113
|
+
message: '"session.workspaces_external" is true; "ctxr session reap" refuses to run — worktrees are provided ' +
|
|
114
|
+
'externally and are not this command\'s to reclaim.',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
102
118
|
export class NoRemoteConfiguredError extends ContextureError {
|
|
103
119
|
constructor() {
|
|
104
120
|
super(ExitCode.Usage, {
|
|
@@ -123,7 +139,8 @@ export class SessionLandOnDefaultBranchError extends ContextureError {
|
|
|
123
139
|
super(ExitCode.Usage, {
|
|
124
140
|
code: 'session.land.default_branch',
|
|
125
141
|
severity: 'error',
|
|
126
|
-
message: `"${branch}" is the store's default branch; "ctxr session land" refuses to land it
|
|
142
|
+
message: `"${branch}" is the store's default branch; "ctxr session land" refuses to land it. ` +
|
|
143
|
+
'Name the session with --branch <name>, or the pull request with --pr <number>.',
|
|
127
144
|
subject: branch,
|
|
128
145
|
});
|
|
129
146
|
}
|