greprag 5.71.1 → 5.72.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/commands/load.js +22 -1
- package/dist/commands/load.js.map +1 -1
- package/dist/commands/mechanic-spawn.js +3 -0
- package/dist/commands/mechanic-spawn.js.map +1 -1
- package/dist/commands/skill.js +62 -1
- package/dist/commands/skill.js.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/opencode-plugin.bundle.js +63 -2
- package/dist/procedure.d.ts +8 -0
- package/dist/procedure.js +35 -9
- package/dist/procedure.js.map +1 -1
- package/dist/skill-source-drift.d.ts +56 -0
- package/dist/skill-source-drift.js +389 -0
- package/dist/skill-source-drift.js.map +1 -0
- package/package.json +1 -1
- package/skill/greprag/docs/codex-chip.md +3 -2
- package/skill/mechanic/SKILL.md +1 -1
- package/skill/templates/chip-spawn.md +1 -1
- package/skill/templates/codex-chip-spawn.md +6 -4
- package/skill/templates/skill-change.md +56 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/** Skill source drift — local Git evidence for mirrored skills.
|
|
3
|
+
*
|
|
4
|
+
* A cloud skill can name the local source files it summarizes, but only the
|
|
5
|
+
* local machine can know whether those files have moved. This module keeps the
|
|
6
|
+
* cloud payload dumb: a hidden JSON metadata block in SKILL.md names watched
|
|
7
|
+
* paths plus their baseline commits; `greprag load` checks local Git at serve
|
|
8
|
+
* time and emits a high-signal directive when the skill is stale.
|
|
9
|
+
*
|
|
10
|
+
* docs/load-system.md §Source-bound skill freshness
|
|
11
|
+
* adr/parity-system.md
|
|
12
|
+
*/
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
exports.SOURCE_BINDINGS_MARKER = void 0;
|
|
48
|
+
exports.parseSkillSourceBindings = parseSkillSourceBindings;
|
|
49
|
+
exports.serializeSkillSourceBindings = serializeSkillSourceBindings;
|
|
50
|
+
exports.upsertSkillSourceBindings = upsertSkillSourceBindings;
|
|
51
|
+
exports.resolveSourceRoot = resolveSourceRoot;
|
|
52
|
+
exports.computeCommittedPathHash = computeCommittedPathHash;
|
|
53
|
+
exports.analyzeSkillSourceDrift = analyzeSkillSourceDrift;
|
|
54
|
+
exports.formatSkillSourceDrift = formatSkillSourceDrift;
|
|
55
|
+
exports.stampSourceBinding = stampSourceBinding;
|
|
56
|
+
const crypto = __importStar(require("crypto"));
|
|
57
|
+
const fs = __importStar(require("fs"));
|
|
58
|
+
const os = __importStar(require("os"));
|
|
59
|
+
const path = __importStar(require("path"));
|
|
60
|
+
const proc_1 = require("./proc");
|
|
61
|
+
exports.SOURCE_BINDINGS_MARKER = 'greprag-source-bindings';
|
|
62
|
+
function asString(value) {
|
|
63
|
+
return typeof value === 'string' ? value.trim() : '';
|
|
64
|
+
}
|
|
65
|
+
function normalizeRelPath(raw) {
|
|
66
|
+
const value = asString(raw).replace(/\\/g, '/').replace(/^\.\/+/, '');
|
|
67
|
+
if (!value || value.startsWith('/') || /^[A-Za-z]:\//.test(value))
|
|
68
|
+
return null;
|
|
69
|
+
if (value.split('/').some(part => !part || part === '.' || part === '..'))
|
|
70
|
+
return null;
|
|
71
|
+
return value;
|
|
72
|
+
}
|
|
73
|
+
function normalizeBinding(raw) {
|
|
74
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw))
|
|
75
|
+
return null;
|
|
76
|
+
const obj = raw;
|
|
77
|
+
const project = asString(obj.project);
|
|
78
|
+
const baselineCommit = asString(obj.baselineCommit || obj.baseline_commit);
|
|
79
|
+
const baselineHash = asString(obj.baselineHash || obj.baseline_hash);
|
|
80
|
+
const paths = Array.isArray(obj.paths)
|
|
81
|
+
? [...new Set(obj.paths.map(normalizeRelPath).filter((p) => !!p))]
|
|
82
|
+
: [];
|
|
83
|
+
if (!/^[A-Za-z0-9._-]{1,80}$/.test(project))
|
|
84
|
+
return null;
|
|
85
|
+
if (!/^[0-9a-f]{7,40}$/i.test(baselineCommit))
|
|
86
|
+
return null;
|
|
87
|
+
if (paths.length === 0)
|
|
88
|
+
return null;
|
|
89
|
+
return { project, paths, baselineCommit, ...(baselineHash ? { baselineHash } : {}) };
|
|
90
|
+
}
|
|
91
|
+
function parseSkillSourceBindings(skillMd) {
|
|
92
|
+
const re = new RegExp(`<!--\\s*${exports.SOURCE_BINDINGS_MARKER}\\s*([\\s\\S]*?)-->`, 'm');
|
|
93
|
+
const match = re.exec(skillMd);
|
|
94
|
+
if (!match)
|
|
95
|
+
return [];
|
|
96
|
+
try {
|
|
97
|
+
const parsed = JSON.parse(match[1].trim());
|
|
98
|
+
const rows = Array.isArray(parsed)
|
|
99
|
+
? parsed
|
|
100
|
+
: parsed && typeof parsed === 'object'
|
|
101
|
+
? parsed.sources
|
|
102
|
+
: [];
|
|
103
|
+
if (!Array.isArray(rows))
|
|
104
|
+
return [];
|
|
105
|
+
return rows.map(normalizeBinding).filter((b) => !!b);
|
|
106
|
+
}
|
|
107
|
+
catch {
|
|
108
|
+
return [];
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function sortedBindings(bindings) {
|
|
112
|
+
return [...bindings].sort((a, b) => a.project.localeCompare(b.project));
|
|
113
|
+
}
|
|
114
|
+
function serializeSkillSourceBindings(bindings) {
|
|
115
|
+
const sources = sortedBindings(bindings).map(binding => ({
|
|
116
|
+
project: binding.project,
|
|
117
|
+
baselineCommit: binding.baselineCommit,
|
|
118
|
+
...(binding.baselineHash ? { baselineHash: binding.baselineHash } : {}),
|
|
119
|
+
paths: [...binding.paths].sort(),
|
|
120
|
+
}));
|
|
121
|
+
return `<!-- ${exports.SOURCE_BINDINGS_MARKER}\n${JSON.stringify({ version: 1, sources }, null, 2)}\n-->`;
|
|
122
|
+
}
|
|
123
|
+
function upsertSkillSourceBindings(skillMd, bindings) {
|
|
124
|
+
const block = serializeSkillSourceBindings(bindings);
|
|
125
|
+
const re = new RegExp(`<!--\\s*${exports.SOURCE_BINDINGS_MARKER}\\s*[\\s\\S]*?-->`, 'm');
|
|
126
|
+
if (re.test(skillMd))
|
|
127
|
+
return skillMd.replace(re, block);
|
|
128
|
+
const frontmatter = /^---\r?\n[\s\S]*?\r?\n---\r?\n?/.exec(skillMd);
|
|
129
|
+
if (frontmatter) {
|
|
130
|
+
const head = frontmatter[0].replace(/\s*$/, '\n');
|
|
131
|
+
return `${head}\n${block}\n\n${skillMd.slice(frontmatter[0].length).replace(/^\s*/, '')}`;
|
|
132
|
+
}
|
|
133
|
+
return `${block}\n\n${skillMd}`;
|
|
134
|
+
}
|
|
135
|
+
function git(root, args) {
|
|
136
|
+
try {
|
|
137
|
+
return (0, proc_1.safeExecFileSync)('git', args, {
|
|
138
|
+
cwd: root,
|
|
139
|
+
encoding: 'utf-8',
|
|
140
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
141
|
+
}).trim();
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function gitOk(root, args) {
|
|
148
|
+
try {
|
|
149
|
+
(0, proc_1.safeExecFileSync)('git', args, { cwd: root, stdio: 'ignore' });
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function gitBuffer(root, args) {
|
|
157
|
+
try {
|
|
158
|
+
return (0, proc_1.safeExecFileSync)('git', args, {
|
|
159
|
+
cwd: root,
|
|
160
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function gitRoot(start) {
|
|
168
|
+
const out = git(start, ['rev-parse', '--show-toplevel']);
|
|
169
|
+
return out ? path.resolve(out) : null;
|
|
170
|
+
}
|
|
171
|
+
function splitLines(value) {
|
|
172
|
+
return (value || '').split(/\r?\n/).map(line => line.trim()).filter(Boolean);
|
|
173
|
+
}
|
|
174
|
+
function parseExplicitRoots() {
|
|
175
|
+
const out = new Map();
|
|
176
|
+
const raw = process.env.GREPRAG_SOURCE_ROOTS || '';
|
|
177
|
+
for (const entry of raw.split(/[;,]/)) {
|
|
178
|
+
const eq = entry.indexOf('=');
|
|
179
|
+
if (eq < 1)
|
|
180
|
+
continue;
|
|
181
|
+
const name = entry.slice(0, eq).trim().toLowerCase();
|
|
182
|
+
const dir = entry.slice(eq + 1).trim();
|
|
183
|
+
if (name && dir)
|
|
184
|
+
out.set(name, path.resolve(dir));
|
|
185
|
+
}
|
|
186
|
+
return out;
|
|
187
|
+
}
|
|
188
|
+
function rootNames(root) {
|
|
189
|
+
const names = new Set([path.basename(root).toLowerCase()]);
|
|
190
|
+
for (const rel of [path.join('.greprag', 'project.json'), path.join('.claude', 'project.json')]) {
|
|
191
|
+
try {
|
|
192
|
+
const raw = JSON.parse(fs.readFileSync(path.join(root, rel), 'utf-8'));
|
|
193
|
+
if (typeof raw.project_name === 'string' && raw.project_name.trim()) {
|
|
194
|
+
names.add(raw.project_name.trim().toLowerCase());
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch { /* no anchor name */ }
|
|
198
|
+
}
|
|
199
|
+
return names;
|
|
200
|
+
}
|
|
201
|
+
function resolveSourceRoot(project, cwd = process.cwd()) {
|
|
202
|
+
const wanted = project.toLowerCase();
|
|
203
|
+
const explicit = parseExplicitRoots().get(wanted);
|
|
204
|
+
if (explicit) {
|
|
205
|
+
const root = gitRoot(explicit);
|
|
206
|
+
if (root)
|
|
207
|
+
return root;
|
|
208
|
+
}
|
|
209
|
+
const cwdRoot = gitRoot(cwd) || path.resolve(cwd);
|
|
210
|
+
const candidates = [
|
|
211
|
+
cwdRoot,
|
|
212
|
+
path.join(path.dirname(cwdRoot), project),
|
|
213
|
+
path.join(path.parse(cwdRoot).root, project),
|
|
214
|
+
path.join(os.homedir(), project),
|
|
215
|
+
];
|
|
216
|
+
for (const candidate of candidates) {
|
|
217
|
+
if (!fs.existsSync(candidate))
|
|
218
|
+
continue;
|
|
219
|
+
const root = gitRoot(candidate);
|
|
220
|
+
if (!root)
|
|
221
|
+
continue;
|
|
222
|
+
if (rootNames(root).has(wanted))
|
|
223
|
+
return root;
|
|
224
|
+
}
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
function shortCommit(root, ref) {
|
|
228
|
+
return git(root, ['rev-parse', '--short', ref]) || ref.slice(0, 8);
|
|
229
|
+
}
|
|
230
|
+
function computeCommittedPathHash(root, ref, paths) {
|
|
231
|
+
const hash = crypto.createHash('sha256');
|
|
232
|
+
for (const rel of [...paths].sort()) {
|
|
233
|
+
hash.update(rel).update('\0');
|
|
234
|
+
const content = gitBuffer(root, ['show', `${ref}:${rel}`]);
|
|
235
|
+
hash.update(content === null ? Buffer.from('<missing>', 'utf8') : content).update('\0');
|
|
236
|
+
}
|
|
237
|
+
return hash.digest('hex');
|
|
238
|
+
}
|
|
239
|
+
function dirtyPaths(root, paths) {
|
|
240
|
+
const dirty = new Set();
|
|
241
|
+
for (const line of splitLines(git(root, ['diff', '--name-only', '--', ...paths])))
|
|
242
|
+
dirty.add(line);
|
|
243
|
+
for (const line of splitLines(git(root, ['diff', '--name-only', '--cached', '--', ...paths])))
|
|
244
|
+
dirty.add(line);
|
|
245
|
+
for (const line of splitLines(git(root, ['ls-files', '--others', '--exclude-standard', '--', ...paths])))
|
|
246
|
+
dirty.add(line);
|
|
247
|
+
return [...dirty].sort();
|
|
248
|
+
}
|
|
249
|
+
function analyzeProject(binding, cwd) {
|
|
250
|
+
const root = resolveSourceRoot(binding.project, cwd);
|
|
251
|
+
if (!root) {
|
|
252
|
+
return {
|
|
253
|
+
project: binding.project,
|
|
254
|
+
baselineCommit: binding.baselineCommit,
|
|
255
|
+
baselineHash: binding.baselineHash,
|
|
256
|
+
commitsAhead: 0,
|
|
257
|
+
changedPaths: [],
|
|
258
|
+
dirtyPaths: [],
|
|
259
|
+
status: 'unknown',
|
|
260
|
+
reason: 'local checkout not found',
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
if (!gitOk(root, ['cat-file', '-e', `${binding.baselineCommit}^{commit}`])) {
|
|
264
|
+
return {
|
|
265
|
+
project: binding.project,
|
|
266
|
+
root,
|
|
267
|
+
baselineCommit: binding.baselineCommit,
|
|
268
|
+
baselineHash: binding.baselineHash,
|
|
269
|
+
head: shortCommit(root, 'HEAD'),
|
|
270
|
+
commitsAhead: 0,
|
|
271
|
+
changedPaths: [],
|
|
272
|
+
dirtyPaths: dirtyPaths(root, binding.paths),
|
|
273
|
+
status: 'unknown',
|
|
274
|
+
reason: 'baseline commit not present locally',
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
const changedPaths = splitLines(git(root, ['diff', '--name-only', `${binding.baselineCommit}..HEAD`, '--', ...binding.paths]));
|
|
278
|
+
const dirty = dirtyPaths(root, binding.paths);
|
|
279
|
+
const countRaw = git(root, ['rev-list', '--count', `${binding.baselineCommit}..HEAD`, '--', ...binding.paths]) || '0';
|
|
280
|
+
const commitsAhead = Number.parseInt(countRaw, 10) || 0;
|
|
281
|
+
const committedStale = commitsAhead > 0 || changedPaths.length > 0;
|
|
282
|
+
return {
|
|
283
|
+
project: binding.project,
|
|
284
|
+
root,
|
|
285
|
+
baselineCommit: shortCommit(root, binding.baselineCommit),
|
|
286
|
+
baselineHash: binding.baselineHash,
|
|
287
|
+
head: shortCommit(root, 'HEAD'),
|
|
288
|
+
commitsAhead,
|
|
289
|
+
changedPaths,
|
|
290
|
+
dirtyPaths: dirty,
|
|
291
|
+
status: committedStale ? 'stale' : dirty.length > 0 ? 'dirty' : 'fresh',
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function analyzeSkillSourceDrift(skillName, skillMd, cwd = process.cwd()) {
|
|
295
|
+
const bindings = parseSkillSourceBindings(skillMd);
|
|
296
|
+
if (bindings.length === 0)
|
|
297
|
+
return null;
|
|
298
|
+
const projects = bindings.map(binding => analyzeProject(binding, cwd));
|
|
299
|
+
const status = projects.some(p => p.status === 'stale') ? 'stale'
|
|
300
|
+
: projects.some(p => p.status === 'dirty') ? 'dirty'
|
|
301
|
+
: projects.some(p => p.status === 'unknown') ? 'unknown'
|
|
302
|
+
: 'fresh';
|
|
303
|
+
return {
|
|
304
|
+
skillName,
|
|
305
|
+
status,
|
|
306
|
+
projects,
|
|
307
|
+
watchedPathCount: bindings.reduce((sum, binding) => sum + binding.paths.length, 0),
|
|
308
|
+
commitsAhead: projects.reduce((sum, project) => sum + project.commitsAhead, 0),
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
function plural(n, one, many = `${one}s`) {
|
|
312
|
+
return `${n} ${n === 1 ? one : many}`;
|
|
313
|
+
}
|
|
314
|
+
function previewPaths(paths, limit = 5) {
|
|
315
|
+
if (paths.length === 0)
|
|
316
|
+
return '';
|
|
317
|
+
const head = paths.slice(0, limit).join(', ');
|
|
318
|
+
return paths.length > limit ? `${head}, +${paths.length - limit}` : head;
|
|
319
|
+
}
|
|
320
|
+
function formatSkillSourceDrift(report, options = {}) {
|
|
321
|
+
if (!report)
|
|
322
|
+
return '';
|
|
323
|
+
if (!options.details && report.status === 'fresh')
|
|
324
|
+
return '';
|
|
325
|
+
const label = report.status === 'unknown'
|
|
326
|
+
? 'freshness unknown'
|
|
327
|
+
: report.status === 'dirty'
|
|
328
|
+
? 'source dirty'
|
|
329
|
+
: report.status;
|
|
330
|
+
const lines = [
|
|
331
|
+
'[greprag source drift - show this to the user before using this skill]',
|
|
332
|
+
`/${report.skillName} ${label} - ${plural(report.watchedPathCount, 'watched path')} - ${plural(report.commitsAhead, 'relevant commit')}`,
|
|
333
|
+
];
|
|
334
|
+
for (const project of report.projects) {
|
|
335
|
+
if (!options.details && project.status === 'fresh')
|
|
336
|
+
continue;
|
|
337
|
+
if (project.status === 'unknown') {
|
|
338
|
+
lines.push(`- ${project.project}: unknown - ${project.reason || 'no local evidence'} (${project.baselineCommit})`);
|
|
339
|
+
continue;
|
|
340
|
+
}
|
|
341
|
+
const changed = previewPaths(project.changedPaths);
|
|
342
|
+
const dirty = previewPaths(project.dirtyPaths);
|
|
343
|
+
const parts = [
|
|
344
|
+
`${project.baselineCommit} -> ${project.head || '?'}`,
|
|
345
|
+
plural(project.commitsAhead, 'commit'),
|
|
346
|
+
];
|
|
347
|
+
if (changed)
|
|
348
|
+
parts.push(`changed: ${changed}`);
|
|
349
|
+
if (dirty)
|
|
350
|
+
parts.push(`dirty: ${dirty}`);
|
|
351
|
+
if (project.status === 'fresh')
|
|
352
|
+
parts.push('fresh');
|
|
353
|
+
lines.push(`- ${project.project}: ${parts.join(' - ')}`);
|
|
354
|
+
}
|
|
355
|
+
if (report.status === 'stale' || report.status === 'dirty') {
|
|
356
|
+
lines.push('Action: read the changed watched files/diffs and use local source as truth before answering.');
|
|
357
|
+
}
|
|
358
|
+
if (report.projects.some(p => p.dirtyPaths.length > 0)) {
|
|
359
|
+
lines.push('Baseline rule: do not stamp a new baseline while watched local edits are dirty.');
|
|
360
|
+
}
|
|
361
|
+
if (report.status === 'unknown') {
|
|
362
|
+
lines.push('Action: say source freshness is unknown before relying on this skill\'s stateful claims.');
|
|
363
|
+
}
|
|
364
|
+
return lines.join('\n') + '\n';
|
|
365
|
+
}
|
|
366
|
+
function stampSourceBinding(params) {
|
|
367
|
+
const root = gitRoot(params.root);
|
|
368
|
+
if (!root)
|
|
369
|
+
throw new Error(`not a Git checkout: ${params.root}`);
|
|
370
|
+
const commit = git(root, ['rev-parse', params.baselineCommit || 'HEAD']);
|
|
371
|
+
if (!commit)
|
|
372
|
+
throw new Error(`baseline commit not found in ${root}`);
|
|
373
|
+
const paths = [...new Set(params.paths.map(normalizeRelPath).filter((p) => !!p))].sort();
|
|
374
|
+
if (paths.length === 0)
|
|
375
|
+
throw new Error('at least one safe relative --path is required');
|
|
376
|
+
const dirty = dirtyPaths(root, paths);
|
|
377
|
+
if (dirty.length > 0) {
|
|
378
|
+
throw new Error(`watched source paths have uncommitted changes: ${dirty.join(', ')}`);
|
|
379
|
+
}
|
|
380
|
+
const binding = {
|
|
381
|
+
project: params.project,
|
|
382
|
+
baselineCommit: commit,
|
|
383
|
+
baselineHash: computeCommittedPathHash(root, commit, paths),
|
|
384
|
+
paths,
|
|
385
|
+
};
|
|
386
|
+
const others = parseSkillSourceBindings(params.skillMd).filter(b => b.project !== params.project);
|
|
387
|
+
return { content: upsertSkillSourceBindings(params.skillMd, [...others, binding]), binding };
|
|
388
|
+
}
|
|
389
|
+
//# sourceMappingURL=skill-source-drift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-source-drift.js","sourceRoot":"","sources":["../src/skill-source-drift.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;GAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgEH,4DAgBC;AAMD,oEAQC;AAED,8DAWC;AAqED,8CAsBC;AAMD,4DAQC;AAyDD,0DAmBC;AAYD,wDA6CC;AAED,gDAyBC;AAlXD,+CAAiC;AACjC,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,iCAA0C;AAE7B,QAAA,sBAAsB,GAAG,yBAAyB,CAAC;AA8BhE,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AACvD,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAY;IACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACtE,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/E,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACvF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AAK;KACN,CAAC;IACF,MAAM,MAAM,GAAG,wBAAwB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,OAAO,CAAC,CAAC;IAClG,OAAO,EAAE,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC;AAC/F,CAAC"}
|
package/package.json
CHANGED
|
@@ -24,8 +24,9 @@ archive clearance (`Clearance: safe to archive` or `Clearance: keep open because
|
|
|
24
24
|
cleanup.
|
|
25
25
|
One landing exception (adr/codex-landing-doctrine.md): a mission whose first
|
|
26
26
|
line begins `FIX:` (from `greprag fix spawn`) self-lands per its Phase 3 —
|
|
27
|
-
peer-confer, merge its own branch to main,
|
|
28
|
-
cleanup stays native (archive clearance) and
|
|
27
|
+
peer-confer, attribute repository dirtiness, merge its own branch to main,
|
|
28
|
+
native reply as an FYI — while cleanup stays native (archive clearance) and
|
|
29
|
+
push/release stays operator-gated.
|
|
29
30
|
All other chip shapes keep the parent-owned landing above.
|
|
30
31
|
Use `greprag send` only for durable cross-harness or fallback messaging; confirm
|
|
31
32
|
delivery with a real peer response, not a stored row or a completed empty turn.
|
package/skill/mechanic/SKILL.md
CHANGED
|
@@ -73,7 +73,7 @@ Same gate the hourly compactor applies at write-time — Mechanic and compactor
|
|
|
73
73
|
- **Never edit `~/.claude/docs/chip-spawn.md` without confirm.** Global rules are sticky.
|
|
74
74
|
- **Cross-project carve-out.** Default to the current project (resolved via `greprag fix list`). The Phase 0 census MAY read sibling queues to show where fixes piled up; *draining* one requires the operator to name it, and every `add`/`delete` against it MUST carry `--project <that-project>`. Never touch a sibling silently.
|
|
75
75
|
- **Harness scope is mandatory.** Friction carries its source harness (`claude-code`, `codex`, `opencode`). Repairs to hooks/skills/watchers must target that harness with `greprag mechanic install ... --harness <name>`. In a Codex session, default to `--harness codex`; use `--harness all` only for deliberately portable mechanisms.
|
|
76
|
-
- **Coordinate with peer Mechanics before repo gates.** Assume other Mechanic chips or repair sessions may be active in the same repo. Before merging, pushing, deploying, publishing, tagging, or cutting a release, inspect live peers/worktrees and coordinate ownership/status with them. If another Mechanic owns overlapping files, surfaces, or release scope, stop and get an explicit handoff/confirmation before taking over, merging, or shipping their patch. A `send_message_to_thread` call, `greprag send`, stored row, or completed empty turn is not proof of coordination; require an actual peer response or another verifiable status signal, and report unconfirmed peers as a caveat. Do not treat a clean current checkout as proof the whole repo is clear.
|
|
76
|
+
- **Coordinate with peer Mechanics before repo gates.** Assume other Mechanic chips or repair sessions may be active in the same repo. Before merging, pushing, deploying, publishing, tagging, or cutting a release, inspect live peers/worktrees and coordinate ownership/status with them. Attribute repository dirtiness before crossing the boundary: every dirty file is yours, a peer's, or pre-existing user work; resolve or explicitly claim any unowned dirt. If another Mechanic owns overlapping files, surfaces, or release scope, stop and get an explicit handoff/confirmation before taking over, merging, or shipping their patch. A `send_message_to_thread` call, `greprag send`, stored row, or completed empty turn is not proof of coordination; require an actual peer response or another verifiable status signal, and report unconfirmed peers as a caveat. Do not treat a clean current checkout as proof the whole repo is clear.
|
|
77
77
|
|
|
78
78
|
## Codex Mechanic chip handoff
|
|
79
79
|
|
|
@@ -107,4 +107,4 @@ Chips never `npm link` from the worktree — dangling symlinks silently break th
|
|
|
107
107
|
|
|
108
108
|
When you (the parent) merge a chip branch — via `/commit` or raw `git merge` — prune in the same breath: junction guard (`~/.claude/skills/commit/guard-junctions.sh <worktree>`), `git worktree remove .claude/worktrees/<slug>`, and `git branch -d chip/<slug>` once merged. Deferred cleanup = stale worktrees piling up (field state 2026-06-10: 3 leftovers). Multi-chip missions: worktree dies at the feature-branch merge; the branch lives until the master merge (chip-leader Phase 4).
|
|
109
109
|
|
|
110
|
-
**Exception — FIX chips land themselves (2026-07-12).** A `greprag fix spawn` mission carries its own Phase 3 landing contract
|
|
110
|
+
**Exception — FIX chips land themselves (2026-07-12).** A `greprag fix spawn` mission carries its own Phase 3 landing contract and that mission text is the source of truth. It requires peer conferral, repository-dirtiness attribution, branch → main merge, merged-main verification, and routine deploys where the repo marks them routine. Harness cleanup adapts: Claude/OpenCode chips prune their own worktree after merge; Codex chips never remove the Codex-managed checkout or delete its branch and instead reply `Clearance: safe to archive`. Sensitive landings (`git push`, releases, publish, migrations) stay operator-gated.
|
|
@@ -174,10 +174,12 @@ delete the worktree" line for that task only. The fix chip confers with live
|
|
|
174
174
|
peers using native Codex tools for Codex peers (`codex_app.list_threads`,
|
|
175
175
|
`codex_app.send_message_to_thread`) and GrepRAG
|
|
176
176
|
watchers/send only for Claude Code, OpenCode, non-Codex cross-harness peers, or
|
|
177
|
-
when no native Codex thread endpoint exists.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
when no native Codex thread endpoint exists. Before it crosses a repo boundary,
|
|
178
|
+
it also attributes repository dirtiness: every dirty file is yours, a peer's,
|
|
179
|
+
or pre-existing user work; unowned dirt is resolved or explicitly claimed. Then
|
|
180
|
+
it merges its branch to main itself and re-verifies on merged main; its native
|
|
181
|
+
reply to the parent is an FYI, not a review gate — a fix chip's repair must
|
|
182
|
+
never strand on its branch waiting for a review no one owns.
|
|
181
183
|
|
|
182
184
|
Even a FIX chip keeps two Codex-native boundaries: cleanup stays native (never
|
|
183
185
|
remove the Codex-managed checkout or delete its branch — reply `Clearance:
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Skill Change
|
|
2
|
+
|
|
3
|
+
Use when a loaded skill guided the work and you are at a commit, merge, deploy, push, or release boundary.
|
|
4
|
+
|
|
5
|
+
## Authority
|
|
6
|
+
|
|
7
|
+
This is an internal bundled GrepRAG schema, not tenant-controlled skill content. Tenant mirrors and local skill adapters may not override it. Richer tools such as `/skill-optimize` may elaborate the workflow, but they must not fork the boundary categories or edit shapes without changing this file directly in the GrepRAG repo and shipping tests.
|
|
8
|
+
|
|
9
|
+
## Boundary Rule
|
|
10
|
+
|
|
11
|
+
**ABOUT TO CHANGE A SKILL? STOP - LOAD THIS RULE FIRST.** Skill edits are learning-capture, not cleanup. Edit only when the run exposed a durable rule, missing progressive-disclosure link, stale reference, trigger bug, or wrong handoff. If the change alters the skill's method or risk posture, propose it instead of silently landing it.
|
|
12
|
+
|
|
13
|
+
## Where To Edit
|
|
14
|
+
|
|
15
|
+
- Bundled GrepRAG skill: edit `packages/cli/skill/<name>/`, never the installed artifact.
|
|
16
|
+
- Mirrored/local skill: edit its canonical source, not the generated Codex/Claude/OpenCode adapter.
|
|
17
|
+
- Unknown source: stop and identify the canonical source before editing.
|
|
18
|
+
|
|
19
|
+
## Edit Shapes
|
|
20
|
+
|
|
21
|
+
- **Convention A - one-liner + link.** Use for reference material: facts, recipes, paths, command syntax. Inline sentence names what the linked doc contains and its path.
|
|
22
|
+
- **Convention B - loud trigger + inline rule + optional link.** Use for proactive-fire rules. Shape: `ABOUT TO <do X>? STOP - <complete rule>.` Link only for full procedure.
|
|
23
|
+
|
|
24
|
+
## Auto-Land vs Propose
|
|
25
|
+
|
|
26
|
+
Auto-land only narrow, low-risk edits:
|
|
27
|
+
|
|
28
|
+
- add a missing trigger phrase or `NOT for` boundary
|
|
29
|
+
- repoint a verified stale path/name/command
|
|
30
|
+
- add a missing progressive-disclosure link
|
|
31
|
+
- convert skipped wallpaper prose into Convention B without changing meaning
|
|
32
|
+
- add one gotcha rule that directly follows from the run
|
|
33
|
+
|
|
34
|
+
Propose instead:
|
|
35
|
+
|
|
36
|
+
- method changes
|
|
37
|
+
- broader scope changes
|
|
38
|
+
- new autonomy/destructive behavior
|
|
39
|
+
- ambiguous doctrine
|
|
40
|
+
- anything that would need user taste, strategy, or risk judgment
|
|
41
|
+
|
|
42
|
+
## Defect Map
|
|
43
|
+
|
|
44
|
+
- Mis-route: update `description` / `Use when` / `NOT for`.
|
|
45
|
+
- Wrong altitude: add a handoff or out-of-scope line naming the delegate.
|
|
46
|
+
- Flattened relay: add a Convention-B relay-fidelity rule.
|
|
47
|
+
- Wallpaper rule: rewrite the existing rule to Convention B.
|
|
48
|
+
- Stale reference: verify and repoint; remove only if wholly dead.
|
|
49
|
+
- Missing rule: add one Convention-B gotcha rule at the point the agent meets it.
|
|
50
|
+
|
|
51
|
+
## Guardrails
|
|
52
|
+
|
|
53
|
+
- One learning, one edit.
|
|
54
|
+
- Do not grow `SKILL.md` unless adding a real per-task step or proactive-fire rule.
|
|
55
|
+
- Show the diff before finalizing if the operator has not already authorized the exact edit.
|
|
56
|
+
- Out of taxonomy: `greprag fix spawn "<skill friction unit>"`.
|