devzone 0.59.0 → 1.1.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.
Files changed (42) hide show
  1. package/.devcontainer/agent-erreurs.sh +72 -56
  2. package/.devcontainer/agent-etat-json.sh +45 -43
  3. package/.devcontainer/agent-modele.sh +3 -3
  4. package/.devcontainer/agent-session.sh +122 -125
  5. package/.devcontainer/agent-workspace.sh +53 -53
  6. package/.devcontainer/agent.sh +107 -109
  7. package/.devcontainer/argocd/argocd.sh +4 -16
  8. package/.devcontainer/catalogue/app.sh +1 -1
  9. package/.devcontainer/catalogue/catalogue-veilleur.sh +2 -2
  10. package/.devcontainer/catalogue/mysql/mysql.sh +1 -13
  11. package/.devcontainer/catalogue.sh +4 -16
  12. package/.devcontainer/cluster.sh +1 -1
  13. package/.devcontainer/command-aliases.sh +78 -114
  14. package/.devcontainer/devzone +34 -48
  15. package/.devcontainer/etat-json.sh +162 -162
  16. package/.devcontainer/etat-verrou.sh +25 -24
  17. package/.devcontainer/etat.sh +122 -123
  18. package/.devcontainer/gitlab/gitlab.sh +1 -13
  19. package/.devcontainer/gitlab/installation.sh +3 -3
  20. package/.devcontainer/gitlab/secrets.sh +1 -1
  21. package/.devcontainer/gitlab/test-gitlab.sh +1 -1
  22. package/.devcontainer/help.sh +4 -3
  23. package/.devcontainer/memoire.sh +58 -58
  24. package/.devcontainer/metrics-server.sh +52 -51
  25. package/.devcontainer/paquets.sh +0 -12
  26. package/.devcontainer/password.sh +88 -87
  27. package/.devcontainer/ports-auto.sh +6 -6
  28. package/.devcontainer/ports.sh +1 -13
  29. package/.devcontainer/postgres/postgres.sh +1 -13
  30. package/.devcontainer/services-admin.sh +3 -3
  31. package/.devcontainer/skills/devzone/SKILL.md +2 -2
  32. package/README.md +13 -3
  33. package/charts/devzone-workspace/templates/statefulset.yaml +3 -0
  34. package/manage/devzone +61 -569
  35. package/manage/scripts/argocd-services.sh +2 -2
  36. package/manage/scripts/devzone-create.sh +138 -0
  37. package/manage/scripts/devzone-manifest.sh +171 -0
  38. package/manage/scripts/devzone-update.sh +222 -0
  39. package/manage/scripts/migrer.sh +2 -6
  40. package/manage/scripts/workspace-aliases.sh +4 -31
  41. package/manage/workspace.sh +7 -12
  42. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bash
2
- # Dirige opencode sur une consigne : rotation, silence au depart, reprise.
3
- # Module ia (#221). devzone agent <dossier> <consigne> | etat | liberer.
4
- # shellcheck disable=SC2034 # RACINE, FREE_MODELS, PAUSE_RANG: read by the sourced agent-*.sh
2
+ # Drives opencode on a brief: rotation, silence at start, resume.
3
+ # ia module (#221). devzone agent <folder> <brief> | etat | liberer.
4
+ # shellcheck disable=SC2034 # RACINE, FREE_MODELS, PAUSE_RANK: read by the sourced agent-*.sh
5
5
  set -euo pipefail
6
- # Dossier du script, liens symboliques suivis à la main : readlink -f n'existe
7
- # pas sur macOS (tests sous bash 3.2).
6
+ # Folder of the script, symbolic links followed by hand: readlink -f does not exist
7
+ # on macOS (tests under bash 3.2).
8
8
  SOURCE="${BASH_SOURCE[0]}"
9
9
  while [ -L "$SOURCE" ]; do
10
10
  DIR="$(cd -P "$(dirname "$SOURCE")" && pwd)"
@@ -34,185 +34,183 @@ FREE_MODELS=(big-pickle deepseek-v4.1-flash-free hy4-flash-free nemotron-3.5-sup
34
34
  # shellcheck source=agent-pod.sh disable=SC1091
35
35
  . "$ICI/agent-pod.sh"
36
36
  SILENCE="${DEVZONE_AGENT_SILENCE:-45}"
37
- FIGEE="${DEVZONE_AGENT_FIGEE:-600}"
37
+ FROZEN="${DEVZONE_AGENT_FIGEE:-600}"
38
38
  AGENT_ETAT="${DEVZONE_AGENT_ETAT:-$HOME/.local/state/oc-lancer}"
39
- # Pause entre lecture et écriture du rang (tests seulement) : active seulement
40
- # si DEVZONE_AGENT_PAUSE_RANG est défini sous bats ; jamais de pause par défaut.
41
- PAUSE_RANG=0
42
- if [ -n "${DEVZONE_AGENT_PAUSE_RANG:-}" ] && [ -n "${BATS_TEST_TMPDIR:-}" ]; then PAUSE_RANG="$DEVZONE_AGENT_PAUSE_RANG"; fi
43
- # Relances d'une même session pour cause réseau, par modèle, avant le modèle suivant
44
- RELANCES_RESEAU=3
45
- refuse() { echo "devzone agent : $*" >&2; exit 2; }
46
- agent_lancer() {
47
- local dossier="$1" consigne="$2"
48
- local journal etat debut m i pid code offset taille demarre freeze discard nouveau
49
- local consigne_courante repris=0 maintenant dernier sortie cause
50
- local reseau_pour="" reseau_n=0
51
- # Chemins relatifs au dossier d'appel : rendus absolus avant tout cd, verrou ou
52
- # écriture d'état ; le nom de la consigne est conservé.
53
- [ -d "$dossier" ] || refuse "dossier introuvable : $dossier (cherché depuis $(pwd))"
54
- [ -r "$consigne" ] || refuse "consigne introuvable : $consigne (cherché depuis $(pwd))"
55
- dossier="$(cd "$dossier" && pwd -P)"
56
- consigne="$(cd "$(dirname "$consigne")" && pwd -P)/$(basename "$consigne")"
57
- # Module ia requis : sans assistants, rien à diriger.
39
+ # Pause between read and write of the rank (tests only): active only when
40
+ # DEVZONE_AGENT_PAUSE_RANG is set under bats; never a pause by default.
41
+ PAUSE_RANK=0
42
+ if [ -n "${DEVZONE_AGENT_PAUSE_RANG:-}" ] && [ -n "${BATS_TEST_TMPDIR:-}" ]; then PAUSE_RANK="$DEVZONE_AGENT_PAUSE_RANG"; fi
43
+ # Retries of the same session for a network cause, per model, before the next model
44
+ NETWORK_RETRIES=3
45
+ refuse() { echo "devzone agent: $*" >&2; exit 2; }
46
+ agent_launch() {
47
+ local folder="$1" brief="$2"
48
+ local journal state start m i pid code offset size started freeze discard new
49
+ local brief_current resumed=0 now last output recent cause start_t
50
+ local network_for="" network_n=0
51
+ # Paths relative to the calling folder: made absolute before any cd, lock or
52
+ # state write; the name of the brief is kept.
53
+ [ -d "$folder" ] || refuse "folder not found: $folder (searched from $(pwd))"
54
+ [ -r "$brief" ] || refuse "brief not found: $brief (searched from $(pwd))"
55
+ folder="$(cd "$folder" && pwd -P)"
56
+ brief="$(cd "$(dirname "$brief")" && pwd -P)/$(basename "$brief")"
57
+ # ia module required: without assistants, nothing to drive.
58
58
  if ! bash "$ICI/devzone" is-enabled ia >/dev/null 2>&1; then
59
- refuse "module ia désactivé : devzone enable ia"
59
+ refuse "ia module disabled: devzone enable ia"
60
60
  fi
61
61
  configurer
62
- journal="$(journal_de "$dossier")"
62
+ journal="$(journal_of "$folder")"
63
63
  export AGENT_JOURNAL="$journal"
64
- etat="$AGENT_ETAT"
65
- mkdir -p "$(dirname "$journal")" "$etat"
66
- droits_photo "$dossier"
64
+ state="$AGENT_ETAT"
65
+ mkdir -p "$(dirname "$journal")" "$state"
66
+ droits_photo "$folder"
67
67
  modeles_charger "$journal"
68
68
  local_charge
69
- debut="$(rang_prendre "$etat" "$journal")" || refuse "rang des modèles verrouillé : réessayer"
70
- consigne_courante="$consigne"
71
- # Reprise : une session neuve repart du travail déjà présent (git status,
72
- # diff, log), sans historique de conversation.
73
- reprise() {
74
- if [ "$repris" = 1 ]; then return 0; fi
75
- repris=1
69
+ start="$(rank_take "$state" "$journal")" || refuse "model rank locked: retry later"
70
+ brief_current="$brief"
71
+ # Resume: a new session restarts from the work already present (git status,
72
+ # diff, log), without conversation history.
73
+ resume() {
74
+ if [ "$resumed" = 1 ]; then return 0; fi
75
+ resumed=1
76
76
  local c
77
77
  c="$(mktemp)"
78
- cat "$consigne_courante" >"$c"
79
- printf '\n\nREPRISE : une session précédente a été interrompue. Lis git status, git diff et git log dans le dossier, vérifie ce travail contre la consigne ci-dessus, corrige ce qui s en écarte et termine ce qui manque.\n' >>"$c"
80
- consigne_courante="$c"
78
+ cat "$brief_current" >"$c"
79
+ printf '\n\nRESUME: a previous session was interrupted. Read git status, git diff and git log in the folder, check this work against the brief above, fix what deviates from it and finish what is missing.\n' >>"$c"
80
+ brief_current="$c"
81
81
  }
82
- modele_ordre "$debut"
82
+ modele_ordre "$start"
83
83
  i=0
84
84
  while [ "$i" -lt "${#ORDRE[@]}" ]; do
85
85
  m="${ORDRE[$i]}"
86
- if [ "$m" != "$reseau_pour" ]; then reseau_pour="$m"; reseau_n=0; fi
87
- if modele_ecarte "$m"; then
86
+ if [ "$m" != "$network_for" ]; then network_for="$m"; network_n=0; fi
87
+ if model_excluded "$m"; then
88
88
  modele_demande_ecart "$m" "$(modele_ecart_cause "$m")" "$journal"
89
89
  i=$(( i + 1 ))
90
90
  continue
91
91
  fi
92
92
  modele_demande_choisi "$m" "$journal"
93
- echo "=== modèle opencode/$m début $(date -u +%Y-%m-%dT%H:%M:%SZ)" >>"$journal"
93
+ echo "=== model opencode/$m start $(date -u +%Y-%m-%dT%H:%M:%SZ)" >>"$journal"
94
94
  offset="$(wc -c <"$journal")"
95
- opencode_lancer "$dossier" "$m" "$consigne_courante" "$journal" "$etat"
95
+ opencode_launch "$folder" "$m" "$brief_current" "$journal" "$state"
96
96
  pid=$!
97
- demarre=0
97
+ started=0
98
98
  discard=0
99
- local debut_t
100
- debut_t="$(date +%s)"
99
+ start_t="$(date +%s)"
101
100
  while kill -0 "$pid" 2>/dev/null; do
102
- if session_erreur_fatale "$pid" "$journal" "$offset" "$m" "$dossier"; then discard=1; break; fi
101
+ if session_fatal_error "$pid" "$journal" "$offset" "$m" "$folder"; then discard=1; break; fi
103
102
  if [ "$(wc -c <"$journal")" -gt "$offset" ]; then
104
- nouveau="$(tail -c "+$(( offset + 1 ))" "$journal" 2>/dev/null || true)"
105
- if [ "$(erreur_cause "$(lignes_erreur "$nouveau")")" != "quota" ]; then demarre=1; break; fi
103
+ new="$(tail -c "+$(( offset + 1 ))" "$journal" 2>/dev/null || true)"
104
+ if [ "$(error_cause "$(error_lines "$new")")" != "quota" ]; then started=1; break; fi
106
105
  fi
107
- if [ $(( $(date +%s) - debut_t )) -ge "$SILENCE" ]; then break; fi
106
+ if [ $(( $(date +%s) - start_t )) -ge "$SILENCE" ]; then break; fi
108
107
  sleep "${DEVZONE_AGENT_PAS:-1}"
109
108
  done
110
- if [ "$discard" = 1 ]; then reprise; i=$(( i + 1 )); continue; fi
111
- if kill -0 "$pid" 2>/dev/null && [ "$demarre" = 0 ]; then
109
+ if [ "$discard" = 1 ]; then resume; i=$(( i + 1 )); continue; fi
110
+ if kill -0 "$pid" 2>/dev/null && [ "$started" = 0 ]; then
112
111
  pkill -P "$pid" 2>/dev/null || true
113
112
  kill "$pid" 2>/dev/null || true
114
113
  wait "$pid" 2>/dev/null || true
115
- droits_verifier "$dossier"
116
- echo "=== opencode/$m muet au départ : écarté 1 h, modèle suivant" >>"$journal"
117
- modele_ecarter "$m" mute
114
+ droits_verifier "$folder"
115
+ echo "=== opencode/$m silent at start: excluded 1 h, next model" >>"$journal"
116
+ model_exclude "$m" mute
118
117
  modele_demande_ecart "$m" mute "$journal"
119
- reprise
118
+ resume
120
119
  i=$(( i + 1 ))
121
120
  continue
122
121
  fi
123
- # Session figée : plus rien écrit depuis FIGEE secondes en cours de
124
- # route → arrêtée, puis session neuve avec la consigne de reprise.
122
+ # Frozen session: nothing written for FROZEN seconds during the run -> stopped,
123
+ # then a new session with the resume brief.
125
124
  freeze=0
126
- if kill -0 "$pid" 2>/dev/null && [ "$demarre" = 1 ]; then
127
- dernier="$(date +%s)"
128
- taille="$(wc -c <"$journal")"
125
+ if kill -0 "$pid" 2>/dev/null && [ "$started" = 1 ]; then
126
+ last="$(date +%s)"
127
+ size="$(wc -c <"$journal")"
129
128
  while kill -0 "$pid" 2>/dev/null; do
130
- if session_erreur_fatale "$pid" "$journal" "$offset" "$m" "$dossier"; then discard=1; break; fi
129
+ if session_fatal_error "$pid" "$journal" "$offset" "$m" "$folder"; then discard=1; break; fi
131
130
  sleep "${DEVZONE_AGENT_PAS:-1}"
132
- maintenant="$(date +%s)"
133
- if [ "$(wc -c <"$journal")" -gt "$taille" ]; then
134
- taille="$(wc -c <"$journal")"
135
- dernier="$maintenant"
131
+ now="$(date +%s)"
132
+ if [ "$(wc -c <"$journal")" -gt "$size" ]; then
133
+ size="$(wc -c <"$journal")"
134
+ last="$now"
136
135
  fi
137
- if [ $(( maintenant - dernier )) -gt "$FIGEE" ]; then
136
+ if [ $(( now - last )) -gt "$FROZEN" ]; then
138
137
  pkill -P "$pid" 2>/dev/null || true
139
138
  kill "$pid" 2>/dev/null || true
140
139
  wait "$pid" 2>/dev/null || true
141
- droits_verifier "$dossier"
140
+ droits_verifier "$folder"
142
141
  freeze=1
143
142
  break
144
143
  fi
145
144
  done
146
145
  fi
147
- if [ "$discard" = 1 ]; then reprise; i=$(( i + 1 )); continue; fi
146
+ if [ "$discard" = 1 ]; then resume; i=$(( i + 1 )); continue; fi
148
147
  if [ "$freeze" = 1 ]; then
149
- echo "=== opencode/$m figé ($FIGEE s sans écrire) : session neuve, modèle suivant" >>"$journal"
150
- reprise
148
+ echo "=== opencode/$m frozen ($FROZEN s without writing): new session, next model" >>"$journal"
149
+ resume
151
150
  i=$(( i + 1 ))
152
151
  continue
153
152
  fi
154
153
  code=0
155
154
  wait "$pid" || code=$?
156
- droits_verifier "$dossier"
157
- # Seule la sortie de cette tentative compte : une erreur d'un modèle
158
- # précédent ne doit pas condamner le suivant. On ne lit que ses 30
159
- # dernières lignes, et seulement si le code de sortie est non nul ou si
160
- # opencode a écrit sa propre ligne d'erreur : du code affiché contenant
161
- # « Free usage limit » qui finit normalement n'est pas un échec.
162
- sortie="$(tail -c "+$(( offset + 1 ))" "$journal" 2>/dev/null || true)"
163
- recent="$(printf '%s\n' "$sortie" | tail -n 30)"
164
- if [ "$code" -ne 0 ] || printf '%s\n' "$recent" | grep -qE "$LIGNE_ERREUR"; then
165
- if printf '%s\n' "$recent" | grep -qE "$ERREURS"; then
166
- cause="$(erreur_cause "$(printf '%s\n' "$recent" | grep -oE "$ERREURS" | tail -1)")"
167
- # Une erreur « réseau » n'est retenue que si le réseau est coupé
168
- # maintenant : sinon elle se répéterait sans fin sur un réseau bon.
169
- if [ "$cause" = reseau ] && reseau_joignable; then
170
- echo "=== erreur réseau signalée mais réseau joignable : traité comme autre" >>"$journal"
155
+ droits_verifier "$folder"
156
+ # Only the output of this attempt counts: an error of a previous model must not
157
+ # condemn the next one. Only its last 30 lines are read, and only when the exit
158
+ # code is non-zero or opencode wrote its own error line: a printed "Free usage
159
+ # limit" in text that ends normally is not a failure.
160
+ output="$(tail -c "+$(( offset + 1 ))" "$journal" 2>/dev/null || true)"
161
+ recent="$(printf '%s\n' "$output" | tail -n 30)"
162
+ if [ "$code" -ne 0 ] || printf '%s\n' "$recent" | grep -qE "$ERROR_LINE"; then
163
+ if printf '%s\n' "$recent" | grep -qE "$ERRORS"; then
164
+ cause="$(error_cause "$(printf '%s\n' "$recent" | grep -oE "$ERRORS" | tail -1)")"
165
+ # A network error is kept only if the network is down now: otherwise it
166
+ # would repeat endlessly on a good network.
167
+ if [ "$cause" = reseau ] && network_reachable; then
168
+ echo "=== network error reported but network reachable: treated as other" >>"$journal"
171
169
  cause=autre
172
170
  fi
173
- if [ "$cause" = reseau ] && [ "$reseau_n" -ge "$RELANCES_RESEAU" ]; then
174
- echo "=== opencode/$m réseau coupé $RELANCES_RESEAU fois : modèle suivant, sans écart" >>"$journal"
171
+ if [ "$cause" = reseau ] && [ "$network_n" -ge "$NETWORK_RETRIES" ]; then
172
+ echo "=== opencode/$m network down $NETWORK_RETRIES times: next model, no exclusion" >>"$journal"
175
173
  cause=autre
176
174
  fi
177
175
  if [ "$cause" = reseau ]; then
178
- if reseau_attendre; then
179
- reseau_n=$(( reseau_n + 1 ))
180
- reprise
176
+ if network_wait; then
177
+ network_n=$(( network_n + 1 ))
178
+ resume
181
179
  continue
182
180
  fi
183
- echo "=== réseau indisponible" >>"$journal"
181
+ echo "=== network unavailable" >>"$journal"
184
182
  exit 4
185
183
  fi
186
184
  if [ "$cause" = autre ]; then
187
- echo "=== opencode/$m erreur, sans écart : modèle suivant" >>"$journal"
185
+ echo "=== opencode/$m error, no exclusion: next model" >>"$journal"
188
186
  else
189
- modele_ecarter "$m" "$cause"
187
+ model_exclude "$m" "$cause"
190
188
  modele_demande_ecart "$m" "$cause" "$journal"
191
- echo "=== opencode/$m écarté ($cause, $(ecart_libelle "$cause")) : modèle suivant" >>"$journal"
189
+ echo "=== opencode/$m excluded ($(cause_label "$cause"), $(exclusion_label "$cause")): next model" >>"$journal"
192
190
  fi
193
- reprise
191
+ resume
194
192
  i=$(( i + 1 ))
195
193
  continue
196
194
  fi
197
195
  fi
198
196
  if [ "$code" -ne 0 ]; then
199
- echo "=== opencode/$m arrêté en erreur (code $code) : modèle suivant" >>"$journal"
200
- reprise
197
+ echo "=== opencode/$m stopped on error (code $code): next model" >>"$journal"
198
+ resume
201
199
  i=$(( i + 1 ))
202
200
  continue
203
201
  fi
204
- echo "=== fin avec opencode/$m (code $code)" >>"$journal"
202
+ echo "=== end with opencode/$m (code $code)" >>"$journal"
205
203
  exit "$code"
206
204
  done
207
- echo "=== aucun modèle gratuit disponible" >>"$journal"
205
+ echo "=== no free model available" >>"$journal"
208
206
  exit 3
209
207
  }
210
208
  case "${1:-}" in
211
209
  status) agent_pod_status ;;
212
- etat) if [ "${2:-}" = "--json" ]; then exec bash "$ICI/agent-etat-json.sh"; else agent_etat; fi ;;
210
+ etat) if [ "${2:-}" = "--json" ]; then exec bash "$ICI/agent-etat-json.sh"; else agent_state; fi ;;
213
211
  liberer)
214
212
  [ -n "${2:-}" ] || { agent_aide >&2; exit 2; }
215
- ecart_liberer "$2"
213
+ exclusion_clear "$2"
216
214
  ;;
217
215
  -h | --help | aide) agent_aide ;;
218
216
  "")
@@ -222,7 +220,7 @@ case "${1:-}" in
222
220
  *)
223
221
  if [ "${1:-}" = "--modele" ]; then [ -n "${2:-}" ] || { agent_aide >&2; exit 2; }; MODELE_LISTE="$2"; shift 2; fi
224
222
  if [ "${1:-}" = "--pod" ]; then
225
- [ -z "$MODELE_LISTE" ] || refuse "--modele n'est pas géré avec --pod"
223
+ [ -z "$MODELE_LISTE" ] || refuse "--modele is not supported with --pod"
226
224
  shift
227
225
  if [ -z "${1:-}" ] || [ -z "${2:-}" ]; then
228
226
  agent_aide >&2
@@ -230,20 +228,20 @@ case "${1:-}" in
230
228
  fi
231
229
  agent_pod_lancer "$1" "$2"
232
230
  fi
233
- mode_local=0
231
+ local_mode=0
234
232
  if [ "${1:-}" = "--local" ]; then
235
- mode_local=1
233
+ local_mode=1
236
234
  shift
237
235
  fi
238
236
  if [ "$#" -lt 2 ]; then
239
237
  agent_aide >&2
240
238
  exit 2
241
239
  fi
242
- if [ "$mode_local" = 0 ] && workspace_disponible; then
240
+ if [ "$local_mode" = 0 ] && workspace_available; then
243
241
  code=0
244
242
  agent_workspace "$1" "$2" || code=$?
245
243
  exit "$code"
246
244
  fi
247
- agent_lancer "$1" "$2"
245
+ agent_launch "$1" "$2"
248
246
  ;;
249
247
  esac
@@ -21,8 +21,8 @@ ETAT="${DEVZONE_ETAT:-$RACINE/.devzone.modules}"
21
21
  # shellcheck source=SCRIPTDIR/../isolement.sh
22
22
  # shellcheck disable=SC1091
23
23
  . "$ICI/../isolement.sh"
24
- # Shared memory check of the services cluster (#608): quantite_ki and
25
- # memoire_cluster_ki.
24
+ # Shared memory check of the services cluster (#608): quantity_ki and
25
+ # memory_cluster_ki.
26
26
  # shellcheck source=SCRIPTDIR/../memoire.sh
27
27
  # shellcheck disable=SC1091
28
28
  . "$ICI/../memoire.sh"
@@ -39,7 +39,7 @@ refuse() { echo "devzone : argocd : $*" >&2; exit 2; }
39
39
 
40
40
  # Vue regroupée des identifiants : un échec n'empêche jamais l'opération
41
41
  regenerer_identifiants() {
42
- password_regenerer ||
42
+ password_regenerate ||
43
43
  echo "devzone : argocd : identifiants regroupés non mis à jour (devzone passwords)" >&2
44
44
  }
45
45
 
@@ -47,7 +47,7 @@ regenerer_identifiants() {
47
47
  # message indique où agrandir le cluster et la commande à relancer.
48
48
  verifier_memoire() {
49
49
  local memoire
50
- if ! memoire="$(memoire_cluster_ki)"; then
50
+ if ! memoire="$(memory_cluster_ki)"; then
51
51
  echo "devzone : argocd : cluster des services injoignable : devzone cluster" >&2
52
52
  return 2
53
53
  fi
@@ -190,18 +190,6 @@ ARGOCD_CONF="${DEVZONE_ARGOCD_CONF:-$RACINE/.argocd.conf}"
190
190
  # shellcheck disable=SC1091
191
191
  . "$ICI/apps.sh"
192
192
  argocd_kubectl() { kubectl --context devzone "$@"; }
193
- # English command names are accepted (#557) : a copied script may miss the file
194
- # shellcheck source=SCRIPTDIR/../command-aliases.sh
195
- # shellcheck disable=SC1091
196
- if [ -f "$ICI/../command-aliases.sh" ]; then
197
- . "$ICI/../command-aliases.sh"
198
- fi
199
- # Subcommand and options become their canonical English names ; the old
200
- # French names warn on use (#557)
201
- if command -v canonical_args >/dev/null 2>&1; then
202
- canonical_args argocd "$@"
203
- set -- "${ARGS_CANONICAL[@]+"${ARGS_CANONICAL[@]}"}"
204
- fi
205
193
 
206
194
  case "${1:-}" in
207
195
  install) installer ;;
@@ -60,7 +60,7 @@ app_secret() {
60
60
 
61
61
  # Vue regroupée des identifiants : un échec n'empêche jamais l'opération
62
62
  regenerer_identifiants() {
63
- password_regenerer ||
63
+ password_regenerate ||
64
64
  echo "devzone : catalogue : identifiants regroupés non mis à jour (devzone passwords)" >&2
65
65
  }
66
66
 
@@ -54,8 +54,8 @@ tour() {
54
54
  [ -f "$ETAT" ] || return 0
55
55
  # État restauré ou reconstruit : le veilleur ne suit pas un état douteux,
56
56
  # et ne désinstalle jamais tant que devzone apply ne l'a pas confirmé
57
- etat_recouvrement_attente && return 0
58
- etat_recouvrement_en_attente && return 0
57
+ state_recovery_wait && return 0
58
+ state_recovery_pending && return 0
59
59
  mkdir -p "$BASE"
60
60
  maintenant="$(stat -c %Y "$ETAT" 2>/dev/null || stat -f %m "$ETAT" 2>/dev/null || true)"
61
61
  [ -n "$maintenant" ] || return 0
@@ -23,18 +23,6 @@ ETAT="${DEVZONE_ETAT:-$RACINE/.devzone.modules}"
23
23
  # shellcheck source=SCRIPTDIR/../../argocd/catalogue-argocd.sh
24
24
  # shellcheck disable=SC1091
25
25
  . "$ICI/../../argocd/catalogue-argocd.sh"
26
- # English command names are accepted (#557) : a copied script may miss the file
27
- # shellcheck source=SCRIPTDIR/../../command-aliases.sh
28
- # shellcheck disable=SC1091
29
- if [ -f "$ICI/../../command-aliases.sh" ]; then
30
- . "$ICI/../../command-aliases.sh"
31
- fi
32
- # Subcommand and options become their canonical English names ; the old
33
- # French names warn on use (#557)
34
- if command -v canonical_args >/dev/null 2>&1; then
35
- canonical_args mysql "$@"
36
- set -- "${ARGS_CANONICAL[@]+"${ARGS_CANONICAL[@]}"}"
37
- fi
38
26
  NS=devzone-mysql
39
27
  SECRETS="$RACINE/workspace/.mysql"
40
28
  MYSQL_PORT="${MYSQL_PORT:-3306}"
@@ -48,7 +36,7 @@ refuse() { echo "devzone : catalogue mysql : $*" >&2; exit 2; }
48
36
  services_secret_mysql() { mysql_secret; }
49
37
  # Régénère la vue .password (échec non bloquant)
50
38
  regenerer_identifiants() {
51
- password_regenerer ||
39
+ password_regenerate ||
52
40
  echo "devzone : catalogue mysql : identifiants regroupés non mis à jour (devzone passwords)" >&2
53
41
  }
54
42
  # Raccourci kubectl dans le namespace devzone-mysql
@@ -24,18 +24,6 @@ ETAT="${DEVZONE_ETAT:-$RACINE/.devzone.modules}"
24
24
  # shellcheck source=SCRIPTDIR/catalogue/app.sh
25
25
  # shellcheck disable=SC1091
26
26
  . "$ICI/catalogue/app.sh"
27
- # English command names are accepted (#557) : a copied script may miss the file
28
- # shellcheck source=SCRIPTDIR/command-aliases.sh
29
- # shellcheck disable=SC1091
30
- if [ -f "$ICI/command-aliases.sh" ]; then
31
- . "$ICI/command-aliases.sh"
32
- fi
33
- # Subcommand and options become their canonical English names ; the old
34
- # French names warn on use (#557)
35
- if command -v canonical_args >/dev/null 2>&1; then
36
- canonical_args catalog "$@"
37
- set -- "${ARGS_CANONICAL[@]+"${ARGS_CANONICAL[@]}"}"
38
- fi
39
27
 
40
28
  refuse() { echo "devzone : catalogue : $*" >&2; exit 2; }
41
29
 
@@ -111,9 +99,9 @@ catalogue_synchroniser() (
111
99
  local app entete manque="" tmp
112
100
  [ -f "$ETAT" ] || return 0
113
101
  entete="# Applications du catalogue : passer à on pour installer (devzone catalog)"
114
- etat_verrou_prendre || return 1
102
+ state_lock_take || return 1
115
103
  # Le verrou est rendu à la sortie, y compris sur une erreur sous set -e
116
- trap 'etat_verrou_lacher' EXIT
104
+ trap 'state_lock_release' EXIT
117
105
  while IFS= read -r app; do
118
106
  [ -n "$app" ] || continue
119
107
  grep -qE "^${app}=" "$ETAT" 2>/dev/null && continue
@@ -126,7 +114,7 @@ catalogue_synchroniser() (
126
114
  grep -qF "$entete" "$ETAT" || echo "$entete"
127
115
  echo "$manque"
128
116
  } >"$tmp"
129
- etat_poser "$tmp"
117
+ state_replace "$tmp"
130
118
  rm -f "$tmp"
131
119
  )
132
120
 
@@ -169,7 +157,7 @@ app_relais_arrete() {
169
157
  fi
170
158
  script="$ICI/catalogue/$app/$app.sh"
171
159
  if [ -f "$script" ]; then
172
- etat="$(bash "$script" etat 2>/dev/null || true)"
160
+ etat="$(bash "$script" status 2>/dev/null || true)"
173
161
  case "$etat" in *"relais arrêté"*) return 0 ;; esac
174
162
  fi
175
163
  ! relais_actif "$app"
@@ -64,7 +64,7 @@ cluster_lu() {
64
64
  }
65
65
 
66
66
  cluster_ecrire() {
67
- etat_ecrire cluster "$1"
67
+ state_write cluster "$1"
68
68
  }
69
69
 
70
70
  cluster_est_dedie() {