Files
sisi/canon/risk.json
T
swaitsandClaude Sonnet 5.5 2e31b23713 Risk table: fix the classes of mistake behind the held-out disagreements
Code is never trivial; whole-word tokens; wider logic vocabulary; build config, ORM/DAO/repository data (view and ML models excluded), auto-run files and version markers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 11:48:19 -07:00

65 lines
15 KiB
JSON

{
"profiles": ["trivial", "isolated", "logic", "integration", "data", "critical", "release"],
"requirements": {
"trivial": {"contract": false, "checks": "the diff; a targeted check when one exists", "requirement_model": false, "risk_note": false, "independent_evidence": false, "retro": "only on an anomaly (two send-backs, or a human correction)"},
"isolated": {"contract": true, "checks": "at least one that is not vacuous", "requirement_model": false, "risk_note": false, "independent_evidence": false, "retro": "yes"},
"logic": {"contract": true, "checks": "as isolated, each with covers", "requirement_model": false, "risk_note": false, "independent_evidence": false, "retro": "yes"},
"integration": {"contract": true, "checks": "as logic, plus invariants", "requirement_model": true, "risk_note": true, "independent_evidence": false, "retro": "yes"},
"data": {"contract": true, "checks": "as integration", "requirement_model": true, "risk_note": true, "independent_evidence": true, "retro": "yes"},
"critical": {"contract": true, "checks": "as integration", "requirement_model": true, "risk_note": true, "independent_evidence": true, "retro": "yes"},
"release": {"contract": true, "checks": "every check (--all)", "requirement_model": true, "risk_note": true, "independent_evidence": true, "retro": "yes"}
},
"patterns": [
{"stage": "code", "glob": "**/*.{py,pyi,pyw,js,mjs,cjs,jsx,ts,tsx,mts,cts,vue,svelte,astro,java,kt,kts,scala,groovy,clj,cljs,go,rs,c,h,cc,cpp,cxx,hpp,hh,hxx,m,mm,cs,fs,vb,swift,dart,rb,php,pl,pm,lua,r,jl,ex,exs,erl,hs,ml,mli,nim,zig,sh,bash,zsh,fish,ps1,bat,cmd,sol,sv,vhd,tcl,awk,asm,sql}", "profile": "isolated", "reason": "source code: never trivial, whatever its name or directory"},
{"stage": "kind", "kind": "version", "glob": ["**/{version,.version,version.txt,_version.txt}"], "profile": "release", "reason": "version marker: what a release is called"},
{"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 (unless the file is code)", "unless_code": true},
{"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", "unless_code": true},
{"stage": "kind", "kind": "style", "glob": "**/*.{css,scss,sass,less,styl}", "profile": "trivial", "reason": "styling only", "unless_code": true},
{"stage": "kind", "kind": "content", "glob": ["**/{locales,locale,i18n,translations}/**", "**/*.{po,pot}"], "profile": "trivial", "reason": "translated strings or copy; no behaviour", "unless_code": true},
{"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,makefile,gnumakefile,cmakelists.txt,justfile,rakefile,build,build.bazel,workspace,workspace.bazel,module.bazel,meson.build,build.sbt,project.clj,deps.edn,stack.yaml,sconstruct,build.zig,rebar.config,dune-project,gradle.properties,go.work,environment.yml,brewfile,flake.nix,shell.nix,default.nix,nx.json,turbo.json,lerna.json,tox.ini,noxfile.py,tsconfig.json,jsconfig.json,.babelrc,renovate.json,renovate.json5,dependabot.yml,directory.build.props,directory.packages.props,directory.build.targets,.tool-versions,.nvmrc,.python-version,.bazelversion}", "**/requirements*.txt", "**/build.gradle*", "**/settings.gradle*", "**/*.{gemspec,csproj,fsproj}", "**/tsconfig*.json", "**/jsconfig*.json", "**/{webpack,vite,rollup,babel,esbuild,snowpack,parcel,metro,next,nuxt,svelte,astro,tailwind,postcss,gulpfile,gruntfile,jest,vitest,karma,tsup,swc}.config.*", "**/gulpfile.*", "**/gruntfile.*", "**/.babelrc.*", "**/*.{versions.toml,sln,vcxproj,xcodeproj,pbxproj,nuspec,cabal,bzl}", "**/*.mk", "**/*.build.gradle", "**/constraints*.txt", "**/gradle/**", "**/.github/dependabot.y*ml", "**/cmake/**/*.cmake", "**/*.cmake"], "profile": "integration", "reason": "dependency, packaging or build configuration: what is built, and from what, 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": "text", "glob": "**/*.txt", "profile": "trivial", "reason": "plain text only", "unless_code": true},
{"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", "secrets", "keystore", "keychain", "keyring", "token", "tokens"], "scope": "dir", "profile": "critical", "reason": "secrets and credentials"},
{"stage": "name", "token": ["password*", "passwd", "credential*", "secret", "secrets", "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/**", "**/.git/hooks/**", "**/hooks/{pre-commit,commit-msg,pre-push,post-merge,post-checkout,post-commit,pre-rebase,prepare-commit-msg,pre-receive,post-receive,update,post-rewrite,pre-merge-commit}", "**/{lefthook,.lefthook}.{yml,yaml,json,toml}", "**/.pre-commit-config.yaml"], "profile": "critical", "reason": "git hook: runs automatically on every commit or push"},
{"stage": "name", "token": ["parse", "parser", "parsers", "parsing", "parsed", "parsable", "parseable", "unparse", "lexer", "lexers", "lexing", "lexical", "tokenizer", "tokenizers", "tokenizing", "tokenization", "tokeniser", "codec", "codecs", "decoder", "decoders", "decode", "decoding", "encoder", "encoders", "encode", "encoding", "serializer", "serializers", "serialization", "deserializer", "deserialization", "grammar", "grammars", "expr", "expression", "expressions", "evaluator", "interpreter", "compiler", "cron", "interval", "intervals", "merge", "merger", "merging", "scheduler", "schedulers", "scheduling", "solver", "solvers", "calculator", "calculators", "matcher", "matchers", "regex", "framing", "framer", "protocol", "protocols", "checksum", "limiter", "backoff"], "profile": "logic", "reason": "parsing, codecs, expressions, scheduling and merging have a broad input space (whole words only)"},
{"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"},
{"stage": "name", "token": ["models", "model", "entity", "entities", "dao", "daos", "repository", "repositories", "orm", "persistence"], "except": {"glob": "**/*.{tsx,jsx,vue,svelte}", "token": ["view", "views", "viewmodel", "viewmodels", "component", "components", "page", "pages", "ui", "web", "frontend", "client", "mobile", "screen", "screens", "widget", "widgets", "redux", "vuex", "pinia", "ngrx", "mobx", "zustand", "slice", "slices", "reducer", "reducers", "ml", "ai", "nn", "neural", "training", "train", "torch", "pytorch", "tensorflow", "keras", "sklearn", "inference", "notebooks", "notebook", "onnx", "llm", "vision", "nlp"]}, "profile": "data", "reason": "ORM model, entity, data-access object or repository: defines or touches stored data (front-end view models and machine-learning models are excluded)"},
{"stage": "name", "token": ["store", "stores"], "except": {"glob": ["**/*.{tsx,jsx,vue,svelte,ts,js,mjs}"], "token": ["view", "views", "viewmodel", "viewmodels", "component", "components", "page", "pages", "ui", "web", "frontend", "client", "mobile", "screen", "screens", "widget", "widgets", "redux", "vuex", "pinia", "ngrx", "mobx", "zustand", "slice", "slices", "reducer", "reducers", "ml", "ai", "nn", "neural", "training", "train", "torch", "pytorch", "tensorflow", "keras", "sklearn", "inference", "notebooks", "notebook", "onnx", "llm", "vision", "nlp"]}, "profile": "data", "reason": "data store (front-end state stores and machine-learning paths are excluded)"},
{"stage": "name", "glob": ["**/.{bashrc,bash_profile,bash_login,bash_logout,bash_aliases,zshrc,zshenv,zprofile,zlogin,zlogout,profile,xinitrc,xprofile,xsession,kshrc,cshrc,tcshrc}", "**/{bashrc,zshrc,zshenv,zprofile,profile,bash_profile,xinitrc,xprofile}", "**/profile.d/**", "**/{bashrc.d,zshrc.d,zshenv.d}/**", "**/fish/conf.d/**", "**/fish/config.fish", "**/{rc.local,init.d,rc.d}", "**/{init.d,rc.d}/**", "**/etc/{environment,profile}", "**/*.{service,timer,socket,mount,automount,target}", "**/systemd/**", "**/{crontab,anacrontab}", "**/{crontabs,cron.d,cron.daily,cron.hourly,cron.weekly,cron.monthly}/**", "**/{launchagents,launchdaemons}/**", "**/autostart/**", "**/programs/startup/**"], "profile": "critical", "reason": "runs automatically on a user's machine or in every session"},
{"stage": "name", "glob": ["**/version", "**/.version", "**/{version,_version,__version__}.*", "**/.release-please*", "**/release-please*", "**/.changeset/**", "**/.bumpversion*", "**/.bump2version*", "**/.versionrc*", "**/.releaserc*", "**/.tbump.toml"], "profile": "release", "reason": "version marker or release tooling state"},
{"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"},
{"keyword": "authorize", "profile": "critical", "reason": "diff makes authorization decisions"},
{"keyword": "authentication", "profile": "critical", "reason": "diff handles authentication"},
{"keyword": "payment", "profile": "critical", "reason": "diff moves money"},
{"keyword": "mutex", "profile": "critical", "reason": "diff uses a concurrency primitive"},
{"keyword": "release candidate", "profile": "release", "reason": "diff prepares a release"}
]
}