@open-cr-agent/cloud-contract 0.0.0-stage → 0.5.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.
@@ -0,0 +1,68 @@
1
+ {
2
+ "about": "The redaction pass of @open-cr-agent/cloud-contract (packages/cloud-contract/src/redact.ts in Open-CR-Agent), which the ocra CLI and ocra Cloud both run. Each `redact` entry is a line whose `secret` must not survive; each `keep` line must come back unchanged. ocra Cloud tests its generated copy of this file.",
3
+ "redact": [
4
+ { "line": "const key = \"AKIAABCDEFGHIJKLMNOP\";", "secret": "AKIAABCDEFGHIJKLMNOP" },
5
+ { "line": "token: ghp_abcdefghijklmnopqrstuvwxyz0123", "secret": "ghp_abcdefghijklmnop" },
6
+ {
7
+ "line": "ANTHROPIC=sk-ant-api03-abcdefghijklmnopqrstuvwxyz",
8
+ "secret": "sk-ant-api03-abcdef"
9
+ },
10
+ { "line": "or = 'sk-or-v1-0123456789abcdef0123456789abcdef'", "secret": "sk-or-v1-0123456789" },
11
+ { "line": "maps = AIzaSyA-1234567890abcdefghijklmnopqrstu", "secret": "AIzaSyA-1234567890" },
12
+ {
13
+ "line": "-----BEGIN RSA PRIVATE KEY-----\nMIIEow\n-----END RSA PRIVATE KEY-----",
14
+ "secret": "MIIEow"
15
+ },
16
+ {
17
+ "line": "const k = \"Zq3Xk9LmP2vR7tYb4NcW8sJh1Df6Ga5Ue0Oi\";",
18
+ "secret": "Zq3Xk9LmP2vR7tYb4NcW8sJh1Df6Ga5Ue0Oi"
19
+ },
20
+ {
21
+ "line": "aws_secret = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
22
+ "secret": "wJalrXUtnFEMI/K7MDENG"
23
+ },
24
+ {
25
+ "line": "AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
26
+ "secret": "bPxRfiCYEXAMPLEKEY"
27
+ },
28
+ {
29
+ "line": "api_key = \"4f2a9c1e7b3d8a6f0e5c2b9d7a1f3e8c6b0d4a2f9e7c5b3a1d8f6e4c2a0b9d7e\"",
30
+ "secret": "4f2a9c1e7b3d8a6f0e5c2b9d"
31
+ },
32
+ {
33
+ "line": "key 9b8f7e6d5c4b3a291807f6e5d4c3b2a1",
34
+ "secret": "9b8f7e6d5c4b3a291807f6e5d4c3b2a1"
35
+ },
36
+ {
37
+ "line": "DATABASE_URL=postgres://admin:S3cr3tPass@db.internal:5432/app",
38
+ "secret": "S3cr3tPass"
39
+ },
40
+ { "line": "redis://:hunter2hunter2@cache:6379", "secret": "hunter2hunter2" },
41
+ {
42
+ "line": "fetch(\"https://hooks.slack.com/services/T0AAAA/B0BBBB/XXXXXXXXXXXXXXXX\")",
43
+ "secret": "T0AAAA/B0BBBB"
44
+ },
45
+ {
46
+ "line": "url: https://discord.com/api/webhooks/123456789012345678/abcDEF_ghi-JKL",
47
+ "secret": "abcDEF_ghi-JKL"
48
+ },
49
+ { "line": "password = \"hunter2hunter2\"", "secret": "hunter2hunter2" },
50
+ { "line": "\"apiKey\": \"live_51HxYz\",", "secret": "live_51HxYz" },
51
+ { "line": "DB_PASSWORD: 'correct horse battery'", "secret": "correct horse battery" },
52
+ { "line": "client_secret='abc123def'", "secret": "abc123def" }
53
+ ],
54
+ "keep": [
55
+ "const total = items.reduce((n, i) => n + i.price, 0);",
56
+ "import { ReviewSettings } from \"./components/settings/ReviewSettingsPage\";",
57
+ "packages/cli/src/review/cloud-findings.ts",
58
+ "function getElementByIdAndQuerySelectorAllNodes() {}",
59
+ "useEffectWithDependencyArrayAndCleanup2(x);",
60
+ "const password = readPasswordFromEnv();",
61
+ "if (token === undefined) return;",
62
+ "see https://github.com/jma49/Open-CR-Agent/blob/main/docs/manual/en/cli.mdx",
63
+ "const ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdef\";",
64
+ "// https://github.com/jma49/open-cr-agent/blob/main/docs/adr/0028-findings.md",
65
+ "import { x } from '../../packages/core/src/pipeline/output-schema.ts';",
66
+ "export async function fetchAccountMemoryForRepository(repoHash: string) {}"
67
+ ]
68
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "about": "POST /api/reviews as the ocra CLI sends it, made by uploadOf() and sharedFindings() from a sample report (packages/cli/src/cloud/contract.test.ts; OCRA_UPDATE_FIXTURES=1 rewrites it). ocra Cloud must keep every field.",
3
+ "runId": "run-2026-10-04-a1b2",
4
+ "repoHash": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92",
5
+ "source": "github",
6
+ "tier": "full",
7
+ "verdict": "significant_concerns",
8
+ "complete": false,
9
+ "findings": {
10
+ "critical": 1,
11
+ "warning": 1,
12
+ "suggestion": 1
13
+ },
14
+ "files": {
15
+ "reviewed": 2,
16
+ "notReviewed": 1
17
+ },
18
+ "tasks": {
19
+ "completed": 2,
20
+ "failed": 1
21
+ },
22
+ "usage": {
23
+ "inputTokens": 1200,
24
+ "outputTokens": 340,
25
+ "costUsd": 0.4375
26
+ },
27
+ "durationMs": 61234,
28
+ "ocraVersion": "0.0.0",
29
+ "reviewers": {
30
+ "logic": {
31
+ "tasks": 2,
32
+ "failedTasks": 1,
33
+ "findings": {
34
+ "critical": 0,
35
+ "warning": 1,
36
+ "suggestion": 0
37
+ },
38
+ "costUsd": 0.1875,
39
+ "fixed": 1,
40
+ "dismissed": 0
41
+ },
42
+ "security": {
43
+ "tasks": 1,
44
+ "failedTasks": 0,
45
+ "findings": {
46
+ "critical": 1,
47
+ "warning": 0,
48
+ "suggestion": 1
49
+ },
50
+ "costUsd": 0.25,
51
+ "fixed": 0,
52
+ "dismissed": 1
53
+ }
54
+ },
55
+ "verification": {
56
+ "confirmed": 1,
57
+ "uncertain": 1,
58
+ "unchecked": 1
59
+ },
60
+ "outcomes": {
61
+ "fixed": 1,
62
+ "dismissed": 1
63
+ },
64
+ "findingList": [
65
+ {
66
+ "fingerprint": "0123456789abcdef",
67
+ "reviewer": "security",
68
+ "severity": "critical",
69
+ "category": "security",
70
+ "verification": "confirmed",
71
+ "file": "src/db.ts",
72
+ "lineStart": 10,
73
+ "lineEnd": 12,
74
+ "title": "SQL built from input",
75
+ "body": "The id reaches the query unescaped.",
76
+ "suggestion": null,
77
+ "code": "const q = 'SELECT * FROM t WHERE id = ' + id;"
78
+ },
79
+ {
80
+ "fingerprint": "fedcba9876543210",
81
+ "reviewer": "logic",
82
+ "severity": "warning",
83
+ "category": "correctness",
84
+ "verification": "uncertain",
85
+ "file": "src/retry.ts",
86
+ "lineStart": null,
87
+ "lineEnd": null,
88
+ "title": "Retry without a limit",
89
+ "body": "A failing call is retried forever.",
90
+ "suggestion": "Stop after three attempts.",
91
+ "code": "while (true) await attempt();"
92
+ },
93
+ {
94
+ "fingerprint": "1111222233334444",
95
+ "reviewer": "security",
96
+ "severity": "suggestion",
97
+ "category": "security",
98
+ "verification": "unchecked",
99
+ "file": "src/db.ts",
100
+ "lineStart": 10,
101
+ "lineEnd": 12,
102
+ "title": "SQL built from input",
103
+ "body": "The id reaches the query unescaped.",
104
+ "suggestion": null,
105
+ "code": "const q = 'SELECT * FROM t WHERE id = ' + id;"
106
+ }
107
+ ]
108
+ }
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@open-cr-agent/cloud-contract",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.5.0",
4
+ "description": "The wire contract between Open-CR-Agent and ocra Cloud: Zod schemas, limits, vocabularies, the redaction pass and its test vectors",
5
+ "keywords": [
6
+ "code-review",
7
+ "zod",
8
+ "schema"
9
+ ],
10
+ "license": "Apache-2.0",
11
+ "homepage": "https://ocracloud.com",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/jma49/Open-CR-Agent.git",
15
+ "directory": "packages/cloud-contract"
16
+ },
17
+ "bugs": "https://github.com/jma49/Open-CR-Agent/issues",
18
+ "engines": {
19
+ "node": ">=22.19"
20
+ },
21
+ "type": "module",
22
+ "sideEffects": false,
23
+ "exports": {
24
+ ".": {
25
+ "@open-cr-agent/source": "./src/index.ts",
26
+ "types": "./dist/index.d.ts",
27
+ "default": "./dist/index.js"
28
+ },
29
+ "./fixtures/*": "./fixtures/*",
30
+ "./package.json": "./package.json"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "fixtures",
35
+ "!dist/**/*.map"
36
+ ],
37
+ "dependencies": {
38
+ "zod": "^4.6.5"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }