Class TemplateProbeGenerator
java.lang.Object
org.ek9lang.compiler.fuzz.TemplateProbeGenerator
Strand 2: Compiler-Aware Injection.
Compiles working qaExample templates through PRE_IR_CHECKS, harvests the resolved
symbol table from CompilableProgram, then generates probe source files that call
or reference those real symbols — sometimes correctly, sometimes with controlled mutations.
The key insight: the compiler's own CompilableProgram IS our symbol registry. No parallel tracking needed — we ask the compiler what exists.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordResult of probe generation: the sources to compile and the template identity for tracking. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTemplateProbeGenerator(List<NamedSource> qaExampleSources, SharedThreadContext<CompilableProgram> sharedContext, FileHandling fileHandling, CompilerReporter compilerReporter) Pre-harvest symbols from qaExample templates by compiling each through PRE_IR_CHECKS. -
Method Summary
Modifier and TypeMethodDescription(package private) static boolean(package private) static voidcleanupModule(CompilableSource cs, SharedThreadContext<CompilableProgram> sharedContext) (package private) static StringextractModuleName(String source) (package private) static StringextractQaId(String filename) Extract QA ID from a filename like "qaExamples/classesAndOOP/QA0093_define_class.ek9".(package private) static HarvestedMethodfindCallableConstructor(HarvestedType type, Map<String, String> constructedTypes, Random random) Generate a probe: pick a random template, generate correct or near-correct calls.(package private) static String(package private) static StringgenerateLiteral(String typeName, Random random) (package private) List<HarvestedTemplate> Access to loaded templates for Strand 3 mutation access.(package private) static HarvestedFunctionharvestFunction(MethodSymbol method) (package private) static HarvestedMethodharvestMethod(MethodSymbol method) (package private) static HarvestedTypeharvestType(AggregateSymbol aggregate) (package private) static booleanisInstantiableGenus(SymbolGenus genus) voidsetStatistics(FuzzStatistics stats) Set the statistics collector for liveness tracking.intHow many templates were harvested (all are now usable via fallback probes).
-
Field Details
-
BUILT_IN_TYPES
-
-
Constructor Details
-
Method Details
-
setStatistics
Set the statistics collector for liveness tracking. -
generate
Generate a probe: pick a random template, generate correct or near-correct calls. All templates are usable — those without callable symbols get a fallback probe exercising built-in type operations in the template's module context.- Returns:
- ProbeResult with sources and template ID, or null if no templates at all
-
templateCount
public int templateCount()How many templates were harvested (all are now usable via fallback probes). -
isInstantiableGenus
-
harvestType
-
harvestMethod
-
harvestFunction
-
findCallableConstructor
static HarvestedMethod findCallableConstructor(HarvestedType type, Map<String, String> constructedTypes, Random random) -
canProvideAllParams
-
generateArgs
-
generateLiteral
-
extractModuleName
-
extractQaId
-
getTemplates
List<HarvestedTemplate> getTemplates()Access to loaded templates for Strand 3 mutation access.
-