@soleur/opencode 3.361.6 → 3.362.0
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.
- package/package.json +1 -1
- package/skills/plan/references/plan-sharp-edges.md +1 -0
- package/skills/registry-breakglass-mirror/SKILL.md +227 -0
- package/skills/registry-breakglass-mirror/scripts/mirror-ghcr-to-zot.sh +905 -0
- package/skills/registry-breakglass-mirror/test/mirror-ghcr-to-zot.test.sh +156 -0
package/package.json
CHANGED
|
@@ -337,4 +337,5 @@ NEVER CODE! Just research and write the plan.
|
|
|
337
337
|
- **A gate placed after a single, non-repeatable decision rejects; it does not redirect.** For any one-shot selection (one model call, one lottery, one claim), list every fact known BEFORE it (ownership, suppression, caps) and put those in the decision's input; keep the later gate as a backstop. The scenario that proves it shows a DIFFERENT candidate reaching the outcome, not only the owned one being refused. **Why:** #10550 — the create arm applied the ledger after its one model call, so one owned pattern of seven won the call and the run ended `no_action`. See `knowledge-base/project/learnings/2026-10-28-a-filter-that-runs-after-the-single-decision-cannot-protect-the-decision.md`.
|
|
338
338
|
|
|
339
339
|
- **Before a plan rewrites a line, inventory what exact-matches it — including probes that run the match on a LIVE host.** `grep -qxF` / `grep -qE '^…$'` pin sites and parity tests force additive shapes: preserve the pinned literal verbatim as the generic branch and add a conditional arm for the new case; a rewrite is only safe after the pin census comes back empty. A pin's blast radius is where the match RUNS, not where it lives. **Why:** #8211/PR #11342 — `git-data-cutover.sh`'s `pin_ex` probe SSHes to the production host and exact-lines the wrapper's shared `exec git -c "core.hooksPath=…" "${verb#git-}"` line; adding `-c receive.shallowUpdate=true` by rewriting it would have flipped every fence probe to `transport_pin_mismatch` while local suites stayed green. See `knowledge-base/project/learnings/best-practices/2026-10-27-exec-line-pinned-by-live-host-probe-forces-conditional-branch.md`.
|
|
340
|
+
- **A plan that makes a follow-through probe's verdict newly REACHABLE must read what each exit code TRIGGERS and the runbook paragraph for that tracker.** `scripts/sweep-followthroughs.sh` closes the tracker on exit 0 and never reopens a closure it justified, so a probe that could never pass has its other recorded rules (a restart floor, a ceiling re-rule) inert until it can. List the sweeper's action per exit code in the plan and re-verify every criterion that the unreachable verdict was masking. **Why:** #11393 — a fix that let the S4 window probe pass would have closed #10865 on pre-restart evidence; found only at review. See `knowledge-base/project/learnings/2026-10-28-a-probe-that-could-finally-pass-would-have-closed-its-tracker-on-pre-restart-evidence.md`.
|
|
340
341
|
- **A plan section that writes a technical outcome as "the owner's call" or "the operator's ruling" is itself the defect.** A time gate, merge gate or hold that says a failed or transient reading is for the operator to rule on hands the founder a call the CTO makes; write the ruling (`Ruled by CTO agent`) or an `assumed:` default there, and name the operator only for a closed-list category (section 8.1b of `plugins/soleur/skills/brainstorm-techniques/references/technical-ruling-delegation.md`). **Why:** 2026-10-26 — a pipeline closed on `Blocked:` asking the founder whether a transient CI failure counted as evidence because the plan had named the due date and any ruling on that slot as the founder's.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: registry-breakglass-mirror
|
|
3
|
+
description: "This skill should be used for GHCR-to-Zot break-glass mirrors."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- soleur-cloud-mode:start -->
|
|
7
|
+
**Cloud Mode (Devin):** before pipeline work run `bash "${CLAUDE_PLUGIN_ROOT}/scripts/cloud-detect.sh"`. If `CLAUDE_PLUGIN_ROOT` is unset (cloud exec shells do not export it), resolve the root by IDENTITY, never by script basename: for `d` in `"$HOME/.local/share/devin/cli/plugins/cache"` and `/opt/.devin/plugins`, skip unless `[ -d "$d" ]`, then `MANIFEST="$(find "$d" -path '*/.claude-plugin/plugin.json' -exec grep -l '"name"[[:space:]]*:[[:space:]]*"soleur"' {} + 2>/dev/null | head -1)"`, `ROOT="${MANIFEST%/.claude-plugin/plugin.json}"` — one resolution, two consumers: `$ROOT/scripts/cloud-detect.sh` and `$ROOT/scripts/precommit-guard.sh`. (Shape check, not authentication: a planted `{"name":"soleur"}` dir passes — ADR-179 A11.) `local` or `not-local:no-devin-env` proceeds normally; any other `not-local:<reason>` applies `<plugin-root>/devin/INSTRUCTIONS.md` §Cloud Mode: emit the `--banner`, fan out sequentially with `Reviewed-Coverage: sequential-fallback` disclosure (never claim an independent review ran), `message_user` ack before any secrets read or production mutation, and run `precommit-guard.sh` before any `git commit` — hooks do not fire in cloud.
|
|
8
|
+
<!-- soleur-cloud-mode:end -->
|
|
9
|
+
|
|
10
|
+
<!-- grok-harness-invoke:start -->
|
|
11
|
+
**Grok Build (`plugins/soleur/lib/harness.ts` `invokeSkill()`):** Read this SKILL.md in this process and run it to completion. A one-segment `soleur:<name>` in this document names a SKILL — on Grok Build, Read `plugins/soleur/skills/<name>/SKILL.md` in this process; it is not a nested tool_use. A multi-segment id such as `soleur:<domain>:<name>` names an AGENT: spawn it, never Read it, and on Grok Build spawn_subagent takes the id with its colons replaced by hyphens (`agentIdToGrokSubagentType`). **Claude Code:** Skill tool for a skill (`soleur:<name>`), Task tool with `subagent_type` for an agent. Forbidden is executing a subset, not the Read.
|
|
12
|
+
<!-- grok-harness-invoke:end -->
|
|
13
|
+
|
|
14
|
+
# registry-breakglass-mirror
|
|
15
|
+
|
|
16
|
+
Re-materialize production's zot store (`10.0.1.30:5000`) from GHCR when the
|
|
17
|
+
Cloudflare Tunnel registry bridge is **down** — the one window in which
|
|
18
|
+
`registry-restore-from-ghcr.sh` (the luks-recut restore engine) cannot run,
|
|
19
|
+
because every CI path to zot traverses that bridge
|
|
20
|
+
(`.github/actions/cf-tunnel-registry-bridge/action.yml`).
|
|
21
|
+
|
|
22
|
+
This is a **break-glass** procedure. It is the documented, name-scoped exception
|
|
23
|
+
to the #9169 hosts-file ghcr deny (ADR-096 amendment 2026-10-28): a manual
|
|
24
|
+
operator/agent-invoked run, not a standing code path, not a host service, not a
|
|
25
|
+
standing credential.
|
|
26
|
+
|
|
27
|
+
## When to use
|
|
28
|
+
|
|
29
|
+
- The `registry.` tunnel ingress (or the tunnel itself) is down **and** the zot
|
|
30
|
+
store must be (re)populated: post-restore backfill, a zot store that lost its
|
|
31
|
+
pinned image set, or a release image that never made the mirror leg.
|
|
32
|
+
- Do **not** reach for it when the bridge is alive — the routine restore path is
|
|
33
|
+
`registry-restore-from-ghcr.sh` over the tunnel, and the routine mirror is the
|
|
34
|
+
release pipeline itself.
|
|
35
|
+
- Do **not** use it to "test" GHCR connectivity — it writes to the sole pull
|
|
36
|
+
path production deploys read from.
|
|
37
|
+
|
|
38
|
+
## Connectivity matrix — reaching the mirror host
|
|
39
|
+
|
|
40
|
+
The mirror runs **on a private-net datacenter host**, never on the operator's
|
|
41
|
+
machine and never over a forwarded connection (see **The hard DO-NOT** below).
|
|
42
|
+
|
|
43
|
+
`MIRROR_HOST` is parameterized — default `web-1`; any `10.0.1.0/24` member works.
|
|
44
|
+
Since ADR-304, `web-2` is the tunnel-connector host and `web-1` is LUKS-pinned
|
|
45
|
+
and unreplaceable (#6964); prefer a fresh cattle host when one is up, and prefer
|
|
46
|
+
`web-1` when the alternative is the connector host mid-incident.
|
|
47
|
+
|
|
48
|
+
| Path | Reach | Precondition |
|
|
49
|
+
|------|-------|--------------|
|
|
50
|
+
| **Primary** | `ssh.soleur.ai` through the Cloudflare Tunnel (`cloudflared access ssh` ProxyCommand, as `deploy`) | the tunnel is alive — i.e., NOT the break-glass window itself, but fine for a degraded-registry store while SSH still converges |
|
|
51
|
+
| **Fallback** | direct SSH to the host's public address as `deploy` | the operator's **current egress IP** must be in the Hetzner firewall allow-list (`Doppler prd_terraform/ADMIN_IPS`) — run `soleur:admin-ip-refresh` FIRST when the IP may have rotated; this is an L3 dependency that precedes every SSH-layer assumption |
|
|
52
|
+
|
|
53
|
+
If neither path reaches the host, stop here: the fault is connectivity, not the
|
|
54
|
+
mirror. Do not widen the firewall beyond `admin-ip-refresh`'s documented
|
|
55
|
+
mutation.
|
|
56
|
+
|
|
57
|
+
## Credential sourcing (least privilege, exact forms)
|
|
58
|
+
|
|
59
|
+
| Credential | Source | Notes |
|
|
60
|
+
|------------|--------|-------|
|
|
61
|
+
| `DEPLOY_SSH_PRIVATE_KEY` | `doppler secrets get DEPLOY_SSH_PRIVATE_KEY -p soleur -c prd_terraform --plain` | write to a `0600` keyfile for the SSH legs |
|
|
62
|
+
| `ZOT_PUSH_USER` | `doppler secrets get ZOT_PUSH_USER -p soleur -c prd --plain` | root `prd` config, not `prd_terraform`; never "rotate ZOT_PUSH_* first" — `/etc/zot/htpasswd` is baked at registry boot |
|
|
63
|
+
| `ZOT_PUSH_TOKEN` | `doppler secrets get ZOT_PUSH_TOKEN -p soleur -c prd --plain` | second call — the multi-name form is an unverified CLI shape |
|
|
64
|
+
| `GHCR_TOKEN` | **operator-supplied at invocation** — a `read:packages` PAT the operator types or pastes | the Doppler `GHCR_READ_TOKEN` copy is **revoked BY DESIGN** (ADR-096 §5.5/B3 — no host reads GHCR); never reach for it |
|
|
65
|
+
| `GHCR_USER` | fixed | basic-auth username for the token exchange; default `operator`, charset-checked by the script |
|
|
66
|
+
|
|
67
|
+
Two `doppler secrets get` calls for `ZOT_PUSH_*` — one per secret, mirroring the
|
|
68
|
+
`scheduled-inngest-health.yml` credential pattern.
|
|
69
|
+
|
|
70
|
+
Host prerequisites on the mirror host: `curl`, `jq`, `sha256sum`, `timeout`
|
|
71
|
+
(the script die-6s on a missing one); `crane` is fetched pinned when absent.
|
|
72
|
+
|
|
73
|
+
## Inputs — which repo, which refs
|
|
74
|
+
|
|
75
|
+
- **Repo:** `jikig-ai/soleur-web-platform` (the only image set production
|
|
76
|
+
deploys pin).
|
|
77
|
+
- **Refs:** the pinned image set. The canonical generator is
|
|
78
|
+
[registry-pull-path-health.sh](../../../../scripts/registry-pull-path-health.sh)
|
|
79
|
+
with `--prepare --tags-out` — the same
|
|
80
|
+
`entries[]` manifest `registry-restore-from-ghcr.sh --tags-from` consumes —
|
|
81
|
+
or the `registry-restore-pins` workflow artifact from the last restore run.
|
|
82
|
+
Digest refs (`repo@sha256:<d>`) are preferred — they bind the pin exactly;
|
|
83
|
+
tag refs resolve to the digest GHCR serves at mirror time.
|
|
84
|
+
- **Example:** `mirror-ghcr-to-zot.sh jikig-ai/soleur-web-platform \
|
|
85
|
+
jikig-ai/soleur-web-platform@sha256:<d1> jikig-ai/soleur-web-platform@sha256:<d2>`
|
|
86
|
+
|
|
87
|
+
## The mirror host's GHCR exception (what the script does)
|
|
88
|
+
|
|
89
|
+
The web hosts sinkhole `ghcr.io`, `pkg-containers.githubusercontent.com`, and
|
|
90
|
+
`docker.pkg.github.com` to `0.0.0.0`/`::` in `/etc/hosts` (the #9169 accident
|
|
91
|
+
guard on name resolution — enumerated from
|
|
92
|
+
`apps/web-platform/infra/server.tf` `ghcr_deny_sh`). The script bypasses it with
|
|
93
|
+
**per-command `curl --resolve <name>:443:<ip>`** for the two names a pull needs —
|
|
94
|
+
`/etc/hosts` is never edited, TLS verification stays on (`--resolve` pins only
|
|
95
|
+
the dial address; SNI, the handshake, and CA verification still target the
|
|
96
|
+
hostname), and every pulled byte is verified at its sha256, so a wrong answer
|
|
97
|
+
cannot inject content. `pkg-containers.githubusercontent.com` MUST be resolved
|
|
98
|
+
too: GHCR blob GETs 307-redirect to it.
|
|
99
|
+
|
|
100
|
+
The IPs come from DNS-over-HTTPS at runtime (the host's own `getent` would
|
|
101
|
+
return the sinkhole), or from `GHCR_IP`/`PKGC_IP` env overrides when DoH is
|
|
102
|
+
unreachable.
|
|
103
|
+
|
|
104
|
+
## The hard DO-NOT
|
|
105
|
+
|
|
106
|
+
**Never upload blobs through a forwarded registry connection.** zot PATCH
|
|
107
|
+
uploads die mid-stream over `ssh -L` and registries do not resume upload
|
|
108
|
+
sessions — measured during the 2026-10-28 O2 recovery: ~1.1–2.4 GB over the
|
|
109
|
+
operator's residential uplink failed repeatedly (~250 KiB–1.5 MB/s, HTTP/2
|
|
110
|
+
PROTOCOL_ERROR drops, ~1 h+), while the datacenter-side fetch on web-1 finished
|
|
111
|
+
in ~3 minutes. The doctrine: **pull where the bandwidth is; push over the
|
|
112
|
+
private net.** An operator improvising `ssh -L 5000:10.0.1.30:5000` + `crane
|
|
113
|
+
copy` reopens exactly this failure mode — the skill exists so that is never the
|
|
114
|
+
path of least resistance.
|
|
115
|
+
|
|
116
|
+
## Cosign-signature mirroring is obligatory
|
|
117
|
+
|
|
118
|
+
`ci-deploy` cosign-verifies at deploy time and fetches the signature **from the
|
|
119
|
+
same registry it pulled the image from** (ADR-087). A mirrored image whose
|
|
120
|
+
signature is absent fails verification on the host — there is no
|
|
121
|
+
unsigned-mirror arm, and a missing signature is a hard failure, never a
|
|
122
|
+
warning. The signature rides the OCI referrers tag `sha256-<image-digest-hex>`
|
|
123
|
+
(the plan's `sha256-<hex>.sig` shorthand names this reference): GHCR serves it
|
|
124
|
+
as an OCI **index** whose *child* carries the `artifactType`
|
|
125
|
+
(`application/vnd.dev.sigstore.bundle.v0.3+json`) — the #7410 lesson. Reading
|
|
126
|
+
the tag as a plain manifest fail-closes a healthy signature; the script
|
|
127
|
+
mirrors the index structure and checks the child's `.subject.digest` binding
|
|
128
|
+
**where present** (a `sha256-<hex>` referrers tag name already carries the
|
|
129
|
+
binding).
|
|
130
|
+
|
|
131
|
+
## Procedure
|
|
132
|
+
|
|
133
|
+
1. **Stage credentials (operator side).** Source the four secrets per the table
|
|
134
|
+
above. `GHCR_TOKEN` is supplied by the operator at invocation.
|
|
135
|
+
2. **Copy the engine to the host.** Copy
|
|
136
|
+
[mirror-ghcr-to-zot.sh](./scripts/mirror-ghcr-to-zot.sh) via `scp` to the
|
|
137
|
+
mirror host (`deploy@<MIRROR_HOST>` through whichever connectivity row is
|
|
138
|
+
up).
|
|
139
|
+
3. **Dry-run first.** `mirror-ghcr-to-zot.sh --dry-run <repo> <ref>...` prints
|
|
140
|
+
the plan — resolved refs, blob counts, declared bytes, signature presence,
|
|
141
|
+
target — and pushes nothing. **Read the plan text, not just the exit code:**
|
|
142
|
+
a `sig=… ABSENT` verdict or `blobs=unmeasured` still exits 0 — both mean
|
|
143
|
+
"do not proceed" (supply `GHCR_TOKEN` for the count, and never mirror a ref
|
|
144
|
+
whose signature shows ABSENT).
|
|
145
|
+
4. **Mirror.** Carry the environment to the host WITHOUT putting secrets on a
|
|
146
|
+
command line — never `ssh host 'GHCR_TOKEN=… bash …'` (the PAT lands on the
|
|
147
|
+
remote `bash -c` argv and the local `ssh` argv for the whole run). Feed
|
|
148
|
+
env+invocation over `ssh host bash -s` stdin, or write a `0600` env file,
|
|
149
|
+
`scp` it, then
|
|
150
|
+
`ssh deploy@<host> 'set -a; . ./mirror.env; set +a; ./mirror-ghcr-to-zot.sh …; rm -f ./mirror.env'`
|
|
151
|
+
(the `rm` matters — the env-file arm must not strand a credential file on
|
|
152
|
+
a prod host). The script pulls
|
|
153
|
+
manifests+blobs via `curl
|
|
154
|
+
--resolve`, assembles each ref into an OCI layout, `crane push`es to
|
|
155
|
+
`10.0.1.30:5000/<repo>` (plain-HTTP private net — `--insecure`, the standing
|
|
156
|
+
`hetzner -> zotRegistry` posture), mirrors the `sha256-<hex>` signature ref,
|
|
157
|
+
then read-back-verifies every pushed ref with `crane validate --remote`
|
|
158
|
+
(platform children) plus blob-presence (attestation/signature children) —
|
|
159
|
+
never `crane digest` alone; a manifest can outlive its layers under zot
|
|
160
|
+
gc+dedupe.
|
|
161
|
+
5. **Close out.** Exit `0` prints `mirror_summary ... result=ok`. Anything else
|
|
162
|
+
is a non-zero exit with the failing ref named — do not treat the store as
|
|
163
|
+
usable. Then verify the deploy path resolves the digest: from a second
|
|
164
|
+
`10.0.1.0/24` member,
|
|
165
|
+
`crane digest --insecure 10.0.1.30:5000/jikig-ai/soleur-web-platform@sha256:<d>`
|
|
166
|
+
must return the same `sha256:<d>` (or `ssh deploy@<host> 'docker manifest
|
|
167
|
+
inspect 10.0.1.30:5000/jikig-ai/soleur-web-platform@sha256:<d>'`).
|
|
168
|
+
|
|
169
|
+
## Failure vocabulary
|
|
170
|
+
|
|
171
|
+
Name **only measured causes** (ADR-166). On this path the measured facts are the
|
|
172
|
+
http_code the pull leg observed and the crane error the push/verify leg
|
|
173
|
+
observed. The closed verdict vocabulary for the CI mirror path —
|
|
174
|
+
`live` / `stale` / `unverifiable` / `unmeasured` — lives in
|
|
175
|
+
[zot-mirror-diagnosis.sh](../../../../scripts/zot-mirror-diagnosis.sh); its rule
|
|
176
|
+
applies here too: no failure message may name a cause nothing measured (e.g.,
|
|
177
|
+
GHCR 404 means "absent **or not visible to this credential**", not "the image
|
|
178
|
+
is gone").
|
|
179
|
+
|
|
180
|
+
## Exit codes (the script's)
|
|
181
|
+
|
|
182
|
+
- `0` — every required reference pushed AND read-back-verified.
|
|
183
|
+
- `1` — usage/configuration error.
|
|
184
|
+
- `2` — GHCR/source leg failed (unreachable, 5xx, credential rejected, 404).
|
|
185
|
+
- `3` — sink (zot) unavailable; retryable.
|
|
186
|
+
- `4` — verification failed: the copy "succeeded" and the result is unusable
|
|
187
|
+
(missing blob, digest mismatch, missing signature). NOT retryable.
|
|
188
|
+
- `5` — credential unusable (absent/empty, or rejected by the sink).
|
|
189
|
+
- `6` — unclassified; loudest arm, file it.
|
|
190
|
+
- `78` — refused to run under `bash -x` while a credential is set (#7797).
|
|
191
|
+
|
|
192
|
+
## Sharp Edges
|
|
193
|
+
|
|
194
|
+
- **`docker.pkg.github.com` is sinkholed too** and is deliberately never
|
|
195
|
+
resolved — nothing on the GHCR pull path needs it.
|
|
196
|
+
- **`GHCR_TOKEN` is operator-supplied on purpose.** There is no zero-touch GHCR
|
|
197
|
+
read path by construction (ADR-088 arm-b): the Doppler copy is revoked and
|
|
198
|
+
stays revoked.
|
|
199
|
+
- **Digest refs push by digest** (`<repo>@sha256:<d>`); tag refs push by tag.
|
|
200
|
+
zot keeps digest-pushed manifests digest-addressable — exactly what the
|
|
201
|
+
pinned deploy refs need. Prefer passing a tag ref when the intended pull is
|
|
202
|
+
`repo:tag`, a digest ref when it is `repo@sha256:`.
|
|
203
|
+
- **Do not edit `/etc/hosts`** "to make it easier" — the deny must stay in
|
|
204
|
+
force after the mirror; per-command `--resolve` is the whole exception.
|
|
205
|
+
- **`crane` is fetched pinned** (v0.20.2 release tarball + sha256) when absent —
|
|
206
|
+
github.com is not sinkholed.
|
|
207
|
+
- **Multiple refs in one run are fine** and each is verified independently; a
|
|
208
|
+
later failure does not un-verify earlier successes — re-run the failing refs.
|
|
209
|
+
|
|
210
|
+
## Related
|
|
211
|
+
|
|
212
|
+
- [mirror-ghcr-to-zot.sh](./scripts/mirror-ghcr-to-zot.sh) — the engine (usage,
|
|
213
|
+
env contract, exit codes in its header).
|
|
214
|
+
- `registry-restore-from-ghcr.sh` — the luks-recut restore engine this skill
|
|
215
|
+
stands in for while the bridge is down (runs over the tunnel; its
|
|
216
|
+
invariants — signature copy, `crane validate --remote`, credential hygiene —
|
|
217
|
+
are carried, not the engine).
|
|
218
|
+
- [zot-mirror-diagnosis.sh](../../../../scripts/zot-mirror-diagnosis.sh) — the
|
|
219
|
+
measured-cause vocabulary (`live`/`stale`/`unverifiable`/`unmeasured`).
|
|
220
|
+
- `soleur:admin-ip-refresh` — the direct-SSH fallback's firewall precondition.
|
|
221
|
+
- `soleur:cf-token-scope` — Cloudflare-token probe discipline reference.
|
|
222
|
+
- ADR-096 (the deny + its 2026-10-28 break-glass amendment), ADR-087 (cosign),
|
|
223
|
+
ADR-166 (cause vocabulary), ADR-169 (restore authorization), ADR-304
|
|
224
|
+
(connector placement). Learnings:
|
|
225
|
+
`2026-09-28-an-ssh-drop-without-a-pty-is-sigpipe-and-my-cleanup-trap-read-it-as-success`,
|
|
226
|
+
`2026-08-05-every-green-signal-certified-something-other-than-what-it-claimed`.
|
|
227
|
+
- Issue: #11424.
|