Craft Anything: understand how any software works, and craft your own.
Rust
Pinned builds keep runtime models in obj folders (R2.10) (#439)
Afloatfed67edd3854
diff --git a/crates/engine/src/pins.rs b/crates/engine/src/pins.rsindex ff7f5eba..8b28d310 100644--- a/crates/engine/src/pins.rs+++ b/crates/engine/src/pins.rs@@ -34,9 +34,15 @@ use std::time::Duration;pub const PINNED: &str = "pinned";pub const PIN_FILE: &str = "pin.json";/// The current `pin.json` format version.-pub const PIN_VERSION: u32 = 1;-/// Steps that bring an older `pin.json` forward (none yet: version 1 is the first).-const PIN_STEPS: &[versioned::Step<Value>] = &[];+pub const PIN_VERSION: u32 = 2;+/// Version 2 remembers the program selected for an argument-free launch inside the copied app.+const PIN_STEPS: &[versioned::Step<Value>] = &[pin_v1_to_v2];++fn pin_v1_to_v2(doc: &mut Value) -> Result<(), String> {+ let object = doc.as_object_mut().ok_or_else(|| "a pin must be an object".to_string())?;+ object.insert("program".into(), Value::Null);+ Ok(())+}const _: () = assert!(PIN_STEPS.len() as u32 + 1 == PIN_VERSION, "one step per pin.json version after the first");/// A start that ends within this long is reported as having quit straight away.pub const QUICK_EXIT: Duration = Duration::from_secs(2);@@ -100,6 +106,10 @@ pub struct Pin {/// What a light pin shares with the project.#[serde(default)]pub shared_bytes: u64,+ /// The selected program relative to the copied app, for a launch without arguments.+ /// Older pins and launches through an external runtime keep the existing discovery path.+ #[serde(default, skip_serializing_if = "Option::is_none")]+ pub program: Option<PathBuf>,}impl Pin {@@ -118,6 +128,33 @@ impl Pin {pub fn log_path(&self, ws: &Workspace) -> PathBuf {self.dir(ws).join("last-run.log")}++ /// Resolve the recorded program within the copy; old pins retain their discovery behavior.+ pub(crate) fn launch(&self, ws: &Workspace, godot: Option<&Path>) -> Result<(PathBuf, Vec<String>), ToolError> {+ let app = self.app_dir(ws);+ if self.mode.keeps_copy()+ && let Some(relative) = &self.program+ {+ if relative.as_os_str().is_empty() || !relative.components().all(|part| matches!(part, std::path::Component::Normal(_))) {+ return Err(ToolError::invalid("The pin's recorded program must be a relative path inside its app."));+ }+ let program = app.join(relative);+ if !program.is_file() || !crate::outputs::is_program(&program) {+ return Err(ToolError::new(ErrorCode::NotFound, "The program recorded by this pin is missing or cannot be started.")+ .with_remediation("Restore the pin's program or pin a working build again."));+ }+ let resolved = program.canonicalize().map_err(|e| ToolError::io(program.display(), e))?;+ let root = app.canonicalize().map_err(|e| ToolError::io(app.display(), e))?;+ if !resolved.starts_with(root) {+ return Err(ToolError::invalid("The pin's recorded program points outside its app."));+ }+ return Ok((program, Vec::new()));+ }+ crate::outputs::launch(&app, godot).ok_or_else(|| {+ ToolError::new(ErrorCode::NotFound, "There's nothing to start: no built program in this pin.")+ .with_remediation("Pin a working build or open the folder to look.")+ })+ }}fn pin_dir(ws: &Workspace, id: u32) -> PathBuf {@@ -348,7 +385,8 @@ pub fn create(ws: &Workspace, mode: PinMode, name: Option<&str>, godot: Option<&return Err(ToolError::invalid("Live pins aren't made any more: one only opened the latest build, as Play does.").with_remediation("Pin it as frozen or light."));}- let (program, _) = start_of(&ws.app_dir(), godot)?;+ let (program, args) = start_of(&ws.app_dir(), godot)?;+ let recorded_program = if args.is_empty() { program.strip_prefix(ws.app_dir()).ok().map(Path::to_path_buf) } else { None };let parent = ws.root.join(PINNED);std::fs::create_dir_all(&parent).map_err(|e| ToolError::io(parent.display(), e))?;let mut id = list(ws).iter().map(|p| p.id).max().unwrap_or(0).saturating_add(1);@@ -368,12 +406,10 @@ pub fn create(ws: &Workspace, mode: PinMode, name: Option<&str>, godot: Option<&(None, Some(r)) => format!("{project} · round {r}"),(None, None) => format!("{project} · pin {id}"),};- let mut pin = Pin { version: PIN_VERSION, id, name, mode, created_ms: now_ms(), round, bytes: 0, shared_bytes: 0 };+ let mut pin = Pin { version: PIN_VERSION, id, name, mode, created_ms: now_ms(), round, bytes: 0, shared_bytes: 0, program: recorded_program };let made = (|| {(pin.bytes, pin.shared_bytes) = copy(ws, &program, &pin.app_dir(ws), mode, progress)?;- if crate::outputs::launch(&pin.app_dir(ws), godot).is_none() {- return Err(ToolError::internal("The copy was made, but there's nothing to start in it."));- }+ pin.launch(ws, godot)?;save(ws, &pin)})();if let Err(e) = made {@@ -552,6 +588,18 @@ mod tests {#[cfg(not(unix))]fn mark_program(_: &Path) {}+ #[test]+ fn recorded_program_paths_cannot_escape_the_pin() {+ let d = tempfile::tempdir().unwrap();+ let ws = built(d.path());+ let mut pin = create(&ws, PinMode::Frozen, None, None, &mut |_, _| true).unwrap();+ assert_eq!(pin.program, Some(PathBuf::from("target/release").join(exe("snake"))));+ for relative in [PathBuf::new(), PathBuf::from("../other"), d.path().join("outside")] {+ pin.program = Some(relative);+ assert_eq!(pin.launch(&ws, None).unwrap_err().code, ErrorCode::BadInput);+ }+ }+#[test]fn a_frozen_pin_copies_the_app_and_its_program_but_not_what_a_build_makes() {let d = tempfile::tempdir().unwrap();@@ -580,6 +628,46 @@ mod tests {assert!(!ws.root.join(PINNED).exists());}+ #[test]+ fn pins_keep_obj_models_and_leave_out_managed_compiler_intermediates() {+ const MODEL: &str = "o triangle\nv 0 0 0\nv 1 0 0\nv 0 1 0\nf 1 2 3\n";+ for mode in [PinMode::Frozen, PinMode::Light] {+ let d = tempfile::tempdir().unwrap();+ let ws = built(d.path());+ let app = ws.app_dir();+ for folder in ["assets/obj", "assets/models"] {+ std::fs::create_dir_all(app.join(folder)).unwrap();+ std::fs::write(app.join(folder).join("hero.obj"), MODEL).unwrap();+ }+ for extension in ["csproj", "fsproj", "vbproj"] {+ let project = app.join(extension);+ std::fs::create_dir_all(project.join("obj")).unwrap();+ std::fs::write(project.join(format!("Game.{extension}")), "<Project />").unwrap();+ std::fs::write(project.join("obj/intermediate.bin"), [7; 256]).unwrap();+ }+ let size = estimate(&ws, None).unwrap();+ let pin = create(&ws, mode, None, None, &mut |_, _| true).unwrap();+ let copy = pin.app_dir(&ws);+ for folder in ["assets/obj", "assets/models"] {+ assert!(copy.join(folder).join("hero.obj").is_file(), "{mode:?}: {folder} keeps its runtime model");+ assert_eq!(std::fs::read_to_string(copy.join(folder).join("hero.obj")).unwrap(), MODEL, "{mode:?}: {folder}");+ }+ for extension in ["csproj", "fsproj", "vbproj"] {+ assert!(copy.join(extension).join(format!("Game.{extension}")).is_file(), "the project source stays");+ assert!(!copy.join(extension).join("obj").exists(), "compiler intermediates stay behind");+ }+ assert!(!copy.join("target/release/deps").exists());+ assert_eq!(pin.bytes + pin.shared_bytes, size.bytes, "the estimate includes both models");+ if mode == PinMode::Light {+ assert_eq!(pin.shared_bytes, (2 * MODEL.len()) as u64, "both runtime models can be shared");+ } else {+ assert_eq!(pin.shared_bytes, 0);+ }+ std::fs::remove_file(app.join("assets/obj/hero.obj")).unwrap();+ assert_eq!(std::fs::read_to_string(copy.join("assets/obj/hero.obj")).unwrap(), MODEL, "the pin survives removal from the project");+ }+ }+#[test]fn a_pin_leaves_out_old_copies_of_its_program_but_keeps_helpers() {let d = tempfile::tempdir().unwrap();@@ -739,6 +827,10 @@ mod tests {fn an_older_or_newer_pin_file_is_read() {let old = read_pin(br#"{"id":2,"name":"A","mode":"live","created_ms":5}"#).unwrap();assert_eq!((old.version, old.mode, old.bytes), (PIN_VERSION, PinMode::Live, 0));+ assert_eq!(old.program, None);+ let frozen = read_pin(br#"{"version":1,"id":3,"name":"Old copy","mode":"frozen","created_ms":5,"program":"formerly-unknown"}"#).unwrap();+ assert_eq!(frozen.version, PIN_VERSION);+ assert_eq!(frozen.program, None, "the migration cannot invent the old pin's selected program");let newer = read_pin(br#"{"version":9,"id":2,"name":"A","mode":"frozen","created_ms":5,"colour":"red"}"#).unwrap();assert_eq!(newer.version, 9, "a newer pin keeps its version");assert!(read_pin(b"[]").is_err());diff --git a/crates/engine/src/tools/pin_tools.rs b/crates/engine/src/tools/pin_tools.rsindex f910a09a..4313ce05 100644--- a/crates/engine/src/tools/pin_tools.rs+++ b/crates/engine/src/tools/pin_tools.rs@@ -187,6 +187,10 @@ pub(crate) fn start(ctx: &mut Ctx<'_>, app: &Path, log: &Path, another: bool, lareturn Err(ToolError::new(ErrorCode::NotFound, "There's nothing to start: no built program here.").with_remediation("Finish a build first (rebuild), or open the folder to look."));};+ start_program(ctx, app, log, another, label, (program, args))+}++fn start_program(ctx: &mut Ctx<'_>, app: &Path, log: &Path, another: bool, label: &str, (program, args): (PathBuf, Vec<String>)) -> Result<Value, ToolError> {if let Some(dir) = log.parent() {std::fs::create_dir_all(dir).map_err(|e| ToolError::io(dir.display(), e))?;}@@ -264,7 +268,8 @@ fn project_pin_open(ctx: &mut Ctx<'_>, params: Value) -> Result<ToolOutput, Toollet p: OpenParams = parse_params(params)?;let ws = open_project(&p.project)?;let pin = pins::get(&ws, p.pin)?;- let mut out = start(ctx, &pin.app_dir(&ws), &pin.log_path(&ws), p.another, &pin.name)?;+ let launch = pin.launch(&ws, godot(ctx).as_deref())?;+ let mut out = start_program(ctx, &pin.app_dir(&ws), &pin.log_path(&ws), p.another, &pin.name, launch)?;if let Some(o) = out.as_object_mut() {o.insert("pin".into(), json!(pin.id));}@@ -306,6 +311,45 @@ mod tests {use crate::workspace::TargetRef;use crate::{CallOptions, Caller, Consent, Engine};+ #[cfg(unix)]+ #[test]+ fn opening_a_pin_keeps_the_program_selected_before_copying() {+ use std::os::unix::fs::PermissionsExt;+ use std::time::{Duration, SystemTime};++ let d = tempfile::tempdir().unwrap();+ let ws = Workspace::create(d.path(), "Game", "a packaged game", TargetRef::None).unwrap();+ let build = ws.app_dir().join("Build");+ std::fs::create_dir_all(build.join("obj")).unwrap();+ let game = build.join("game");+ let helper = build.join("obj/helper");+ for (path, output, seconds) in [(&game, "selected-game", 20), (&helper, "wrong-helper", 10)] {+ std::fs::write(path, format!("#!/bin/sh\nprintf '%s\\n' '{output}'\n")).unwrap();+ std::fs::set_permissions(path, std::fs::Permissions::from_mode(0o755)).unwrap();+ let times = std::fs::FileTimes::new().set_modified(SystemTime::UNIX_EPOCH + Duration::from_secs(seconds));+ std::fs::File::options().write(true).open(path).unwrap().set_times(times).unwrap();+ }+ assert_eq!(crate::outputs::packaged_program(&build), Some(game));+ let e = Engine::new(crate::testing::session());+ let call = |id: &str, params: Value| {+ e.call(id, params, CallOptions::new(Caller::Cli).with_consent(Consent::Granted)).map(|out| out.to_json()["result"].clone())+ };+ for mode in ["frozen", "light"] {+ let made = call("project_pin_create", json!({"project": ws.root, "mode": mode})).unwrap();+ let id = made["pin"]["id"].as_u64().unwrap() as u32;+ let pin = pins::get(&ws, id).unwrap();+ let copy = pin.app_dir(&ws);+ let future = std::fs::FileTimes::new().set_modified(SystemTime::now() + Duration::from_secs(60));+ std::fs::File::options().write(true).open(copy.join("Build/obj/helper")).unwrap().set_times(future).unwrap();+ assert_eq!(crate::outputs::packaged_program(©.join("Build")), Some(copy.join("Build/obj/helper")));+ let opened = call("project_pin_open", json!({"project": ws.root, "pin": id})).unwrap();+ assert_eq!(opened["started"], copy.join("Build/game").display().to_string());+ assert_eq!(pins::tail(&pin.log_path(&ws)), "selected-game");+ std::fs::remove_file(copy.join("Build/game")).unwrap();+ assert_eq!(call("project_pin_open", json!({"project": ws.root, "pin": id})).unwrap_err().code, ErrorCode::NotFound);+ }+ }+#[test]fn pin_list_rename_and_remove_from_the_cli() {let d = tempfile::tempdir().unwrap();diff --git a/crates/engine/src/workspace.rs b/crates/engine/src/workspace.rsindex 5af5ffd3..96ea5d69 100644--- a/crates/engine/src/workspace.rs+++ b/crates/engine/src/workspace.rs@@ -29,12 +29,28 @@ use std::path::{Path, PathBuf};pub const MANIFEST: &str = "craft.json";/// Folders a copy of a project leaves out: what a build makes again, which can be gigabytes.-const REBUILT: &[&str] = &["node_modules", "target", ".godot", "Library", "Temp", "obj", ".venv", "__pycache__", ".next", ".turbo"];+const REBUILT: &[&str] = &["node_modules", "target", ".godot", "Library", "Temp", ".venv", "__pycache__", ".next", ".turbo"];+/// An `obj` directory is ambiguous: these neighbouring project files identify managed build output.+const MANAGED_PROJECTS: &[&str] = &["csproj", "fsproj", "vbproj"];/// How deep a copy of a project's folders goes.const COPY_DEPTH: usize = 64;pub(crate) fn rebuilt(p: &Path) -> bool {- p.file_name().and_then(|n| n.to_str()).is_some_and(|n| REBUILT.contains(&n)) && p.is_dir()+ let Some(name) = p.file_name().and_then(|n| n.to_str()) else { return false };+ if name != "obj" {+ return REBUILT.contains(&name) && p.is_dir();+ }+ if !p.is_dir() {+ return false;+ }+ // Runtime models commonly live in assets/obj. Without evidence that a folder is compiler+ // output, keep it; an unreadable or unusually large parent must not cause data to be omitted.+ p.parent().and_then(|parent| std::fs::read_dir(parent).ok()).is_some_and(|entries| {+ entries.take(4096).flatten().any(|entry| {+ entry.path().extension().and_then(|e| e.to_str()).is_some_and(|ext| MANAGED_PROJECTS.iter().any(|project| ext.eq_ignore_ascii_case(project)))+ && entry.file_type().is_ok_and(|kind| kind.is_file())+ })+ })}/// Copy a folder's files and folders (links are skipped), leaving out what `skip` says.@@ -1119,6 +1135,23 @@ mod tests {assert_eq!(Workspace::list(dir.path()).len(), 2, "folders without a manifest are skipped");}+ #[test]+ fn project_copies_keep_runtime_obj_folders() {+ let dir = tempfile::tempdir().unwrap();+ let ws = Workspace::create(dir.path(), "Models", "a model viewer", TargetRef::None).unwrap();+ let app = ws.app_dir();+ std::fs::create_dir_all(app.join("assets/obj")).unwrap();+ std::fs::write(app.join("assets/obj/hero.obj"), "v 0 0 0\n").unwrap();+ std::fs::create_dir_all(app.join("managed/obj")).unwrap();+ std::fs::write(app.join("managed/Viewer.csproj"), "<Project />").unwrap();+ std::fs::write(app.join("managed/obj/intermediate.bin"), [7; 256]).unwrap();+ let copy = ws.duplicate("Models copy").unwrap().app_dir();+ assert!(copy.join("assets/obj/hero.obj").is_file(), "a project copy keeps its runtime model");+ assert_eq!(std::fs::read_to_string(copy.join("assets/obj/hero.obj")).unwrap(), "v 0 0 0\n");+ assert!(copy.join("managed/Viewer.csproj").is_file());+ assert!(!copy.join("managed/obj").exists());+ }+#[test]fn checks_from_older_projects_are_judged_as_they_were() {let old = |json: &str| serde_json::from_str::<CheckResult>(json).unwrap();diff --git a/docs/ROADMAP.md b/docs/ROADMAP.mdindex 5127a879..97187a69 100644--- a/docs/ROADMAP.md+++ b/docs/ROADMAP.md@@ -909,12 +909,13 @@ Gaps found while using the app for real projects.Owner: maintainers · Status: in progressKeep a build that works at hand: pin it, and open it from the sidebar whatever the builder doesto the project next. Pins are the engine's (tools), kept in the project's `pinned/` folder.+- [x] Keep runtime assets in `obj` folders when pinning or copying a project; only exclude recognised compiler intermediates, and retain the selected direct-launch program in a pin (#274).- [x] Pin a build as a frozen copy (the default: the app's files and the program, without whata build makes again, in `pinned/<n>/`, with its size shown first) or as a live pin that runsthe project's app as it is; open, stop, rename and remove pins; one copy runs per folder(pins and Play alike) unless another is asked for; a start that quits at once says so withits last output (`project_pin_create`, `project_pins_list`, `project_pin_open`,- `project_pin_stop`, `project_pin_rename`, `project_pin_delete`; `pin.json` version 1;+ `project_pin_stop`, `project_pin_rename`, `project_pin_delete`; `pin.json` version 2 (version 1 still reads);`platform::Launched`)- [x] A light pin in place of the live one, which only opened what Play opens: the program, thecode and anything a program may write to are copied, dependencies and media are hard-linkeddiff --git a/docs/STATUS.md b/docs/STATUS.mdindex 6f5abfb8..b4c36d96 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -31,6 +31,7 @@ workspace clippy, layers, fmt and the secret scan of all history were clean. Chi| WASM plugins | With `--features wasm-plugins`: `[[plugins.wasm]]` components exporting `craft-anything:plugin/tools` add tools, and ones exporting `craft-anything:plugin/checks` add checks run after each kind's own (they get the build's file list as JSON) (added, listed, turned on or off and removed in Settings → Plugins or with `plugins_add`/`plugins_remove`/`plugins_list`); no imports, fresh instance per call, fuel and memory limits | Tests with components written in WAT (describe, call, checks, a looping call stopped, imports refused, end to end through the engine); `examples/wasm-plugin-wordcount` built from Rust and loaded || WebAssembly tag interfaces | `formats_wasm_compare` resolves retained imported and defined tag exports to their declared parameter types. Identical unresolved or invalid diagnostics may still count as unchanged; those counts do not establish interface compatibility, and invalid/partial limitations remain present | Synthetic core modules with tag changes and re-exports, mixed index spaces, import/tag limits, and missing or non-function type references; formats and engine tests. No real module corpus or WebAssembly execution was used for this correction || Questions and approvals | A file inbox per project; `core_person_ask`, `core_action_approve` and MCP consent requests become cards in the app | Cross-handle round-trip tests, a full approval round trip through the engine |+| Runtime assets in pinned builds | Frozen and light pins, size estimates and project copies keep runtime files in `obj` folders. An `obj` directory beside a regular C#, F# or Visual Basic project file is still recognised as compiler output; ambiguous folders are retained. New pins record the direct-launch program relative to the copy so a newer helper cannot replace it; older pins retain discovery behavior | Synthetic filesystem tests cover both pin modes, model bytes, compiler-output controls and project duplication. A Linux tool-level regression starts temporary scripts through `project_pin_open`, with a newer `Build/obj/helper`, and verifies the originally selected program and its output; a missing recorded program is refused. No real pinned application was launched for this correction || Desktop app | Simple mode: sidebar with New project and the project history (kept across restarts); New project either makes something or just looks inside an app or file, a website or a game's files; a Game files screen (a game's archives; pictures from Unreal paks, Unity .assets files and Unity bundles saved as PNG after the person confirms they may unpack the game; uncompressed textures and the block formats DXT1, DXT5 and BC4–BC7), make prompt with picture attachments and, for anything recreated, a Clean room / Deep choice (also in the title bar; in Clean room, Just look inside, Game files, opening a file and the workbench ask for Deep mode instead), project screen (steps with the time spent and the AI cost and tokens of every build, saved in the project's usage.json by the run (a coding agent's figure is shown as an estimate at API prices, not the bill), what the build is on now and its activity as it arrives (kept in `build-activity.log`), pinned builder checklist, feed, question and approval cards, a Continue card when a build was paused or stopped part-way (the app or computer closed; the project shows Interrupted) that carries on the builder's own session instead of starting over, and "It's done" beside Continue or Try again to keep the build as it is (`project_build_finish`), checks with screenshots and the requirements not met yet, the builder's open questions, preview, play, folder, follow-ups while it builds, which Claude Code takes at its next step; Up in the prompt box takes back the last note still waiting). Projects can start in a folder the person picks, whose files are either the app, edited in place, or material to start from (asked, or the answer remembered in Settings), and are listed from any number of folders (`project_folders`, `project_list`, `rebuild --project-folder`). Make says which AI builds ("Built by": automatic, or any AI that can build, by name); a pick stays with the project and builds its later changes. With nothing to build with, Start offers the coding agents found on the computer. Settings → AI turns an AI off or removes it, and sets how hard the Claude API or Claude Code thinks (every Claude level, low to max; also `ai effort` in the CLI). In the prompt box, Up at the very start and Down at the very end go through earlier prompts when no note is waiting. Questions about a build ("Just ask" under the prompt box, or a message starting with `/btw`, the first slash command; `rebuild_question_ask`) are answered in the conversation, where each folds away and is kept in the project, without a build or a round and changing nothing: Claude Code answers from a read-only copy of the builder's own session. Under each project's prompt box, "Builder's questions: Ask me / Decide yourself" chooses whether the builder's questions come to the person as cards or are decided by the builder, which says what it chose (`project_questions_set`; the default is in Settings and follows Auto mode until picked). Projects can be renamed, duplicated and deleted (right-click in the sidebar, or the project's page; a delete keeps the person's own files). A build can be pinned (Pin this build on its page, or `project_pin_*` from the CLI and MCP): a frozen copy in the project's pinned/ folder (the default) or a light one that shares dependencies and media with the project through hard links (each one's size shown first), opened from the sidebar's collapsible Pinned section (icons with a running dot when folded); a pin or Play runs once per folder unless another copy is asked for, and a start that quits at once says so with its last output. Typed drafts survive a restart. In a narrow window the sidebar folds to icons and the project's details move above its feed; messages float over the screen and errors stay until dismissed. Advanced mode: workbench with every panel wired to real tools, as a screen beside the projects (builds and their questions stay a click away) | UI unit and smoke tests (egui_kittest), offscreen snapshots of every screen || CLI | Every tool, `--deep` or `--clean-room` for one run (never saved), `rebuild` (including `--continue-in`, and `--resume` to carry on a stopped build), `mcp --inbox`, `ai`, `setup`, `doctor`, `report` | CLI integration tests || SQLite database files (`db_sqlite_show`) | A rowid alias column (`INTEGER PRIMARY KEY`, including the table-constraint form) shows the rowid; `DESC`, non-`INTEGER` and composite keys keep their stored values | Hand-built fixtures; generated files compared with the official SQLite library |diff --git a/docs/file-formats.md b/docs/file-formats.mdindex 004fb58e..8dcdf25d 100644--- a/docs/file-formats.md+++ b/docs/file-formats.md@@ -15,7 +15,7 @@ version up to the current one, then turn the document into Rust types. The step| `<project>/checks/round-N/self-test.json` | `engine::self_test` (written by the built game's `--self-test`, read by `SelfTestCheck`) | 1 (`version`; missing = 1) | — | the check fails and says so || `<project>/usage.json` | `engine::workspace` (`ProjectUsage`; written only by the rebuild run) | `USAGE_VERSION` = 1 (`version`; missing = 0) | read as before, saved as current | read as far as its fields are known, never written over || `<project>/questions.json` | `engine::questions` (`AskedQuestion`, written by `rebuild_question_ask`) | `QUESTIONS_VERSION` = 1 (`{version, items}`) | read as before | read as far as its fields are known |-| `<project>/pinned/<n>/pin.json` | `engine::pins` (`Pin`) | `PIN_VERSION` = 1 (`version`; missing = 1) | brought forward | read as far as its fields are known |+| `<project>/pinned/<n>/pin.json` | `engine::pins` (`Pin`) | `PIN_VERSION` = 2 (`version`; missing = 1; 2 records the selected program for a copied direct launch) | brought forward | read as far as its fields are known || `<folder>/standin.json` | `engine::tools::standin_tools` (`analysis::standin::StandIn`; written only by `web_standin_build`) | `STANDIN_VERSION` = 1 (`version`, required) | brought forward | refused, with "update Craft Anything", and never written over || `<project>/feed.json` | `ai::rebuild::feed` (written by the run) | `FEED_VERSION` = 1 (`{version, items}`; a bare list = 0) | read as before, saved as current | never written over; the conversation is rebuilt from the project for display |