unitbob 0.1.11 → 0.2.1
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.
- package/dist/cli.js +7 -1
- package/dist/files/artifactPath.js +19 -0
- package/dist/files/behavioral.js +29 -0
- package/dist/files/guardrails.js +6 -4
- package/dist/files/suiteBuild.js +65 -57
- package/dist/runner/bdd.js +138 -0
- package/dist/runner/boundReport.js +107 -0
- package/dist/runner/precheck.js +60 -1
- package/dist/runner/provision.js +116 -0
- package/dist/runner/pytestBddPlugin.js +62 -0
- package/dist/verbs/contractPrompt.js +25 -0
- package/dist/verbs/putSuiteBuild.js +42 -28
- package/dist/verbs/run.js +71 -144
- package/dist/verbs/suitePrepare.js +46 -20
- package/dist/wire.js +58 -3
- package/package.json +1 -1
package/dist/wire.js
CHANGED
|
@@ -49,9 +49,64 @@ export class Wire {
|
|
|
49
49
|
await this.ensureOk(res, `PUT ${this.repoPath('map_build')}`);
|
|
50
50
|
return (await res.json());
|
|
51
51
|
}
|
|
52
|
-
// GET /repos/:id/suite_packets — the
|
|
53
|
-
//
|
|
54
|
-
// the server's "run
|
|
52
|
+
// GET /repos/:id/suite_packets — the two peer assignments (spec 32), exactly
|
|
53
|
+
// one per contract system. Relayed opaque; 409 (no current map) surfaces as a
|
|
54
|
+
// WireError carrying the server's "run the Unitbob map first" guidance.
|
|
55
|
+
async getSuitePacketsBatch() {
|
|
56
|
+
const res = await this.send('GET', this.repoPath('suite_packets'));
|
|
57
|
+
await this.ensureOk(res, `GET ${this.repoPath('suite_packets')}`);
|
|
58
|
+
const body = (await res.json());
|
|
59
|
+
if (!Array.isArray(body.suite_packets)) {
|
|
60
|
+
throw new WireError(`GET ${this.repoPath('suite_packets')} returned no suite_packets array.`);
|
|
61
|
+
}
|
|
62
|
+
return body.suite_packets;
|
|
63
|
+
}
|
|
64
|
+
// PUT /repos/:id/suite_builds — upload both peer branches in one batch (spec
|
|
65
|
+
// 32). Each item is validated and published independently; the response
|
|
66
|
+
// carries one result per suite_kind.
|
|
67
|
+
async putSuiteBuilds(items) {
|
|
68
|
+
const res = await this.send('PUT', this.repoPath('suite_builds'), { suite_builds: items });
|
|
69
|
+
await this.ensureOk(res, `PUT ${this.repoPath('suite_builds')}`);
|
|
70
|
+
const body = (await res.json());
|
|
71
|
+
if (!Array.isArray(body.results)) {
|
|
72
|
+
throw new WireError(`PUT ${this.repoPath('suite_builds')} returned no results array.`);
|
|
73
|
+
}
|
|
74
|
+
return body.results;
|
|
75
|
+
}
|
|
76
|
+
// GET /repos/:id/suites — both current suites (spec 32), exactly two peer
|
|
77
|
+
// items. A `ready` item carries its blob; a `not_built` item is skipped.
|
|
78
|
+
async getSuites() {
|
|
79
|
+
const res = await this.send('GET', this.repoPath('suites'));
|
|
80
|
+
await this.ensureOk(res, `GET ${this.repoPath('suites')}`);
|
|
81
|
+
const body = (await res.json());
|
|
82
|
+
if (!Array.isArray(body.suites)) {
|
|
83
|
+
throw new WireError(`GET ${this.repoPath('suites')} returned no suites array.`);
|
|
84
|
+
}
|
|
85
|
+
return body.suites;
|
|
86
|
+
}
|
|
87
|
+
// POST /repos/:id/runs/batch — ship each branch's raw report (or suite error)
|
|
88
|
+
// in one batch; the server parses each against the exact stored version and
|
|
89
|
+
// returns one summary per branch plus one shared map URL.
|
|
90
|
+
async postRunsBatch(runs) {
|
|
91
|
+
const res = await this.send('POST', this.repoPath('runs/batch'), { runs });
|
|
92
|
+
await this.ensureOk(res, `POST ${this.repoPath('runs/batch')}`);
|
|
93
|
+
const body = (await res.json());
|
|
94
|
+
if (!Array.isArray(body.results)) {
|
|
95
|
+
throw new WireError(`POST ${this.repoPath('runs/batch')} returned no results array.`);
|
|
96
|
+
}
|
|
97
|
+
return { results: body.results, map_url: String(body.map_url ?? '') };
|
|
98
|
+
}
|
|
99
|
+
// GET /repos/:id/contract_prompt?suite_digest=&test_id=&intent= — the one
|
|
100
|
+
// contract action operation for both maps and both intents (spec 32).
|
|
101
|
+
async getContractPrompt(suiteDigest, testId, intent) {
|
|
102
|
+
const query = new URLSearchParams({ suite_digest: suiteDigest, test_id: testId, intent });
|
|
103
|
+
const url = `${this.repoPath('contract_prompt')}?${query}`;
|
|
104
|
+
const res = await this.send('GET', url);
|
|
105
|
+
await this.ensureOk(res, `GET ${url}`);
|
|
106
|
+
return (await res.json());
|
|
107
|
+
}
|
|
108
|
+
// GET /repos/:id/suite_packets — the legacy singular assignment (spec 26),
|
|
109
|
+
// kept for the structural-only flow. Relayed opaque.
|
|
55
110
|
async getSuitePackets() {
|
|
56
111
|
const res = await this.send('GET', this.repoPath('suite_packets'));
|
|
57
112
|
await this.ensureOk(res, `GET ${this.repoPath('suite_packets')}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unitbob",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Unitbob connector — thin local hands for the Unitbob Rails brain. Owns no domain logic: it runs tools, relays bytes over the wire, and prints what the server returns.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|