Skip to content

feat: ship bundled recipe workflows#118

Draft
Keith-CY wants to merge 114 commits intodevelopfrom
feat/recipe-import-library
Draft

feat: ship bundled recipe workflows#118
Keith-CY wants to merge 114 commits intodevelopfrom
feat/recipe-import-library

Conversation

@Keith-CY
Copy link
Copy Markdown
Collaborator

@Keith-CY Keith-CY commented Mar 12, 2026

Summary

  • ship bundled and importable recipe workflows for dedicated agents and persona packs
  • align the recipe action surface with OpenClaw CLI semantics while keeping higher-level business actions for recipe authors
  • add a canonical recipe action catalog shared by backend validation/materialization and frontend action descriptions
  • keep runner execution OpenClaw-first, with guarded destructive actions and profile/auth sync for remote environments
  • add bundled recipe lifecycle controls: explicit bundled upgrades, digest-based update detection, and per-version approval invalidation
  • tighten Recipe review/execution with strict approval gating and non-technical bundled/source/risk status in Recipes and Cook
  • add dockerized OpenClaw recipe e2e coverage plus expanded authoring and runner documentation

Key additions

  • two-layer action surface: recommended business actions plus CLI primitive actions
  • canonical action catalog module: src-tauri/src/recipe_action_catalog.rs
  • bundled recipe seed state machine for missing / upToDate / updateAvailable / localModified / conflictedUpdate
  • workspace metadata for source kind, bundled version, trust level, risk level, and approval-required state
  • explicit bundled recipe upgrade action from the Recipes workspace cards
  • digest-scoped recipe approval for saved workspace recipes, enforced in both Review UX and backend execution
  • updated docs for authoring, runner boundaries, local docker debugging, and CLI action catalog

Product behavior changes

  • bundled recipes are only auto-seeded when missing; newer bundled versions no longer silently overwrite workspace copies
  • bundled recipe upgrades are explicit, and local modifications block one-click replacement
  • approval is tracked per workspace recipe digest and is invalidated by edits, re-imports, and bundled upgrades
  • Review now explains what must be ready, why execution is blocked, and when approval is required before continuing
  • Recipes workspace cards now show bundled/local/url source, update state, risk/approval badges, and bundled update actions

Testing

  • cargo test recipe_ --manifest-path src-tauri/Cargo.toml
  • cargo test recipe_workspace --manifest-path src-tauri/Cargo.toml
  • cargo test recipe_library_tests --manifest-path src-tauri/Cargo.toml
  • cargo fmt --all --manifest-path src-tauri/Cargo.toml -- --check
  • bun run typecheck
  • bun test src/pages/__tests__/Recipes.test.tsx src/components/__tests__/RecipePlanPreview.test.tsx src/pages/__tests__/cook-execution.test.ts

cjs and others added 19 commits March 8, 2026 11:08
- Use gh CLI to get release body (avoids shell escaping issues)
- Use jq for proper JSON construction
- Skip .sig and latest.json files
- Use HTTP/1.1 for large file upload stability
- Detect user timezone to determine if likely in China
- CN users fetch release assets from GitLab (lay2dev/clawpal)
- Other users fetch from GitHub as before
- Falls back to secondary source if primary fails
feat(site): geo-aware download links
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

📊 Test Coverage Report

Metric Base (develop) PR (feat/recipe-import-library) Delta
Lines 74.59% (6228/8350) 74.65% (6303/8443) 🟢 +0.06%
Functions 69.12% (714/1033) 69.35% (724/1044) 🟢 +0.23%
Regions 75.97% (10250/13492) 76.00% (10363/13635) 🟢 +0.03%

Coverage measured by cargo llvm-cov (clawpal-core + clawpal-cli).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

📦 PR Build Artifacts

Platform Download Size
Windows-x64 📥 clawpal-Windows-x64 27.3 MB
Linux-x64 📥 clawpal-Linux-x64 105.7 MB
macOS-x64 📥 clawpal-macOS-x64 13.9 MB
macOS-ARM64 📥 clawpal-macOS-ARM64 13.2 MB

🔨 Built from 29be7b9 · View workflow run
⚠️ Unsigned development builds — for testing only

Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #118 Review — Recipe Import Library & Authoring Workbench

CI all green across 4 platforms + coverage + e2e. This is a substantial feature PR (~19k lines, 106 files) that ships:

  • Recipe library model with examples/recipe-library/ structure
  • RecipeBundle + ExecutionSpec core schema with validation
  • Recipe adapter (legacy → structured spec compilation)
  • Recipe executor with systemd materialization
  • Runtime store for instances/runs/artifacts
  • Recipe workspace (fork/save/delete)
  • Recipe Studio with source editor + form mode
  • Draft recipe → Cook execution pipeline
  • Runtime traceability (source digest/origin)
  • Docker recipe E2E test
  • Comprehensive authoring documentation

Architecture is clean: bundle declares capabilities/resources, spec template gets compiled with params, executor materializes to systemd commands, runtime store tracks provenance. The phase boundary discipline (no remote reciped, no workflow engine, no OPA in phase 1) is well-documented.

One non-blocking note below. LGTM ✅

reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
serde = { version = "1.0.214", features = ["derive"] }
serde_json = "1.0.133"
serde_yaml = "0.9"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NBS: serde_yaml 0.9 is officially deprecated (the crate description literally says +deprecated). It still works fine, but if you plan to maintain this long-term, consider migrating to serde_yml or just using serde_json + json5 (which you already have) and dropping YAML support from parse_structured_document. Not urgent — just flagging for future awareness.

@Keith-CY Keith-CY marked this pull request as draft March 12, 2026 19:31
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after d9f8276..ba8460e (2 new commits)

CI: 7/9 green, Windows-x64 and Docker Recipe E2E still pending (typical for these runners).

The expanded action surface is solid:

  • New actions (delete_agent, unbind_channel, set_agent_model, set_agent_persona, clear_agent_persona, set_channel_persona, clear_channel_persona, upsert_markdown_document, delete_markdown_document, ensure_model_profile, delete_model_profile, ensure_provider_auth, delete_provider_auth) all follow the established internal-command pattern with proper JSON payload serialization.
  • markdown_document.rs — clean new module with path traversal prevention (validate_relative_path rejects .. components), section-level upsert via heading matching, and proper local/remote symmetry.
  • Safety guards are consistent: bindings_reference_agent prevents orphaned bindings on agent delete, auth_ref_is_in_use_by_bindings blocks auth removal while in use, with force escape hatches.
  • agent_identity.rsPersonaChange enum is a nice refinement over the previous Option<&str> approach, making set/clear/preserve semantics explicit.
  • Recipe adapter correctly registers capability and resource claims for all new action types.
  • Test coverage hits the key paths (materializer, binding removal, markdown section upsert, path validation).

NBS: channel_persona_patch (commands/mod.rs) currently only supports discord and errors on other channel types. If telegram/signal/etc. are planned for a future phase, a brief doc comment noting this is intentional scope limiting would help.

LGTM ✅

Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 747d702..80d88fb (1 new commit)

CI: rust ❌ (cargo fmt --check), Docker Recipe E2E ❌ | macOS-ARM64 ✅ | frontend ✅ | coverage ✅ | home-perf ✅ | Provider Auth E2E ✅ | Builds + Recipe GUI E2E + metrics + Screenshots pending.

New: config caching for remote identity writes

Good performance optimization. resolve_remote_identity_path now returns (String, Option<String>) — piggybacking the SFTP read of the existing IDENTITY.md content onto the path resolution probe, eliminating a redundant SFTP read in each caller. Three callers (write_remote_agent_identity, set_remote_agent_persona, clear_remote_agent_persona) all drop their separate sftp_read blocks.

New _with_config variants accept Option<&Value> for a pre-parsed config, and remote_apply_queued_commands_with_services parses config once upfront (serde_json::from_str(&config_before).ok()) and passes it through to all internal commands. This avoids N redundant SSH config reads when applying N queued recipe commands. Clean ownership pattern with owned_cfg + borrow.

🔴 Blocking

BS 1: cargo fmt failures in ssh.rs (persisting since d1b8d95 — now 8 review cycles)

Three formatting diffs remain at L531, L552, L572. Fix: cargo fmt --all. This has been flagged in every review since March 21 01:53 UTC.

Docker Recipe E2E — systemPrompt config readback still returns empty string (pre-existing, tracked since 4b35e2e).

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

The cached config must reflect the latest config after each
__config_write__ step, otherwise subsequent identity/persona
steps can't find newly created agents and fail with rollback.

Previous commit cached config_before (pre-recipe config) which
didn't contain the new agent entry.
Commands like 'openclaw agents add' modify the config file directly.
The cached config must be refreshed after these commands, otherwise
subsequent internal commands (setup_identity, set_agent_persona)
can't find the newly created agent and trigger rollback.
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 80d88fb..6066528 (2 new commits)

CI: rust ❌ (cargo fmt --check), Docker Recipe E2E ❌ | Recipe GUI E2E pending | Builds (4 platforms) ✅ | frontend ✅ | coverage ✅ | home-perf ✅ | Screenshots ✅

Config cache staleness fix

Good bugfix — likely the root cause of the Docker Recipe E2E systemPrompt readback failure that persisted across many review cycles.

Commit 1: fix: update cached config after __config_write__ — When the apply loop encounters a __config_write__ command, it extracts the new config content via rollback_command_content and updates cached_cfg before execution. Subsequent commands in the same batch now see updated config state. cached_cfg correctly changed to let mut.

Commit 2: fix: re-read config after CLI commands that modify openclaw.json — For external CLI commands, config is re-read via SFTP after each successful execution. Catches modifications by openclaw config set and similar commands.

Both changes are minimal and well-scoped.

🔴 Still blocking (pre-existing)

BS 1: cargo fmt failures in ssh.rs — persisting since d1b8d95 (9 review cycles). Fix: cargo fmt --all.

Docker Recipe E2E — systemPrompt readback empty. These commits should fix it but CI hasn't confirmed yet.

🟡 Non-blocking

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove
  • bun.lock alongside package-lock.json — intentional?

Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction: Switching to REQUEST_CHANGES — rust CI still fails on cargo fmt --check in ssh.rs. The config cache fix commits themselves look great (LGTM on the logic), but please run cargo fmt --all before merge. This has been flagged since d1b8d95 (9 review cycles).

- Show skipped recipes with reason instead of undefined values
- Add seconds display for times >= 1s (e.g. '422000 (422.0s)')
- All 3 built-in recipes now appear in the metrics report
- New Dockerfile.local: single container with both ClawPal and OpenClaw
- recipe-e2e.mjs supports --mode=local flag
  - sshExec/sshReadJson use local bash/fs instead of SSH
  - resetSshd is no-op in local mode
- CI workflow builds and runs both SSH and local variants
- PR comment shows side-by-side comparison of SSH vs Local performance
- entrypoint-local.sh starts OpenClaw gateway + Xvfb + tauri-driver
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 6066528..2b8d62a (2 new commits)

CI: rust ❌ (cargo fmt --check), Docker Recipe E2E ❌ | Builds (3/4) ✅ | frontend ✅ | coverage ✅ | home-perf ✅ | Screenshots ✅ | Recipe GUI E2E + metrics + Windows pending.

New commits

feat: improve perf report with all 3 recipes and human-readable times — Shows skipped recipes with reason instead of undefined, adds seconds display for large values. Nice polish.

feat: add local mode E2E test (ClawPal + OpenClaw same machine)Dockerfile.local runs both ClawPal and OpenClaw in a single container, recipe-e2e.mjs gets --mode=local that replaces SSH exec/read with local bash/fs calls. CI workflow builds both SSH and local variants with side-by-side perf comparison in PR comment. Good addition for catching SSH-unrelated recipe issues.

🔴 Still blocking

BS 1: cargo fmt failures in ssh.rs (persisting since d1b8d95 — now 10 review cycles)

Three formatting diffs remain at L531 (.await {), L552 (.await {), L572 (format!() line too long). Fix: cargo fmt --all. This has been flagged in every review since March 21 01:53 UTC. Please run it before the next push.

Docker Recipe E2E — systemPrompt config readback still returns empty string.

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

Instead of rebuilding ClawPal from scratch, use the already-built
clawpal-recipe-harness image as base and just add OpenClaw + config.
This saves ~35 min of duplicate Rust compilation.
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 2b8d62a..d8ba2d3 (1 new commit)

CI: rust ❌ (cargo fmt --check), Docker Recipe E2E ❌, Recipe GUI E2E pending. Builds (4 platforms) ✅ + frontend ✅ + coverage ✅ + home-perf ✅ + metrics ✅ + Screenshots ✅.

New commit

fix: reuse SSH harness image as base for local modeDockerfile.local now uses ARG BASE_IMAGE=clawpal-recipe-harness:latest as a multi-stage base instead of duplicating the entire builder stage. Drops ~45 lines of redundant build steps. Clean simplification — local mode inherits the compiled binary, tauri-driver, Node.js, and test harness from the SSH image, only adding RECIPE_MODE=local, OpenClaw install, config seed, and the local entrypoint override. No concerns.

🔴 Still blocking

BS 1: cargo fmt failures in ssh.rs (persisting since d1b8d95 — now 11 review cycles)

Three formatting diffs remain at L531 (.await {), L552 (.await {), L572 (format!() line too long). Fix: cargo fmt --all. This has been flagged in every review since March 21 01:53 UTC.

Docker Recipe E2E — systemPrompt config readback still returns empty string (pre-existing, tracked since 4b35e2e).

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

Keith-CY and others added 5 commits March 22, 2026 02:47
…switch

- Integrate DiscordIdCache into both remote and local slow paths to persist
  guild/channel id→name mappings across page reloads (discord-id-cache.json)
- Fall back to one-by-one channel resolution when batch openclaw channels
  resolve fails (e.g. single 404 channel blocking all others)
- Preserve previously-resolved channel names via channel_name_fallback_map
  when CLI resolution fails, preventing overwrite with raw IDs
- Fix tab-switch showing wrong VPS channels by resolving remote
  persistenceScope synchronously during render (setState-during-render
  pattern) instead of in useEffect, eliminating the one-render lag
- Change useChannelCache initialization from useEffect to useLayoutEffect
  so state maps are populated before browser paint
- Add unit tests for DiscordIdCache, parse_resolve_name_map, channel name
  fallback, loadInitialSharedChannels, and tab-switch cache behavior

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…149)

Co-authored-by: cjs <cjs@cjs-mini.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
A rate-limited response proves the API key is valid and the endpoint is
reachable — failing the test on 429 causes flaky CI when free-tier
quotas are exhausted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after d8ba2d3..2c28f96 (4 new commits)

CI: rust ❌ (cargo fmt --check), Docker Recipe E2E ❌, Recipe GUI E2E ❌ | Builds (4 platforms) ✅ | frontend ✅ | coverage ✅ | home-perf ✅ | metrics ✅ | Screenshots ✅ | Provider Auth E2E ✅

New commits

4 Recipe GUI E2E harness fixes — no feature code changes:

  • fix: restore anthropic provider with fake apiKey for model access step
  • fix: restore anthropic provider config, add debug screenshots, broaden Done text matching
  • debug: add page text polling during execution to diagnose hang
  • fix: increase timeouts - job 90min, execution wait 600s

All confined to harness/recipe-e2e/. No concerns with the harness changes.

🔴 Still blocking

BS 1: cargo fmt failures in ssh.rs (persisting since d1b8d95 — now 12 review cycles)

Three formatting diffs remain at L531 (.await {.await\n{), L552 (same pattern), L572 (format!() line too long). Fix: cargo fmt --all. This has been flagged in every review since March 21 01:53 UTC. Please run it.

Docker Recipe E2E — systemPrompt config readback still returns empty string (pre-existing, tracked since 4b35e2e). The config cache staleness fix from 6066528 should address this but cargo fmt failure blocks the rust CI check from confirming.

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 2c28f96..6ccd782 (merge syncs + new features)

CI: rust ❌ (cargo fmt) | frontend ❌ (TypeScript) | Builds (4 platforms) ❌ | Docker Recipe E2E ❌ | Recipe GUI E2E ❌ | Screenshots ❌ | coverage ✅ | home-perf ✅ | Provider Auth E2E ✅

New since last review

~30 new commits — merge syncs from develop/main, progressive Discord channel loading (#128), Discord id cache with one-by-one resolve fallback, PR #150 merge, and Provider Auth E2E fix.

🔴 Blocking

BS 1: cargo fmt failure in ssh.rs — import ordering: use base64::Engine and use std::collections::HashMap need reordering. Fix: cargo fmt --all. This has been flagged repeatedly in prior review cycles.

BS 2: TypeScript compilation error in BackupsPanel.tsx

src/components/BackupsPanel.tsx(77,11): error TS18047: 'backups' is possibly 'null'.
src/components/BackupsPanel.tsx(81,12): error TS18047: 'backups' is possibly 'null'.

This breaks tsc --noEmit, which cascades to all 4 platform builds (they run npm run buildtsc && vite build). Fix: add a null guard before accessing backups on lines 77/81.

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

Keith-CY and others added 2 commits March 22, 2026 19:19
Tier 1 — New test files for uncovered modules:
- recipe_tests.rs: 30 tests covering validate(), render_template_string/value(),
  validate_recipe_source(), load_recipes_from_source_text(), builtin_recipes(),
  step_references_empty_param(), build_candidate_config_from_template()
- recipe_action_catalog_tests.rs: 7 tests (uniqueness, required fields,
  legacy alias integrity, read-only invariant)
- recipe_bundle_tests.rs: expanded from 1 to 9 tests (JSON/YAML parsing,
  kind validation, empty execution kinds)
- recipe_runtime/systemd.rs: 11 inline tests (sanitize_unit_fragment,
  escape_systemd_env, env_patch_dropin, materialize_job/service)

Tier 2 — Tests added to existing modules:
- cli_runner.rs: 12 tests (remote_config_root_from_path, shell_quote,
  command_kind_for_activity, summarize_activity_text, display_command)
- commands/discovery.rs: 7 tests (summarize_resolution_error,
  append_resolution_warning)
- commands/logs.rs: 4 tests (summarize_remote_config_payload)

Tier 3 — Frontend:
- api-read-cache.test.ts: 6 tests (hasGuidanceEmitted, buildCacheKey,
  shouldLogRemoteInvokeMetric)

Total: ~58 new tests, 0 business code changes.
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 6ccd782..c308de7 (2 new commits)

CI: rust ❌ (cargo fmt --check) | frontend ❌ (TypeScript) | Builds (4 platforms) ❌ | Docker Recipe E2E ❌ | Recipe GUI E2E ❌ | Screenshots ❌ | coverage ✅ | home-perf ✅ | Provider Auth E2E

New commits

feat: add cook activity audit trail (#151) — Well-designed observability feature:

  • CookActivityEmitter emits real-time cook:activity events via Tauri's event system during recipe execution
  • ApplyQueueStepResult tracks per-step timing, exit codes, stdout/stderr summaries
  • AuditEntry persisted in recipe store runs for post-hoc review
  • CookActivityPanel React component with expandable step details, status badges, chronological ordering
  • PrecheckActivity struct adds auth-check phase activity tracking
  • Remote apply now uses dynamic config_path via remote_resolve_openclaw_config_path instead of hardcoded ~/.openclaw/openclaw.json — good robustness improvement
  • run_openclaw_remote_with_autofix removed — callers now handle errors inline with log_remote_autofix_suppressed for owner_display_parse_error. Cleaner than silent retry.
  • ParamForm gets disabled prop for execution-in-progress state
  • log_remote_config_write + summarize_remote_config_payload for structured config write logging

test: add comprehensive test coverage for PR #118 recipe platform — 321 lines of recipe tests + 68 action catalog tests + 62 bundle tests + 117 systemd tests + 96 CookActivityPanel tests + 63 ParamForm tests + 41 store tests + Docker E2E audit trail assertions. Thorough coverage.

🔴 Blocking

BS 1: cargo fmt failures across multiple files
cli_runner.rs (15 diffs), discovery.rs (2 diffs), logs.rs (1 diff), lib.rs (2 diffs), plus test files. Fix: cargo fmt --all.

BS 2: TypeScript compilation errors

src/components/BackupsPanel.tsx(77,11): error TS18047: 'backups' is possibly 'null'.
src/components/BackupsPanel.tsx(81,12): error TS18047: 'backups' is possibly 'null'.
src/lib/__tests__/api-read-cache.test.ts(1,28): error TS2305: Module '"bun:test"' has no exported member 'it'.

BackupsPanel needs a null guard. api-read-cache.test.ts should use test instead of it (bun:test doesn't export it).

BS 3: ssh.rs duplicate import
The diff shows use base64::Engine; removed from line 1 but it still appears elsewhere — the file has a duplicate use base64::Engine; import. This has been flagged in prior review cycles.

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

lay2OcBot added 2 commits March 22, 2026 15:53
…helpers

- execution_spec_tests.rs: +6 tests (wrong kind, unsupported execution kind,
  all supported kinds accepted, bundle alignment, bundle kind mismatch,
  empty bundle capabilities)
- markdown_document.rs: +8 inline tests (path validation accept/reject,
  empty paths, upsert section append/empty doc/preserve footer,
  normalize_remote_dir, normalize_optional_text)
- cook-execution.test.ts: +4 tests (markCookStatuses done, markCookFailure
  restore, buildCookPhaseItems, getCookPlanningProgress null)
- cook-plan-context.test.ts: +5 tests (hasBlockingAuthIssues empty/warn/error,
  buildCookRouteSummary local/remote/docker)
- api-read-cache.test.ts: fix bun:test import (it→test)

Total: +23 tests, 0 business code changes.
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after c308de7..dc32f6b (2 new commits)

CI: rust ❌ (cargo fmt --check) | frontend ❌ (TypeScript) | Builds (4 platforms) ❌ | Docker Recipe E2E ❌ | Recipe GUI E2E ❌ | coverage ✅ | home-perf ✅ | Provider Auth E2E

What's new

test: expand test coverage — Good additions: execution spec validation tests (wrong kind, unsupported kind, all supported kinds, bundle alignment, mismatched execution kind, empty capabilities), markdown document tests (relative path validation, upsert append/empty/preserve), cook helper tests (markCookStatuses, markCookFailure). Solid coverage.

style: fix cargo fmt in cli_runner test assertions — Addresses the cli_runner.rs formatting diffs from my previous BS 1.

api-read-cache.test.ts ittest — Fixes the bun:test export error from my previous BS 2. ✅

🔴 Blocking

BS 1: cargo fmt failures in recipe_docker_e2e.rs
New formatting diffs at lines ~430 and ~446: assert_result_audit_trail signature formatting and assert_stored_run_audit_trail parameter layout. Fix: cargo fmt --all.

BS 2: TypeScript compilation errors in new test files

cook-execution.test.ts(210): Property 'state' does not exist on type 'CookStepStatus'.
cook-execution.test.ts(225): Argument of type 'null' is not assignable to parameter of type 'CookPlanningStage'.
cook-plan-context.test.ts(292): 'instanceType' does not exist in type 'CookRouteContext'.

The new test files reference properties/types that don't match the current type definitions. Fix: align test code with the actual type definitions.

BackupsPanel.tsx null check (from previous review, still open):

BackupsPanel.tsx(77): 'backups' is possibly 'null'.

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

lay2OcBot added 2 commits March 22, 2026 16:15
- cook-execution.test.ts: CookStepStatus is a string union, not an object
- cook-plan-context.test.ts: CookRouteContext uses isRemote not instanceType,
  kind is 'ssh' not 'remote'
- cargo fmt --all applied
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after dc32f6b..9c59796 (2 new commits)

CI: rustcoveragehome-perfProvider Auth E2E ✅ | frontend ❌ | Builds (4 platforms) ❌ | Docker Recipe E2E ❌ | Recipe GUI E2E ❌ | Screenshots ❌ | metrics ❌

Resolved

  • BS 1 (cargo fmt) — ✅ Fixed across cli_runner.rs, discovery.rs, logs.rs, lib.rs, recipe_action_catalog_tests.rs, recipe_tests.rs, ssh.rs, recipe_docker_e2e.rs. Module ordering in lib.rs alphabetized.
  • BS 2 (TypeScript test compilation) — ✅ cook-execution.test.ts: CookStepStatus is now a plain string, markCookStatuses/markCookFailure take string arrays. cook-plan-context.test.ts: instanceType removed from CookRouteContext, buildCookRouteSummary returns "ssh" for SSH instances. All aligned with current types.
  • BS 3 (duplicate import in ssh.rs) — ✅ Resolved by fmt pass.

🔴 Still blocking

BS: TypeScript compilation error in BackupsPanel.tsx (unchanged since 2 review cycles ago)

src/components/BackupsPanel.tsx(77,11): error TS18047: 'backups' is possibly 'null'.
src/components/BackupsPanel.tsx(81,12): error TS18047: 'backups' is possibly 'null'.

This blocks tsc --noEmit, which cascades to all 4 platform builds. Fix: add a null guard (e.g. if (!backups) return null; or optional chaining).

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

- recipe_store_tests.rs: +3 tests (multi audit entries order, multi
  resource claims, unknown instance returns empty)
- recipe_workspace_tests.rs: +4 tests (digest determinism, digest changes
  with content, read unknown errors, delete rejects traversal)
- BackupsPanel.tsx: add null guard for 'backups' (fixes pre-existing
  TS18047 that blocked all frontend CI)
Copy link
Copy Markdown
Collaborator

@dev01lay2 dev01lay2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after 9c59796..29be7b9 (1 new commit)

CI: rustfrontendcoveragehome-perf ✅ Builds (4 platforms) ✅ Screenshots ✅ Provider Auth E2E ✅ | Docker Recipe E2E ❌ | Recipe GUI E2E ❌

Resolved

  • BS (BackupsPanel.tsx TS18047) — ✅ Fixed with !backups || null guard on line 77. Clean one-liner.

New test coverage

  • recipe_store_tests.rs +55 lines: store persistence and retrieval paths
  • recipe_workspace_tests.rs +29 lines: workspace lifecycle edge cases

Both additions are straightforward and well-scoped.

Docker Recipe E2E / Recipe GUI E2E failures

Both appear to be pre-existing harness issues unrelated to this commit. The systemPrompt config readback issue (Docker E2E) was addressed by the config cache staleness fix in an earlier commit — may need a harness-side adjustment. Recipe GUI E2E timeout is likely the same bundled recipe library path issue noted in prior reviews.

🟡 Non-blocking (from earlier reviews, still open)

  • mod-rs-refactor-plan.md at repo root — move to docs/ or remove before merge
  • bun.lock alongside package-lock.json — intentional?

LGTM ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants