test: eliminate fixture races and prune redundant scaffolding (#849)

* test: eliminate fixture races and prune redundant scaffolding

* fix(test): publish launcher capture readiness without renaming
This commit is contained in:
morluto
2026-10-07 12:25:37 +08:00
committed by GitHub
parent 5cbf06c7ad
commit f72931d9dd
22 changed files with 421 additions and 719 deletions
+1 -36
View File
@@ -4,43 +4,8 @@ import {
parseArtifactInventoryEvidence,
tryAssembleInventorySet,
} from "./artifactInventoryEvidence.js";
import { EvidenceReferenceError } from "./evidenceErrors.js";
import type { ReferenceSourceReaderError } from "../reference/ReferenceSourceReaderTypes.js";
/**
* The three validation taxonomies and their disjoint codes:
* - Filesystem reader: cancelled | invalid-root | io | unsupported
* (per-entry: cancelled | changed | io | symlink | unsupported).
* - Session evidence references: missing | wrong_operation |
* wrong_predicate | identity_mismatch.
* - Inventory assembly: TypeError strings, migrating to Result leaves
* starting with the empty-pages code below.
*/
const readerCodes: readonly ReferenceSourceReaderError["code"][] = [
"cancelled",
"invalid-root",
"io",
"unsupported",
];
const referenceReasons = (
[
"missing",
"wrong_operation",
"wrong_predicate",
"identity_mismatch",
] as const
).map(
(reason) =>
new EvidenceReferenceError("ev_test", reason, "expected", null).reason,
);
describe("validation taxonomy mapping", () => {
it("keeps session reference reasons disjoint from reader codes", () => {
for (const reason of referenceReasons)
expect(readerCodes).not.toContain(reason);
});
describe("inventory validation failure channels", () => {
it("returns the empty-pages leaf as Result without throwing", () => {
const result = tryAssembleInventorySet([]);
expect(result).toEqual({