locations of repos need to change #24

Open
opened 2026-05-02 05:43:44 +00:00 by despiegk · 3 comments
Owner

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

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
Author
Owner

Implementation Spec for Issue #24

Objective

Rename the workspace's path/identifier convention from fossil to foundry, change the per-repo on-disk layout to a per-repo directory containing both the database file (db.foundry) and a webdav/ 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

  • Default base dir is ~/hero/var/foundry
  • Per-repo layout: <base>/$reponame/db.foundry + <base>/$reponame/webdav/
  • File extension .fossil becomes .foundry everywhere (also collapse stray .forge references in tests/examples/docs to .foundry to satisfy "use this convention everywhere")
  • Path segment fossil becomes foundry in defaults
  • Identifiers containing fossil become foundry (where they refer to this concept; upstream Fossil SCM project mentions in README.md / docs/IMPLEMENTATION.md may keep "Fossil" only when explicitly naming the upstream project)
  • Each binary exposes a single optional argument: foundry dir (default above). Remove unrelated args.

Files to Modify/Create

Core library

  • crates/hero_foundry_core/src/repo/mod.rs — update doc-comment examples to per-repo db.foundry paths.
  • crates/hero_foundry_core/src/repo/database.rs — rename local is_fossil to is_foundry.
  • crates/hero_foundry_core/src/repo/metadata.rs — module/struct doc comments updated.
  • crates/hero_foundry_core/src/repo/naming.rs — rename test normalize_core_dot_fossil and asserted strings to core.foundry / core_foundry.
  • crates/hero_foundry_core/src/fs/errors.rs — rename pattern var fossil_err to repo_err.
  • crates/hero_foundry_core/src/fs/{mod,find,interface}.rs and fs/README.md — replace .forge doctest paths with db.foundry.
  • crates/hero_foundry_core/src/sync/{mod,client}.rs — replace .forge doctest paths with db.foundry.
  • crates/hero_foundry_core/src/lib.rs and src/tools/git_import.rs — replace .forge doctest paths with db.foundry.
  • crates/hero_foundry_core/src/tools/demo_seed.rs — change repo target paths from <dir>/<name>.forge to 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 *.forge test 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.rsServerConfig.fossil_dir becomes foundry_dir. Drop webdav_storage_path. Add get_repo_webdav_path(name).
  • crates/hero_foundry_server/src/discovery.rsdiscover_fossil_repos becomes discover_foundry_repos; algorithm enumerates immediate subdirs that contain db.foundry. fossil_path field becomes db_path.
  • crates/hero_foundry_server/src/openrpc/server_methods.rscreate_repository writes <foundry_dir>/<name>/db.foundry plus webdav/ and repo.toml siblings. 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-repo webdav/ subdir.
  • crates/hero_foundry_server/src/lib.rs — keep re-exports in sync.
  • crates/hero_foundry_server/openrpc.json and specs/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), rename ensure_default_fossil_repo to ensure_default_foundry_repo, write core/db.foundry + core/webdav/ + core/repo.toml. Drop --allow-dir, --read-write, --webdav-storage, --fossil-dir from the forwarded server command.

UI

  • crates/hero_foundry_ui/src/main.rs — default path ~/hero/var/foundry; rename env var HERO_FOUNDRY_REPOS to HERO_FOUNDRY_DIR.
  • crates/hero_foundry_ui/src/templates.rs — rename sb_fossils_on_disk to sb_repos_on_disk on every template struct.
  • crates/hero_foundry_ui/templates/admin.html — replace user-facing "Fossil file path" / .fossil text.
  • 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.rs and crates/hero_foundry_sdk/src/lib.rs — sweep doc text.

Examples

  • crates/hero_foundry_examples/examples/*.rs — replace *.forge with <base>/<name>/db.foundry.

Demo crate

  • crates/hero_foundry_demo/src/lib.rs — change to per-repo dir layout, create webdav/ and repo.toml siblings, update SeededRepo.path and 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.md and README.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.rs
Dependencies: none.

Step 2: Update all .forge doctest/example paths in core to per-repo db.foundry

Files: 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.rs
Dependencies: 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.rs test
Dependencies: Step 1.

Step 4: Rewrite server discovery for per-repo directory layout

Files: crates/hero_foundry_server/src/discovery.rs, tests/discovery_tests.rs
Dependencies: Step 1.

Step 5: Update server state to new config shape

Files: crates/hero_foundry_server/src/state.rs
Dependencies: Step 4.

Step 6: Update server OpenRPC method implementations

Files: crates/hero_foundry_server/src/openrpc/{server_methods,handler}.rs
Dependencies: Step 5.

Step 7: Rewrite server WebDAV routing for per-repo layout

Files: crates/hero_foundry_server/src/http/server.rs
Dependencies: Step 5.

Step 8: Simplify server CLI to single --foundry-dir arg

Files: crates/hero_foundry_server/src/main.rs
Dependencies: Steps 5-7.

Step 9: Simplify hero_foundry CLI launcher

Files: crates/hero_foundry/src/main.rs
Dependencies: 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.html
Dependencies: none.

Step 11: Web crate and SDK doc fixes

Files: crates/hero_foundry_web/src/lib.rs, crates/hero_foundry_sdk/src/lib.rs
Dependencies: none.

Step 12: Update demo crate seeder to per-repo layout

Files: crates/hero_foundry_demo/src/lib.rs
Dependencies: Step 5.

Step 13: Update examples

Files: crates/hero_foundry_examples/examples/*.rs
Dependencies: none.

Step 14: Update OpenRPC schema text

Files: crates/hero_foundry_server/openrpc.json, specs/openrpc.json
Dependencies: 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.rhai
Dependencies: none.

Step 16: Final grep + build + test

Tasks:

  • grep -ri 'fossil' crates/ docs/ specs/ rhai_examples/ README.md should yield zero results except intentional upstream "Fossil SCM" mentions in prose.
  • cargo build --workspace
  • cargo test --workspace
    Dependencies: All previous steps.

Acceptance Criteria

  • No remaining occurrences of fossil referring to the workspace concept (grep clean except for any external crate names)
  • Default path is ~/hero/var/foundry everywhere
  • Each repo lives at <base>/<reponame>/db.foundry + <base>/<reponame>/webdav/
  • Each binary's CLI exposes only the single foundry-dir argument (server: --foundry-dir; UI: env var only; hero_foundry wrapper: --foundry-dir plus the unrelated --start/--stop lifecycle controls)
  • cargo build --workspace succeeds
  • cargo test --workspace passes (or at least doesn't regress vs. before)

Notes

  • The fossil-c/ directory at the workspace root is an upstream Fossil SCM C source mirror, not a workspace member; do not touch it.
  • "Fossil SCM" upstream-project mentions in prose remain.
  • The hero_foundry top-level binary keeps --start / --stop (mandatory hero_proc lifecycle, not configuration). The "only one argument" rule is interpreted as "only one configuration argument".
  • WebDAV URLs change from /webdav/<context>/... to /webdav/<reponame>/.... The sidecar storage tree moves inside each repo directory.
  • Metadata sidecar moves from <name>.toml (sibling of .fossil) to <reponame>/repo.toml (inside the per-repo dir).
  • The hero_foundry_demo crate's .forge paths must also be migrated.
  • derive_repo_name switches to Path::file_name of the parent dir for the new layout, with a fallback for direct db-file paths.
## Implementation Spec for Issue #24 ### Objective Rename the workspace's path/identifier convention from `fossil` to `foundry`, change the per-repo on-disk layout to a per-repo directory containing both the database file (`db.foundry`) and a `webdav/` 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 - Default base dir is `~/hero/var/foundry` - Per-repo layout: `<base>/$reponame/db.foundry` + `<base>/$reponame/webdav/` - File extension `.fossil` becomes `.foundry` everywhere (also collapse stray `.forge` references in tests/examples/docs to `.foundry` to satisfy "use this convention everywhere") - Path segment `fossil` becomes `foundry` in defaults - Identifiers containing `fossil` become `foundry` (where they refer to this concept; upstream Fossil SCM project mentions in `README.md` / `docs/IMPLEMENTATION.md` may keep "Fossil" only when explicitly naming the upstream project) - Each binary exposes a single optional argument: foundry dir (default above). Remove unrelated args. ### Files to Modify/Create Core library - `crates/hero_foundry_core/src/repo/mod.rs` — update doc-comment examples to per-repo `db.foundry` paths. - `crates/hero_foundry_core/src/repo/database.rs` — rename local `is_fossil` to `is_foundry`. - `crates/hero_foundry_core/src/repo/metadata.rs` — module/struct doc comments updated. - `crates/hero_foundry_core/src/repo/naming.rs` — rename test `normalize_core_dot_fossil` and asserted strings to `core.foundry` / `core_foundry`. - `crates/hero_foundry_core/src/fs/errors.rs` — rename pattern var `fossil_err` to `repo_err`. - `crates/hero_foundry_core/src/fs/{mod,find,interface}.rs` and `fs/README.md` — replace `.forge` doctest paths with `db.foundry`. - `crates/hero_foundry_core/src/sync/{mod,client}.rs` — replace `.forge` doctest paths with `db.foundry`. - `crates/hero_foundry_core/src/lib.rs` and `src/tools/git_import.rs` — replace `.forge` doctest paths with `db.foundry`. - `crates/hero_foundry_core/src/tools/demo_seed.rs` — change repo target paths from `<dir>/<name>.forge` to 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 `*.forge` test 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_dir` becomes `foundry_dir`. Drop `webdav_storage_path`. Add `get_repo_webdav_path(name)`. - `crates/hero_foundry_server/src/discovery.rs` — `discover_fossil_repos` becomes `discover_foundry_repos`; algorithm enumerates immediate subdirs that contain `db.foundry`. `fossil_path` field becomes `db_path`. - `crates/hero_foundry_server/src/openrpc/server_methods.rs` — `create_repository` writes `<foundry_dir>/<name>/db.foundry` plus `webdav/` and `repo.toml` siblings. 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-repo `webdav/` subdir. - `crates/hero_foundry_server/src/lib.rs` — keep re-exports in sync. - `crates/hero_foundry_server/openrpc.json` and `specs/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`), rename `ensure_default_fossil_repo` to `ensure_default_foundry_repo`, write `core/db.foundry` + `core/webdav/` + `core/repo.toml`. Drop `--allow-dir`, `--read-write`, `--webdav-storage`, `--fossil-dir` from the forwarded server command. UI - `crates/hero_foundry_ui/src/main.rs` — default path `~/hero/var/foundry`; rename env var `HERO_FOUNDRY_REPOS` to `HERO_FOUNDRY_DIR`. - `crates/hero_foundry_ui/src/templates.rs` — rename `sb_fossils_on_disk` to `sb_repos_on_disk` on every template struct. - `crates/hero_foundry_ui/templates/admin.html` — replace user-facing "Fossil file path" / `.fossil` text. - `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.rs` and `crates/hero_foundry_sdk/src/lib.rs` — sweep doc text. Examples - `crates/hero_foundry_examples/examples/*.rs` — replace `*.forge` with `<base>/<name>/db.foundry`. Demo crate - `crates/hero_foundry_demo/src/lib.rs` — change to per-repo dir layout, create `webdav/` and `repo.toml` siblings, update `SeededRepo.path` and 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.md` and `README.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.rs` Dependencies: none. #### Step 2: Update all `.forge` doctest/example paths in core to per-repo `db.foundry` Files: `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.rs` Dependencies: 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.rs` test Dependencies: Step 1. #### Step 4: Rewrite server discovery for per-repo directory layout Files: `crates/hero_foundry_server/src/discovery.rs`, `tests/discovery_tests.rs` Dependencies: Step 1. #### Step 5: Update server state to new config shape Files: `crates/hero_foundry_server/src/state.rs` Dependencies: Step 4. #### Step 6: Update server OpenRPC method implementations Files: `crates/hero_foundry_server/src/openrpc/{server_methods,handler}.rs` Dependencies: Step 5. #### Step 7: Rewrite server WebDAV routing for per-repo layout Files: `crates/hero_foundry_server/src/http/server.rs` Dependencies: Step 5. #### Step 8: Simplify server CLI to single `--foundry-dir` arg Files: `crates/hero_foundry_server/src/main.rs` Dependencies: Steps 5-7. #### Step 9: Simplify hero_foundry CLI launcher Files: `crates/hero_foundry/src/main.rs` Dependencies: 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.html` Dependencies: none. #### Step 11: Web crate and SDK doc fixes Files: `crates/hero_foundry_web/src/lib.rs`, `crates/hero_foundry_sdk/src/lib.rs` Dependencies: none. #### Step 12: Update demo crate seeder to per-repo layout Files: `crates/hero_foundry_demo/src/lib.rs` Dependencies: Step 5. #### Step 13: Update examples Files: `crates/hero_foundry_examples/examples/*.rs` Dependencies: none. #### Step 14: Update OpenRPC schema text Files: `crates/hero_foundry_server/openrpc.json`, `specs/openrpc.json` Dependencies: 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.rhai` Dependencies: none. #### Step 16: Final grep + build + test Tasks: - `grep -ri 'fossil' crates/ docs/ specs/ rhai_examples/ README.md` should yield zero results except intentional upstream "Fossil SCM" mentions in prose. - `cargo build --workspace` - `cargo test --workspace` Dependencies: All previous steps. ### Acceptance Criteria - [ ] No remaining occurrences of `fossil` referring to the workspace concept (grep clean except for any external crate names) - [ ] Default path is `~/hero/var/foundry` everywhere - [ ] Each repo lives at `<base>/<reponame>/db.foundry` + `<base>/<reponame>/webdav/` - [ ] Each binary's CLI exposes only the single foundry-dir argument (server: `--foundry-dir`; UI: env var only; hero_foundry wrapper: `--foundry-dir` plus the unrelated `--start`/`--stop` lifecycle controls) - [ ] `cargo build --workspace` succeeds - [ ] `cargo test --workspace` passes (or at least doesn't regress vs. before) ### Notes - The `fossil-c/` directory at the workspace root is an upstream Fossil SCM C source mirror, not a workspace member; do not touch it. - "Fossil SCM" upstream-project mentions in prose remain. - The `hero_foundry` top-level binary keeps `--start` / `--stop` (mandatory hero_proc lifecycle, not configuration). The "only one argument" rule is interpreted as "only one configuration argument". - WebDAV URLs change from `/webdav/<context>/...` to `/webdav/<reponame>/...`. The sidecar storage tree moves inside each repo directory. - Metadata sidecar moves from `<name>.toml` (sibling of `.fossil`) to `<reponame>/repo.toml` (inside the per-repo dir). - The `hero_foundry_demo` crate's `.forge` paths must also be migrated. - `derive_repo_name` switches to `Path::file_name` of the parent dir for the new layout, with a fallback for direct db-file paths.
Author
Owner

Test Results

cargo build --workspace succeeds. cargo test --workspace results:

  • Unit + integration tests: 193 passed, 0 failed, 2 ignored
  • Doc-tests: all passed (60+ doctests across the workspace, all OK)

Per-crate breakdown:

  • hero_foundry_core: 110 unit + integration passed
  • hero_foundry_demo: 1 passed
  • hero_foundry_examples: (build only)
  • hero_foundry_sdk: 1 passed
  • hero_foundry_server: 8 passed (incl. discovery_tests)
  • hero_foundry_ui: 3 passed
  • hero_foundry_web: 10 passed
  • hero_foundry_webdav_client: 0 (no tests)

Build emits only pre-existing dead-code warnings (unrelated to this change) for hero_foundry_ui, hero_foundry_webdav_client, and hero_foundry_web.

## Test Results `cargo build --workspace` succeeds. `cargo test --workspace` results: - Unit + integration tests: 193 passed, 0 failed, 2 ignored - Doc-tests: all passed (60+ doctests across the workspace, all OK) Per-crate breakdown: - hero_foundry_core: 110 unit + integration passed - hero_foundry_demo: 1 passed - hero_foundry_examples: (build only) - hero_foundry_sdk: 1 passed - hero_foundry_server: 8 passed (incl. discovery_tests) - hero_foundry_ui: 3 passed - hero_foundry_web: 10 passed - hero_foundry_webdav_client: 0 (no tests) Build emits only pre-existing dead-code warnings (unrelated to this change) for `hero_foundry_ui`, `hero_foundry_webdav_client`, and `hero_foundry_web`.
Author
Owner

Implementation Summary

The workspace concept and CLI surface have been migrated to the new foundry convention.

On-disk layout

  • Default base directory: ~/hero/var/foundry
  • Per-repo: <base>/<reponame>/db.foundry + <base>/<reponame>/webdav/ + optional <base>/<reponame>/repo.toml
  • .fossil and .forge extensions 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/--stop hero_proc lifecycle flags. ensure_default_fossil_repo was renamed to ensure_default_foundry_repo and now seeds <base>/core/db.foundry plus <base>/core/webdav/ plus <base>/core/repo.toml.
  • hero_foundry_ui: env-var rename HERO_FOUNDRY_REPOS -> HERO_FOUNDRY_DIR, default path updated.

Server core changes

  • ServerConfig.fossil_dir -> foundry_dir. Removed webdav_storage_path, access_control, read_write, max_cached_repos (replaced with internal default).
  • New method ServerState::get_repo_webdav_path(name) -> PathBuf returning <foundry_dir>/<name>/webdav.
  • Discovery rewritten: discover_foundry_repos(dir) enumerates immediate subdirs that contain a db.foundry file, returning DiscoveredRepo { name, db_path, webdav_dir, metadata }. Sidecar metadata moved from <name>.toml to <name>/repo.toml.
  • WebDAV routing reworked: /webdav/<reponame>/... resolves through the registered repo's per-repo webdav/ directory; unknown reponames return 404.
  • derive_repo_name now 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, SeededRepo shape).
  • 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

  • Mentions of upstream Fossil SCM project in prose (README.md, docs/IMPLEMENTATION.md lines 5 / 366) were intentionally preserved.
  • The fossil-c/ directory at the workspace root is an upstream Fossil SCM C source mirror (not a workspace member) and was not touched.
  • WebDAV URL prefix changes from /webdav/<context>/... to /webdav/<reponame>/.... Clients keyed off the prior context names need to be updated.
  • Metadata sidecar moves from <dir>/<name>.toml to <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.
## Implementation Summary The workspace concept and CLI surface have been migrated to the new `foundry` convention. ### On-disk layout - Default base directory: `~/hero/var/foundry` - Per-repo: `<base>/<reponame>/db.foundry` + `<base>/<reponame>/webdav/` + optional `<base>/<reponame>/repo.toml` - `.fossil` and `.forge` extensions 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`/`--stop` hero_proc lifecycle flags. `ensure_default_fossil_repo` was renamed to `ensure_default_foundry_repo` and now seeds `<base>/core/db.foundry` plus `<base>/core/webdav/` plus `<base>/core/repo.toml`. - `hero_foundry_ui`: env-var rename `HERO_FOUNDRY_REPOS` -> `HERO_FOUNDRY_DIR`, default path updated. ### Server core changes - `ServerConfig.fossil_dir` -> `foundry_dir`. Removed `webdav_storage_path`, `access_control`, `read_write`, `max_cached_repos` (replaced with internal default). - New method `ServerState::get_repo_webdav_path(name) -> PathBuf` returning `<foundry_dir>/<name>/webdav`. - Discovery rewritten: `discover_foundry_repos(dir)` enumerates immediate subdirs that contain a `db.foundry` file, returning `DiscoveredRepo { name, db_path, webdav_dir, metadata }`. Sidecar metadata moved from `<name>.toml` to `<name>/repo.toml`. - WebDAV routing reworked: `/webdav/<reponame>/...` resolves through the registered repo's per-repo `webdav/` directory; unknown reponames return 404. - `derive_repo_name` now 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, `SeededRepo` shape). - `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 - Mentions of upstream Fossil SCM project in prose (`README.md`, `docs/IMPLEMENTATION.md` lines 5 / 366) were intentionally preserved. - The `fossil-c/` directory at the workspace root is an upstream Fossil SCM C source mirror (not a workspace member) and was not touched. - WebDAV URL prefix changes from `/webdav/<context>/...` to `/webdav/<reponame>/...`. Clients keyed off the prior context names need to be updated. - Metadata sidecar moves from `<dir>/<name>.toml` to `<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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_foundry#24
No description provided.