devzone 7.8.0 → 7.9.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.
@@ -51,7 +51,7 @@ The log is `workspace/.agents/<folder>.log`. `--auto` avoids waiting for a permi
51
51
 
52
52
  With `ai` active, the repowarden guard is plugged in for Claude Code and opencode: the agent is stopped before modifying `main`/`develop`, committing without `repowarden cc` or bypassing the hooks. `repowarden cc -m "…"` to commit.
53
53
 
54
- Protected rights files (never written by an agent, fixed list, no variable changes it): `.devcontainer/opencode/agent.json`, `.devcontainer/opencode.jsonc`, `.repowarden.conf`, `.devcontainer/agent-rights.sh`. An agent that touches them is refused and the change is reverted in the tree.
54
+ Protected rights files (never written by an agent, fixed list, no variable changes it): `.devcontainer/opencode/agent.json`, `.devcontainer/opencode.jsonc`, `.repowarden.conf`, `internal/domain/agent/rights.go`. An agent that touches them is refused and the change is reverted in the tree.
55
55
 
56
56
  ## Kubernetes only
57
57
 
@@ -1,4 +1,4 @@
1
- # Single source for the repowarden version used by workspace-init.sh and manage/scripts/ci/versions.sh.
1
+ # Single source for the repowarden version used by devzone init and manage/scripts/ci/versions.sh.
2
2
  REPOWARDEN_VERSION=4.18.2
3
3
 
4
4
  # Pinned metrics-server release installed on the local clusters by devzone.
package/bin/SHA256SUMS CHANGED
@@ -1,6 +1,6 @@
1
- d62303538615b37fb04918a4a5f8177bf93c4206e09de3103194a95b112913b2 devzone-linux-amd64
2
- 4ecdc53b10efd3a0be787574a255a0102717589bb41c3fd9b44bb392b3a7bf90 devzone-linux-arm64
3
- cccf1f863ac80b60f400f9a1199f0dc7b4578b85f767ad18143ca37c5f3e9381 devzone-darwin-amd64
4
- 8a5eaf8debc4b7b09799edd460958fb098b820fdb8190fc5019651af79ed5095 devzone-darwin-arm64
5
- 10d34d76a8631378572ca14dd272bc60dc4c1d0aef92e0ca8d439b25a04e39ce devzone-windows-amd64.exe
6
- 5049c37144a86aeb04cc6a8aaba3bde7fa18c29de61e289840eaebca70f64600 devzone-windows-arm64.exe
1
+ fa2fde00e5bcde77ed338e99291fde962d32ba6276ffb6bfcd4f7b8c110d5407 devzone-linux-amd64
2
+ fb1048f1ded7b6bc5d8fadad95d822b77934a576cc446cf362df120d4c60ff52 devzone-linux-arm64
3
+ 95e61b089c75cfc882afd856ad53b88bfaf589b349c43969c96094096161af07 devzone-darwin-amd64
4
+ c0e21ba31a7fda9e0319afce5ac86bb6a929c322a2ca66e99ad3adf99980e626 devzone-darwin-arm64
5
+ d14be980fc84313c0cc8a1aa647850f0b261e8eae9c54daa82e9b7c050becb60 devzone-windows-amd64.exe
6
+ ce8c8333a72b4fda41d0c1b720837c5601fd8a8a96f5ac84a7c277385982da95 devzone-windows-arm64.exe
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -49,15 +49,17 @@ buildkit:
49
49
  # Workspace container and the volume of its projects (#399): the workspace PVC
50
50
  # is mounted on /workspaces/projets, where the container starts (workingDir).
51
51
  workspace:
52
- # Command: run workspace-init.sh in the foreground first, then keep the pod
53
- # alive as PID 1 (like VS Code for a devcontainer) (#503). The init script
54
- # runs before the loop, its errors are ignored (|| true) and its journal is
55
- # ~/.local/state/devzone/init.log. Empty = image default command.
52
+ # Command: run the pod's init in the foreground first, then keep the pod
53
+ # alive as PID 1 (like VS Code for a devcontainer) (#503). The Go init runs
54
+ # before the loop; its exit status is ignored by the pod but a failure is
55
+ # written to ~/.local/state/devzone/init.log. The absolute binary path avoids
56
+ # an npm-installed devzone hiding the pod one in PATH (#980). Empty = image
57
+ # default command.
56
58
  # PID 1 must reap the orphans (#967): sleep infinity did not, so the zombies
57
59
  # piled up (20 000 in 2.5 days). The loop calls wait, which reaps every child
58
60
  # of the shell, orphans included (they are re-parented to PID 1). TERM and INT
59
61
  # exit at once, so the pod stops on time.
60
- command: ["bash", "-c", "mkdir -p \"$HOME/.local/state/devzone\"; bash /usr/local/share/devzone/.devcontainer/workspace-init.sh >>\"$HOME/.local/state/devzone/init.log\" 2>&1 || true; trap 'exit 0' TERM INT; while true; do wait -n 2>/dev/null; sleep 1; done"]
62
+ command: ["bash", "-c", "mkdir -p \"$HOME/.local/state/devzone\"; /usr/local/bin/devzone init >>\"$HOME/.local/state/devzone/init.log\" 2>&1 || echo \"devzone init: failed (exit $?)\" >>\"$HOME/.local/state/devzone/init.log\"; trap 'exit 0' TERM INT; while true; do wait -n 2>/dev/null; sleep 1; done"]
61
63
  # Size of the projects volume.
62
64
  size: 20Gi
63
65
  storageClass: ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devzone",
3
- "version": "7.8.0",
3
+ "version": "7.9.0",
4
4
  "description": "Ton poste de développement Linux, prêt en une commande, identique sur Mac, Windows et Linux.",
5
5
  "license": "GPL-3.0-only",
6
6
  "repository": {
@@ -1,89 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Protects the rights files of the agents during a devzone agent session (#361).
3
- # Library sourced by agent.sh: no command is launched here.
4
-
5
- # Rights files, paths relative to the root of the working folder. Fixed list: no
6
- # environment variable changes it, and an agent cannot add to it.
7
- # agent-rights.sh is in it, otherwise an agent could empty the list.
8
- RIGHTS_FILES=(
9
- .devcontainer/opencode/agent.json
10
- .devcontainer/opencode.jsonc
11
- .repowarden.conf
12
- .devcontainer/agent-rights.sh
13
- )
14
-
15
- # Snapshot directory of a project's rights files, in the agent state.
16
- rights_dir() {
17
- echo "$AGENT_STATE/droits-$(basename "$1")"
18
- }
19
-
20
- # At launch: copies each rights file (or notes its absence) and the starting HEAD,
21
- # then clears the alert of the previous session on this project.
22
- rights_snapshot() {
23
- local d f
24
- d="$(rights_dir "$1")"
25
- rm -rf "$d" "$d.alerte"
26
- mkdir -p "$d/fichiers"
27
- : >"$d/absents"
28
- for f in "${RIGHTS_FILES[@]}"; do
29
- if [ -f "$1/$f" ]; then
30
- mkdir -p "$d/fichiers/$(dirname "$f")"
31
- cp -p "$1/$f" "$d/fichiers/$f"
32
- else
33
- echo "$f" >>"$d/absents"
34
- fi
35
- done
36
- git -C "$1" rev-parse HEAD >"$d/head" 2>/dev/null || : >"$d/head"
37
- }
38
-
39
- # Restores a rights file to its snapshot (removed when it did not exist).
40
- rights_restore() {
41
- local d f
42
- d="$(rights_dir "$1")"
43
- f="$2"
44
- if grep -qxF "$f" "$d/absents"; then
45
- rm -f "$1/$f"
46
- else
47
- mkdir -p "$(dirname "$1/$f")"
48
- cp -p "$d/fichiers/$f" "$1/$f"
49
- fi
50
- }
51
-
52
- # After each opencode session: restores the modified files in the tree, reports in
53
- # the journal any commit that touches them (history is never rewritten), raises the alert.
54
- rights_verify() {
55
- local d f depart sha message
56
- d="$(rights_dir "$1")"
57
- [ -d "$d" ] || return 0
58
- depart="$(cat "$d/head" 2>/dev/null || true)"
59
- for f in "${RIGHTS_FILES[@]}"; do
60
- message=""
61
- if grep -qxF "$f" "$d/absents"; then
62
- if [ -e "$1/$f" ]; then message="change reverted"; fi
63
- elif ! cmp -s "$d/fichiers/$f" "$1/$f"; then
64
- message="change reverted"
65
- fi
66
- sha=""
67
- if [ -n "$depart" ]; then
68
- if [ -n "$(git -C "$1" diff --name-only "$depart" HEAD -- "$f" 2>/dev/null)" ]; then
69
- sha="$(git -C "$1" log -1 --format=%h "$depart..HEAD" -- "$f" 2>/dev/null || true)"
70
- message="change reverted in the tree, committed in ${sha:-HEAD}: remove this commit before any push"
71
- fi
72
- fi
73
- [ -n "$message" ] || continue
74
- rights_restore "$1" "$f"
75
- echo "=== ⚠ rights changed: $f : $message" >>"$AGENT_JOURNAL"
76
- echo "$f" >>"$d.alerte"
77
- done
78
- return 0
79
- }
80
-
81
- # For devzone agent state: one line per project whose rights were changed.
82
- rights_alerts() {
83
- local f
84
- for f in "$AGENT_STATE"/droits-*.alerte; do
85
- [ -e "$f" ] || continue
86
- f="${f##*/droits-}"
87
- echo " ⚠ rights changed (${f%.alerte}): see the journal"
88
- done
89
- }
@@ -1,95 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Why: this script installs the devzone tools in the workspace pod (#503).
3
- # Each step logs one "devzone init:" line, and a failure never stops the next
4
- # step. No Docker socket is used and no kubeconfig is fabricated.
5
- set -uo pipefail
6
-
7
- # A crash must not leave a multi-gigabyte core file in a worktree (#961).
8
- ulimit -c 0 2>/dev/null || true
9
-
10
- HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
11
- VERSIONS_ENV="$HERE/versions.env"
12
- PROMPT_START="# >>> devzone prompt >>>"
13
-
14
- log() {
15
- echo "devzone init: $*"
16
- }
17
-
18
- init_safe_directory() {
19
- local current
20
- current="$(git config --global --get-all safe.directory 2>/dev/null || true)"
21
- if printf '%s\n' "$current" | grep -qxF '/workspaces/projets/*'; then
22
- log "safe.directory /workspaces/projets/* already set"
23
- return 0
24
- fi
25
- if git config --global --add safe.directory '/workspaces/projets/*' 2>/dev/null; then
26
- log "safe.directory /workspaces/projets/* added"
27
- else
28
- log "safe.directory: failed"
29
- fi
30
- }
31
-
32
- init_repowarden() {
33
- local installed
34
- if [ ! -f "$VERSIONS_ENV" ]; then
35
- log "repowarden: $VERSIONS_ENV missing"
36
- return 0
37
- fi
38
- # shellcheck source=SCRIPTDIR/versions.env
39
- . "$VERSIONS_ENV"
40
- installed="$(repowarden --version 2>/dev/null || true)"
41
- if [ "$installed" = "${REPOWARDEN_VERSION:-}" ]; then
42
- log "repowarden $installed already installed"
43
- elif npm install -g "repowarden@${REPOWARDEN_VERSION:-}" 2>&1; then
44
- log "repowarden ${REPOWARDEN_VERSION:-} installed"
45
- else
46
- log "repowarden: npm install failed"
47
- fi
48
- if repowarden install --global --lang fr 2>&1; then
49
- log "repowarden global hooks installed"
50
- else
51
- log "repowarden: install --global failed"
52
- fi
53
- }
54
-
55
- init_modules() {
56
- if devzone apply 2>&1; then
57
- log "modules applied"
58
- else
59
- log "modules incomplete"
60
- fi
61
- }
62
-
63
- init_prompt() {
64
- local bashrc="$HOME/.bashrc"
65
- if ! touch "$bashrc" 2>/dev/null; then
66
- log "prompt: cannot write $bashrc"
67
- return 0
68
- fi
69
- # Blocks written before the Go prompt sourced a shell library that no longer
70
- # exists: drop them, the new block below takes over (migration, idempotent)
71
- if grep -qE 'invite-kube\.sh|kube-prompt\.sh' "$bashrc" 2>/dev/null; then
72
- sed -i -e '/devzone prompt >>>/d' -e '/devzone prompt <</d' \
73
- -e '/invite-kube\.sh/d' -e '/kube-prompt\.sh/d' \
74
- -e '/devzone_invite_kube/d' -e '/devzone_kube_prompt/d' "$bashrc"
75
- log "prompt block migrated to the Go command"
76
- fi
77
- if grep -qF "$PROMPT_START" "$bashrc" 2>/dev/null; then
78
- log "prompt block already present"
79
- return 0
80
- fi
81
- cat >>"$bashrc" <<'PROMPT'
82
- # >>> devzone prompt >>>
83
- # Interactive shells in the pod must not write core files either (#961).
84
- ulimit -c 0 2>/dev/null || true
85
- PS1='$(devzone kube prompt) '"$PS1"
86
- # <<< devzone prompt <<<
87
- PROMPT
88
- log "prompt block added to $bashrc"
89
- }
90
-
91
- init_safe_directory
92
- init_repowarden
93
- init_modules
94
- init_prompt
95
- log "done"