@agentswf/lab 0.3.0 → 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 (88) hide show
  1. package/package.json +4 -4
  2. package/schema/{case-check.schema.json → lab-check.schema.json} +1 -1
  3. package/schema/{case-config.schema.json → lab-config.schema.json} +1 -1
  4. package/schema/{case-final.schema.json → lab-final.schema.json} +6 -6
  5. package/schema/{case-grade.schema.json → lab-grade.schema.json} +1 -1
  6. package/schema/{case-key.schema.json → lab-key.schema.json} +7 -0
  7. package/schema/{case-label.schema.json → lab-label.schema.json} +3 -3
  8. package/schema/{case-loop-report.schema.json → lab-loop-report.schema.json} +26 -15
  9. package/schema/{case-loop.schema.json → lab-loop.schema.json} +1 -1
  10. package/schema/{case-plan.schema.json → lab-plan.schema.json} +14 -3
  11. package/schema/{case-proposal.schema.json → lab-proposal.schema.json} +3 -3
  12. package/schema/{case-report.schema.json → lab-report.schema.json} +272 -36
  13. package/schema/{case-run.schema.json → lab-run.schema.json} +4 -4
  14. package/schema/{case-runs.schema.json → lab-runs.schema.json} +8 -1
  15. package/schema/{case-score.schema.json → lab-score.schema.json} +2 -2
  16. package/schema/{case-spread.schema.json → lab-spread.schema.json} +6 -6
  17. package/schema/{case-trial.schema.json → lab-trial.schema.json} +9 -9
  18. package/schema/{case-try.schema.json → lab-try.schema.json} +6 -6
  19. package/schema/local.json +3 -3
  20. package/src/env/capture.ts +1 -1
  21. package/src/env/compare.ts +7 -7
  22. package/src/env/fetch.ts +1 -1
  23. package/src/env/files.ts +14 -14
  24. package/src/env/grade-helper.ts +15 -15
  25. package/src/env/grader.ts +5 -2
  26. package/src/env/index.ts +18 -18
  27. package/src/env/trial.ts +5 -2
  28. package/src/format/key.ts +24 -0
  29. package/src/format/loop.ts +20 -19
  30. package/src/format/output.ts +120 -59
  31. package/src/format/records.ts +23 -20
  32. package/src/format/schema-files.ts +30 -30
  33. package/src/format/settings.ts +20 -13
  34. package/src/format/trial-env.ts +9 -6
  35. package/src/help/awf-lab.txt +1 -1
  36. package/src/help/case.txt +5 -4
  37. package/src/help/config.txt +2 -2
  38. package/src/help/label.txt +2 -2
  39. package/src/help/loop.txt +10 -10
  40. package/src/help/report.txt +1 -1
  41. package/src/help/run.txt +11 -10
  42. package/src/help/runs.txt +4 -3
  43. package/src/help/score.txt +4 -3
  44. package/src/lab/blame.ts +1 -1
  45. package/src/lab/box.ts +7 -5
  46. package/src/lab/capture-command.ts +11 -7
  47. package/src/lab/capture.ts +1 -1
  48. package/src/lab/check-command.ts +3 -3
  49. package/src/lab/cli.ts +9 -8
  50. package/src/lab/columns.ts +5 -5
  51. package/src/lab/command-context.ts +7 -7
  52. package/src/lab/compare.ts +8 -8
  53. package/src/lab/config-command.ts +25 -20
  54. package/src/lab/dataset.ts +37 -18
  55. package/src/lab/eval-files.ts +27 -16
  56. package/src/lab/folders.ts +26 -7
  57. package/src/lab/good.ts +1 -1
  58. package/src/lab/grading-stub.txt +2 -2
  59. package/src/lab/inspect.ts +13 -12
  60. package/src/lab/labels.ts +16 -11
  61. package/src/lab/loop-command.ts +68 -64
  62. package/src/lab/loop-records.ts +5 -5
  63. package/src/lab/loop.ts +105 -100
  64. package/src/lab/rates.ts +11 -6
  65. package/src/lab/record-copies.ts +1 -1
  66. package/src/lab/report-command.ts +8 -7
  67. package/src/lab/report.ts +172 -74
  68. package/src/lab/reuse.ts +29 -21
  69. package/src/lab/run-command.ts +304 -199
  70. package/src/lab/run-report.ts +49 -22
  71. package/src/lab/runs-command.ts +35 -27
  72. package/src/lab/scaffold.ts +19 -16
  73. package/src/lab/score-command.ts +72 -64
  74. package/src/lab/score.ts +1 -1
  75. package/src/lab/store.ts +3 -3
  76. package/src/lab/{trial-stub.txt → target-stub.txt} +3 -3
  77. package/src/lab/trial-settings.ts +17 -12
  78. package/src/lab/trial.ts +19 -23
  79. package/src/lab/usage.ts +1 -0
  80. package/src/lab/workflow-graders.ts +4 -1
  81. package/src/lab/workspace.ts +16 -9
  82. package/src/loop/propose.workflow.ts +1 -1
  83. package/src/shared/compare/index.ts +2 -2
  84. package/src/shared/compare/paired.ts +20 -20
  85. package/src/shared/compare/types.ts +4 -4
  86. package/src/write-schemas.ts +3 -3
  87. /package/schema/{case-good-record.schema.json → lab-good-record.schema.json} +0 -0
  88. /package/schema/{case-previous.schema.json → lab-previous.schema.json} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentswf/lab",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "agents.wf's lab: run a workflow on cases whose answers are known, grade every trial, compare versions and run the improvement loop. Gives you awf-lab and @agentswf/lab",
5
5
  "license": "MIT",
6
6
  "homepage": "https://agents.wf/reference/awf-lab",
@@ -32,15 +32,15 @@
32
32
  "LICENSE"
33
33
  ],
34
34
  "dependencies": {
35
- "@agentswf/contract": "0.3.0",
35
+ "@agentswf/contract": "0.4.0",
36
36
  "typebox": "^1.3.34",
37
37
  "yaml": "^2.9.1"
38
38
  },
39
39
  "peerDependencies": {
40
- "agentswf": "^0.3.0"
40
+ "agentswf": "^0.4.0"
41
41
  },
42
42
  "devDependencies": {
43
- "agentswf": "0.3.0"
43
+ "agentswf": "0.4.0"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "kind": {
8
8
  "type": "string",
9
- "const": "awf.case-check/1"
9
+ "const": "awf.lab-check/1"
10
10
  },
11
11
  "datasets": {
12
12
  "type": "array",
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "kind": {
8
8
  "type": "string",
9
- "const": "awf.case-config/1"
9
+ "const": "awf.lab-config/1"
10
10
  },
11
11
  "project": {
12
12
  "type": "string",
@@ -2,11 +2,11 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "awf-lab loop's final check",
4
4
  "type": "object",
5
- "required": ["kind", "k", "at", "incumbent", "runId", "verdict", "why", "spend"],
5
+ "required": ["kind", "k", "at", "kept", "labRun", "decision", "why", "estimate"],
6
6
  "properties": {
7
7
  "kind": {
8
8
  "type": "string",
9
- "const": "awf.case-final/1"
9
+ "const": "awf.lab-final/1"
10
10
  },
11
11
  "k": {
12
12
  "type": "integer",
@@ -16,15 +16,15 @@
16
16
  "type": "string",
17
17
  "minLength": 1
18
18
  },
19
- "incumbent": {
19
+ "kept": {
20
20
  "type": "integer",
21
21
  "minimum": 1
22
22
  },
23
- "runId": {
23
+ "labRun": {
24
24
  "type": "string",
25
25
  "minLength": 1
26
26
  },
27
- "verdict": {
27
+ "decision": {
28
28
  "anyOf": [
29
29
  {
30
30
  "type": "string",
@@ -39,7 +39,7 @@
39
39
  "type": "string",
40
40
  "minLength": 1
41
41
  },
42
- "spend": {
42
+ "estimate": {
43
43
  "type": "number",
44
44
  "minimum": 0
45
45
  }
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "kind": {
8
8
  "type": "string",
9
- "const": "awf.case-grade/1"
9
+ "const": "awf.lab-grade/1"
10
10
  },
11
11
  "case": {
12
12
  "type": "string",
@@ -85,6 +85,13 @@
85
85
  "uniqueItems": true,
86
86
  "description": "Plain words the report groups cases by, and --tags picks them by; no grader reads them."
87
87
  },
88
+ "shared": {
89
+ "type": "array",
90
+ "items": {
91
+ "type": "string"
92
+ },
93
+ "description": "The files and folders of the data folder's shared/ this case gets, relative to it, a folder whole; every one when absent, none when []."
94
+ },
88
95
  "captured": {
89
96
  "type": "object",
90
97
  "required": ["run", "mark"],
@@ -2,13 +2,13 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "awf-lab label",
4
4
  "type": "object",
5
- "required": ["kind", "runId", "case", "mark", "at"],
5
+ "required": ["kind", "trialId", "case", "mark", "at"],
6
6
  "properties": {
7
7
  "kind": {
8
8
  "type": "string",
9
- "const": "awf.case-label/1"
9
+ "const": "awf.lab-label/1"
10
10
  },
11
- "runId": {
11
+ "trialId": {
12
12
  "type": "string",
13
13
  "minLength": 1
14
14
  },
@@ -22,7 +22,7 @@
22
22
  "properties": {
23
23
  "kind": {
24
24
  "type": "string",
25
- "const": "awf.case-loop-report/1"
25
+ "const": "awf.lab-loop-report/1"
26
26
  },
27
27
  "id": {
28
28
  "type": "string",
@@ -73,13 +73,13 @@
73
73
  "anyOf": [
74
74
  {
75
75
  "type": "object",
76
- "required": ["runId", "verdict", "unsteady", "spend"],
76
+ "required": ["labRun", "decision", "unsteady", "estimate"],
77
77
  "properties": {
78
- "runId": {
78
+ "labRun": {
79
79
  "type": "string",
80
80
  "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
81
81
  },
82
- "verdict": {
82
+ "decision": {
83
83
  "anyOf": [
84
84
  {
85
85
  "type": "string",
@@ -97,7 +97,7 @@
97
97
  "minLength": 1
98
98
  }
99
99
  },
100
- "spend": {
100
+ "estimate": {
101
101
  "type": "number",
102
102
  "minimum": 0
103
103
  }
@@ -117,7 +117,7 @@
117
117
  "type": "array",
118
118
  "items": {
119
119
  "type": "object",
120
- "required": ["n", "parent", "decision", "why", "changed", "spend"],
120
+ "required": ["n", "parent", "outcome", "why", "changed", "estimate"],
121
121
  "properties": {
122
122
  "n": {
123
123
  "type": "integer",
@@ -127,7 +127,7 @@
127
127
  "type": "integer",
128
128
  "minimum": 0
129
129
  },
130
- "decision": {
130
+ "outcome": {
131
131
  "type": "string",
132
132
  "minLength": 1
133
133
  },
@@ -144,11 +144,22 @@
144
144
  "minLength": 1
145
145
  }
146
146
  },
147
- "runId": {
147
+ "labRun": {
148
148
  "type": "string",
149
149
  "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
150
150
  },
151
- "spend": {
151
+ "decision": {
152
+ "anyOf": [
153
+ {
154
+ "type": "string",
155
+ "minLength": 1
156
+ },
157
+ {
158
+ "type": "null"
159
+ }
160
+ ]
161
+ },
162
+ "estimate": {
152
163
  "type": "number",
153
164
  "minimum": 0
154
165
  }
@@ -164,21 +175,21 @@
164
175
  "type": "array",
165
176
  "items": {
166
177
  "type": "object",
167
- "required": ["k", "incumbent", "runId", "verdict", "why", "spend"],
178
+ "required": ["k", "kept", "labRun", "decision", "why", "estimate"],
168
179
  "properties": {
169
180
  "k": {
170
181
  "type": "integer",
171
182
  "minimum": 1
172
183
  },
173
- "incumbent": {
184
+ "kept": {
174
185
  "type": "integer",
175
- "minimum": 0
186
+ "minimum": 1
176
187
  },
177
- "runId": {
188
+ "labRun": {
178
189
  "type": "string",
179
190
  "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
180
191
  },
181
- "verdict": {
192
+ "decision": {
182
193
  "anyOf": [
183
194
  {
184
195
  "type": "string",
@@ -192,7 +203,7 @@
192
203
  "why": {
193
204
  "type": "string"
194
205
  },
195
- "spend": {
206
+ "estimate": {
196
207
  "type": "number",
197
208
  "minimum": 0
198
209
  }
@@ -21,7 +21,7 @@
21
21
  "properties": {
22
22
  "kind": {
23
23
  "type": "string",
24
- "const": "awf.case-loop/1"
24
+ "const": "awf.lab-loop/1"
25
25
  },
26
26
  "name": {
27
27
  "type": "string",
@@ -6,7 +6,7 @@
6
6
  "properties": {
7
7
  "kind": {
8
8
  "type": "string",
9
- "const": "awf.case-plan/1"
9
+ "const": "awf.lab-plan/1"
10
10
  },
11
11
  "command": {
12
12
  "enum": ["run", "score", "loop run", "loop final"]
@@ -15,7 +15,7 @@
15
15
  "type": "string",
16
16
  "minLength": 1
17
17
  },
18
- "run": {
18
+ "labRun": {
19
19
  "type": "string",
20
20
  "pattern": "^[0-9]{8}-[0-9]{6}-[0-9a-f]{4}$"
21
21
  },
@@ -78,13 +78,24 @@
78
78
  "minLength": 1
79
79
  }
80
80
  },
81
- "rounds": {
81
+ "tries": {
82
82
  "type": "integer",
83
83
  "minimum": 1
84
84
  },
85
85
  "spread": {
86
86
  "type": "boolean"
87
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
+ },
88
99
  "estimate": {
89
100
  "type": "object",
90
101
  "properties": {
@@ -2,11 +2,11 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "awf-lab loop's proposal.json",
4
4
  "type": "object",
5
- "required": ["kind", "hypothesis", "spend", "feedback"],
5
+ "required": ["kind", "hypothesis", "estimate", "feedback"],
6
6
  "properties": {
7
7
  "kind": {
8
8
  "type": "string",
9
- "const": "awf.case-proposal/1"
9
+ "const": "awf.lab-proposal/1"
10
10
  },
11
11
  "hypothesis": {
12
12
  "type": "object",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "additionalProperties": false
37
37
  },
38
- "spend": {
38
+ "estimate": {
39
39
  "type": "number",
40
40
  "minimum": 0
41
41
  },