Skip to content

Subsystem 6b: Item DB decay + upkeep calculators (/decay /upkeep + in-game, schema v2)#29

Merged
HandyS11 merged 12 commits into
developfrom
feat/item-database-2
Jun 27, 2026
Merged

Subsystem 6b: Item DB decay + upkeep calculators (/decay /upkeep + in-game, schema v2)#29
HandyS11 merged 12 commits into
developfrom
feat/item-database-2

Conversation

@HandyS11

Copy link
Copy Markdown
Owner

Second slice of the item-database subsystem (after 6a, #28). Extends the bundled dataset with two new per-item attributes — decay and upkeep — and ships matching calculators on both surfaces: in-game !decay/!upkeep and Discord /decay//upkeep. A faithful mirror of 6a's /recycle//craft//research.

What's in it

  • Schema (Features.ItemData)ItemRecord gains nullable Decay (DecayInfo: seconds + 4 env variants + HP) and Upkeep (UpkeepCost/UpkeepEntry: resource id + min/max quantity). DatasetSources gains DecayAsOf/UpkeepAsOf. Schema version bumped 1 → 2 (loader rejects a mismatched bundle).
  • Generator (tools/RustPlusBot.ItemData.Generator)LoadDecay/LoadUpkeep read the "items"-wrapped RustLabs files; a pure UpkeepQuantity.Parse turns "1" / en-dash ranges "8–25" into structured min/max and fails loud on anything else; DatasetValidator gains upkeep-id-resolves / min ≤ max / non-negative-decay checks. The embedded item-data.json was regenerated (1205 items, schemaVersion 2, 0 orphan decay/upkeep entries — 137 decay + 26 upkeep attached).
  • Calculators (Features.Commands) — pure DecayLine/UpkeepLine formatters, in-game DecayCommandHandler/UpkeepCommandHandler, two [SlashCommand]s on ItemCommandModule, EN/FR strings, and the /help catalog. The slash footer now shows each command's own section date (small refactor of the shared helper).

Scope / deferrals

  • decay + upkeep only. Durability (19 MB raid matrix), smelting, and CCTV each get their own later slice.
  • Upkeep makes 4c's deferred TC-upkeep calc possible but does not wire it — that stays a separate StorageMonitors slice.
  • The upkeep line deliberately omits a period label (no "/ 24h") pending RustLabs verification of the period semantics.

Quality gates

  • Build 0 warnings / 0 errors (-warnaserror, strict Roslynator/Sonar).
  • 618 tests / 16 assemblies green (-maxcpucount:1); no assembly dropped.
  • jb cleanupcode --profile=ReformatAndReorder zero-diff.
  • No EF / migration drift (read-only static data); Features.ItemData stays a dependency-free leaf.
  • Built subagent-driven (TDD + per-task spec/quality reviews + a final whole-branch opus review — no Critical/Important).

🤖 Generated with Claude Code

HandyS11 and others added 12 commits June 27, 2026 15:11
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ter (6b)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…6b review)

- EmbeddedItemDatabaseTests: Assert.Single on WoodenDoor upkeep entry with ItemId/QuantityMin/QuantityMax
- DecayFormatterTests: add DecayLine_ShowsDashAndHpWhenNoDecaySeconds fact; assert HP(250) in variant test
- Strings.resx + Strings.fr.resx: append period to help.slash.decay and help.slash.upkeep values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@HandyS11 HandyS11 merged commit a05739c into develop Jun 27, 2026
3 checks passed
@HandyS11 HandyS11 deleted the feat/item-database-2 branch June 27, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant