Steps 290-294: Phase 11a — Semanno format, annotation codegen, visitor dispatch (60/60 tests)
Semanno comment format standard (@semanno:type(key=value)) with emitter/parser covering all 67+ annotation types. SemannoAnnotationImpl CRTP mixin provides default visitor implementations for all 56 extended annotation methods across 7 language generators. Virtual inheritance resolves diamond ambiguity between ProjectionGenerator and SemannoAnnotationImpl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1236,6 +1236,46 @@ private:
|
||||
};
|
||||
}
|
||||
|
||||
void registerTrainingDataTools() {
|
||||
// whetstone_export_training_data
|
||||
tools_.push_back({"whetstone_export_training_data",
|
||||
"Export annotated code as training data for LLM fine-tuning. "
|
||||
"Supports HuggingFace (instruction/input/output JSONL) and "
|
||||
"PairsJSONL (raw_code/annotated_code) formats. Includes statistics.",
|
||||
{{"type", "object"}, {"properties", {
|
||||
{"format", {{"type", "string"},
|
||||
{"description",
|
||||
"Export format: 'huggingface' or 'pairs' (default: 'huggingface')"}}},
|
||||
{"languages", {{"type", "array"},
|
||||
{"description",
|
||||
"Languages to include (default: all available)"},
|
||||
{"items", {{"type", "string"}}}}}
|
||||
}}}
|
||||
});
|
||||
toolHandlers_["whetstone_export_training_data"] =
|
||||
[this](const json& args) {
|
||||
return callWhetstone("exportTrainingData", args);
|
||||
};
|
||||
|
||||
// whetstone_generate_examples
|
||||
tools_.push_back({"whetstone_generate_examples",
|
||||
"Generate annotated code examples with Semanno comments. "
|
||||
"Takes raw source code and language, returns annotated version "
|
||||
"with inferred annotations from all 8 subjects.",
|
||||
{{"type", "object"}, {"properties", {
|
||||
{"source", {{"type", "string"},
|
||||
{"description", "Source code to annotate"}}},
|
||||
{"language", {{"type", "string"},
|
||||
{"description",
|
||||
"Programming language (python, cpp, rust, etc.)"}}}
|
||||
}}, {"required", json::array({"source", "language"})}}
|
||||
});
|
||||
toolHandlers_["whetstone_generate_examples"] =
|
||||
[this](const json& args) {
|
||||
return callWhetstone("generateExamples", args);
|
||||
};
|
||||
}
|
||||
|
||||
void registerWhetstoneTools() {
|
||||
registerASTTools();
|
||||
registerAnnotationTools();
|
||||
@@ -1247,5 +1287,6 @@ private:
|
||||
registerSidecarTools();
|
||||
registerSemanticAnnotationTools();
|
||||
registerEnvironmentTools();
|
||||
registerTrainingDataTools();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user