From 4d35c98b756514d45d5d3f4581423e6ac7430620 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 15:01:54 +0100 Subject: [PATCH 1/4] test(live): probe the Disk facts a two-way sync builds on Co-Authored-By: Claude Opus 5.5 --- scripts/live.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scripts/live.sh b/scripts/live.sh index 749d724..dcb91de 100755 --- a/scripts/live.sh +++ b/scripts/live.sh @@ -72,6 +72,30 @@ node -e ' if (read(process.argv[1]) !== read(process.argv[2])) throw new Error("a moved file got a new resource_id")' \ "$work/before.json" "$work/after.json" "${cli[@]}" live files delete "/ydisk-live/moved-$stamp.txt" --yes --json >/dev/null +# Facts a two-way sync builds on that Yandex's docs leave open: the Disk's sha256, whether a replacing upload keeps +# the file's resource_id, whether the Disk revision moves with a write, and what a delete with a wrong md5 answers. +raw() { "${cli[@]}" live api "$@" 2>&1 || true; } +echo "probe one $stamp" >"$work/probe.txt" +"${cli[@]}" live files upload "$work/probe.txt" --folder /ydisk-live --name "probe-$stamp.txt" --json >/dev/null +raw resources-list --path "disk:/ydisk-live/probe-$stamp.txt" >"$work/probe-1.json" +raw disk-get --fields revision >"$work/rev-1.json" +echo "probe two, longer $stamp" >"$work/probe.txt" +"${cli[@]}" live files upload "$work/probe.txt" --folder /ydisk-live --name "probe-$stamp.txt" --replace --yes --json >/dev/null +raw resources-list --path "disk:/ydisk-live/probe-$stamp.txt" >"$work/probe-2.json" +raw disk-get --fields revision >"$work/rev-2.json" +raw resources-delete --path "disk:/ydisk-live/probe-$stamp.txt" --md5 00000000000000000000000000000000 >"$work/del-wrong.json" +raw resources-list --path "disk:/ydisk-live/probe-$stamp.txt" --fields path >"$work/after-wrong.json" +node -e ' + const fs = require("fs") + const read = (f) => { const t = fs.readFileSync(f, "utf8"); try { return JSON.parse(t) } catch { return t.trim() } } + const [one, two, r1, r2, del, after] = process.argv.slice(1, 7).map(read) + const local = require("crypto").createHash("sha256").update(fs.readFileSync(process.argv[7])).digest("hex") + const pick = (r) => ({ resource_id: r.resource_id, sha256: r.sha256, md5: r.md5, revision: r.revision }) + console.error("probe:", JSON.stringify({ one: pick(one), two: pick(two), local_sha256: local, + disk_revision: [r1.revision, r2.revision], delete_wrong_md5: del, after_wrong: after }))' \ + "$work/probe-1.json" "$work/probe-2.json" "$work/rev-1.json" "$work/rev-2.json" "$work/del-wrong.json" \ + "$work/after-wrong.json" "$work/probe.txt" +"${cli[@]}" live files delete "/ydisk-live/probe-$stamp.txt" --yes --json >/dev/null 2>&1 || true "${cli[@]}" live doctor --json >/dev/null "${cli[@]}" live session end --json >/dev/null From 726233b406384ce96a6b355387647fc556b8734d Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 15:03:24 +0100 Subject: [PATCH 2/4] test(live): read the raw answers' item and confirm the probe delete Co-Authored-By: Claude Opus 5.5 --- scripts/live.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/live.sh b/scripts/live.sh index dcb91de..034c690 100755 --- a/scripts/live.sh +++ b/scripts/live.sh @@ -83,16 +83,16 @@ echo "probe two, longer $stamp" >"$work/probe.txt" "${cli[@]}" live files upload "$work/probe.txt" --folder /ydisk-live --name "probe-$stamp.txt" --replace --yes --json >/dev/null raw resources-list --path "disk:/ydisk-live/probe-$stamp.txt" >"$work/probe-2.json" raw disk-get --fields revision >"$work/rev-2.json" -raw resources-delete --path "disk:/ydisk-live/probe-$stamp.txt" --md5 00000000000000000000000000000000 >"$work/del-wrong.json" +raw resources-delete --path "disk:/ydisk-live/probe-$stamp.txt" --md5 00000000000000000000000000000000 --yes >"$work/del-wrong.json" raw resources-list --path "disk:/ydisk-live/probe-$stamp.txt" --fields path >"$work/after-wrong.json" node -e ' const fs = require("fs") const read = (f) => { const t = fs.readFileSync(f, "utf8"); try { return JSON.parse(t) } catch { return t.trim() } } const [one, two, r1, r2, del, after] = process.argv.slice(1, 7).map(read) const local = require("crypto").createHash("sha256").update(fs.readFileSync(process.argv[7])).digest("hex") - const pick = (r) => ({ resource_id: r.resource_id, sha256: r.sha256, md5: r.md5, revision: r.revision }) + const pick = ({ item: r = {} }) => ({ resource_id: r.resource_id, sha256: r.sha256, md5: r.md5, revision: r.revision }) console.error("probe:", JSON.stringify({ one: pick(one), two: pick(two), local_sha256: local, - disk_revision: [r1.revision, r2.revision], delete_wrong_md5: del, after_wrong: after }))' \ + disk_revision: [r1.item?.revision, r2.item?.revision], delete_wrong_md5: del, after_wrong: after }))' \ "$work/probe-1.json" "$work/probe-2.json" "$work/rev-1.json" "$work/rev-2.json" "$work/del-wrong.json" \ "$work/after-wrong.json" "$work/probe.txt" "${cli[@]}" live files delete "/ydisk-live/probe-$stamp.txt" --yes --json >/dev/null 2>&1 || true From 9004287f2fdc84b3524652352915d5cb6382955a Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 15:04:54 +0100 Subject: [PATCH 3/4] test(live): assert the Disk facts a two-way sync builds on The probes showed on the test account: the Disk's sha256 is the content's, a replacing upload keeps the resource_id, the Disk revision moves with each write, and a delete with a wrong md5 is refused with 409. Yandex's docs leave all four open; the sync design relies on them, so the release check now asserts them. Co-Authored-By: Claude Opus 5.5 --- scripts/live.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/live.sh b/scripts/live.sh index 034c690..45eab1d 100755 --- a/scripts/live.sh +++ b/scripts/live.sh @@ -72,8 +72,8 @@ node -e ' if (read(process.argv[1]) !== read(process.argv[2])) throw new Error("a moved file got a new resource_id")' \ "$work/before.json" "$work/after.json" "${cli[@]}" live files delete "/ydisk-live/moved-$stamp.txt" --yes --json >/dev/null -# Facts a two-way sync builds on that Yandex's docs leave open: the Disk's sha256, whether a replacing upload keeps -# the file's resource_id, whether the Disk revision moves with a write, and what a delete with a wrong md5 answers. +# Facts a two-way sync builds on that Yandex's docs leave open (seen on 2026-11-18): the Disk's sha256 is the content's, +# a replacing upload keeps the resource_id, the Disk revision moves with a write, a delete with a wrong md5 gets 409. raw() { "${cli[@]}" live api "$@" 2>&1 || true; } echo "probe one $stamp" >"$work/probe.txt" "${cli[@]}" live files upload "$work/probe.txt" --folder /ydisk-live --name "probe-$stamp.txt" --json >/dev/null @@ -87,16 +87,19 @@ raw resources-delete --path "disk:/ydisk-live/probe-$stamp.txt" --md5 0000000000 raw resources-list --path "disk:/ydisk-live/probe-$stamp.txt" --fields path >"$work/after-wrong.json" node -e ' const fs = require("fs") - const read = (f) => { const t = fs.readFileSync(f, "utf8"); try { return JSON.parse(t) } catch { return t.trim() } } + const read = (f) => JSON.parse(fs.readFileSync(f, "utf8")) const [one, two, r1, r2, del, after] = process.argv.slice(1, 7).map(read) const local = require("crypto").createHash("sha256").update(fs.readFileSync(process.argv[7])).digest("hex") - const pick = ({ item: r = {} }) => ({ resource_id: r.resource_id, sha256: r.sha256, md5: r.md5, revision: r.revision }) - console.error("probe:", JSON.stringify({ one: pick(one), two: pick(two), local_sha256: local, - disk_revision: [r1.item?.revision, r2.item?.revision], delete_wrong_md5: del, after_wrong: after }))' \ + const fail = (message) => { throw new Error(message) } + if (two.item.sha256 !== local) fail("the Disk sha256 is not the sha256 of the content") + if (one.item.resource_id !== two.item.resource_id) fail("a replacing upload gave the file a new resource_id") + if (!(r2.item.revision > r1.item.revision)) fail("the Disk revision did not move with a write") + if (del.error?.details?.status !== 409) fail("a delete with a wrong md5 was not refused with 409") + if (!after.item?.path) fail("a delete with a wrong md5 removed the file")' \ "$work/probe-1.json" "$work/probe-2.json" "$work/rev-1.json" "$work/rev-2.json" "$work/del-wrong.json" \ "$work/after-wrong.json" "$work/probe.txt" -"${cli[@]}" live files delete "/ydisk-live/probe-$stamp.txt" --yes --json >/dev/null 2>&1 || true +"${cli[@]}" live files delete "/ydisk-live/probe-$stamp.txt" --yes --json >/dev/null "${cli[@]}" live doctor --json >/dev/null "${cli[@]}" live session end --json >/dev/null -echo "live check passed: describe format 2, sign-in, files list, folders browse, download, upload, move and delete, sync, search, doctor, sign-out" +echo "live check passed: describe format 2, sign-in, files list, folders browse, download, upload, move and delete, the sync facts, sync, search, doctor, sign-out" From 3c5f455f27b8e62ba2f91cea5fd291b0da44dec0 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 18 Nov 2026 15:05:36 +0100 Subject: [PATCH 4/4] chore(release): live check of 0.2.0 --- docs/dev/live-checks.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/dev/live-checks.txt b/docs/dev/live-checks.txt index 09b4474..6a74a67 100644 --- a/docs/dev/live-checks.txt +++ b/docs/dev/live-checks.txt @@ -3,4 +3,4 @@ 0.0.0 1b6c81ec337292365398dc3d0a9265afe2346c71 2026-11-17 scripts/live.sh v2:3a883748711f80846b6898fc41402aa7981297c9a69a26a5317137f1e95ea010 0.1.0 3cd0dce26bdf2b6ee3f344236c6fd69564658601 2026-11-17 scripts/live.sh v2:fdc87d1dade6b2f8e09fb19aac44c08f682e28f4ceec33c0e1bc952b31024267 0.1.1 73ca7b7f3b0a1e9c7e021d1dea3c525304252a9b 2026-11-17 scripts/live.sh v2:6e17f9f68dacf811705d5a71ad31573904b96b1466edfdab66fc525c6ef21344 -0.2.0 93afc3c1babfeca394341f64367f8575db6b5faf 2026-11-18 scripts/live.sh v2:00ba1ad80aabdce948b0c64f2a6a29a54ca74e78c356462c78ade3240570392a +0.2.0 9004287f2fdc84b3524652352915d5cb6382955a 2026-11-18 scripts/live.sh v2:00ba1ad80aabdce948b0c64f2a6a29a54ca74e78c356462c78ade3240570392a