{"record":{"id":"1fec59fd23c098d1","repo":"xai-org/x-algorithm","slug":"s-is-not-a-derived-feature-function","errorCode":null,"errorMessage":"%s is not a derived feature function","messagePattern":"(.+?) is not a derived feature function","errorType":"validation","errorClass":"SemanticCheckFailure","httpStatus":null,"severity":"error","filePath":"botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java","lineNumber":1155,"sourceCode":"\n    if (varExprASTNode.getReturnType() == Type.SYMBOL) {\n      throw new SemanticCheckFailure(\"Cannot assign SYMBOL type to variable\");\n    }\n\n    return Pair.of(variableName, varExprASTNode);\n  }\n\n  private ASTNode toDerivedFeatureFunction(\n      CompilerContext context, String funcName, int lineNo, List<ASTNode> children\n  ) throws ParseFailure, SemanticCheckFailure {\n    if (context.containsMacro(funcName)) {\n      throw new SemanticCheckFailure(String.format(\n          \"Recursive invocation of derived feature function %s is prohibited\", funcName));\n    }\n\n    Optional<DerivedFeature> dfOpt = context.getDerivedFeature(funcName);\n    if (!dfOpt.isPresent()) {\n      throw new SemanticCheckFailure(String.format(\n          \"%s is not a derived feature function\", funcName));\n    }\n\n    DerivedFeature derivedFeature = dfOpt.get();\n    context.trackUsage(derivedFeature);\n\n    List<Tuple3<Tree, String, Optional<Tree>>> params = derivedFeature.getParams();\n    boolean isLogged = derivedFeature.isLogged();\n\n    List<ASTNode> args = children;\n    if (params.size() != children.size()) {\n\n      if (params.size() < children.size()\n          || !params.get(children.size()).getThird().isPresent()) {\n        throw new SemanticCheckFailure(String.format(\n            \"Derived Feature %s has %d parameters, received %d\",\n            funcName, params.size(), children.size()));\n      }","sourceCodeStart":1137,"sourceCodeEnd":1173,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/botmaker/src/java/com/twitter/botmaker/compiler/Compiler.java#L1137-L1173","documentation":"The expression calls a function that looks like a derived feature invocation, but no DerivedFeature with that name is registered in the compilation context (and it was not caught as a builtin or macro earlier).","triggerScenarios":"Calling a derived feature that was never declared, was declared in a different rule set/unit, or after a rename; also stale references after deleting a feature.","commonSituations":"Multi-file rule sets where a feature is used before its defining file is compiled, feature removed during cleanup but references remain, or name casing mistakes.","solutions":["Verify the derived feature name and casing matches its declaration","Ensure the defining rule/feature file is included in the same compilation","If the feature was removed, update all call sites"],"exampleFix":"// before\nvalue = myFeautre(x)\n// after\nvalue = myFeature(x)","handlingStrategy":"validation","validationCode":"if (!context.getDerivedFeature(funcName).isPresent() && !builtins.contains(funcName)) throw new IllegalArgumentException(\"Undeclared derived feature: \" + funcName);","typeGuard":null,"tryCatchPattern":"catch (SemanticCheckFailure e) { if (e.getMessage().contains(\"is not a derived feature function\")) reportMissingFeature(e); else throw e; }","preventionTips":["Compile feature-defining files before dependent files","Lint for references to deleted features in CI"],"tags":["botmaker","derived-feature","undefined-reference"],"backgroundTag":"undefined-function-reference","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}