grepmax 0.26.75 → 0.26.77
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.
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"name": "grepmax",
|
|
11
11
|
"source": "./plugins/grepmax",
|
|
12
12
|
"description": "Semantic code search for Claude Code. Automatically indexes your project and provides intelligent search capabilities.",
|
|
13
|
-
"version": "0.26.
|
|
13
|
+
"version": "0.26.77",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "Robert Owens",
|
|
16
16
|
"email": "robowens@me.com"
|
package/README.md
CHANGED
|
@@ -532,6 +532,8 @@ Production recovery currently requires macOS, a persistent `autostart-disabled`
|
|
|
532
532
|
|
|
533
533
|
The child waits for launch and deletion admission tokens, with verified helper PID/start identity recorded as the primary exclusive owner. Existing readers retain exclusion if the parent dies while the helper is alive. Current/tagged/post-cutoff metadata is verified after pruning; recovery refuses more than 256 protected versions before deletion to bound verification. Interrupted attempts require verification and explicit acknowledgement before retry. Linux/APFS fixtures exercise native retention and interruption; supported production host admission is tested separately and still runs freshly for each operation.
|
|
534
534
|
|
|
535
|
+
If a short-lived client child exits during memory sampling, confirmed dead processes can leave the sample while all surviving processes retain measured footprints. An uncertain exit, new process or changed identity requires a complete fresh measurement; a normal-pressure sample may do that once within the original deadline. It never accepts an unmeasured live process. Continued changes, unavailable measurements, and observed warning or critical pressure still refuse admission.
|
|
536
|
+
|
|
535
537
|
For an operator-coordinated recovery window:
|
|
536
538
|
|
|
537
539
|
1. Check live host pressure and service availability first. Keep development online when recovery admission is already known to refuse. Preserve the configured normal-service policy and any pre-existing safety markers.
|
|
@@ -130,9 +130,40 @@ function parseBatchFootprints(output) {
|
|
|
130
130
|
return result;
|
|
131
131
|
}
|
|
132
132
|
function sampleHostResources(extraPids = [], overrides = {}, extraGroups = []) {
|
|
133
|
+
var _a, _b;
|
|
134
|
+
const monotonic = (_a = overrides.monotonic) !== null && _a !== void 0 ? _a : (() => performance.now());
|
|
135
|
+
const deadline = monotonic() + ((_b = overrides.sampleTimeoutMs) !== null && _b !== void 0 ? _b : exports.HOST_SAMPLE_TIMEOUT_MS);
|
|
136
|
+
let snapshot;
|
|
137
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
138
|
+
snapshot = sampleHostResourcesOnce(extraPids, Object.assign(Object.assign({}, overrides), { monotonic, sampleTimeoutMs: Math.max(0, deadline - monotonic()) }), extraGroups);
|
|
139
|
+
// Short-lived client children routinely exit during footprint sampling.
|
|
140
|
+
// Re-measure the entire cohort once, within the original deadline. Never
|
|
141
|
+
// accept a partial total or retry away observed warning/critical pressure.
|
|
142
|
+
if (attempt === 1 ||
|
|
143
|
+
snapshot.memoryPressure !== "normal" ||
|
|
144
|
+
snapshot.kernelPressure !== "ok" ||
|
|
145
|
+
snapshot.incompleteReasons.length !== 1 ||
|
|
146
|
+
snapshot.incompleteReasons[0] !==
|
|
147
|
+
"process inventory changed during sample" ||
|
|
148
|
+
monotonic() >= deadline)
|
|
149
|
+
return snapshot;
|
|
150
|
+
}
|
|
151
|
+
return snapshot;
|
|
152
|
+
}
|
|
153
|
+
function sampleHostResourcesOnce(extraPids, overrides, extraGroups) {
|
|
133
154
|
var _a;
|
|
134
155
|
var _b, _c;
|
|
135
|
-
const deps = Object.assign({ platform: process.platform, pid: process.pid, uid: (_b = (_a = process.getuid) === null || _a === void 0 ? void 0 : _a.call(process)) !== null && _b !== void 0 ? _b : -1, now: Date.now, monotonic: () => performance.now(), freeBytes: os.freemem,
|
|
156
|
+
const deps = Object.assign({ platform: process.platform, pid: process.pid, uid: (_b = (_a = process.getuid) === null || _a === void 0 ? void 0 : _a.call(process)) !== null && _b !== void 0 ? _b : -1, now: Date.now, monotonic: () => performance.now(), freeBytes: os.freemem, processAlive: (pid) => {
|
|
157
|
+
try {
|
|
158
|
+
process.kill(pid, 0);
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
if (error.code === "ESRCH")
|
|
163
|
+
return false;
|
|
164
|
+
throw new Error("process liveness unavailable");
|
|
165
|
+
}
|
|
166
|
+
}, sampleTimeoutMs: exports.HOST_SAMPLE_TIMEOUT_MS, kernelProbeTimeoutMs: 500, run: (command, args, timeoutMs) => (0, node_child_process_1.execFileSync)(command, args, {
|
|
136
167
|
encoding: "utf8",
|
|
137
168
|
timeout: timeoutMs,
|
|
138
169
|
maxBuffer: 512 * 1024,
|
|
@@ -203,8 +234,19 @@ function sampleHostResources(extraPids = [], overrides = {}, extraGroups = []) {
|
|
|
203
234
|
p.role,
|
|
204
235
|
];
|
|
205
236
|
if (JSON.stringify(after.map(identity)) !==
|
|
206
|
-
JSON.stringify(snapshot.processes.map(identity)))
|
|
207
|
-
|
|
237
|
+
JSON.stringify(snapshot.processes.map(identity))) {
|
|
238
|
+
// A verified exit releases memory. It need not invalidate measured
|
|
239
|
+
// survivors, even when the exiting child's footprint is unavailable.
|
|
240
|
+
// Additions, reuse, reparenting and uncertain liveness still require a
|
|
241
|
+
// complete fresh measurement; never treat them as zero-memory exits.
|
|
242
|
+
const previous = new Map(snapshot.processes.map((p) => [p.pid, p]));
|
|
243
|
+
if (after.some((p) => !previous.has(p.pid) ||
|
|
244
|
+
JSON.stringify(identity(p)) !==
|
|
245
|
+
JSON.stringify(identity(previous.get(p.pid)))) ||
|
|
246
|
+
snapshot.processes.some((p) => !after.some((q) => q.pid === p.pid) && deps.processAlive(p.pid)))
|
|
247
|
+
throw new Error("process inventory changed during sample");
|
|
248
|
+
snapshot.processes = after.map((p) => { var _a; return (Object.assign(Object.assign({}, p), { footprintMb: (_a = footprints.get(p.pid)) !== null && _a !== void 0 ? _a : null })); });
|
|
249
|
+
}
|
|
208
250
|
if (snapshot.processes.some((p) => p.footprintMb === null))
|
|
209
251
|
throw new Error("process footprint unavailable");
|
|
210
252
|
snapshot.aggregateFootprintMb = snapshot.processes.reduce((sum, p) => sum + p.footprintMb, 0);
|
package/package.json
CHANGED