@indigoai-us/hq-cloud 6.16.40 → 6.16.41
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/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-loop.js +9 -9
- package/dist/bin/sync-runner-watch-loop.js.map +1 -1
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +27 -28
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +0 -49
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +8 -8
- package/dist/cli/sync.js.map +1 -1
- package/dist/journal-area-ledger-read-boundary.test.js +12 -46
- package/dist/journal-area-ledger-read-boundary.test.js.map +1 -1
- package/dist/journal-record-proxy.d.ts +2 -12
- package/dist/journal-record-proxy.d.ts.map +1 -1
- package/dist/journal-record-proxy.js +1 -8
- package/dist/journal-record-proxy.js.map +1 -1
- package/dist/journal-row-store.d.ts +0 -64
- package/dist/journal-row-store.d.ts.map +1 -1
- package/dist/journal-row-store.js +3 -129
- package/dist/journal-row-store.js.map +1 -1
- package/dist/journal-row-store.test.js +1 -3
- package/dist/journal-row-store.test.js.map +1 -1
- package/dist/journal-snapshot-rows.d.ts +1 -17
- package/dist/journal-snapshot-rows.d.ts.map +1 -1
- package/dist/journal-snapshot-rows.js +0 -18
- package/dist/journal-snapshot-rows.js.map +1 -1
- package/dist/journal-snapshot-v4.d.ts +2 -3
- package/dist/journal-snapshot-v4.d.ts.map +1 -1
- package/dist/journal-snapshot-v4.js +3 -9
- package/dist/journal-snapshot-v4.js.map +1 -1
- package/dist/journal-snapshot-v4.test.js +0 -1
- package/dist/journal-snapshot-v4.test.js.map +1 -1
- package/dist/journal.d.ts +5 -23
- package/dist/journal.d.ts.map +1 -1
- package/dist/journal.js +189 -309
- package/dist/journal.js.map +1 -1
- package/dist/journal.test.js +1 -58
- package/dist/journal.test.js.map +1 -1
- package/dist/personal-vault.d.ts.map +1 -1
- package/dist/personal-vault.js +4 -6
- package/dist/personal-vault.js.map +1 -1
- package/dist/remote-pull.d.ts.map +1 -1
- package/dist/remote-pull.js +8 -9
- package/dist/remote-pull.js.map +1 -1
- package/dist/scope-shrink.js +2 -2
- package/dist/scope-shrink.js.map +1 -1
- package/dist/session-log-retention.d.ts.map +1 -1
- package/dist/session-log-retention.js +2 -2
- package/dist/session-log-retention.js.map +1 -1
- package/dist/sync/area-ledger-migration.d.ts +6 -13
- package/dist/sync/area-ledger-migration.d.ts.map +1 -1
- package/dist/sync/area-ledger-migration.js +19 -45
- package/dist/sync/area-ledger-migration.js.map +1 -1
- package/dist/sync/area-ledger-migration.test.js +0 -23
- package/dist/sync/area-ledger-migration.test.js.map +1 -1
- package/dist/sync/area-ledger.d.ts +1 -31
- package/dist/sync/area-ledger.d.ts.map +1 -1
- package/dist/sync/area-ledger.js +88 -385
- package/dist/sync/area-ledger.js.map +1 -1
- package/dist/sync/area-ledger.test.js +10 -123
- package/dist/sync/area-ledger.test.js.map +1 -1
- package/dist/types.d.ts +0 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/packed-journal-phase2.test.d.ts +0 -2
- package/dist/packed-journal-phase2.test.d.ts.map +0 -1
- package/dist/packed-journal-phase2.test.js +0 -273
- package/dist/packed-journal-phase2.test.js.map +0 -1
package/dist/cli/share.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/cli/share.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAe,YAAY,EAAE,MAAM,aAAa,CAAC;AAsBhG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"share.d.ts","sourceRoot":"","sources":["../../src/cli/share.ts"],"names":[],"mappings":"AAAA;;;;;GA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AAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,iBAAS,gBAAgB,CACvB,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAAsB,GAC1B,MAAM,CAuBR;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,iBAAS,qBAAqB,CAC5B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,gBAAgB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,GACvC,OAAO,CAwBT;AA8HD;;;;;;;;;;;GAWG;AACH,iBAAS,YAAY,CACnB,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,OAAO,EAC/C,KAAK,GAAE,YAAiB,GACvB,cAAc,EAAE,CAkGlB"}
|
package/dist/cli/share.js
CHANGED
|
@@ -13,7 +13,7 @@ import { createSyncProgressRecorder } from "../sync-progress.js";
|
|
|
13
13
|
import { localPathForVaultKey, vaultKeyForLocalPath } from "../local-path-codec.js";
|
|
14
14
|
import { uploadFile, uploadSymlink, toPosixKey, headRemoteFile, readVerifiedRemoteSymlinkTarget, deleteRemoteFile, downloadFile, primeObjectTransport, primeUploads, WindowsSymlinkPrivilegeError, WINDOWS_SYMLINK_PRIVILEGE_REMEDY, WindowsRenameBlockedError, WINDOWS_RENAME_BLOCKED_REMEDY, renameOrRaiseWindowsBlocked, } from "../s3.js";
|
|
15
15
|
import * as crypto from "crypto";
|
|
16
|
-
import { isUnderAnyRoot,
|
|
16
|
+
import { isUnderAnyRoot, readJournal, readJournalScoped, writeJournal, hashFile, hashSymlinkTarget, journalEntryMatchesStat, timestampsTooCoarseToTrust, updateEntry, removeEntry, isTombstone, normalizeEtag, PERSONAL_VAULT_JOURNAL_SLUG, migratePersonalVaultJournal, migrateToV2, } from "../journal.js";
|
|
17
17
|
import { createIgnoreFilter, hasControlCharacters, isExpectedIgnore, isWithinSizeLimit, } from "../ignore.js";
|
|
18
18
|
import { wrapFilterWithPersonalVaultDefaults, } from "../personal-vault-exclusions.js";
|
|
19
19
|
import { isGeneratedCoreMirrorKey, isPersonalVaultDeletionExcluded, purgeExcludedPersonalVaultJournalEntries, } from "../personal-vault.js";
|
|
@@ -309,7 +309,7 @@ function computePushPlan(filesToShare, journal, skipUnchanged, onHeartbeat) {
|
|
|
309
309
|
if (entry.kind === "symlink") {
|
|
310
310
|
const localHash = hashSymlinkTarget(entry.target);
|
|
311
311
|
if (skipUnchanged) {
|
|
312
|
-
const existing =
|
|
312
|
+
const existing = journal.files[relativePath];
|
|
313
313
|
// `!localDiverges`: see the regular-file gate below — a divergent entry
|
|
314
314
|
// stores the current LOCAL hash, so hash equality here proves only that
|
|
315
315
|
// local has not moved since the pull-side hold, never that it matches remote.
|
|
@@ -351,7 +351,7 @@ function computePushPlan(filesToShare, journal, skipUnchanged, onHeartbeat) {
|
|
|
351
351
|
// by the restamp below so the next pass is free;
|
|
352
352
|
// - `localDiverges` entries — see the hash gate below for why equality
|
|
353
353
|
// proves nothing about them.
|
|
354
|
-
if (skipUnchanged && statMatchesJournal(absolutePath,
|
|
354
|
+
if (skipUnchanged && statMatchesJournal(absolutePath, journal.files[relativePath])) {
|
|
355
355
|
items.push({ action: "skip-unchanged", absolutePath, relativePath });
|
|
356
356
|
continue;
|
|
357
357
|
}
|
|
@@ -382,7 +382,7 @@ function computePushPlan(filesToShare, journal, skipUnchanged, onHeartbeat) {
|
|
|
382
382
|
: undefined;
|
|
383
383
|
}
|
|
384
384
|
if (skipUnchanged) {
|
|
385
|
-
const existing =
|
|
385
|
+
const existing = journal.files[relativePath];
|
|
386
386
|
// A `localDiverges` entry records the hash of the KEPT LOCAL body, so
|
|
387
387
|
// `existing.hash === localHash` is true for every such file by
|
|
388
388
|
// construction. Skipping on that equality asserts "local matches remote",
|
|
@@ -705,12 +705,11 @@ export function currentUploadBytes(item) {
|
|
|
705
705
|
}
|
|
706
706
|
}
|
|
707
707
|
function clearSkillMetadataPending(run, relativePath) {
|
|
708
|
-
const
|
|
709
|
-
const entry = rows.get(relativePath);
|
|
708
|
+
const entry = run.journal.files[relativePath];
|
|
710
709
|
if (!entry || !Object.hasOwn(entry, "skillMetadataPending"))
|
|
711
710
|
return;
|
|
712
711
|
const { skillMetadataPending: _skillMetadataPending, ...cleared } = entry;
|
|
713
|
-
|
|
712
|
+
run.journal.files[relativePath] = cleared;
|
|
714
713
|
}
|
|
715
714
|
/**
|
|
716
715
|
* A checkpoint write failed. Distinct from an upload error so it can escape
|
|
@@ -838,7 +837,7 @@ async function createPushRunContext(options) {
|
|
|
838
837
|
// defer its keyed journal read until the exact K upload/delete keys are
|
|
839
838
|
// known. Full/cadence callers retain the complete snapshot here.
|
|
840
839
|
const scopedJournal = options.scopedJournal === true;
|
|
841
|
-
const journal = scopedJournal ? emptyJournalForScopedPass() :
|
|
840
|
+
const journal = scopedJournal ? emptyJournalForScopedPass() : readJournal(journalSlug);
|
|
842
841
|
return {
|
|
843
842
|
options,
|
|
844
843
|
paths,
|
|
@@ -994,7 +993,7 @@ async function preflightCompanySkillIdentities(run, entries) {
|
|
|
994
993
|
CANONICAL_COMPANY_SKILL_RE.test(entry.relativePath));
|
|
995
994
|
const unstamped = canonical.filter((entry) => !parseRegisteredCompanySkillUid(fs.readFileSync(entry.absolutePath, "utf8")));
|
|
996
995
|
const pending = canonical.filter((entry) => {
|
|
997
|
-
const journalEntry =
|
|
996
|
+
const journalEntry = run.journal.files[entry.relativePath];
|
|
998
997
|
return (journalEntry?.skillMetadataPending === true &&
|
|
999
998
|
journalEntry.hash === hashFile(entry.absolutePath));
|
|
1000
999
|
});
|
|
@@ -1055,14 +1054,14 @@ async function preflightCompanySkillIdentities(run, entries) {
|
|
|
1055
1054
|
});
|
|
1056
1055
|
}
|
|
1057
1056
|
for (const entry of pending) {
|
|
1058
|
-
const journalEntry =
|
|
1057
|
+
const journalEntry = run.journal.files[entry.relativePath];
|
|
1059
1058
|
run.options.onHeartbeat?.();
|
|
1060
1059
|
const remote = await headRemoteFile(run.ctx, entry.relativePath);
|
|
1061
1060
|
if (!remote) {
|
|
1062
1061
|
// The upload this marker referred to no longer exists. Drop the stale
|
|
1063
1062
|
// baseline so the normal planner cannot skip the local file as unchanged
|
|
1064
1063
|
// and will upload it again on this pass.
|
|
1065
|
-
|
|
1064
|
+
delete run.journal.files[entry.relativePath];
|
|
1066
1065
|
flushShareJournal(run);
|
|
1067
1066
|
continue;
|
|
1068
1067
|
}
|
|
@@ -1075,7 +1074,7 @@ async function preflightCompanySkillIdentities(run, entries) {
|
|
|
1075
1074
|
// Invalidate the stale baseline before any network work. If recovery
|
|
1076
1075
|
// fails, the next pass must still see a real divergence rather than
|
|
1077
1076
|
// classifying the local file as unchanged forever.
|
|
1078
|
-
|
|
1077
|
+
delete run.journal.files[entry.relativePath];
|
|
1079
1078
|
flushShareJournal(run);
|
|
1080
1079
|
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "hq-skill-metadata-"));
|
|
1081
1080
|
const tempFile = path.join(tempDir, "SKILL.md");
|
|
@@ -1265,7 +1264,7 @@ function emptyJournalForScopedPass() {
|
|
|
1265
1264
|
function refreshPushJournalAfterWalk(run, collectedKeys = [], deleteScopeRoots = []) {
|
|
1266
1265
|
run.journal = migrateToV2(run.scopedJournal
|
|
1267
1266
|
? readJournalScoped(run.journalSlug, collectedKeys, deleteScopeRoots)
|
|
1268
|
-
:
|
|
1267
|
+
: readJournal(run.journalSlug));
|
|
1269
1268
|
run.checkpoint.baselineLastSync = run.journal.lastSync;
|
|
1270
1269
|
run.checkpoint.threshold = checkpointThresholdFor(run.journal);
|
|
1271
1270
|
// Purge classifies every journal row and decommission plans likewise scan
|
|
@@ -1311,7 +1310,7 @@ async function executeUploads(run, pushPlan, counters, conflictPaths) {
|
|
|
1311
1310
|
const tombstone = fileTombstones.get(toPosixKey(item.relativePath));
|
|
1312
1311
|
if (tombstone === undefined)
|
|
1313
1312
|
return false;
|
|
1314
|
-
const entry =
|
|
1313
|
+
const entry = run.journal.files[item.relativePath];
|
|
1315
1314
|
return entry !== undefined && entry.hash === item.localHash;
|
|
1316
1315
|
};
|
|
1317
1316
|
// Prime from the preview's likely uploads for transport efficiency. The
|
|
@@ -1364,14 +1363,14 @@ async function executeUploads(run, pushPlan, counters, conflictPaths) {
|
|
|
1364
1363
|
});
|
|
1365
1364
|
}
|
|
1366
1365
|
else if (item.restamp) {
|
|
1367
|
-
const existing =
|
|
1366
|
+
const existing = run.journal.files[item.relativePath];
|
|
1368
1367
|
if (existing && existing.hash) {
|
|
1369
|
-
|
|
1368
|
+
run.journal.files[item.relativePath] = {
|
|
1370
1369
|
...existing,
|
|
1371
1370
|
mtimeMs: item.restamp.mtimeMs,
|
|
1372
1371
|
ctimeMs: item.restamp.ctimeMs,
|
|
1373
1372
|
size: item.restamp.size,
|
|
1374
|
-
}
|
|
1373
|
+
};
|
|
1375
1374
|
}
|
|
1376
1375
|
}
|
|
1377
1376
|
counters.filesSkipped++;
|
|
@@ -1469,7 +1468,7 @@ async function executeUploads(run, pushPlan, counters, conflictPaths) {
|
|
|
1469
1468
|
// `remoteEtag` over live HEAD so a peer-advanced object cannot be
|
|
1470
1469
|
// silently LWW-overwritten by a journaled stale local body (Ace-shaped
|
|
1471
1470
|
// vault regression 2026-08-03).
|
|
1472
|
-
const journalEntry =
|
|
1471
|
+
const journalEntry = run.journal.files[relativePath];
|
|
1473
1472
|
// A `localDiverges` entry whose remote object is GONE (HEAD null — peer
|
|
1474
1473
|
// delete, or an operator purge with no tombstone) must not fall through to
|
|
1475
1474
|
// the ordinary recreation path below. That path fences with
|
|
@@ -1749,10 +1748,10 @@ async function executeUploads(run, pushPlan, counters, conflictPaths) {
|
|
|
1749
1748
|
skillRegistrarForRun(run) !== undefined,
|
|
1750
1749
|
});
|
|
1751
1750
|
if (run.message) {
|
|
1752
|
-
|
|
1753
|
-
...
|
|
1751
|
+
run.journal.files[relativePath] = {
|
|
1752
|
+
...run.journal.files[relativePath],
|
|
1754
1753
|
message: run.message,
|
|
1755
|
-
}
|
|
1754
|
+
};
|
|
1756
1755
|
}
|
|
1757
1756
|
counters.filesUploaded++;
|
|
1758
1757
|
counters.bytesUploaded += size;
|
|
@@ -1760,7 +1759,7 @@ async function executeUploads(run, pushPlan, counters, conflictPaths) {
|
|
|
1760
1759
|
// call. The ordinary cadence is intentionally sparse for large vaults,
|
|
1761
1760
|
// but losing this row can strand tags after a crash between PUT and
|
|
1762
1761
|
// reconciliation.
|
|
1763
|
-
if (
|
|
1762
|
+
if (run.journal.files[relativePath]?.skillMetadataPending === true) {
|
|
1764
1763
|
flushShareJournal(run);
|
|
1765
1764
|
}
|
|
1766
1765
|
else {
|
|
@@ -2348,7 +2347,7 @@ async function executeDeletes(run, deletePlan, decommissionPlan, counters, files
|
|
|
2348
2347
|
run.ctx = await refreshEntityContext(run.companyRef, run.vaultConfig);
|
|
2349
2348
|
}
|
|
2350
2349
|
try {
|
|
2351
|
-
const entry =
|
|
2350
|
+
const entry = run.journal.files[relativePath];
|
|
2352
2351
|
// Last-second absence re-check. Applies to EVERY propagated delete,
|
|
2353
2352
|
// intent-backed or etag-only: a pull leg or the user can recreate the
|
|
2354
2353
|
// file between planning and applying, and deleting it remotely then
|
|
@@ -2374,7 +2373,7 @@ async function executeDeletes(run, deletePlan, decommissionPlan, counters, files
|
|
|
2374
2373
|
if (recreatedLocally || intentChanged) {
|
|
2375
2374
|
if (entry?.localDeleteIntent) {
|
|
2376
2375
|
const { localDeleteIntent: _localDeleteIntent, ...cleared } = entry;
|
|
2377
|
-
|
|
2376
|
+
run.journal.files[relativePath] = cleared;
|
|
2378
2377
|
}
|
|
2379
2378
|
const refusalReason = recreatedLocally
|
|
2380
2379
|
? "recreated-locally"
|
|
@@ -2440,7 +2439,7 @@ async function executeDeletes(run, deletePlan, decommissionPlan, counters, files
|
|
|
2440
2439
|
const localPath = localPathForVaultKey(run.syncRoot, relativePath);
|
|
2441
2440
|
try {
|
|
2442
2441
|
const lstat = fs.lstatSync(localPath);
|
|
2443
|
-
const entry =
|
|
2442
|
+
const entry = run.journal.files[relativePath];
|
|
2444
2443
|
if (lstat.isFile()) {
|
|
2445
2444
|
const localHash = hashFile(localPath);
|
|
2446
2445
|
if (entry?.hash && entry.hash !== localHash) {
|
|
@@ -2559,7 +2558,7 @@ function checkpointCadenceOverride() {
|
|
|
2559
2558
|
* journal hundreds of thousands of times on a large vault.
|
|
2560
2559
|
*/
|
|
2561
2560
|
function checkpointThresholdFor(journal) {
|
|
2562
|
-
return Math.max(CHECKPOINT_MIN_APPLIED, Math.ceil(
|
|
2561
|
+
return Math.max(CHECKPOINT_MIN_APPLIED, Math.ceil(Object.keys(journal.files).length * CHECKPOINT_JOURNAL_FRACTION));
|
|
2563
2562
|
}
|
|
2564
2563
|
/**
|
|
2565
2564
|
* Persist the journal partway through a long pass so an interrupted run
|
|
@@ -3768,7 +3767,7 @@ companyScoped = true) {
|
|
|
3768
3767
|
// of roots; test each row by walking its ancestors, never rows x roots.
|
|
3769
3768
|
const scopeRootSet = new Set(scopeRoots);
|
|
3770
3769
|
const everyRowInScope = scopeRootSet.has("");
|
|
3771
|
-
for (const [relativeKey, entry] of
|
|
3770
|
+
for (const [relativeKey, entry] of Object.entries(journal.files)) {
|
|
3772
3771
|
const inScope = everyRowInScope || isUnderAnyRoot(relativeKey, scopeRootSet);
|
|
3773
3772
|
if (!inScope)
|
|
3774
3773
|
continue;
|
|
@@ -4203,7 +4202,7 @@ function computeDecommissionPlan(journal, prefixes, policy, alreadyPlanned) {
|
|
|
4203
4202
|
// reconcile their own entry, not have us blast it away on their behalf.
|
|
4204
4203
|
const requireOwned = policy === "owned-only" || policy === "currency-gated";
|
|
4205
4204
|
const out = [];
|
|
4206
|
-
for (const [relativeKey, entry] of
|
|
4205
|
+
for (const [relativeKey, entry] of Object.entries(journal.files)) {
|
|
4207
4206
|
if (alreadyPlanned.has(relativeKey))
|
|
4208
4207
|
continue;
|
|
4209
4208
|
const matches = prefixes.some((prefix) => prefix === "" ||
|