@openwop/openwop-conformance 1.136.11 → 1.138.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/src/setup.ts CHANGED
@@ -32,7 +32,7 @@ import { McpFakeServer, setMcpFakeServer } from './lib/mcp-fake-server.js';
32
32
  import { A2AFakePeer, setA2AFakePeer } from './lib/a2a-fake-peer.js';
33
33
  import { afterAll, afterEach, beforeAll, expect } from 'vitest';
34
34
  import { basename } from 'node:path';
35
- import { recordRequirement, journalLength, journalSince } from './lib/requirement-ledger.js';
35
+ import { recordRequirement, hasRequirement, journalLength, journalSince } from './lib/requirement-ledger.js';
36
36
  import { requirementIdForFile, resolveFileRecord, type FileTestState } from './lib/scenario-disposition.js';
37
37
  import { softSkipDisposition } from './lib/soft-skip.js';
38
38
  import type { DiscoveryPayload } from './lib/profiles.js';
@@ -279,10 +279,29 @@ afterAll(({}, suite) => {
279
279
  // honest bundle row and the pressure to say why both survive. The rule is
280
280
  // `resolveFileRecord` (pinned by conformance-execution-witness.test.ts).
281
281
  const { disposition, detail } = resolveFileRecord(states, gateReason, assertionCount, softSkipDisposition(file));
282
- try {
283
- recordRequirement(requirementIdForFile(file), disposition, detail, { assertionCount });
284
- } catch {
285
- /* a scenario that recorded its own file id first wins; never fail the file for bookkeeping */
282
+ const fileRequirementId = requirementIdForFile(file);
283
+ // A scenario that classified ITSELF wins outright — including its `detail` and
284
+ // its `assertionCount`.
285
+ //
286
+ // The `catch` below has always made the explicit record win when the two
287
+ // DISAGREE (`recordRequirement` throws on a conflicting disposition). It did
288
+ // not when they AGREE: the automatic call then reached `ledger.set` and
289
+ // silently replaced the scenario's own detail and count with the file-level
290
+ // ones. Invisible until 2026-08-19, when `resolveFileRecord` started attaching
291
+ // a `partial-witness:` marker — a scenario that recorded `executed-pass` for a
292
+ // requirement it really did exercise, in a file whose LAST leg soft-skipped,
293
+ // would have been stamped "may not have witnessed this" over its own explicit
294
+ // finding. That would inject false positives into exactly the measurement the
295
+ // marker exists to produce.
296
+ //
297
+ // So the comment describing this line was true of half the cases. It is true
298
+ // of both now.
299
+ if (!hasRequirement(fileRequirementId)) {
300
+ try {
301
+ recordRequirement(fileRequirementId, disposition, detail, { assertionCount });
302
+ } catch {
303
+ /* never fail a file for bookkeeping */
304
+ }
286
305
  }
287
306
  _fileStates.delete(file);
288
307
  _fileAssertions.delete(file);