PREVISION — VERY QUICK ANALYSER PROTOTYPE (RELEASE 0.1) ===================================================== WHAT IS INCLUDED - analyser.html — main business-friendly analyser and evidence experiment - api.php — one small PHP file that calls OpenAI, reads evidence and saves JSON - analyser_prompt.txt — concise plain-English version of Investor Analysis Timeline Generator v1.1 - prevision_investor_projects.html — general viewer, discovering companies automatically - runs/ — analyst-visible documents ONLY (S02, S03, S04, S05) - investment_analyses/ — original reference analyses where available (S02, S04, S05) - analysis_runs/, analysis_experiments/, analysis_backups/ — separate output folders No dossier.json, timeline.json, hidden event metadata or secret API key is included. Any number of companies can be added; there are no fixed company names in the program. INSTALL ON THE WEB SERVER 1. Unzip the ZIP into C:\prevision_orig if you want a local working copy. It creates C:\prevision_orig\prevision_release\. 2. Upload the WHOLE 'prevision_release' directory to your website's public web directory. For example: ~/public_html/prevision_release/ (your hosting may use another name). 3. The website needs PHP 8.0 or later, with working HTTPS requests from PHP. No Node, npm, database, Python or package installation is needed on the server. 4. Make a private folder OUTSIDE the web directory, called prevision_secrets. For a typical ~/public_html/prevision_release/ installation, create: ~/prevision_secrets/openai_key.txt ~/prevision_secrets/demo_password.txt Put ONLY your already-created OpenAI API key in the first file, as plain text. Put a DEMO PASSWORD of at least eight characters in the second file. Never put the key inside an HTML or JS file, or somewhere accessible by URL. For other hosting layouts, change KEY_FILE and PASS_FILE at the top of api.php, or set PREVISION_OPENAI_KEY_FILE and PREVISION_DEMO_PASSWORD_FILE in PHP's environment. 5. Make sure PHP can write to the following folders: prevision_release/analysis_runs/ prevision_release/analysis_experiments/ prevision_release/analysis_backups/ 6. In Firefox, open https://YOUR-SERVER/prevision_release/analyser.html Type your DEMO PASSWORD (not your API key) into the password field. FIRST DEMO — EXISTING RESULT 1. Pick S02, S04 or S05 from the Company menu. 2. Click any stage. The original (pre-made) investment view appears immediately. 3. Choose 'Read the document' to see the evidence that the analyst could read. 4. Open the full timeline viewer using the link at the top. It reads analyses live from the folders, not from a hard-coded company list. FIRST API TEST 1. Select a company. Leave the model as gpt-5.4-mini for an inexpensive test. 2. Click 'Analyse next document'. It sends document 1 to OpenAI. 3. Continue with 'Analyse next' or 'Analyse all remaining'. 4. Each step is saved under analysis_runs/COMPANY/investor_analysis_NNN.json. Existing investment_analyses/ files are untouched. 5. 'Publish finished draft to viewer' is OPTIONAL. It first backs up the published results and then replaces them. Do not publish during your first tests. TRY CHANGING THE EVIDENCE 1. Select a company that already has a complete existing analysis (S02, S04 or S05). 2. Choose a stage; for example stage 2 in S02 or stage 6 in S04. 3. Click 'Change the evidence'. Edit just one sentence in the document copy. 4. Click 'Save change and compare automatically'. The analyser immediately runs the edited stage and all later stages, ONE API call at a time. 5. The screen displays the original and edited investment views side-by-side. The earlier stages are copied EXACTLY from the original analysis. 6. 'Stop after this stage' pauses the sequence; 'Continue unfinished comparison' resumes it. Changed experiments are saved in analysis_experiments/COMPANY/. 7. Saving NEVER changes the original evidence or the original investment analyses. ADDING A COMPANY (NO CODE CHANGES) 1. Put its analyst-visible evidence in: prevision_release/runs/YOUR_COMPANY/analyst_documents/ 2. Include a manifest.json with company_id and documents[] entries with: id, date (YYYY-MM-DD), type, title, file, optional attachments[] Files can be .html, .txt or .md. This first prototype also accepts CSV attachments. Documents must be ordered by issue date and then by document ID. 3. Optionally put {"name":"Your Display Name"} in prevision_release/runs/YOUR_COMPANY/company.json 4. Optionally copy existing investor_analysis_NNN.json files to prevision_release/investment_analyses/YOUR_COMPANY/ 5. Refresh the company list. The new company appears automatically. IF YOU HAVE A PREVIOUS S03 ANALYSIS Copy its investor_analysis_001.json, _002.json and _003.json into prevision_release/investment_analyses/S03/. Then reload the page. The ZIP includes S03's analyst-visible documents but not its earlier analysis files. IMPORTANT LIMITATIONS - This is a working ANALYSER first. The timeline/evidence GENERATOR is the NEXT task. - It handles plain text, HTML text and CSV, not actual images, PDFs or audio. - The AI model has not been called with your personal key here. The program's entire request/validation/save/compare process was tested with a local mock API. - An edited result may differ partly because AI output varies, not only because of the evidence edit. Use the side-by-side text to judge what really changed. - Only put fictional or safe-to-share data on this public prototype. A proper login and permissions system is needed before using private real-company files. - The demo password protects paid POST requests from casual misuse, but this is NOT production security. Use HTTPS and do not post a public link widely yet. - A server restart or page reload does not lose completed stages; incomplete runs may be continued. - Your own API costs will depend on model, token use and number of stages. 'Analyse all' and 'Try a change' can make several paid calls. Files are intentionally simple. No hidden dossier, generator metadata or company-specific UI rules are sent to the investor analyser.