feat(errors): carry related parameters and operations and derive CLI flags and commands (#11777)

* feat(errors): carry related parameters and operations and derive CLI flags and commands

* fix(cli,errors): preserve operation-selector flags in CLI hints and clarify snapshot load/save
This commit is contained in:
morluto authored and GitHub committed 2026-11-16 16:42:07 -05:00
1 parent ddd0d6d4a4
commit d5a942177f
25 files changed
+679 -68

No files matched your search

+13
View File
@@ -96,6 +96,19 @@ export const cliOperationFailureIdentity = (
): CliFailureIdentity | undefined =>
isRecord(value) ? loggedFailures.get(value)?.identity : undefined;
/** Keep failure classification and recovery identity when a CLI wrapper projects an error record. */
export const rebindLoggedCliFailure = (
previous: unknown,
next: unknown,
): void => {
if (previous === next || !isRecord(previous) || !isRecord(next)) return;
if (!loggedFailures.has(previous)) return;
loggedFailures.set(
next,
inferCliOperationFailure(next) ?? loggedFailures.get(previous),
);
};
/** Log one CLI command with duration and a stable success or failure status. */
export const logCliCommand = async <Value>(
logger: Logger,