Semantic Evaluation Harness
The Semantic Evaluation Harness measures whether a system answers software understanding questions correctly.
The Semantic Evaluation Harness measures whether a system answers software understanding questions correctly.
It is intentionally separate from compiler validation. Compiler validation checks graph generation, counts, diagnostics, coverage, trust, and performance. Semantic evaluation asks repository-specific questions and scores answers against deterministic expectations.
Layout
validation/semantic/
fixtures/
questions/
evaluators/
leaderboard/
reports/Generated artifacts include:
validation/semantic/leaderboard.mdvalidation/semantic/leaderboard.jsonvalidation/semantic/reports/<repository>.mdvalidation/semantic/reports/<repository>.jsonvalidation/semantic/reports/summary.mdvalidation/semantic/reports/summary.jsonvalidation/semantic/reports/performance.mdvalidation/semantic/regression-baseline.jsonvalidation/semantic/regression-current.jsonvalidation/semantic/regression.json
Commands
ontoly evaluate
ontoly evaluate ovok-core
ontoly evaluate --ci
ontoly leaderboard
ontoly benchmark semanticThe harness can also be run directly:
node validation/semantic/evaluators/run-semantic-evaluation.mjs --ci--ci exits non-zero when semantic regression fails. --refresh reruns the
base Ontoly versus Graphify validation suite before scoring semantic questions.
Question Format
Questions live in validation/semantic/questions/<repository>.yaml.
- id: auth-controller
repository: ovok-core
category: Controllers
evaluator: FindController
question: Which controller handles authentication?
selector:
nodeTypes:
- Controller
terms:
- AuthController
exactTerms: true
expected:
exact:
- AuthController
acceptable:
- AuthenticationController
nodes:
- type: Controller
name: AuthController
edges:
- type: INJECTS
from: AuthController
to: AuthServiceSupported expectation shapes:
exact: canonical answer labels.acceptable: aliases that may satisfy a single-answer question.nodes: expected semantic nodes.edges: expected semantic relationships.relationships: relationship expectations using the sametype,from, andtoshape asedges.
Categories
The baseline categories are:
- Functions
- Methods
- Classes
- Interfaces
- Routes
- Controllers
- Services
- Providers
- Modules
- Packages
- Dependency Injection
- Configuration
- Environment Variables
- Call Graph
- Request Lifecycle
- Repository Structure
- Workspace
- Authentication
- Authorization
- Database
- API
- Architecture
Evaluators
Evaluators normalize Ontoly and Graphify outputs into semantic answers before scoring. The current evaluator names are:
FindControllerFindRouteFindProviderFindModuleFindDependencyFindCallChainFindConsumersFindConfigurationFindEnvironmentVariableFindRepositoryFindDatabaseAccessFindEntrypointTraceExecutionTraceDependencyArchitectureSummaryImpactAnalysis
Scoring
Every question is scored independently for Ontoly and Graphify.
PASS: all expected answers were found and precision is acceptable.PARTIAL: at least one expected answer was found, but recall or precision is incomplete.FAIL: no expected answer was found.
Each result records:
- exact match
- precision
- recall
- false positives
- false negatives
- confidence
- latency
- explanation
The aggregate Semantic Understanding Score is the percentage of questions that passed, with partial answers counting as half credit.
Fixtures
Repository fixtures live in validation/semantic/fixtures/<repository>.yaml.
repository: ovok-core
name: Ovok Core
path: /Users/shrey/Desktop/work/ovok-core
frameworks:
- NestJS
questions: questions/ovok-core.yaml
expectedGraph:
minNodes: 20000
minEdges: 45000
coverageExpectations:
semanticCoverage: 95
trustScore: 95To add a fixture:
- Add
validation/semantic/fixtures/<repository>.yaml. - Add
validation/semantic/questions/<repository>.yaml. - Run
ontoly evaluate <repository>. - Inspect
validation/semantic/reports/<repository>.md. - Run
ontoly evaluate --cibefore accepting the baseline.
Regression
regression-baseline.json is the accepted semantic release gate. Each run writes
regression-current.json and compares current Ontoly statuses and scores against
the baseline.
The regression status is:
PASSwhen no Ontoly semantic score or question status regressed.FAILwhen a repository score drops or a question moves fromPASStoPARTIALorFAIL.
The CI workflow runs:
node validation/semantic/evaluators/run-semantic-evaluation.mjs --ciA release is ready only when semantic understanding remains stable or improves across the validation corpus.