Skip to content

fix(seed): add items_event_sets bridge for Radio (item 5168) — unblocks SGC_W1 mission 1561 - #605

Open
BangRocket wants to merge 1 commit into
mainfrom
fix/334-radio-items-event-sets
Open

BangRocket wants to merge 1 commit into
mainfrom
fix/334-radio-items-event-sets

Conversation

@BangRocket

Copy link
Copy Markdown
Contributor

Summary

Radio (item 5168) had no row in resources.items_event_sets. The SGW client treats that table as the authoritative "can this item be used?" gate, so with no row the Radio shows no Use option and the cell-side OnItemUse::5168 trigger never fires — softlocking SGC_W1 mission 1561 (chains 3021 "use radio → advance to bomb defusal" and 3025 "use radio → complete mission" can never run).

Fix is a single seed INSERT mirroring the other quest-item-use rows (item 19 Ambernol vial → 1374, item 1893 GDO → 597, both on event_id = 5 / EVENT_ItemUse):

INSERT INTO items_event_sets (item_event_id, item_id, ability_id, event_id)
  VALUES (2768, 5168, 597, 5);

2768 is the next free item_event_id (prior max + setval were both 2767); the setval at the end of the file is bumped to 2768 in the same edit so a future sequence-driven insert doesn't collide.

Verified against the seed before editing:

  • item 5168 exists in items.sql with container_sets = '{2}' (mission tab) — only the events bridge was missing.
  • ability 597 ("quest-item use") exists in abilities.sql — the same ability the vial/GDO rows use.
  • chains 3021 and 3025 in sgc_w1_chains.sql both trigger on item_use '5168' and already exist.
  • no pre-existing items_event_sets row for 5168.

Testing

Live-DB regression load_item_event_set_abilities_binds_radio_use (in spawner/tests/live_db_loaders.rs) runs the real loader against the seeded DB and asserts (5168, 5) → 597. It self-skips locally via require_db_or_skip! and runs in CI against the fresh db/database.sql-loaded Postgres; dropping the seed INSERT makes it fail there.

I chose a loader-backed seed guard over a chain-replay test on 3021/3025 because those chains exist independently of this row — a replay test would pass with or without the fix, so it wouldn't guard the change. The server's UseInventoryItem path fires ItemUsed without consulting items_event_sets (the chain decides consumption), so this row is specifically the client-side usability gate; the loader guard is the tightest revertable check for it.

No doc update: docs/content/mission-chains.md and association-map.md already document the two-step radio-use flow as the intended (canonical) behavior — none claimed it was broken, so there's no known-gap note to flip.

Closes #334

🤖 Generated with Claude Code

…ks SGC_W1 mission 1561 (#334)

Radio (5168) had no items_event_sets row, so the client offered no Use
option and OnItemUse::5168 never fired — softlocking mission 1561
(chains 3021/3025). Add the standard quest-item-use binding
(5168 -> ability 597 on EVENT_ItemUse=5), mirroring the vial/GDO rows,
and bump the sequence setval to 2768 so a future sequence insert can't
collide.

Live-DB guard load_item_event_set_abilities_binds_radio_use runs the
real loader against the seed and asserts (5168, 5) -> 597; it fails in
CI if the INSERT is dropped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@BangRocket, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5c1b4949-bbde-46f9-bae0-c6eb7e2c7866

📥 Commits

Reviewing files that changed from the base of the PR and between 2536371 and 01240ef.

📒 Files selected for processing (2)
  • crates/services/src/cell/spawner/tests/live_db_loaders.rs
  • db/resources/Items/Seed/items_event_sets.sql
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/334-radio-items-event-sets

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

fix(seed): add items_event_sets entry for Radio (item 5168) — unblocks SGC_W1 mission 1561

1 participant