Skip to content

Introduce rollout store and in-memory source - #13096

Open
charley-oai wants to merge 34 commits into
mainfrom
cc/rollout-reconstruction-resumable-backtracking
Open

charley-oai wants to merge 34 commits into
mainfrom
cc/rollout-reconstruction-resumable-backtracking

Conversation

@charley-oai

@charley-oai charley-oai commented Feb 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • introduce RolloutStore and InMemoryRolloutSource in codex-rs/core/src/rollout/recorder.rs, and route rollout reconstruction plus related readers through the RolloutSource interface instead of assuming raw rollout-item vectors everywhere
  • keep one process-local in-memory rollout source in sync with runtime writes and session-meta enrichment, so replay readers and persistence share the same ordered rollout state
  • preserve main's deferred rollout-file materialization semantics for fresh threads while tightening the startup / resume paths around the shared source
  • avoid resume-specific rollout duplication by passing preloaded sources where available and reconstructing resumed state without cloning the full rollout source
  • make the remaining eager boundaries explicit (InitialHistory::Resumed, fork startup, phase-1 memories, some metadata helpers) so later work can move them onto RolloutSource incrementally

Why

This keeps the PR focused on one productive groundwork step for lazy rollout reading without pulling in the larger backtracking / retention design yet:

  • core/runtime now has a shared in-memory rollout source instead of separate queue and replay views
  • reconstruction and related readers already speak in terms of RolloutSource operations (inclusive_start_of_rollout_index, exclusive_end_of_rollout_index, iter_forward_from, iter_reverse_from)
  • resume/startup paths can reuse preloaded rollout sources instead of reparsing or silently degrading
  • the branch remains compatible with main's deferred-persistence behavior rather than changing rollout-file lifecycle semantics as part of this work

Not In Scope

  • resumable backtracking state
  • retention-window trimming of older in-memory rollout items
  • replacing eager InitialHistory::Resumed(Vec<RolloutItem>) end-to-end with a RolloutSource-backed startup API
  • making phase-1 memories compaction-aware or fully token-budget-aware (that path now uses the source interface, but still serializes the full filtered rollout)

Testing

  • just fmt
  • just fix -p codex-core
  • targeted codex-core / codex-app-server checks while iterating on:
    • resume startup / ephemeral resume
    • rollout metadata extraction
    • rollout source ordering and session-meta sync
    • app-server thread start / read / resume / fork / archive paths
  • CI on the final branch SHA

Notes

  • load_rollout_items intentionally remains as a shim in recorder.rs for diff quality; InMemoryRolloutSource::load_from_path delegates to it for now.
  • startup git metadata is captured from startup time without blocking startup: collection begins eagerly and is awaited later when the session-meta line is written.
  • some startup consumers still require owned rollout items today; those callsites are marked with TODOs where the next RolloutSource-backed cleanup should happen.

@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1fded1ebb9

ℹ️ 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".

Comment thread codex-rs/core/src/codex/rollout_reconstruction.rs Outdated
Comment thread codex-rs/core/src/rollout/recorder.rs Outdated
@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4d6ad0a04a

ℹ️ 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".

Comment thread codex-rs/core/src/codex/rollout_reconstruction.rs Outdated
@charley-oai
charley-oai force-pushed the cc/rollout-reconstruction-resumable-backtracking branch from 4d6ad0a to 3a84aa9 Compare March 2, 2026 06:00
@charley-oai charley-oai changed the title Make rollout reconstruction resumable for backtracking Introduce in-memory rollout source Mar 2, 2026
@charley-oai charley-oai changed the title Introduce in-memory rollout source Introduce rollout store and in-memory source Mar 2, 2026
@charley-oai
charley-oai force-pushed the cc/rollout-reconstruction-resumable-backtracking branch from f83d40f to 1c5141e Compare March 3, 2026 02:02
@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

💡 Codex Review

let source = match Self::load_source(path.as_path()).await {

P2 Badge Avoid double-loading rollout files on resume

ThreadManager::resume_thread_from_rollout already materializes the full rollout with RolloutStore::get_rollout_history before session startup. In RolloutStore::new (resume path), load_source reads/parses the same file again. Large .jsonl sessions now pay ~2x file I/O and peak memory during resume, which can noticeably slow startup or exhaust memory for long threads.

ℹ️ 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".

@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d7a0d5b7f

ℹ️ 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".

Comment thread codex-rs/core/src/codex.rs Outdated
Comment thread codex-rs/core/src/codex.rs Outdated
Comment thread codex-rs/core/src/codex.rs Outdated
@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1405b7cd52

ℹ️ 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".

Comment thread codex-rs/core/src/codex.rs Outdated
@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 45cb6d9a77

ℹ️ 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".

Comment thread codex-rs/core/src/codex.rs
@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review for no behavior change

@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review for correctness

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a163f0536b

ℹ️ 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".

Comment thread codex-rs/core/src/rollout/recorder.rs Outdated
Comment thread codex-rs/core/src/codex.rs Outdated
mzeng-openai and others added 8 commits March 10, 2026 13:16
## Summary
- add ARC monitor support for MCP tool calls by serializing MCP approval
requests into the ARC action shape and sending the relevant
conversation/policy context to the `/api/codex/safety/arc` endpoint
- route ARC outcomes back into MCP approval flow so `ask-user` falls
back to a user prompt and `steer-model` blocks the tool call, with
guardian/ARC tests covering the new request shape
- update the TUI approval copy from “Approve Once” to “Allow” / “Allow
for this session” and refresh the related
  snapshots

---------

Co-authored-by: Fouad Matin <fouad@openai.com>
Co-authored-by: Fouad Matin <169186268+fouad-openai@users.noreply.github.com>
Add forceRemoteSync to plugin/list.
When it is set to True, we will sync the local plugin status with the
remote one (backend-api/plugins/list).
#14232)

…e package

## Summary

This changes the Python SDK packaging model so we no longer commit
`codex`
binaries into `sdk/python`.

Instead, published SDK builds now depend on a separate `codex-cli-bin`
runtime
package that carries the platform-specific `codex` binary. The SDK and
runtime
can be staged together with an exact version pin, so the published
Python SDK
still resolves to a Codex version we know is compatible.

The SDK now resolves `codex` in this order:

- `AppServerConfig.codex_bin` if explicitly set
- installed `codex-cli-bin` runtime package

There is no `PATH` fallback anymore. Published installs either use the
pinned
runtime or fail loudly, and local development uses an explicit
`codex_bin`
override when working from the repo.

## What changed

- removed checked-in binaries from `sdk/python/src/codex_app_server/bin`
- changed `AppServerClient` to resolve `codex` from:
  - explicit `AppServerConfig.codex_bin`
  - installed `codex-cli-bin`
- kept `AppServerConfig.codex_bin` override support for local/dev use
- added a new `sdk/python-runtime` package template for the pinned
runtime
- updated `scripts/update_sdk_artifacts.py` to stage releasable
SDK/runtime
  packages instead of downloading binaries into the repo
- made `codex-cli-bin` build as a platform-specific wheel
- made `codex-cli-bin` wheel-only by rejecting `sdist` builds
- updated docs/tests to match the new packaging flow and explicit
local-dev
  contract

## Why

Checking in six platform binaries made the repo much heavier and tied
normal
source changes to release artifacts.

This keeps the compatibility guarantees we want, but moves them into
packaging:

- the published SDK can depend on an exact `codex-cli-bin==...`
- the runtime package carries the platform-specific binary
- users still get a pinned runtime
- the repo no longer needs to store those binaries

It also makes the runtime contract stricter and more predictable:

- published installs never silently fall back to an arbitrary `codex` on
`PATH`
- local development remains supported through explicit `codex_bin`
- `codex-cli-bin` is distributed as platform wheels only, which avoids
unsafe
source-distribution installs for a package that embeds a prebuilt binary

## Validation

- ran targeted Python SDK tests:
- `python3 -m pytest
sdk/python/tests/test_artifact_workflow_and_binaries.py
sdk/python/tests/test_client_rpc_methods.py
sdk/python/tests/test_contract_generation.py`
- exercised the staging flow with a local dummy binary to verify
SDK/runtime
  staging end to end
- verified the staged runtime package builds a platform-specific wheel
(`Root-Is-Purelib: false`) rather than a universal `py3-none-any` wheel
- added test coverage for the explicit-only runtime resolution model
- added test coverage that `codex-cli-bin` rejects `sdist` builds

---------

Co-authored-by: sdcoffey <stevendcoffey@gmail.com>
- add `model` and `reasoning_effort` to the `spawn_agent` schema so the
values pass through
- validate requested models against `model.model` and only check that
the selected model supports the requested reasoning effort

---------

Co-authored-by: Codex <noreply@openai.com>
image-gen feature will have the model saving to /tmp by default + at all
times
…Reject (#14191)

## Summary
This change makes `AskForApproval::Reject` gate correctly anywhere it
appears inside otherwise-stable app-server protocol types.

Previously, experimental gating for `approval_policy: Reject` was
handled with request-specific logic in `ClientRequest` detection. That
covered a few request params types, but it did not generalize to other
nested uses such as `ProfileV2`, `Config`, `ConfigReadResponse`, or
`ConfigRequirements`.

This PR replaces that ad hoc handling with a generic nested experimental
propagation mechanism.

## Testing

seeing this when run app-server-test-client without experimental api
enabled:
```
 initialize response: InitializeResponse { user_agent: "codex-toy-app-server/0.0.0 (Mac OS 26.3.1; arm64) vscode/2.4.36 (codex-toy-app-server; 0.0.0)" }
> {
>   "id": "50244f6a-270a-425d-ace0-e9e98205bde7",
>   "method": "thread/start",
>   "params": {
>     "approvalPolicy": {
>       "reject": {
>         "mcp_elicitations": false,
>         "request_permissions": true,
>         "rules": false,
>         "sandbox_approval": true
>       }
>     },
>     "baseInstructions": null,
>     "config": null,
>     "cwd": null,
>     "developerInstructions": null,
>     "dynamicTools": null,
>     "ephemeral": null,
>     "experimentalRawEvents": false,
>     "mockExperimentalField": null,
>     "model": null,
>     "modelProvider": null,
>     "persistExtendedHistory": false,
>     "personality": null,
>     "sandbox": null,
>     "serviceName": null
>   }
> }
< {
<   "error": {
<     "code": -32600,
<     "message": "askForApproval.reject requires experimentalApi capability"
<   },
<   "id": "50244f6a-270a-425d-ace0-e9e98205bde7"
< }
[verified] thread/start rejected approvalPolicy=Reject without experimentalApi
```

---------

Co-authored-by: celia-oai <celia@openai.com>
…de (#14236)

Summary
- drop `McpToolOutput` in favor of `CallToolResult`, moving its helpers
to keep MCP tooling focused on the final result shape
- wire the new schema definitions through code mode, context, handlers,
and spec modules so MCP tools serialize the exact output shape expected
by the model
- extend code mode tests to cover multiple MCP call scenarios and ensure
the serialized data matches the new schema
- refresh JS runner helpers and protocol models alongside the schema
changes

Testing
- Not run (not requested)
@charley-oai

Copy link
Copy Markdown
Contributor Author

@codex review this

charley-oai and others added 14 commits March 10, 2026 15:37
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Reinstate main's deferred rollout persistence behavior while keeping the shared rollout source groundwork. Materialize the rollout on first persisted user-visible activity, restore app-server's unmaterialized-thread handling, and keep in-memory rollout state aligned with persisted session metadata.

Co-authored-by: Codex <noreply@openai.com>
Borrow the in-memory rollout source when reconstructing resumed history, tool selection, and token usage instead of cloning the full rollout into a second buffer during startup.

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@charley-oai
charley-oai force-pushed the cc/rollout-reconstruction-resumable-backtracking branch from d969369 to 6e2682f Compare March 10, 2026 22:39
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

charley-oai and others added 2 commits March 10, 2026 17:06
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
@nidhishgajjar

Copy link
Copy Markdown

Orb Code Review (powered by GLM-4.7 on Orb Cloud)

Summary

This is a substantial architectural refactoring that introduces an in-memory rollout source system and renames RolloutRecorder to RolloutStore. The changes enable better management of rollout data by keeping it in memory until explicitly persisted, reducing I/O and improving performance. The PR also adds remote synchronization capabilities for plugin marketplaces.

Architecture

Major Changes:

  • Renamed RolloutRecorder → RolloutStore (breaking change)
  • Renamed RolloutRecorderParams → RolloutStoreParams (breaking change)
  • Added in-memory RolloutSource to store structure
  • Introduced resume_with_source() to avoid re-reading rollout files
  • Changed fresh session behavior: buffered in memory until explicit persist() call
  • Added forceRemoteSync parameter for plugin marketplace reconciliation
  • Added remoteSyncError field to plugin marketplace entries
  • Updated rollout_path descriptions to clarify timing

Architecture Quality:

  • ✅ Clear separation between in-memory and persistent storage
  • ✅ Reduces I/O operations for fresh sessions
  • ✅ Maintains backward compatibility through resume paths
  • ✅ Proper queue ordering with queue_order: Arc<Mutex<()>>
  • ✅ Canonical in-memory source shared across operations

Issues Found

Breaking Changes:

  1. Public API Changes: Renaming RolloutRecorder to RolloutStore and RolloutRecorderParams to RolloutStoreParams are breaking changes. Ensure all callers are updated.

  2. Behavior Change: Fresh sessions now buffer in memory until persist() call. This changes the timing of when data is written to disk.

Major Concerns:

  1. Data Loss Risk: If the process crashes before persist() is called, fresh session data could be lost. Consider:

    • Auto-persist on critical operations
    • Warning users about in-memory state
    • Adding a force_persist() method
  2. Memory Usage: Keeping rollouts in memory could increase memory usage significantly for long sessions. Monitor memory impact.

  3. Race Conditions: The queue_order: Arc<Mutex<()>> approach is clever but unusual. Ensure this properly serializes access across all operations.

Minor Considerations:

  1. Testing: With 22,774 lines of changes, ensure comprehensive testing:

    • Unit tests for in-memory source behavior
    • Integration tests for persist/recovery flows
    • Tests for crash recovery scenarios
    • Performance tests for I/O reduction
  2. Documentation: Update all documentation referencing the old RolloutRecorder name.

  3. Migration Path: Consider adding a compatibility shim or migration guide for the API changes.

  4. Error Handling: Ensure proper error handling when persist() fails after in-memory buffering.

Positive Aspects:

  • ✅ Reduces I/O operations for performance
  • ✅ Clean separation of in-memory and persistent storage
  • ✅ Proper source of truth management
  • ✅ Comprehensive schema updates
  • ✅ Remote sync capabilities for marketplaces
  • ✅ Better error reporting with remoteSyncError

Cross-file Impact

Impact:

  • ⚠️ Breaking API changes require updating all callers
  • ⚠️ Behavior change for fresh session persistence timing
  • ⚠️ Large diff makes review challenging - consider splitting
  • ✅ Comprehensive schema updates across multiple files
  • ✅ Plugin marketplace improvements are valuable

Integration:

  • ⚠️ Ensure all code using RolloutRecorder is updated
  • ⚠️ Verify plugin marketplace remote sync works correctly
  • ✅ Schema changes are properly propagated

Security & Performance

Security:

  • ⚠️ In-memory buffering could increase attack surface for memory disclosure
  • ✅ No obvious security vulnerabilities introduced

Performance:

  • ✅ Reduced I/O for fresh sessions
  • ✅ In-memory operations are faster than disk I/O
  • ⚠️ Increased memory usage for large rollouts
  • ⚠️ Potential memory pressure with many concurrent sessions

Assessment

Overall: Significant architectural improvement, needs careful review and testing

This is a major refactoring that introduces valuable improvements but also carries risks due to breaking changes and new behavior. The architectural direction is sound, but the size and scope of changes make thorough review essential.

Recommendation: Request changes - split PR and address concerns

Given the scope (22,774 lines), consider:

  1. Splitting into smaller, focused PRs
  2. Adding comprehensive test coverage
  3. Documenting breaking changes clearly
  4. Adding safeguards against data loss
  5. Performance testing for memory impact

Required Actions:

  1. Add crash recovery tests
  2. Document breaking changes
  3. Add auto-persist or warning mechanism
  4. Consider splitting into smaller PRs
  5. Add performance benchmarks
  6. Verify all callers updated

Next Steps:

  1. Consider splitting into multiple PRs
  2. Add comprehensive test coverage
  3. Document migration path
  4. Add data loss prevention mechanisms
  5. Performance testing
  6. Security review of in-memory storage

This PR has excellent architectural goals but needs more careful handling of the scope and risks involved.

@nidhishgajjar

Copy link
Copy Markdown

Orb Code Review (powered by GLM-4.7 on Orb Cloud)

Summary

This is a substantial architectural refactoring that introduces rollout store and in-memory source management for the Codex application. The PR renames RolloutRecorder to RolloutStore, adds in-memory rollout source capabilities, and changes the persistence model so fresh sessions keep rollout buffered in memory until explicit persist() calls.

Architecture

Major Changes:

  • Renamed RolloutRecorder → RolloutStore
  • Renamed RolloutRecorderParams → RolloutStoreParams
  • Added InMemoryRolloutSource as canonical in-memory rollout representation
  • Added source field to store in-memory rollout items and session metadata
  • Added queue_order mutex for serialization
  • New resume_with_source() method to avoid re-reading rollout files
  • Changed persistence model: fresh sessions buffered in memory until explicit persist()
  • Added forceRemoteSync parameter for plugin marketplace reconciliation
  • Enhanced rollout_path descriptions to clarify async file materialization

Design Goals:

  • Reduce disk I/O by keeping rollouts in memory when possible
  • Enable faster startup by preloading rollout sources
  • Improve consistency between replay and writer views
  • Support async rollout file materialization for fresh persistent threads

Issues Found

Major Concerns:

  1. Breaking Changes: This PR makes significant breaking changes:

    • Renamed core types (RolloutRecorder → RolloutStore)
    • Changed API signatures
    • Modified persistence behavior
    • Requires comprehensive updates across the codebase
  2. Testing Coverage: Given the scope (22,774 lines), ensure:

    • Comprehensive unit tests for new in-memory source behavior
    • Integration tests for the new persistence model
    • Migration tests for existing rollout files
    • Performance benchmarks for memory vs disk I/O tradeoffs
  3. Memory Management: The in-memory source approach increases memory usage:

    • What's the memory footprint for large rollout histories?
    • Are there memory limits or cleanup policies?
    • What happens if memory becomes constrained?
  4. Data Consistency: Complex synchronization between in-memory and on-disk state:

    • What happens if process crashes before persist() is called?
    • How are conflicts resolved between in-memory and disk state?
    • Is there data loss risk during async materialization?

Positive Aspects:

  • ✅ Well-Designed Architecture: Clear separation of in-memory and persisted state
  • ✅ Performance Focus: Addresses real performance bottlenecks with disk I/O
  • ✅ Flexibility: resume_with_source() enables optimized startup paths
  • ✅ Documentation: Enhanced schema descriptions clarify async behavior
  • ✅ Plugin Marketplace: forceRemoteSync improves marketplace consistency

Implementation Observations:

  1. Thread Safety: Proper use of Arc<Mutex<>> for concurrent access
  2. Backward Compatibility: resume() method still works without source parameter
  3. Schema Updates: Consistent updates across all schema files
  4. Error Handling: Considered async file materialization in descriptions

Cross-file Impact

Impact:

  • ⚠️ Extensive: Changes affect core rollout infrastructure
  • ⚠️ Breaking: Type renames and API changes affect all consumers
  • ⚠️ Schema Changes: Protocol schema updates affect client compatibility
  • ✅ Isolated: Rollout-specific changes, minimal external impact

Integration:

  • ✅ Clean separation of concerns in the rollout store
  • ✅ Consistent with existing async patterns
  • ⚠️ Requires comprehensive testing of migration paths

Security & Performance

Security:

  • ✅ No new security vulnerabilities introduced
  • ✅ Proper memory synchronization with mutexes
  • ⚠️ Ensure in-memory sources don't expose sensitive data unexpectedly

Performance:

  • ✅ Major Improvements: Reduced disk I/O, faster startup
  • ✅ Efficient Caching: In-memory sources eliminate redundant reads
  • ⚠️ Memory Tradeoff: Increased memory usage for large rollouts
  • ⚠️ Async Complexity: Async file materialization adds complexity

Assessment

Overall: Major architectural improvement requiring careful validation

This is a well-designed but substantial architectural change that addresses real performance issues. However, the breaking changes and scope require thorough validation.

Recommendation: Request extensive testing before merging

Before merging, ensure:

  1. Comprehensive Testing: Full test coverage including edge cases
  2. Migration Testing: Verify existing rollout files work correctly
  3. Performance Validation: Measure actual performance improvements
  4. Memory Profiling: Validate memory usage is acceptable
  5. Documentation: Update migration guides for API changes
  6. Backward Compatibility: Ensure smooth transition for existing users

Required Actions:

  1. Add comprehensive unit tests for InMemoryRolloutSource
  2. Add integration tests for new persistence model
  3. Performance benchmarks comparing old vs new implementation
  4. Memory profiling with realistic workload data
  5. Migration testing with existing rollout files
  6. Update API documentation and migration guides

Strengths:

  • Addresses real performance bottlenecks
  • Well-designed architecture
  • Clean separation of concerns
  • Proper thread safety
  • Enhanced documentation

Risks:

  • Breaking changes affect many consumers
  • Increased memory usage
  • Complex state synchronization
  • Potential data loss during crashes
  • Extensive testing required

Next Steps:

  1. Complete comprehensive testing suite
  2. Performance and memory profiling
  3. Migration testing and documentation
  4. Gradual rollout with monitoring
  5. Merge once confidence is high

This is a significant improvement that requires careful validation due to its scope and breaking changes.

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.