stream: LF again; the stale boundary docs name the label as the gap's origin
Restores LF on stream.rs, stream/tests.rs and bin/mind-stream.rs (5defa18 converted them). Renames the capped-repo test for the rule built; build_seed's since is the newest thought's label tick time; STREAM_MIN_GAP_S counts from the label, so a model run of M seconds leaves 900 - M s of quiet after admission. No behaviour change.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2f77fb2c50
commit
e2e0488abb
3 changed files with 1616 additions and 1614 deletions
|
|
@ -34,7 +34,9 @@ use crate::recall::{self, Cue};
|
||||||
|
|
||||||
pub const AGENT: &str = "mind-stream";
|
pub const AGENT: &str = "mind-stream";
|
||||||
|
|
||||||
/// No tick sooner than this after her newest thought, whatever has happened.
|
/// No tick sooner than this after her newest thought, whatever has happened. The gap counts from the thought's label
|
||||||
|
/// (the tick time it was made for), not from its admission: a model run of M seconds leaves `STREAM_MIN_GAP_S - M`
|
||||||
|
/// seconds of quiet after the thought is admitted.
|
||||||
pub const STREAM_MIN_GAP_S: i64 = 900;
|
pub const STREAM_MIN_GAP_S: i64 = 900;
|
||||||
/// How often the stream process polls: the unit in which a poll "crosses" a `STREAM_MIN_GAP_S` mark.
|
/// How often the stream process polls: the unit in which a poll "crosses" a `STREAM_MIN_GAP_S` mark.
|
||||||
pub const STREAM_POLL_S: i64 = 60;
|
pub const STREAM_POLL_S: i64 = 60;
|
||||||
|
|
@ -400,7 +402,7 @@ fn unbidden(mind: &dyn MindPort, instance: &Slug, now: DateTime<Utc>, pick: u64)
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The seed, rebuilt from her mind and nothing else. `since` is her newest thought's admission and `fresh` what `news` found.
|
/// The seed, rebuilt from her mind and nothing else. `since` is her newest thought's label tick time (never later than its admission) and `fresh` what `news` found.
|
||||||
fn build_seed(mind: &dyn MindPort, persona: &PersonaRead, since: Option<DateTime<Utc>>, now: DateTime<Utc>, responsibilities: &Responsibilities, fresh: Vec<(String, Option<PipelineRef>)>) -> Result<Seed> {
|
fn build_seed(mind: &dyn MindPort, persona: &PersonaRead, since: Option<DateTime<Utc>>, now: DateTime<Utc>, responsibilities: &Responsibilities, fresh: Vec<(String, Option<PipelineRef>)>) -> Result<Seed> {
|
||||||
let instance = mind.instance().clone();
|
let instance = mind.instance().clone();
|
||||||
let state = &persona.state;
|
let state = &persona.state;
|
||||||
|
|
|
||||||
|
|
@ -688,7 +688,7 @@ fn repo_activity_is_news_only_after_her_newest_thought_and_is_stamped_when_it_ha
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn a_capped_repo_is_news_only_beside_an_event_after_her_newest_thought() {
|
fn a_capped_repo_is_news_only_beside_a_forge_event_after_her_newest_thoughts_label() {
|
||||||
let mind = mind_with_thought(1000);
|
let mind = mind_with_thought(1000);
|
||||||
let read = PersonaRead { state: state(), receipt_id: "r".into() };
|
let read = PersonaRead { state: state(), receipt_id: "r".into() };
|
||||||
let mut quiet = Wrap::over(&mind, &[]).with_forge(vec![push(1, 500)]);
|
let mut quiet = Wrap::over(&mind, &[]).with_forge(vec![push(1, 500)]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue