[Init] Initial commit - NetMesh terminal manager
Some checks failed
build-packages / resolve bundled mosh-client (push) Has been cancelled
build-packages / resolve bundled et-client (push) Has been cancelled
build-packages / build-macos (push) Has been cancelled
build-packages / build-windows (push) Has been cancelled
build-packages / build-linux-x64 (push) Has been cancelled
build-packages / build-linux-arm64 (push) Has been cancelled
build-packages / release (push) Has been cancelled
build-packages / update Nix release metadata (push) Has been cancelled
build-packages / bump homebrew tap (push) Has been cancelled
test / lint-and-test (push) Has been cancelled
AI automation / Route event (push) Has been cancelled
AI automation / Hand reopened issue to maintainers (push) Has been cancelled
AI automation / Clean source issue state (push) Has been cancelled
AI automation / Reconcile handoffs (push) Has been cancelled
AI automation / Classify issue (push) Has been cancelled
AI automation / Claude Code smoke (push) Has been cancelled
AI automation / Review issue follow-up (push) Has been cancelled
AI automation / Publish issue follow-up (push) Has been cancelled
AI automation / Implement with Claude Code (push) Has been cancelled
AI automation / Publish implement PR (push) Has been cancelled
AI automation / Continue queued issue comments (push) Has been cancelled
AI automation / Codex review loop (push) Has been cancelled
AI automation / Publish Codex fix (push) Has been cancelled
AI automation / Clear Codex dispatch marker (push) Has been cancelled
AI automation / Own PR re-request Codex (push) Has been cancelled
AI automation / External PR re-request Codex (push) Has been cancelled
AI automation / Poll Codex reaction / retry (push) Has been cancelled
build-et-binaries / build-linux-x64 (push) Has been cancelled
build-et-binaries / build-linux-arm64 (push) Has been cancelled
build-et-binaries / build-macos-universal (push) Has been cancelled
build-et-binaries / build-windows-x64 (push) Has been cancelled
build-et-binaries / release (push) Has been cancelled

This commit is contained in:
2026-09-13 18:24:01 +08:00
commit 3c72efcb7f
3255 changed files with 907009 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
import assert from "node:assert/strict";
import test from "node:test";
import {
hasNewSourceFingerprint,
resolveDurableCheckpointBytes,
shouldApplyTransferProgress,
} from "./transferProgressMetadata";
test("source fingerprint metadata changes bypass ordinary progress throttling", () => {
assert.equal(hasNewSourceFingerprint("sha256:old", "sha256:new"), true);
assert.equal(hasNewSourceFingerprint("sha256:same", "sha256:same"), false);
assert.equal(shouldApplyTransferProgress({
elapsedMs: 10,
transferred: 20,
total: 100,
incomingSourceFingerprint: "sha256:new",
}), true);
assert.equal(shouldApplyTransferProgress({
elapsedMs: 10,
transferred: 20,
total: 100,
}), false);
// Below the UI floor (400ms) ordinary ticks stay suppressed.
assert.equal(shouldApplyTransferProgress({
elapsedMs: 250,
transferred: 20,
total: 100,
}), false);
assert.equal(shouldApplyTransferProgress({
elapsedMs: 400,
transferred: 20,
total: 100,
}), true);
// Completion always paints even inside the throttle window.
assert.equal(shouldApplyTransferProgress({
elapsedMs: 10,
transferred: 100,
total: 100,
}), true);
});
test("durable checkpoint prefers contiguous bridge offset over high-water transferred", () => {
// Soft-drain: transferred=3MB, contiguous hole-free offset still 1MB.
assert.equal(resolveDurableCheckpointBytes({
transferred: 3 * 1024 * 1024,
previousCheckpoint: 512 * 1024,
incomingCheckpoint: 1024 * 1024,
status: "pausing",
}), 1024 * 1024);
// While paused, missing contiguous field must not advance from high-water.
assert.equal(resolveDurableCheckpointBytes({
transferred: 9_000_000,
previousCheckpoint: 1000,
status: "paused",
}), 1000);
// Active stream without explicit contiguous still uses transferred.
assert.equal(resolveDurableCheckpointBytes({
transferred: 500,
previousCheckpoint: 100,
status: "transferring",
}), 500);
});