9 Commits

Author SHA1 Message Date
hungtran24
5c61227e6f fix: drop temperature from AI requests and make the trial scenario editable
- gpt-6-luna on AIHub rejects temperature=0 (HTTP 400), which made every
  call without reasoning_effort fall back; no longer send temperature.
- Fixtures page edits the scenario as JSON instead of a fixed preview;
  backend validation errors are shown.
- AI profile form keeps submitted values after a trial run.
- Record the live AIHub check in the spec and README.
2026-10-09 08:32:19 +07:00
hungtran24
6577bb74be refactor: simplify scoring service, AI profile revisions and test suite
Phase 2 and 3 of the platform rework.

- Neutral request/response contract: external_id, metadata, X-AI-Key,
  run_id in the response; client-specific fields removed.
- AI profile is a revision table: saving creates an inactive revision,
  activation is separate, try-run does not store a run. One
  chat-completions gateway serves AIHub and OpenAI-compatible profiles.
- Add between and in rule operators.
- Contracts moved to contracts/lead-scoring/ with a score-response fixture.
- Admin Web updated for revisions, runs and the neutral fixture.
- Consolidate tests; remove rewrite_architect.md and the stale handoff doc;
  rewrite spec, CONTEXT and ARCHITECTURE for the current design.

Not verified: live AIHub/OpenAI behavior, Omni/EMS integration.
2026-10-09 08:23:21 +07:00
hungtran24
b1f6643796 refactor: score synchronously and drop webhook/background execution
POST /v1/lead-scoring/score now evaluates in the request, applies an overall
AI deadline, and stores the completed run only after scoring. Idempotency is
kept by (app_id, account_id, request_id) with a body fingerprint.

Removes the webhook outbox, scheduler/recovery loop, app lead_scoring
permission, credential audit events, seed_demo and generate_secret scripts,
and the tests that covered them. Trims tests to behavior of the new flow.
2026-10-09 02:44:24 +07:00
hungtran24
ec9f0f911e feat: update admin web for app access and AI fixture previews
Replace tenant-key administration with app access listing and revocation. Show the canonical conversation and rules before submitting a fixture, support opt-in medium AI scoring, and keep credentials server-only.
2026-10-02 10:57:31 +07:00
hungtran24
cfdc997211 feat: add internal admin flows and fixture runner 2026-09-28 23:11:02 +07:00
hungtran24
156e7af7d8 feat: add internal SvelteKit admin web 2026-09-25 09:55:44 +07:00
hungtran24
81c3de8087 chore: archive legacy implementation and document rebuild 2026-09-25 09:54:57 +07:00
hungtran24
1f0b95edd8 docs: add runnable local setup 2026-09-14 14:57:35 +07:00
hungtran24
9d90440e54 chore: initialize AI Platform repository 2026-09-14 09:57:12 +07:00