Skip to content

Synchronize IRT SysX repo with latest updates#21

Merged
abdratsd merged 58 commits into
IRT-SystemX:mainfrom
ainetus:main
Jul 24, 2026
Merged

Synchronize IRT SysX repo with latest updates#21
abdratsd merged 58 commits into
IRT-SystemX:mainfrom
ainetus:main

Conversation

@abdratsd

Copy link
Copy Markdown
Collaborator

No description provided.

abdratsd and others added 30 commits March 11, 2026 13:54
Introduce browser-side session trace storage and export helpers.\nSupports JSON/CSV generation, safe session-id fallback, and download handling.
Update sendTrace to persist each outgoing trace in the local session timeline before posting to historic-service.
Start a trace session after login and export it during logout.\nKeep auth flow robust by guarding export/session errors and always clearing auth state.
Simulator APIs (ATM, PowerGrid, Railway, applyRecommendation) return
fake success responses. HTTP interceptor auto-logout on token expiry
is commented out. These are temporary workarounds for local demo use.
…ate from hydrated card

- Hydrate card before EVENT trace recording to get titleTranslated/summaryTranslated
- Include publish_date (wall-clock time) alongside start_date (simulation time)
- Add title/summary to ASKFORHELP fallback EVENT in sendTrace
add chart values on project side
All affected locations are marked with:
  TODO: TEMP HACK (eval-demo) — MUST BE REMOVED before next release

Files:
- frontend/src/api/services.ts         — applyRecommendation fake success
- frontend/src/entities/ATM/api.ts     — ATM simulator fake success
- frontend/src/entities/PowerGrid/api.ts — PowerGrid simulator fake success
- frontend/src/entities/Railway/api.ts — Railway simulator fake success
- frontend/src/plugins/http.ts         — auto-logout on token expiry disabled
Includes temporary demo hacks — see TODO: TEMP HACK comments in:
- frontend/src/api/services.ts
- frontend/src/entities/ATM/api.ts
- frontend/src/entities/PowerGrid/api.ts
- frontend/src/entities/Railway/api.ts
- frontend/src/plugins/http.ts

These hacks must be removed in a follow-up fix:
1. Re-enable real simulator API calls (applyRecommendation)
2. Re-enable auto-logout on token expiry in http.ts
abdratsd and others added 28 commits May 20, 2026 05:21
- Pass VITE_COGNITIVE_TOKEN as build arg to frontend image only
- Reference RL_AGENT_API_TOKEN from K8s secret 'cab-recommendation'
- Bump frontend package version to 1.3.1
…p expression

secrets context is not available in strategy.matrix, only in steps.
Use format() conditional to scope the build arg to the frontend service only.
Also bump OVH chart image tags to 1.3.1.
The production image used nginx's bare default config (no proxy blocks).
Requests to /cognitive-api/ fell through to the SPA try_files fallback,
returning index.html (200 OK) → JSON.parse failure in the browser.

Add default.conf with /cognitive-api/ and /rl-api/ proxy blocks.
start-webui.sh replaces the resolver line at container startup.
feat(zoom): Implements zooming of the displayed grid
Add sncf_recommender with four ordering strategies and wire them into
RailwayManager via request_data.event.mode:

- basic: best-first ordering (SNCF_RECO3)
- deontic: filter by a KPI threshold, then sort ascending
- risk: sort all recommendations by a KPI ascending
- risk_tie_break: primary KPI with a secondary KPI as tie-breaker

Supported KPIs: passengers, delay (parsed from strings like "1h30"),
cost, total_cost. Catalog lookup errors are surfaced as an empty list
instead of crashing the transform step.
Replace the eval-demo hack that faked a success response with the real
POST to VITE_POWERGRID_SIMU/api/v1/recommendations.

- api.ts: await the real request, detect when the response is the SPA
  index.html (request fell through to the nginx SPA fallback because no
  /powergrid-simu/ proxy is present) and log request/response details.
- Assistant.vue: make onSelection async; only mark the card resolved and
  close the assistant when the apply succeeds, and leave the card open on
  failure so the user can retry (the http plugin shows the error modal).
Route the apply POST through a /powergrid-simu/ location so the browser
stays same-origin and never triggers CORS against the grid2op simulator.

- frontend/default.conf and cab-standalone nginx-cors-permissive.conf:
  add the /powergrid-simu/ proxy_pass (LAN upstream, adjust per env).
- docker-compose.sh: default VITE_POWERGRID_SIMU=/powergrid-simu.
- env.d.ts: type the VITE_* env vars, including VITE_POWERGRID_SIMU.
Upgrade the PowerGrid grid2op simulator PoC with five related changes:

- Recommendation store: add an in-process RecommendationStore shared by
  the POST /api/v1/recommendations endpoint and the simulation loop. The
  loop now reads the applied recommendation directly instead of issuing
  an HTTP request back to itself, which was fragile behind a reverse
  proxy and returned 404.
- Action verification: add summarize_action / verify_action_applied /
  format_verdict_description in utils.py and wire them into Simulator so
  each InteractiveAI recommendation is checked against the grid state
  (APPLIED / NO_OP / NO_EFFECT / REJECTED / OVERRIDDEN) and reported.
- Pause/Resume: replace the one-shot 'Continue' button with a Pause/
  Resume toggle, add /pause_simulation, stream simulation-state and
  keepalive SSE events, and default IS_PAUSED to False.
- Reverse-proxy / CORS readiness: add CORS headers, ProxyFix, SocketIO
  cors_allowed_origins and X-Accel-Buffering so the simulator works
  behind the frontend nginx proxy and for direct cross-origin calls.
- Translate comments, log messages and dashboard UI from French to
  English; tune scenario timing and demo server config.
Name the created i18n instance and export it as the default, and have
setupEntitiesLocales default to that instance instead of requiring it to
be passed in, so entity locales register against the same instance the
app uses.
Add the Kubernetes ConfigMap for the cab namespace covering the
OperatorFabric businessconfig, cards, users, nginx and web-ui
configuration for the assistant platform deployment.
Drop the hardcoded LAN IP fallback that had been baked into the source
(and the built image). The machine-specific value is already supplied at
runtime via the RL_AGENT_API_URL env var (.secrets -> docker-compose.sh
-> .env for local Docker, extraEnv for k8s), so the code fallback only
needs to be the safe in-cluster default.
Merge solution-application: PowerGrid apply flow + nginx proxy + PowerGrid sim UX overhaul, Railway KPI sorting.
Squashes the documentation work from the Docs branch (14 commits by
Maroua MEDDEB) into a single commit on top of current main. Only the
new docs/ files are included:
  - docs/AIAgent_integration.md
  - docs/img/GeneralWorkflow.png
  - docs/img/InteractiveAI_AIAgent.png

Authored by Maroua MEDDEB; squashed and applied by Abderrahman AIT SAID.
@abdratsd
abdratsd merged commit 3c1beeb into IRT-SystemX:main Jul 24, 2026
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants