Architecture Internals
Keeping the docs true (contributors)
To prevent documentation drift as the compiler evolves, Aegil enforces automated synchronization checks. Whenever CLI commands, error codes, device permissions, file ownership rules, or verification checks are updated in the Dart source, continuous integration validates that reference tables, YAML annotations, and documentation pages match the live compiler code.
How the generated reference pages work
Section titled “How the generated reference pages work”The pages under Reference (generated) are built from the Dart source code by scripts/generate.mjs and are gitignored:
| Generated page | Extractor (scripts/extract/) |
Dart source read | Annotation YAML (annotations/) |
|---|---|---|---|
| CLI commands and options | cli.mjs |
bin/aegil.dart (_usage) |
cli.yaml |
| Error codes | errors.mjs |
bin/**/*.dart, lib/**/*.dart (ERR_*) |
errors.yaml |
| Platforms and permissions | permissions.mjs |
lib/compiler/platforms/permission_registry.dart |
permissions.yaml |
| File ownership and tool-managed paths | owners.mjs |
output_plan.dart, platform_shell_emitter.dart |
owners.yaml |
| Verification check kinds | checks.mjs |
integration_test_emitter.dart |
checks.yaml |
| Secrets and environment variables | secrets.mjs |
secrets_emitter.dart |
secrets.yaml |
Commands for updating and verifying the docs
Section titled “Commands for updating and verifying the docs”From inside site/:
cd ../aegil_docspnpm dev # regenerate reference pages and serve http://localhost:4321pnpm annotate # add TODO placeholders for any new CLI flags, ERR_* codes, permissions, etc.pnpm coverage # fail if any code item is missing from annotations/*.yaml or still says TODOpnpm verify # run generate, lint, coverage, extractor tests, and astro buildAnd from the repository root:
dart run tool/check_docs.dartdart analyze bin lib test tooldart test