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 TypeClassDescription(package private) static final record(package private) static final record(package private) static final record(package private) static final recordAll harvested info from a single qaExample template.(package private) static final recordHarvested type information from a compiled template.static final recordResult of probe generation: the sources to compile and the template identity for tracking. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTemplateProbeGenerator(List<AtnBasedGenerator.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 TemplateProbeGenerator.HarvestedMethodfindCallableConstructor(TemplateProbeGenerator.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<TemplateProbeGenerator.HarvestedTemplate> Access to loaded templates for Strand 3 mutation access.(package private) static TemplateProbeGenerator.HarvestedFunctionharvestFunction(MethodSymbol method) (package private) static TemplateProbeGenerator.HarvestedMethodharvestMethod(MethodSymbol method) (package private) static TemplateProbeGenerator.HarvestedTypeharvestType(AggregateSymbol aggregate) (package private) static booleanisInstantiableGenus(SymbolGenus genus) intHow many templates were harvested (all are now usable via fallback probes).
-
Field Details
-
BUILT_IN_TYPES
-
-
Constructor Details
-
Method Details
-
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 TemplateProbeGenerator.HarvestedMethod findCallableConstructor(TemplateProbeGenerator.HarvestedType type, Map<String, String> constructedTypes, Random random) -
canProvideAllParams
-
generateArgs
-
generateLiteral
-
extractModuleName
-
extractQaId
-
getTemplates
List<TemplateProbeGenerator.HarvestedTemplate> getTemplates()Access to loaded templates for Strand 3 mutation access.
-