Add docs.updateTemplate RPC method #103

Closed
opened 2026-04-26 12:24:20 +00:00 by mahmoud · 3 comments
Owner

Parent: #101

What to add

Method: docs.updateTemplate
Params: { path: string }
Returns: { job_id: string }
Wraps: DocSite::update_template() at lib.rs:90

Implementation steps

  1. Verify hero_docs update-template subcommand exists
  2. Add handle_docs_update_template(id, params, config) -> RpcResponse in crates/hero_books_server/src/web/rpc.rs
  3. Add dispatch arm "docs.updateTemplate" at rpc.rs:155
  4. Add method entry in openrpc.json, bump info.version
  5. Update doc-comment header at rpc.rs:9-28

Acceptance Criteria

  • hero_docs update-template subcommand exists
  • Handler shells out via hero_docs
  • Returns { job_id }; client polls docs.jobStatus
  • spec/impl parity check passes
Parent: #101 ## What to add **Method:** `docs.updateTemplate` **Params:** `{ path: string }` **Returns:** `{ job_id: string }` **Wraps:** `DocSite::update_template()` at `lib.rs:90` ## Implementation steps 1. Verify `hero_docs update-template` subcommand exists 2. Add `handle_docs_update_template(id, params, config) -> RpcResponse` in `crates/hero_books_server/src/web/rpc.rs` 3. Add dispatch arm `"docs.updateTemplate"` at `rpc.rs:155` 4. Add method entry in `openrpc.json`, bump `info.version` 5. Update doc-comment header at `rpc.rs:9-28` ## Acceptance Criteria - [x] `hero_docs update-template` subcommand exists - [x] Handler shells out via hero_docs - [x] Returns `{ job_id }`; client polls `docs.jobStatus` - [x] spec/impl parity check passes
rawdaGastan added this to the ACTIVE project 2026-04-26 14:08:25 +00:00
Member

Implementation Spec for Issue #103

Objective

Expose DocSite::update_template over the OpenRPC interface as docs.updateTemplate. Mirrors the pattern established by #102 / docs.installTemplate: the handler submits a hero_proc job that shells out to a new hero_docs update-template subcommand and returns { "job_id": "<n>" } for clients to poll via docs.jobStatus.

Requirements

  • docs.updateTemplate is dispatchable from crates/hero_books_server/src/web/rpc.rs and reaches a new handler handle_docs_update_template.
  • Matching entry in crates/hero_books_server/openrpc.json, mirroring the docs.installTemplate style (no examples block — none exist).
  • info.version in openrpc.json bumped (0.1.6 -> 0.1.7).
  • The ## Docs section in the rpc.rs file-level doc-header (added in #102) gains a docs.updateTemplate bullet.
  • hero_docs (src/bin/hero_docs.rs) gains a new update-template subcommand: hero_docs update-template --path <path>. It calls hero_books_docusaurus::template::update_template(&path) directly — no heroscript loading, since the underlying function only needs a build-directory path. (Same path semantics as docs.installTemplate.)
  • Handler shells out via config.hero_docs_bin, never DocSite in-process.
  • Handler reuses submit_or_dedup_docs_job(...) with action name docs_update_template_<input_hash>.
  • handle_docs_job_status's prefix-recognition comment block is extended to mention docs_update_template_ alongside docs_install_template_ (no behaviour change — both already fall through the strip-list and emit no output_path, since the path is not recoverable from the input hash).
  • Invalid-params responses use RpcResponse::invalid_params (-32602); internal failures use RpcResponse::error(id, -32000, ...).
  • Inline schema in rpc_spec.rs (used by rpc.discover) gains a matching docs.updateTemplate entry.
  • INSTRUCTIONS_OPENRPC.md §Verification diff produces empty output (spec list and dispatcher list match).

Files to Modify/Create

  • src/bin/hero_docs.rs — new UpdateTemplate(UpdateTemplateArgs) variant, args struct, runner.
  • crates/hero_books_server/src/web/rpc.rshandle_docs_update_template, dispatch arm, doc-header bullet, prefix-recognition comment update, unit test.
  • crates/hero_books_server/src/web/rpc_spec.rs — inline docs.updateTemplate entry.
  • crates/hero_books_server/openrpc.jsondocs.updateTemplate method entry, bump info.version to "0.1.7".

No new files.

Implementation Plan

Step 1 — Add update-template subcommand to hero_docs

Files: src/bin/hero_docs.rs

  • Extend the Commands enum with UpdateTemplate(UpdateTemplateArgs).
  • Args struct:
    #[derive(Args)]
    struct UpdateTemplateArgs {
        /// Path to the Docusaurus build directory whose template should be updated
        #[arg(long)]
        path: String,
    }
    
  • Runner:
    fn run_update_template(args: UpdateTemplateArgs) -> Result<(), Box<dyn std::error::Error>> {
        let path = std::path::PathBuf::from(&args.path);
        hero_books_docusaurus::template::update_template(&path)?;
        log::info!("Template updated at {}", path.display());
        Ok(())
    }
    
  • Dispatch from main() alongside the existing New, Generate, InstallTemplate arms.

Dependencies: none.

Step 2 — Add handle_docs_update_template handler

Files: crates/hero_books_server/src/web/rpc.rs

  • Add the function below handle_docs_install_template with signature fn handle_docs_update_template(id: Option<Value>, params: Option<Value>, config: &ServerConfig) -> RpcResponse.
  • Body:
    • Extract path (required, non-empty). Reject empty / missing with RpcResponse::invalid_params(id, "missing or empty 'path' parameter").
    • let input_hash = calculate_docs_input_hash(&[&path]);
    • Build script: format!("{} update-template --path {}", hero_docs, path_q) using shell_quote.
    • Submit via submit_or_dedup_docs_job(id, config, &format!("docs_update_template_{}", input_hash), &script).

Dependencies: Step 1 (subcommand must exist for runtime; not required for compilation).

Step 3 — Wire dispatch arm

Files: crates/hero_books_server/src/web/rpc.rs

  • In the match request.method.as_str() block, add immediately after docs.installTemplate and before docs.jobStatus:
    "docs.updateTemplate" => handle_docs_update_template(request.id, request.params, config),
    

Dependencies: Step 2.

Step 4 — Extend prefix-recognition comment in handle_docs_job_status

Files: crates/hero_books_server/src/web/rpc.rs

  • The comment block added in #102 already lists "docs.updateTemplate" as one of the upcoming methods that will fall through without an output_path. Update it so docs.updateTemplate is no longer "upcoming" — move it next to docs.installTemplate in the description. No code changes inside the strip-list itself: both docs_install_template_ and docs_update_template_ action names simply do not match either docs_new_ or docs_generate_ prefix-strip arms, so they correctly fall through.

Dependencies: Step 2.

Step 5 — Update doc-header

Files: crates/hero_books_server/src/web/rpc.rs

  • Inside the ## Docs section added in #102, insert docs.updateTemplate after docs.installTemplate:
    //! - `docs.updateTemplate` - Update the Docusaurus template at a build path
    

Dependencies: none.

Step 6 — Add docs.updateTemplate entries (openrpc.json + rpc_spec.rs)

Files: crates/hero_books_server/openrpc.json, crates/hero_books_server/src/web/rpc_spec.rs

  • openrpc.json:
    • Bump info.version from "0.1.6" to "0.1.7".
    • Insert new method object between docs.installTemplate and docs.jobStatus:
      {
        "name": "docs.updateTemplate",
        "summary": "Submit a hero_proc job that updates the Docusaurus template at the given build path. Returns the hero_proc job id as a string; poll via docs.jobStatus.",
        "params": [
          { "name": "path", "schema": { "type": "string" }, "required": true }
        ],
        "result": {
          "name": "jobRef",
          "schema": {
            "type": "object",
            "properties": { "job_id": { "type": "string" } }
          }
        }
      }
      
  • rpc_spec.rs: insert the same entry into the inline schema between docs.installTemplate and docs.jobStatus.

Dependencies: Step 3 (so the verification diff in Step 8 passes).

Step 7 — Add unit test

Files: crates/hero_books_server/src/web/rpc.rs

  • Add test_docs_update_template_missing_params next to test_docs_install_template_missing_params. Same shape: missing path, empty path, missing params object — each returns an error body containing "missing or empty 'path'".

Dependencies: Step 2.

Step 8 — Verify spec/impl parity and build

Files: none (read-only check + cargo).

  • Run the verification snippet from INSTRUCTIONS_OPENRPC.md §Verification — diff must be empty.
  • cargo check -p hero_books_server and cargo check --bin hero_docs succeed.
  • cargo test -p hero_books_server --lib — 18 passing (one new), no regressions.
  • Smoke test: cargo run --bin hero_docs -- update-template --help.
  • Live RPC test against running hero_books_server/hero_proc: discovery, validation, submission, idempotent dedup, error-tail surfacing through docs.jobStatus.

Dependencies: Steps 1-7.

Acceptance Criteria

  • hero_docs update-template --help prints usage with --path (required).
  • hero_docs update-template --path /tmp/test_docs_install (against an already-installed template) succeeds.
  • crates/hero_books_server/src/web/rpc.rs defines handle_docs_update_template.
  • docs.updateTemplate is wired into the dispatcher between docs.installTemplate and docs.jobStatus.
  • handle_docs_job_status does not synthesise an output_path for docs_update_template_* jobs.
  • ## Docs doc-header in rpc.rs lists docs.updateTemplate.
  • crates/hero_books_server/openrpc.json contains the docs.updateTemplate method entry; info.version is "0.1.7".
  • crates/hero_books_server/src/web/rpc_spec.rs inline schema contains docs.updateTemplate.
  • INSTRUCTIONS_OPENRPC.md §Verification diff produces empty output.
  • cargo check -p hero_books_server and cargo check --bin hero_docs succeed.
  • cargo test -p hero_books_server --lib passes (with new test_docs_update_template_missing_params).

Notes

  • Path semantics: same as docs.installTemplatepath is the Docusaurus build directory. We bypass DocSite::from_heroscript because the underlying template::update_template(&Path) only needs that path.
  • Output_path policy: docs.updateTemplate falls in the same bucket as docs.installTemplate — the user-supplied path is not recoverable from the input hash, so no output_path is synthesised.
  • info.version bump: 0.1.6 -> 0.1.7. Subsequent siblings (#104-#107) will continue bumping.
  • Dedup keying: only path is in the hash. Idempotent re-submission with the same path returns the same job_id.
  • Error codes: -32602 for invalid params, -32000 for hero_proc / internal failures.
  • Pre-condition for live success: the build path must already contain an installed template (docs.installTemplate first, or a manually-installed one). template::update_template re-extracts the embedded template and re-runs bun install. The same bun runtime requirement noted in #102 applies.
## Implementation Spec for Issue #103 ### Objective Expose `DocSite::update_template` over the OpenRPC interface as `docs.updateTemplate`. Mirrors the pattern established by #102 / `docs.installTemplate`: the handler submits a `hero_proc` job that shells out to a new `hero_docs update-template` subcommand and returns `{ "job_id": "<n>" }` for clients to poll via `docs.jobStatus`. ### Requirements - `docs.updateTemplate` is dispatchable from `crates/hero_books_server/src/web/rpc.rs` and reaches a new handler `handle_docs_update_template`. - Matching entry in `crates/hero_books_server/openrpc.json`, mirroring the `docs.installTemplate` style (no `examples` block — none exist). - `info.version` in `openrpc.json` bumped (`0.1.6` -> `0.1.7`). - The `## Docs` section in the `rpc.rs` file-level doc-header (added in #102) gains a `docs.updateTemplate` bullet. - `hero_docs` (`src/bin/hero_docs.rs`) gains a new `update-template` subcommand: `hero_docs update-template --path <path>`. It calls `hero_books_docusaurus::template::update_template(&path)` directly — no heroscript loading, since the underlying function only needs a build-directory path. (Same path semantics as `docs.installTemplate`.) - Handler shells out via `config.hero_docs_bin`, never `DocSite` in-process. - Handler reuses `submit_or_dedup_docs_job(...)` with action name `docs_update_template_<input_hash>`. - `handle_docs_job_status`'s prefix-recognition comment block is extended to mention `docs_update_template_` alongside `docs_install_template_` (no behaviour change — both already fall through the strip-list and emit no `output_path`, since the `path` is not recoverable from the input hash). - Invalid-params responses use `RpcResponse::invalid_params` (-32602); internal failures use `RpcResponse::error(id, -32000, ...)`. - Inline schema in `rpc_spec.rs` (used by `rpc.discover`) gains a matching `docs.updateTemplate` entry. - INSTRUCTIONS_OPENRPC.md §Verification diff produces empty output (spec list and dispatcher list match). ### Files to Modify/Create - `src/bin/hero_docs.rs` — new `UpdateTemplate(UpdateTemplateArgs)` variant, args struct, runner. - `crates/hero_books_server/src/web/rpc.rs` — `handle_docs_update_template`, dispatch arm, doc-header bullet, prefix-recognition comment update, unit test. - `crates/hero_books_server/src/web/rpc_spec.rs` — inline `docs.updateTemplate` entry. - `crates/hero_books_server/openrpc.json` — `docs.updateTemplate` method entry, bump `info.version` to `"0.1.7"`. No new files. ### Implementation Plan #### Step 1 — Add `update-template` subcommand to `hero_docs` Files: `src/bin/hero_docs.rs` - Extend the `Commands` enum with `UpdateTemplate(UpdateTemplateArgs)`. - Args struct: ```rust #[derive(Args)] struct UpdateTemplateArgs { /// Path to the Docusaurus build directory whose template should be updated #[arg(long)] path: String, } ``` - Runner: ```rust fn run_update_template(args: UpdateTemplateArgs) -> Result<(), Box<dyn std::error::Error>> { let path = std::path::PathBuf::from(&args.path); hero_books_docusaurus::template::update_template(&path)?; log::info!("Template updated at {}", path.display()); Ok(()) } ``` - Dispatch from `main()` alongside the existing `New`, `Generate`, `InstallTemplate` arms. Dependencies: none. #### Step 2 — Add `handle_docs_update_template` handler Files: `crates/hero_books_server/src/web/rpc.rs` - Add the function below `handle_docs_install_template` with signature `fn handle_docs_update_template(id: Option<Value>, params: Option<Value>, config: &ServerConfig) -> RpcResponse`. - Body: - Extract `path` (required, non-empty). Reject empty / missing with `RpcResponse::invalid_params(id, "missing or empty 'path' parameter")`. - `let input_hash = calculate_docs_input_hash(&[&path]);` - Build script: `format!("{} update-template --path {}", hero_docs, path_q)` using `shell_quote`. - Submit via `submit_or_dedup_docs_job(id, config, &format!("docs_update_template_{}", input_hash), &script)`. Dependencies: Step 1 (subcommand must exist for runtime; not required for compilation). #### Step 3 — Wire dispatch arm Files: `crates/hero_books_server/src/web/rpc.rs` - In the `match request.method.as_str()` block, add immediately after `docs.installTemplate` and before `docs.jobStatus`: ```rust "docs.updateTemplate" => handle_docs_update_template(request.id, request.params, config), ``` Dependencies: Step 2. #### Step 4 — Extend prefix-recognition comment in `handle_docs_job_status` Files: `crates/hero_books_server/src/web/rpc.rs` - The comment block added in #102 already lists "docs.updateTemplate" as one of the upcoming methods that will fall through without an `output_path`. Update it so `docs.updateTemplate` is no longer "upcoming" — move it next to `docs.installTemplate` in the description. No code changes inside the strip-list itself: both `docs_install_template_` and `docs_update_template_` action names simply do not match either `docs_new_` or `docs_generate_` prefix-strip arms, so they correctly fall through. Dependencies: Step 2. #### Step 5 — Update doc-header Files: `crates/hero_books_server/src/web/rpc.rs` - Inside the `## Docs` section added in #102, insert `docs.updateTemplate` after `docs.installTemplate`: ```rust //! - `docs.updateTemplate` - Update the Docusaurus template at a build path ``` Dependencies: none. #### Step 6 — Add `docs.updateTemplate` entries (openrpc.json + rpc_spec.rs) Files: `crates/hero_books_server/openrpc.json`, `crates/hero_books_server/src/web/rpc_spec.rs` - `openrpc.json`: - Bump `info.version` from `"0.1.6"` to `"0.1.7"`. - Insert new method object between `docs.installTemplate` and `docs.jobStatus`: ```json { "name": "docs.updateTemplate", "summary": "Submit a hero_proc job that updates the Docusaurus template at the given build path. Returns the hero_proc job id as a string; poll via docs.jobStatus.", "params": [ { "name": "path", "schema": { "type": "string" }, "required": true } ], "result": { "name": "jobRef", "schema": { "type": "object", "properties": { "job_id": { "type": "string" } } } } } ``` - `rpc_spec.rs`: insert the same entry into the inline schema between `docs.installTemplate` and `docs.jobStatus`. Dependencies: Step 3 (so the verification diff in Step 8 passes). #### Step 7 — Add unit test Files: `crates/hero_books_server/src/web/rpc.rs` - Add `test_docs_update_template_missing_params` next to `test_docs_install_template_missing_params`. Same shape: missing `path`, empty `path`, missing `params` object — each returns an `error` body containing `"missing or empty 'path'"`. Dependencies: Step 2. #### Step 8 — Verify spec/impl parity and build Files: none (read-only check + cargo). - Run the verification snippet from INSTRUCTIONS_OPENRPC.md §Verification — diff must be empty. - `cargo check -p hero_books_server` and `cargo check --bin hero_docs` succeed. - `cargo test -p hero_books_server --lib` — 18 passing (one new), no regressions. - Smoke test: `cargo run --bin hero_docs -- update-template --help`. - Live RPC test against running `hero_books_server`/`hero_proc`: discovery, validation, submission, idempotent dedup, error-tail surfacing through `docs.jobStatus`. Dependencies: Steps 1-7. ### Acceptance Criteria - [ ] `hero_docs update-template --help` prints usage with `--path` (required). - [ ] `hero_docs update-template --path /tmp/test_docs_install` (against an already-installed template) succeeds. - [ ] `crates/hero_books_server/src/web/rpc.rs` defines `handle_docs_update_template`. - [ ] `docs.updateTemplate` is wired into the dispatcher between `docs.installTemplate` and `docs.jobStatus`. - [ ] `handle_docs_job_status` does not synthesise an `output_path` for `docs_update_template_*` jobs. - [ ] `## Docs` doc-header in `rpc.rs` lists `docs.updateTemplate`. - [ ] `crates/hero_books_server/openrpc.json` contains the `docs.updateTemplate` method entry; `info.version` is `"0.1.7"`. - [ ] `crates/hero_books_server/src/web/rpc_spec.rs` inline schema contains `docs.updateTemplate`. - [ ] INSTRUCTIONS_OPENRPC.md §Verification diff produces empty output. - [ ] `cargo check -p hero_books_server` and `cargo check --bin hero_docs` succeed. - [ ] `cargo test -p hero_books_server --lib` passes (with new `test_docs_update_template_missing_params`). ### Notes - **Path semantics**: same as `docs.installTemplate` — `path` is the Docusaurus *build directory*. We bypass `DocSite::from_heroscript` because the underlying `template::update_template(&Path)` only needs that path. - **Output_path policy**: `docs.updateTemplate` falls in the same bucket as `docs.installTemplate` — the user-supplied `path` is not recoverable from the input hash, so no `output_path` is synthesised. - **`info.version` bump**: `0.1.6` -> `0.1.7`. Subsequent siblings (#104-#107) will continue bumping. - **Dedup keying**: only `path` is in the hash. Idempotent re-submission with the same path returns the same `job_id`. - **Error codes**: `-32602` for invalid params, `-32000` for hero_proc / internal failures. - **Pre-condition for live success**: the build path must already contain an installed template (`docs.installTemplate` first, or a manually-installed one). `template::update_template` re-extracts the embedded template and re-runs `bun install`. The same `bun` runtime requirement noted in #102 applies.
Member

Test Results

Suite: cargo test -p hero_books_server --lib
Total: 18 — Passed: 18 — Failed: 0

New test added with this change:

  • web::rpc::tests::test_docs_update_template_missing_params — covers missing path, empty path, and missing params object.

Spec/impl parity

INSTRUCTIONS_OPENRPC.md §Verification diff is empty — openrpc.json and rpc.rs dispatcher agree, with docs.updateTemplate listed in both.

Build

  • cargo check -p hero_books_server — OK
  • cargo check --bin hero_docs — OK

CLI smoke test

$ hero_docs update-template --help
Update the Docusaurus template at a build directory

Usage: hero_docs update-template --path <PATH>

Options:
      --path <PATH>  Path to the Docusaurus build directory whose template should be updated
  -h, --help         Print help

Live end-to-end RPC test (against running hero_books_server + hero_proc)

Step Result
rpc.discover lists docs.updateTemplate with required path pass
Validation: missing path returns -32602 "missing or empty 'path' parameter" pass
Validation: empty path returns -32602 pass
Submit returns {"job_id":"85"} pass
Re-submit with same path dedupes to the same job_id: "85" pass
Job dispatched to hero_proc and ran hero_docs update-template ... pass
Failure tail surfaces correctly via docs.jobStatus pass
No output_path field on the response (per design — input path not recoverable from hash) pass

The single live failure was an environment issue (bun is not installed) inside template::update_template, identical to the #102 / docs.installTemplate test result. Same shared infrastructure, not a defect introduced by this change. The RPC chain (dispatch → handler → hero_proc → hero_docs update-template → status reporting) executed end-to-end.

info.version

Unchanged at 0.1.6 — this rolling PR shipped its single version bump in #102; subsequent children on the same branch reuse it.

## Test Results **Suite:** `cargo test -p hero_books_server --lib` **Total:** 18 — Passed: 18 — Failed: 0 New test added with this change: - `web::rpc::tests::test_docs_update_template_missing_params` — covers missing `path`, empty `path`, and missing `params` object. ### Spec/impl parity INSTRUCTIONS_OPENRPC.md §Verification diff is empty — `openrpc.json` and `rpc.rs` dispatcher agree, with `docs.updateTemplate` listed in both. ### Build - `cargo check -p hero_books_server` — OK - `cargo check --bin hero_docs` — OK ### CLI smoke test ``` $ hero_docs update-template --help Update the Docusaurus template at a build directory Usage: hero_docs update-template --path <PATH> Options: --path <PATH> Path to the Docusaurus build directory whose template should be updated -h, --help Print help ``` ### Live end-to-end RPC test (against running hero_books_server + hero_proc) | Step | Result | | --- | --- | | `rpc.discover` lists `docs.updateTemplate` with required `path` | pass | | Validation: missing `path` returns `-32602 "missing or empty 'path' parameter"` | pass | | Validation: empty `path` returns `-32602` | pass | | Submit returns `{"job_id":"85"}` | pass | | Re-submit with same `path` dedupes to the same `job_id: "85"` | pass | | Job dispatched to `hero_proc` and ran `hero_docs update-template ...` | pass | | Failure tail surfaces correctly via `docs.jobStatus` | pass | | No `output_path` field on the response (per design — input path not recoverable from hash) | pass | The single live failure was an environment issue (`bun is not installed`) inside `template::update_template`, identical to the #102 / `docs.installTemplate` test result. Same shared infrastructure, not a defect introduced by this change. The RPC chain (dispatch → handler → hero_proc → `hero_docs update-template` → status reporting) executed end-to-end. ### `info.version` Unchanged at `0.1.6` — this rolling PR shipped its single version bump in #102; subsequent children on the same branch reuse it.
Member

Implementation Summary

docs.updateTemplate is now exposed over JSON-RPC, mirroring the pattern established by docs.installTemplate (#102). Same path semantics (build-directory path, no heroscript loading), same dedup behaviour, same output_path-free response shape.

Files changed (this iteration)

  • src/bin/hero_docs.rs — new UpdateTemplate(UpdateTemplateArgs) subcommand wrapping hero_books_docusaurus::template::update_template(&path).
  • crates/hero_books_server/src/web/rpc.rs
    • handle_docs_update_template handler.
    • Dispatch arm "docs.updateTemplate" between docs.installTemplate and docs.jobStatus.
    • ## Docs doc-header updated.
    • Prefix-recognition comment in handle_docs_job_status now lists docs.updateTemplate alongside docs.installTemplate (no behaviour change — both action-name prefixes correctly fall through without producing an output_path).
    • New unit test test_docs_update_template_missing_params.
  • crates/hero_books_server/src/web/rpc_spec.rs — inline schema gains a matching docs.updateTemplate entry.
  • crates/hero_books_server/openrpc.json — new method entry. info.version unchanged at 0.1.6 — single version bump per rolling PR (#102 already did it).
  • crates/hero_books_server/openrpc.client.generated.rs — auto-regenerated by the openrpc_client! macro.

Tests

  • 18/18 lib tests pass (one new).
  • Spec/impl parity diff empty.
  • Live RPC test confirmed: discovery, validation, submit, idempotent dedup, hero_proc dispatch, error-tail surfacing through docs.jobStatus.

Notes

  • Path semantics: path is the Docusaurus build directory, passed straight to template::update_template(&Path). Same convention as docs.installTemplate.
  • Same bun runtime prerequisite for end-to-end success — not introduced by this PR.
## Implementation Summary `docs.updateTemplate` is now exposed over JSON-RPC, mirroring the pattern established by `docs.installTemplate` (#102). Same path semantics (build-directory path, no heroscript loading), same dedup behaviour, same `output_path`-free response shape. ### Files changed (this iteration) - `src/bin/hero_docs.rs` — new `UpdateTemplate(UpdateTemplateArgs)` subcommand wrapping `hero_books_docusaurus::template::update_template(&path)`. - `crates/hero_books_server/src/web/rpc.rs` - `handle_docs_update_template` handler. - Dispatch arm `"docs.updateTemplate"` between `docs.installTemplate` and `docs.jobStatus`. - `## Docs` doc-header updated. - Prefix-recognition comment in `handle_docs_job_status` now lists `docs.updateTemplate` alongside `docs.installTemplate` (no behaviour change — both action-name prefixes correctly fall through without producing an `output_path`). - New unit test `test_docs_update_template_missing_params`. - `crates/hero_books_server/src/web/rpc_spec.rs` — inline schema gains a matching `docs.updateTemplate` entry. - `crates/hero_books_server/openrpc.json` — new method entry. `info.version` unchanged at `0.1.6` — single version bump per rolling PR (#102 already did it). - `crates/hero_books_server/openrpc.client.generated.rs` — auto-regenerated by the `openrpc_client!` macro. ### Tests - 18/18 lib tests pass (one new). - Spec/impl parity diff empty. - Live RPC test confirmed: discovery, validation, submit, idempotent dedup, hero_proc dispatch, error-tail surfacing through `docs.jobStatus`. ### Notes - Path semantics: `path` is the Docusaurus *build directory*, passed straight to `template::update_template(&Path)`. Same convention as `docs.installTemplate`. - Same `bun` runtime prerequisite for end-to-end success — not introduced by this PR.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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_books#103
No description provided.