Context
The library-first workflow (now the lead flow in docs/protocol-pattern-workflow.md) saves patterns to the shared patterns/ library, then builds a protocol referencing them by name. That runs fine on any bench (the library is repo-global), but the protocol is not a self-contained pair: Promote-to-shared copies only the colocated <name>_patterns/ folder, and the repo-side pattern checks (W badges on repo-opened protocols) key off colocation.
Today's workaround (documented in the guide): per pattern, in the Pattern Designer — LOAD ▾ → Open from Repo… → 📚 Shared pattern library → open it → ⇪ SAVE TO REPO… → "A protocol's pattern folder". Clunky for N patterns.
Proposal
A one-click "Collect patterns into this protocol's folder…" action in the Arena Studio (File ▾, Edit view, next to Promote):
- Resolve every
pattern: name referenced by the current (saved) protocol.
- For each name found in
patterns/ (and not already in <name>_patterns/): fetch bytes, direct-commit a copy into protocols/<bench-id>/<name>_patterns/.
- Skip + report names already colocated; list unresolved names loudly (typo or not yet made).
- Same-name-different-content in the destination → hash-compare guard like Promote (refuse, never overwrite silently).
Building blocks all exist: GH.reqGetContents/runBytes/directCommit (path allowlist already covers both areas), RunnerLib-style pattern-name extraction, the Promote flow's hash guard, and registerRepoPatternPreviews to refresh W badges afterwards.
Notes
Context
The library-first workflow (now the lead flow in
docs/protocol-pattern-workflow.md) saves patterns to the sharedpatterns/library, then builds a protocol referencing them by name. That runs fine on any bench (the library is repo-global), but the protocol is not a self-contained pair: Promote-to-shared copies only the colocated<name>_patterns/folder, and the repo-side pattern checks (W badges on repo-opened protocols) key off colocation.Today's workaround (documented in the guide): per pattern, in the Pattern Designer — LOAD ▾ → Open from Repo… → 📚 Shared pattern library → open it → ⇪ SAVE TO REPO… → "A protocol's pattern folder". Clunky for N patterns.
Proposal
A one-click "Collect patterns into this protocol's folder…" action in the Arena Studio (File ▾, Edit view, next to Promote):
pattern:name referenced by the current (saved) protocol.patterns/(and not already in<name>_patterns/): fetch bytes, direct-commit a copy intoprotocols/<bench-id>/<name>_patterns/.Building blocks all exist:
GH.reqGetContents/runBytes/directCommit(path allowlist already covers both areas),RunnerLib-style pattern-name extraction, the Promote flow's hash guard, andregisterRepoPatternPreviewsto refresh W badges afterwards.Notes