Skip to content

feat(coordinator): add checkCoordinatorConfigDocs validator#3567

Closed
gauravahuja wants to merge 1 commit into
mainfrom
feat/coordinator-config-docs-check
Closed

feat(coordinator): add checkCoordinatorConfigDocs validator#3567
gauravahuja wants to merge 1 commit into
mainfrom
feat/coordinator-config-docs-check

Conversation

@gauravahuja

@gauravahuja gauravahuja commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Add ConfigDocValidator (pure over the walked ConfigKey list) enforcing: every leaf carries @ConfigDoc and every section @ConfigSection, and the description is non-blank. A replacement is optional even for deprecated items (a plain removal is valid). It emits a deterministic, path-sorted violation report.

Wire it behind a ConfigDocCheckMain entrypoint and a standalone checkCoordinatorConfigDocs Gradle task that walks the five root config classes and fails on any violation.

The task is intentionally NOT wired into 'check' yet: the real config classes are annotated in a later phase, so running it now reports the currently-undocumented keys. Wiring into check/CI happens once every key is documented.

This PR implements issue(s) #2978

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this
    PR.
  • I have informed the team of any breaking changes if there are any.

Note

Low Risk
Verification-only tooling and tests; no runtime coordinator behavior or config parsing changes.

Overview
Adds documentation enforcement for Coordinator v2 TOML config: a pure ConfigDocValidator over walked ConfigKeys requires @ConfigDoc on leaves, @ConfigSection on nested tables, and non-blank descriptions (deprecated keys/sections may omit a replacement).

ConfigDocCheckMain runs the existing schema walker across the five root config file classes and exits non-zero with a path-sorted report on failure. A standalone Gradle task checkCoordinatorConfigDocs invokes that main class; it is not hooked into check/CI yet so builds stay green until annotations land on the real config classes.

Unit tests cover validator rules and report formatting; an integration test exercises walker + validator on sample TOML data classes.

Reviewed by Cursor Bugbot for commit bdbe166. Bugbot is set up for automated code reviews on this repo. Configure here.

Add ConfigDocValidator (pure over the walked ConfigKey list) enforcing:
every leaf carries @ConfigDoc and every section @ConfigSection, and the
description is non-blank. A replacement is optional even for deprecated
items (a plain removal is valid). It emits a deterministic, path-sorted
violation report.

Wire it behind a ConfigDocCheckMain entrypoint and a standalone
checkCoordinatorConfigDocs Gradle task that walks the five root config
classes and fails on any violation.

The task is intentionally NOT wired into 'check' yet: the real config
classes are annotated in a later phase, so running it now reports the
currently-undocumented keys. Wiring into check/CI happens once every key
is documented.

Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
@gauravahuja gauravahuja self-assigned this Jul 15, 2026
@gauravahuja
gauravahuja requested a deployment to docker-build-and-e2e July 15, 2026 03:52 — with GitHub Actions Waiting
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.52941% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...a/coordinator/config/v2/docs/ConfigDocCheckMain.kt 0.00% 9 Missing ⚠️

📢 Thoughts on this report? Let us know!

* validates that every key is documented, prints any violations, and exits non-zero on failure
* so the Gradle task (and CI) fails.
*/
object ConfigDocCheckMain {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this going to the final production Jar?
If so, it should not. It's bad practice to mix build/analysis tool code into production code.

Have you considered making a Gradle plugin inside gradleSrc? If too complex as gradleSrc, then we shall create a Gradle module inside jvm-libs (e.g jvm-libs/linea/config-validator) and add it here as compile only dependency.

This piece of work (documentation validation and generation) must be replicated to Maru. The way it is done atm it's not possible :(

gauravahuja added a commit that referenced this pull request Jul 21, 2026
Add ConfigDocsRunner (walk+validate+report exit code; generate+writeIfChanged
idempotently) plus generic ConfigDocsCheckMain/ConfigDocsGenerateMain entry
points and a ConfigDocsSpec interface. Apps declare a single ConfigDocsSpec
object (roots, section detector, output paths, title) and name it from
build.gradle; the generic mains load it by class name, so apps need no
check/generate entry-point code and the Gradle plugin stays zero-logic.

Refs: #3567
Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
@gauravahuja gauravahuja removed their assignment Jul 22, 2026
gauravahuja added a commit that referenced this pull request Jul 23, 2026
Add ConfigDocsRunner (walk+validate+report exit code; generate+writeIfChanged
idempotently) plus generic ConfigDocsCheckMain/ConfigDocsGenerateMain entry
points and a ConfigDocsSpec interface. Apps declare a single ConfigDocsSpec
object (roots, section detector, output paths, title) and name it from
build.gradle; the generic mains load it by class name, so apps need no
check/generate entry-point code and the Gradle plugin stays zero-logic.

Refs: #3567
Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
@gauravahuja

Copy link
Copy Markdown
Contributor Author

Closing in favor of #3606

gauravahuja added a commit that referenced this pull request Jul 23, 2026
…figSection

Annotate every Coordinator TOML config class with @ConfigDoc (leaf values)
and @ConfigSection (nested tables), covering all 450 config keys across:
top-level sections, defaults, database, request retries, prover, traces,
conflation, L1 submission, L2 network gas pricing, message anchoring,
forced transactions, protocol, signer, state manager, type-2 state proof,
L1 finalization monitor, and API.

Annotations are imported from the jvm-libs:linea:config-docs module and
depended on via compileOnly, so the tooling stays out of the production
jar. checkConfigDocs now reports 450/450 keys documented.

Refs: #3567
Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
gauravahuja added a commit that referenced this pull request Jul 23, 2026
…figSection

Annotate every Coordinator TOML config class with @ConfigDoc (leaf values)
and @ConfigSection (nested tables), covering all 450 config keys across:
top-level sections, defaults, database, request retries, prover, traces,
conflation, L1 submission, L2 network gas pricing, message anchoring,
forced transactions, protocol, signer, state manager, type-2 state proof,
L1 finalization monitor, and API.

Annotations are imported from the jvm-libs:linea:config-docs module and
depended on via compileOnly, so the tooling stays out of the production
jar. checkConfigDocs now reports 450/450 keys documented.

Refs: #3567
Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
gauravahuja added a commit that referenced this pull request Jul 23, 2026
…tive spec

Add a reusable 'linea.config-docs' buildSrc convention plugin that creates a
'configDocs' source set (compiled against main + the config-docs engine, kept
out of the production jar) and registers checkConfigDocs / generateConfigDocs
tasks. The tasks run the engine's generic entry points against the app's
ConfigDocsSpec, whose fully-qualified name is declared in build.gradle
(configDocs { spec = ... }) - no per-app entry-point code and no
META-INF/services file.

Coordinator applies the plugin and provides CoordinatorConfigDocsSpec (roots,
section detector, output paths) in the configDocs source set. checkConfigDocs
currently reports the undocumented keys; the config classes are annotated in
the next PR. Generated artifacts are committed in a later PR.

Refs: #3567
Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
gauravahuja added a commit that referenced this pull request Jul 23, 2026
…figSection

Annotate every Coordinator TOML config class with @ConfigDoc (leaf values)
and @ConfigSection (nested tables), covering all 450 config keys across:
top-level sections, defaults, database, request retries, prover, traces,
conflation, L1 submission, L2 network gas pricing, message anchoring,
forced transactions, protocol, signer, state manager, type-2 state proof,
L1 finalization monitor, and API.

Annotations are imported from the jvm-libs:linea:config-docs module and
depended on via compileOnly, so the tooling stays out of the production
jar. checkConfigDocs now reports 450/450 keys documented.

Refs: #3567
Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants