gencow 0.1.289 → 0.1.290
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -234,6 +234,17 @@ function appendRootCauseLines(lines, contract, statusCommand) {
|
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
+
// body.diagnostic = { code, scope }: shown only when both values match these strict patterns, never echoed otherwise.
|
|
238
|
+
const DIAGNOSTIC_SCOPE_PATTERN = /^[a-z][a-z0-9_]{2,31}$/u;
|
|
239
|
+
const DIAGNOSTIC_CODE_PATTERNS = [/^[a-z][a-z0-9_]{2,63}$/u, /^[A-Z][A-Z0-9_]{2,99}$/u];
|
|
240
|
+
|
|
241
|
+
function readStructuredDiagnosticLines(responseBody) {
|
|
242
|
+
const { code, scope } = responseBody?.diagnostic ?? {};
|
|
243
|
+
if (typeof code !== "string" || typeof scope !== "string") return [];
|
|
244
|
+
if (!DIAGNOSTIC_SCOPE_PATTERN.test(scope) || !DIAGNOSTIC_CODE_PATTERNS.some((p) => p.test(code))) return [];
|
|
245
|
+
return [`Diagnostic: ${scope}/${code}`];
|
|
246
|
+
}
|
|
247
|
+
|
|
237
248
|
function safeText(value, maxLength) {
|
|
238
249
|
if (typeof value !== "string") return null;
|
|
239
250
|
const normalized = value.trim();
|
|
@@ -660,7 +671,7 @@ export function renderDeployFailureDiagnosticLines(responseBody, statusText, opt
|
|
|
660
671
|
const publicMessage = contract.legacySupportAction
|
|
661
672
|
? PLATFORM_STATUS_MESSAGE
|
|
662
673
|
: (safeText(responseBody.error, 240) ?? fallbackMessage);
|
|
663
|
-
const lines = [`Deploy failed: ${publicMessage}`, `Code: ${contract.code}`, `Stage: ${contract.stage}`];
|
|
674
|
+
const lines = [`Deploy failed: ${publicMessage}`, `Code: ${contract.code}`, ...readStructuredDiagnosticLines(responseBody), `Stage: ${contract.stage}`];
|
|
664
675
|
const phase = formatDeploymentOperationPhase(responseBody);
|
|
665
676
|
if (phase) lines.push(`Phase: ${phase}`);
|
|
666
677
|
const selfService = readSelfServiceDiagnostic(responseBody, contract, options.expectedAppName);
|
|
@@ -744,7 +755,7 @@ export function renderDeployFailureDiagnosticLines(responseBody, statusText, opt
|
|
|
744
755
|
? PLATFORM_STATUS_MESSAGE
|
|
745
756
|
: (safeText(responseBody.error, 240) ?? fallbackMessage);
|
|
746
757
|
const lines = [`Deploy failed: ${publicMessage}`];
|
|
747
|
-
lines.push(`Code: ${contract.code}`, `Stage: ${contract.stage}`);
|
|
758
|
+
lines.push(`Code: ${contract.code}`, ...readStructuredDiagnosticLines(responseBody), `Stage: ${contract.stage}`);
|
|
748
759
|
const selfService = readSelfServiceDiagnostic(responseBody, contract, options.expectedAppName);
|
|
749
760
|
appendSelfServiceState(lines, selfService);
|
|
750
761
|
if (isCliUpgradeContract(contract) && !selfService) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gencow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.290",
|
|
4
4
|
"description": "Gencow — AI Backend Engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"postgres": "^3.4.9",
|
|
43
43
|
"@gencow/client": "0.2.8",
|
|
44
44
|
"@gencow/core": "0.1.48",
|
|
45
|
+
"@gencow/server": "0.1.3",
|
|
45
46
|
"@gencow/react": "0.2.8",
|
|
46
|
-
"@gencow/shared": "0.0.0"
|
|
47
|
-
"@gencow/server": "0.1.3"
|
|
47
|
+
"@gencow/shared": "0.0.0"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "node scripts/bundle-core.mjs && node scripts/bundle-shared.mjs && node scripts/bundle-server.mjs",
|