AutoForge/prompts/Step-03B.md

16 KiB

Step-03B - Preserve probe evidence when identification is unavailable

STEP IDENTIFIER

Step-03B, corrective assignment for the remaining Step-03 finding R-04. Step-03A's R-01/R-02/R-03 fixes are accepted within their scope. Step-03 as a whole is NOT ACCEPTED. This is the sole active assignment; Step-04 is blocked.

STEP TITLE

Represent successful probing and successful identification as separate facts, retaining valid partial discovery evidence and truthful UI counts.

OBJECTIVE

Correct discovery's loss of a validated positive probe when the later identity operation is unavailable or fails. Preserve actual services/phase outcomes, explicit uncertainty, existing action guards, transport traces and all accepted wire/verification fixes. Do not redesign the protocol or begin dynamics.

You are the WORKER. Execute only this correction, write prompts/Step-03B-Report.md, and STOP for manual orchestrator review.

ARCHITECTURAL CONTEXT

Read STATE.md, ROADMAP.md, Step-03, its report, Step-03A and its report, plus current protocol/simulation/architecture docs.

Keep the nine-project .NET 10 modular monolith, sole native Client and two RCLs. Diagnostics owns protocol/session/result contracts; Simulation owns virtual definitions/state; Application coordinates ports; UI presents application facts. No new project, package, host, backend, provider or mediator.

All source/projects/tests remain under src, tests under src/tests. Root project directories remain docs, src, prompts. Handoffs are manual.

CURRENT IMPLEMENTATION STATE

The synthetic provider, explicit session lifecycle, real encoded wire path, static signals, virtual DTC state/oracle, bounded trace and /diagnostics UI exist. Step-03A corrected:

  • Required/unambiguous requests and no dispatch for malformed clear frames.
  • Complete semantic reply validation before positive result/trace.
  • Application clear-and-verify, distinct acknowledgement and empty fresh readback.

Preserve these fixes and their actual regression coverage. Worker evidence records a clean complete nine-project/native Release build and 175 passed cases: 111 unit + 64 integration, zero failed/skipped. Native baseline smoke passed; test-only injected failed-clear evidence was correctly reported as rendered real-DI integration, not native Client coverage.

The orchestrator found R-04 by inspecting source, allowed definitions and the discovery contract; it did not execute a reproduction or run builds/tests. Reinspect Git/instructions and preserve pre-existing dirty implementation and historical assignments/reports.

REQUIRED IMPLEMENTATION

R-04 - Do not discard successful probe evidence on identity failure

Relevant locations:

Concrete valid counterexample: configure a module to implement probe but not read.identity. This is allowed by VirtualModuleDefinition and protocol v1. The endpoint returns a validated positive probe. Its identity is unavailable, but current discovery loses its successful probe/service evidence and counts it as though it never responded.

The same information loss occurs when probing succeeds and identification then returns a negative response, malformed/mismatched identity, timeout or cancellation. This is not the fixed Step-03A case of an invalid probe: the probe itself is valid.

1. Preserve phase-specific results

Use the smallest clear result/model change that represents:

  • Expected endpoint/profile context.
  • Probe outcome and its actionable error, if any.
  • Whether a validated positive probe was received, with its immutable advertised services retained independently of identity success.
  • Identity outcome or explicit not-attempted/unavailable state, its error and identity only when actually validated.

Do not encode not-attempted as default PositiveResponse, parse human error strings to infer the phase, or reconstruct business results from the trace. Define counts/collections so successful probes and successfully identified modules are distinguishable. Rename ambiguous members/update consumers where appropriate; no speculative compatibility adapter is required.

On probe success plus identity failure:

  • Keep the successful probe and advertised services.
  • Keep identity null/unverified; preserve its actual failure/unavailable reason.
  • Do not substitute role/name/hardware/software/calibration from profile metadata and call that a retrieved identity.
  • Do not relabel the valid positive probe as failed because another exchange failed. Keep each actual wire exchange's own truthful trace/outcome.

On no-response/timeout/malformed/mismatched probe:

  • Do not count it as a validated positive probe or an identified module.
  • Do not invent advertised services or perform/claim a successful identity read.
  • Preserve precise outcomes and explicit not-attempted identity state.

If identity is not advertised, the client may avoid an unsupported identity request or retain the existing explicit request/failure behavior. Document and test the chosen policy. Either way, its valid probe/service evidence remains. Do not require every virtual module to implement identity or reject valid probe-only definitions merely to hide the defect.

2. Make UI summaries and partial states truthful

Update the real UI/view model to distinguish expected endpoints, successful validated probes and identified modules. Labels must say what is counted; do not use an identity count as the number of endpoints that responded.

Show partial rows and advertised services with explicit identity-unavailable/ unverified status and the phase-specific reason. A successful probe is not a complete identity verification or operational authorization.

Preserve existing identity-dependent read/clear action gates. In particular, retaining advertised clear support must not enable virtual clear when identity validation failed. Do not broaden low-level service authorization or physical access as part of this display/result correction.

Cancellation after a successful probe must retain already validated partial facts without claiming successful identification. Closing/resetting a session must still discard stale active-session presentation and preserve isolation. Normal fully identified examples and existing no-response behavior remain correct.

3. Keep the actual communication and safety boundaries

Derive facts from actual validated probe/identity exchanges, not profile inventory, role assumptions or test-only shortcuts. Preserve strict v1 request/reply validation, no fallback, immutable raw trace, logical timing, isolated state, Application verified-clear and the internal test-oracle boundary.

No wire-format/schema version change, simulation clock redesign, extra service, physics, raw-frame console or new host is required.

FILES OR PROJECTS EXPECTED TO CHANGE

  • Diagnostics discovery result/aggregation and directly related consumers.
  • Existing diagnostic UI view model/page for phase-specific rows/counts/messages.
  • Existing unit/real-DI/rendered integration tests and narrowly needed data/fault helpers. Keep original synthetic examples where practical.
  • README, discovery/protocol/simulation/ADR/testing docs as directly affected.
  • Create only prompts/Step-03B-Report.md under prompts.

Do not change assignments, ROADMAP, STATE, previous reports or protected Copilot instructions, or create override instructions. Do not stage, commit, push, initialize/reset Git or discard unrelated work.

INTERFACE AND DEPENDENCY REQUIREMENTS

Retain the nine-project graph and one Client executable. Keep phase/model/business aggregation in Diagnostics/Application and UI presentation in the RCL. No UI or Application access to Simulation runtime state/oracle. No new dependencies or workload install/restore/update/repair/rollback are authorized; ordinary package restore is distinct and only needed after a real missing-dependency failure.

Unknown/unavailable identity is never fabricated verification or permission. All Simulation-only, metadata/connection, no-physical-programming and accepted profile timestamp/evidence safeguards remain unchanged.

TESTING REQUIREMENTS

Actual pre-fix reproduction

Add a real-definition/transport regression for a valid positive probe with unsupported identity and execute it against the current code. Record the actual failure before implementing the correction, then record passing corrected runs. Do not describe static analysis as a runtime reproduction.

Required behavioral matrix

Use actual protocol/Simulation/Application paths, not a mocked discovery service:

  1. Valid probe-only module: positive probe retained, no verified identity, explicit unsupported/unavailable identity, advertised probe services retained; correct probe-versus-identified counts.
  2. Valid probe advertising other services but unavailable identity: retain claims as probe evidence while existing identity-dependent actions remain blocked.
  3. Valid probe followed by negative identity, malformed/mismatched identity and timeout: preserve probe and services, report actual identity failure, no fake identity and no false no-response classification.
  4. Cancellation or session close after a successful probe while identity is pending: preserve correct low-level phase facts; UI remains partial/cancelled or closed, never stale identified success.
  5. Failed/no-response/timeout/invalid probe: zero validated positive probe count, no fabricated identity/services, clear identity-not-attempted status.
  6. Normal fully responding/identified modules: both metrics correct, existing discovery/read/verified-clear/reset/trace behavior unchanged.

A small deterministic response decorator may reuse the existing RewritingDiagnosticTransportFactory for identity-specific faults. Do not alter every service's latency just to simulate an identity timeout if that would time out the preceding probe too. Do not add random delays or Thread.Sleep tests.

Assert actual raw traces per exchange: valid probe stays PositiveResponse; identity failure retains its own negative/protocol/timeout/cancelled outcome; no duplicate or rewritten probe trace. Assert exact identity-null and retained service-list values, not just endpoint counts.

Real UI integration

Render the actual /diagnostics route with real DI after the partial discovery. Assert truthful distinct counts/labels, phase-specific reason, visible unverified identity and retained advertised services. Ensure no profile-derived identity or identity-dependent clear/read button is enabled on that partial row.

Keep original profile/target/home/not-found routes and R-01/R-02/R-03 correction assertions. Map any necessary discovery API/label assertion changes explicitly; do not delete safety or failure checks to make the suite green.

Full build/regression and native evidence

Preserve the accepted corrective baseline of 175 cases (111 unit/64 integration) and add the missing cases. Run focused checks, then sequential complete Release verification with the actual Windows Client:

  • dotnet build .\src\AutoForge.slnx --configuration Release --no-restore
  • dotnet test .\src\AutoForge.slnx --configuration Release --no-build

Record exact commands/exit outcomes, warnings and per-project discovered/passed/ failed/skipped counts. No filtered headless build reported as complete.

Run native baseline smoke for explicit import/open/probe, truthful summary, read/verified clear, trace, an existing visible failure, reset/close and old routes. If the existing safe composition permits a native partial-identity scenario, exercise it. Otherwise distinguish its real-DI/rendered test evidence from native baseline smoke, as Step-03A did. Do not add a fault console/test executable merely to manufacture native coverage. Report missing prerequisites honestly.

DOCUMENTATION REQUIREMENTS

Update README and directly related protocol/simulation/ADR/testing docs for:

  • Probe success versus identity verification and not-attempted/unavailable states.
  • Count/collection semantics and retained partial advertised services.
  • Identity-dependent action policy, no metadata-derived identity/authority, trace phase consistency and cancellation/close behavior.
  • Actual before/after/full-suite results, native versus rendered evidence and pending parent Step-03 acceptance.

Preserve historical reports and LF Markdown conventions. Do not rewrite the 175-case report as if it covered R-04. Static signals remain synthetic fixtures, not dynamics, capture, compatibility or physical access.

ACCEPTANCE CRITERIA

ID Criterion Required evidence
AC-01 Successful probe/service evidence survives unavailable/failed identity with explicit independent phase states and no fabricated identity Probe-only and advertised-identity-failure real transport/DI assertions
AC-02 Expected/probed/identified counts and UI rows accurately describe partial discovery, with identity-dependent actions still fail-closed Actual result values, rendered labels/reasons/service lists and action assertions
AC-03 Invalid/no-response probes and post-probe timeout/cancel/close preserve truthful outcomes/trace without stale success Deterministic phase matrix and correlation-specific raw trace/lifecycle checks
AC-04 Normal workflow, R-01/R-02/R-03 fixes, profiles/targets/state/oracle/project graph and all 175 prior cases retained Regression mapping, actual nine-project build and per-project suite evidence
AC-05 Actual pre-fix failure, corrected focused/full verification and native baseline evidence are recorded honestly Exact commands, outcomes, counts and native/rendered coverage distinction
AC-06 README/protocol/simulation/ADR/test docs match phase/count/action semantics and corrective lifecycle Changed document list and contract summary
AC-07 No unrelated feature/package/workload/orchestration/history change; complete report saved and worker stops Preservation/Git/scope evidence and prompts/Step-03B-Report.md

Map every criterion to PASSED, FAILED, NOT EXECUTED or BLOCKED with evidence. COMPLETE requires all required correction/regression/native checks. Do not begin Step-04; parent milestone acceptance belongs to the orchestrator.

OUT-OF-SCOPE WORK

New diagnostic protocols/services or physical adapters, relaxed authorization, vehicle dynamics/scenarios, telemetry recording/replay, calibration/programming, AI/research/persistence, new projects/hosts/packages, clock redesign, broad model refactors, fault consoles and unrelated cleanup. Physical safety/prohibited- operation restrictions remain in force.

REPORTING REQUIREMENTS

Create prompts/Step-03B-Report.md entirely inside exactly one plain triple-backtick code fence, without language tag or outside content. Use no nested fences. Use the same copy-window format for the final chat report.

Include step/title and COMPLETE/INCOMPLETE/BLOCKED status; R-04 root cause/fix; files created/modified; result/API/phase/count changes; unit/integration/UI tests and actual pre-fix/post-fix evidence; exact build/test commands/results with per-project counts; native/rendered observations; AC-01 through AC-07 mapping; documentation and README changes; limitations/issues; deviations/recommendations; and protected/scope/Git preservation review.

Save the report and STOP. Do not modify assignments/roadmap/state, create or begin Step-04, invoke agents, automate handoff, stage, commit or push.