Exact source used by this build. SHA-256: 687fe543579ef2f979b17fa1059875b0b56a4933aa8f4059ee72d85cb37a8834.

1 # Tamarack foundation implementation report
2 
3 Implemented the P1 foundation: registered simulation systems and intent validation, registered client panels/actions/renderers and four scenes, seven independent content domains, eight Tiled blockouts, authoritative area transitions and scoped visibility, seasonal appearances, seeded weather and rain watering, title/HUD/camera fixes, and save/device-token migration.
4 
5 ## Structure
6 
7 ```text
8 packages/sim/src/
9   systems/{calendar,energy,farming,movement,wallet,weather}/
10   systems/{index,registry,schema}.ts
11   examples/counter.ts
12 packages/content/
13   data/{crops,farm,items,maps,seasons,tiles,weather}/
14   src/domains/{crops,farm,items,maps,seasons,tiles,weather}/
15   src/domains/{index,types}.ts
16 apps/client/src/
17   core/
18   scenes/{Boot,Title,World,UIOverlay}.ts
19   systems/{areas,calendar,energy,farming,movement,sleep,wallet,weather}/
20 apps/server/src/
21   configuration.ts
22   intent-budget.ts
23   migration.ts
24   index.ts
25 docs/{extending,foundation-report}.md
26 ```
27 
28 See [extending.md](extending.md) for authoring instructions and the compiled counter-system example. Registering a system requires its folder, an import and one entry in the appropriate registry; there are no per-system protocol or Durable Object branches. Domain data is automatically composed into simulation rules, so new content-backed systems need no server configuration or shared rules-type edits. P0's public state fields remain compatibility fields owned by the systems; new features use namespaced state slices.
29 
30 ## Final validation
31 
32 - `bun install --frozen-lockfile`: passed; 68 installs checked across 164 packages, no dependency changes. The initial offline install attempt lacked cached manifests; the frozen existing lockfile succeeded.
33 - `bun run check`: passed, all four strict typechecks, **82 tests passed, 0 failed, 1,272 expectations across 16 files**, 44.86 seconds; validator confirmed **7 domains, 3 crops, 6 items, 8 Tiled areas**. This final run used the preserved local storage identity.
34 - `bun run --cwd apps/client build`: passed, 173 modules; 1,632.88 kB JavaScript / 403.15 kB gzip. Existing Phaser bundle triggers Vite's greater-than-500-kB chunk warning.
35 - `git diff --check`: passed.
36 - Targeted package typechecks/tests, migration and timing-credit tests passed during implementation; final full check includes them.
37 - Native Chrome visual checks: desktop title and gameplay; iPhone 16 emulation (393 × 852) title, safe-area HUD and touch-control layout; movement/camera follow and map-edge clamping. Repeated normal movement after timing/reconciliation fixes showed no speed-limit toast.
38 - Two real WebSocket clients walk all 75 farm-to-town route steps, disappear from each other's area state while separated, then reappear together in town. Original farming, auth, restart/persistence and offline-clock tests still pass.
39 - Early integration runs during concurrent live source edits encountered SQLite locks on Wrangler reload. Final checks with stable source completed successfully. No deployment or login was performed.
40 
41 ## Deliberate limits
42 
43 All art and maps are original placeholders. Farm, town, woods, mountain and beach are open; rainforest, canyon and bog remain locked with repair interactions. Repair progression and mine interiors are future work. Seasonal art currently uses colors and simple ground-cover shapes. Actual iPhone hardware/Capacitor testing was outside this task; mobile layout was checked in browser emulation. No new runtime dependency was added.
44 
45 Changes remain uncommitted; the repository instruction requires an explicit commit instruction. No Git write, push or history rewrite was attempted. The unrelated `tasks/p2-art-pipeline.md`, `tasks/p2-items-core.md` and `docs/requests.md` appeared during this task and were left untouched.
46 
47 The dev command and integration tests retain the internal `shared-farm-server` worker identity because Wrangler derives local Durable Object paths and IDs from that identity. This preserves access to P0 saves without moving or rewriting saved databases. The checked-in worker name, packages and application are Tamarack; legacy browser device tokens are reused automatically.
48 
49 The isolated QA server/client were stopped and their generated QA token/state removed. Existing `.wrangler/test-state` (about 120 MB, including earlier test state) was retained to avoid deleting pre-existing files; it is ignored. The production build is about 1.6 MB and ignored; existing dependencies are about 408 MB. No large generated assets are tracked.
50 
51 ## Changed files
52 
53 The three old top-level content JSON files were moved into domain folders. Paths below include modified, moved-from and newly added task files; unrelated task specs are excluded.
54 
55 - `README.md`
56 - `apps/client/index.html`
57 - `apps/client/package.json`
58 - `apps/client/public/assets/CREDITS.md`
59 - `apps/client/src/core/device-token.test.ts`
60 - `apps/client/src/core/device-token.ts`
61 - `apps/client/src/core/dom.ts`
62 - `apps/client/src/core/registry.test.ts`
63 - `apps/client/src/core/registry.ts`
64 - `apps/client/src/core/session.ts`
65 - `apps/client/src/core/types.ts`
66 - `apps/client/src/main.ts`
67 - `apps/client/src/net.ts`
68 - `apps/client/src/scenes/Boot.ts`
69 - `apps/client/src/scenes/Title.ts`
70 - `apps/client/src/scenes/UIOverlay.ts`
71 - `apps/client/src/scenes/World.ts`
72 - `apps/client/src/styles.css`
73 - `apps/client/src/systems/areas/index.ts`
74 - `apps/client/src/systems/areas/rendering.test.ts`
75 - `apps/client/src/systems/areas/rendering.ts`
76 - `apps/client/src/systems/calendar/index.ts`
77 - `apps/client/src/systems/energy/index.ts`
78 - `apps/client/src/systems/farming/index.ts`
79 - `apps/client/src/systems/index.ts`
80 - `apps/client/src/systems/movement/geometry.test.ts`
81 - `apps/client/src/systems/movement/geometry.ts`
82 - `apps/client/src/systems/movement/index.ts`
83 - `apps/client/src/systems/movement/prediction.test.ts`
84 - `apps/client/src/systems/movement/prediction.ts`
85 - `apps/client/src/systems/sleep/index.ts`
86 - `apps/client/src/systems/wallet/index.ts`
87 - `apps/client/src/systems/weather/index.ts`
88 - `apps/server/package.json`
89 - `apps/server/src/configuration.ts`
90 - `apps/server/src/index.ts`
91 - `apps/server/src/intent-budget.ts`
92 - `apps/server/src/migration.ts`
93 - `apps/server/test/intent-budget.test.ts`
94 - `apps/server/test/migration.test.ts`
95 - `apps/server/test/server.test.ts`
96 - `apps/server/wrangler.toml`
97 - `bun.lock`
98 - `docs/extending.md`
99 - `docs/foundation-report.md`
100 - `package.json`
101 - `packages/content/data/crops.json`
102 - `packages/content/data/crops/crops.json`
103 - `packages/content/data/farm.json`
104 - `packages/content/data/farm/farm.json`
105 - `packages/content/data/items.json`
106 - `packages/content/data/items/items.json`
107 - `packages/content/data/maps/beach.json`
108 - `packages/content/data/maps/bog.json`
109 - `packages/content/data/maps/canyon.json`
110 - `packages/content/data/maps/farm.json`
111 - `packages/content/data/maps/mountain.json`
112 - `packages/content/data/maps/rainforest.json`
113 - `packages/content/data/maps/town.json`
114 - `packages/content/data/maps/woods.json`
115 - `packages/content/data/seasons/palettes.json`
116 - `packages/content/data/tiles/blockout.svg`
117 - `packages/content/data/tiles/palette.json`
118 - `packages/content/data/weather/odds.json`
119 - `packages/content/data/weather/visuals.json`
120 - `packages/content/package.json`
121 - `packages/content/src/domains/crops/index.ts`
122 - `packages/content/src/domains/crops/schema.ts`
123 - `packages/content/src/domains/farm/index.ts`
124 - `packages/content/src/domains/farm/schema.ts`
125 - `packages/content/src/domains/index.ts`
126 - `packages/content/src/domains/items/index.ts`
127 - `packages/content/src/domains/items/schema.ts`
128 - `packages/content/src/domains/maps/index.ts`
129 - `packages/content/src/domains/maps/loader.ts`
130 - `packages/content/src/domains/maps/schema.ts`
131 - `packages/content/src/domains/seasons/index.ts`
132 - `packages/content/src/domains/seasons/schema.ts`
133 - `packages/content/src/domains/tiles/index.ts`
134 - `packages/content/src/domains/tiles/schema.ts`
135 - `packages/content/src/domains/types.ts`
136 - `packages/content/src/domains/weather/index.ts`
137 - `packages/content/src/domains/weather/schema.ts`
138 - `packages/content/src/index.ts`
139 - `packages/content/src/schemas.ts`
140 - `packages/content/src/validate.ts`
141 - `packages/content/test/domains.test.ts`
142 - `packages/content/test/maps.test.ts`
143 - `packages/content/test/seasons.test.ts`
144 - `packages/sim/package.json`
145 - `packages/sim/src/clock.ts`
146 - `packages/sim/src/examples/counter.ts`
147 - `packages/sim/src/index.ts`
148 - `packages/sim/src/protocol.ts`
149 - `packages/sim/src/reducers.ts`
150 - `packages/sim/src/state.ts`
151 - `packages/sim/src/systems/calendar/index.ts`
152 - `packages/sim/src/systems/energy/index.ts`
153 - `packages/sim/src/systems/farming/index.ts`
154 - `packages/sim/src/systems/index.ts`
155 - `packages/sim/src/systems/movement/index.ts`
156 - `packages/sim/src/systems/registry.ts`
157 - `packages/sim/src/systems/schema.ts`
158 - `packages/sim/src/systems/wallet/index.ts`
159 - `packages/sim/src/systems/weather/index.ts`
160 - `packages/sim/src/types.ts`
161 - `packages/sim/src/world.ts`
162 - `packages/sim/test/areas-weather.test.ts`
163 - `packages/sim/test/registry.test.ts`
164