60a7a945470c
pin koh3 3.1.4 and prove offer --json names the saves that came in flagged during the upgrade (v3.0.82)
- time
- 2026-09-28 12:41 UTC · 2 weeks ago
- machine
- Junes-MacBook-Pro.local
- agent
- claude-opus-5-5
- session
- finalize the queue
- parent
- 1340381db563
↓ kepr-60a7a945.tar.gzatlas at this save
files changed3 files
package.json+1 −1tests/koh-version.txt+1 −1tests/kohsteal.test.ts+15 −0package.json+1 −1
@@ -1,6 +1,6 @@11 {22 "name": "kepr",3- "version": "3.0.81",3+ "version": "3.0.82",44 "private": true,55 "type": "module",66 "scripts": {tests/kohsteal.test.ts+15 −0
@@ -194,6 +194,10 @@194194 await mkdir(fresh, { recursive: true });195195 expect((await koh3(fresh, thiefHome, ["steal", `${host}/${REPO}`])).code).toBe(0);196196 expect(await Bun.file(join(fresh, REPO, "src.v")).exists()).toBe(false);197+ // A third copy stays stolen to the end, for `offer --json` to upgrade.198+ const third = join(root, "thief-three");199+ await mkdir(third, { recursive: true });200+ expect((await koh3(third, thiefHome, ["steal", `${host}/${REPO}`])).code).toBe(0);197201 198202 // Signing in: a code from the connect page, read the way `koh` reads it.199203 // This Kepr's domain is the loopback address it is served on, so the same-origin@@ -272,6 +276,17 @@272276 expect(await readFile(join(second, PRIVATE_REPO, "secret.txt"), "utf8")).toContain("kept");273277 // And it is a normal repo: the machine's own remote is untouched by any of this.274278 expect((await koh3(second, thiefHome, ["remote"])).out).toContain(`s3 ${endpoint}`);279+280+ // Saves that come in flagged during offer's upgrade are named in its JSON, as steal's are.281+ expect((await koh3(repoDir, ownerHome, ["steal"])).code).toBe(0);282+ await writeFile(join(repoDir, "risky.txt"), "risky\n");283+ const risky = JSON.parse((await koh3(repoDir, ownerHome, ["save", "risky", "--json"])).out).id;284+ const flag = await koh3(repoDir, ownerHome, ["flag", risky, "--reason", "broke the build"]);285+ expect(flag.code, flag.err + flag.out).toBe(0);286+ expect((await koh3(repoDir, ownerHome, ["offer"])).code).toBe(0);287+ const flaggedOffer = await koh3(join(third, REPO), thiefHome, ["offer", "--json"]);288+ expect(flaggedOffer.code, flaggedOffer.err + flaggedOffer.out).toBe(0);289+ expect(JSON.parse(flaggedOffer.out).flagged).toEqual([risky]);275290 } finally {276291 bucketServer.stop();277292 }