Risk table: kind before name, token matching, dependency floor, labelled set; short route --explain

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Sonnet 5.5 committed 2026-11-23 11:40:00 -07:00
1 parent 29d239ca3b
commit 7572f27154
6 files changed
+1227 -110

No files matched your search

+34 -49
View File
@@ -10,58 +10,43 @@
"release": {"contract": true, "checks": "every check (--all)", "requirement_model": true, "risk_note": true, "independent_evidence": true, "retro": "yes"}
},
"patterns": [
{"glob": "**/migrations/**", "profile": "data", "reason": "database migration changes stored data shape"},
{"glob": "**/migration/**", "profile": "data", "reason": "data migration code"},
{"glob": "**/*.sql", "profile": "data", "reason": "SQL changes stored data or schema"},
{"glob": "**/schema/**", "profile": "data", "reason": "schema definition"},
{"glob": "**/*.schema.*", "profile": "data", "reason": "schema definition"},
{"glob": "**/alembic/**", "profile": "data", "reason": "database migration history"},
{"glob": "**/db/**", "profile": "data", "reason": "persistence layer"},
{"glob": "**/storage/**", "profile": "data", "reason": "persistence layer"},
{"glob": "**/persist*/**", "profile": "data", "reason": "persistence layer"},
{"glob": "**/auth/**", "profile": "critical", "reason": "authorization or authentication code"},
{"glob": "**/*auth*", "profile": "critical", "reason": "authorization or authentication code"},
{"glob": "**/*secret*", "profile": "critical", "reason": "secret handling"},
{"glob": "**/*crypto*", "profile": "critical", "reason": "cryptography"},
{"glob": "**/*encrypt*", "profile": "critical", "reason": "cryptography"},
{"glob": "**/*payment*", "profile": "critical", "reason": "payments move money"},
{"glob": "**/*billing*", "profile": "critical", "reason": "billing moves money"},
{"glob": "**/*mutex*", "profile": "critical", "reason": "concurrency primitive"},
{"glob": "**/*semaphore*", "profile": "critical", "reason": "concurrency primitive"},
{"glob": "**/*lock*", "profile": "critical", "reason": "concurrency primitive"},
{"glob": "**/hooks/**", "profile": "critical", "reason": "hook wiring runs on every session"},
{"glob": "**/*hook*", "profile": "critical", "reason": "hook wiring runs automatically"},
{"glob": "**/install*", "profile": "critical", "reason": "installer changes the user's machine"},
{"glob": "install*", "profile": "critical", "reason": "installer changes the user's machine"},
{"glob": "**/setup.py", "profile": "critical", "reason": "installer runs at install time"},
{"glob": "**/PKGBUILD", "profile": "critical", "reason": "package build script runs as root tooling"},
{"glob": "VERSION", "profile": "release", "reason": "version marker for a release"},
{"glob": "**/release/**", "profile": "release", "reason": "release machinery"},
{"glob": "**/*release*", "profile": "release", "reason": "release machinery"},
{"glob": "**/api/**", "profile": "integration", "reason": "public interface surface"},
{"glob": "**/public/**", "profile": "integration", "reason": "public interface surface"},
{"glob": "include/**", "profile": "integration", "reason": "public headers are an interface"},
{"glob": "**/parser/**", "profile": "logic", "reason": "parsing logic has a broad input space"},
{"glob": "**/*pars*", "profile": "logic", "reason": "parsing logic has a broad input space"},
{"glob": "**/*lexer*", "profile": "logic", "reason": "lexing logic has a broad input space"},
{"glob": "**/*codec*", "profile": "logic", "reason": "encode/decode logic"},
{"glob": "**/money/**", "profile": "logic", "reason": "money arithmetic must be exact"},
{"glob": "**/*money*", "profile": "logic", "reason": "money arithmetic must be exact"},
{"glob": "**/*rounding*", "profile": "logic", "reason": "rounding rules decide money"},
{"glob": "**/*pricing*", "profile": "logic", "reason": "pricing arithmetic"},
{"glob": "**/algo*/**", "profile": "logic", "reason": "algorithmic logic"},
{"glob": "**/*algorithm*", "profile": "logic", "reason": "algorithmic logic"},
{"glob": "**/*state-machine*", "profile": "logic", "reason": "state machine transitions"},
{"glob": "**/*statemachine*", "profile": "logic", "reason": "state machine transitions"},
{"glob": "**/*.md", "profile": "trivial", "reason": "documentation only"},
{"glob": "**/*.txt", "profile": "trivial", "reason": "plain text only"},
{"glob": "**/*.rst", "profile": "trivial", "reason": "documentation only"},
{"glob": "docs/**", "profile": "trivial", "reason": "documentation only"},
{"glob": "**/*.css", "profile": "trivial", "reason": "styling only"},
{"glob": "**/*.scss", "profile": "trivial", "reason": "styling only"},
{"stage": "kind", "kind": "doc", "glob": ["**/*.{md,mdx,rst,adoc}", "**/{license,licence,copying,notice,authors,contributors}*", "**/.{gitignore,gitattributes,editorconfig,dockerignore,prettierignore,prettierrc*}", "docs/**", "**/docs/**"], "profile": "trivial", "reason": "documentation or repository metadata; no behaviour"},
{"stage": "kind", "kind": "asset", "glob": "**/*.{png,jpg,jpeg,gif,svg,ico,webp,avif,bmp,woff,woff2,ttf,otf,eot,mp3,mp4,wav,ogg,webm,pdf}", "profile": "trivial", "reason": "static asset or image; no behaviour"},
{"stage": "kind", "kind": "style", "glob": "**/*.{css,scss,sass,less,styl}", "profile": "trivial", "reason": "styling only"},
{"stage": "kind", "kind": "content", "glob": ["**/{locales,locale,i18n,translations}/**", "**/*.{po,pot}"], "profile": "trivial", "reason": "translated strings or copy; no behaviour"},
{"stage": "kind", "kind": "template", "glob": "**/.env.{example,sample,template,dist}", "profile": "isolated", "reason": "template of settings, no secrets, but it documents the configuration surface"},
{"stage": "kind", "kind": "fixture", "glob": ["**/{fixtures,testdata,golden,__snapshots__,__mocks__}/**", "**/*.snap"], "profile": "isolated", "reason": "test fixture or snapshot; data for tests, not behaviour"},
{"stage": "kind", "kind": "test", "glob": ["**/{tests,test,__tests__,e2e}/**", "**/spec/**/*.rb", "**/test_*.*", "**/*_test.*", "**/*_spec.*", "**/*.{test,spec}.*", "**/*{Test,Tests}.{java,kt,swift,cs,php,scala}"], "profile": "isolated", "reason": "test code: not trivial, and a test of data or critical code is at least logic", "elevate": true},
{"stage": "kind", "kind": "generated", "glob": ["**/{dist,target,__generated__,generated}/**", "**/*.{pb.go,generated.*,min.js,min.css,g.dart}", "**/*_pb2.py", "**/*_pb2_grpc.py", "**/__pycache__/**", "**/*.pyc"], "profile": "isolated", "reason": "generated or built output; the source that produces it carries the risk"},
{"stage": "kind", "kind": "lockfile", "glob": ["**/*.lock", "**/*.lockb", "**/*-lock.{json,yaml,yml}", "**/*.lock.json", "**/{go.sum,package.resolved,gradle.lockfile,flake.lock}", "**/npm-shrinkwrap.json"], "profile": "integration", "reason": "lockfile: the code you depend on changes without you writing it"},
{"stage": "kind", "kind": "manifest", "glob": ["**/{package.json,cargo.toml,go.mod,gemfile,pipfile,pyproject.toml,setup.py,setup.cfg,pom.xml,composer.json,package.swift,podfile,cartfile,mix.exs,pubspec.yaml,vcpkg.json,conanfile.txt,deno.json}", "**/requirements*.txt", "**/build.gradle*", "**/settings.gradle*", "**/*.{gemspec,csproj,fsproj}"], "profile": "integration", "reason": "dependency or packaging manifest: what your code depends on changes"},
{"stage": "kind", "kind": "vendor", "glob": "**/{vendor,third_party,third-party,node_modules}/**", "profile": "integration", "reason": "vendored code you did not write"},
{"stage": "kind", "kind": "build", "glob": "**/cmakelists.txt", "profile": "isolated", "reason": "build script; text extension, not documentation"},
{"stage": "kind", "kind": "text", "glob": "**/*.txt", "profile": "trivial", "reason": "plain text only"},
{"stage": "name", "token": ["auth", "authn", "authz", "authenticat*", "authoriz*", "oauth", "oidc", "saml", "jwt", "rbac", "acl", "iam", "permission*", "sudoers", "security"], "profile": "critical", "reason": "authentication, authorization or access control"},
{"stage": "name", "token": ["password*", "passwd", "credential*", "secret*", "keystore", "keychain", "keyring", "token*"], "scope": "dir", "profile": "critical", "reason": "secrets and credentials"},
{"stage": "name", "token": ["password*", "passwd", "credential*", "secret*", "keystore", "keychain", "keyring"], "scope": "stem", "profile": "critical", "reason": "secrets and credentials"},
{"stage": "name", "token": ["crypto*", "encrypt*", "decrypt*", "cipher*", "sha256", "aes", "tls"], "profile": "critical", "reason": "cryptography"},
{"stage": "name", "glob": ["**/.env", "**/.env.*", "**/*.pem", "**/*.key", "**/id_rsa*"], "profile": "critical", "reason": "real environment or key file may hold secrets"},
{"stage": "name", "token": ["payment*", "billing", "checkout"], "profile": "critical", "reason": "payments and billing move money"},
{"stage": "name", "token": ["mutex", "semaphore", "spinlock", "rwlock", "lock", "locks", "locking"], "profile": "critical", "reason": "concurrency primitive"},
{"stage": "name", "glob": ["**/{install,uninstall,installer,postinst,preinst}.{sh,bash,ps1,bat,py,rb,go,rs,js}", "**/PKGBUILD", "**/pkgbuild", "**/{postinst,preinst,postrm,prerm}"], "profile": "critical", "reason": "installer changes the user's machine"},
{"stage": "name", "glob": ["VERSION", "**/{release,releases,publish,deploy}.{sh,bash,ps1,py,rb,go,rs,mk,yml,yaml,toml,json,gradle}", "**/{release,releases}/**", "**/.goreleaser*", "**/release.config.*", "**/.github/workflows/*{release,publish,deploy}*"], "profile": "release", "reason": "release or deployment machinery"},
{"stage": "name", "glob": ["**/*.{sql,prisma,ddl,cql}", "**/db/schema.rb", "**/db/migrate/**"], "token": ["migrations", "migration", "migrate", "alembic", "flyway", "liquibase"], "profile": "data", "reason": "database migration or schema: stored data changes shape"},
{"stage": "name", "token": ["db", "database", "storage", "persist*", "backup", "restore"], "scope": "dir", "profile": "data", "reason": "persistence layer"},
{"stage": "name", "token": ["backup", "restore"], "scope": "stem", "profile": "data", "reason": "persistence layer or backup"},
{"stage": "name", "glob": ["include/**", "**/*.{proto,graphql,gql,thrift,avsc,wsdl}", "**/openapi*", "**/swagger*", "**/*.schema.json", "**/protos/**", "**/proto/**"], "profile": "integration", "reason": "public interface surface"},
{"stage": "name", "token": ["api", "apis"], "scope": "dir", "profile": "integration", "reason": "public interface surface"},
{"stage": "name", "glob": ["**/*{feature_flag,feature-flag,featureflag}*", "**/{flags,feature_flags,feature-flags}.*", "**/feature[_-]flags/**"], "profile": "integration", "reason": "runtime switches change behaviour across modules"},
{"stage": "name", "glob": ["**/*.{tf,tfvars}", "**/dockerfile*", "**/*.dockerfile", "**/docker-compose*.{yml,yaml}", "**/compose*.{yml,yaml}", "**/.github/workflows/**", "**/.gitlab-ci.yml", "**/jenkinsfile", "**/.circleci/**", "**/.travis.yml", "**/azure-pipelines.yml", "**/{terraform,k8s,kubernetes,helm,charts,ansible,infra,infrastructure,deploy}/**"], "profile": "integration", "reason": "infrastructure, pipeline or container definition"},
{"stage": "name", "glob": ["**/.githooks/**", "**/.husky/**"], "profile": "integration", "reason": "git hook runs automatically on every commit"},
{"stage": "name", "token": ["pars*", "lexer", "lexing", "tokeniz*", "codec"], "profile": "logic", "reason": "parsing has a broad input space"},
{"stage": "name", "token": ["money", "currenc*", "rounding", "pricing", "tax"], "profile": "logic", "reason": "money arithmetic must be exact"},
{"stage": "name", "glob": ["**/*state-machine*", "**/*statemachine*", "**/*state_machine*"], "token": ["algo", "algos", "algorithm*", "fsm"], "profile": "logic", "reason": "algorithmic logic"},
{"keyword": "migration", "profile": "data", "reason": "diff mentions a data migration"},
{"keyword": "schema change", "profile": "data", "reason": "diff changes a schema"},
{"keyword": "alter table", "profile": "data", "reason": "diff alters stored data"},
{"keyword": "drop table", "profile": "data", "reason": "diff drops stored data"},
{"keyword": "password", "profile": "critical", "reason": "diff handles credentials"},
{"keyword": "secret", "profile": "critical", "reason": "diff handles secrets"},
{"keyword": "encrypt", "profile": "critical", "reason": "diff uses cryptography"},