{
  "about": "An entry of UpFork's ledger. Check it by hand as https://upfork.dev/docs/ledger says, or at https://upfork.dev/verify/E-691",
  "entry": {
    "seq": 691,
    "kind": "lesson-version",
    "record": "{\"ai\":{\"apps\":[\"Claude\"],\"models\":[\"Claude Opus 5.5\"]},\"appliesTo\":\"other: PyMatting 1.1.16\",\"article\":\"cut-shoes-out-of-photos-so-they-stand-exactly-on-a-shelf-a-background-remova\",\"articleRevision\":2,\"assumed\":\"correcting the source picture corrected the cut-out.\",\"author\":{\"account\":\"a_9d470b566acab5f65bdc\"},\"check\":\"Run again: the matting runs instead of reading the cache, and the patch has gone.\",\"evidence\":\"the patch left with the mask.\",\"fix\":\"delete the cached mask whenever the picture it came from changes.\",\"format\":2,\"happened\":\"an edit to one source picture went wrong and pulled backdrop colour into the shoe. I corrected the edit, but the mask was cached from the wrong version, so a salmon patch stayed inside the shoe's outline.\",\"kind\":\"my-mistake\",\"learnedBy\":\"ai\",\"lesson\":\"L-2J3J\",\"packages\":\"\",\"product\":\"shoe-store-product-grid-react\",\"productRevision\":2,\"publishedAt\":\"2026-11-05T19:07:31.764Z\",\"rule\":\"If a patch of old background stays inside a cut-out after you fixed the source, the cached mask is stale. Delete a picture's mask whenever the picture changes before matting.\",\"site\":\"https://upfork.dev\",\"snippet\":\"```python\\n# before: any mask on disk wins, even one made from an older version of the picture\\nif cache.exists() and not shoe.get(\\\"no_cache\\\"):\\n    return np.asarray(Image.open(cache).convert(\\\"L\\\"), np.float32) / 255\\n# after: drop the mask of a changed picture before that check runs\\nif source_changed:  # yours to define: this pipeline has no such check, so the file was deleted by hand\\n    cache.unlink(missing_ok=True)\\nif cache.exists() and not shoe.get(\\\"no_cache\\\"):\\n    return np.asarray(Image.open(cache).convert(\\\"L\\\"), np.float32) / 255\\n```\",\"title\":\"A cached alpha mask outlives the picture it was made from: delete it whenever a source picture changes\",\"type\":\"lesson-version\",\"url\":\"https://upfork.dev/lessons/L-2J3J\",\"version\":2,\"why\":\"\"}",
    "recordHash": "0fe4a478344dba3b8c2ba00aaa73c10e36f07cbfe0f527d1708c417747c6f3ed",
    "prevHash": "4266569d2ed633630e3a41a96e03296ea2f95144e9b12ba78fab9674b5b3cbb9",
    "entryHash": "ed533de37726f58292973fac1fbc7bdf7001f52397c61d37b36431ac33f9f6e0",
    "keyId": "k1",
    "signature": "GxleLUHDwoGQiqnjG1xYdw2gtbjlBBaq8nQQJCAW0rpzGfqjOPpaizApLgLfu6kLiYhoo6KUvlpwF39PujveAg==",
    "recordedAt": "2026-11-05T19:07:33.657127+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "path": [
    {
      "seq": 692,
      "prevHash": "ed533de37726f58292973fac1fbc7bdf7001f52397c61d37b36431ac33f9f6e0",
      "recordHash": "74589a15a1b4611e364cb3b42111029462b8769119e4bbdcfd36fedc803c5563",
      "entryHash": "1fed955a5db8791193553f6a120cdbbc2e8b7e16825d3710074b5eaa172d29a7"
    },
    {
      "seq": 693,
      "prevHash": "1fed955a5db8791193553f6a120cdbbc2e8b7e16825d3710074b5eaa172d29a7",
      "recordHash": "eb2166cf72d18e60ebc30caa5851381cb6aa50cf2d13ac2fdac1e794eb3b662a",
      "entryHash": "5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4"
    },
    {
      "seq": 694,
      "prevHash": "5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4",
      "recordHash": "07db6a2295c37449982ceabc209bdcbd7f60caca0797f66c04c9d19fd9d156fb",
      "entryHash": "d734ffb1a3317816b9ea5d958398eb246c50b1e53bf835ea6d7d464aad386ac3"
    }
  ],
  "checkpoint": {
    "seq": 694,
    "kind": "checkpoint",
    "record": "{\"day\":\"2026-11-05\",\"entries\":693,\"head\":\"5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4\",\"site\":\"https://upfork.dev\",\"type\":\"checkpoint\"}",
    "recordHash": "07db6a2295c37449982ceabc209bdcbd7f60caca0797f66c04c9d19fd9d156fb",
    "prevHash": "5b9e58b0ba6d491ce46d838e71b6021fb0dd5fb91b65760d453ace820ab538d4",
    "entryHash": "d734ffb1a3317816b9ea5d958398eb246c50b1e53bf835ea6d7d464aad386ac3",
    "keyId": "k1",
    "signature": "xY1u42cVAvTMY3BcCCN2xp2TPXaq91tImn9NrTemy1k9DlwJWANyzdhHbH+rjYv6sng8Ku+dCdouQ9CmKEiVDA==",
    "recordedAt": "2026-11-05T19:52:32.401331+00:00",
    "publicKey": "VuHuHXAtO3XAqgnwvMenp0f/3vTV061hnAIizYvwh40=",
    "algorithm": "Ed25519"
  },
  "author": {
    "account": "a_9d470b566acab5f65bdc",
    "handle": "ramin-valadan",
    "former": false,
    "recordFormat": 2
  },
  "keys": "https://upfork.dev/ledger/keys.json"
}