Repository navigation
feat(herdr-t3): pin 済み herdr-plugins 導入セットの再現スクリプト (#239) #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5915e42
feat(herdr-t3): reproducible pinned herdr-plugins install set (#239)
rebuildup 2256a06
feat(herdr-t3): cover all six pinned plugins and fix ps1 pin-table cl…
rebuildup 5c6a3f8
feat(herdr-t3): add usage plugin to pinned set (7 plugins) (#239)
rebuildup 5dd6b30
feat(herdr-t3): expand plugin set to all 14 v0.6.0 pins incl. machine…
rebuildup c248e44
merge(#239): main into the #239 branch — the pinned plugin set follow…
rebuildup 1b43a2e
fix(#239): harden the pinned plugin set and the mise exclusion (revie…
rebuildup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Install the pinned rebuildup/hoxay-plugins set used by hoxay | ||
| # (pc-setup#239, rebuildup/hoxay#358). | ||
| # | ||
| # The fourteen plugins and their full commit SHAs mirror the contract pins in | ||
| # rebuildup/hoxay `docs/migration/contracts/plugins-boundary.md` | ||
| # @ release-0-6-0 (inbox v0.1.0, git v0.2.0, projects v0.3.0, | ||
| # checkpoints v0.4.0, automations v0.7.0, conversations/usage/artifacts/ | ||
| # handoff/textgen/controls/secrets/mcp v0.5.0 @ d23205af, machines v0.1.0 | ||
| # @ 08f96a4 — the RC pin-backport carrying the --socket/--session fix, | ||
| # hoxay-plugins#264) — the full set shipped in v0.6.0. Each | ||
| # plugin installs independently through the official | ||
| # `herdr plugin install --ref <sha>` path; state lives under herdr's own | ||
| # plugin directories, so reinstalling never loses organize state. | ||
| # | ||
| # Idempotent: a plugin already installed at the pinned commit is skipped; | ||
| # a different commit is re-installed at the pin. `-Check` only reports. | ||
| # | ||
| # Prerequisites: `herdr` on PATH (herdr >= 0.9.0) and `bun` on PATH — | ||
| # plugin manifest commands run `bun run`. Note that non-login ssh | ||
| # sessions may not carry the user PATH; run this from an interactive | ||
| # shell (rebuildup/hoxay#339). | ||
| # | ||
| # Usage: plugin-set.ps1 [-Check] | ||
| param([switch]$Check) | ||
|
|
||
| $ErrorActionPreference = "Stop" | ||
|
|
||
| function Log($msg) { Write-Host "[hoxay plugins] $msg" } | ||
| function Die($msg) { Write-Host "[hoxay plugins] ERROR: $msg" -ForegroundColor Red; exit 1 } | ||
|
|
||
| if (-not (Get-Command herdr -ErrorAction SilentlyContinue)) { Die "herdr not found on PATH" } | ||
| if (-not (Get-Command bun -ErrorAction SilentlyContinue)) { Die "bun not found on PATH (plugin commands run 'bun run')" } | ||
|
|
||
| # name|full commit SHA — keep in sync with plugins-boundary.md. | ||
| $Plugins = @( | ||
| @{ Name = "inbox"; Sha = "414e87dea9faa5c221fb27508e5828f086849836" }, | ||
| @{ Name = "git"; Sha = "d0578307a856e53af210775f9cb95c9f593d6f87" }, | ||
| @{ Name = "projects"; Sha = "2dcb2abfa57b0adcf5d1109f76087e19b3dfae07" }, | ||
| @{ Name = "checkpoints"; Sha = "ae4f214c523d05128354a8c4ba493b62cd8e843f" }, | ||
| @{ Name = "automations"; Sha = "6c1cfa501323772e7c1c008c3dbcd7e364feb0b3" }, | ||
| @{ Name = "conversations"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" }, | ||
| @{ Name = "usage"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" }, | ||
| @{ Name = "artifacts"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" }, | ||
| @{ Name = "handoff"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" }, | ||
| @{ Name = "textgen"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" }, | ||
| @{ Name = "controls"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" }, | ||
| @{ Name = "secrets"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" }, | ||
| @{ Name = "machines"; Sha = "08f96a4d151f0edb72b61483376ff977177f92e8" }, | ||
| @{ Name = "mcp"; Sha = "d23205af0cd2ff7dba25f72e1f3b872762a108ee" } | ||
| ) | ||
|
|
||
| # A failing `herdr plugin list` writes to stderr and leaves stdout empty. | ||
| # An empty stdout would parse into $null and make every plugin look | ||
| # MISSING — the check would report a false drift and a normal run would | ||
| # reinstall the whole set. Fail loudly instead (PowerShell 7 does not stop | ||
| # on a non-zero exit code with $ErrorActionPreference alone). | ||
| $listJson = herdr plugin list --json | Out-String | ||
| if ($LASTEXITCODE -ne 0) { Die "herdr plugin list failed (exit $LASTEXITCODE)" } | ||
| try { | ||
| $listParsed = $listJson | ConvertFrom-Json | ||
| } catch { | ||
| Die "herdr plugin list did not return JSON: $($_.Exception.Message)" | ||
| } | ||
| if (-not $listParsed -or -not $listParsed.result) { Die "herdr plugin list returned no result payload" } | ||
| # NOTE: PowerShell variables are case-insensitive — this must NOT be | ||
| # named $plugins or it overwrites the $Plugins pin table above. | ||
| $installedPlugins = $listParsed.result.plugins | ||
|
|
||
| $rc = 0 | ||
| foreach ($p in $Plugins) { | ||
| $pluginId = "rebuildup.$($p.Name)" | ||
| $entry = $installedPlugins | Where-Object { $_.plugin_id -eq $pluginId } | Select-Object -First 1 | ||
| $have = $entry.source.resolved_commit | ||
| if ($have -eq $p.Sha) { | ||
| Log "$pluginId already at pin $($p.Sha.Substring(0,12))" | ||
| continue | ||
| } | ||
| if ($Check) { | ||
| if (-not $have) { Log "$pluginId MISSING (pin $($p.Sha.Substring(0,12)))" } | ||
| else { Log "$pluginId at $($have.Substring(0,12)), pin is $($p.Sha.Substring(0,12))" } | ||
| $rc = 1 | ||
| continue | ||
| } | ||
| Log "installing $pluginId @ $($p.Sha.Substring(0,12))" | ||
| herdr plugin install "rebuildup/hoxay-plugins/plugins/$($p.Name)" --ref $p.Sha -y | ||
| if ($LASTEXITCODE -ne 0) { Log "ERROR: install failed for $pluginId"; $rc = 1 } | ||
| } | ||
|
|
||
| exit $rc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| #!/usr/bin/env bash | ||
| # Install the pinned rebuildup/hoxay-plugins set used by hoxay | ||
| # (pc-setup#239, rebuildup/hoxay#358). | ||
| # | ||
| # The fourteen plugins and their full commit SHAs mirror the contract pins in | ||
| # rebuildup/hoxay `docs/migration/contracts/plugins-boundary.md` | ||
| # @ release-0-6-0 (inbox v0.1.0, git v0.2.0, projects v0.3.0, | ||
| # checkpoints v0.4.0, automations v0.7.0, conversations/usage/artifacts/ | ||
| # handoff/textgen/controls/secrets/mcp v0.5.0 @ d23205af, machines v0.1.0 | ||
| # @ 08f96a4 — the RC pin-backport carrying the --socket/--session fix, | ||
| # hoxay-plugins#264) — the full set shipped in v0.6.0. Each | ||
| # plugin installs independently through the official | ||
| # `herdr plugin install --ref <sha>` path; state lives under herdr's own | ||
| # plugin directories, so reinstalling never loses organize state. | ||
| # | ||
| # Idempotent: a plugin already installed at the pinned commit is skipped; | ||
| # a different commit is re-installed at the pin. `--check` only reports. | ||
| # | ||
| # Prerequisites: `herdr` on PATH (herdr >= 0.9.0) and `bun` on PATH — | ||
| # plugin manifest commands run `bun run`. | ||
| # | ||
| # Usage: plugin-set.sh [--check] | ||
| set -euo pipefail | ||
|
|
||
| CHECK_ONLY=0 | ||
| [[ "${1:-}" == "--check" ]] && CHECK_ONLY=1 | ||
|
|
||
| log() { printf '[hoxay plugins] %s\n' "$*"; } | ||
| die() { log "ERROR: $*" >&2; exit 1; } | ||
|
|
||
| command -v herdr >/dev/null 2>&1 || die "herdr not found on PATH" | ||
| command -v bun >/dev/null 2>&1 || die "bun not found on PATH (plugin commands run 'bun run')" | ||
|
|
||
| # name|full commit SHA — keep in sync with plugins-boundary.md. | ||
| PLUGINS=( | ||
| "inbox|414e87dea9faa5c221fb27508e5828f086849836" | ||
| "git|d0578307a856e53af210775f9cb95c9f593d6f87" | ||
| "projects|2dcb2abfa57b0adcf5d1109f76087e19b3dfae07" | ||
| "checkpoints|ae4f214c523d05128354a8c4ba493b62cd8e843f" | ||
| "automations|6c1cfa501323772e7c1c008c3dbcd7e364feb0b3" | ||
| "conversations|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| "usage|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| "artifacts|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| "handoff|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| "textgen|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| "controls|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| "secrets|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| "machines|08f96a4d151f0edb72b61483376ff977177f92e8" | ||
| "mcp|d23205af0cd2ff7dba25f72e1f3b872762a108ee" | ||
| ) | ||
|
|
||
| # resolved_commit of one installed plugin (empty when absent/malformed). | ||
| installed_commit() { | ||
| herdr plugin list --json | bun -e ' | ||
| const d = JSON.parse(await new Response(Bun.stdin.stream()).text()); | ||
| const plugins = d?.result?.plugins ?? []; | ||
| const p = plugins.find((x) => x && x.plugin_id === process.argv[1]); | ||
| process.stdout.write(p?.source?.resolved_commit ?? ""); | ||
| ' "$1" | ||
| } | ||
|
|
||
| rc=0 | ||
| for entry in "${PLUGINS[@]}"; do | ||
| name="${entry%%|*}" | ||
| rest="${entry#*|}" | ||
| sha="${rest##*|}" | ||
| plugin_id="rebuildup.$name" | ||
| have="$(installed_commit "$plugin_id")" | ||
| if [[ "$have" == "$sha" ]]; then | ||
| log "$plugin_id already at pin ${sha:0:12}" | ||
| continue | ||
| fi | ||
| if [[ "$CHECK_ONLY" == "1" ]]; then | ||
| if [[ -z "$have" ]]; then | ||
| log "$plugin_id MISSING (pin ${sha:0:12})" | ||
| else | ||
| log "$plugin_id at ${have:0:12}, pin is ${sha:0:12}" | ||
| fi | ||
| rc=1 | ||
| continue | ||
| fi | ||
| log "installing $plugin_id @ ${sha:0:12}" | ||
| herdr plugin install "rebuildup/hoxay-plugins/plugins/$name" --ref "$sha" -y \ | ||
| || { log "ERROR: install failed for $plugin_id" >&2; rc=1; } | ||
| done | ||
|
|
||
| exit "$rc" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.