# Deploy the academy

Upload this folder to DiscoveryVIP as a static site. On Apache include the hidden .htaccess so .mjs files are served as JavaScript. For local testing, run `python3 -m http.server 8828` here. The site needs neither a Google session nor an API key.

## Browser acceptance workflow

1. Run the intake sample. Inspect its four actions, simulated send receipt and Notified status.
2. Change Required team to Finance. Run again. The Operations row should be rejected without a send.
3. Restore Operations. Inject the Gmail fault and run. The trace should identify the interrupted Gmail call and leave the row in Processing. Fix the fault and rerun with the fresh synthetic fixture.
4. View Apps Script Code and download the workflow ZIP. Load the onboarding capstone and verify the new folder, moved document, draft, and final status in the Observatory.
5. Reload and confirm the graph is restored. Use Portfolio to download versioned JSON backups.

The UI and simulations are adapted from DiscoveryVIP's Workspace Automation Architect. This academy curates 60 lessons, 50 existing failure investigations and 50 additional fixture challenges, and 25 guided projects including a new onboarding capstone. The 25 projects are script-based activities. The visual graph library ships the intake and capstone graphs, with additional graphs built in the designer. The trace shows elapsed simulated service call timings rather than Google quotas or benchmarks. The AI coach produces prompts for manual use.

## Exported Apps Script

The visual designer exports supported graphs as Code.gs, appsscript.json and SETUP.md. The individual script editor exports .gs source for its activities. Check the activity-specific setup notes. Use a disposable bound spreadsheet and a test account. Follow the ZIP instructions to map columns, grant scopes, and install the spreadsheet trigger. Substitute an address you control before testing the notification workflow. The capstone creates a draft for review. If a real workflow stops with Processing, reconcile any created objects or message activity before explicitly clearing the row for a retry.

- Google event objects: https://developers.google.com/apps-script/guides/triggers/events
- Installable triggers: https://developers.google.com/apps-script/guides/triggers/installable
- Google service authorization: https://developers.google.com/apps-script/guides/services/authorization

Run `node --test tests/academy.test.mjs` with Node.js 20 or later. The tests check fixture scripts, graph validation, backup validation, virtual email, duplicate protection, the code export and capstone output. Browser testing covered the intake path, rule rejection, failure recovery, code generation, capstone execution and reload. The exported code passed syntax and simulator tests. It has not been run against a live Google account.
