prompt: route source assertions through effective catalog

This commit is contained in:
2026-08-14 14:02:01 +09:00
parent a1f6a6bad5
commit 93e784a3ed
3 changed files with 18 additions and 19 deletions
-15
View File
@@ -1457,21 +1457,6 @@ mod tests {
assert!(reviewer.compaction.is_some());
}
#[test]
fn orchestrator_role_keeps_review_routing_owned_by_coder() {
let prompt = include_str!("../../../resources/prompts/role/orchestrator.md");
assert!(prompt.contains("assigned Coder owns its review/fix loop"));
assert!(prompt.contains("then use `SpawnTicketCoder`"));
assert!(prompt.contains("verify its current assignment names that Coder"));
assert!(prompt.contains("never route implementation to an unassigned Coder"));
assert!(prompt.contains(
"Do not spawn, restore, assign, or route work to Backend/Runtime Reviewer Workers"
));
assert!(prompt.contains("never compensate by creating an independent Reviewer Worker"));
assert!(!prompt.contains("sibling Coder/Reviewer Workers"));
}
#[test]
fn profile_resolution_requires_runtime_worker_name() {
let tmp = TempDir::new().unwrap();
@@ -24,9 +24,6 @@ const MAX_PAGE_LIMIT: usize = 100;
const MAX_READ_BYTES: usize = 16 * 1024;
const OBSERVATION_INSTRUCTION_ID: &str = "worker-observation.policy";
const OBSERVATION_PROMPT_REF: &str = "common.worker_observation";
#[cfg(test)]
const OBSERVATION_PROMPT_SOURCE: &str =
include_str!("../../../../../resources/prompts/common/worker-observation.md");
fn observation_instruction() -> FeatureInstructionDeclaration {
FeatureInstructionDeclaration::new(
@@ -801,6 +798,8 @@ mod tests {
#[test]
fn prompt_source_names_the_worker_observation_contract() {
let catalog = crate::PromptCatalog::builtins_only().unwrap();
let source = &catalog.projection().templates["common.worker_observation"];
for token in [
"ListWorkerSessions",
"ViewSessionOverview",
@@ -808,7 +807,7 @@ mod tests {
"ReadSessionEntry",
"SessionEntryRef",
] {
assert!(OBSERVATION_PROMPT_SOURCE.contains(token), "missing {token}");
assert!(source.contains(token), "missing {token}");
}
}
+15
View File
@@ -595,6 +595,21 @@ mod tests {
);
}
#[test]
fn orchestrator_role_keeps_review_routing_owned_by_coder() {
let catalog = PromptCatalog::builtins_only().unwrap();
let prompt = &catalog.projection.templates["role.orchestrator"];
assert!(prompt.contains("assigned Coder owns its review/fix loop"));
assert!(prompt.contains("then use `SpawnTicketCoder`"));
assert!(prompt.contains("verify its current assignment names that Coder"));
assert!(prompt.contains("never route implementation to an unassigned Coder"));
assert!(prompt.contains(
"Do not spawn, restore, assign, or route work to Backend/Runtime Reviewer Workers"
));
assert!(prompt.contains("never compensate by creating an independent Reviewer Worker"));
assert!(!prompt.contains("sibling Coder/Reviewer Workers"));
}
#[test]
fn existing_internal_prompt_render_contracts_are_preserved() {
let catalog = PromptCatalog::builtins_only().unwrap();