TenantAtlas/apps/platform/.pnpm-store/v10/files/ac/f25be665d2799cd664ece6fe5c2bc0fa268c9a1a163b6d84486b231420b94402bb7e6af14f8d141fdefc35849ebe19017b9d52a735b477f21e7eda94efb91a
ahmido 1fec9c6f9d
Some checks failed
Main Confidence / confidence (push) Failing after 45s
feat: compress governance operator outcomes (#253)
## 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
2026-04-19 12:30:36 +00:00

77 lines
3.4 KiB
Plaintext

import { __values } from "tslib";
import { Subscription } from '../Subscription';
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
import { arrRemove } from '../util/arrRemove';
import { asyncScheduler } from '../scheduler/async';
import { popScheduler } from '../util/args';
import { executeSchedule } from '../util/executeSchedule';
export function bufferTime(bufferTimeSpan) {
var _a, _b;
var otherArgs = [];
for (var _i = 1; _i < arguments.length; _i++) {
otherArgs[_i - 1] = arguments[_i];
}
var scheduler = (_a = popScheduler(otherArgs)) !== null && _a !== void 0 ? _a : asyncScheduler;
var bufferCreationInterval = (_b = otherArgs[0]) !== null && _b !== void 0 ? _b : null;
var maxBufferSize = otherArgs[1] || Infinity;
return operate(function (source, subscriber) {
var bufferRecords = [];
var restartOnEmit = false;
var emit = function (record) {
var buffer = record.buffer, subs = record.subs;
subs.unsubscribe();
arrRemove(bufferRecords, record);
subscriber.next(buffer);
restartOnEmit && startBuffer();
};
var startBuffer = function () {
if (bufferRecords) {
var subs = new Subscription();
subscriber.add(subs);
var buffer = [];
var record_1 = {
buffer: buffer,
subs: subs,
};
bufferRecords.push(record_1);
executeSchedule(subs, scheduler, function () { return emit(record_1); }, bufferTimeSpan);
}
};
if (bufferCreationInterval !== null && bufferCreationInterval >= 0) {
executeSchedule(subscriber, scheduler, startBuffer, bufferCreationInterval, true);
}
else {
restartOnEmit = true;
}
startBuffer();
var bufferTimeSubscriber = createOperatorSubscriber(subscriber, function (value) {
var e_1, _a;
var recordsCopy = bufferRecords.slice();
try {
for (var recordsCopy_1 = __values(recordsCopy), recordsCopy_1_1 = recordsCopy_1.next(); !recordsCopy_1_1.done; recordsCopy_1_1 = recordsCopy_1.next()) {
var record = recordsCopy_1_1.value;
var buffer = record.buffer;
buffer.push(value);
maxBufferSize <= buffer.length && emit(record);
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (recordsCopy_1_1 && !recordsCopy_1_1.done && (_a = recordsCopy_1.return)) _a.call(recordsCopy_1);
}
finally { if (e_1) throw e_1.error; }
}
}, function () {
while (bufferRecords === null || bufferRecords === void 0 ? void 0 : bufferRecords.length) {
subscriber.next(bufferRecords.shift().buffer);
}
bufferTimeSubscriber === null || bufferTimeSubscriber === void 0 ? void 0 : bufferTimeSubscriber.unsubscribe();
subscriber.complete();
subscriber.unsubscribe();
}, undefined, function () { return (bufferRecords = null); });
source.subscribe(bufferTimeSubscriber);
});
}
//# sourceMappingURL=bufferTime.js.map