Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 17 additions & 1 deletion crates/tui/src/context_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,14 @@ fn base_source_entries(model: &str, workspace: &Path, skills_dir: Option<&Path>)
.source_path
.as_ref()
.map_or_else(|| "project".to_string(), |p| p.display().to_string());
let block = format!(
let mut block = format!(
"<project_instructions source=\"{source}\">\n{content}\n</project_instructions>"
);
// Include rules in the report when present
if let Some(rules) = &project_context.rules_block {
block.push('\n');
block.push_str(rules);
}
builder.push(SourceEntry::text(
SourceKind::ProjectContext,
"Project instructions",
Expand All @@ -349,6 +354,17 @@ fn base_source_entries(model: &str, workspace: &Path, skills_dir: Option<&Path>)
CountingConfidence::High,
Some(5),
));
} else if let Some(rules) = &project_context.rules_block {
// Rules exist without main instructions
builder.push(SourceEntry::text(
SourceKind::ProjectContext,
"Project rules",
None::<String>,
ActivationReason::FilePresent,
rules,
CountingConfidence::High,
Some(5),
));
}

if project_context.constitution_block.is_none() && project_context.instructions.is_none() {
Expand Down
Loading
Loading