Some checks failed
Main Confidence / confidence (push) Failing after 45s
## Summary - introduce surface-aware compressed governance outcomes and reuse the shared truth/explanation seams for operator-first summaries - apply the compressed outcome hierarchy across baseline, evidence, review, review-pack, canonical review/evidence, and artifact-oriented operation-run surfaces - expand spec 214 fixtures and Pest coverage, and fix tenant-panel route assertions by generating explicit tenant-panel URLs in the affected Filament tests ## Validation - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - focused governance compression suite from `specs/214-governance-outcome-compression/quickstart.md` passed (`68` tests, `445` assertions) - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/InventoryItemResourceTest.php tests/Feature/Filament/BackupSetUiEnforcementTest.php tests/Feature/Filament/RestoreRunUiEnforcementTest.php` passed (`18` tests, `81` assertions) Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #253
65 lines
2.0 KiB
Plaintext
65 lines
2.0 KiB
Plaintext
/*
|
|
@license
|
|
Rollup.js v4.60.2
|
|
Sat, 18 Apr 2026 13:58:01 GMT - commit a6be82b8abd747458afdc7484319f7b5deb92535
|
|
|
|
https://github.com/rollup/rollup
|
|
|
|
Released under the MIT License.
|
|
*/
|
|
const getLogFilter = filters => {
|
|
if (filters.length === 0)
|
|
return () => true;
|
|
const normalizedFilters = filters.map(filter => filter.split('&').map(subFilter => {
|
|
const inverted = subFilter[0] === '!';
|
|
if (inverted)
|
|
subFilter = subFilter.slice(1);
|
|
const [key, ...value] = subFilter.split(':');
|
|
return { inverted, key: key.split('.'), parts: value.join(':').split('*') };
|
|
}));
|
|
return (log) => {
|
|
nextIntersectedFilter: for (const intersectedFilters of normalizedFilters) {
|
|
for (const { inverted, key, parts } of intersectedFilters) {
|
|
const isFilterSatisfied = testFilter(log, key, parts);
|
|
if (inverted ? isFilterSatisfied : !isFilterSatisfied) {
|
|
continue nextIntersectedFilter;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
};
|
|
};
|
|
const testFilter = (log, key, parts) => {
|
|
let rawValue = log;
|
|
for (let index = 0; index < key.length; index++) {
|
|
if (!rawValue) {
|
|
return false;
|
|
}
|
|
const part = key[index];
|
|
if (!(part in rawValue)) {
|
|
return false;
|
|
}
|
|
rawValue = rawValue[part];
|
|
}
|
|
let value = typeof rawValue === 'object' ? JSON.stringify(rawValue) : String(rawValue);
|
|
if (parts.length === 1) {
|
|
return value === parts[0];
|
|
}
|
|
if (!value.startsWith(parts[0])) {
|
|
return false;
|
|
}
|
|
const lastPartIndex = parts.length - 1;
|
|
for (let index = 1; index < lastPartIndex; index++) {
|
|
const part = parts[index];
|
|
const position = value.indexOf(part);
|
|
if (position === -1) {
|
|
return false;
|
|
}
|
|
value = value.slice(position + part.length);
|
|
}
|
|
return value.endsWith(parts[lastPartIndex]);
|
|
};
|
|
|
|
export { getLogFilter };
|