feat(engine): platform self-awareness, event pipeline fix, globals() builtin, prompt templates

Session 9 changes driven by live trace analysis:

- CodeAct event pipeline: handle_execute_code_step now transfers
  CodeExecutionResult events to thread.events and broadcasts via event_tx
  (fixes false-positive no_tools_used trace warnings)
- Monty globals()/locals() builtins: returns dict of available action names
  from capability leases, enabling "tool_name" in globals() probing
- PlatformInfo injection into system prompts (version, LLM backend, model,
  database, channels, owner, repo URL)
- Mission goal prompts moved to prompts/*.md files (include_str! pattern)
- /expected command for triggering self-improvement from user feedback
- Session 9 development history

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
2026-03-27 22:39:59 -07:00
co-authored by Claude Opus 4.6
parent ae0cae3a22
commit 85bcaa64e9
18 changed files with 645 additions and 207 deletions
@@ -50,6 +50,8 @@ pub struct ExecutionLoop {
retrieval: Option<crate::memory::RetrievalEngine>,
/// Optional Store for runtime prompt overlay loading and skill retrieval.
store: Option<Arc<dyn crate::traits::store::Store>>,
/// Runtime platform metadata for self-awareness in system prompts.
platform_info: Option<crate::executor::prompt::PlatformInfo>,
}
impl ExecutionLoop {
@@ -74,6 +76,7 @@ impl ExecutionLoop {
event_tx: None,
retrieval: None,
store: None,
platform_info: None,
}
}
@@ -107,6 +110,12 @@ impl ExecutionLoop {
self
}
/// Set platform metadata for self-awareness in system prompts.
pub fn with_platform_info(mut self, info: crate::executor::prompt::PlatformInfo) -> Self {
self.platform_info = Some(info);
self
}
/// Add an event to the thread and broadcast it for live status updates.
#[allow(dead_code)]
fn emit_event(&mut self, kind: EventKind) {
@@ -232,6 +241,7 @@ impl ExecutionLoop {
&actions,
self.store.as_ref(),
self.thread.project_id,
self.platform_info.as_ref(),
)
.await;