Compare commits

..
Author SHA1 Message Date
Richard Zink fcbc052f8e Release v202611-00050 2026-11-16 13:21:35 +01:00
Richard ZinkandClaude Sonnet 5.5 fa6173d224 Factory: no review loop in planning chats
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 13:21:34 +01:00
4 changed files with 32 additions and 1 deletions

No files matched your search

+7
View File
@@ -3,6 +3,13 @@
All notable changes to CodeCraft. Versions follow [Semantic Versioning](https://semver.org/);
until 1.0, minor versions may contain breaking changes.
## [v202611-00050] – 2026-11-16
### Fixed
- The factory's planning chats (spec chat, "Plan a feature", "Cut a milestone") no longer run the review loop
of the agent mode (the "refine" rounds of build mode), which checked their answers as if they were code.
## [v202611-00049] – 2026-11-16
### Added
+1 -1
View File
@@ -11,7 +11,7 @@
</p>
<p align="center">
<img alt="Version v202611-00049" src="https://img.shields.io/badge/version-v202611--00049-d69e2e?style=flat-square">
<img alt="Version v202611-00050" src="https://img.shields.io/badge/version-v202611--00050-d69e2e?style=flat-square">
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-689d6a?style=flat-square">
<img alt="Rust backend" src="https://img.shields.io/badge/backend-Rust-b7410e?style=flat-square&logo=rust">
<img alt="React PWA" src="https://img.shields.io/badge/frontend-React%20PWA-2d81ff?style=flat-square&logo=react">
+20
View File
@@ -1529,6 +1529,16 @@ pub fn draft_of(app: &App, user: &User, session: &crate::types::Session) -> Opti
(session.owner_id.as_deref() == Some(&user.id) && cwd.starts_with(&home) && cwd != home).then_some(cwd)
}
/// Is this a planning chat of the factory (spec chat in `_drafts`, issue chat in `_issues`)? They produce
/// text, not code, so the review loop of the agent mode is switched off for them.
pub fn is_planning_chat(app: &App, session: &crate::types::Session) -> bool {
app.factory_dir().is_some_and(|dir| is_planning_path(&dir, std::path::Path::new(&session.cwd)))
}
fn is_planning_path(factory: &std::path::Path, cwd: &std::path::Path) -> bool {
cwd.strip_prefix(factory).map(|rel| rel.components().any(|c| c.as_os_str() == "_drafts" || c.as_os_str() == "_issues")).unwrap_or(false)
}
/// Start a spec chat with the given model.
pub fn start_spec_chat(app: &Arc<App>, user: &User, model: &str) -> Result<crate::types::Session> {
let id = crate::types::new_id();
@@ -1804,6 +1814,16 @@ mod tests {
assert!(parse_result(t).is_some_and(|v| v["decision"] == "issues"));
}
#[test]
fn planning_chats_are_recognised_by_their_folder() {
let f = std::path::Path::new("/factory");
assert!(is_planning_path(f, std::path::Path::new("/factory/zink/_drafts/abc")));
assert!(is_planning_path(f, std::path::Path::new("/factory/zink/_issues/abc")));
assert!(!is_planning_path(f, std::path::Path::new("/factory/zink/zink/dunkelfeld")));
assert!(!is_planning_path(f, std::path::Path::new("/factory/zink/zink/_work/dunkelfeld-1")));
assert!(!is_planning_path(f, std::path::Path::new("/workspace/_drafts/x")));
}
#[test]
fn encodes_labels() {
assert_eq!(urlenc("factory:qa"), "factory%3Aqa");
+4
View File
@@ -293,6 +293,10 @@ pub async fn run_session(app: Arc<App>, session_id: &str, cancel: CancellationTo
let roots = app.user_roots(session.owner_id.as_deref());
let root = app.root_for(session.owner_id.as_deref(), &cwd);
let mut agent = prompts::find_agent_for(&app, &root, &cwd, &session.agent, session.owner_id.as_deref());
// Chats that plan (spec chat, issue chat) write no code: the mode's review of the work does not apply.
if crate::factory::is_planning_chat(&app, &session) {
agent.refine = None;
}
let clean_room = session.clean_room(app.config().craft.clean_room);
// The craft prompt follows the session's clean room / deep switch.
if agent.name == "craft" && agent.source == "builtin" {