Alice Harness, Model Semantics, and Managed Web Surfaces
This guide owns everything OpenAlice injects into or supervises around a Workspace: the three-layer AI credential/model/adapter projection, always-loaded instructions and CLI shims, versioned Alice Harness Skills, Sticker Packs, and managed Harness Studio web surfaces (AutoQuant and Auto Prediction).
1. Model Semantics and Runtime Injection
OpenAlice does not run an in-process model loop. Native coding-agent CLIs own inference, transcripts, login, and native configuration. Runtime injection crosses three strict layers:
Credential access (Vault account/vendor + auth + wire-to-endpoint map)
↓
Model selection & semantics (exact model ID + limits/reasoning + unknown-model overrides)
↓
Per-process adapter projection (CliAdapter.sessionRuntime.project → child argv/env)
- Credential access & catalogs:
CredentialAIProviderprojects Vault records and caches read-only discovery snapshots under<OPENALICE_HOME>/data/model-catalog/providers/without storing keys or raw responses.NativeAIProviderruns bounded runtime-owned discovery without reading tokens or creating Vault records. Catalog membership is advisory, never a launch gate. - Model semantics (
src/ai-providers/model-semantics.ts): Offline resolution of limits and reasoning (none,optional,adaptive,required), effort tiers, and thinking switches. Unknown free-typed model IDs remain valid; unknown-model overrides bind to one exact model ID. - Adapter projection (
src/workspaces/cli-adapter.ts): Every provider-capable adapter implementssessionRuntime.project(...)and declarescapabilities.aiProvider. Secrets resolve just in time into the child environment and never appear in argv or Workspace files. Omitted effort stays omitted. - Workspace preferences & frozen Session bindings:
.alice/settings.jsonstores secret-freeinteractiveandheadlesscreation defaults (fixed vs recent Agent + credential slug/model/effort tuple). At Session birth, the resolvedSessionRuntimeBindingfreezes into.alice/sessions/<resumeId>.json(orworkspaces/state/workspace-manager-sessions/for Workspace Manager) and replays across every surface; later Workspace preference changes never mutate an existing Session's binding. - Native auth & permissions: Absence of a managed credential defaults to native runtime auth (never picking an arbitrary Vault key). Alice-managed Sessions configure full host access and automatic tool approval through process-local adapter flags on both fresh launch and resume, never by rewriting global user config.
2. Workspace Agent Guidance and Live CLI Shims
Guidance is organized into three layers so always-loaded prompts stay compact:
- Always-loaded contract (
CLAUDE.md&AGENTS.md): Copied fromsrc/workspaces/templates/<template>/files/instruction.mdat Workspace creation. Holds durable behavioral rules and Skill routing only. - Discoverable Skills (
default/skills/*/SKILL.md): Projected into.agents/skills/(primary) and.claude/skills/(mirror):alice: Inbox, Issues, provenance, peers, Session nametagsfile-delivery: Connector reply attachmentsdelegate-autoquant: Chat → AutoQuant delegationself-scheduling: Issue frontmatter, schedules, headless deliverytraderhub: Low-frequency market/fundamental/macro datamarket-data: K-line discovery, OHLCV, chart referencesalice-analysis: Quantitative formulas and technical snapshotsalice-uta: Broker reads and trading writes/approvals
- Live CLI authority (
alice,traderhub,alice-uta): The live CLI manifest and tool gateway own exact command syntax and validation;alice-workspaceis a legacy alias only. Adapters must preserve Alice's composedPATHacross login shells so global binaries never shadow Workspace shims.
3. Alice Harness Skill Distribution and Preferences
default/alice-harness.json and ALICE_HARNESS_SKILLS
(src/workspaces/alice-harness-policy.ts) version Project-owned Skill trees
independently of Workspace templates.
- State & preferences:
.alice/alice-harness-version.jsonrecords accepted bundle and per-Skill revisions (local bookkeeping, git-excluded)..alice/alice-harness-config.jsonis tracked Workspace config controlling CLI enablement (disabled tools return403; malformed config fails closed) and independent per-Skill inclusion booleans (self-schedulingis always included). - Scoped and bundle updates: Settings → Workspace injection and
alice harness upgrade [--apply] [--skill <name> --action install|update|remove|restore]use the shared three-way managed-file transaction engine, checkout lease, and preview digest verification.
4. Sticker Packs (default/stickers/)
AliceProjects supply optional Sticker Pack prototypes (Alice Color, Alice Ink,
plus custom imports under data/stickers/packs/<id>/ capped at 512 KiB/image,
100 images, 32 MiB total).
- Enabled by default for new Chat Workspaces only (excluded from ordinary
Harness/template updates). Projects selected images to flat
sticker/<name>.png|.webppaths and generates.agents/skills/alice-stickers/SKILL.md(plus.claude/skills/mirror), tracked in.alice/stickers.jsonwith rollback journals at.alice/sticker-transaction.json. - Ownership & safety: Projection rejects symlinked
sticker/or Skill paths and conflicting unmanaged filenames, never deletes personal files or intervening user edits, and leaves modified managed files in place until an explicitrestoreaction. - Connector resolves
[[sticker/wave.png]]through the generic Workspace file boundary to send native stickers.
5. Managed Harness Web Surfaces (Studio)
OpenAlice supervises Harness-owned web applications (AutoQuant Studio and Auto
Prediction Studio) declared via root harness.json (manifestVersion: 1,
capabilities.studio: { command, ports, entryPort, readinessPath }):
- Ownership & teardown boundary: The Harness repository owns its own business state, APIs, and dependencies; OpenAlice never reproduces Harness business routes/state and Studio launch never runs dependency installers. Stopping or replacing a generation removes its route before termination and kills the full descendant process group even if a wrapper script already exited.
- Managed launch: OpenAlice allocates loopback ports, injects
HARNESS_CAPABILITY=studio,HARNESS_HOST=127.0.0.1,HARNESS_PORTS, andHARNESS_NO_OPEN=1, supervises one foreground process tree per Workspace generation, and waits for HTTP 2xx onreadinessPath. - Opaque routing & security: A ready generation receives
oa-surface-<opaque>.localhost(no arbitrary/proxy/<port>route). Browser,pnpm devWeb relay, and SSH tunnels route byHostheader; Electron uses an ephemeral loopback-only Surface Gateway exposing Harness routes only. The proxy strips OpenAlice auth/cookie/CSRF headers. - Source-backed Harness upgrades (
src/workspaces/harness-source-upgrade.ts): Source-pinned templates record their commit in tracked.alice/harness-source.json. Preview fetches the target commit, validatesharness.json, and checks Git mergeability; apply requires idle Sessions/Studio, a clean working tree for touched paths, and creates a no-fast-forward Git merge commit under the shared checkout lease.
6. Load-Bearing Paths and Verification
src/ai-providers/{preset-catalog,model-semantics,presets,provider,model-catalog}.ts— provider presets, model semantics, and catalog caching.src/workspaces/{cli-adapter,session-runtime-binding,workspace-runtime-settings,session-runtime-store,credential-injection}.ts&src/workspaces/adapters/— binding resolution and process projection.src/workspaces/{context-injector,alice-harness-policy,template-upgrade}.ts— prompt/Skill/sticker injection and three-way updates.src/workspaces/{harness-manifest,harness-surface-manager,harness-source-upgrade}.ts&src/webui/harness-surface-proxy.ts— Studio supervision, proxy routing, and source merges.
Verify changes with owning root/UI typechecks, adapter/binding/harness unit and
integration suites, and a real Workspace CLI/Studio execution check (command -v alice
in headless shell plus real adapter launch/resume).