* feat(daemon): let a rig choose CLAUDE.local.md for Claude managed blocks (#25)
A rig spec can now declare
managed_blocks:
claude-code: CLAUDE.local.md
so OpenRig writes its managed instruction blocks for Claude Code members to
CLAUDE.local.md instead of a git-tracked CLAUDE.md. The default stays
CLAUDE.md and Codex members stay on AGENTS.md.
- Validation accepts only the claude-code key with CLAUDE.md or
CLAUDE.local.md, and rejects anything else before a member launches.
- The selection is stored on the rig (migration 085) and bound once in
StartupOrchestrator.startNode, so launch, restore replay, relaunch,
continue and added members all write the same file. Startup
guidance_merge, profile managed_block projection and the conflict
target all use it.
- Teardown cleans only the selected file. The other file is never edited,
moved or deleted; blocks already written to CLAUDE.md stay until the
user removes them, as the reference docs explain.
- Export and the bundle rig.yaml rewrite round-trip the field.
Reported and proposed by @hvpaiva.
* docs(daemon): say accurately which paths deliver the Claude managed-block file
Handover launches the successor directly and writes no guidance, so the
startNode and migration comments no longer list it among the delivery paths.
Comment-only change.
* release: prepare 0.5.16
Set the version to 0.5.16 and finalize the changelog and release notes for
the Claude instruction-file option (#25), the advisory portability report (#56)
and the README update (#54).
* docs: keep uncommitted edits safe when removing old Claude blocks
Recommend deleting only the managed sections by hand, and warn that
git restore CLAUDE.md discards every unstaged change to the file. Say that
portability findings never fail the check while operational errors still do.
---------
Co-authored-by: OpenRig contributors <noreply@openrig.dev>
Lane-A carry (qitem 4b805845; PM scope ruling option A — the user-authorable
path gets a worked example; authored by review-r1, delivered via acting-orch,
byte-verified 1ebf873b / resulting docs fb03335f).
- packages/daemon/policies/examples/my-cautious-dev.policy.md: placement
policies/examples/ is the censused minimal-sibling convention (no prior
examples convention existed; PM has path-flexibility if they rule otherwise
at acceptance). Ships via build-package's recursive policies staging
(cp -r), and is structurally NOT materialized as a builtin — the
materializer's known-four allowlist admits only locked|standard|open|yolo
(builtin suite re-run green beside this carry).
- docs/reference/rig-spec.md: the delivered touchpoint patch applied;
resulting file hash matches the delivery manifest.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Add optional docs field to RigSpec for bundled documentation
Add a top-level `docs` array field to the pod-aware RigSpec schema.
Each entry has a `path` field (safe relative path, same validation as
culture_file and startup file paths).
The engine does not consume these files for instantiation — they are
metadata for humans and agents setting up the environment before launch.
The bundle packer includes listed docs in the archive so setup
instructions travel with the distributable artifact.
Schema changes:
- types.ts: add RigSpecDoc interface and docs field to RigSpec
- rigspec-schema.ts: validate docs array with path safety checks
- rigspec-schema.ts: normalize docs into typed array
- rigspec-codec.ts: serialize docs field
Bundle changes:
- pod-bundle-assembler.ts: collect docs files into the bundle archive
Tests:
- rigspec-schema-docs.test.ts: 7 tests covering validation, rejection,
normalization, and path safety
Reference doc:
- docs/reference/rig-spec.md: document the docs field
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix review findings: null guard, missing-docs failure, bundle tests
Addresses all findings from R2 and orch1-peer independent reviews:
1. Guard against null/non-object entries in docs validation — docs: [null]
and docs: [42] now return clean validation errors instead of crashing
the validator (R2 #1, peer #1)
2. Bundle assembly fails loudly when a declared docs file is missing from
disk — prevents silently shipping bundles that advertise docs they
don't contain (R2 #2, peer #2)
3. Add bundle-level tests proving docs are collected and missing docs
fail assembly (R2 #3)
Tests: 5 new tests (3 schema null/primitive/string + 2 bundle positive/negative)
Full suite: 128 files, 1722/1722 passing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Provision runtime config and disclose setup mutations
* Fix: force acceptEdits for managed sessions, don't inherit restrictive modes
deliverStartup unconditionally sets permissions.defaultMode = "acceptEdits"
for managed Claude sessions instead of preserving existing restrictive modes
via nullish coalesce. A pre-existing denyAll or other restrictive mode in
.claude/settings.local.json would previously survive provisioning, causing
managed rigs to hit prompt/block behavior in reused workspaces.
Found by: dev1-qa independent repro
Fix: change ?? "acceptEdits" to unconditional "acceptEdits" assignment
Test: regression test seeds denyAll, verifies deliverStartup overrides it
Full suite: 128 files, 1723/1723 passing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix JSON normalization, disclosure copy, and README accuracy
Addresses CodeRabbit findings verified by QA:
1. readJsonObject now excludes arrays (typeof "object" includes arrays
in JS). Prevents silent property loss when settings.local.json or
.mcp.json contains a bare JSON array instead of an object.
2. provisionPermissionsAndMcps refactored to use readJsonObject,
readJsonObjectField, and readStringArray consistently instead of
raw JSON.parse + manual type checks. Same helpers used elsewhere
in the adapter.
3. Setup disclosure for .claude/settings.local.json now mentions
statusLine mutation alongside permissions (CodeRabbit item 3).
4. README clarifies that managed runtime boot performs config writes
while rig setup only discloses the paths (CodeRabbit item 6).
5. Regression test: array-valued settings.local.json and .mcp.json
are recovered to proper objects during provisioning.
Full suite: 128 files, 1724/1724 passing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Harden setup disclosure tests against copy churn
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move reference docs from packages/daemon/docs/reference/ to
docs/reference/ at the repo root — this is the authoring location
- Update .gitignore to track docs/reference/ alongside docs/as-built/
- Update build-package.sh to copy from docs/reference/ into the
assembled CLI package (not from inside the daemon package)
- Daemon startup still copies the bundled docs to ~/.openrig/reference/
on start for stable agent-accessible paths
Flow: docs/reference/ (edit here) → build → cli/daemon/docs/reference/
(npm package) → daemon start → ~/.openrig/reference/ (agents read here)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>