feat(run): garde-fou quand un projet n'est pas câblé pour Albert (T7.7, AC-R040)#15
Merged
Merged
Conversation
…7, AC-R040) `albert-code run` dans un dossier sans opencode.json (jamais setup), ou avec un opencode.json sans provider albert, ouvrait OpenCode sur ses modeles par defaut -- Albert absent de /models, sans aucune alerte. 2 beta-testeurs pieges (dont un power user), longue session de debug a chaque fois. - phase_run : garde-fou en tete. Si ./opencode.json absent ou sans "albert", avertit clairement (fais `albert-code setup` ici) et demande confirmation avant de lancer sans Albert (dry-run/non-interactif : n'ouvre pas). - scaffold_opencode_json : si opencode.json existe sans "albert", ne dit plus juste "conserve" -- signale qu'Albert n'est pas cable (absorbe T1.6). Detection sur fichier (grep -q '"albert"' ./opencode.json), pas de pipe donc pas de course SIGPIPE (cf. T7.6). Tests : TESTS.md S44 (garde-fou run) + S45 (avertissement setup, ex-T1.6/S22).
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problème
albert-code rundans un dossier sansopencode.json(jamaissetup) — ou avec unopencode.jsonsans provideralbert— ouvre OpenCode sur ses modèles par défaut : Albert absent de/models, sans aucune alerte.Footgun silencieux confirmé sur 2 bêta-testeurs (dont un power user avec ~34 VMs), chacun suivi d'une longue session de debug pour une cause banale :
runlancé avantsetup.Correctif (généralise T1.6)
1. Garde-fou au
run(phase_run, tout début)Si
./opencode.jsonest absent ou ne contient pas"albert": avertissement clair (« projet non configuré pour Albert → faisalbert-code setupici ») + confirmation avant de lancer sans Albert. En dry-run / non-interactif,confirmrépond non → on n'ouvre pas OpenCode sans config.2. Avertissement au
setup(scaffold_opencode_json, fichier existant)Si
./opencode.jsonexiste sans"albert", on ne dit plus juste « conservé » : on signale qu'Albert n'est pas câblé et on pointe le blocprovider "albert"à ajouter. → absorbe le ticket T1.6.Détail technique
Détection sur fichier :
grep -q '"albert"' ./opencode.json. Pas delimactl | grep, donc pas de course SIGPIPE (leçon de T7.6). Non-destructif : aucun fichier écrasé.Logique validée sur 3 cas :
opencode.jsonopencode.jsonsansalbertopencode.jsonavecalbertTests
TESTS.mdS44 — garde-fou aurun(3 sous-cas).TESTS.mdS45 — avertissement ausetup(ex-T1.6/S22).Portée
lib/phases.sh(2 points :phase_run,scaffold_opencode_json) + doc (BACKLOG T7.7, FEEDBACK AC-R040, TESTS S44/S45).vendor/vm/non touché.