Commit Graph

303 Commits

Author SHA1 Message Date
Ubuntu 182a9525e7 fix(frontend): persist upload requirement to sessionStorage; friendly error when files lost on refresh
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:57:20 +00:00
Ubuntu 75533e9319 fix(simulation): guarantee SQLite connection close with finally block 2026-04-26 14:56:52 +00:00
Ubuntu 117eabf607 feat(recovery): persist active_task_id to project.json for browser-refresh reconnection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:54:44 +00:00
Ubuntu 656a3d7d5c fix(graph): cap get_all_edges to 5000 edges to prevent unbounded RAM growth 2026-04-26 14:50:21 +00:00
Ubuntu d09ee23cd3 feat: ontology import, project recovery, graphiti improvements, and docs
- Add ontology import from file (Step 1)
- Persist active task_id to project.json for browser-refresh recovery
- Add project list endpoint and frontend recovery UI
- Improve Graphiti backend stability and oasis profile generation
- Add TechnicalDesign.md and enterprise roadmap spec
- Update .gitignore to exclude secrets and local-only docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 14:28:14 +00:00
Ubuntu f854a0de12 chore(report): remove unused getReportDownloadUrl helper 2026-04-26 00:29:08 +00:00
Ubuntu b78c3721f2 fix(report): use Axios blob for authenticated downloads; remove dead closeDownloadMenu
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 00:26:19 +00:00
Ubuntu 0235bd51e8 feat(report): add MD/PDF download dropdown button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 00:14:09 +00:00
Ubuntu 7cd876bfbe feat(report): add getReportDownloadUrl helper
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 00:14:04 +00:00
Ubuntu 7daf8566ed fix(report): eliminate temp file leak in MD fallback; simplify invalid-format test 2026-04-26 00:11:40 +00:00
Ubuntu 8efedb55e5 feat(report): add PDF download endpoint via PyMuPDF
Adds ?format=md|pdf query param to GET /api/report/<id>/download.
PDF is generated from Markdown via fitz.Story (PyMuPDF). Also fixes
create_app() to support dict config and skip JWT auth in TESTING mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-26 00:07:09 +00:00
Ubuntu 0c732db90f chore(deps): add markdown>=3.6 for PDF generation 2026-04-25 23:57:46 +00:00
Ubuntu 364b6078e2 fix(deps): pin graphiti-core==0.28.2, override neo4j>=5.26.0
graphiti-core 0.28.2 has _extract_entity_attributes required by the
monkey-patch in GraphitiBackend. Override neo4j to resolve conflict
with camel-oasis==0.2.5 which pins neo4j==5.23.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 23:20:25 +00:00
Ubuntu fb280011b7 fix(azure): add GRAPH_BACKEND, NEO4J, LLM_EMBED, LLM_SMALL to config and bicep
All variables now flow from config.sh through 2-build-deploy.sh to the
container env, so GRAPH_BACKEND=graphiti is honoured at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 22:42:58 +00:00
Ubuntu a209330b0b debug: log GRAPH_BACKEND and key presence at graph build start
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 22:18:26 +00:00
Ubuntu 058d260552 fix(azure): restore config.sh sourcing in deploy scripts; add --no-cache support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 21:54:57 +00:00
Ubuntu 6e4e5c40dd chore: resolve .env.example merge conflict; keep feat/pluggable-graph-backend version
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 21:11:06 +00:00
Ubuntu 09935e53a0 refactor(graph): remove hardcoded ZEP checks, use get_graph_config_errors; add embed/small LLM env docs
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 21:10:40 +00:00
Ubuntu c074136a87 fix(llm): centralise Azure URL normalisation in parse_azure_url utility
Extract parse_azure_url from graphiti_backend into utils/llm_client so all
services (oasis_profile_generator, simulation_config_generator, graphiti_backend,
LLMClient) strip the /chat/completions suffix and api-version before passing
base_url to the OpenAI SDK, fixing 404 errors when the full Azure endpoint URL
is set in LLM_BASE_URL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 21:09:48 +00:00
Ubuntu e7ebcdff75 fix(graphiti): patch _extract_entity_attributes to flatten nested attr dicts
The previous fix applied _flatten_attributes too broadly, breaking graphiti's
internal ExtractedEntities validation (lists were converted to strings).

Instead, monkey-patch only _extract_entity_attributes — the exact function
that returns entity attribute dicts to node.attributes before Neo4j write.
Lists of primitives are preserved; only dict-valued attributes are flattened.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 20:24:08 +00:00
Ubuntu 6bce05dca2 fix(graphiti): flatten nested attribute dicts before Neo4j write; hide summary from properties panel
Graphiti's attribute extraction LLM sometimes returns values wrapped in
nested dicts ({"value": "CTTI"}) instead of plain strings. Neo4j rejects
these with TypeError: "Property values can only be of primitive types".

Fix: after _AzureGenericClient gets the LLM response, validate it through
the Pydantic response_model and call _flatten_attributes() so every value
reaching Neo4j is a scalar. Also add _flatten_attributes() helper.

UI: exclude 'summary' from the Properties section of the node detail panel
since it already appears in the dedicated Summary section below.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 20:08:39 +00:00
Ubuntu ba9c8d1f42 feat(ontology): make entity/edge type limits configurable via env vars
Revert default limits back to 10 edges and 12 entities (10 specific + 2
fallback), matching Zep Cloud's maximum. Expose ONTOLOGY_MAX_ENTITY_TYPES
and ONTOLOGY_MAX_EDGE_TYPES in Config so operators can override without
touching code. Prompts now inject the live values at request time.
Also replace Chinese comments in .env.example with English equivalents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:56:44 +00:00
Ubuntu 0ce4d6c10e docs(env): update Gemini example model to gemini-3.1-flash-lite-preview
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:25:19 +00:00
Ubuntu dfabab5343 feat(graph): expand ontology to 20 types, pass attributes to Graphiti, add retry
- ontology_generator: increase entity limit to 20 (18 specific + 2 fallback),
  edge types to 20 (12-20 requested); bump max_tokens to 8192
- ontology_generator: fallback type names (Person/Organization) now resolved
  via i18n so Catalan gets Persona/Organització
- locales: add ontologyFallback* keys to en/zh/es/ca
- graph_builder: pass entity/edge attributes to non-Zep set_ontology (were discarded)
- graphiti_backend: _make_model builds real Pydantic fields per attribute
- graphiti_backend: _build_extraction_instructions includes per-entity attribute
  hints so the LLM knows which fields to extract
- graphiti_backend: add_batch retries up to 3x on "node not found" race condition
  with exponential backoff (2s, 4s) before propagating the error

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 19:19:28 +00:00
Ubuntu 3e270f2e16 docs: document graphiti+neo4j backend architecture and translate .env.example to English
- INSTALL.md: add section 3 covering the pluggable graph backend
  (architecture diagram, interface table, Zep vs Graphiti comparison,
  optional deps, env vars, Azure ACI deployment details, test instructions)
- .env.example: translate all Chinese comments to English; add
  GRAPH_BACKEND selector and Graphiti/Neo4j variables (commented out)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 15:32:18 +00:00
Ubuntu 4fceef609d feat(deploy): support GRAPH_BACKEND, NEO4J_* and LLM_PROVIDER in Azure deploy
- Dockerfile installs graphiti optional extras so any GRAPH_BACKEND works at runtime
- container-app.bicep adds graphBackend, neo4jUri/User/Password and llmProvider params
- 2-build-deploy.sh validates graph backend config and passes all new vars to Bicep
- config.sh.example documents new variables with inline guidance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 13:37:12 +00:00
Ubuntu d2ee1d3d5f docs(env): document GRAPH_BACKEND, Neo4j, and Gemini configuration
Add commented sections for the new pluggable graph backend and Gemini
LLM provider options so users know what variables are available.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 13:13:27 +00:00
Ubuntu 039de4ad8b feat(llm): auto-configure Google AI Studio URL when LLM_PROVIDER=gemini
When LLM_PROVIDER=gemini, LLMClient automatically uses the Google AI Studio
OpenAI-compatible endpoint instead of requiring manual base_url configuration.
An explicit base_url argument still takes precedence.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-25 13:13:11 +00:00
Ubuntu 788f9c29c9 feat(graph): add GraphitiBackend for Neo4j+graphiti-core local deployment 2026-04-25 13:10:56 +00:00
Ubuntu b2fd7e1b87 refactor(services): replace direct Zep SDK calls with GraphBackend interface 2026-04-25 13:09:59 +00:00
Ubuntu e073ef8716 feat(graph): add GraphBackendFactory singleton 2026-04-25 12:59:56 +00:00
Ubuntu 247ecc86ae feat(graph): add ZepBackend adapter implementing GraphBackend 2026-04-25 11:29:59 +00:00
Ubuntu 0544001fa0 feat(config): add GRAPH_BACKEND + NEO4J_* + LLM_PROVIDER config vars 2026-04-25 11:29:17 +00:00
Ubuntu a75b7cf75a feat(graph): add GraphBackend abstract interface 2026-04-25 11:11:06 +00:00
Ubuntu a6437df335 fix(i18n): translate hardcoded UI labels in Step1 ontology panel
Replace hardcoded English strings (GENERATED ENTITY TYPES, ATTRIBUTES,
EXAMPLES, etc.) and the Uploading message with i18n keys.
Add corresponding translations to all 4 locale files (ca/en/zh/es).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 23:45:57 +00:00
Ubuntu 7d172b9eec chore(i18n): replace all hardcoded Chinese strings with English in backend
Translate all Chinese comments, docstrings, log messages, error messages,
and LLM prompt text to English across the entire backend codebase.
Locale translation files (locales/*.json) are unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 23:40:58 +00:00
Ubuntu e3943c7d7c fix: regenerate uv.lock to include gunicorn
gunicorn was declared in pyproject.toml but missing from uv.lock,
so `uv sync --frozen` in the Dockerfile never installed it and the
container crashed with 'no such file or directory' on startup.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 21:50:44 +00:00
Ubuntu f9b5f79747 chore(azure): remove Log Analytics Workspace from infra
Simplifies infrastructure: ACR + Container Apps Environment only.
Log Analytics can be added later if observability is needed.
Update INSTALL.md accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 19:30:36 +00:00
Ubuntu cb04f26be7 docs: add INSTALL.md with local dev and Azure deployment guide
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 19:30:03 +00:00
Ubuntu ffe6c537d0 feat(azure): add infra + build/deploy scripts for Azure Container Apps
Split Bicep into infra.bicep (one-time: ACR + Log Analytics + Env) and
container-app.bicep (per-deploy: Container App with ACR auth).
Add 1-infra.sh and 2-build-deploy.sh shell scripts with config.sh.example
covering all .env variables. Gitignore azure/config.sh to prevent
secret leakage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 19:28:21 +00:00
Ubuntu b5c4d4a336 feat(auth): add JWT login screen, production Dockerfile and Azure Container App Bicep
- Backend: POST /api/auth/login endpoint (PyJWT HS256, 24h expiry)
  require_auth before_request middleware protecting all /api/* routes
  except /login and /health; wsgi.py entry point for gunicorn;
  Flask serves compiled Vue SPA in production
- Frontend: LoginView.vue (MiroFish dark aesthetic), auth.js reactive
  store, Axios Bearer token injection + 401 → /login redirect,
  Vue Router global guard protecting all routes
- i18n: login keys added to en/zh/es/ca locale files
- Dockerfile: multi-stage build (node:20-slim → python:3.11-slim +
  gunicorn), single port 5001
- Azure: container-app.bicep following CTTI guidelines — Log Analytics
  (NOR0016-C 90d retention), Container Apps Environment, all .env vars
  as env vars (secrets via secretRef, plain values inline)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 18:46:39 +00:00
Ubuntu 437e37febf chore: add .worktrees/ to .gitignore 2026-04-24 18:32:41 +00:00
Ubuntu 8a5ae9c923 feat(i18n): add Spanish (es) and Catalan (ca) locale support
- Add locales/es.json with 646 keys (neutral Spanish, based on upstream PR #510)
- Add locales/ca.json with 646 keys (standard Catalan, full translation)
- Add README-ES.md and README-CA.md with complete project documentation
- Update locales/languages.json with ca entry and llmInstruction
- Update README.md language switcher links

Both locales integrate automatically with the existing i18n architecture:
UI labels, progress messages, console logs, and LLM prompt instructions
all respect the user's selected language end-to-end.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 17:52:33 +00:00
666ghj fa0f6519b1 docs: rename README-EN.md to README.md as default English documentation 2026-04-02 16:52:29 +08:00
666ghj 0e9420e0f8 docs: rename README.md to README-ZH.md for Chinese documentation 2026-04-02 16:52:29 +08:00
BaiFu 7d07fb7f03
Merge pull request #440 from Ghostubborn/fix/security-deps
fix(security): 修复前端 3 个高危依赖漏洞
2026-04-02 15:17:46 +08:00
ghostubborn 223b283da7 fix(security): upgrade axios, rollup, picomatch to fix 3 high severity vulnerabilities 2026-04-02 15:00:33 +08:00
BaiFu af71244974
Merge pull request #428 from Ghostubborn/feat/i18n
feat(i18n): 添加多语言切换功能,支持中英文
2026-04-02 14:27:04 +08:00
ghostubborn ed465908db fix(i18n): set HTML lang attribute before Vue mounts via inline script 2026-04-02 14:21:09 +08:00
ghostubborn 65df257e19 chore(deps): upgrade vue-i18n from v9 to v11 2026-04-02 14:20:50 +08:00