@enspirit/opspicy 0.3.0 → 0.3.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/README.md +6 -6
- package/dist/judging.js +6 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -186,16 +186,16 @@ A system that stops answering during the run is not that: each case then could n
|
|
|
186
186
|
|
|
187
187
|
| Tag | Is |
|
|
188
188
|
| --- | --- |
|
|
189
|
-
| `0.3.
|
|
189
|
+
| `0.3.1` | The version tagged `v0.3.1`: the image of that commit, as it was tested. Name one of these. |
|
|
190
190
|
| `latest`, `sha-<commit>` | The main branch, and one commit of it. |
|
|
191
191
|
|
|
192
192
|
**As a tool**, on a suite that is mounted:
|
|
193
193
|
|
|
194
194
|
```sh
|
|
195
|
-
docker run --rm -v "$PWD":/suite:ro enspirit/opspicy:0.3.
|
|
196
|
-
docker run --rm -v "$PWD":/suite:ro enspirit/opspicy:0.3.
|
|
197
|
-
docker run --rm -v "$PWD":/suite enspirit/opspicy:0.3.
|
|
198
|
-
docker run --rm -v "$PWD":/suite:ro -p 127.0.0.1:8080:8080 enspirit/opspicy:0.3.
|
|
195
|
+
docker run --rm -v "$PWD":/suite:ro enspirit/opspicy:0.3.1 opspicy --check
|
|
196
|
+
docker run --rm -v "$PWD":/suite:ro enspirit/opspicy:0.3.1 tsc -p . # type-checks its config.ts
|
|
197
|
+
docker run --rm -v "$PWD":/suite enspirit/opspicy:0.3.1 opspicy explorer --out=explorer.html
|
|
198
|
+
docker run --rm -v "$PWD":/suite:ro -p 127.0.0.1:8080:8080 enspirit/opspicy:0.3.1 opspicy serve --host=0.0.0.0
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
The last one is read-only: `--api` is offered on the machine the server runs on, which a container is not.
|
|
@@ -203,7 +203,7 @@ The last one is read-only: `--api` is offered on the machine the server runs on,
|
|
|
203
203
|
**As the base of a suite's image**, where the system is reached: on the network of its stack, say.
|
|
204
204
|
|
|
205
205
|
```dockerfile
|
|
206
|
-
FROM enspirit/opspicy:0.3.
|
|
206
|
+
FROM enspirit/opspicy:0.3.1
|
|
207
207
|
COPY . /suite
|
|
208
208
|
CMD ["tail", "-f", "/dev/null"] # it sleeps, and `opspicy` is run in it
|
|
209
209
|
```
|
package/dist/judging.js
CHANGED
|
@@ -40,12 +40,16 @@ function answer(operation, kase, observed, meaning, refusal) {
|
|
|
40
40
|
const typed = misfit ? [{ says: `what is answered is not a ${type}`, saw: `${misfit} — ${excerpt(observed.body)}` }] : [];
|
|
41
41
|
return [...typed, ...(kase.then.code && code !== kase.then.code ? [{ says: `it is not refused as ${kase.then.code}`, saw: `refused as ${excerpt(code)}` }] : [])];
|
|
42
42
|
}
|
|
43
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* The names of what is not as it was: of the state, of the relations, of what others see. Each is
|
|
45
|
+
* named as a whole, `me` or `seenBy.admin.me`, never by a part of it: a state is what an operation
|
|
46
|
+
* controls, and what others see is a state.
|
|
47
|
+
*/
|
|
44
48
|
export function changed(before, after, path = '') {
|
|
45
49
|
if (JSON.stringify(before) === JSON.stringify(after))
|
|
46
50
|
return [];
|
|
47
51
|
const nested = (value) => Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
48
|
-
const deeper = path === '' || path === 'db' || path
|
|
52
|
+
const deeper = path === '' || path === 'db' || path === 'seenBy' || /^seenBy\.[^.]+$/.test(path);
|
|
49
53
|
if (!deeper || !nested(before) || !nested(after))
|
|
50
54
|
return [path];
|
|
51
55
|
return [...new Set([...Object.keys(before), ...Object.keys(after)])].flatMap((name) => changed(before[name], after[name], path ? `${path}.${name}` : name));
|
package/package.json
CHANGED