Konture
Main entry point for Konture. All architecture assertion builders, scoping builders, and graph configurations are extended from or accessible through this object.
Properties
The file path of the baseline file relative to the baseline directory. Default value is obtained from system property "konture.baseline.path" or falls back to "konture-baseline.json". Backed by ThreadLocal state; safe under parallel test execution.
Whether persistent disk caching of analysis results is enabled. When enabled (requires incremental too), parsed AST snapshots are written to cacheDir and reused across JVM runs, so unchanged Kotlin files skip re-parsing entirely in later test executions. Can be configured via system property "konture.cache.enabled" or programmatically. Backed by ThreadLocal state; safe under parallel test execution.
Optional fingerprint used to namespace the persistent analysis cache. Changing the fingerprint invalidates previously stored entries, which is the recommended way to invalidate the cache when rule definitions or analysis configuration change. The Gradle plugin computes this automatically from the effective konture { analysis { } } configuration. Can be configured via system property "konture.cache.fingerprint" or programmatically. Backed by ThreadLocal state; safe under parallel test execution.
Synonym for scope representing class-level functional scope for the entire project.
Default baseline filename fallback when no custom path is configured.
Default persistent cache directory.
Default value for persistent disk caching.
Default value for failing on resolved baseline violations.
Default HTML report path.
Default value for incremental AST analysis.
Default JSON report path.
Default value for parallel rule evaluation.
Default maximum worker count for parallel evaluation (0 indicates automatic sizing based on available CPU cores).
Default value for reporting resolved baseline violations.
Default SARIF report path.
Whether to fail the test execution if resolved violations exist in the baseline (ratchet mode). Backed by ThreadLocal state; safe under parallel test execution.
The minimum severity threshold required for rule violations to trigger test failure. When null, Konture runs in audit / dry-run mode (no violations cause test failure). Can be configured via system property "konture.fail.on.severity" or programmatically. Backed by ThreadLocal state; safe under parallel test execution.
Retrieves a file-level functional KontureFileScope representing all files in the project.
Retrieves a function-level functional KontureFunctionScope representing all functions in the project.
Flag indicating whether to generate violations into the baseline file rather than throwing AssertionError. Default value is obtained from system property "konture.baseline.generate" (as boolean) or falls back to false. Backed by ThreadLocal state; safe under parallel test execution.
Target HTML report output path relative to project build directory. Default value is obtained from system property "konture.report.html.path" or falls back to "build/reports/konture/konture-report.html". Backed by ThreadLocal state; safe under parallel test execution.
Whether incremental AST analysis and source hashing are enabled. When enabled, unchanged Kotlin files are resolved from the AST cache without re-parsing. Can be configured via system property "konture.incremental.enabled" or programmatically. Backed by ThreadLocal state; safe under parallel test execution.
Target JSON report output path relative to project build directory. Default value is obtained from system property "konture.report.json.path" or falls back to "build/reports/konture/konture-report.json". Backed by ThreadLocal state; safe under parallel test execution.
Retrieves a module-level functional KontureModuleScope representing all modules in the project.
The output format used when formatting architecture violation reports upon failure. Can be configured via system property "konture.output.format" or programmatically. Backed by ThreadLocal state; safe under parallel test execution.
Whether parallel evaluation of independent rules is enabled. When enabled, rule suites are evaluated concurrently across CPU cores using coroutines. Can be configured via system property "konture.parallel.enabled" or programmatically. Backed by ThreadLocal state; safe under parallel test execution.
The maximum number of worker threads for parallel rule evaluation. Defaults to 0 (automatic sizing using available processor cores). Can be configured via system property "konture.parallel.maxWorkers" or programmatically. Backed by ThreadLocal state; safe under parallel test execution.
Lazily and thread-safely loads the ProjectGraph from the default resource path on first use, or retrieves the default graph if already initialized.
System property key used to override the target output directory for baseline files.
System property key used to enable/disable baseline generation mode.
System property key used to override the path of baseline files.
System property key used to override the persistent cache directory.
System property key used to enable/disable persistent disk caching of analysis results.
System property key used to override the persistent cache fingerprint.
System property key used to fail the build when resolved baseline violations are detected.
System property key used to override the minimum severity failure threshold.
System property key used to enable/disable incremental AST analysis and caching.
System property key used to override the target translation language / locale.
System property key used to override the output format (e.g. human, problem_matcher).
System property key used to enable/disable parallel rule evaluation.
System property key used to configure the maximum number of worker threads for parallel rule evaluation.
System property key used to override the path of generated HTML report files.
System property key used to override the path of generated JSON report files.
System property key used to override the path of generated HTML/JSON/SARIF report files.
System property key used to enable reporting of resolved baseline violations.
System property key used to override the path of generated SARIF report files.
Retrieves a property-level functional KonturePropertyScope representing all properties in the project.
Target report output path relative to project build directory. Default value is obtained from system property "konture.report.path" or falls back to "build/reports/konture/konture-report.html". Backed by ThreadLocal state; safe under parallel test execution.
Whether to log and report baseline violations that have been resolved (fixed in code). Backed by ThreadLocal state; safe under parallel test execution.
Target SARIF report output path relative to project build directory. Default value is obtained from system property "konture.report.sarif.path" or falls back to "build/reports/konture/konture-report.sarif". Backed by ThreadLocal state; safe under parallel test execution.
Retrieves a class-level functional KontureScope representing the entire project.
Functions
Unified multi-rule block supporting modules, classes, and layered architecture validations. Runs every declared suite and aggregates all violations before failing.
Unified multi-rule block supporting modules, classes, and layered architecture validations against a specific ProjectGraph. Runs every declared suite and aggregates all violations before failing.
Verifies that there are no module dependency cycles in the project. Throws an AssertionError if a cycle is detected.
Checks ratchet status and throws an AssertionError if resolved violations exist in the baseline and failOnResolvedViolations is enabled.
Access the class-level declarative assertion rule builder. Allows filtering and assertion of class structure, modifiers, annotations, visibility, and dependencies.
Filter or assertion criteria for classes.
Define and run class dependency/structural rules inside a block-based DSL context. Automatically checks the rules at the end of the block.
Filter or assertion criteria for class scope.
Filter or assertion criteria for class scope from module.
Synonym for scopeFromPackage retrieving a class-level functional KontureScope.
Synonym for scopeFromPackage retrieving a class-level functional KontureScope with source set filter.
Access the file-level declarative assertion rule builder. Allows filtering and assertion of source files and their imports, package, or wildcard usages.
Filter or assertion criteria for files.
Define and run source file dependency/structural rules inside a block-based DSL context. Automatically checks the rules at the end of the block.
Filter or assertion criteria for file scope.
Retrieves a file-level functional KontureFileScope scoped to a specific module path.
Filter or assertion criteria for file scope from module.
Retrieves a file-level functional KontureFileScope scoped to a specific package name.
Filter or assertion criteria for file scope from package.
Access the function-level declarative assertion rule builder. Allows filtering and assertion of function declarations (both top-level and nested member functions).
Filter or assertion criteria for functions.
Define and run function dependency/structural rules inside a block-based DSL context. Automatically checks the rules at the end of the block.
Filter or assertion criteria for function scope.
Retrieves a function-level functional KontureFunctionScope scoped to a specific module path.
Retrieves a function-level functional KontureFunctionScope scoped to a specific module path and source set.
Retrieves a function-level functional KontureFunctionScope scoped to a specific package name.
Retrieves a function-level functional KontureFunctionScope scoped to a specific package name and source set.
Define and run a nested, type-safe layered architecture specification. Automatically checks the layered rules at the end of the block.
Access the layered-architecture rule builder. Allows defining high-level layers and declaring directional access constraints between them.
Access the modules-level declarative assertion rule builder. Allows filtering and assertion of architectural module structures and dependencies.
Filter or assertion criteria for modules.
Define and run module dependency rules inside a block-based DSL context. Automatically checks the rules at the end of the block.
Filter or assertion criteria for module scope.
Retrieves a module-level functional KontureModuleScope scoped to a specific module path or pattern.
Filter or assertion criteria for module scope from module.
Access the property-level declarative assertion rule builder. Allows filtering and assertion of property declarations (both top-level and class properties).
Filter or assertion criteria for properties.
Define and run property dependency/structural rules inside a block-based DSL context. Automatically checks the rules at the end of the block.
Filter or assertion criteria for property scope.
Retrieves a property-level functional KonturePropertyScope scoped to a specific module path.
Retrieves a property-level functional KonturePropertyScope scoped to a specific module path and source set.
Retrieves a property-level functional KonturePropertyScope scoped to a specific package name.
Retrieves a property-level functional KonturePropertyScope scoped to a specific package name and source set.
Filter or assertion criteria for scope.
Retrieves a class-level functional KontureScope scoped to a specific module path.
Filter or assertion criteria for scope from module.
Retrieves a class-level functional KontureScope scoped to a specific package name.
Retrieves a class-level functional KontureScope scoped to a specific package name and source set.
Access the slice declarative assertion rule builder. Groups packages into slices by a capture-group pattern and asserts relationships between them, such as cycle-freedom.
Filter or assertion criteria for slices.
Define and run slice rules inside a block-based DSL context. Automatically checks the rules at the end of the block.
Retrieves a slice-level functional KontureSliceScope derived from a package pattern.
Filter or assertion criteria for slice scope.
Retrieves a slice-level functional KontureSliceScope derived from a module pattern.
Retrieves a slice-level functional KontureSliceScope derived from a module pattern and source set.
Retrieves a slice-level functional KontureSliceScope derived from a package pattern.
Retrieves a slice-level functional KontureSliceScope derived from a package pattern and source set.