Skip to content

docs: generate op-batcher flag reference from source, keyed to finalized releases#21847

Merged
sbvegan merged 5 commits into
developfrom
docs-improver/b1-op-batcher-flag-gen
Jul 17, 2026
Merged

docs: generate op-batcher flag reference from source, keyed to finalized releases#21847
sbvegan merged 5 commits into
developfrom
docs-improver/b1-op-batcher-flag-gen

Conversation

@claude

@claude claude Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Requested by Matthew Cruz · Slack thread

Tracks ethereum-optimism/solutions#957

What

Slice B1 of the Truth-from-Source docs program: replace the hand-transcribed op-batcher flag catalog with a table generated from source, regenerated only when a new finalized op-batcher release is published.

  • Generator (docs/public-docs/scripts/gen-flags/): walks the composed op-batcher/flags.Flags slice (including the op-service families appended in init(): rpc, log, metrics, pprof, txmgr, altda) via urfave/cli's DocGenerationFlag accessors, so output matches --help semantics. Emits snippets/generated/op-batcher-flags.mdx with a do-not-edit header and a provenance line for the release tag recorded in manifest.json (op-batcher/v1.16.11, the latest finalized tag). A -check mode verifies the committed snippet matches generated output without rewriting it.
  • Generated snippet: 87 flags (3 required, 84 optional). The old page was pinned to v1.10.0 and missing all six throttle.pid-* flags plus the newer txmgr/signer flags; it also carried wrong defaults (e.g. --active-sequencer-check-duration is 5s, not 2m0s).
  • Reworked chain-operators/reference/batcher-configuration.mdx: imports the snippet; the "options are from the --help in v1.10.0" disclaimer is gone; hand-written prose kept around the table, with a throttling narrative that surfaces op-batcher/throttling.md.
  • Release-keyed regeneration: the table documents released software, so it is regenerated when a new finalized (non-rc) op-batcher/v* tag is published — not on every develop change. Enforcement runs as a review-gated Mintlify docs automation on a weekly schedule (paste-ready config in the PR comments), plus local generator runs. Procedure in docs/public-docs/scripts/gen-flags/README.md. No GitHub Actions workflow and no new CODEOWNERS entries: everything lives under docs/public-docs/, already owned by @ethereum-optimism/solutions via the existing CODEOWNERS rule.

Notes for reviewers

  • No docs.json change; guides/configuration/batcher.mdx untouched.
  • The generator sorts the --compressor option list: compressor.KindKeys is map-ordered and random on every process start, in op-batcher --help itself. Follow-up proposed: sort KindKeys at init (one line in op-batcher/compressor/compressors.go).
  • Known residual gaps documented in the README: flag changes merged after a release are intentionally not reflected until the next finalized tag; the required-flag list is mirrored in the generator (runtime sanity check catches renames).

Reviewer checklist

  • Generated table spot-checked against op-batcher/flags at op-batcher/v1.16.11
  • All six throttle.pid-* flags present
  • Provenance line and snippet import render on the page
  • Release-regeneration procedure and Mintlify automation config look right

Part of the docs-improver program — see projects/docs-improver/README.md in ethereum-optimism/solutions.

🤖 Drafted by the docs-improver agent — review before merge.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EBBBR8m2V8LjzMvuG7Go2L


Generated by Claude Code

claude added 3 commits July 16, 2026 07:38
Replace the hand-transcribed op-batcher flag catalog (pinned to v1.10.0,
missing all six throttle.pid-* flags and the newer txmgr/signer flags) with
a table generated from the flag definitions the binary actually registers.

- docs/public-docs/scripts/gen-flags: Go generator walking op-batcher's
  composed urfave/cli Flags slice via the DocGenerationFlag accessors, so
  the output matches --help semantics; emits an MDX snippet with a
  do-not-edit header and a provenance line naming the release tag recorded
  in manifest.json (op-batcher/v1.16.11).
- docs/public-docs/snippets/generated/op-batcher-flags.mdx: generated
  output, 87 flags (3 required, 84 optional).
- batcher-configuration.mdx: import the generated snippet; drop the
  'options are from the --help in v1.10.0' disclaimer; keep hand-written
  framing prose and add a throttling narrative that surfaces
  op-batcher/throttling.md.
- .github/workflows/docs-flag-drift.yml: regenerate + git diff --exit-code,
  path-filtered to op-batcher/flags/ and the docs paths; failure message
  includes the regen command.
- CODEOWNERS: explicit entries for the generator, generated snippets, and
  the drift workflow; ownership model in the gen-flags README.

Tracks ethereum-optimism/solutions#957

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBBBR8m2V8LjzMvuG7Go2L
op-batcher's --compressor usage string embeds compressor.KindKeys, which is
collected from map iteration and therefore ordered randomly on every process
start (in op-batcher --help itself, not just here). Sort that one option
list in the generator so regeneration is byte-stable and the drift check
cannot flake; document the source-side one-line fix (sorting KindKeys at
init) as a follow-up.

Tracks ethereum-optimism/solutions#957

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBBBR8m2V8LjzMvuG7Go2L
…check

The drift workflow fetched mise with an unpinned 'curl https://mise.run | sh',
so the job's own tooling was the only unpinned fetch in it. Use the same
SHA-pinned jdx/mise-action (mise 2026.2.2) the repo's docker-build-prep
composite action already uses, which also handles config trust on the runner.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBBBR8m2V8LjzMvuG7Go2L
@claude
claude Bot requested review from a team as code owners July 16, 2026 08:01
@claude claude Bot added docs-improver Opened by the docs-improver agent size:M docs-improver size band documentation labels Jul 16, 2026
@wiz-0f98cca50a

wiz-0f98cca50a Bot commented Jul 16, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 Medium
Software Management Finding Software Management Findings -
Total 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@mintlify

mintlify Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Optimism-Docs 🟢 Ready View Preview Jul 16, 2026, 8:02 AM

Address SAST findings on the flag-reference generator:

- Create the output directory with 0o750 and write snippets with 0o640
  instead of 0o755/0o644. Git does not store these mode bits, so this
  only tightens permissions on the CI runner's disk; committed output
  is unaffected.
- Resolve the docs dir once and route every read/write path through a
  pathUnder helper that cleans the joined path and errors out if it
  escapes the docs root. The paths come from in-repo constants, not
  user input, so this is defense in depth.

Regenerated output is byte-identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EBBBR8m2V8LjzMvuG7Go2L
@mintlify

mintlify Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Optimism-Docs 🟡 Building Jul 16, 2026, 8:01 AM

…automation

Replace the GitHub Actions drift-check workflow with a release-driven flow:
the snippet is generated at the finalized op-batcher release tag recorded in
manifest.json and refreshed when a new non-rc tag is published, enforced by a
review-gated Mintlify docs automation on a schedule plus local runs. Add a
-check mode to the generator for local verification, and drop the dedicated
CODEOWNERS entries — the existing /docs/public-docs/ rule already covers
every path in the pipeline.

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread docs/public-docs/scripts/gen-flags/main.go
@claude claude Bot changed the title docs: generate op-batcher flag reference from source with CI drift check docs: generate op-batcher flag reference from source, keyed to finalized releases Jul 17, 2026
@claude

claude Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Paste-ready Mintlify docs-automation config for the release-keyed refresh (replaces the removed GitHub Actions drift workflow):

  • Name: op-batcher flag reference refresh
  • Trigger: Custom schedule — 0 9 * * 1 (Mondays 09:00 UTC)
  • Context repository: ethereum-optimism/optimism
  • Integrations: GitHub (default)
  • Apply: Require review

Additional prompt:

Check the newest finalized op-batcher release tag (pattern op-batcher/vX.Y.Z, excluding any -rc or pre-release) in the context repository. Compare it against the tag recorded in docs/public-docs/scripts/gen-flags/manifest.json. If they match, do nothing. If a newer finalized tag exists: regenerate the flag reference by running the generator per docs/public-docs/scripts/gen-flags/README.md at that tag (go run ./docs/public-docs/scripts/gen-flags; if the environment cannot check out the tag, first verify the flag-defining packages listed in the README are unchanged between the tag and the default branch, then generate). Update the generated snippet, manifest.json, and the provenance line together, and propose the change for review. Never hand-edit the generated table. Never regenerate from unreleased code. If generation fails, describe the failure instead of guessing.

@sbvegan
sbvegan enabled auto-merge July 17, 2026 05:03
@sbvegan
sbvegan added this pull request to the merge queue Jul 17, 2026
Merged via the queue into develop with commit 099d3ba Jul 17, 2026
18 checks passed
@sbvegan
sbvegan deleted the docs-improver/b1-op-batcher-flag-gen branch July 17, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-improver Opened by the docs-improver agent documentation size:M docs-improver size band

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants