Keep a check that worked while nothing it looks at changes, so an unchanged build isn't built and started again (R2.9) (#1296)

A check round in which every check worked is kept, and the next check reuses its results while nothing it looked at has changed: the app's files, the reference and capture files, the kind, stack and mode, the plugin checks and the project's folder. So a prompt that changes nothing in app/ no longer builds and starts the app again, and the check after the builder's turn doesn't repeat its own check. The feed says when results stand. A round with any failure is never kept, so Try again always looks again; the kept round is saved in the build progress.
This commit is contained in:
Tanish Manku authored and GitHub committed 2026-11-09 17:47:23 +08:00
1 parent 28cccdb998
commit 5870bcebed
11 files changed
+341 -8

No files matched your search

+80
View File
@@ -0,0 +1,80 @@
//! A check round in which every check worked stands while nothing it looks at changes, so a
//! prompt that changes nothing in app/ doesn't build and start the app again (and the check
//! after the builder's turn doesn't repeat the builder's own `rebuild_check`). A round with a
//! failure is never kept: something outside the project (a program installed, a browser back)
//! may make it work, and Try again must look again.
use super::kinds::{TargetKind, plugin_ids};
use super::*;
use craft_anything_engine::workspace::progress::CheckedBuild;
/// The run's kept round, and the scan cache its digests reuse.
#[derive(Default)]
pub(super) struct KeptChecks {
files: AppFingerprintCache,
kept: Option<(String, Vec<CheckResult>)>,
}
impl KeptChecks {
/// Start from the round `progress` kept, when `craft.json` still has it.
pub(super) fn from_saved(progress: &BuildProgress, ws: &Workspace) -> KeptChecks {
let kept = progress.checked.as_ref().and_then(|c| {
let last = ws.manifest.checks.last()?.round;
let round: Vec<CheckResult> = ws.manifest.checks.iter().filter(|r| r.round == c.round).cloned().collect();
(last == c.round && all_worked(&round)).then(|| (c.key.clone(), round))
});
KeptChecks { files: AppFingerprintCache::default(), kept }
}
/// What to save for `round`: the kept key when the kept results are this round's.
pub(super) fn saved_for(&self, round: u32) -> Option<CheckedBuild> {
self.kept.as_ref().filter(|(_, r)| r.first().is_some_and(|c| c.round == round)).map(|(key, _)| CheckedBuild { key: key.clone(), round })
}
}
fn all_worked(round: &[CheckResult]) -> bool {
!round.is_empty() && round.iter().all(|c| c.passed)
}
impl Worker {
/// `run`'s results, or the kept round's (numbered `round`) when what the checks look at
/// hasn't changed since it ran. A digest that can't be taken just means checking again.
pub(super) fn checks_unless_unchanged(
&self,
ws: &Workspace,
kind: &dyn TargetKind,
round: u32,
run: impl FnOnce() -> Result<Vec<CheckResult>, ToolError>,
) -> Result<Vec<CheckResult>, ToolError> {
let extra = {
let session = self.engine.session();
// The folder too: a copy of the project has none of the build outputs the round checked.
let mut extra =
vec![ws.root.display().to_string(), kind.id().to_string(), ws.manifest.stack.clone(), format!("clean_room={}", session.clean_room())];
extra.extend(plugin_ids(&session, kind));
extra
};
let extra: Vec<&str> = extra.iter().map(String::as_str).collect();
let mut kept = self.kept_checks.lock().unwrap_or_else(PoisonError::into_inner);
let before = ws.check_fingerprint(&mut kept.files, &extra, &self.stop).ok();
if let (Some(now), Some((key, results))) = (&before, &kept.kept)
&& now == key
{
let results: Vec<CheckResult> = results.iter().map(|c| CheckResult { round, ..c.clone() }).collect();
kept.kept = Some((key.clone(), results.clone()));
drop(kept);
self.emit(RunEvent::Agent(AgentEvent::Status {
text: "Nothing the check looks at has changed since it last worked, so its results stand.".into(),
}));
return Ok(results);
}
// Checks take minutes; the lock isn't held while they run.
drop(kept);
let results = run()?;
let mut kept = self.kept_checks.lock().unwrap_or_else(PoisonError::into_inner);
// Taken after the round: a build writes files of its own that the next scan sees too.
let after = if all_worked(&results) { ws.check_fingerprint(&mut kept.files, &extra, &self.stop).ok() } else { None };
kept.kept = after.map(|key| (key, results.clone()));
Ok(results)
}
}
+9
View File
@@ -255,6 +255,15 @@ impl CheckCx<'_> {
}
}
/// The ids of the WASM plugins' checks that join `kind`'s.
pub(super) fn plugin_ids(session: &craft_anything_engine::Session, kind: &dyn TargetKind) -> Vec<String> {
craft_anything_engine::wasm_plugins::checks(session)
.iter()
.filter(|c| c.kinds.is_empty() || c.kinds.iter().any(|k| k == kind.id()))
.map(|c| c.id.to_string())
.collect()
}
impl Worker {
/// Run the checks the kind asks for in this round, in order, then the WASM plugins' checks for
/// this kind. One that fails stops the rest: a later check needs what an earlier one proved (a
+12
View File
@@ -42,6 +42,7 @@ pub mod activity;
mod brief;
mod check;
pub mod feed;
mod kept_check;
pub mod kinds;
mod locate;
pub mod notes;
@@ -300,6 +301,7 @@ impl RebuildRun {
self_check: None,
reset_progress_after_notes: false,
keys: hub.keys.clone(),
kept_checks: Mutex::default(),
};
let r2 = running.clone();
let key_store = hub.keys.clone();
@@ -496,6 +498,8 @@ struct Worker {
reset_progress_after_notes: bool,
/// The backends' stored keys, for an agent CLI that asks the host to authenticate (Devin).
keys: crate::keys::KeyStore,
/// The last check round in which everything worked, kept while nothing it looks at changes.
kept_checks: Mutex<kept_check::KeptChecks>,
}
/// The project a run records its usage in, and when it last did.
@@ -743,6 +747,7 @@ impl Worker {
opts: &RunOptions,
) -> Result<String, ToolError> {
let mut progress = BuildProgress::load(&ws.root)?;
*self.kept_checks.lock().unwrap_or_else(PoisonError::into_inner) = kept_check::KeptChecks::from_saved(&progress, ws);
let mut progress_available = true;
let mut fingerprints = AppFingerprintCache::default();
// Try again has no message. Only an explicit new request starts another attempt on
@@ -978,6 +983,9 @@ impl Worker {
// round adds to it, across runs, until the limit stops the build.
ws.manifest.not_working_checks = if checks.iter().all(|c| c.passed) { 0 } else { ws.manifest.not_working_checks.saturating_add(1) };
ws.save()?;
// Kept for the next prompt when every check worked; saved after craft.json has the round.
progress.checked = self.kept_checks.lock().unwrap_or_else(PoisonError::into_inner).saved_for(round);
progress.save(&ws.root)?;
for c in &checks {
self.emit(RunEvent::Checked(c.clone()));
}
@@ -1112,6 +1120,10 @@ impl Worker {
/// an error couldn't look at all (a browser that went away), which says nothing about the
/// build, so it gets a second go before the run stops, and the run says what is really wrong.
fn checks_with_a_retry(&self, ws: &Workspace, kind: &dyn kinds::TargetKind, round: u32) -> Result<Vec<CheckResult>, ToolError> {
self.checks_unless_unchanged(ws, kind, round, || self.checks_with_a_retry_now(ws, kind, round))
}
fn checks_with_a_retry_now(&self, ws: &Workspace, kind: &dyn kinds::TargetKind, round: u32) -> Result<Vec<CheckResult>, ToolError> {
let e = match self.run_checks(ws, kind, round) {
Err(e) if e.code != ErrorCode::Cancelled => e,
done => return done,
+1 -1
View File
@@ -187,7 +187,7 @@ fn consumed_note_resets_survive_failed_and_cancelled_turns() {
for cancelled in [false, true] {
for text in ["Keep the header blue", " "] {
for record in ["", "{ broken progress", r#"{"version":2,"fingerprint":null,"unchanged_turns":1}"#] {
for record in ["", "{ broken progress", r#"{"version":3,"fingerprint":null,"unchanged_turns":1}"#] {
let dir = tempfile::tempdir().unwrap();
let mut ws = Workspace::create(dir.path(), "Interrupted note", "Build an app", TargetRef::None).unwrap();
std::fs::create_dir_all(ws.capture_dir()).unwrap();
+4 -1
View File
@@ -129,7 +129,10 @@ impl Worker {
"The builder is checking its work against the original…"
};
self.step(ws, Step::Build, Status::Building, checking)?;
let (text, line) = match self.run_checks_within(ws, kind.as_ref(), SELF_CHECK_ROUND, Some(SELF_CHECK_LIMIT)) {
let checked = self.checks_unless_unchanged(ws, kind.as_ref(), SELF_CHECK_ROUND, || {
self.run_checks_within(ws, kind.as_ref(), SELF_CHECK_ROUND, Some(SELF_CHECK_LIMIT))
});
let (text, line) = match checked {
Ok(checks) => {
let line = format!("The builder checked its work: {}.", summary(&checks, good_enough));
(report(&checks, good_enough, &open_questions(ws)), line)
+93
View File
@@ -451,6 +451,7 @@ fn notes_added_while_it_works_reach_the_agent_at_its_next_step() {
notes: notes.clone(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -1358,6 +1359,7 @@ fn an_api_backend_builds_with_the_build_tools() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -1476,6 +1478,7 @@ fn the_mechanics_sheet_is_required_and_held_against_the_code() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -2600,9 +2603,92 @@ fn check_worker(ws: &Workspace, deep: bool) -> Worker {
self_check: None,
reset_progress_after_notes: false,
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
}
}
#[test]
fn a_check_that_worked_stands_while_nothing_it_looks_at_changes() {
use craft_anything_engine::workspace::progress::CheckedBuild;
use std::cell::Cell;
let d = tempfile::tempdir().unwrap();
let mut ws = Workspace::create(d.path(), "Arena", "Recreate this game", TargetRef::None).unwrap();
std::fs::create_dir_all(ws.app_dir().join("src")).unwrap();
std::fs::write(ws.app_dir().join("src/main.rs"), "fn main() {}\n").unwrap();
let w = check_worker(&ws, false);
let runs = Cell::new(0);
let worked = Cell::new(true);
let check = |ws: &Workspace, round| {
w.checks_unless_unchanged(ws, &SheetKind, round, || {
runs.set(runs.get() + 1);
Ok(vec![CheckResult::new(CheckResult::BUILD, round, worked.get(), "built")])
})
.unwrap()
};
assert_eq!(check(&ws, 1)[0].round, 1);
assert_eq!(runs.get(), 1);
// The builder's own check, then the one after its turn: nothing changed, so it isn't run again.
let kept = check(&ws, self_check::SELF_CHECK_ROUND);
assert_eq!((runs.get(), kept[0].round, kept[0].passed), (1, self_check::SELF_CHECK_ROUND, true));
assert_eq!(check(&ws, 2)[0].round, 2);
assert_eq!(runs.get(), 1);
// A changed file, a new picture to compare with, or Deep mode checks again.
std::fs::write(ws.app_dir().join("src/main.rs"), "fn main() { println!(\"hi\"); }\n").unwrap();
check(&ws, 3);
assert_eq!(runs.get(), 2);
std::fs::create_dir_all(ws.reference_dir()).unwrap();
std::fs::write(ws.reference_dir().join("look.png"), "a picture").unwrap();
check(&ws, 4);
assert_eq!(runs.get(), 3);
let deep = check_worker(&ws, true);
*deep.kept_checks.lock().unwrap_or_else(PoisonError::into_inner) = std::mem::take(&mut *w.kept_checks.lock().unwrap_or_else(PoisonError::into_inner));
deep.checks_unless_unchanged(&ws, &SheetKind, 5, || {
runs.set(runs.get() + 1);
Ok(vec![CheckResult::new(CheckResult::BUILD, 5, true, "built")])
})
.unwrap();
assert_eq!(runs.get(), 4, "Deep mode checks again");
// A round with a failure is never kept: Try again looks again.
worked.set(false);
check(&ws, 6);
check(&ws, 7);
assert_eq!(runs.get(), 6);
worked.set(true);
// Kept across runs: the round saved in the progress record, while craft.json still ends with it.
let round = check(&ws, 8);
assert_eq!(runs.get(), 7);
let saved = w.kept_checks.lock().unwrap_or_else(PoisonError::into_inner).saved_for(8);
assert!(w.kept_checks.lock().unwrap_or_else(PoisonError::into_inner).saved_for(7).is_none());
ws.manifest.checks.extend(round);
let progress = BuildProgress { checked: saved.clone(), ..BuildProgress::default() };
let next_run = check_worker(&ws, false);
*next_run.kept_checks.lock().unwrap_or_else(PoisonError::into_inner) = kept_check::KeptChecks::from_saved(&progress, &ws);
let again = next_run.checks_unless_unchanged(&ws, &SheetKind, 9, || panic!("an unchanged build isn't checked again")).unwrap();
assert_eq!((again[0].round, again[0].note.as_str()), (9, "built"));
// A copy of the project, with the same files, checks its own build.
let other = tempfile::tempdir().unwrap();
let copy = Workspace::create(other.path(), "Arena", "Recreate this game", TargetRef::None).unwrap();
std::fs::create_dir_all(copy.app_dir().join("src")).unwrap();
std::fs::copy(ws.app_dir().join("src/main.rs"), copy.app_dir().join("src/main.rs")).unwrap();
std::fs::create_dir_all(copy.reference_dir()).unwrap();
std::fs::copy(ws.reference_dir().join("look.png"), copy.reference_dir().join("look.png")).unwrap();
let copied = Cell::new(false);
next_run
.checks_unless_unchanged(&copy, &SheetKind, 10, || {
copied.set(true);
Ok(Vec::new())
})
.unwrap();
assert!(copied.get(), "a copy is checked again");
// A record naming another round than craft.json's last one keeps nothing.
let stale = BuildProgress { checked: Some(CheckedBuild { round: 7, ..saved.unwrap() }), ..BuildProgress::default() };
assert!(kept_check::KeptChecks::from_saved(&stale, &ws).saved_for(7).is_none());
}
/// A new Python project reaches the same build/screenshot path as a packaged app. The local
/// interpreter is a stand-in: no installed Python, packages, window, network or user settings.
#[cfg(unix)]
@@ -3068,6 +3154,7 @@ fn preparing_the_builders_agent_does_not_lock_up() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -3111,6 +3198,7 @@ fn the_run_answers_the_builders_own_check_during_its_turn() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -3309,6 +3397,7 @@ fn a_note_the_builder_took_at_a_step_joins_the_feed_and_isnt_sent_again() {
])),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -3668,6 +3757,7 @@ fn a_session_left_on_another_computer_starts_a_new_one_from_the_project() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -3724,6 +3814,7 @@ fn a_missing_session_with_nothing_to_start_from_is_said_plainly() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -3791,6 +3882,7 @@ fn the_builders_conversation_travels_with_the_project() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
@@ -3869,6 +3961,7 @@ fn a_build_says_when_it_waits_for_an_analysis_started_earlier() {
notes: Arc::default(),
feed: Arc::new(Mutex::new(feed::FeedLog::open(&ws))),
keys: crate::KeyStore::file_only(ws.root.join("keys.toml")),
kept_checks: Mutex::default(),
assets: false,
decompiled: false,
usage: None,
+91 -4
View File
@@ -18,18 +18,23 @@ pub const UNCHANGED_TURN_LIMIT: u32 = 2;
// Keep state inside an already reserved Craft directory. A project created by an older
// version may have its own app data named build-progress.json at the root.
pub const BUILD_PROGRESS_FILE: &str = "inbox/build-progress.json";
pub const BUILD_PROGRESS_VERSION: u32 = 1;
pub const BUILD_PROGRESS_VERSION: u32 = 2;
const MAX_RECORD_BYTES: u64 = 16 * 1024;
const MAX_ENTRIES: usize = 100_000;
const MAX_DEPTH: usize = 64;
const STEPS: &[crate::versioned::Step<Value>] = &[v0_to_v1];
const STEPS: &[crate::versioned::Step<Value>] = &[v0_to_v1, v1_to_v2];
const _: () = assert!(STEPS.len() == BUILD_PROGRESS_VERSION as usize);
fn v0_to_v1(doc: &mut Value) -> Result<(), String> {
if doc.is_object() { Ok(()) } else { Err("the progress record isn't a JSON object".into()) }
}
/// Version 2 adds `checked`; a version 1 record has no kept check.
fn v1_to_v2(doc: &mut Value) -> Result<(), String> {
v0_to_v1(doc)
}
/// The app as the builder last left it, and turns since it last changed. Only the rebuild run
/// writes this record. An older project without one has no counted turns.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
@@ -40,11 +45,25 @@ pub struct BuildProgress {
pub fingerprint: Option<String>,
#[serde(default)]
pub unchanged_turns: u32,
/// The last check round in which every check worked, and what it looked at; while that
/// stays the same, the round's results stand instead of building and starting the app again.
#[serde(default)]
pub checked: Option<CheckedBuild>,
}
/// A check round kept with the state it judged.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
#[serde(deny_unknown_fields)]
pub struct CheckedBuild {
/// A digest of what the round's checks look at, taken after they ran.
pub key: String,
/// The round in `craft.json`'s `checks` whose results stand.
pub round: u32,
}
impl Default for BuildProgress {
fn default() -> Self {
Self { version: BUILD_PROGRESS_VERSION, fingerprint: None, unchanged_turns: 0 }
Self { version: BUILD_PROGRESS_VERSION, fingerprint: None, unchanged_turns: 0, checked: None }
}
}
@@ -137,6 +156,67 @@ impl Workspace {
pub fn app_fingerprint(&self, stop: &CancelToken) -> Result<String, ToolError> {
AppFingerprintCache::default().scan(self, stop)
}
/// A digest of what a check round looks at: the app's files (as [`Workspace::app_fingerprint`]
/// reads them), the names, sizes and times of the files in `reference/` and `capture/` it
/// compares with, and `extra` (the folder, kind, stack, mode and plugin checks, from the caller).
/// Equal digests mean the same round would judge the same build against the same things.
pub fn check_fingerprint(&self, cache: &mut AppFingerprintCache, extra: &[&str], stop: &CancelToken) -> Result<String, ToolError> {
let mut hash = Sha256::new();
hash.update(b"craft-check-inputs-v1\0");
hash.update(cache.scan(self, stop)?.as_bytes());
for dir in [self.reference_dir(), self.capture_dir()] {
hash.update(b"\0dir\0");
let mut visited = 0;
stamp_tree(&dir, &dir, &mut hash, &mut visited, 0, stop)?;
}
for e in extra {
hash.update(b"\0extra\0");
hash.update(e.as_bytes());
}
Ok(hex::encode(hash.finalize()))
}
}
/// Names, sizes, kinds and modification times under `dir`, in name order; a missing folder adds
/// nothing. Bounded like the app scan, and symlinks are recorded, never followed.
fn stamp_tree(root: &Path, dir: &Path, hash: &mut Sha256, visited: &mut usize, depth: usize, stop: &CancelToken) -> Result<(), ToolError> {
if depth > MAX_DEPTH {
return Err(ToolError::new(ErrorCode::OverLimit, format!("{} is nested too deeply to compare.", root.display())));
}
let read = match std::fs::read_dir(dir) {
Ok(r) => r,
Err(e) if e.kind() == std::io::ErrorKind::NotFound && depth == 0 => return Ok(()),
Err(e) => return Err(ToolError::io(dir.display(), e)),
};
let mut entries = Vec::new();
for entry in read {
stop.check()?;
let entry = entry.map_err(|e| ToolError::io(dir.display(), e))?;
*visited = visited.saturating_add(1);
if *visited > MAX_ENTRIES {
return Err(ToolError::new(ErrorCode::OverLimit, format!("{} has too many files to compare.", root.display())));
}
entries.push(entry.path());
}
entries.sort();
for path in entries {
let metadata = std::fs::symlink_metadata(&path).map_err(|e| ToolError::io(path.display(), e))?;
let name = path.strip_prefix(root).unwrap_or(&path).to_string_lossy().replace('\\', "/");
let kind = if metadata.is_symlink() {
"l"
} else if metadata.is_dir() {
"d"
} else {
"f"
};
let modified = metadata.modified().ok().and_then(|t| t.duration_since(SystemTime::UNIX_EPOCH).ok()).map_or(0, |d| d.as_nanos());
hash.update(format!("{kind}\0{name}\0{}\0{modified}\n", metadata.len()).as_bytes());
if metadata.is_dir() {
stamp_tree(root, &path, hash, visited, depth.saturating_add(1), stop)?;
}
}
Ok(())
}
/// Content digests reused within one build run. The first scan reads the files; subsequent
@@ -562,8 +642,15 @@ mod tests {
let old = BuildProgress::load(d.path()).unwrap();
assert_eq!(old.version, BUILD_PROGRESS_VERSION);
assert!(old.stalled());
assert_eq!(old.checked, None);
old.save(d.path()).unwrap();
assert!(std::fs::read_to_string(&path).unwrap().contains("\"version\": 1"));
assert!(std::fs::read_to_string(&path).unwrap().contains("\"version\": 2"));
// A version 1 record has no kept check; a kept one round-trips.
std::fs::write(&path, r#"{"version":1,"fingerprint":"previous","unchanged_turns":1}"#).unwrap();
assert_eq!(BuildProgress::load(d.path()).unwrap().checked, None);
let kept = BuildProgress { checked: Some(CheckedBuild { key: "k".into(), round: 3 }), ..old.clone() };
kept.save(d.path()).unwrap();
assert_eq!(BuildProgress::load(d.path()).unwrap(), kept);
for bad in [r#"{"version":99,"future":true}"#, "not json", r#"{"version":-1}"#, r#"{"app_data":"not a Craft progress record"}"#] {
std::fs::write(&path, bad).unwrap();
assert!(BuildProgress::load(d.path()).is_err());
+7
View File
@@ -1051,6 +1051,13 @@ Gaps found while using the app for real projects.
— claimed: tanish2k09, branch feature/r2.9-approvals-ui
- [ ] The new approvals strings in every catalog were written with an AI; not reviewed by native
speakers yet — pt-BR claimed: marlonferreira1800-hue, branch docs/r2.9-approvals-pt-br-review
- [x] A prompt that changes nothing in app/ still builds and starts the app again, often twice (the
builder's own rebuild_check, then the check after its turn). Keep a check whose round all
worked while the app's files and what it's compared with are unchanged
— claimed: tanish2k09, branch feature/r2.9-reuse-unchanged-check
- [ ] A check starts the app in front, with focus, on the main monitor, in the way of whatever the
person is doing. Start it behind other windows without taking focus (it's still pictured);
Play keeps opening it in front
- [x] Keep New project's content column fixed while the vertical scrollbar animates in or out,
hiding it when there is nothing to scroll, so switching tabs never shifts the page horizontally
— claimed: Codex, branch bugfix/r2.9-home-scrollbar-gutter
+7
View File
@@ -448,6 +448,13 @@ later readable run starts a fresh comparison. Checks and the existing round limi
Cancellation still stops the run; completed builder replies are saved as awaiting checks before
the post-turn scan. Broken or newer progress records and record-write failures remain errors.
A check round in which every check worked is kept (in memory, and as `checked` in the record once
`craft.json` has the round). While nothing it looks at changes (the app's files as above, the
names, sizes and times of `reference/` and `capture/`, the kind, stack, mode, plugin checks and
the project's folder), the next check, the builder's own `rebuild_check` included, takes its
results instead of building and starting the app again, and the feed says so. A round with any
failure is never kept, so Try again always looks again. Not run live.
Scripted API turns and executable CLI stand-ins cover the stop, persistence, fresh requests and
check recovery. This change has not been verified with a paid model or a live provider. Copying a
whole project keeps its progress record; Duplicate creates a new attempt with a fresh conversation
+1 -1
View File
@@ -8,7 +8,7 @@ version up to the current one, then turn the document into Rust types. The step
| File | Owner | Current version | Older files | Newer files |
|---|---|---|---|---|
| `<project>/craft.json` | `engine::workspace` (`Manifest`) | `MANIFEST_VERSION` = 4 (`version`; missing = 0; 3 adds `approvals`, 4 adds the saved builder session's mode `agent_session_deep`; a version-3 session migrates as Deep) | brought forward, saved as current | opened read-only: saving is refused |
| `<project>/inbox/build-progress.json` | `engine::workspace::progress` (`BuildProgress`; written only by the rebuild run) | `BUILD_PROGRESS_VERSION` = 1 (`version`; missing = 0) | brought forward; an absent file starts with no counted turns | the build stops and the record is left unchanged |
| `<project>/inbox/build-progress.json` | `engine::workspace::progress` (`BuildProgress`; written only by the rebuild run) | `BUILD_PROGRESS_VERSION` = 2 (`version`; missing = 0; 2 adds `checked`, the round kept while nothing it looked at changes) | brought forward; an absent file starts with no counted turns | the build stops and the record is left unchanged |
| `config.toml` (`settings::config_dir()`) | `engine::settings` (`Settings`) | `SETTINGS_VERSION` = 2 (`version`; missing = 0; 2 moved `[engines.ghidra] enabled` to `deep_mode`) | brought forward | loaded, never saved over |
| `<name>.cany/project.toml` | `engine::project` (`ProjectMeta`) | `FORMAT_VERSION` = 1 (`format_version`, required) | brought forward | refused, with "update Craft Anything" |
| `<project>/transcript.json` | `ai::context` (the API builder's conversation) | `TRANSCRIPT_VERSION` = 2 (`{version, deep, history}`; a version-1 transcript counts as Deep) | read as before; one without `deep` is resumed only in Deep | not resumed; a fresh build replaces it |
+36 -1
View File
@@ -4,6 +4,18 @@
"description": "The app as the builder last left it, and turns since it last changed. Only the rebuild run\nwrites this record. An older project without one has no counted turns.",
"type": "object",
"properties": {
"checked": {
"description": "The last check round in which every check worked, and what it looked at; while that\nstays the same, the round's results stand instead of building and starting the app again.",
"anyOf": [
{
"$ref": "#/$defs/CheckedBuild"
},
{
"type": "null"
}
],
"default": null
},
"fingerprint": {
"type": [
"string",
@@ -26,5 +38,28 @@
"additionalProperties": false,
"required": [
"version"
]
],
"$defs": {
"CheckedBuild": {
"description": "A check round kept with the state it judged.",
"type": "object",
"properties": {
"key": {
"description": "A digest of what the round's checks look at, taken after they ran.",
"type": "string"
},
"round": {
"description": "The round in `craft.json`'s `checks` whose results stand.",
"type": "integer",
"format": "uint32",
"minimum": 0
}
},
"additionalProperties": false,
"required": [
"key",
"round"
]
}
}
}