ctxr-cli 0.4.1 → 0.5.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/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +55 -7
- package/dist/commands/init.js.map +1 -1
- 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/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 +18 -2
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +18 -2
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/schema.d.ts +14 -4
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +45 -9
- 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/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 +25 -1
- package/dist/core/checks/integrity-checks.d.ts.map +1 -1
- package/dist/core/checks/integrity-checks.js +136 -3
- 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 +12 -0
- package/dist/core/checks/organize-checks.d.ts.map +1 -1
- package/dist/core/checks/organize-checks.js +51 -1
- package/dist/core/checks/organize-checks.js.map +1 -1
- package/dist/core/convention-doc.d.ts +33 -0
- package/dist/core/convention-doc.d.ts.map +1 -0
- package/dist/core/convention-doc.js +110 -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/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/migrations/registry.d.ts.map +1 -1
- package/dist/core/migrations/registry.js +6 -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.js +2 -2
- package/dist/core/notes/list.js.map +1 -1
- package/dist/core/reconcile.d.ts.map +1 -1
- package/dist/core/reconcile.js +31 -4
- 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/write-lifecycle/path-gate.js +1 -1
- package/dist/core/write-lifecycle/path-gate.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 +1 -7
- package/templates/agents/{store-conventions.md → conventions.md} +2 -4
- package/templates/agents/mission.md +5 -0
- package/templates/conventions/baseline-convention.md +60 -0
- package/templates/conventions/custom-convention-seed.md +21 -0
- package/templates/agents/store-conventions-empty.md +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH
|
|
1
|
+
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
|
|
47
47
|
/**
|
|
48
|
-
* harness-portability spec (
|
|
49
|
-
* required pieces — root-resolution rule, frontmatter schema
|
|
50
|
-
* write-path rule, and
|
|
51
|
-
* this file, with no harness-specific context, has
|
|
52
|
-
* (the spec's own "Reading only AGENTS.md is
|
|
48
|
+
* harness-portability spec (inline-conventions-and-mission): the canonical
|
|
49
|
+
* template's required pieces — root-resolution rule, frontmatter schema
|
|
50
|
+
* pointer, write-path rule, and the harness/store identity boundary — so an
|
|
51
|
+
* agent that has read only this file, with no harness-specific context, has
|
|
52
|
+
* everything it needs (the spec's own "Reading only AGENTS.md is
|
|
53
|
+
* sufficient" scenario). The skill index this section used to carry is gone
|
|
54
|
+
* (see the REMOVED "The skill index reflects the files on disk" requirement)
|
|
55
|
+
* — on a harness with native skill auto-discovery it duplicated content
|
|
56
|
+
* already in context; a harness without one still reaches every skill by
|
|
57
|
+
* path at the configured skills path.
|
|
53
58
|
*/
|
|
54
59
|
export declare const AGENTS_MD_CANONICAL_FENCE: import("./markers.js").Fence;
|
|
55
|
-
export declare function renderCanonicalSection(config: StoreConfig
|
|
60
|
+
export declare function renderCanonicalSection(config: StoreConfig): string[];
|
|
56
61
|
export declare function buildAgentsCanonicalSection(root: string, config: StoreConfig): Promise<{
|
|
57
62
|
changed: boolean;
|
|
58
63
|
}>;
|
|
59
64
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
65
|
+
* inline-conventions-and-mission: the store's current mission, inlined as
|
|
66
|
+
* its own fenced section — replacing the pointer-only rendering this used to
|
|
67
|
+
* get. `missionRaw` is the mission note's raw file content, read by the
|
|
68
|
+
* caller (`buildAgentsMissionSection`) so this stays a pure, synchronous
|
|
69
|
+
* renderer like every other section in this file; `null` means unconfigured
|
|
70
|
+
* or the note doesn't exist, either of which renders nothing at all.
|
|
71
|
+
*/
|
|
72
|
+
export declare const AGENTS_MD_MISSION_FENCE: import("./markers.js").Fence;
|
|
73
|
+
export declare function renderMissionSection(config: StoreConfig, missionRaw: string | null): string[];
|
|
74
|
+
export declare function buildAgentsMissionSection(root: string, config: StoreConfig): Promise<{
|
|
75
|
+
changed: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
/**
|
|
78
|
+
* harness-portability spec (inline-conventions-and-mission, folded into one
|
|
79
|
+
* template by compose-store-guidance-documents): operator conventions
|
|
80
|
+
* inlined in full. What's on disk at the configured conventions path is
|
|
81
|
+
* inlined body-and-all — heading-demoted under a heading naming its title,
|
|
82
|
+
* with a provenance line naming its source path — never referenced by a
|
|
83
|
+
* link alone; contexture ships no seeds here — conventions are
|
|
84
|
+
* definitionally operator-authored, so an empty store gets an explanation of
|
|
85
|
+
* the mechanism instead. One template (`conventions.md`) carries both: the
|
|
86
|
+
* empty-vs-populated difference is entirely in the lines `renderConventionsSection`
|
|
87
|
+
* computes for its one `__CONVENTION_BODY__` slot, so the surrounding frame
|
|
88
|
+
* (heading, harness-specific-note paragraph) exists in exactly one place and
|
|
89
|
+
* cannot drift between two copies the way it could when it shipped as two
|
|
90
|
+
* separate template files.
|
|
66
91
|
*/
|
|
67
92
|
export declare const AGENTS_MD_CONVENTIONS_FENCE: import("./markers.js").Fence;
|
|
93
|
+
/** Exported so doctor/verify can check a specific convention file's inlined block for drift without re-deriving the format. */
|
|
94
|
+
export declare function renderConventionBlock(doc: ScannedDoc): string[];
|
|
68
95
|
export declare function renderConventionsSection(config: StoreConfig, conventions: readonly ScannedDoc[]): string[];
|
|
69
96
|
export declare function buildAgentsConventionsSection(root: string, config: StoreConfig): Promise<{
|
|
70
97
|
changed: boolean;
|
|
71
98
|
}>;
|
|
99
|
+
/**
|
|
100
|
+
* harness-portability spec: "Generated sections render in a fixed order" —
|
|
101
|
+
* hard rules and current state first, operating mechanics next, the long
|
|
102
|
+
* operator reference last. `reconcileStore` passes this straight to
|
|
103
|
+
* `reorderFencedRegionsInFile`; a mission-less store simply never has the
|
|
104
|
+
* mission fence present, which the reorder primitive already treats as
|
|
105
|
+
* "skip it," not an error.
|
|
106
|
+
*/
|
|
107
|
+
export declare const AGENTS_MD_SECTION_ORDER: import("./markers.js").Fence[];
|
|
108
|
+
export interface AgentsMdDrift {
|
|
109
|
+
/** Store-relative paths of convention files whose inlined block no longer matches the source. */
|
|
110
|
+
driftedConventions: string[];
|
|
111
|
+
/** The configured mission path, when its inlined section no longer matches the source; null otherwise. */
|
|
112
|
+
driftedMission: string | null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* harness-portability spec: "The entry document's inlined content matches
|
|
116
|
+
* its sources" — shared by `ctxr doctor` (reports every drifted file) and
|
|
117
|
+
* `ctxr verify --portable` (stops at the first one), per design.md's
|
|
118
|
+
* "Drift detection reuses render, not a hash": re-runs the same renderers
|
|
119
|
+
* `buildAgents*Section` uses and diffs against what is currently inside each
|
|
120
|
+
* fence, rather than storing a separate content hash anywhere.
|
|
121
|
+
*/
|
|
122
|
+
export declare function checkAgentsMdDrift(root: string, config: StoreConfig): Promise<AgentsMdDrift>;
|
|
72
123
|
//# sourceMappingURL=agents-doc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents-doc.d.ts","sourceRoot":"","sources":["../../src/core/agents-doc.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agents-doc.d.ts","sourceRoot":"","sources":["../../src/core/agents-doc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAIvD,OAAO,EAAsD,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAgBvG,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,8BAA4C,CAAC;AAgCrF,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAOrE;AAED,mHAAmH;AACnH,wBAAs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AoBhH;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,2BAA2B,8BAAkC,CAAC;AAE3E,+HAA+H;AAC/H,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,UAAU,GAAG,MAAM,EAAE,CAE/D;AAeD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,EAAE,CAE1G;AAED,wBAAsB,6BAA6B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAGpH;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,gCAOnC,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,iGAAiG;IACjG,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,0GAA0G;IAC1G,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC,CAoClG"}
|
package/dist/core/agents-doc.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import { GRAPH_DOCUMENT_RELATIVE_PATH } from './graph/persist.js';
|
|
3
4
|
import { CONFIG_FILE_NAME } from './root.js';
|
|
4
5
|
import { excludedPrefixesFor } from './notes/list.js';
|
|
5
|
-
import { scanConventions } from './conventions.js';
|
|
6
|
-
import {
|
|
7
|
-
import { upsertFencedRegionInFile } from './fs/fenced-region.js';
|
|
6
|
+
import { extractDocMetadata, inlineDocBody, scanConventions } from './conventions.js';
|
|
7
|
+
import { readFencedRegionFromFile, removeFencedRegionFromFile, upsertFencedRegionInFile } from './fs/fenced-region.js';
|
|
8
8
|
import { htmlCommentFence } from './markers.js';
|
|
9
9
|
import { packagedTemplate, substituteBlock } from './templates.js';
|
|
10
10
|
/**
|
|
@@ -17,10 +17,6 @@ import { packagedTemplate, substituteBlock } from './templates.js';
|
|
|
17
17
|
function agentsTemplate(name) {
|
|
18
18
|
return packagedTemplate('agents', name);
|
|
19
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
20
|
export function agentsMdPath(root) {
|
|
25
21
|
return path.join(root, 'AGENTS.md');
|
|
26
22
|
}
|
|
@@ -34,9 +30,38 @@ export function agentsMdPath(root) {
|
|
|
34
30
|
* index) as sibling regions in the same file, never touching this one.
|
|
35
31
|
*/
|
|
36
32
|
export const AGENTS_MD_LEG_ROUTING_FENCE = htmlCommentFence('retrieval-leg-routing');
|
|
33
|
+
function trimTrailingSlash(prefix) {
|
|
34
|
+
return prefix.replace(/\/+$/, '');
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* inline-conventions-and-mission: `excludedPrefixesFor` deliberately includes
|
|
38
|
+
* both a parent path (e.g. `.contexture/`) and paths nested under it (e.g.
|
|
39
|
+
* `.contexture/cache/`) — each has its own reason to be there, and the note
|
|
40
|
+
* walker (`notes/list.ts`) needs the full, unfiltered set to skip directories
|
|
41
|
+
* early rather than descend and filter every file. Rendering that list
|
|
42
|
+
* verbatim produces a dozen-plus redundant bullets, so this collapses any
|
|
43
|
+
* prefix already covered by an ancestor prefix for display only — the
|
|
44
|
+
* exclusion logic itself is untouched.
|
|
45
|
+
*/
|
|
46
|
+
function collapseNestedPrefixes(prefixes) {
|
|
47
|
+
// Original (possibly trailing-slash) form preserved per trimmed key, since
|
|
48
|
+
// this list mixes directory prefixes and bare file exclusions (AGENTS.md,
|
|
49
|
+
// log.md) — the collapse test itself compares on the trimmed form only.
|
|
50
|
+
const originalByTrimmed = new Map();
|
|
51
|
+
for (const prefix of prefixes) {
|
|
52
|
+
const trimmed = trimTrailingSlash(prefix);
|
|
53
|
+
if (!originalByTrimmed.has(trimmed))
|
|
54
|
+
originalByTrimmed.set(trimmed, prefix);
|
|
55
|
+
}
|
|
56
|
+
const trimmed = [...originalByTrimmed.keys()];
|
|
57
|
+
return trimmed
|
|
58
|
+
.filter((path) => !trimmed.some((other) => other !== path && path.startsWith(`${other}/`)))
|
|
59
|
+
.sort()
|
|
60
|
+
.map((path) => originalByTrimmed.get(path));
|
|
61
|
+
}
|
|
37
62
|
export function renderLegRoutingSection(config) {
|
|
38
|
-
const exclusions =
|
|
39
|
-
return substituteBlock(agentsTemplate('retrieval-leg-routing').replaceAll('__GRAPH_DOCUMENT_PATH__', GRAPH_DOCUMENT_RELATIVE_PATH), '__EXCLUSION_PATHS__', exclusions.map((prefix) =>
|
|
63
|
+
const exclusions = collapseNestedPrefixes(excludedPrefixesFor(config));
|
|
64
|
+
return substituteBlock(agentsTemplate('retrieval-leg-routing').replaceAll('__GRAPH_DOCUMENT_PATH__', GRAPH_DOCUMENT_RELATIVE_PATH), '__EXCLUSION_PATHS__', [exclusions.map((prefix) => `\`${prefix}\``).join(', ')]).split('\n');
|
|
40
65
|
}
|
|
41
66
|
/** Idempotently reconciles AGENTS.md's leg-routing section from current config — called at init and on re-init. */
|
|
42
67
|
export async function buildAgentsLegRoutingSection(root, config) {
|
|
@@ -82,22 +107,28 @@ export async function buildAgentsPlacementSection(root, config) {
|
|
|
82
107
|
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_PLACEMENT_FENCE, renderPlacementSection(config));
|
|
83
108
|
}
|
|
84
109
|
/**
|
|
85
|
-
* harness-portability spec (
|
|
86
|
-
* required pieces — root-resolution rule, frontmatter schema
|
|
87
|
-
* write-path rule, and
|
|
88
|
-
* this file, with no harness-specific context, has
|
|
89
|
-
* (the spec's own "Reading only AGENTS.md is
|
|
110
|
+
* harness-portability spec (inline-conventions-and-mission): the canonical
|
|
111
|
+
* template's required pieces — root-resolution rule, frontmatter schema
|
|
112
|
+
* pointer, write-path rule, and the harness/store identity boundary — so an
|
|
113
|
+
* agent that has read only this file, with no harness-specific context, has
|
|
114
|
+
* everything it needs (the spec's own "Reading only AGENTS.md is
|
|
115
|
+
* sufficient" scenario). The skill index this section used to carry is gone
|
|
116
|
+
* (see the REMOVED "The skill index reflects the files on disk" requirement)
|
|
117
|
+
* — on a harness with native skill auto-discovery it duplicated content
|
|
118
|
+
* already in context; a harness without one still reaches every skill by
|
|
119
|
+
* path at the configured skills path.
|
|
90
120
|
*/
|
|
91
121
|
export const AGENTS_MD_CANONICAL_FENCE = htmlCommentFence('canonical');
|
|
92
122
|
/**
|
|
93
|
-
* context-organize spec
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
* `__MISSION_POINTER__` template line
|
|
100
|
-
* `substituteBlock`'s empty-list case), not a
|
|
123
|
+
* context-organize spec, kept through inline-conventions-and-mission's
|
|
124
|
+
* design decision "the identity/mission pointer coexists with the inlined
|
|
125
|
+
* Mission section": when `organize.mission_path` is configured, the
|
|
126
|
+
* canonical section still names it as a document to load at session start,
|
|
127
|
+
* immediately followed (as its own fenced section — see
|
|
128
|
+
* `renderMissionSection` below) by that document's full inlined body.
|
|
129
|
+
* Nothing is rendered when unset: the `__MISSION_POINTER__` template line
|
|
130
|
+
* disappears entirely (via `substituteBlock`'s empty-list case), not a
|
|
131
|
+
* placeholder.
|
|
101
132
|
*/
|
|
102
133
|
function renderMissionPointer(config) {
|
|
103
134
|
const { mission_path: missionPath } = config.organize;
|
|
@@ -106,40 +137,159 @@ function renderMissionPointer(config) {
|
|
|
106
137
|
return [
|
|
107
138
|
'',
|
|
108
139
|
`Load \`${missionPath}\` at the start of every session — this store's standing current-state document, ` +
|
|
109
|
-
'kept current by the mission skill
|
|
140
|
+
'kept current by the mission skill and written through `ctxr rollup write`; its full content follows in the "Mission" section below.',
|
|
110
141
|
];
|
|
111
142
|
}
|
|
112
|
-
export function renderCanonicalSection(config
|
|
113
|
-
|
|
143
|
+
export function renderCanonicalSection(config) {
|
|
144
|
+
return substituteBlock(agentsTemplate('canonical')
|
|
114
145
|
.replaceAll('__CONFIG_FILE_NAME__', CONFIG_FILE_NAME)
|
|
115
146
|
.replaceAll('__VISIBILITY_FIELD__', config.fields.visibility)
|
|
116
147
|
.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');
|
|
148
|
+
.replaceAll('__SKILLS_PATH__', config.harness.skills_path), '__MISSION_POINTER__', renderMissionPointer(config)).split('\n');
|
|
119
149
|
}
|
|
120
150
|
export async function buildAgentsCanonicalSection(root, config) {
|
|
121
|
-
|
|
122
|
-
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CANONICAL_FENCE, renderCanonicalSection(config, skills));
|
|
151
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CANONICAL_FENCE, renderCanonicalSection(config));
|
|
123
152
|
}
|
|
124
153
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
154
|
+
* inline-conventions-and-mission: the store's current mission, inlined as
|
|
155
|
+
* its own fenced section — replacing the pointer-only rendering this used to
|
|
156
|
+
* get. `missionRaw` is the mission note's raw file content, read by the
|
|
157
|
+
* caller (`buildAgentsMissionSection`) so this stays a pure, synchronous
|
|
158
|
+
* renderer like every other section in this file; `null` means unconfigured
|
|
159
|
+
* or the note doesn't exist, either of which renders nothing at all.
|
|
131
160
|
*/
|
|
132
|
-
export const
|
|
133
|
-
export function
|
|
161
|
+
export const AGENTS_MD_MISSION_FENCE = htmlCommentFence('mission');
|
|
162
|
+
export function renderMissionSection(config, missionRaw) {
|
|
163
|
+
const { mission_path: missionPath } = config.organize;
|
|
164
|
+
if (!missionPath || missionRaw === null)
|
|
165
|
+
return [];
|
|
166
|
+
const doc = extractDocMetadata(missionRaw, missionPath);
|
|
167
|
+
return substituteBlock(agentsTemplate('mission').replaceAll('__MISSION_PATH__', missionPath), '__MISSION_BODY__', inlineDocBody(doc, 1)).split('\n');
|
|
168
|
+
}
|
|
169
|
+
export async function buildAgentsMissionSection(root, config) {
|
|
170
|
+
const { mission_path: missionPath } = config.organize;
|
|
171
|
+
let missionRaw = null;
|
|
172
|
+
if (missionPath) {
|
|
173
|
+
try {
|
|
174
|
+
missionRaw = await readFile(path.join(root, missionPath), 'utf8');
|
|
175
|
+
}
|
|
176
|
+
catch (err) {
|
|
177
|
+
if (err.code !== 'ENOENT')
|
|
178
|
+
throw err;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const body = renderMissionSection(config, missionRaw);
|
|
182
|
+
// `upsertFencedRegionInFile` appends a fence pair unconditionally when it's
|
|
183
|
+
// absent, even with an empty body — wrong here, where "unconfigured" must
|
|
184
|
+
// mean the section is absent entirely, never an empty fence pair. Removal
|
|
185
|
+
// is idempotent (a no-op when the fence isn't there), so this also cleans
|
|
186
|
+
// up correctly if a store had a mission configured and then unset it.
|
|
187
|
+
if (body.length === 0) {
|
|
188
|
+
return removeFencedRegionFromFile(agentsMdPath(root), AGENTS_MD_MISSION_FENCE);
|
|
189
|
+
}
|
|
190
|
+
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_MISSION_FENCE, body);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* harness-portability spec (inline-conventions-and-mission, folded into one
|
|
194
|
+
* template by compose-store-guidance-documents): operator conventions
|
|
195
|
+
* inlined in full. What's on disk at the configured conventions path is
|
|
196
|
+
* inlined body-and-all — heading-demoted under a heading naming its title,
|
|
197
|
+
* with a provenance line naming its source path — never referenced by a
|
|
198
|
+
* link alone; contexture ships no seeds here — conventions are
|
|
199
|
+
* definitionally operator-authored, so an empty store gets an explanation of
|
|
200
|
+
* the mechanism instead. One template (`conventions.md`) carries both: the
|
|
201
|
+
* empty-vs-populated difference is entirely in the lines `renderConventionsSection`
|
|
202
|
+
* computes for its one `__CONVENTION_BODY__` slot, so the surrounding frame
|
|
203
|
+
* (heading, harness-specific-note paragraph) exists in exactly one place and
|
|
204
|
+
* cannot drift between two copies the way it could when it shipped as two
|
|
205
|
+
* separate template files.
|
|
206
|
+
*/
|
|
207
|
+
export const AGENTS_MD_CONVENTIONS_FENCE = htmlCommentFence('conventions');
|
|
208
|
+
/** Exported so doctor/verify can check a specific convention file's inlined block for drift without re-deriving the format. */
|
|
209
|
+
export function renderConventionBlock(doc) {
|
|
210
|
+
return [`### ${doc.title}`, '', ...inlineDocBody(doc, 2), '', `_Source: ${doc.path}_`];
|
|
211
|
+
}
|
|
212
|
+
function conventionsBody(config, conventions) {
|
|
134
213
|
if (conventions.length === 0) {
|
|
135
|
-
return
|
|
136
|
-
.
|
|
137
|
-
.
|
|
214
|
+
return [
|
|
215
|
+
'This store declares no convention documents yet. Operator-authored conventions (content style, field',
|
|
216
|
+
`semantics, house rules) belong as markdown files under \`${config.harness.guidance_path}\` — each is`,
|
|
217
|
+
'inlined here in full on regeneration.',
|
|
218
|
+
];
|
|
138
219
|
}
|
|
139
|
-
|
|
220
|
+
const blocks = conventions.map(renderConventionBlock);
|
|
221
|
+
const bodies = blocks.flatMap((block, i) => (i === blocks.length - 1 ? block : [...block, '']));
|
|
222
|
+
return ['Operator-authored conventions for this store, inlined in full:', '', ...bodies];
|
|
223
|
+
}
|
|
224
|
+
export function renderConventionsSection(config, conventions) {
|
|
225
|
+
return substituteBlock(agentsTemplate('conventions'), '__CONVENTION_BODY__', conventionsBody(config, conventions)).split('\n');
|
|
140
226
|
}
|
|
141
227
|
export async function buildAgentsConventionsSection(root, config) {
|
|
142
228
|
const conventions = await scanConventions(root, config);
|
|
143
229
|
return upsertFencedRegionInFile(agentsMdPath(root), AGENTS_MD_CONVENTIONS_FENCE, renderConventionsSection(config, conventions));
|
|
144
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* harness-portability spec: "Generated sections render in a fixed order" —
|
|
233
|
+
* hard rules and current state first, operating mechanics next, the long
|
|
234
|
+
* operator reference last. `reconcileStore` passes this straight to
|
|
235
|
+
* `reorderFencedRegionsInFile`; a mission-less store simply never has the
|
|
236
|
+
* mission fence present, which the reorder primitive already treats as
|
|
237
|
+
* "skip it," not an error.
|
|
238
|
+
*/
|
|
239
|
+
export const AGENTS_MD_SECTION_ORDER = [
|
|
240
|
+
AGENTS_MD_CANONICAL_FENCE,
|
|
241
|
+
AGENTS_MD_MISSION_FENCE,
|
|
242
|
+
AGENTS_MD_LEG_ROUTING_FENCE,
|
|
243
|
+
AGENTS_MD_CAPTURE_FENCE,
|
|
244
|
+
AGENTS_MD_PLACEMENT_FENCE,
|
|
245
|
+
AGENTS_MD_CONVENTIONS_FENCE,
|
|
246
|
+
];
|
|
247
|
+
/**
|
|
248
|
+
* harness-portability spec: "The entry document's inlined content matches
|
|
249
|
+
* its sources" — shared by `ctxr doctor` (reports every drifted file) and
|
|
250
|
+
* `ctxr verify --portable` (stops at the first one), per design.md's
|
|
251
|
+
* "Drift detection reuses render, not a hash": re-runs the same renderers
|
|
252
|
+
* `buildAgents*Section` uses and diffs against what is currently inside each
|
|
253
|
+
* fence, rather than storing a separate content hash anywhere.
|
|
254
|
+
*/
|
|
255
|
+
export async function checkAgentsMdDrift(root, config) {
|
|
256
|
+
const filePath = agentsMdPath(root);
|
|
257
|
+
const conventions = await scanConventions(root, config);
|
|
258
|
+
const conventionsRegion = (await readFencedRegionFromFile(filePath, AGENTS_MD_CONVENTIONS_FENCE)).join('\n');
|
|
259
|
+
const freshConventionsSection = renderConventionsSection(config, conventions).join('\n');
|
|
260
|
+
const driftedConventions = [];
|
|
261
|
+
if (freshConventionsSection !== conventionsRegion) {
|
|
262
|
+
if (conventions.length === 0) {
|
|
263
|
+
driftedConventions.push(config.harness.guidance_path);
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
for (const doc of conventions) {
|
|
267
|
+
if (!conventionsRegion.includes(renderConventionBlock(doc).join('\n')))
|
|
268
|
+
driftedConventions.push(doc.path);
|
|
269
|
+
}
|
|
270
|
+
// Every individual block present, yet the whole section still differs
|
|
271
|
+
// (a reordering, an added/removed file, a template change): still real
|
|
272
|
+
// drift, just not attributable to one file — report the whole set.
|
|
273
|
+
if (driftedConventions.length === 0)
|
|
274
|
+
driftedConventions.push(...conventions.map((doc) => doc.path));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
let driftedMission = null;
|
|
278
|
+
const missionPath = config.organize.mission_path;
|
|
279
|
+
if (missionPath) {
|
|
280
|
+
let missionRaw = null;
|
|
281
|
+
try {
|
|
282
|
+
missionRaw = await readFile(path.join(root, missionPath), 'utf8');
|
|
283
|
+
}
|
|
284
|
+
catch (err) {
|
|
285
|
+
if (err.code !== 'ENOENT')
|
|
286
|
+
throw err;
|
|
287
|
+
}
|
|
288
|
+
const missionRegion = (await readFencedRegionFromFile(filePath, AGENTS_MD_MISSION_FENCE)).join('\n');
|
|
289
|
+
const freshMissionSection = renderMissionSection(config, missionRaw).join('\n');
|
|
290
|
+
if (freshMissionSection !== missionRegion)
|
|
291
|
+
driftedMission = missionPath;
|
|
292
|
+
}
|
|
293
|
+
return { driftedConventions, driftedMission };
|
|
294
|
+
}
|
|
145
295
|
//# sourceMappingURL=agents-doc.js.map
|
|
@@ -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,E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,MAAM,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChF,IAAI,mBAAmB,KAAK,aAAa;YAAE,cAAc,GAAG,WAAW,CAAC;IAC1E,CAAC;IAED,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* compose-store-guidance-documents design.md D6: inlining every convention
|
|
3
|
+
* file's full body into AGENTS.md's "Store conventions" section
|
|
4
|
+
* (inline-conventions-and-mission) removed the natural size bound an index
|
|
5
|
+
* provided — an unbounded custom part could make AGENTS.md unwieldy. A
|
|
6
|
+
* configured ceiling (`harness.convention_max_bytes`, defaulting to
|
|
7
|
+
* `DEFAULT_CONVENTION_MAX_BYTES`) fails doctor loud rather than silently
|
|
8
|
+
* truncating content the inlining exists to surface.
|
|
9
|
+
*/
|
|
10
|
+
export declare const conventionsSectionSizeCheck: import("./types.js").CheckDefinition;
|
|
11
|
+
export declare const HARNESS_PORTABILITY_CHECKS: import("./types.js").CheckDefinition[];
|
|
12
|
+
//# sourceMappingURL=harness-portability-checks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-portability-checks.d.ts","sourceRoot":"","sources":["../../../src/core/checks/harness-portability-checks.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,sCAuBtC,CAAC;AAEH,eAAO,MAAM,0BAA0B,wCAAgC,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DEFAULT_CONVENTION_MAX_BYTES } from '../../config/defaults.js';
|
|
2
|
+
import { AGENTS_MD_CONVENTIONS_FENCE, agentsMdPath } from '../agents-doc.js';
|
|
3
|
+
import { readFencedRegionFromFile } from '../fs/fenced-region.js';
|
|
4
|
+
import { defineCheck } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* compose-store-guidance-documents design.md D6: inlining every convention
|
|
7
|
+
* file's full body into AGENTS.md's "Store conventions" section
|
|
8
|
+
* (inline-conventions-and-mission) removed the natural size bound an index
|
|
9
|
+
* provided — an unbounded custom part could make AGENTS.md unwieldy. A
|
|
10
|
+
* configured ceiling (`harness.convention_max_bytes`, defaulting to
|
|
11
|
+
* `DEFAULT_CONVENTION_MAX_BYTES`) fails doctor loud rather than silently
|
|
12
|
+
* truncating content the inlining exists to surface.
|
|
13
|
+
*/
|
|
14
|
+
export const conventionsSectionSizeCheck = defineCheck({
|
|
15
|
+
id: 'harness_portability.conventions_section_size',
|
|
16
|
+
title: "AGENTS.md's inlined \"Store conventions\" section stays within its configured size budget",
|
|
17
|
+
severity: 'invariant',
|
|
18
|
+
capability: 'harness-portability',
|
|
19
|
+
scopes: ['store'],
|
|
20
|
+
async run(ctx) {
|
|
21
|
+
const region = await readFencedRegionFromFile(agentsMdPath(ctx.storeRoot), AGENTS_MD_CONVENTIONS_FENCE);
|
|
22
|
+
if (region.length === 0) {
|
|
23
|
+
return { status: 'skip', skipReason: 'AGENTS.md has not been generated yet — run `ctxr update`', findings: [] };
|
|
24
|
+
}
|
|
25
|
+
const size = Buffer.byteLength(region.join('\n'), 'utf8');
|
|
26
|
+
const budget = ctx.config.harness.convention_max_bytes ?? DEFAULT_CONVENTION_MAX_BYTES;
|
|
27
|
+
if (size <= budget)
|
|
28
|
+
return { status: 'pass', findings: [] };
|
|
29
|
+
const finding = {
|
|
30
|
+
code: 'harness_portability.conventions_section_size_exceeded',
|
|
31
|
+
severity: 'error',
|
|
32
|
+
message: `AGENTS.md's "Store conventions" section is ${size} bytes, exceeding the configured budget of ${budget}. Trim a convention file's content or raise \`harness.convention_max_bytes\`.`,
|
|
33
|
+
details: { size, budget },
|
|
34
|
+
};
|
|
35
|
+
return { status: 'fail', findings: [finding] };
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
export const HARNESS_PORTABILITY_CHECKS = [conventionsSectionSizeCheck];
|
|
39
|
+
//# sourceMappingURL=harness-portability-checks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"harness-portability-checks.js","sourceRoot":"","sources":["../../../src/core/checks/harness-portability-checks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAE7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC;IACrD,EAAE,EAAE,8CAA8C;IAClD,KAAK,EAAE,2FAA2F;IAClG,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,qBAAqB;IACjC,MAAM,EAAE,CAAC,OAAO,CAAC;IACjB,KAAK,CAAC,GAAG,CAAC,GAAG;QACX,MAAM,MAAM,GAAG,MAAM,wBAAwB,CAAC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,2BAA2B,CAAC,CAAC;QACxG,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,0DAA0D,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;QAClH,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,oBAAoB,IAAI,4BAA4B,CAAC;QACvF,IAAI,IAAI,IAAI,MAAM;YAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;QAE5D,MAAM,OAAO,GAAY;YACvB,IAAI,EAAE,uDAAuD;YAC7D,QAAQ,EAAE,OAAO;YACjB,OAAO,EAAE,8CAA8C,IAAI,8CAA8C,MAAM,+EAA+E;YAC9L,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;SAC1B,CAAC;QACF,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACjD,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,2BAA2B,CAAC,CAAC"}
|
|
@@ -29,11 +29,35 @@ export declare const adapterCompatibilityCheck: import("./types.js").CheckDefini
|
|
|
29
29
|
* copy-pasted into the entry file outside its managed fence — the way an
|
|
30
30
|
* operator reaching for "where do I put a Claude-only note" might otherwise
|
|
31
31
|
* duplicate a whole AGENTS.md section into CLAUDE.md instead of writing a
|
|
32
|
-
* harness-specific extra beneath the import (see the `
|
|
32
|
+
* harness-specific extra beneath the import (see the `conventions`
|
|
33
33
|
* fence's own guidance in `agents-doc.ts`).
|
|
34
34
|
*/
|
|
35
35
|
export declare const harnessEntryNoDuplicateConventionTextCheck: import("./types.js").CheckDefinition;
|
|
36
36
|
/** store-integrity spec: "no unrecognized top-level config keys." */
|
|
37
37
|
export declare const noUnrecognizedConfigKeysCheck: import("./types.js").CheckDefinition;
|
|
38
|
+
/**
|
|
39
|
+
* harness-portability spec (inline-conventions-and-mission): "The entry
|
|
40
|
+
* document's inlined content matches its sources" — `AGENTS.md`'s inlined
|
|
41
|
+
* conventions/mission sections are derived content (rendered from
|
|
42
|
+
* `.contexture/conventions/*.md` and the configured mission path), so
|
|
43
|
+
* editing a source directly without regenerating `AGENTS.md` (e.g. bypassing
|
|
44
|
+
* `ctxr update`) leaves it silently stale. Reuses `checkAgentsMdDrift`, the
|
|
45
|
+
* same re-render-and-diff `ctxr verify --portable` uses, so the two commands
|
|
46
|
+
* can never disagree about whether a store is in sync.
|
|
47
|
+
*/
|
|
48
|
+
export declare const agentsMdInlinedContentCurrentCheck: import("./types.js").CheckDefinition;
|
|
49
|
+
/**
|
|
50
|
+
* write-lifecycle spec / harness-portability spec (inline-conventions-and-mission):
|
|
51
|
+
* "A commit that would leave the entry document stale is refused." The
|
|
52
|
+
* store-scope drift check above reads the working tree, which is the wrong
|
|
53
|
+
* source of truth for a pre-commit hook — an operator can edit a convention
|
|
54
|
+
* file, forget to run `ctxr update`, and `git add` only the convention file;
|
|
55
|
+
* the working tree would then have a regenerated AGENTS.md sitting right
|
|
56
|
+
* next to it only if they happened to run `ctxr update` first, which is
|
|
57
|
+
* exactly the step this check exists to enforce. So this reads STAGED
|
|
58
|
+
* content for any file this commit touches (falling back to disk for files
|
|
59
|
+
* the commit doesn't touch) and re-renders against that view instead.
|
|
60
|
+
*/
|
|
61
|
+
export declare const stagedAgentsMdInlinedContentCurrentCheck: import("./types.js").CheckDefinition;
|
|
38
62
|
export declare const INTEGRITY_CHECKS: import("./types.js").CheckDefinition[];
|
|
39
63
|
//# sourceMappingURL=integrity-checks.d.ts.map
|
|
@@ -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":"AAiCA;;;;;;;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;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,sCA4B7C,CAAC;AAqBH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,wCAAwC,sCAiEnD,CAAC;AAEH,eAAO,MAAM,gBAAgB,wCAS5B,CAAC"}
|