Skip to content

Craft Anything: understand how any software works, and craft your own.

Rust

List the current manifest and feed versions in the file formats table (#502)

NetterSilver33d243674e8c
diff --git a/crates/engine/src/feed.rs b/crates/engine/src/feed.rs
index f442c027..e61b2556 100644
--- a/crates/engine/src/feed.rs
+++ b/crates/engine/src/feed.rs
@@ -162,6 +162,15 @@ mod tests {
use crate::inbox::RequestKind;
use crate::workspace::TargetRef;
+ #[test]
+ fn file_formats_doc_lists_current_manifest_and_feed_versions() {
+ let doc = include_str!("../../../docs/file-formats.md");
+ let manifest = format!("`MANIFEST_VERSION` = {} ", crate::workspace::MANIFEST_VERSION);
+ let feed = format!("`FEED_VERSION` = {} ", FEED_VERSION);
+ assert!(doc.contains(&manifest), "docs/file-formats.md must list {manifest}");
+ assert!(doc.contains(&feed), "docs/file-formats.md must list {feed}");
+ }
+
#[test]
fn history_rebuilds_from_the_manifest() {
let d = tempfile::tempdir().unwrap();
diff --git a/docs/file-formats.md b/docs/file-formats.md
index c84b8067..179bf657 100644
--- a/docs/file-formats.md
+++ b/docs/file-formats.md
@@ -7,7 +7,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` = 1 (`version`; missing = 0) | brought forward, saved as current | opened read-only: saving is refused |
+| `<project>/craft.json` | `engine::workspace` (`Manifest`) | `MANIFEST_VERSION` = 2 (`version`; missing = 0) | brought forward, saved as current | opened read-only: saving is refused |
| `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` = 1 (`{version, history}`) | read as before | not resumed; a fresh build replaces it |
@@ -17,7 +17,7 @@ version up to the current one, then turn the document into Rust types. The step
| `<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` = 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 |
+| `<project>/feed.json` | `ai::rebuild::feed` (written by the run) | `FEED_VERSION` = 2 (`{version, items}`; a bare list = 0) | read as before, saved as current | never written over; the conversation is rebuilt from the project for display |
Other JSON in a project (`assets.json`, `inbox/`, `checks/`, evidence records) has no version yet;
add one the first time its shape changes.