A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Add an internal synthetic monthly context contract, test-only (Refs #1716) (#1812)
Eyal Golan307bef9fe7c8
diff --git a/changelog.d/1716-c301-synthetic-contract.md b/changelog.d/1716-c301-synthetic-contract.mdnew file mode 100644index 000000000..16378aec2--- /dev/null+++ b/changelog.d/1716-c301-synthetic-contract.md@@ -0,0 +1 @@+- Add an internal synthetic monthly-context contract for #1716; no game activation or resolver integration.diff --git a/docs/rules/mvp.md b/docs/rules/mvp.mdindex 206e66eb5..cf0f73f82 100644--- a/docs/rules/mvp.md+++ b/docs/rules/mvp.md@@ -30,6 +30,8 @@ R-LOOP-005: Every balance number of the GDD loop (all of `cities.yaml` and `unitThe ID R-LOOP-003 (the Phase 1 overlay, `MvpSlice.Overlay`) is retired with the overlay at the cutover and is not reused.+Synthetic #1716 fixtures provide an internal immutable monthly snapshot for future gdd-0.3 work (R-LOOP-001/002; #1668, loop-switch.md:17-39 at 605277df). There is no shipping caller, resolver integration, persistence or activation. Consumers must revalidate eligibility; R-LOOP-004 is unchanged.+## Settlement controlR-CTRL-001: Only a settlement in `settlement_targets.yaml` may be captured. Each target is an `arab_town` row of `map/settlements_1948.yaml` (Q-TGT-1 (a), owner ruling of 18 October 2026), stands on a land hex of `map/hexes.json` that is its own hex in `map/settlement_hexes.yaml`, names a sourced operation (each source an https URL with a `checked` date) and carries a review status; any other row is a load error naming file and field. The shipped list holds the six rows the owner approved on 19 October 2026 and filled on 21 October 2026 (#793: jaffa, acre, nazareth, lod, ramla, beersheba; Gaza excluded), which the owner sensitivity-reviewed on #793. #799 adds each row's residents outcome (R-CTRL-016) and returns every row to `status: draft` until the owner reviews those fields, so the release gate holds them (D-F5).diff --git a/sim/Statecraft.Sim.Tests/Gdd03SyntheticMonthContextTests.cs b/sim/Statecraft.Sim.Tests/Gdd03SyntheticMonthContextTests.csnew file mode 100644index 000000000..716231605--- /dev/null+++ b/sim/Statecraft.Sim.Tests/Gdd03SyntheticMonthContextTests.cs@@ -0,0 +1,174 @@+using Statecraft.Sim;+using System.Globalization;++// Synthetic #1716 contract tests. All ids, counts, progress, capacities and amounts below are+// test-only synthetic values, not starting-state or balance data.+public class Gdd03SyntheticMonthContextTests+{+ static PopulationUnit Person(int id, PopulationAssignmentKind kind, string? target = null) =>+ new PopulationUnit(id, kind == PopulationAssignmentKind.Course ? PopulationStatus.Trainee+ : kind == PopulationAssignmentKind.Reception ? PopulationStatus.Refugee : PopulationStatus.FreeCivilian, 0, null,+ new PopulationAssignment(kind, target), CivilianProfession.None, CivilianTier.None,+ 0, "", 0, PopulationEquipment.None);++ static Gdd03SyntheticFacilitySnapshot Facility(string id = "synthetic-work", bool available = true) =>+ new Gdd03SyntheticFacilitySnapshot(id, available, 2);++ static Gdd03SyntheticMonthContext Context(IEnumerable<PopulationUnit>? people = null,+ IEnumerable<Gdd03SyntheticFacilitySnapshot>? facilities = null,+ IEnumerable<int>? residents = null, IEnumerable<Gdd03SyntheticPendingEntry>? entries = null,+ string identity = SaveGame.Gdd03Ruleset, int month = 0) =>+ Gdd03SyntheticMonthContext.CreateSynthetic(identity, month,+ people ?? Array.Empty<PopulationUnit>(), facilities ?? Array.Empty<Gdd03SyntheticFacilitySnapshot>(),+ residents ?? Array.Empty<int>(), Array.Empty<Gdd03SyntheticHousingSnapshot>(),+ entries ?? Array.Empty<Gdd03SyntheticPendingEntry>());++ // RED-FIRST 1: R-LOOP-001/002. No old-identity contract and no implicit identity fallback.+ [Theory]+ [InlineData("legacy")]+ [InlineData("gdd-0.1")]+ [InlineData("GDD-0.3")]+ [InlineData("")]+ public void RejectsEveryIdentityExceptExactGdd03(string identity) =>+ Assert.Throws<ArgumentException>(() => Context(identity: identity));++ // RED-FIRST 2: R-LOOP-001/002; GDD loop-switch:17,24-28.+ [Fact] public void RejectsDuplicatePeopleAndUnresolvedAssignmentsOrResidents()+ {+ var p = Person(7, PopulationAssignmentKind.Work, "synthetic-work");+ Assert.Throws<ArgumentException>(() => Context(new[] { p, p }, new[] { Facility() }));+ Assert.Throws<ArgumentException>(() => Context(new[] { p }));+ Assert.Throws<ArgumentException>(() => Context(residents: new[] { 7 }));+ Assert.Throws<ArgumentException>(() => Context(new[] { p }, new[] { Facility() }, new[] { 7, 7 }));+ Assert.Throws<ArgumentException>(() => Context(facilities: new[] { Facility(), Facility() }));+ Assert.Throws<ArgumentNullException>(() => Gdd03SyntheticMonthContext.CreateSynthetic(+ SaveGame.Gdd03Ruleset, 0, null!, Array.Empty<Gdd03SyntheticFacilitySnapshot>(),+ Array.Empty<int>(), Array.Empty<Gdd03SyntheticHousingSnapshot>(), Array.Empty<Gdd03SyntheticPendingEntry>()));+ Assert.Throws<ArgumentException>(() => Context(new PopulationUnit[] { null! }));+ Assert.Throws<ArgumentException>(() => Context(month: -1));+ Assert.Throws<ArgumentException>(() => new Gdd03SyntheticFacilitySnapshot(" ", true, 2));+ Assert.Throws<ArgumentException>(() => new Gdd03SyntheticFacilitySnapshot("synthetic-work", true, -1));+ Assert.Throws<ArgumentException>(() => new Gdd03SyntheticHousingSnapshot("synthetic-house", -0.1m));+ Assert.Throws<ArgumentException>(() => new Gdd03SyntheticHousingSnapshot("synthetic-house", 1.1m));+ Assert.Throws<ArgumentException>(() => new Gdd03SyntheticPendingEntry("", "synthetic-unit", 2m));+ Assert.Throws<ArgumentException>(() => Context(entries: new[] {+ new Gdd03SyntheticPendingEntry("synthetic-key", "synthetic-unit", 2m),+ new Gdd03SyntheticPendingEntry("synthetic-key", "synthetic-other-unit", -3m) }));+ }++ // RED-FIRST: GDD loop-switch:17,24. Structural references do not replace owner validation.+ [Fact] public void RejectsIncompatibleStatusAndUnresolvedTeacherAndDuplicateHousing()+ {+ PopulationUnit Pupil(int teacher) => new PopulationUnit(7, PopulationStatus.Trainee, 0, null,+ new PopulationAssignment(PopulationAssignmentKind.Course, "synthetic-course", 1, teacher),+ CivilianProfession.None, CivilianTier.None, 0, "", 0, PopulationEquipment.None);+ var invalid = new PopulationUnit(7, PopulationStatus.Captured, 0, null,+ new PopulationAssignment(PopulationAssignmentKind.Work, "synthetic-work"),+ CivilianProfession.None, CivilianTier.None, 0, "", 0, PopulationEquipment.None);+ Assert.Throws<ArgumentException>(() => Context(new[] { invalid }, new[] { Facility() }));+ Assert.Throws<ArgumentException>(() => Context(new[] { Pupil(99) }, new[] { Facility("synthetic-course") }));+ Assert.Throws<ArgumentException>(() => Context(new[] { Person(1, PopulationAssignmentKind.Unassigned) }, residents: new[] { -1 }));+ var teacher = Person(2, PopulationAssignmentKind.Teaching, "synthetic-course");+ var valid = Context(new[] { teacher, Pupil(2) }, new[] { Facility("synthetic-course") });+ Assert.Equal(new[] { 7 }, valid.CourseEligibleIds);+ Assert.Empty(valid.WorkEligibleIds);+ Assert.Throws<ArgumentException>(() => Gdd03SyntheticMonthContext.CreateSynthetic(+ SaveGame.Gdd03Ruleset, 0, Array.Empty<PopulationUnit>(), Array.Empty<Gdd03SyntheticFacilitySnapshot>(),+ Array.Empty<int>(), new[] { new Gdd03SyntheticHousingSnapshot("synthetic-house", 0m),+ new Gdd03SyntheticHousingSnapshot("synthetic-house", 1m) }, Array.Empty<Gdd03SyntheticPendingEntry>()));+ var zero = new Gdd03SyntheticFacilitySnapshot("synthetic-work", true, 0);+ Assert.Empty(Context(new[] { Person(1, PopulationAssignmentKind.Work, zero.Id) }, new[] { zero }).WorkEligibleIds);+ }++ // RED-FIRST 3: GDD loop-switch:17,24-28,33. Frozen membership is not a work executor.+ [Fact] public void FreezesDisjointOpeningEligibilityAndOmitsUnavailableCapacity()+ {+ var people = new List<PopulationUnit> {+ Person(9, PopulationAssignmentKind.Work, "synthetic-work"),+ Person(3, PopulationAssignmentKind.Course, "synthetic-course"),+ Person(5, PopulationAssignmentKind.Reception, "synthetic-reception"),+ Person(8, PopulationAssignmentKind.Work, "synthetic-closed") };+ var facilities = new List<Gdd03SyntheticFacilitySnapshot> {+ Facility(), Facility("synthetic-course"), Facility("synthetic-reception"), Facility("synthetic-closed", false) };+ var context = Context(people, facilities, new[] { 9 });+ people.Clear(); facilities.Clear();+ Assert.Equal(new[] { 3, 5, 8, 9 }, context.OpeningPeople.Select(p => p.Id));+ Assert.Equal(new[] { 9 }, context.WorkEligibleIds);+ Assert.Equal(new[] { 3 }, context.CourseEligibleIds);+ Assert.Equal(new[] { 5 }, context.ReceptionEligibleIds);+ Assert.Equal(new[] { 9 }, context.PreArrivalResidentIds);+ Assert.Throws<NotSupportedException>(() => ((IList<int>)context.WorkEligibleIds).Add(11));+ Assert.Throws<NotSupportedException>(() => ((IList<PopulationUnit>)context.OpeningPeople).Clear());+ Assert.Equal(PopulationAssignmentKind.Course, context.OpeningPeople[0].Assignment.Kind);+ Assert.Equal(0, context.OpeningPeople[0].Assignment.ProgressTicks);+ }++ // RED-FIRST 4: R-LOOP-002; GDD loop-switch:29,39. No persistence/hash claim.+ [Theory] [InlineData("he-IL")] [InlineData("en-US")]+ public void SortsOrdinallyAndCopiesEveryContainerUnderBothCultures(string name)+ {+ var previous = CultureInfo.CurrentCulture; var previousUi = CultureInfo.CurrentUICulture;+ try+ {+ CultureInfo.CurrentCulture = CultureInfo.GetCultureInfo(name);+ CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo(name);+ var pupil = new PopulationUnit(20, PopulationStatus.Trainee, 1, null,+ new PopulationAssignment(PopulationAssignmentKind.Course, "synthetic-I", 3),+ CivilianProfession.Farmer, CivilianTier.Trained, 7, "synthetic-qualification", 5,+ new PopulationEquipment("synthetic-tools", true, "synthetic-kit", true));+ var people = new[] { pupil, Person(2, PopulationAssignmentKind.Reception, "synthetic-i") };+ var keys = new[] { "synthetic-é", "synthetic-i", "synthetic-I", "synthetic_!", "synthetic-!" };+ var expectedKeys = new[] { "synthetic-!", "synthetic-I", "synthetic-i", "synthetic-é", "synthetic_!" };+ var facilities = keys.Select(id => Facility(id)).ToList();+ var residents = new List<int> { 20, 2 };+ var housing = keys.Select(id => new Gdd03SyntheticHousingSnapshot(id, id == "synthetic-é" ? 0.4m : 0.7m)).ToList();+ var pending = keys.Select(id => new Gdd03SyntheticPendingEntry(id, "synthetic-unit", id == "synthetic-é" ? -1.25m : 2m)).ToList();+ Gdd03SyntheticMonthContext Make(bool reverse) => Gdd03SyntheticMonthContext.CreateSynthetic(+ SaveGame.Gdd03Ruleset, 4, reverse ? people.Reverse() : people,+ reverse ? facilities.AsEnumerable().Reverse() : facilities,+ reverse ? residents.AsEnumerable().Reverse() : residents,+ reverse ? housing.AsEnumerable().Reverse() : housing,+ reverse ? pending.AsEnumerable().Reverse() : pending);+ var a = Make(false); var b = Make(true);+ people[0] = Person(99, PopulationAssignmentKind.Unassigned);+ facilities.Clear(); residents.Clear(); housing.Clear(); pending.Clear();+ foreach (var context in new[] { a, b })+ {+ Assert.Equal(new[] { 2, 20 }, context.OpeningPeople.Select(p => p.Id));+ Assert.Equal(new[] { 2, 20 }, context.PreArrivalResidentIds);+ Assert.Equal(expectedKeys, context.Facilities.Select(f => f.Id));+ Assert.Equal(expectedKeys, context.Housing.Select(h => h.Id));+ Assert.Equal(expectedKeys, context.PendingEntries.Select(e => e.Key));+ Assert.All(context.Facilities, f => { Assert.True(f.AvailableAtMonthFreeze); Assert.Equal(2, f.OpeningCapacity); });+ Assert.Empty(context.WorkEligibleIds);+ Assert.Equal(new[] { 20 }, context.CourseEligibleIds);+ Assert.Equal(new[] { 2 }, context.ReceptionEligibleIds);+ var retained = context.OpeningPeople[1];+ Assert.Equal(CivilianProfession.Farmer, retained.Profession);+ Assert.Equal(CivilianTier.Trained, retained.Tier);+ Assert.Equal(7, retained.WorkXp);+ Assert.Equal(5, retained.CombatXp);+ Assert.Equal("synthetic-qualification", retained.Qualification);+ Assert.Equal(1, retained.ReceptionTicks);+ Assert.Equal(3, retained.Assignment.ProgressTicks);+ Assert.Equal("synthetic-tools", retained.Equipment.ToolsId);+ Assert.True(retained.Equipment.ToolsPaid);+ Assert.Equal("synthetic-kit", retained.Equipment.MilitaryId);+ Assert.True(retained.Equipment.MilitaryPaid);+ Assert.Equal(0.4m, context.Housing[3].ConditionBeforeDeterioration);+ Assert.Equal(-1.25m, context.PendingEntries[3].Amount);+ Assert.Equal("synthetic-unit", context.PendingEntries[3].Unit);+ Assert.Equal("-1.25", context.PendingEntries[3].Amount.ToString(CultureInfo.InvariantCulture));+ Assert.Throws<NotSupportedException>(() => ((IList<PopulationUnit>)context.OpeningPeople).Clear());+ Assert.Throws<NotSupportedException>(() => ((IList<Gdd03SyntheticFacilitySnapshot>)context.Facilities).Clear());+ Assert.Throws<NotSupportedException>(() => ((IList<Gdd03SyntheticHousingSnapshot>)context.Housing).Clear());+ Assert.Throws<NotSupportedException>(() => ((IList<Gdd03SyntheticPendingEntry>)context.PendingEntries).Clear());+ Assert.Throws<NotSupportedException>(() => ((IList<int>)context.PreArrivalResidentIds).Clear());+ Assert.Throws<NotSupportedException>(() => ((IList<int>)context.WorkEligibleIds).Clear());+ Assert.Throws<NotSupportedException>(() => ((IList<int>)context.CourseEligibleIds).Clear());+ Assert.Throws<NotSupportedException>(() => ((IList<int>)context.ReceptionEligibleIds).Clear());+ }+ }+ finally { CultureInfo.CurrentCulture = previous; CultureInfo.CurrentUICulture = previousUi; }+ }+}diff --git a/sim/Statecraft.Sim/Gdd03SyntheticMonthContext.cs b/sim/Statecraft.Sim/Gdd03SyntheticMonthContext.csnew file mode 100644index 000000000..9a885a893--- /dev/null+++ b/sim/Statecraft.Sim/Gdd03SyntheticMonthContext.cs@@ -0,0 +1,160 @@+using System;+using System.Collections.Generic;+using System.Collections.ObjectModel;+using System.Linq;++namespace Statecraft.Sim+{+ /// <summary>Synthetic #1716 contract, test fixtures only. Not a live-state adapter.+ /// GDD 605277df docs/gdd/loop-switch.md:17-39.+ /// Frozen eligibility is only an upper bound: future consumers must recheck survival,+ /// location, control and facility availability immediately before using an entry.+ /// This object neither executes phases nor authorizes work, settlement or persistence.</summary>+ internal sealed class Gdd03SyntheticMonthContext+ {+ internal int MonthOrdinal { get; }+ internal IReadOnlyList<PopulationUnit> OpeningPeople { get; }+ internal IReadOnlyList<int> PreArrivalResidentIds { get; }+ internal IReadOnlyList<int> WorkEligibleIds { get; }+ internal IReadOnlyList<int> CourseEligibleIds { get; }+ internal IReadOnlyList<int> ReceptionEligibleIds { get; }+ internal IReadOnlyList<Gdd03SyntheticFacilitySnapshot> Facilities { get; }+ internal IReadOnlyList<Gdd03SyntheticHousingSnapshot> Housing { get; }+ internal IReadOnlyList<Gdd03SyntheticPendingEntry> PendingEntries { get; }++ private Gdd03SyntheticMonthContext(int monthOrdinal, PopulationUnit[] people, int[] residents,+ Gdd03SyntheticFacilitySnapshot[] facilities, Gdd03SyntheticHousingSnapshot[] housing,+ Gdd03SyntheticPendingEntry[] pending)+ {+ MonthOrdinal = monthOrdinal;+ OpeningPeople = Freeze(people); PreArrivalResidentIds = Freeze(residents);+ Facilities = Freeze(facilities); Housing = Freeze(housing); PendingEntries = Freeze(pending);+ var available = new HashSet<string>(facilities.Where(f => f.AvailableAtMonthFreeze && f.OpeningCapacity > 0)+ .Select(f => f.Id), StringComparer.Ordinal);+ int[] Eligible(PopulationAssignmentKind kind) => people.Where(p => p.Assignment.Kind == kind+ && p.Assignment.Target != null && available.Contains(p.Assignment.Target)).Select(p => p.Id).ToArray();+ // One immutable PopulationAssignment per distinct population id makes these sets disjoint.+ WorkEligibleIds = Freeze(Eligible(PopulationAssignmentKind.Work));+ CourseEligibleIds = Freeze(Eligible(PopulationAssignmentKind.Course));+ ReceptionEligibleIds = Freeze(Eligible(PopulationAssignmentKind.Reception));+ }++ // Sole constructor entry point; callers exist only in synthetic tests. No GameState,+ // resolver, Content, save, RNG, region binding or production-ledger dependency.+ // People retain #1689 PopulationUnit ids/immutable assignments, never parallel city counts.+ // This structural boundary does not replace PopulationLedger's full binding validation.+ internal static Gdd03SyntheticMonthContext CreateSynthetic(string ruleset, int monthOrdinal,+ IEnumerable<PopulationUnit> openingPeople,+ IEnumerable<Gdd03SyntheticFacilitySnapshot> facilities,+ IEnumerable<int> preArrivalResidentIds,+ IEnumerable<Gdd03SyntheticHousingSnapshot> housing,+ IEnumerable<Gdd03SyntheticPendingEntry> pendingEntries)+ {+ if (!string.Equals(ruleset, SaveGame.Gdd03Ruleset, StringComparison.Ordinal) || monthOrdinal < 0)+ throw new ArgumentException("Synthetic monthly context requires exact gdd-0.3 identity and a nonnegative month ordinal.");+ var people = Materialize(openingPeople);+ var capacity = Materialize(facilities);+ var conditions = Materialize(housing);+ var pending = Materialize(pendingEntries);+ if (preArrivalResidentIds == null) throw new ArgumentNullException(nameof(preArrivalResidentIds));+ var residents = preArrivalResidentIds.OrderBy(id => id).ToArray();+ if (people.Select(p => p.Id).Distinct().Count() != people.Length+ || residents.Distinct().Count() != residents.Length)+ throw new ArgumentException("Population and resident ids must be unique.");+ var peopleById = people.ToDictionary(p => p.Id);+ if (residents.Any(id => !peopleById.ContainsKey(id)+ || peopleById[id].Status == PopulationStatus.Captured+ || peopleById[id].Status == PopulationStatus.CivilianInTransit))+ throw new ArgumentException("Pre-arrival residents must reference present non-captive, non-transit people.");+ Unique(capacity.Select(f => f.Id)); Unique(conditions.Select(h => h.Id)); Unique(pending.Select(e => e.Key));+ var targets = new HashSet<string>(capacity.Select(f => f.Id), StringComparer.Ordinal);+ foreach (var person in people)+ {+ var kind = person.Assignment.Kind;+ if ((kind == PopulationAssignmentKind.Work || kind == PopulationAssignmentKind.Course+ || kind == PopulationAssignmentKind.Reception || kind == PopulationAssignmentKind.Teaching)+ && (person.Assignment.Target == null || !targets.Contains(person.Assignment.Target)))+ throw new ArgumentException("Monthly work/course/reception/teacher target must exist in the synthetic opening inventory.");+ if ((kind == PopulationAssignmentKind.Work || kind == PopulationAssignmentKind.Teaching)+ && person.Status != PopulationStatus.FreeCivilian+ || kind == PopulationAssignmentKind.Course && person.Status != PopulationStatus.Trainee+ || kind == PopulationAssignmentKind.Reception && person.Status != PopulationStatus.Refugee+ && person.Status != PopulationStatus.FreeCivilian)+ throw new ArgumentException("Monthly assignment has an incompatible population status.");+ var teacher = person.Assignment.TeacherId;+ if (teacher.HasValue && (!peopleById.TryGetValue(teacher.Value, out var t)+ || t.Assignment.Kind != PopulationAssignmentKind.Teaching+ || t.Assignment.Target != person.Assignment.Target))+ throw new ArgumentException("Course teacher must reference an opening teacher at the same target.");+ }+ return new Gdd03SyntheticMonthContext(monthOrdinal, people.OrderBy(p => p.Id).ToArray(), residents,+ capacity.OrderBy(f => f.Id, StringComparer.Ordinal).ToArray(),+ conditions.OrderBy(h => h.Id, StringComparer.Ordinal).ToArray(),+ pending.OrderBy(e => e.Key, StringComparer.Ordinal).ToArray());+ }++ static T[] Materialize<T>(IEnumerable<T> source) where T : class+ {+ if (source == null) throw new ArgumentNullException(nameof(source));+ var copy = source.ToArray();+ if (copy.Any(item => item == null)) throw new ArgumentException("Null snapshot records are not allowed.");+ return copy;+ }+ static IReadOnlyList<T> Freeze<T>(T[] ownedCopy) => new ReadOnlyCollection<T>(ownedCopy);+ static void Unique(IEnumerable<string> ids)+ {+ var seen = new HashSet<string>(StringComparer.Ordinal);+ foreach (var id in ids) if (!seen.Add(id)) throw new ArgumentException("Duplicate monthly key.");+ }+ internal static string Reference(string value)+ {+ if (string.IsNullOrWhiteSpace(value)) throw new ArgumentException("Explicit synthetic reference required.");+ PopulationText.ValidateText(value);+ return value;+ }+ }++ /// <summary>Opaque synthetic assignment target; no region, host, project kind or balance default.+ /// Capacity/availability are opening inputs, never updated on same-month completion.+ /// Owners still define capacity units, staffing limits and completion-turn upkeep.</summary>+ internal sealed class Gdd03SyntheticFacilitySnapshot+ {+ internal string Id { get; }+ internal bool AvailableAtMonthFreeze { get; }+ internal int OpeningCapacity { get; }+ internal Gdd03SyntheticFacilitySnapshot(string id, bool availableAtMonthFreeze, int openingCapacity)+ {+ if (openingCapacity < 0) throw new ArgumentException("Opening capacity must be nonnegative.");+ Id = Gdd03SyntheticMonthContext.Reference(id);+ AvailableAtMonthFreeze = availableAtMonthFreeze; OpeningCapacity = openingCapacity;+ }+ }++ /// <summary>Opaque synthetic housing handle, not a regional record. GDD balance.md:100+ /// defines housing.condition_max = 1 (Agreed fraction). No surcharge/decay calculation.</summary>+ internal sealed class Gdd03SyntheticHousingSnapshot+ {+ internal string Id { get; }+ internal decimal ConditionBeforeDeterioration { get; }+ internal Gdd03SyntheticHousingSnapshot(string id, decimal conditionBeforeDeterioration)+ {+ if (conditionBeforeDeterioration < 0m || conditionBeforeDeterioration > 1m)+ throw new ArgumentException("Condition must be a fraction within the catalogue maximum.");+ Id = Gdd03SyntheticMonthContext.Reference(id); ConditionBeforeDeterioration = conditionBeforeDeterioration;+ }+ }++ /// <summary>Keyed opaque synthetic fact, not a Money/indicator settlement interface.+ /// No sign convention, currency conversion, clamp, summation or application is defined here.+ /// Key uniqueness prevents ambiguous duplicate inputs; persistent one-time tracking belongs to owners.</summary>+ internal sealed class Gdd03SyntheticPendingEntry+ {+ internal string Key { get; }+ internal string Unit { get; }+ internal decimal Amount { get; }+ internal Gdd03SyntheticPendingEntry(string key, string unit, decimal amount)+ {+ Key = Gdd03SyntheticMonthContext.Reference(key); Unit = Gdd03SyntheticMonthContext.Reference(unit); Amount = amount;+ }+ }+}