GLMChat V2.2 — AUTHORITATIVE FEATURE AND FUNCTION MAP
=====================================================

ARCHITECTURE
- Maintainable React source: source/frontend/react/*.js
- Deterministic build: scripts/build.mjs; scripts/verify.mjs
- PHP 8.2+ backend: server/bootstrap.php; server/index.php; server/routes/*.php
- SQLite persistence/migrations: server/lib/Database.php; server/lib/Migrations.php; server/migrations/*.sql
- LiteSpeed/Apache security/deployment: .htaccess; server/.htaccess; storage/.htaccess
- Offline PWA: source/frontend/offline-runtime.js; source/frontend/sw.js; manifest.webmanifest

SETUP, AUTHENTICATION AND SECURITY
- Install gate and standalone transitions: React bootstrap/components; install-gate browser suite.
- First-use six-digit PIN and Together key validation: auth routes, Auth.php, Crypto.php, setup screens.
- Session, CSRF, lockout and recent-PIN reauthentication: Auth.php; auth/data/project/template/tool routes.
- Authenticated encryption and secret-safe failure/logging: Crypto.php; Logger.php; Api.php; bootstrap preflight tests.

CHAT AND MULTIMODAL
- Conversations/history/pinning/export: conversations routes and Chat/History screens.
- Streaming chat, stop, retry/regenerate, copy/share: chat routes, Together.php and ChatScreen.
- Visible project/file context and project instructions: Projects.php; ContextBudget.php; chat route/UI selectors.
- Image attachments and separate vision model: chat route; Together vision request; message_attachments persistence.
- Per-turn reasoning, preserved reasoning and JSON-Schema output: AgenticDefinition.php; Together.php; chat UI.
- Cost preflight and conversion to prompt/agent/workflow: cost/chat/prompt/automation APIs and ChatScreen.
- TTS voices/generation/playback: tts routes and TTS screen.

PROJECT WORKSPACES
- Project CRUD, ZIP import/export and path-safe file handling: Projects.php; projects routes.
- Overview/Chat/Files/Automations/Activity tabs: ProjectDetailScreen.
- Metadata, instructions, budget, permissions, retention and revision: migration 012; Projects::updateMetadata.
- Linked runs, outputs and activity: workflow/automation APIs and project screens.

TYPED AGENTIC DEFINITIONS
- Versioned agent/team/workflow validation: AgenticDefinition.php.
- Server CRUD and typed request payloads: automation.php; templates.php; frontend wizards.
- Immutable execution snapshots: workflow_snapshots and WorkflowEngine::start.
- IndexedDB wizard drafts/local records: 00-core.js and WizardShell/BaseWizard.

WORKERS, TEAMS AND ORCHESTRATION
- Persistent workers, assignments, events, outputs and telemetry: migration 011; WorkflowEngine.php.
- Manager-led, sequential, parallel and consensus policies: typed team definitions and execution engine.
- Delegation, memory guidance, checkpoints and worker-scoped controls: WorkflowEngine events/checkpoints/interventions.
- Custom stages, dependencies, optional stages and parallel groups: workflow definition schema and instantiation.
- Pause/resume/cancel, retry/skip, reassignment, tool revoke and branch checkpoint: workflow routes/engine and RunDetailScreen.

FUNCTION CALLING AND PHP TOOLS
- Authoritative allowlisted registry and JSON schemas: ToolRegistry.php.
- Schema validation, project confinement, timeout/output limits and secret redaction: ToolExecutor.php.
- Together tool-call request/continuation loop and structured responses: Together.php; WorkflowEngine.php.
- Read/write/destructive approval policy and recent-PIN controls: tool_calls/tool_approvals tables and routes.
- Tool catalogue, exact scope review, approvals and audit timeline: Tools/Run screens.

TEMPLATES, PROMPTS AND LIBRARY
- Server automation templates: migration 012; templates.php.
- Search, pin, duplicate, import/export, edit and protected delete: LibraryScreen and template API.
- Prompt CRUD/reset and save-from-chat: Prompts.php; prompts routes; library/chat UI.

OFFLINE, SYNC AND CONFLICTS
- Encrypted IndexedDB state and ordered mutation queue: offline-runtime.js.
- UUID idempotency, request hashes, retries, auth pause and conflicts: sync route/runtime.
- Offline drafts never silently submitted: chat and wizard persistence.
- Pending/conflict/exhausted/auth-required inspection and manual recovery: OfflineScreen.
- Conflict resolution through sync API: OfflineScreen and sync route.
- Shell-only Cache Storage and safe updates preserving IndexedDB/queues: sw.js; platform-enhancements.js.

COST, SETTINGS, PRIVACY AND DIAGNOSTICS
- Provider/model/reasoning/output/vision settings: settings route and SettingsScreen.
- Daily/workflow/agent/stage limits and currency-aware display: Cost.php; settings/cost APIs and screens.
- Export, selected delete, full reset and offline revoke: DataManagement.php; privacy screen.
- Safe diagnostics and stable error recovery: platform-enhancements.js; ErrorBoundary.

ACCESSIBILITY AND ANDROID
- 320–600px, short landscape, 200% text, 48px targets and reduced motion: app.css and browser suites.
- Focus trap/restoration, logical headings, restrained live regions and keyboard navigation: components/screens.
- Safe areas, Android Back overlays and standalone PWA install/update: native-android.js; app shell; install tests.

VERIFICATION OWNERS
- Node contracts: tests/node/*.test.mjs
- PHP portable/static: tests/php/static.php and bootstrap_preflight.php
- Migrations: tests/python/test_migrations.py
- Browser: tests/browser/run_*_test.py
- Build/cache: scripts/build.mjs; scripts/verify.mjs; scripts/adversarial_build_check.py
- Feature lock: FEATURE_LOCK.json; scripts/feature-lock.mjs
