TenantAtlas/apps/platform/.pnpm-store/v10/files/69/86e8bd50016648dfc8447bb2a5b2db782f83f9dff8ef921b6b42e7d86008cd58ca2b3cbaf45f502f1ad3b899aa39aac4bb15bc99acb8e5a70d8b08f655cd23
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

155 lines
4.7 KiB
Plaintext

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var view_exports = {};
__export(view_exports, {
ManualViewBuilder: () => ManualViewBuilder,
MySqlView: () => MySqlView,
ViewBuilder: () => ViewBuilder,
ViewBuilderCore: () => ViewBuilderCore,
mysqlView: () => mysqlView,
mysqlViewWithSchema: () => mysqlViewWithSchema
});
module.exports = __toCommonJS(view_exports);
var import_entity = require("../entity.cjs");
var import_selection_proxy = require("../selection-proxy.cjs");
var import_utils = require("../utils.cjs");
var import_query_builder = require("./query-builders/query-builder.cjs");
var import_table = require("./table.cjs");
var import_view_base = require("./view-base.cjs");
var import_view_common = require("./view-common.cjs");
class ViewBuilderCore {
constructor(name, schema) {
this.name = name;
this.schema = schema;
}
static [import_entity.entityKind] = "MySqlViewBuilder";
config = {};
algorithm(algorithm) {
this.config.algorithm = algorithm;
return this;
}
sqlSecurity(sqlSecurity) {
this.config.sqlSecurity = sqlSecurity;
return this;
}
withCheckOption(withCheckOption) {
this.config.withCheckOption = withCheckOption ?? "cascaded";
return this;
}
}
class ViewBuilder extends ViewBuilderCore {
static [import_entity.entityKind] = "MySqlViewBuilder";
as(qb) {
if (typeof qb === "function") {
qb = qb(new import_query_builder.QueryBuilder());
}
const selectionProxy = new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
});
const aliasedSelection = new Proxy(qb.getSelectedFields(), selectionProxy);
return new Proxy(
new MySqlView({
mysqlConfig: this.config,
config: {
name: this.name,
schema: this.schema,
selectedFields: aliasedSelection,
query: qb.getSQL().inlineParams()
}
}),
selectionProxy
);
}
}
class ManualViewBuilder extends ViewBuilderCore {
static [import_entity.entityKind] = "MySqlManualViewBuilder";
columns;
constructor(name, columns, schema) {
super(name, schema);
this.columns = (0, import_utils.getTableColumns)((0, import_table.mysqlTable)(name, columns));
}
existing() {
return new Proxy(
new MySqlView({
mysqlConfig: void 0,
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: void 0
}
}),
new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
as(query) {
return new Proxy(
new MySqlView({
mysqlConfig: this.config,
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: query.inlineParams()
}
}),
new import_selection_proxy.SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
}
class MySqlView extends import_view_base.MySqlViewBase {
static [import_entity.entityKind] = "MySqlView";
[import_view_common.MySqlViewConfig];
constructor({ mysqlConfig, config }) {
super(config);
this[import_view_common.MySqlViewConfig] = mysqlConfig;
}
}
function mysqlViewWithSchema(name, selection, schema) {
if (selection) {
return new ManualViewBuilder(name, selection, schema);
}
return new ViewBuilder(name, schema);
}
function mysqlView(name, selection) {
return mysqlViewWithSchema(name, selection, void 0);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ManualViewBuilder,
MySqlView,
ViewBuilder,
ViewBuilderCore,
mysqlView,
mysqlViewWithSchema
});
//# sourceMappingURL=view.cjs.map