TenantAtlas/apps/platform/.pnpm-store/v10/files/dc/24f2a7191ae6cbf82253f0177b014bec2918e03016e88d78e4061f58eb96c4783ff91cd3ee1e67acfb78b49c3629865775251fbf8795c4c8b61d56c2b4d7cd
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

100 lines
3.5 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 selection_proxy_exports = {};
__export(selection_proxy_exports, {
SelectionProxyHandler: () => SelectionProxyHandler
});
module.exports = __toCommonJS(selection_proxy_exports);
var import_alias = require("./alias.cjs");
var import_column = require("./column.cjs");
var import_entity = require("./entity.cjs");
var import_sql = require("./sql/sql.cjs");
var import_subquery = require("./subquery.cjs");
var import_view_common = require("./view-common.cjs");
class SelectionProxyHandler {
static [import_entity.entityKind] = "SelectionProxyHandler";
config;
constructor(config) {
this.config = { ...config };
}
get(subquery, prop) {
if (prop === "_") {
return {
...subquery["_"],
selectedFields: new Proxy(
subquery._.selectedFields,
this
)
};
}
if (prop === import_view_common.ViewBaseConfig) {
return {
...subquery[import_view_common.ViewBaseConfig],
selectedFields: new Proxy(
subquery[import_view_common.ViewBaseConfig].selectedFields,
this
)
};
}
if (typeof prop === "symbol") {
return subquery[prop];
}
const columns = (0, import_entity.is)(subquery, import_subquery.Subquery) ? subquery._.selectedFields : (0, import_entity.is)(subquery, import_sql.View) ? subquery[import_view_common.ViewBaseConfig].selectedFields : subquery;
const value = columns[prop];
if ((0, import_entity.is)(value, import_sql.SQL.Aliased)) {
if (this.config.sqlAliasedBehavior === "sql" && !value.isSelectionField) {
return value.sql;
}
const newValue = value.clone();
newValue.isSelectionField = true;
return newValue;
}
if ((0, import_entity.is)(value, import_sql.SQL)) {
if (this.config.sqlBehavior === "sql") {
return value;
}
throw new Error(
`You tried to reference "${prop}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`
);
}
if ((0, import_entity.is)(value, import_column.Column)) {
if (this.config.alias) {
return new Proxy(
value,
new import_alias.ColumnAliasProxyHandler(
new Proxy(
value.table,
new import_alias.TableAliasProxyHandler(this.config.alias, this.config.replaceOriginalName ?? false)
)
)
);
}
return value;
}
if (typeof value !== "object" || value === null) {
return value;
}
return new Proxy(value, new SelectionProxyHandler(this.config));
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
SelectionProxyHandler
});
//# sourceMappingURL=selection-proxy.cjs.map