Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: use portable Git paths for archive verification
[._.]/ Adam Eivy620b75e2624b
diff --git a/server/services/heldCheckoutRecovery.js b/server/services/heldCheckoutRecovery.jsindex e2a8a135fe..d826c3bc82 100644--- a/server/services/heldCheckoutRecovery.js+++ b/server/services/heldCheckoutRecovery.js@@ -21,7 +21,7 @@import { findGoneInventoryRows } from './branchReconcileInventoryPrune.js';import { createReadStream, realpathSync } from 'node:fs';import { lstat, stat, readlink, readdir, readFile, chmod, open, mkdtemp } from 'node:fs/promises';-import { devNull, tmpdir } from 'node:os';+import { tmpdir } from 'node:os';import { createHash, randomUUID } from 'node:crypto';import { basename, dirname, isAbsolute, join, resolve, relative, sep } from 'node:path';import { sameRetirementCheckout, unresolvedRetirements } from '../lib/reconcileRetirementEvidence.js';@@ -129,9 +129,11 @@ async function verifyHeldArchive(repoPath, dir, release) {// Bundle verify/list-heads validate headers, not packed object integrity. Prove// the complete closure without borrowing any object from the live repository.const scratch = await mkdtemp(join(tmpdir(), 'portos-retirement-proof-'));+ // Git recognizes /dev/null on Windows too; Node's device-namespace spelling+ // is not a portable Git configuration path.const env = { ...Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.toUpperCase().startsWith('GIT_'))),- GIT_CONFIG_NOSYSTEM: '1', GIT_CONFIG_GLOBAL: devNull, GIT_NO_REPLACE_OBJECTS: '1', GIT_NO_LAZY_FETCH: '1', GIT_TERMINAL_PROMPT: '0' };- const prove = args => execGit(['--no-optional-locks', '-c', `core.hooksPath=${devNull}`, '-c', 'core.fsmonitor=false', ...args], scratch,+ GIT_CONFIG_NOSYSTEM: '1', GIT_CONFIG_GLOBAL: '/dev/null', GIT_NO_REPLACE_OBJECTS: '1', GIT_NO_LAZY_FETCH: '1', GIT_TERMINAL_PROMPT: '0' };+ const prove = args => execGit(['--no-optional-locks', '-c', 'core.hooksPath=/dev/null', '-c', 'core.fsmonitor=false', ...args], scratch,{ env, maxBuffer: GIT_OUTPUT_BYTES });try {await prove(['init', '--bare', `--object-format=${release.head.length === 64 ? 'sha256' : 'sha1'}`, '.']);diff --git a/server/services/heldCheckoutRecovery.test.js b/server/services/heldCheckoutRecovery.test.jsindex b52abc04f9..1abe1bff39 100644--- a/server/services/heldCheckoutRecovery.test.js+++ b/server/services/heldCheckoutRecovery.test.js@@ -20,7 +20,7 @@ vi.mock('../lib/paths.js', async importOriginal => makePathsProxy(await importOrafterAll(cleanupTempDataRoots);const SYMLINKS = process.platform !== 'win32';-const injected = vi.hoisted(() => ({ policies: [], schedule: null, app: null, fetchRemote: null, fetches: [], onBundle: null, onEvidence: null }));+const injected = vi.hoisted(() => ({ policies: [], schedule: null, app: null, fetchRemote: null, fetches: [], onBundle: null, onEvidence: null, proofFailures: [] }));vi.mock('../lib/execGit.js', async importOriginal => {const actual = await importOriginal();@@ -32,7 +32,15 @@ vi.mock('../lib/execGit.js', async importOriginal => {injected.fetches.push({ args, options });if (injected.fetchRemote) args = args.map(arg => arg === 'https://github.com/example/repo.git' ? injected.fetchRemote : arg);}- return actual.execGit(args, cwd, options);+ try {+ return await actual.execGit(args, cwd, options);+ } catch (error) {+ // Report only the failed proof phase, never native stderr with host paths.+ if (options?.env?.GIT_NO_REPLACE_OBJECTS === '1') {+ injected.proofFailures.push(args.includes('init') ? 'init' : args.includes('unbundle') ? 'unbundle' : 'fsck');+ }+ throw error;+ }} };});vi.mock('./forgeExecOptions.js', () => ({ resolveForgeExecOptions: async () => ({ env: { ...process.env, GH_TOKEN: 'synthetic-account-token' } }) }));@@ -62,7 +70,7 @@ describe.skipIf(SKIP_HEAVY_INTEGRATION)('held checkout recovery (real git)', ()const noOwners = async () => [];beforeEach(async () => {- Object.assign(injected, { policies: [], schedule: { executions: {} }, app: { id: 'app-1', repoPath: null }, fetchRemote: null, fetches: [], onBundle: null, onEvidence: null });+ Object.assign(injected, { policies: [], schedule: { executions: {} }, app: { id: 'app-1', repoPath: null }, fetchRemote: null, fetches: [], onBundle: null, onEvidence: null, proofFailures: [] });scratch = realpathSync(await mkdtemp(join(tmpdir(), 'portos-held-checkout-')));const safeRepo = join(scratch, 'repo');await mkdir(safeRepo);@@ -123,7 +131,7 @@ describe.skipIf(SKIP_HEAVY_INTEGRATION)('held checkout recovery (real git)', ()const { release, saved } = await historicalArchive();const before = (await execGit(['show-ref'], repo)).stdout;const outcome = await recordBranchReconcileOutcome('app-1', { status: 'incomplete', remaining: [] });- expect(outcome.retirementObligations).toEqual([]);+ expect(outcome.retirementObligations, `Isolated bundle proof failures: ${injected.proofFailures.join(', ') || 'none'}`).toEqual([]);expect(outcome.remaining).toEqual([]);expect(outcome.recoveredPreservations).toEqual([expect.objectContaining({ path: release.path, branch: release.branch, head: release.head,archiveDir: saved.archiveDir, verified: true,