Repository navigation
refactor(projects): move projects.json and desktop.json to YAML - #285
Merged
Merged
Conversation
inference-gateway/cli#1239 records the ~/.infer file-format rule: files a human may open are YAML, only opaque caches stay JSON. projects.yaml is on the YAML side twice over - people open it to work out why a chat landed in the wrong project, and the CLI carves it out of the agent sandbox (config.go isWithinConfigSubdir) so the agent can edit it on the user's behalf. Straight rename, no fallback read and no migration: both files hold regenerable sidebar and app state, so carrying two formats would cost more than re-creating a layout once. serde_norway already backs the config.yaml reader, so this is a serializer swap rather than a new dep. The six hand-rolled read-parse-default / write-serialize copies of projects.json across projects.rs, agent.rs and export.rs collapse onto one read_projects_in / write_projects_in pair in projects.rs. The read/write Tauri commands keep their JSON-text contract with the frontend and convert at the boundary, so the webview needs no YAML parser and store.tsx is unchanged. One-time loss: a user still holding projects.json sees a clean sidebar and re-creates grouping and path overrides once. Resolves #283
edenreich
marked this pull request as ready for review
September 18, 2026 15:25
edenreich
commented
Sep 18, 2026
Contributor
|
🎉 This PR is included in version 0.43.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #283.
inference-gateway/cli#1239 records the
~/.infer/file-format rule: files a human may open are YAML, only opaque caches and cursors stay JSON.projects.jsonanddesktop.jsonwere on the wrong side of it.projects.yamlearns YAML twice over - people open it to work out why a chat landed in the wrong project, and the CLI carves it out of the agent sandbox (verified in the CLI'sconfig/config.go:isWithinConfigSubdir(absPath, "plans", "projects.yaml")) precisely so the agent can edit it on the user's behalf.Straight rename: no fallback read, no migration, no dual-format branch. Both files hold regenerable sidebar and app state, so carrying two formats would cost more than re-creating a layout once.
serde_norwayalready backs theconfig.yamlreader, so this is a serializer swap rather than a new dependency.Changes
projects.json->projects.yamlacrossprojects.rs,agent.rsandexport.rs;desktop.json->desktop.yamlinexport.rsread_projects_in/write_projects_inpair inprojects.rs, which every caller now goes through.export.rsnets -24 linesprojects.rsalready had (it returnedNull, equivalent for every.get()caller) and whatexport.rsalready didread_projects/write_projectskeep their JSON-text contract with the frontend and convert at the boundary. The webview needs no YAML parser andstore.tsx/tauri.tsare unchangeddesktop.yamlgoes throughserde_norwayon the typedDesktopData; its three Tauri commands are unaffecteddesktop-projectsskill updated: it is the agent's instruction sheet for editing this file, so its example block is now YAML and it no longer tells the agent to write JSON. Its sandbox note is corrected too -projects.yamlis carved out and writable directly,config.yamlstill promptsEXPORT_VERSIONstays 1.yaml-file, so the read path is exercised against the format a human or the agent would actually writeVerification
bun run build,cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(160 passed).New
projects_state_round_trips_yamlcovers the missing-file rebuild, the write/read round trip, that the emitted file is YAML and not JSON, and that a hand-edited file is read as written.Checked live against a real
~/.infer/projects.yaml:read_projects()now returns 37 names, 38 assignments, 37 groups and 2 path overrides, and the sandbox grant computes from them. On the oldprojects.jsonpath it returned{}.One-time loss
A user still holding
projects.jsonsees a clean sidebar and re-creates their grouping and path overrides once. Deliberate, per the issue - noBREAKING CHANGEfooter, so this stays a patch release.Cross-repo
CLI side is already done in inference-gateway/cli#1239 and the JSON names are gone from it entirely; the CLI never parses either file. No docs ticket -
inference-gateway/docsdoes not reference either file.