locations of repos need to change #24
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_foundry#24
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?
there is only one argument (and optional, recommend not to change) which is the foundry dir
default ~/hero/var/foundry
~/hero/var/foundry/$reponame/db.foundry
~/hero/var/foundry/$reponame/webdav/
change .fossil everywhere to .foundry
make sure that we use this convention everywhere, remove all arguments not needed
Implementation Spec for Issue #24
Objective
Rename the workspace's path/identifier convention from
fossiltofoundry, change the per-repo on-disk layout to a per-repo directory containing both the database file (db.foundry) and awebdav/subdirectory, default the foundry base directory to~/hero/var/foundry, and reduce every Hero binary's CLI to a single optional argument: the foundry directory.Requirements
~/hero/var/foundry<base>/$reponame/db.foundry+<base>/$reponame/webdav/.fossilbecomes.foundryeverywhere (also collapse stray.forgereferences in tests/examples/docs to.foundryto satisfy "use this convention everywhere")fossilbecomesfoundryin defaultsfossilbecomefoundry(where they refer to this concept; upstream Fossil SCM project mentions inREADME.md/docs/IMPLEMENTATION.mdmay keep "Fossil" only when explicitly naming the upstream project)Files to Modify/Create
Core library
crates/hero_foundry_core/src/repo/mod.rs— update doc-comment examples to per-repodb.foundrypaths.crates/hero_foundry_core/src/repo/database.rs— rename localis_fossiltois_foundry.crates/hero_foundry_core/src/repo/metadata.rs— module/struct doc comments updated.crates/hero_foundry_core/src/repo/naming.rs— rename testnormalize_core_dot_fossiland asserted strings tocore.foundry/core_foundry.crates/hero_foundry_core/src/fs/errors.rs— rename pattern varfossil_errtorepo_err.crates/hero_foundry_core/src/fs/{mod,find,interface}.rsandfs/README.md— replace.forgedoctest paths withdb.foundry.crates/hero_foundry_core/src/sync/{mod,client}.rs— replace.forgedoctest paths withdb.foundry.crates/hero_foundry_core/src/lib.rsandsrc/tools/git_import.rs— replace.forgedoctest paths withdb.foundry.crates/hero_foundry_core/src/tools/demo_seed.rs— change repo target paths from<dir>/<name>.forgeto per-repo dirs<dir>/<name>/db.foundry.crates/hero_foundry_core/tests/sync_tests.rs,tests/race_condition_tests.rs,tests/staging_stress_tests.rs— replace*.forgetest paths with<tmp>/<name>/db.foundry.Server
crates/hero_foundry_server/src/main.rs— single CLI arg--foundry-dir. Remove all other flags. Always read-write, default to~/hero/var/foundry, seed<base>/core/db.foundry.crates/hero_foundry_server/src/state.rs—ServerConfig.fossil_dirbecomesfoundry_dir. Dropwebdav_storage_path. Addget_repo_webdav_path(name).crates/hero_foundry_server/src/discovery.rs—discover_fossil_reposbecomesdiscover_foundry_repos; algorithm enumerates immediate subdirs that containdb.foundry.fossil_pathfield becomesdb_path.crates/hero_foundry_server/src/openrpc/server_methods.rs—create_repositorywrites<foundry_dir>/<name>/db.foundrypluswebdav/andrepo.tomlsiblings. Discovery and registration use renamed APIs.crates/hero_foundry_server/src/openrpc/handler.rs— rename internal local bindings for consistency.crates/hero_foundry_server/src/http/server.rs— WebDAV routes off the per-repowebdav/subdir.crates/hero_foundry_server/src/lib.rs— keep re-exports in sync.crates/hero_foundry_server/openrpc.jsonandspecs/openrpc.json— rewrite text references.crates/hero_foundry_server/tests/discovery_tests.rs— update fixtures to per-repo dirs.CLI launcher
crates/hero_foundry/src/main.rs— keep--start/--stop(hero_proc lifecycle), remove every other arg, add--foundry-dir(default~/hero/var/foundry), renameensure_default_fossil_repotoensure_default_foundry_repo, writecore/db.foundry+core/webdav/+core/repo.toml. Drop--allow-dir,--read-write,--webdav-storage,--fossil-dirfrom the forwarded server command.UI
crates/hero_foundry_ui/src/main.rs— default path~/hero/var/foundry; rename env varHERO_FOUNDRY_REPOStoHERO_FOUNDRY_DIR.crates/hero_foundry_ui/src/templates.rs— renamesb_fossils_on_disktosb_repos_on_diskon every template struct.crates/hero_foundry_ui/templates/admin.html— replace user-facing "Fossil file path" /.fossiltext.crates/hero_foundry_ui/templates/partials/sidebar.html— element id, var name, and storage path text.crates/hero_foundry_ui/templates/repo_list.html— Rescan button text.Web crate / SDK
crates/hero_foundry_web/src/lib.rsandcrates/hero_foundry_sdk/src/lib.rs— sweep doc text.Examples
crates/hero_foundry_examples/examples/*.rs— replace*.forgewith<base>/<name>/db.foundry.Demo crate
crates/hero_foundry_demo/src/lib.rs— change to per-repo dir layout, createwebdav/andrepo.tomlsiblings, updateSeededRepo.pathand callers.Rhai example
rhai_examples/server/05_hero_proc.rhai— service strings updated.Docs
docs/MULTI_REPO_TESTING.md— full layout rewrite, document--foundry-dir.docs/HERO_FOUNDRY_SERVER_QUICK_START.md— fix dead reference, update paths.docs/IMPLEMENTATION.mdandREADME.md— keep upstream "Fossil SCM" prose; replace Hero-workspace paths.Implementation Plan
Step 1: Rename core internal identifiers and metadata doc comments
Files:
crates/hero_foundry_core/src/repo/{database,metadata,naming}.rs,crates/hero_foundry_core/src/fs/errors.rsDependencies: none.
Step 2: Update all
.forgedoctest/example paths in core to per-repodb.foundryFiles:
crates/hero_foundry_core/src/lib.rs,repo/mod.rs,fs/{mod,find,interface}.rs,fs/README.md,sync/{mod,client}.rs,tools/git_import.rsDependencies: none.
Step 3: Update core demo seeder and test fixtures to per-repo layout
Files:
crates/hero_foundry_core/src/tools/demo_seed.rs,tests/sync_tests.rs,tests/race_condition_tests.rs,tests/staging_stress_tests.rs,src/sync/client.rstestDependencies: Step 1.
Step 4: Rewrite server discovery for per-repo directory layout
Files:
crates/hero_foundry_server/src/discovery.rs,tests/discovery_tests.rsDependencies: Step 1.
Step 5: Update server state to new config shape
Files:
crates/hero_foundry_server/src/state.rsDependencies: Step 4.
Step 6: Update server OpenRPC method implementations
Files:
crates/hero_foundry_server/src/openrpc/{server_methods,handler}.rsDependencies: Step 5.
Step 7: Rewrite server WebDAV routing for per-repo layout
Files:
crates/hero_foundry_server/src/http/server.rsDependencies: Step 5.
Step 8: Simplify server CLI to single
--foundry-dirargFiles:
crates/hero_foundry_server/src/main.rsDependencies: Steps 5-7.
Step 9: Simplify hero_foundry CLI launcher
Files:
crates/hero_foundry/src/main.rsDependencies: Step 8.
Step 10: Update UI binary, templates, and template structs
Files:
crates/hero_foundry_ui/src/main.rs,src/templates.rs,templates/admin.html,templates/partials/sidebar.html,templates/repo_list.htmlDependencies: none.
Step 11: Web crate and SDK doc fixes
Files:
crates/hero_foundry_web/src/lib.rs,crates/hero_foundry_sdk/src/lib.rsDependencies: none.
Step 12: Update demo crate seeder to per-repo layout
Files:
crates/hero_foundry_demo/src/lib.rsDependencies: Step 5.
Step 13: Update examples
Files:
crates/hero_foundry_examples/examples/*.rsDependencies: none.
Step 14: Update OpenRPC schema text
Files:
crates/hero_foundry_server/openrpc.json,specs/openrpc.jsonDependencies: Step 6.
Step 15: Documentation rewrites
Files:
docs/MULTI_REPO_TESTING.md,docs/HERO_FOUNDRY_SERVER_QUICK_START.md,docs/IMPLEMENTATION.md,README.md,rhai_examples/server/05_hero_proc.rhaiDependencies: none.
Step 16: Final grep + build + test
Tasks:
grep -ri 'fossil' crates/ docs/ specs/ rhai_examples/ README.mdshould yield zero results except intentional upstream "Fossil SCM" mentions in prose.cargo build --workspacecargo test --workspaceDependencies: All previous steps.
Acceptance Criteria
fossilreferring to the workspace concept (grep clean except for any external crate names)~/hero/var/foundryeverywhere<base>/<reponame>/db.foundry+<base>/<reponame>/webdav/--foundry-dir; UI: env var only; hero_foundry wrapper:--foundry-dirplus the unrelated--start/--stoplifecycle controls)cargo build --workspacesucceedscargo test --workspacepasses (or at least doesn't regress vs. before)Notes
fossil-c/directory at the workspace root is an upstream Fossil SCM C source mirror, not a workspace member; do not touch it.hero_foundrytop-level binary keeps--start/--stop(mandatory hero_proc lifecycle, not configuration). The "only one argument" rule is interpreted as "only one configuration argument"./webdav/<context>/...to/webdav/<reponame>/.... The sidecar storage tree moves inside each repo directory.<name>.toml(sibling of.fossil) to<reponame>/repo.toml(inside the per-repo dir).hero_foundry_democrate's.forgepaths must also be migrated.derive_repo_nameswitches toPath::file_nameof the parent dir for the new layout, with a fallback for direct db-file paths.Test Results
cargo build --workspacesucceeds.cargo test --workspaceresults:Per-crate breakdown:
Build emits only pre-existing dead-code warnings (unrelated to this change) for
hero_foundry_ui,hero_foundry_webdav_client, andhero_foundry_web.Implementation Summary
The workspace concept and CLI surface have been migrated to the new
foundryconvention.On-disk layout
~/hero/var/foundry<base>/<reponame>/db.foundry+<base>/<reponame>/webdav/+ optional<base>/<reponame>/repo.toml.fossiland.forgeextensions are gone from the workspace.CLI surface
hero_foundry-server: single optional flag--foundry-dir <PATH>(default~/hero/var/foundry). Removed--repo,--default-repo,--bind,--read-write,--allow-dir,--max-cache,--webdav-storage,--fossil-dir. Server is always read-write and always binds to the standard Hero Unix socket.hero_foundry(top-level wrapper):--foundry-dir <PATH>(default~/hero/var/foundry) plus the unrelated--start/--stophero_proc lifecycle flags.ensure_default_fossil_repowas renamed toensure_default_foundry_repoand now seeds<base>/core/db.foundryplus<base>/core/webdav/plus<base>/core/repo.toml.hero_foundry_ui: env-var renameHERO_FOUNDRY_REPOS->HERO_FOUNDRY_DIR, default path updated.Server core changes
ServerConfig.fossil_dir->foundry_dir. Removedwebdav_storage_path,access_control,read_write,max_cached_repos(replaced with internal default).ServerState::get_repo_webdav_path(name) -> PathBufreturning<foundry_dir>/<name>/webdav.discover_foundry_repos(dir)enumerates immediate subdirs that contain adb.foundryfile, returningDiscoveredRepo { name, db_path, webdav_dir, metadata }. Sidecar metadata moved from<name>.tomlto<name>/repo.toml./webdav/<reponame>/...resolves through the registered repo's per-repowebdav/directory; unknown reponames return 404.derive_repo_namenow uses the parent directory name for paths under the new layout.Files touched (high-level)
hero_foundry_core:repo/{database,metadata,naming,mod}.rs,fs/{mod,find,interface,errors,README}.{rs,md},sync/{mod,client}.rs,tools/{demo_seed,git_import}.rs,lib.rs,tests/{sync,race_condition,staging_stress}_tests.rs,Cargo.toml.hero_foundry_server:main.rs,state.rs,discovery.rs(new),lib.rs,openrpc/{server_methods,handler}.rs,http/{server,files_api}.rs,tests/discovery_tests.rs,Cargo.toml.hero_foundry:src/main.rs(CLI flag rename, seeding rewrite).hero_foundry_ui:src/main.rs,templates/admin.html,templates/repo_list.html,templates/partials/sidebar.html,templates/stats.html.hero_foundry_demo:src/lib.rs(per-repo layout,SeededReposhape).hero_foundry_web: doc comment.hero_foundry_sdk: doc comments.hero_foundry_examples/examples/*.rs: every example migrated to the new layout.docs/MULTI_REPO_TESTING.md,docs/HERO_FOUNDRY_SERVER_QUICK_START.md,docs/IMPLEMENTATION.md,README.md: paths and flag references updated.rhai_examples/server/05_hero_proc.rhai: service strings updated.Test results
cargo build --workspace: clean (only pre-existing dead-code warnings).cargo test --workspace: 193 passed, 0 failed, 2 ignored. Doctests all pass.Notes
README.md,docs/IMPLEMENTATION.mdlines 5 / 366) were intentionally preserved.fossil-c/directory at the workspace root is an upstream Fossil SCM C source mirror (not a workspace member) and was not touched./webdav/<context>/...to/webdav/<reponame>/.... Clients keyed off the prior context names need to be updated.<dir>/<name>.tomlto<dir>/<name>/repo.toml. Existing on-disk repos created by the previous code will not auto-migrate; recreate or move them under the new layout.