Skip to content

Feature Flags

opencode edited this page Oct 3, 2026 · 1 revision

Feature Flags

Source: src-tauri/src/application/flags.rs (module docs flags.rs:1-52, flag table flags.rs:89-110) and src-tauri/src/commands/flags.rs:1-9,43-53 in the main repo. Flags carry booleans only — no secret material is ever involved.

Flag table (2.0 rollout gates)

Every default is the current main behavior (true), so resolving with nothing set changes nothing.

Flag Subsystem New path gated Flag OFF reproduces
snapshots WS-C.1 SnapshotStore capture / checkpoint / rollback No snapshots (pre-2.0: no store)
self_audit WS-C.3 record_report outcome append No outcome append (pass stays read-only)
injection WS-C.2 Untrusted-output envelopes + marker-scan approval hold Raw observations, no scan (pre-2.0 dispatch)
assembly Smart assembly Budgeted opening build + proactive compaction seed Legacy unbounded build (pre-2.0 prompts)

Precedence (highest wins)

  1. Workspace — valid .nexora/flags.json file (flat JSON object of known-name booleans, e.g. {"snapshots": false}).
  2. Global — app-global flags.* settings keys (flags.<name> accepts only true/false, trimmed, case-insensitive; anything else is treated as absent). See commands/settings.rs:63,80 and is_known_flag_setting (application/flags.rs:118-123).
  3. Default — hardcoded FlagDef::default (true).

This mirrors the routing-profile precedence. A present workspace file that fails to load falls back to the global tier with the fixed-vocabulary notice "the workspace flags file is invalid; using the stored settings flags" (application/flags.rs:71-72) — the run never fails, and no document content is echoed (fixed-vocabulary FlagError messages, flags.rs:49-52).

Enforcement status (phased rollout)

  • injection and assembly are enforced in the run path: the run bridge resolves ResolvedFlags::run_flags once per run and the runner consumes it via AgentRunner::with_run_flags (application/agent/runner.rs:173,406).
  • snapshots and self_audit are resolved-but-not-yet-enforced: values resolve through the same precedence and appear in the status view, but no snapshot/self-audit record path reads them yet. The status view marks this per flag (FlagStatus::enforced).

Status view (read-only)

The flags_status Tauri command (commands/flags.rs:43-53,61-71) maps every registered flag to its effective value, fixed-vocabulary source (workspace / global / default), and enforcement mark, plus the workspace-file fallback notice (None unless a present file failed to load). There is intentionally no setter command: flags are edited where they live (the workspace .nexora/flags.json file, or the flags.* settings keys through the existing set_setting path) — see commands/flags.rs:1-9.

Clone this wiki locally