gcf-aif-ext 0.12.1 → 0.12.2
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/extension.json +1 -1
- package/lib/integrate.js +11 -3
- package/package.json +1 -1
package/extension.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/lee-to/ai-factory/2.x/schemas/extension.schema.json",
|
|
3
3
|
"name": "gcf-aif-ext",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.2",
|
|
5
5
|
"description": "Game Context Framework for AI Factory",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills/gcf-init",
|
package/lib/integrate.js
CHANGED
|
@@ -39,6 +39,14 @@ export async function excludeSession(projectDir) {
|
|
|
39
39
|
|
|
40
40
|
const METRICS = ':(exclude)gcf/.metrics';
|
|
41
41
|
|
|
42
|
+
/** A worktree's own audit and context lines in gcf/.metrics are no work to keep: dropped. */
|
|
43
|
+
function dropLogs(dir) {
|
|
44
|
+
// Staged ones too: checkout restores from the index.
|
|
45
|
+
git(dir, ['reset', '-q', '--', 'gcf/.metrics'], { check: false });
|
|
46
|
+
git(dir, ['checkout', '--', 'gcf/.metrics'], { check: false });
|
|
47
|
+
git(dir, ['clean', '-fdq', '--', 'gcf/.metrics'], { check: false });
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
/**
|
|
43
51
|
* A merge stopped on gcf/INDEX.md alone: both sides counted something (an inbox entry a branch
|
|
44
52
|
* added, a move on main). The index is generated, so it is written again and the merge goes on,
|
|
@@ -69,6 +77,8 @@ async function mergedPastIndex(dir) {
|
|
|
69
77
|
async function syncWithMain(projectDir, dir) {
|
|
70
78
|
const main = git(projectDir, ['rev-parse', '--abbrev-ref', 'HEAD']).out;
|
|
71
79
|
if (main === 'HEAD' || main.startsWith('work/')) return {};
|
|
80
|
+
// An earlier run's lines in the worktree's logs would stop main's newer logs merging in.
|
|
81
|
+
dropLogs(dir);
|
|
72
82
|
const res = git(dir, ['merge', '--no-edit', '-m', `gcf(sync): ${main}`, main], { check: false });
|
|
73
83
|
if (res.ok || (await mergedPastIndex(dir))) return {};
|
|
74
84
|
if (git(dir, ['rev-parse', '-q', '--verify', 'MERGE_HEAD'], { check: false }).ok)
|
|
@@ -151,9 +161,7 @@ function cleanUp(projectDir, id, { force = false } = {}) {
|
|
|
151
161
|
const notes = [];
|
|
152
162
|
const dir = worktreeOf(projectDir, id);
|
|
153
163
|
if (existsSync(dir)) {
|
|
154
|
-
|
|
155
|
-
git(dir, ['checkout', '--', 'gcf/.metrics'], { check: false });
|
|
156
|
-
git(dir, ['clean', '-fdq', '--', 'gcf/.metrics'], { check: false });
|
|
164
|
+
dropLogs(dir);
|
|
157
165
|
const res = git(projectDir, ['worktree', 'remove', dir], { check: false });
|
|
158
166
|
if (!res.ok) notes.push(`worktree kept: ${res.err}`);
|
|
159
167
|
}
|