feat: The Librarian β shared read-only volumes for hatchlings#27
feat: The Librarian β shared read-only volumes for hatchlings#27
Conversation
Implements #18: hatchlings can mount shared reference materials as read-only volumes via hatch.sh --library <path>. - hatch.sh: --library flag adds :ro volume mount to docker-compose.yml, persists path in fleet.json, warns if path missing locally - fleet.sh: status output shows library mount per instance - test-hatch.sh: validates compose mount and fleet.json library field - README.md: documents The Librarian pattern with usage examples
dahifi
left a comment
There was a problem hiding this comment.
Zephyr code review β PR #27 (The Librarian)
π Looks good to merge β clean, focused implementation.
What's good:
--libraryflag is optional and non-breaking β existinghatch.shusage unchanged- Read-only mount (
:ro) is the right default for shared resources - Warning-not-error when path doesn't exist locally is smart for remote deploy scenarios
fleet.jsonpersistence meansfleet.sh statuscan report library paths without Docker inspection- Tests cover both compose mount presence and registry field β solid coverage
- README docs are clear with concrete examples
EOFβEOF2fix for nested heredocs is a good catch
E2E failure is pre-existing β container health check timeout affects both #26 and #27 but not earlier PRs. Likely an OC version or CI env change. The Build and Test workflow passes. Worth investigating separately (maybe the latest OC npm package changed its health endpoint behavior?).
Minor nit (non-blocking): The awk injection for the volume mount is fragile if the compose template ever changes the data mount line. A yq approach would be more robust, but it's fine for now given the template is controlled.
Ready for merge. π’
π¦ Automated Review (Zephyr)Local tests: 25/25 pass β
Good details:
CI note: E2E failure is container health timeout in GitHub Actions β unrelated to this PR (main branch E2E passes green). Transient CI env issue. One minor suggestion (non-blocking): The awk injection for the volume mount assumes exact indentation match on the data volume line. If the template's whitespace ever changes, the mount won't inject. A more robust approach (yq or a sed anchor) could future-proof it. Not blocking β current approach works fine with the existing template. Ready to merge. π’ |
dahifi
left a comment
There was a problem hiding this comment.
π¦ Automated review (Zephyr)
Tested locally β all tests pass (25/25 hatch, 23/23 fleet).
Summary: Adds --library PATH flag to hatch.sh that mounts a shared read-only volume at /home/openclaw/library. Path tracked in fleet.json, shown in fleet.sh status.
Code quality: Clean. Awk injection for compose mount is pragmatic, heredoc delimiter fix is correct, test coverage is solid including cleanup.
Minor suggestion for later: Add a negative test (hatch without --library β no library mount in compose). Low risk.
Ready to merge. π’
Closes #18
What
Adds
--library <path>flag tohatch.shso hatchlings can mount shared reference materials as read-only volumes.Changes
--libraryflag injects a:rovolume mount into the generateddocker-compose.ymland persists the path infleet.json. Warns (doesn't fail) if the path doesn't exist locally β it may exist on the remote deploy host.statusoutput now showslibrary=<path>orlibrary=noneper instance.fleet.jsonlibrary field.Usage
Produces:
Tests
All 48 tests pass (
test-hatch.sh: 25,test-fleet.sh: 23).