donobu 5.53.0 → 5.54.0

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.
@@ -908,14 +908,14 @@ async function persistFlowJson(persistence, flowId, fileId, value) {
908
908
  * See `fetchBaselineScreenshot` / `gatherTestFailureEvidence` in
909
909
  * triageTestFailure.ts.
910
910
  *
911
- * Runs for any meaningful end state; skipped only for `skipped` tests (no real
912
- * page state), when triage is disabled, or for V1 (legacy self-heal) tests.
913
- * Best-effort and fails open.
911
+ * Runs for any meaningful end state, including V1 (objective-annotated) tests;
912
+ * skipped only for `skipped` tests (no real page state) or when triage is
913
+ * disabled. Triage reads this screenshot as the current run's failure shot and
914
+ * as the baseline for a later failing run. Best-effort and fails open.
914
915
  */
915
916
  async function captureAndPersistFinalState(page, testInfo) {
916
917
  if (testInfo.status === 'skipped' ||
917
- process.env.DONOBU_TRIAGE_DISABLED === '1' ||
918
- isV1Test(testInfo)) {
918
+ process.env.DONOBU_TRIAGE_DISABLED === '1') {
919
919
  return;
920
920
  }
921
921
  const flowId = page._dnb?.donobuFlowMetadata?.id;
@@ -1015,35 +1015,40 @@ async function finalizeTest(page, testInfo, logBuffer, videoOption) {
1015
1015
  // future failing run reads a successful run's copy as its baseline.
1016
1016
  await captureAndPersistFinalState(page, testInfo);
1017
1017
  if (testInfo.status === 'failed') {
1018
- if (isV1Test(testInfo)) {
1019
- if (isV1SelfHealingEnabled(testInfo) &&
1020
- !MiscUtils_1.MiscUtils.yn(envVars_1.env.data.DONOBU_AUTO_HEAL_ACTIVE)) {
1021
- if (!sharedState.gptClient) {
1022
- Logger_1.appLogger.warn('Will not self-heal due to no GPT client being set up.');
1023
- }
1024
- else {
1025
- try {
1026
- await (0, selfHealing_1.selfHeal)(sharedState.gptClient, testInfo, page);
1027
- }
1028
- catch (error) {
1029
- Logger_1.appLogger.error('Error when attempting to self-heal', error);
1030
- }
1031
- }
1018
+ // Gather failure-triage evidence for every failed test, regardless of its
1019
+ // V1 (objective-annotated) classification or self-heal setting. Triage is a
1020
+ // standalone diagnostic: it writes the failure evidence that populates the
1021
+ // triage run directory, feeds the reports, and supplies the treatment plans
1022
+ // auto-heal consumes. Legacy V1 self-heal runs separately, below.
1023
+ try {
1024
+ const evidenceResult = await (0, triageTestFailure_1.gatherTestFailureEvidence)(testInfo, page);
1025
+ if (evidenceResult?.filePath) {
1026
+ Logger_1.appLogger.info(`Persisted Donobu triage evidence for "${testInfo.title}" to ${evidenceResult.filePath}.`);
1027
+ }
1028
+ else if (evidenceResult?.evidence) {
1029
+ Logger_1.appLogger.info(`Captured Donobu triage evidence for "${testInfo.title}" (schema v${evidenceResult.evidence.schemaVersion}).`);
1032
1030
  }
1033
1031
  }
1034
- else {
1035
- try {
1036
- const evidenceResult = await (0, triageTestFailure_1.gatherTestFailureEvidence)(testInfo, page);
1037
- if (evidenceResult?.filePath) {
1038
- Logger_1.appLogger.info(`Persisted Donobu triage evidence for "${testInfo.title}" to ${evidenceResult.filePath}.`);
1032
+ catch (error) {
1033
+ Logger_1.appLogger.error(`Failed to gather test failure evidence for "${testInfo.title}".`, error);
1034
+ }
1035
+ // Legacy V1 self-heal: only for objective-annotated tests that opt in via
1036
+ // SELF_HEAL_TESTS_ENABLED, and never during an auto-heal rerun (which owns
1037
+ // its own remediation path).
1038
+ if (isV1Test(testInfo) &&
1039
+ isV1SelfHealingEnabled(testInfo) &&
1040
+ !MiscUtils_1.MiscUtils.yn(envVars_1.env.data.DONOBU_AUTO_HEAL_ACTIVE)) {
1041
+ if (!sharedState.gptClient) {
1042
+ Logger_1.appLogger.warn('Will not self-heal due to no GPT client being set up.');
1043
+ }
1044
+ else {
1045
+ try {
1046
+ await (0, selfHealing_1.selfHeal)(sharedState.gptClient, testInfo, page);
1039
1047
  }
1040
- else if (evidenceResult?.evidence) {
1041
- Logger_1.appLogger.info(`Captured Donobu triage evidence for "${testInfo.title}" (schema v${evidenceResult.evidence.schemaVersion}).`);
1048
+ catch (error) {
1049
+ Logger_1.appLogger.error('Error when attempting to self-heal', error);
1042
1050
  }
1043
1051
  }
1044
- catch (error) {
1045
- Logger_1.appLogger.error(`Failed to gather test failure evidence for "${testInfo.title}".`, error);
1046
- }
1047
1052
  }
1048
1053
  }
1049
1054
  else if (testInfo.status === 'passed' &&
@@ -908,14 +908,14 @@ async function persistFlowJson(persistence, flowId, fileId, value) {
908
908
  * See `fetchBaselineScreenshot` / `gatherTestFailureEvidence` in
909
909
  * triageTestFailure.ts.
910
910
  *
911
- * Runs for any meaningful end state; skipped only for `skipped` tests (no real
912
- * page state), when triage is disabled, or for V1 (legacy self-heal) tests.
913
- * Best-effort and fails open.
911
+ * Runs for any meaningful end state, including V1 (objective-annotated) tests;
912
+ * skipped only for `skipped` tests (no real page state) or when triage is
913
+ * disabled. Triage reads this screenshot as the current run's failure shot and
914
+ * as the baseline for a later failing run. Best-effort and fails open.
914
915
  */
915
916
  async function captureAndPersistFinalState(page, testInfo) {
916
917
  if (testInfo.status === 'skipped' ||
917
- process.env.DONOBU_TRIAGE_DISABLED === '1' ||
918
- isV1Test(testInfo)) {
918
+ process.env.DONOBU_TRIAGE_DISABLED === '1') {
919
919
  return;
920
920
  }
921
921
  const flowId = page._dnb?.donobuFlowMetadata?.id;
@@ -1015,35 +1015,40 @@ async function finalizeTest(page, testInfo, logBuffer, videoOption) {
1015
1015
  // future failing run reads a successful run's copy as its baseline.
1016
1016
  await captureAndPersistFinalState(page, testInfo);
1017
1017
  if (testInfo.status === 'failed') {
1018
- if (isV1Test(testInfo)) {
1019
- if (isV1SelfHealingEnabled(testInfo) &&
1020
- !MiscUtils_1.MiscUtils.yn(envVars_1.env.data.DONOBU_AUTO_HEAL_ACTIVE)) {
1021
- if (!sharedState.gptClient) {
1022
- Logger_1.appLogger.warn('Will not self-heal due to no GPT client being set up.');
1023
- }
1024
- else {
1025
- try {
1026
- await (0, selfHealing_1.selfHeal)(sharedState.gptClient, testInfo, page);
1027
- }
1028
- catch (error) {
1029
- Logger_1.appLogger.error('Error when attempting to self-heal', error);
1030
- }
1031
- }
1018
+ // Gather failure-triage evidence for every failed test, regardless of its
1019
+ // V1 (objective-annotated) classification or self-heal setting. Triage is a
1020
+ // standalone diagnostic: it writes the failure evidence that populates the
1021
+ // triage run directory, feeds the reports, and supplies the treatment plans
1022
+ // auto-heal consumes. Legacy V1 self-heal runs separately, below.
1023
+ try {
1024
+ const evidenceResult = await (0, triageTestFailure_1.gatherTestFailureEvidence)(testInfo, page);
1025
+ if (evidenceResult?.filePath) {
1026
+ Logger_1.appLogger.info(`Persisted Donobu triage evidence for "${testInfo.title}" to ${evidenceResult.filePath}.`);
1027
+ }
1028
+ else if (evidenceResult?.evidence) {
1029
+ Logger_1.appLogger.info(`Captured Donobu triage evidence for "${testInfo.title}" (schema v${evidenceResult.evidence.schemaVersion}).`);
1032
1030
  }
1033
1031
  }
1034
- else {
1035
- try {
1036
- const evidenceResult = await (0, triageTestFailure_1.gatherTestFailureEvidence)(testInfo, page);
1037
- if (evidenceResult?.filePath) {
1038
- Logger_1.appLogger.info(`Persisted Donobu triage evidence for "${testInfo.title}" to ${evidenceResult.filePath}.`);
1032
+ catch (error) {
1033
+ Logger_1.appLogger.error(`Failed to gather test failure evidence for "${testInfo.title}".`, error);
1034
+ }
1035
+ // Legacy V1 self-heal: only for objective-annotated tests that opt in via
1036
+ // SELF_HEAL_TESTS_ENABLED, and never during an auto-heal rerun (which owns
1037
+ // its own remediation path).
1038
+ if (isV1Test(testInfo) &&
1039
+ isV1SelfHealingEnabled(testInfo) &&
1040
+ !MiscUtils_1.MiscUtils.yn(envVars_1.env.data.DONOBU_AUTO_HEAL_ACTIVE)) {
1041
+ if (!sharedState.gptClient) {
1042
+ Logger_1.appLogger.warn('Will not self-heal due to no GPT client being set up.');
1043
+ }
1044
+ else {
1045
+ try {
1046
+ await (0, selfHealing_1.selfHeal)(sharedState.gptClient, testInfo, page);
1039
1047
  }
1040
- else if (evidenceResult?.evidence) {
1041
- Logger_1.appLogger.info(`Captured Donobu triage evidence for "${testInfo.title}" (schema v${evidenceResult.evidence.schemaVersion}).`);
1048
+ catch (error) {
1049
+ Logger_1.appLogger.error('Error when attempting to self-heal', error);
1042
1050
  }
1043
1051
  }
1044
- catch (error) {
1045
- Logger_1.appLogger.error(`Failed to gather test failure evidence for "${testInfo.title}".`, error);
1046
- }
1047
1052
  }
1048
1053
  }
1049
1054
  else if (testInfo.status === 'passed' &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "donobu",
3
- "version": "5.53.0",
3
+ "version": "5.54.0",
4
4
  "description": "Create browser automations with an LLM agent and replay them as Playwright scripts.",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/esm/main.js",