docs: update the reference generation script #1442
<h3>Greptile Summary</h3>
This follow-up hardens the documentation reference generator against silently omitted Go validation rules and repairs stale generator tests and documentation.
Validate.<h3>Confidence Score: 5/5</h3>
The PR appears safe to merge because the follow-up fixes validator discovery and adds safeguards against silent reference-generation drift without introducing a new actionable failure.
No new blocking or non-blocking findings remain. The helper-validation and pointer-receiver threads were manually resolved without explanatory replies; the current pointer-receiver implementation is covered by a matching declaration check, while the helper concern is not reposted because it belongs to its resolved existing thread.
<h3>Important Files Changed</h3>
| Filename | Overview |
|----------|----------|
| docs/6-ibc-cli/tools/refgen.py | Expands validator discovery and adds explicit refusal paths for validation constructs the scraper cannot interpret. |
| docs/6-ibc-cli/tools/test-refgen.py | Adds coverage ensuring declared validators are discovered and either yield field rules or are explicitly ruleless. |
| docs/6-ibc-cli/tools/test-refgen-e2e.py | Re-anchors struct-discovery mutations so the end-to-end cases modify the current source layout reliably. |
| docs/6-ibc-cli/6-cli-commands.md | Refreshes the generated description for the configuration validation command. |
| cli/AGENTS.md | Documents generated-reference maintenance for CLI contributors. |
| proto/AGENTS.md | Adds generated-reference maintenance guidance for protobuf contributors. |
<!-- greptile_other_comments_section -->
<sub>Reviews (2): Last reviewed commit: "docs: follow delegated validators and po..." | Re-trigger Greptile</sub>
<a href="#"><img alt="P1" src="https://greptile-static-assets.s3.amazonaws.com/badges/p1.svg?v=9" align="top"></a> Helper validations remain invisible
The new refusal only examines calls named errors., fmt., or errPath*, so validation delegated to ordinary helpers remains unread. For example, EVMChainConfig.Validate yields recognized rpc and ws rules before calling c.validateICS26Router(), whose required and address checks are outside the scraped method body. Since this validator already yields some rules, the new non-empty assertion also passes. As a result, helper-backed validation changes can still leave requiredness, constraints, and fingerprints stale without making reference generation refuse.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
<a href="#"><img alt="P2" src="https://greptile-static-assets.s3.amazonaws.com/badges/p2.svg?v=9" align="top"></a> Pointer validators are skipped
The broadened receiver regex still cannot match pointer receivers such as func (c *Config) Validate() error. Pointer receivers are already used in the config package, so a validator could realistically adopt this form. It would then disappear from validations, and the new test would not notice because it checks only the validators returned by the parser. This could again leave generated validation details incomplete while checks pass.
@greptileai review again
Want your agent to iterate on Greptile's feedback? Try greploops.
I'm going to approve this for now, but I think the doc gen strategy is incredibly brittle as it relies on parsing specific keywords out of the config. They depend on implementation details like helper function names that are likely to change frequently and at any time, which creates additional burden on developers to update this doc gen script. If this becomes a burden we'll need to revisit this strategy or consider removing these doc gen scripts entirely.
dhfang
evanorti
Follow-up to #1440. This fixes the docs generator. The generator reads validation rules to decide required-ness, enum values, and the attestor/signer tables — when it can't read how errors are built it harvests nothing.
Validate()builds errors the scraper doesn't readcValidate()yields a rule, or is listed as ruleless6-cli-commands.md, stale on mainAGENTS.mdnotes incli/andproto/; ignore__pycache__