feat(registryctl): add editor-ready project initialization#404
Conversation
|
1.0 integration review disposition: keep this PR as the replacement for the preserved local Required before integration:
The existing remote matrix is green for |
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
1cb5d9d to
4be3768
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4be3768a7e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| pub status: &'static str, | ||
| pub project: String, | ||
| pub project_kind: InitProjectKind, | ||
| pub output: PathBuf, |
There was a problem hiding this comment.
Serialize init paths without failing on non-UTF8
When init --format json is used on Unix with a non-UTF-8 destination path, this PathBuf field makes serde_json::to_string_pretty fail with path contains invalid UTF-8 characters after the initializer has already copied or written the project. The previous starter report converted paths to display strings, and the Relay initializer also printed display paths, so JSON mode now leaves a successfully-created project behind while exiting nonzero; please convert or reject paths before doing writes so the init command remains atomic.
Useful? React with 👍 / 👎.
| setup_registry_project_editor(&ProjectEditorSetupOptions { | ||
| project_directory: options.directory.clone(), | ||
| })?; |
There was a problem hiding this comment.
Roll back starter files when editor setup fails
When editor publication fails after the starter has been copied—for example on a project directory hosted on a filesystem that rejects the hard-link based publication used by setup_registry_project_editor—init --from returns an error but leaves the copied starter behind. A retry then hits the earlier “destination must be absent or empty” guard, so the user has to manually clean up a project that was otherwise already copied; either make the editor step non-fatal for init or roll back the copied starter on this post-copy failure path.
Useful? React with 👍 / 👎.
Summary
registryctl init --fromregistryctl authoring editor --project-dir <dir>for existing projectsregistryctl.init.v1JSON report through--format json, with concise human output by defaultCloses #394.
Part of #399 and the candidate-neutral first-run work in #198.
This PR is the reviewed replacement for the preserved local
codex/registryctl-init-outputwork. That dirty local checkout was not rebased, staged, reset, or merged.User and developer impact
New starter projects receive
.vscode,.zed, and.registry-stack-editorsupport automatically. Existing projects can opt in with the standalone command. The five embedded schemas remain matched to the runningregistryctlbinary without a source checkout or network retrieval.Existing generated editor bundles refresh only after manifest and schema hashes verify. Custom settings, malformed manifests, symlinks, and unexpected file changes remain explicit conflicts rather than being silently overwritten.
Human init output is safe for spaces, quotes, backslashes, C0/C1 controls, newline, carriage return, tab, ESC, and relative leading-dash paths.
--format jsonremains lossless and machine-parseable. Normal paths remain concise and next commands remain shell-usable.Portable YAML mappings reserve the documented path suffixes at any depth. Exact workspace-root routing remains future editor-extension/LSP work.
Current-base preservation
The consolidated one-commit packet is directly based on
c1426fcd295f99800a73287d93561adc49027d9eand preserves integrated #402 typed target attributes, #405 canonical evaluation-format semantics, #383 aggregate diagnostics, #384 source-free credential rejection, and #406's dependency graph.Validation
c1426fcd295f99800a73287d93561adc49027d9eAn interactive VS Code/Zed desktop smoke remains candidate evidence because the earlier desktop capture service could not attach. VS Code also requires the recommended Red Hat YAML extension.
Merge only after the full remote matrix is green on exact head
4be3768a7e80ae24bfcf5d631c84cb6b6b9063fe.