Skip to content

Key module scoreboards by module ID - #1113

Open
zardus wants to merge 1 commit into
masterfrom
codex/issue-1097-module-generation
Open

Key module scoreboards by module ID#1113
zardus wants to merge 1 commit into
masterfrom
codex/issue-1097-module-generation

Conversation

@zardus

@zardus zardus commented Jul 24, 2026

Copy link
Copy Markdown
Member

Fixes #1097

Summary

  • key module scoreboard and crew caches by the stable module ID instead of its mutable list index
  • add an explicit id discriminator so numeric module IDs cannot collide with legacy index keys
  • change only the four module scoreboard readers and writers involved in the reported bug

Testing

  • populate a module scoreboard, replace that module at the same index, and verify the replacement starts empty
  • solve the replacement once and verify its score is exactly one

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

https://github.com/pwncollege/dojo/blob/622a71f43c9da57ce1448de0aefa129b6e40a423/dojo#L277-L279
P2 Badge Unset SKIP_COLD_START during restore rebuild

When a deployment has SKIP_COLD_START in the stats-worker environment, this restore path starts the existing stats-worker container with that same setting, but worker/__main__.py then skips initialization and never emits Cold start complete - all stats initialized. After pg_restore and FLUSHDB, dojo restore will wait the full timeout, report failure, and the cleanup path leaves services stopped even though the database restore already committed; the restore rebuild should force cold start or recognize a separate successful rebuild signal.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
dojo_plugin/worker/handlers/scoreboard.py 0.00% 2 Missing ⚠️
dojo_plugin/worker/handlers/solve.py 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@zardus
zardus force-pushed the codex/issue-1097-module-generation branch from 8630b49 to 2792576 Compare July 26, 2026 16:26
@zardus
zardus changed the base branch from master to codex/ci-harden-dojo-tests July 26, 2026 16:26
@zardus
zardus force-pushed the codex/ci-harden-dojo-tests branch from cddd17c to c09419a Compare July 26, 2026 18:06
@zardus
zardus force-pushed the codex/issue-1097-module-generation branch from 2792576 to b6c0e53 Compare July 26, 2026 18:06
zardus added a commit that referenced this pull request Jul 26, 2026
## Summary

- make the stats-worker cold-start regression deterministic by stopping
the worker, clearing the target cache, and verifying its exact
cold-start initialization
- make database-shell errors fail tests immediately and surface
PostgreSQL diagnostics
- raise the test-step limit from 15 to 20 minutes; recent remote
#1111/#1113 test steps took up to 16m33s

## Scope

This PR is strictly CI/test-only. It changes exactly:

- `.github/workflows/ci.yml`
- `test/test_background_stats.py`
- `test/utils.py`

It contains no runtime, production, image-build, Compose, or dependency
changes.

## Validation

- Python syntax check
- workflow YAML parse
- whitespace check
- full single-node and multi-node suites in GitHub Actions

## Stack

The seven feature PRs (#1105, #1106, #1108, #1110, #1111, #1112, and
#1113) each contain one feature-only commit directly above this branch.

Shared schema-startup hardening is isolated in #1115. Image-build
patch-runner hardening is isolated in #1116. Neither is a prerequisite
for any feature PR.

Merge this PR first, then retarget the nine sibling PRs to `master`
before deleting this branch.
Base automatically changed from codex/ci-harden-dojo-tests to master July 26, 2026 22:31
@zardus
zardus force-pushed the codex/issue-1097-module-generation branch 2 times, most recently from f316d47 to 7638e99 Compare July 27, 2026 02:30
@zardus zardus changed the title Make module scoreboard caches generation-safe Prevent stale scoreboards after module replacement Jul 27, 2026
@zardus
zardus force-pushed the codex/issue-1097-module-generation branch from 7638e99 to 1e40661 Compare July 27, 2026 02:59
@zardus zardus changed the title Prevent stale scoreboards after module replacement Key module scoreboards by module ID Jul 27, 2026
@zardus

zardus commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

@adamdoupe do you see any issues with this? It sets module ID instead of index for the cache key, to avoid the issue where inserting a module midway through a dojo makes things really weird. Other than having to regenerate caches on start, it should be good, right?

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.

scoreboard with full solves on a fresh module

1 participant