bots-garden/sidekickspublic Fork
⑂ v1.1.0
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/sidekicks.git
git clone ssh://git@rickub.com/bots-garden/sidekicks.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
🛟 Updated. d580a32 · on v1.1.0 · k33g · 3d ago
0028-abstraire-le-workspace-local-sandbox-sbx-contain.yaml · 112 lines · 4.4 KBYAML Blame HistoryRaw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Managed by IssueSpec. Hand edits are welcome; keep the schema valid.
id: 28
title: "Abstraire le workspace : local, sandbox sbx, container"
state: closed
author:
  name: k33g
  email: ph.charriere@gmail.com
createdAt: 2026-10-29T07:20:26.000Z
updatedAt: 2026-10-29T18:17:05.000Z
labels:
  - "kind::feature"
  - "area::workspace"
  - "priority::high"
  - "size::L"
milestone: "M4 · Workspace des agents"
epic: "Workspace des agents"
related:
  - 4
body: |
  ## Contexte
  Draft [#1 — draft](.tickets/issues/0001-draft.yaml) : l'agent peut tourner en local, dans une **sandbox Docker sbx** ou dans un **container**. Le treeview et le terminal doivent alors accéder au workspace *là où il est*.

  ## Pourquoi une abstraction
  Sans elle, chaque feature (treeview, éditeur, terminal) devrait gérer les 3 cas. Une interface unique isole cette complexité :
  ```go
  type Workspace interface {
      List(path string) ([]Entry, error)
      Read(path string) ([]byte, error)
      Write(path string, data []byte) error
      Remove(path string) error
      Watch(path string) (<-chan Event, error)
      Exec(ctx context.Context, cmd []string, tty bool) (Process, error)
  }
  ```
  Implémentations : `local` (os + PTY), `container` (`docker exec`, `docker cp` ou montage), `sbx` (commande sbx équivalente — **à vérifier** : exec et accès fichiers).

  ## Critères d'acceptation
  - [ ] Les 3 implémentations passent la même suite de tests de contrat.
  - [ ] Le type de runtime est déclaré dans la config ([#4 — Spécifier le format du fichier de configuration YAML](.tickets/issues/0004-specifier-le-format-du-fichier-de-configuration.yaml)).
tasks:
  - id: 1
    title: "Définir l'interface Workspace"
    state: closed
    priority: high
    author:
      name: k33g
      email: ph.charriere@gmail.com
    createdAt: 2026-10-29T07:20:26.000Z
    updatedAt: 2026-10-29T18:17:05.000Z
    closedAt: 2026-10-29T18:17:05.000Z
  - id: 2
    title: "Implémentation locale"
    state: closed
    priority: high
    author:
      name: k33g
      email: ph.charriere@gmail.com
    createdAt: 2026-10-29T07:20:26.000Z
    updatedAt: 2026-10-29T18:17:05.000Z
    closedAt: 2026-10-29T18:17:05.000Z
  - id: 3
    title: "Implémentation container (docker exec / cp)"
    state: closed
    priority: medium
    author:
      name: k33g
      email: ph.charriere@gmail.com
    createdAt: 2026-10-29T07:20:26.000Z
    updatedAt: 2026-10-29T18:17:05.000Z
    closedAt: 2026-10-29T18:17:05.000Z
  - id: 4
    title: "Investiguer l'accès shell et fichiers d'une sandbox sbx"
    state: closed
    priority: high
    author:
      name: k33g
      email: ph.charriere@gmail.com
    createdAt: 2026-10-29T07:20:26.000Z
    updatedAt: 2026-10-29T18:17:05.000Z
    closedAt: 2026-10-29T18:17:05.000Z
  - id: 5
    title: "Implémentation sbx"
    state: closed
    priority: medium
    author:
      name: k33g
      email: ph.charriere@gmail.com
    createdAt: 2026-10-29T07:20:26.000Z
    updatedAt: 2026-10-29T18:17:05.000Z
    closedAt: 2026-10-29T18:17:05.000Z
  - id: 6
    title: "Suite de tests de contrat"
    state: closed
    priority: medium
    author:
      name: k33g
      email: ph.charriere@gmail.com
    createdAt: 2026-10-29T07:20:26.000Z
    updatedAt: 2026-10-29T18:17:05.000Z
    closedAt: 2026-10-29T18:17:05.000Z
comments:
  - id: 1
    author:
      name: k33g
      email: ph.charriere@gmail.com
    createdAt: 2026-10-29T18:17:05.000Z
    body: |
      ## Résultat

      `internal/workspace` : interface `Workspace` (`Location`, `List`, `Read`, `Write`, `Remove`, `Changes`, `Shell`), chemins relatifs au dossier et refus de tout chemin qui en sort (`..`, absolu, lien symbolique). Implémentations **locale** (os, fsnotify, creack/pty) et **conteneur** (`docker exec` + commandes POSIX que busybox comprend). La même suite de tests de contrat tourne sur un dossier temporaire et dans un vrai conteneur `alpine:3.22` (ignorée sans Docker ou sans l'image). `workspacePath` vaut par défaut `workspace`.

      **sbx : déplacé vers #39** (choix du propriétaire) — `sbx` n'est pas disponible là où Sidekicks est développé ; plutôt que du code non testé, la vue indique « not supported yet ». Les tâches « Investiguer l'accès… sbx » et « Implémentation sbx » sont reprises par [#39 — Workspace et terminal pour les sandboxes sbx](.tickets/issues/0039-workspace-et-terminal-pour-les-sandboxes-sbx.yaml). Décisions : [ADR 0007](docs/adr/0007-agent-workspaces.md).