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

74 lines
3.0 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 command_exports = {};
__export(command_exports, {
declareCommand: () => declareCommand,
parseCommand: () => parseCommand
});
module.exports = __toCommonJS(command_exports);
var import_zodBundle = require("../../zodBundle");
function declareCommand(command) {
return command;
}
const kEmptyOptions = import_zodBundle.z.object({});
const kEmptyArgs = import_zodBundle.z.object({});
function parseCommand(command, args) {
const optionsObject = { ...args };
delete optionsObject["_"];
const optionsSchema = (command.options ?? kEmptyOptions).strict();
const options = zodParse(optionsSchema, optionsObject, "option");
const argsSchema = (command.args ?? kEmptyArgs).strict();
const argNames = [...Object.keys(argsSchema.shape)];
const argv = args["_"].slice(1);
if (argv.length > argNames.length)
throw new Error(`error: too many arguments: expected ${argNames.length}, received ${argv.length}`);
const argsObject = {};
argNames.forEach((name, index) => argsObject[name] = argv[index]);
const parsedArgsObject = zodParse(argsSchema, argsObject, "argument");
const toolName = typeof command.toolName === "function" ? command.toolName({ ...parsedArgsObject, ...options }) : command.toolName;
const toolParams = command.toolParams({ ...parsedArgsObject, ...options });
return { toolName, toolParams };
}
function zodParse(schema, data, type) {
try {
return schema.parse(data);
} catch (e) {
throw new Error(e.issues.map((issue) => {
const keys = issue.code === "unrecognized_keys" ? issue.keys : [""];
const props = keys.map((key) => [...issue.path, key].filter(Boolean).join("."));
return props.map((prop) => {
const label = type === "option" ? `'--${prop}' option` : `'${prop}' argument`;
switch (issue.code) {
case "invalid_type":
return "error: " + label + ": " + issue.message.replace(/Invalid input:/, "").trim();
case "unrecognized_keys":
return "error: unknown " + label;
default:
return "error: " + label + ": " + issue.message;
}
});
}).flat().join("\n"));
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
declareCommand,
parseCommand
});