@quolu/lattice 0.67.2 → 0.67.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quolu/lattice",
|
|
3
|
-
"version": "0.67.
|
|
3
|
+
"version": "0.67.3",
|
|
4
4
|
"description": "Schedulability compiler for multi-agent development: observe real code boundaries, refactor the conflicting seam, recompile the plan for parallel execution",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Quo / クオ at kitepon.dev",
|
|
@@ -23,33 +23,6 @@ const MAX_TRACKED_FILE_BYTES = 4_194_304;
|
|
|
23
23
|
const GIT_SHA1 = /^[0-9a-f]{40}$/;
|
|
24
24
|
const LINE_ID = /^[0-9A-Za-z](?:[0-9A-Za-z._-]{0,127})$/;
|
|
25
25
|
|
|
26
|
-
/**
|
|
27
|
-
* gitignore 済みのコンパイラ/ツール出力 directory 名。
|
|
28
|
-
* 観測から外すのは ignored かつこの segment を持つ path だけ。
|
|
29
|
-
* tracked な `bin/`(CLI の正本)は status code が `!!` ではないので残る。
|
|
30
|
-
* gitignore 迂回の検知(ignored なソース相当 file)は残す。
|
|
31
|
-
*/
|
|
32
|
-
export const GENERATED_OUTPUT_DIR_NAMES = Object.freeze([
|
|
33
|
-
'obj', 'bin', 'node_modules', '.vs', 'TestResults',
|
|
34
|
-
'__pycache__', '.pytest_cache', 'dist', 'coverage',
|
|
35
|
-
]);
|
|
36
|
-
|
|
37
|
-
export function isGeneratedOutputPath(relativePath) {
|
|
38
|
-
if (typeof relativePath !== 'string' || relativePath.length === 0) return false;
|
|
39
|
-
return relativePath.replace(/\/$/u, '').split('/').some(
|
|
40
|
-
(segment) => GENERATED_OUTPUT_DIR_NAMES.includes(segment),
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function isIgnoredStatus(code) {
|
|
45
|
-
return typeof code === 'string' && code.includes('!');
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function keepObservedEntry(entry) {
|
|
49
|
-
if (!isIgnoredStatus(entry.code)) return true;
|
|
50
|
-
return !isGeneratedOutputPath(entry.path);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
26
|
function fail(reason) {
|
|
54
27
|
throw new TypeError(`diff observer契約違反: ${reason}`);
|
|
55
28
|
}
|
|
@@ -199,14 +172,12 @@ export async function captureWorktreeDiff(options = {}) {
|
|
|
199
172
|
fail(`worktree HEADがbaseの子孫でない(reset・branch切替・rebase): ${head}`);
|
|
200
173
|
}
|
|
201
174
|
}
|
|
202
|
-
//
|
|
203
|
-
//
|
|
204
|
-
// ただし obj/bin/node_modules 等のコンパイラ出力は成果ではない。
|
|
205
|
-
// 展開すると MAX_DIFF_ENTRIES を踏み、accept が undeclared_write で hold する。
|
|
175
|
+
// gitignore済みfileは観測しない(オーナー裁定 2026-08-29: gitignore迂回という脅威は
|
|
176
|
+
// 実在せず、ignored観測はツールキャッシュで正当なacceptをholdする実害だけを生んだ)。
|
|
206
177
|
const statusBytes = await run('git', [
|
|
207
|
-
'status', '--porcelain=v1', '-z', '--untracked-files=all',
|
|
178
|
+
'status', '--porcelain=v1', '-z', '--untracked-files=all',
|
|
208
179
|
], worktreePath);
|
|
209
|
-
const entries = statusEntries(statusBytes)
|
|
180
|
+
const entries = statusEntries(statusBytes);
|
|
210
181
|
// commit済みの変更はstatusへ出ない。base..HEADの範囲も観測へ入れないと、
|
|
211
182
|
// commitした瞬間に変更が観測から消える。
|
|
212
183
|
if (head !== baseSha) {
|
|
@@ -221,28 +192,7 @@ export async function captureWorktreeDiff(options = {}) {
|
|
|
221
192
|
if (entries.length > MAX_DIFF_ENTRIES) {
|
|
222
193
|
fail(`diff entry数が上限を超える: ${entries.length}`);
|
|
223
194
|
}
|
|
224
|
-
|
|
225
|
-
// (集約のまま扱うとdirectoryをspecial file扱いで落とし、write pathを特定できない)。
|
|
226
|
-
const expanded = [];
|
|
227
|
-
for (const entry of entries) {
|
|
228
|
-
if (isIgnoredStatus(entry.code) && isGeneratedOutputPath(entry.path)) continue;
|
|
229
|
-
if (!entry.path.endsWith('/')) {
|
|
230
|
-
expanded.push(entry);
|
|
231
|
-
continue;
|
|
232
|
-
}
|
|
233
|
-
const inner = await run('git', [
|
|
234
|
-
'ls-files', '--others', '--ignored', '--exclude-standard', '-z', '--', entry.path,
|
|
235
|
-
], worktreePath);
|
|
236
|
-
for (const innerPath of inner.toString('utf8').split('\0')) {
|
|
237
|
-
if (innerPath.length === 0) continue;
|
|
238
|
-
const innerEntry = { path: innerPath, code: entry.code };
|
|
239
|
-
if (!keepObservedEntry(innerEntry)) continue;
|
|
240
|
-
expanded.push(innerEntry);
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
if (expanded.length > MAX_DIFF_ENTRIES) {
|
|
244
|
-
fail(`diff entry数が上限を超える: ${expanded.length}`);
|
|
245
|
-
}
|
|
195
|
+
const expanded = entries;
|
|
246
196
|
const seen = new Set();
|
|
247
197
|
const records = [];
|
|
248
198
|
for (const entry of expanded) {
|