Initial state: - ia_dev was historically referenced as ./ia_dev in docs and integrations, while the vendored module lives under services/ia_dev. - AnythingLLM sync and hook installation had error masking / weak exit signaling. - Proxy layers did not validate proxy path segments, allowing path normalization tricks. Motivation: - Make the IDE-oriented workflow usable (sync -> act -> deploy/preview) with explicit errors. - Reduce security footguns in proxying and script automation. Resolution: - Standardize IA_DEV_ROOT usage and documentation to services/ia_dev. - Add SSH remote data mirroring + optional AnythingLLM ingestion. - Extend AnythingLLM pull sync to support upload-all/prefix and fail on upload errors. - Harden smart-ide-sso-gateway and smart-ide-global-api proxying with safe-path checks and non-leaking error responses. - Improve ia-dev-gateway runner validation and reduce sensitive path leakage. - Add site scaffold tool (Vite/React) with OIDC + chat via sso-gateway -> orchestrator. Root cause: - Historical layout changes (submodule -> vendored tree) and missing central contracts for path resolution. - Missing validation for proxy path traversal patterns. - Overuse of silent fallbacks (|| true, exit 0 on partial failures) in automation scripts. Impacted features: - Project sync: git pull + AnythingLLM sync + remote data mirror ingestion. - Site frontends: SSO gateway proxy and orchestrator intents (rag.query, chat.local). - Agent execution: ia-dev-gateway script runner and SSE output. Code modified: - scripts/remote-data-ssh-sync.sh - scripts/anythingllm-pull-sync/sync.mjs - scripts/install-anythingllm-post-merge-hook.sh - cron/git-pull-project-clones.sh - services/smart-ide-sso-gateway/src/server.ts - services/smart-ide-global-api/src/server.ts - services/smart-ide-orchestrator/src/server.ts - services/ia-dev-gateway/src/server.ts - services/ia_dev/tools/site-generate.sh Documentation modified: - docs/** (architecture, API docs, ia_dev module + integration, scripts) Configurations modified: - config/services.local.env.example - services/*/.env.example Files in deploy modified: - services/ia_dev/deploy/* Files in logs impacted: - logs/ia_dev.log (runtime only) - .logs/* (runtime only) Databases and other sources modified: - None Off-project modifications: - None Files in .smartIde modified: - .smartIde/agents/*.md - services/ia_dev/.smartIde/** Files in .secrets modified: - None New patch version in VERSION: - 0.0.5 CHANGELOG.md updated: - yes
5.9 KiB
Configurations projet (projects/<id>/)
Ce répertoire, à la racine du monorepo smart_ide, ne contient que les fichiers de configuration attendus par ia_dev (conf.json par identifiant de projet). Ce n’est pas le répertoire des clones Git des applications.
Les sous-répertoires projects/<id>/ non listés dans le .gitignore à la racine (exceptions pour les ids versionnés) restent ignorés par Git : pour versionner un nouvel id, ajouter les lignes !projects/<id>/ et !projects/<id>/** à côté des exceptions existantes.
Clones applicatifs (docv, stacks métier, etc.)
Les dépôts sources des produits (ex. backend docv sous un chemin du type …/enso/docv, autres apps) doivent vivre ailleurs, selon la convention du poste — typiquement un répertoire frère du monorepo, par ex. ../projects/<nom>/ (relatif à la racine smart_ide), distinct de ./projects/ ici.
./projects/→ un seul fichier de configuration par id :projects/<id>/conf.json(y compris le gabaritprojects/example/conf.json). Pas de fichier.code-workspaceversionné à côté : l’équivalent multi-root IDE estsmart_ide.workspacedans ce mêmeconf.json.ia_devrésout via le lien symbolique décrit dans ia_dev-module.md.../projects/(ou autre racine configurée) → arborescences Git complètes, builds, etc. ; dans chaqueconf.json,project_pathet les cheminsdeploy.*utiles sont relatifs à la racine du monorepo smart_ide (ex.../enso,.) ou absolus ; le scriptcron/git-pull-project-clones.shet ia_dev les résolvent depuis cette racine (IA_DEV_ROOT/lib/conf_path_resolve.sh).
smart_ide
- Fichier :
projects/smart_ide/conf.json - Après clone ou réorganisation des dossiers :
./scripts/ensure-ia-dev-project-link.sh smart_ide(ou le wrapperscripts/ensure-ia-dev-smart-ide-project-link.sh) pour recréer le lien sousIA_DEV_ROOT/projects/smart_ide(ex.services/ia_dev/projects/smart_ide) →../../projects/smart_ide(chemin relatif variant selonIA_DEV_ROOT).
enso
- Fichier :
projects/enso/conf.json— clone enso frère du monorepo (project_pathtypique../enso), déploiementdeploy/scripts_v2, forge 4nk/enso (wiki / issues), mails ticketingAI.ENSO.*@4nkweb.com. - Chemins absolus sur les serveurs sous
smart_ide.remote_data_access: alignés surENSO_REMOTE_ROOT,ENSO_SSH_HOSTetdata/dossiers-permanents(dépôt enso,enso-deploy.env). Valeurs réelles : fichiersenso-deploy.envnon versionnés. - Cron fragment :
cron/fragments/enso.cron - Pour
ia_dev: lien symboliqueIA_DEV_ROOT/projects/enso→../../projects/enso(recréer avec./scripts/ensure-ia-dev-project-link.sh enso; chemin relatif variant selonIA_DEV_ROOT).
builazoo
- Fichier :
projects/builazoo/conf.json— dépôt frère du monorepo (project_pathtypique../builazoo), forge 4nk/builazoo (wiki / issues à ajuster si le dépôt diffère), mails ticketingAI.BUILAZOO.*@4nkweb.com. smart_ide.remote_data_access: alias SSHbuilazoo-test/builazoo-pprod/builazoo-prod(à déclarer dans~/.ssh/configcomme pour les autres ids).- Multi-root IDE :
smart_ide.workspacedansconf.json(dossiers +smartIde.activeProjectId). - Cron fragment :
cron/fragments/builazoo.cron - Pour
ia_dev:./scripts/ensure-ia-dev-project-link.sh builazoo - Le répertoire
builazoo/à la racine du monorepo est partiellement ignoré par Git (saufbuilazoo/README.md) : y placer le clone ou les sources.
Synchronisation Git planifiée
Pour chaque projects/<id>/conf.json, le tirage automatique utilise cron/config.env (PULL_SYNC_*) et cron/git-pull-wrapper.sh → cron/git-pull-project-clones.sh.
- Timer systemd utilisateur (recommandé) :
scripts/install-git-pull-systemd-user.sh— voir cron-git-pull.md - Désactiver pour un id :
"cron": { "git_pull": false }dans leconf.json - Désactiver tout :
PULL_SYNC_ENABLED=0dansconfig.envouconfig.local.env
project_path est résolu en chemin absolu à partir de la racine smart_ide lorsqu’il est relatif.
Données déployées, SSH, AnythingLLM et IDE
Spécification : features/remote-deployed-data-ssh.md.
Bloc optionnel smart_ide dans conf.json
Clé smart_ide avec notamment remote_data_access, anythingllm_workspace_slug, workspace (équivalent .code-workspace : folders + settings.smartIde.activeProjectId), preview_urls (ex. test : URL du déploiement test pour Carbonyl). Exemple : projects/enso/conf.json.
Projet actif pour l’éditeur / Cursor
- Copier
projects/active-project.json.exampleversprojects/active-project.json(non versionné) ; renseignerid, optionnellementdefault_env,notes. - Pour ouvrir un workspace multi-dossiers dans VS Code / Cursor : lire
smart_ide.workspacedansprojects/<id>/conf.json(même schéma qu’un fichier.code-workspace) — copier ce bloc dans un fichier local.code-workspacesi l’éditeur l’exige, ou configurer les dossiers à la main.
Nouveau projet : partir de projects/example/conf.json → projects/<nouvel_id>/conf.json.
Convention agents : .smartIde/rules/smart-ide-ia-dev-bridge.mdc.
Référence amont (schéma conf)
Schéma détaillé des champs conf.json : ia-dev-project-conf-schema.md (aligné sur IA_DEV_ROOT/projects/README.md amont). Extensions cron et smart_ide : spécifiques smart_ide ; ia_dev peut ignorer les champs non lus.