Files

12 KiB
Raw Permalink Blame History

phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, estimate, must_haves
phase plan type wave depends_on files_modified autonomous requirements estimate must_haves
01-reproducible-fidelity-baseline 04 execute 2
01-01
src/GamePort/Application/FidelityObservation.cs
src/GamePort/Program.cs
tests/GamePort.FidelityObservationTests/GamePort.FidelityObservationTests.csproj
tests/GamePort.FidelityObservationTests/Program.cs
tests/test_fidelity_observation.py
true
EVID-02
EVID-04
tokens raw_tokens tasks confidence
33000 33000 2 low
truths artifacts key_links
An optional passive observer records actual native port input/control/scene events across the continuous route per D-01, without changing gameplay or scene lifetime.
Natural/skipped and fresh/retained runs have distinct case identities, with one monotonic session across actual retained continuations per D-02 and D-03.
Held/neutral input, banked jump, landing and idle observations retain their real owner/tick/time per D-04; injected smoke fixtures stay separately classified.
An output failure leaves the observation incomplete and visible rather than reporting acceptance or changing movement/state to finish the recording.
path provides
src/GamePort/Application/FidelityObservation.cs Optional passive bounded JSONL session observer
path provides
tests/GamePort.FidelityObservationTests/Program.cs Managed clock/order/ownership and failure regressions
path provides
tests/test_fidelity_observation.py Process-level observer output and receipt interoperability checks
from to via
src/GamePort/Program.cs src/GamePort/Application/FidelityObservation.cs Outer Run continuation lifetime and actual post-Step acceptsInput result
from to via
Observed events.jsonl tools/recon/fidelity_receipts.py Case/session identity, monotonic elapsed and separately labeled simulation tick
Supply the native port input/event evidence that existing smoke screenshots/logs cannot provide: accepted input and control ownership, with one lifetime across normal scene continuations. Observe existing behavior; do not repair any movement, rotation, body, camera or gameplay contract.

Artifacts this phase produces in this plan: FidelityObservation with session-owned clock, RecordInput/RecordControl/RecordTransition/Complete/Dispose methods; --fidelity-output PATH, --fidelity-session ID and --fidelity-case ID options; events.jsonl and observation-summary.json under a new generated session directory; standalone net10.0 observation test project and Python interoperability tests. All symbols/options are new observer interfaces, not existing/recovered gameplay APIs. <execution_context> @/home/cristian/.codex/gsd-core/workflows/execute-plan.md @/home/cristian/.codex/gsd-core/templates/summary.md </execution_context> @AGENTS.md @.planning/PROJECT.md @.planning/ROADMAP.md @.planning/phases/01-reproducible-fidelity-baseline/01-CONTEXT.md @.planning/phases/01-reproducible-fidelity-baseline/01-PATTERNS.md @.planning/phases/01-reproducible-fidelity-baseline/01-01-SUMMARY.md Observe one real port input-to-control step through a recorded session src/GamePort/Application/FidelityObservation.cs, src/GamePort/Program.cs, tests/GamePort.FidelityObservationTests/GamePort.FidelityObservationTests.csproj, tests/GamePort.FidelityObservationTests/Program.cs, tests/test_fidelity_observation.py <read_first>src/GamePort/Program.cs outer presentation/Run loop, SDL polling, PlayerInput construction, playerBinding.Step return and continuation publication; src/GamePort/Application/CutsceneIdleSmoke.cs; tests/GamePort.BodyOwnershipTests/GamePort.BodyOwnershipTests.csproj; 01-PATTERNS.md Optional FidelityObservation; docs/gameplay/main-menu-player-lifetime.md; docs/checkpoint/README.md, coverage.md and implementation-plan.md.</read_first> Managed tests execute at least eight checks for disabled no-op behavior, session identity, monotonic clock, requested versus accepted input, control/tick distinction, bounded output, output exception and correct disposal. Python adds at least four subprocess/interoperability checks proving actual emitted records validate and missing/incomplete records cannot qualify as native gameplay. Write tests first and link the focused observer source into a standalone net10.0 console test project, following existing test conventions. Existing Program logging lacks ordinary accepted-input/timestamp continuity, so add a separate passive observer only at the application boundary. Allocate it once beside the outer RenderSession/Run loop, with a single Stopwatch spanning continuations; inject its reference into Run without creating a second gameplay owner. New options explicitly enable output, carry stable session/case IDs and require a new contained output directory separate from originals. On one actual step record requested PlayerInput values, accepted-input result after playerBinding.Step (or existing direct simulation.Step path), current control ownership, scene, monotonic time and simulation tick separately. Raw polled events, if captured, are labeled raw and never passed off as accepted gameplay input. Emit immutable copied observations after existing owner calls without invoking extra getters/callbacks that mutate game state. Keep observer-off paths behavior-identical. Handle bounded buffering/disk errors visibly in an incomplete observation summary; recording failure must not trigger a simulation reset, extra stepping or modified input. Add a subprocess end-to-end test using a bounded existing smoke invocation with observer output, explicitly classified synthetic/fixture, then validate its output through the receipt contract. This proves observation wiring only; ordinary native play remains required. <acceptance_criteria>A real port process emits a case-bound observation from input through control decision and file output; counted managed/Python checks pass; disabled observation and write errors preserve game update/state semantics; all fixture results retain their narrow method.</acceptance_criteria> bash -lc 'source scripts/env.sh && dotnet run --project tests/GamePort.FidelityObservationTests' <fails_when>Nonzero exit or missing summary Fidelity observation checks: N passed with N at least 8; any clock/input/ownership/error assertion fails.</fails_when> python3 -c 'import sys,unittest; s=unittest.defaultTestLoader.discover("tests",pattern="test_fidelity_observation.py"); assert s.countTestCases() >= 4,"fewer than 4 observer integration tests"; sys.exit(not unittest.TextTestRunner(verbosity=2).run(s).wasSuccessful())' <fails_when>Nonzero exit, fewer than four tests, no actual process output, or incomplete/fixture records incorrectly qualify as native gameplay.</fails_when> Optional passive input/control observation works through the real port process and remains outside gameplay behavior and acceptance classification. Preserve observation identity across dialogue and retained scene lifetimes src/GamePort/Application/FidelityObservation.cs, src/GamePort/Program.cs, tests/GamePort.FidelityObservationTests/Program.cs, tests/test_fidelity_observation.py <read_first>Task 01-04-01 observer interfaces; Program.cs actual dialogue skip/control changes and continuation publication; docs/evidence/scenarios.json; protected movement/startup reports.</read_first> Extend managed checks to at least 14, covering natural/skip event distinction, requested held input while input is rejected, first accepted neutral/held step, ordered transition/RETURN records, monotonic continuation time and independent fresh session time. Compare observed/off deterministic state through existing fixtures. Add observation records at actual existing dialogue/control changes and continuation publication per D-01–D-04, preserving exact player/save/return payloads and call order. Give transitions ordered sequence IDs and pair departure/destination in one session without restarting the outer clock. Keep fresh launches independent. Mark natural versus skip from the actual action path, not guessed elapsed duration; publish neutral/held acceptance and landing/bank/idle only from existing owner state observations or external annotations with explicit method. No new physics contacts, setters, orientation resets, cached callback data or actor admission. Annotate observation overhead in provenance; clean external audiovisual recordings and diagnostic observer runs remain distinguishable. Extend process-level tests to confirm fixture on/off state/readback equivalence and shared-session continuity, without calling synthetic transitions ordinary-route evidence. Run existing protected regressions and build; capture a bounded native Linux smoke with observer on/off if display is available, retaining actual readbacks and limitation if unavailable. Native full-route capture is owned by plan 01-06. <acceptance_criteria>All 14 managed checks pass; real continuation records preserve identity/order/clocks; protected movement/Director/Checkpoint/BodyOwnership checks remain passing; runtime diff contains passive observer plumbing only.</acceptance_criteria> bash -lc 'source scripts/env.sh && dotnet run --project tests/GamePort.FidelityObservationTests && dotnet build GamePort.csproj --no-restore' <fails_when>Nonzero exit, missing at-least-14 positive observer check summary, or any build error.</fails_when> bash -lc 'source scripts/env.sh && dotnet run --project tests/GamePort.MovementTests -- ../Original && dotnet run --project tests/GamePort.DirectorTests -- ../Original && dotnet run --project tests/GamePort.CheckpointTests -- ../Original && dotnet run --project tests/GamePort.BodyOwnershipTests' <fails_when>Nonzero exit or an absent/zero group-count summary from any protected regression; state/readback equivalence differs.</fails_when> Continuous observations preserve real control and retained lifetimes while all protected gameplay contracts remain unchanged. <threat_model> ASVS level 1; unresolved high/critical threats block acceptance.

Boundary Description
Runtime observation → local output Optional diagnostic writes cannot own or modify gameplay state
CLI output path → filesystem Caller-controlled paths must remain outside originals and existing sessions
Threat ID Category Component Severity Disposition Mitigation Plan
T-01-10 Tampering Observer output high mitigate Exclusive contained output, no gameplay callbacks/setters/retries and observed/off equivalence checks
T-01-11 Denial of service Observation buffering medium mitigate Bounded records/buffer, explicit incomplete summary on write failure, reliable disposal
T-01-12 Spoofing Input/control records high mitigate Distinct raw/requested/accepted observations, one session clock and fixture/native classification
T-01-SC Tampering Package installation high mitigate Existing .NET framework/runtime dependencies only; no new NuGet packages
</threat_model>
Run counted observation tests and protected managed regressions; inspect passive application-only diff. Full local suite runs during checkpoint integration. No body/movement/source algorithm edits are authorized.
<success_criteria>Native port recording can include truthful input/control/scene traces with preserved lifetime and source behavior.</success_criteria>
Create .planning/phases/01-reproducible-fidelity-baseline/01-04-SUMMARY.md with observation semantics, overhead and actual protected checks.