Exact source used by this build. SHA-256: 71e2492bcd9b37f9bf811880da580ba419ba969bfddca5e24c60c6dff9b4df6a.
1 # Shared items core implementation report
2
3 Implemented as independent registry systems: items, inventory, tools, skills,
4 shipping, shops and forage, integrated with the existing farming system. Client
5 systems provide the backpack/hotbar, chests, shops, shipping, overnight screens,
6 forage/debris rendering and hold-to-charge input. No production server handlers,
7 protocol envelopes, scene coordinators, map data or time-model implementation
8 were changed. No new runtime dependency was added.
9
10 ## Final verification
11
12 ```text
13 $ bun run check
14 123 pass
15 0 fail
16 1803 expect() calls
17 Ran 123 tests across 26 files. [52.25s]
18 Validated 12 content domains: 12 crops, 57 items, and 8 Tiled areas.
19
20 $ bun run --cwd apps/client build
21 206 modules transformed
22 built in 421ms
23 JS 1,722.93 kB / gzip 424.30 kB
24
25 $ git diff --check
26 (no errors)
27 ```
28
29 The headless server test uses two real TCP WebSocket clients, the production
30 FarmWorld authentication, intent dispatch, SQL journal and checkpoint methods,
31 and in-memory SQLite. Cloudflare's socket/storage adapters and Date.now are
32 substituted by the test harness; gameplay changes after fixture setup go through
33 server intents. The existing workerd suite separately verifies the deployed
34 transport's local runtime path. Both players buy seeds, walk through the actual
35 town/farm maps, plant, water through four nights, harvest, ship, and receive
36 correct fifth-morning payouts. Starting from 1,000g, the shared wallet ends at
37 1,045g; separate wallets end at 515g and 530g. Checkpoints contain these balances.
38
39 Coverage includes quality stacking, split/merge, full backpacks, upgrades,
40 shared chests, magnet pickup and drop grace, trash refunds, all tool upgrade
41 costs and gates, two absent mornings, rotated power areas, water capacity/refill,
42 tree hit counts, the full XP table, overnight levels, profession gates/effects,
43 quality and per-shipper payouts, shop scheduling/stock transactions, seeded
44 forage/quality, and invalid cross-domain references. Earlier integration runs
45 found legacy tile-patch-only test expectations; these now accept authoritative
46 area replacements too. A server test interrupted during concurrent dev rebuilds
47 was rerun in the final successful check. Catalog generation now avoids rewriting
48 unchanged output so preparation itself does not restart dev servers.
49
50 ## Extension workflow and compatibility
51
52 `docs/extending.md` gained an additive JSON catalog subsection. Items and crops
53 may be added as JSON files without TypeScript import edits. A build-time Bun
54 script compiles the directory contents into ignored `packages/content/generated/`
55 catalogs. Install, typecheck, validation, client build/dev and server dev prepare
56 them automatically; run `bun run content:prepare` before direct `bun test` after
57 editing JSON. This was needed because browser and Worker bundles cannot scan
58 content directories at runtime. Generated catalogs are excluded from Git. The
59 existing registry system/domain/panel instructions were followed unchanged.
60
61 Item prices and qualities are authoritative in the items domain. The legacy
62 crop price fields and quantity inventory view remain compatibility inputs/views.
63 Slot helpers update the compatibility quantity view. Legacy item aliases map
64 old P0 seeds/produce to numbered ids; oversized saved inventories retain excess
65 items and refill freed slots without discarding quantities. Unresolved pending
66 shipping entries remain queued when a content definition is missing. Crop growth
67 plans live in the farming area slice, preserving strict crop wire validation.
68
69 The explicit request for two mornings without an upgraded tool is interpreted
70 as readiness on the third morning. The requested five-tier scythe uses the
71 standard four upgrade cost/bar steps. Starting money and wallet-mode behavior
72 remain as previously implemented; the server test supplies its starting balance.
73
74 ## Known gaps and verification limits
75
76 - Geode cracking and non-farming profession effects are intentional stubs.
77 - Farming harvests currently yield regular-quality produce. Forage rolls quality;
78 the shared item, inventory, price and shipping paths support all four tiers.
79 - Farming's animal professions expose functional typed modifiers for future
80 animal systems; this task does not add animal producers.
81 - Phone visual verification could not run: local Chrome aborted under macOS
82 sandbox Crashpad/Mach permissions, and computer-use reported no browser
83 surfaces. Pure client tests and production compilation passed; no screenshots
84 were obtained.
85 - Vite reports a bundle larger than 500 kB (the client includes Phaser). The
86 production build succeeds.
87
88 Formula references checked while implementing the numerical helpers:
89 [Farming XP](https://stardewvalleywiki.com/Farming) and
90 [edibility calculation](https://ja.stardewvalleywiki.com/モジュール:Calcedibility).
91 Only numerical mechanics were used; names, descriptions and shape art are
92 original/placeholders, with procedural graphics credited as CC0.
93
94 ## Repository and storage state
95
96 Changes are uncommitted; no Git write was attempted. Nothing was deployed,
97 pushed, authenticated or history-rewritten. The concurrent change in
98 `docs/requests.md` was left untouched and is excluded from the implementation
99 tree below. Ignored local server state/cache is approximately 196 MB and is
100 retained because it includes pre-existing data; client dist is 1.7 MB and generated
101 content catalogs are 16 KB. No unknown files were removed.
102
103 ## Changed files
104
105 ```text
106 Tamarack/
107 ├── .gitignore
108 ├── apps/
109 │ ├── client/
110 │ │ ├── package.json
111 │ │ ├── public/
112 │ │ │ └── assets/
113 │ │ │ └── CREDITS.md
114 │ │ └── src/
115 │ │ ├── core/
116 │ │ │ └── registry.test.ts
117 │ │ └── systems/
118 │ │ ├── chests/
119 │ │ │ └── index.ts
120 │ │ ├── farming/
121 │ │ │ └── index.ts
122 │ │ ├── forage/
123 │ │ │ └── index.ts
124 │ │ ├── index.ts
125 │ │ ├── inventory/
126 │ │ │ ├── index.ts
127 │ │ │ ├── model.test.ts
128 │ │ │ ├── model.ts
129 │ │ │ └── ui.ts
130 │ │ ├── shipping/
131 │ │ │ └── index.ts
132 │ │ ├── shops/
133 │ │ │ └── index.ts
134 │ │ ├── skills/
135 │ │ │ ├── index.ts
136 │ │ │ └── options.test.ts
137 │ │ └── tools/
138 │ │ ├── index.ts
139 │ │ ├── model.test.ts
140 │ │ └── model.ts
141 │ └── server/
142 │ ├── package.json
143 │ └── test/
144 │ ├── items-loop.test.ts
145 │ └── server.test.ts
146 ├── docs/
147 │ ├── extending.md
148 │ └── items-core-report.md
149 ├── package.json
150 └── packages/
151 ├── content/
152 │ ├── data/
153 │ │ ├── crops/
154 │ │ │ └── crops.json
155 │ │ ├── farm/
156 │ │ │ └── farm.json
157 │ │ ├── forage/
158 │ │ │ └── tables.json
159 │ │ ├── items/
160 │ │ │ └── items.json
161 │ │ ├── shipping/
162 │ │ │ └── bins.json
163 │ │ ├── shops/
164 │ │ │ └── shops.json
165 │ │ ├── skills/
166 │ │ │ └── skills.json
167 │ │ └── tools/
168 │ │ └── tools.json
169 │ ├── package.json
170 │ ├── src/
171 │ │ └── domains/
172 │ │ ├── crops/
173 │ │ │ ├── index.ts
174 │ │ │ └── schema.ts
175 │ │ ├── forage/
176 │ │ │ ├── index.ts
177 │ │ │ └── schema.ts
178 │ │ ├── index.ts
179 │ │ ├── items/
180 │ │ │ ├── generate.ts
181 │ │ │ ├── index.ts
182 │ │ │ └── schema.ts
183 │ │ ├── shipping/
184 │ │ │ ├── index.ts
185 │ │ │ └── schema.ts
186 │ │ ├── shops/
187 │ │ │ ├── economy-content.test.ts
188 │ │ │ ├── index.ts
189 │ │ │ └── schema.ts
190 │ │ ├── skills/
191 │ │ │ ├── index.ts
192 │ │ │ └── schema.ts
193 │ │ └── tools/
194 │ │ ├── index.ts
195 │ │ └── schema.ts
196 │ └── test/
197 │ ├── domains.test.ts
198 │ ├── items.test.ts
199 │ └── validation.test.ts
200 └── sim/
201 ├── src/
202 │ └── systems/
203 │ ├── farming/
204 │ │ └── index.ts
205 │ ├── forage/
206 │ │ └── index.ts
207 │ ├── index.ts
208 │ ├── inventory/
209 │ │ └── index.ts
210 │ ├── items/
211 │ │ └── index.ts
212 │ ├── shipping/
213 │ │ ├── index.ts
214 │ │ └── money.ts
215 │ ├── shops/
216 │ │ └── index.ts
217 │ ├── skills/
218 │ │ └── index.ts
219 │ └── tools/
220 │ └── index.ts
221 └── test/
222 ├── farming-items.test.ts
223 ├── items-economy.test.ts
224 ├── items-inventory.test.ts
225 └── tools.test.ts
226 ```
227