@openrig/cli 0.4.7 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/daemon/assets/plugins/openrig-core/skills/applying-a-permission-policy/SKILL.md +120 -0
  2. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/precompact-hook.mjs +0 -0
  3. package/daemon/assets/plugins/openrig-core/skills/claude-compaction-restore/scripts/restore-from-jsonl.mjs +0 -0
  4. package/daemon/assets/plugins/openrig-core/skills/delegating-work/SKILL.md +43 -0
  5. package/daemon/assets/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md +2 -0
  6. package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +4 -7
  7. package/daemon/assets/plugins/openrig-core/skills/openrig-skills/SKILL.md +50 -57
  8. package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +16 -2
  9. package/daemon/dist/adapters/claude-code-adapter.d.ts +0 -9
  10. package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
  11. package/daemon/dist/adapters/claude-code-adapter.js +13 -46
  12. package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
  13. package/daemon/dist/adapters/claude-resume.d.ts +1 -1
  14. package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
  15. package/daemon/dist/adapters/claude-resume.js +8 -2
  16. package/daemon/dist/adapters/claude-resume.js.map +1 -1
  17. package/daemon/dist/adapters/codex-resume.d.ts +1 -1
  18. package/daemon/dist/adapters/codex-resume.d.ts.map +1 -1
  19. package/daemon/dist/adapters/codex-resume.js +4 -2
  20. package/daemon/dist/adapters/codex-resume.js.map +1 -1
  21. package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
  22. package/daemon/dist/adapters/codex-runtime-adapter.js +10 -5
  23. package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
  24. package/daemon/dist/adapters/pi-resume.d.ts +1 -1
  25. package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
  26. package/daemon/dist/adapters/pi-resume.js +7 -2
  27. package/daemon/dist/adapters/pi-resume.js.map +1 -1
  28. package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
  29. package/daemon/dist/adapters/pi-runtime-adapter.js +4 -1
  30. package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
  31. package/daemon/dist/adapters/yolo-mode.d.ts +23 -0
  32. package/daemon/dist/adapters/yolo-mode.d.ts.map +1 -0
  33. package/daemon/dist/adapters/yolo-mode.js +49 -0
  34. package/daemon/dist/adapters/yolo-mode.js.map +1 -0
  35. package/daemon/dist/build-info.js +3 -3
  36. package/daemon/dist/db/migrations/055_node_permission_policy.d.ts +13 -0
  37. package/daemon/dist/db/migrations/055_node_permission_policy.d.ts.map +1 -0
  38. package/daemon/dist/db/migrations/055_node_permission_policy.js +17 -0
  39. package/daemon/dist/db/migrations/055_node_permission_policy.js.map +1 -0
  40. package/daemon/dist/db/migrations/056_rig_permission_policy.d.ts +13 -0
  41. package/daemon/dist/db/migrations/056_rig_permission_policy.d.ts.map +1 -0
  42. package/daemon/dist/db/migrations/056_rig_permission_policy.js +17 -0
  43. package/daemon/dist/db/migrations/056_rig_permission_policy.js.map +1 -0
  44. package/daemon/dist/db/migrations/057_node_policy_provenance.d.ts +19 -0
  45. package/daemon/dist/db/migrations/057_node_policy_provenance.d.ts.map +1 -0
  46. package/daemon/dist/db/migrations/057_node_policy_provenance.js +26 -0
  47. package/daemon/dist/db/migrations/057_node_policy_provenance.js.map +1 -0
  48. package/daemon/dist/db/migrations/058_rig_policy_provenance.d.ts +15 -0
  49. package/daemon/dist/db/migrations/058_rig_policy_provenance.d.ts.map +1 -0
  50. package/daemon/dist/db/migrations/058_rig_policy_provenance.js +22 -0
  51. package/daemon/dist/db/migrations/058_rig_policy_provenance.js.map +1 -0
  52. package/daemon/dist/domain/builtin-policy-reference.d.ts +13 -0
  53. package/daemon/dist/domain/builtin-policy-reference.d.ts.map +1 -0
  54. package/daemon/dist/domain/builtin-policy-reference.js +58 -0
  55. package/daemon/dist/domain/builtin-policy-reference.js.map +1 -0
  56. package/daemon/dist/domain/native-resume-probe.d.ts +1 -1
  57. package/daemon/dist/domain/native-resume-probe.d.ts.map +1 -1
  58. package/daemon/dist/domain/native-resume-probe.js +11 -4
  59. package/daemon/dist/domain/native-resume-probe.js.map +1 -1
  60. package/daemon/dist/domain/node-inventory.js +2 -2
  61. package/daemon/dist/domain/node-inventory.js.map +1 -1
  62. package/daemon/dist/domain/permission-policy/policy-ref.d.ts +89 -0
  63. package/daemon/dist/domain/permission-policy/policy-ref.d.ts.map +1 -0
  64. package/daemon/dist/domain/permission-policy/policy-ref.js +171 -0
  65. package/daemon/dist/domain/permission-policy/policy-ref.js.map +1 -0
  66. package/daemon/dist/domain/permission-policy/policy-spec.d.ts +34 -0
  67. package/daemon/dist/domain/permission-policy/policy-spec.d.ts.map +1 -0
  68. package/daemon/dist/domain/permission-policy/policy-spec.js +106 -0
  69. package/daemon/dist/domain/permission-policy/policy-spec.js.map +1 -0
  70. package/daemon/dist/domain/restore-orchestrator.d.ts +14 -0
  71. package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
  72. package/daemon/dist/domain/restore-orchestrator.js +90 -6
  73. package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
  74. package/daemon/dist/domain/rig-expansion-service.d.ts.map +1 -1
  75. package/daemon/dist/domain/rig-expansion-service.js +10 -1
  76. package/daemon/dist/domain/rig-expansion-service.js.map +1 -1
  77. package/daemon/dist/domain/rig-repository.d.ts +45 -0
  78. package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
  79. package/daemon/dist/domain/rig-repository.js +75 -1
  80. package/daemon/dist/domain/rig-repository.js.map +1 -1
  81. package/daemon/dist/domain/rigspec-codec.d.ts.map +1 -1
  82. package/daemon/dist/domain/rigspec-codec.js +6 -0
  83. package/daemon/dist/domain/rigspec-codec.js.map +1 -1
  84. package/daemon/dist/domain/rigspec-exporter.d.ts.map +1 -1
  85. package/daemon/dist/domain/rigspec-exporter.js +8 -0
  86. package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
  87. package/daemon/dist/domain/rigspec-instantiator.d.ts +18 -1
  88. package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
  89. package/daemon/dist/domain/rigspec-instantiator.js +187 -8
  90. package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
  91. package/daemon/dist/domain/rigspec-preflight.d.ts +11 -0
  92. package/daemon/dist/domain/rigspec-preflight.d.ts.map +1 -1
  93. package/daemon/dist/domain/rigspec-preflight.js +35 -1
  94. package/daemon/dist/domain/rigspec-preflight.js.map +1 -1
  95. package/daemon/dist/domain/rigspec-schema.d.ts.map +1 -1
  96. package/daemon/dist/domain/rigspec-schema.js +25 -0
  97. package/daemon/dist/domain/rigspec-schema.js.map +1 -1
  98. package/daemon/dist/domain/runtime-adapter.d.ts +5 -0
  99. package/daemon/dist/domain/runtime-adapter.d.ts.map +1 -1
  100. package/daemon/dist/domain/runtime-adapter.js.map +1 -1
  101. package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
  102. package/daemon/dist/domain/seat-handover-service.js +7 -1
  103. package/daemon/dist/domain/seat-handover-service.js.map +1 -1
  104. package/daemon/dist/domain/successor-session-launcher.d.ts +4 -0
  105. package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
  106. package/daemon/dist/domain/successor-session-launcher.js +2 -0
  107. package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
  108. package/daemon/dist/domain/types.d.ts +17 -0
  109. package/daemon/dist/domain/types.d.ts.map +1 -1
  110. package/daemon/dist/domain/types.js.map +1 -1
  111. package/daemon/dist/routes/agent-images.d.ts.map +1 -1
  112. package/daemon/dist/routes/agent-images.js +2 -0
  113. package/daemon/dist/routes/agent-images.js.map +1 -1
  114. package/daemon/dist/routes/rigs.js +8 -0
  115. package/daemon/dist/routes/rigs.js.map +1 -1
  116. package/daemon/dist/startup.d.ts.map +1 -1
  117. package/daemon/dist/startup.js +17 -1
  118. package/daemon/dist/startup.js.map +1 -1
  119. package/daemon/docs/reference/rig-spec.md +19 -0
  120. package/daemon/policies/builtin/locked.policy.md +24 -0
  121. package/daemon/policies/builtin/open.policy.md +24 -0
  122. package/daemon/policies/builtin/standard.policy.md +25 -0
  123. package/daemon/policies/builtin/yolo.policy.md +20 -0
  124. package/daemon/policies/examples/my-cautious-dev.policy.md +40 -0
  125. package/daemon/specs/agents/shared/runtime/claude-settings.fragment.json +1 -20
  126. package/daemon/specs/agents/shared/skills/core/openrig-architect/SKILL.md +0 -2
  127. package/daemon/specs/agents/shared/skills/process/systematic-debugging/find-polluter.sh +0 -0
  128. package/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md +1 -0
  129. package/dist/build-info.js +3 -3
  130. package/dist/commands/setup.d.ts +14 -0
  131. package/dist/commands/setup.d.ts.map +1 -1
  132. package/dist/commands/setup.js +131 -8
  133. package/dist/commands/setup.js.map +1 -1
  134. package/package.json +1 -1
  135. package/daemon/specs/agents/shared/skills/pm/backlog-capture/SKILL.md +0 -43
  136. package/daemon/specs/agents/shared/skills/pm/context-builder/SKILL.md +0 -87
  137. package/daemon/specs/agents/shared/skills/pm/exec-summary/SKILL.md +0 -84
  138. package/daemon/specs/agents/shared/skills/pm/office-hours/SKILL.md +0 -129
  139. package/daemon/specs/agents/shared/skills/pm/plan-review/SKILL.md +0 -98
  140. package/daemon/specs/agents/shared/skills/pm/requirements-writer/SKILL.md +0 -113
  141. package/daemon/specs/agents/shared/skills/pm/ui-mockup/SKILL.md +0 -76
  142. package/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md +0 -148
  143. package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +0 -266
  144. package/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md +0 -213
  145. package/daemon/specs/agents/shared/skills/process/systematic-debugging/CREATION-LOG.md +0 -119
  146. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-academic.md +0 -14
  147. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-pressure-1.md +0 -58
  148. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-pressure-2.md +0 -68
  149. package/daemon/specs/agents/shared/skills/process/systematic-debugging/test-pressure-3.md +0 -69
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: applying-a-permission-policy
3
+ description: "Use when a permission policy is attached to a rig/seat (rig.yaml permission_policy:), or a user asks you to apply one, and you must translate that harness-neutral policy into the target harness's LIVE permission config — Claude settings.json / Codex config.toml / Pi run flags. Agent-driven and interactive: you read the policy, ground yourself in YOUR harness version, show the diff, and ask before writing. NOT for defining policies (that's the policy spec) and NOT a set-and-forget updater."
4
+ metadata:
5
+ openrig:
6
+ stage: established # config cells VM-verified + cold-transfer PASSING (rerun #2, 627abbb6) + built-in SPEC FILES landed → skill translates FROM the spec (POINT-not-COPY). The two established criteria met 2026-08-04. Reviewed at push.
7
+ tested_against: # VERSION STAMP — the whole point; re-verify at every harness bump
8
+ claude_code: "2.1.220 — VM-CONFIRMED 2026-08-03 (all cells)"
9
+ codex: "0.120.0 — VM-CONFIRMED 2026-08-03 (sandbox_mode/approval_policy; on-failure deprecated-but-accepted)"
10
+ pi: "0.83.0 — VM-CONFIRMED 2026-08-03: --approve/--no-approve govern PROJECT-RESOURCE TRUST, NOT tool permissions; Pi has NO permission surface (see Pi leg)"
11
+ verification_status: "Live-verified 2026-08-03/04 (dev-qa @ v-openrig-build). Claude 2.1.220 + Codex 0.120.0 config cells CONFIRMED live. Pi 0.83.0 divergence folded (flags = project-resource trust, not a permission gate). Cold-transfer rerun #1 blocked on the force_push/push_to_remote prefix collision → added the PREFIX-COLLISION rule. Cold-transfer rerun #2 (qitem 001c95fd, verdict SHA 627abbb6bf08ad2f350e2101f11438975def7b193b8da8bbcb747647239afc358): TRANSFERS — all 5 gate checks pass (collision resolved deterministically without asking; single ordinary write confirmation; defaultMode floor written; Codex workspace-write/on-request; Pi compute-nothing). Blocking collision/floor defect CLOSED → gate cleared, 4.8-shippable (provisional-with-passing-cold-transfer). Non-blocking seam closed: the built-in SPEC FILES landed (arch-accepted, source:builtin) → skill translates FROM the spec, interim in-skill pinned summary retired (POINT-not-COPY). stage:ESTABLISHED 2026-08-04 — both criteria met."
12
+ ---
13
+
14
+ # Applying a permission policy
15
+
16
+ ## Translation is best-effort — read this first
17
+ This skill provides the policy schema and OpenRig's best current understanding of how to translate it to each harness. That guidance is **best-effort and version-stamped**: harness permission surfaces change frequently across versions, so a mapping that is correct today can drift on a later release. When you apply a config-surface policy:
18
+ - **Verify against the current docs for your installed harness version.** Treat this skill's tables as version-stamped starting points (see `tested_against`), not settled truth.
19
+ - **Prefer testing in a protected or disposable environment first.** An incorrect write can lock a seat out or over-permit it, so confirm the format before applying it to a live seat.
20
+ - **Hand-editing via the harness's own settings tools is always a valid path.** If a translation is uncertain, setting the policy directly — or asking the user to — is a legitimate outcome, not a failure.
21
+
22
+ The reliable, deterministic parts are the **blunt instruments**: the YOLO full-bypass flag and the floor (Claude `acceptEdits` / Codex `workspace-write`), which ride the stable launch-flag surface. **Fine-grained config-rule translation — the allow/ask/deny prefix rules and the Codex posture — is the best-effort part** and carries no guarantee of exact fidelity. If a translation looks wrong, fall back to a blunt instrument or a direct hand-edit.
23
+
24
+ ## ⚠ Read this preamble first — why this is a SKILL, not a script (do not "improve" it into a deterministic updater)
25
+ Harness permission formats are a **moving target**. The exact fact this skill is stamped against — Claude Code 2.1.220 permission rules are **prefix-only** (no flag-precise Bash match) — is *version-specific*; the rule grammar can change on the next point release. A hardcoded/deterministic updater would foot-gun the instant it does, and a wrong permission write can **lock a seat out or silently over-permit it**. So the maintained artifact is this caveated, version-stamped skill that an agent reads and applies **interactively, grounding in the live format** — never a code path that writes blindly. If you are tempted to replace this with a deterministic projector: that temptation is the bug this preamble exists to stop.
26
+
27
+ ## When to reach for this
28
+ - A rig/seat has a policy attached (`rig.yaml … permission_policy: <file>`), and you're at **setup/preflight** — apply it (**mandatory for autonomous seats**, see the freeze warning).
29
+ - A user asks "apply the Standard/Open/Locked/Operator policy here" or "set up permissions like <host>".
30
+ - NOT for authoring policies (that's the policy spec) and NOT for daemon-level enforcement (OpenRig is agnostic — it injects nothing).
31
+
32
+ ## What you're translating (the boundary)
33
+ INPUT = a **harness-neutral policy spec** (arch's schema): `default_posture`, `floor`, `allow`/`ask`/`deny` as **semantic actions** (`push_to_remote`, `delete_files`, …), `destructive_class`, `source: builtin|custom`. You TRANSLATE that intent → the harness's live config. You never invent policy; you never pre-bake harness config into the spec.
34
+
35
+ ## The apply flow (interactive — the interactive-ask IS the product)
36
+ 1. **Read the policy spec** + its `source:` marker (built-in read-only from the package = copy-to-customize before editing; custom = user space).
37
+ 2. **PREFLIGHT (mandatory) — ground yourself in THIS environment:**
38
+ - **daemon-HOME must equal seat-HOME**, or a user-level Claude write never reaches the seat (assessment iv). Check; if they differ, **stop and ask** — do not write into the wrong HOME.
39
+ - Read the harness's **actual current config file** + confirm its schema against your installed version (`claude --version`, the live settings.json shape, codex/pi versions). If the format differs from this skill's `tested_against`, trust the LIVE format and flag the drift.
40
+ 3. **Derive the per-harness config** from the semantic actions (see the three legs below). Compute the Codex posture-collapse + Pi bit.
41
+ 4. **Show the concrete DIFF before writing** (old → new, per file). Never a blind write.
42
+ 5. **Resolve best-effort actions by the built-in's rule FIRST, then ask only on genuine ambiguity.** Best-effort destructive actions (`force_push`, `delete_files`, `delete_everything`, `read_secrets`) default to **`ask`** (never a `deny` that can't be enforced) — apply that default rather than stopping to question-back. Surface a question only when the policy is genuinely ambiguous or the seat is interactive. **For a same-prefix collision (`push_to_remote` vs `force_push`, both `Bash(git push:*)`), NEVER ask — apply the deterministic PREFIX-COLLISION rule in the Claude leg.** (Live cold-transfers caught fresh agents *question-backing* — first on the `force_push` default, then on the prefix collision — instead of applying the fixed rule; both freeze an autonomous seat.) On a Claude-only fleet, if the policy denies `network_egress`, **say so explicitly**: it is NOT enforceable — Claude has no network gate, a `Bash(curl:*)`/`Bash(wget:*)` deny is best-effort, and `python`/`node` fetch bypasses it (live-verified: `urllib` reached HTTPS 200 under a curl/wget deny). Route real egress-gating to the Codex sandbox, or record it as advisory on Claude.
43
+ 6. **Back up the current config**, then write. Prefer the **user-level** file (`~/.claude/settings.json`) for durable policy — it's the clobber-resistant tier (deny wins across the union). **ALWAYS include `defaultMode: "acceptEdits"` in the Claude settings.json you write** — the floor key must be PRESENT in the file, or the config policy strips the floor. (This is the exact gap a live cold-transfer test FAILED on: the fresh agent wrote allow/deny lists but omitted `defaultMode`, leaving the seat below the floor.)
44
+ 7. **Verify** the write landed and the seat can see it (re-read; confirm `defaultMode: "acceptEdits"` is present; for an autonomous seat, confirm no `ask` will freeze it).
45
+
46
+ ## Two surfaces — and this skill writes only ONE of them
47
+ Permissions live on two surfaces with opposite stability — which is the whole reason for the agent-driven split:
48
+ - **LAUNCH-FLAG surface — STABLE (>1yr) → OpenRig sets it DETERMINISTICALLY, NOT this skill.** The flags OpenRig passes at boot: Claude `--permission-mode` / `--dangerously-skip-permissions`; Codex sandbox/bypass flags; Pi `--approve`/`--no-approve`. **Two things live here, both OpenRig-owned: the FLOOR (minimum, by default) and YOLO (full bypass, opt-in).**
49
+ - **CONFIG-FILE surface — CHAOTIC → NEVER deterministic → THIS SKILL'S DOMAIN.** Claude `settings.json` allow/ask/deny + defaultMode; Codex `config.toml` approval rules. This is where the Locked / Standard / Open policies get applied — agent-driven, version-stamped, caveated. (Pi has **no permission surface at all** — its `--approve`/`--no-approve` flags govern project-resource trust, not tool permissions (VM-confirmed Pi 0.83.0); a permission policy does not translate to Pi. See the Pi leg.)
50
+
51
+ **THE FLOOR (launch-flag, OpenRig-set — this skill KNOWS it, never WRITES it):** Claude `--permission-mode acceptEdits` (keep it); **Codex workspace-only** (stop forcing `danger-full-access` — ≈ Codex's own default ≈ setting-nothing = agnostic); Pi `--no-approve` (a project-resource-trust floor — Pi has no permission gate; see the Pi leg). **One consistent unconditional minimum** (no by-context switching — that mode idea is parked 5.0). A chosen config-file policy layers ON TOP of the floor.
52
+
53
+ **YOLO MODE (launch-flag, OpenRig-set, opt-in — for people done with permissions):** OpenRig boots every seat with the full-bypass flag (Claude `--dangerously-skip-permissions`; Codex full-bypass). **When YOLO is on, CONFIG-FILE POLICY IS MOOT** — this skill does NOT apply a config policy (or explicitly notes it's overridden by the flag); don't fight the bypass. YOLO is OpenRig's deterministic job, not this skill's. (**Operator = YOLO mode** — subsumed.)
54
+
55
+ ## The three harness legs (skill-owned mapping knowledge, version-stamped + caveated)
56
+
57
+ ### Claude — `~/.claude/settings.json` (user-level, clobber-resistant)
58
+ - **Action → prefix map** (VM-CONFIRMED @ Claude 2.1.220, 2026-08-03 — every row exercised through real Claude tool calls). `fidelity`: `clean` = the prefix honors intent; `best_effort` = prefix-only can't fully enforce → prefer `ask`, never a `deny` that lies.
59
+
60
+ | Semantic action | `permissions.*` prefix rule(s) | fidelity |
61
+ |---|---|---|
62
+ | push_to_remote | `Bash(git push:*)` | clean |
63
+ | force_push | ask the flag-first forms `Bash(git push --force:*)` `Bash(git push -f:*)` `Bash(git push --force-with-lease:*)`; base `Bash(git push:*)` follows push_to_remote (see the collision rule) | **best_effort** — catches flag-FIRST force; flag-LAST (`git push origin main --force`) leaks |
64
+ | create_pr | `Bash(gh pr create:*)` | clean |
65
+ | publish_package | `Bash(npm publish:*)` `Bash(pnpm publish:*)` `Bash(yarn publish:*)` `Bash(cargo publish:*)` | clean (multi-pattern) |
66
+ | merge_or_release | `Bash(git merge:*)` `Bash(git tag:*)` `Bash(gh release:*)` | best_effort — protected-branch semantics not expressible |
67
+ | delete_files | `Bash(rm:*)` | **best_effort** — target-first leak (`rm <t> -rf` slips); scope not boundable → default `ask` |
68
+ | delete_everything | `Bash(rm -rf:*)` `Bash(rm -fr:*)` | **best_effort** — same leak → default to `ask`, never a silent deny |
69
+ | reset_or_discard_vcs | `Bash(git reset:*)` `Bash(git clean:*)` `Bash(git checkout:*)` `Bash(git branch -D:*)` | best_effort |
70
+ | drop_persistent_store | `Bash(dropdb:*)` `Bash(docker volume rm:*)` (+ project-specific) | best_effort (open-ended) → `ask` |
71
+ | rig_up / rig_down | `Bash(rig up:*)` / `Bash(rig down:*)` | clean — ⚠ an `ask` here FREEZES an autonomous seat |
72
+ | mutate_topology | `Bash(rig add:*)` `Bash(rig remove:*)` `Bash(rig rename:*)` | clean |
73
+ | run_toolchain | `Bash(npm:*)` `Bash(npx:*)` `Bash(pnpm:*)` `Bash(yarn:*)` `Bash(node:*)` `Bash(tsc:*)` `Bash(vitest:*)` `Bash(jest:*)` | clean (the known set) |
74
+ | run_arbitrary_shell | `Bash(*)` — this IS the `default_posture` knob | clean |
75
+ | network_egress | `Bash(curl:*)` `Bash(wget:*)` (partial) | **best_effort** — Claude has NO native network gate; real floor = Codex sandbox (route it there) |
76
+ | read_secrets | `Read(./.env)` `Read(~/.ssh/**)` `Read(**/*secret*)` (path-scoped) | **best_effort** — path-based, not secret-aware |
77
+ | install_dependencies | `Bash(npm install:*)` `Bash(pip install:*)` `Bash(brew install:*)` | clean |
78
+ - **PREFIX-ONLY caveat** — cannot flag-precisely gate (`force_push` vs `push_to_remote` both match `Bash(git push:*)`); **target-first leak** (`rm <target> -rf` slips a `Bash(rm -rf*)` deny). Actions marked `best_effort` in the taxonomy (`force_push`, `delete_files`, `read_secrets`) → surface the caveat and prefer `ask` over a `deny` you can't enforce (a `deny` that leaks lies).
79
+ - **PREFIX-COLLISION resolution (deterministic — resolve it, NEVER ask).** When two actions collapse to the SAME base prefix with different dispositions — the canonical case is `push_to_remote`=allow + `force_push`=ask, both basing to `Bash(git push:*)` — you cannot put that base prefix in both `allow` and `ask`. Resolve without a question-back:
80
+ - **Push allowed + force asked (Standard / Open):** put the base `Bash(git push:*)` per push's disposition (`allow`), AND add the flag-first force forms to `ask` (`Bash(git push --force:*)`, `Bash(git push -f:*)`, `Bash(git push --force-with-lease:*)`). RECORD in your diff that this is best-effort — flag-LAST force (`git push origin main --force`) leaks past the flag-first ask rules and runs under the allow. Don't block on it.
81
+ - **Push denied (Locked):** `Bash(git push:*)` in `deny` already covers force — no conflict.
82
+ This is a FIXED rule, not a user decision — apply it and note the leak. (A live cold-transfer FAILED because a fresh agent *blocked asking* "how to resolve the force_push/push_to_remote collision" instead of applying this default.)
83
+ - **`defaultMode: "acceptEdits"` is the FLOOR and MUST be written into every Claude settings.json you produce.** It is not a knob you tune, but it IS a key you must always include — a config policy that omits it strips the floor (the cold-transfer failure). Live-confirmed schema: `{"permissions":{"allow":[],"ask":[],"deny":[],"defaultMode":"acceptEdits"}}`.
84
+
85
+ ### Codex — `~/.codex/config.toml` (via the existing X10 `codex_config_fragment` splice path — reuse, don't invent)
86
+ - Codex is **per-posture, not per-action**: the whole action set **collapses** to the nearest `{sandbox_mode, approval_policy}` pair. **Built-in → posture** (VM-CONFIRMED @ Codex 0.120.0, 2026-08-03 — each posture applied to a real seat: read-only blocked writes+egress, workspace-write allowed writes/blocked egress, danger-full-access allowed both):
87
+
88
+ | Built-in | `sandbox_mode` | `approval_policy` | Collapse note (surface this to the user) |
89
+ |---|---|---|---|
90
+ | Locked | `read-only` | `on-request` | read-only blocks all writes + egress, prompts on escalation — OVER-restricts `edit_files` vs the Claude floor |
91
+ | Standard ⭐ | `workspace-write` | `on-request` | workspace writes allowed, egress blocked by sandbox, prompt on escalation — UNDER-gates `create_pr` (no per-action ask; folds into the prompt) |
92
+ | Open | `danger-full-access` | `on-failure` | everything allowed, prompt only on failure — OVER-permits the `destructive_class` vs the Claude ask-gates |
93
+ | YOLO | *(flag-surface — full-bypass launch flag, NOT config.toml)* | — | not a config write; the rip-out adapter owns it |
94
+
95
+ Valid values (VM-confirmed @ Codex 0.120.0): `sandbox_mode` ∈ {read-only, workspace-write, danger-full-access}; `approval_policy` ∈ {on-request, on-failure, never, untrusted, granular} (`granular` observed live at 0.120.0). ⚠ `on-failure` (used by Open) is marked **deprecated** in 0.120.0 help but still accepted — revisit if a future Codex drops it.
96
+ - Surface the collapse: "Codex can't gate per-action; this policy becomes sandbox=X approval=Y, which over-permits Z / under-permits W."
97
+
98
+ ### Pi — NO permission surface at all (VM-confirmed Pi 0.83.0 — the earlier "approval bit" reading was WRONG)
99
+ - **Pi has no tool-permission gate — neither a config store NOR a permission-posture flag.** Live verification confirmed: Pi 0.83.0's `--approve`/`-a` and `--no-approve`/`-na` govern **project-resource trust** (whether project extensions/resources appear in RPC `get_commands`), **NOT** tool-call approval. There is no sandbox or permission mechanism to map a policy onto.
100
+ - So a permission policy **does not translate to Pi**. Do NOT say `--approve` = "auto-approve all", or that a posture "collapses to a Pi approval bit" — that was an earlier misread, corrected here. This skill computes **nothing** for Pi.
101
+ - Whatever the OpenRig adapter sets (`--no-approve` by default) is a project-resource-trust floor, not a permission posture — not this skill's to derive.
102
+ - Behavior to know (resource-trust, NOT permission-gating): under default ask / `--no-approve`, a project resource is silently **absent** from RPC `get_commands`; it appears under `--approve`. Never mistake that for permission enforcement.
103
+ - **Say this to the user for a Pi seat:** "Pi has no permission-policy surface today — the policy applies to Claude/Codex; Pi runs under its project-resource-trust flag unchanged."
104
+
105
+ ## ⚠ The two warnings that save real fleets
106
+ - **`ask` FREEZES an autonomous/headless Claude seat** — it hangs on the first non-edit op. So for autonomous fleets apply **Open/YOLO** (or a policy with no asks) **at setup** — the floor only covers edits; bash still asks without an applied policy. Never leave an autonomous seat on a policy with live `ask` gates. (Pi has no permission ask at all — see the Pi leg; Codex prompts per its posture, not per-action.)
107
+ - **daemon-HOME ≠ seat-HOME** silently voids user-level writes — always the preflight check above.
108
+
109
+ ## The built-ins — DEFINED by the shipped policy spec files (translate FROM the spec; POINT, don't COPY)
110
+ The four built-in policies ship as read-only spec files (`source: builtin`, `policy_schema_version: 1`) — they are the AUTHORITATIVE definitions. **Do NOT restate their action-sets here.** An earlier in-skill copy drifted (it under-asked `publish_package`/`merge_or_release`, which the spec ASKs) — the exact reason POINT-don't-COPY is the rule. Read the attached/selected spec and translate its semantic-action sets (`default_posture` / `allow` / `ask` / `deny` / `destructive_class`) per the three legs above.
111
+ - **Locked / Standard ⭐ / Open** — `surface: config`. Translate to the Claude / Codex config surface. **Standard ⭐** is the recommended default: routine dev incl. push allowed, the outward/release/history-rewriting acts (`create_pr`, `publish_package`, `merge_or_release`, `force_push`) ASK, destructive_class ASKs. Standard has live `ask` gates → not for a headless-autonomous Claude seat (use Open or YOLO). Locked = deny-default whitelist; Open = allow-default, destructive_class asks only.
112
+ - **YOLO** — `surface: flag`, `launch_posture: full_bypass`. This skill does **NOT** translate it — it points at OpenRig's deterministic flag-surface opt-in (the rip-out YOLO setting). When YOLO is on, any config-surface policy is MOOT (the bypass overrides it). (Subsumes the former "Operator".)
113
+
114
+ Built-ins ship read-only in the package (canonical names); copy-to-customize into user space (custom, user-named); the `source:` frontmatter marker travels on copy. Onboarding presents these as a required MENU (explain each + ask which; no-choice = the floor).
115
+
116
+ ## Boundary (keeps this the only maintained piece)
117
+ This skill TRANSLATES + APPLIES only. It does **not** define policies (the policy spec does) and does **not** enforce at the daemon (OpenRig is agnostic). Spec = *what* (neutral intent); this skill = *how, on this harness version* (the caveated, version-stamped translation).
118
+
119
+ ---
120
+ *Stage: ESTABLISHED (2026-08-04) — both criteria met: (1) cold-transfer PASSING (rerun #2, verdict SHA 627abbb6, all 5 gate checks TRANSFER); (2) the built-in policy SPEC FILES landed (`source: builtin`, arch-accepted) as the authoritative source — the skill now translates FROM the spec and the interim in-skill pinned summary is retired (POINT-not-COPY). Config cells VM-CONFIRMED (Claude 2.1.220 / Codex 0.120.0); Pi has no permission surface (compute-nothing). Reviewed at push. feedback.md maintained.*
@@ -0,0 +1,43 @@
1
+ ---
2
+ name: delegating-work
3
+ description: "Use when you have a task and must decide WHO does it — yourself, a spawned subagent, or another agent in the topology that already holds the context. The rule: how much would a blank slate have to read in to do this correctly? A lot → route to a context-holding agent; a little → subagent; unsure → a real agent or yourself. NOT the mechanics of fanning out (that's dispatching-parallel-agents / subagent-driven-development) — this is the who/whether decision, and the failure mode that makes teams abandon subagents."
4
+ metadata:
5
+ openrig:
6
+ stage: field-captured
7
+ ---
8
+
9
+ # Delegating work — who should do this task?
10
+
11
+ ## The core question: context performance
12
+ Getting work done well is a context problem. The agent best suited to a task is **the one who already holds the context that task requires.** Before you spawn a subagent or grind it out yourself, ask who that is.
13
+
14
+ ## The decision
15
+ **Ask: how much would a blank slate have to read in before it could do this correctly?**
16
+
17
+ - **A lot to read in → route to a real agent in the topology that already holds it.** This is what the role structure is FOR — reviewers, QA, implementers who have been on a project over time. An agent that already understands the work produces a better, safer result than any amount of briefing.
18
+ - **A little — a prompt plus light grounding is enough → spawn a subagent.**
19
+ - **Genuinely unsure → err toward a real agent, or do it yourself.**
20
+
21
+ ## Subagents are underused — reach for them far more
22
+ For self-contained work that is fully specifiable in the prompt, spawn a subagent instead of spending your own context: tracing, research, grounding passes, summarizing, scanning log files, searching, fetching, web search, mechanical extraction with citations. This is the common shape and it is under-used.
23
+
24
+ ## The failure mode — the part that matters most
25
+ **Subagents start as blank slates, and you cannot anticipate everything they need to know.** Give one a task where there is a lot to understand and it will have blind spots it does not know it has — it will complete the task and **return a false conclusion**, not from weakness but because it lacked the context to know what "correct" even looked like.
26
+
27
+ This is the unknown-unknowns problem, and it is the single most common subagent failure: **a poorly-contextualized summary is worse than no summary, because it arrives looking like an answer.** Overreliance on subagents for context-heavy work causes more problems than it solves — and a team burned by it stops using subagents at all, which is the wrong correction. The fix is not "avoid subagents"; it is "match the task to the context it needs."
28
+
29
+ ## The practical test
30
+ Before delegating to a blank slate, ask: **would a wrong-but-plausible answer here be detectable?** If the requester cannot check the result against something they already know — a citation they can open, a count they can re-run — the blind-spot risk is unacceptable, and that task belongs with an agent that holds the context.
31
+
32
+ ## Worked examples
33
+ - **GOOD (→ subagent):** extract how four apps implement a UI mechanism, with `file:line` citations and an explicit instruction to report facts, not recommendations. Self-contained; the requester can verify the citations.
34
+ - **BAD to delegate blind (→ routed to the context-holder):** an independent security re-sweep of a rewritten git branch, where knowing which commit range must stay byte-identical, and that "lightly obfuscated real values" is the thing to hunt, takes a paragraph to explain and one sentence to get wrong. It went to the agent already holding the context.
35
+
36
+ ## It generalizes
37
+ This is really **"route work to whoever holds the context,"** with subagents as the option for work that needs none. The audience is **every agent** — implementers and QA seats make this call as much as orchestrators do.
38
+
39
+ ## Once you've decided
40
+ - Decided on subagents for 2+ independent tasks → `dispatching-parallel-agents` (the fan-out mechanics).
41
+ - Subagents executing a plan's independent tasks → `subagent-driven-development`.
42
+ - Routing to a real agent you will direct over multiple rounds → `directing-partner-agents`.
43
+ - The right context-holder is the human → `human-in-the-loop`.
@@ -243,6 +243,8 @@ If you're booting into a new seat in an OpenRig rig:
243
243
 
244
244
  You're now oriented enough to start doing useful work.
245
245
 
246
+ **Permission policy (at setup):** OpenRig sets only a minimal usability floor on your harness permissions, then offers recommended policies you opt into (Locked / Standard / Open — or YOLO to bypass). If you're creating or bringing up a rig, that's a choice you make, not something OpenRig decides for you — see openrig-user's "Permission policy — pick one at setup" and the `applying-a-permission-policy` skill.
247
+
246
248
  ---
247
249
 
248
250
  ## Going deeper (canonical references)
@@ -12,10 +12,7 @@ metadata:
12
12
 
13
13
  # Mission/Slice SOP — how you work a mission & slice
14
14
 
15
- Use this skill to actually **do** mission/slice work the way OpenRig expects: author the convention sections, track on the canonical files, prove on them, hand off through them, and survive compaction on them. **Do the work described here; do not merely explain the protocol.** The deterministic backstop is `rig scope audit` — an **advisory, fail-open** check (it records and advises, never blocks a write; see Proportionality below), not an authority you serve. The conventions themselves live in ONE document: **`docs/reference/sdlc-conventions.md`** in the repo, materialized by the daemon at **`$OPENRIG_HOME/reference/sdlc-conventions.md`** (default `~/.openrig/reference/sdlc-conventions.md`) on an installed package — this skill teaches the flow; the SSOT defines the formats.
16
-
17
- ## Proportionality — this SOP serves shipping; it is not the work itself
18
- The working product is the deliverable. This bookkeeping exists so the work survives handoff, compaction, and review — nothing more. **Match it to stakes:** OpenRig core = full ceremony; Studio Box / SDK / app slices = pragmatic — the mini-requirements may BE the whole PRD, and a couple of honest, LOOKed proof lines beat an elaborate contract. The `rig scope audit` backstop is **advisory and fail-open** (its own SSOT says so): it never blocks a build and is not a gate you clear before proceeding. If you're spending more time on the convention files or the audit than on the running product, stop and go build. Running the full apparatus on a small change is the letter-worship failure, not diligence.
15
+ Use this skill to actually **do** mission/slice work the way OpenRig expects: author the convention sections, track on the canonical files, prove on them, hand off through them, and survive compaction on them. **Do the work described here; do not merely explain the protocol.** The deterministic backstop is `rig scope audit` — the audit classifier is the source of truth for adherence. The conventions themselves live in ONE document: **`docs/reference/sdlc-conventions.md`** in the repo, materialized by the daemon at **`$OPENRIG_HOME/reference/sdlc-conventions.md`** (default `~/.openrig/reference/sdlc-conventions.md`) on an installed package — this skill teaches the flow; the SSOT defines the formats.
19
16
 
20
17
  ## The SDLC flow (intent → proof)
21
18
 
@@ -33,7 +30,7 @@ intent → mini-requirements + proof contract → (UI slices: mockups)
33
30
  - **PARSER CONTRACT (README AND IMPLEMENTATION-PRD, from first draft — a parser contract, not stylistic):** each doc carries a verbatim, **undecorated** `## Mini-requirements` heading with a **numbered list**, and a verbatim, **undecorated** `## Proof contract` heading whose checkbox (`- [ ]`) lines are **character-identical** across the two files. `rig scope audit` parses the PRD's `## Proof contract`; a prose rollup (e.g. `## Required proof …`) or any renamed/decorated heading trips **`proof_contract_missing_or_malformed`** and forces a post-lock format patch. Never rename or decorate these two headings, and keep the PRD's checkbox lines byte-for-byte equal to the README's.
34
31
  - **REFERENCE-NOT-RESTATE (public / runnable examples — an honesty rail, from first draft):** any example that shows output or a value the referenced file/command **derives** — repo/runtime counts, current-state totals, hashes, timestamps — must **reference the source/derivation, omit the volatile value, or pin an explicitly stable fixture**; never hardcode the live count/state in a public or shipped doc. "Illustrative" derived output is a lie on a timer: `OK registry (2 manifests)` goes false the instant an entry lands. Write the invariant form (`OK registry (<N> manifests)`, N = entries in `registry.json`) or name the fixture instead of the momentary number. Restated derivable state in a public doc is a defect `rig scope audit` will not catch — the author owns it.
35
32
  3. **Plan-lock**: `rig scope slice approve <slice> --scope spec` — "the PRD matches the intent; THIS artifact set is what gets built." One daemon-side write: frontmatter stamp + append-only audit row.
36
- - **PRE-PLAN-LOCK SELF-CHECK (advisory, not a gate):** before requesting `--scope spec`, it's worth running `rig scope audit --mission <mission> --json` and clearing any real **format** defect (e.g. `proof_contract_missing_or_malformed`) so the parser can read your proof contract that's a genuine machine-parsing need, cheap to fix. But the audit is fail-open: findings do NOT block the lock or the build, and you do NOT need a zero-findings score to proceed. Fix what's real, skip what isn't, keep moving.
33
+ - **PRE-PLAN-LOCK SELF-CHECK (MANDATORY):** before requesting `--scope spec`, run `rig scope audit --mission <mission> --json`, inspect the target slice's entry, and request the lock **only when that slice shows ZERO findings**. Do not carry a format defect (e.g. `proof_contract_missing_or_malformed`) into the lock and force a post-lock correction.
37
34
  4. **Build the locked set** — look at the mockups, not just the spec text.
38
35
  5. **QA visual compare**: for each deliverable, load the planned mockup, produce the real artifact in a test/demo environment, visually compare, and record the verdict.
39
36
  6. **Drop proof**: `rig proof add <slice> --artifact-type qa --verdict PASS --candidate-sha <tip> --money-evidence "…" --evidences "1,3" --media "walk.webm,panel.png" --self-check "…"` — the C1 header's closed sets validate at drop time; `--evidences` joins the drop to its proof-contract items and `--media` names the curated proof/-relative media the drop stands behind (that pairing + media set is what the UI's DELIVERED section renders).
@@ -47,7 +44,7 @@ intent → mini-requirements + proof contract → (UI slices: mockups)
47
44
 
48
45
  ## The canonical files (the operating surface)
49
46
 
50
- > The canonical files below are the **operating surface of the work** — you track on them, prove on them, hand off through them, and survive compaction on them. Keep them current because that is what lets the work survive handoff, compaction, and review — but they **serve** the product, they are not the product. If you're polishing these files while the actual thing isn't shipping, you've inverted it: go build, then update them.
47
+ > The canonical files below are the **operating surface of the work** — you track on them, prove on them, hand off through them, and survive compaction on them. They are NOT side-artifacts to "maintain"; keeping them current *is* the work.
51
48
 
52
49
  - **README.md** (mission + slice) — the overview, OPENING with the convention sections (`## Intent` / `## Mini-requirements` / `## Proof contract`). The **mission README carries this SOP at its bottom.**
53
50
  - **IMPLEMENTATION-PRD.md** — the full PRD; opens with the mini-requirements; the `## Proof contract` here is what the UI's DELIVERED pairing joins proof against.
@@ -103,7 +100,7 @@ When you `rig capture` a pane, **greyed / ghost autocomplete suggestions are NOT
103
100
 
104
101
  ## Moment-of-truth checklist
105
102
 
106
- - **Starting a slice?** → intent recorded verbatim? **PRD carries a verbatim numbered `## Mini-requirements` + a verbatim `## Proof contract` whose `- [ ]` lines are character-identical to the README's** (parser contract)? **no example restates derivable state** — counts/hashes/timestamps referenced, omitted, or pinned to a stable fixture, never hardcoded (reference-not-restate)? mockups attached (UI slices)? ran `rig scope audit` and fixed any real **format** defect so the parser reads the proof contract (advisory — a clean score is NOT required to lock)?
103
+ - **Starting a slice?** → intent recorded verbatim? **PRD carries a verbatim numbered `## Mini-requirements` + a verbatim `## Proof contract` whose `- [ ]` lines are character-identical to the README's** (parser contract)? **no example restates derivable state** — counts/hashes/timestamps referenced, omitted, or pinned to a stable fixture, never hardcoded (reference-not-restate)? mockups attached (UI slices)? **`rig scope audit --mission <m> --json` shows ZERO findings for this slice** BEFORE plan-lock (`--scope spec`)?
107
104
  - **Finishing a slice?** → every proof-contract item has curated evidence via `rig proof add … --evidences --media` (C1 drops — never only hand-placed files)? PROGRESS updated? MISSION_NOTES `§1` refreshed? proof locked (`--scope delivery`)? Handed off via queue?
108
105
  - **Committing?** → PROGRESS updated?
109
106
  - **Compacting?** → filed your state in MISSION_NOTES?
@@ -16,80 +16,73 @@ Skills are **progressive disclosure**: a skill's *name + description* sit in you
16
16
 
17
17
  Every row below names **how to reach the skill** — already-hot, or an exact load path. No row is a dead end.
18
18
 
19
- For repo-shipped skills, resolve the installed CLI package root once:
20
-
21
- ```sh
22
- OPENRIG_CLI_ROOT="$(dirname "$(dirname "$(realpath "$(command -v rig)")")")"
23
- ```
24
-
25
- Paths below use that variable. Tier-A skills live in the daemon-vendored plugin at
26
- `~/.openrig/plugins/openrig-core/skills/`; selected and vendored skills live in the installed CLI package.
27
-
28
19
  ## The index
29
20
 
30
21
  ### Always loaded — the universal spine (open its body when its moment hits)
31
22
  These are auto-delivered to every rig; their name+description are already in your context. Open the body when the "when" matches.
32
23
 
33
- - **forming-an-openrig-mental-model** — first boot, or you're unsure how the pieces fit. The runtime mental model. Load: `~/.openrig/plugins/openrig-core/skills/forming-an-openrig-mental-model/SKILL.md`.
34
- - **openrig-user** — you need a `rig` CLI command (send / queue / ps / whoami / scope / broadcast). The daily CLI surface. Load: `~/.openrig/plugins/openrig-core/skills/openrig-user/SKILL.md`.
35
- - **claude-compaction-restore** — you just compacted (Claude). Restore from durable evidence before resuming real work. Load: `~/.openrig/plugins/openrig-core/skills/claude-compaction-restore/SKILL.md`.
36
- - **session-compaction-and-restore** — preparing for, or recovering from, compaction (any runtime). The write- and read-side protocol. Load: `~/.openrig/plugins/openrig-core/skills/session-compaction-and-restore/SKILL.md`.
37
- - **queue-handoff** — you're passing durable work to another seat or ending your turn. The queue is the work ledger, not chat. Load: `~/.openrig/plugins/openrig-core/skills/queue-handoff/SKILL.md`.
38
- - **seat-continuity-and-handover** — handing your seat's work across a restart or to another owner. Load: `~/.openrig/plugins/openrig-core/skills/seat-continuity-and-handover/SKILL.md`.
39
- - **mission-slice-sop** — you're working a mission/slice (the SDLC: intent → mini-requirements + proof contract → build → QA → proof). The operating manual. Load: `~/.openrig/plugins/openrig-core/skills/mission-slice-sop/SKILL.md`.
40
- - **messaging-the-human** — composing a message to the human operator. Plain language, no insider jargon. Load: `~/.openrig/plugins/openrig-core/skills/messaging-the-human/SKILL.md`.
41
- - **software-for-agents** — you want the full first-load model of how agent software is built and operated here. Load: `~/.openrig/plugins/openrig-core/skills/software-for-agents/SKILL.md`.
42
- - **openrig-skills** — this index (you're reading it). Always loaded; the entry point to everything below. Load: `~/.openrig/plugins/openrig-core/skills/openrig-skills/SKILL.md`.
24
+ - **forming-an-openrig-mental-model** — first boot, or you're unsure how the pieces fit. The runtime mental model.
25
+ - **openrig-user** — you need a `rig` CLI command (send / queue / ps / whoami / scope / broadcast). The daily CLI surface.
26
+ - **claude-compaction-restore** — you just compacted (Claude). Restore from durable evidence before resuming real work.
27
+ - **session-compaction-and-restore** — preparing for, or recovering from, compaction (any runtime). The write- and read-side protocol.
28
+ - **queue-handoff** — you're passing durable work to another seat or ending your turn. The queue is the work ledger, not chat.
29
+ - **seat-continuity-and-handover** — handing your seat's work across a restart or to another owner.
30
+ - **mission-slice-sop** — you're working a mission/slice (the SDLC: intent → mini-requirements + proof contract → build → QA → proof). The operating manual.
31
+ - **messaging-the-human** — composing a message to the human. Plain language, no insider jargon.
32
+ - **software-for-agents** — you want the full first-load model of how agent software is built and operated here.
33
+ - **openrig-skills** — this index (you're reading it). Always loaded; the entry point to everything below.
43
34
 
44
35
  ### Load when your role or task calls for it (repo-shipped, profile-selected)
45
- These ship in the installed OpenRig CLI and reach a seat when its profile selects them. To use one, select it in your profile's `uses.skills`, or open the exact installed path below.
46
-
47
- - **openrig-architect** — authoring a rig or topology (NOT for changing OpenRig itself — that's `openrig-builder`). Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/openrig-architect/SKILL.md`.
48
- - **openrig-cmux** — driving the `cmux` terminal provider. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/openrig-cmux/SKILL.md`.
49
- - **openrig-herdr** — opening/managing seat terminals via the default proof-gated provider. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/openrig-herdr/SKILL.md`.
50
- - **agent-startup-and-context-ingestion** — a seat is booting and ingesting its startup context. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/agent-startup-and-context-ingestion/SKILL.md`.
51
- - **topology-mutation-and-seat-management** — adding, removing, renaming seats or otherwise mutating rig topology. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/topology-mutation-and-seat-management/SKILL.md`.
52
- - **rig-lifecycle** — rig up / down / pause / resume lifecycle operations. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/rig-lifecycle/SKILL.md`.
53
- - **rig-bundles-and-shareable-artifacts** — packaging or installing a rig bundle / shareable artifact. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/rig-bundles-and-shareable-artifacts/SKILL.md`.
54
- - **cross-host-rig-commands** — reaching seats or queues on another host (`--host`). Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/cross-host-rig-commands/SKILL.md`.
55
- - **openrig-upgrade** — upgrading OpenRig or the daemon. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/openrig-upgrade/SKILL.md`.
56
- - **agent-starters** — composing an agent's starter context / priming packs. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/agent-starters/SKILL.md`.
57
- - **specification-system** — authoring or reading AgentSpecs and rig specs. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/specification-system/SKILL.md`.
58
- - **attention-queue** — managing the attention / needs-attention surface. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/attention-queue/SKILL.md`.
59
- - **human-in-the-loop** — deciding when to involve the human vs. proceed on your own authority. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/human-in-the-loop/SKILL.md`.
60
- - **watchdog** — monitoring or recovering a seat (health, restore, stuck state). Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/watchdog/SKILL.md`.
61
- - **session-source-fork** — forking a session's source/context. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/core/session-source-fork/SKILL.md`.
36
+ These ship in the OpenRig repo and reach a seat when its profile selects them. To use one, select it in your profile's `uses.skills`, or open it directly at `packages/daemon/specs/agents/shared/skills/core/<skill>/SKILL.md`.
37
+
38
+ - **openrig-architect** — authoring a rig or topology (NOT for changing OpenRig itself — that's `openrig-builder`).
39
+ - **openrig-cmux** — driving the `cmux` terminal provider.
40
+ - **openrig-herdr** — opening/managing seat terminals via the default proof-gated provider.
41
+ - **agent-startup-and-context-ingestion** — a seat is booting and ingesting its startup context.
42
+ - **topology-mutation-and-seat-management** — adding, removing, renaming seats or otherwise mutating rig topology.
43
+ - **rig-lifecycle** — rig up / down / pause / resume lifecycle operations.
44
+ - **applying-a-permission-policy** — a rig/seat has a permission policy attached, or you're setting one up (Locked / Standard / Open): translate it into the live harness config (Claude `settings.json` / Codex `config.toml`), agent-driven + interactive. Reached at onboarding and at rig setup/preflight. (YOLO / bypass is a launch-flag OpenRig sets, not this skill.)
45
+ - **rig-bundles-and-shareable-artifacts** — packaging or installing a rig bundle / shareable artifact.
46
+ - **cross-host-rig-commands** — reaching seats or queues on another host (`--host`).
47
+ - **openrig-upgrade** — upgrading OpenRig or the daemon.
48
+ - **agent-starters** — composing an agent's starter context / priming packs.
49
+ - **specification-system** — authoring or reading AgentSpecs and rig specs.
50
+ - **attention-queue** — managing the attention / needs-attention surface.
51
+ - **human-in-the-loop** — deciding when to involve the human vs. proceed on your own authority.
52
+ - **delegating-work** — deciding WHO does a task: yourself, a spawned subagent, or another agent that already holds the context (the when/whether decision, not the fan-out mechanics).
53
+ - **watchdog** — monitoring or recovering a seat (health, restore, stuck state).
54
+ - **session-source-fork** — forking a session's source/context.
62
55
 
63
56
  Pod handbooks (load when you're in that pod):
64
- - **orchestration-team** — you're orchestrating a rig: dispatching, monitoring, keeping the loop moving. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md`.
65
- - **development-team** — you're on the dev pod: building and shipping product changes. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pods/development-team/SKILL.md`.
66
- - **review-team** — you're reviewing: fresh scrutiny, anti-slop, empirical verification. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pods/review-team/SKILL.md`.
57
+ - **orchestration-team** — you're orchestrating a rig: dispatching, monitoring, keeping the loop moving.
58
+ - **development-team** — you're on the dev pod: building and shipping product changes.
59
+ - **review-team** — you're reviewing: fresh scrutiny, anti-slop, empirical verification.
67
60
 
68
61
  Product-management craft (load when shaping/reviewing work):
69
- - **requirements-writer** — turning intent into clear requirements. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pm/requirements-writer/SKILL.md`.
70
- - **plan-review** — reviewing a plan before it's built. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pm/plan-review/SKILL.md`.
71
- - **exec-summary** — writing a decision-ready summary for a human. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pm/exec-summary/SKILL.md`.
72
- - **office-hours** — running a structured advisory / decision session. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pm/office-hours/SKILL.md`.
73
- - **context-builder** — assembling the context a task or seat needs. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pm/context-builder/SKILL.md`.
74
- - **backlog-capture** — capturing and shaping backlog items. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pm/backlog-capture/SKILL.md`.
75
- - **ui-mockup** — producing a UI mockup for a slice. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/pm/ui-mockup/SKILL.md`.
62
+ - **requirements-writer** — turning intent into clear requirements.
63
+ - **plan-review** — reviewing a plan before it's built.
64
+ - **exec-summary** — writing a decision-ready summary for a human.
65
+ - **office-hours** — running a structured advisory / decision session.
66
+ - **context-builder** — assembling the context a task or seat needs.
67
+ - **backlog-capture** — capturing and shaping backlog items.
68
+ - **ui-mockup** — producing a UI mockup for a slice.
76
69
 
77
70
  ### Vendored craft — load when you're coding (ships with upstream provenance)
78
71
  General engineering skills OpenRig ships as vendored copies. Open when the task matches; they carry "modified by OpenRig" provenance.
79
72
 
80
- - **test-driven-development** — implementing a feature or bugfix: write the failing test first. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/test-driven-development/SKILL.md`.
81
- - **verification-before-completion** — about to claim done / passing / fixed: run the check and read the output first. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/verification-before-completion/SKILL.md`.
82
- - **systematic-debugging** — debugging: find the root cause before the fix. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/systematic-debugging/SKILL.md`.
83
- - **writing-plans** — writing an implementation plan. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/writing-plans/SKILL.md`.
84
- - **executing-plans** — working through a written plan. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/executing-plans/SKILL.md`.
85
- - **brainstorming** — divergent ideation before converging. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/brainstorming/SKILL.md`.
86
- - **using-superpowers** — discovering and using the vendored "superpowers" skill set. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/using-superpowers/SKILL.md`.
87
- - **agent-browser** — driving a browser (screenshot / screencast) from an agent. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/agent-browser/SKILL.md`.
88
- - **frontend-design** — designing frontend / UI. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/frontend-design/SKILL.md`.
89
- - **dogfood** — web-QA / dogfooding a shipped UI. Load: `${OPENRIG_CLI_ROOT}/daemon/specs/agents/shared/skills/process/dogfood/SKILL.md`.
73
+ - **test-driven-development** — implementing a feature or bugfix: write the failing test first.
74
+ - **verification-before-completion** — about to claim done / passing / fixed: run the check and read the output first.
75
+ - **systematic-debugging** — debugging: find the root cause before the fix.
76
+ - **writing-plans** — writing an implementation plan.
77
+ - **executing-plans** — working through a written plan.
78
+ - **brainstorming** — divergent ideation before converging.
79
+ - **using-superpowers** — discovering and using the vendored "superpowers" skill set.
80
+ - **agent-browser** — driving a browser (screenshot / screencast) from an agent.
81
+ - **frontend-design** — designing frontend / UI.
82
+ - **dogfood** — web-QA / dogfooding a shipped UI.
90
83
 
91
84
  ## Need more than what ships here?
92
85
 
93
86
  This index covers the **shipped** surface. A dev host carries far more (factory, architecture, PM-craft, studio skills) reached through the host's own routers/codemaps — if you're on a builder host and need something not listed above, that deeper routing is the next hop, not a wall. (Host-scale routing is the subject of the context-routing architecture doc; at product scale, this one file is the whole map.)
94
87
 
95
- > Membership note: this index lists exactly the approved product-public oracle set (45 skills as of 2026-08-02: 10 Tier-A + 25 Tier-B + 10 vendored). Skills graduated but not yet in the oracle (e.g. `culture-drift`, `triple-gate-verification`, `reference-first-verification`) join this index when they land in `conventions/product-public-skills.yaml` — index and shipped set stay one scope.
88
+ > Membership note: this index lists exactly the skills that ship with OpenRig. When a skill graduates into the shipped set it joins this index the index and the shipped set stay one scope.
@@ -8,8 +8,6 @@ description: Use when operating OpenRig with the `rig` CLI and you need the ship
8
8
  This is an as-built guide to the shipped `rig` CLI.
9
9
  Use current code and `rig ... --help` as ground truth if anything here ever conflicts with older planning docs.
10
10
 
11
- If you need a different shipped skill, open `openrig-skills` — the global index that routes to every shipped skill in one hop.
12
-
13
11
  This is not the config-layer or builder guide. Use the substrate control-plane guidance for `rigx`
14
12
  and experimental overlays. Use the OpenRig builder guidance when changing OpenRig behavior,
15
13
  doctrine, or release posture.
@@ -295,6 +293,21 @@ rig workflow continue <instanceId> # read-only inspector of an instance (doe
295
293
 
296
294
  *(Surface note — the current `rig workflow` command group registers **13** subcommands: `validate`, `instantiate`, `project`, `list`, `specs`, `show`, `trace`, `continue`, `run`, `watch`, `route`, `resume`, `status`. There is still no `create` verb — the spec YAML is authored on disk. `project` is the advancing verb (it projects the next-step packet); `continue` is a read-only inspector, NOT an advance — do not conflate them. The 13-verb set and the project-vs-continue semantics are verified against current product main `d37a08ad` (`packages/cli/src/commands/workflow.ts`, 13 registered `.command(...)` entries; the earlier "6-verb surface / continue-advances" claim here was stale). Verify individual subcommand flags with `rig workflow --help`.)*
297
295
 
296
+ ## Permission policy — pick one at setup (onboarding)
297
+
298
+ OpenRig sets only a **minimal usability floor** on your harness permissions and otherwise stays out of the way — then it ships **recommended policies you opt into**. It never bakes a permission policy for you. On install / onboarding this is a required choice, presented as a top-level pick:
299
+
300
+ - **POLICY MODE** — pick a built-in policy and have it applied:
301
+ - **Locked** — deny-by-default whitelist; untrusted rigs/work.
302
+ - **Standard** ⭐ (recommended) — the normal software-factory posture; dev incl. push + PR, destructive actions ask.
303
+ - **Open** — allow-by-default; everything except explicitly-destructive, which ask.
304
+
305
+ The built-in definitions ship as read-only policy spec files (Locked / Standard / Open); applying your pick is the job of the **`applying-a-permission-policy`** skill — it translates the chosen spec into your live harness config (Claude `settings.json` / Codex `config.toml`), interactively, showing the diff before it writes.
306
+ - **YOLO MODE** — done with permissions, just want it to work: OpenRig boots every seat with the harness full-bypass launch flag. No config policy is applied (the bypass overrides it). This is a deterministic OpenRig setting, not a skill.
307
+ - **No choice = the floor** — the minimal usability baseline (Claude `acceptEdits` / Codex workspace-only / Pi `--no-approve`), one consistent minimum, nothing more.
308
+
309
+ The floor and YOLO are **launch flags** OpenRig sets deterministically; the Locked / Standard / Open policies are **config-file** policies the skill applies (agent-driven, because harness config formats drift). A rig **carries** its chosen policy on its spec and boots with it — see Lifecycle → Bring a rig up. To (re)apply or change a policy, open **`applying-a-permission-policy`**.
310
+
298
311
  ## v0.3.x Starter, Workspace, And Plugin Surfaces
299
312
 
300
313
  OpenRig v0.3.0 adds `rig agent-image`, `rig context-pack`, `rig workspace`, and
@@ -932,6 +945,7 @@ Current behavior notes:
932
945
  - `local:` `agent_ref` values resolve relative to the rig spec directory, not your shell cwd.
933
946
  - if you copy a built-in spec elsewhere, keep its `agents/` tree beside the YAML or rewrite those refs to `path:/absolute/path`
934
947
  - `rig specs add <directory>` installs a full spec tree when the directory contains `rig.yaml` or `agent.yaml`.
948
+ - **Permission policy:** a rig carries a permission policy and boots with it (never changed on the fly). Default if none set = the minimum floor (Claude `acceptEdits` / Codex workspace-only / Pi `--no-approve`); otherwise a chosen built-in (Locked / Standard / Open) or deliberately none. When you spec or bring up a rig, decide its policy — apply it via `applying-a-permission-policy` (see also the onboarding menu, "Permission policy — pick one at setup").
935
949
 
936
950
  Legacy/spec-specific surfaces still ship too:
937
951
 
@@ -84,21 +84,12 @@ export declare class ClaudeCodeAdapter implements RuntimeAdapter {
84
84
  private captureResumeToken;
85
85
  private detectDeliveryHint;
86
86
  private provisionManagedBootstrap;
87
- /** Managed rig command baseline.
88
- * Additive only; never removes existing entries. Uses `Bash(cmd:*)`
89
- * colon-form per Claude Code convention.
90
- *
91
- * NOTE: this is not OpenRig's permission system. Harness-native
92
- * permissions should remain the primary control surface. */
93
- static readonly CONVENIENCE_BASELINE: readonly string[];
94
- private provisionRigPermissions;
95
87
  private provisionWorkspaceTrust;
96
88
  private provisionOnboardingState;
97
89
  private workspaceTrustKeys;
98
90
  private readJsonObject;
99
91
  private readJsonObjectStrict;
100
92
  private readJsonObjectField;
101
- private readStringArray;
102
93
  /**
103
94
  * Best-effort: provision the OpenRig context collector for managed Claude sessions.
104
95
  * Writes a collector script and merges status line config into .claude/settings.local.json.
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/claude-code-adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,KAAK,EACV,cAAc,EAAE,WAAW,EAAE,mBAAmB,EAChD,iBAAiB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAC3E,mBAAmB,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,iCAAiC,CAAC;AAIvF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAA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AAsB,CAAC,OAAO,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI;YAM7E,kBAAkB;IAkFhC,OAAO,CAAC,YAAY;IA6CpB,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,iBAAiB;IAQzB;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;IAmBrB;;;;OAIG;IACH;;;;;;OAMG;YACW,kBAAkB;IAehC,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,yBAAyB;IAajC,OAAO,CAAC,uBAAuB;IAmB/B,OAAO,CAAC,wBAAwB;IAUhC,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,mBAAmB;IAS3B;;;;OAIG;IACH,OAAO,CAAC,yBAAyB;CAyBlC"}
@@ -1,6 +1,7 @@
1
1
  import nodePath from "node:path";
2
2
  import fs from "node:fs";
3
3
  import { createHash, randomUUID } from "node:crypto";
4
+ import { claudePostureFlag } from "./yolo-mode.js";
4
5
  import { resolveConcreteHint } from "../domain/runtime-adapter.js";
5
6
  import { assessNativeResumeProbe } from "../domain/native-resume-probe.js";
6
7
  import { mergeManagedBlock } from "../domain/managed-blocks.js";
@@ -132,7 +133,10 @@ export class ClaudeCodeAdapter {
132
133
  if (opts.resumeToken && opts.forkSource) {
133
134
  return { ok: false, error: "resumeToken and forkSource are mutually exclusive — pick one" };
134
135
  }
135
- const permissionMode = "--permission-mode acceptEdits";
136
+ // OPR.0.4.8.2: the acceptEdits floor by default; YOLO (opt-in) swaps in the full-bypass flag.
137
+ // The SAME decision (claudePostureFlag) is used on the restore path (claude-resume.ts).
138
+ // OPR.0.4.8.3 Seam B: a per-seat resolved policy posture (binding.launchPosture) overrides env.
139
+ const permissionMode = claudePostureFlag(process.env, binding.launchPosture);
136
140
  // Fork branch: build `claude --resume <parent> --fork-session --name <seat>`
137
141
  // and capture the NEW post-fork session id. The parent token is NEVER
138
142
  // persisted onto the new seat record (identity-honesty bedrock).
@@ -448,51 +452,16 @@ export class ClaudeCodeAdapter {
448
452
  return resolveConcreteHint(path, content);
449
453
  }
450
454
  provisionManagedBootstrap(binding) {
451
- this.provisionRigPermissions();
455
+ // OPR.0.4.8.2 agnostic rip-out: provisionRigPermissions (C2) removed — OpenRig no longer
456
+ // authors any config-file permission policy. Trust/onboarding (C3/C4) are neutral plumbing, kept.
452
457
  this.provisionWorkspaceTrust(binding.cwd ?? null);
453
458
  this.provisionOnboardingState();
454
459
  }
455
- /** Managed rig command baseline.
456
- * Additive only; never removes existing entries. Uses `Bash(cmd:*)`
457
- * colon-form per Claude Code convention.
458
- *
459
- * NOTE: this is not OpenRig's permission system. Harness-native
460
- * permissions should remain the primary control surface. */
461
- static CONVENIENCE_BASELINE = [
462
- "Bash(rig:*)",
463
- ];
464
- provisionRigPermissions() {
465
- const home = this.fs.homedir ?? (typeof process !== "undefined" ? process.env.HOME : undefined);
466
- if (!home)
467
- return;
468
- const settingsPath = nodePath.join(home, ".claude", "settings.json");
469
- this.fs.mkdirp(nodePath.dirname(settingsPath));
470
- const settings = this.readJsonObject(settingsPath);
471
- const permissions = this.readJsonObjectField(settings, "permissions");
472
- const allow = new Set(this.readStringArray(permissions["allow"]));
473
- // Bash convenience baseline — additive only; never removes existing entries.
474
- // Track whether any new patterns were actually added to avoid redundant writes
475
- // (preserves provenance timestamp + file content idempotency on re-runs).
476
- let added = 0;
477
- for (const pattern of ClaudeCodeAdapter.CONVENIENCE_BASELINE) {
478
- if (!allow.has(pattern)) {
479
- allow.add(pattern);
480
- added++;
481
- }
482
- }
483
- if (added === 0)
484
- return; // All patterns already present; skip write
485
- permissions["allow"] = Array.from(allow);
486
- settings["permissions"] = permissions;
487
- // Provenance marker so operators can distinguish rig-injected from human-authored
488
- settings["_openrig_provenance"] = {
489
- author: "openrig-at-spawn",
490
- baseline: "convenience",
491
- patterns_added: added,
492
- ts: new Date().toISOString(),
493
- };
494
- this.fs.writeFile(settingsPath, JSON.stringify(settings, null, 2));
495
- }
460
+ // OPR.0.4.8.2 agnostic rip-out: the CONVENIENCE_BASELINE (global `Bash(rig:*)` allow) and its
461
+ // provisionRigPermissions writer (assessment row C2 — wrote into ~/.claude/settings.json with an
462
+ // `_openrig_provenance` marker) are DELETED. OpenRig no longer authors any config-file permission
463
+ // policy; the harness-native permission surface is the control surface. Existing provenance-marked
464
+ // user files are NOT retro-scrubbed — the new code simply never touches settings.json.
496
465
  provisionWorkspaceTrust(cwd) {
497
466
  if (!cwd)
498
467
  return;
@@ -555,9 +524,7 @@ export class ClaudeCodeAdapter {
555
524
  ? value
556
525
  : {};
557
526
  }
558
- readStringArray(value) {
559
- return Array.isArray(value) ? value.filter((item) => typeof item === "string") : [];
560
- }
527
+ // OPR.0.4.8.2 rip-out: readStringArray removed — its only caller was provisionRigPermissions (C2).
561
528
  /**
562
529
  * Best-effort: provision the OpenRig context collector for managed Claude sessions.
563
530
  * Writes a collector script and merges status line config into .claude/settings.local.json.