# Agentic AI Engineering Academy

## Run and upload

The offline core is an HTML, CSS and native JavaScript app. From the DiscoveryVIP root, start `python3 -m http.server 8767 --bind 127.0.0.1` and open `http://127.0.0.1:8767/agentic-ai-engineering-academy/`. Use a PHP server for the surrounding DiscoveryVIP pages and the optional provider adapter.

Back up the live website, then extract the upload package into the existing site root. It contains the academy and three shared discovery files under `data/` and the root sitemap. Merge any newer live catalog edits before replacing those files. Serve `.mjs` with a JavaScript MIME type. Confirm that the academy appears in Interactive Guides and the AI learning path. Use an HTTPS origin for production.

## First investigation

1. Run the starter workflow. Select the tool error, fallback and final outcome in the execution trace.
2. Compare the cited archive with the current source in Source collection.
3. Open Workflow. Set the search node’s retries to 1 and the draft node’s policy to approved. Validate, return to Mission Control, and run the same fixture. The reviewed repair is also available as a reference.
4. Open Evaluation and select Starter baseline as the reference. Compare the fixed run with the original on identical evidence. The archive reports 45 days. The repaired workflow returns 30 days with the approved citation.
5. Export workflow JSON and the evaluation report. Save a revision in Passport. Reload and load the saved revision to verify local persistence.

## Supported execution

The engine executes deterministic typed nodes over five fictional policy domains and six evaluation conditions. Each run generates inputs, calls, tool errors, retries, outputs, context packets, role handoffs, checks and an outcome from the executable graph. Pause stops advancement, Step advances one frame, and Replay reruns the prior graph and fixture from clean working memory.

Graph edges validate their type, reachability and termination. Error edges receive the original node input. Citation checks can route unsupported claims through an alternate edge. The search loop is bounded by retry count, simulated timeout and a shared call budget. The independent second research branch runs sequentially so its duplicate work can be counted deterministically. Tool permissions and arguments are validated before synthetic execution. Approval gates can record a result only inside the simulator. 

The 120 lesson activities are organized into 20 modules of six tasks. The 25 campaigns combine five architectural briefs with five policy domains. The 60 investigations are twelve failure families with five fixtures each. The 30 experiments compare six evaluation conditions across five domains. They share documented rules and data structures. This arrangement supports controlled comparisons across variants.

The planner, researcher, analyst, critic, reviewer and executor are deterministic roles. The engine does not use generated reasoning in offline mode. Working memory resets per run. Context packing can restrict evidence by authority and budget, and the trace exposes which source IDs were excluded. Simulated latency, token estimates and assumed credits are teaching metrics. Human review is recorded separately.

## Export and run a workflow

Export workflow JSON in Workflow. Keep `starter.mjs` alongside the academy’s `assets/` folder. Run from that folder using Node.js with ES module support:

```sh
node starter.mjs /path/to/agent-workflow-v1.json returns-intermittent
```

The runner prints the outcome, checks and actual simulator trace. Its exit code is nonzero when a check fails or the workflow is invalid. For an approval fixture, pass `approve` as the fourth argument after the workflow and fixture ID. The JSON is an executable workflow definition for the included engine. It does not expose a live provider, create real external actions or reconstruct a graph from arbitrary source code.

Passport stores verified fixture passes, up to 12 saved revisions and the most recent 12 evaluation summaries in browser storage. Full evaluation reports export separately. Export a portfolio before switching devices or clearing browser data.

## Optional Gemini comparison

The endpoint defaults to disabled. It sends one fixed fictional evidence fixture to Gemini after the operator approves the request. The provider has no tools or action permissions. The backend checks the structured proposal against the fixture and labels it for human review.

To enable this on a PHP 8.1+ HTTPS host with cURL:

- Protect the endpoint with host authentication. Configure a trusted server-side `REMOTE_USER` from the authenticated principal, rather than a client-supplied identity header.
- Set `AGENT_ACADEMY_LIVE=1`, `AGENT_ACADEMY_OPERATOR` to the permitted principal, `GEMINI_API_KEY` to the server-side key, `AGENT_ACADEMY_GEMINI_MODEL` to a supported model identifier, and `AGENT_ACADEMY_PRIVATE_DIR` to a writable directory outside the document root.
- Keep the endpoint same-origin. It accepts only a small JSON consent request and a custom request marker. It rejects arbitrary prompts, credentials and provider destinations from the browser.
- Review the global daily request cap, 16-second provider timeout, 32 KiB response cap, and metadata-only provider logs. Keep the private usage directory restricted.
- Test in staging as the authenticated operator with the fictional fixture before enabling public access to the rest of the academy.

PHP syntax, disabled behavior and operator denial were verified locally. Live provider authentication, model compatibility, billing and host configuration remain to be verified. [Gemini generateContent reference](https://ai.google.dev/api/generate-content)

## Verification

```sh
node --test agentic-ai-engineering-academy/tests/engine.test.mjs
python3 scripts/test_seo.py
```

Automated checks cover the initial failure and repair, 30 experiments with both approval decisions, all 60 broken baselines and reference repairs, runnable fixtures for 120 lessons and 25 campaigns, replay determinism, schema validation and least-privilege synthetic tools. Browser testing covered baseline and reference runs, manual workflow editing, the 30-row comparison, restored workflow revisions, and a 390 px viewport. The local DiscoveryVIP sitemap checks passed with 326 routes.
