Repository navigation
feat(persona): service_module batched cutover via analyze_burst (task #249) - #1598
Conversation
|
SENTINEL VERDICT: APPROVE (producer-pays self-review) Adversarial self-review per producer-pays. This is the production wiring slice of #1597's demand-pull cognition; the changes are narrow, doctrinally consistent, and test-pinned. What's structurally right:
Five non-blocking findings:
Smaller PR than #1597, smaller review. Ship it after the stack-retarget mechanic in finding #1. |
… analyze_burst (task #249) Production wiring for the demand-pull cognition doctrine that PR #1597 landed at the substrate seam. `PersonaServiceModule::service_burst_for` replaces the per-item `service_once_for` path: - ONE call per persona per tick drains every channel's coherent burst via `ChannelRegistry::service_cycle_batched` and runs cognition's `analyze_burst` per burst. Per `[[cognition-batches-per-channel- adapter]]`: one gate decision per channel-tick, not per item. A burst aggregating N chat messages = ONE inference dispatch. - `ServiceBurstDecision` replaces `ServicePopDecision`: `Silent | NeedsResponse | UnsupportedDomain`. Non-Chat bursts surface as `UnsupportedDomain` (typed view not yet implemented) rather than silently dropping per `[[no-fallbacks-ever]]`. - `build_respond_input_from_burst` replaces the per-item `build_respond_input`; reads `BurstRespondContext.aggregated_content` + `room_id`, anchors `message_id` at burst granularity. - `drain_all_personas` loses the `while drained < MAX_DRAIN_PER_TICK` item-counting loop — replaced by a Vec iterator over the bursts service_burst_for returned. Per-tick work is naturally bounded by the number of active `ActivityDomain`s (4), not an arbitrary item cap. Lock discipline preserved: brief lock around the sync drain, drop, await respond, brief lock to update CB. - Dead code removed: `MAX_DRAIN_PER_TICK`, `ChatItemWire`, `ServiceOnceOutcome` (was never consumed by a caller — only defined). Per `[[organization-purity-as-we-migrate]]`. Tests updated: - service_burst_for_idle_returns_empty_vec (pins zero-work to zero bursts, not "one burst with empty content") - service_burst_for_dispatches_chat_burst_through_analyze_burst (pins one item to one Chat burst to NeedsResponse with config flowing through + aggregated_content carrying burst text) - drain_handles_large_burst_without_tripping_cb (replaces the MAX_DRAIN_PER_TICK item-count test — new contract is "many items consolidate into a coherent burst; CB stays clean") - Existing CB / responder-DI tests unchanged in shape; comments rewritten to reference `analyze_burst` instead of `full_evaluate` and the new break-on-inference-error semantics. 24/24 service_module tests + 777/777 persona:: tests green. Stacks on PR #1597 (analyze_burst + service_cycle_batched seams). Co-Authored-By: Claude Opus 4.7 <[email protected]>
…m in-tree doc comments The `airc_chat_demo` binary is gone (deleted with task #137's reshape); the `service_module::service_once_for` symbol is gone (replaced by `service_burst_for` in the prior commit). Six doc comments still named them as load-bearing examples — that's misleading for anyone navigating the substrate. Rewrites the comments to reference what's actually in tree: - `persona/host.rs`: `spawn_persona_service` users → "supervisor and integration tests" - `persona/airc_persona_conversation.rs`: live-stream-lag handling rationale → `[[no-fallbacks-ever]]` doctrine link (the binary reference was always derivative) - `persona/spawner_module.rs`: "demo binary's main today" → "originally inlined per-persona; slice 9 factored it out for production boot + tests" - `persona/service_loop.rs` (3 sites): `airc_chat_demo` direct caller → "integration tests"; the bin/line ref in the test docstring → the doctrine name - `persona/channel_registry.rs` (2 sites): `service_cycle` legacy surface now correctly points at `service_module::service_burst_for` as the production cutover (task #249), with `service_cycle` retained for the parity-architecture-proof test and `modules/channel` paths - `persona/channel_view.rs`: Delta 5 `service_cycle` rewrite reference → `analyze_burst` + `service_burst_for` (the production seams that actually shipped) Comment-only change. Zero behavioral delta. `cargo check -p continuum-core --features metal,accelerate` green. Co-Authored-By: Claude Opus 4.7 <[email protected]>
8ce9f90 to
9f287c3
Compare
…pen special cases (card f878fb9a) Serves the residents directly (plan: order of work, "every fast-path miss loud" / the act gate): a card reopened under its holder left her holding work the board showed Open. Atlas and 4c9bb8d9 on the M5 renewed claims on SWE cards she could not act on (card 12afbb2f). airc #1598 fixes the owner: its projection now ends the claim on any transition to Open, so continuum stops patching around it. - airc pin 44478af -> 2666f36 (#1592, #1594-#1598; the Cargo.toml note lists each). Cargo.lock changes only the rev; `cargo metadata` resolved with no other change. - work_create: delete release_live_claim_on_reopen. Its release is now a no-op on the projection (the claim already ended). The bench round's settled mark is still cleared on reopen. - work_focus::actionable: revert #5248's Open arm and its test. An Open card can no longer be in her held set, because the held set is the board's live claims. - release_live_claim_on_reopen.rs held four verbs after the #5245 split. Each moves to its own file, as a pure move (checked with a multiset diff: the only lines without a match are the deleted function, the deleted call and its comment, the mod/use wiring, and one `use super::*;` per new file): work_note.rs, work_heartbeat.rs, work_list.rs; the work/similar types join their impl in work_similar.rs (644 lines). - identity/mod.rs: the loose-card-id allowlist names the new files. - card_holder: the comment says Open no longer carries a claim. Net: 397 lines removed, 332 added (git --numstat). Git reads the move as a rename, release_live_claim_on_reopen.rs -> work_list.rs, plus the new files; the real deletions are the release function (~45 lines) and #5248's Open arm and test (29). source-hygiene 43/43 on IntelMac. The core isn't compiled here (serving node); CI compiles it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE
…pen special cases (card f878fb9a) (#5256) Serves the residents directly (plan: order of work, "every fast-path miss loud" / the act gate): a card reopened under its holder left her holding work the board showed Open. Atlas and 4c9bb8d9 on the M5 renewed claims on SWE cards she could not act on (card 12afbb2f). airc #1598 fixes the owner: its projection now ends the claim on any transition to Open, so continuum stops patching around it. - airc pin 44478af -> 2666f36 (#1592, #1594-#1598; the Cargo.toml note lists each). Cargo.lock changes only the rev; `cargo metadata` resolved with no other change. - work_create: delete release_live_claim_on_reopen. Its release is now a no-op on the projection (the claim already ended). The bench round's settled mark is still cleared on reopen. - work_focus::actionable: revert #5248's Open arm and its test. An Open card can no longer be in her held set, because the held set is the board's live claims. - release_live_claim_on_reopen.rs held four verbs after the #5245 split. Each moves to its own file, as a pure move (checked with a multiset diff: the only lines without a match are the deleted function, the deleted call and its comment, the mod/use wiring, and one `use super::*;` per new file): work_note.rs, work_heartbeat.rs, work_list.rs; the work/similar types join their impl in work_similar.rs (644 lines). - identity/mod.rs: the loose-card-id allowlist names the new files. - card_holder: the comment says Open no longer carries a claim. Net: 397 lines removed, 332 added (git --numstat). Git reads the move as a rename, release_live_claim_on_reopen.rs -> work_list.rs, plus the new files; the real deletions are the release function (~45 lines) and #5248's Open arm and test (29). source-hygiene 43/43 on IntelMac. The core isn't compiled here (serving node); CI compiles it. Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Summary
Production wiring for the demand-pull cognition doctrine PR #1597 landed at the substrate seam.
PersonaServiceModule::service_burst_forreplaces the per-itemservice_once_forpath: ONE call per persona per tick drains every channel's coherent burst viaChannelRegistry::service_cycle_batchedand runs cognition'sanalyze_burstper burst.Stacks on #1597 (base =
feat/channel-adapter-batch-cognition). Auto-rebases to canary once #1597 merges.Theme — Demand-pull cognition cutover (task #249)
Per
[[cognition-batches-per-channel-adapter]]: one gate decision per channel-tick, not per item. A burst aggregating N chat messages = ONE inference dispatch.ServiceBurstDecisionreplacesServicePopDecision:Silent | NeedsResponse | UnsupportedDomain. Non-Chat bursts surface asUnsupportedDomain(typed view not yet implemented) rather than silently dropping per[[no-fallbacks-ever]].build_respond_input_from_burstreplaces the per-itembuild_respond_input; readsBurstRespondContext.aggregated_content+room_id, anchorsmessage_idat burst granularity.drain_all_personasloses thewhile drained < MAX_DRAIN_PER_TICKitem-counting loop — replaced by a Vec iterator over the burstsservice_burst_forreturned. Per-tick work is naturally bounded by the number of activeActivityDomains (4), not an arbitrary item cap. Lock discipline preserved: brief lock around the sync drain, drop, await respond, brief lock to update CB.MAX_DRAIN_PER_TICK,ChatItemWire,ServiceOnceOutcome(was never consumed by a caller). Per[[organization-purity-as-we-migrate]].Theme — Stale doc-refs cleanup
The
airc_chat_demobinary is gone (deleted with task #137's reshape);service_module::service_once_foris gone (this PR). Six doc comments still named them as load-bearing examples — that's misleading for navigators.Rewrites the references in
host.rs,airc_persona_conversation.rs,spawner_module.rs,service_loop.rs(3 sites),channel_registry.rs(2 sites), andchannel_view.rsto point at what's actually in tree (service_burst_for,analyze_burst, integration tests).Task #245 deferred
ChatItem::embedding()still routes through the placeholder pure-decoder, not the realEmbeddingModule. Architectural read: makingembedding()async to route throughEmbeddingModulecascades toOnceLock→tokio::sync::OnceCell,ChatChannelView::interpret,interpret_for_domain, andservice_cycle_batched— a substantive shape change to the lazy cell PR #1597 just landed.burst_embeddinghas no production consumer today (doctrine-witness tests only), so the right slice is a follow-up after #1597 merges, with the async cascade designed cleanly against a stable canary baseline. Tracked as task #245.Doctrines anchoring this PR
[[cognition-batches-per-channel-adapter]]— one analyze per channel-tick[[no-fallbacks-ever]]—UnsupportedDomainsurfaces non-Chat bursts; analyze_burst's typed contract (should_respond⇒respond_context = Some) is enforced at the seam[[organization-purity-as-we-migrate]]— dead code (MAX_DRAIN_PER_TICK,ChatItemWire,ServiceOnceOutcome) deleted as we touch the fileArchitecture docs
docs/architecture/PERSONA-COGNITION-PIPELINE.md— what a persona IS + the cognition cycledocs/architecture/CONCURRENCY-STYLE-GUIDE.md— RTOS shape every ServiceModule inheritsTest plan
cargo check -p continuum-core --features metal,accelerateclean (69 warnings, 0 errors)cargo test -p continuum-core --features metal,accelerate --lib persona::service_module— 24/24 greencargo test -p continuum-core --features metal,accelerate --lib persona::— 777/777 greenservice_burst_for_idle_returns_empty_vec,service_burst_for_dispatches_chat_burst_through_analyze_burst,drain_handles_large_burst_without_tripping_cb