Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
862ba45
Persist background task acceptance and terminal receipts
joelteply Oct 29, 2026
b355c06
Retain dispatch effect classification in durable failures
joelteply Oct 29, 2026
9dc011e
Project task completion from the durable terminal winner
joelteply Oct 29, 2026
70bc97e
Exercise durable completion after a handler unwinds
joelteply Oct 29, 2026
c278903
test(kernel): pin terminal arbitration across cancelled storage writes
joelteply Oct 29, 2026
19147f4
test(kernel): keep task race regression in the single test module
joelteply Oct 29, 2026
29c9ffe
feat(tasks): centralize owner consumption before acknowledgement
joelteply Oct 30, 2026
a52865f
Persist owner task references and wake obligations through resident c…
joelteply Oct 30, 2026
982a883
Connect resident checkpoint consumption to ledger delivery contract
joelteply Oct 30, 2026
1eedcea
Reconcile durable task pages through resident checkpoint publication
joelteply Oct 30, 2026
15a93ea
Merge remote-tracking branch 'origin/canary' into codex/task-lifecycle
joelteply Oct 30, 2026
2e1fc87
Mark resident task fixtures as test-only for dependency ratchet
joelteply Oct 30, 2026
9a557e2
Publish task wake retirement only after durable checkpoint
joelteply Oct 30, 2026
d98fe29
Bind durable task read receipts to the registered memory incarnation
joelteply Oct 30, 2026
6dcdb53
WIP (not pushed): working memory sizes from the one owner, WorkingMem…
joelteply Oct 31, 2026
91202b8
WM slice: drop the because-clause from results (Fable approved); open…
joelteply Oct 31, 2026
8c01588
WM slice: vitals gauge percentage saturates without a literal clamp; …
joelteply Oct 31, 2026
9cd28b1
WM slice: no backwards compatibility (Joel 2026-10-31: 'This is the f…
joelteply Oct 31, 2026
61e6b55
WM slice: observation::call_args, the one argument renderer (Observat…
joelteply Oct 31, 2026
895e6e7
WM slice: the provenance test stops asserting the old checkpoint tupl…
joelteply Oct 31, 2026
39ed38f
WM slice: recent_results stays until checkpoint adoption moves onto i…
joelteply Oct 31, 2026
fe7c4fc
The render receipt: what each served prompt showed her, in order, at …
joelteply Oct 31, 2026
d94939b
WM slice: no retirement by order (Codex on #5637). A finished dispatc…
joelteply Oct 31, 2026
2171100
render receipt: Level gets its own module (levels.rs untouched); the …
joelteply Oct 31, 2026
10ebf1f
Integrate submitted render receipts with task memory incarnation
joelteply Oct 31, 2026
2f00316
Epoch::observe: identical bytes that now stand for another occurrence…
joelteply Oct 31, 2026
70352f5
Her tasks are their own view source: one leveled item per task, keyed…
joelteply Oct 31, 2026
e31cd5b
tasks ride with the sources that change within an epoch (after though…
joelteply Oct 31, 2026
a1f5fe8
Cover refused render read batches and shutdown delivery retention
joelteply Oct 31, 2026
f12f68f
Merge commit '2f003160ce' into codex/task-lifecycle
joelteply Oct 31, 2026
1d46580
Return submitted render receipts through the owned workspace result
joelteply Oct 31, 2026
f8ba142
Keep truncated generation bodies out of fault summaries
joelteply Oct 31, 2026
48b304f
Integrate the task context source and remove duplicate dispatch rende…
joelteply Oct 31, 2026
45aa58a
Project durable terminal facts through the task source and match rend…
joelteply Oct 31, 2026
afe6406
Retire durably read terminal projections without repeat checkpoint wr…
joelteply Oct 31, 2026
2235fe4
Remove empty task source after durable terminal consumption
joelteply Oct 31, 2026
d797735
Share awaited checkpoint execution for task ends and rendered receipts
joelteply Oct 31, 2026
668402d
Bind task receipt custody to the assembled resident cycle
joelteply Oct 31, 2026
f78096c
Persist rendered task receipts before settlement effects and type fai…
joelteply Oct 31, 2026
d4bfd6c
Preserve distinct failure causes in lived experience grading
joelteply Oct 31, 2026
79778b8
Preserve inbound obligation custody on receipt checkpoint failure
joelteply Oct 31, 2026
3f6f0de
Qualify shared checkpoint failure ownership type
joelteply Oct 31, 2026
10f801f
Preserve complete failure evidence and persona identifiers
joelteply Oct 31, 2026
40b8470
Submit whole failed build observations to shared context allocation
joelteply Oct 31, 2026
24d7176
fix(inference): separate admission expiry from generation prediction
joelteply Oct 31, 2026
15e17fe
test(inference): finish simulated generation before successor admission
joelteply Oct 31, 2026
5574140
refactor(tasks): preserve nonzero page contract through storage
joelteply Oct 31, 2026
0a76c6d
fix(tasks): acknowledge only checkpointed perception receipts
joelteply Oct 31, 2026
4141337
merge canary task rendering and memory contracts into task lifecycle
joelteply Oct 31, 2026
0da6e8e
fix(tasks): render durable ends with the shared task line
joelteply Oct 31, 2026
44493e5
fix(academy): retain complete answers for grade-time lessons
joelteply Oct 31, 2026
627d17f
fix(tests): remove obsolete Faculty import after canary merge
joelteply Oct 31, 2026
4656b9a
Remove independent heuristic echo clipping and digest truncation
joelteply Oct 31, 2026
87d7bbf
fix(cognition): use shared gateway admission for responses
joelteply Oct 31, 2026
17e8326
fix(protocol): match executed response binding export
joelteply Oct 31, 2026
8b66ddf
test(core): remove retired response admission ID declarations
joelteply Oct 31, 2026
1919966
Merge commit '5ee2053955ceb1e0cac38591613fb5f1ea191dd2' into codex/ta…
joelteply Oct 31, 2026
1773b1b
test(cognition): repeated task receipt cannot acknowledge an end
joelteply Oct 31, 2026
3ad42bf
A checkpoint's context view is derived: one that no longer decodes is…
joelteply Oct 31, 2026
4cddddc
The regression test reproduces the outage exactly: a real serialized …
joelteply Oct 31, 2026
5043dcb
Merge commit '4cddddc35aeac4313a18b53f0325425df55c49b2' into codex/ta…
joelteply Oct 31, 2026
e6c5d4c
test(cognition): preserve pending task custody across view invalidation
joelteply Oct 31, 2026
79ddda0
Derived view decoded from its exact text (RawValue), never through se…
joelteply Oct 31, 2026
1ce79cb
Merge commit '79ddda0fc1dbcf0c3a24ae896ff1e8da41207ba3' into codex/ta…
joelteply Oct 31, 2026
d4aee66
fix(tasks): keep acceptance with execution when caller drops
joelteply Oct 31, 2026
aac2306
merge: integrate canary checkpoint and cognition changes into tasks
joelteply Oct 31, 2026
12ec595
fix(tasks): remove unused runtime import after canary merge
joelteply Nov 1, 2026
ab7dbb6
Retain shared admission custody across background task persistence
joelteply Nov 1, 2026
878e60b
Withhold module shutdown until background custody settles
joelteply Nov 1, 2026
637f542
Allow owned shutdown to retry after withheld task custody
joelteply Nov 1, 2026
4f382a9
Prove shutdown custody across paused acceptance and terminal writes
joelteply Nov 1, 2026
8176653
Reject process exit while task custody remains unresolved
joelteply Nov 1, 2026
15ec55d
Withhold signal exit until background custody settles
joelteply Nov 1, 2026
88d7ec3
Clarify acceptance custody and shutdown contract
joelteply Nov 1, 2026
fb8f32a
Refuse self-shutdown within admitted task custody
joelteply Nov 1, 2026
1b382b8
Retain unresolved persistence after execution owner unwinds
joelteply Nov 1, 2026
bab6c1b
test(tasks): assert unresolved custody outcome instead of stale prose
joelteply Nov 1, 2026
172bf9d
test(tasks): prove terminal storage unwind withholds completion and s…
joelteply Nov 1, 2026
18b707b
refactor(runtime): consolidate custody tests under one test module
joelteply Nov 1, 2026
b697556
refactor(admission): delete unused private resource lease gate
joelteply Nov 1, 2026
467e3d9
fix(tasks): retain unresolved custody after acceptance storage errors
joelteply Nov 1, 2026
a158b65
fix(tasks): resolve lost acceptance acknowledgement from exact durabl…
joelteply Nov 1, 2026
17b72b0
test(tasks): preserve custody when acceptance readback fails
joelteply Nov 1, 2026
8ba457c
fix(process): refuse indeterminate Windows process observation
joelteply Nov 1, 2026
318e774
test(tasks): prove terminal and delivery reply-loss recovery
joelteply Nov 1, 2026
6be3620
feat(tasks): persist executor incarnation with task acceptance
joelteply Nov 1, 2026
bed8690
refactor(cognition): share registered owner checkpoint boundary
joelteply Nov 1, 2026
3e8e98e
Merge canary and preserve selected-cycle receipt custody
joelteply Nov 1, 2026
5caa7f9
fix(mind): bind replay sweep fixtures to executor incarnation
joelteply Nov 1, 2026
fca4dd4
test(custody): carry durability faults into checkpoint workers
joelteply Nov 2, 2026
7182603
refactor(custody): move checkpoints and adoption into personas disk c…
joelteply Nov 2, 2026
eae44a5
fix(cognition): resolve checkpoint custody and carry seam fault fixtures
joelteply Nov 2, 2026
325b051
fix(stage): stamp provenance from the owned run and inputs
joelteply Nov 2, 2026
20cd743
fix(stage): avoid shadowing the publication test helper
joelteply Nov 2, 2026
fd63f4a
fix(tasks): fence terminal publication to accepted execution incarnation
joelteply Nov 2, 2026
e86d69a
fix(tasks): expose typed execution mismatch for completion reconcilia…
joelteply Nov 2, 2026
ba87a21
fix(tasks): distinguish unreadable acceptance from authorization refusal
joelteply Nov 2, 2026
5f4a450
test(tasks): inject acceptance failure through query owner
joelteply Nov 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions core/continuum-academy/src/cognition/eval/default_eval_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,6 @@ where
/// step over — the living persona's lane.
pub(super) const EVAL_LANE_BASE_PORT: u16 = 58_200;

/// How much of a graded answer to persist in the result. A coder answer (code + reasoning)
/// fits far under this; the generous bound exists ONLY to cap a pathological loop-to-length
/// generation (which is captured up to here, still a diagnosable signal). The old 200-char
/// cap stored only the preamble and blinded every failure diagnosis + correction-corpus mine.
// context-budget-exempt: observability: how much of an answer is CAPTURED into the run ledger for humans, never text sent to a model
pub(super) const ANSWER_CAPTURE_CHARS: usize = 24_000;

/// Per-task detail retained in the DURABLE run ledger row (`append_progress_ledger`).
/// The ledger stored only the summary (score/total), so a detached run's per-task
/// verdicts were unrecoverable — a webdev pass/fail could not be glass-boxed after the
Expand Down
8 changes: 4 additions & 4 deletions core/continuum-academy/src/cognition/eval/eval_settle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ pub(super) async fn run_pass_team(
// number. Threading the full re-verify+retry into the two-solver loop is a scoped
// follow-up. [[proctored-exam-session-dependable-benchmark]]
if let Some(cause) = r
.inference_error
.failure
.clone()
.or_else(|| w.inference_error.clone())
.or_else(|| w.failure.clone())
{
infra_faults += 1;
if infra_reason.is_none() {
Expand All @@ -116,7 +116,7 @@ pub(super) async fn run_pass_team(
results.push(EvalTaskResult {
id: t.id.clone(),
ok: false,
grade: format!("infra unavailable (lane never recovered): {cause}"),
grade: format!("settlement infrastructure unavailable: {cause}"),
acts: 0,
answer: String::new(),
latency_ms: 0,
Expand Down Expand Up @@ -180,7 +180,7 @@ pub(super) async fn run_pass_team(
ok,
grade,
acts,
answer: answer.chars().take(ANSWER_CAPTURE_CHARS).collect(),
answer,
latency_ms: m.latency_ms,
output_tokens: m.output_tokens,
tokens_per_second: m.tokens_per_second(),
Expand Down
8 changes: 4 additions & 4 deletions core/continuum-academy/src/cognition/eval/eval_task_result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ pub struct EvalTaskResult {
/// the act budget mid-action — an honest "did not finish", never fabricated). For a
/// coder exam the answer IS the code, so this must carry the whole thing: a 200-char
/// cap stored only the "Sure, I can help..." preamble and made every failure
/// undiagnosable AND un-minable for a correction corpus (2026-07-21). Bounded by
/// ANSWER_CAPTURE_CHARS against a pathological loop-to-length, which is itself a
/// signal worth capturing up to the cap.
/// undiagnosable AND un-minable for a correction corpus (2026-07-21). Retain the
/// complete answer for the grade-time lesson sink; storage policy cannot cut
/// the evidence before that consumer receives it.
pub answer: String,
/// Wall-clock latency to SETTLE this task: the summed deliberation-generation
/// time across every act→observe tick (the model's own measured request time,
Expand Down Expand Up @@ -67,7 +67,7 @@ pub struct EvalTaskResult {
pub struct InfraUnavailable {
/// Human cause: which axis broke (not-ready / connect-refused / not-the-served-model
/// / compute-error / stream-idle timeout), naming the task it broke on. Display-only
/// — the classification that produced it is [`SettleOutcome::inference_error`], never
/// — the classification that produced it is [`SettleOutcome::failure`], never
/// re-parsed from this string.
pub reason: String,
/// How many tasks were attempted before the run aborted. The exam is INCOMPLETE — a
Expand Down
40 changes: 18 additions & 22 deletions core/continuum-academy/src/cognition/eval/run_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ pub(super) async fn run_pass(
// Wedge detection is the SERVING layer's job and it is event-based there: the
// stream-liveness classifier (phase-aware budgets, 9e2f95820) kills a
// zero-token stream at the source and the failure surfaces here as
// `inference_error` — the event path `drive_to_settle` already returns on.
// `failure` — the event path `drive_to_settle` already returns on.
// The old flat 600s deadline predated that sensor (#123, 2026-07-17) and was
// never demoted once it shipped: it second-guessed the serving layer with a
// stopwatch, declared a LIVE multi-minute e2e decode "wedged" (fluid-sim-e2e,
Expand All @@ -276,7 +276,7 @@ pub(super) async fn run_pass(
const PER_TASK_IDLE_BACKSTOP: std::time::Duration =
std::time::Duration::from_secs(20 * 60);
// BOUNDED INFRA-FAULT RECOVERY (Proctored Exam Session, Slice B). Drive to
// settlement; if the model call itself FAILS (`inference_error`: lane not-ready /
// settlement; if the model call itself FAILS (`failure`: lane not-ready /
// connect-refused / "not the active served model" / compute-error / deadline-wedge)
// that is an INFRA fault, never a wrong answer. Re-verify the lane and retry the
// SAME task — the retried generation is itself the real decode proof — up to
Expand Down Expand Up @@ -325,9 +325,13 @@ pub(super) async fn run_pass(
}
}
};
let Some(cause) = settled.inference_error.clone() else {
let Some(cause) = settled.failure.clone() else {
break; // reached a verdict (answer OR graded-wrong) on a working lane
};
// Re-verifying an inference lane cannot repair checkpoint custody.
if matches!(cause, crate::cognition::act_observe::SettlementFailure::ReceiptPersistence(_)) {
break;
}
infra_attempt += 1;
if infra_attempt > INFRA_FAULT_RETRIES {
break;
Expand All @@ -348,15 +352,15 @@ pub(super) async fn run_pass(
// INFRA_FAULT_RETRIES re-verify+retry cycles. Record the row for forensics, mark the
// run void, and ABORT — every remaining task would only accrue more phantom zeros on
// a dead lane. The caller reports InfraUnavailable, NEVER a fake pass_rate.
if let Some(cause) = &settled.inference_error {
if let Some(cause) = &settled.failure {
infra_faults += 1;
if infra_reason.is_none() {
infra_reason = Some(format!("task '{}': {cause}", t.id));
}
results.push(EvalTaskResult {
id: t.id.clone(),
ok: false,
grade: format!("infra unavailable (lane never recovered): {cause}"),
grade: format!("settlement infrastructure unavailable: {cause}"),
acts: 0,
answer: String::new(),
latency_ms: 0,
Expand All @@ -372,7 +376,7 @@ pub(super) async fn run_pass(
task = %t.id,
attempted = results.len(),
cause = %cause,
"aborting run as InfraUnavailable — serving lane never recovered; refusing to \
"aborting run as InfraUnavailable — settlement failed; refusing to \
publish a phantom score over a dead lane"
);
break;
Expand Down Expand Up @@ -444,7 +448,7 @@ pub(super) async fn run_pass(
.await
{
// Take the re-drive only if it produced a real turn (not an infra fault).
if re.inference_error.is_none() {
if re.failure.is_none() {
settled = re;
}
}
Expand Down Expand Up @@ -512,24 +516,16 @@ pub(super) async fn run_pass(
round = redrive_round as u64,
"settled on a RED DoD — handing her the verdict with a bounded re-drive"
);
let tail: String = dod_out
.chars()
.rev()
.take(4000)
.collect::<Vec<_>>()
.into_iter()
.rev()
.collect();
let red_delivery = crate::cognition::rag_budget::RagDelivery {
source_id: "airc".to_string(),
items: vec![crate::cognition::rag_budget::RagItem {
key: String::new(),
summary: None,
pointer: None,
content: format!(
"You settled, but the task's definition-of-done currently FAILS. Its output ends:
"You settled, but the task's definition-of-done currently FAILS. Its output is:

{tail}
{dod_out}

Fix the workspace and finish — the grade reads the files, and a red build scores zero."
),
Expand Down Expand Up @@ -559,7 +555,7 @@ Fix the workspace and finish — the grade reads th
)
.await
{
if re.inference_error.is_none() {
if re.failure.is_none() {
settled = re;
}
}
Expand Down Expand Up @@ -590,7 +586,7 @@ Fix the workspace and finish — the grade reads th
ok: false,
grade: format!("infra (DoD could not run, NOT a wrong answer): {reason}"),
acts: settled.acts as u32,
answer: answer.chars().take(ANSWER_CAPTURE_CHARS).collect(),
answer,
latency_ms: settled.metrics.latency_ms,
output_tokens: settled.metrics.output_tokens,
tokens_per_second: settled.metrics.tokens_per_second(),
Expand All @@ -601,9 +597,9 @@ Fix the workspace and finish — the grade reads th
});
continue; // no grade, NO lesson — a harness fault teaches nothing
}
// `settled.inference_error` is None here — the abort above consumed every infra
// `settled.failure` is None here — the abort above consumed every infra
// fault, so this grades a REAL verdict (a working lane produced an answer, right or
// wrong). No `inference_error` arm remains: an infra fault can no longer masquerade
// wrong). No `failure` arm remains: an infra fault can no longer masquerade
// as a graded miss.
let (ok, grade) = if !t.ui_checks.is_empty() {
// FUNCTIONAL WEB-DEV: grade what her UI ACTUALLY RENDERED. Observe `target` through
Expand Down Expand Up @@ -713,7 +709,7 @@ Fix the workspace and finish — the grade reads th
ok,
grade,
acts: total_acts,
answer: answer.chars().take(ANSWER_CAPTURE_CHARS).collect(),
answer,
latency_ms: m.latency_ms,
output_tokens: m.output_tokens,
tokens_per_second: m.tokens_per_second(),
Expand Down
5 changes: 4 additions & 1 deletion core/continuum-academy/src/cognition/eval/warm_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ pub(super) async fn warm_gate(cycle: &crate::cognition::workspace::WorkspaceCycl
crate::cognition::workspace::TurnFraming::directed(),
)
.await;
if probe.inference_error.is_none() {
if probe.failure.is_none() {
warm = true;
break;
}
if matches!(probe.failure, Some(crate::cognition::act_observe::SettlementFailure::ReceiptPersistence(_))) {
break;
}
tokio::time::sleep(std::time::Duration::from_secs(4)).await;
}
// Reset the volatile scratch the probe touched so task #1 starts from the same
Expand Down
13 changes: 9 additions & 4 deletions core/continuum-academy/src/cognition/experience.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl ExperienceRecord {
/// the honest, end-to-end-instrumented lived verdict is whether she *converged*
/// — reached a real settle-verdict (`Speak`/`Pass`/`RaiseUnprompted`) without
/// an inference/serving fault. Two magic-number-free failure signals make a
/// lived turn salient: an infra fault (`inference_error`), and NON-CONVERGENCE
/// lived turn salient: an infra fault (`failure`), and NON-CONVERGENCE
/// — the settle loop ran out its action budget mid-`Act` and never reached a
/// verdict (`SettleOutcome.decision` is still `Act`, the "did not finish" the
/// eval grader already recognizes). Both are structural facts of the outcome,
Expand All @@ -240,7 +240,7 @@ impl ExperienceRecord {
// eval's "did not finish", and an honest capability signal with no threshold.
let converged = !matches!(settled.decision, Decision::Act { .. });
let clean =
converged && settled.inference_error.is_none() && settled.capacity_refusal.is_none();
converged && settled.failure.is_none() && settled.capacity_refusal.is_none();
Self {
// The stimulus IS the task for a lived turn: the message she answered,
// posed as the prompt. No `test`/`expect` — nothing objective to grade
Expand All @@ -253,11 +253,16 @@ impl ExperienceRecord {
// correctness claim — a lived turn has no grader (see doc above).
ok: clean,
grade: match (
&settled.inference_error,
&settled.failure,
&settled.capacity_refusal,
converged,
) {
(Some(cause), _, _) => format!("lived turn: inference fault — {cause}"),
(Some(crate::cognition::act_observe::SettlementFailure::Inference(cause)), _, _) => {
format!("lived turn: inference fault — {cause}")
}
(Some(crate::cognition::act_observe::SettlementFailure::ReceiptPersistence(cause)), _, _) => {
format!("lived turn: receipt persistence fault — {cause}")
}
(None, Some(error), _) => format!("lived turn: prompt capacity refused — {error}"),
(None, None, false) => {
"lived turn: did not converge (action budget exhausted mid-act)".to_string()
Expand Down
14 changes: 11 additions & 3 deletions core/continuum-academy/src/cognition/experience/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
world_state: world_state.to_string(),
room_updates: Default::default(),
metrics: TurnMetrics::default(),
inference_error: None,
failure: None,
deferred_before_dispatch: false,
capacity_refusal: None,
touched_paths: Vec::new(),
Expand Down Expand Up @@ -233,6 +233,14 @@
lived_fault.grade.contains("inference fault"),
"the fault cause is named in the grade"
);
let mut persistence_failed = faulted;
persistence_failed.failure = Some(crate::cognition::act_observe::SettlementFailure::ReceiptPersistence(
std::sync::Arc::new(crate::cognition::persona_workspace::TaskSinkError::OwnerGone(peer.as_uuid())),
));
let lived_persistence = ExperienceRecord::from_lived_turn("ping", &persistence_failed);
assert!(!lived_persistence.ok, "checkpoint failure is not accepted experience");
assert!(lived_persistence.grade.contains("receipt persistence fault"));
assert!(!lived_persistence.grade.contains("inference fault"));

// NON-CONVERGENCE: the drive-loop ran out its action budget mid-Act and never
// reached a verdict — the lived analog of the eval's "did not finish". A
Expand All @@ -248,7 +256,7 @@
world_state: "budget exhausted after 8 acts".into(),
room_updates: Default::default(),
metrics: TurnMetrics::default(),
inference_error: None,
failure: None,
deferred_before_dispatch: false,
capacity_refusal: None,
touched_paths: Vec::new(),
Expand Down Expand Up @@ -464,7 +472,7 @@
world_state: String::new(),
room_updates: Default::default(),
metrics: TurnMetrics::default(),
inference_error: None,
failure: None,
deferred_before_dispatch: false,
capacity_refusal: None,
touched_paths: Vec::new(),
Expand Down
11 changes: 9 additions & 2 deletions core/continuum-cognition/src/cognition/act_observe/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ pub async fn apply_act(
for call in calls {
let cmd = call.name.replace('_', "/");
if is_long_running(&cmd) {
let handle = exec.dispatch_background(
let accepted = exec.dispatch_background(
cmd.clone(),
call.input.clone(),
// In THESE hands: a long-running command a card turn dispatches runs in
Expand All @@ -229,7 +229,14 @@ pub async fn apply_act(
None => identity,
}
}),
);
).await;
let handle = match accepted {
Ok(handle) => handle,
Err(error) => {
bg_notes.push(format!("[not run] {cmd}: {}", error.message));
continue;
}
};
dispatched_calls.push(call.clone());
body.working_memory.record_dispatch_event(
handle,
Expand Down
2 changes: 1 addition & 1 deletion core/continuum-cognition/src/cognition/act_observe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub(crate) use observation::call_args;
pub use observation::{extract_paths, ActOutcome, ActStatus, Observation, ToolOutput, ToolVerb};

mod types;
pub use types::{SettleOutcome, SettleStep};
pub use types::{SettleOutcome, SettleStep, SettlementFailure};

mod apply;
/// Marks committed before an effect reaches the world (stop-drain S2, card 68811445).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::cognition::workspace::{Burst, Decision, Situation, TurnFraming, TurnM

use super::apply::apply_act;
use super::perception::{any_real_receipt, batch_evidence, claimed_file_without_act, collect_touched_paths, mutated_workspace, ConcernPhase, wrote_without_observation};
use super::types::{SettleOutcome, SettleStep};
use super::types::{SettleOutcome, SettleStep, SettlementFailure};
use crate::inference::turn_bound::TICK_DEADLINE;

mod tick_deadline;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub async fn settle_step(
// One Instant and one probe; no signature change, and the caller's arithmetic
// is unchanged.
let cycle_started = std::time::Instant::now();
let ws = cycle.run_situated(burst, framing, situation).await;
let mut ws = cycle.run_situated(burst, framing, situation).await;
let cycle_ms = cycle_started.elapsed().as_millis() as u64;
// The cost of THIS tick's deliberation generation — latency + tokens of the
// model call behind the verdict. Carried out alongside the step so the caller
Expand Down Expand Up @@ -100,6 +100,11 @@ pub async fn settle_step(
if let Some(m) = metrics.as_ref() {
cycle.note_generation(m);
}
if let Err(error) = cycle.persist_render_receipts(std::mem::take(&mut ws.render_receipts)).await {
continuum_base::probe!(class = "settle.receipt_persistence_failed", room = %room_id,
error = %error, "served generation retained; checkpoint failed before applying final speech or action");
return (SettleStep::ReceiptPersistenceFailed { error: Arc::new(error) }, metrics, step_receipts);
}
// A FAILED model call is not a verdict and not a silence — surface it LOUD so no
// failure ever masquerades as a chosen `Pass` ([[fallbacks-are-illegal-fail-loud]]).
// Checked BEFORE the decision so a fault can never collapse into `Passed` (the
Expand All @@ -123,7 +128,7 @@ pub async fn settle_step(
continuum_base::probe!(
class = "settle.inference_failed",
room = %room_id,
error = &error.to_string()[..error.to_string().len().min(160)],
error = %error,
"deliberation generation FAILED — surfacing before the step returns"
);
return (
Expand Down
Loading
Loading