js-rigor: extend fuzzer campaign to 6 config kinds (intersection, defeasible)
Confirms min-intersection and when*unless defeasible semantics hold under fuzzed config transitions and mutation bursts.
This commit is contained in:
@@ -23,7 +23,7 @@ import { Arbiter } from '../../src/index.js';
|
|||||||
const NODES = 6;
|
const NODES = 6;
|
||||||
const nodeKey = (id) => (id < 2 ? `u:${id}` : id === 2 ? 'g:0' : `doc:${id - 3}`);
|
const nodeKey = (id) => (id < 2 ? `u:${id}` : id === 2 ? 'g:0' : `doc:${id - 3}`);
|
||||||
|
|
||||||
const KINDS = ['direct', 'chain', 'union', 'exclusion'];
|
const KINDS = ['direct', 'chain', 'union', 'exclusion', 'intersection', 'defeasible'];
|
||||||
const CONFIGS = {
|
const CONFIGS = {
|
||||||
direct: { type: 'direct', relation: 'owner' },
|
direct: { type: 'direct', relation: 'owner' },
|
||||||
chain: {
|
chain: {
|
||||||
@@ -46,6 +46,18 @@ const CONFIGS = {
|
|||||||
{ type: 'direct', relation: 'owner' },
|
{ type: 'direct', relation: 'owner' },
|
||||||
{ type: 'chain', steps: [{ relation: 'member_of', direction: 'out' }, { relation: 'reads', direction: 'out' }] }
|
{ type: 'chain', steps: [{ relation: 'member_of', direction: 'out' }, { relation: 'reads', direction: 'out' }] }
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
intersection: {
|
||||||
|
intersection: {
|
||||||
|
rules: [
|
||||||
|
{ type: 'direct', relation: 'owner' },
|
||||||
|
{ type: 'chain', steps: [{ relation: 'member_of', direction: 'out' }, { relation: 'reads', direction: 'out' }] }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
defeasible: {
|
||||||
|
when: { type: 'direct', relation: 'owner' },
|
||||||
|
unless: { type: 'chain', steps: [{ relation: 'member_of', direction: 'out' }, { relation: 'reads', direction: 'out' }] }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -64,6 +76,8 @@ function mirrorCheck(tuples, kind, src, rel, dst) {
|
|||||||
if (kind === 'chain') return chainBest;
|
if (kind === 'chain') return chainBest;
|
||||||
if (kind === 'union') return Math.max(direct, chainBest);
|
if (kind === 'union') return Math.max(direct, chainBest);
|
||||||
if (kind === 'exclusion') return direct * (1 - chainBest);
|
if (kind === 'exclusion') return direct * (1 - chainBest);
|
||||||
|
if (kind === 'intersection') return Math.min(direct, chainBest);
|
||||||
|
if (kind === 'defeasible') return direct * (1 - chainBest);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user