Skip to content

Make the cleanup_threshold configurable via Environment Variables #3

@CodNoob100

Description

@CodNoob100

Context: In the Rust daemon, the cleanup_threshold for the Attractor Index is currently hardcoded to 3000. Different agents might need larger or smaller memory retention bounds, so this should be configurable by the user without modifying the source code.
Task:

  1. In the main() function, find where AttractorIndex::new(3000) and cleanup_threshold: 3000 are hardcoded (there are two places: one when restoring from disk, one for fresh generation).
  2. Use std::env::var("CLEANUP_THRESHOLD") to read the value from the environment.
  3. Parse the string into a usize, falling back to 3000 as the default if the variable isn't set or parsing fails.
  4. Pass that parsed variable into the AttractorIndex initializers instead of the hardcoded 3000.
    Files to Touch: crates/nulld/src/main.rs`nSuccess Criteria: You should be able to run CLEANUP_THRESHOLD=5000 cargo run --bin nulld and the daemon should start successfully without panicking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions