Skip to content

Commit 1cb0c0f

Browse files
HandyS11claude
andcommitted
docs(6e): document CCTV source in the generator README
Add cctv.json row to the source-file table, /cctv to the calculator list, CctvAsOf to the provenance constants list, and CCTV Notes bullet. Also fix comment-rot (21→22 handler names) and apply jb cleanupcode reformats to IItemDatabase.cs, CctvChoiceDriftTests.cs, DatasetValidator.cs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 25846a4 commit 1cb0c0f

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

src/RustPlusBot.Features.ItemData/IItemDatabase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ public interface IItemDatabase
99
/// <summary>Per-section provenance dates, for "data as of" display.</summary>
1010
DatasetSources Sources { get; }
1111

12+
/// <summary>All CCTV monument entries from the bundle.</summary>
13+
IReadOnlyList<CctvMonument> CctvMonuments { get; }
14+
1215
/// <summary>Gets the record for an item id, or null if unknown.</summary>
1316
/// <param name="id">The Rust item id.</param>
1417
ItemRecord? GetById(int id);
@@ -28,9 +31,6 @@ public interface IItemDatabase
2831
/// <returns>A match describing the outcome.</returns>
2932
SmeltMatch ResolveSmelter(string query);
3033

31-
/// <summary>All CCTV monument entries from the bundle.</summary>
32-
IReadOnlyList<CctvMonument> CctvMonuments { get; }
33-
3434
/// <summary>Resolves a user query (monument name) to a CCTV monument.</summary>
3535
/// <param name="query">The raw user input.</param>
3636
/// <returns>A match describing the outcome.</returns>

tests/RustPlusBot.Features.Commands.Tests/Help/CommandHelpCatalogTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace RustPlusBot.Features.Commands.Tests.Help;
55

66
public sealed class CommandHelpCatalogTests
77
{
8-
/// <summary>The 21 registered in-game handler names (see AddCommands / CommandRegistrationTests).</summary>
8+
/// <summary>The 22 registered in-game handler names (see AddCommands / CommandRegistrationTests).</summary>
99
private static readonly string[] HandlerNames =
1010
[
1111
"mute", "unmute", "uptime", "pop", "wipe", "time",

tests/RustPlusBot.Features.Commands.Tests/Modules/CctvChoiceDriftTests.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@ private static IReadOnlyList<string> ChoiceValues()
1212
var parameter = typeof(ItemCommandModule)
1313
.GetMethod(nameof(ItemCommandModule.CctvAsync))!
1414
.GetParameters()[0];
15-
return [..parameter.GetCustomAttributes<ChoiceAttribute>()
16-
.Select(c => (string)c.Value!)];
15+
return
16+
[
17+
..parameter.GetCustomAttributes<ChoiceAttribute>()
18+
.Select(c => (string)c.Value!)
19+
];
1720
}
1821

1922
[Fact]

tools/RustPlusBot.ItemData.Generator/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A maintainer CLI that regenerates the embedded Rust item dataset
44
(`src/RustPlusBot.Features.ItemData/Data/item-data.json`) consumed by the bot's
5-
`/item`, `/recycle`, `/craft`, `/research`, `/decay`, `/upkeep`, `/durability`, and `/smelt` calculators.
5+
`/item`, `/recycle`, `/craft`, `/research`, `/decay`, `/upkeep`, `/durability`, `/smelt`, and `/cctv` calculators.
66

77
This tool is **not** part of the running bot — it is referenced by nothing in
88
the application graph. It exists so the bundled item data can be refreshed when
@@ -39,6 +39,7 @@ garbage** if the upstream shape drifts.
3939
| `rustlabsUpkeepData.json` | upkeep cost (resource + quantity range) |
4040
| `rustlabsDurabilityData.json` | raid cost (explosives only — trimmed) |
4141
| `rustlabsSmeltingData.json` | smelting/cooking conversions (per smelter) |
42+
| `cctv.json` | monument CCTV camera codes |
4243

4344
2. Projects them into our own typed schema (`ItemDataset` /
4445
`ItemRecord` / …, defined in `RustPlusBot.Features.ItemData`), keyed by item id,
@@ -92,7 +93,7 @@ tests assert known items resolve correctly.
9293

9394
The source dates stamped into the dataset are currently hard-coded constants in
9495
[`Program.cs`](Program.cs) (`NamesAsOf`, `RecycleAsOf`, `CraftAsOf`,
95-
`ResearchAsOf`, `DecayAsOf`, `UpkeepAsOf`, `DurabilityAsOf`, `SmeltingAsOf`).
96+
`ResearchAsOf`, `DecayAsOf`, `UpkeepAsOf`, `DurabilityAsOf`, `SmeltingAsOf`, `CctvAsOf`).
9697
Update them when you refresh from newer upstream data.
9798

9899
## Notes
@@ -112,6 +113,9 @@ Update them when you refresh from newer upstream data.
112113
resolved by name like raid targets. Its provenance (`SmeltingAsOf`,
113114
2023-11-05) lags the other rustlabs sources because the upstream file has not
114115
changed since then.
116+
- CCTV data (`cctv.json`, ~2 KB) is keyed by **monument name** and projected into a dedicated
117+
`Cctv` table (`OfflineCctvSource`), resolved by name. Codes are un-escaped (`\*``*`) during the
118+
transform. Its provenance (`CctvAsOf`, 2025-11-12) is the upstream last-change date for the file.
115119

116120
## Attribution
117121

tools/RustPlusBot.ItemData.Generator/Validation/DatasetValidator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ namespace RustPlusBot.ItemData.Generator.Validation;
77
/// <param name="MinRaidTargetCount">The minimum number of raid targets the dataset must contain.</param>
88
/// <param name="MinSmelterCount">The minimum number of smelters the dataset must contain.</param>
99
/// <param name="MinCctvCount">The minimum number of CCTV monuments the dataset must contain.</param>
10-
internal sealed record ValidationOptions(int MinItemCount, int MinRaidTargetCount = 0, int MinSmelterCount = 0,
10+
internal sealed record ValidationOptions(
11+
int MinItemCount,
12+
int MinRaidTargetCount = 0,
13+
int MinSmelterCount = 0,
1114
int MinCctvCount = 0);
1215

1316
/// <summary>Validates an <see cref="ItemDataset"/> for structural integrity.</summary>

0 commit comments

Comments
 (0)