@openwop/openwop-conformance 1.136.10 → 1.136.11
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Provenance of this vendored schemas/ copy. See conformance/README.md \u00a7\"Resolving the contract\". Compare against the stamp in your installed @openwop/openwop-conformance to detect a stale hand-copied contract.",
|
|
3
|
-
"suiteVersion": "1.136.
|
|
4
|
-
"corpusCommit": "
|
|
3
|
+
"suiteVersion": "1.136.11",
|
|
4
|
+
"corpusCommit": "d52dd83825840335271db2bd1696476b4bbcb634"
|
|
5
5
|
}
|
|
@@ -20,7 +20,10 @@
|
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
import { describe, it, expect } from 'vitest';
|
|
23
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
24
|
+
import { join } from 'node:path';
|
|
23
25
|
import { verifyBundle, verifyBundleProfile, PROFILE_FLOOR_SCENARIOS } from '../lib/profiles.js';
|
|
26
|
+
import { SCENARIOS_DIR } from '../lib/paths.js';
|
|
24
27
|
|
|
25
28
|
/** Derives `openwop-core` and `openwop-stream-sse` (transports omitted ⇒ all). */
|
|
26
29
|
const streamingDiscovery = {
|
|
@@ -135,5 +138,67 @@ describe('RFC 0148 §C — floor enforcement is not vacuous', () => {
|
|
|
135
138
|
for (const { profile, scenario } of all) {
|
|
136
139
|
expect(scenario, `${profile} floor cites a non-scenario filename`).toMatch(/\.test\.ts$/);
|
|
137
140
|
}
|
|
141
|
+
|
|
142
|
+
// 2026-08-18: this leg's NAME promised "files that exist" and it only
|
|
143
|
+
// matched the `.test.ts` suffix — a string check wearing an existence
|
|
144
|
+
// check's name. The phantom `audit-log-verification.test.ts` floor row sat
|
|
145
|
+
// in `openwop-core-standard` until `--certify` hit it against a live host,
|
|
146
|
+
// because nothing here opened the directory.
|
|
147
|
+
if (SCENARIOS_DIR === null) return; // published layout ships src/, but stay honest if it ever does not
|
|
148
|
+
const dir = SCENARIOS_DIR as string;
|
|
149
|
+
const missing = all
|
|
150
|
+
.filter(({ scenario }) => !existsSync(join(dir, scenario)))
|
|
151
|
+
.map(({ profile, scenario }) => `${profile} → ${scenario}`);
|
|
152
|
+
expect(
|
|
153
|
+
missing,
|
|
154
|
+
'a floor cites a scenario file that does not exist — that requirement can never be satisfied, ' +
|
|
155
|
+
'so the profile can never certify, for a reason unrelated to any host',
|
|
156
|
+
).toEqual([]);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('no floor scenario is corpus-only — a floor must be provable from the published package', () => {
|
|
160
|
+
// openwop-app's suggestion, and it is right that this be a red test rather
|
|
161
|
+
// than a paragraph: the failure mode is SOMEONE LATER adding a corpus
|
|
162
|
+
// self-check to a floor, and prose in a PR body will not be in front of
|
|
163
|
+
// them.
|
|
164
|
+
//
|
|
165
|
+
// A scenario that can only run in a repo checkout (it reads `spec/` or
|
|
166
|
+
// `RFCS/` through `V1_DIR`) records `blocked` in the published layout,
|
|
167
|
+
// where the package ships no corpus by design. `blocked` is correct there
|
|
168
|
+
// — RFC 0148 §A defines it as a missing dependency — but a `blocked`
|
|
169
|
+
// requirement in a claimed profile invalidates that profile. So a
|
|
170
|
+
// corpus-only scenario in a floor makes the profile UNCERTIFIABLE from the
|
|
171
|
+
// npm tarball, permanently, for a reason no host can fix. It is the mirror
|
|
172
|
+
// of the phantom-row trap above: that one named a file that does not
|
|
173
|
+
// exist, this one names a file that cannot execute where certification is
|
|
174
|
+
// measured.
|
|
175
|
+
if (SCENARIOS_DIR === null) return;
|
|
176
|
+
const dir = SCENARIOS_DIR as string;
|
|
177
|
+
|
|
178
|
+
/** Every `it`/`test` in the file is V1_DIR-guarded, or every `describe` is. */
|
|
179
|
+
const isCorpusOnly = (source: string): boolean => {
|
|
180
|
+
if (!source.includes('V1_DIR')) return false;
|
|
181
|
+
const guard = /\(V1_DIR === null\)/;
|
|
182
|
+
const its = [...source.matchAll(/\b(?:it|test)(\.skipIf\([^)]*\))?\s*\(/g)];
|
|
183
|
+
const describes = [...source.matchAll(/\bdescribe(\.skipIf\([^)]*\))?\s*\(/g)];
|
|
184
|
+
const allItsGuarded = its.length > 0 && its.every((m) => guard.test(m[1] ?? ''));
|
|
185
|
+
const allDescribesGuarded = describes.length > 0 && describes.every((m) => guard.test(m[1] ?? ''));
|
|
186
|
+
return allItsGuarded || allDescribesGuarded;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const offenders = Object.entries(PROFILE_FLOOR_SCENARIOS)
|
|
190
|
+
.flatMap(([profile, floor]) => floor.required.map((scenario) => ({ profile, scenario })))
|
|
191
|
+
.filter(({ scenario }) => {
|
|
192
|
+
const path = join(dir, scenario);
|
|
193
|
+
return existsSync(path) && isCorpusOnly(readFileSync(path, 'utf8'));
|
|
194
|
+
})
|
|
195
|
+
.map(({ profile, scenario }) => `${profile} → ${scenario}`);
|
|
196
|
+
|
|
197
|
+
expect(
|
|
198
|
+
offenders,
|
|
199
|
+
'a profile floor cites a CORPUS-ONLY scenario (all of its tests are guarded on `V1_DIR === null`). ' +
|
|
200
|
+
'It records `blocked` in the published layout, so that profile can never certify from the npm ' +
|
|
201
|
+
'tarball — no host can fix it. Keep corpus self-checks out of floors.',
|
|
202
|
+
).toEqual([]);
|
|
138
203
|
});
|
|
139
204
|
});
|