@indigoai-us/hq-cloud 6.15.4 → 6.15.6
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/cli/push-scan-exclusions.test.d.ts +2 -0
- package/dist/cli/push-scan-exclusions.test.d.ts.map +1 -0
- package/dist/cli/push-scan-exclusions.test.js +87 -0
- package/dist/cli/push-scan-exclusions.test.js.map +1 -0
- package/dist/cli/rescue-exec-bit-preserve.test.js +8 -0
- package/dist/cli/rescue-exec-bit-preserve.test.js.map +1 -1
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +21 -1
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +82 -0
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync.d.ts +23 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +9 -0
- package/dist/cli/sync.js.map +1 -1
- package/dist/lib/net-errors.d.ts.map +1 -1
- package/dist/lib/net-errors.js +4 -0
- package/dist/lib/net-errors.js.map +1 -1
- package/dist/machine-auth.test.js +7 -1
- package/dist/machine-auth.test.js.map +1 -1
- package/dist/object-io.d.ts +21 -0
- package/dist/object-io.d.ts.map +1 -1
- package/dist/object-io.js +229 -77
- package/dist/object-io.js.map +1 -1
- package/dist/object-io.test.js +211 -1
- package/dist/object-io.test.js.map +1 -1
- package/dist/outposts/billing.d.ts +41 -0
- package/dist/outposts/billing.d.ts.map +1 -0
- package/dist/outposts/billing.js +53 -0
- package/dist/outposts/billing.js.map +1 -0
- package/dist/outposts/cli-billing.d.ts +59 -0
- package/dist/outposts/cli-billing.d.ts.map +1 -0
- package/dist/outposts/cli-billing.js +93 -0
- package/dist/outposts/cli-billing.js.map +1 -0
- package/dist/outposts/cli.d.ts +13 -0
- package/dist/outposts/cli.d.ts.map +1 -0
- package/dist/outposts/cli.js +13 -0
- package/dist/outposts/cli.js.map +1 -0
- package/dist/outposts/client.d.ts +140 -0
- package/dist/outposts/client.d.ts.map +1 -0
- package/dist/outposts/client.js +271 -0
- package/dist/outposts/client.js.map +1 -0
- package/dist/outposts/client.test.d.ts +9 -0
- package/dist/outposts/client.test.d.ts.map +1 -0
- package/dist/outposts/client.test.js +226 -0
- package/dist/outposts/client.test.js.map +1 -0
- package/dist/outposts/command.d.ts +74 -0
- package/dist/outposts/command.d.ts.map +1 -0
- package/dist/outposts/command.js +661 -0
- package/dist/outposts/command.js.map +1 -0
- package/dist/outposts/command.test.d.ts +18 -0
- package/dist/outposts/command.test.d.ts.map +1 -0
- package/dist/outposts/command.test.js +933 -0
- package/dist/outposts/command.test.js.map +1 -0
- package/dist/outposts/errors.d.ts +32 -0
- package/dist/outposts/errors.d.ts.map +1 -0
- package/dist/outposts/errors.js +72 -0
- package/dist/outposts/errors.js.map +1 -0
- package/dist/outposts/heartbeat-command.d.ts +106 -0
- package/dist/outposts/heartbeat-command.d.ts.map +1 -0
- package/dist/outposts/heartbeat-command.js +186 -0
- package/dist/outposts/heartbeat-command.js.map +1 -0
- package/dist/outposts/host-deps.d.ts +49 -0
- package/dist/outposts/host-deps.d.ts.map +1 -0
- package/dist/outposts/host-deps.js +93 -0
- package/dist/outposts/host-deps.js.map +1 -0
- package/dist/outposts/index.d.ts +36 -0
- package/dist/outposts/index.d.ts.map +1 -0
- package/dist/outposts/index.js +32 -0
- package/dist/outposts/index.js.map +1 -0
- package/dist/outposts/node.d.ts +23 -0
- package/dist/outposts/node.d.ts.map +1 -0
- package/dist/outposts/node.js +22 -0
- package/dist/outposts/node.js.map +1 -0
- package/dist/outposts/remote-command.d.ts +30 -0
- package/dist/outposts/remote-command.d.ts.map +1 -0
- package/dist/outposts/remote-command.js +39 -0
- package/dist/outposts/remote-command.js.map +1 -0
- package/dist/outposts/replica-sync.d.ts +40 -0
- package/dist/outposts/replica-sync.d.ts.map +1 -0
- package/dist/outposts/replica-sync.js +188 -0
- package/dist/outposts/replica-sync.js.map +1 -0
- package/dist/outposts/replica-sync.test.d.ts +2 -0
- package/dist/outposts/replica-sync.test.d.ts.map +1 -0
- package/dist/outposts/replica-sync.test.js +224 -0
- package/dist/outposts/replica-sync.test.js.map +1 -0
- package/dist/outposts/self-deploy.d.ts +47 -0
- package/dist/outposts/self-deploy.d.ts.map +1 -0
- package/dist/outposts/self-deploy.js +188 -0
- package/dist/outposts/self-deploy.js.map +1 -0
- package/dist/outposts/self-deploy.test.d.ts +2 -0
- package/dist/outposts/self-deploy.test.d.ts.map +1 -0
- package/dist/outposts/self-deploy.test.js +186 -0
- package/dist/outposts/self-deploy.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-bounds.test.d.ts +25 -0
- package/dist/outposts/session-heartbeat-bounds.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-bounds.test.js +156 -0
- package/dist/outposts/session-heartbeat-bounds.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-guard.test.d.ts +16 -0
- package/dist/outposts/session-heartbeat-guard.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-guard.test.js +88 -0
- package/dist/outposts/session-heartbeat-guard.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-publisher.d.ts +76 -0
- package/dist/outposts/session-heartbeat-publisher.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-publisher.js +117 -0
- package/dist/outposts/session-heartbeat-publisher.js.map +1 -0
- package/dist/outposts/session-heartbeat-publisher.test.d.ts +10 -0
- package/dist/outposts/session-heartbeat-publisher.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-publisher.test.js +153 -0
- package/dist/outposts/session-heartbeat-publisher.test.js.map +1 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.d.ts +18 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.js +106 -0
- package/dist/outposts/session-heartbeat-retain-guard.test.js.map +1 -0
- package/dist/outposts/session-heartbeat.d.ts +210 -0
- package/dist/outposts/session-heartbeat.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat.js +657 -0
- package/dist/outposts/session-heartbeat.js.map +1 -0
- package/dist/outposts/session-heartbeat.test.d.ts +11 -0
- package/dist/outposts/session-heartbeat.test.d.ts.map +1 -0
- package/dist/outposts/session-heartbeat.test.js +370 -0
- package/dist/outposts/session-heartbeat.test.js.map +1 -0
- package/dist/outposts/ssh.d.ts +29 -0
- package/dist/outposts/ssh.d.ts.map +1 -0
- package/dist/outposts/ssh.js +66 -0
- package/dist/outposts/ssh.js.map +1 -0
- package/dist/outposts/transport.d.ts +76 -0
- package/dist/outposts/transport.d.ts.map +1 -0
- package/dist/outposts/transport.js +91 -0
- package/dist/outposts/transport.js.map +1 -0
- package/dist/outposts/transport.test.d.ts +10 -0
- package/dist/outposts/transport.test.d.ts.map +1 -0
- package/dist/outposts/transport.test.js +116 -0
- package/dist/outposts/transport.test.js.map +1 -0
- package/dist/outposts/types.d.ts +125 -0
- package/dist/outposts/types.d.ts.map +1 -0
- package/dist/outposts/types.js +13 -0
- package/dist/outposts/types.js.map +1 -0
- package/dist/personal-vault.d.ts +69 -0
- package/dist/personal-vault.d.ts.map +1 -1
- package/dist/personal-vault.js +100 -0
- package/dist/personal-vault.js.map +1 -1
- package/dist/personal-vault.test.js +140 -1
- package/dist/personal-vault.test.js.map +1 -1
- package/dist/s3.d.ts.map +1 -1
- package/dist/s3.js +62 -0
- package/dist/s3.js.map +1 -1
- package/dist/s3.test.js +126 -0
- package/dist/s3.test.js.map +1 -1
- package/package.json +39 -3
package/dist/cli/share.test.js
CHANGED
|
@@ -2032,6 +2032,7 @@ describe("share", () => {
|
|
|
2032
2032
|
if (e.type === "plan" ||
|
|
2033
2033
|
e.type === "new-files" ||
|
|
2034
2034
|
e.type === "personal-vault-out-of-policy" ||
|
|
2035
|
+
e.type === "personal-vault-journal-pruned" ||
|
|
2035
2036
|
e.type === "scope-excluded" ||
|
|
2036
2037
|
e.type === "scope-materialization-gap" ||
|
|
2037
2038
|
e.type === "ignore-excluded" ||
|
|
@@ -3935,6 +3936,87 @@ describe("share", () => {
|
|
|
3935
3936
|
delete process.env.HQ_STATE_DIR;
|
|
3936
3937
|
}
|
|
3937
3938
|
});
|
|
3939
|
+
it("stale-journal convergence: a personal push purges out-of-scope baseline rows and emits a summary", async () => {
|
|
3940
|
+
// The never-completing personal-vault sync: a journal written by an engine
|
|
3941
|
+
// that predated an exclusion rule keeps carrying rows for `.claude/
|
|
3942
|
+
// worktrees/`, `workspace/`, `.hq-conflicts/`, and `.conflict-*` — nothing
|
|
3943
|
+
// removed them, so they were re-diffed on every push forever. The push now
|
|
3944
|
+
// purges them (option a: drop the row; the pull leg refuses the keys, so
|
|
3945
|
+
// any remote object is an inert orphan) and persists the trimmed journal.
|
|
3946
|
+
const stateDirPersonal = fs.mkdtempSync(path.join(os.tmpdir(), "hq-state-prs-purge-"));
|
|
3947
|
+
process.env.HQ_STATE_DIR = stateDirPersonal;
|
|
3948
|
+
try {
|
|
3949
|
+
const journalPath = path.join(stateDirPersonal, "sync-journal.__hq_personal_vault__.json");
|
|
3950
|
+
const entry = () => ({
|
|
3951
|
+
hash: "h", size: 1, syncedAt: new Date().toISOString(),
|
|
3952
|
+
direction: "up",
|
|
3953
|
+
});
|
|
3954
|
+
fs.writeFileSync(journalPath, JSON.stringify({
|
|
3955
|
+
version: "1",
|
|
3956
|
+
lastSync: new Date().toISOString(),
|
|
3957
|
+
files: {
|
|
3958
|
+
// Legit row — must survive.
|
|
3959
|
+
"personal/keep.md": entry(),
|
|
3960
|
+
// Stale excluded rows with no other owner — must be purged.
|
|
3961
|
+
".claude/worktrees/wt/a.ts": entry(),
|
|
3962
|
+
"personal/node_modules/pkg/index.js": entry(),
|
|
3963
|
+
".hq-conflicts/mirror.md": entry(),
|
|
3964
|
+
"workspace/scratch/tmp.md": entry(),
|
|
3965
|
+
// Litter row — owned by the vault-litter drain (remote delete), NOT
|
|
3966
|
+
// the purge. Left absent on disk so the drain removes it remotely.
|
|
3967
|
+
"CLAUDE.md.conflict-2026-05-13T19-40-40Z-e5797a.md": entry(),
|
|
3968
|
+
},
|
|
3969
|
+
}));
|
|
3970
|
+
fs.writeFileSync(path.join(tmpDir, "personal-keep-seed"), "x");
|
|
3971
|
+
fs.mkdirSync(path.join(tmpDir, "personal"), { recursive: true });
|
|
3972
|
+
fs.writeFileSync(path.join(tmpDir, "personal", "keep.md"), "x");
|
|
3973
|
+
const personalCtx = makeEntityContext({
|
|
3974
|
+
uid: "prs_01HASSAANTESTUSER",
|
|
3975
|
+
slug: "__hq_personal_vault__",
|
|
3976
|
+
bucketName: "hq-vault-prs-01HASSAANTESTUSER",
|
|
3977
|
+
});
|
|
3978
|
+
const events = [];
|
|
3979
|
+
const pruned = [];
|
|
3980
|
+
await share({
|
|
3981
|
+
paths: [tmpDir],
|
|
3982
|
+
entityContext: personalCtx,
|
|
3983
|
+
hqRoot: tmpDir,
|
|
3984
|
+
personalMode: true,
|
|
3985
|
+
skipUnchanged: true,
|
|
3986
|
+
propagateDeletes: true,
|
|
3987
|
+
onEvent: (e) => {
|
|
3988
|
+
events.push(e.type);
|
|
3989
|
+
if (e.type === "personal-vault-journal-pruned") {
|
|
3990
|
+
pruned.push({ count: e.count, byReason: e.byReason });
|
|
3991
|
+
}
|
|
3992
|
+
},
|
|
3993
|
+
});
|
|
3994
|
+
// Summary event fired exactly once with the right breakdown. The
|
|
3995
|
+
// `.conflict-*` litter is NOT counted here — it is drained by the
|
|
3996
|
+
// vault-litter delete path, not the purge.
|
|
3997
|
+
expect(pruned).toHaveLength(1);
|
|
3998
|
+
expect(pruned[0].count).toBe(4);
|
|
3999
|
+
expect(pruned[0].byReason["ignore-filtered"]).toBe(3);
|
|
4000
|
+
expect(pruned[0].byReason["excluded-top-level"]).toBe(1);
|
|
4001
|
+
// The persisted journal converged: excluded rows gone, legit row kept.
|
|
4002
|
+
const journal = JSON.parse(fs.readFileSync(journalPath, "utf-8"));
|
|
4003
|
+
expect(Object.keys(journal.files)).toContain("personal/keep.md");
|
|
4004
|
+
expect(journal.files[".claude/worktrees/wt/a.ts"]).toBeUndefined();
|
|
4005
|
+
expect(journal.files["personal/node_modules/pkg/index.js"]).toBeUndefined();
|
|
4006
|
+
expect(journal.files[".hq-conflicts/mirror.md"]).toBeUndefined();
|
|
4007
|
+
expect(journal.files["workspace/scratch/tmp.md"]).toBeUndefined();
|
|
4008
|
+
// The litter row was drained by the litter path (remote delete), so it is
|
|
4009
|
+
// also gone from the journal — but via DeleteObject, not a silent purge.
|
|
4010
|
+
expect(journal.files["CLAUDE.md.conflict-2026-05-13T19-40-40Z-e5797a.md"]).toBeUndefined();
|
|
4011
|
+
expect(deleteRemoteFile).toHaveBeenCalledWith(expect.anything(), "CLAUDE.md.conflict-2026-05-13T19-40-40Z-e5797a.md");
|
|
4012
|
+
// Purged rows are DROPPED, not delete-propagated to the remote.
|
|
4013
|
+
expect(deleteRemoteFile).not.toHaveBeenCalledWith(expect.anything(), ".claude/worktrees/wt/a.ts");
|
|
4014
|
+
}
|
|
4015
|
+
finally {
|
|
4016
|
+
fs.rmSync(stateDirPersonal, { recursive: true, force: true });
|
|
4017
|
+
delete process.env.HQ_STATE_DIR;
|
|
4018
|
+
}
|
|
4019
|
+
});
|
|
3938
4020
|
// ── personalMode ───────────────────────────────────────────────────────────
|
|
3939
4021
|
//
|
|
3940
4022
|
// The personal vault (slug "personal" in the runner's fanout plan) shares
|