rename & spec #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
use skill /hero_crates_best_practices_check
put a readme in each of the folders
organize the repo well
initial start
put a spec document in each directory (SPECIFICATIONS.md)
Here is a minimal spec for CodeSmith.
CodeSmith — Minimal Specification
1. Purpose
CodeSmith is a remote development orchestration module that prepares and manages secure development environments on remote servers over SSH.
Its first goal is simple:
This is only the skeleton for further work.
2. High-Level Concept
CodeSmith consists of two parts:
2.1 Local controller
Runs on the operator/developer machine.
Responsibilities:
2.2 Remote CodeSmith server
Runs on each managed server.
Responsibilities:
3. Core Design Principles
3.1 SSH-first
No public service exposure is required initially.
All communication happens through:
3.2 OpenRPC-native
All remote operations are exposed through a clear OpenRPC interface.
This allows:
3.3 Secure-by-default
Development happens in isolated contexts.
Initial security model:
3.4 Workspace-oriented
The primary unit of work is a workspace.
A workspace contains:
4. Initial Scope
The first version only needs to support:
4.1 Node preparation
Prepare a target server over SSH so it can run CodeSmith.
Includes:
4.2 Remote server startup
Ensure the CodeSmith server is running on the node.
Includes:
4.3 Local forwarding
Forward the remote CodeSmith API endpoint to a local socket.
Examples:
The controller should maintain a mapping such as:
4.4 User management
Remote server can:
4.5 Workspace management
Remote server can:
4.6 Sandbox skeleton
Remote server can create a minimal isolated execution context.
At this stage, sandbox may simply mean:
5. Non-Goals for the First Skeleton
Not required yet:
6. Architecture
6.1 Components
Local Controller
Responsible for:
Remote Agent / Server
Responsible for:
Workspace
A directory structure representing an isolated development environment.
Sandbox
Logical isolation boundary attached to a workspace.
7. Basic Flow
7.1 Register / prepare node
7.2 Create workspace
7.3 Use workspace
Later tools or agents connect through the controller to the node and operate only inside that workspace context.
8. Security Model (Minimal)
8.1 Trust boundaries
8.2 Privilege model
8.3 Isolation baseline
Each workspace should at minimum have:
9. Minimal Remote API Surface (OpenRPC)
Suggested first methods:
Node / service
node.infonode.healthnode.versionUser management
user.createuser.getuser.listuser.deleteWorkspace management
workspace.createworkspace.getworkspace.listworkspace.deleteSandbox / environment
sandbox.createsandbox.getsandbox.deleteCode / repository setup
Implementation Specification: CodeSmith Repository Reorganization
Objective
Reorganize the hero_codesmith repository to follow the Hero crate best practices structure, create the required crate directories with README.md and SPECIFICATIONS.md files, and align the project with the CodeSmith specification for remote development orchestration.
Requirements
codesmith_lib,codesmith_ui,codesmith_server,codesmith_ssh,codesmithsrc/directory references (already deleted in working tree)Files to Create/Modify
Implementation Plan
Step 1: Update Root Cargo.toml to Workspace Configuration
crates/Step 2-4: Create codesmith_lib Crate
Step 5-8: Create codesmith_server Crate
Step 9-10: Create codesmith_sdk Crate
Step 11-12: Create codesmith_ui Crate
Step 13-14: Create codesmith_ssh Crate
Step 15-16: Create codesmith CLI Crate
Step 17-18: Create codesmith_examples Crate
Step 19-20: Update Root Files
Acceptance Criteria
cargo checkpasses for all crates~/hero/var/sockets/conventionNotes
codesmithprefix as per issue requirementscrates/codesmith_lib/src/hero_rpc_deriveandherolib_corefrom herolib repositoryPlease review and approve this spec to proceed with implementation.
Test Results
Summary
All tests pass successfully.
codesmith_lib
code::git::tests::test_get_current_branch- ✅code::git::tests::test_get_remote_url- ✅code::git::tests::test_has_uncommitted_changes- ✅code::reorganize::tests::test_analyze_repos- ✅code::reorganize::tests::test_extract_repo_info- ✅code::scanner::tests::test_find_git_repos- ✅error::tests::test_dev_mgr_error_display- ✅sessions::changes::tests::test_get_changes_summary- ✅sessions::crud::tests::test_create_session- ✅sessions::crud::tests::test_delete_session- ✅sessions::crud::tests::test_list_sessions- ✅sessions::snapshot::tests::test_create_snapshot- ✅sessions::snapshot::tests::test_list_snapshots- ✅system::btrfs::tests::test_create_subvolume- ✅system::checks::tests::test_verify_system- ✅system::users::tests::test_get_username- ✅system::users::tests::test_parse_id_output- ✅system::users::tests::test_validate_name- ✅Other crates
Implementation Complete
Summary
The CodeSmith repository has been reorganized to follow the Hero crate best practices structure.
Changes Made
Root Level
Cargo.toml- Converted to workspace configuration with 7 crate membersREADME.md- Updated with new architecture and crate documentationbuildenv.sh- Updated with new project name and binaries listNew Crates Created
codesmith_libcodesmith_servercodesmith_sdkcodesmith_uicodesmith_sshcodesmithcodesmith_examplesFiles Modified
crates/codesmith_lib/src/lib.rs- Removedtuimodule reference, updated crate docscrates/codesmith_lib/src/main.rs- Moved to separate CLI crateBuild Status
cargo checkpassescargo testpasses (18 tests)Socket Convention
All services use Unix sockets at
~/hero/var/sockets/:codesmith_server.sockcodesmith_ui.sockOpenRPC API
The server exposes 16 OpenRPC methods:
rpc.discover,rpc.healthnode.info,node.versionuser.create,user.get,user.list,user.deleteworkspace.create,workspace.get,workspace.list,workspace.deletesandbox.create,sandbox.get,sandbox.deleterepo.initNext Steps