fix(javascript): preserve semantic query identity and source coverage

This commit is contained in:
morluto
2026-10-24 02:52:47 +08:00
parent 34552ff0df
commit cf5e4f6fa3
16 changed files with 362 additions and 51 deletions
@@ -34,6 +34,18 @@ export interface JavaScriptArtifactFile {
};
}
/** Producer text exclusions shared by full and incremental source projections. */
export const javaScriptArtifactTextExclusion = (
file: JavaScriptArtifactFile,
): string | null => {
if (file.text.included || file.text.reason === "not-applicable") return null;
if (file.text.reason === "invalid-utf8" && file.kind !== "javascript")
return null;
return file.text.reason === "outside-analysis-scope"
? "Source was not analyzed because it is outside the caller-selected source_paths."
: "Source bytes are not valid UTF-8; JavaScript semantics were not analyzed.";
};
/**
* One inventoried regular file not backed by analyzed source bytes. Its inventory
* occurrence remains available even when content is opaque or unavailable.