@terpjs/spec 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (392) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +417 -417
  3. package/VERSION +1 -1
  4. package/app-check-report.schema.json +122 -122
  5. package/assurance-profile.schema.json +70 -70
  6. package/catalog/backend/alembic_downgrades_not_empty.json +22 -22
  7. package/catalog/backend/base_query_not_overridden.json +27 -27
  8. package/catalog/backend/canonical_module_shape.json +22 -22
  9. package/catalog/backend/datetime_columns_are_timezone_aware.json +23 -23
  10. package/catalog/backend/escape_hatch_budget.json +21 -21
  11. package/catalog/backend/events_reference_catalog.json +27 -27
  12. package/catalog/backend/input_schemas_exclude_managed_columns.json +27 -27
  13. package/catalog/backend/input_str_fields_have_max_length.json +22 -22
  14. package/catalog/backend/jobs_reference_catalog.json +27 -27
  15. package/catalog/backend/list_routes_paginate.json +32 -32
  16. package/catalog/backend/modules_declare_policy.json +26 -26
  17. package/catalog/backend/mutations_emit_audit.json +26 -26
  18. package/catalog/backend/mutations_require_write_role.json +32 -32
  19. package/catalog/backend/no_adhoc_background_runtime.json +22 -22
  20. package/catalog/backend/no_adhoc_config_decrypt.json +27 -27
  21. package/catalog/backend/no_adhoc_logging_config.json +22 -22
  22. package/catalog/backend/no_adhoc_middleware.json +27 -27
  23. package/catalog/backend/no_adhoc_permission_literals.json +27 -27
  24. package/catalog/backend/no_app_instantiation.json +22 -22
  25. package/catalog/backend/no_blocking_sleep.json +22 -22
  26. package/catalog/backend/no_cross_module_imports.json +21 -21
  27. package/catalog/backend/no_dependency_overrides.json +27 -27
  28. package/catalog/backend/no_destructive_migrations.json +22 -22
  29. package/catalog/backend/no_dynamic_sql.json +22 -22
  30. package/catalog/backend/no_empty_tests.json +22 -22
  31. package/catalog/backend/no_eval_or_exec.json +22 -22
  32. package/catalog/backend/no_hardcoded_credentials.json +21 -21
  33. package/catalog/backend/no_internal_imports.json +22 -22
  34. package/catalog/backend/no_manual_actor_stamping.json +27 -27
  35. package/catalog/backend/no_manual_ownership_checks.json +32 -32
  36. package/catalog/backend/no_manual_scope_filtering.json +27 -27
  37. package/catalog/backend/no_manual_table_schema.json +22 -22
  38. package/catalog/backend/no_manual_version_assignment.json +22 -22
  39. package/catalog/backend/no_mutable_default_args.json +22 -22
  40. package/catalog/backend/no_naive_datetime.json +22 -22
  41. package/catalog/backend/no_oversized_python_files.json +22 -22
  42. package/catalog/backend/no_print.json +22 -22
  43. package/catalog/backend/no_raw_app_routes.json +26 -26
  44. package/catalog/backend/no_raw_connection_access.json +27 -27
  45. package/catalog/backend/no_raw_file_references.json +27 -27
  46. package/catalog/backend/no_raw_outbound_http.json +22 -22
  47. package/catalog/backend/no_raw_session_construction.json +22 -22
  48. package/catalog/backend/no_star_imports.json +22 -22
  49. package/catalog/backend/no_todo_fixme.json +22 -22
  50. package/catalog/backend/no_unique_columns_on_soft_delete_models.json +22 -22
  51. package/catalog/backend/offset_queries_declare_ordering.json +22 -22
  52. package/catalog/backend/path_id_params_are_uuid.json +22 -22
  53. package/catalog/backend/policy_refs_resolve.json +27 -27
  54. package/catalog/backend/public_modules_are_read_only.json +26 -26
  55. package/catalog/backend/reads_use_base_query.json +27 -27
  56. package/catalog/backend/response_model_not_table_model.json +27 -27
  57. package/catalog/backend/routes_declare_response_model.json +27 -27
  58. package/catalog/backend/safe_methods_are_read_only.json +31 -31
  59. package/catalog/backend/schemas_exclude_sensitive_fields.json +32 -32
  60. package/catalog/backend/session_imported_from_sqlmodel.json +22 -22
  61. package/catalog/backend/table_models_use_base_table.json +22 -22
  62. package/catalog/backend/tables_have_migrations.json +27 -27
  63. package/catalog/backend/tenant_scoped_models_use_scoped_service.json +22 -22
  64. package/catalog/backend/ungoverned_escape_hatch.json +21 -21
  65. package/catalog/backend/update_schemas_inherit_base_update_schema.json +32 -32
  66. package/catalog/frontend/escape-hatch.json +21 -21
  67. package/catalog/frontend/generated-client-only.json +26 -26
  68. package/catalog/frontend/layout-contract.json +26 -26
  69. package/catalog/frontend/no-cross-module-imports.json +21 -21
  70. package/catalog/frontend/no-deep-imports.json +25 -25
  71. package/catalog/frontend/no-dom-html-injection.json +22 -22
  72. package/catalog/frontend/no-eval.json +21 -21
  73. package/catalog/frontend/no-inline-styling.json +25 -25
  74. package/catalog/frontend/no-style-imports.json +24 -24
  75. package/catalog/frontend/no-unsafe-href.json +21 -21
  76. package/catalog/frontend/no-unsafe-target-blank.json +21 -21
  77. package/catalog/frontend/router-links.json +22 -22
  78. package/catalog/frontend/token-styled-elements.json +25 -25
  79. package/catalog/schema.json +95 -95
  80. package/corpus/PENDING.json +4 -4
  81. package/corpus/RESIDUALS.json +21 -21
  82. package/corpus/backend/alembic_downgrades_not_empty/compliant-01/modules/notes/migrations/versions/0001_change.py +6 -6
  83. package/corpus/backend/alembic_downgrades_not_empty/violation-01/modules/notes/migrations/versions/0001_change.py +6 -6
  84. package/corpus/backend/base_query_not_overridden/compliant-01/modules/notes/service.py +8 -8
  85. package/corpus/backend/base_query_not_overridden/compliant-02/modules/notes/service.py +8 -8
  86. package/corpus/backend/base_query_not_overridden/violation-01/modules/notes/service.py +8 -8
  87. package/corpus/backend/base_query_not_overridden/violation-02/expected-findings.json +7 -7
  88. package/corpus/backend/base_query_not_overridden/violation-02/modules/notes/service.py +8 -8
  89. package/corpus/backend/canonical_module_shape/compliant-01/modules/notes/models.py +6 -6
  90. package/corpus/backend/canonical_module_shape/compliant-01/modules/notes/module.py +7 -7
  91. package/corpus/backend/canonical_module_shape/compliant-01/modules/notes/router.py +3 -3
  92. package/corpus/backend/canonical_module_shape/compliant-01/modules/notes/schemas.py +10 -10
  93. package/corpus/backend/canonical_module_shape/compliant-01/modules/notes/service.py +5 -5
  94. package/corpus/backend/canonical_module_shape/violation-01/modules/notes/router.py +3 -3
  95. package/corpus/backend/datetime_columns_are_timezone_aware/compliant-01/modules/notes/models.py +12 -12
  96. package/corpus/backend/datetime_columns_are_timezone_aware/violation-01/modules/notes/models.py +12 -12
  97. package/corpus/backend/datetime_columns_are_timezone_aware/violation-02/modules/notes/models.py +13 -13
  98. package/corpus/backend/datetime_columns_are_timezone_aware/violation-03/modules/notes/models.py +15 -15
  99. package/corpus/backend/escape_hatch_budget/compliant-01/escape-hatch-budget.json +3 -3
  100. package/corpus/backend/escape_hatch_budget/compliant-01/modules/notes/service.py +2 -2
  101. package/corpus/backend/escape_hatch_budget/compliant-02/escape-hatch-budget.json +1 -1
  102. package/corpus/backend/escape_hatch_budget/compliant-02/modules/notes/service.py +4 -4
  103. package/corpus/backend/escape_hatch_budget/violation-01/escape-hatch-budget.json +1 -1
  104. package/corpus/backend/escape_hatch_budget/violation-01/modules/notes/service.py +2 -2
  105. package/corpus/backend/escape_hatch_budget/violation-02/escape-hatch-budget.json +3 -3
  106. package/corpus/backend/escape_hatch_budget/violation-02/modules/notes/service.py +4 -4
  107. package/corpus/backend/events_reference_catalog/compliant-01/modules/notes/module.py +9 -9
  108. package/corpus/backend/events_reference_catalog/violation-01/modules/notes/module.py +8 -8
  109. package/corpus/backend/input_schemas_exclude_managed_columns/compliant-01/modules/notes/schemas.py +6 -6
  110. package/corpus/backend/input_schemas_exclude_managed_columns/violation-01/expected-findings.json +7 -7
  111. package/corpus/backend/input_schemas_exclude_managed_columns/violation-01/modules/notes/schemas.py +9 -9
  112. package/corpus/backend/input_schemas_exclude_managed_columns/violation-02/expected-findings.json +12 -12
  113. package/corpus/backend/input_schemas_exclude_managed_columns/violation-02/modules/notes/router.py +14 -14
  114. package/corpus/backend/input_str_fields_have_max_length/compliant-01/modules/notes/schemas.py +4 -4
  115. package/corpus/backend/input_str_fields_have_max_length/violation-01/modules/notes/schemas.py +2 -2
  116. package/corpus/backend/jobs_reference_catalog/compliant-01/modules/notes/service.py +5 -5
  117. package/corpus/backend/jobs_reference_catalog/violation-01/modules/notes/service.py +2 -2
  118. package/corpus/backend/list_routes_paginate/compliant-01/modules/notes/router.py +6 -6
  119. package/corpus/backend/list_routes_paginate/violation-01/modules/notes/router.py +3 -3
  120. package/corpus/backend/modules_declare_policy/compliant-01/modules/notes/module.py +7 -7
  121. package/corpus/backend/modules_declare_policy/violation-01/modules/notes/module.py +6 -6
  122. package/corpus/backend/mutations_emit_audit/compliant-01/modules/notes/service.py +9 -9
  123. package/corpus/backend/mutations_emit_audit/violation-01/modules/notes/service.py +4 -4
  124. package/corpus/backend/mutations_require_write_role/compliant-01/modules/notes/module.py +7 -7
  125. package/corpus/backend/mutations_require_write_role/compliant-01/modules/notes/router.py +3 -3
  126. package/corpus/backend/mutations_require_write_role/compliant-02/modules/notes/module.py +7 -7
  127. package/corpus/backend/mutations_require_write_role/compliant-02/modules/notes/router.py +3 -3
  128. package/corpus/backend/mutations_require_write_role/violation-01/expected-findings.json +7 -7
  129. package/corpus/backend/mutations_require_write_role/violation-01/modules/notes/module.py +7 -7
  130. package/corpus/backend/mutations_require_write_role/violation-01/modules/notes/router.py +3 -3
  131. package/corpus/backend/mutations_require_write_role/violation-02/expected-findings.json +7 -7
  132. package/corpus/backend/mutations_require_write_role/violation-02/modules/notes/module.py +7 -7
  133. package/corpus/backend/mutations_require_write_role/violation-02/modules/notes/router.py +5 -5
  134. package/corpus/backend/mutations_require_write_role/violation-03/expected-findings.json +7 -7
  135. package/corpus/backend/mutations_require_write_role/violation-03/modules/notes/module.py +10 -10
  136. package/corpus/backend/mutations_require_write_role/violation-03/modules/notes/router.py +3 -3
  137. package/corpus/backend/no_adhoc_background_runtime/compliant-01/modules/notes/service.py +9 -9
  138. package/corpus/backend/no_adhoc_background_runtime/violation-01/modules/notes/service.py +5 -5
  139. package/corpus/backend/no_adhoc_background_runtime/violation-02/modules/notes/service.py +3 -3
  140. package/corpus/backend/no_adhoc_config_decrypt/compliant-01/modules/billing/service.py +2 -2
  141. package/corpus/backend/no_adhoc_config_decrypt/violation-01/modules/billing/service.py +2 -2
  142. package/corpus/backend/no_adhoc_logging_config/compliant-01/modules/notes/service.py +3 -3
  143. package/corpus/backend/no_adhoc_logging_config/violation-01/modules/notes/service.py +3 -3
  144. package/corpus/backend/no_adhoc_middleware/compliant-01/main.py +3 -3
  145. package/corpus/backend/no_adhoc_middleware/violation-01/main.py +4 -4
  146. package/corpus/backend/no_adhoc_middleware/violation-02/main.py +5 -5
  147. package/corpus/backend/no_adhoc_permission_literals/compliant-01/modules/notes/module.py +3 -3
  148. package/corpus/backend/no_adhoc_permission_literals/compliant-02/modules/notes/router.py +5 -5
  149. package/corpus/backend/no_adhoc_permission_literals/violation-01/expected-findings.json +7 -7
  150. package/corpus/backend/no_adhoc_permission_literals/violation-01/modules/notes/module.py +1 -1
  151. package/corpus/backend/no_adhoc_permission_literals/violation-02/expected-findings.json +7 -7
  152. package/corpus/backend/no_adhoc_permission_literals/violation-02/modules/notes/router.py +2 -2
  153. package/corpus/backend/no_adhoc_permission_literals/violation-03/expected-findings.json +12 -12
  154. package/corpus/backend/no_adhoc_permission_literals/violation-03/modules/notes/module.py +10 -10
  155. package/corpus/backend/no_app_instantiation/compliant-01/main.py +3 -3
  156. package/corpus/backend/no_app_instantiation/violation-01/main.py +3 -3
  157. package/corpus/backend/no_blocking_sleep/compliant-01/modules/notes/service.py +2 -2
  158. package/corpus/backend/no_blocking_sleep/violation-01/modules/notes/service.py +5 -5
  159. package/corpus/backend/no_cross_module_imports/compliant-01/modules/a/service.py +1 -1
  160. package/corpus/backend/no_cross_module_imports/violation-01/modules/a/service.py +1 -1
  161. package/corpus/backend/no_cross_module_imports/violation-02/modules/a/service.py +1 -1
  162. package/corpus/backend/no_dependency_overrides/compliant-01/main.py +12 -12
  163. package/corpus/backend/no_dependency_overrides/violation-01/main.py +11 -11
  164. package/corpus/backend/no_destructive_migrations/compliant-01/modules/notes/migrations/versions/0001_change.py +3 -3
  165. package/corpus/backend/no_destructive_migrations/compliant-02/modules/notes/migrations/versions/0001_change.py +8 -8
  166. package/corpus/backend/no_destructive_migrations/violation-01/expected-findings.json +7 -7
  167. package/corpus/backend/no_destructive_migrations/violation-01/modules/notes/migrations/versions/0001_change.py +2 -2
  168. package/corpus/backend/no_destructive_migrations/violation-02/expected-findings.json +7 -7
  169. package/corpus/backend/no_destructive_migrations/violation-02/modules/notes/migrations/versions/0001_change.py +2 -2
  170. package/corpus/backend/no_destructive_migrations/violation-03/expected-findings.json +7 -7
  171. package/corpus/backend/no_destructive_migrations/violation-03/modules/notes/migrations/versions/0001_change.py +3 -3
  172. package/corpus/backend/no_destructive_migrations/violation-04/expected-findings.json +12 -12
  173. package/corpus/backend/no_destructive_migrations/violation-04/modules/notes/migrations/versions/0001_change.py +6 -6
  174. package/corpus/backend/no_destructive_migrations/violation-05/expected-findings.json +12 -12
  175. package/corpus/backend/no_destructive_migrations/violation-05/modules/notes/migrations/versions/0001_change.py +3 -3
  176. package/corpus/backend/no_dynamic_sql/compliant-01/modules/notes/service.py +1 -1
  177. package/corpus/backend/no_dynamic_sql/compliant-02/modules/notes/service.py +20 -20
  178. package/corpus/backend/no_dynamic_sql/violation-01/modules/notes/service.py +2 -2
  179. package/corpus/backend/no_dynamic_sql/violation-02/modules/notes/service.py +2 -2
  180. package/corpus/backend/no_dynamic_sql/violation-03/modules/notes/service.py +7 -7
  181. package/corpus/backend/no_dynamic_sql/violation-04/modules/notes/service.py +16 -16
  182. package/corpus/backend/no_empty_tests/compliant-01/tests/test_notes.py +2 -2
  183. package/corpus/backend/no_empty_tests/violation-01/tests/test_notes.py +2 -2
  184. package/corpus/backend/no_eval_or_exec/compliant-01/modules/notes/service.py +2 -2
  185. package/corpus/backend/no_eval_or_exec/violation-01/modules/notes/service.py +2 -2
  186. package/corpus/backend/no_hardcoded_credentials/compliant-01/modules/billing/service.py +3 -3
  187. package/corpus/backend/no_hardcoded_credentials/compliant-02/modules/billing/service.py +18 -18
  188. package/corpus/backend/no_hardcoded_credentials/violation-01/expected-findings.json +7 -7
  189. package/corpus/backend/no_hardcoded_credentials/violation-01/modules/billing/service.py +2 -2
  190. package/corpus/backend/no_hardcoded_credentials/violation-02/expected-findings.json +7 -7
  191. package/corpus/backend/no_hardcoded_credentials/violation-02/modules/billing/service.py +1 -1
  192. package/corpus/backend/no_hardcoded_credentials/violation-03/expected-findings.json +22 -22
  193. package/corpus/backend/no_hardcoded_credentials/violation-03/modules/billing/service.py +11 -11
  194. package/corpus/backend/no_hardcoded_credentials/violation-04/expected-findings.json +12 -12
  195. package/corpus/backend/no_hardcoded_credentials/violation-04/modules/billing/service.py +8 -8
  196. package/corpus/backend/no_hardcoded_credentials/violation-05/expected-findings.json +12 -12
  197. package/corpus/backend/no_hardcoded_credentials/violation-05/modules/billing/service.py +4 -4
  198. package/corpus/backend/no_internal_imports/compliant-01/modules/notes/service.py +1 -1
  199. package/corpus/backend/no_internal_imports/violation-01/modules/notes/service.py +1 -1
  200. package/corpus/backend/no_manual_actor_stamping/compliant-01/modules/notes/service.py +5 -5
  201. package/corpus/backend/no_manual_actor_stamping/compliant-02/modules/notes/schemas.py +12 -12
  202. package/corpus/backend/no_manual_actor_stamping/violation-01/modules/notes/service.py +3 -3
  203. package/corpus/backend/no_manual_actor_stamping/violation-02/expected-findings.json +7 -7
  204. package/corpus/backend/no_manual_actor_stamping/violation-02/modules/notes/service.py +4 -4
  205. package/corpus/backend/no_manual_ownership_checks/compliant-01/modules/journals/service.py +3 -3
  206. package/corpus/backend/no_manual_ownership_checks/compliant-02/modules/journals/schemas.py +11 -11
  207. package/corpus/backend/no_manual_ownership_checks/violation-01/modules/journals/service.py +3 -3
  208. package/corpus/backend/no_manual_ownership_checks/violation-02/expected-findings.json +7 -7
  209. package/corpus/backend/no_manual_ownership_checks/violation-02/modules/journals/service.py +9 -9
  210. package/corpus/backend/no_manual_ownership_checks/violation-03/expected-findings.json +7 -7
  211. package/corpus/backend/no_manual_ownership_checks/violation-03/modules/notes/jobs.py +1 -1
  212. package/corpus/backend/no_manual_ownership_checks/violation-03/modules/notes/models.py +7 -7
  213. package/corpus/backend/no_manual_ownership_checks/violation-03/modules/notes/module.py +11 -11
  214. package/corpus/backend/no_manual_ownership_checks/violation-03/modules/notes/service.py +7 -7
  215. package/corpus/backend/no_manual_scope_filtering/compliant-01/modules/notes/service.py +8 -8
  216. package/corpus/backend/no_manual_scope_filtering/compliant-02/modules/notes/schemas.py +12 -12
  217. package/corpus/backend/no_manual_scope_filtering/violation-01/modules/notes/service.py +2 -2
  218. package/corpus/backend/no_manual_scope_filtering/violation-02/modules/notes/service.py +2 -2
  219. package/corpus/backend/no_manual_scope_filtering/violation-03/expected-findings.json +7 -7
  220. package/corpus/backend/no_manual_scope_filtering/violation-03/modules/notes/service.py +7 -7
  221. package/corpus/backend/no_manual_table_schema/compliant-01/modules/notes/models.py +6 -6
  222. package/corpus/backend/no_manual_table_schema/violation-01/modules/notes/models.py +8 -8
  223. package/corpus/backend/no_manual_version_assignment/compliant-01/modules/notes/service.py +5 -5
  224. package/corpus/backend/no_manual_version_assignment/violation-01/modules/notes/service.py +3 -3
  225. package/corpus/backend/no_manual_version_assignment/violation-02/modules/notes/service.py +3 -3
  226. package/corpus/backend/no_manual_version_assignment/violation-03/modules/notes/service.py +3 -3
  227. package/corpus/backend/no_mutable_default_args/compliant-01/modules/notes/service.py +3 -3
  228. package/corpus/backend/no_mutable_default_args/violation-01/modules/notes/service.py +2 -2
  229. package/corpus/backend/no_naive_datetime/compliant-01/modules/notes/service.py +2 -2
  230. package/corpus/backend/no_naive_datetime/violation-01/modules/notes/service.py +2 -2
  231. package/corpus/backend/no_naive_datetime/violation-02/modules/notes/service.py +2 -2
  232. package/corpus/backend/no_oversized_python_files/compliant-01/modules/notes/service.py +9 -9
  233. package/corpus/backend/no_oversized_python_files/violation-01/modules/notes/service.py +530 -530
  234. package/corpus/backend/no_print/compliant-01/modules/notes/service.py +7 -7
  235. package/corpus/backend/no_print/violation-01/modules/notes/service.py +2 -2
  236. package/corpus/backend/no_raw_app_routes/compliant-01/main.py +12 -12
  237. package/corpus/backend/no_raw_app_routes/violation-01/main.py +10 -10
  238. package/corpus/backend/no_raw_app_routes/violation-02/main.py +16 -16
  239. package/corpus/backend/no_raw_app_routes/violation-03/main.py +12 -12
  240. package/corpus/backend/no_raw_app_routes/violation-04/main.py +10 -10
  241. package/corpus/backend/no_raw_app_routes/violation-05/main.py +12 -12
  242. package/corpus/backend/no_raw_app_routes/violation-06/main.py +10 -10
  243. package/corpus/backend/no_raw_connection_access/compliant-01/modules/notes/service.py +5 -5
  244. package/corpus/backend/no_raw_connection_access/violation-01/modules/notes/service.py +2 -2
  245. package/corpus/backend/no_raw_connection_access/violation-02/modules/notes/service.py +2 -2
  246. package/corpus/backend/no_raw_file_references/compliant-01/modules/notes/models.py +10 -10
  247. package/corpus/backend/no_raw_file_references/violation-01/modules/notes/models.py +9 -9
  248. package/corpus/backend/no_raw_outbound_http/compliant-01/modules/notes/service.py +2 -2
  249. package/corpus/backend/no_raw_outbound_http/compliant-03/modules/notes/service.py +12 -12
  250. package/corpus/backend/no_raw_outbound_http/violation-01/expected-findings.json +7 -7
  251. package/corpus/backend/no_raw_outbound_http/violation-01/modules/notes/service.py +1 -1
  252. package/corpus/backend/no_raw_outbound_http/violation-02/expected-findings.json +7 -7
  253. package/corpus/backend/no_raw_outbound_http/violation-02/modules/notes/service.py +1 -1
  254. package/corpus/backend/no_raw_outbound_http/violation-03/expected-findings.json +7 -7
  255. package/corpus/backend/no_raw_outbound_http/violation-03/modules/notes/service.py +1 -1
  256. package/corpus/backend/no_raw_outbound_http/violation-04/expected-findings.json +12 -12
  257. package/corpus/backend/no_raw_outbound_http/violation-04/modules/notes/service.py +7 -7
  258. package/corpus/backend/no_raw_outbound_http/violation-05/expected-findings.json +12 -12
  259. package/corpus/backend/no_raw_outbound_http/violation-05/modules/notes/service.py +5 -5
  260. package/corpus/backend/no_raw_outbound_http/violation-06/expected-findings.json +12 -12
  261. package/corpus/backend/no_raw_outbound_http/violation-06/modules/notes/service.py +2 -2
  262. package/corpus/backend/no_raw_session_construction/compliant-01/modules/notes/service.py +3 -3
  263. package/corpus/backend/no_raw_session_construction/violation-01/modules/notes/service.py +3 -3
  264. package/corpus/backend/no_star_imports/compliant-01/modules/notes/service.py +1 -1
  265. package/corpus/backend/no_star_imports/violation-01/modules/notes/service.py +1 -1
  266. package/corpus/backend/no_todo_fixme/compliant-01/modules/notes/service.py +3 -3
  267. package/corpus/backend/no_todo_fixme/violation-01/modules/notes/service.py +3 -3
  268. package/corpus/backend/no_unique_columns_on_soft_delete_models/compliant-01/modules/notes/models.py +17 -17
  269. package/corpus/backend/no_unique_columns_on_soft_delete_models/violation-01/expected-findings.json +7 -7
  270. package/corpus/backend/no_unique_columns_on_soft_delete_models/violation-01/modules/notes/models.py +6 -6
  271. package/corpus/backend/no_unique_columns_on_soft_delete_models/violation-02/expected-findings.json +7 -7
  272. package/corpus/backend/no_unique_columns_on_soft_delete_models/violation-02/modules/notes/models.py +13 -13
  273. package/corpus/backend/no_unique_columns_on_soft_delete_models/violation-03/expected-findings.json +7 -7
  274. package/corpus/backend/no_unique_columns_on_soft_delete_models/violation-03/modules/notes/models.py +16 -16
  275. package/corpus/backend/offset_queries_declare_ordering/compliant-01/modules/notes/service.py +4 -4
  276. package/corpus/backend/offset_queries_declare_ordering/violation-01/modules/notes/service.py +2 -2
  277. package/corpus/backend/path_id_params_are_uuid/compliant-01/modules/notes/router.py +6 -6
  278. package/corpus/backend/path_id_params_are_uuid/violation-01/modules/notes/router.py +6 -6
  279. package/corpus/backend/policy_refs_resolve/compliant-01/modules/notes/module.py +7 -7
  280. package/corpus/backend/policy_refs_resolve/violation-01/modules/notes/module.py +8 -8
  281. package/corpus/backend/public_modules_are_read_only/compliant-01/modules/notes/module.py +7 -7
  282. package/corpus/backend/public_modules_are_read_only/compliant-01/modules/notes/router.py +3 -3
  283. package/corpus/backend/public_modules_are_read_only/violation-01/expected-findings.json +7 -7
  284. package/corpus/backend/public_modules_are_read_only/violation-01/modules/notes/module.py +7 -7
  285. package/corpus/backend/public_modules_are_read_only/violation-01/modules/notes/router.py +3 -3
  286. package/corpus/backend/public_modules_are_read_only/violation-02/expected-findings.json +7 -7
  287. package/corpus/backend/public_modules_are_read_only/violation-02/modules/notes/module.py +7 -7
  288. package/corpus/backend/public_modules_are_read_only/violation-02/modules/notes/router.py +5 -5
  289. package/corpus/backend/reads_use_base_query/compliant-01/modules/notes/models.py +6 -6
  290. package/corpus/backend/reads_use_base_query/compliant-01/modules/notes/service.py +8 -8
  291. package/corpus/backend/reads_use_base_query/compliant-02/modules/notes/models.py +9 -9
  292. package/corpus/backend/reads_use_base_query/compliant-02/modules/notes/service.py +9 -9
  293. package/corpus/backend/reads_use_base_query/violation-01/modules/notes/models.py +6 -6
  294. package/corpus/backend/reads_use_base_query/violation-01/modules/notes/service.py +9 -9
  295. package/corpus/backend/reads_use_base_query/violation-02/expected-findings.json +7 -7
  296. package/corpus/backend/reads_use_base_query/violation-02/modules/notes/models.py +6 -6
  297. package/corpus/backend/reads_use_base_query/violation-02/modules/notes/service.py +8 -8
  298. package/corpus/backend/response_model_not_table_model/compliant-01/modules/notes/models.py +6 -6
  299. package/corpus/backend/response_model_not_table_model/compliant-01/modules/notes/router.py +3 -3
  300. package/corpus/backend/response_model_not_table_model/compliant-01/modules/notes/schemas.py +5 -5
  301. package/corpus/backend/response_model_not_table_model/violation-01/modules/notes/models.py +6 -6
  302. package/corpus/backend/response_model_not_table_model/violation-01/modules/notes/router.py +3 -3
  303. package/corpus/backend/routes_declare_response_model/compliant-01/modules/notes/router.py +8 -8
  304. package/corpus/backend/routes_declare_response_model/violation-01/modules/notes/router.py +3 -3
  305. package/corpus/backend/safe_methods_are_read_only/compliant-01/modules/notes/router.py +6 -6
  306. package/corpus/backend/safe_methods_are_read_only/compliant-02/modules/notes/router.py +5 -5
  307. package/corpus/backend/safe_methods_are_read_only/violation-01/expected-findings.json +7 -7
  308. package/corpus/backend/safe_methods_are_read_only/violation-01/modules/notes/router.py +3 -3
  309. package/corpus/backend/safe_methods_are_read_only/violation-02/expected-findings.json +7 -7
  310. package/corpus/backend/safe_methods_are_read_only/violation-02/modules/notes/router.py +5 -5
  311. package/corpus/backend/safe_methods_are_read_only/violation-03/expected-findings.json +7 -7
  312. package/corpus/backend/safe_methods_are_read_only/violation-03/modules/notes/router.py +3 -3
  313. package/corpus/backend/schemas_exclude_sensitive_fields/compliant-01/modules/users/schemas.py +5 -5
  314. package/corpus/backend/schemas_exclude_sensitive_fields/compliant-02/modules/accounts/schemas.py +12 -12
  315. package/corpus/backend/schemas_exclude_sensitive_fields/violation-01/expected-findings.json +7 -7
  316. package/corpus/backend/schemas_exclude_sensitive_fields/violation-01/modules/users/schemas.py +3 -3
  317. package/corpus/backend/schemas_exclude_sensitive_fields/violation-02/expected-findings.json +7 -7
  318. package/corpus/backend/schemas_exclude_sensitive_fields/violation-02/modules/connectors/router.py +8 -8
  319. package/corpus/backend/schemas_exclude_sensitive_fields/violation-03/expected-findings.json +17 -17
  320. package/corpus/backend/schemas_exclude_sensitive_fields/violation-03/modules/integrations/schemas.py +7 -7
  321. package/corpus/backend/session_imported_from_sqlmodel/compliant-01/modules/notes/service.py +5 -5
  322. package/corpus/backend/session_imported_from_sqlmodel/violation-01/modules/notes/service.py +5 -5
  323. package/corpus/backend/table_models_use_base_table/compliant-01/modules/notes/models.py +6 -6
  324. package/corpus/backend/table_models_use_base_table/violation-01/modules/notes/models.py +5 -5
  325. package/corpus/backend/tables_have_migrations/compliant-01/modules/notes/migrations/versions/0a1b2c3d4e5f_create_notes_tables.py +22 -22
  326. package/corpus/backend/tables_have_migrations/compliant-01/modules/notes/models.py +6 -6
  327. package/corpus/backend/tables_have_migrations/compliant-02/capabilities/ledger/models.py +6 -6
  328. package/corpus/backend/tables_have_migrations/violation-01/expected-findings.json +7 -7
  329. package/corpus/backend/tables_have_migrations/violation-01/modules/notes/models.py +6 -6
  330. package/corpus/backend/tables_have_migrations/violation-02/expected-findings.json +7 -7
  331. package/corpus/backend/tables_have_migrations/violation-02/modules/notes/models.py +10 -10
  332. package/corpus/backend/tenant_scoped_models_use_scoped_service/compliant-01/modules/projects/models.py +6 -6
  333. package/corpus/backend/tenant_scoped_models_use_scoped_service/compliant-01/modules/projects/service.py +5 -5
  334. package/corpus/backend/tenant_scoped_models_use_scoped_service/compliant-02/modules/projects/models.py +8 -8
  335. package/corpus/backend/tenant_scoped_models_use_scoped_service/compliant-02/modules/projects/service.py +5 -5
  336. package/corpus/backend/tenant_scoped_models_use_scoped_service/violation-01/modules/projects/models.py +6 -6
  337. package/corpus/backend/tenant_scoped_models_use_scoped_service/violation-01/modules/projects/service.py +5 -5
  338. package/corpus/backend/ungoverned_escape_hatch/compliant-01/modules/notes/service.py +5 -5
  339. package/corpus/backend/ungoverned_escape_hatch/compliant-02/modules/notes/service.py +4 -4
  340. package/corpus/backend/ungoverned_escape_hatch/violation-01/modules/notes/service.py +2 -2
  341. package/corpus/backend/update_schemas_inherit_base_update_schema/compliant-01/modules/notes/schemas.py +2 -2
  342. package/corpus/backend/update_schemas_inherit_base_update_schema/violation-01/modules/notes/schemas.py +2 -2
  343. package/corpus/backend/update_schemas_inherit_base_update_schema/violation-02/modules/notes/schemas.py +5 -5
  344. package/corpus/frontend/escape-hatch/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  345. package/corpus/frontend/escape-hatch/violation-01/src/modules/widgets/Widget.tsx +4 -4
  346. package/corpus/frontend/escape-hatch/violation-02/src/modules/widgets/Widget.tsx +7 -7
  347. package/corpus/frontend/escape-hatch/violation-03/src/modules/widgets/Widget.tsx +7 -7
  348. package/corpus/frontend/generated-client-only/compliant-01/src/modules/widgets/Widget.tsx +6 -6
  349. package/corpus/frontend/generated-client-only/compliant-02/src/modules/widgets/Widget.tsx +21 -21
  350. package/corpus/frontend/generated-client-only/compliant-03/src/modules/widgets/Widget.tsx +7 -7
  351. package/corpus/frontend/generated-client-only/compliant-04/src/modules/widgets/Widget.tsx +17 -17
  352. package/corpus/frontend/generated-client-only/violation-01/src/modules/widgets/Widget.tsx +3 -3
  353. package/corpus/frontend/generated-client-only/violation-02/src/modules/widgets/Widget.tsx +9 -9
  354. package/corpus/frontend/generated-client-only/violation-03/src/modules/widgets/Widget.tsx +14 -14
  355. package/corpus/frontend/generated-client-only/violation-04/src/modules/widgets/Widget.tsx +6 -6
  356. package/corpus/frontend/layout-contract/compliant-01/layout-contract.json +3 -3
  357. package/corpus/frontend/layout-contract/compliant-01/src/modules/widgets/Widget.tsx +8 -8
  358. package/corpus/frontend/layout-contract/violation-01/layout-contract.json +3 -3
  359. package/corpus/frontend/layout-contract/violation-01/src/modules/widgets/Widget.tsx +8 -8
  360. package/corpus/frontend/no-cross-module-imports/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  361. package/corpus/frontend/no-cross-module-imports/violation-01/src/modules/widgets/Widget.tsx +3 -3
  362. package/corpus/frontend/no-deep-imports/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  363. package/corpus/frontend/no-deep-imports/violation-01/src/modules/widgets/Widget.tsx +2 -2
  364. package/corpus/frontend/no-dom-html-injection/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  365. package/corpus/frontend/no-dom-html-injection/compliant-02/src/modules/widgets/Widget.tsx +11 -11
  366. package/corpus/frontend/no-dom-html-injection/violation-01/src/modules/widgets/Widget.tsx +3 -3
  367. package/corpus/frontend/no-dom-html-injection/violation-02/src/modules/widgets/Widget.tsx +7 -7
  368. package/corpus/frontend/no-dom-html-injection/violation-03/src/modules/widgets/Widget.tsx +12 -12
  369. package/corpus/frontend/no-eval/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  370. package/corpus/frontend/no-eval/compliant-02/src/modules/widgets/Widget.tsx +11 -11
  371. package/corpus/frontend/no-eval/violation-01/src/modules/widgets/Widget.tsx +3 -3
  372. package/corpus/frontend/no-eval/violation-02/src/modules/widgets/Widget.tsx +7 -7
  373. package/corpus/frontend/no-eval/violation-03/src/modules/widgets/Widget.tsx +10 -10
  374. package/corpus/frontend/no-eval/violation-04/src/modules/widgets/Widget.tsx +6 -6
  375. package/corpus/frontend/no-inline-styling/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  376. package/corpus/frontend/no-inline-styling/violation-01/src/modules/widgets/Widget.tsx +3 -3
  377. package/corpus/frontend/no-inline-styling/violation-02/src/modules/widgets/Widget.tsx +6 -6
  378. package/corpus/frontend/no-style-imports/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  379. package/corpus/frontend/no-style-imports/violation-01/src/modules/widgets/Widget.tsx +2 -2
  380. package/corpus/frontend/no-unsafe-href/compliant-01/src/modules/widgets/Widget.tsx +3 -3
  381. package/corpus/frontend/no-unsafe-href/violation-01/src/modules/widgets/Widget.tsx +3 -3
  382. package/corpus/frontend/no-unsafe-target-blank/compliant-01/src/modules/widgets/Widget.tsx +3 -3
  383. package/corpus/frontend/no-unsafe-target-blank/violation-01/src/modules/widgets/Widget.tsx +3 -3
  384. package/corpus/frontend/router-links/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  385. package/corpus/frontend/router-links/violation-01/src/modules/widgets/Widget.tsx +3 -3
  386. package/corpus/frontend/token-styled-elements/compliant-01/src/modules/widgets/Widget.tsx +4 -4
  387. package/corpus/frontend/token-styled-elements/compliant-02/src/modules/widgets/Widget.tsx +4 -4
  388. package/corpus/frontend/token-styled-elements/violation-01/src/modules/widgets/Widget.tsx +3 -3
  389. package/findings.schema.json +40 -40
  390. package/package.json +23 -23
  391. package/restricted-surface.json +10 -10
  392. package/scorecard.schema.json +52 -52
@@ -1,10 +1,10 @@
1
- from terp.core import ModuleSpec, Policy
2
-
3
- spec = ModuleSpec(
4
- name="notes",
5
- router=router,
6
- policy=Policy(
7
- read="notes:read",
8
- write_role="editor",
9
- ),
10
- )
1
+ from terp.core import ModuleSpec, Policy
2
+
3
+ spec = ModuleSpec(
4
+ name="notes",
5
+ router=router,
6
+ policy=Policy(
7
+ read="notes:read",
8
+ write_role="editor",
9
+ ),
10
+ )
@@ -1,3 +1,3 @@
1
- from terp.core import create_app
2
-
3
- app = create_app(modules=[])
1
+ from terp.core import create_app
2
+
3
+ app = create_app(modules=[])
@@ -1,3 +1,3 @@
1
- from fastapi import FastAPI
2
-
3
- app = FastAPI(title='notes')
1
+ from fastapi import FastAPI
2
+
3
+ app = FastAPI(title='notes')
@@ -1,2 +1,2 @@
1
- def run(worker):
2
- worker.wait_for_completion()
1
+ def run(worker):
2
+ worker.wait_for_completion()
@@ -1,5 +1,5 @@
1
- import time
2
-
3
-
4
- def run():
5
- time.sleep(1)
1
+ import time
2
+
3
+
4
+ def run():
5
+ time.sleep(1)
@@ -1 +1 @@
1
- from terp.core import BaseService
1
+ from terp.core import BaseService
@@ -1 +1 @@
1
- from app.modules.b.models import Thing
1
+ from app.modules.b.models import Thing
@@ -1 +1 @@
1
- from ..b.service import TaskService
1
+ from ..b.service import TaskService
@@ -1,12 +1,12 @@
1
- """Compliant: the composition root wires seams through create_app only."""
2
-
3
- from terp.core import create_app
4
-
5
- from app.auth import principal_provider
6
-
7
-
8
- def build():
9
- return create_app([], principal_provider=principal_provider)
10
-
11
-
12
- app = build()
1
+ """Compliant: the composition root wires seams through create_app only."""
2
+
3
+ from terp.core import create_app
4
+
5
+ from app.auth import principal_provider
6
+
7
+
8
+ def build():
9
+ return create_app([], principal_provider=principal_provider)
10
+
11
+
12
+ app = build()
@@ -1,11 +1,11 @@
1
- """Violation: rebinding the principal seam disables authentication app-wide."""
2
-
3
- from terp.core import create_app, get_principal
4
-
5
-
6
- def build():
7
- return create_app([])
8
-
9
-
10
- app = build()
11
- app.dependency_overrides[get_principal] = lambda: None
1
+ """Violation: rebinding the principal seam disables authentication app-wide."""
2
+
3
+ from terp.core import create_app, get_principal
4
+
5
+
6
+ def build():
7
+ return create_app([])
8
+
9
+
10
+ app = build()
11
+ app.dependency_overrides[get_principal] = lambda: None
@@ -1,3 +1,3 @@
1
- def upgrade():
2
- op.add_column('notes', column)
3
- op.alter_column('notes', 'title', nullable=False)
1
+ def upgrade():
2
+ op.add_column('notes', column)
3
+ op.alter_column('notes', 'title', nullable=False)
@@ -1,8 +1,8 @@
1
- def downgrade():
2
- op.drop_table('notes')
3
-
4
-
5
- def upgrade():
6
- op.execute("UPDATE notes SET title = 'untitled' WHERE title IS NULL")
7
- op.execute('DROP INDEX ix_notes_title')
8
- op.alter_column('notes', 'title', nullable=True)
1
+ def downgrade():
2
+ op.drop_table('notes')
3
+
4
+
5
+ def upgrade():
6
+ op.execute("UPDATE notes SET title = 'untitled' WHERE title IS NULL")
7
+ op.execute('DROP INDEX ix_notes_title')
8
+ op.alter_column('notes', 'title', nullable=True)
@@ -1,7 +1,7 @@
1
- [
2
- {
3
- "rule": "backend/no_destructive_migrations",
4
- "path": "modules/notes/migrations/versions/0001_change.py",
5
- "line": 2
6
- }
7
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_destructive_migrations",
4
+ "path": "modules/notes/migrations/versions/0001_change.py",
5
+ "line": 2
6
+ }
7
+ ]
@@ -1,2 +1,2 @@
1
- def upgrade():
2
- op.drop_table('notes')
1
+ def upgrade():
2
+ op.drop_table('notes')
@@ -1,7 +1,7 @@
1
- [
2
- {
3
- "rule": "backend/no_destructive_migrations",
4
- "path": "modules/notes/migrations/versions/0001_change.py",
5
- "line": 2
6
- }
7
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_destructive_migrations",
4
+ "path": "modules/notes/migrations/versions/0001_change.py",
5
+ "line": 2
6
+ }
7
+ ]
@@ -1,2 +1,2 @@
1
- def upgrade():
2
- op.execute('DROP TABLE notes')
1
+ def upgrade():
2
+ op.execute('DROP TABLE notes')
@@ -1,7 +1,7 @@
1
- [
2
- {
3
- "rule": "backend/no_destructive_migrations",
4
- "path": "modules/notes/migrations/versions/0001_change.py",
5
- "line": 3
6
- }
7
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_destructive_migrations",
4
+ "path": "modules/notes/migrations/versions/0001_change.py",
5
+ "line": 3
6
+ }
7
+ ]
@@ -1,3 +1,3 @@
1
- # terp-allow-destructive-migration: the pre-0.6.0 bespoke file-level waiver is retired
2
- def upgrade():
3
- op.drop_table('notes_beta')
1
+ # terp-allow-destructive-migration: the pre-0.6.0 bespoke file-level waiver is retired
2
+ def upgrade():
3
+ op.drop_table('notes_beta')
@@ -1,12 +1,12 @@
1
- [
2
- {
3
- "rule": "backend/no_destructive_migrations",
4
- "path": "modules/notes/migrations/versions/0001_change.py",
5
- "line": 5
6
- },
7
- {
8
- "rule": "backend/no_destructive_migrations",
9
- "path": "modules/notes/migrations/versions/0001_change.py",
10
- "line": 6
11
- }
12
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_destructive_migrations",
4
+ "path": "modules/notes/migrations/versions/0001_change.py",
5
+ "line": 5
6
+ },
7
+ {
8
+ "rule": "backend/no_destructive_migrations",
9
+ "path": "modules/notes/migrations/versions/0001_change.py",
10
+ "line": 6
11
+ }
12
+ ]
@@ -1,6 +1,6 @@
1
- import sqlalchemy as sa
2
-
3
-
4
- def upgrade():
5
- op.drop_column('notes', 'legacy_flag')
6
- op.alter_column('notes', 'title', type_=sa.Text())
1
+ import sqlalchemy as sa
2
+
3
+
4
+ def upgrade():
5
+ op.drop_column('notes', 'legacy_flag')
6
+ op.alter_column('notes', 'title', type_=sa.Text())
@@ -1,12 +1,12 @@
1
- [
2
- {
3
- "rule": "backend/no_destructive_migrations",
4
- "path": "modules/notes/migrations/versions/0001_change.py",
5
- "line": 2
6
- },
7
- {
8
- "rule": "backend/no_destructive_migrations",
9
- "path": "modules/notes/migrations/versions/0001_change.py",
10
- "line": 3
11
- }
12
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_destructive_migrations",
4
+ "path": "modules/notes/migrations/versions/0001_change.py",
5
+ "line": 2
6
+ },
7
+ {
8
+ "rule": "backend/no_destructive_migrations",
9
+ "path": "modules/notes/migrations/versions/0001_change.py",
10
+ "line": 3
11
+ }
12
+ ]
@@ -1,3 +1,3 @@
1
- def upgrade():
2
- op.execute('DELETE FROM notes WHERE deleted_at IS NOT NULL')
3
- op.execute('TRUNCATE TABLE notes_audit')
1
+ def upgrade():
2
+ op.execute('DELETE FROM notes WHERE deleted_at IS NOT NULL')
3
+ op.execute('TRUNCATE TABLE notes_audit')
@@ -1 +1 @@
1
- stmt = text('SELECT * FROM notes WHERE id=:id')
1
+ stmt = text('SELECT * FROM notes WHERE id=:id')
@@ -1,20 +1,20 @@
1
- """Compliant near-misses: static SQL that merely LOOKS dynamic must stay clean.
2
-
3
- * adjacent string literals merge into one static literal at parse time — that is
4
- juxtaposition, not concatenation;
5
- * a comment or a plain string mentioning ``text(f"...")`` is not a call;
6
- * parameters bind data without building SQL.
7
- """
8
-
9
- from sqlalchemy import text
10
-
11
- # text(f"SELECT * FROM notes WHERE id={note_id}") in a comment must not fire.
12
- GUIDE = 'never call text(f"SELECT ...") — bind parameters instead'
13
-
14
-
15
- def fetch(session, note_id):
16
- stmt = text(
17
- "SELECT id, title FROM notes "
18
- "WHERE id = :id AND deleted_at IS NULL"
19
- )
20
- return session.execute(stmt, {"id": note_id})
1
+ """Compliant near-misses: static SQL that merely LOOKS dynamic must stay clean.
2
+
3
+ * adjacent string literals merge into one static literal at parse time — that is
4
+ juxtaposition, not concatenation;
5
+ * a comment or a plain string mentioning ``text(f"...")`` is not a call;
6
+ * parameters bind data without building SQL.
7
+ """
8
+
9
+ from sqlalchemy import text
10
+
11
+ # text(f"SELECT * FROM notes WHERE id={note_id}") in a comment must not fire.
12
+ GUIDE = 'never call text(f"SELECT ...") — bind parameters instead'
13
+
14
+
15
+ def fetch(session, note_id):
16
+ stmt = text(
17
+ "SELECT id, title FROM notes "
18
+ "WHERE id = :id AND deleted_at IS NULL"
19
+ )
20
+ return session.execute(stmt, {"id": note_id})
@@ -1,2 +1,2 @@
1
- def run(note_id):
2
- return text(f'SELECT * FROM notes WHERE id={note_id}')
1
+ def run(note_id):
2
+ return text(f'SELECT * FROM notes WHERE id={note_id}')
@@ -1,2 +1,2 @@
1
- def run(table_name):
2
- return text('SELECT * FROM ' + table_name)
1
+ def run(table_name):
2
+ return text('SELECT * FROM ' + table_name)
@@ -1,7 +1,7 @@
1
- """Violation: attribute-qualified text() with .format() — qualification must not evade."""
2
-
3
- import sqlalchemy
4
-
5
-
6
- def find_all(session, table_name):
7
- return session.execute(sqlalchemy.text("SELECT * FROM {}".format(table_name)))
1
+ """Violation: attribute-qualified text() with .format() — qualification must not evade."""
2
+
3
+ import sqlalchemy
4
+
5
+
6
+ def find_all(session, table_name):
7
+ return session.execute(sqlalchemy.text("SELECT * FROM {}".format(table_name)))
@@ -1,16 +1,16 @@
1
- """Violation: SQL built into a variable (multiline %-format) and passed to text().
2
-
3
- Deliberately session-free: the case must trigger only ``no_dynamic_sql`` (a
4
- ``session.execute(text(...))`` receiver would additionally trip the
5
- ``mutations_emit_audit`` smuggled-DML detection -- a different rule's concern).
6
- """
7
-
8
- from sqlalchemy import text
9
-
10
-
11
- def build_search(term):
12
- query = (
13
- "SELECT id FROM notes "
14
- "WHERE title LIKE '%%%s%%'" % term
15
- )
16
- return text(query)
1
+ """Violation: SQL built into a variable (multiline %-format) and passed to text().
2
+
3
+ Deliberately session-free: the case must trigger only ``no_dynamic_sql`` (a
4
+ ``session.execute(text(...))`` receiver would additionally trip the
5
+ ``mutations_emit_audit`` smuggled-DML detection -- a different rule's concern).
6
+ """
7
+
8
+ from sqlalchemy import text
9
+
10
+
11
+ def build_search(term):
12
+ query = (
13
+ "SELECT id FROM notes "
14
+ "WHERE title LIKE '%%%s%%'" % term
15
+ )
16
+ return text(query)
@@ -1,2 +1,2 @@
1
- def test_run():
2
- assert 1 + 1 == 2
1
+ def test_run():
2
+ assert 1 + 1 == 2
@@ -1,2 +1,2 @@
1
- def test_run():
2
- pass
1
+ def test_run():
2
+ pass
@@ -1,2 +1,2 @@
1
- def run(payload):
2
- return int(payload)
1
+ def run(payload):
2
+ return int(payload)
@@ -1,2 +1,2 @@
1
- def run(payload):
2
- return eval(payload)
1
+ def run(payload):
2
+ return eval(payload)
@@ -1,3 +1,3 @@
1
- password = ''
2
- api_key = settings.API_KEY
3
- token = os.environ['TOKEN']
1
+ password = ''
2
+ api_key = settings.API_KEY
3
+ token = os.environ['TOKEN']
@@ -1,18 +1,18 @@
1
- """Compliant near-misses: credential-adjacent code that must stay clean.
2
-
3
- * a credential-shaped name is fine when the value is dynamic (env read) or not a
4
- string (a numeric policy knob);
5
- * names that merely resemble the credential words (``passphrase_env``,
6
- ``credentials_path``) are not in the shape list;
7
- * comments and truncated look-alike tokens are not secrets.
8
- """
9
-
10
- import os
11
-
12
- token_kind = os.environ.get("TOKEN_KIND", "opaque")
13
- password_min_length = 12
14
- passphrase_env = "BILLING_PASSPHRASE"
15
- credentials_path = "/run/secrets/billing.json"
16
-
17
- # password = "hunter2" in a comment must not fire.
18
- EXAMPLE_DOC = "an AKIA_EXAMPLE_NOT_A_KEY placeholder is not a real AWS key id"
1
+ """Compliant near-misses: credential-adjacent code that must stay clean.
2
+
3
+ * a credential-shaped name is fine when the value is dynamic (env read) or not a
4
+ string (a numeric policy knob);
5
+ * names that merely resemble the credential words (``passphrase_env``,
6
+ ``credentials_path``) are not in the shape list;
7
+ * comments and truncated look-alike tokens are not secrets.
8
+ """
9
+
10
+ import os
11
+
12
+ token_kind = os.environ.get("TOKEN_KIND", "opaque")
13
+ password_min_length = 12
14
+ passphrase_env = "BILLING_PASSPHRASE"
15
+ credentials_path = "/run/secrets/billing.json"
16
+
17
+ # password = "hunter2" in a comment must not fire.
18
+ EXAMPLE_DOC = "an AKIA_EXAMPLE_NOT_A_KEY placeholder is not a real AWS key id"
@@ -1,7 +1,7 @@
1
- [
2
- {
3
- "rule": "backend/no_hardcoded_credentials",
4
- "path": "modules/billing/service.py",
5
- "line": 2
6
- }
7
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_hardcoded_credentials",
4
+ "path": "modules/billing/service.py",
5
+ "line": 2
6
+ }
7
+ ]
@@ -1,2 +1,2 @@
1
- def configure(self):
2
- password = 'not-from-config'
1
+ def configure(self):
2
+ password = 'not-from-config'
@@ -1,7 +1,7 @@
1
- [
2
- {
3
- "rule": "backend/no_hardcoded_credentials",
4
- "path": "modules/billing/service.py",
5
- "line": 1
6
- }
7
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_hardcoded_credentials",
4
+ "path": "modules/billing/service.py",
5
+ "line": 1
6
+ }
7
+ ]
@@ -1 +1 @@
1
- client_secret = 'not-from-config'
1
+ client_secret = 'not-from-config'
@@ -1,22 +1,22 @@
1
- [
2
- {
3
- "rule": "backend/no_hardcoded_credentials",
4
- "path": "modules/billing/service.py",
5
- "line": 5
6
- },
7
- {
8
- "rule": "backend/no_hardcoded_credentials",
9
- "path": "modules/billing/service.py",
10
- "line": 8
11
- },
12
- {
13
- "rule": "backend/no_hardcoded_credentials",
14
- "path": "modules/billing/service.py",
15
- "line": 11
16
- },
17
- {
18
- "rule": "backend/no_hardcoded_credentials",
19
- "path": "modules/billing/service.py",
20
- "line": 11
21
- }
22
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_hardcoded_credentials",
4
+ "path": "modules/billing/service.py",
5
+ "line": 5
6
+ },
7
+ {
8
+ "rule": "backend/no_hardcoded_credentials",
9
+ "path": "modules/billing/service.py",
10
+ "line": 8
11
+ },
12
+ {
13
+ "rule": "backend/no_hardcoded_credentials",
14
+ "path": "modules/billing/service.py",
15
+ "line": 11
16
+ },
17
+ {
18
+ "rule": "backend/no_hardcoded_credentials",
19
+ "path": "modules/billing/service.py",
20
+ "line": 11
21
+ }
22
+ ]
@@ -1,11 +1,11 @@
1
- """Violation: credential-shaped targets beyond a plain name — attribute, annotated, chained."""
2
-
3
-
4
- class BillingClient:
5
- api_key: str = "sk_live_1234567890"
6
-
7
- def configure(self) -> None:
8
- self._auth_token = "Bearer abc.def.ghi"
9
-
10
-
11
- password = admin_password = "hunter2"
1
+ """Violation: credential-shaped targets beyond a plain name — attribute, annotated, chained."""
2
+
3
+
4
+ class BillingClient:
5
+ api_key: str = "sk_live_1234567890"
6
+
7
+ def configure(self) -> None:
8
+ self._auth_token = "Bearer abc.def.ghi"
9
+
10
+
11
+ password = admin_password = "hunter2"
@@ -1,12 +1,12 @@
1
- [
2
- {
3
- "rule": "backend/no_hardcoded_credentials",
4
- "path": "modules/billing/service.py",
5
- "line": 3
6
- },
7
- {
8
- "rule": "backend/no_hardcoded_credentials",
9
- "path": "modules/billing/service.py",
10
- "line": 5
11
- }
12
- ]
1
+ [
2
+ {
3
+ "rule": "backend/no_hardcoded_credentials",
4
+ "path": "modules/billing/service.py",
5
+ "line": 3
6
+ },
7
+ {
8
+ "rule": "backend/no_hardcoded_credentials",
9
+ "path": "modules/billing/service.py",
10
+ "line": 5
11
+ }
12
+ ]
@@ -1,8 +1,8 @@
1
- """Violation: high-confidence secret literals under bland names (format scan, not name scan)."""
2
-
3
- UPLOADER_NOTE = "temporary uploader key AKIAABCDEFGHIJKLMNOP"
4
-
5
- BACKUP_MATERIAL = """
6
- -----BEGIN RSA PRIVATE KEY-----
7
- MIIEow...
8
- """
1
+ """Violation: high-confidence secret literals under bland names (format scan, not name scan)."""
2
+
3
+ UPLOADER_NOTE = "temporary uploader key AKIAABCDEFGHIJKLMNOP"
4
+
5
+ BACKUP_MATERIAL = """
6
+ -----BEGIN RSA PRIVATE KEY-----
7
+ MIIEow...
8
+ """