run402 4.63.0 → 4.63.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/gitvault-surface.json
CHANGED
|
@@ -408,6 +408,23 @@ export function shouldRunAutoGc(threshold, generationsSinceCheckpoint) {
|
|
|
408
408
|
return Number.isFinite(threshold) && threshold > 0 && Number.isFinite(generationsSinceCheckpoint) && generationsSinceCheckpoint >= threshold;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
+
/**
|
|
412
|
+
* The auto-gc cycle's `compact()`/`prune()` target — exported standalone,
|
|
413
|
+
* same reasoning as `shouldRunAutoGc` above, because the merge itself was
|
|
414
|
+
* the bug: `GitvaultVaultHandleOptions.repo_dir` defaults to
|
|
415
|
+
* `process.cwd()` only in CALLER convention, never inside the SDK's own
|
|
416
|
+
* `open()` (which sets it ONLY when `options.repo_dir !== undefined`).
|
|
417
|
+
* Building the auto-gc target from `{ ...target }` alone — omitting
|
|
418
|
+
* `repo_dir` — made every real post-push auto-gc cycle fail closed with
|
|
419
|
+
* `GITVAULT_REPO_DIR_REQUIRED`, silently degrading to the advisory on
|
|
420
|
+
* EVERY push, live in production shape, until a push-latency guard bench
|
|
421
|
+
* finally drove the real trigger path (found 2026-08-31; `repos gc`'s CLI
|
|
422
|
+
* wrapper passes repo_dir explicitly and never hit this).
|
|
423
|
+
*/
|
|
424
|
+
export function buildAutoGcCompactionTarget(target, repoDir) {
|
|
425
|
+
return { ...target, repo_dir: repoDir };
|
|
426
|
+
}
|
|
427
|
+
|
|
411
428
|
async function main(argv, { onBackgroundWork } = {}) {
|
|
412
429
|
// gitvault-connection-amortization (bench P5) note: the prewarm now fires
|
|
413
430
|
// at the module TOP, before the SDK graph loads (gitvault-startup-
|
|
@@ -741,10 +758,19 @@ async function main(argv, { onBackgroundWork } = {}) {
|
|
|
741
758
|
}
|
|
742
759
|
if (!shouldRunAutoGc(threshold, generationsSinceCheckpoint)) return;
|
|
743
760
|
|
|
761
|
+
// `compact()`/`prune()` never default repo_dir to process.cwd() —
|
|
762
|
+
// GitvaultVaultHandleOptions's own doc comment describes CALLER
|
|
763
|
+
// convention, not an SDK fallback (`open()` only sets repo_dir when
|
|
764
|
+
// `options.repo_dir !== undefined`). Omitting it here made every real
|
|
765
|
+
// post-push auto-gc cycle fail closed with GITVAULT_REPO_DIR_REQUIRED,
|
|
766
|
+
// silently degrading to the advisory on every push (found live,
|
|
767
|
+
// 2026-08-31, via a push-latency guard bench that finally drove the
|
|
768
|
+
// ACTUAL trigger path instead of a synthetic `repos gc` invocation).
|
|
769
|
+
const compactionTarget = buildAutoGcCompactionTarget(target, repoDir);
|
|
744
770
|
const runCycle = async () => {
|
|
745
771
|
const sdk = getCachedSdk();
|
|
746
|
-
const checkpoint = await sdk.gitvault.compact({ ...
|
|
747
|
-
const prune = await sdk.gitvault.prune(
|
|
772
|
+
const checkpoint = await sdk.gitvault.compact({ ...compactionTarget });
|
|
773
|
+
const prune = await sdk.gitvault.prune(compactionTarget); // PLAN only — never `submit`; see compact()'s own grant-close doc comment for why prune needs no headroom of its own
|
|
748
774
|
return { checkpoint, prune };
|
|
749
775
|
};
|
|
750
776
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "run402",
|
|
3
|
-
"version": "4.63.
|
|
3
|
+
"version": "4.63.1",
|
|
4
4
|
"description": "CLI for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|