@soleur/opencode 3.407.5 → 3.409.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleur/opencode",
3
- "version": "3.407.5",
3
+ "version": "3.409.0",
4
4
  "description": "Soleur AI organization plugin for OpenCode",
5
5
  "type": "module",
6
6
  "bin": {
@@ -978,7 +978,7 @@ if [ -d "$INFRA" ]; then
978
978
  TABLE_ROLES="$(awk '/^readonly ROLE_TABLE=/{t=1} t{ line=$0; sub(/^readonly ROLE_TABLE=./,"",line); sub(/.$/,"",line); if (line ~ /^[a-z0-9-]+\|/) { split(line,a,"|"); print a[1] } } /^grok-dogfood\|/{t=0}' "$TREE/h/host-state.sh" | sort -u | tr '\n' ' ')"
979
979
  eq "role table lists the six roles" "$TABLE_ROLES" "git-data grok-dogfood inngest registry web-1 web-2 "
980
980
  BLOCKS="$(git -C "$REPO_TOP" ls-files 'apps/web-platform/infra/*.tf' | grep -v rehearsal | while IFS= read -r f; do grep -hE '^resource[[:space:]]+"hcloud_server"[[:space:]]+"[a-z0-9_]+"' "$REPO_TOP/$f"; done | sed -E 's/.*"hcloud_server"[[:space:]]+"([a-z0-9_]+)".*/\1/' | sort | tr '\n' ' ')"
981
- eq "census: hcloud_server blocks outside rehearsal roots" "$BLOCKS" "git_data grok_dogfood inngest registry web "
981
+ eq "census: hcloud_server blocks outside rehearsal roots" "$BLOCKS" "bastion git_data grok_dogfood inngest registry web "
982
982
  # every block maps to at least one role; web expands by var.web_hosts, one role per key
983
983
  WEB_KEYS="$(sed -n '/^variable "web_hosts"/,/^}/p' "$INFRA/variables.tf" | grep -oE '^\s+"web-[0-9]+" = \{' | grep -oE 'web-[0-9]+' | sort | tr '\n' ' ')"
984
984
  eq "census: web_hosts keys equal the web roles" "$WEB_KEYS" "web-1 web-2 "
@@ -986,6 +986,10 @@ if [ -d "$INFRA" ]; then
986
986
  b="${blk%%:*}"; r="${blk##*:}"
987
987
  case " $TABLE_ROLES " in *" $r "*) ok ;; *) bad "census: block $b has no role row $r" ;; esac
988
988
  done
989
+ # bastion (#12866, ADR-327 step 2a) has NO role row on purpose: 2a declares it and births it by a gated
990
+ # dispatch, and it ships no log source or kernel marker (no Vector, no heartbeat). Its role row lands with
991
+ # #12879's heartbeat. Ratchet: once host-state.sh names a bastion role, this exemption must go.
992
+ case " $TABLE_ROLES " in *" bastion "*) bad "census: bastion now has a role row; drop its exemption here" ;; *) ok ;; esac
989
993
  fi
990
994
 
991
995
  # ===========================================================================================================
@@ -1019,6 +1023,9 @@ km_census() { # km_census <infra-dir> -> findings, one per line; empty means cle
1019
1023
  [ -f "$d/cloud-init-registry.yml" ] || echo "NO-REGISTRY-CLOUD-INIT"
1020
1024
  grep -qE 'host-kernel-marker|SOLEUR_HOST_KERNEL' "$d/cloud-init-registry.yml" 2> /dev/null && echo "STALE-REGISTRY-EXEMPTION" ;;
1021
1025
  git_data) : ;; # exempt: separate Logs source, tracked in the git-data follow-up issue
1026
+ bastion) # exempt (#12866, ADR-327 2a): no shipper and no marker until #12879's heartbeat. Ratchet: once
1027
+ # bastion-cloud-init.yml mentions the marker, the exemption must flip to emits on purpose.
1028
+ grep -qE 'host-kernel-marker|SOLEUR_HOST_KERNEL' "$d/bastion-cloud-init.yml" 2> /dev/null && echo "STALE-BASTION-EXEMPTION" ;;
1022
1029
  grok_dogfood) # exempt: default-off, no shipper; the exemption ends when the variable flips
1023
1030
  grep -qE 'default[[:space:]]*=[[:space:]]*false' < <(sed -n '/^variable "enable_grok_dogfood"/,/^}/p' "$d/variables.tf" 2> /dev/null) || echo "STALE-EXEMPTION grok_dogfood" ;;
1024
1031
  *) echo "UNCLASSIFIED $b" ;;
@@ -369,7 +369,10 @@ NEVER CODE! Just research and write the plan.
369
369
  - **A plan that proposes a flag or argv as an implementation lever on a repo script must read the script's actual argv first — "the flag that should exist" is a capability claim verified against the parser, not inferred from the suite's shape.** Grep the script's argument handling (`--only`, `getopts`, the `usage`/help text) or run `--help`; it settles in seconds what a wrong claim costs a ruling cycle to catch. **Why:** #12626 — the plan prescribed a `--rows` row-splitting lever on `approval-guard1-mutation`; the battery's argv is `[--only|--list|--check-anchors]`, and only the batched CTO ruling caught it. See `knowledge-base/project/learnings/2026-11-11-a-completed-but-failing-leg-filed-as-did-not-complete.md` SE#4.
370
370
  - **A plan that pins a Terraform forget (`removed { destroy = false }`) must state the property in the provider's DELETE key (an email, a name) and pin a CLOSED SET over every file Terraform would load — every tracked `.tf`/`.tf.json` in the repo, minus dotfiles Terraform ignores, with heredocs found by a raw scan — never a search for the bad label or literal.** When the property is "no managed resource of type T", the set is the allowed occurrences of the type token (only the forget's `from` line); when other instances of T stay managed, enumerate the allowed addresses instead. Reuse the `FIX B handed` describe in `plugins/soleur/test/terraform-target-parity.test.ts` and its mirror, Guard G4a in `tests/scripts/test-infra-privileged-tier-census.sh`, rather than rebuilding the scan from prose. Labels miss `import`, `local.`/`var.` values, case, unquoted labels, modules and other roots; and a second guard that shares the first one's file reader and string stripper shares its blind spots. **Why:** #12813 — a dotfile `.tf` and a quote-confused heredoc each kept the test and that census guard green while Terraform planned a DELETE of the sole Better Stack Admin. See `knowledge-base/project/learnings/2026-11-16-my-forget-pin-checked-labels-while-the-provider-deletes-by-email.md`.
371
371
  - **A plan that adds a rule to a gate which reads text another interpreter will expand (a Bash PreToolUse hook, a CI shell lint) must list that interpreter's whole expansion and quoting set first, and close each class in one place rather than deny-listing spellings.** For bash: brace, tilde, parameter/`$[…]`, command, process substitution, pathname/extglob, backslash and `$'…'` quoting, and the target tool's own argv parsing (git long-option prefixes, commit pathspecs). Brief the first fix-round security seat to sweep that whole list, not to find one more instance. **Why:** #12806 — seven fix rounds each found the next form the cron hook read differently from bash; see `knowledge-base/project/learnings/2026-11-16-seven-fix-rounds-each-found-the-next-bash-expansion-the-hook-read-differently.md`.
372
+ - **Before a plan assigns a resource to one PR of a split (a heartbeat, a host create, a replace target), grep the parity test and manifest that pair that resource type with a route, and put the resource in the PR that carries the paired route.** A `betteruptime_heartbeat` armed by host boot needs a `<host>-host-replace` option and a `-replace` line (`heartbeat-reprovision-parity.test.ts`, `heartbeat-manifest.ts`), even when paused. A new route that reads `fresh-host-boot-trail.sh` must decide from a positive `fresh_boot_ready`, not the exit code, which is 0 on a skipped read. **Why:** #12866, where a heartbeat ruled into PR 2a needed PR 2b's replace route; see `knowledge-base/project/learnings/2026-11-17-a-split-pr-cannot-ship-a-boot-armed-heartbeat-before-its-replace-route.md`.
372
373
  - **A test scenario that checks a discriminator with a live stand-in must keep the production filter and vary only the data. Never invert the filter.** Swapping `= 'Object'` for `= 'String'` measures a different predicate over the rows that do match it. Conjoin the production filter with an impossible clause to get the empty-window value, and use a split count (`countIf` in ClickHouse, `COUNT(*) FILTER (WHERE …)` in Postgres) to show what the discriminator excludes. **Why:** #12726/PR #12865 — the inverted stand-in window held 42 string rows and read value 0 where the plan expected 1. See `knowledge-base/project/learnings/2026-11-18-the-guard-lexer-kept-desyncing-until-the-guarded-file-was-confined-to-the-subset-it-models.md`.
373
374
  - **An acceptance criterion that says "additions only" / "no `-` line" must be checked against every edit the plan itself prescribes in that file: an in-cell table append or an in-field frontmatter change is a one-line rewrite, so `git diff` shows a `-` line and the AC is unsatisfiable as written.** Write the carve-out into the AC by naming each rewritten line's content anchor (the table row's first cells, the frontmatter key), with the exact grep that drops only those lines, e.g. `git diff -U0 origin/main...HEAD -- <file> | grep -E '^-' | grep -vE '^--- (a/|/dev/null)' | grep -vF '<row anchor>'` printing nothing. Do not state it as "the `-` line is a prefix of its `+` line": a table row's closing pipe (space then `|`) and a replaced frontmatter value both break that. Do not match `^-[^-]` either: it misses a deleted `- item` line, which the diff shows as `-- item`. **Why:** #12742/PR #12884 — AC7 forbade any `-` line while Phase 4 step 2 prescribed an in-cell append to the runbook's #10538 row; the task was ticked anyway and review flagged it. See `knowledge-base/project/learnings/2026-11-18-an-ac-that-contradicts-the-prescribed-edit.md`.
375
+ - When a plan has shell code re-implement an app rule (jq or awk over a container env, a config file or JSON), prescribe ONE shared fixture table that both the app tests and the shell rows run, with the shell rows graded on `<output>|<exit status>`. Also name each runtime default that differs: jq `\s` versus JS `trim` (NEL, BOM), `fromjson` versus `JSON.parse` (NaN, leading zeros, lone surrogates). A jq error prints nothing and reads as "no" unless the rc is asserted. **Why:** #12910/PR #12918, three review passes. See `knowledge-base/project/learnings/2026-11-20-a-shell-mirror-of-an-app-rule-diverged-on-trim-json-strictness-and-exit-status.md`.
376
+ - **A plan that moves a job body into a reusable workflow (`uses: ./.github/workflows/<file>.yml`) must list every suite that reads that caller's `jobs.<id>.steps`, and must make each one follow the call into the reusable file.** A thin caller has no `steps:`, so a suite keyed on caller + job id + steps sees nothing. A "present" assertion goes red, but an "every step that does X also does Y" assertion passes vacuously. Find them repo-wide (most infra suites live under `apps/`) with `git grep -l '<caller>.yml' -- ':!knowledge-base' ':!.github' ':!*.md' | xargs grep -lE '<job_id>|\.jobs\b|\.steps\b|jobs\[|\bsteps:'`, then read each hit: it must follow the call when it reads the caller's jobs by id, by `apply_target`, or by an extracted `^ <job_id>:` block. On #12873 this listed 54 files, four of which read the moved job. Suites that walk every workflow file see the moved body as a file of its own. **Why:** #12866/PR #12873 — `stock-preflight-coverage.test.ts` went red only on CI after `bastion_host_create` moved into `bastion-host-create.yml`. See `knowledge-base/project/learnings/2026-11-19-a-reusable-workflow-hides-its-steps-from-every-suite-that-reads-the-caller.md`.
374
377
  - **A plan that adds agent-prompt text on a degraded path must check each clause against the tool list the SDK receives on that path, and must prescribe its positive (`toContain`) asserts on that section's body, not the whole prompt; absence asserts may read the whole prompt.** Read `mcpServers`/`allowedTools`/`disallowedTools` where the prompt is built, not only the sibling prompt text; and grep every fragment you prescribe for `toContain` against the base prompt, because a composite prompt already carries common words. **Why:** #12598/PR #12957 — "no GitHub claim" left the agent told it had no web access while its `github_*` read tools stayed registered, and `toContain("failed to start")` matched `BASH_UNAVAILABLE_PROMPT_DIRECTIVE`, so a body-gutting mutation stayed green. See `knowledge-base/project/learnings/2026-11-19-a-prompt-line-is-a-claim-about-the-tool-list-and-its-asserts-must-read-its-own-body.md`.
375
378
  - **A plan that revokes a grant (a toggle-off, a consent withdrawal, a token revoke) must list every await between the point where the grant is READ and the point where the resource is REGISTERED, and every path that tears the resource down. The revocation check (an epoch, a flag) is read at the grant read, not at the start of the spawn helper. Every abort sets the revoked state, and every new attempt clears it.** **Why:** #12585/PR #12897 — the R4 epoch was read inside `spawnEgressForwarder`, which missed about 22 dispatcher awaits (the repo clone included). Aborts during the gateway probe were never marked, a stale mark hid a real spawn failure, and the warm re-resolve's teardown never marked. A targeted fix round found all four. See `knowledge-base/project/learnings/2026-11-18-a-revocation-fix-closed-the-window-i-named-not-the-windows-between-grant-read-and-register.md`.
@@ -44,6 +44,10 @@ The `soleur:ship` Phase 5.5 "Deploy Pipeline Fix Drift Gate" surfaces this contr
44
44
  | `lock_contention` | 1 | Another ci-deploy.sh holds flock | Wait for prior run to finish; if stuck >10min, SSH to kill |
45
45
  | `doppler_unavailable` | 1 | doppler binary missing on server | Re-run terraform apply to reprovision |
46
46
  | `doppler_token_missing` | 1 | DOPPLER_TOKEN env var not set | Check `/etc/default/webhook-deploy` on server |
47
+ | `host_key_change` | 1 | #12910 T3/T3a: the running prod container had VERIFIED a `var.web_hosts` key and this deploy resolved a different one; aborted before prune/pull/canary, the old container keeps serving | Read the deploy line: `scripts/betterstack-query.sh --grep 'host_key abort'` (`running=<old> new=<new>`). The cause is a changed metadata hostname. No workflow updates `hcloud_server.web` in place: the per-PR and manual-rerun `-target` sets exclude it, and only `web-host-create` / `web-host-replace` touch it. If a PR changed the name (`server.tf`) or the name-to-key map (`resolve_host_key`), revert that change in a PR. If the server was renamed outside Terraform, renaming it back (Hetzner console or API) is the owner's action. If the host really must take the new key, that is a host replace (`apply-web-platform-infra.yml -f apply_target=web-host-replace`, refuses web-1), which needs the operator's go. If `running=` came from a Doppler prd `SOLEUR_HOST_KEY` (only a cloud-init first-boot container from before #12910 round 2 lacks the empty `-e` override; per the CTO agent's read in decision-challenges R2-Q3, Doppler prd held no such secret on 2026-11-19), no roster fix clears it, because the check reads the running container's frozen env: remove the key from Doppler prd, then replace the host, both operator-gated. Do NOT re-run blind |
48
+ | `host_key_lost` | 1 | #12910 T3a: the running container had verified a key and this deploy resolved none | The abort line names why: `scripts/betterstack-query.sh --grep 'host_key abort'` (`cause=<token>`). `cause=metadata_unreachable` is transient: re-run the deploy after a few minutes with `gh run rerun "$(gh run list --workflow=web-platform-release.yml --event workflow_run -L1 --json databaseId -q '.[0].databaseId')"`. Any other cause (`name_unmapped`, `name_reserved`, `key_malformed`) is a naming defect: fix it in a PR. An old image under the new script can also abort this way once; a re-run recovers it. Do NOT SSH |
49
+ | `host_key_inspect_failed` | 1 | #12910 T3a: `docker inspect` of the running prod container failed for a reason other than "no such container"; the sticky check refuses to read that as "no container" | Transient daemon error: re-run with `gh run rerun "$(gh run list --workflow=web-platform-release.yml --event workflow_run -L1 --json databaseId -q '.[0].databaseId')"`. Persisting: the host's docker daemon is unhealthy, see the host's Sentry/Better Stack rows. Do NOT SSH |
50
+ | `host_key_unverifiable` | 1 | #12910 round 2 (CTO Q1): the running container verified a key, but the NEXT prod container could not verify it: either this host's private IP was not up at deploy (`PROXY_BIND` empty), or the Doppler prd `SOLEUR_HOST_ROSTER` no longer maps the key to this host's IP. Aborted before the canary, the old container keeps serving | `scripts/betterstack-query.sh --grep 'host_key abort reason=key_unverifiable'`. A late NIC is transient: re-run with `gh run rerun "$(gh run list --workflow=web-platform-release.yml --event workflow_run -L1 --json databaseId -q '.[0].databaseId')"`. If it repeats, compare the Doppler prd `SOLEUR_HOST_ROSTER` with `var.web_hosts` (`variables.tf`) and fix the roster in Doppler (an operator-gated prd write), then redeploy. Do NOT SSH |
47
51
  | `doppler_fetch_failed` | 1 | Transient Doppler API failure | Retry deploy |
48
52
  | `command_missing` | 1 | Empty SSH_ORIGINAL_COMMAND | Check webhook -> ssh trigger wiring |
49
53
  | `command_malformed` | 1 | Wrong arg count | Check CI payload shape |
@@ -89,6 +93,17 @@ The `soleur:ship` Phase 5.5 "Deploy Pipeline Fix Drift Gate" surfaces this contr
89
93
  | `timeout` | 124 | Wall-clock cap (`ci-deploy-wrapper.sh` 1800s, raised from 900s in #5061) sent SIGTERM and `ci-deploy.sh`'s TERM trap fired before bash exited (#3704) | SSH and run `journalctl -u webhook -t ci-deploy --since '-15m'` for the last successful step before silence; likely culprit is hung `docker pull`, `docker exec bwrap`, or canary probe. |
90
94
  | `corrupt_state` | -3 | State file is unparseable JSON | Server-side disk issue; SSH to investigate |
91
95
 
96
+ ### Host identity signals (#12910): not deploy-status reasons, read them beside one
97
+
98
+ These come from the app, not from `ci-deploy.sh`, so the deploy-status hook never returns them.
99
+
100
+ | Signal | Where | Meaning | Action |
101
+ |---|---|---|---|
102
+ | `host_identity source=<web-host-key\|key-absent\|key-malformed\|key-unverified\|dev-sentinel\|unresolved>` | Better Stack, one pino line per container boot | Which id this container places leases under. `web-host-key` is the healthy state. | `scripts/betterstack-query.sh --grep 'host_identity source='`. The prod container should read `web-host-key` after its first ci-deploy. A first-boot container reads `unresolved`, which is expected until that deploy. |
103
+ | `resolveHostId.key-fallback` (`tags.source`) | Sentry, prod container only | The prod container did not verify its key and fell back to `hetzner-<id>` (including a late private NIC). | Compare the deploy's `host_key` line with the Doppler prd `SOLEUR_HOST_ROSTER`. A late NIC clears on the next deploy; a roster mismatch needs a roster fix, which is an operator-gated prd write. Do NOT SSH. |
104
+ | `resolveSessionRoute.owner-is-self` | Sentry, at most one per workspace per 5 min | The router refused to proxy a session to this host's own address. That means a lease under an id this host no longer uses (a fallback, or the transition deploy). | It clears when the lease expires (up to 240 s). If it repeats, look for `resolveHostId.key-fallback` on the same host. |
105
+ | `resolveSessionRoute.owner-unresolved` | Sentry | The lease holder is not in this host's roster (for example a `hetzner-<id>` holder seen from a key-shaped roster). | It is transient during the first rollout (up to 240 s per lease). If it persists, check that both hosts log `host_key resolved=web-<n>`. |
106
+
92
107
  ## Response fields: `.peers` (per-fan-out-peer verdict merge)
93
108
 
94
109
  `cat-deploy-state.sh` merges a top-level `peers` object when the state file