2.3 KiB
2.3 KiB
PR-03 Asset Declaration Parsing, Validation, and Details Contract
Domain Owner: docs/packer
Briefing
Implement strict asset.json parsing and the packer-side details contract used by both tooling and Studio.
This PR converts the declaration spec into typed packer models and structured diagnostics.
Objective
Deliver strict parse, schema/version checks, common field validation, and a get_asset_details response model that Studio can consume through an adapter.
Dependencies
./PR-02-workspace-init-registry-and-identity-foundation.md../specs/3. Asset Declaration and Virtual Asset Contract Specification.md../specs/6. Versioning, Migration, and Trust Model Specification.md
Scope
- parse and validate the common
asset.jsoncontract - validate required baseline fields:
schema_versionnametypeinputsoutputpreload
- emit structured diagnostics for parse, structural, and version errors
- define the packer
get_asset_detailsresponse model - preserve distinction between valid-orphan declarations and invalid declarations
Non-Goals
- no full format-family payload encoding rules
- no workspace scan aggregation yet
- no mutation apply behavior yet
Execution Method
- Implement typed declaration models and strict decoding.
- Add common semantic validation and diagnostic mapping.
- Define details-response DTOs that preserve both declaration and diagnostic evidence.
- Back the contract with representative valid and invalid fixtures.
Acceptance Criteria
- invalid declarations fail with actionable structured diagnostics
- valid declarations produce stable typed models
get_asset_detailscan expose declaration, inputs, output, preload, and diagnostics cleanly- unsupported or malformed schema versions surface as explicit failures
Validation
- fixture-driven parser tests
- semantic validation tests for required fields
- details-response tests for valid, orphan, and invalid declarations
Affected Artifacts
prometeu-packer/**- packer declaration fixtures
- cross-domain reference: Studio asset details adapter inputs