收紧测试与平台编译边界并清理冗余测试包装
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m10s
Project CI / Backend tests (pull_request) Failing after 17s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m41s
Project CI / Frontend tests (pull_request) Successful in 2m4s
Project CI / Repository checks (pull_request) Failing after 12s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m24s
Project CI / Native shell tests (pull_request) Successful in 5m22s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m20s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m37s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m10s
Project CI / Backend tests (pull_request) Failing after 17s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m41s
Project CI / Frontend tests (pull_request) Successful in 2m4s
Project CI / Repository checks (pull_request) Failing after 12s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m24s
Project CI / Native shell tests (pull_request) Successful in 5m22s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 7m20s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 8m37s
将十五条重导出诊断对应的测试出口限定编译范围并删除无消费者导出 将Provider交接故障注入结果及传递分支限定为测试编译 删除计数快照和旧回复流ready包装,保留有效测试断言 将项目目录句柄方法限定为Unix平台 更新二十条警告的处理记录,注明未重新编译验证数量
This commit is contained in:
@@ -13,6 +13,8 @@ mod run_lifecycle;
|
||||
mod tests;
|
||||
mod trace;
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) use canvas_generation::submit_external_generation_request;
|
||||
pub(in crate::agent) use canvas_generation::{
|
||||
admit_platform_art_generation_at, commit_prepared_platform_art_asset_at,
|
||||
commit_prepared_platform_art_asset_strict_slices_at, generate_admitted_platform_art_asset_at,
|
||||
@@ -26,14 +28,10 @@ pub(in crate::agent) use canvas_generation::{
|
||||
validate_platform_art_png_bytes_with_limits, AdmittedPlatformArtGeneration,
|
||||
};
|
||||
pub(crate) use canvas_generation::{
|
||||
classify_external_generation_initial_response, external_canvas_placeholder,
|
||||
external_editor_json_request, external_editor_response_data, external_generation_poll_after_ms,
|
||||
external_generation_result_has_download_reference,
|
||||
external_generation_submit_rejection_is_definitive,
|
||||
platform_art_generation_error_needs_reconciliation, prepare_external_canvas_generation_context,
|
||||
resolve_canvas_resource_download_with_access, submit_external_generation_request,
|
||||
wait_for_external_generation_result_with_access, ExternalCanvasGenerationContext,
|
||||
ExternalGenerationInitialResponse,
|
||||
external_canvas_placeholder, external_editor_json_request, external_editor_response_data,
|
||||
external_generation_poll_after_ms, platform_art_generation_error_needs_reconciliation,
|
||||
prepare_external_canvas_generation_context, resolve_canvas_resource_download_with_access,
|
||||
ExternalCanvasGenerationContext,
|
||||
};
|
||||
pub(in crate::agent) use draft_validation::validate_closed_game_script_blocks;
|
||||
pub(crate) use external_generation_state::{
|
||||
|
||||
@@ -58,9 +58,10 @@ pub(crate) use action_audit::{
|
||||
append_agent_runtime_action_receipt_with_project_revision_before,
|
||||
append_agent_runtime_tool_call_record, AgentRuntimeToolPolicyBlock,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use action_execution::execute_game_creator_agent_runtime_tool_action_with_action_id;
|
||||
pub(crate) use action_execution::{
|
||||
execute_game_creator_agent_runtime_tool_action,
|
||||
execute_game_creator_agent_runtime_tool_action_with_action_id,
|
||||
execute_game_creator_agent_runtime_tool_action_with_pending_action,
|
||||
};
|
||||
pub(crate) use action_projection::mark_game_creator_agent_runtime_auto_action_executing_if_current;
|
||||
@@ -73,10 +74,11 @@ pub(crate) use autonomous_policy::{
|
||||
validate_agent_runtime_autonomous_source_payload, AgentRuntimeAutonomousSourcePayloadStats,
|
||||
};
|
||||
pub(crate) use context_compaction::compact_game_creator_agent_runtime_session_at;
|
||||
#[cfg(test)]
|
||||
pub(crate) use parallel_ledger::game_creator_agent_runtime_parallel_read_batch_path;
|
||||
pub(crate) use parallel_ledger::{
|
||||
agent_runtime_confirmation_path_component, agent_runtime_parallel_read_batch_len,
|
||||
agent_runtime_tool_allowed_for_agent, agent_runtime_tool_is_parallel_safe_read,
|
||||
game_creator_agent_runtime_parallel_read_batch_path,
|
||||
game_creator_agent_runtime_pending_tool_action_path,
|
||||
game_creator_agent_runtime_provider_action_batch_path,
|
||||
};
|
||||
@@ -97,20 +99,20 @@ pub(crate) use project_gates::{
|
||||
acquire_game_creator_agent_provider_plan_project_write_lock_with_wait,
|
||||
acquire_game_creator_agent_runtime_project_write_lock_with_wait,
|
||||
advance_agent_runtime_project_revision_locked,
|
||||
agent_runtime_observation_advances_project_revision,
|
||||
agent_runtime_tool_requires_pending_revision_gate,
|
||||
begin_agent_runtime_project_verification_locked, clear_agent_runtime_failed_playtest_at,
|
||||
finish_agent_runtime_project_verification_locked,
|
||||
invalidate_agent_runtime_project_verification_after_preview_failure_at,
|
||||
is_agent_runtime_project_mutation_observation, isolated_join_completion_blocker_at,
|
||||
prepare_agent_runtime_project_mutation_locked, process_session_completion_blocker_at,
|
||||
project_verification_completion_blocker, project_verification_completion_blocker_at,
|
||||
static_delegate_completion_blocker_at, structured_plan_completion_blocker,
|
||||
validate_agent_runtime_pending_verification_gate_before,
|
||||
project_verification_completion_blocker_at, static_delegate_completion_blocker_at,
|
||||
structured_plan_completion_blocker, validate_agent_runtime_pending_verification_gate_before,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use project_gates::{
|
||||
agent_runtime_observation_advances_project_revision,
|
||||
ensure_current_autonomous_ready_child_mutation_at_locked,
|
||||
project_verification_completion_blocker,
|
||||
supervisor_collaboration_policy_completion_blocker_for_test_at,
|
||||
supervisor_orchestrator_mutation_block_after_dispatch_for_test,
|
||||
};
|
||||
|
||||
+5
-1
@@ -123,6 +123,7 @@ pub(in crate::agent) async fn compact_game_creator_agent_runtime_context_at(
|
||||
AgentRuntimePersistedProviderRequestOutcome::Waiting(record) => {
|
||||
return Ok(AgentRuntimeContextCompactionOutcome::Waiting(record));
|
||||
}
|
||||
#[cfg(test)]
|
||||
AgentRuntimePersistedProviderRequestOutcome::HandoffPrepared => {
|
||||
return Ok(AgentRuntimeContextCompactionOutcome::HandoffPrepared);
|
||||
}
|
||||
@@ -341,8 +342,11 @@ pub(crate) async fn compact_game_creator_agent_runtime_session_at(
|
||||
AgentRuntimeContextCompactionOutcome::Completed(None) => {
|
||||
return Err("手动上下文压缩被新的控制指令中断".to_string());
|
||||
}
|
||||
#[cfg(test)]
|
||||
AgentRuntimeContextCompactionOutcome::HandoffPrepared => {
|
||||
return Err("手动上下文压缩不应进入后台 Provider 重试等待".to_string());
|
||||
}
|
||||
AgentRuntimeContextCompactionOutcome::Waiting(_)
|
||||
| AgentRuntimeContextCompactionOutcome::HandoffPrepared
|
||||
| AgentRuntimeContextCompactionOutcome::Superseded => {
|
||||
return Err("手动上下文压缩不应进入后台 Provider 重试等待".to_string());
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ pub(in crate::agent) async fn request_game_creator_agent_background_final_reply_
|
||||
AgentRuntimeContextCompactionOutcome::Waiting(record) => {
|
||||
return Ok(RequestedAgentRuntimeFinalReplyOutcome::Waiting(record));
|
||||
}
|
||||
#[cfg(test)]
|
||||
AgentRuntimeContextCompactionOutcome::HandoffPrepared => {
|
||||
return Ok(RequestedAgentRuntimeFinalReplyOutcome::HandoffPrepared);
|
||||
}
|
||||
@@ -278,6 +279,7 @@ pub(in crate::agent) async fn request_game_creator_agent_background_final_reply_
|
||||
AgentRuntimePersistedProviderRequestOutcome::Waiting(record) => {
|
||||
return Ok(RequestedAgentRuntimeFinalReplyOutcome::Waiting(record));
|
||||
}
|
||||
#[cfg(test)]
|
||||
AgentRuntimePersistedProviderRequestOutcome::HandoffPrepared => {
|
||||
return Ok(RequestedAgentRuntimeFinalReplyOutcome::HandoffPrepared);
|
||||
}
|
||||
|
||||
@@ -268,6 +268,7 @@ pub(in crate::agent) async fn request_game_creator_agent_background_tool_plan_at
|
||||
AgentRuntimeContextCompactionOutcome::Waiting(record) => {
|
||||
return Ok(RequestedAgentRuntimeToolPlanOutcome::Waiting(record));
|
||||
}
|
||||
#[cfg(test)]
|
||||
AgentRuntimeContextCompactionOutcome::HandoffPrepared => {
|
||||
return Ok(RequestedAgentRuntimeToolPlanOutcome::HandoffPrepared);
|
||||
}
|
||||
@@ -423,6 +424,7 @@ pub(in crate::agent) async fn request_game_creator_agent_background_tool_plan_at
|
||||
AgentRuntimePersistedProviderRequestOutcome::Waiting(record) => {
|
||||
return Ok(RequestedAgentRuntimeToolPlanOutcome::Waiting(record));
|
||||
}
|
||||
#[cfg(test)]
|
||||
AgentRuntimePersistedProviderRequestOutcome::HandoffPrepared => {
|
||||
return Ok(RequestedAgentRuntimeToolPlanOutcome::HandoffPrepared);
|
||||
}
|
||||
|
||||
@@ -219,19 +219,6 @@ impl AgentRuntimeResponseStreamPublisher {
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn ready(&mut self, response: &str, finish_reason: Option<&str>) {
|
||||
if response.trim().is_empty()
|
||||
|| response.chars().count() > AGENT_RUNTIME_RESPONSE_STREAM_MAX_CHARS
|
||||
{
|
||||
self.finish_with_status(AGENT_RUNTIME_RESPONSE_STREAM_STATUS_FAILED);
|
||||
return;
|
||||
}
|
||||
self.stream.accumulated_text = response.to_string();
|
||||
self.stream.finish_reason =
|
||||
normalize_agent_runtime_response_stream_finish_reason(finish_reason);
|
||||
self.finish_with_status(AGENT_RUNTIME_RESPONSE_STREAM_STATUS_READY);
|
||||
}
|
||||
|
||||
pub(super) fn failed(&mut self) {
|
||||
self.finish_with_status(AGENT_RUNTIME_RESPONSE_STREAM_STATUS_FAILED);
|
||||
}
|
||||
|
||||
+2
-19
@@ -211,16 +211,6 @@ fn response_stream_publisher_persists_monotonic_visible_deltas() {
|
||||
assert_eq!(second.sequence, 2);
|
||||
assert_eq!(second.accumulated_text, "你好,这是总控回复。");
|
||||
assert!(!second.accumulated_text.contains("内部推理"));
|
||||
|
||||
publisher.ready("你好,这是总控回复。", Some("stop"));
|
||||
let ready =
|
||||
read_game_creator_agent_runtime_response_stream_at(root, &state.agent_id, &state.run_id)
|
||||
.expect("read ready response stream")
|
||||
.expect("ready response stream exists");
|
||||
assert_eq!(ready.status, AGENT_RUNTIME_RESPONSE_STREAM_STATUS_READY);
|
||||
assert_eq!(ready.sequence, 3);
|
||||
assert_eq!(ready.accumulated_text, "你好,这是总控回复。");
|
||||
assert_eq!(ready.finish_reason.as_deref(), Some("stop"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -240,7 +230,7 @@ fn response_stream_retry_restart_preserves_identity_and_advances_sequence() {
|
||||
.expect("failed response stream attempt exists");
|
||||
assert_eq!(failed.status, AGENT_RUNTIME_RESPONSE_STREAM_STATUS_FAILED);
|
||||
|
||||
let mut retry = AgentRuntimeResponseStreamPublisher::start(root, &snapshot, response_revision);
|
||||
let retry = AgentRuntimeResponseStreamPublisher::start(root, &snapshot, response_revision);
|
||||
let restarted =
|
||||
read_game_creator_agent_runtime_response_stream_at(root, &state.agent_id, &state.run_id)
|
||||
.expect("read restarted response stream attempt")
|
||||
@@ -254,14 +244,7 @@ fn response_stream_retry_restart_preserves_identity_and_advances_sequence() {
|
||||
assert!(restarted.sequence > failed.sequence);
|
||||
assert!(restarted.accumulated_text.is_empty());
|
||||
|
||||
retry.ready("重试后的最终回复", Some("stop"));
|
||||
let ready =
|
||||
read_game_creator_agent_runtime_response_stream_at(root, &state.agent_id, &state.run_id)
|
||||
.expect("read retried ready response stream")
|
||||
.expect("retried ready response stream exists");
|
||||
assert_eq!(ready.status, AGENT_RUNTIME_RESPONSE_STREAM_STATUS_READY);
|
||||
assert!(ready.sequence > restarted.sequence);
|
||||
assert_eq!(ready.accumulated_text, "重试后的最终回复");
|
||||
drop(retry);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -302,9 +302,11 @@ pub(crate) use entrypoints::{
|
||||
pub(crate) use finalization::resume_game_creator_agent_finalization_for_test_at;
|
||||
pub(crate) use finalization::AgentRuntimePendingActionResume;
|
||||
#[cfg(test)]
|
||||
pub(crate) use interaction::acquire_game_creator_agent_runtime_user_input_answer_locks_for_test;
|
||||
pub(crate) use interaction::{
|
||||
acquire_game_creator_agent_runtime_user_input_answer_locks_for_test,
|
||||
agent_runtime_tool_requires_repository_context_fingerprint_gate,
|
||||
};
|
||||
pub(crate) use interaction::{
|
||||
answer_game_creator_agent_runtime_user_input_at, confirm_game_creator_agent_runtime_task_at,
|
||||
pending_repository_context_drift_observation, reject_game_creator_agent_runtime_task_at,
|
||||
};
|
||||
@@ -325,14 +327,9 @@ pub(crate) use pending_execution::{
|
||||
pub(crate) use pending_recovery::resume_game_creator_agent_pending_tool_action_at;
|
||||
#[cfg(test)]
|
||||
pub(crate) use pending_recovery::resume_game_creator_agent_provider_action_batch_for_test_at;
|
||||
pub(crate) use provider_recovery::{
|
||||
autonomous_manifest_parent_wake_error_is_transient,
|
||||
schedule_waiting_autonomous_manifest_parent_wake_after_lane_release,
|
||||
schedule_waiting_static_delegate_parent_wake_after_lane_release,
|
||||
static_delegate_parent_wake_error_is_transient,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use provider_recovery::{
|
||||
autonomous_manifest_parent_wake_error_is_transient,
|
||||
drive_waiting_autonomous_manifest_parent_wake_budget_for_test,
|
||||
ensure_static_delegate_user_input_wait_at, ensure_waiting_provider_retry_records_for_test,
|
||||
mark_autonomous_manifest_parent_wake_needs_reconciliation_for_test,
|
||||
@@ -340,6 +337,11 @@ pub(crate) use provider_recovery::{
|
||||
probe_static_delegate_parent_wake_singleflight_coalescing,
|
||||
repair_autonomous_manifest_parent_wake_reconciliation_projection_for_test,
|
||||
};
|
||||
pub(crate) use provider_recovery::{
|
||||
schedule_waiting_autonomous_manifest_parent_wake_after_lane_release,
|
||||
schedule_waiting_static_delegate_parent_wake_after_lane_release,
|
||||
static_delegate_parent_wake_error_is_transient,
|
||||
};
|
||||
pub(crate) use recovery_scan::{
|
||||
cleanup_game_creator_agent_runtime_completed_finalizations_at,
|
||||
has_recoverable_game_creator_agent_background_tasks_at,
|
||||
@@ -357,18 +359,20 @@ pub(crate) use task_queue::{
|
||||
spawn_next_game_creator_agent_background_task_drain_with_lock,
|
||||
spawn_started_game_creator_agent_background_task_drain_with_lock,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use task_start::start_game_creator_agent_background_task_with_session_lane_hook_at;
|
||||
pub(crate) use task_start::{
|
||||
autonomous_game_build_root_task_is_active, current_autonomous_game_build_root_task_at,
|
||||
notify_external_agent_runner_after_background_task_enqueue,
|
||||
project_autonomous_manifest_ready_task_terminal_at,
|
||||
schedule_autonomous_game_build_ready_tasks_at, schedule_game_creator_agent_ready_tasks_at,
|
||||
start_game_creator_agent_background_task_at,
|
||||
start_game_creator_agent_background_task_for_session_at,
|
||||
start_game_creator_agent_goal_task_in_session_lane_at,
|
||||
start_game_creator_supervisor_background_task_for_session_at,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use task_start::{
|
||||
start_game_creator_agent_background_task_for_session_at,
|
||||
start_game_creator_agent_background_task_with_session_lane_hook_at,
|
||||
};
|
||||
|
||||
pub(crate) const AGENT_RUNTIME_BACKGROUND_LOOP_LIMIT: usize = 6;
|
||||
pub(crate) const AGENT_RUNTIME_BACKGROUND_TOOL_ACTION_LIMIT: usize = 3;
|
||||
|
||||
@@ -931,6 +931,7 @@ async fn run_game_creator_agent_background_task_pass_without_deadline(
|
||||
}
|
||||
return AgentBackgroundTaskOutcome::WaitingForProviderRetry;
|
||||
}
|
||||
#[cfg(test)]
|
||||
Ok(RequestedAgentRuntimeToolPlanOutcome::HandoffPrepared) => {
|
||||
return AgentBackgroundTaskOutcome::WaitingForProviderHandoff;
|
||||
}
|
||||
@@ -3432,6 +3433,7 @@ async fn run_game_creator_agent_background_task_pass_without_deadline(
|
||||
}
|
||||
return AgentBackgroundTaskOutcome::WaitingForProviderRetry;
|
||||
}
|
||||
#[cfg(test)]
|
||||
Ok(RequestedAgentRuntimeFinalReplyOutcome::HandoffPrepared) => {
|
||||
return AgentBackgroundTaskOutcome::WaitingForProviderHandoff;
|
||||
}
|
||||
|
||||
@@ -473,6 +473,7 @@ pub(crate) async fn run_game_creator_agent_background_task_with_context(
|
||||
);
|
||||
return AgentBackgroundTaskOutcome::WaitingForProviderRetry;
|
||||
}
|
||||
#[cfg(test)]
|
||||
AgentBackgroundTaskOutcome::WaitingForProviderHandoff => {
|
||||
return AgentBackgroundTaskOutcome::WaitingForProviderHandoff;
|
||||
}
|
||||
|
||||
@@ -43,9 +43,10 @@ pub(crate) use context_bundle::{
|
||||
read_game_creator_agent_runtime_context_bundle,
|
||||
read_game_creator_agent_runtime_context_bundle_for_idle_compaction,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use context_window::agent_runtime_context_window_applies;
|
||||
pub(crate) use context_window::{
|
||||
agent_runtime_context_window_applies, sanitize_agent_runtime_context_observation,
|
||||
AgentRuntimeContextCheckpoint,
|
||||
sanitize_agent_runtime_context_observation, AgentRuntimeContextCheckpoint,
|
||||
};
|
||||
#[allow(unused_imports)]
|
||||
pub(crate) use finalization::{
|
||||
@@ -73,11 +74,11 @@ pub(crate) use provider_retry::{
|
||||
game_creator_agent_runtime_provider_request_id,
|
||||
game_creator_agent_runtime_transient_retry_backoff_ms,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use real_e2e_checkpoint::AgentRuntimeRealE2eAckPublishPhase;
|
||||
pub(crate) use response_stream::{
|
||||
game_creator_agent_runtime_response_stream_path,
|
||||
read_game_creator_agent_runtime_response_stream_at,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use response_stream::game_creator_agent_runtime_response_stream_path;
|
||||
pub(crate) use response_stream::read_game_creator_agent_runtime_response_stream_at;
|
||||
pub(crate) use run_configuration::{
|
||||
agent_runtime_run_profile_identity_at, bind_game_creator_agent_runtime_run_profile_at,
|
||||
game_creator_agent_runtime_provider_transient_retry_policy_at,
|
||||
@@ -88,11 +89,14 @@ pub(crate) use run_configuration::{
|
||||
game_creator_agent_runtime_project_revision_path,
|
||||
game_creator_agent_runtime_run_profile_binding_path,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(crate) use steering::{
|
||||
acquire_game_creator_agent_runtime_steer_project_write_lock_with_wait,
|
||||
game_creator_agent_runtime_steer_ledger_path,
|
||||
};
|
||||
pub(crate) use steering::{
|
||||
consume_game_creator_agent_runtime_steers,
|
||||
game_creator_agent_runtime_provider_request_count_for_roots,
|
||||
game_creator_agent_runtime_steer_ledger_path,
|
||||
interrupt_game_creator_agent_runtime_provider_request_at,
|
||||
interrupt_game_creator_agent_runtime_provider_requests_for_roots,
|
||||
register_game_creator_agent_runtime_provider_request,
|
||||
|
||||
@@ -6,6 +6,7 @@ pub(crate) enum AgentBackgroundTaskOutcome {
|
||||
WaitingForConfirmation,
|
||||
WaitingForUserInput,
|
||||
WaitingForProviderRetry,
|
||||
#[cfg(test)]
|
||||
WaitingForProviderHandoff,
|
||||
WaitingForIsolatedJoin,
|
||||
WaitingForDelegateReceipts,
|
||||
@@ -21,6 +22,7 @@ pub(crate) enum AgentBackgroundTaskOutcome {
|
||||
pub(in crate::agent) enum AgentRuntimePersistedProviderRequestOutcome {
|
||||
Response(Option<platform_llm::LlmRunResponse>),
|
||||
Waiting(AgentRuntimeProviderRetryRecord),
|
||||
#[cfg(test)]
|
||||
HandoffPrepared,
|
||||
Superseded,
|
||||
}
|
||||
@@ -28,6 +30,7 @@ pub(in crate::agent) enum AgentRuntimePersistedProviderRequestOutcome {
|
||||
pub(in crate::agent) enum AgentRuntimeContextCompactionOutcome {
|
||||
Completed(Option<AgentRuntimeContextCompactionResult>),
|
||||
Waiting(AgentRuntimeProviderRetryRecord),
|
||||
#[cfg(test)]
|
||||
HandoffPrepared,
|
||||
Superseded,
|
||||
}
|
||||
@@ -35,6 +38,7 @@ pub(in crate::agent) enum AgentRuntimeContextCompactionOutcome {
|
||||
pub(in crate::agent) enum RequestedAgentRuntimeToolPlanOutcome {
|
||||
Ready(Option<RequestedAgentRuntimeToolPlan>),
|
||||
Waiting(AgentRuntimeProviderRetryRecord),
|
||||
#[cfg(test)]
|
||||
HandoffPrepared,
|
||||
Superseded,
|
||||
}
|
||||
@@ -42,6 +46,7 @@ pub(in crate::agent) enum RequestedAgentRuntimeToolPlanOutcome {
|
||||
pub(in crate::agent) enum RequestedAgentRuntimeFinalReplyOutcome {
|
||||
Ready(Option<RequestedAgentRuntimeFinalReply>),
|
||||
Waiting(AgentRuntimeProviderRetryRecord),
|
||||
#[cfg(test)]
|
||||
HandoffPrepared,
|
||||
Superseded,
|
||||
}
|
||||
|
||||
@@ -20,15 +20,6 @@ const QUEUE_CAPACITY: usize = 1024;
|
||||
const MAX_META_BYTES: usize = 256 * 1024;
|
||||
const MAX_LIVE_OBSERVATIONS: usize = 16_384;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
pub(crate) struct StoreCounters {
|
||||
pub accepted: u64,
|
||||
pub dropped: u64,
|
||||
pub duplicate: u64,
|
||||
pub corrupt_batches: u64,
|
||||
pub io_errors: u64,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
struct Counters {
|
||||
queued_bytes: AtomicU64,
|
||||
@@ -282,16 +273,6 @@ impl AnalyticsWriter {
|
||||
pub(crate) fn flush(&self) -> bool {
|
||||
self.sender.try_send(Command::Flush).is_ok()
|
||||
}
|
||||
|
||||
pub(crate) fn counters(&self) -> StoreCounters {
|
||||
StoreCounters {
|
||||
accepted: self.counters.accepted.load(Ordering::Relaxed),
|
||||
dropped: self.counters.dropped.load(Ordering::Relaxed),
|
||||
duplicate: self.counters.duplicate.load(Ordering::Relaxed),
|
||||
corrupt_batches: self.counters.corrupt_batches.load(Ordering::Relaxed),
|
||||
io_errors: self.counters.io_errors.load(Ordering::Relaxed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct LimitedSize(usize);
|
||||
|
||||
@@ -349,7 +349,7 @@ fn full_or_disconnected_channel_never_waits_and_counts_drops() {
|
||||
assert!(before.elapsed() < Duration::from_secs(1));
|
||||
drop(receiver);
|
||||
assert!(!writer.try_record(route("A"), event(&session, "A"), "closed".into()));
|
||||
assert_eq!(writer.counters().dropped, 2);
|
||||
assert_eq!(writer.counters.dropped.load(Ordering::Relaxed), 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -1177,7 +1177,7 @@ fn direct_pending_capacity_evicts_oldest_without_settlement_fallback() {
|
||||
assert!(!drain_goal_writer(config.path(), &context, &writer)
|
||||
.iter()
|
||||
.any(|e| e.agent_run_id.is_some()));
|
||||
assert!(writer.counters().dropped >= 1);
|
||||
assert!(writer.counters.dropped.load(Ordering::Relaxed) >= 1);
|
||||
run::settle(Some((context.clone(), writer.clone())), &ids[16], false);
|
||||
assert_eq!(
|
||||
drain_goal_writer(config.path(), &context, &writer)
|
||||
|
||||
@@ -8,6 +8,7 @@ mod playtest;
|
||||
mod process;
|
||||
mod sweep;
|
||||
|
||||
#[cfg(test)]
|
||||
pub use discovery::discover_chrome_or_edge;
|
||||
#[allow(unused_imports)]
|
||||
pub use model::{
|
||||
|
||||
@@ -14,17 +14,21 @@ mod generic;
|
||||
mod lane_defense;
|
||||
pub(super) mod runner;
|
||||
|
||||
#[cfg(test)]
|
||||
pub(super) use generic::{
|
||||
finish_generic_stability_observation, generic_action_sequence_probe_fingerprint_material,
|
||||
generic_non_loss_progression_phase_is_valid, generic_primary_action_phase_is_valid,
|
||||
generic_restart_phase_is_valid, generic_start_phase_is_valid,
|
||||
validate_generic_stability_sample, GENERIC_PLAYTEST_ACTION_CAUSALITY_FINGERPRINT,
|
||||
GENERIC_PLAYTEST_MAX_FINAL_SAMPLE_GAP, GENERIC_PLAYTEST_POST_ACTION_MIN_STABILITY_SAMPLES,
|
||||
GENERIC_PLAYTEST_POST_ACTION_WINDOW, GENERIC_PLAYTEST_RESTART_MIN_STABILITY_SAMPLES,
|
||||
GENERIC_PLAYTEST_RESTART_STABILITY_WINDOW,
|
||||
finish_generic_stability_observation, generic_non_loss_progression_phase_is_valid,
|
||||
generic_primary_action_phase_is_valid, generic_restart_phase_is_valid,
|
||||
generic_start_phase_is_valid, validate_generic_stability_sample,
|
||||
};
|
||||
pub(super) use generic::{
|
||||
generic_action_sequence_probe_fingerprint_material,
|
||||
GENERIC_PLAYTEST_ACTION_CAUSALITY_FINGERPRINT, GENERIC_PLAYTEST_MAX_FINAL_SAMPLE_GAP,
|
||||
GENERIC_PLAYTEST_POST_ACTION_MIN_STABILITY_SAMPLES, GENERIC_PLAYTEST_POST_ACTION_WINDOW,
|
||||
GENERIC_PLAYTEST_RESTART_MIN_STABILITY_SAMPLES, GENERIC_PLAYTEST_RESTART_STABILITY_WINDOW,
|
||||
GENERIC_PLAYTEST_START_OPPORTUNITY_MIN_STABILITY_SAMPLES,
|
||||
GENERIC_PLAYTEST_START_OPPORTUNITY_WINDOW,
|
||||
};
|
||||
#[cfg(test)]
|
||||
pub(super) use lane_defense::{lane_enemy_state_changes, LaneBattleProgress};
|
||||
|
||||
pub(super) const PLAYABLE_GAME_STATE_SCHEMA_VERSION: &str = "playable-web-game-state.v1";
|
||||
|
||||
@@ -245,6 +245,7 @@ pub(super) struct ExternalAgentRunnerProjectOwnerStorage {
|
||||
}
|
||||
|
||||
impl ExternalAgentRunnerProjectOwnerStorage {
|
||||
#[cfg(unix)]
|
||||
pub(super) fn runtime_directory(&self) -> &File {
|
||||
self.directory_handles
|
||||
.last()
|
||||
|
||||
@@ -31,10 +31,9 @@ pub(crate) use ledger::{
|
||||
ensure_capacity_for_request_at, is_later_repair_identity, lookup_at, read_for_run_at,
|
||||
remove_at, write_at,
|
||||
};
|
||||
pub(crate) use model::{
|
||||
AgentRuntimeToolPlanHandoffEntry, AgentRuntimeToolPlanHandoffLedger,
|
||||
AgentRuntimeToolPlanHandoffLookup, TOOL_PLAN_HANDOFF_SCHEMA_VERSION,
|
||||
};
|
||||
pub(crate) use model::{AgentRuntimeToolPlanHandoffEntry, AgentRuntimeToolPlanHandoffLookup};
|
||||
#[cfg(test)]
|
||||
pub(crate) use model::{AgentRuntimeToolPlanHandoffLedger, TOOL_PLAN_HANDOFF_SCHEMA_VERSION};
|
||||
|
||||
pub(crate) fn absolute_path_validation_error(
|
||||
label: &str,
|
||||
|
||||
Reference in New Issue
Block a user