Skip to content

Sync main with 0.7.1 branch and fix update notes parsing#20

Merged
gitmaan merged 11 commits into
mainfrom
codex/chronicle-refresh-fix
Mar 23, 2026
Merged

Sync main with 0.7.1 branch and fix update notes parsing#20
gitmaan merged 11 commits into
mainfrom
codex/chronicle-refresh-fix

Conversation

@gitmaan

@gitmaan gitmaan commented Mar 23, 2026

Copy link
Copy Markdown
Owner

Description

Sync main with the already released v0.7.0/v0.7.1 branch work and include the follow-up updater release-notes parsing fix.

This brings chronicle refresh mode and pacing improvements, event/player/megastructure extraction fixes, expanded tests, and the update dialog parsing fix into main.

Related issue

N/A

Priority alignment

  • This PR aligns with current priorities: DLC coverage/correctness, Windows/Linux reliability, or stability of existing features
  • This brings main back in sync with the already shipped 0.7.x branch and adds a follow-up stability fix

DLC impact

  • No DLC behavior changed
  • DLC-sensitive context/extraction changes are included; reviewer should focus on advisor/context behavior around player guidance and chronicle inputs

Platform validation

  • I tested on Windows and/or Linux, or explained why that was not possible

Regression risk

Chronicle refresh cadence and updater release-note rendering changed. Local validation passed with ruff, pytest tests/ -v --tb=short, cargo fmt --check, cargo clippy -- -D warnings, cargo test, and cargo build --release. I did not do a fresh manual Windows/Linux run in this pass.

Type of change

  • Bug fix
  • New feature
  • Refactoring (no functional changes)
  • Documentation

Checklist

  • Tests pass locally (pytest tests/)
  • Rust parser builds (cd stellaris-parser && cargo build --release)
  • No new warnings
  • I have tested with a real Stellaris save file

gitmaan added 11 commits March 6, 2026 11:32
Restore normal visible chronicle refreshes so ongoing games do not leave the current era stuck while the advisor keeps updating.

Refresh the current-era teaser after meaningful event growth or notable events, while keeping hidden background catch-up on the cheaper chapter-only path.

Add backend regression tests and Electron end-to-end coverage for the stale-chronicle and hidden-resume refresh flows.
Add a Chronicle refresh mode setting with Balanced as the free-tier default and Enhanced as the higher-spend option for users who want more responsive current-era updates.

Gate automatic current-era generation on the Chronicle tab being active and the app being visible so the renderer no longer spends teaser calls while the user is on Advisor or Settings. Hidden/background refreshes still use chapter-only catch-up.

Thread the selected refresh mode through Electron IPC into the chronicle API so the backend can vary current-era regeneration thresholds per request without restarting the backend. Balanced keeps the current 3-event routine threshold while Enhanced refreshes after a single new routine event; notable events still bypass the routine threshold.

Expand backend and Electron coverage for the new behavior, including tab-gating, hidden resume flow, Enhanced mode cadence, and API concurrency compatibility after the new chronicle request shape.
Reduce normal chapter cadence to 30 years and era-ending cooldown to 2 years. Keep colony and military power changes in chapter context, but stop them from forcing immediate current-era rewrites on their own.
Move the chronicle refresh selector out of the crowded header controls and present Balanced and Enhanced as an in-panel toggle within Gemini model access. Keep the setting wired through the existing save flow and update Electron end-to-end coverage so the new control is exercised when validating refresh-mode behavior.
Update the packaged app and Python project metadata to 0.7.0 so the stable Electron release workflow publishes the correct versioned artifacts and updater manifests for this release.
Correct war battle stats to count only battles where the player empire directly participated instead of attributing coalition-wide engagements to the player. This prevents advisor summaries from reporting wins or losses that belong to allies or subjects rather than the player empire.

Replace suffix-based megastructure construction detection with live save-state checks based on build queue and upgrade data. This fixes completed stage-suffixed megastructures such as Grand Archive-style or other late-game structures being reported as still under construction.

Add focused regression tests for coalition-only battle scenarios, dict-based battle participants, and completed stage-suffixed megastructures. Also add an integration test that derives expected player battle stats from raw war entries in a real save and verifies SaveExtractor.get_wars() matches that raw participation data.
Stop inferring megastructure lifecycle state from numeric type suffixes in the history pipeline. Preserve the literal suffix as raw stage metadata in snapshot signals, but treat status as the authoritative source for whether a megastructure is under construction, complete, restored, or ruined.

Update event detection to emit megastructure lifecycle events from status transitions, including construction completed, restored, and ruined, while retaining stage-based upgrade events only for genuine numeric stage increases. This lets single-stage structures such as Grand Archive-style entries produce correct completion events even when their type suffix never changes.

Mark the new megastructure lifecycle events as notable chronicle inputs and add regression coverage across signals, events, and chronicle tests to lock in the new semantics.
Prefer compiled cumulative snapshots when loading patch mechanics for the advisor, while keeping cumulative fallback behavior for later deltas.

Add a current-state 4.3 Cetus snapshot, extend the live stress harness for versioned 4.3 checks, and cover snapshot loading with focused tests.

Also tighten prompt guidance around naval capacity wording and document the snapshot workflow for future patch updates.
Add conservative naval capacity analysis with confidence flags so the advisor can distinguish confirmed and estimated cap states without leaving the normal advisor path.

Add focused tests for the extractor and advisor policy behavior, and ignore local scratch artifacts used during investigation.
Update the Python and Electron package metadata for the 0.7.1 release so tagged builds publish the correct app version and updater manifests.
@gitmaan

gitmaan commented Mar 23, 2026

Copy link
Copy Markdown
Owner Author

Reviewed locally before merge: I rechecked the updater note parsing, chronicle refresh wiring, and naval-capacity guidance paths, and I did not find a blocking issue. Required GitHub checks are green, and local ruff/pytest/cargo validation also passed.

@gitmaan gitmaan merged commit 2cba6a9 into main Mar 23, 2026
11 checks passed
@gitmaan gitmaan deleted the codex/chronicle-refresh-fix branch March 23, 2026 06:51
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