From bd53989498d2aea7f59f8a15ec48fdd99a2435f7 Mon Sep 17 00:00:00 2001 From: gamer147 Date: Mon, 3 Aug 2026 11:00:36 -0400 Subject: [PATCH] Move input contracts to model --- docs/PROJECT-STRUCTURE.md | 2 ++ docs/remake-architecture-and-roadmap.md | 9 +++++++-- engine/Age.Engine.Tests/AdvAutoAdvanceTimerTests.cs | 1 + engine/Age.Engine/Hosting/AdvAutoAdvanceTimer.cs | 2 ++ engine/Age.Engine/Hosting/IHost.cs | 7 ------- engine/Age.Engine/Model/InputContracts.cs | 8 ++++++++ 6 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 engine/Age.Engine/Model/InputContracts.cs diff --git a/docs/PROJECT-STRUCTURE.md b/docs/PROJECT-STRUCTURE.md index 3c0ef0f..3e85f4c 100644 --- a/docs/PROJECT-STRUCTURE.md +++ b/docs/PROJECT-STRUCTURE.md @@ -179,6 +179,8 @@ decoders, host surfaces, renderers, persistence, and tests; consumers do not dep decoded pixels. `engine/Age.Engine/Model/SurfaceContracts.cs` owns neutral surface fill/copy requests and the black-fade direction shared by VM presentation, graphics hosts, Godot, and tests. +`engine/Age.Engine/Model/InputContracts.cs` owns neutral ADV auto-wait state and fullwidth text-edit request/result +records shared by input hosts, timing policy, VM dispatch, Godot, and tests. `engine/Age.Engine/Model/GfxState.cs` retains cross-domain retained-graphics coordination. `engine/Age.Engine/Model/GfxState.Contracts.cs` owns its public render, transition, diagnostic, persistence, diff --git a/docs/remake-architecture-and-roadmap.md b/docs/remake-architecture-and-roadmap.md index 8a39569..3e2808a 100644 --- a/docs/remake-architecture-and-roadmap.md +++ b/docs/remake-architecture-and-roadmap.md @@ -804,6 +804,11 @@ do not mix mechanical moves with semantic changes. remain behaviorally unchanged. Input transport records remain in their prior locations pending a separate cleanup. Runtime validation remains green. + The ninth bounded contract slice moved the unchanged `FullwidthTextEditRequest`, `FullwidthTextEditResult`, and + `AdvAutoWaitState` declarations from `Hosting` into `Model/InputContracts.cs`. Only the auto-advance timer and + its focused tests required new imports; record shape, editor defaults, wait overloads, and all runtime behavior + remain unchanged. Runtime validation remains green. + 4. **Make the build graph express source ownership.** Stop linking production `.cs` files from `godot/` and `tools/movie-corpus-gate/` into `Age.Engine.Tests`. Extract the platform-neutral frontend/movie/diagnostic code into a small production project referenced by Godot, tests, and the corpus gate. Retain both existing @@ -1165,7 +1170,7 @@ layer's rendering diverges from ADV; save layout. Continue step 3 of the **codebase consolidation** maintenance slice: clarify runtime contracts without changing behavior or the aggregate host accepted by the VM. With diagnostic, lifecycle, audio, and movie contracts established beneath `IHost`, shared graphics transport neutral, and graphics/input contracts now separated, move -the unchanged `FullwidthTextEditRequest`, `FullwidthTextEditResult`, and `AdvAutoWaitState` declarations from -`Hosting` to `Model` next. Preserve all consumers before extracting the remaining ADV text/presentation contract. +the remaining ADV text/history/layout/presentation members into `IAdvHost` next. Preserve all required/default +members and existing hosts, leaving `IHost` as the unchanged aggregate runtime entry point. Concrete playthrough blockers may still preempt this bounded maintenance work; the consolidation effort does not replace Phase B gameplay validation or the open cross-platform gates. diff --git a/engine/Age.Engine.Tests/AdvAutoAdvanceTimerTests.cs b/engine/Age.Engine.Tests/AdvAutoAdvanceTimerTests.cs index 627d2a1..e558c08 100644 --- a/engine/Age.Engine.Tests/AdvAutoAdvanceTimerTests.cs +++ b/engine/Age.Engine.Tests/AdvAutoAdvanceTimerTests.cs @@ -1,4 +1,5 @@ using Age.Engine.Hosting; +using Age.Engine.Model; using Xunit; public class AdvAutoAdvanceTimerTests diff --git a/engine/Age.Engine/Hosting/AdvAutoAdvanceTimer.cs b/engine/Age.Engine/Hosting/AdvAutoAdvanceTimer.cs index 4047ae2..55c5a0d 100644 --- a/engine/Age.Engine/Hosting/AdvAutoAdvanceTimer.cs +++ b/engine/Age.Engine/Hosting/AdvAutoAdvanceTimer.cs @@ -1,3 +1,5 @@ +using Age.Engine.Model; + namespace Age.Engine.Hosting; /// diff --git a/engine/Age.Engine/Hosting/IHost.cs b/engine/Age.Engine/Hosting/IHost.cs index dc7810b..974a448 100644 --- a/engine/Age.Engine/Hosting/IHost.cs +++ b/engine/Age.Engine/Hosting/IHost.cs @@ -17,16 +17,9 @@ public readonly record struct AdvWaitIndicatorConfig( } } -public readonly record struct AdvAutoWaitState( - bool Enabled, bool VoicePending, long PostVoiceDelayMs, long UnvoicedDelayMs); - /// A synchronous AGE-owned diagnostic prompt after native body/context formatting. public readonly record struct DiagnosticMessage(string Caption, string Text); -/// AGERc command 10's synchronous full-width text edit request and result. -public readonly record struct FullwidthTextEditRequest(string CurrentText, string InitialText); -public readonly record struct FullwidthTextEditResult(bool Accepted, string Text); - public interface IHost : IDiagnosticHost, ILifecycleHost, IAudioHost, IMovieHost, IGraphicsHost, IInputHost { void ShowText(int offset, string text); diff --git a/engine/Age.Engine/Model/InputContracts.cs b/engine/Age.Engine/Model/InputContracts.cs new file mode 100644 index 0000000..b00037e --- /dev/null +++ b/engine/Age.Engine/Model/InputContracts.cs @@ -0,0 +1,8 @@ +namespace Age.Engine.Model; + +public readonly record struct AdvAutoWaitState( + bool Enabled, bool VoicePending, long PostVoiceDelayMs, long UnvoicedDelayMs); + +/// AGERc command 10's synchronous full-width text edit request and result. +public readonly record struct FullwidthTextEditRequest(string CurrentText, string InitialText); +public readonly record struct FullwidthTextEditResult(bool Accepted, string Text);