Skip to content

Ticket #240: native-first default on and rollback — verification ​

  • Date: 2026-11-11
  • Branch: ticket/240-native-default
  • Base: integration/native-first-defaults at eb0faee
  • Spec: parent #235; ticket #240
  • ADRs: 0011
  • Unit gate: npm run verify — typecheck plus 1,860 tests, all passing
  • Live gate: npm run test:live:native-first — main 66/66, restart 18/18, 0 gaps, exit 0

Default and persistence ​

  • DEFAULT_SETTINGS.nativeFirst is on. nativeFirstMode(undefined), an absent persisted value, or an invalid persisted value resolves to on.
  • Explicit off and shadow read back unchanged and keep the legacy visible path.
  • V2Store.ensureNativeFirstDefault() inspects the persisted meta row once on service start. When it has no valid mode, the store writes nativeFirst: "on"; when it has one, nothing is rewritten. A later default change therefore cannot flip an explicit choice.
  • The service logs native.mode with mode, toolSurface, and migrated; no content or paths.

Tool surface ​

effectiveToolSurface uses the mode as the outer gate:

SettingSurface
nativeFirst: "on" (no overrides)native
nativeFirst: "on", toolSurface: "native"native
nativeFirst: "on", toolSurface: "legacy"legacy
nativeFirst: "on", nativeMentionRouting: falselegacy
nativeFirst: "off" or "shadow"legacy, even with a stored toolSurface: "native"

The legacy path remains registered by :tools legacy; nothing was removed. Settings changes still replace the per-location registration in place.

Commands ​

  • :native-first on|off|shadow validates one argument. on also sets toolSurface: "native" so a previous legacy-surface override cannot keep the old tools. Arguments and completions are generated by the normal command catalog, so help includes both commands.
  • :tools native|legacy validates one argument and reports success or the usage error in the statusline. Invalid input performs no settings write.

Restart requirement ​

The mode and surface apply immediately to the running service. A host restart is required once after upgrading so the new plugin code and the rewritten AGENTS.md contract load; the commands document this in their success line and the operator guidance is in implementation.md and ADR 0011.

Coverage ​

  • native-first.test.ts: default, absent/invalid, explicit off/shadow.
  • store.test.ts: first-start persistence, no rewrite on restart, explicit choices preserved.
  • tool-surface.test.ts: default native, off/shadow legacy, legacy override, kill-switch rollback.
  • tui/commands.test.ts: parsing, argument validation, command patches, help catalog, completions.
  • service.test.ts: service start persists and logs the default, explicit off is preserved and logs no migration, and the legacy suites still run the explicit path unchanged.

The live driver now asserts the fresh isolated store reports nativeFirst: "on" before any scenario setting is written.

Released under the MIT License.