diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a41accd --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Johan Vaz + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 2093613..221acad 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ FluentAI is an OpenAI-powered agentic language-learning demo. It feels like a co FluentAI now requires `OPENAI_API_KEY` for real lesson and conversation runs. Tests use mocked OpenAI responses so CI never needs secrets. +[](docs/media/workflow-demo.mp4) + +**[Watch the 83-second workflow demo](docs/media/workflow-demo.mp4)** · [Download MP4](https://raw.githubusercontent.com/Jo2234/FluentAI/main/docs/media/workflow-demo.mp4) · [Reproduce the recording](docs/DEMO.md) + +This is the current browser app with **mocked model responses and temporary learner memory**, labelled throughout the recording. It shows a lesson, a deliberate quiz mistake, saved XP and spaced review, text conversation, and progress surviving reload. It demonstrates the interface and state flow; live model quality, voice, and camera behavior are not shown. + ## What works now - **Lesson Mode**: personalized mini lesson, vocabulary, grammar, examples, adaptive quiz, grading, XP, weak-topic updates. @@ -178,3 +184,7 @@ See [architecture and memory](docs/GAP_AND_DESIGN.md), [privacy controls](docs/O - Add richer lesson packs for Hindi and French. - Add stable browser-based voice regression tests with mocked Realtime events. - Add camera-frame fixtures for vision-context tests. + +## License + +[MIT](LICENSE), copyright Johan Vaz. Dependencies and third-party materials retain their own licenses and notices. diff --git a/docs/DEMO.md b/docs/DEMO.md new file mode 100644 index 0000000..715778d --- /dev/null +++ b/docs/DEMO.md @@ -0,0 +1,41 @@ +# Recorded workflow demo + +[Watch the MP4](media/workflow-demo.mp4) or inspect the [current lesson screenshot](media/current-lesson.png). Both are captured from the current shared browser/Electron renderer served through the real Python HTTP bridge, not from the historical mockups. + +## What the recording proves + +| Approximate time | Workflow | +| --- | --- | +| 0–6 s | Home loads an isolated learner profile with no prior practice | +| 6–26 s | Start a lesson from weak-topic memory; answer six quiz questions | +| 26–41 s | Submit one deliberate mistake; see feedback, XP, and scheduled review | +| 41–61 s | Practice two text conversation replies using the same learner memory | +| 61–83 s | Inspect memory, reload the app, and see persisted progress | + +The yellow banner remains visible throughout: **mocked model responses, temporary learner profile, no API calls**. The Python harness replaces the provider with deterministic curriculum/tutor scaffolding. The renderer, HTTP bridge, local grading, transaction logic, review scheduling, and persistence remain real. It changes provider-success log wording so the recording does not claim a live OpenAI call. + +This is workflow evidence, not a demonstration of OpenAI output quality, language-course quality, Realtime voice, camera accuracy, or desktop signing/distribution. The screenshot includes the same disclosure. No microphone/camera permission is requested. No personal profile, `.env`, or API credential is needed. + +## Reproduce + +Use Python 3.10+, Node.js, FFmpeg (`ffmpeg` and `ffprobe` on PATH), and a Playwright Chromium installation. From the repository root: + +```bash +python3 -m venv .venv +source .venv/bin/activate +python -m pip install -e '.[dev]' +npm ci +npm install --no-save --package-lock=false playwright@1.62.1 +npx playwright install chromium +node scripts/record_portfolio_demo.cjs +``` + +The recording script starts `scripts/portfolio_demo.py` on localhost, creates a disposable profile, drives visible controls, blocks external browser requests, and shuts down the server afterward. It checks for browser/bridge errors, quiz XP, scheduled review, and persistence after reload. It writes `docs/media/current-lesson.png`, `workflow-demo.mp4`, and `recording.json`; FFmpeg converts the captured browser video to a silent H.264 MP4. The demo uses on-screen chapter labels instead of narration. + +Optional environment overrides: `PYTHON_EXECUTABLE` for the interpreter, `CHROMIUM_EXECUTABLE` for an already installed browser, and `DEMO_PORT` for an available localhost port (default 7862). An existing Playwright installation can be resolved through `NODE_PATH`. The checked recording reused an installed Chromium binary; the commands above install Playwright's own compatible browser for a fresh reproduction. Timing, session IDs, and timestamps may vary; `recording.json` records the actual duration and source commit. + +To inspect the workflow manually, run `python scripts/portfolio_demo.py` and open `http://127.0.0.1:7861`. Ctrl-C deletes the temporary state. This explicit development harness is not a production offline-tutor mode; ordinary app entrypoints continue to require OpenAI. + +## Checks and provenance + +The screenshot and video are generated by the two scripts above. `recording.json` identifies the pre-recording source commit and automated assertions. The Git commit containing the artifacts also contains the exact harness and driver. Original design mockups and their notices remain in `mockups/`. The repository's MIT license covers Johan Vaz's original work; third-party dependencies retain their own terms. diff --git a/docs/media/current-lesson.png b/docs/media/current-lesson.png new file mode 100644 index 0000000..f00fe1a Binary files /dev/null and b/docs/media/current-lesson.png differ diff --git a/docs/media/recording.json b/docs/media/recording.json new file mode 100644 index 0000000..c6121c5 --- /dev/null +++ b/docs/media/recording.json @@ -0,0 +1,20 @@ +{ + "source_commit": "85241bc625a2435324fffeca0bda2b0847d3f143", + "duration_seconds": 82.7, + "size_bytes": 1312712, + "viewport": "1440x1000", + "model_boundary": "Mocked Python provider; actual renderer, bridge, grading, state persistence, and review scheduling", + "external_browser_requests": "Blocked", + "checks": [ + "Lesson awarded XP", + "Review queue populated", + "XP and review queue survive page reload", + "No browser errors or failed bridge responses" + ], + "excluded": [ + "Live model quality", + "Realtime voice", + "Camera", + "Signed desktop distribution" + ] +} diff --git a/docs/media/workflow-demo.mp4 b/docs/media/workflow-demo.mp4 new file mode 100644 index 0000000..99b309d Binary files /dev/null and b/docs/media/workflow-demo.mp4 differ diff --git a/notes.md b/notes.md index bf76c6c..b19d650 100644 --- a/notes.md +++ b/notes.md @@ -24,3 +24,7 @@ Current behavior is documented in [architecture](docs/GAP_AND_DESIGN.md), [curri ## Provenance The full construction log and original five design proposals remain available in [the pre-cleanup Git snapshot](https://github.com/Jo2234/FluentAI/tree/d923a6a49243ed19cbad3c3470e165157f2c34b0). In that snapshot, `notes.md` records dated work and validation, and `docs/` contains the original north-star, schema, onboarding, curriculum, and packaging proposals. Their work-package assignments, future-tense descriptions, and old source line numbers are historical, not current implementation instructions. Git history retains authorship and the evolution of those decisions. + +## Portfolio recording (2026-09-11) + +Added a current-app screenshot and 83-second workflow recording using a labelled mock-provider harness and temporary learner data. Real bridge/UI checks verify quiz XP, review scheduling, and persistence after reload. The recording is not evidence of live model, voice, camera, or signed-app quality. Python/JS regressions and Ruff passed; see [demo reproduction and provenance](docs/DEMO.md). diff --git a/scripts/portfolio_demo.py b/scripts/portfolio_demo.py new file mode 100644 index 0000000..9671ae9 --- /dev/null +++ b/scripts/portfolio_demo.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python3 +"""Local recording harness. Real renderer/bridge; mocked provider; disposable state. + +Not an application fallback. Never reads repository learner state or API keys. +""" +from __future__ import annotations + +import argparse +import copy +import sys +import tempfile +from pathlib import Path +from unittest.mock import patch + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +from fluent_ai import desktop_bridge, web +from fluent_ai.state import default_state, profile_state, save_state, utc_now + + +class DemoProvider: + available = True + model = "mocked-portfolio-fixture" + last_error = None + + def status(self): + return "Mocked model responses — portfolio workflow recording." + + def enhance_lesson(self, state, lesson): + result = copy.deepcopy(lesson) + # The production bridge requires this provider-success marker. The + # recording banner and logs explicitly identify the substituted service. + result["source"] = "openai" + return result + + def conversation_tutor_reply(self, topic, state, transcript, phase, fallback): + return fallback + + +class DemoHandler(web.FluentAIHandler): + def _renderer_html(self): + banner = '''