Frame — Context & Control
Purpose
Section titled “Purpose”The context manager. Manages operational contexts, modes, authority levels, and environments. Every operation runs within a defined scope. Like permission and process management in an OS, Frame controls who can do what, in what context. Frame consumes organizational identity from baseline.config.ts (voice, industry, formality, company size) and adjusts AI behavior accordingly. Frame treats the LLM context window as a programmable operating system.
Key interfaces
Section titled “Key interfaces”interface ContextEntry { name: string; mode: string; environment: string; permissions: string[]; authority: string; status: 'active' | 'inactive' | 'archived';}
interface ModeEntry { name: string; permissions: string[]; environment: string; features: string[];}
interface AuthorityEntry { name: string; level: number; permissions: string[];}
interface FrameStatus { initialized: boolean; currentMode: ModeEntry | null; currentEnvironment: string | undefined; activeContexts: number;}import { BaselineFrameSystem } from '@baselineos/frame';
const frame = new BaselineFrameSystem();frame.switchContext('default');
const result = frame.processCommand('status');// { success: true, context: 'default' }
// Permission-aware: system context blocks unauthorized writesframe.switchContext('system');frame.processCommand('write:config');// { success: false, error: 'Permission denied by context/mode' }LayerSweep checks
Section titled “LayerSweep checks”The layer sweep runs three checks against Frame:
| Check | What it validates |
|---|---|
| Context validation | Frame system is initialized with a valid context and mode |
| Authority level | Agent trust score meets the threshold for task complexity (50 standard, 70 complex, 85 epic) |
| Permission check | Execute permission is granted based on the agent’s trust level |
References
Section titled “References”- Specification: 02-frame — three-layer permission model and context lifecycle
- Package README —
@baselineos/frame