From 7f4beb6c06d21f9a99c967b59ccbee98a3b69c9a Mon Sep 17 00:00:00 2001 From: Worph Date: Tue, 14 Jul 2026 16:09:01 +0200 Subject: [PATCH] gitattributes --- .gitattributes | 6 ++++++ packages/meta-dup-core/src/kv/RedisClient.ts | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9f43494 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# FIX CRLF always when developer has not set +# Linux/Mac: git config --global core.autocrlf input +# Windows: git config --global core.autocrlf true +# Auto detect text files and perform LF normalization +* text=auto +* eol=lf diff --git a/packages/meta-dup-core/src/kv/RedisClient.ts b/packages/meta-dup-core/src/kv/RedisClient.ts index 5bc51d6..2093305 100644 --- a/packages/meta-dup-core/src/kv/RedisClient.ts +++ b/packages/meta-dup-core/src/kv/RedisClient.ts @@ -461,11 +461,14 @@ export class RedisClient implements Partial { ctime: data.ctime ? parseFloat(data.ctime) : mtime, // Identification. The midhash (record address) and the full-file - // sha2-256 (exact-dup key) are recovered from the bare-CID - // key-set by multicodec; legacy named fields kept as a - // transition fallback. See METADATA_KEYS.md §2/§14.13. - hashId: hashId ?? pickCidByMulticodec(data, MH_MIDHASH256) ?? data.cid_midhash256 ?? data.hashId, - sha256: pickCidByMulticodec(data, MH_SHA256) ?? data['cid_sha2-256'] ?? data.sha256, + // sha2-256 (exact-dup key) are recovered from the bare-CID key-set by + // multicodec. The legacy `cid_midhash256` / `cid_sha2-256` fallbacks + // are gone: meta-core rejects those fields at the write boundary now + // (400), because a `cid_*` field is stored but never reverse-indexed — + // a record carrying one is unresolvable by that CID. There is nothing + // left to fall back to. See METADATA_KEYS.md §2/§14.13. + hashId: hashId ?? pickCidByMulticodec(data, MH_MIDHASH256) ?? data.hashId, + sha256: pickCidByMulticodec(data, MH_SHA256) ?? data.sha256, // Title information title: data.title,