# Step-02 - Vehicle profiles and control module model ## STEP IDENTIFIER Step-02, regenerated 2026-10-28 following acceptance of Step-01A. This assignment explicitly **supersedes the previously prepared but unexecuted Step-02 assignment** following the Step-01A architectural correction. The old headless/four-project/dual-host instructions no longer apply. This is the only currently authorized implementation assignment. ## STEP TITLE Introduce validated vehicle profiles, extensible module metadata, provenance, versioned JSON interchange and explicit configuration selection through cohesive application feature slices, with a thin consumer in the existing UI. ## OBJECTIVE Deliver a cohesive vertical slice that imports a clearly synthetic vehicle profile, validates its module identities/capabilities and provenance, registers multiple saved configurations, selects an exact configuration, and exports it without losing information. Demonstrate the full path through real application features, DI-based integration tests and a minimal profile metadata page in the existing MAUI-hosted UI. Do not implement simulation, diagnostic communication, calibration editing, programming or AI. Profile metadata is not evidence that an operation exists or is authorized. You are the WORKER. Execute only this assignment, write `prompts/Step-02-Report.md`, and STOP for manual orchestrator review. ## ARCHITECTURAL CONTEXT Read [ROADMAP.md](ROADMAP.md), [STATE.md](STATE.md), and the existing [architecture](../docs/architecture.md) and [build/test policy](../docs/build-and-test.md). AutoForge is one local-first .NET 10 platform integrating deterministic simulation, vehicle-wide diagnostics/telemetry/calibration, and replaceable local AI. Vehicle and module definitions must be data-driven rather than fixed to a manufacturer, engine ECU, transmission controller or fixed list of module roles. Core owns platform-neutral domain types and invariants. Application uses Vertical Slice Architecture within a modular monolith; profile import/export/list/select are cohesive feature operations, not a generic service/repository layer. Organize them under `Features/Vehicles` or an equally clear profile feature area. Share feature-local schema/catalog code only where it is genuinely reused; do not force every operation into requests/handlers or introduce a mediator. The sole executable remains AutoForge.Client (.NET 10 MAUI Blazor Hybrid); AutoForge.UI owns pages/routes/feature presentation and AutoForge.Components owns generic controls. UI invokes application contracts; Client performs thin in-process composition. Preserve Client -> UI -> Components and inward domain dependencies. Keep all seven projects. No new shell/RCL/backend or restructuring belongs here. All source and automated tests remain under `src`; tests under `src/tests`. Only `docs`, `src`, and `prompts` are top-level project directories. Preserve root configuration and protected infrastructure. Handoffs are manual, with no watchers, polling, automatic agent invocation or next-step execution. ## CURRENT IMPLEMENTATION STATE Accepted Step-01 plus Step-01A provide: - [AutoForge.slnx](../src/AutoForge.slnx) with Core, Application, Components, UI, Client, UnitTests and IntegrationTests. Client targets `net10.0-windows10.0.26100.0`/win-x64; the other projects target `net10.0`. - Client -> UI/Application; UI -> Components/Application; Application -> Core. Neither portable test project references Client; Components has no AutoForge project dependency and there is no cycle or separate backend. - Immutable target descriptors for Simulation, RecordedReplay and PhysicalHardware. Resolution requires an explicit provider identifier and kind; unknown, mismatched, invalid or ambiguous inputs fail without fallback. - Snapshot isolation and eager DI validation through [AddAutoForgeTargetSelection](../src/AutoForge.Application/Features/ExecutionTargets/SelectExecutionTarget/ServiceCollectionExtensions.cs). There are no production provider registrations or operational transports. - Existing application target-selection slice at `Features/ExecutionTargets/SelectExecutionTarget` with stable public namespace. Existing UI routes `/`, `/execution-targets` and explicit not-found presentation, a feature-local selection view model, `AddAutoForgeUi`, and reusable StatusNotice. Client uses real application DI with an empty provider registry. - SDK 10.0.402 with stable same-feature-band patch roll-forward, shared nullable/ warnings-as-errors conventions, central package pins and a working VSTest/xUnit test stack. - Worker-recorded successful full solution/direct native Release builds, zero warnings/errors, 39 unit plus 26 integration cases passed and zero failed/skipped. This includes all 54 Step-01 regressions. Native Windows route/asset/selection smoke was reported. See [Step-01A report](Step-01A-Report.md). - Reported native prerequisites: MAUI Windows manifest 10.0.110, Windows SDK 10.0.26100.0, runtime 10.0.13 and WebView2 155.0.4283.62. - No vehicle/profile model, simulator, diagnostic/telemetry engine, persistent storage, AI or hardware operation exists. The orchestrator accepted Step-01A by inspecting implementation and evidence, not by rerunning builds/tests. Reinspect Git status and applicable instructions; existing implementation changes are still unstaged/uncommitted and must not be discarded. Preserve all prior assignments/reports. Known hygiene/process notes: - The prior worker mistakenly invoked workload restore during inspection and reported manifest updates. No rollback occurred. Do not run `dotnet workload restore`, install, update, repair or uninstall as inspection or without separate authorization. Read-only SDK/workload listing is sufficient unless a concrete failure identifies a prerequisite. Ordinary package restore is different. - Raw Git whitespace checking flags README CRLF against a mixed-line-ending index; no trailing spaces/tabs were found. Normalize README to the repository's existing Markdown LF convention during its required update, without changing Git settings. ## REQUIRED IMPLEMENTATION ### 1. Vehicle definitions and saved profiles Introduce a small, strongly typed domain model sufficient to represent: 1. A stable profile identifier, profile/configuration revision and vehicle identity or definition reference. Keep schema version separate from profile revision. 2. Manufacturer/model/model year and optional trim, engine, transmission and drivetrain information. Unknown optional facts must remain explicitly unknown, not fabricated defaults such as a zero model year or invented engine. 3. A saved vehicle configuration with an arbitrary inventory of module instances. The same vehicle may have multiple saved configurations or revisions; different vehicles may have different inventories. 4. Module-instance identity distinct from its human-readable role/name, plus hardware, software, firmware and calibration identifiers where known. Unknown identifiers do not become "compatible" or a complete firmware image. 5. Calibration identity/reference metadata only, sufficient to distinguish saved configurations. Do not model memory offsets, tune tables, firmware bytes or real manufacturer definitions in this step. Use explicit validation for required fields, positive revision/schema values, identifier uniqueness and valid optional values. Define identifier comparison semantics; do not silently trim or merge ambiguous identities. Modules of the same role may coexist if their instance identities differ. Do not use a fixed enum of module types that prevents a new/custom module role. Prefer a self-contained profile document for this first interchange format. If references are used internally, validate that required references resolve within the document/catalog and cannot silently bind to an unrelated revision. Avoid a generic entity/definition framework or arbitrary property-bag domain. ### 2. Capability declarations with explicit uncertainty Represent operation identifiers independently of module role. Support ordinary diagnostic/configuration/calibration/firmware/service operation declarations and custom operation identifiers without changing a closed module-type enumeration. Distinguish at least Supported, Unsupported, Unknown, Inaccessible and Restricted. Describe their meaning in documentation and retain explanatory restrictions/ limitations and supporting provenance where supplied. - A missing declaration must not become Supported. Expose a documented explicit not-declared/Unknown outcome with a reason, or an explicit lookup failure. - Unknown, inaccessible, restricted and unsupported are not interchangeable. - Declared support is metadata, not an implemented service, connection, permission or physical-write authorization. - Reject invalid statuses and duplicate/ambiguous declarations. Ensure caller mutation cannot alter a validated profile's capabilities. Do not add an operation executor, a programming approval system or a real capability-discovery implementation. ### 3. Provenance and applicability Provide a practical reusable evidence representation for profile/module facts and capability/identity metadata. It must carry: - Classification: VERIFIED, UNVERIFIED, INFERRED or SYNTHETIC. - Source/reference and useful evidence description. - Publication/retrieval information when known, supplied explicitly rather than generated from the current clock during validation or serialization. - Applicable vehicle/configuration/module and hardware/software/firmware or calibration context where known. - Confidence/verification information and known limitations; unknown confidence is allowed explicitly rather than silently treated as certain. Define inheritance or reference rules so evidence is not copied everywhere while its applicability remains unambiguous. Reject dangling evidence references, invalid classification/confidence values, and conflicting applicability rather than silently mixing vehicles, model years or module versions. If confidence is numeric, document the scale and require finite in-range values, including rejection of NaN/infinity through any direct construction path. Do not claim that labeling a source VERIFIED independently verifies its contents. The system preserves supplied evidence; no online research or authority promotion is implemented. Synthetic fixture facts/evidence must remain visibly SYNTHETIC. No provenance status authorizes physical writes. ### 4. Versioned JSON interchange with validation Implement import/export of a documented schema version 1 through Application. Use built-in .NET JSON support unless a concrete missing capability justifies a dependency; verify any actual API before using it. Requirements: 1. Schema version is explicit and distinct from profile/configuration revision. 2. Reject missing/unsupported schema versions, malformed JSON, null/missing required fields, invalid enum/status values, duplicate identities/capabilities, broken references and invalid domain data. Do not silently downgrade or "repair" input. 3. Reject ambiguous duplicate JSON properties. Define an explicit unknown-property policy; prefer rejecting unknown schema fields for v1 rather than silently discarding identity, capability or provenance information. 4. Optional unknown information has a documented representation that round-trips without becoming a default fact. Persist all declared statuses and provenance. 5. Deserialization must enforce the same invariants as direct domain construction; it cannot bypass validation through setters, mutable arrays or DTO mapping. 6. Round-trip a valid profile without semantic loss, including module inventory, unknowns, identity/revision, capability states and evidence applicability. 7. Failures are explicit and actionable with schema/property/identifier context as appropriate. Do not log full private payloads or silently return an empty synthetic profile. Follow existing argument/typed-exception conventions. 8. No wall-clock-generated IDs/timestamps, random behavior, network calls or hidden file writes during import/export. In-memory string/stream interchange is enough; no database or permanent user-file storage is required. The worker chooses straightforward domain and serialization representations. If DTOs/mapping are necessary to preserve invariants, keep them local and small; Core must not depend on DI, Application or persistence infrastructure. ### 5. Explicit catalog selection and real application composition Provide a narrow application service/catalog that accepts validated profiles, lists available configuration identities and resolves an explicitly requested profile/configuration identifier and revision. Expose these behaviors through cohesive feature operations; an in-memory feature-local catalog is sufficient. Do not introduce generic repositories or permanent database/file storage. Keep any selected configuration explicit to the request/presentation scope rather than a mutable global execution mode. - Support multiple vehicles and multiple saved variants of one vehicle. - Reject duplicate keys under the documented identity rule. An exact unknown revision must fail even when another revision of that profile exists. - Require explicit selection; do not choose the first/latest/closest profile, substitute another vehicle or infer a physical execution target. - Preserve immutable snapshots. Editing/replacing caller collections or registering another configuration must not mutate an original validated version. - Empty catalogs produce explicit not-found/unavailable behavior, not a fabricated vehicle. Failed import must not partially register a profile. - Wire through the real DI path, without changing the existing target-selection contract or registering fake connected/available providers. Catalog selection is metadata selection only. It must not couple profile loading to a global active target, a hardware connection, the UI or an AI model. ### 6. Clearly synthetic example data Create source-controlled schema-v1 fixtures under the test tree: - An AutoForge Synthetic Test Truck baseline with at least three differently named module instances, including a non-powertrain role. - A second saved configuration/revision for that vehicle with a meaningful metadata difference, such as a distinct synthetic calibration identity. Preserve the original baseline without modifying it. - Test coverage for another differently shaped synthetic vehicle/inventory, including a custom module role and operation identifier. Across the fixtures/tests, exercise all five capability states and at least one unknown optional identity. Supply explicit synthetic provenance and limitations. Do not claim real manufacturer compatibility, use private VINs, invent authentic diagnostic commands/offsets, or put synthetic fixture data in ignored local-data. Fixtures describe metadata, not real services or working simulation. Avoid duplicated fixture copies between test projects or an unnecessary shared test-helper assembly. Use a simple existing test-tree arrangement. ### 7. Minimal profile UI in the existing application Add a profile metadata feature page, for example `/vehicle-profiles`, under AutoForge.UI's feature organization, plus a navigation entry in the existing layout. Do not move routing/pages into Client or restructure the shell. - Provide a simple JSON text input for explicit import, an available-profile/ revision listing and explicit selection, and a read-only metadata inspection/ JSON export area. No OS file picker, persistent user files or auto-loaded real vehicle database is needed. - Invoke the same application import/list/select/export operations tested headlessly. Presentation adapts inputs and displays errors; domain/schema validation remains in Core/Application. - Show module identities, declared capability states, unknown information, provenance and synthetic limitations accurately. Reuse StatusNotice. - Do not silently select the first/latest/imported configuration, mutate a previously selected baseline, or change execution-target/provider registration. - Invalid JSON, unsupported schema, duplicate import and unknown selection must produce explicit visible errors without partial registration or replacement. - Do not claim a loaded profile is connected, a supported service is implemented, or a synthetic calibration identity is firmware/tune data. - Restrict Client changes to necessary feature DI composition; add no second executable, backend, native adapter, fake provider or placeholder future screen. ## FILES OR PROJECTS EXPECTED TO CHANGE - Add domain models/validation to `src/AutoForge.Core`. - Add feature-organized JSON interchange/catalog operations and DI wiring under `src/AutoForge.Application/Features`. - Add profile feature presentation and navigation in `src/AutoForge.UI`; reuse Components. Touch Client only for necessary in-process DI composition. - Extend both existing test projects; place synthetic fixtures under `src/tests`. - Update root README and relevant documentation under `docs`. - Update dependency/build configuration only if necessary, with a specific rationale. - Create only `prompts/Step-02-Report.md` under `prompts`. Do not modify roadmap/state/assignments or prior worker reports. Do not modify or create `.github/copilot-instructions.md`, or alternative override instructions. Preserve existing uncommitted changes. Do not stage, commit, push or initialize Git. ## INTERFACE AND DEPENDENCY REQUIREMENTS - Keep all seven existing projects and corrected reference direction. No new framework, database, host, adapter, RCL, knowledge service or test project is needed. - Reuse existing validation/error/DI patterns where applicable without forcing unrelated abstractions. Keep the explicit-target service behavior unchanged. - Profile/module/capability identity is data-driven. Unknown facts cannot enable support or authorize execution, and provenance cannot override access restrictions. - Use strongly typed models and immutable/snapshotted collections. Do not expose backing arrays/lists/dictionaries that bypass validation. - Use the installed SDK/test stack and existing central pins. Do not install packages preemptively or retarget to another framework. - Application/domain tests remain independent of UI/native startup. UI tests render the actual portable RCL without Client. No external service, inference, cloud account, device, model, wall-clock data input or uncontrolled randomness is needed. - Do not add a simulation ground-truth shortcut to ordinary application models. ## TESTING REQUIREMENTS ### Unit tests Cover domain construction and use-case behavior, including: - Required identifiers, valid optional values, invalid revisions/year/confidence/ classification/status values and null/missing data where applicable. - Multiple modules with the same role but distinct instance IDs; duplicate IDs and duplicate operation declarations fail under the documented comparison rule. - Every capability state and explicit missing-capability behavior. - Evidence references/applicability, unknown identities and synthetic classification. - Input-collection mutation and immutable original configuration preservation. - Catalog empty/unknown/duplicate selection, exact revision selection and no cross-vehicle/first/latest fallback. - Import/export invalid-input boundaries and semantic round-trip behavior. ### Integration tests Exercise actual Core/Application/JSON/catalog feature implementations through DI: 1. Load a synthetic fixture, validate and register it, explicitly select its exact configuration, export/reimport it, and compare the meaningful complete model. 2. Select baseline and variant independently; verify their module/calibration identity differences and that the baseline remains unchanged. 3. Load another vehicle/custom module/operation without changing production code. 4. Verify all five statuses, evidence classifications/applicability, explicit unknown values and unknown-capability behavior survive round-trip. 5. Reject malformed JSON, missing/future schema, duplicate properties, invalid/ missing required fields, duplicate module/capability IDs, invalid statuses and dangling/conflicting evidence. Failed import cannot leave a partial catalog entry. 6. Verify unknown profile/revision and mismatched identity cannot select another saved configuration; caller mutation cannot change the selected snapshot. 7. Compose profile services alongside the existing target resolver. Loading or selecting a profile must not create/replace a provider or change an explicit target selection. Retain all Step-01/Step-01A regression behaviors. 8. Render the real new profile UI with the same application feature composition; verify metadata/unknown/status/provenance/error presentation and explicit selection/export behavior. Do not mock the feature under test. Do not mock the services under test or assert only that a container returns an object. Use exact structural assertions on identities, values, statuses, unknowns and provenance; comparing only profile counts or JSON text is insufficient. ### Execution evidence From the repository root, run the relevant focused tests while implementing, then run the complete seven-project Release build and both suites for regression: - `dotnet restore .\src\AutoForge.slnx` when dependency restoration is needed. - `dotnet build .\src\AutoForge.slnx --configuration Release --no-restore` - `dotnet test .\src\AutoForge.slnx --configuration Release --no-build` Use the configured SDK and runner. Record exact commands/exit outcomes, warnings, per-project discovered/passed/failed/skipped counts and any corrected failures. Preserve the accepted 54 Step-01 cases/invariants and add substantive new coverage; also preserve the 11 additional Step-01A rendered/graph cases (65 total baseline). Do not remove checks or skip acceptance tests to produce a green report. Build the real Windows Client as well if a direct native command is needed to diagnose target/runtime issues. Use the existing verified Windows TFM; do not apply a Windows framework override to portable projects. The established runtime-specific package restore may be needed after manifest changes: `dotnet restore .\src\AutoForge.Client\AutoForge.Client.csproj --runtime win-x64`. This is package restore, not permission to change installed workloads. ### Native profile-feature smoke Launch the actual Client on the existing supported Windows desktop. Navigate to the new profile page, import synthetic fixture JSON, explicitly select baseline and variant, inspect module/capability/provenance/unknown metadata, and export a selected configuration. Confirm invalid/duplicate input is visible and does not replace valid data or change target selection. Verify existing home/target/not-found routes remain functional. Record observations separately from headless tests. If native execution/build becomes unavailable, report the exact blocker and unexecuted check honestly; do not substitute a web host or claim full completion. Report durable evidence in the step report, with optional ignored result files under `src`. The orchestrator will inspect it without executing builds/tests. Finish with a Git status/diff and protected-file/scope review; do not discard unrelated work or perform destructive cleanup. ## DOCUMENTATION REQUIREMENTS Update the documentation index, architecture, build/test guidance and root README to describe actual implemented profile/module/provenance/interchange/catalog behavior and its limitations. Add concise schema-v1/profile documentation with: - Model responsibilities, identifier/revision semantics and unknown representation. - The five capability states, missing declaration behavior and no authorization. - Provenance references/inheritance/applicability, validation and confidence rules. - JSON schema shape, required/optional fields, unknown/duplicate property policy, supported version, explicit unsupported-version outcome and future migration rule. - Synthetic fixture purpose, provenance and how to exercise the application path. - Immutable version selection and error outcomes. - Application slice and UI ownership, in-memory/session-only lifetime, explicit selection, synthetic import/export walkthrough and native smoke procedure. Record a focused ADR only for a significant new decision, such as persisted schema/versioning rules; do not create empty future-feature documents. Align README and existing ADR lifecycle text with Step-01A's acceptance, clearly distinguish Step-02 worker completion from pending orchestrator acceptance, and preserve prior reports as historical evidence. Preserve the real native Client startup/build commands; profiles are metadata only, not a diagnostic transport, simulator or hardware support. Retain one Client/two RCLs and no backend. Normalize the README's line endings as noted above; do not change global Git settings or rewrite unrelated historical files to conceal whitespace warnings. ## ACCEPTANCE CRITERIA | ID | Criterion | Required evidence | |---|---|---| | AC-01 | Existing repository, seven-project single-shell/RCL/VSA architecture, accepted target behavior and manual/protected workflow preserved; no shell restructuring or new assembly | Git/scope/reference review and all 65 baseline regression results | | AC-02 | Validated versioned profiles model multiple vehicles/configurations, arbitrary module roles, identities and calibration references with explicit unknowns | Source paths and positive/negative domain tests | | AC-03 | All five capability states, extensible operation IDs, duplicate rejection and explicit missing declarations work without granting operational authority | Behavior tests and documented status contract | | AC-04 | Provenance classifications, sources, confidence/verification/limitations and applicable identity context round-trip; invalid/conflicting references fail | Model/schema documentation and evidence validation tests | | AC-05 | Schema-v1 JSON import/export preserves semantic data and enforces domain invariants; malformed/missing/future/ambiguous data fail explicitly | Full round-trip and enumerated rejection tests | | AC-06 | Feature-organized real DI path supports exact profile/revision selection, empty/unknown/duplicate failure, immutable originals and atomic import; thin real UI consumes it without target fallback | Source paths, application/rendered integration assertions and native profile smoke | | AC-07 | Clearly synthetic baseline/variant and alternate-vehicle coverage prove data-driven module/operation handling without manufacturer claims | Visible fixture paths and integration evidence | | AC-08 | Seven-project Release/native build, both suites with all accepted/new cases and native UI smoke succeed; no required skipped/zero-discovery cases | Exact commands/targets/outcomes, warnings, per-project counts and native observations | | AC-09 | README/index/architecture/schema guidance match implemented scope, lifecycle and existing Markdown convention; prior reports unchanged | Documentation/preservation summary and line-ending check | | AC-10 | Complete Step-02 report saved at the required path; worker stops without changing orchestration files or starting Step-03 | Report sections, acceptance table and Git review | Map every criterion to PASSED, FAILED, NOT EXECUTED or BLOCKED with concrete evidence. Overall COMPLETE requires every criterion and required execution to succeed. State unresolved failures and environment blockers explicitly. ## OUT-OF-SCOPE WORK Simulation/dynamics/virtual modules, diagnostics/protocols/transports, telemetry, recording/replay, calibration definitions/values/editing/programming/backups, runbooks/approval execution, real hardware/drivers, new/restructured UI hosts/RCLs, databases, knowledge research/RAG/AI/model downloads, MCP, containers and cloud infrastructure. No authentic manufacturer definitions or online vehicle research are needed. No operation intended to defeat emissions, bypass anti-theft, falsify mileage or disable safety systems is permitted. ## REPORTING REQUIREMENTS Create `prompts/Step-02-Report.md`, entirely inside exactly one plain triple-backtick code fence, without a language tag or content outside it. Use no nested fences. Use the same copy-window format for the final chat report. Include: 1. Step identifier/title and COMPLETE, INCOMPLETE or BLOCKED status. 2. Implemented functionality and explicit distinction from planned functionality. 3. Files created and modified; pre-existing/concurrent changes preserved. 4. Architectural/project/dependency changes and new public contracts/error behavior. 5. Schema/identifier/revision/unknown/capability/provenance decisions and limitations. 6. Unit tests created/modified and their behavior coverage. 7. Integration tests created/modified and actual boundaries/assertions exercised. 8. Environment/SDK/package/runner choices and any necessary changes. 9. Exact restore/build commands/results, exit outcomes and warnings/errors. 10. Exact test commands/results, per-project counts, prior regression preservation and any failed/skipped/unexecuted cases. Include native profile-feature launch/interaction observations separately. 11. AC-01 through AC-10 evidence table. 12. Documentation changes and root README changes. 13. Known limitations, outstanding issues/blockers and corrected failures. 14. Deviations and rationale; relevant recommendations for review. 15. Protected assignment/report/orchestration preservation and final Git review. Include README line-ending verification and confirm no workload-changing inspection/installation/update/rollback command was invoked. Never claim unexecuted tests passed or metadata proves operational compatibility. After saving the report, STOP. Do not change assignments/roadmap/state, create Step-03, invoke another agent, automate handoff, stage, commit or push.