Repository navigation
refactor(artifacts): describe formats in one registry - #8054
Conversation
Reader construction, classification retention, container role, and extraction now read one descriptor per domain format id. unknown has no reader, and zip package families share one capability row.
|
@gensokyo-dev @dandgabr Format capabilities now live in one descriptor per domain format id. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge; the previous type issue is fixed and no new actionable issues were found. SummaryCentralizes artifact reader construction and format capabilities in one registry.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart LR
IDs[Domain format IDs] --> Registry[Format descriptors]
Registry --> Factory[Reader factory]
Registry --> Classifier[Source retention]
Registry --> Graph[Container roles]
Registry --> Inventory[Availability and limitations]
Registry --> Extraction[Extractable formats]
Reviews (2) · Last reviewed commit: "fix(artifacts): keep reader presence in ..." · Reviewed by Greptile |
Descriptor helpers no longer widen every format to an optional reader, so ArtifactReaderFormat stays the union of formats that construct one.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Take main d48e472. morluto#8054's registry, src/artifacts/artifactFormats.ts, now owns the per-format switches this branch extended, so `uf2` and `dfuse` become registry entries with the old switches' flags and limitation texts, and the reader-format test lists them. morluto#7481's vocabulary guard gains `uf2` and `dfuse` targets. The DfuSe element declaration joins main's `declarationChanged`. Format lists keep both sides, in embedded-integration's order.
This branch carried morluto#7498's pre-squash commits, which upstream merged as squash 64196b0 with maintainer commits. The merge therefore used the absorbed prototype ea2b386 as its base, so the result differs from main only in this branch's own changes; git's own base reported every morluto#7498 region as a conflict. Adaptations to main: - morluto#8054 describes formats in one registry. The esp-flash-image descriptor in artifactFormats.ts now owns the reader construction, admission, classification retention, container role, extraction and reader limitation that this branch had spread over createArtifactReader, classify, ArtifactGraphConstruction, ArtifactExtraction and the inventory reader. EspFlashAdmission joins ArtifactFormatAdmission. - morluto#7498 moved the ESP image fixture to tests/fixtures/espImage.ts; the ESP flash tests import it from there. - morluto#7481's vocabulary guard expected every caller-selected format hint to name an executable target; an ESP flash dump is read as an archive. - morluto#7905 bounds MCP arguments at 1,024 elements by default, which the inline flash-dump inventories exceed, so the ESP flash comparison test compares the Evidence its session retained.
Summary
Artifact formats now have one descriptor each. The reader factory, classifier, graph builder, and extractor read that descriptor instead of repeating format switches.
Problem and expected behavior
Adding a format meant updating separate string lists in the reader factory, classifier, graph builder, and extractor. A format id from the domain list should have one descriptor.
unknownstays an id with no reader. ZIP package families share one capability row. Formats that construct a reader stay inArtifactReaderFormat; formats that do not, includingunknown, stay out of that union.Change and scope
ARTIFACT_FORMAT_IDSremains the domain list.src/artifacts/artifactFormats.tsis aRecord<ArtifactFormatId, FormatDescriptor>. A missing id fails typecheck. ZIP ids are built fromZIP_PACKAGE_FORMATSwithZIP_FAMILY_CAPABILITIES. Helpers that attach a reader return a type wherecreateReaderis required, soArtifactReaderFormatis the union of those ids rather thannever. Byte probes that decide which format a prefix is stay in the classifier; only the per-format capability switches moved. Follow the contribution scope.Ordinary refactor of existing format dispatch. Not applicable.
Contract and boundary impact
docs/public/product-catalog.json), package, or installation impact (CI generates and validates ignored catalogs andskills/; edit authored instructions in.agents/skills/reverse-engineer-anything/and never commit build outputs): noneExpected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/artifacts/artifactFormats.test.tschecks that registry keys equalARTIFACT_FORMAT_IDS, thatunknownhas no reader, that every ZIP package id matchesZIP_FAMILY_CAPABILITIES, and thatArtifactReaderFormatequals the ids whose descriptors construct a reader.createArtifactReader.ts,classify.ts,ArtifactGraphConstruction.ts,reader.ts, andArtifactExtraction.ts. Greptile foundArtifactReaderFormatresolved toneverbecause every helper returnedFormatDescriptor.For boundary fixes, identify the applicable boundary regressions
and lifecycle regressions
covered by the evidence above, and explain relevant gaps.
FIT reader tests and artifact graph construction tests cover the reader and container classification those switches used. Lifecycle regressions are not applicable.
For evidence-bearing changes:
Validation performed
npm run format:check— all matched files use the correct formatnpm run check:fast— typecheck and lint succeedednpm run test:focused -- src/artifacts/artifactFormats.test.ts src/artifacts/FitArtifactReader.test.ts src/artifacts/inventory/ArtifactGraphConstruction.test.ts— 70 passedCompatibility, safety, and release
Author readiness
Human owner: @morluto
Before merge
type(scope): outcome.