Skip to content
wiki.fftac.org

11 User AI Architecture - Source Excerpt 02 - Page Orientation Surfaces

Back to 11 User AI Architecture

Summary

This source excerpt begins near Page Orientation Surfaces and preserves the surrounding evidence from Wiki.FFTAC.org/raw/system-archives/anti-christ.org/docs-archive/2026-05-10/docs/11-user-ai-architecture.md.

**Source path:** Wiki.FFTAC.org/raw/system-archives/anti-christ.org/docs-archive/2026-05-10/docs/11-user-ai-architecture.md

- Briefing Lane: `briefing` persona with `public_note`

Change lane copy in `antichrist_engine_foundation_ai_prompt_paths()` inside `wp-content/plugins/fftac-ai-engine/inc/ai-content.php`. Change the console pairing in `template-ai-engine.php` and the client click behavior in `assets/ts/theme.ts`.

## Page Orientation Surfaces

The AI page renders public-facing orientation sections below the live console:

- command map from `antichrist_engine_foundation_ai_route_map()`
- prompt lanes from `antichrist_engine_foundation_ai_prompt_paths()`
- response contract from `antichrist_engine_foundation_ai_response_contract()`
- next-route handoffs from `antichrist_engine_foundation_ai_next_routes()`

These sections make the page useful for first-time readers and guests while keeping the signed-in console near the top of the page. They are public copy, not hidden prompt instructions.

## Conversation History

Conversation history is intentionally browser-local.

Reason:

- keeps the interaction feeling like modern AI tools
- avoids turning every chat into a WordPress private record
- reduces stored sensitive content
- lets the user clear history immediately from the console

The browser sends recent sanitized history with each prompt. The server formats that history into one Responses API input message plus the current prompt. The hidden persona and protocol prompts remain in the `instructions` field.

The browser may keep longer assistant answers locally so code-heavy responses remain visible and shareable. The outgoing context is still reduced before AJAX submission and the server applies its own per-message history cap before building the Responses API transcript.

The workspace brief is separate from outgoing context. It stays in browser storage until the user explicitly folds it into the visible prompt with `Add To Prompt`; after that, it is treated like normal user prompt text and subject to the same prompt limits.

Assistant messages expose three prompt-conversion actions:

- `Drill deeper` switches to the counterclaim protocol and loads a stronger self-review prompt
- `Research handoff` switches to the Dossier Builder persona with the Evidence Ledger protocol and loads a prompt for claim units, missing evidence, chronology needs, counter-readings, and atlas follow-up
- `Public note` switches to the Public Briefing Editor persona with the Public Note Forge protocol and loads a share-ready drafting prompt

## Session Portability And Snapshots

The session tools panel is also browser-local.

Implemented behavior:

- prompt and local-context counters update as the user types, changes key state, imports history, clears history, or receives a response
- context pressure is counted as the current prompt plus the reduced recent transcript that would be sent with the next AJAX request
- users can keep a browser-local workspace brief for the current claim, draft, source trail, or recovery context
- the workspace brief is not sent to the server until the user chooses `Add To Prompt`, which folds it into the visible prompt text
- `Export JSON` downloads a local transcript payload with version, export time, page URL, selected persona/protocol, optional workspace brief, and normalized messages
- `Export Markdown` downloads the same working session as an editorially readable `.md` file with persona/protocol labels and the optional workspace brief
- `Copy Transcript` copies a plain-text transcript with speaker labels and visible persona/protocol labels where available
- `Import JSON` accepts either the exported payload shape or a raw message array, normalizes messages, replaces only this browser's local transcript, optionally restores the exported workspace brief, and re-renders the log
- importing a transcript does not send that transcript to the server until the user submits a new prompt
- `Save Snapshot` stores a named local restore point containing normalized messages, the current prompt draft, optional workspace brief, selected persona, selected protocol, and timestamp
- `Restore` replaces only this browser's current transcript, prompt draft, workspace brief, persona, and protocol with the selected local snapshot
- `Delete` removes only the selected local snapshot from browser storage
- the local vault is capped to the newest 10 snapshots to keep browser storage modest

This feature exists so serious users can preserve, move, or review their own working sessions while keeping the default privacy stance intact: chat is not persisted in WordPress unless the user explicitly shares a selected assistant output into the post layer.

## Client Rendering And Fullscreen

The served JavaScript is generated from `assets/ts/theme.ts`; do not hand-edit `assets/js/theme.js`.

The AI message renderer creates DOM nodes with text content rather than trusting generated HTML. It supports:

- Markdown-style headings, paragraphs, lists, and blockquotes
- inline code
- fenced code blocks with horizontal overflow instead of layout breakage
- per-code-block copy buttons
- safe Markdown links for `http`, `https`, `mailto`, and site-relative URLs

The fullscreen control toggles `.ai-console.is-fullscreen` and the body lock class `has-ai-console-fullscreen`. Escape exits fullscreen. Styling lives in `assets/css/theme.css`, and the feature emits `ai_fullscreen_toggled`.

The protocol cards update `data-ai-protocol`, optionally load a protocol starter into an empty prompt field, and keep the active state in sync with the select control. Assistant messages also include `Drill deeper`, `Research handoff`, and `Public note` actions that convert the chosen output into a fresh follow-up prompt and switch to the most fitting persona/protocol pairing.

## Output Sharing

AI sharing is explicit and user-triggered. Browser-local chat remains local until the signed-in user chooses an assistant answer and submits the share form.

The share handler:

- requires the AI nonce and a signed-in account
- rate-limits sharing separately from chat and key management
- stores a normal WordPress `post` authored by the current user
- prefixes the generated post slug with a sanitized profile/display-name slug
- supports `draft`, `pending`, and `publish` statuses through the private draft, journal-review, and public-profile destinations
- preserves fenced code blocks in shared post content with escaped `<pre><code>` markup
- stores AI metadata in post meta: shared flag, persona key, persona label, protocol key, protocol label, original prompt, selected visibility, and author slug
- includes both the response flavor and inquiry protocol in the shared post body so readers know the generated text's method context
- opens comments on public profile posts so normal WordPress discussion can attach to the public item

Shared output is user-authored AI-assisted material. It is not Foundation doctrine or an official record unless separately reviewed and promoted through the normal publication layer.

## Analytics Events

The AI console emits the existing launch analytics layer events:

- `ai_prompt_submitted`
- `ai_response_received`
- `ai_prompt_error`
- `ai_example_prompt_loaded`
- `ai_persona_changed`
- `ai_protocol_changed`
- `ai_protocol_selected`
- `ai_prompt_lane_loaded`
- `ai_followup_loaded`
- `ai_workspace_brief_saved`
- `ai_workspace_brief_applied`
- `ai_workspace_brief_cleared`
- `ai_history_cleared`
- `ai_key_saved`
- `ai_key_removed`
- `ai_key_error`
- `ai_fullscreen_toggled`
- `ai_output_copied`
- `ai_output_shared`
- `ai_output_share_error`
- `ai_transcript_exported`
- `ai_transcript_markdown_exported`
- `ai_transcript_copied`
- `ai_transcript_imported`
- `ai_transcript_import_error`
- `ai_session_snapshot_saved`
- `ai_session_snapshot_restored`
- `ai_session_snapshot_deleted`

External analytics should subscribe to `antichrist:analytics` or `window.dataLayer`. Do not put analytics-provider code directly into the AI template.

## Launch Recommendations

Near-term AI work that should remain operational or product-level until the production stack is chosen:

- connect analytics to the AI prompt, response, error, key, share, fullscreen, workspace-brief, transcript, Markdown export, and local snapshot events so launch operators can see whether the console is useful or confusing
- set provider-side OpenAI project budgets, alerts, and key-rotation rules before raising Foundation-key limits
- review the first shared AI posts manually and decide whether public-profile publishing should remain open, move to pending review, or become role-gated after launch behavior is visible
- expand beyond the current prompt lanes only after real user questions reveal which additional lanes matter most
- defer retrieval-augmented or dossier-aware AI until the research data layer has a production owner and source freshness rules