Ticket #240: native-first default on and rollback — verification
- Date: 2026-11-11
- Branch:
ticket/240-native-default - Base:
integration/native-first-defaultsateb0faee - 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.nativeFirstison.nativeFirstMode(undefined), an absent persisted value, or an invalid persisted value resolves toon.- Explicit
offandshadowread 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 writesnativeFirst: "on"; when it has one, nothing is rewritten. A later default change therefore cannot flip an explicit choice.- The service logs
native.modewithmode,toolSurface, andmigrated; no content or paths.
Tool surface
effectiveToolSurface uses the mode as the outer gate:
| Setting | Surface |
|---|---|
nativeFirst: "on" (no overrides) | native |
nativeFirst: "on", toolSurface: "native" | native |
nativeFirst: "on", toolSurface: "legacy" | legacy |
nativeFirst: "on", nativeMentionRouting: false | legacy |
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|shadowvalidates one argument.onalso setstoolSurface: "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|legacyvalidates 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, explicitoff/shadow.store.test.ts: first-start persistence, no rewrite on restart, explicit choices preserved.tool-surface.test.ts: default native,off/shadowlegacy, 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, explicitoffis 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.