refactor(kernel): migrate the remaining SHA-256 hex digests to sha256Hex and move isRecord into src/kernel (#11571)

* refactor(kernel): migrate the remaining one-shot SHA-256 hex digests to sha256Hex

* refactor(kernel): move isRecord into src/kernel and replace its inline copies (#11574)

* fix(scripts): import isRecord from src/kernel in the managed manifest parser
This commit is contained in:
morluto authored and GitHub committed 2026-11-15 20:53:36 -05:00
1 parent 9ecfb109e8
commit b51ed4c3ec
157 files changed
+397 -589

No files matched your search

@@ -1,6 +1,5 @@
import type { JavaScriptMemberMutationAllowance } from "../domain/javascript/javascriptSemanticWorkAllowance.js";
import { err, ok, type Result } from "../domain/result.js";
import { createHash } from "node:crypto";
import { posix } from "node:path";
import type { JavaScriptPackageType } from "../domain/javascript/javascriptSourceParser.js";
@@ -28,6 +27,7 @@ import type {
import { typescriptEmittedSourceCandidates } from "./TypeScriptEmittedSourceCandidates.js";
import { appendAll } from "../domain/appendAll.js";
import { decodeStrictUtf8 } from "../domain/strictUtf8.js";
import { sha256Hex } from "../kernel/sha256Hex.js";
export interface ParsedReferenceSourceEntries {
readonly entries: HistoricalSourceGraphInput["entries"];
@@ -57,9 +57,6 @@ const entryRecoveryGuidance = (
return "This file could not be read. Check its permissions, then try again.";
};
const hashBytes = (bytes: Uint8Array): string =>
createHash("sha256").update(bytes).digest("hex");
const failedEntry = (
entry: Extract<ReferenceSourceEntry, { status: "failed" }>,
): HistoricalSourceGraphInput["entries"][number] => {
@@ -563,7 +560,7 @@ const appendFile = (
output.entries.push({
path: entry.path,
kind: "file",
sha256: hashBytes(entry.bytes),
sha256: sha256Hex(entry.bytes),
size: entry.size,
language,
classifications: classifyReferenceSourcePath(entry.path),