@agentswf/lab 0.0.0-stage → 0.4.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 (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -2
  3. package/package.json +46 -4
  4. package/schema/lab-check.schema.json +64 -0
  5. package/schema/lab-config.schema.json +187 -0
  6. package/schema/lab-final.schema.json +48 -0
  7. package/schema/lab-good-record.schema.json +70 -0
  8. package/schema/lab-grade.schema.json +49 -0
  9. package/schema/lab-key.schema.json +124 -0
  10. package/schema/lab-label.schema.json +32 -0
  11. package/schema/lab-loop-report.schema.json +221 -0
  12. package/schema/lab-loop.schema.json +141 -0
  13. package/schema/lab-plan.schema.json +128 -0
  14. package/schema/lab-previous.schema.json +70 -0
  15. package/schema/lab-proposal.schema.json +52 -0
  16. package/schema/lab-report.schema.json +1128 -0
  17. package/schema/lab-run.schema.json +253 -0
  18. package/schema/lab-runs.schema.json +132 -0
  19. package/schema/lab-score.schema.json +319 -0
  20. package/schema/lab-spread.schema.json +110 -0
  21. package/schema/lab-trial.schema.json +543 -0
  22. package/schema/lab-try.schema.json +113 -0
  23. package/schema/local.json +155 -0
  24. package/src/cli.ts +9 -0
  25. package/src/env/capture.ts +48 -0
  26. package/src/env/compare.ts +201 -0
  27. package/src/env/facts.ts +51 -0
  28. package/src/env/fetch.ts +57 -0
  29. package/src/env/files.ts +228 -0
  30. package/src/env/grade-case.ts +80 -0
  31. package/src/env/grade-helper.ts +352 -0
  32. package/src/env/grader.ts +131 -0
  33. package/src/env/index.ts +727 -0
  34. package/src/env/mock.ts +374 -0
  35. package/src/env/routes.ts +90 -0
  36. package/src/env/sources.ts +19 -0
  37. package/src/env/state.ts +79 -0
  38. package/src/env/trial.ts +185 -0
  39. package/src/format/key.ts +168 -0
  40. package/src/format/loop.ts +179 -0
  41. package/src/format/output.ts +542 -0
  42. package/src/format/records.ts +443 -0
  43. package/src/format/schema-files.ts +64 -0
  44. package/src/format/settings.ts +559 -0
  45. package/src/format/trial-env.ts +67 -0
  46. package/src/format/trial-file.ts +134 -0
  47. package/src/help/awf-lab.txt +29 -0
  48. package/src/help/case.txt +39 -0
  49. package/src/help/config.txt +14 -0
  50. package/src/help/label.txt +12 -0
  51. package/src/help/loop.txt +44 -0
  52. package/src/help/report.txt +20 -0
  53. package/src/help/run.txt +61 -0
  54. package/src/help/runs.txt +11 -0
  55. package/src/help/score.txt +28 -0
  56. package/src/judge/criteria.workflow.ts +237 -0
  57. package/src/judge/version.ts +6 -0
  58. package/src/lab/answer.ts +47 -0
  59. package/src/lab/blame.ts +204 -0
  60. package/src/lab/box.ts +251 -0
  61. package/src/lab/capture-command.ts +302 -0
  62. package/src/lab/capture.ts +234 -0
  63. package/src/lab/check-command.ts +187 -0
  64. package/src/lab/cli.ts +325 -0
  65. package/src/lab/code-graders.ts +108 -0
  66. package/src/lab/columns.ts +138 -0
  67. package/src/lab/command-context.ts +436 -0
  68. package/src/lab/compare.ts +123 -0
  69. package/src/lab/config-command.ts +283 -0
  70. package/src/lab/criteria.ts +69 -0
  71. package/src/lab/dataset.ts +375 -0
  72. package/src/lab/eval-files.ts +196 -0
  73. package/src/lab/expect.ts +79 -0
  74. package/src/lab/facts.ts +59 -0
  75. package/src/lab/families.ts +32 -0
  76. package/src/lab/folders.ts +172 -0
  77. package/src/lab/git.ts +128 -0
  78. package/src/lab/good.ts +224 -0
  79. package/src/lab/grading-stub.txt +8 -0
  80. package/src/lab/grading.ts +332 -0
  81. package/src/lab/inspect.ts +227 -0
  82. package/src/lab/labels.ts +211 -0
  83. package/src/lab/loop-code.ts +255 -0
  84. package/src/lab/loop-command.ts +774 -0
  85. package/src/lab/loop-records.ts +144 -0
  86. package/src/lab/loop.ts +864 -0
  87. package/src/lab/marker.ts +23 -0
  88. package/src/lab/outcome.ts +196 -0
  89. package/src/lab/pooled.ts +106 -0
  90. package/src/lab/project-env.ts +39 -0
  91. package/src/lab/rates.ts +155 -0
  92. package/src/lab/reach.ts +111 -0
  93. package/src/lab/record-copies.ts +202 -0
  94. package/src/lab/refusal.ts +2 -0
  95. package/src/lab/report-command.ts +157 -0
  96. package/src/lab/report.ts +936 -0
  97. package/src/lab/reuse.ts +134 -0
  98. package/src/lab/run-command.ts +958 -0
  99. package/src/lab/run-logs.ts +89 -0
  100. package/src/lab/run-report.ts +286 -0
  101. package/src/lab/runs-command.ts +171 -0
  102. package/src/lab/runs.ts +172 -0
  103. package/src/lab/scaffold.ts +94 -0
  104. package/src/lab/score-command.ts +197 -0
  105. package/src/lab/score.ts +396 -0
  106. package/src/lab/store.ts +383 -0
  107. package/src/lab/target-stub.txt +18 -0
  108. package/src/lab/text.ts +29 -0
  109. package/src/lab/trial-settings.ts +105 -0
  110. package/src/lab/trial.ts +439 -0
  111. package/src/lab/usage.ts +274 -0
  112. package/src/lab/verdict.ts +161 -0
  113. package/src/lab/workflow-graders.ts +164 -0
  114. package/src/lab/workspace.ts +496 -0
  115. package/src/loop/propose.workflow.ts +84 -0
  116. package/src/shared/allowance.ts +185 -0
  117. package/src/shared/compare/index.ts +3 -0
  118. package/src/shared/compare/paired.ts +397 -0
  119. package/src/shared/compare/stats.ts +139 -0
  120. package/src/shared/compare/types.ts +75 -0
  121. package/src/shared/config.ts +15 -0
  122. package/src/shared/runner.ts +321 -0
  123. package/src/shared/validate.ts +181 -0
  124. package/src/shared/version.ts +41 -0
  125. package/src/write-schemas.ts +10 -0
@@ -0,0 +1,221 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "awf-lab report --loop --json",
4
+ "type": "object",
5
+ "required": [
6
+ "kind",
7
+ "id",
8
+ "name",
9
+ "dataset",
10
+ "started",
11
+ "proposer",
12
+ "trials",
13
+ "params",
14
+ "tuning",
15
+ "holdout",
16
+ "spread",
17
+ "tries",
18
+ "kept",
19
+ "finals",
20
+ "estimate"
21
+ ],
22
+ "properties": {
23
+ "kind": {
24
+ "type": "string",
25
+ "const": "awf.lab-loop-report/1"
26
+ },
27
+ "id": {
28
+ "type": "string",
29
+ "minLength": 1
30
+ },
31
+ "name": {
32
+ "type": "string",
33
+ "minLength": 1
34
+ },
35
+ "dataset": {
36
+ "type": "string",
37
+ "minLength": 1
38
+ },
39
+ "started": {
40
+ "type": "string",
41
+ "minLength": 1
42
+ },
43
+ "proposer": {
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "trials": {
48
+ "type": "integer",
49
+ "minimum": 1
50
+ },
51
+ "params": {
52
+ "type": "array",
53
+ "items": {
54
+ "type": "string",
55
+ "minLength": 1
56
+ }
57
+ },
58
+ "tuning": {
59
+ "type": "array",
60
+ "items": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ }
64
+ },
65
+ "holdout": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string",
69
+ "minLength": 1
70
+ }
71
+ },
72
+ "spread": {
73
+ "anyOf": [
74
+ {
75
+ "type": "object",
76
+ "required": ["labRun", "decision", "unsteady", "estimate"],
77
+ "properties": {
78
+ "labRun": {
79
+ "type": "string",
80
+ "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
81
+ },
82
+ "decision": {
83
+ "anyOf": [
84
+ {
85
+ "type": "string",
86
+ "minLength": 1
87
+ },
88
+ {
89
+ "type": "null"
90
+ }
91
+ ]
92
+ },
93
+ "unsteady": {
94
+ "type": "array",
95
+ "items": {
96
+ "type": "string",
97
+ "minLength": 1
98
+ }
99
+ },
100
+ "estimate": {
101
+ "type": "number",
102
+ "minimum": 0
103
+ }
104
+ },
105
+ "additionalProperties": false
106
+ },
107
+ {
108
+ "type": "string",
109
+ "const": "skipped"
110
+ },
111
+ {
112
+ "type": "null"
113
+ }
114
+ ]
115
+ },
116
+ "tries": {
117
+ "type": "array",
118
+ "items": {
119
+ "type": "object",
120
+ "required": ["n", "parent", "outcome", "why", "changed", "estimate"],
121
+ "properties": {
122
+ "n": {
123
+ "type": "integer",
124
+ "minimum": 1
125
+ },
126
+ "parent": {
127
+ "type": "integer",
128
+ "minimum": 0
129
+ },
130
+ "outcome": {
131
+ "type": "string",
132
+ "minLength": 1
133
+ },
134
+ "why": {
135
+ "type": "string"
136
+ },
137
+ "change": {
138
+ "type": "string"
139
+ },
140
+ "changed": {
141
+ "type": "array",
142
+ "items": {
143
+ "type": "string",
144
+ "minLength": 1
145
+ }
146
+ },
147
+ "labRun": {
148
+ "type": "string",
149
+ "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
150
+ },
151
+ "decision": {
152
+ "anyOf": [
153
+ {
154
+ "type": "string",
155
+ "minLength": 1
156
+ },
157
+ {
158
+ "type": "null"
159
+ }
160
+ ]
161
+ },
162
+ "estimate": {
163
+ "type": "number",
164
+ "minimum": 0
165
+ }
166
+ },
167
+ "additionalProperties": false
168
+ }
169
+ },
170
+ "kept": {
171
+ "type": "integer",
172
+ "minimum": 0
173
+ },
174
+ "finals": {
175
+ "type": "array",
176
+ "items": {
177
+ "type": "object",
178
+ "required": ["k", "kept", "labRun", "decision", "why", "estimate"],
179
+ "properties": {
180
+ "k": {
181
+ "type": "integer",
182
+ "minimum": 1
183
+ },
184
+ "kept": {
185
+ "type": "integer",
186
+ "minimum": 1
187
+ },
188
+ "labRun": {
189
+ "type": "string",
190
+ "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
191
+ },
192
+ "decision": {
193
+ "anyOf": [
194
+ {
195
+ "type": "string",
196
+ "minLength": 1
197
+ },
198
+ {
199
+ "type": "null"
200
+ }
201
+ ]
202
+ },
203
+ "why": {
204
+ "type": "string"
205
+ },
206
+ "estimate": {
207
+ "type": "number",
208
+ "minimum": 0
209
+ }
210
+ },
211
+ "additionalProperties": false
212
+ }
213
+ },
214
+ "estimate": {
215
+ "type": "number",
216
+ "minimum": 0
217
+ }
218
+ },
219
+ "additionalProperties": false,
220
+ "description": "awf-lab report --loop --json."
221
+ }
@@ -0,0 +1,141 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "awf-lab loop's loop.json",
4
+ "type": "object",
5
+ "required": [
6
+ "kind",
7
+ "name",
8
+ "dataset",
9
+ "started",
10
+ "from",
11
+ "brief",
12
+ "edit",
13
+ "proposer",
14
+ "trials",
15
+ "params",
16
+ "spread",
17
+ "tuning",
18
+ "holdout",
19
+ "comparison"
20
+ ],
21
+ "properties": {
22
+ "kind": {
23
+ "type": "string",
24
+ "const": "awf.lab-loop/1"
25
+ },
26
+ "name": {
27
+ "type": "string",
28
+ "minLength": 1
29
+ },
30
+ "dataset": {
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "started": {
35
+ "type": "string",
36
+ "minLength": 1
37
+ },
38
+ "from": {
39
+ "type": "object",
40
+ "required": ["path", "commit", "dirty"],
41
+ "properties": {
42
+ "path": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "commit": {
47
+ "anyOf": [
48
+ {
49
+ "type": "string",
50
+ "minLength": 1
51
+ },
52
+ {
53
+ "type": "null"
54
+ }
55
+ ]
56
+ },
57
+ "dirty": {
58
+ "type": "boolean"
59
+ }
60
+ },
61
+ "additionalProperties": false
62
+ },
63
+ "brief": {
64
+ "type": "string",
65
+ "minLength": 1
66
+ },
67
+ "edit": {
68
+ "type": "object",
69
+ "required": ["allow", "deny"],
70
+ "properties": {
71
+ "allow": {
72
+ "type": "array",
73
+ "items": {
74
+ "type": "string",
75
+ "minLength": 1
76
+ },
77
+ "minItems": 1
78
+ },
79
+ "deny": {
80
+ "type": "array",
81
+ "items": {
82
+ "type": "string",
83
+ "minLength": 1
84
+ }
85
+ }
86
+ },
87
+ "additionalProperties": false
88
+ },
89
+ "proposer": {
90
+ "type": "string",
91
+ "minLength": 1
92
+ },
93
+ "trials": {
94
+ "type": "integer",
95
+ "minimum": 1
96
+ },
97
+ "params": {
98
+ "type": "array",
99
+ "items": {
100
+ "type": "string",
101
+ "minLength": 1
102
+ }
103
+ },
104
+ "cases": {
105
+ "type": "array",
106
+ "items": {
107
+ "type": "string",
108
+ "minLength": 1
109
+ }
110
+ },
111
+ "tags": {
112
+ "type": "array",
113
+ "items": {
114
+ "type": "string",
115
+ "minLength": 1
116
+ }
117
+ },
118
+ "spread": {
119
+ "type": "boolean"
120
+ },
121
+ "tuning": {
122
+ "type": "array",
123
+ "items": {
124
+ "type": "string",
125
+ "minLength": 1
126
+ }
127
+ },
128
+ "holdout": {
129
+ "type": "array",
130
+ "items": {
131
+ "type": "string",
132
+ "minLength": 1
133
+ }
134
+ },
135
+ "comparison": {
136
+ "type": "string",
137
+ "minLength": 1
138
+ }
139
+ },
140
+ "additionalProperties": false
141
+ }
@@ -0,0 +1,128 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "awf-lab --dry-run --json",
4
+ "type": "object",
5
+ "required": ["kind", "command", "dataset", "cases", "columns", "trials", "concurrency"],
6
+ "properties": {
7
+ "kind": {
8
+ "type": "string",
9
+ "const": "awf.lab-plan/1"
10
+ },
11
+ "command": {
12
+ "enum": ["run", "score", "loop run", "loop final"]
13
+ },
14
+ "dataset": {
15
+ "type": "string",
16
+ "minLength": 1
17
+ },
18
+ "labRun": {
19
+ "type": "string",
20
+ "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
21
+ },
22
+ "loop": {
23
+ "type": "string",
24
+ "minLength": 1
25
+ },
26
+ "cases": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "object",
30
+ "required": ["case", "trials"],
31
+ "properties": {
32
+ "case": {
33
+ "type": "string",
34
+ "minLength": 1
35
+ },
36
+ "trials": {
37
+ "type": "integer",
38
+ "minimum": 0
39
+ }
40
+ },
41
+ "additionalProperties": false
42
+ }
43
+ },
44
+ "columns": {
45
+ "type": "integer",
46
+ "minimum": 1
47
+ },
48
+ "trials": {
49
+ "type": "integer",
50
+ "minimum": 0
51
+ },
52
+ "reused": {
53
+ "type": "integer",
54
+ "minimum": 0
55
+ },
56
+ "grades": {
57
+ "type": "object",
58
+ "patternProperties": {
59
+ "^.*$": {
60
+ "type": "integer",
61
+ "minimum": 0
62
+ }
63
+ }
64
+ },
65
+ "maybe": {
66
+ "type": "object",
67
+ "patternProperties": {
68
+ "^.*$": {
69
+ "type": "integer",
70
+ "minimum": 0
71
+ }
72
+ }
73
+ },
74
+ "unpriced": {
75
+ "type": "array",
76
+ "items": {
77
+ "type": "string",
78
+ "minLength": 1
79
+ }
80
+ },
81
+ "tries": {
82
+ "type": "integer",
83
+ "minimum": 1
84
+ },
85
+ "spread": {
86
+ "type": "boolean"
87
+ },
88
+ "nothing": {
89
+ "type": "string",
90
+ "minLength": 1
91
+ },
92
+ "unestimated": {
93
+ "type": "array",
94
+ "items": {
95
+ "type": "string",
96
+ "minLength": 1
97
+ }
98
+ },
99
+ "estimate": {
100
+ "type": "object",
101
+ "properties": {
102
+ "usd": {
103
+ "type": "number",
104
+ "minimum": 0
105
+ },
106
+ "upTo": {
107
+ "type": "number",
108
+ "minimum": 0
109
+ },
110
+ "ms": {
111
+ "type": "number",
112
+ "minimum": 0
113
+ }
114
+ },
115
+ "additionalProperties": false
116
+ },
117
+ "budget": {
118
+ "type": "number",
119
+ "minimum": 0
120
+ },
121
+ "concurrency": {
122
+ "type": "integer",
123
+ "minimum": 1
124
+ }
125
+ },
126
+ "additionalProperties": false,
127
+ "description": "awf-lab run, score, loop run and loop final --dry-run --json."
128
+ }
@@ -0,0 +1,70 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "awf-lab grade folder's previous.json",
4
+ "type": "object",
5
+ "required": ["key", "parts"],
6
+ "properties": {
7
+ "key": {
8
+ "type": "string",
9
+ "pattern": "^[0-9a-f]{64}$"
10
+ },
11
+ "parts": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "object",
15
+ "required": ["about"],
16
+ "properties": {
17
+ "about": {
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "verdict": {
22
+ "enum": ["passed", "failed", "undecided", "not judged"]
23
+ },
24
+ "label": {
25
+ "type": "string",
26
+ "minLength": 1
27
+ },
28
+ "data": {},
29
+ "why": {
30
+ "type": "string"
31
+ },
32
+ "settled": {
33
+ "enum": ["agreed", "majority", "tiebreak", "unsettled", "given"]
34
+ },
35
+ "votes": {
36
+ "type": "array",
37
+ "items": {
38
+ "type": "object",
39
+ "required": ["by"],
40
+ "properties": {
41
+ "by": {
42
+ "type": "string",
43
+ "minLength": 1
44
+ },
45
+ "role": {
46
+ "type": "string",
47
+ "minLength": 1
48
+ },
49
+ "verdict": {
50
+ "enum": ["passed", "failed", "undecided", "not judged"]
51
+ },
52
+ "label": {
53
+ "type": "string",
54
+ "minLength": 1
55
+ },
56
+ "data": {},
57
+ "why": {
58
+ "type": "string"
59
+ }
60
+ },
61
+ "additionalProperties": false
62
+ }
63
+ }
64
+ },
65
+ "additionalProperties": false
66
+ }
67
+ }
68
+ },
69
+ "additionalProperties": false
70
+ }
@@ -0,0 +1,52 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "awf-lab loop's proposal.json",
4
+ "type": "object",
5
+ "required": ["kind", "hypothesis", "estimate", "feedback"],
6
+ "properties": {
7
+ "kind": {
8
+ "type": "string",
9
+ "const": "awf.lab-proposal/1"
10
+ },
11
+ "hypothesis": {
12
+ "type": "object",
13
+ "required": ["change", "hypothesis", "predicted", "mechanism"],
14
+ "properties": {
15
+ "change": {
16
+ "type": "string",
17
+ "minLength": 1,
18
+ "description": "What changed, in a sentence."
19
+ },
20
+ "hypothesis": {
21
+ "type": "string",
22
+ "minLength": 1,
23
+ "description": "Why it should do better."
24
+ },
25
+ "predicted": {
26
+ "type": "string",
27
+ "minLength": 1,
28
+ "description": "The effect expected on the comparison's numbers, and its cost."
29
+ },
30
+ "mechanism": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "description": "What the trials must show if the hypothesis holds."
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ },
38
+ "estimate": {
39
+ "type": "number",
40
+ "minimum": 0
41
+ },
42
+ "feedback": {
43
+ "type": "number",
44
+ "minimum": 0
45
+ },
46
+ "runId": {
47
+ "type": "string",
48
+ "minLength": 1
49
+ }
50
+ },
51
+ "additionalProperties": false
52
+ }