Skip to content

fix(prism): allow one-candidate startup replay pages - #256

Merged
kiwidream merged 2 commits into
2.x.xfrom
check-prism-stratum-failures
Sep 9, 2026
Merged

kiwidream merged 2 commits into
2.x.xfrom
check-prism-stratum-failures

Conversation

@kiwidream

@kiwidream kiwidream commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Large pending candidate payloads can be decoded together during startup replay, stalling the coordinator long enough to lose its writer lease. This adds PRISM_BLOCK_REPLAY_PAGE_SIZE so operators can request one candidate per cursor page during startup and forced ancestor re-drive.

The setting accepts 1–1024 and defaults to the existing 1024. The cursor walk still enumerates all pending work before opening the startup gate. Page failures preserve the gate and retry without duplicate adoption; accounting, lease fencing, cleanup backpressure, ordinary polling, and the legacy cursorless fallback retain their existing behavior. Compose wiring, configuration validation, and operator guidance are included.

Related to #255; this is a partial mitigation and leaves that issue open. A synthetic Python 3.14.7 Linux ARM64 probe with approximately 232 MB per candidate reduced the observed decoding pause from 920 ms for two candidates to 470 ms for one. This is preliminary local evidence, not a production recovery result. A single large candidate and live candidate encoding can still exceed the lease budget; smaller pages also add database/RPC calls and do not cap total queued memory.

The environment-policy unit tests also use controlled Docker fixtures, including the minimal-PATH case. This prevents successful validation from waiting on the CI runner's real Docker daemon; explicit success-path fixtures continue to exercise source pinning and production provenance. The affected assertions now require reaching the expected Docker boundary.

Validation:

  • Passed 60 replay/reliability tests, 120 coordinator configuration tests, and 24 Compose profile tests. Regression coverage includes complete one-row pagination, the final empty page, failed-page retry, and ancestor re-drive. The initial regression tests failed against the original implementation.
  • All 57 environment-policy tests pass with a deliberately stalled Docker command on the inherited PATH, without invoking it. Before the fixture fix, the nonproduction test reproduced the CI timeout against that command.
  • Docker Ruff, ShellCheck, shell syntax, and Python compilation passed.
  • Ran all four Linux Python test shards: 3,389 tests reported, with five skips and ten failures. Seven audit-file failures reproduce unchanged on base commit d392800; the other three were caused by the read-only test mount, and all six source-staging tests passed on a writable copy. The broader macOS run also passed those audit tests; its five Linux-only spool failures passed when rerun on Linux.

Self-review of the full diff against 2.x.x found no remaining issues, including configuration bounds, cursor completeness, failed-page retries, accounting gates, and test-fixture isolation.

No production deployment is included. After review and deployment, opting into PRISM_BLOCK_REPLAY_PAGE_SIZE=1 requires checking completed pending-block accounting and subscribe/authorize/notify health on both public Stratum listeners. Restore 1024 to undo the tuning.

Add an opt-in cursor page size for startup and forced ancestor replay while preserving complete enumeration, retry deduplication, and accounting gates. Document the mitigation and its limits while issue #255 remains under investigation.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-09-09T17:00:48.396855Z 95b1724 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kiwidream

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Provided git ref 95b172436461c9778f748392ebd0e4cfd244d019 does not exist
ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@blacksmith-sh

blacksmith-sh Bot commented Sep 9, 2026

Copy link
Copy Markdown

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
test_check_env_production_gate.CheckEnvProductionGateTests.test_non_auxpow_lane_ignores
_unused_bitcoin_validation_settings/
test_non_auxpow_lane_ignores_unused_bitcoin_validation_settings
View Logs
test_check_env_production_gate.CheckEnvProductionGateTests.test_nonproduction_skips_pro
duction_only_policy_checks/test_nonproduction_skips_production_only_policy_checks
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Use a controlled Docker fixture for policy tests so runner daemon startup cannot exceed the subprocess deadline. Preserve explicit success fixtures and assert that valid configurations reach the expected Docker boundary.
@kiwidream
kiwidream merged commit 24e7478 into 2.x.x Sep 9, 2026
25 checks passed
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