Something went wrong. Try again.
Identities for entities did.bot
agent llm did
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197# Hooks for prek (https://prek.j178.dev/). See DEVELOPING.md for setup.
# `prek install` wires the pre-commit hook and nothing else unless it is told# otherwise, so without this line the commit-msg hook below would sit in the# file, installed by nobody and firing never.default_install_hook_types = ["pre-commit", "commit-msg"]
# `stages` appears on every hook because there is more than one stage in play.# A hook that does not name its stages runs in all of them, so without this the# file-hygiene and cargo hooks would also fire on commit-msg, where the only# path they are handed is .git/COMMIT_EDITMSG — several lines of "no files to# check" before every commit, and the whitespace fixers quietly rewriting the# message file. The one hook deliberately without a `stages` here is committed,# further down, which declares `commit-msg` in its own manifest. It has to be# spelled out per hook rather than once as a top-level `default_stages`,# because that key is applied before the manifest is consulted and would# override committed's own stage — turning the new hook off while looking like# it tidied up.# The three whitespace fixers exclude the vendored interop vectors, and they# have to. Those files encode invalidity in whitespace — `one.two.three ` is an# invalid NSID *because* of the trailing space, and a blank line at the end of# a file is a candidate in its own right. A fixer reaching them would edit a# test case into passing, and the diff would look like tidying.## THIRD-PARTY-NOTICES.txt is excluded for the neighbouring reason: it is other# people's licence text, reproduced to satisfy the terms it carries, and the# MPL-2.0 text has trailing spaces of its own. Edited, it stops matching what# `scripts/gen-notices.sh` writes and the `notices` hook below fails.## crates/didbot-pds/tests/fixtures/layout/ is excluded because it is a data# directory a released binary wrote: framed, checksummed bytes, and a blob# whose filename is the hash of its contents. A newline appended to any of# them is a fixture that no longer decodes, and the diff would look like# tidying.[[repos]]repo = "https://github.com/pre-commit/pre-commit-hooks"rev = "v6.0.0"hooks = [ { id = "check-merge-conflict", stages = ["pre-commit"] }, { id = "check-added-large-files", stages = ["pre-commit"] }, { id = "check-yaml", stages = ["pre-commit"] }, { id = "check-toml", stages = ["pre-commit"] }, { id = "check-json", stages = ["pre-commit"] }, { id = "mixed-line-ending", args = ["--fix=lf"], stages = ["pre-commit"], exclude = '^(vendor/|crates/didbot-pds/tests/fixtures/layout/|THIRD-PARTY-NOTICES\.txt$)' }, { id = "end-of-file-fixer", stages = ["pre-commit"], exclude = '^(vendor/|crates/didbot-pds/tests/fixtures/layout/|THIRD-PARTY-NOTICES\.txt$)' }, { id = "trailing-whitespace", stages = ["pre-commit"], exclude = '^(vendor/|crates/didbot-pds/tests/fixtures/layout/|THIRD-PARTY-NOTICES\.txt$)' },]
# Run the project's own toolchain rather than a pinned copy of it. Every cargo# hook acts on the whole workspace, so it takes no filenames and runs at most# once per commit; `files` only decides whether it runs at all.## There is no vendor/ exclude. If a patched dependency is ever vendored here, it# belongs in [patch.crates-io] rather than as a workspace member, so `cargo fmt --all`# will not reach it, and clippy's -D warnings applies to workspace members# only. Add an exclude when there is something to exclude, not before.[[repos]]repo = "local"hooks = [ # A fixer, not a check: it rewrites what it can and the run fails on the # modified files, same as the whitespace fixers above — nobody has to # hand-apply a diff rustfmt already knows how to write. { id = "cargo-fmt", name = "cargo fmt", entry = "cargo fmt --all", language = "system", types = ["file"], files = '\.rs$', pass_filenames = false, stages = ["pre-commit"] }, # clippy type-checks as it lints, so there is no separate cargo check hook. { id = "cargo-clippy", name = "cargo clippy", entry = "scripts/lint.sh", language = "system", types = ["file"], files = '(\.rs$|Cargo\.(toml|lock)$)', pass_filenames = false, stages = ["pre-commit"] }, # Spelled out rather than hidden behind a cargo alias: see the comment in # .cargo/config.toml for why an alias breaks inside a worktree. # The doc build is a check, not just a build: .cargo/config.toml sets # rustdocflags = -D warnings, so a prose page that links at an item which no # longer exists fails here. That is the whole reason the narrative pages are # compiled into rustdoc rather than kept as a separate site. Triggered by # docs/ as well as src/, since the pages are include_str!'d into the facade # crate and a change to one is a change to the doc build's input. { id = "cargo-doc", name = "cargo doc", entry = "cargo doc --workspace --no-deps --all-features --document-private-items", language = "system", types = ["file"], files = '(\.rs$|^docs/.*\.md$|Cargo\.(toml|lock)$|^\.cargo/config\.toml$)', pass_filenames = false, stages = ["pre-commit"] }, # Advisories, license terms, duplicate versions and dependency sources — # against the exact graph Cargo.lock resolves, so this needs the lock file # and gains nothing from running on a commit that doesn't touch it or a # crate's own Cargo.toml. `deny.toml` itself is also a trigger: a policy # change (a new allowed license, a new skip entry) should be checked the # same way a dependency change is. # # Unlike cargo fmt/clippy/doc, `cargo-deny` doesn't ship with rustup: # `cargo install cargo-deny` once, same as installing `prek` itself. { id = "cargo-deny", name = "cargo deny", entry = "cargo deny check", language = "system", types = ["file"], files = '(^Cargo\.(toml|lock)$|^crates/.*/Cargo\.toml$|^deny\.toml$)', pass_filenames = false, stages = ["pre-commit"] }, # The licence notices the image ships, checked the way the plan register is: # the generator runs, the result is diffed, and a dependency change that # moved the graph fails here until the file is regenerated and staged. Reads # the same inputs `cargo deny` does, plus its own config and template. # # Like cargo-deny above, `cargo about` is a one-time install: # `cargo install --locked --features cli cargo-about`. { id = "notices", name = "licence notices", entry = "scripts/gen-notices.sh --check", language = "system", types = ["file"], files = '(^Cargo\.(toml|lock)$|^crates/.*/Cargo\.toml$|^about\.(toml|hbs)$|^scripts/gen-notices\.sh$)', pass_filenames = false, stages = ["pre-commit"] }, # The two things the doc build cannot see: an untested rust code fence, and # a relative link between pages whose target no longer exists. { id = "doc-lint", name = "doc lint", entry = "scripts/doc-lint.sh", language = "system", types = ["file"], files = '^(docs/.*\.md|scripts/doc-lint\.sh)$', pass_filenames = false, stages = ["pre-commit"] }, # A code span in docs/, plan/ or README.md that names a path in this tree # has to name one that exists, at a line the file still has. A finding in # scripts/doc-paths-baseline.txt passes, and a line there that no longer # occurs fails, so that list only shrinks. It runs on every commit, which # takes about a tenth of a second, so a rename that strands a span fails the # commit that made it. { id = "doc-paths", name = "doc paths", entry = "scripts/check-doc-paths.py", language = "system", always_run = true, pass_filenames = false, stages = ["pre-commit"] }, { id = "doc-paths-self-test", name = "doc paths self-test", entry = "scripts/check-doc-paths.py --self-test", language = "system", files = '^scripts/(check-doc-paths\.py|fixtures/doc-paths/.*)$', pass_filenames = false, stages = ["pre-commit"] }, # The lexicon JSON is the protocol's source of truth and is compiled into # didbot-lexicon, where the tests assert that every document parses, # that its id matches its path, and that the set agrees with the namespace # constants. Running them on a lexicon change catches a rename that touched # the file but not the constant. # Six development scripts source three shared files between them, so a # syntax error in one of the three breaks all six and nothing else would # notice until somebody tried to start a server. `bash -n` parses without # running, which is the whole check: it costs milliseconds and it is the # failure that is most annoying to meet for the first time in a terminal you # opened to do something else. # # The wrapper is because `bash -n a.sh b.sh` checks only `a.sh` — the rest # become its positional arguments — so each file has to be handed over on # its own. # plan/README.md says both of these run on a commit that touches plan/, and # until now neither was wired: the register could disagree with the epics it # is generated from and nothing said so until somebody read both. The two are # separate hooks because they fail for different reasons — a malformed epic # is fixed by editing it, and a stale register is fixed by running the # generator and staging the result — and a single hook would have to explain # both in one message. Both read all of plan/ whatever they are handed, so # neither takes filenames, and the scripts are inputs as much as the epics # are: a change to the frontmatter parser can stale the register on its own. { id = "check-plan", name = "check plan", entry = "scripts/check-plan.py", language = "system", files = '^(plan/.*|scripts/check-plan\.py)$', pass_filenames = false, stages = ["pre-commit"] }, { id = "plan-register", name = "plan register", entry = "scripts/gen-plan-readme.py --check", language = "system", files = '^(plan/.*|scripts/(check-plan|gen-plan-readme)\.py)$', pass_filenames = false, stages = ["pre-commit"] }, { id = "shell-parse", name = "shell parse", entry = "bash -c 'for f in \"$@\"; do bash -n \"$f\" || exit 1; done' _", language = "system", files = '^scripts/.*\.sh$', stages = ["pre-commit"] }, # Two line counts, both in scripts/check-file-size.py. Over 5000 lines a # file is refused, because a change inside one is reviewed by hope rather # than read. Over 2000 it is named and the commit goes through, because that # is where a file usually picks up its second subject and splitting it is # still one person's afternoon. # # The excludes are the neighbouring hooks' plus the generated files nobody # writes by hand: vendored vectors, the licence notices, the plan register # and every lock file, each of which is long because a generator made it so. { id = "file-size", name = "file size", entry = "scripts/check-file-size.py", language = "system", types = ["text"], exclude = '^(vendor/|THIRD-PARTY-NOTICES\.txt$|plan/README\.md$|(.*/)?(Cargo\.lock|package-lock\.json|\.terraform\.lock\.hcl)$)', stages = ["pre-commit"] }, { id = "lexicon-tests", name = "lexicon tests", entry = "cargo test -p didbot-lexicon --all-features", language = "system", types = ["file"], files = '^lexicons/.*\.json$', pass_filenames = false, stages = ["pre-commit"] }, # The recommended policies the policy site offers, each judged by this # server against the cases beside it. A person editing a policy or its # cases learns here whether it still refuses and admits what they say. { id = "recommended-policies", name = "recommended policies", entry = "cargo test -p didbot-pds --test recommended_policies", language = "system", types = ["file"], files = '^(policy-site/recommended/.*|crates/didbot-pds/tests/recommended_policies\.rs)$', pass_filenames = false, stages = ["pre-commit"] }, # The did.bot site's own build, assembled from three inputs that each need # a check of their own: the Astro pages build; docs/*.md is copied in and # link-rewritten (site/scripts/prepare-docs.mjs) and every file in docs/ # has to end up reachable; `cargo doc`'s output is mounted at /api/ and # every page linking there has to find something. scripts/build-site.sh is # the one thing that runs all three in the right order, so this hook is # that script rather than a shorter command that would drift from it. # Assumes site/node_modules already exists — like the cargo hooks above # assume a toolchain, this does not `npm ci` on every commit, and # build-site.sh says so plainly if it is missing. # No exclusion for site/node_modules or site/dist: both are gitignored, so # neither can appear in a commit's file list for this pattern to match # against. { id = "site-build", name = "site build + tests", entry = "scripts/build-site.sh", language = "system", types = ["file"], files = '(^site/.*|^docs/.*\.md$|^scripts/(build-site|build-wasm)\.sh$|^crates/didbot-site-anim/.*)', pass_filenames = false, stages = ["pre-commit"] }, # publish-site.sh's own tests stub the aws CLI out entirely (see the # script), so this is cheap enough to run on every touch of these files — # unlike site-build above, it never invokes cargo or npm. { id = "publish-site-tests", name = "publish-site tests", entry = "scripts/test-publish-site.sh", language = "system", files = '^scripts/(publish-site|publish-lib|test-publish-site|build-site)\.sh$', pass_filenames = false, stages = ["pre-commit"] }, # policy.did.bot's build, its two wasm modules and then Vite, and its tests # against the built tree. scripts/build-policy-site.sh runs them in that # order, so this hook is that script. It needs the wasm toolchain site-build # needs, and runs its own `npm ci`. infra/policy-site/main.tf is a trigger # because policy-site/tests/check-csp.mjs reads the CSP from it; the crates # and lexicons are triggers because the page ships them as wasm. { id = "policy-site-build", name = "policy site build + tests", entry = "scripts/build-policy-site.sh", language = "system", types = ["file"], files = '(^policy-site/.*|^scripts/build-(policy-site|policy-wasm|policy-anim-wasm|wasm)\.sh$|^infra/policy-site/main\.tf$|^crates/didbot-(lexicon|policy|policy-cedar|policy-check|policy-count|policy-records|policy-regex|schema|site-anim)/.*|^lexicons/bot/did/.*)', pass_filenames = false, stages = ["pre-commit"] }, # publish-policy-site.sh's tests stub the aws CLI as publish-site's do, and # are as cheap. { id = "publish-policy-site-tests", name = "publish-policy-site tests", entry = "scripts/test-publish-policy-site.sh", language = "system", files = '^scripts/(publish-policy-site|publish-lib|test-publish-policy-site|build-policy-site)\.sh$', pass_filenames = false, stages = ["pre-commit"] },]
# Conventional Commits, checked as the message is written. It matters more than# house style here because the version is computed from these subjects (see# cliff.toml): a subject that does not parse is a change that silently does not# count towards the next version, and the failure is invisible until someone# reads a version number and disbelieves it.## The rules are in committed.toml.[[repos]]repo = "https://github.com/crate-ci/committed"rev = "v1.1.11"hooks = [{ id = "committed" }]
# Stamp a Change-Id trailer on commits that lack one: the identity a stacked# pull request is matched to its commits by. Added by `atgc repo configure# --hook-config`; the script is atgc's, and does nothing to a commit that has# an id already.[[repos]]repo = "local"hooks = [ { id = "change-id", name = "change-id", entry = "scripts/change-id-hook.sh", language = "system", stages = ["commit-msg"], always_run = true },]