smart_ide/docs/README.md
Nicolas Cantu 58cc2493e5 chore: consolidate ia_dev module, sync tooling, and harden gateways (0.0.5)
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
2026-04-04 18:36:43 +02:00

113 lines
8.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Documentation technique — smart_ide
Index principal. Les **fonctionnalités** détaillées sont dans [`features/`](./features/). La **documentation opérationnelle** regroupée (anciens `README.md` à la racine et sous `cron/`, `projects/`, `services/`, etc.) est dans **[`repo/`](./repo/)**.
## Configuration locale agrégée
| Fichier | Rôle |
|---------|------|
| [config/services.local.env.example](../config/services.local.env.example) | Ports, jetons, `SMART_IDE_MONOREPO_ROOT` — copier vers `config/services.local.env` |
| [config/README.md](../config/README.md) | Rôle du répertoire `config/` |
| [packages/smart-ide-upstreams/README.md](../packages/smart-ide-upstreams/README.md) | Clés damont HTTP partagées (`@4nk/smart-ide-upstreams`) pour lAPI globale et le SSO |
## Documentation du dépôt (`repo/`)
Vue densemble et index complet : **[repo/README.md](./repo/README.md)**. Règles/agents IDE : **[repo/smartide-config-directory.md](./repo/smartide-config-directory.md)**.
| Document | Contenu |
|----------|---------|
| [repo/smart-ide-overview.md](./repo/smart-ide-overview.md) | Vision produit, stack, liens architecture |
| [repo/projects-directory.md](./repo/projects-directory.md) | `projects/<id>/conf.json`, clones, `active-project.json` |
| [repo/cron-git-pull.md](./repo/cron-git-pull.md) | Pull planifié, `cron/config.env`, systemd user |
| [repo/systemd-units.md](./repo/systemd-units.md) | Ollama, AnythingLLM, timer git-pull |
| [repo/logs-directory.md](./repo/logs-directory.md) | Fichiers journaux locaux sous `logs/` |
| [repo/docv-services-directory.md](./repo/docv-services-directory.md) | Répertoire `services/docv/`, contrat intégration |
| [repo/docv-enso-docs-mirror.md](./repo/docv-enso-docs-mirror.md) | Miroir `services/docv/enso-docs/` |
| [repo/ia-dev-smart-ide-integration.md](./repo/ia-dev-smart-ide-integration.md) | Module `ia_dev` dans smart_ide |
| [repo/ia-dev-repository-overview.md](./repo/ia-dev-repository-overview.md) | Dépôt ia_dev : agents, deploy |
| [repo/ia-dev-project-conf-schema.md](./repo/ia-dev-project-conf-schema.md) | Schéma `conf.json`, résolution projet |
| [repo/ia-dev-deploy-lib.md](./repo/ia-dev-deploy-lib.md) | `IA_DEV_ROOT/deploy/lib/` |
| [repo/ia-dev-shared-lib.md](./repo/ia-dev-shared-lib.md) | `IA_DEV_ROOT/lib/project_config.sh` |
| [repo/service-*.md](./repo/README.md) | Exploitation de chaque micro-service (voir index `repo/README`) |
| [repo/script-anythingllm-pull-sync.md](./repo/script-anythingllm-pull-sync.md) | Hook post-merge → AnythingLLM |
| [repo/service-anythingllm-devtools.md](./repo/service-anythingllm-devtools.md) | Service HTTP AnythingLLM + devtools |
| [repo/service-carbonyl.md](./repo/service-carbonyl.md) | Carbonyl (navigateur terminal), prévisualisation test |
| [repo/service-pageindex.md](./repo/service-pageindex.md) | PageIndex (index vectorless, définition sémantique documents) |
| [repo/service-smart-ide-tools-bridge.md](./repo/service-smart-ide-tools-bridge.md) | Pont HTTP IDE + sous-modules CLI |
| [repo/service-smart-ide-global-api.md](./repo/service-smart-ide-global-api.md) | API HTTP interne : proxy vers micro-services (jetons techniques) |
| [repo/service-smart-ide-sso-gateway.md](./repo/service-smart-ide-sso-gateway.md) | Passerelle OIDC utilisateur → API globale → micro-services |
| [repo/service-chandra.md](./repo/service-chandra.md) | Chandra OCR (PDF / images structurés) |
| [repo/extension-anythingllm-workspaces.md](./repo/extension-anythingllm-workspaces.md) | Extension AnythingLLM IDE (supprimée ; voir anythingllm-devtools) |
Les fichiers **`README.md`** sous `services/*/`, `cron/`, `projects/`, etc. ne font que **renvoyer** vers ces pages.
## Architecture et déploiement
| Document | Contenu |
|----------|---------|
| [services-functional-scope.md](./services-functional-scope.md) | Périmètre fonctionnel des services, rôle **IDE** vs **backends applicatifs** |
| [platform-target.md](./platform-target.md) | Vision plateforme en ligne, 3 envs, machine IA unique vs SSH, SSO, navigateur optionnel |
| [implementation-rollout.md](./implementation-rollout.md) | Déroulé du plan plateforme : doc + code minimal, suites |
| [system-architecture.md](./system-architecture.md) | Couches, monorepo, cartographie des dossiers, gateway, OpenShell, micro-services |
| [ecosystem-architecture-and-sync.md](./ecosystem-architecture-and-sync.md) | smart_ide, projets développés, API IA, Ollama / AnythingLLM / Git ; automation et synchro |
| [core-ide.md](./core-ide.md) | Socle applicatif Lapce : `core_ide/`, clone amont, build |
| [deployment-target.md](./deployment-target.md) | Client Linux + SSH, variante machine IA unique, serveur socle IA et repos |
| [infrastructure.md](./infrastructure.md) | SSH, accès hôte, renvois vers les scripts |
| [services.md](./services.md) | Ollama, AnythingLLM, **Local Office**, micro-services HTTP ; renvoie vers la vue fonctionnelle détaillée |
## Référence API des services (`API/`)
| Document | Contenu |
|----------|---------|
| [API/README.md](./API/README.md) | Index : auth, ports, liens vers chaque service |
| [API/repos-devtools-server.md](./API/repos-devtools-server.md) | Clone / liste / load de dépôts Git |
| [API/langextract-api.md](./API/langextract-api.md) | Extraction structurée (LangExtract) |
| [API/claw-harness-proxy.md](./API/claw-harness-proxy.md) | Proxy HTTP vers serveur claw-code |
| [API/agent-regex-search-api.md](./API/agent-regex-search-api.md) | Recherche regex fichiers (ripgrep) |
| [API/local-office.md](./API/local-office.md) | Documents Office (upload, commandes docx) |
| [API/ia-dev-gateway.md](./API/ia-dev-gateway.md) | Gateway `ia_dev` — agents, runs, SSE (spécification) |
| [API/orchestrator.md](./API/orchestrator.md) | Orchestrateur intentions — routage (spécification) |
## Workspaces et IDE
| Document | Contenu |
|----------|---------|
| [anythingllm-workspaces.md](./anythingllm-workspaces.md) | Un workspace AnythingLLM par projet, synchronisation |
| [features/carbonyl-terminal-browser.md](./features/carbonyl-terminal-browser.md) | Carbonyl, URL test dans `conf.json` |
| [features/pageindex-semantic-documents.md](./features/pageindex-semantic-documents.md) | PageIndex, arbre sémantique PDF / Markdown |
| [features/chandra-ocr-documents.md](./features/chandra-ocr-documents.md) | Chandra OCR, mise en page |
| [ux-navigation-model.md](./ux-navigation-model.md) | Intentions, recherche, mode expert |
## Intégration dépôts
| Document | Contenu |
|----------|---------|
| [ia_dev-module.md](./ia_dev-module.md) | Module `ia_dev` dans le dépôt, agents ; confs dans `projects/<id>/` |
| [ia_dev-project-smart_ide.md](./ia_dev-project-smart_ide.md) | Projet Cursor / conf `smart_ide` |
| [repo/logs-directory.md](./repo/logs-directory.md) | Journaux : pull planifié, `ia_dev` |
| [repo/ia-dev-smart-ide-integration.md](./repo/ia-dev-smart-ide-integration.md) | Contrat intégration `services/ia_dev/` |
## Données déployées et SSH
| Document | Contenu |
|----------|---------|
| [features/remote-deployed-data-ssh.md](./features/remote-deployed-data-ssh.md) | Données hors Git sur test/pprod/prod ; SSH ; bloc `smart_ide` dans `conf.json` ; `active-project.json` |
## Fonctionnalités (`features/`)
| Document | Contenu |
|----------|---------|
| [features/local-office.md](./features/local-office.md) | **Local Office** — API REST Office dans `services/local-office/` |
| [features/langextract-api.md](./features/langextract-api.md) | API locale LangExtract |
| [features/claw-harness-api.md](./features/claw-harness-api.md) | Harnais claw-code, proxy |
| [features/agent-regex-search-api.md](./features/agent-regex-search-api.md) | Recherche regex code (ripgrep) |
| [features/anythingllm-pull-sync-after-pull.md](./features/anythingllm-pull-sync-after-pull.md) | Synchro AnythingLLM après pull |
| [features/initial-rag-sync-4nkaiignore.md](./features/initial-rag-sync-4nkaiignore.md) | RAG initial et `.4nkaiignore` |
| [features/ia-dev-service.md](./features/ia-dev-service.md) | Service `ia-dev-gateway`, fork `ia_dev`, migration |
| [features/orchestrator-api.md](./features/orchestrator-api.md) | Contrat HTTP orchestrateur (Ollama, ALLM, services) |
| [features/lapce-porting-roadmap.md](./features/lapce-porting-roadmap.md) | Phases portage surface AnythingLLM → Lapce (service HTTP + UI) |
| [features/sso-docv-enso.md](./features/sso-docv-enso.md) | OIDC front ↔ docv (Enso) |
| [features/docv-ai-integration.md](./features/docv-ai-integration.md) | Backend docv : API IA smart_ide, clones `../projects/`, AnythingLLM |
| [features/docv-service-integration.md](./features/docv-service-integration.md) | docv gestion documentaire, `../projects/<id>/data`, `DOCV_PROJECTS_ROOT`, multi-hôte |
| [features/browser-automation-criteria.md](./features/browser-automation-criteria.md) | Critères service navigateur optionnel |