@radicaltools/cli 0.6.1 → 0.6.3

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 (64) hide show
  1. package/dist/{chunk-SBQRTX3Y.js → chunk-KLTSABHI.js} +1 -1
  2. package/dist/{dist-LSHMW73I.js → dist-5LSJ4CQ3.js} +2 -2
  3. package/dist/hub-catalogue/concern/concern-accessibility.radical +85 -1
  4. package/dist/hub-catalogue/concern/concern-api-collections.radical +78 -1
  5. package/dist/hub-catalogue/concern/concern-api-errors.radical +78 -1
  6. package/dist/hub-catalogue/concern/concern-api-evolution.radical +78 -1
  7. package/dist/hub-catalogue/concern/concern-api-idempotency.radical +121 -3
  8. package/dist/hub-catalogue/concern/concern-api-resource-design.radical +78 -1
  9. package/dist/hub-catalogue/concern/concern-api-style-guide.radical +78 -1
  10. package/dist/hub-catalogue/concern/concern-architecture-style.radical +83 -7
  11. package/dist/hub-catalogue/concern/concern-audit-trail.radical +77 -1
  12. package/dist/hub-catalogue/concern/concern-authentication.radical +178 -8
  13. package/dist/hub-catalogue/concern/concern-authorization.radical +133 -7
  14. package/dist/hub-catalogue/concern/concern-availability.radical +156 -6
  15. package/dist/hub-catalogue/concern/concern-backend-stack.radical +71 -8
  16. package/dist/hub-catalogue/concern/concern-backup-recovery.radical +136 -6
  17. package/dist/hub-catalogue/concern/concern-caching.radical +73 -1
  18. package/dist/hub-catalogue/concern/concern-capacity.radical +124 -5
  19. package/dist/hub-catalogue/concern/concern-ci-cd-pipeline.radical +154 -15
  20. package/dist/hub-catalogue/concern/concern-code-documentation.radical +131 -13
  21. package/dist/hub-catalogue/concern/concern-code-quality-gate.radical +116 -7
  22. package/dist/hub-catalogue/concern/concern-code-review-branching.radical +174 -13
  23. package/dist/hub-catalogue/concern/concern-code-style.radical +148 -16
  24. package/dist/hub-catalogue/concern/concern-communication-style.radical +94 -7
  25. package/dist/hub-catalogue/concern/concern-data-classification.radical +77 -1
  26. package/dist/hub-catalogue/concern/concern-data-consistency.radical +87 -5
  27. package/dist/hub-catalogue/concern/concern-data-store.radical +87 -5
  28. package/dist/hub-catalogue/concern/concern-decomposition.radical +78 -1
  29. package/dist/hub-catalogue/concern/concern-definition-of-done.radical +150 -11
  30. package/dist/hub-catalogue/concern/concern-delivery-metrics.radical +130 -5
  31. package/dist/hub-catalogue/concern/concern-dependency-hygiene.radical +127 -10
  32. package/dist/hub-catalogue/concern/concern-deployment.radical +113 -9
  33. package/dist/hub-catalogue/concern/concern-encryption.radical +146 -5
  34. package/dist/hub-catalogue/concern/concern-error-handling-logging.radical +118 -12
  35. package/dist/hub-catalogue/concern/concern-eu-dora.radical +69 -1
  36. package/dist/hub-catalogue/concern/concern-frontend-stack.radical +148 -9
  37. package/dist/hub-catalogue/concern/concern-incident-management.radical +122 -1
  38. package/dist/hub-catalogue/concern/concern-infrastructure.radical +54 -1
  39. package/dist/hub-catalogue/concern/concern-integration-resilience.radical +110 -5
  40. package/dist/hub-catalogue/concern/concern-messaging.radical +89 -2
  41. package/dist/hub-catalogue/concern/concern-mobile-performance.radical +67 -1
  42. package/dist/hub-catalogue/concern/concern-module-boundaries.radical +92 -5
  43. package/dist/hub-catalogue/concern/concern-observability.radical +105 -1
  44. package/dist/hub-catalogue/concern/concern-operational-readiness.radical +140 -5
  45. package/dist/hub-catalogue/concern/concern-personal-data.radical +206 -7
  46. package/dist/hub-catalogue/concern/concern-quality-priorities.radical +104 -12
  47. package/dist/hub-catalogue/concern/concern-rate-limiting.radical +110 -1
  48. package/dist/hub-catalogue/concern/concern-release-versioning.radical +99 -7
  49. package/dist/hub-catalogue/concern/concern-retention.radical +130 -9
  50. package/dist/hub-catalogue/concern/concern-secrets.radical +196 -12
  51. package/dist/hub-catalogue/concern/concern-secure-coding.radical +122 -1
  52. package/dist/hub-catalogue/concern/concern-secure-development.radical +118 -1
  53. package/dist/hub-catalogue/concern/concern-security-detection.radical +124 -1
  54. package/dist/hub-catalogue/concern/concern-supply-chain.radical +116 -1
  55. package/dist/hub-catalogue/concern/concern-technical-debt.radical +162 -19
  56. package/dist/hub-catalogue/concern/concern-technology-lifecycle.radical +152 -18
  57. package/dist/hub-catalogue/concern/concern-tenant-isolation.radical +111 -1
  58. package/dist/hub-catalogue/concern/concern-test-strategy.radical +83 -7
  59. package/dist/hub-catalogue/concern/concern-threat-modelling.radical +120 -1
  60. package/dist/hub-catalogue/concern/concern-usability.radical +84 -5
  61. package/dist/index.js +68 -18
  62. package/dist/{pdfjs-WWNLOMK2.js → pdfjs-NDGKK4BL.js} +1 -1
  63. package/dist/{undici-53QU2XSN.js → undici-BOSAZUPY.js} +1 -1
  64. package/package.json +1 -1
@@ -18,7 +18,61 @@
18
18
  "id": "code-documentation",
19
19
  "trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
20
20
  "why": "code lives in these elements, so what is written down about it, where, and how it is kept true has to be decided; one decision usually covers a whole repository and is bound to every element built from it.",
21
- "group": "coding"
21
+ "group": "coding",
22
+ "scope": {
23
+ "group": "coding",
24
+ "questions": [
25
+ {
26
+ "key": "TEAM",
27
+ "label": "Who writes the code?",
28
+ "default": "small",
29
+ "hint": "Code others must read and change needs written conventions and documentation.",
30
+ "options": [
31
+ {
32
+ "value": "small",
33
+ "label": "one or two people",
34
+ "description": "One or two developers who know all of it."
35
+ },
36
+ {
37
+ "value": "team",
38
+ "label": "a team",
39
+ "description": "A team of its own, with people joining and leaving."
40
+ },
41
+ {
42
+ "value": "teams",
43
+ "label": "several teams",
44
+ "description": "Several teams working in the same codebase or in parts of it."
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "key": "LIFETIME",
50
+ "label": "How long must the code live?",
51
+ "default": "years",
52
+ "hint": "A prototype thrown away soon needs little; code kept for years needs its debt paid down.",
53
+ "options": [
54
+ {
55
+ "value": "short",
56
+ "label": "a prototype or a short-lived tool",
57
+ "description": "A trial, a demo or a tool for a few months, then thrown away."
58
+ },
59
+ {
60
+ "value": "years",
61
+ "label": "years",
62
+ "description": "It will be kept and changed for years."
63
+ }
64
+ ]
65
+ }
66
+ ],
67
+ "when": [
68
+ {
69
+ "TEAM": [
70
+ "team",
71
+ "teams"
72
+ ]
73
+ }
74
+ ]
75
+ }
22
76
  },
23
77
  "sources": [
24
78
  {
@@ -118,7 +172,13 @@
118
172
  "label": "no public API; internal types documented in code only",
119
173
  "description": "Nothing outside the team calls the element; its exported types and functions carry doc comments and nothing is published. Pick it for a web app or a batch job with no callers, so that no one builds a reference nobody reads."
120
174
  }
121
- ]
175
+ ],
176
+ "scopeWhen": {
177
+ "TEAM": [
178
+ "team",
179
+ "teams"
180
+ ]
181
+ }
122
182
  },
123
183
  {
124
184
  "key": "READMES",
@@ -137,7 +197,13 @@
137
197
  "label": "one README at the repository root",
138
198
  "description": "One README at the root explains how to run and test the whole repository and holds a table of its modules with a line of purpose and an owner each. Pick it for a single-purpose repository where per-module READMEs would repeat the same text."
139
199
  }
140
- ]
200
+ ],
201
+ "scopeWhen": {
202
+ "TEAM": [
203
+ "team",
204
+ "teams"
205
+ ]
206
+ }
141
207
  },
142
208
  {
143
209
  "key": "DOCS_SITE",
@@ -156,7 +222,13 @@
156
222
  "label": "kept and published outside the repository",
157
223
  "description": "Documentation lives in Confluence, Notion, GitBook or a help-centre product, written by people who do not work in the repository, with a link from the README and the release it describes on each page. Pick it when technical writers or support own the documentation, or the readers are end users."
158
224
  }
159
- ]
225
+ ],
226
+ "scopeWhen": {
227
+ "TEAM": [
228
+ "team",
229
+ "teams"
230
+ ]
231
+ }
160
232
  },
161
233
  {
162
234
  "key": "DIAGRAMS",
@@ -175,7 +247,13 @@
175
247
  "label": "hand-drawn images, dated, in the docs folder",
176
248
  "description": "Diagrams are drawn in draw.io or Excalidraw and kept as images in docs/diagrams, each with its editable source file next to it and a caption with its date and author on the page that shows it. Pick it for a small system with one or two diagrams, or sketches whose value is the conversation, not the record."
177
249
  }
178
- ]
250
+ ],
251
+ "scopeWhen": {
252
+ "TEAM": [
253
+ "team",
254
+ "teams"
255
+ ]
256
+ }
179
257
  },
180
258
  {
181
259
  "key": "ADR_DAYS",
@@ -338,7 +416,15 @@
338
416
  "y": 910,
339
417
  "ears_type": "ubiquitous",
340
418
  "action": "carry a doc comment with a one-line summary on at least {{DOC_COMMENT_COVERAGE_PCT}}% of the exported or public symbols of the element, measured on every pull request, with the undocumented ones listed",
341
- "rationale": "Whether or not a reference is published, a symbol without a comment is a blank page for the next reader; a threshold on the whole keeps the gate from blocking every typo while the number is brought up (Google developer documentation style guide on API reference comments; ISO 25010 analysability)."
419
+ "rationale": "Whether or not a reference is published, a symbol without a comment is a blank page for the next reader; a threshold on the whole keeps the gate from blocking every typo while the number is brought up (Google developer documentation style guide on API reference comments; ISO 25010 analysability).",
420
+ "hubWhen": {
421
+ "API_DOCS": [
422
+ "generated",
423
+ "reference",
424
+ "written",
425
+ "none"
426
+ ]
427
+ }
342
428
  },
343
429
  {
344
430
  "id": "req-examples-run",
@@ -425,7 +511,15 @@
425
511
  "ears_type": "state-driven",
426
512
  "precondition": "a page of the documentation (in the docs folder, or in the external space) has no owner, no review date, or a review date older than {{MAX_DOC_AGE_DAYS}} days",
427
513
  "action": "fail the stale-page check naming the page and its owner, so that the page is re-dated after a review or removed",
428
- "rationale": "A page nobody owns is a page nobody updates; a review date makes \"is this still true?\" a question with an answer instead of a guess (Google developer documentation style guide; Write the Docs on documentation maintenance)."
514
+ "rationale": "A page nobody owns is a page nobody updates; a review date makes \"is this still true?\" a question with an answer instead of a guess (Google developer documentation style guide; Write the Docs on documentation maintenance).",
515
+ "hubWhen": {
516
+ "API_DOCS": [
517
+ "generated",
518
+ "reference",
519
+ "written",
520
+ "none"
521
+ ]
522
+ }
429
523
  },
430
524
  {
431
525
  "id": "req-diagram-same-pr",
@@ -562,7 +656,15 @@
562
656
  "y": 910,
563
657
  "given": "a pull request exporting a new function without a doc comment that takes coverage below {{DOC_COMMENT_COVERAGE_PCT}}%",
564
658
  "when": "the doc-comment test runs",
565
- "then": "it fails with the coverage and names the function"
659
+ "then": "it fails with the coverage and names the function",
660
+ "hubWhen": {
661
+ "API_DOCS": [
662
+ "generated",
663
+ "reference",
664
+ "written",
665
+ "none"
666
+ ]
667
+ }
566
668
  },
567
669
  {
568
670
  "id": "sc-examples-run",
@@ -647,7 +749,15 @@
647
749
  "y": 1690,
648
750
  "given": "a page whose review date is {{MAX_DOC_AGE_DAYS}} days old plus one",
649
751
  "when": "the stale-page check runs",
650
- "then": "it fails naming the page and its owner, and passes once the page is re-dated or removed"
752
+ "then": "it fails naming the page and its owner, and passes once the page is re-dated or removed",
753
+ "hubWhen": {
754
+ "API_DOCS": [
755
+ "generated",
756
+ "reference",
757
+ "written",
758
+ "none"
759
+ ]
760
+ }
651
761
  },
652
762
  {
653
763
  "id": "sc-diagram-same-pr",
@@ -689,7 +799,7 @@
689
799
  "status": "accepted",
690
800
  "date": "",
691
801
  "context": "Code lives in this element and will be read, changed and operated by people who were not there when it was written, and by the same people a year later. The forces: a decision that is not written down is re-argued at every change, or quietly reversed; documentation kept away from the code is not updated when the code is, and a page that was true once reads as if it still were; generated reference is always current but says what, never why; a wiki reaches readers who never open a repository, at the price of living where no review and no build can check it; a diagram drawn once drifts from the system it shows the moment the next pull request merges; and every page costs time to keep, so the set has to be small enough that it is kept. The snippets assume one repository layout: source in src/, tests in test/, documentation in docs/ (diagrams in docs/diagrams/), and in a monorepo one directory per workspace under packages/.",
692
- "decision": "Every architecturally significant decision is one Markdown file in {{ADR_DIR}}, numbered and named NNNN-title.md, copied from the template in the same directory in the MADR format: YAML front matter with status, date and decision-makers (and superseded-by on a superseded record), then the sections Context and Problem Statement, Considered Options, Decision Outcome and Consequences. A record leaves status proposed within {{ADR_DAYS}} days. The record is changed in the pull request of the first code that implements it, reviewed by the same reviewers; a superseding record sets the old one's status to superseded with a link, and old records are never rewritten. A test over the front matter runs in CI. API reference: {{API_DOCS}}. READMEs: {{READMES}}. Documentation: {{DOCS_SITE}}. Diagrams: {{DIAGRAMS}}.",
802
+ "decision": "Every architecturally significant decision is one Markdown file in {{ADR_DIR}}, numbered and named NNNN-title.md, copied from the template in the same directory in the MADR format: YAML front matter with status, date and decision-makers (and superseded-by on a superseded record), then the sections Context and Problem Statement, Considered Options, Decision Outcome and Consequences. A record leaves status proposed within {{ADR_DAYS}} days. The record is changed in the pull request of the first code that implements it, reviewed by the same reviewers; a superseding record sets the old one's status to superseded with a link, and old records are never rewritten. A test over the front matter runs in CI. ",
693
803
  "consequences": "• Decisions are versioned, reviewed and searched like code, and travel with the repository when it is forked or archived.\n• Readers who do not open the repository (product, operations, auditors) need a published copy: the docs site renders the folder.\n• The template guarantees fields, not quality: a record with a one-line context passes the test and still explains nothing; reviewers have to read it.\n• Decisions spanning several repositories live in one of them or in a shared one, and the others link to it.",
694
804
  "alternatives": "1. Decisions in an architecture model next to the code: links each decision to the elements it constrains and lets CI check them together, but needs the model to exist and be kept.\n2. A decision log in a wiki: reaches readers outside the repository, but no review with the code and only a scheduled job checks it.\n3. Decisions in commit messages or pull request descriptions: already written, but unsearchable by topic, and commit messages are folded when the branch is squashed.",
695
805
  "hubWhen": {
@@ -708,7 +818,7 @@
708
818
  "status": "accepted",
709
819
  "date": "",
710
820
  "context": "Code lives in this element and will be read, changed and operated by people who were not there when it was written, and by the same people a year later. The forces: a decision that is not written down is re-argued at every change, or quietly reversed; documentation kept away from the code is not updated when the code is, and a page that was true once reads as if it still were; generated reference is always current but says what, never why; a wiki reaches readers who never open a repository, at the price of living where no review and no build can check it; a diagram drawn once drifts from the system it shows the moment the next pull request merges; and every page costs time to keep, so the set has to be small enough that it is kept. The snippets assume one repository layout: source in src/, tests in test/, documentation in docs/ (diagrams in docs/diagrams/), and in a monorepo one directory per workspace under packages/.",
711
- "decision": "Decisions are elements of the architecture model kept in {{MODEL_DIR}} in the repository: with radical.tools, ADR nodes in the Markdown folder with status, date, context, decision, consequences and alternatives, linked with constrains to the containers and components they bind, with derives to the requirements behind them and with implements from the fitness functions that enforce them; `radical check {{MODEL_DIR}}` runs in CI with the rules adr-incomplete and concern-unbound raised to errors in check.json, and a script fails a decision left proposed for more than {{ADR_DAYS}} days. With Structurizr, ADRs in the workspace's decisions folder shown in its ADR view, validated by the CLI. A decision is changed in the same pull request as the first code that implements it; a superseding decision links the old one (radical check reports a superseded decision nothing supersedes) and leaves it in place. API reference: {{API_DOCS}}. READMEs: {{READMES}}. Documentation: {{DOCS_SITE}}. Diagrams: {{DIAGRAMS}}.",
821
+ "decision": "Decisions are elements of the architecture model kept in {{MODEL_DIR}} in the repository: with radical.tools, ADR nodes in the Markdown folder with status, date, context, decision, consequences and alternatives, linked with constrains to the containers and components they bind, with derives to the requirements behind them and with implements from the fitness functions that enforce them; `radical check {{MODEL_DIR}}` runs in CI with the rules adr-incomplete and concern-unbound raised to errors in check.json, and a script fails a decision left proposed for more than {{ADR_DAYS}} days. With Structurizr, ADRs in the workspace's decisions folder shown in its ADR view, validated by the CLI. A decision is changed in the same pull request as the first code that implements it; a superseding decision links the old one (radical check reports a superseded decision nothing supersedes) and leaves it in place. ",
712
822
  "consequences": "• A reader of an element reaches its decisions, requirements and checks from the element, and a decision without a subject is an error, not a forgotten file.\n• The model has to be kept: a team that stops updating it has stale decisions and stale diagrams at once.\n• The model folder is reviewable as text, but the tool is one more thing to install for reading and editing (CLI, Studio or an editor for the DSL).\n• Decisions are published as part of the model, not as a page on their own; readers outside the repository need the rendered site or a viewer.",
713
823
  "alternatives": "1. Decision records as plain files in {{ADR_DIR}}: no tool to learn, but the link from a decision to what it constrains is prose and nothing checks it.\n2. A decision log in a wiki: reaches readers outside the repository, but no review with the code and only a scheduled job checks it.\n3. Decisions both in the model and in a wiki: two copies drift; keep one and link to it.",
714
824
  "hubWhen": {
@@ -727,7 +837,7 @@
727
837
  "status": "accepted",
728
838
  "date": "",
729
839
  "context": "Code lives in this element and will be read, changed and operated by people who were not there when it was written, and by the same people a year later. The forces: a decision that is not written down is re-argued at every change, or quietly reversed; documentation kept away from the code is not updated when the code is, and a page that was true once reads as if it still were; generated reference is always current but says what, never why; a wiki reaches readers who never open a repository, at the price of living where no review and no build can check it; a diagram drawn once drifts from the system it shows the moment the next pull request merges; and every page costs time to keep, so the set has to be small enough that it is kept. The snippets assume one repository layout: source in src/, tests in test/, documentation in docs/ (diagrams in docs/diagrams/), and in a monorepo one directory per workspace under packages/. Here most readers never open the repository: decisions have to be found, read and commented on in the space where those readers already work.",
730
- "decision": "Decisions are pages in the team's space (Confluence with the Decision template, or a Notion database with the same fields), labelled decision, with the content properties status (proposed, accepted, superseded) and date and, on a superseded page, superseded-by: title, decision-makers, context, decision, consequences, options considered. One decision log index page per system links every decision page; the repository README links the index. A page leaves proposed within {{ADR_DAYS}} days; superseding sets the old page's status and the superseded-by property, and old pages are not edited. A weekly job over the space's REST API fails on a page missing a property, a page left proposed too long, and a decision not linked from the index. API reference: {{API_DOCS}}. READMEs: {{READMES}}. Documentation: {{DOCS_SITE}}. Diagrams: {{DIAGRAMS}}.",
840
+ "decision": "Decisions are pages in the team's space (Confluence with the Decision template, or a Notion database with the same fields), labelled decision, with the content properties status (proposed, accepted, superseded) and date and, on a superseded page, superseded-by: title, decision-makers, context, decision, consequences, options considered. One decision log index page per system links every decision page; the repository README links the index. A page leaves proposed within {{ADR_DAYS}} days; superseding sets the old page's status and the superseded-by property, and old pages are not edited. A weekly job over the space's REST API fails on a page missing a property, a page left proposed too long, and a decision not linked from the index. ",
731
841
  "consequences": "• Product, operations and an architecture board read and comment where they already are, with the space's search and notifications.\n• The decision is not reviewed with the code: the reviewer of the pull request has to open the page, and a code change that contradicts a decision is caught by people, not by a check.\n• The space is outside version control: history is the page history, and an export is needed when the space is moved or shut.\n• Links from code to pages break when pages move; the job catches missing pages, not moved ones.",
732
842
  "alternatives": "1. Decision records as files in {{ADR_DIR}}: reviewed with the code and versioned, but invisible to readers who do not open repositories unless published.\n2. Decisions in an architecture model next to the code: connected and checked, but the furthest from readers who live in the wiki.\n3. Files in the repository published to the wiki by a job: one source and both audiences, at the cost of a job to keep and comments that land on the copy.",
733
843
  "hubWhen": {
@@ -837,7 +947,15 @@
837
947
  "cadence": "triggered",
838
948
  "trigger": "pull-request",
839
949
  "invocation": "automated",
840
- "description": "A test opens the TypeScript program from tsconfig.json, walks the exported declarations of every file under src, counts the ones with a JSDoc comment and fails below the threshold, printing the undocumented symbols with their file. For Python, interrogate measures docstring coverage of the public API and fails under the same number; for Java, the javadoc doclint run of the build reports undocumented public members. Where the Code quality gate decision enforces a linter, eslint-plugin-jsdoc's require-jsdoc rule also refuses a new export without a comment on the changed lines.\n\nThreshold: At least {{DOC_COMMENT_COVERAGE_PCT}}% of the exported functions, classes, interfaces, type aliases and variables under src carry a doc comment; the test lists the ones that do not\n\nTool: Vitest with the TypeScript compiler API; interrogate for Python; javadoc -Xdoclint for Java\n\n```ts\n// test/doc-comments.test.ts\nimport ts from 'typescript'\nimport { expect, it } from 'vitest'\n\nconst MIN_PCT = {{DOC_COMMENT_COVERAGE_PCT}}\nconst { config } = ts.readConfigFile('tsconfig.json', ts.sys.readFile)\nconst { fileNames, options } = ts.parseJsonConfigFileContent(config, ts.sys, '.')\nconst program = ts.createProgram(fileNames.filter((f) => f.startsWith('src/') || f.includes('/src/')), options)\nconst checker = program.getTypeChecker()\n\nit(`at least ${MIN_PCT}% of the exported symbols carry a doc comment`, () => {\n const missing: string[] = []\n let total = 0\n for (const file of program.getSourceFiles()) {\n if (file.isDeclarationFile || !program.getRootFileNames().includes(file.fileName)) continue\n const module = checker.getSymbolAtLocation(file)\n for (const symbol of module ? checker.getExportsOfModule(module) : []) {\n const decl = symbol.declarations?.[0]\n if (!decl) continue\n total++\n if (!ts.getJSDocCommentsAndTags(decl).length) missing.push(`${file.fileName}: ${symbol.name}`)\n }\n }\n const pct = total ? ((total - missing.length) * 100) / total : 100\n expect(pct, `${pct.toFixed(1)}% documented; without a comment:\\n${missing.join('\\n')}`).toBeGreaterThanOrEqual(MIN_PCT)\n})\n// Python: interrogate --fail-under {{DOC_COMMENT_COVERAGE_PCT}} src\n```"
950
+ "description": "A test opens the TypeScript program from tsconfig.json, walks the exported declarations of every file under src, counts the ones with a JSDoc comment and fails below the threshold, printing the undocumented symbols with their file. For Python, interrogate measures docstring coverage of the public API and fails under the same number; for Java, the javadoc doclint run of the build reports undocumented public members. Where the Code quality gate decision enforces a linter, eslint-plugin-jsdoc's require-jsdoc rule also refuses a new export without a comment on the changed lines.\n\nThreshold: At least {{DOC_COMMENT_COVERAGE_PCT}}% of the exported functions, classes, interfaces, type aliases and variables under src carry a doc comment; the test lists the ones that do not\n\nTool: Vitest with the TypeScript compiler API; interrogate for Python; javadoc -Xdoclint for Java\n\n```ts\n// test/doc-comments.test.ts\nimport ts from 'typescript'\nimport { expect, it } from 'vitest'\n\nconst MIN_PCT = {{DOC_COMMENT_COVERAGE_PCT}}\nconst { config } = ts.readConfigFile('tsconfig.json', ts.sys.readFile)\nconst { fileNames, options } = ts.parseJsonConfigFileContent(config, ts.sys, '.')\nconst program = ts.createProgram(fileNames.filter((f) => f.startsWith('src/') || f.includes('/src/')), options)\nconst checker = program.getTypeChecker()\n\nit(`at least ${MIN_PCT}% of the exported symbols carry a doc comment`, () => {\n const missing: string[] = []\n let total = 0\n for (const file of program.getSourceFiles()) {\n if (file.isDeclarationFile || !program.getRootFileNames().includes(file.fileName)) continue\n const module = checker.getSymbolAtLocation(file)\n for (const symbol of module ? checker.getExportsOfModule(module) : []) {\n const decl = symbol.declarations?.[0]\n if (!decl) continue\n total++\n if (!ts.getJSDocCommentsAndTags(decl).length) missing.push(`${file.fileName}: ${symbol.name}`)\n }\n }\n const pct = total ? ((total - missing.length) * 100) / total : 100\n expect(pct, `${pct.toFixed(1)}% documented; without a comment:\\n${missing.join('\\n')}`).toBeGreaterThanOrEqual(MIN_PCT)\n})\n// Python: interrogate --fail-under {{DOC_COMMENT_COVERAGE_PCT}} src\n```",
951
+ "hubWhen": {
952
+ "API_DOCS": [
953
+ "generated",
954
+ "reference",
955
+ "written",
956
+ "none"
957
+ ]
958
+ }
841
959
  },
842
960
  {
843
961
  "id": "ff-reference-build",
@@ -18,7 +18,83 @@
18
18
  "id": "code-quality-gate",
19
19
  "trigger": "LIST NODES WHERE (type = \"container\" OR type = \"webapp\") AND external != true",
20
20
  "why": "code lives in these elements, so what a change must pass before it is merged, beyond the tests, has to be decided; one decision usually covers a whole repository and is bound to every element built from it.",
21
- "group": "sdlc"
21
+ "group": "sdlc",
22
+ "scope": {
23
+ "group": "sdlc",
24
+ "questions": [
25
+ {
26
+ "key": "USE",
27
+ "label": "What is the software for?",
28
+ "default": "business",
29
+ "hint": "Software for one's own use can be built by hand; an organisation that runs or ships it needs a repeatable way to build, release and deploy.",
30
+ "options": [
31
+ {
32
+ "value": "personal",
33
+ "label": "our own or home use",
34
+ "description": "A hobby project or a tool for oneself or a household; nobody else depends on it."
35
+ },
36
+ {
37
+ "value": "business",
38
+ "label": "a system an organisation runs",
39
+ "description": "A company or public body runs it for its staff or customers (an internal tool, an online shop, a booking system)."
40
+ },
41
+ {
42
+ "value": "product",
43
+ "label": "a product we ship to others",
44
+ "description": "Software sold or handed to customers who install or run it themselves, or offered to many organisations."
45
+ }
46
+ ]
47
+ },
48
+ {
49
+ "key": "TEAM",
50
+ "label": "Who builds it?",
51
+ "default": "small",
52
+ "hint": "Review, a Definition of Done and delivery metrics need more than one or two people.",
53
+ "options": [
54
+ {
55
+ "value": "small",
56
+ "label": "one or two people",
57
+ "description": "One or two developers."
58
+ },
59
+ {
60
+ "value": "team",
61
+ "label": "a team",
62
+ "description": "A team of its own."
63
+ },
64
+ {
65
+ "value": "teams",
66
+ "label": "several teams",
67
+ "description": "Several teams contributing to it."
68
+ }
69
+ ]
70
+ }
71
+ ],
72
+ "when": [
73
+ {
74
+ "USE": [
75
+ "product"
76
+ ]
77
+ },
78
+ {
79
+ "TEAM": [
80
+ "team",
81
+ "teams"
82
+ ]
83
+ }
84
+ ]
85
+ },
86
+ "scopeAnswers": [
87
+ {
88
+ "when": {
89
+ "TEAM": [
90
+ "small"
91
+ ]
92
+ },
93
+ "answers": {
94
+ "COMPLEXITY": "none"
95
+ }
96
+ }
97
+ ]
22
98
  },
23
99
  "sources": [
24
100
  {
@@ -109,7 +185,13 @@
109
185
  "label": "types only at module boundaries",
110
186
  "description": "Dynamic typing inside modules, with type annotations required and checked only on the parameters and return values of exported or public functions, by one lint rule that runs even where only a formatter is enforced. Pick it for scripts, notebooks and glue code, or a language without a mature checker."
111
187
  }
112
- ]
188
+ ],
189
+ "scopeWhen": {
190
+ "TEAM": [
191
+ "team",
192
+ "teams"
193
+ ]
194
+ }
113
195
  },
114
196
  {
115
197
  "key": "COMPLEXITY",
@@ -157,7 +239,13 @@
157
239
  "label": "every finding fixed before merge",
158
240
  "description": "No baseline: the whole element has zero findings on the main branch, and a change with one cannot merge. Pick it for a new codebase, or after a one-time clean-up; it is the only option that keeps the rule set from drifting into a list of exceptions."
159
241
  }
160
- ]
242
+ ],
243
+ "scopeWhen": {
244
+ "TEAM": [
245
+ "team",
246
+ "teams"
247
+ ]
248
+ }
161
249
  },
162
250
  {
163
251
  "key": "DUPLICATION",
@@ -176,7 +264,13 @@
176
264
  "label": "reported in the pull request",
177
265
  "description": "Duplication is measured on every pull request and the clones are posted as a comment, and the reviewer decides. Pick it as the default: some duplication is better than a wrong abstraction, and the reviewer can tell the two apart."
178
266
  }
179
- ]
267
+ ],
268
+ "scopeWhen": {
269
+ "TEAM": [
270
+ "team",
271
+ "teams"
272
+ ]
273
+ }
180
274
  },
181
275
  {
182
276
  "key": "LINT_MINUTES",
@@ -286,6 +380,11 @@
286
380
  "hubWhen": {
287
381
  "STATIC": [
288
382
  "format-only"
383
+ ],
384
+ "TYPES": [
385
+ "strict",
386
+ "ratchet",
387
+ "loose"
289
388
  ]
290
389
  }
291
390
  },
@@ -520,6 +619,11 @@
520
619
  "hubWhen": {
521
620
  "STATIC": [
522
621
  "format-only"
622
+ ],
623
+ "TYPES": [
624
+ "strict",
625
+ "ratchet",
626
+ "loose"
523
627
  ]
524
628
  }
525
629
  },
@@ -695,7 +799,7 @@
695
799
  "status": "accepted",
696
800
  "date": "",
697
801
  "context": "Code lives in this element and is changed by several people, soon by people who did not write it; what a change must pass before it is merged, beyond its tests, decides whether the code stays readable or decays one pull request at a time. The forces: review time is the scarcest resource and arguing about formatting and obvious mistakes wastes it, while a machine finds those in seconds; a rule that is not enforced is a wish, and a rule that blocks on old code nobody is touching teaches people to switch it off; strict types and complexity limits catch defects early but cost effort on code that was written without them; a baseline that is never lowered becomes permanent; and every check added to the pull request makes the feedback slower, so the whole gate has to finish in minutes. Tests, coverage and mutation score are decided by the Test strategy concern, not here. The snippets assume one repository layout: source in src/, tests in test/, the workflow files under .github/workflows/, and GitHub as the platform (on GitLab the same jobs run in a required pipeline with allow_failure false and the merge-request setting \"pipelines must succeed\").",
698
- "decision": "Every pull request runs the stack's linter, and the format check of the formatter the Code style and conventions pack decides, as required checks within {{LINT_MINUTES}} minutes: ESLint (flat config, eslint:recommended plus typescript-eslint recommended-type-checked) or Biome's linter on TypeScript, ruff check on Python, golangci-lint on Go, detekt on Kotlin. Every rule is an error; unused disable comments are errors; a disable comment needs a description naming the reason. The same versions run on staged files at commit through husky and lint-staged (or pre-commit on Python). Types: {{TYPES}}. Size and complexity: {{COMPLEXITY}}. New findings: {{DEBT}}. Duplicated code: {{DUPLICATION}}. Tests and coverage follow the Test strategy decision.",
802
+ "decision": "Every pull request runs the stack's linter, and the format check of the formatter the Code style and conventions pack decides, as required checks within {{LINT_MINUTES}} minutes: ESLint (flat config, eslint:recommended plus typescript-eslint recommended-type-checked) or Biome's linter on TypeScript, ruff check on Python, golangci-lint on Go, detekt on Kotlin. Every rule is an error; unused disable comments are errors; a disable comment needs a description naming the reason. The same versions run on staged files at commit through husky and lint-staged (or pre-commit on Python). Size and complexity: {{COMPLEXITY}}. Tests and coverage follow the Test strategy decision.",
699
803
  "consequences": "• Obvious mistakes and formatting never reach review; reviewers read for design and correctness.\n• Feedback in seconds locally and in minutes in CI, with no service to run.\n• Rule sets drift unless someone owns them; the recommended set is upgraded with the tool, and each upgrade is a pull request of its own.\n• No history or dashboard across repositories; a team that wants one needs the platform variant.\n• Type-aware ESLint rules need the TypeScript program and are the slowest part; keeping under {{LINT_MINUTES}} minutes needs a cache (eslint --cache) on a large element.",
700
804
  "alternatives": "1. A code-analysis platform (SonarQube) with a gate on new code: cross-repository view and evidence, but a service to run or pay for and a slower loop.\n2. Only a formatter: nothing to maintain, but every mistake a linter finds is left to the reviewer.\n3. Lint rules at warning severity: easier to adopt, but warnings are ignored within a month and the rule set becomes noise.",
701
805
  "hubWhen": {
@@ -714,7 +818,7 @@
714
818
  "status": "accepted",
715
819
  "date": "",
716
820
  "context": "Code lives in this element and is changed by several people, soon by people who did not write it; what a change must pass before it is merged, beyond its tests, decides whether the code stays readable or decays one pull request at a time. The forces: review time is the scarcest resource and arguing about formatting and obvious mistakes wastes it, while a machine finds those in seconds; a rule that is not enforced is a wish, and a rule that blocks on old code nobody is touching teaches people to switch it off; strict types and complexity limits catch defects early but cost effort on code that was written without them; a baseline that is never lowered becomes permanent; and every check added to the pull request makes the feedback slower, so the whole gate has to finish in minutes. Tests, coverage and mutation score are decided by the Test strategy concern, not here. The snippets assume one repository layout: source in src/, tests in test/, the workflow files under .github/workflows/, and GitHub as the platform (on GitLab the same jobs run in a required pipeline with allow_failure false and the merge-request setting \"pipelines must succeed\").",
717
- "decision": "Every pull request is analysed by SonarQube Server (or SonarCloud) and the pipeline waits for its quality gate (sonar.qualitygate.wait=true); the gate holds conditions on new code only, with new code defined against the main branch: 0 new bugs, 0 new vulnerabilities, 100% of new security hotspots reviewed, maintainability rating A, and the duplication condition where duplication is blocked. The stack's linter (ESLint or Biome, ruff check, golangci-lint) and the formatter the Code style and conventions pack decides still run locally on commit and as a first CI step, because the platform's round trip is too slow to be the only feedback; the findings rule below applies to the linter's findings, and the gate on new code carries it for the platform's. The whole check finishes within {{LINT_MINUTES}} minutes. Types: {{TYPES}}. Size and complexity: {{COMPLEXITY}}. New findings: {{DEBT}}. Duplicated code: {{DUPLICATION}}. Tests and coverage follow the Test strategy decision; coverage conditions live in the same gate.",
821
+ "decision": "Every pull request is analysed by SonarQube Server (or SonarCloud) and the pipeline waits for its quality gate (sonar.qualitygate.wait=true); the gate holds conditions on new code only, with new code defined against the main branch: 0 new bugs, 0 new vulnerabilities, 100% of new security hotspots reviewed, maintainability rating A, and the duplication condition where duplication is blocked. The stack's linter (ESLint or Biome, ruff check, golangci-lint) and the formatter the Code style and conventions pack decides still run locally on commit and as a first CI step, because the platform's round trip is too slow to be the only feedback; the findings rule below applies to the linter's findings, and the gate on new code carries it for the platform's. The whole check finishes within {{LINT_MINUTES}} minutes. Size and complexity: {{COMPLEXITY}}. Tests and coverage follow the Test strategy decision; coverage conditions live in the same gate.",
718
822
  "consequences": "• One standard and one dashboard across repositories and teams, with history, and a report to show an auditor or a customer.\n• The gate on new code can be passed by every pull request from the first day, so it stays on.\n• A service to run and upgrade (or a subscription per line of code), and one more thing between a push and a green check.\n• Two rule sets to keep aligned: what Sonar flags and what the local linter flags; a finding seen only in the platform is found late.\n• Developers need the SonarLint plugin connected to the server to see the same rules in the editor.",
719
823
  "alternatives": "1. A linter and a formatter in CI only: faster and free, but no cross-repository view and no evidence trail.\n2. GitHub code scanning with CodeQL: strong on security findings, weak on maintainability; a complement, not a replacement.\n3. A gate on the whole codebase instead of new code: it is failed from day one on any existing code and switched off within a week.",
720
824
  "hubWhen": {
@@ -733,7 +837,7 @@
733
837
  "status": "accepted",
734
838
  "date": "",
735
839
  "context": "Code lives in this element and is changed by several people, soon by people who did not write it; what a change must pass before it is merged, beyond its tests, decides whether the code stays readable or decays one pull request at a time. The forces: review time is the scarcest resource and arguing about formatting and obvious mistakes wastes it, while a machine finds those in seconds; a rule that is not enforced is a wish, and a rule that blocks on old code nobody is touching teaches people to switch it off; strict types and complexity limits catch defects early but cost effort on code that was written without them; a baseline that is never lowered becomes permanent; and every check added to the pull request makes the feedback slower, so the whole gate has to finish in minutes. Tests, coverage and mutation score are decided by the Test strategy concern, not here. The snippets assume one repository layout: source in src/, tests in test/, the workflow files under .github/workflows/, and GitHub as the platform (on GitLab the same jobs run in a required pipeline with allow_failure false and the merge-request setting \"pipelines must succeed\"). Here the element is small enough for review to hold: a prototype, a set of scripts or an internal tool with one or two owners.",
736
- "decision": "Only the formatter the Code style and conventions pack decides is enforced, run on staged files at commit and checked in CI within {{LINT_MINUTES}} minutes. No lint rule set and no analysis platform; what a linter would find is left to the author and the reviewer, and the only single rules that run are the ones the types and complexity decisions below name. Types: {{TYPES}}. Size and complexity: {{COMPLEXITY}} (without a linter, lizard carries the limits). There are no linter findings to treat, so the findings rule chosen ({{DEBT}}) takes effect when a linter is introduced. Duplicated code: {{DUPLICATION}}. The decision is revisited, and a linter introduced through a new decision, when the element passes 5,000 source lines or gains a third regular contributor; a monthly count checks both. Tests follow the Test strategy decision.",
840
+ "decision": "Only the formatter the Code style and conventions pack decides is enforced, run on staged files at commit and checked in CI within {{LINT_MINUTES}} minutes. No lint rule set and no analysis platform; what a linter would find is left to the author and the reviewer, and the only single rules that run are the ones the types and complexity decisions below name. Size and complexity: {{COMPLEXITY}} (without a linter, lizard carries the limits). There are no linter findings to treat, so the findings rule chosen takes effect when a linter is introduced. The decision is revisited, and a linter introduced through a new decision, when the element passes 5,000 source lines or gains a third regular contributor; a monthly count checks both. Tests follow the Test strategy decision.",
737
841
  "consequences": "• Nothing to configure or maintain beyond the formatter, and a pull request check that takes seconds.\n• Unused variables, unreachable code, wrong equality and the other mistakes a linter finds for free reach review and sometimes production.\n• The element is cheap to start and must be cheap to leave: the revisit trigger is written down so growth does not pass unnoticed.\n• Anything in this decision that depends on a linter (enforced complexity limits, boundary types) is carried by a standalone tool or a single rule instead and costs more to set up than it would with one.",
738
842
  "alternatives": "1. A linter and a formatter in CI: an hour to set up with a recommended rule set, and the right choice as soon as a third person contributes.\n2. A code-analysis platform: far more than a prototype needs.\n3. Nothing enforced at all: formatting arguments in review within a week.",
739
843
  "hubWhen": {
@@ -819,6 +923,11 @@
819
923
  "hubWhen": {
820
924
  "STATIC": [
821
925
  "format-only"
926
+ ],
927
+ "TYPES": [
928
+ "strict",
929
+ "ratchet",
930
+ "loose"
822
931
  ]
823
932
  }
824
933
  },