@coderook/cli 0.42.6 → 0.42.7

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.
@@ -2,7 +2,7 @@
2
2
  "name": "coderook",
3
3
  "displayName": "CodeRook",
4
4
  "description": "Save, browse and restore whole-snapshot versions of a project on CodeRook, with cbx or plain git, from Claude Code.",
5
- "version": "0.42.6",
5
+ "version": "0.42.7",
6
6
  "author": {
7
7
  "name": "ACCA Gaming Productions",
8
8
  "url": "https://coderook.com"
@@ -1938,9 +1938,63 @@ class Uploader {
1938
1938
  return priorByDigest.get(declaration.sha256) ?? null;
1939
1939
  };
1940
1940
  const keptAsItWas = (declaration) => storedAs(declaration) !== null;
1941
- const declarations = hashed.declarations.filter((one) => !keptAsItWas(one));
1941
+ /*
1942
+ A copy left stale by somebody else's save is not an edit.
1943
+
1944
+ Both callers select everything, so a file nobody touched here is still
1945
+ "selected". When the version this save starts from holds a newer copy,
1946
+ merged in from somebody else, the untouched old bytes on this disk
1947
+ differ from it, and they were sent as though they were a change: the
1948
+ second unrelated save after a colleague's edit put their file back to
1949
+ what it was (state-matrix R1, reproduced 2026-11-06: v4 reverted v2).
1950
+
1951
+ What the file IS decides it, not where it sits: bytes identical to what
1952
+ this folder last received (request.known) are not this person's work.
1953
+ The version's own copy is kept, and the folder's record still says it
1954
+ received the old bytes, so the file shows as behind until fetched. A
1955
+ file the version no longer holds at all was removed by somebody else,
1956
+ and an untouched copy here does not bring it back.
1957
+ */
1958
+ const received = request.known ?? null;
1959
+ const staleHere = new Set();
1960
+ if (received && prior.size) {
1961
+ for (const one of hashed.declarations) {
1962
+ if (received[one.path] !== one.sha256)
1963
+ continue;
1964
+ const now = prior.get(one.path);
1965
+ if (now && now.sha256 === one.sha256)
1966
+ continue;
1967
+ staleHere.add(one.path);
1968
+ }
1969
+ }
1970
+ const declarations = hashed.declarations.filter((one) => !staleHere.has(one.path) && !keptAsItWas(one));
1942
1971
  let totalBytes = hashed.totalBytes;
1943
1972
  for (const one of hashed.declarations) {
1973
+ if (!staleHere.has(one.path))
1974
+ continue;
1975
+ totalBytes -= one.size;
1976
+ const now = prior.get(one.path);
1977
+ if (!now) {
1978
+ ticked.delete(one.path);
1979
+ continue;
1980
+ }
1981
+ reused.push({
1982
+ path: one.path,
1983
+ sourceSize: now.sourceSize,
1984
+ storedSize: now.storedSize,
1985
+ mediaType: now.mediaType,
1986
+ added: 0,
1987
+ removed: 0,
1988
+ included: true,
1989
+ deleted: false,
1990
+ binary: false,
1991
+ lines: 0,
1992
+ });
1993
+ }
1994
+ (0, profile_js_1.counted)("stale copies kept as the version has them", staleHere.size);
1995
+ for (const one of hashed.declarations) {
1996
+ if (staleHere.has(one.path))
1997
+ continue;
1944
1998
  const held = storedAs(one);
1945
1999
  if (!held)
1946
2000
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coderook/cli",
3
- "version": "0.42.6",
3
+ "version": "0.42.7",
4
4
  "description": "The command line for CodeRook (coderook.com): version control and project hosting for projects of any size. Every save is a compressed snapshot, private or public, never used to train AI.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://coderook.com",