TenantAtlas/apps/platform/.pnpm-store/v10/files/b6/f37d377ef4c92b86f8a3600dd47f76d6c9a55ace20b9956e60a6c49c0117737710b780fd3fe64803a45819a341ea2572345e935d5de39a96c3ba91fd39b8ea
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

119 lines
3.1 KiB
Plaintext

import { entityKind } from "../entity.js";
import { SelectionProxyHandler } from "../selection-proxy.js";
import { getTableColumns } from "../utils.js";
import { QueryBuilder } from "./query-builders/query-builder.js";
import { singlestoreTable } from "./table.js";
import { SingleStoreViewBase } from "./view-base.js";
import { SingleStoreViewConfig } from "./view-common.js";
class ViewBuilderCore {
constructor(name, schema) {
this.name = name;
this.schema = schema;
}
static [entityKind] = "SingleStoreViewBuilder";
config = {};
algorithm(algorithm) {
this.config.algorithm = algorithm;
return this;
}
definer(definer) {
this.config.definer = definer;
return this;
}
sqlSecurity(sqlSecurity) {
this.config.sqlSecurity = sqlSecurity;
return this;
}
withCheckOption(withCheckOption) {
this.config.withCheckOption = withCheckOption ?? "cascaded";
return this;
}
}
class ViewBuilder extends ViewBuilderCore {
static [entityKind] = "SingleStoreViewBuilder";
as(qb) {
if (typeof qb === "function") {
qb = qb(new QueryBuilder());
}
const selectionProxy = new SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
});
const aliasedSelection = new Proxy(qb.getSelectedFields(), selectionProxy);
return new Proxy(
new SingleStoreView({
singlestoreConfig: this.config,
config: {
name: this.name,
schema: this.schema,
selectedFields: aliasedSelection,
query: qb.getSQL().inlineParams()
}
}),
selectionProxy
);
}
}
class ManualViewBuilder extends ViewBuilderCore {
static [entityKind] = "SingleStoreManualViewBuilder";
columns;
constructor(name, columns, schema) {
super(name, schema);
this.columns = getTableColumns(singlestoreTable(name, columns));
}
existing() {
return new Proxy(
new SingleStoreView({
singlestoreConfig: void 0,
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: void 0
}
}),
new SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
as(query) {
return new Proxy(
new SingleStoreView({
singlestoreConfig: this.config,
config: {
name: this.name,
schema: this.schema,
selectedFields: this.columns,
query: query.inlineParams()
}
}),
new SelectionProxyHandler({
alias: this.name,
sqlBehavior: "error",
sqlAliasedBehavior: "alias",
replaceOriginalName: true
})
);
}
}
class SingleStoreView extends SingleStoreViewBase {
static [entityKind] = "SingleStoreView";
[SingleStoreViewConfig];
constructor({ singlestoreConfig, config }) {
super(config);
this[SingleStoreViewConfig] = singlestoreConfig;
}
}
export {
ManualViewBuilder,
SingleStoreView,
ViewBuilder,
ViewBuilderCore
};
//# sourceMappingURL=view.js.map