feat(FN-3706): gate research tools behind experimental feature

The merge introduces a research tool surface gating mechanism: shared availability helpers in core and engine, applied to the executor and triage agent so research prompts and tool exposure are gated behind experimental-feature flags, with tests covering the new logic.

Fusion-Task-Id: FN-3706
This commit is contained in:
Fusion
2026-05-07 15:50:20 -07:00
committed by gsxdsm
parent 8bbb7346b8
commit c38b7cd002
11 changed files with 231 additions and 24 deletions

View File

@@ -0,0 +1,24 @@
import type { Settings } from "./types.js";
const LEGACY_EXPERIMENTAL_FEATURE_ALIASES: Record<string, string> = {
devServer: "devServerView",
};
export function isExperimentalFeatureEnabled(
settings: Pick<Settings, "experimentalFeatures"> | undefined,
key: string,
): boolean {
const features = settings?.experimentalFeatures;
if (!features) return false;
const canonicalKey = LEGACY_EXPERIMENTAL_FEATURE_ALIASES[key] ?? key;
if (features[canonicalKey] === true) return true;
for (const [legacyKey, aliasCanonical] of Object.entries(LEGACY_EXPERIMENTAL_FEATURE_ALIASES)) {
if (aliasCanonical === canonicalKey && features[legacyKey] === true) {
return true;
}
}
return false;
}