Extend scaffolder (#54): examples crate + PURPOSE.md + README + CI + drop Makefile #62

Merged
timur merged 1 commit from pr-54-scaffold-extend into development 2026-05-19 13:38:49 +00:00
Owner

Closes #54.

Extends WorkspaceScaffolder per the issue's remaining scope: _examples crate generation, drops the Makefile (ADR-0001), generates PURPOSE.md modeled on hero_proc, generates README referencing only lab service …, generates .forgejo/workflows/build-linux.yaml. Adds missing src/lib.rs stubs on core + _sdk crates so cargo metadata doesn't abort lab infocheck.

lab infocheck on a freshly scaffolded hero_demo → 2 crate(s) clean, 0 finding(s). cargo test -p hero_rpc_generator → 121 passed (+10 new artefact tests). cargo fmt --check clean.

Closes #54. Extends WorkspaceScaffolder per the issue's remaining scope: `_examples` crate generation, drops the Makefile (ADR-0001), generates `PURPOSE.md` modeled on `hero_proc`, generates README referencing only `lab service …`, generates `.forgejo/workflows/build-linux.yaml`. Adds missing `src/lib.rs` stubs on core + `_sdk` crates so `cargo metadata` doesn't abort `lab infocheck`. `lab infocheck` on a freshly scaffolded `hero_demo` → 2 crate(s) clean, 0 finding(s). `cargo test -p hero_rpc_generator` → 121 passed (+10 new artefact tests). `cargo fmt --check` clean.
feat(scaffold): #54 examples crate + PURPOSE.md + README + CI + drop Makefile
Some checks failed
Test / test (pull_request) Failing after 3m56s
Test / test (push) Failing after 3m57s
0a5236d016
Closes the remaining #54 scope on top of #55. Six deltas in
`crates/generator/src/build/scaffold.rs`:

1. **Drop Makefile + buildenv.sh generation (ADR-0001).** `lab` owns the
   full build/install/start/stop lifecycle on top of `hero_proc`; scaffold
   no longer emits `Makefile`, `buildenv.sh`, or `scripts/*.sh`. Per
   `hero_service_check_fix.md` §6/§8.

2. **Generate `hero_<name>_examples` crate** mirroring `hero_proc_examples`
   (Cargo.toml + `src/lib.rs` placeholder + `examples/01_connect.rs`
   stub). Added to workspace members. Pre-#54 the scaffolder had no
   examples crate — naming table in `hero_service_check_fix.md` §2
   requires `_examples` as the canonical suffix.

3. **Generate `PURPOSE.md`** modelled on `hero_proc/PURPOSE.md`:
   `Binary | Role | Socket` table, `Crate | Role` table (incl. the new
   `_examples` row), Key Features, Service Management. Lifecycle commands
   reference only `lab service <short> --install/--start/--stop/--status`
   (`hero_service_check_fix.md` §1, §6).

4. **Generate `README.md`** with quickstart, components list, domain
   list, smoke-test recipe. All lifecycle commands are `lab service ...`
   only — no `make`, no bash, no nu. `hero_service_check_fix.md` §6/§8.

5. **Generate `.gitignore`** (target/, IDE noise, .env).

6. **Generate `.forgejo/workflows/build-linux.yaml`** per the
   `forge-release-workflow` skill (self-contained Rust variant —
   `build_lib.sh` is forbidden by ADR-0001). Tag push → musl release
   binaries → upload as release assets. Pins toolchain to 1.93.0 for
   edition 2024 / rust-version.

Also:

- Adds `src/lib.rs` stubs for the core `hero_<name>` and `hero_<name>_sdk`
  crates. Without these, `cargo metadata` errors with "no targets
  specified in the manifest" before `build.rs` codegen can run, which
  causes `lab infocheck` (and every other workspace-wide tool) to abort
  before validating the server/admin crates.

## Verification

End-to-end scaffold into a tempdir + `lab infocheck`:

```
$ cargo run -p hero_rpc_generator --bin hero_rpc_generator -- \
    --name hero_demo --workspace-dir $TMP --no-rhai
$ cd $TMP && git init -q && lab infocheck
repo: $TMP
crates discovered: 2
  ok   $TMP/crates/hero_demo_admin
  ok   $TMP/crates/hero_demo_server
summary: 2 crate(s) clean, 0 crate(s) with issues, 0 finding(s) total
```

Zero manual edits required — meets the #54 acceptance criterion.

## Tests

10 new scaffold tests cover every new artefact:

- `test_scaffold_no_makefile_no_buildenv_no_scripts`
- `test_scaffold_emits_examples_crate`
- `test_scaffold_workspace_includes_examples`
- `test_scaffold_generates_readme_referencing_lab_only`
- `test_scaffold_generates_purpose_md_in_hero_proc_shape`
- `test_scaffold_generates_forgejo_workflow`
- `test_scaffold_generates_gitignore`
- `test_scaffold_core_and_sdk_crates_have_lib_rs`
- `test_scaffold_full_layout_no_admin`
- `test_short_name`

`cargo test -p hero_rpc_generator` → 121 passed, 1 ignored (was 110).
`cargo fmt --check` clean.

Refs hero_rpc#54, hero_skills#262 (parent META).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
timur merged commit 87d01fea12 into development 2026-05-19 13:38:49 +00:00
Sign in to join this conversation.
No reviewers
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_rpc!62
No description provided.