@marinjursic/prc-windows-arm64 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (264) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/bin/LICENSE +21 -0
  4. package/bin/README.md +335 -0
  5. package/bin/THIRD_PARTY_NOTICES.md +74 -0
  6. package/bin/adapters/checkov-v3.3.8.yaml +50 -0
  7. package/bin/adapters/gitleaks-v8.30.0.yaml +63 -0
  8. package/bin/adapters/grype-v0.116.1.yaml +58 -0
  9. package/bin/adapters/syft-v1.51.0.yaml +54 -0
  10. package/bin/catalog/assertions/core-repository.yaml +625 -0
  11. package/bin/catalog/assertions/iac.yaml +24 -0
  12. package/bin/catalog/assertions/supply-chain.yaml +45 -0
  13. package/bin/catalog/control-contracts.json +1 -0
  14. package/bin/catalog/control-id-registry.json +110470 -0
  15. package/bin/catalog/objectives/core-repository.yaml +243 -0
  16. package/bin/catalog/objectives/iac.yaml +13 -0
  17. package/bin/catalog/objectives/supply-chain.yaml +13 -0
  18. package/bin/catalog/profiles/api.yaml +12 -0
  19. package/bin/catalog/profiles/core-repository.yaml +49 -0
  20. package/bin/catalog/profiles/iac.yaml +18 -0
  21. package/bin/catalog/profiles/kubernetes.yaml +15 -0
  22. package/bin/catalog/profiles/quick.yaml +27 -0
  23. package/bin/catalog/profiles/supply-chain.yaml +20 -0
  24. package/bin/docs/architecture/adapters.md +380 -0
  25. package/bin/docs/architecture/agent-providers.md +188 -0
  26. package/bin/docs/architecture/applicability.md +80 -0
  27. package/bin/docs/architecture/catalog-integrity.md +85 -0
  28. package/bin/docs/architecture/evidence-and-results.md +154 -0
  29. package/bin/docs/architecture/execution-plans.md +61 -0
  30. package/bin/docs/architecture/product-contract.md +76 -0
  31. package/bin/docs/architecture/publisher-trust.md +68 -0
  32. package/bin/docs/architecture/remediation-contract.md +113 -0
  33. package/bin/docs/architecture/trust-model.md +95 -0
  34. package/bin/docs/assets/hero.svg +37 -0
  35. package/bin/docs/assets/logo.svg +13 -0
  36. package/bin/docs/assets/production-readiness-scan-demo-poster.png +0 -0
  37. package/bin/docs/assets/production-readiness-scan-demo.gif +0 -0
  38. package/bin/docs/assets/production-readiness-scan-demo.mp4 +0 -0
  39. package/bin/docs/assets/social-card.png +0 -0
  40. package/bin/docs/assets/social-card.svg +40 -0
  41. package/bin/docs/checklists/00-readiness-principle.md +17 -0
  42. package/bin/docs/checklists/01-release-foundations.md +91 -0
  43. package/bin/docs/checklists/02-product-risk-architecture.md +136 -0
  44. package/bin/docs/checklists/03-source-build-supply-chain.md +97 -0
  45. package/bin/docs/checklists/04-environments-quality-experience.md +226 -0
  46. package/bin/docs/checklists/05-application-security.md +320 -0
  47. package/bin/docs/checklists/06-data-privacy-performance.md +166 -0
  48. package/bin/docs/checklists/07-reliability-operations.md +355 -0
  49. package/bin/docs/checklists/08-maintenance-vendors-compliance.md +112 -0
  50. package/bin/docs/checklists/09-conditional-modules.md +229 -0
  51. package/bin/docs/checklists/10-evidence-and-decision.md +111 -0
  52. package/bin/docs/engineering/00-overview.md +51 -0
  53. package/bin/docs/engineering/01-governance-and-foundations.md +919 -0
  54. package/bin/docs/engineering/02-product-and-requirements.md +186 -0
  55. package/bin/docs/engineering/03-user-experience-web-and-content.md +1352 -0
  56. package/bin/docs/engineering/04-architecture-and-design.md +387 -0
  57. package/bin/docs/engineering/05-code-quality-and-implementation.md +1103 -0
  58. package/bin/docs/engineering/06-application-services-and-apis.md +476 -0
  59. package/bin/docs/engineering/07-data-and-information-lifecycle.md +1009 -0
  60. package/bin/docs/engineering/08-security-and-cryptography.md +1215 -0
  61. package/bin/docs/engineering/09-privacy-and-data-protection.md +205 -0
  62. package/bin/docs/engineering/10-verification-and-testing.md +841 -0
  63. package/bin/docs/engineering/11-developer-experience-platform-and-delivery.md +1013 -0
  64. package/bin/docs/engineering/12-operations-sre-and-support.md +795 -0
  65. package/bin/docs/engineering/13-documentation-and-knowledge.md +349 -0
  66. package/bin/docs/engineering/14-trust-safety-and-ecosystems.md +330 -0
  67. package/bin/docs/engineering/15-ai-ml-and-ai-assisted-development.md +785 -0
  68. package/bin/docs/engineering/16-specialized-domains-and-release-assurance.md +775 -0
  69. package/bin/docs/engineering/source-manifest.md +479 -0
  70. package/bin/docs/guides/ai-assisted-review.md +61 -0
  71. package/bin/docs/guides/getting-started.md +78 -0
  72. package/bin/docs/index.md +66 -0
  73. package/bin/docs/prompts/evidence-challenge.md +26 -0
  74. package/bin/docs/prompts/full-readiness-review.md +34 -0
  75. package/bin/docs/prompts/release-diff-review.md +31 -0
  76. package/bin/docs/records/evidence-record.md +42 -0
  77. package/bin/docs/records/go-no-go-decision.md +63 -0
  78. package/bin/docs/records/release-assessment.md +124 -0
  79. package/bin/docs/records/risk-exception.md +64 -0
  80. package/bin/docs/references.md +52 -0
  81. package/bin/docs/scanner/ai-control-review.md +208 -0
  82. package/bin/docs/scanner/benchmarks.md +122 -0
  83. package/bin/docs/scanner/cli-contract.md +130 -0
  84. package/bin/docs/scanner/configuration.md +101 -0
  85. package/bin/docs/scanner/control-contracts.md +47 -0
  86. package/bin/docs/scanner/core-repository.md +62 -0
  87. package/bin/docs/scanner/diff-and-invalidation.md +79 -0
  88. package/bin/docs/scanner/doctor.md +71 -0
  89. package/bin/docs/scanner/getting-started.md +355 -0
  90. package/bin/docs/scanner/go-http-timeouts.md +96 -0
  91. package/bin/docs/scanner/infrastructure-policy.md +64 -0
  92. package/bin/docs/scanner/kubernetes-workloads.md +63 -0
  93. package/bin/docs/scanner/mcp-agent-integration.md +138 -0
  94. package/bin/docs/scanner/openapi-contracts.md +75 -0
  95. package/bin/docs/scanner/private-key-armor.md +44 -0
  96. package/bin/docs/scanner/releases.md +160 -0
  97. package/bin/docs/scanner/remediation.md +273 -0
  98. package/bin/docs/scanner/risk-exceptions.md +52 -0
  99. package/bin/docs/scanner/security-walkthrough.md +236 -0
  100. package/bin/docs/scanner/state-and-history.md +113 -0
  101. package/bin/docs/scanner/supply-chain.md +132 -0
  102. package/bin/docs/scanner/test-discovery.md +60 -0
  103. package/bin/docs/stylesheets/extra.css +183 -0
  104. package/bin/fixtures/benchmarks/core-native/suite-comprehensive.yaml +302 -0
  105. package/bin/fixtures/benchmarks/core-native/suite.yaml +59 -0
  106. package/bin/fixtures/benchmarks/core-native/targets/baseline/README.md +3 -0
  107. package/bin/fixtures/benchmarks/core-native/targets/baseline/app.go +1 -0
  108. package/bin/fixtures/benchmarks/core-native/targets/conflict-template/app.js +5 -0
  109. package/bin/fixtures/benchmarks/core-native/targets/container-risky-template/Dockerfile +2 -0
  110. package/bin/fixtures/benchmarks/core-native/targets/container-valid/Dockerfile +2 -0
  111. package/bin/fixtures/benchmarks/core-native/targets/dependency-lock-missing/package.json +5 -0
  112. package/bin/fixtures/benchmarks/core-native/targets/dependency-lock-present/package-lock.json +6 -0
  113. package/bin/fixtures/benchmarks/core-native/targets/dependency-lock-present/package.json +5 -0
  114. package/bin/fixtures/benchmarks/core-native/targets/empty-manifest-template/package.json +1 -0
  115. package/bin/fixtures/benchmarks/core-native/targets/final-newline-template/app.py +1 -0
  116. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/.github/CODEOWNERS +1 -0
  117. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/.github/dependabot.yml +6 -0
  118. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/.github/workflows/validate.yml +15 -0
  119. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/CODE_OF_CONDUCT.md +3 -0
  120. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/CONTRIBUTING.md +3 -0
  121. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/LICENSE +1 -0
  122. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/README.md +3 -0
  123. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/SECURITY.md +3 -0
  124. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/package-lock.json +6 -0
  125. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/package.json +7 -0
  126. package/bin/fixtures/benchmarks/core-native/targets/foundation-present/tests/example.test.js +3 -0
  127. package/bin/fixtures/benchmarks/core-native/targets/go-http-server-timeout-risky-template/go.mod +3 -0
  128. package/bin/fixtures/benchmarks/core-native/targets/go-http-server-timeout-risky-template/server.go +18 -0
  129. package/bin/fixtures/benchmarks/core-native/targets/go-http-timeout-malformed-template/client.go +3 -0
  130. package/bin/fixtures/benchmarks/core-native/targets/go-http-timeout-malformed-template/go.mod +3 -0
  131. package/bin/fixtures/benchmarks/core-native/targets/go-http-timeout-risky-template/client.go +7 -0
  132. package/bin/fixtures/benchmarks/core-native/targets/go-http-timeout-risky-template/go.mod +3 -0
  133. package/bin/fixtures/benchmarks/core-native/targets/go-http-timeout-safe/client.go +22 -0
  134. package/bin/fixtures/benchmarks/core-native/targets/go-http-timeout-safe/go.mod +3 -0
  135. package/bin/fixtures/benchmarks/core-native/targets/go-http-timeout-safe/hazards_test.go +8 -0
  136. package/bin/fixtures/benchmarks/core-native/targets/kubernetes-risky-template/deployment.yaml +27 -0
  137. package/bin/fixtures/benchmarks/core-native/targets/kubernetes-valid/deployment.yaml +26 -0
  138. package/bin/fixtures/benchmarks/core-native/targets/openapi-operation-ids-risky-template/openapi.yaml +17 -0
  139. package/bin/fixtures/benchmarks/core-native/targets/openapi-operation-responses-risky-template/openapi.yaml +11 -0
  140. package/bin/fixtures/benchmarks/core-native/targets/openapi-root-malformed-template/openapi.yaml +5 -0
  141. package/bin/fixtures/benchmarks/core-native/targets/openapi-root-risky-template/openapi.yaml +5 -0
  142. package/bin/fixtures/benchmarks/core-native/targets/openapi-root-valid/openapi.yaml +17 -0
  143. package/bin/fixtures/benchmarks/core-native/targets/package-test-command/app.js +3 -0
  144. package/bin/fixtures/benchmarks/core-native/targets/package-test-command/package.json +7 -0
  145. package/bin/fixtures/benchmarks/core-native/targets/package-test-placeholder/app.js +3 -0
  146. package/bin/fixtures/benchmarks/core-native/targets/package-test-placeholder/package.json +7 -0
  147. package/bin/fixtures/benchmarks/core-native/targets/private-key-template/deploy.pem +3 -0
  148. package/bin/fixtures/benchmarks/core-native/targets/readme-missing/fixture.txt +1 -0
  149. package/bin/fixtures/benchmarks/core-native/targets/runtime-missing/package-lock.json +6 -0
  150. package/bin/fixtures/benchmarks/core-native/targets/runtime-missing/package.json +4 -0
  151. package/bin/fixtures/benchmarks/core-native/targets/terraform-locked/.terraform.lock.hcl +3 -0
  152. package/bin/fixtures/benchmarks/core-native/targets/terraform-locked/main.tf +7 -0
  153. package/bin/fixtures/benchmarks/core-native/targets/terraform-unlocked-template/.terraform.lock.hcl +3 -0
  154. package/bin/fixtures/benchmarks/core-native/targets/terraform-unlocked-template/main.tf +7 -0
  155. package/bin/fixtures/benchmarks/core-native/targets/test-declaration-valid/app.py +2 -0
  156. package/bin/fixtures/benchmarks/core-native/targets/test-declaration-valid/tests/test_app.py +5 -0
  157. package/bin/fixtures/benchmarks/core-native/targets/test-path-without-declaration/app.py +2 -0
  158. package/bin/fixtures/benchmarks/core-native/targets/test-path-without-declaration/tests/test_app.py +1 -0
  159. package/bin/fixtures/benchmarks/core-native/targets/workflow-malformed/.github/workflows/validate.yml +1 -0
  160. package/bin/fixtures/benchmarks/core-native/targets/workflow-no-jobs/.github/workflows/empty.yml +9 -0
  161. package/bin/fixtures/benchmarks/core-native/targets/workflow-risky/.github/workflows/risky.yml +10 -0
  162. package/bin/fixtures/benchmarks/core-native/targets/workflow-valid/.github/workflows/validate.yml +14 -0
  163. package/bin/packs/core-foundation.yaml +25 -0
  164. package/bin/packs/core-native.yaml +59 -0
  165. package/bin/prc.exe +0 -0
  166. package/bin/schemas/adapter-execution-v0.1.schema.json +101 -0
  167. package/bin/schemas/adapter-execution-v0.2.schema.json +128 -0
  168. package/bin/schemas/adapter-execution.schema.json +145 -0
  169. package/bin/schemas/adapter-fixture-report.schema.json +59 -0
  170. package/bin/schemas/adapter-fixture-suite.schema.json +104 -0
  171. package/bin/schemas/adapter-manifest-v0.1.schema.json +55 -0
  172. package/bin/schemas/adapter-manifest-v0.2.schema.json +122 -0
  173. package/bin/schemas/adapter-manifest-v0.3.schema.json +172 -0
  174. package/bin/schemas/adapter-manifest.schema.json +299 -0
  175. package/bin/schemas/adapter-message.schema.json +136 -0
  176. package/bin/schemas/adapter-registry-report.schema.json +13 -0
  177. package/bin/schemas/adapter-registry.schema.json +47 -0
  178. package/bin/schemas/agent-execution-v0.1.schema.json +26 -0
  179. package/bin/schemas/agent-execution.schema.json +26 -0
  180. package/bin/schemas/agent-failure-v0.1.schema.json +102 -0
  181. package/bin/schemas/agent-failure.schema.json +102 -0
  182. package/bin/schemas/agent-output-v0.1.schema.json +36 -0
  183. package/bin/schemas/agent-output.schema.json +36 -0
  184. package/bin/schemas/agent-task-v0.1.schema.json +44 -0
  185. package/bin/schemas/agent-task.schema.json +46 -0
  186. package/bin/schemas/assertion-catalog.schema.json +69 -0
  187. package/bin/schemas/benchmark-report.schema.json +94 -0
  188. package/bin/schemas/benchmark-suite.schema.json +116 -0
  189. package/bin/schemas/catalog-bundle.schema.json +27 -0
  190. package/bin/schemas/catalog-manifest.schema.json +23 -0
  191. package/bin/schemas/checkov-iac-policy-report.schema.json +82 -0
  192. package/bin/schemas/control-contracts.schema.json +44 -0
  193. package/bin/schemas/control-review-output.schema.json +51 -0
  194. package/bin/schemas/doctor.schema.json +53 -0
  195. package/bin/schemas/evidence-v0.1.schema.json +21 -0
  196. package/bin/schemas/evidence.schema.json +21 -0
  197. package/bin/schemas/finding-v0.1.schema.json +70 -0
  198. package/bin/schemas/finding.schema.json +70 -0
  199. package/bin/schemas/fix-contract-v0.1.schema.json +35 -0
  200. package/bin/schemas/fix-contract-v0.2.schema.json +46 -0
  201. package/bin/schemas/fix-contract-v0.3.schema.json +49 -0
  202. package/bin/schemas/fix-contract.schema.json +49 -0
  203. package/bin/schemas/grype-vulnerability-report.schema.json +88 -0
  204. package/bin/schemas/history.schema.json +37 -0
  205. package/bin/schemas/invalidation.schema.json +86 -0
  206. package/bin/schemas/inventory-v0.1.schema.json +42 -0
  207. package/bin/schemas/inventory-v0.2.schema.json +95 -0
  208. package/bin/schemas/inventory-v0.3.schema.json +139 -0
  209. package/bin/schemas/inventory.schema.json +139 -0
  210. package/bin/schemas/objective-catalog.schema.json +62 -0
  211. package/bin/schemas/pack-report.schema.json +16 -0
  212. package/bin/schemas/pack.schema.json +53 -0
  213. package/bin/schemas/plan-v0.1.schema.json +31 -0
  214. package/bin/schemas/plan-v0.2.schema.json +32 -0
  215. package/bin/schemas/plan-v0.3.schema.json +44 -0
  216. package/bin/schemas/plan-v0.4.schema.json +48 -0
  217. package/bin/schemas/plan-v0.5.schema.json +49 -0
  218. package/bin/schemas/plan-v0.6.schema.json +137 -0
  219. package/bin/schemas/plan.schema.json +137 -0
  220. package/bin/schemas/profile.schema.json +42 -0
  221. package/bin/schemas/project-config.schema.json +128 -0
  222. package/bin/schemas/release-manifest-v0.1.schema.json +86 -0
  223. package/bin/schemas/release-manifest-v0.2.schema.json +146 -0
  224. package/bin/schemas/release-manifest-v0.3.schema.json +146 -0
  225. package/bin/schemas/release-manifest.schema.json +6 -0
  226. package/bin/schemas/remediation-candidate-v0.1.schema.json +51 -0
  227. package/bin/schemas/remediation-candidate-v0.2.schema.json +51 -0
  228. package/bin/schemas/remediation-candidate-v0.3.schema.json +51 -0
  229. package/bin/schemas/remediation-candidate-v0.4.schema.json +69 -0
  230. package/bin/schemas/remediation-candidate.schema.json +69 -0
  231. package/bin/schemas/remediation-run-v0.1.schema.json +69 -0
  232. package/bin/schemas/remediation-run-v0.2.schema.json +78 -0
  233. package/bin/schemas/remediation-run-v0.3.schema.json +86 -0
  234. package/bin/schemas/remediation-run-v0.4.schema.json +86 -0
  235. package/bin/schemas/remediation-run-v0.5.schema.json +131 -0
  236. package/bin/schemas/remediation-run-v0.6.schema.json +143 -0
  237. package/bin/schemas/remediation-run-v0.7.schema.json +160 -0
  238. package/bin/schemas/remediation-run-v0.8.schema.json +161 -0
  239. package/bin/schemas/remediation-run.schema.json +161 -0
  240. package/bin/schemas/risk-exception-verification.schema.json +17 -0
  241. package/bin/schemas/risk-exception.schema.json +137 -0
  242. package/bin/schemas/run-result-v0.1.schema.json +54 -0
  243. package/bin/schemas/run-result-v0.10.schema.json +64 -0
  244. package/bin/schemas/run-result-v0.11.schema.json +146 -0
  245. package/bin/schemas/run-result-v0.2.schema.json +60 -0
  246. package/bin/schemas/run-result-v0.3.schema.json +52 -0
  247. package/bin/schemas/run-result-v0.4.schema.json +52 -0
  248. package/bin/schemas/run-result-v0.5.schema.json +60 -0
  249. package/bin/schemas/run-result-v0.6.schema.json +61 -0
  250. package/bin/schemas/run-result-v0.7.schema.json +61 -0
  251. package/bin/schemas/run-result-v0.8.schema.json +61 -0
  252. package/bin/schemas/run-result-v0.9.schema.json +77 -0
  253. package/bin/schemas/run-result.schema.json +165 -0
  254. package/bin/schemas/signature-verification.schema.json +22 -0
  255. package/bin/schemas/signature.schema.json +18 -0
  256. package/bin/schemas/state-check-v0.1.schema.json +27 -0
  257. package/bin/schemas/state-check.schema.json +28 -0
  258. package/bin/schemas/trust-store.schema.json +50 -0
  259. package/bin/schemas/verification-execution-v0.1.schema.json +105 -0
  260. package/bin/schemas/verification-execution.schema.json +105 -0
  261. package/bin/schemas/version-v0.1.schema.json +27 -0
  262. package/bin/schemas/version.schema.json +27 -0
  263. package/manifest.json +9 -0
  264. package/package.json +28 -0
@@ -0,0 +1,380 @@
1
+ # Sandboxed adapter protocol
2
+
3
+ External tools are untrusted evidence producers. They do not evaluate controls,
4
+ change policy, or mark assertions as passing. The scanner accepts only
5
+ schema-valid observations and leaves the final assertion assessment to the
6
+ deterministic engine.
7
+
8
+ ## Protocol
9
+
10
+ `prc-adapter-jsonl-v1` is a line-delimited JSON protocol over standard input and
11
+ standard output. The scanner sends exactly three messages:
12
+
13
+ ```json
14
+ {"type":"hello","protocol":"prc-adapter-jsonl-v1","run_id":"<64 lowercase hex characters>"}
15
+ {"type":"input","subject":{"target_name":"example","inventory_digest":"<64 lowercase hex characters>"},"facts":{},"config":{}}
16
+ {"type":"execute"}
17
+ ```
18
+
19
+ An adapter may emit bounded `log`, `observation`, and `artifact` messages and
20
+ must end with exactly one `summary`. Standard output is protocol-only. Standard
21
+ error is bounded diagnostic text. A summary is an implementation execution
22
+ status, not a control result.
23
+
24
+ Raw standard error is not echoed in CLI JSON. The runner reports only its byte
25
+ count and SHA-256 digest. Protocol messages may still describe sensitive target
26
+ facts, so operators must treat the transcript as assessment evidence and apply
27
+ appropriate access, redaction, and retention controls.
28
+
29
+ The decoder rejects:
30
+
31
+ - unknown or duplicate JSON fields;
32
+ - blank, oversized, excessive, or trailing messages;
33
+ - absolute, non-normalized, or escaping artifact and source paths;
34
+ - malformed digests, statuses, locations, and counters;
35
+ - missing summaries or messages after a summary; and
36
+ - fields through which an adapter tries to declare `pass`, suppress a finding,
37
+ or otherwise take evaluator authority.
38
+
39
+ The machine contract is
40
+ [`adapter-message.schema.json`](https://github.com/MarinJursic/production-readiness-checklist/blob/main/schemas/adapter-message.schema.json). The
41
+ checked-in release suite includes completed, unsupported, timeout, malformed,
42
+ resource-limit, undeclared-output, and explicit evaluator-authority attack
43
+ transcripts.
44
+
45
+ Manifest v0.4 also defines two closed native-output protocols. The first,
46
+ `prc-adapter-gitleaks-json-v1`, accepts only Gitleaks 8.30.0's reviewed
47
+ official image digest, exact scanner-owned current-tree command, and JSON
48
+ report contract. The scanner supplies the SHA-256-pinned upstream default
49
+ ruleset on standard input, forces full redaction, ignores target-owned Gitleaks
50
+ configuration, ignore files, and `gitleaks:allow` comments, and disables archive
51
+ and recursive-decoding expansion. The normalizer rejects unknown or duplicate
52
+ fields, unredacted findings, history or symlink metadata, paths outside the
53
+ snapshot, inconsistent fingerprints, invalid coordinates, and excessive
54
+ findings. It retains only rule identity and normalized location metadata.
55
+
56
+ The exact redacted native report is represented by a media type, byte count,
57
+ and SHA-256 artifact descriptor in the transcript; raw report content is not
58
+ copied into the durable run record. This preserves content provenance without
59
+ persisting matched source context. An empty report becomes an explicit
60
+ `not_found` observation. One or more findings become `found` observations, but
61
+ neither the tool nor normalizer can declare an assertion pass or failure.
62
+
63
+ The second closed protocol, `prc-adapter-syft-cyclonedx-json-v1`, accepts only
64
+ Syft 1.51.0's reviewed non-root image digest and the scanner-owned directory
65
+ command. The scanner injects an empty configuration at a reserved `.prc` path,
66
+ so target `.syft.yaml` or environment defaults cannot disable catalogers or
67
+ redirect output. The normalizer requires Syft's exact tool identity and
68
+ CycloneDX 1.7 document envelope, rejects duplicate keys, malformed component,
69
+ package-URL, dependency, or metadata structures, and caps the component and
70
+ output counts.
71
+
72
+ Syft generates a fresh timestamp and serial number for identical input. The
73
+ normalizer removes those optional values and the source component's
74
+ non-semantic `bom-ref`, then canonically orders components, properties, and
75
+ dependencies. The resulting `application/vnd.cyclonedx+json;version=1.7`
76
+ artifact is content-addressed and byte-for-byte deterministic for the same
77
+ sealed inventory. When `--state-dir` is supplied, the bytes are written before
78
+ the run that references them. A successful `value` observation proves only
79
+ that this repository-inventory SBOM was generated; it does not claim that a
80
+ built artifact is complete, vulnerability-free, acceptably licensed, or
81
+ production ready.
82
+
83
+ The third closed protocol, `prc-adapter-grype-json-v1`, accepts only Grype
84
+ 0.116.1's reviewed image digest, exact scanner-owned command, and enriched JSON
85
+ report. It injects scanner-owned configuration that disables application and
86
+ database updates, external sources, target ignores, and VEX policy. The
87
+ container runs without network access against one explicitly supplied,
88
+ read-only `grype-db` directory. The runner hashes and seals that directory while
89
+ the normalizer independently requires a valid schema-v6 database, an official
90
+ archive URL with a SHA-256 checksum, a build age no greater than 120 hours, and
91
+ valid EPSS, KEV, and NVD provider provenance.
92
+
93
+ Grype output is decoded with duplicate and unknown-field rejection and bounded
94
+ nested records. Ignored matches, package alerts, escaping paths, unsupported
95
+ tool or database identities, incomplete matching evidence, or unsafe numeric
96
+ values fail the execution. The deterministic normalized artifact retains only
97
+ the findings and provenance needed for assessment; report timestamps and bulk
98
+ raw metadata do not affect its digest. A `not_found` observation is time-bound
99
+ evidence for the catalog gate, while any `found` observation remains a factual
100
+ tool result for the engine to assess.
101
+
102
+ An assertion binding owns the meaning of an observation outcome. Bindings that
103
+ omit an outcome policy retain the conservative analysis default:
104
+ `not_found` passes and `found` fails. A binding may instead declare a nonempty
105
+ `pass_outcomes` list and a disjoint, possibly empty `fail_outcomes` list from
106
+ the closed `found`, `not_found`, `value`, and `unsupported` vocabulary. Any
107
+ unconfigured outcome remains Unknown; a configured pass mixed with another
108
+ unconfigured outcome is Conflicting. The SBOM assertion therefore treats only
109
+ `value` as passing and has no failing tool outcome: malformed, missing,
110
+ unsupported, partial, or contradictory output never becomes Pass.
111
+
112
+ ## Capability manifest
113
+
114
+ Every external adapter has a strict
115
+ [`adapter-manifest.schema.json`](https://github.com/MarinJursic/production-readiness-checklist/blob/main/schemas/adapter-manifest.schema.json).
116
+ Manifest v0.4 binds the exact protocol and output schema, compatible
117
+ engine APIs, publisher and owner identities, immutable tool version and
118
+ supported format versions, declared observation kinds, maintenance state, and
119
+ known limitations. Output validation rejects an observation kind that is not
120
+ declared by that exact manifest. The archived v0.1 through v0.3 schemas remain
121
+ available for record interpretation but are not accepted for new execution.
122
+
123
+ Trust is deliberately not self-declared by the adapter. A registry or explicit
124
+ local operator grant must bind trust to the exact manifest digest and publisher;
125
+ the manifest alone cannot promote itself to first-party or verified status.
126
+ The current experimental runner deliberately supports only a narrow subset:
127
+
128
+ - OCI execution through Docker or Podman;
129
+ - an image reference pinned by a `sha256` digest and explicit registry host;
130
+ - a private, read-only snapshot containing the regular files in the sealed
131
+ inventory plus any exact protocol-owned policy input described below;
132
+ - explicitly declared, content-hashed, read-only external data directories for
133
+ reviewed native adapters whose immutable datasets are too large to copy into
134
+ each project snapshot;
135
+ - no image pull during a scan;
136
+ - no network;
137
+ - no secret handles;
138
+ - no child processes for generic JSONL adapters, with narrowly reviewed,
139
+ PID-bounded OS-task allowances for the pinned Gitleaks, Syft, and Grype
140
+ binaries;
141
+ - an optional bounded scratch `tmpfs`; and
142
+ - explicit wall-time, memory, CPU, process, line, message, stdin, stdout, and
143
+ stderr limits.
144
+
145
+ Before execution, the scanner reopens and hashes every inventoried regular file
146
+ while copying it to a private temporary snapshot. Scanner-excluded paths and
147
+ symlinks are not copied. Protocol-owned path remapping may prevent a target file
148
+ from changing analyzer policy without dropping its content: the Gitleaks
149
+ protocol relocates the root `.gitleaksignore`, scans its original bytes, and
150
+ maps any resulting location back to `.gitleaksignore`. The Syft and Grype
151
+ protocols add only their digest-bound scanner configurations under the
152
+ inventory-excluded `.prc` namespace. A changed type, size, or
153
+ digest stops execution. The snapshot has a 4 GiB safety ceiling, is mounted
154
+ read-only, and is removed after the run. Its own deterministic digest is sealed
155
+ into the OCI plan and checked again immediately before and after the container
156
+ runs, so observations cannot silently refer to different bytes than the
157
+ inventory.
158
+
159
+ External data is a separate trust boundary. A manifest can declare only a
160
+ bounded named directory mounted at its reserved `/prc-inputs/NAME` path. The
161
+ operator supplies the host directory explicitly. The scanner rejects empty,
162
+ oversized, over-populated, symlink-containing, non-regular, missing, extra, or
163
+ duplicate mounts; hashes every file before planning; seals the digest, file
164
+ count, byte count, and destination into the OCI plan; and rehashes the directory
165
+ immediately before and after execution. The durable execution records this
166
+ content identity but never the host path. A data directory changing during a
167
+ run is an execution error, not evidence. This mechanism does not download or
168
+ refresh data and does not let an adapter expand its declared mounts.
169
+
170
+ The generated OCI command also drops all Linux capabilities, enables
171
+ `no-new-privileges`, uses the invoking non-root UID/GID so private snapshot
172
+ permissions need not be broadened, disables swap beyond the memory ceiling,
173
+ caps open files, makes the image root filesystem read-only, and removes the
174
+ named container. The runner refuses root and Windows hosts. Timeout cleanup
175
+ targets only the scanner-generated container name. The plan records the OCI
176
+ client binary digest and execution stops if the plan, manifest, runtime binary,
177
+ or bound snapshot changes after capability evaluation.
178
+
179
+ An OCI runtime is a security control, not proof of perfect isolation. Operators
180
+ must keep the runtime and host patched, review adapter images, and treat runtime
181
+ or resource-control failure as an execution error. Podman documents that some
182
+ rootless resource limits depend on the host cgroup configuration.
183
+
184
+ ## Registry lockfile and revocation
185
+
186
+ [`adapter-registry.schema.json`](https://github.com/MarinJursic/production-readiness-checklist/blob/main/schemas/adapter-registry.schema.json)
187
+ defines the local registry trust root. Each entry pins the adapter ID, manifest
188
+ SHA-256, publisher ID, registry-assigned trust, lifecycle status, and normalized
189
+ relative manifest path. The loader hashes and validates the manifest, rejects
190
+ publisher or lifecycle drift, rejects symlinked or escaping paths, and verifies
191
+ current engine compatibility.
192
+
193
+ `revoked` entries remain effective even when the compromised manifest has been
194
+ removed. Default resolution permits only `first-party-sandboxed` and
195
+ `verified-community` entries; it denies deprecated, unverified-community, and
196
+ local entries. A manifest cannot alter these registry decisions. Detached,
197
+ scoped Ed25519 verification is available through an explicitly selected
198
+ [publisher trust store](publisher-trust.md). The current repository does not
199
+ yet publish an official release trust store or signed registry, so a public
200
+ adapter distribution channel is not yet complete.
201
+
202
+ Validate and inspect a lockfile without executing anything:
203
+
204
+ ```bash
205
+ prc adapter registry-validate \
206
+ --file /path/to/adapter-registry.yaml \
207
+ --format json
208
+ ```
209
+
210
+ ## Inspect and validate
211
+
212
+ Validate the full release fixture suite without executing an adapter:
213
+
214
+ ```bash
215
+ prc adapter fixture-validate \
216
+ --suite fixtures/adapters/fixture-suite.yaml \
217
+ --format json
218
+ ```
219
+
220
+ The strict
221
+ [`adapter-fixture-suite.schema.json`](https://github.com/MarinJursic/production-readiness-checklist/blob/main/schemas/adapter-fixture-suite.schema.json)
222
+ binds every transcript to the canonical digest of one exact manifest. A case
223
+ may reduce the manifest's line, message, or stdout ceiling to exercise a
224
+ resource failure, but it cannot increase adapter authority or resource limits.
225
+ The runner rejects symlinks and paths outside the suite, hashes the suite and
226
+ transcript corpus, and evaluates every case twice. It compares exact
227
+ disposition, summary status, error class, and observation ID, kind, and
228
+ outcome. CI fails when any expectation drifts or either evaluation differs.
229
+
230
+ The resulting
231
+ [`adapter-fixture-report.schema.json`](https://github.com/MarinJursic/production-readiness-checklist/blob/main/schemas/adapter-fixture-report.schema.json)
232
+ is release evidence for protocol compatibility only. It does not prove the
233
+ upstream analyzer's detection accuracy, image provenance, runtime isolation,
234
+ or suitability for the production profile. A real adapter still needs its own
235
+ tool-specific corpus, reviewed pinned image, registry entry, publisher trust,
236
+ and exact catalog binding.
237
+
238
+ Validate a transcript without executing an adapter:
239
+
240
+ ```bash
241
+ prc adapter validate-output \
242
+ --manifest fixtures/adapters/fixture-adapter.yaml \
243
+ --file fixtures/adapters/valid-output.jsonl
244
+ ```
245
+
246
+ Render the exact OCI command without starting a container:
247
+
248
+ ```bash
249
+ prc adapter plan-oci \
250
+ --manifest /path/to/pinned-adapter.yaml \
251
+ --target /path/to/project \
252
+ --runtime docker
253
+ ```
254
+
255
+ Run an already-present pinned image in the bounded OCI environment and emit a
256
+ content-addressed execution record bound to the exact manifest and inventory:
257
+
258
+ ```bash
259
+ prc adapter run-oci \
260
+ --manifest /path/to/pinned-adapter.yaml \
261
+ --target /path/to/project \
262
+ --runtime docker
263
+ ```
264
+
265
+ `--pull=never` means the command fails if the exact image is not already
266
+ available. For a manifest that declares external data, repeat
267
+ `--data NAME=/path/to/directory` for both `plan-oci` and `run-oci`. Current v0.3
268
+ execution records include required `resolution` and `data_inputs` identities.
269
+ An explicit manifest records the publisher and `local-explicit`
270
+ operator grant; a registry resolution additionally binds the registry ID,
271
+ revision, content digest, and registry-assigned trust. Changing any provenance
272
+ field changes the execution ID. Version-specific v0.1 and v0.2 records remain
273
+ valid for archived runs, but v0.1 records cannot be supplied as evidence to a
274
+ new scan. Current run results embed these records. A scan may execute up to 16
275
+ adapters when applicable assertions bind every exact adapter ID, manifest
276
+ SHA-256 digest, and observation kind. Repeat `--adapter-manifest` for an
277
+ explicit local set:
278
+
279
+ ```bash
280
+ prc scan \
281
+ --target /path/to/project \
282
+ --catalog-root /path/to/trusted/catalog \
283
+ --mode verify-local \
284
+ --adapter-manifest /path/to/first-pinned-adapter.yaml \
285
+ --adapter-manifest /path/to/second-pinned-adapter.yaml \
286
+ --adapter-runtime docker
287
+ ```
288
+
289
+ Scan-level data bindings use an adapter-qualified name so multi-adapter runs
290
+ cannot consume one another's inputs:
291
+
292
+ ```bash
293
+ prc scan \
294
+ --target /path/to/project \
295
+ --catalog-root /path/to/trusted/catalog \
296
+ --profile prc/supply-chain \
297
+ --mode verify-local \
298
+ --adapter-manifest /path/to/pinned-adapter.yaml \
299
+ --adapter-data 'prc.adapter.example@1.0/example-db=/path/to/database-cache'
300
+ ```
301
+
302
+ For registry-assigned trust and revocation, resolve the same catalog-pinned
303
+ adapter through a lockfile instead:
304
+
305
+ ```bash
306
+ prc scan \
307
+ --target /path/to/project \
308
+ --catalog-root /path/to/trusted/catalog \
309
+ --mode verify-local \
310
+ --adapter-registry /path/to/adapter-registry.yaml \
311
+ --adapter-id prc.adapter.first@1.0 \
312
+ --adapter-id prc.adapter.second@1.0 \
313
+ --adapter-runtime docker
314
+ ```
315
+
316
+ `--adapter-manifest` is the explicit local-operator path and is mutually
317
+ exclusive with `--adapter-registry`. Adapter paths and IDs cannot repeat. Both
318
+ paths still require an exact manifest digest binding in an applicable catalog
319
+ assertion; registry approval cannot authorize a catalog-unbound adapter. The
320
+ scanner resolves, validates, and authorizes the complete set before invoking the
321
+ runtime, then executes the set in deterministic adapter-ID and manifest-digest
322
+ order. When project configuration supplies a maximum duration, one shared
323
+ deadline bounds the complete set rather than restarting the budget per adapter.
324
+
325
+ The explicit mode grants only the reviewed no-network OCI capability envelope;
326
+ authorization is checked before the OCI runtime is invoked. The adapter cannot
327
+ declare an assertion assessment: the engine maps `found`, `not_found`,
328
+ `unsupported`, incomplete, and conflicting observations through the catalog's
329
+ immutable binding. The execution and each resulting evidence envelope are bound
330
+ to the exact inventory digest. Offline execution-record import is deliberately
331
+ unsupported because a content digest alone does not prove that a tool ran.
332
+
333
+ The default `PRC-A-CORE-013` binding pins
334
+ `prc.adapter.gitleaks@8.30` and the canonical manifest digest for
335
+ `adapters/gitleaks-v8.30.0.yaml`. It remains Blocked in an ordinary inspect-mode
336
+ core scan because inspect mode never launches containers. To produce executed
337
+ evidence, an operator must first pull the exact image digest and then explicitly
338
+ select `--mode verify-local` with the checked-in manifest. The checked-in
339
+ protocol fixture still exercises generic JSONL plumbing in tests but is not
340
+ authorized by the production profile.
341
+
342
+ ```bash
343
+ docker pull \
344
+ ghcr.io/gitleaks/gitleaks@sha256:691af3c7c5a48b16f187ce3446d5f194838f91238f27270ed36eef6359a574d9
345
+
346
+ prc scan \
347
+ --target /path/to/project \
348
+ --catalog-root /path/to/production-readiness-checklist \
349
+ --mode verify-local \
350
+ --adapter-manifest /path/to/production-readiness-checklist/adapters/gitleaks-v8.30.0.yaml
351
+ ```
352
+
353
+ The command scans only the sealed current-tree snapshot. It does not scan Git
354
+ history, files above 10 MiB, symlink targets, archives, or recursively decoded
355
+ content. Gitleaks rules are heuristic; both false positives and false negatives
356
+ remain possible, so this binding is one selected analysis class rather than a
357
+ claim of complete secret or static-analysis coverage.
358
+
359
+ Normal validation and scanner-release workflows pull that exact digest and run
360
+ the clean and suppression-resistant finding cases through the production OCI
361
+ runner. A nonempty test-image override that differs from the reviewed digest is
362
+ an error, not a skipped test.
363
+
364
+ ## Design references
365
+
366
+ - [OCI content descriptors](https://specs.opencontainers.org/image-spec/descriptor/?v=v1.1.0)
367
+ define digest-addressed references and require retrieved content to be checked
368
+ against its digest.
369
+ - [Docker container run](https://docs.docker.com/reference/cli/docker/container/run/)
370
+ documents read-only roots, capability removal, resource limits, and
371
+ `no-new-privileges`.
372
+ - [Podman run](https://docs.podman.io/en/stable/markdown/podman-run.1.html)
373
+ documents the corresponding rootless container and resource controls.
374
+ - [Gitleaks v8.30.0](https://github.com/gitleaks/gitleaks/releases/tag/v8.30.0)
375
+ is the pinned upstream release; its official CLI documents directory scans,
376
+ JSON reports, full redaction, timeouts, and bounded target-file size.
377
+ - [Gitleaks default configuration](https://github.com/gitleaks/gitleaks/blob/v8.30.0/config/gitleaks.toml)
378
+ is vendored as a deterministic gzip archive, attributed in
379
+ `THIRD_PARTY_NOTICES.md`, and verified in both compressed and exact
380
+ decompressed forms before every execution.
@@ -0,0 +1,188 @@
1
+ # Read-only agent providers
2
+
3
+ The experimental provider layer connects the scanner to installed Codex and
4
+ Claude Code CLIs without giving either provider authority over scanner truth.
5
+ The local CLI binary and remote provider are still trusted process and data
6
+ processing dependencies. The current mode is deliberately `suggest`: an agent receives only content-addressed
7
+ copies of declared relevant text files and returns a schema-constrained patch
8
+ proposal. It cannot inspect the source workspace, edit files, run shell commands,
9
+ use web or MCP tools, change capabilities, or mark an assertion as passed.
10
+
11
+ The implementation follows the current official documentation for [Codex
12
+ non-interactive mode](https://developers.openai.com/codex/noninteractive/),
13
+ [Codex sandboxing](https://developers.openai.com/codex/sandboxing/), [Claude Code
14
+ headless mode](https://code.claude.com/docs/en/headless), and [Claude Code
15
+ permissions](https://code.claude.com/docs/en/permissions). Provider flags are
16
+ also covered by golden launch-plan tests so an accidental dangerous flag fails
17
+ review.
18
+
19
+ ## Capability boundary
20
+
21
+ Both launch plans require:
22
+
23
+ - a content-addressed `prc.agent-task/v0.2` task bound to one canonical finding
24
+ ID and stable fingerprint;
25
+ - explicit acknowledgement that relevant source may be processed by a remote
26
+ provider;
27
+ - an exact workspace inventory plus bounded, content-addressed task inputs;
28
+ - a fail-closed preflight that prevents obvious private keys, distinctive
29
+ provider-token shapes, and credential-bearing URLs from entering a remote
30
+ task without logging the matched value;
31
+ - a private execution/output directory disjoint from the source workspace;
32
+ - denied agent-tool network access and no task secrets;
33
+ - schema-constrained, non-interactive output;
34
+ - scanner-enforced time and output limits;
35
+ - executable and output-schema digests rechecked immediately before execution;
36
+ and
37
+ - filtered process environments that exclude unrelated credentials such as
38
+ cloud, repository, and deployment tokens.
39
+
40
+ The scanner can reuse only a login created by `prc login codex` or `prc login claude`.
41
+ Those commands call the provider's official authentication flow with a private
42
+ scanner credential directory. They do not reuse the provider's normal user
43
+ configuration, sessions, instructions, plugins, hooks, or MCP servers. Supported
44
+ API-key environment variables remain an alternative. Each scan still gets a
45
+ new private home; only the selected credential, basic runtime variables, and
46
+ scanner-owned overrides reach the process.
47
+
48
+ Codex runs from the private output directory with ignored user configuration,
49
+ strict configuration, ephemeral sessions, the read-only sandbox, approval policy
50
+ `never`, no inherited shell environment, and the default shell tool disabled.
51
+ Hosted web search, MCP, multi-agent, goal, remote-plugin, app, browser,
52
+ computer-use, and image-generation features are also disabled. Claude Code runs
53
+ from the same isolated directory with an empty tool allowlist; Bash, reading,
54
+ editing, writing, notebook editing, web tools, slash commands, ambient MCP
55
+ servers, project setting sources, and session persistence are disabled. The
56
+ source text needed for either provider is inside the sealed task prompt. Claude's
57
+ optional provider-side cost limit is passed through; the current Codex CLI
58
+ adapter rejects a nonzero cost limit because it cannot enforce one.
59
+
60
+ These command flags cannot contain a malicious local executable. A replaced or
61
+ compromised `codex` or `claude` program runs as the current operating-system
62
+ user and could ignore every argument before the scanner detects the changed
63
+ digest. Install the CLI from its official source, keep it updated, inspect the
64
+ resolved path and digest with `prc doctor`, and use a separate OS account or
65
+ strong external sandbox when the host contains secrets the CLI must never see.
66
+ The scanner also stops when it can see local Claude managed settings that may
67
+ force hooks, plugins, or MCP configuration, but it cannot inspect every policy
68
+ delivered by a provider server.
69
+
70
+ Repository text is always untrusted data, including comments that resemble
71
+ instructions or the scanner's task delimiter. The scanner JSON-encodes the
72
+ entire content-addressed task, so delimiter characters inside a source file are
73
+ escaped and cannot terminate the authoritative envelope. Checked-in adversarial
74
+ tests reconstruct that envelope and require the hostile fixture to round-trip
75
+ only as an input value. This is defense in depth: output schema validation,
76
+ capability denial, patch-path validation, and independent candidate checks remain
77
+ mandatory even when the prompt boundary is intact. These controls implement the
78
+ OWASP guidance to [identify external content, constrain privileges, validate
79
+ outputs, and test adversarially](https://genai.owasp.org/llmrisk/llm01-prompt-injection/).
80
+
81
+ These controls are not an R2 write sandbox. Neither provider may mutate a
82
+ candidate workspace. An agent proposal remains untrusted data. The
83
+ scanner-owned [`remediate-proposal`](../scanner/remediation.md#apply-one-validated-r2-proposal)
84
+ path can explicitly parse one validated proposal into a fresh isolated
85
+ candidate and run deterministic acceptance checks; the provider does not apply
86
+ or approve that result. The bounded `prc fix --provider` path composes those
87
+ same two stages only for a scanner-planned missing-test task.
88
+
89
+ ## Create and seal a task
90
+
91
+ Start from the checked-in
92
+ [`fixtures/providers/suggest-task.json`](https://github.com/MarinJursic/production-readiness-checklist/blob/main/fixtures/providers/suggest-task.json)
93
+ example.
94
+ For a draft, leave `task_id` empty, keep arrays sorted, tailor the goal and path
95
+ allowlists, and make the remote-processing decision explicit. Seal it without
96
+ modifying the draft:
97
+
98
+ ```bash
99
+ ./prc provider seal-task \
100
+ --file /path/to/draft-task.json \
101
+ --workspace /path/to/project \
102
+ --config /path/to/project/production-readiness.yaml \
103
+ > /safe/path/task.json
104
+ ```
105
+
106
+ Sealing reads only the sorted `relevant_paths`, rejects non-regular, binary, or
107
+ larger-than-256-KiB inputs, and embeds their text and SHA-256 digests. Total input
108
+ text is limited to 768 KiB. Before remote processing, sealing also rejects
109
+ high-confidence secret-like input without including the matched material in the
110
+ error. This conservative guard is not a comprehensive repository secret scan;
111
+ it covers selected high-precision generic and provider credential families
112
+ recognized by [GitHub's supported secret-scanning pattern
113
+ catalog](https://docs.github.com/en/code-security/reference/secret-security/supported-secret-scanning-patterns),
114
+ and projects should still run a dedicated secret scanner. Sealing also binds the
115
+ current workspace inventory digest into the task. The task's `finding_id` names the exact scan finding that caused
116
+ the task to be created; both it and `finding_fingerprint` are revalidated
117
+ against a fresh baseline before a proposal can be applied. For a manual draft,
118
+ copy both values from the same canonical finding in a current JSON scan; the
119
+ bounded loop does this automatically. When configured, that inventory includes
120
+ the declared-scope digest, and the scanner merges its default guards, configured
121
+ protected paths, and the in-target configuration path into the sealed task.
122
+ Changing a task field, finding binding, configuration declaration, or any
123
+ inventoried workspace file invalidates the execution plan.
124
+
125
+ ## Inspect a launch plan
126
+
127
+ Create a new output directory outside the workspace, then inspect the exact
128
+ executable identity, arguments, environment names, schema identity, and
129
+ capabilities before any provider call:
130
+
131
+ ```bash
132
+ install -d -m 700 /safe/path/provider-output
133
+ export OPENAI_API_KEY='your-provider-key'
134
+
135
+ ./prc provider plan \
136
+ --provider codex \
137
+ --task /safe/path/task.json \
138
+ --workspace /path/to/project \
139
+ --output-dir /safe/path/provider-output
140
+ ```
141
+
142
+ Use `--provider claude` for Claude Code. `provider capabilities` reports the
143
+ static envelope for either adapter.
144
+
145
+ ## Run explicitly
146
+
147
+ `provider run` invokes the installed provider and can consume provider quota or
148
+ incur provider charges. It should be called only after the operator reviews the
149
+ task's remote-source acknowledgement and launch plan.
150
+
151
+ ```bash
152
+ ./prc provider run \
153
+ --provider codex \
154
+ --task /safe/path/task.json \
155
+ --workspace /path/to/project \
156
+ --output-dir /safe/path/provider-output
157
+ ```
158
+
159
+ The scanner writes raw standard output and diagnostics as mode-`0600` transcript
160
+ files in the output directory, records their byte counts and SHA-256 digests,
161
+ and emits a `prc.agent-execution/v0.1` record after valid output. A failed
162
+ invocation instead returns a content-addressed `prc.agent-failure/v0.1` record
163
+ with scanner-authored stage and reason codes plus complete or partial transcript
164
+ metadata. Treat transcripts as sensitive source-derived evidence.
165
+
166
+ ## Validate without running
167
+
168
+ Golden and adversarial provider outputs can be checked independently:
169
+
170
+ ```bash
171
+ ./prc provider validate-output \
172
+ --provider codex \
173
+ --task fixtures/providers/suggest-task.json \
174
+ --file fixtures/providers/valid-output.json
175
+ ```
176
+
177
+ Validation rejects prose-only responses, duplicate JSON keys, task mismatches,
178
+ unsorted or duplicate files, changes outside the allowlist, protected paths,
179
+ reported command execution, requested capability expansion, trailing JSON, and
180
+ oversized output. Claude's outer JSON envelope must contain a non-error
181
+ `structured_output` value that passes the same validation.
182
+
183
+ After validation, follow the [isolated R2 proposal](../scanner/remediation.md#apply-one-validated-r2-proposal)
184
+ workflow when the task's assertion is R2. `provider run` itself never applies a
185
+ proposal. The optional [bounded R2 loop](../scanner/remediation.md#opt-in-to-one-scanner-planned-r2-task)
186
+ constructs and seals its own narrow task, invokes the same read-only provider
187
+ protocol, and hands valid output to the isolated scanner-owned application
188
+ path. A proposal is never applied to the source workspace.
@@ -0,0 +1,80 @@
1
+ # Bounded applicability evaluation
2
+
3
+ Applicability decides whether an assertion belongs in a specific assessment. It
4
+ does not decide whether the assertion passes. The scanner evaluates catalog
5
+ applicability with Common Expression Language (CEL) and records the outcome,
6
+ evaluator identity, and reason in the immutable scan plan.
7
+
8
+ ## Fail-closed contract
9
+
10
+ Every expression must compile, evaluate within the configured resource budget,
11
+ and return a Boolean. The result mapping is deliberately small:
12
+
13
+ | CEL outcome | Planned applicability |
14
+ | --- | --- |
15
+ | `true` | `applicable` |
16
+ | `false` | `not_applicable` |
17
+ | Compile error, missing field, non-Boolean result, or evaluation error | `undetermined` |
18
+ | Parser, recursion, expression-size, or runtime-cost limit reached | `undetermined` |
19
+
20
+ `undetermined` never becomes Not Applicable or Pass. A required assertion with
21
+ undetermined applicability keeps the assessment incomplete.
22
+
23
+ Plan v0.3 records `applicability_reason` for every planned assertion and
24
+ identifies the evaluator as `cel-go/v0.30.0+prc-inventory/v0.3`. Version-specific
25
+ v0.1 through v0.6 plan schemas remain available for validating archived plans.
26
+
27
+ ## Available inventory view
28
+
29
+ Expressions receive only a deterministic projection named `inventory`. Target
30
+ file bytes, the target root path, environment variables, credentials, and
31
+ process or network capabilities are not exposed.
32
+
33
+ The projection contains:
34
+
35
+ - `file_count` and `source_files`;
36
+ - `package_ecosystems`, `manifests`, `lock_files`, `container_files`, and
37
+ `symlinks`;
38
+ - `ci.github_actions` and `ci.workflow_files`;
39
+ - `infrastructure.terraform_files` and
40
+ `infrastructure.kubernetes_files`;
41
+ - `components`, limited to component ID, kind, path, and ecosystem; and
42
+ - `fact_values`, mapping sourced inventory fact keys to their string values; and
43
+ - `declared`, containing the bound project ID, risk profile, profile, release
44
+ scope, features, and data-context tags, or `configured: false` when absent.
45
+
46
+ Examples:
47
+
48
+ ```text
49
+ inventory.package_ecosystems.size() > 0
50
+ inventory.ci.github_actions == true
51
+ inventory.components.exists(c, c.kind == "container-build")
52
+ inventory.components.exists(c, c.kind == "api-description" && c.ecosystem == "openapi")
53
+ ```
54
+
55
+ Inventory detection remains evidence with stated limitations. An expression can
56
+ select assertions using detected facts; it cannot turn those facts into proof of
57
+ runtime behavior or deployment state.
58
+
59
+ ## Resource and capability boundary
60
+
61
+ CEL is used as a non-Turing-complete, side-effect-free expression evaluator. The
62
+ scanner additionally limits an expression to 4,096 source characters, parser
63
+ recursion depth 64, and 10,000 runtime cost units, with periodic interruption
64
+ checks. Compiled programs are cached by exact expression for deterministic,
65
+ concurrent reuse.
66
+
67
+ No custom functions perform file, process, network, clock, random, or environment
68
+ access. Catalog authors cannot use applicability to execute a target project or
69
+ an adapter. Applicability expressions should be short predicates over the
70
+ documented projection; assertion implementations remain responsible for
71
+ collecting and evaluating evidence.
72
+
73
+ ## Design references
74
+
75
+ - The [CEL project](https://github.com/cel-expr/cel-go) describes CEL as a
76
+ non-Turing-complete, type-checkable, side-effect-free expression language and
77
+ documents program reuse.
78
+ - The [cel-go API](https://pkg.go.dev/github.com/google/cel-go/cel) documents
79
+ parser recursion and expression-size limits, runtime cost limits, and
80
+ interruption checks used by this implementation.