fluffos/.github/workflows/config-docs.yml
gesslar e1a50d2642
Generate driver config docs and a starter config from rc.cc tables (#1206)
* Generate driver config docs and a starter config from rc.cc tables

Make the runtime-config option tables in rc.cc the single source of truth
for documentation, so the docs can no longer drift from the driver.

- rc.cc: add `category`/`description` fields to the int-option table
  (INT_FLAGS) and introduce a STR_FLAGS table for the simple string
  options, parsing them directly from the table in read_config().
- docs/gen_config_docs.py: generate docs/driver/config.md from those
  tables (resolving expression/macro defaults). `--check` mode fails if
  the committed doc is stale.
- .github/workflows/config-docs.yml: run the generator with --check on
  changes to rc.cc/options_internal.h/the generator/the doc.
- docs/driver/config.md: regenerated; now covers all recognized options
  accurately (previously ~half, with some stale/nonexistent entries).
- driver --generate-config: emit a complete, bootable starter config to
  stdout (ints at defaults, required paths as placeholders, websocket/
  TLS/external bits commented out). Comment lines are wrapped to stay
  under the parser's per-line limit.
- Config.example: add the 9 previously-missing options and fix the
  "call_out(0) next level" -> "nest level" typo.
- CLAUDE.md / docs/CLAUDE.md / docs/cli/driver.md: document the source of
  truth, the regeneration workflow, and the new flag.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Config.example: keep only valid options

Remove options the driver doesn't actually use:
- obsolete (driver warns to delete): `binary directory`, `swap file`
- unrecognized / silently ignored: `apply cache bits`, `maximum users`,
  `compiler stack size`

Relocate `evaluator stack size` (a valid limit) up with the other limits
and drop the now-empty "not currently used or implemented" section, and
remove the `binary directory` mention from the header note.

Verified: the cleaned sample boots a mudlib to "Initializations complete"
with no obsolete-line warnings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 13:07:06 -04:00

34 lines
1,014 B
YAML

name: Config Docs
# Verifies that docs/driver/config.md is regenerated whenever the runtime config
# tables in rc.cc change. The doc is generated from INT_FLAGS[] / STR_FLAGS[] by
# docs/gen_config_docs.py; if a contributor edits the tables without re-running
# the generator, this job fails and tells them what to run.
on:
push:
branches: [master]
paths:
- 'src/base/internal/rc.cc'
- 'src/base/internal/options_internal.h'
- 'docs/gen_config_docs.py'
- 'docs/driver/config.md'
pull_request:
branches: [master]
paths:
- 'src/base/internal/rc.cc'
- 'src/base/internal/options_internal.h'
- 'docs/gen_config_docs.py'
- 'docs/driver/config.md'
jobs:
check:
name: config.md is up to date
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Verify generated config docs
run: python3 docs/gen_config_docs.py --check