mirror of
https://github.com/morluto/rea.git
synced 2026-11-21 14:05:49 +00:00
test(artifacts): remove descriptor registry mirror checks (#12796)
This commit is contained in:
1 parent
533af33a36
commit
c7353f4257
3 files changed
+1
-98
No files matched your search
@@ -15,7 +15,7 @@ that covers the step.
|
||||
`src/artifacts/AndroidBootImageArtifactReader.test.ts`)
|
||||
- [x] Register metadata schemas and the reader on the uImage inventory,
|
||||
extraction, and target-resolution path. (Requirement 9;
|
||||
`src/artifacts/artifactFormats.test.ts`,
|
||||
`tests/acceptance/androidBootImageCli.test.ts`,
|
||||
`src/application/binary/TargetFormatVocabularies.test.ts`)
|
||||
- [x] Preserve untrusted-string and unknown-role limitations through CLI and
|
||||
MCP Evidence. (Requirements 5 and 9;
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { ARTIFACT_FORMAT_IDS } from "../domain/artifactGraph.js";
|
||||
import {
|
||||
ZIP_PACKAGE_FORMATS,
|
||||
type ZipPackageFormat,
|
||||
} from "../domain/zipPackageFormat.js";
|
||||
import { ARTIFACT_FORMATS } from "./artifactFormats.js";
|
||||
import {
|
||||
createArtifactReader,
|
||||
type ArtifactReaderFormat,
|
||||
} from "./createArtifactReader.js";
|
||||
|
||||
type Equal<Left, Right> =
|
||||
(<Value>() => Value extends Left ? 1 : 2) extends <
|
||||
Value,
|
||||
>() => Value extends Right ? 1 : 2
|
||||
? true
|
||||
: false;
|
||||
|
||||
type FormatsWithReaders =
|
||||
| ZipPackageFormat
|
||||
| "dotnet-bundle"
|
||||
| "bun-standalone"
|
||||
| "deno-standalone"
|
||||
| "dmg"
|
||||
| "asar"
|
||||
| "ines"
|
||||
| "godot-pck"
|
||||
| "unityfs"
|
||||
| "wxapkg"
|
||||
| "uimage"
|
||||
| "android-boot-image"
|
||||
| "android-ota-payload"
|
||||
| "mach-o-universal"
|
||||
| "directory"
|
||||
| "pyinstaller"
|
||||
| "node-sea"
|
||||
| "intel-hex"
|
||||
| "srec"
|
||||
| "esp-image"
|
||||
| "uf2"
|
||||
| "dfuse"
|
||||
| "esp-flash-image"
|
||||
| "fit"
|
||||
| "ntfs-mft"
|
||||
| "uefi";
|
||||
|
||||
const readerFormatsMatch: Equal<ArtifactReaderFormat, FormatsWithReaders> =
|
||||
true;
|
||||
const unknownHasNoReader: "unknown" extends ArtifactReaderFormat
|
||||
? false
|
||||
: true = true;
|
||||
|
||||
describe("artifact format descriptors", () => {
|
||||
it("derives the reader-format union from descriptors that construct a reader", () => {
|
||||
expect(readerFormatsMatch).toBe(true);
|
||||
expect(unknownHasNoReader).toBe(true);
|
||||
});
|
||||
|
||||
it("covers every domain format id and no other id", () => {
|
||||
expect(Object.keys(ARTIFACT_FORMATS).sort()).toEqual(
|
||||
[...ARTIFACT_FORMAT_IDS].sort(),
|
||||
);
|
||||
});
|
||||
|
||||
it("leaves unknown without a reader", () => {
|
||||
expect("createReader" in ARTIFACT_FORMATS.unknown).toBe(false);
|
||||
expect(
|
||||
createArtifactReader("/unused", "unknown", {
|
||||
environment: {},
|
||||
unreadableDirectories: "omit",
|
||||
}),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
it("shares one capability row across zip package families", () => {
|
||||
for (const id of ZIP_PACKAGE_FORMATS)
|
||||
expect(ARTIFACT_FORMATS[id]).toMatchObject({
|
||||
zipFamily: true,
|
||||
occurrenceContainer: true,
|
||||
roleContainer: false,
|
||||
retainClassifiedSource: true,
|
||||
extractable: true,
|
||||
requiresDarwin: false,
|
||||
absentInventory: "unavailable",
|
||||
});
|
||||
const zipIds = new Set<ZipPackageFormat>(ZIP_PACKAGE_FORMATS);
|
||||
for (const id of ARTIFACT_FORMAT_IDS)
|
||||
if (!zipIds.has(id as ZipPackageFormat))
|
||||
expect(ARTIFACT_FORMATS[id].zipFamily).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -75,8 +75,6 @@ export interface ArtifactReaderConstruction {
|
||||
|
||||
export interface FormatDescriptor {
|
||||
readonly id: ArtifactFormatId;
|
||||
/** Every ZIP package family shares this row of capabilities. */
|
||||
readonly zipFamily: boolean;
|
||||
/** Root occurrence kind is container, including directories and zip packages. */
|
||||
readonly occurrenceContainer: boolean;
|
||||
/** Path-role classification treats the format as a container of its own. */
|
||||
@@ -145,7 +143,6 @@ function admittedAs(
|
||||
|
||||
/** One capability row for every ZIP-backed package family. */
|
||||
const ZIP_FAMILY_CAPABILITIES = {
|
||||
zipFamily: true,
|
||||
occurrenceContainer: true,
|
||||
roleContainer: false,
|
||||
retainClassifiedSource: true,
|
||||
@@ -204,7 +201,6 @@ function described<Id extends ArtifactFormatId>(
|
||||
}
|
||||
|
||||
const plain = {
|
||||
zipFamily: false,
|
||||
occurrenceContainer: false,
|
||||
roleContainer: false,
|
||||
retainClassifiedSource: false,
|
||||
|
||||
Reference in new issue
Block a user