Add ops.activity/resource/combat bridge actions + death poller#68
Add ops.activity/resource/combat bridge actions + death poller#68yacketrj wants to merge 4 commits into
Conversation
Main issues I found
Requested changesCould you please update the PR to:
Once those changes are in place, I'll recheck again |
|
All three issues resolved: 1. Column names fixed — guildActivity, factionActivity, and mapActivity queries now use
2. Death poller first-run fix — 3. Test coverage added —
|
|
I
Issue Fix Tests
Wrong column names Defensive columnsFor() + firstExistingColumn() probes
schema dynamically — matches leadershipGuilds pattern —
Death poll false positives detectTransitions skips when the snapshot is
empty — it only counts Alive→Dead between valid snapshots 3/3 pass
No test coverage bridgeActions.test.js — 3 death poller tests Full suite
250/250 pass
Regards,
Ron Yacketta
Regards,
Ron Yacketta
…On Mon, Jul 6, 2026 at 11:42 PM RedBlink ***@***.***> wrote:
*Red-Blink* left a comment (Red-Blink/dune-awakening-selfhost-docker#68)
<#68 (comment)>
Main issues I found
1.
*ops.activity.summary appears to use column names that don't match the
live database schema.*
For example, the PR references:
- guilds.id
- guilds.name
- player_faction.player_id
- player_faction.faction
- map_names.id
- map_names.name
- markers.player_id
However, the live schema uses:
- guilds.guild_id
- guilds.guild_name
- player_faction.actor_id
- player_faction.faction_id
- map_names.map_name_id
- map_names.map_name
- markers.player_id does not exist
Since these queries are wrapped in empty catch {} blocks, the endpoint
can appear to succeed while silently returning empty guild, faction, or map
activity.
2.
*The death poller can generate false death records on first run or
when runtime/generated/death-snapshot.json is missing or corrupted.*
Currently, detectTransitions() treats oldState === undefined as a
death transition. As a result, any player already in a Dead* state
when the poller starts can be recorded as a new death, even though the
death occurred before the poller began tracking.
3.
*The new bridge actions and death poller behavior are not currently
covered by tests.*
Requested changes
Could you please update the PR to:
-
Use the actual live schema column names, preferably following the same
defensive columnsFor() / tableExists() approach already used elsewhere
in duneDb.js.
-
Prevent players who are already dead from being logged as new deaths
when no previous snapshot exists.
-
Add test coverage for:
- ops.activity.summary
- ops.resources.summary
- ops.combat.deaths
- Initial death poller snapshot behavior
Once those changes are in place, I'll recheck again
—
Reply to this email directly, view it on GitHub
<#68?email_source=notifications&email_token=AA5PNZAAFS7M2QK74LKHC6T5DSLW7A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOJQGA4TCNBUGA3KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4900914406>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5PNZB7CX74VUFUNOS5M4T5DSLW7AVCNFSNUABGKJSXA33TNF2G64TZHMYTENBRG4ZDAMRRGE5US43TOVSTWNBYGI2TKOBVGEZTDILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AA5PNZFZWUSTEUQQIXBYXJL5DSLW7A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOJQGA4TCNBUGA3KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/AA5PNZCTN6SSAREY6FRTIDD5DSLW7A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOJQGA4TCNBUGA3KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
…un safety, add test coverage
e7d5ef0 to
76166b8
Compare
|
The death poller starts automatically and creates/writes a dune.* table on every API boot with no opt-in. Gate it behind a config/env flag and avoid unconditional DB mutation. |
Summary
Adds three new bridge actions for the Dune Ops Observability addon plus a local death-tracking poller.
Files changed (3 files, +363 lines)
console/api/src/deathPoller.js(new) — In-process poller that snapshotsplayer_state.life_stateevery 10s, detects Alive→Dead transitions, and logs them toplayer_death_logtableconsole/api/src/duneDb.js— Adds three bridge action query functions:addonOpsActivitySummary()— queriesplayer_statefor activity windows, guild/faction/map distributionaddonOpsResourcesSummary()— queriesresourcefield_state+spicefield_typesfor spice field trackingaddonOpsCombatDeaths()— queriesplayer_death_logfor cumulative death counts by causeconsole/api/src/server.js— Adds three bridge routes (ops.activity.summary,ops.resources.summary,ops.combat.deaths) plus death poller initializationPattern compliance
All bridge actions follow the exact same pattern as existing
ops.health.players:assertInstalledAddonPermission(config, id, "ops:read")bridgeRateLimiterweb-admin-audit.jsonldb.query(text, values)Security
player_controller_id+death_cause(enum string)memoryBalancer.jspattern: in-process, lock-protected, error-suppressedTesting
pgmodule not found — handled bynpm ciin CI)RFC
See RFC-COMBAT-DEATH-TRACKING.pdf in the addon repository for the full death tracking design document.