pramanasutra 0.0.0-stage → 0.3.4

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 (274) hide show
  1. package/.agents/skills/pramanasutra-access/SKILL.md +21 -0
  2. package/.agents/skills/pramanasutra-api/SKILL.md +21 -0
  3. package/.agents/skills/pramanasutra-data/SKILL.md +21 -0
  4. package/.agents/skills/pramanasutra-defect/SKILL.md +21 -0
  5. package/.agents/skills/pramanasutra-evidence/SKILL.md +21 -0
  6. package/.agents/skills/pramanasutra-flake/SKILL.md +21 -0
  7. package/.agents/skills/pramanasutra-flow/SKILL.md +21 -0
  8. package/.agents/skills/pramanasutra-load/SKILL.md +21 -0
  9. package/.agents/skills/pramanasutra-pipeline/SKILL.md +21 -0
  10. package/.agents/skills/pramanasutra-prime/SKILL.md +22 -0
  11. package/.agents/skills/pramanasutra-regression/SKILL.md +21 -0
  12. package/.agents/skills/pramanasutra-release/SKILL.md +21 -0
  13. package/.agents/skills/pramanasutra-secure/SKILL.md +21 -0
  14. package/.agents/skills/pramanasutra-strategy/SKILL.md +21 -0
  15. package/.agents/skills/pramanasutra-unit/SKILL.md +21 -0
  16. package/.agents/skills/pramanasutra-verify/SKILL.md +21 -0
  17. package/.agents/skills/pramanasutra-visual/SKILL.md +21 -0
  18. package/.claude/agents/pramanasutra-prime.md +7 -0
  19. package/CHANGELOG.md +80 -0
  20. package/LICENSE +201 -0
  21. package/NOTICE +2 -0
  22. package/README.md +141 -2
  23. package/docs/.nojekyll +0 -0
  24. package/docs/00-start-here.html +207 -0
  25. package/docs/01-executive-summary.html +205 -0
  26. package/docs/02-functional-specification.html +212 -0
  27. package/docs/03-architecture.html +246 -0
  28. package/docs/04-technical-reference.html +217 -0
  29. package/docs/05-user-guide.html +246 -0
  30. package/docs/06-cli-and-reports.html +213 -0
  31. package/docs/07-rule-catalog.html +207 -0
  32. package/docs/08-skills-and-agents.html +204 -0
  33. package/docs/09-security-and-privacy.html +205 -0
  34. package/docs/10-legal-and-compliance.html +216 -0
  35. package/docs/11-testing-and-proof.html +210 -0
  36. package/docs/12-ci-and-release.html +221 -0
  37. package/docs/13-roadmap-and-status.html +199 -0
  38. package/docs/14-faq-and-glossary.html +217 -0
  39. package/docs/15-maintainer-guide.html +213 -0
  40. package/docs/agent-catalog.md +3 -0
  41. package/docs/api.md +3 -0
  42. package/docs/architecture.md +15 -0
  43. package/docs/assets/favicon.svg +1 -0
  44. package/docs/assets/site.css +183 -0
  45. package/docs/assets/site.js +79 -0
  46. package/docs/audit/report.html +41 -0
  47. package/docs/audit/report.json +61 -0
  48. package/docs/audit/report.md +83 -0
  49. package/docs/audit/report.sarif.json +16 -0
  50. package/docs/commands.md +13 -0
  51. package/docs/compatibility.md +15 -0
  52. package/docs/configuration.md +3 -0
  53. package/docs/execution-safety.md +3 -0
  54. package/docs/handbook/01-executive-summary.html +1 -0
  55. package/docs/handbook/01-executive-summary.md +51 -0
  56. package/docs/handbook/02-functional-specification.html +1 -0
  57. package/docs/handbook/02-functional-specification.md +69 -0
  58. package/docs/handbook/03-technical-specification.html +1 -0
  59. package/docs/handbook/03-technical-specification.md +85 -0
  60. package/docs/handbook/04-architecture.html +1 -0
  61. package/docs/handbook/04-architecture.md +107 -0
  62. package/docs/handbook/05-user-guide.html +1 -0
  63. package/docs/handbook/05-user-guide.md +118 -0
  64. package/docs/handbook/06-cli-reference.html +1 -0
  65. package/docs/handbook/06-cli-reference.md +88 -0
  66. package/docs/handbook/07-security-privacy-legal.html +1 -0
  67. package/docs/handbook/07-security-privacy-legal.md +65 -0
  68. package/docs/handbook/08-testing-and-proof.html +1 -0
  69. package/docs/handbook/08-testing-and-proof.md +83 -0
  70. package/docs/handbook/09-compatibility-and-roadmap.html +1 -0
  71. package/docs/handbook/09-compatibility-and-roadmap.md +53 -0
  72. package/docs/handbook/10-contributor-guide.html +1 -0
  73. package/docs/handbook/10-contributor-guide.md +64 -0
  74. package/docs/handbook/11-glossary-and-faq.html +1 -0
  75. package/docs/handbook/11-glossary-and-faq.md +52 -0
  76. package/docs/handbook/12-rule-catalog.html +1 -0
  77. package/docs/handbook/12-rule-catalog.md +65 -0
  78. package/docs/handbook/README.md +40 -0
  79. package/docs/handbook/index.html +1 -0
  80. package/docs/index.html +213 -0
  81. package/docs/legal/trademark-and-name-clearance.html +1 -0
  82. package/docs/legal/trademark-and-name-clearance.md +32 -0
  83. package/docs/master-claude-prompt.md +483 -0
  84. package/docs/proof/eval-results.json +91 -0
  85. package/docs/proof/test-results.txt +56 -0
  86. package/docs/quality-gates.md +10 -0
  87. package/docs/report-schema.md +22 -0
  88. package/docs/roadmap.md +3 -0
  89. package/docs/robots.txt +22 -0
  90. package/docs/samples/clean-project/report.html +30 -0
  91. package/docs/samples/clean-project/report.json +46 -0
  92. package/docs/samples/clean-project/report.md +69 -0
  93. package/docs/samples/clean-project/report.sarif.json +16 -0
  94. package/docs/samples/focused-test/report.html +30 -0
  95. package/docs/samples/focused-test/report.json +61 -0
  96. package/docs/samples/focused-test/report.md +76 -0
  97. package/docs/samples/focused-test/report.sarif.json +43 -0
  98. package/docs/samples/missing-ci/report.html +30 -0
  99. package/docs/samples/missing-ci/report.json +60 -0
  100. package/docs/samples/missing-ci/report.md +77 -0
  101. package/docs/samples/missing-ci/report.sarif.json +40 -0
  102. package/docs/samples/missing-tests/report.html +30 -0
  103. package/docs/samples/missing-tests/report.json +60 -0
  104. package/docs/samples/missing-tests/report.md +77 -0
  105. package/docs/samples/missing-tests/report.sarif.json +40 -0
  106. package/docs/samples/multi-language/report.html +34 -0
  107. package/docs/samples/multi-language/report.json +117 -0
  108. package/docs/samples/multi-language/report.md +112 -0
  109. package/docs/samples/multi-language/report.sarif.json +125 -0
  110. package/docs/samples/unsafe-names/report.html +30 -0
  111. package/docs/samples/unsafe-names/report.json +62 -0
  112. package/docs/samples/unsafe-names/report.md +77 -0
  113. package/docs/samples/unsafe-names/report.sarif.json +43 -0
  114. package/docs/server-deployment.md +3 -0
  115. package/docs/sitemap.xml +20 -0
  116. package/docs/standards.md +12 -0
  117. package/docs/status.md +22 -0
  118. package/docs/troubleshooting.md +7 -0
  119. package/docs/trust-model.md +3 -0
  120. package/documents/pramanasutra/00-start-here.md +82 -0
  121. package/documents/pramanasutra/01-executive-summary.md +61 -0
  122. package/documents/pramanasutra/02-functional-specification.md +90 -0
  123. package/documents/pramanasutra/03-architecture.md +102 -0
  124. package/documents/pramanasutra/04-technical-reference.md +123 -0
  125. package/documents/pramanasutra/05-user-guide.md +155 -0
  126. package/documents/pramanasutra/06-cli-and-reports.md +79 -0
  127. package/documents/pramanasutra/07-rule-catalog.md +79 -0
  128. package/documents/pramanasutra/08-skills-and-agents.md +68 -0
  129. package/documents/pramanasutra/09-security-and-privacy.md +73 -0
  130. package/documents/pramanasutra/10-legal-and-compliance.md +72 -0
  131. package/documents/pramanasutra/11-testing-and-proof.md +72 -0
  132. package/documents/pramanasutra/12-ci-and-release.md +89 -0
  133. package/documents/pramanasutra/13-roadmap-and-status.md +73 -0
  134. package/documents/pramanasutra/14-faq-and-glossary.md +81 -0
  135. package/documents/pramanasutra/15-maintainer-guide.md +81 -0
  136. package/documents/pramanasutra/README.md +11 -0
  137. package/documents/pramanasutra/audit/report.html +41 -0
  138. package/documents/pramanasutra/audit/report.json +61 -0
  139. package/documents/pramanasutra/audit/report.md +83 -0
  140. package/documents/pramanasutra/audit/report.sarif.json +16 -0
  141. package/documents/pramanasutra/html/00-start-here.html +207 -0
  142. package/documents/pramanasutra/html/01-executive-summary.html +205 -0
  143. package/documents/pramanasutra/html/02-functional-specification.html +212 -0
  144. package/documents/pramanasutra/html/03-architecture.html +246 -0
  145. package/documents/pramanasutra/html/04-technical-reference.html +217 -0
  146. package/documents/pramanasutra/html/05-user-guide.html +246 -0
  147. package/documents/pramanasutra/html/06-cli-and-reports.html +213 -0
  148. package/documents/pramanasutra/html/07-rule-catalog.html +207 -0
  149. package/documents/pramanasutra/html/08-skills-and-agents.html +204 -0
  150. package/documents/pramanasutra/html/09-security-and-privacy.html +205 -0
  151. package/documents/pramanasutra/html/10-legal-and-compliance.html +216 -0
  152. package/documents/pramanasutra/html/11-testing-and-proof.html +210 -0
  153. package/documents/pramanasutra/html/12-ci-and-release.html +221 -0
  154. package/documents/pramanasutra/html/13-roadmap-and-status.html +199 -0
  155. package/documents/pramanasutra/html/14-faq-and-glossary.html +217 -0
  156. package/documents/pramanasutra/html/15-maintainer-guide.html +213 -0
  157. package/documents/pramanasutra/html/audit/report.html +41 -0
  158. package/documents/pramanasutra/html/audit/report.json +61 -0
  159. package/documents/pramanasutra/html/audit/report.md +83 -0
  160. package/documents/pramanasutra/html/audit/report.sarif.json +16 -0
  161. package/documents/pramanasutra/html/index.html +213 -0
  162. package/documents/pramanasutra/html/proof/eval-results.json +91 -0
  163. package/documents/pramanasutra/html/proof/test-results.txt +56 -0
  164. package/documents/pramanasutra/html/robots.txt +22 -0
  165. package/documents/pramanasutra/html/samples/clean-project/report.html +30 -0
  166. package/documents/pramanasutra/html/samples/clean-project/report.json +46 -0
  167. package/documents/pramanasutra/html/samples/clean-project/report.md +69 -0
  168. package/documents/pramanasutra/html/samples/clean-project/report.sarif.json +16 -0
  169. package/documents/pramanasutra/html/samples/focused-test/report.html +30 -0
  170. package/documents/pramanasutra/html/samples/focused-test/report.json +61 -0
  171. package/documents/pramanasutra/html/samples/focused-test/report.md +76 -0
  172. package/documents/pramanasutra/html/samples/focused-test/report.sarif.json +43 -0
  173. package/documents/pramanasutra/html/samples/missing-ci/report.html +30 -0
  174. package/documents/pramanasutra/html/samples/missing-ci/report.json +60 -0
  175. package/documents/pramanasutra/html/samples/missing-ci/report.md +77 -0
  176. package/documents/pramanasutra/html/samples/missing-ci/report.sarif.json +40 -0
  177. package/documents/pramanasutra/html/samples/missing-tests/report.html +30 -0
  178. package/documents/pramanasutra/html/samples/missing-tests/report.json +60 -0
  179. package/documents/pramanasutra/html/samples/missing-tests/report.md +77 -0
  180. package/documents/pramanasutra/html/samples/missing-tests/report.sarif.json +40 -0
  181. package/documents/pramanasutra/html/samples/multi-language/report.html +34 -0
  182. package/documents/pramanasutra/html/samples/multi-language/report.json +117 -0
  183. package/documents/pramanasutra/html/samples/multi-language/report.md +112 -0
  184. package/documents/pramanasutra/html/samples/multi-language/report.sarif.json +125 -0
  185. package/documents/pramanasutra/html/samples/unsafe-names/report.html +30 -0
  186. package/documents/pramanasutra/html/samples/unsafe-names/report.json +62 -0
  187. package/documents/pramanasutra/html/samples/unsafe-names/report.md +77 -0
  188. package/documents/pramanasutra/html/samples/unsafe-names/report.sarif.json +43 -0
  189. package/documents/pramanasutra/html/sitemap.xml +20 -0
  190. package/documents/pramanasutra/proof/eval-results.json +91 -0
  191. package/documents/pramanasutra/proof/test-results.txt +56 -0
  192. package/documents/pramanasutra/samples/clean-project/report.html +30 -0
  193. package/documents/pramanasutra/samples/clean-project/report.json +46 -0
  194. package/documents/pramanasutra/samples/clean-project/report.md +69 -0
  195. package/documents/pramanasutra/samples/clean-project/report.sarif.json +16 -0
  196. package/documents/pramanasutra/samples/focused-test/report.html +30 -0
  197. package/documents/pramanasutra/samples/focused-test/report.json +61 -0
  198. package/documents/pramanasutra/samples/focused-test/report.md +76 -0
  199. package/documents/pramanasutra/samples/focused-test/report.sarif.json +43 -0
  200. package/documents/pramanasutra/samples/missing-ci/report.html +30 -0
  201. package/documents/pramanasutra/samples/missing-ci/report.json +60 -0
  202. package/documents/pramanasutra/samples/missing-ci/report.md +77 -0
  203. package/documents/pramanasutra/samples/missing-ci/report.sarif.json +40 -0
  204. package/documents/pramanasutra/samples/missing-tests/report.html +30 -0
  205. package/documents/pramanasutra/samples/missing-tests/report.json +60 -0
  206. package/documents/pramanasutra/samples/missing-tests/report.md +77 -0
  207. package/documents/pramanasutra/samples/missing-tests/report.sarif.json +40 -0
  208. package/documents/pramanasutra/samples/multi-language/report.html +34 -0
  209. package/documents/pramanasutra/samples/multi-language/report.json +117 -0
  210. package/documents/pramanasutra/samples/multi-language/report.md +112 -0
  211. package/documents/pramanasutra/samples/multi-language/report.sarif.json +125 -0
  212. package/documents/pramanasutra/samples/unsafe-names/report.html +30 -0
  213. package/documents/pramanasutra/samples/unsafe-names/report.json +62 -0
  214. package/documents/pramanasutra/samples/unsafe-names/report.md +77 -0
  215. package/documents/pramanasutra/samples/unsafe-names/report.sarif.json +43 -0
  216. package/examples/dotnet-app/README.md +3 -0
  217. package/examples/evidence/passing.json +12 -0
  218. package/examples/java-service/README.md +3 -0
  219. package/examples/mobile/README.md +3 -0
  220. package/examples/python-api/README.md +3 -0
  221. package/examples/release-policy/README.md +3 -0
  222. package/examples/sample-app/README.md +3 -0
  223. package/examples/sample-app/package.json +8 -0
  224. package/examples/sample-app/src/math.js +1 -0
  225. package/examples/sample-app/tests/math.test.js +5 -0
  226. package/examples/sample-output/clean-project/report.html +30 -0
  227. package/examples/sample-output/clean-project/report.json +46 -0
  228. package/examples/sample-output/clean-project/report.md +69 -0
  229. package/examples/sample-output/clean-project/report.sarif.json +16 -0
  230. package/examples/sample-output/focused-test/report.html +30 -0
  231. package/examples/sample-output/focused-test/report.json +61 -0
  232. package/examples/sample-output/focused-test/report.md +76 -0
  233. package/examples/sample-output/focused-test/report.sarif.json +43 -0
  234. package/examples/sample-output/missing-ci/report.html +30 -0
  235. package/examples/sample-output/missing-ci/report.json +60 -0
  236. package/examples/sample-output/missing-ci/report.md +77 -0
  237. package/examples/sample-output/missing-ci/report.sarif.json +40 -0
  238. package/examples/sample-output/missing-tests/report.html +30 -0
  239. package/examples/sample-output/missing-tests/report.json +60 -0
  240. package/examples/sample-output/missing-tests/report.md +77 -0
  241. package/examples/sample-output/missing-tests/report.sarif.json +40 -0
  242. package/examples/sample-output/multi-language/report.html +34 -0
  243. package/examples/sample-output/multi-language/report.json +117 -0
  244. package/examples/sample-output/multi-language/report.md +112 -0
  245. package/examples/sample-output/multi-language/report.sarif.json +125 -0
  246. package/examples/sample-output/unsafe-names/report.html +30 -0
  247. package/examples/sample-output/unsafe-names/report.json +62 -0
  248. package/examples/sample-output/unsafe-names/report.md +77 -0
  249. package/examples/sample-output/unsafe-names/report.sarif.json +43 -0
  250. package/llms.txt +63 -0
  251. package/package.json +65 -4
  252. package/packages/cli/bin/pramanasutra.mjs +91 -0
  253. package/packages/cli/lib/evidence.mjs +60 -0
  254. package/packages/cli/lib/installer.mjs +39 -0
  255. package/packages/cli/lib/policy.mjs +33 -0
  256. package/packages/cli/lib/report.mjs +224 -0
  257. package/packages/cli/lib/scanner.mjs +164 -0
  258. package/policies/recommended.json +11 -0
  259. package/policies/strict.json +12 -0
  260. package/templates/defect-report.md +11 -0
  261. package/templates/qa-strategy.md +9 -0
  262. package/templates/release-notes.md +9 -0
  263. package/templates/release-readiness.md +9 -0
  264. package/templates/rollback-plan.md +7 -0
  265. package/templates/test-evidence.json +11 -0
  266. package/templates/test-plan.md +4 -0
  267. package/templates/traceability-matrix.csv +1 -0
  268. package/workflows/create-test-plan.md +9 -0
  269. package/workflows/implement-tests.md +9 -0
  270. package/workflows/inspect-project.md +9 -0
  271. package/workflows/investigate-failure.md +9 -0
  272. package/workflows/post-release-observability.md +9 -0
  273. package/workflows/release-readiness.md +9 -0
  274. package/workflows/verify-regression.md +9 -0
@@ -0,0 +1,90 @@
1
+ # Functional specification
2
+
3
+ <!-- summary: Actors, use cases, functional requirements and acceptance criteria for PramanaSutra AI 0.3.4. Planned work is marked planned and is not described as shipped. -->
4
+
5
+ This specification describes version 0.3.4 as implemented. A requirement marked **planned** is not available. Tests that mention a requirement are named so a reader can find them in `tests/cli.test.mjs`.
6
+
7
+ ## Actors
8
+
9
+ | Actor | Goal | What they can do |
10
+ |---|---|---|
11
+ | Developer | Know if a change is even a candidate for release | Run the CLI locally. Read `report.md` or `report.html` |
12
+ | AI assistant inside an IDE | Plan QA without inventing results | Follow a skill. The skill forbids claiming a test ran without a tool result |
13
+ | CI job | Fail the build on a blocking finding, and record evidence | Run tests, pass the counts as `--evidence`, fail on exit 2 |
14
+ | Reviewer | Understand a gate without installing Node | Open the HTML report or the Markdown report |
15
+ | Maintainer | Keep the rules honest | Add a fixture and a test before changing a rule. See the [maintainer guide](15-maintainer-guide.md) |
16
+ | Release approver | Decide | Read the gate. The tool will not approve for them |
17
+
18
+ ## Use cases
19
+
20
+ ### UC-1 Static audit
21
+
22
+ The developer points the CLI at a directory. The tool walks the tree, skips symlinks, skips ignored paths, and reports focused tests, skipped tests, missing tests, missing CI and a missing license. It writes `report.md`, `report.html`, `report.json` and `report.sarif.json` together. It does not execute the project. `scan` and `release-check` use the same exit codes.
23
+
24
+ ### UC-2 Release check with evidence
25
+
26
+ The developer, or CI, has already run the test command. They write a JSON evidence file (or the CI helper writes it from the real output) and pass `--evidence`. The gate combines the static findings and that file. Passing evidence from `local-executed` or `ci-ingested`, plus a clean required static picture, yields `READY_FOR_HUMAN_APPROVAL` and exit 0. The report shows the counts from the file and states that PramanaSutra did not run the command.
27
+
28
+ ### UC-3 Install skills
29
+
30
+ The developer runs `init --ide <host> --target <existing directory>`. The tool copies the canonical skills from `.agents/skills` into the host's directory. If a skill directory already exists, the copy stops unless `--force` is set. The target must be a real directory, not a file and not a symlink. A symlink anywhere on the destination path is refused.
31
+
32
+ ### UC-4 Policy
33
+
34
+ A team commits `policies/strict.json` or their own file. `--policy` loads it. Unknown keys, wrong types, and any attempt to set `allowAutomatedDeployment` to true or `manualApprovalsRequired` to false are errors. Exit code 1. The default policy is `recommended` when `--policy` is omitted.
35
+
36
+ ### UC-5 Exclude examples
37
+
38
+ A repository that contains labeled bad examples (this one does) lists them in `.pramanasutraignore`. The report's limitations say how many paths were excluded. Excluded content is not inspected. The author of the ignore file is responsible for not hiding the tests that matter.
39
+
40
+ ## Functional requirements
41
+
42
+ | ID | Statement | Status | Acceptance |
43
+ |---|---|---|---|
44
+ | FR-1 | `doctor` reports Node, platform, offline, and that no model is called | Implemented | Test `doctor succeeds without a provider key` |
45
+ | FR-2 | `version` and `--version` print the version from `package.json` | Implemented | Test `version and --version print the package version` |
46
+ | FR-3 | `agents list` lists 17 skills whose folder name matches frontmatter | Implemented | Test `agents catalog includes Prime and 16 specialists` |
47
+ | FR-4 | `scan` and `release-check` require `--path` to a real directory | Implemented | Missing path exits 1, no stack trace |
48
+ | FR-5 | Default output is `./pramanasutra-reports` in the current working directory, not inside the scanned project | Implemented | Test `scan writes md, html and json reports by default` |
49
+ | FR-6 | The four report files are always written together unless `--no-report` | Implemented | Tests assert `report.md`, `report.html`, `report.json`, and SARIF 2.1.0 |
50
+ | FR-7 | HTML and Markdown escape `<`, `>` and quotes from file names, titles and evidence commands | Implemented | Escape tests, including a portable path test that does not need a forbidden file name |
51
+ | FR-8 | The scanned path stored in the report is the directory's base name, not the absolute path | Implemented | Test `reports do not disclose absolute target paths by default` |
52
+ | FR-9 | A focused test (`test.only`, `it.only`, `describe.only`, `fit`, `fdescribe`) is high severity and `NO_GO` under the default policy | Implemented | Fixture `focused-test`, exit code 2 |
53
+ | FR-10 | A skipped or todo test is reported and is not described as an executed test | Implemented | `it.skip`, `test.todo`, pytest, unittest, JUnit, Go |
54
+ | FR-11 | No recognised tests, no recognised CI, and no root license are separate findings | Implemented | Fixture cases and unit tests |
55
+ | FR-12 | Without evidence, a clean static project is `REVIEW_REQUIRED`, never ready | Implemented | Exit code 3 |
56
+ | FR-13 | Passing `ci-ingested` or `local-executed` evidence, with failed = 0, exit 0, passed > 0, and a clean policy picture, is `READY_FOR_HUMAN_APPROVAL` and still `automatedDeploymentAuthorized: false` | Implemented | Exit code 0 test |
57
+ | FR-14 | Failing evidence is `NO_GO` even when the static scan is clean | Implemented | Exit code 2 |
58
+ | FR-15 | `external-unverified` evidence and zero-pass evidence stay `REVIEW_REQUIRED` | Implemented | Unit tests |
59
+ | FR-16 | `--evidence` and `--policy` are rejected on `scan` | Implemented | Unit test |
60
+ | FR-17 | Symlinks are not followed | Implemented | Skipped when the OS denies symlink creation |
61
+ | FR-18 | `.pramanasutraignore` excludes prefixes and rejects `..` | Implemented | Unit test |
62
+ | FR-19 | Binary test files (NUL byte) are not decoded as source; the scan is marked partial | Implemented | Unit test |
63
+ | FR-20 | Skill install does not overwrite and does not follow a symlinked destination | Implemented | Installer tests |
64
+ | FR-21 | The CLI executes the target project's tests | **Planned** | Must stay `not-run` until a real executor exists |
65
+ | FR-22 | Browser, accessibility measurement, load, security scan | **Planned** or explicitly not supported | Capabilities in every report |
66
+ | FR-23 | Hosted server, Ollama, extra model API | **Planned** | Not in the CLI |
67
+
68
+ ## Out of scope
69
+
70
+ - Replacing Jest, pytest, JUnit, Playwright or a CI provider.
71
+ - Mutating the scanned project. The only writes are the report directory, and `init` into the target the user named.
72
+ - Secret detection, dependency CVE scanning, SBOM, provenance attestations, SLSA.
73
+ - Deciding production rollout, feature flags, or customer communication.
74
+ - Legal conclusions about the user's product. See [Legal](10-legal-and-compliance.md).
75
+
76
+ ## Policies shipped in the box
77
+
78
+ `policies/recommended.json` blocks focused tests, requires executed evidence, requires tests, CI and a license, and does not block on skipped tests.
79
+
80
+ `policies/strict.json` is the same and also blocks on skipped tests, so a skip becomes `NO_GO` even when evidence passes.
81
+
82
+ Both set `allowAutomatedDeployment` to false. The loader will not accept true.
83
+
84
+ ## User-visible errors
85
+
86
+ Errors go to stderr as `PramanaSutra error: <message>` and exit 1. The message is the thrown error's message, not a stack, for the cases tests cover (missing path, bad evidence, bad policy, unknown option). A bug that throws an unexpected exception is also caught and printed as that one line, which hides the stack from the user. Maintainers reproduce with the unit suite.
87
+
88
+ ## Acceptance of the documentation itself
89
+
90
+ A reader who has not seen the source can: install, run a check, open both report files, explain the three gate words, point at a sample for each gate, and state two things the tool does not do. The pages linked from [Start here](00-start-here.md) are the checklist.
@@ -0,0 +1,102 @@
1
+ # Architecture
2
+
3
+ <!-- summary: Components, data flow, trust boundaries and design decisions for the PramanaSutra AI CLI and skills. The CLI does not call a model and does not run the target's tests. -->
4
+
5
+ ## What exists at runtime
6
+
7
+ There is one program: `packages/cli/bin/pramanasutra.mjs`. It loads four libraries and nothing else. There is no database, no daemon, no plugin loader and no network stack in the scan path.
8
+
9
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 880 460" role="img" aria-labelledby="archTitle archDesc">
10
+ <title id="archTitle">PramanaSutra components</title>
11
+ <desc id="archDesc">Skills stay in the IDE. The CLI reads the repo, optional policy and evidence, evaluates a gate, and writes Markdown, HTML and JSON locally.</desc>
12
+ <style>text{font-family:ui-sans-serif,system-ui,sans-serif}</style>
13
+ <rect width="880" height="460" fill="#f7f4ee"/>
14
+ <rect x="24" y="24" width="250" height="120" rx="12" fill="#fff" stroke="#0f3d3e"/>
15
+ <text x="40" y="56" font-size="15" font-weight="700" fill="#0f3d3e">AI IDE</text>
16
+ <text x="40" y="80" font-size="13" fill="#1c1915">Claude, Cursor, Codex,</text>
17
+ <text x="40" y="100" font-size="13" fill="#1c1915">Copilot, Gemini CLI</text>
18
+ <text x="40" y="124" font-size="12" fill="#5e584e">Model stays in the IDE</text>
19
+ <rect x="24" y="168" width="250" height="100" rx="12" fill="#fff" stroke="#0f3d3e"/>
20
+ <text x="40" y="200" font-size="15" font-weight="700" fill="#0f3d3e">17 Agent Skills</text>
21
+ <text x="40" y="224" font-size="13" fill="#1c1915">.agents/skills is canonical</text>
22
+ <text x="40" y="244" font-size="12" fill="#5e584e">init copies them. It does not run them</text>
23
+ <rect x="330" y="70" width="250" height="210" rx="12" fill="#0f3d3e"/>
24
+ <text x="348" y="104" font-size="16" font-weight="700" fill="#f4fffe">pramanasutra CLI</text>
25
+ <text x="348" y="132" font-size="13" fill="#d5efec">scanner.mjs walk + rules</text>
26
+ <text x="348" y="156" font-size="13" fill="#d5efec">policy.mjs fail-closed</text>
27
+ <text x="348" y="180" font-size="13" fill="#d5efec">evidence.mjs schema</text>
28
+ <text x="348" y="204" font-size="13" fill="#d5efec">evaluateGate</text>
29
+ <text x="348" y="236" font-size="13" fill="#f4fffe">No network. No test exec.</text>
30
+ <rect x="630" y="24" width="226" height="78" rx="12" fill="#fff" stroke="#92400e"/>
31
+ <text x="646" y="52" font-size="14" font-weight="700" fill="#92400e">Policy JSON</text>
32
+ <text x="646" y="76" font-size="12" fill="#1c1915">optional --policy</text>
33
+ <rect x="630" y="118" width="226" height="78" rx="12" fill="#fff" stroke="#92400e"/>
34
+ <text x="646" y="146" font-size="14" font-weight="700" fill="#92400e">Evidence JSON</text>
35
+ <text x="646" y="170" font-size="12" fill="#1c1915">optional --evidence</text>
36
+ <rect x="630" y="214" width="226" height="110" rx="12" fill="#fff" stroke="#166534"/>
37
+ <text x="646" y="244" font-size="14" font-weight="700" fill="#166534">Reports</text>
38
+ <text x="646" y="268" font-size="13" fill="#1c1915">report.md</text>
39
+ <text x="646" y="288" font-size="13" fill="#1c1915">report.html</text>
40
+ <text x="646" y="308" font-size="13" fill="#1c1915">report.json</text>
41
+ <rect x="24" y="310" width="832" height="124" rx="12" fill="#fff" stroke="#ddd4c4"/>
42
+ <text x="40" y="342" font-size="14" font-weight="700" fill="#1c1915">Target repository (read-only)</text>
43
+ <text x="40" y="368" font-size="13" fill="#1c1915">Files, test names, CI config, LICENSE. Symlinks skipped. .pramanasutraignore prefixes excluded.</text>
44
+ <text x="40" y="392" font-size="13" fill="#1c1915">The report stores the folder's base name, not the absolute path.</text>
45
+ <text x="40" y="416" font-size="12" fill="#5e584e">Writes go to the output directory the operator chose, default ./pramanasutra-reports in the current working directory.</text>
46
+ </svg>
47
+
48
+ The diagram is inline. The page does not fetch a chart library. The reports box lists Markdown, HTML and JSON. The same write also emits `report.sarif.json` (SARIF 2.1.0).
49
+
50
+ ## Trust boundaries
51
+
52
+ | Boundary | Rule |
53
+ |---|---|
54
+ | Target tree to scanner | Read-only. Symlinks skipped, not followed. Directories in the skip list (`.git`, `node_modules`, build outputs, `pramanasutra-reports`) are not entered |
55
+ | Ignore file to scanner | Prefixes only. `..`, absolute paths and NUL are rejected. The file is data, not code |
56
+ | Evidence file to gate | Schema-checked JSON, max 1 MB, must be a regular file. The counts are believed as data. The provenance is only as good as `source` |
57
+ | Policy file to gate | Fail closed. Safety flags cannot be weakened |
58
+ | Report to the reader | Every string that came from the repo or the evidence file is escaped in HTML and in Markdown |
59
+ | IDE to skill | The skill is text. The model is the IDE's. PramanaSutra does not see that traffic |
60
+ | CLI to network | No HTTP client is used by the scan, gate, report or installer |
61
+
62
+ ## Command flow
63
+
64
+ `scan` calls `scanProject`, runs `evaluateGate` with no evidence (so the decision is at best `REVIEW_REQUIRED` unless something is already `NO_GO`), and writes reports. Exit code is 0 even when the gate is not ready, because scan is an inspection.
65
+
66
+ `release-check` is the same pipeline plus optional evidence and policy. Its exit code is the gate: 2, 3 or 0. That is the code CI should use.
67
+
68
+ `verify` only validates an evidence file. It does not scan.
69
+
70
+ `init` only copies directories.
71
+
72
+ ## Design decisions
73
+
74
+ **Heuristics, not parsers.** A real parser for every language would be a different product and a large dependency. The cost is false positives and false negatives. Each rule says its confidence is `medium` except the license check, which is `high` because it is a file-name check. The report repeats the limitation so a green gate is not read as a proof of absence.
75
+
76
+ **Evidence is supplied, not collected by running tests.** Running the target's test script would execute arbitrary code. The CLI refuses that. CI runs the tests in its own job, where the user already accepted that risk, and passes the summary in.
77
+
78
+ **Ready still needs a human.** `requiresHumanApproval` is always true. `automatedDeploymentAuthorized` is always false. A policy cannot flip them.
79
+
80
+ **Reports are the product, not a log line.** Reviewers live in pull requests and browsers. Markdown, HTML and JSON are written in one function so they cannot drift into different facts. JSON is the machine copy of the same object the prose describes.
81
+
82
+ **Ignore is visible.** Hiding `fixtures/` without saying so would make this repository's own gate dishonest. The limitation line is mandatory when the ignore file matches anything.
83
+
84
+ ## What the other packages are
85
+
86
+ Directories under `packages/` other than `cli` (`core`, `runner`, `server`, `reporter`, and the rest) contain README notes for planned modules. They are not imported by the CLI. Treat them as roadmap, not as running code. The status page says the same thing. Do not document them as features.
87
+
88
+ ## Failure behavior
89
+
90
+ | Condition | Result |
91
+ |---|---|
92
+ | Path missing, not a directory, or a symlink | Error, exit 1 |
93
+ | Evidence or policy unreadable, huge, or schema-invalid | Error, exit 1 |
94
+ | Unreadable subdirectory during the walk | Limitation on the report, scan continues, `inventory.partial` may be true, gate will not be ready |
95
+ | More than 20,000 files or depth 22 | Truncation limitation, partial scan, not ready |
96
+ | Test file bigger than 2,000,000 bytes | Skipped, partial, not ready |
97
+ | Test file contains a NUL | Skipped as binary, partial, not ready |
98
+ | Output directory cannot be created | Error, exit 1 |
99
+
100
+ ## Extension points
101
+
102
+ A new static rule belongs in `scanner.mjs` next to the existing ones, with a fixture and a test. A new evidence source belongs in `evidence.mjs` and must not be added to the "can count as passing" set unless the provenance story is real. A new IDE path belongs in `installer.mjs` `ADAPTERS`. None of these load remote code.
@@ -0,0 +1,123 @@
1
+ # Technical reference
2
+
3
+ <!-- summary: Modules, report schema, evidence schema, policy keys, scan limits and exit codes for the PramanaSutra AI CLI. -->
4
+
5
+ Source of the running tool: `packages/cli/`. Node.js ES modules. No `npm install` is required to run it, because there are no dependencies. Dev-time checks are `node --test`.
6
+
7
+ ## Modules
8
+
9
+ | File | Responsibility |
10
+ |---|---|
11
+ | `packages/cli/bin/pramanasutra.mjs` | Argument parsing, commands, process exit code. Version string is read from root `package.json` |
12
+ | `packages/cli/lib/scanner.mjs` | Directory walk, test-file classification, rules, `evaluateGate` |
13
+ | `packages/cli/lib/evidence.mjs` | Load and validate evidence. Classify it as absent, failing, inconclusive, unverified or passing |
14
+ | `packages/cli/lib/policy.mjs` | Default policy and fail-closed loader |
15
+ | `packages/cli/lib/report.mjs` | `markdown()`, `html()`, `writeReports()`. `escapeHtml` is exported and tested |
16
+ | `packages/cli/lib/installer.mjs` | Map of IDE directories and the copy routine |
17
+ | `scripts/ci-gate.mjs` | Runs the unit tests, builds evidence from that output, release-checks this repo |
18
+ | `scripts/generate-proof.mjs` | Regenerates sample reports, `proof/` and `documents/pramanasutra/audit` |
19
+ | `scripts/build-docs.mjs` | Builds this HTML site from the numbered Markdown files |
20
+
21
+ ## Exit codes
22
+
23
+ | Code | When |
24
+ |---|---|
25
+ | 0 | `doctor` on Node 20+, `help`, `version`, `agents`, `init`, `verify` success, `scan` or `release-check` with `READY_FOR_HUMAN_APPROVAL` |
26
+ | 1 | Bad arguments, unreadable input, invalid evidence, invalid policy, doctor on Node older than 20, unknown command |
27
+ | 2 | `scan` or `release-check` decision `NO_GO` |
28
+ | 3 | `scan` or `release-check` decision `REVIEW_REQUIRED` |
29
+
30
+ `scan` and `release-check` both use 2 for `NO_GO` and 3 for `REVIEW_REQUIRED`. Exit 0 from either command is `READY_FOR_HUMAN_APPROVAL` only. A scan without an evidence file cannot be ready.
31
+
32
+ ## Report object (schema 1.0.0)
33
+
34
+ Written as `report.json`. The Markdown and HTML are renderings of this object, plus a few fixed explanation sentences.
35
+
36
+ | Field | Meaning |
37
+ |---|---|
38
+ | `schemaVersion` | `"1.0.0"` |
39
+ | `product` | `PramanaSutra AI` |
40
+ | `toolVersion` | Version from `package.json` at scan time |
41
+ | `generatedAt` | ISO-8601 UTC |
42
+ | `scannedPath` | Base name of the target directory only |
43
+ | `capabilities` | Map of capability to `executed`, `not-run`, `not-supported` or `evidence-supplied` |
44
+ | `inventory.fileCount` | Files that were listed, after ignore rules and skip directories |
45
+ | `inventory.testFiles` | Relative paths classified as tests |
46
+ | `inventory.manifests` | `package.json`, `pyproject.toml`, `go.mod`, Gradle, Maven, Cargo, Gemfile, Composer, pubspec, `.sln`, `.csproj`, `requirements.txt` |
47
+ | `inventory.ciWorkflows` | GitHub Actions under `.github/workflows`, plus GitLab, Jenkins, Azure Pipelines, Bitbucket Pipelines, CircleCI, Buildkite, Drone and Woodpecker file names |
48
+ | `inventory.changedFiles` | Present as an array only when `--changed` could run `git diff`. `null` when the flag was omitted or git was unavailable |
49
+ | `inventory.partial` | True when the walk truncated, skipped a large or binary test file, or could not read a directory |
50
+ | `inventory.ignoredPaths` | Count of file or directory entries skipped because of `.pramanasutraignore` |
51
+ | `findings[]` | `id`, `ruleId`, `severity`, `confidence`, `title`, `description`, `evidence.path`, `evidence.line`, `recommendation`, `status` |
52
+ | `limitations[]` | Sentences about skips, truncation, ignore |
53
+ | `releaseGate` | `decision`, `policy`, `reasons[]`, `requiresHumanApproval`, `executedTestEvidence`, `evidenceState`, `automatedDeploymentAuthorized` |
54
+ | `evidence` | Present only when `--evidence` was accepted. Echoes source, command, time, exit code, passed, failed, skipped, environment, commit, and `github` or null. Omitted on a plain scan |
55
+
56
+ Adding `toolVersion` and `evidence` does not change `schemaVersion`. Consumers that ignore unknown fields keep working. Consumers that reject unknown fields will need a change; none are shipped in this repo.
57
+
58
+ ## Evidence file
59
+
60
+ | Field | Rule |
61
+ |---|---|
62
+ | `schemaVersion` | Must be `"1.0.0"` |
63
+ | `source` | `local-executed`, `ci-ingested`, or `external-unverified` |
64
+ | `command` | Non-empty string. Shown in the report. Escaped. It is not executed |
65
+ | `executedAt` | ISO-8601 timestamp |
66
+ | `exitCode` | Integer. Non-zero is failing even if `failed` is 0 |
67
+ | `passed`, `failed` | Integers ≥ 0 |
68
+ | `skipped` | Optional integer ≥ 0 |
69
+ | `environment`, `commit` | Optional strings |
70
+ | `github` | Optional object. When present, `repository`, `sha`, `runId` and `workflow` must each be a non-empty string. The report then says `ci-environment`. Missing `github` is `unbound`. Neither state is a signature |
71
+
72
+ Classification order: no file → `absent`. `failed > 0` or `exitCode !== 0` → `failing`. `passed === 0` → `inconclusive`. `external-unverified` → `unverified`. Otherwise → `passing`. Only `passing` can unlock the ready state, and only together with the policy's static requirements.
73
+
74
+ ## Policy keys
75
+
76
+ Boolean keys, defaulting to the recommended policy when omitted: `releaseRequiresExecutedEvidence`, `blockOnFocusedTests`, `blockOnSkippedTests`, `requireCi`, `requireLicense`, `requireTests`.
77
+
78
+ `name` is a string up to 80 characters.
79
+
80
+ Fixed keys, accepted only at the safe value: `schemaVersion` must be `"1.0.0"` if present, `allowAutomatedDeployment` must be false, `manualApprovalsRequired` must be true. Any other key is an error.
81
+
82
+ ## Scan limits
83
+
84
+ | Limit | Value |
85
+ |---|---|
86
+ | Max depth | 22 |
87
+ | Max files listed | 20,000 |
88
+ | Max test file read | 2,000,000 bytes |
89
+ | Max evidence file | 1,000,000 bytes |
90
+ | Max policy file | 100,000 bytes |
91
+ | Max ignore file | 100,000 bytes |
92
+
93
+ Skipped directory names: `.git`, `node_modules`, `.venv`, `venv`, `dist`, `build`, `target`, `coverage`, `.next`, `.nuxt`, `.turbo`, `.cache`, `reports`, `pramanasutra-reports`, `.idea`, `.gradle`, `vendor`, `bin`, `obj`.
94
+
95
+ ## Test detection
96
+
97
+ A file is a test if the relative path (forward slashes) matches a test directory (`test`, `tests`, `__tests__`, `spec`, `specs`, `e2e`), or a name like `*.test.*`, `*.spec.*`, `*_test.go`, `test_*.py`, `*_spec.rb`, or a class-style name such as `UserServiceTest.java`. Look-alikes such as `Submit.java` are not tests. The check is a regex, not a language module.
98
+
99
+ Rules run only on test files whose extension is in the source list: JS/TS and JSX/TSX, Python, Go, Rust, Ruby, PHP, Java, Kotlin, Swift, Dart, C#, Vue, Svelte.
100
+
101
+ ## Ignore file
102
+
103
+ `.pramanasutraignore` at the scan root. Blank lines and `#` comments are ignored. A line ending in `/` excludes that directory and everything under it. Any other line excludes that relative path and its children. Backslashes are normalized. `..` and absolute paths throw.
104
+
105
+ This repository's file excludes `fixtures/` and `examples/sample-app/` because those trees contain intentional `test.only` examples.
106
+
107
+ ## Installer map
108
+
109
+ | `--ide` | Directory under the target |
110
+ |---|---|
111
+ | `claude` | `.claude/skills` |
112
+ | `cursor` | `.cursor/skills` |
113
+ | `codex` | `.agents/skills` |
114
+ | `gemini` | `.gemini/skills` |
115
+ | `copilot` | `.github/skills` |
116
+ | `generic` | `.agents/skills` |
117
+ | `all` | Each distinct path above |
118
+
119
+ `codex` and `generic` share a path, so `all` does not copy that directory twice. Copying onto the canonical source directory itself is a no-op for that one destination.
120
+
121
+ ## Commands the shell accepts
122
+
123
+ See [CLI and reports](06-cli-and-reports.md) for examples. Unknown options fail. `--help`, `-h`, `--version` and `-v` are commands, not errors. Values are required for `--path`, `--out`, `--ide`, `--target`, `--evidence` and `--policy`.
@@ -0,0 +1,155 @@
1
+ # User guide
2
+
3
+ <!-- summary: How to install PramanaSutra AI, run a release check, read the Markdown and HTML reports, supply evidence, and install skills. Node.js 20 or newer. No API key. -->
4
+
5
+ ## Before you start
6
+
7
+ Install Node.js 20 or newer. Check with `node --version`. You do not need an API key, an account, or `npm install` inside this repository.
8
+
9
+ From a clone of this repository the command is:
10
+
11
+ ```bash
12
+ node packages/cli/bin/pramanasutra.mjs doctor
13
+ ```
14
+
15
+ From anywhere, once the repository is public on GitHub:
16
+
17
+ ```bash
18
+ npx pramanasutra doctor
19
+ ```
20
+
21
+ `npx` downloads the repository. The CLI that then runs still does not call a model and does not scan until you ask it to.
22
+
23
+ ## Check a project
24
+
25
+ ```bash
26
+ node packages/cli/bin/pramanasutra.mjs release-check --path path/to/project
27
+ ```
28
+
29
+ You get a paragraph on the terminal and four files in `./pramanasutra-reports/`:
30
+
31
+ | File | Open it with |
32
+ |---|---|
33
+ | `report.md` | The pull request, an editor, or GitHub |
34
+ | `report.html` | Any browser. Light and dark follow the system. It prints |
35
+ | `report.json` | A script. Same facts as the other files |
36
+ | `report.sarif.json` | A SARIF 2.1.0 reader. The CLI writes the file and does not upload it |
37
+
38
+ `scan` and `release-check` use the same exit codes: `2` for `NO_GO`, `3` for `REVIEW_REQUIRED`, `0` for `READY_FOR_HUMAN_APPROVAL`. A scan with no evidence file exits `3`.
39
+
40
+ `--changed` adds names from `git diff` when the directory is a Git checkout. Those names are not a test selection. If git cannot read the directory, the report says `git diff was not available for this directory, so no changed-file list was collected.`
41
+
42
+ Choose another folder with `--out reports/feature-a`. Skip the files with `--no-report` if you only want the exit code.
43
+
44
+ The terminal line always includes `Tests executed by this tool: NO`. If you did not pass `--evidence`, the gate cannot be ready.
45
+
46
+ ## Read the result
47
+
48
+ Open `report.html` first if you are a person. The first block is the decision:
49
+
50
+ - **NO_GO** (exit 2). Something blocking was seen, usually a focused test, or the evidence file says the tests failed. Do not release on this output.
51
+ - **REVIEW_REQUIRED** (exit 3). The static picture is not blocking, but evidence is missing, untrusted, empty, or the scan was partial, or tests, CI or a license are missing under the policy. A person has to look.
52
+ - **READY_FOR_HUMAN_APPROVAL** (exit 0). The policy's checks passed. It is still not permission to deploy.
53
+
54
+ Then read "Supplied test evidence". If it says no file was supplied, the pass/fail counts you might imagine are not in this report. Then read the findings table: severity, rule, file:line, and the fix. The limitations at the bottom are part of the result, not a footnote to skip.
55
+
56
+ Samples you can open without scanning anything:
57
+
58
+ | Situation | Markdown | HTML |
59
+ |---|---|---|
60
+ | Focused test, NO_GO | [report.md](samples/focused-test/report.md) | [report.html](samples/focused-test/report.html) |
61
+ | Clean project plus passing evidence | [report.md](samples/clean-project/report.md) | [report.html](samples/clean-project/report.html) |
62
+ | Tests exist, CI does not | [report.md](samples/missing-ci/report.md) | [report.html](samples/missing-ci/report.html) |
63
+ | CI exists, tests do not | [report.md](samples/missing-tests/report.md) | [report.html](samples/missing-tests/report.html) |
64
+ | Odd file names, still a focused test | [report.md](samples/unsafe-names/report.md) | [report.html](samples/unsafe-names/report.html) |
65
+ | Python, Java and Go skips | [report.md](samples/multi-language/report.md) | [report.html](samples/multi-language/report.html) |
66
+
67
+ This repository's own audit: [audit/report.md](audit/report.md) and [audit/report.html](audit/report.html).
68
+
69
+ ## Supply evidence
70
+
71
+ The CLI will not run your tests. You run them, then describe the result. Minimum shape:
72
+
73
+ ```json
74
+ {
75
+ "schemaVersion": "1.0.0",
76
+ "source": "local-executed",
77
+ "command": "npm test",
78
+ "executedAt": "2026-11-06T12:00:00Z",
79
+ "exitCode": 0,
80
+ "passed": 37,
81
+ "failed": 0,
82
+ "skipped": 1
83
+ }
84
+ ```
85
+
86
+ `source` is `local-executed` when you ran it on a machine you control, or `ci-ingested` when the counts came from the CI log. Use `external-unverified` when you cannot stand behind the file; the gate will stay in review.
87
+
88
+ ```bash
89
+ node packages/cli/bin/pramanasutra.mjs release-check --path . --evidence evidence.json
90
+ ```
91
+
92
+ Check a file alone:
93
+
94
+ ```bash
95
+ node packages/cli/bin/pramanasutra.mjs verify --evidence evidence.json
96
+ ```
97
+
98
+ In this repository, `node scripts/ci-gate.mjs` runs the unit tests and builds that file from the summary. It does not hand-type the counts. Copy that pattern in your own CI rather than committing a stale evidence file.
99
+
100
+ ## Choose a policy
101
+
102
+ ```bash
103
+ node packages/cli/bin/pramanasutra.mjs release-check --path . --evidence evidence.json --policy policies/strict.json
104
+ ```
105
+
106
+ Strict mode turns skipped tests into `NO_GO`. Recommended mode reports them and does not block on them. Write your own file with only the keys in the [technical reference](04-technical-reference.md). A typo in a key is an error, on purpose.
107
+
108
+ ## Install the skills
109
+
110
+ ```bash
111
+ node packages/cli/bin/pramanasutra.mjs init --ide claude --target /path/to/your/app
112
+ ```
113
+
114
+ The target must already exist. The command copies folders. It does not call the model. If you already have a `pramanasutra-prime` skill there, it stops. Read the existing file before you pass `--force`.
115
+
116
+ Then tell the assistant, in your own words or this one:
117
+
118
+ > PramanaSutra Prime: assess this repository's test quality and release readiness. Stay read-only, cite file and line, separate observed facts from executed results, and ask before running any tests.
119
+
120
+ The skill is supposed to refuse to invent a pass. If a host ignores the skill, that is a host limitation. It is listed as not verified in [Roadmap and status](13-roadmap-and-status.md).
121
+
122
+ ## Exclude paths
123
+
124
+ Put `.pramanasutraignore` at the root of the project you scan. Example:
125
+
126
+ ```text
127
+ # generated fixtures, not the product
128
+ fixtures/
129
+ examples/sample-app/
130
+ ```
131
+
132
+ The report will say how many paths were excluded. If you exclude your real tests, the gate can look healthier than the project is. That is your file. Read the limitation line.
133
+
134
+ ## Fix a NO_GO for a focused test
135
+
136
+ 1. Open the path in the finding, for example `tests/a.test.js:2`.
137
+ 2. Remove `.only`, `fit` or `fdescribe`.
138
+ 3. Run the project's real test command and keep the output.
139
+ 4. Run `release-check` again with `--evidence` pointing at a file that matches that output.
140
+
141
+ Removing `.only` without running the suite only clears the static finding. Without evidence the gate becomes `REVIEW_REQUIRED`, which is still not ready. That is the correct outcome.
142
+
143
+ ## When something fails
144
+
145
+ | Symptom | What it usually means |
146
+ |---|---|
147
+ | `Node 20+ required` | `doctor` saw an older Node. Install 20 or newer |
148
+ | `Scan target must be a real directory` | The path is missing, a file, or a symlink |
149
+ | `Invalid evidence` | A field is missing or the wrong type. `verify` prints the reason |
150
+ | `Invalid policy` | Unknown key, or a safety flag set to an unsafe value |
151
+ | Exit 3 and you expected 0 | No evidence, evidence not from a trusted source, zero passes, partial scan, or missing tests, CI or license |
152
+ | HTML looks empty of findings | The scan found none. Read the limitations and the evidence block before you treat that as healthy |
153
+ | Tests "passed" inside an AI chat but the CLI says not-run | The chat is not evidence. Pass `--evidence` or do not claim the run |
154
+
155
+ More terms: [FAQ](14-faq-and-glossary.md).
@@ -0,0 +1,79 @@
1
+ # CLI and reports
2
+
3
+ <!-- summary: Every PramanaSutra AI command and flag, and how report.md, report.html, report.json and report.sarif.json present the same audit. -->
4
+
5
+ Binary name: `pramanasutra`. From a clone: `node packages/cli/bin/pramanasutra.mjs`.
6
+
7
+ ## Commands
8
+
9
+ | Command | What it does | Exit |
10
+ |---|---|---|
11
+ | `version`, `--version`, `-v` | Prints `PramanaSutra AI` and the version | 0 |
12
+ | `help`, `--help`, `-h` | Prints usage | 0 |
13
+ | `doctor [--json]` | Node major version, platform, offline, no model | 0 if Node ≥ 20, else 1 |
14
+ | `agents list [--json]` | Canonical skill names | 0 |
15
+ | `scan --path <dir> [--changed] [--out <dir>] [--no-report] [--json]` | Static audit plus a gate with no evidence file. Same exit codes as `release-check` | 0, 2, 3, or 1 |
16
+ | `release-check --path <dir> [--evidence <file>] [--policy <file>] [--changed] [--out <dir>] [--no-report] [--json]` | Audit plus gate. This is the CI command | 0, 2, 3, or 1 |
17
+ | `verify --evidence <file> [--json]` | Schema-check an evidence file. Does not scan | 0 or 1 |
18
+ | `init --ide <name> --target <dir> [--force]` | Copy skills. `--ide` is `claude`, `cursor`, `codex`, `gemini`, `copilot`, `generic` or `all` | 0 or 1 |
19
+
20
+ `--json` prints the object instead of the sentence. For `release-check --json`, the process exit code is still the gate. Do not parse the exit code from the JSON alone; use `releaseGate.decision` if you need the word, and the process status if you need CI to fail.
21
+
22
+ `--evidence` and `--policy` on `scan` are errors. They belong to `release-check` so a scan cannot quietly change meaning.
23
+
24
+ ## Flags that take a value
25
+
26
+ `--path`, `--out`, `--ide`, `--target`, `--evidence`, `--policy`. The value is the next argument. A missing value is an error. `--force`, `--json`, `--no-report` and `--changed` take no value. `--changed` is only meaningful on `scan` and `release-check`.
27
+
28
+ ## Where files are written
29
+
30
+ Default: `pramanasutra-reports` under the **current working directory**, resolved to an absolute path at write time. The scanned project is not the default output location, so a scan of a foreign tree does not drop files into it.
31
+
32
+ The four names are fixed: `report.md`, `report.html`, `report.json`, `report.sarif.json`. They are written in that order, in one directory, in one call. If the directory cannot be created, nothing is reported as success. SARIF is a rendering of the findings for other tools. The CLI does not upload it and does not fetch the SARIF schema.
33
+
34
+ ## How to read report.md
35
+
36
+ 1. The first table is identity: project base name, time, tool version, schema, **Release decision**, policy, evidence state.
37
+ 2. The blockquote repeats the decision in a sentence.
38
+ 3. **Summary** counts files, test files, workflows, manifests and findings by severity. It states that this tool did not execute tests.
39
+ 4. **Supplied test evidence** is either an explicit "no file" or a table of source, command, time, exit code, passed, failed, skipped, and GitHub fields when present. Those numbers are from the file. They are not a new test run. The next paragraph is the binding: `none` (no file), `unbound` (no `github` object), or `ci-environment` (repository, commit, run id and workflow are all set). `ci-environment` is still not checked with GitHub. A person can type those four strings.
40
+ 5. **Findings at a glance** is the table to paste into a review: severity, rule, `path:line`, fix.
41
+ 6. **Findings** repeats each item with why it matters.
42
+ 7. **Test files seen** and **CI workflows seen** show what the classification actually matched, up to 40 paths, then a count of the rest.
43
+ 8. **Capabilities** translates `not-run` and `not-supported`.
44
+ 9. **Release gate reasons** is the list that produced the decision.
45
+ 10. **Limitations** includes walk limits, ignore exclusions, and the standing disclaimer.
46
+
47
+ Characters that would be HTML in a file name are escaped in the Markdown too, so a hostile path does not become a tag when GitHub renders the file.
48
+
49
+ ## How to read report.html
50
+
51
+ Same sections, in the same order. The decision is a banner with a text label, not color alone. Stats are the counts. There is a skip link, a system light/dark theme, and a print style. No script is required to read it, and the file does not load a remote stylesheet or font. Open it from disk.
52
+
53
+ Do not host the HTML from an untrusted scan on a site that other people browse if the report might contain internal paths. The tool strips the absolute target path, but evidence `command`, `environment` and `commit` are whatever the evidence file contained, escaped for HTML and still visible as text.
54
+
55
+ ## How to read report.json
56
+
57
+ Parse it. Do not scrape the Markdown. Fields are listed in the [technical reference](04-technical-reference.md). `releaseGate.automatedDeploymentAuthorized` is false. `releaseGate.requiresHumanApproval` is true. If your automation treats a ready decision as permission to deploy, it is ignoring those fields.
58
+
59
+ ## Worked terminal session
60
+
61
+ Against the focused-test fixture, from a clone:
62
+
63
+ ```bash
64
+ node packages/cli/bin/pramanasutra.mjs release-check --path fixtures/focused-test --no-report
65
+ ```
66
+
67
+ Expect exit code 2 and a line containing `Gate: NO_GO` and `Tests executed by this tool: NO`. The fixture is a bad example on purpose. The full rendered reports are already committed under [samples/focused-test](samples/focused-test/report.md).
68
+
69
+ Against the clean fixture with its evidence file:
70
+
71
+ ```bash
72
+ node packages/cli/bin/pramanasutra.mjs release-check --path fixtures/clean-project --evidence fixtures/clean-project/evidence.json --no-report
73
+ ```
74
+
75
+ Expect exit code 0 and `READY_FOR_HUMAN_APPROVAL`.
76
+
77
+ ## What the report will not contain
78
+
79
+ A coverage percentage, a flaky-test rate, a screenshot, a CVE list, a performance number, or a sentence that the suite passed, unless that sentence is the evidence table quoting the file you passed in. If a field is absent, it was not measured.
@@ -0,0 +1,79 @@
1
+ # Rule catalog
2
+
3
+ <!-- summary: Every static rule PramanaSutra AI 0.3.4 can emit, with severity, what the line looks like, a committed sample, and the misses to expect. -->
4
+
5
+ Rules are regular expressions on a single line of a file already classified as a test. They are not ASTs. Confidence is `medium` unless noted. Status on a finding is `observed`, which means "the pattern matched", not "a test was executed".
6
+
7
+ A line that is a string in the middle of other code does not match, because the pattern is anchored at the start of the line (after whitespace). A line that is only the declaration does match. That is why a fixture string inside `const fixture = 'test.only(...)'` is not a finding, and a real `test.only` line is.
8
+
9
+ ## FOCUSED_TEST
10
+
11
+ | | |
12
+ |---|---|
13
+ | Severity | high |
14
+ | Default gate | `NO_GO` when `blockOnFocusedTests` is true (the default) |
15
+ | Why | A focused test runs one case and silently drops the rest. CI can be green and meaningless |
16
+ | Matches | Line starts with optional `await`, then `describe.only(`, `test.only(`, `it.only(`, or `fit(`, `fdescribe(` |
17
+ | Fix text | Remove `.only` / `fit` / `fdescribe`, then execute the full suite |
18
+ | Sample | [samples/focused-test](samples/focused-test/report.md) |
19
+
20
+ Does not match `test.only` split across two lines, a custom wrapper such as `only(test(`, or a focused test in a language outside the pattern (for example Rust `#[ignore]` is not this rule). A team that uses a helper named `test.only` for something else will get a false positive.
21
+
22
+ ## SKIPPED_TEST
23
+
24
+ | | |
25
+ |---|---|
26
+ | Severity | low |
27
+ | Default gate | Reported. Blocks only when `blockOnSkippedTests` is true (`policies/strict.json`) |
28
+ | Why | A skip can be an honest pending test or a buried failure. The tool cannot tell |
29
+ | Matches | `describe.skip(`, `test.skip(`, `it.skip(`, `test.todo(`, `xit(`, `xtest(`, `xdescribe(` |
30
+ | Also matches | `@pytest.mark.skip`, `@pytest.mark.xfail` (including `skipif`, because `skip` is a prefix), `@unittest.skip...`, `@Ignore`, `@Disabled`, `t.Skip(` and `t.SkipNow(` (Go), `pytest.skip(`, `pytest.xfail(`, `self.skipTest(`, `raise unittest.SkipTest` |
31
+ | Fix text | Confirm the skip is intended, tracked, and does not hide a required case |
32
+ | Sample | [samples/multi-language](samples/multi-language/report.md) (pytest decorator, JUnit `@Disabled`, Go `t.Skip`) |
33
+
34
+ Does not match a skip buried in a helper, `pending(` in Mocha, `it.skip` if the call is not at the start of the line, or Rust `#[ignore]`. `@Disabled` with a trailing word and a word boundary will not match `@DisabledIf`.
35
+
36
+ ## NO_TESTS
37
+
38
+ | | |
39
+ |---|---|
40
+ | Severity | medium |
41
+ | Default gate | `REVIEW_REQUIRED` when `requireTests` is true and the test list is empty |
42
+ | Why | The supported naming conventions found nothing. The project may still have tests under an unknown layout |
43
+ | Evidence | `path` is `.`, no line |
44
+ | Fix text | Confirm the framework location; add and execute relevant tests |
45
+ | Sample | [samples/missing-tests](samples/missing-tests/report.md) |
46
+
47
+ False positive: tests live in a folder this regex does not treat as tests, and none of the file names match. False negative: a file is named like a test and contains no assertions. The rule does not read assertions.
48
+
49
+ ## NO_CI
50
+
51
+ | | |
52
+ |---|---|
53
+ | Severity | medium |
54
+ | Default gate | `REVIEW_REQUIRED` when `requireCi` is true and no workflow file matched |
55
+ | Recognises | `.github/workflows/*.yml` and `.yaml`, `.gitlab-ci.yml`, `Jenkinsfile`, `azure-pipelines.yml`, `bitbucket-pipelines.yml`, `.circleci/config.yml`, `.buildkite/pipeline.yml`, `.drone.yml`, `woodpecker.yml` |
56
+ | Does not recognise | A CI config with another name, a workflow that exists only in a hosted UI, or a file that is present but never runs |
57
+ | Sample | [samples/missing-ci](samples/missing-ci/report.md) |
58
+
59
+ Finding a workflow file does not mean the workflow runs tests. The rule is presence, not semantics.
60
+
61
+ ## NO_LICENSE
62
+
63
+ | | |
64
+ |---|---|
65
+ | Severity | low |
66
+ | Confidence | high (it is a file name check) |
67
+ | Default gate | `REVIEW_REQUIRED` when `requireLicense` is true |
68
+ | Recognises | `LICENSE`, `LICENSE.md`, `LICENSE.txt`, `COPYING` at the repository root only, any case |
69
+ | Sample | [samples/multi-language](samples/multi-language/report.md) includes this finding together with the skips |
70
+
71
+ A license inside `docs/` or a `package.json` `"license"` field without a file is not detected. The recommendation is to review intended licensing, not to invent a license the project did not choose.
72
+
73
+ ## Gate interaction
74
+
75
+ Blocking findings are evaluated before evidence. A high finding (or a focused test while that block is on, or a skip while the strict block is on) is `NO_GO` even if evidence passes. If nothing blocks and evidence is `failing`, the decision is still `NO_GO`. Only then does the gate look at missing evidence, a partial scan, missing tests, missing CI and a missing license. Any of those yield `REVIEW_REQUIRED`. If none of them fire, the decision is `READY_FOR_HUMAN_APPROVAL`.
76
+
77
+ ## Adding a rule
78
+
79
+ Do not add a rule that the tests do not lock with a true positive and a false positive. The [maintainer guide](15-maintainer-guide.md) is the procedure. Update this page in the same change, then rebuild the HTML.