Class ProbeDirective

java.lang.Object
org.ek9lang.compiler.directives.ProbeDirective
All Implemented Interfaces:
Directive

public class ProbeDirective extends Object implements Directive
To be used in EK9 source code to assert that the Oracle query at a specific line produces the expected JSON output. This validates the exact data an LLM would receive when querying the compiler about a symbol via MCP or the ek9 -ai REPL.
@Probe: PRE_IR_CHECKS: `{"name":"Counter","genus":"CLASS"}`
@Probe: PRE_IR_CHECKS: CONSTRUCT: `{"construct":{"name":"Counter",...}}`
The directive applies to the next line in the source — the line where the symbol is declared. The listener resolves the symbol at that line, builds a full LocationContext, dispatches to the named extractor, and compares the JSON output line-by-line against the expected JSON.
  • Constructor Details

    • ProbeDirective

      public ProbeDirective(IToken token, CompilationPhase phase, ProbeExtractorType extractorType, String expectedJson, int lineNumber)
      A new probe directive for Oracle JSON validation with explicit extractor type.
    • ProbeDirective

      public ProbeDirective(IToken token, CompilationPhase phase, String expectedJson, int lineNumber)
      Backward-compatible constructor that defaults to SYMBOL extractor.
  • Method Details