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

178 lines
6.1 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 helpGenerator_exports = {};
__export(helpGenerator_exports, {
generateHelp: () => generateHelp,
generateHelpJSON: () => generateHelpJSON,
generateReadme: () => generateReadme
});
module.exports = __toCommonJS(helpGenerator_exports);
var import_zodBundle = require("../../zodBundle");
var import_commands = require("./commands");
function commandArgs(command) {
const args = [];
const shape = command.args ? command.args.shape : {};
for (const [name, schema] of Object.entries(shape)) {
const zodSchema = schema;
const description = zodSchema.description ?? "";
args.push({ name, description, optional: zodSchema.safeParse(void 0).success });
}
return args;
}
function commandArgsText(args) {
return args.map((a) => a.optional ? `[${a.name}]` : `<${a.name}>`).join(" ");
}
function generateCommandHelp(command) {
const args = commandArgs(command);
const lines = [
`playwright-cli ${command.name} ${commandArgsText(args)}`,
"",
command.description,
""
];
if (args.length) {
lines.push("Arguments:");
lines.push(...args.map((a) => formatWithGap(` ${a.optional ? `[${a.name}]` : `<${a.name}>`}`, a.description.toLowerCase())));
}
if (command.options) {
lines.push("Options:");
const optionsShape = command.options.shape;
for (const [name, schema] of Object.entries(optionsShape)) {
const zodSchema = schema;
const description = (zodSchema.description ?? "").toLowerCase();
lines.push(formatWithGap(` --${name}`, description));
}
}
return lines.join("\n");
}
const categories = [
{ name: "core", title: "Core" },
{ name: "navigation", title: "Navigation" },
{ name: "keyboard", title: "Keyboard" },
{ name: "mouse", title: "Mouse" },
{ name: "export", title: "Save as" },
{ name: "tabs", title: "Tabs" },
{ name: "storage", title: "Storage" },
{ name: "network", title: "Network" },
{ name: "devtools", title: "DevTools" },
{ name: "install", title: "Install" },
{ name: "config", title: "Configuration" },
{ name: "browsers", title: "Browser sessions" }
];
function generateHelp() {
const lines = [];
lines.push("Usage: playwright-cli <command> [args] [options]");
lines.push("Usage: playwright-cli -s=<session> <command> [args] [options]");
const commandsByCategory = /* @__PURE__ */ new Map();
for (const c of categories)
commandsByCategory.set(c.name, []);
for (const command of Object.values(import_commands.commands)) {
if (command.hidden)
continue;
commandsByCategory.get(command.category).push(command);
}
for (const c of categories) {
const cc = commandsByCategory.get(c.name);
if (!cc.length)
continue;
lines.push(`
${c.title}:`);
for (const command of cc)
lines.push(generateHelpEntry(command));
}
lines.push("\nGlobal options:");
lines.push(formatWithGap(" --help [command]", "print help"));
lines.push(formatWithGap(" --version", "print version"));
return lines.join("\n");
}
function generateReadme() {
const lines = [];
lines.push("\n## Commands");
const commandsByCategory = /* @__PURE__ */ new Map();
for (const c of categories)
commandsByCategory.set(c.name, []);
for (const command of Object.values(import_commands.commands))
commandsByCategory.get(command.category).push(command);
for (const c of categories) {
const cc = commandsByCategory.get(c.name);
if (!cc.length)
continue;
lines.push(`
### ${c.title}
`);
lines.push("```bash");
for (const command of cc)
lines.push(generateReadmeEntry(command));
lines.push("```");
}
return lines.join("\n");
}
function generateHelpEntry(command) {
const args = commandArgs(command);
const prefix = ` ${command.name} ${commandArgsText(args)}`;
const suffix = command.description.toLowerCase();
return formatWithGap(prefix, suffix);
}
function generateReadmeEntry(command) {
const args = commandArgs(command);
const prefix = `playwright-cli ${command.name} ${commandArgsText(args)}`;
const suffix = "# " + command.description.toLowerCase();
return formatWithGap(prefix, suffix, 40);
}
function unwrapZodType(schema) {
if ("unwrap" in schema && typeof schema.unwrap === "function")
return unwrapZodType(schema.unwrap());
return schema;
}
function isBooleanSchema(schema) {
return unwrapZodType(schema) instanceof import_zodBundle.z.ZodBoolean;
}
function generateHelpJSON() {
const booleanOptions = /* @__PURE__ */ new Set();
const commandEntries = {};
for (const [name, command] of Object.entries(import_commands.commands)) {
const flags = {};
if (command.options) {
const optionsShape = command.options.shape;
for (const [flagName, schema] of Object.entries(optionsShape)) {
const isBoolean = isBooleanSchema(schema);
flags[flagName] = isBoolean ? "boolean" : "string";
if (isBoolean)
booleanOptions.add(flagName);
}
}
commandEntries[name] = { help: generateCommandHelp(command), flags };
}
return {
global: generateHelp(),
commands: commandEntries,
booleanOptions: [...booleanOptions]
};
}
function formatWithGap(prefix, text, threshold = 30) {
const indent = Math.max(1, threshold - prefix.length);
return prefix + " ".repeat(indent) + text;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
generateHelp,
generateHelpJSON,
generateReadme
});