diff --git a/.github/workflows/setup_platform_smoke.yml b/.github/workflows/setup_platform_smoke.yml index 46b98d247..18617269c 100644 --- a/.github/workflows/setup_platform_smoke.yml +++ b/.github/workflows/setup_platform_smoke.yml @@ -752,7 +752,8 @@ jobs: sudo apt-get install -y libgtk-3-0t64 libdbus-glib-1-2 libasound2t64 libxt6t64 libx11-xcb1 mkdir -p "$RUNNER_TEMP/copilot-h2-browsers" curl --fail --location --retry 2 https://archive.mozilla.org/pub/firefox/releases/153.5.1esr/linux-x86_64/en-US/firefox-153.5.1esr.tar.xz --output "$RUNNER_TEMP/copilot-h2-browsers/firefox.tar.xz" - curl --fail --location --retry 2 https://github.com/mozilla/geckodriver/releases/download/v0.37.1/geckodriver-v0.37.1-linux64.tar.gz --output "$RUNNER_TEMP/copilot-h2-browsers/geckodriver.tar.gz" + # Same v0.37.1 release asset; the named download route returned repeated HTTP 504. + curl --fail --location --retry 2 --connect-timeout 10 --max-time 60 --header 'Accept: application/octet-stream' https://api.github.com/repos/mozilla/geckodriver/releases/assets/483347579 --output "$RUNNER_TEMP/copilot-h2-browsers/geckodriver.tar.gz" # Mozilla SHA256SUMS: https://archive.mozilla.org/pub/firefox/releases/153.5.1esr/SHA256SUMS printf '%s %s\n' 'e289bdc532decf2b54dea9b5ac64cf6f84a62eeec4d4a9ec2f69590f61b0ff1c' "$RUNNER_TEMP/copilot-h2-browsers/firefox.tar.xz" | sha256sum --check --strict # GitHub release asset digest: https://api.github.com/repos/mozilla/geckodriver/releases/tags/v0.37.1 diff --git a/build/api/index.js b/build/api/index.js index 7846f3682..bd83ccea9 100644 --- a/build/api/index.js +++ b/build/api/index.js @@ -109,6 +109,26 @@ function bugbotMutationError(cause, stage, findingIds, fallback, affectedCount = } +/***/ }), + +/***/ 2486: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BugbotVerificationResponseFailure = void 0; +const application_error_1 = __nccwpck_require__(5999); +/** Host-validated candidate proof rejection; distinct from agent execution and capacity failures. */ +class BugbotVerificationResponseFailure extends application_error_1.ApplicationError { + constructor(message) { + super('agent.failed', message); + this.reason = 'verification-invalid'; + } +} +exports.BugbotVerificationResponseFailure = BugbotVerificationResponseFailure; + + /***/ }), /***/ 6457: @@ -1405,6 +1425,7 @@ exports.literalVerificationId = literalVerificationId; exports.assertLiteralVerificationPrompt = assertLiteralVerificationPrompt; exports.assertLiteralVerificationResponse = assertLiteralVerificationResponse; exports.applyLiteralVerification = applyLiteralVerification; +const bugbot_verification_response_failure_1 = __nccwpck_require__(2486); const node_crypto_1 = __nccwpck_require__(6005); const application_error_1 = __nccwpck_require__(5999); exports.MAX_LITERAL_VERIFICATION_CANDIDATES = 20; @@ -1483,7 +1504,7 @@ function originalCandidates(candidates) { return originals; } function invalidVerification() { - return new application_error_1.ApplicationError('agent.failed', 'Generated-source verification is incomplete or changed candidate identity, file, anchor or proof. Recheck the exact source; no clean result was verified.'); + return new bugbot_verification_response_failure_1.BugbotVerificationResponseFailure('Generated-source verification is incomplete or changed candidate identity, file, anchor or proof. Recheck the exact source; no clean result was verified.'); } @@ -5998,6 +6019,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.queryBugbotFindings = queryBugbotFindings; exports.buildBugbotPartitionQueryRequest = buildBugbotPartitionQueryRequest; exports.queryBugbotPartitionFindings = queryBugbotPartitionFindings; +const bugbot_verification_response_failure_1 = __nccwpck_require__(2486); +const response_failure_1 = __nccwpck_require__(4286); const framed_review_1 = __nccwpck_require__(3750); const bugbot_framed_receipt_policy_1 = __nccwpck_require__(4411); const agent_task_policy_1 = __nccwpck_require__(5712); @@ -6058,6 +6081,9 @@ async function queryBugbotPartitionFindings(repository, configuration, prompt, t : validation.payload; } catch (error) { + if (attempt === MAX_PARTITION_QUERY_ATTEMPTS && (error instanceof response_failure_1.BugbotResponseFailure || error instanceof bugbot_verification_response_failure_1.BugbotVerificationResponseFailure)) { + throw new application_error_1.ApplicationError('agent.failed', 'The completed Bugbot partition responses failed completed-response validation after three attempts.', { retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: error.reason, attempts: 3 } } }); + } if (attempt === MAX_PARTITION_QUERY_ATTEMPTS || (error instanceof framed_review_1.BugbotReviewCompletenessError && error.facts.resource !== 'receipt')) throw error; (0, logging_ports_1.logInfo)(`Bugbot reviewer retrying one partition query (${attempt + 1}/${MAX_PARTITION_QUERY_ATTEMPTS}) after unusable agent output.`); @@ -6667,6 +6693,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildLiteralVerificationSchema = buildLiteralVerificationSchema; exports.buildLiteralVerificationPrompt = buildLiteralVerificationPrompt; exports.verifyGeneratedLiteralFindings = verifyGeneratedLiteralFindings; +const bugbot_verification_response_failure_1 = __nccwpck_require__(2486); const schema_1 = __nccwpck_require__(6808); const bugbot_literal_verification_policy_1 = __nccwpck_require__(7802); const untrusted_content_1 = __nccwpck_require__(7057); @@ -6797,7 +6824,7 @@ function record(value) { return value; } function invalidOutput() { - return new application_error_1.ApplicationError('agent.failed', 'Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); + return new bugbot_verification_response_failure_1.BugbotVerificationResponseFailure('Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); } @@ -7248,6 +7275,7 @@ var _ApplicationError_cause; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApplicationError = exports.APPLICATION_ERROR_METADATA = exports.APPLICATION_ERROR_RECOVERY_IDS = void 0; exports.isApplicationErrorCorrelationId = isApplicationErrorCorrelationId; +const response_failure_1 = __nccwpck_require__(4286); const progress_batch_diagnostic_1 = __nccwpck_require__(9486); const branch_sync_publication_1 = __nccwpck_require__(7857); const framed_review_1 = __nccwpck_require__(3750); @@ -7312,6 +7340,7 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([ 'progress-result-contract-invalid', 'progress-partition-length-invalid', 'progress-assessment-length-invalid', + 'bugbot-partition-query-exhausted', 'progress-assessment-capacity-exceeded', 'progress-scope-clause-limit', 'progress-sdd-seed-unverified', @@ -7576,6 +7605,7 @@ const RECOVERY_VARIABLE_KEYS = Object.freeze({ 'bugbot-review-incomplete': Object.freeze(['profile', 'countKind', 'resource', 'observed', 'limit', 'unit']), 'progress-result-contract-invalid': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-partition-length-invalid': Object.freeze(['partitionId', 'filePath', 'unitId', 'field', 'maximum', 'observed']), + 'bugbot-partition-query-exhausted': Object.freeze(['reason', 'attempts']), 'progress-assessment-length-invalid': Object.freeze(['requirementId', 'sourceLineId', 'field', 'maximum', 'observed']), 'progress-assessment-capacity-exceeded': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-batch-retained': Object.freeze(['reason', 'verified', 'expected', 'batch', 'requirementId']), @@ -7689,6 +7719,8 @@ function normalizeApplicationErrorRecovery(recovery) { throw new TypeError('Progress part length diagnostic is invalid.'); if (recovery.id === 'progress-assessment-length-invalid' && !(0, progress_assessment_length_failure_1.isProgressAssessmentLengthDiagnostic)(variables)) throw new TypeError('Progress assessment length diagnostic is invalid.'); + if (recovery.id === 'bugbot-partition-query-exhausted' && !(0, response_failure_1.isBugbotPartitionQueryDiagnostic)(variables)) + throw new TypeError('Bugbot partition query diagnostic is invalid.'); if (recovery.id === 'bugbot-review-incomplete' && !(0, framed_review_1.isBugbotReviewBlockFacts)(variables)) throw new TypeError('Bugbot review diagnostic is invalid.'); if (recovery.id === 'progress-inventory-incomplete' && !(0, progress_inventory_diagnostic_1.isProgressInventoryDiagnostic)(variables)) @@ -8397,6 +8429,38 @@ function bugbotReviewResourceUnit(resource) { } +/***/ }), + +/***/ 4286: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BugbotResponseFailure = exports.BUGBOT_RESPONSE_FAILURE_REASONS = void 0; +exports.isBugbotPartitionQueryDiagnostic = isBugbotPartitionQueryDiagnostic; +/** Content-free reasons for a completed Bugbot response, never process or provider guesses. */ +exports.BUGBOT_RESPONSE_FAILURE_REASONS = Object.freeze(['json-invalid', 'schema-type', 'schema-enum', 'schema-string-short', + 'schema-string-long', 'schema-number-finite', 'schema-number-min', 'schema-number-max', 'schema-array-short', + 'schema-array-long', 'schema-required', 'schema-additional', 'verification-invalid']); +function isBugbotPartitionQueryDiagnostic(value) { + if (!value || typeof value !== 'object' || Array.isArray(value)) + return false; + const facts = value; + return Object.keys(facts).sort().join(',') === 'attempts,reason' && facts.attempts === 3 + && exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(reason => reason === facts.reason); +} +class BugbotResponseFailure extends Error { + constructor(reason) { + super('A completed Bugbot response did not satisfy its structured contract.'); + this.reason = reason; + if (!exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(known => known === reason)) + throw new TypeError('Bugbot response reason is invalid.'); + } +} +exports.BugbotResponseFailure = BugbotResponseFailure; + + /***/ }), /***/ 3994: diff --git a/build/api/src/data/model/application_error.d.ts b/build/api/src/data/model/application_error.d.ts index a04e3ce46..2a6cead38 100644 --- a/build/api/src/data/model/application_error.d.ts +++ b/build/api/src/data/model/application_error.d.ts @@ -1,3 +1,4 @@ +import { type BugbotPartitionQueryDiagnostic } from '../../domain/bugbot/response_failure'; import { type ProgressBatchDiagnostic } from '../../domain/progress_batch_diagnostic'; import { type BranchSyncPublicationDiagnostic } from '../../domain/branch_sync_publication'; import { type BugbotReviewBlockFacts } from '../../domain/bugbot/framed_review'; @@ -23,7 +24,7 @@ import { type SddSourceContextDiagnostic } from '../../domain/agent_source_snaps import { type SddDraftMinimumDiagnostic } from '../../domain/sdd_validation_diagnostic'; export type ApplicationErrorKind = 'configuration' | 'authorization' | 'provider' | 'agent' | 'validation' | 'workflow' | 'unknown'; export type ApplicationErrorCode = 'configuration.invalid' | 'configuration.unsupported' | 'authorization.denied' | 'authorization.credential-invalid' | 'provider.not-found' | 'provider.conflict' | 'provider.rate-limited' | 'provider.unavailable' | 'provider.contract-invalid' | 'agent.policy-rejected' | 'agent.failed' | 'locale.output-invalid' | 'locale.translation-failed' | 'validation.invalid-input' | 'validation.evidence-too-large' | 'validation.evidence-unavailable' | 'workflow.invalid-event' | 'workflow.stale' | 'workflow.cancelled' | 'workflow.failed' | 'workflow.presentation-pending' | 'timeout' | 'unexpected'; -export declare const APPLICATION_ERROR_RECOVERY_IDS: readonly ["comment-command-length", "comment-command-name-missing", "comment-command-name-unknown", "comment-command-argument-count", "comment-command-arguments-unexpected", "comment-command-arguments-missing", "comment-command-finding-quoting", "comment-command-review-format", "comment-command-review-effort", "comment-command-review-boolean", "comment-command-review-option", "comment-command-sync-option", "comment-command-sync-parent", "pull-request-link-restored", "pull-request-link-base-retained", "pull-request-link-reference-retained", "pull-request-link-base-and-reference-retained", "managed-branch-enrichment-failed", "inactivity-explanation-failed", "bugbot-review-blocks-pending", "branch-sync-agent-disabled", "branch-sync-fixer-unavailable", "branch-sync-resolution-invalid", "branch-sync-verification-failed", "branch-sync-catalog-incompatible", "branch-sync-workflow-write-required", "branch-sync-publication-failed", "sdd-draft-size-exceeded", "sdd-draft-response-too-short", "sdd-catalog-unsupported-profile", "sdd-catalog-format-invalid", "sdd-catalog-missing-trusted-source", "sdd-source-context-unavailable", "sdd-draft-format-invalid", "sdd-draft-case-identity-invalid", "sdd-draft-case-budget-invalid", "sdd-draft-requirement-mapping-invalid", "sdd-draft-repository-path-invalid", "deployment-publication-context-missing", "workspace-changes-rejected", "closed-issue-reconciliation-failed", "approval-evidence-read-failed", "change-size-reconciliation-failed", "issue-assignment-failed", "issue-assignment-count-invalid", "issue-workflow-admission-blocked", "progress-binary-evidence-unavailable", "progress-inventory-incomplete", "progress-evidence-capacity-exceeded", "bugbot-review-incomplete", "progress-result-contract-invalid", "progress-partition-length-invalid", "progress-assessment-length-invalid", "progress-assessment-capacity-exceeded", "progress-scope-clause-limit", "progress-sdd-seed-unverified", "progress-batch-retained", "progress-completion-recovery-exhausted", "stored-configuration-schema-missing", "stored-configuration-schema-unsupported", "stored-configuration-invalid"]; +export declare const APPLICATION_ERROR_RECOVERY_IDS: readonly ["comment-command-length", "comment-command-name-missing", "comment-command-name-unknown", "comment-command-argument-count", "comment-command-arguments-unexpected", "comment-command-arguments-missing", "comment-command-finding-quoting", "comment-command-review-format", "comment-command-review-effort", "comment-command-review-boolean", "comment-command-review-option", "comment-command-sync-option", "comment-command-sync-parent", "pull-request-link-restored", "pull-request-link-base-retained", "pull-request-link-reference-retained", "pull-request-link-base-and-reference-retained", "managed-branch-enrichment-failed", "inactivity-explanation-failed", "bugbot-review-blocks-pending", "branch-sync-agent-disabled", "branch-sync-fixer-unavailable", "branch-sync-resolution-invalid", "branch-sync-verification-failed", "branch-sync-catalog-incompatible", "branch-sync-workflow-write-required", "branch-sync-publication-failed", "sdd-draft-size-exceeded", "sdd-draft-response-too-short", "sdd-catalog-unsupported-profile", "sdd-catalog-format-invalid", "sdd-catalog-missing-trusted-source", "sdd-source-context-unavailable", "sdd-draft-format-invalid", "sdd-draft-case-identity-invalid", "sdd-draft-case-budget-invalid", "sdd-draft-requirement-mapping-invalid", "sdd-draft-repository-path-invalid", "deployment-publication-context-missing", "workspace-changes-rejected", "closed-issue-reconciliation-failed", "approval-evidence-read-failed", "change-size-reconciliation-failed", "issue-assignment-failed", "issue-assignment-count-invalid", "issue-workflow-admission-blocked", "progress-binary-evidence-unavailable", "progress-inventory-incomplete", "progress-evidence-capacity-exceeded", "bugbot-review-incomplete", "progress-result-contract-invalid", "progress-partition-length-invalid", "progress-assessment-length-invalid", "bugbot-partition-query-exhausted", "progress-assessment-capacity-exceeded", "progress-scope-clause-limit", "progress-sdd-seed-unverified", "progress-batch-retained", "progress-completion-recovery-exhausted", "stored-configuration-schema-missing", "stored-configuration-schema-unsupported", "stored-configuration-invalid"]; export type ApplicationErrorRecoveryId = typeof APPLICATION_ERROR_RECOVERY_IDS[number]; interface ApplicationErrorRecoveryVariables extends Readonly>; readonly 'progress-batch-retained': ProgressBatchDiagnostic; diff --git a/build/api/src/domain/bugbot/response_failure.d.ts b/build/api/src/domain/bugbot/response_failure.d.ts new file mode 100644 index 000000000..15d02faa5 --- /dev/null +++ b/build/api/src/domain/bugbot/response_failure.d.ts @@ -0,0 +1,12 @@ +/** Content-free reasons for a completed Bugbot response, never process or provider guesses. */ +export declare const BUGBOT_RESPONSE_FAILURE_REASONS: readonly ["json-invalid", "schema-type", "schema-enum", "schema-string-short", "schema-string-long", "schema-number-finite", "schema-number-min", "schema-number-max", "schema-array-short", "schema-array-long", "schema-required", "schema-additional", "verification-invalid"]; +export type BugbotResponseFailureReason = typeof BUGBOT_RESPONSE_FAILURE_REASONS[number]; +export type BugbotPartitionQueryDiagnostic = Readonly<{ + readonly reason: BugbotResponseFailureReason; + readonly attempts: 3; +}>; +export declare function isBugbotPartitionQueryDiagnostic(value: unknown): value is BugbotPartitionQueryDiagnostic; +export declare class BugbotResponseFailure extends Error { + readonly reason: BugbotResponseFailureReason; + constructor(reason: BugbotResponseFailureReason); +} diff --git a/build/cli/index.js b/build/cli/index.js index 62d4efcb9..0d013c2db 100755 --- a/build/cli/index.js +++ b/build/cli/index.js @@ -38421,6 +38421,26 @@ function bugbotMutationError(cause, stage, findingIds, fallback, affectedCount = } +/***/ }), + +/***/ 72486: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BugbotVerificationResponseFailure = void 0; +const application_error_1 = __nccwpck_require__(75999); +/** Host-validated candidate proof rejection; distinct from agent execution and capacity failures. */ +class BugbotVerificationResponseFailure extends application_error_1.ApplicationError { + constructor(message) { + super('agent.failed', message); + this.reason = 'verification-invalid'; + } +} +exports.BugbotVerificationResponseFailure = BugbotVerificationResponseFailure; + + /***/ }), /***/ 12183: @@ -39959,6 +39979,11 @@ const ENGLISH_RECOVERY_CONTENT = Object.freeze({ action: 'Inspect part {partitionId}, file {filePath}, unit {unitId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. The replacement must satisfy the unchanged schema. Do not remove files, truncate facts, relax acceptance or bypass verification.', retainedState: 'Existing progress labels and assessments were preserved. No partial percentage or passing verification was published; execution and optional check-publication failures remain separate.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'A completed Bugbot partition response remained invalid after {attempts} attempts; the review was not published.', + action: 'Inspect response reason {reason} and the current run. Qualify the provider output contract before a fresh complete review. This diagnostic describes completed response validation, not an execution infrastructure failure.', + retainedState: 'Prior findings and resolutions were preserved. No partial review was published. Source freshness and complete-review gates remain required.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'An acceptance field still exceeds its unchanged response limit after one complete replacement; progress was not published.', action: 'Inspect phase assessment, requirement {requirementId}, original source {sourceLineId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. Start a fresh complete assessment when the provider can satisfy the unchanged schema. Preserve every requirement and citation; do not truncate facts, raise limits or bypass verification.', @@ -40180,6 +40205,11 @@ const SPANISH_RECOVERY_CONTENT = Object.freeze({ action: 'Inspecciona la parte {partitionId}, archivo {filePath}, unidad {unitId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. La sustitución debe cumplir el mismo esquema. No elimines archivos, recortes los hechos, relajes la aceptación ni eludas la verificación.', retainedState: 'Se conservaron las etiquetas y evaluaciones de progreso. No se publicó ningún porcentaje parcial ni verificación aprobada; los fallos de ejecución y de publicación del check opcional siguen siendo independientes.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'La respuesta completada de una partición de Bugbot siguió siendo inválida tras {attempts} intentos; no se publicó la revisión.', + action: 'Inspecciona el motivo de respuesta {reason} y la ejecución actual. Valida el contrato de salida del proveedor antes de una revisión completa nueva. Este diagnóstico describe la validación de una respuesta completada, no un fallo de infraestructura de ejecución.', + retainedState: 'Se conservaron los hallazgos y resoluciones anteriores. No se publicó una revisión parcial. Siguen siendo obligatorios los controles de fuente vigente y revisión completa.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'Un campo de aceptación sigue superando su límite de respuesta tras una sustitución completa; no se publicó el progreso.', action: 'Inspecciona la fase assessment, requisito {requirementId}, fuente original {sourceLineId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. Inicia una evaluación completa nueva cuando el proveedor pueda cumplir el mismo esquema. Conserva todos los requisitos y citas; no recortes hechos, aumentes límites ni eludas la verificación.', @@ -42125,6 +42155,7 @@ exports.literalVerificationId = literalVerificationId; exports.assertLiteralVerificationPrompt = assertLiteralVerificationPrompt; exports.assertLiteralVerificationResponse = assertLiteralVerificationResponse; exports.applyLiteralVerification = applyLiteralVerification; +const bugbot_verification_response_failure_1 = __nccwpck_require__(72486); const node_crypto_1 = __nccwpck_require__(6005); const application_error_1 = __nccwpck_require__(75999); exports.MAX_LITERAL_VERIFICATION_CANDIDATES = 20; @@ -42203,7 +42234,7 @@ function originalCandidates(candidates) { return originals; } function invalidVerification() { - return new application_error_1.ApplicationError('agent.failed', 'Generated-source verification is incomplete or changed candidate identity, file, anchor or proof. Recheck the exact source; no clean result was verified.'); + return new bugbot_verification_response_failure_1.BugbotVerificationResponseFailure('Generated-source verification is incomplete or changed candidate identity, file, anchor or proof. Recheck the exact source; no clean result was verified.'); } @@ -74351,6 +74382,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.queryBugbotFindings = queryBugbotFindings; exports.buildBugbotPartitionQueryRequest = buildBugbotPartitionQueryRequest; exports.queryBugbotPartitionFindings = queryBugbotPartitionFindings; +const bugbot_verification_response_failure_1 = __nccwpck_require__(72486); +const response_failure_1 = __nccwpck_require__(94286); const framed_review_1 = __nccwpck_require__(43750); const bugbot_framed_receipt_policy_1 = __nccwpck_require__(54411); const agent_task_policy_1 = __nccwpck_require__(85712); @@ -74411,6 +74444,9 @@ async function queryBugbotPartitionFindings(repository, configuration, prompt, t : validation.payload; } catch (error) { + if (attempt === MAX_PARTITION_QUERY_ATTEMPTS && (error instanceof response_failure_1.BugbotResponseFailure || error instanceof bugbot_verification_response_failure_1.BugbotVerificationResponseFailure)) { + throw new application_error_1.ApplicationError('agent.failed', 'The completed Bugbot partition responses failed completed-response validation after three attempts.', { retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: error.reason, attempts: 3 } } }); + } if (attempt === MAX_PARTITION_QUERY_ATTEMPTS || (error instanceof framed_review_1.BugbotReviewCompletenessError && error.facts.resource !== 'receipt')) throw error; (0, logging_ports_1.logInfo)(`Bugbot reviewer retrying one partition query (${attempt + 1}/${MAX_PARTITION_QUERY_ATTEMPTS}) after unusable agent output.`); @@ -75206,6 +75242,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildLiteralVerificationSchema = buildLiteralVerificationSchema; exports.buildLiteralVerificationPrompt = buildLiteralVerificationPrompt; exports.verifyGeneratedLiteralFindings = verifyGeneratedLiteralFindings; +const bugbot_verification_response_failure_1 = __nccwpck_require__(72486); const schema_1 = __nccwpck_require__(16808); const bugbot_literal_verification_policy_1 = __nccwpck_require__(27802); const untrusted_content_1 = __nccwpck_require__(67057); @@ -75336,7 +75373,7 @@ function record(value) { return value; } function invalidOutput() { - return new application_error_1.ApplicationError('agent.failed', 'Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); + return new bugbot_verification_response_failure_1.BugbotVerificationResponseFailure('Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); } @@ -85860,6 +85897,7 @@ var _ApplicationError_cause; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApplicationError = exports.APPLICATION_ERROR_METADATA = exports.APPLICATION_ERROR_RECOVERY_IDS = void 0; exports.isApplicationErrorCorrelationId = isApplicationErrorCorrelationId; +const response_failure_1 = __nccwpck_require__(94286); const progress_batch_diagnostic_1 = __nccwpck_require__(49486); const branch_sync_publication_1 = __nccwpck_require__(67857); const framed_review_1 = __nccwpck_require__(43750); @@ -85924,6 +85962,7 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([ 'progress-result-contract-invalid', 'progress-partition-length-invalid', 'progress-assessment-length-invalid', + 'bugbot-partition-query-exhausted', 'progress-assessment-capacity-exceeded', 'progress-scope-clause-limit', 'progress-sdd-seed-unverified', @@ -86188,6 +86227,7 @@ const RECOVERY_VARIABLE_KEYS = Object.freeze({ 'bugbot-review-incomplete': Object.freeze(['profile', 'countKind', 'resource', 'observed', 'limit', 'unit']), 'progress-result-contract-invalid': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-partition-length-invalid': Object.freeze(['partitionId', 'filePath', 'unitId', 'field', 'maximum', 'observed']), + 'bugbot-partition-query-exhausted': Object.freeze(['reason', 'attempts']), 'progress-assessment-length-invalid': Object.freeze(['requirementId', 'sourceLineId', 'field', 'maximum', 'observed']), 'progress-assessment-capacity-exceeded': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-batch-retained': Object.freeze(['reason', 'verified', 'expected', 'batch', 'requirementId']), @@ -86301,6 +86341,8 @@ function normalizeApplicationErrorRecovery(recovery) { throw new TypeError('Progress part length diagnostic is invalid.'); if (recovery.id === 'progress-assessment-length-invalid' && !(0, progress_assessment_length_failure_1.isProgressAssessmentLengthDiagnostic)(variables)) throw new TypeError('Progress assessment length diagnostic is invalid.'); + if (recovery.id === 'bugbot-partition-query-exhausted' && !(0, response_failure_1.isBugbotPartitionQueryDiagnostic)(variables)) + throw new TypeError('Bugbot partition query diagnostic is invalid.'); if (recovery.id === 'bugbot-review-incomplete' && !(0, framed_review_1.isBugbotReviewBlockFacts)(variables)) throw new TypeError('Bugbot review diagnostic is invalid.'); if (recovery.id === 'progress-inventory-incomplete' && !(0, progress_inventory_diagnostic_1.isProgressInventoryDiagnostic)(variables)) @@ -88777,17 +88819,43 @@ function uniqueCredentials(credentials) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.interpretFindingsResponse = interpretFindingsResponse; +const response_failure_1 = __nccwpck_require__(94286); +const agent_response_schema_failure_1 = __nccwpck_require__(70809); +const agent_response_length_failure_1 = __nccwpck_require__(28528); const agent_json_parser_1 = __nccwpck_require__(19951); const agent_response_parser_1 = __nccwpck_require__(94745); const agent_json_schema_validator_1 = __nccwpck_require__(52663); function interpretFindingsResponse(parts, options) { + const bugbotSchema = options.schemaName === 'bugbot_findings' || options.schemaName === 'bugbot_literal_candidate_verification'; const text = typeof parts === 'string' ? parts : (0, agent_response_parser_1.extractTextFromParts)(parts); - if (!text) + if (!text) { + if (options.expectJson && options.schema && bugbotSchema) + throw new response_failure_1.BugbotResponseFailure('json-invalid'); throw new Error('Empty response text'); + } if (!options.expectJson || !options.schema) return text; - const parsed = (0, agent_json_parser_1.parseStrictJsonFromAgentText)(text); - (0, agent_json_schema_validator_1.assertAgentResponseSchema)(parsed, options.schema); + let parsed; + try { + parsed = (0, agent_json_parser_1.parseStrictJsonFromAgentText)(text); + } + catch (error) { + if (bugbotSchema) + throw new response_failure_1.BugbotResponseFailure('json-invalid'); + throw error; + } + try { + (0, agent_json_schema_validator_1.assertAgentResponseSchema)(parsed, options.schema); + } + catch (error) { + if (bugbotSchema) { + if (error instanceof agent_response_length_failure_1.AgentResponseLengthFailure) + throw new response_failure_1.BugbotResponseFailure('schema-string-long'); + if (error instanceof agent_response_schema_failure_1.AgentResponseSchemaFailure) + throw new response_failure_1.BugbotResponseFailure(`schema-${error.reason}`); + } + throw error; + } if (options.includeReasoning && typeof parts !== 'string') { const reasoning = (0, agent_response_parser_1.extractReasoningFromParts)(parts); if (reasoning) @@ -99151,6 +99219,38 @@ function bugbotReviewResourceUnit(resource) { } +/***/ }), + +/***/ 94286: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BugbotResponseFailure = exports.BUGBOT_RESPONSE_FAILURE_REASONS = void 0; +exports.isBugbotPartitionQueryDiagnostic = isBugbotPartitionQueryDiagnostic; +/** Content-free reasons for a completed Bugbot response, never process or provider guesses. */ +exports.BUGBOT_RESPONSE_FAILURE_REASONS = Object.freeze(['json-invalid', 'schema-type', 'schema-enum', 'schema-string-short', + 'schema-string-long', 'schema-number-finite', 'schema-number-min', 'schema-number-max', 'schema-array-short', + 'schema-array-long', 'schema-required', 'schema-additional', 'verification-invalid']); +function isBugbotPartitionQueryDiagnostic(value) { + if (!value || typeof value !== 'object' || Array.isArray(value)) + return false; + const facts = value; + return Object.keys(facts).sort().join(',') === 'attempts,reason' && facts.attempts === 3 + && exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(reason => reason === facts.reason); +} +class BugbotResponseFailure extends Error { + constructor(reason) { + super('A completed Bugbot response did not satisfy its structured contract.'); + this.reason = reason; + if (!exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(known => known === reason)) + throw new TypeError('Bugbot response reason is invalid.'); + } +} +exports.BugbotResponseFailure = BugbotResponseFailure; + + /***/ }), /***/ 1811: diff --git a/build/deployment_recovery/index.js b/build/deployment_recovery/index.js index 9558b7e5c..cf6dc9c06 100644 --- a/build/deployment_recovery/index.js +++ b/build/deployment_recovery/index.js @@ -32597,6 +32597,11 @@ const ENGLISH_RECOVERY_CONTENT = Object.freeze({ action: 'Inspect part {partitionId}, file {filePath}, unit {unitId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. The replacement must satisfy the unchanged schema. Do not remove files, truncate facts, relax acceptance or bypass verification.', retainedState: 'Existing progress labels and assessments were preserved. No partial percentage or passing verification was published; execution and optional check-publication failures remain separate.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'A completed Bugbot partition response remained invalid after {attempts} attempts; the review was not published.', + action: 'Inspect response reason {reason} and the current run. Qualify the provider output contract before a fresh complete review. This diagnostic describes completed response validation, not an execution infrastructure failure.', + retainedState: 'Prior findings and resolutions were preserved. No partial review was published. Source freshness and complete-review gates remain required.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'An acceptance field still exceeds its unchanged response limit after one complete replacement; progress was not published.', action: 'Inspect phase assessment, requirement {requirementId}, original source {sourceLineId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. Start a fresh complete assessment when the provider can satisfy the unchanged schema. Preserve every requirement and citation; do not truncate facts, raise limits or bypass verification.', @@ -32818,6 +32823,11 @@ const SPANISH_RECOVERY_CONTENT = Object.freeze({ action: 'Inspecciona la parte {partitionId}, archivo {filePath}, unidad {unitId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. La sustitución debe cumplir el mismo esquema. No elimines archivos, recortes los hechos, relajes la aceptación ni eludas la verificación.', retainedState: 'Se conservaron las etiquetas y evaluaciones de progreso. No se publicó ningún porcentaje parcial ni verificación aprobada; los fallos de ejecución y de publicación del check opcional siguen siendo independientes.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'La respuesta completada de una partición de Bugbot siguió siendo inválida tras {attempts} intentos; no se publicó la revisión.', + action: 'Inspecciona el motivo de respuesta {reason} y la ejecución actual. Valida el contrato de salida del proveedor antes de una revisión completa nueva. Este diagnóstico describe la validación de una respuesta completada, no un fallo de infraestructura de ejecución.', + retainedState: 'Se conservaron los hallazgos y resoluciones anteriores. No se publicó una revisión parcial. Siguen siendo obligatorios los controles de fuente vigente y revisión completa.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'Un campo de aceptación sigue superando su límite de respuesta tras una sustitución completa; no se publicó el progreso.', action: 'Inspecciona la fase assessment, requisito {requirementId}, fuente original {sourceLineId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. Inicia una evaluación completa nueva cuando el proveedor pueda cumplir el mismo esquema. Conserva todos los requisitos y citas; no recortes hechos, aumentes límites ni eludas la verificación.', @@ -34039,6 +34049,7 @@ var _ApplicationError_cause; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApplicationError = exports.APPLICATION_ERROR_METADATA = exports.APPLICATION_ERROR_RECOVERY_IDS = void 0; exports.isApplicationErrorCorrelationId = isApplicationErrorCorrelationId; +const response_failure_1 = __nccwpck_require__(4286); const progress_batch_diagnostic_1 = __nccwpck_require__(9486); const branch_sync_publication_1 = __nccwpck_require__(7857); const framed_review_1 = __nccwpck_require__(3750); @@ -34103,6 +34114,7 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([ 'progress-result-contract-invalid', 'progress-partition-length-invalid', 'progress-assessment-length-invalid', + 'bugbot-partition-query-exhausted', 'progress-assessment-capacity-exceeded', 'progress-scope-clause-limit', 'progress-sdd-seed-unverified', @@ -34367,6 +34379,7 @@ const RECOVERY_VARIABLE_KEYS = Object.freeze({ 'bugbot-review-incomplete': Object.freeze(['profile', 'countKind', 'resource', 'observed', 'limit', 'unit']), 'progress-result-contract-invalid': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-partition-length-invalid': Object.freeze(['partitionId', 'filePath', 'unitId', 'field', 'maximum', 'observed']), + 'bugbot-partition-query-exhausted': Object.freeze(['reason', 'attempts']), 'progress-assessment-length-invalid': Object.freeze(['requirementId', 'sourceLineId', 'field', 'maximum', 'observed']), 'progress-assessment-capacity-exceeded': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-batch-retained': Object.freeze(['reason', 'verified', 'expected', 'batch', 'requirementId']), @@ -34480,6 +34493,8 @@ function normalizeApplicationErrorRecovery(recovery) { throw new TypeError('Progress part length diagnostic is invalid.'); if (recovery.id === 'progress-assessment-length-invalid' && !(0, progress_assessment_length_failure_1.isProgressAssessmentLengthDiagnostic)(variables)) throw new TypeError('Progress assessment length diagnostic is invalid.'); + if (recovery.id === 'bugbot-partition-query-exhausted' && !(0, response_failure_1.isBugbotPartitionQueryDiagnostic)(variables)) + throw new TypeError('Bugbot partition query diagnostic is invalid.'); if (recovery.id === 'bugbot-review-incomplete' && !(0, framed_review_1.isBugbotReviewBlockFacts)(variables)) throw new TypeError('Bugbot review diagnostic is invalid.'); if (recovery.id === 'progress-inventory-incomplete' && !(0, progress_inventory_diagnostic_1.isProgressInventoryDiagnostic)(variables)) @@ -35498,6 +35513,38 @@ function bugbotReviewResourceUnit(resource) { } +/***/ }), + +/***/ 4286: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BugbotResponseFailure = exports.BUGBOT_RESPONSE_FAILURE_REASONS = void 0; +exports.isBugbotPartitionQueryDiagnostic = isBugbotPartitionQueryDiagnostic; +/** Content-free reasons for a completed Bugbot response, never process or provider guesses. */ +exports.BUGBOT_RESPONSE_FAILURE_REASONS = Object.freeze(['json-invalid', 'schema-type', 'schema-enum', 'schema-string-short', + 'schema-string-long', 'schema-number-finite', 'schema-number-min', 'schema-number-max', 'schema-array-short', + 'schema-array-long', 'schema-required', 'schema-additional', 'verification-invalid']); +function isBugbotPartitionQueryDiagnostic(value) { + if (!value || typeof value !== 'object' || Array.isArray(value)) + return false; + const facts = value; + return Object.keys(facts).sort().join(',') === 'attempts,reason' && facts.attempts === 3 + && exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(reason => reason === facts.reason); +} +class BugbotResponseFailure extends Error { + constructor(reason) { + super('A completed Bugbot response did not satisfy its structured contract.'); + this.reason = reason; + if (!exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(known => known === reason)) + throw new TypeError('Bugbot response reason is invalid.'); + } +} +exports.BugbotResponseFailure = BugbotResponseFailure; + + /***/ }), /***/ 5304: diff --git a/build/github_action/index.js b/build/github_action/index.js index 616896f67..cc21fff7b 100644 --- a/build/github_action/index.js +++ b/build/github_action/index.js @@ -39332,6 +39332,26 @@ function bugbotMutationError(cause, stage, findingIds, fallback, affectedCount = } +/***/ }), + +/***/ 72486: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BugbotVerificationResponseFailure = void 0; +const application_error_1 = __nccwpck_require__(75999); +/** Host-validated candidate proof rejection; distinct from agent execution and capacity failures. */ +class BugbotVerificationResponseFailure extends application_error_1.ApplicationError { + constructor(message) { + super('agent.failed', message); + this.reason = 'verification-invalid'; + } +} +exports.BugbotVerificationResponseFailure = BugbotVerificationResponseFailure; + + /***/ }), /***/ 12183: @@ -41538,6 +41558,11 @@ const ENGLISH_RECOVERY_CONTENT = Object.freeze({ action: 'Inspect part {partitionId}, file {filePath}, unit {unitId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. The replacement must satisfy the unchanged schema. Do not remove files, truncate facts, relax acceptance or bypass verification.', retainedState: 'Existing progress labels and assessments were preserved. No partial percentage or passing verification was published; execution and optional check-publication failures remain separate.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'A completed Bugbot partition response remained invalid after {attempts} attempts; the review was not published.', + action: 'Inspect response reason {reason} and the current run. Qualify the provider output contract before a fresh complete review. This diagnostic describes completed response validation, not an execution infrastructure failure.', + retainedState: 'Prior findings and resolutions were preserved. No partial review was published. Source freshness and complete-review gates remain required.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'An acceptance field still exceeds its unchanged response limit after one complete replacement; progress was not published.', action: 'Inspect phase assessment, requirement {requirementId}, original source {sourceLineId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. Start a fresh complete assessment when the provider can satisfy the unchanged schema. Preserve every requirement and citation; do not truncate facts, raise limits or bypass verification.', @@ -41759,6 +41784,11 @@ const SPANISH_RECOVERY_CONTENT = Object.freeze({ action: 'Inspecciona la parte {partitionId}, archivo {filePath}, unidad {unitId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. La sustitución debe cumplir el mismo esquema. No elimines archivos, recortes los hechos, relajes la aceptación ni eludas la verificación.', retainedState: 'Se conservaron las etiquetas y evaluaciones de progreso. No se publicó ningún porcentaje parcial ni verificación aprobada; los fallos de ejecución y de publicación del check opcional siguen siendo independientes.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'La respuesta completada de una partición de Bugbot siguió siendo inválida tras {attempts} intentos; no se publicó la revisión.', + action: 'Inspecciona el motivo de respuesta {reason} y la ejecución actual. Valida el contrato de salida del proveedor antes de una revisión completa nueva. Este diagnóstico describe la validación de una respuesta completada, no un fallo de infraestructura de ejecución.', + retainedState: 'Se conservaron los hallazgos y resoluciones anteriores. No se publicó una revisión parcial. Siguen siendo obligatorios los controles de fuente vigente y revisión completa.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'Un campo de aceptación sigue superando su límite de respuesta tras una sustitución completa; no se publicó el progreso.', action: 'Inspecciona la fase assessment, requisito {requirementId}, fuente original {sourceLineId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. Inicia una evaluación completa nueva cuando el proveedor pueda cumplir el mismo esquema. Conserva todos los requisitos y citas; no recortes hechos, aumentes límites ni eludas la verificación.', @@ -43630,6 +43660,7 @@ exports.literalVerificationId = literalVerificationId; exports.assertLiteralVerificationPrompt = assertLiteralVerificationPrompt; exports.assertLiteralVerificationResponse = assertLiteralVerificationResponse; exports.applyLiteralVerification = applyLiteralVerification; +const bugbot_verification_response_failure_1 = __nccwpck_require__(72486); const node_crypto_1 = __nccwpck_require__(6005); const application_error_1 = __nccwpck_require__(75999); exports.MAX_LITERAL_VERIFICATION_CANDIDATES = 20; @@ -43708,7 +43739,7 @@ function originalCandidates(candidates) { return originals; } function invalidVerification() { - return new application_error_1.ApplicationError('agent.failed', 'Generated-source verification is incomplete or changed candidate identity, file, anchor or proof. Recheck the exact source; no clean result was verified.'); + return new bugbot_verification_response_failure_1.BugbotVerificationResponseFailure('Generated-source verification is incomplete or changed candidate identity, file, anchor or proof. Recheck the exact source; no clean result was verified.'); } @@ -69948,6 +69979,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.queryBugbotFindings = queryBugbotFindings; exports.buildBugbotPartitionQueryRequest = buildBugbotPartitionQueryRequest; exports.queryBugbotPartitionFindings = queryBugbotPartitionFindings; +const bugbot_verification_response_failure_1 = __nccwpck_require__(72486); +const response_failure_1 = __nccwpck_require__(94286); const framed_review_1 = __nccwpck_require__(43750); const bugbot_framed_receipt_policy_1 = __nccwpck_require__(54411); const agent_task_policy_1 = __nccwpck_require__(85712); @@ -70008,6 +70041,9 @@ async function queryBugbotPartitionFindings(repository, configuration, prompt, t : validation.payload; } catch (error) { + if (attempt === MAX_PARTITION_QUERY_ATTEMPTS && (error instanceof response_failure_1.BugbotResponseFailure || error instanceof bugbot_verification_response_failure_1.BugbotVerificationResponseFailure)) { + throw new application_error_1.ApplicationError('agent.failed', 'The completed Bugbot partition responses failed completed-response validation after three attempts.', { retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: error.reason, attempts: 3 } } }); + } if (attempt === MAX_PARTITION_QUERY_ATTEMPTS || (error instanceof framed_review_1.BugbotReviewCompletenessError && error.facts.resource !== 'receipt')) throw error; (0, logging_ports_1.logInfo)(`Bugbot reviewer retrying one partition query (${attempt + 1}/${MAX_PARTITION_QUERY_ATTEMPTS}) after unusable agent output.`); @@ -70803,6 +70839,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.buildLiteralVerificationSchema = buildLiteralVerificationSchema; exports.buildLiteralVerificationPrompt = buildLiteralVerificationPrompt; exports.verifyGeneratedLiteralFindings = verifyGeneratedLiteralFindings; +const bugbot_verification_response_failure_1 = __nccwpck_require__(72486); const schema_1 = __nccwpck_require__(16808); const bugbot_literal_verification_policy_1 = __nccwpck_require__(27802); const untrusted_content_1 = __nccwpck_require__(67057); @@ -70933,7 +70970,7 @@ function record(value) { return value; } function invalidOutput() { - return new application_error_1.ApplicationError('agent.failed', 'Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); + return new bugbot_verification_response_failure_1.BugbotVerificationResponseFailure('Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); } @@ -76517,6 +76554,7 @@ var _ApplicationError_cause; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ApplicationError = exports.APPLICATION_ERROR_METADATA = exports.APPLICATION_ERROR_RECOVERY_IDS = void 0; exports.isApplicationErrorCorrelationId = isApplicationErrorCorrelationId; +const response_failure_1 = __nccwpck_require__(94286); const progress_batch_diagnostic_1 = __nccwpck_require__(49486); const branch_sync_publication_1 = __nccwpck_require__(67857); const framed_review_1 = __nccwpck_require__(43750); @@ -76581,6 +76619,7 @@ exports.APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([ 'progress-result-contract-invalid', 'progress-partition-length-invalid', 'progress-assessment-length-invalid', + 'bugbot-partition-query-exhausted', 'progress-assessment-capacity-exceeded', 'progress-scope-clause-limit', 'progress-sdd-seed-unverified', @@ -76845,6 +76884,7 @@ const RECOVERY_VARIABLE_KEYS = Object.freeze({ 'bugbot-review-incomplete': Object.freeze(['profile', 'countKind', 'resource', 'observed', 'limit', 'unit']), 'progress-result-contract-invalid': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-partition-length-invalid': Object.freeze(['partitionId', 'filePath', 'unitId', 'field', 'maximum', 'observed']), + 'bugbot-partition-query-exhausted': Object.freeze(['reason', 'attempts']), 'progress-assessment-length-invalid': Object.freeze(['requirementId', 'sourceLineId', 'field', 'maximum', 'observed']), 'progress-assessment-capacity-exceeded': Object.freeze(['phase', 'reason', 'field', 'requirementId', 'sourceLineId']), 'progress-batch-retained': Object.freeze(['reason', 'verified', 'expected', 'batch', 'requirementId']), @@ -76958,6 +76998,8 @@ function normalizeApplicationErrorRecovery(recovery) { throw new TypeError('Progress part length diagnostic is invalid.'); if (recovery.id === 'progress-assessment-length-invalid' && !(0, progress_assessment_length_failure_1.isProgressAssessmentLengthDiagnostic)(variables)) throw new TypeError('Progress assessment length diagnostic is invalid.'); + if (recovery.id === 'bugbot-partition-query-exhausted' && !(0, response_failure_1.isBugbotPartitionQueryDiagnostic)(variables)) + throw new TypeError('Bugbot partition query diagnostic is invalid.'); if (recovery.id === 'bugbot-review-incomplete' && !(0, framed_review_1.isBugbotReviewBlockFacts)(variables)) throw new TypeError('Bugbot review diagnostic is invalid.'); if (recovery.id === 'progress-inventory-incomplete' && !(0, progress_inventory_diagnostic_1.isProgressInventoryDiagnostic)(variables)) @@ -79539,17 +79581,43 @@ function uniqueCredentials(credentials) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.interpretFindingsResponse = interpretFindingsResponse; +const response_failure_1 = __nccwpck_require__(94286); +const agent_response_schema_failure_1 = __nccwpck_require__(70809); +const agent_response_length_failure_1 = __nccwpck_require__(28528); const agent_json_parser_1 = __nccwpck_require__(19951); const agent_response_parser_1 = __nccwpck_require__(94745); const agent_json_schema_validator_1 = __nccwpck_require__(52663); function interpretFindingsResponse(parts, options) { + const bugbotSchema = options.schemaName === 'bugbot_findings' || options.schemaName === 'bugbot_literal_candidate_verification'; const text = typeof parts === 'string' ? parts : (0, agent_response_parser_1.extractTextFromParts)(parts); - if (!text) + if (!text) { + if (options.expectJson && options.schema && bugbotSchema) + throw new response_failure_1.BugbotResponseFailure('json-invalid'); throw new Error('Empty response text'); + } if (!options.expectJson || !options.schema) return text; - const parsed = (0, agent_json_parser_1.parseStrictJsonFromAgentText)(text); - (0, agent_json_schema_validator_1.assertAgentResponseSchema)(parsed, options.schema); + let parsed; + try { + parsed = (0, agent_json_parser_1.parseStrictJsonFromAgentText)(text); + } + catch (error) { + if (bugbotSchema) + throw new response_failure_1.BugbotResponseFailure('json-invalid'); + throw error; + } + try { + (0, agent_json_schema_validator_1.assertAgentResponseSchema)(parsed, options.schema); + } + catch (error) { + if (bugbotSchema) { + if (error instanceof agent_response_length_failure_1.AgentResponseLengthFailure) + throw new response_failure_1.BugbotResponseFailure('schema-string-long'); + if (error instanceof agent_response_schema_failure_1.AgentResponseSchemaFailure) + throw new response_failure_1.BugbotResponseFailure(`schema-${error.reason}`); + } + throw error; + } if (options.includeReasoning && typeof parts !== 'string') { const reasoning = (0, agent_response_parser_1.extractReasoningFromParts)(parts); if (reasoning) @@ -90095,6 +90163,38 @@ function bugbotReviewResourceUnit(resource) { } +/***/ }), + +/***/ 94286: +/***/ ((__unused_webpack_module, exports) => { + +"use strict"; + +Object.defineProperty(exports, "__esModule", ({ value: true })); +exports.BugbotResponseFailure = exports.BUGBOT_RESPONSE_FAILURE_REASONS = void 0; +exports.isBugbotPartitionQueryDiagnostic = isBugbotPartitionQueryDiagnostic; +/** Content-free reasons for a completed Bugbot response, never process or provider guesses. */ +exports.BUGBOT_RESPONSE_FAILURE_REASONS = Object.freeze(['json-invalid', 'schema-type', 'schema-enum', 'schema-string-short', + 'schema-string-long', 'schema-number-finite', 'schema-number-min', 'schema-number-max', 'schema-array-short', + 'schema-array-long', 'schema-required', 'schema-additional', 'verification-invalid']); +function isBugbotPartitionQueryDiagnostic(value) { + if (!value || typeof value !== 'object' || Array.isArray(value)) + return false; + const facts = value; + return Object.keys(facts).sort().join(',') === 'attempts,reason' && facts.attempts === 3 + && exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(reason => reason === facts.reason); +} +class BugbotResponseFailure extends Error { + constructor(reason) { + super('A completed Bugbot response did not satisfy its structured contract.'); + this.reason = reason; + if (!exports.BUGBOT_RESPONSE_FAILURE_REASONS.some(known => known === reason)) + throw new TypeError('Bugbot response reason is invalid.'); + } +} +exports.BugbotResponseFailure = BugbotResponseFailure; + + /***/ }), /***/ 1811: diff --git a/docs/bugbot/failure-scenarios.mdx b/docs/bugbot/failure-scenarios.mdx index e1ef2711c..a7019ca44 100644 --- a/docs/bugbot/failure-scenarios.mdx +++ b/docs/bugbot/failure-scenarios.mdx @@ -158,3 +158,21 @@ heading or custom-anchor rules. Include those facts when requesting `/copilot recheck`; a prior confidence score does not prove the path claim. Keep working links intact. A missing file or fragment remains actionable, while unavailable source context cannot establish either failure or resolution. + + +## Completed partition responses rejected + +If all three identical partition attempts return invalid JSON or a response that +violates the original schema or candidate-proof validation, Bugbot reports +`bugbot-partition-query-exhausted` with a closed `reason` and `attempts: 3`. +For example, `schema-string-long` identifies a string-bound violation without +revealing its text, field path or value. `json-invalid` identifies a completed +response that could not be parsed. This terminal attempt is non-retryable; +qualify the provider output contract before starting a fresh complete review. +Prior findings and resolutions remain intact and no partial review publishes. + +Process, provider, locale, source and framed-review failures keep their existing +diagnostics. A historical generic `agent.failed` result cannot establish which +of these boundaries failed. Inspect its retained native lifecycle observations; +a later green retry does not determine the earlier cause. See the +[closed error reference](/security-operations/operations/error-reference). diff --git a/docs/development/browser-extension.mdx b/docs/development/browser-extension.mdx index fa1f4c122..2ddba9ad3 100644 --- a/docs/development/browser-extension.mdx +++ b/docs/development/browser-extension.mdx @@ -674,7 +674,13 @@ verify frozen installation with engine checking when updating the lockfile. The native ESR CI step verifies both downloaded archives before extraction or execution. Firefox's pinned SHA-256 comes from Mozilla's release SHA256SUMS; geckodriver's comes from its official GitHub release asset digest. A mismatch -stops the step. Update version, URL and reviewed upstream digest together. +stops the step. The Linux geckodriver download uses the public GitHub API release +asset ID `483347579`, with `Accept: application/octet-stream`, for the same pinned +v0.37.1 archive. The named release route returned repeated HTTP 504 in run +42469201584; the API route returned bytes matching the existing reviewed digest. +Each attempt has a 10-second connection and 60-second transfer limit, with at +most two retries. No credential or alternate binary is used. Update version, +asset ID, URL and reviewed upstream digest together. The native harness clicks the same settings button as a user, then follows exactly diff --git a/docs/security-operations/operations/error-reference.mdx b/docs/security-operations/operations/error-reference.mdx index df77b46be..521ac893b 100644 --- a/docs/security-operations/operations/error-reference.mdx +++ b/docs/security-operations/operations/error-reference.mdx @@ -417,3 +417,35 @@ rate-limit evidence or a 429 uses `provider.rate-limited`; recognized transport, For 404, check access and target; private-resource absence cannot be inferred. Raw assignment-provider exceptions are discarded after their safe classification. See [assignment recovery](/issues/assignees-and-projects#recover-an-assignment-failure). + + +## Bugbot completed-response exhaustion + +`bugbot-partition-query-exhausted` means that completed Bugbot output still failed +strict JSON, the original schema or candidate-proof validation on the third partition attempt. It carries +only a closed `reason` and the fixed `attempts: 3`, and marks that exhausted +attempt non-retryable. The reason describes response validation; process, +provider, locale and source failures retain independent diagnostics. Historical +generic `agent.failed` results cannot be retrospectively classified. + +{/* bugbot-partition-query-example */} + +```json +{ + "code": "agent.failed", + "retryable": false, + "recovery": { + "id": "bugbot-partition-query-exhausted", + "variables": { "reason": "schema-string-long", "attempts": 3 } + } +} +``` + +The allowed reasons are `json-invalid`, `schema-type`, `schema-enum`, +`schema-string-short`, `schema-string-long`, `schema-number-finite`, +`schema-number-min`, `schema-number-max`, `schema-array-short`, +`schema-array-long`, `schema-required`, `schema-additional` and `verification-invalid`. The last reason identifies rejected candidate proof; detection and verification share the original partition allowance. No rejected +response, arbitrary key, path, provider stderr or value is retained. Qualify the +provider's output contract before one fresh complete review. Prior findings and +resolutions are preserved; all original complete-review and freshness gates +still apply. See [Bugbot failures](/bugbot/failure-scenarios). diff --git a/scripts/coverage-budgets.json b/scripts/coverage-budgets.json index 925e79f2b..a44e9506b 100644 --- a/scripts/coverage-budgets.json +++ b/scripts/coverage-budgets.json @@ -1528,6 +1528,21 @@ } ], "successMessage": "SDD ownership question assessment: PASS (100% lines/statements/functions/branches)" + }, + { + "name": "Bugbot partition response diagnostics", + "missingEntryLabel": "Bugbot partition response diagnostics", + "rules": [ + { + "files": [ + "src/domain/bugbot/response_failure.ts", + "src/application/errors/bugbot_verification_response_failure.ts" + ], + "mode": "each", + "thresholdProfile": "exhaustive" + } + ], + "successMessage": "Bugbot partition response diagnostics: PASS (pure closed facts and typed semantic rejection100% all metrics)" } ] } diff --git a/specs/CATALOG.md b/specs/CATALOG.md index 6b17174f4..ed271db09 100644 --- a/specs/CATALOG.md +++ b/specs/CATALOG.md @@ -23,7 +23,7 @@ debt or convert unknown historic intent into a design decision. | `issue-start-and-sdd-readiness` | Implemented | Start every admitted issue with one explicit signal and publish a validated SDD before eligible Action-managed branch work; inspect verified SDD status and bounded structural publication comparisons and preserve complete navigable catalog links for accepted repository filenames and safely publish generated catalogs without following destination links; bootstrap truthful proposed SDK capabilities before implementation without changing readiness; reject incomplete specification discovery explicitly without following unregistered symbolic links; report confirmed missing trusted catalogs with immutable source provenance and prerequisite recovery before model or publication; bind pre-branch analysis and drafting to a verified independent read-only view of the selected immutable source without changing the canonical checkout; distinguish visible protocol notation from repository citations, allow only constructive proposed-file directory ancestry and expose bounded private-safe origin diagnostics; distinguish registered-document updates from new companion and independent capability publication, carrying fresh authorized unpublished ownership context across clarification without changing published ownership fences; ground verification guidance in selected project declarations, preserve exact evidence and independent refinements, and render portable catalog instructions without assuming consumer package scripts; preserve admitted explicit case identities and derive declared-target navigation before unchanged native validation; assemble bounded SDD units, validate optional maintainer drafts, and bind companion recovery to immutable ownership and publication evidence | [Uniform issue start and pre-branch SDD readiness](./issue-start-and-branch-readiness.md) + 9 companion | 195 paths · 2026-11-05 | | `managed-issue-lifecycle` | As-built baseline | Convert typed issues into traceable work branches, project state, and lifecycle state | [Managed issue and branch lifecycle](./managed-issue-and-branch-lifecycle.md) + 2 companion | 109 paths · 2026-11-06 | | `comment-automation` | Implemented | Admit only explicit commands or exact mentions, then route them while protecting repository mutations | [Comment automation and authorization](./comment-automation-and-authorization.md) | 88 paths · 2026-10-26 | -| `bugbot-analysis-and-autofix` | Implemented | Select one canonical PR, exhaustively analyze bounded diff partitions with version-grounded dependency, policy-to-request transformation and source-bound assertion and generated-source coordinates with independent candidate verification, configuration-selected initial-session credential ownership, delegated test-path and external Action input-contract, host-aware self-repository references and Kotlin/Wasm lexical-binding and renderer-grounded Markdown path evidence, publish stable findings atomically, and apply authorized verified fixes with regression coverage for cwd/pattern-grounded indirect unittest discovery and source-bound module execution evidence, with active-instance Kotlin Json nullable-input policy grounding; verify complete large diffs through a source-bound closed framed profile with immutable local Git proof, live-base freshness and atomic global publication; ground Python exception syntax in declared interpreter versions and PEP 758 while preserving older-target and independent runtime defects; ground filesystem recovery findings in retention/no-overwrite, ownership and publication contracts while preserving required disposable cleanup and data-loss defects; independently adjudicate candidates for supplied Python source, retaining existing bounded source, identity and history controls; trace concrete helper defaults/overrides, database-file parent containment and stored query values before judging assertions, preserving exact fragment coordinates and genuine assertion failures; co-deliver complete long discussion to every source-bound partition within closed native prompt and invocation traffic limits, preserving provenance and truthful provider partial coverage; verify actual resource content, source binding, human authority and intended entry availability before reporting an authentication defect; ground asynchronous findings in complete statements, actual receiver/cycle/caller and reached lifecycle effects, preserving genuine unfinished updates and omitting disproved claims JSON boundary evidence follows producer/decoder/transform/reader values and Python identity-cast semantics; paired source-bound controls preserve actual serialization failures without consumer-specific suppression. | [Bugbot analysis, finding publication, and autofix](./bugbot-analysis-publication-and-autofix.md) + 10 companion | 220 paths · 2026-11-05 | +| `bugbot-analysis-and-autofix` | Implemented | Select one canonical PR, exhaustively analyze bounded diff partitions with version-grounded dependency, policy-to-request transformation and source-bound assertion and generated-source coordinates with independent candidate verification, configuration-selected initial-session credential ownership, delegated test-path and external Action input-contract, host-aware self-repository references and Kotlin/Wasm lexical-binding and renderer-grounded Markdown path evidence, publish stable findings atomically, and apply authorized verified fixes with regression coverage for cwd/pattern-grounded indirect unittest discovery and source-bound module execution evidence, with active-instance Kotlin Json nullable-input policy grounding; verify complete large diffs through a source-bound closed framed profile with immutable local Git proof, live-base freshness and atomic global publication; ground Python exception syntax in declared interpreter versions and PEP 758 while preserving older-target and independent runtime defects; ground filesystem recovery findings in retention/no-overwrite, ownership and publication contracts while preserving required disposable cleanup and data-loss defects; independently adjudicate candidates for supplied Python source, retaining existing bounded source, identity and history controls; trace concrete helper defaults/overrides, database-file parent containment and stored query values before judging assertions, preserving exact fragment coordinates and genuine assertion failures; co-deliver complete long discussion to every source-bound partition within closed native prompt and invocation traffic limits, preserving provenance and truthful provider partial coverage; verify actual resource content, source binding, human authority and intended entry availability before reporting an authentication defect; ground asynchronous findings in complete statements, actual receiver/cycle/caller and reached lifecycle effects, preserving genuine unfinished updates and omitting disproved claims JSON boundary evidence follows producer/decoder/transform/reader values and Python identity-cast semantics; paired source-bound controls preserve actual serialization failures without consumer-specific suppression. Native completed JSON/schema and host candidate-proof failures retain content-free closed reasons through the original three-attempt partition bound; provider/process and historical unknown failures remain distinct. | [Bugbot analysis, finding publication, and autofix](./bugbot-analysis-publication-and-autofix.md) + 10 companion | 226 paths · 2026-11-08 | | `branch-synchronization` | Implemented | Observe parent drift with one localized status card and transition-only notifications, then safely merge a parent branch into a linked working branch | [Branch synchronization and conflict recovery](./branch-synchronization-and-conflict-recovery.md) + 3 companion | 159 paths · 2026-11-03 | | `pull-request-lifecycle` | Implemented | Enrich linked and unlinked pull requests with safe issue linkage, metadata, concise descriptions preserving validated closing intent, and distinct workflow evidence | [Pull request lifecycle and enrichment](./pull-request-lifecycle-and-enrichment.md) | 98 paths · 2026-10-30 | | `agent-runtime` | Implemented | Resolve, provision, authenticate, authorize, and execute only the agent roles reachable by a run, with provider-compatible native schemas and exact local acceptance | [Agent runtime, provider, model, and role routing](./agent-runtime-provider-and-model-routing.md) + 1 companion | 116 paths · 2026-11-07 | @@ -31,7 +31,7 @@ debt or convert unknown historic intent into a design decision. | `configurable-issue-workflows` | Implemented | Select canonical issue workflows and explicit consumer field mappings; preserve forms, compare setup/doctor schemas, and report actionable fail-closed admission without state writes | [Configurable issue workflows and fail-closed admission](./configurable-issue-workflows-and-admission.md) | 119 paths · 2026-10-27 | | `repository-agent-collaboration` | Implemented | Generate safe repository-local profiles, guidance, and a skill for agents contributing through configured issues, Action-managed branches, pull requests, and deployment boundaries | [Repository agent collaboration contract](./repository-agent-collaboration-contract.md) | 47 paths · 2026-10-17 | | `guarded-pull-request-approval` | Proposed | Provide revision-bound native bot approvals using validated explicit issue references, evidence gates, safe setup defaults and explainable recovery | [Guarded pull-request approval and setup readiness](./guarded-pull-request-approval.md) + 2 companion | 98 paths · 2026-10-30 | -| `github-browser-extension` | Proposed | Complete proposed desktop product: 150 required functions, local center, Action integration, shared setup and 803 product cases. H1 establishes builds; H2 implements shared runtime/session/settings/GET services and exact native-browser harnesses. Full product/core acceptance and signed delivery remain separate gates. | [Complete GitHub productivity extension and integrated Copilot setup](./github-browser-extension.md) + 13 companion | 932 paths · 2026-10-31 | +| `github-browser-extension` | Proposed | Complete proposed desktop product: 150 required functions, local center, Action integration, shared setup and 803 product cases. H1 establishes builds; H2 implements shared runtime/session/settings/GET services and exact native-browser harnesses. Full product/core acceptance and signed delivery remain separate gates. | [Complete GitHub productivity extension and integrated Copilot setup](./github-browser-extension.md) + 13 companion | 932 paths · 2026-11-08 | ## Evidence map @@ -181,12 +181,12 @@ debt or convert unknown historic intent into a design decision. ### `bugbot-analysis-and-autofix` — Bugbot analysis, finding publication, and autofix - Owner: Copilot maintainers -- Last verified: 2026-11-05 +- Last verified: 2026-11-08 - Specifications: [`specs/bugbot-analysis-publication-and-autofix.md`](./bugbot-analysis-publication-and-autofix.md) · [`specs/bugbot-context-selection-and-budgeting.md`](./bugbot-context-selection-and-budgeting.md) · [`specs/bugbot-exhaustive-partitioned-analysis.md`](./bugbot-exhaustive-partitioned-analysis.md) · [`specs/bugbot-lossless-conversation-context.md`](./bugbot-lossless-conversation-context.md) · [`specs/bugbot-source-bound-framed-review.md`](./bugbot-source-bound-framed-review.md) · [`specs/bugbot-recovery-contract-grounding.md`](./bugbot-recovery-contract-grounding.md) · [`specs/bugbot-fixture-value-grounding.md`](./bugbot-fixture-value-grounding.md) · [`specs/bugbot-complete-conversation-review.md`](./bugbot-complete-conversation-review.md) · [`specs/bugbot-resource-authority-evidence.md`](./bugbot-resource-authority-evidence.md) · [`specs/bugbot-async-statement-evidence.md`](./bugbot-async-statement-evidence.md) · [`specs/bugbot-json-value-grounding.md`](./bugbot-json-value-grounding.md) - Workflows: [`.github/workflows/copilot_commit.yml`](../.github/workflows/copilot_commit.yml) · [`.github/workflows/copilot_pull_request.yml`](../.github/workflows/copilot_pull_request.yml) · [`.github/workflows/copilot_pull_request_comment.yml`](../.github/workflows/copilot_pull_request_comment.yml) - Entrypoints: [`src/application/usecases/steps/commit/detect_potential_problems_use_case.ts`](../src/application/usecases/steps/commit/detect_potential_problems_use_case.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_autofix_use_case.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_autofix_use_case.ts) -- Core code: [`src/application/ports/bugbot_context_ports.ts`](../src/application/ports/bugbot_context_ports.ts) · [`src/data/repository/pull_request/pull_request_changes_repository.ts`](../src/data/repository/pull_request/pull_request_changes_repository.ts) · [`src/domain/bugbot/context.ts`](../src/domain/bugbot/context.ts) · [`src/domain/bugbot/finding.ts`](../src/domain/bugbot/finding.ts) · [`src/domain/bugbot/finding_identity.ts`](../src/domain/bugbot/finding_identity.ts) · [`src/domain/bugbot/review_configuration.ts`](../src/domain/bugbot/review_configuration.ts) · [`src/application/policies/bounded_concurrency_policy.ts`](../src/application/policies/bounded_concurrency_policy.ts) · [`src/application/policies/bugbot_resolution_eligibility_policy.ts`](../src/application/policies/bugbot_resolution_eligibility_policy.ts) · [`src/application/policies/bugbot_result_finding_state_projection_policy.ts`](../src/application/policies/bugbot_result_finding_state_projection_policy.ts) · [`src/application/policies/bugbot_telemetry_projection_policy.ts`](../src/application/policies/bugbot_telemetry_projection_policy.ts) · [`src/application/policies/bugbot_diff_partition_policy.ts`](../src/application/policies/bugbot_diff_partition_policy.ts) · [`src/application/policies/bugbot_conversation_packing_policy.ts`](../src/application/policies/bugbot_conversation_packing_policy.ts) · [`src/application/policies/bugbot_partition_completion_policy.ts`](../src/application/policies/bugbot_partition_completion_policy.ts) · [`src/application/policies/action_summary_policy.ts`](../src/application/policies/action_summary_policy.ts) · [`src/application/policies/copilot_evidence_policy.ts`](../src/application/policies/copilot_evidence_policy.ts) · [`src/application/ports/bugbot_git_ports.ts`](../src/application/ports/bugbot_git_ports.ts) · [`src/application/ports/bugbot_reconciliation_ports.ts`](../src/application/ports/bugbot_reconciliation_ports.ts) · [`src/application/ports/bugbot_scm_ports.ts`](../src/application/ports/bugbot_scm_ports.ts) · [`src/application/usecases/steps/commit/bugbot/schema.ts`](../src/application/usecases/steps/commit/bugbot/schema.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_review_operation_context.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_review_operation_context.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_context_request.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_context_request.ts) · [`src/application/usecases/steps/commit/bugbot/prepare_bugbot_findings_policy.ts`](../src/application/usecases/steps/commit/bugbot/prepare_bugbot_findings_policy.ts) · [`src/application/usecases/steps/commit/bugbot/analyze_bugbot_revision_use_case.ts`](../src/application/usecases/steps/commit/bugbot/analyze_bugbot_revision_use_case.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_partition_aggregation.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_partition_aggregation.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_review_context.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_review_context.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_review_telemetry.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_review_telemetry.ts) · [`src/application/usecases/steps/commit/bugbot/build_bugbot_prompt.ts`](../src/application/usecases/steps/commit/bugbot/build_bugbot_prompt.ts) · [`src/application/usecases/steps/commit/bugbot/load_bugbot_context_use_case.ts`](../src/application/usecases/steps/commit/bugbot/load_bugbot_context_use_case.ts) · [`src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts`](../src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts) · [`src/prompts/bugbot.ts`](../src/prompts/bugbot.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_previous_findings_context.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_previous_findings_context.ts) · [`src/application/usecases/steps/commit/bugbot/publish_findings_use_case.ts`](../src/application/usecases/steps/commit/bugbot/publish_findings_use_case.ts) · [`src/application/usecases/steps/commit/workspace_mutation_guard.ts`](../src/application/usecases/steps/commit/workspace_mutation_guard.ts) · [`src/data/repository/issue/bugbot_issue_comment_query_repository.ts`](../src/data/repository/issue/bugbot_issue_comment_query_repository.ts) · [`src/infrastructure/bound_bugbot_git_mutation_adapter.ts`](../src/infrastructure/bound_bugbot_git_mutation_adapter.ts) · [`src/infrastructure/composition/bugbot_scm_port_factory.ts`](../src/infrastructure/composition/bugbot_scm_port_factory.ts) · [`src/infrastructure/composition/bugbot_composition_root.ts`](../src/infrastructure/composition/bugbot_composition_root.ts) · [`scripts/coverage-budgets.json`](../scripts/coverage-budgets.json) · [`scripts/validate-coverage-budgets.cjs`](../scripts/validate-coverage-budgets.cjs) · [`src/application/usecases/comment_automation_action_workflow.ts`](../src/application/usecases/comment_automation_action_workflow.ts) · [`src/data/repository/pull_request/pull_request_lifecycle_repository.ts`](../src/data/repository/pull_request/pull_request_lifecycle_repository.ts) · [`src/application/usecases/comment_automation_command_workflow.ts`](../src/application/usecases/comment_automation_command_workflow.ts) · [`src/domain/copilot_command.ts`](../src/domain/copilot_command.ts) · [`src/application/usecases/comment_automation_contracts.ts`](../src/application/usecases/comment_automation_contracts.ts) · [`src/application/usecases/issue_comment_use_case.ts`](../src/application/usecases/issue_comment_use_case.ts) · [`src/application/usecases/pull_request_review_comment_use_case.ts`](../src/application/usecases/pull_request_review_comment_use_case.ts) · [`src/infrastructure/composition/main_run_route_composition_root.ts`](../src/infrastructure/composition/main_run_route_composition_root.ts) · [`src/infrastructure/github/ports/github_pull_request_provider_ports.ts`](../src/infrastructure/github/ports/github_pull_request_provider_ports.ts) · [`src/application/usecases/steps/commit/bugbot/dismiss_bugbot_findings_use_case.ts`](../src/application/usecases/steps/commit/bugbot/dismiss_bugbot_findings_use_case.ts) · [`src/application/policies/semantic_result_publication_policy.ts`](../src/application/policies/semantic_result_publication_policy.ts) · [`src/application/policies/publication_message_catalog.ts`](../src/application/policies/publication_message_catalog.ts) · [`src/application/usecases/steps/commit/bugbot/detect_bugbot_fix_intent_workflow.ts`](../src/application/usecases/steps/commit/bugbot/detect_bugbot_fix_intent_workflow.ts) · [`src/application/usecases/comment_automation_use_case.ts`](../src/application/usecases/comment_automation_use_case.ts) · [`src/infrastructure/filesystem/workspace_bugbot_rules_repository.ts`](../src/infrastructure/filesystem/workspace_bugbot_rules_repository.ts) · [`src/application/usecases/steps/commit/git_branch_checkout.ts`](../src/application/usecases/steps/commit/git_branch_checkout.ts) · [`src/application/usecases/steps/commit/bugbot/commit_and_push_preflight.ts`](../src/application/usecases/steps/commit/bugbot/commit_and_push_preflight.ts) · [`src/application/usecases/steps/commit/bugbot/commit_and_push_workflow.ts`](../src/application/usecases/steps/commit/bugbot/commit_and_push_workflow.ts) · [`quality/bugbot/corpus.v1.json`](../quality/bugbot/corpus.v1.json) · [`quality/bugbot/reference-predictions.v1.json`](../quality/bugbot/reference-predictions.v1.json) · [`src/tooling/bugbot_benchmark_runner.ts`](../src/tooling/bugbot_benchmark_runner.ts) · [`quality/bugbot/compose-720-observations.v1.json`](../quality/bugbot/compose-720-observations.v1.json) · [`quality/bugbot/evidence/issue-722.json`](../quality/bugbot/evidence/issue-722.json) · [`quality/bugbot/evidence/issue-736.json`](../quality/bugbot/evidence/issue-736.json) · [`quality/bugbot/evidence/issue-738.json`](../quality/bugbot/evidence/issue-738.json) · [`quality/bugbot/evidence/issue-739.json`](../quality/bugbot/evidence/issue-739.json) · [`quality/bugbot/evidence/issue-749.json`](../quality/bugbot/evidence/issue-749.json) · [`quality/bugbot/evidence/issue-770.json`](../quality/bugbot/evidence/issue-770.json) · [`src/application/policies/bugbot_python_literal_witness_policy.ts`](../src/application/policies/bugbot_python_literal_witness_policy.ts) · [`src/application/policies/bugbot_literal_verification_policy.ts`](../src/application/policies/bugbot_literal_verification_policy.ts) · [`src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts`](../src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts) · [`src/application/policies/agent_output_locale_policy.ts`](../src/application/policies/agent_output_locale_policy.ts) · [`src/domain/bugbot/framed_review.ts`](../src/domain/bugbot/framed_review.ts) · [`src/application/policies/bugbot_framed_identity_policy.ts`](../src/application/policies/bugbot_framed_identity_policy.ts) · [`src/application/policies/bugbot_framed_receipt_policy.ts`](../src/application/policies/bugbot_framed_receipt_policy.ts) · [`src/application/policies/bugbot_framed_snapshot_policy.ts`](../src/application/policies/bugbot_framed_snapshot_policy.ts) · [`src/application/policies/bugbot_framed_review_policy.ts`](../src/application/policies/bugbot_framed_review_policy.ts) · [`src/application/policies/bugbot_patch_binding_policy.ts`](../src/application/policies/bugbot_patch_binding_policy.ts) · [`src/application/policies/bugbot_review_diagnostic_labels.ts`](../src/application/policies/bugbot_review_diagnostic_labels.ts) · [`src/application/ports/bugbot_review_source_ports.ts`](../src/application/ports/bugbot_review_source_ports.ts) · [`src/application/ports/bugbot_telemetry_ports.ts`](../src/application/ports/bugbot_telemetry_ports.ts) · [`src/infrastructure/filesystem/bugbot_git_review_source_adapter.ts`](../src/infrastructure/filesystem/bugbot_git_review_source_adapter.ts) · [`src/application/usecases/steps/commit/bugbot/analyze_bugbot_frames.ts`](../src/application/usecases/steps/commit/bugbot/analyze_bugbot_frames.ts) · [`src/application/policies/bugbot_framed_prompt_policy.ts`](../src/application/policies/bugbot_framed_prompt_policy.ts) · [`quality/bugbot/evidence/issue-831.json`](../quality/bugbot/evidence/issue-831.json) · [`quality/bugbot/evidence/issue-832.json`](../quality/bugbot/evidence/issue-832.json) · [`quality/bugbot/evidence/issue-834.json`](../quality/bugbot/evidence/issue-834.json) · [`src/application/policies/bugbot_complete_conversation_policy.ts`](../src/application/policies/bugbot_complete_conversation_policy.ts) · [`src/prompts/fill.ts`](../src/prompts/fill.ts) · [`quality/bugbot/evidence/issue-843.json`](../quality/bugbot/evidence/issue-843.json) · [`src/prompts/bugbot_resource_authority.ts`](../src/prompts/bugbot_resource_authority.ts) · [`quality/bugbot/resource-authority-corpus.v1.json`](../quality/bugbot/resource-authority-corpus.v1.json) · [`quality/bugbot/evidence/issue-847.json`](../quality/bugbot/evidence/issue-847.json) · [`.gitattributes`](../.gitattributes) · [`src/prompts/bugbot_async_statement_evidence.ts`](../src/prompts/bugbot_async_statement_evidence.ts) · [`quality/bugbot/async-statement-corpus.v1.json`](../quality/bugbot/async-statement-corpus.v1.json) · [`quality/bugbot/evidence/issue-848.json`](../quality/bugbot/evidence/issue-848.json) · [`eslint.config.mjs`](../eslint.config.mjs) · [`src/prompts/bugbot_json_value_evidence.ts`](../src/prompts/bugbot_json_value_evidence.ts) · [`quality/bugbot/json-value-corpus.v1.json`](../quality/bugbot/json-value-corpus.v1.json) · [`quality/bugbot/evidence/issue-855.json`](../quality/bugbot/evidence/issue-855.json) -- Tests: [`src/data/repository/__tests__/pull_request_changes_repository.test.ts`](../src/data/repository/__tests__/pull_request_changes_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/bugbot_review_lifecycle.e2e.test.ts`](../src/application/usecases/steps/commit/__tests__/bugbot_review_lifecycle.e2e.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_operation_context.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_operation_context.test.ts) · [`src/application/policies/__tests__/bugbot_partition_completion_policy.test.ts`](../src/application/policies/__tests__/bugbot_partition_completion_policy.test.ts) · [`src/application/policies/__tests__/bugbot_conversation_packing_policy.test.ts`](../src/application/policies/__tests__/bugbot_conversation_packing_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_revision_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_revision_use_case.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_aggregation.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_aggregation.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_context_request.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_context_request.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/load_bugbot_context_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/load_bugbot_context_use_case.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/schema.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/schema.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/prepare_bugbot_findings.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/prepare_bugbot_findings.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_context.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_context.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts) · [`src/domain/bugbot/__tests__/context.test.ts`](../src/domain/bugbot/__tests__/context.test.ts) · [`src/data/repository/issue/__tests__/bugbot_issue_comment_query_repository.test.ts`](../src/data/repository/issue/__tests__/bugbot_issue_comment_query_repository.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/publish_findings_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/publish_findings_use_case.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_autofix_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_autofix_use_case.test.ts) · [`src/application/ports/__tests__/bugbot_port_boundaries.test.ts`](../src/application/ports/__tests__/bugbot_port_boundaries.test.ts) · [`src/infrastructure/composition/__tests__/bugbot_scm_port_factory.test.ts`](../src/infrastructure/composition/__tests__/bugbot_scm_port_factory.test.ts) · [`src/__tests__/api.test.ts`](../src/__tests__/api.test.ts) · [`src/domain/bugbot/__tests__/finding_identity.test.ts`](../src/domain/bugbot/__tests__/finding_identity.test.ts) · [`src/application/policies/__tests__/bugbot_result_finding_state_projection_policy.test.ts`](../src/application/policies/__tests__/bugbot_result_finding_state_projection_policy.test.ts) · [`src/application/policies/__tests__/bugbot_telemetry_projection_policy.test.ts`](../src/application/policies/__tests__/bugbot_telemetry_projection_policy.test.ts) · [`src/application/policies/__tests__/action_summary_policy.test.ts`](../src/application/policies/__tests__/action_summary_policy.test.ts) · [`src/application/policies/__tests__/copilot_evidence_policy.test.ts`](../src/application/policies/__tests__/copilot_evidence_policy.test.ts) · [`src/actions/__tests__/github_action_completion.test.ts`](../src/actions/__tests__/github_action_completion.test.ts) · [`src/tooling/__tests__/validate_workflow_contract.test.ts`](../src/tooling/__tests__/validate_workflow_contract.test.ts) · [`src/application/usecases/__tests__/comment_automation_action_workflow.test.ts`](../src/application/usecases/__tests__/comment_automation_action_workflow.test.ts) · [`src/data/repository/__tests__/pull_request_lifecycle_repository.test.ts`](../src/data/repository/__tests__/pull_request_lifecycle_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/detect_potential_problems_use_case.test.ts`](../src/application/usecases/steps/commit/__tests__/detect_potential_problems_use_case.test.ts) · [`src/application/usecases/__tests__/comment_automation_use_case.test.ts`](../src/application/usecases/__tests__/comment_automation_use_case.test.ts) · [`src/domain/__tests__/copilot_command.test.ts`](../src/domain/__tests__/copilot_command.test.ts) · [`src/infrastructure/composition/__tests__/main_run_route_composition_root.test.ts`](../src/infrastructure/composition/__tests__/main_run_route_composition_root.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/dismiss_bugbot_findings_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/dismiss_bugbot_findings_use_case.test.ts) · [`src/application/policies/__tests__/semantic_result_publication_policy.test.ts`](../src/application/policies/__tests__/semantic_result_publication_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/detect_bugbot_fix_intent_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/detect_bugbot_fix_intent_use_case.test.ts) · [`src/infrastructure/filesystem/__tests__/workspace_bugbot_rules_repository.test.ts`](../src/infrastructure/filesystem/__tests__/workspace_bugbot_rules_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/git_branch_checkout.integration.test.ts`](../src/application/usecases/steps/commit/__tests__/git_branch_checkout.integration.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/workspace_changes.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/workspace_changes.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/commit_verification_workspace.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/commit_verification_workspace.test.ts) · [`src/application/usecases/__tests__/autofix_conversation_branch_authority.test.ts`](../src/application/usecases/__tests__/autofix_conversation_branch_authority.test.ts) · [`src/tooling/__tests__/bugbot_benchmark.test.ts`](../src/tooling/__tests__/bugbot_benchmark.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_call_path_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_call_path_oracles.ts) · [`src/tooling/__tests__/bugbot_benchmark_runner.test.ts`](../src/tooling/__tests__/bugbot_benchmark_runner.test.ts) · [`src/prompts/__tests__/bugbot.test.ts`](../src/prompts/__tests__/bugbot.test.ts) · [`src/prompts/__tests__/bugbot_framework_semantics.test.ts`](../src/prompts/__tests__/bugbot_framework_semantics.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_validation_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_validation_oracles.ts) · [`src/tooling/__tests__/fixtures/bugbot_validation_functions.ts`](../src/tooling/__tests__/fixtures/bugbot_validation_functions.ts) · [`src/tooling/__tests__/fixtures/bugbot_markdown_link_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_markdown_link_oracles.ts) · [`quality/bugbot/evidence/issue-772.json`](../quality/bugbot/evidence/issue-772.json) · [`src/tooling/__tests__/bugbot_request_transform_evidence.test.ts`](../src/tooling/__tests__/bugbot_request_transform_evidence.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_request_transform_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_request_transform_oracles.ts) · [`quality/bugbot/evidence/issue-784.json`](../quality/bugbot/evidence/issue-784.json) · [`src/tooling/__tests__/fixtures/bugbot_generated_coordinate_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_generated_coordinate_oracles.ts) · [`src/tooling/__tests__/bugbot_generated_coordinate_evidence.test.ts`](../src/tooling/__tests__/bugbot_generated_coordinate_evidence.test.ts) · [`src/application/policies/__tests__/bugbot_python_literal_witness_policy.test.ts`](../src/application/policies/__tests__/bugbot_python_literal_witness_policy.test.ts) · [`src/application/policies/__tests__/bugbot_literal_verification_policy.test.ts`](../src/application/policies/__tests__/bugbot_literal_verification_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/verify_generated_literal_findings.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/verify_generated_literal_findings.test.ts) · [`quality/bugbot/evidence/issue-796.json`](../quality/bugbot/evidence/issue-796.json) · [`src/tooling/__tests__/fixtures/bugbot_initial_session_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_initial_session_oracles.ts) · [`src/tooling/__tests__/bugbot_initial_session_evidence.test.ts`](../src/tooling/__tests__/bugbot_initial_session_evidence.test.ts) · [`quality/bugbot/evidence/issue-798.json`](../quality/bugbot/evidence/issue-798.json) · [`src/tooling/__tests__/bugbot_unittest_discovery.test.ts`](../src/tooling/__tests__/bugbot_unittest_discovery.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_unittest_discovery_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_unittest_discovery_oracles.ts) · [`quality/bugbot/evidence/issue-806.json`](../quality/bugbot/evidence/issue-806.json) · [`src/tooling/__tests__/fixtures/bugbot_unittest_discovery_probe.py`](../src/tooling/__tests__/fixtures/bugbot_unittest_discovery_probe.py) · [`src/tooling/__tests__/bugbot_kotlin_json.test.ts`](../src/tooling/__tests__/bugbot_kotlin_json.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_kotlin_json_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_kotlin_json_oracles.ts) · [`src/tooling/__tests__/fixtures/bugbot_kotlin_json_probe.kt`](../src/tooling/__tests__/fixtures/bugbot_kotlin_json_probe.kt) · [`quality/bugbot/evidence/issue-807.json`](../quality/bugbot/evidence/issue-807.json) · [`src/tooling/__tests__/bugbot_ktor_routing.test.ts`](../src/tooling/__tests__/bugbot_ktor_routing.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_ktor_routing_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_ktor_routing_oracles.ts) · [`quality/bugbot/evidence/issue-809.json`](../quality/bugbot/evidence/issue-809.json) · [`src/domain/bugbot/__tests__/framed_review.test.ts`](../src/domain/bugbot/__tests__/framed_review.test.ts) · [`src/application/policies/__tests__/bugbot_framed_review_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_review_policy.test.ts) · [`src/application/policies/__tests__/bugbot_framed_identity_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_identity_policy.test.ts) · [`src/application/policies/__tests__/bugbot_patch_binding_policy.test.ts`](../src/application/policies/__tests__/bugbot_patch_binding_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_frames.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_frames.test.ts) · [`src/infrastructure/filesystem/__tests__/bugbot_git_review_source_adapter.test.ts`](../src/infrastructure/filesystem/__tests__/bugbot_git_review_source_adapter.test.ts) · [`src/data/repository/__tests__/bugbot_source_bound_identity_repository.test.ts`](../src/data/repository/__tests__/bugbot_source_bound_identity_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/bugbot_framed_complete_review.integration.test.ts`](../src/application/usecases/steps/commit/__tests__/bugbot_framed_complete_review.integration.test.ts) · [`src/application/policies/__tests__/bugbot_framed_snapshot_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_snapshot_policy.test.ts) · [`src/application/policies/__tests__/bugbot_framed_prompt_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_prompt_policy.test.ts) · [`src/tooling/__tests__/bugbot_python_exception_syntax.test.ts`](../src/tooling/__tests__/bugbot_python_exception_syntax.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_python_exception_parse_probe.py`](../src/tooling/__tests__/fixtures/bugbot_python_exception_parse_probe.py) · [`src/tooling/__tests__/fixtures/bugbot_python_314_catch_probe.py`](../src/tooling/__tests__/fixtures/bugbot_python_314_catch_probe.py) · [`src/tooling/__tests__/bugbot_recovery_contract.test.ts`](../src/tooling/__tests__/bugbot_recovery_contract.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_recovery_contract_probe.py`](../src/tooling/__tests__/fixtures/bugbot_recovery_contract_probe.py) · [`src/tooling/__tests__/bugbot_fixture_values.test.ts`](../src/tooling/__tests__/bugbot_fixture_values.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_fixture_values_probe.py`](../src/tooling/__tests__/fixtures/bugbot_fixture_values_probe.py) · [`src/tooling/__tests__/bugbot_fixture_identity.test.ts`](../src/tooling/__tests__/bugbot_fixture_identity.test.ts) · [`src/application/policies/__tests__/bugbot_complete_conversation_policy.test.ts`](../src/application/policies/__tests__/bugbot_complete_conversation_policy.test.ts) · [`src/prompts/__tests__/bugbot_complete_conversation.test.ts`](../src/prompts/__tests__/bugbot_complete_conversation.test.ts) · [`src/application/usecases/steps/commit/__tests__/bugbot_complete_conversation.integration.test.ts`](../src/application/usecases/steps/commit/__tests__/bugbot_complete_conversation.integration.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_long_conversation_fixture.ts`](../src/tooling/__tests__/fixtures/bugbot_long_conversation_fixture.ts) · [`src/tooling/__tests__/bugbot_resource_authority.test.ts`](../src/tooling/__tests__/bugbot_resource_authority.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_resource_boundary_probe.py`](../src/tooling/__tests__/fixtures/bugbot_resource_boundary_probe.py) · [`src/tooling/__tests__/bugbot_async_statements.test.ts`](../src/tooling/__tests__/bugbot_async_statements.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_async_statement_probe.mjs`](../src/tooling/__tests__/fixtures/bugbot_async_statement_probe.mjs) · [`src/tooling/__tests__/fixtures/bugbot_async_statement_runner.mjs`](../src/tooling/__tests__/fixtures/bugbot_async_statement_runner.mjs) · [`src/tooling/__tests__/bugbot_json_values.test.ts`](../src/tooling/__tests__/bugbot_json_values.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_json_value_probe.py`](../src/tooling/__tests__/fixtures/bugbot_json_value_probe.py) · [`src/tooling/__tests__/fixtures/bugbot_json_value_runner.py`](../src/tooling/__tests__/fixtures/bugbot_json_value_runner.py) +- Core code: [`src/application/ports/bugbot_context_ports.ts`](../src/application/ports/bugbot_context_ports.ts) · [`src/data/repository/pull_request/pull_request_changes_repository.ts`](../src/data/repository/pull_request/pull_request_changes_repository.ts) · [`src/domain/bugbot/context.ts`](../src/domain/bugbot/context.ts) · [`src/domain/bugbot/finding.ts`](../src/domain/bugbot/finding.ts) · [`src/domain/bugbot/finding_identity.ts`](../src/domain/bugbot/finding_identity.ts) · [`src/domain/bugbot/review_configuration.ts`](../src/domain/bugbot/review_configuration.ts) · [`src/application/policies/bounded_concurrency_policy.ts`](../src/application/policies/bounded_concurrency_policy.ts) · [`src/application/policies/bugbot_resolution_eligibility_policy.ts`](../src/application/policies/bugbot_resolution_eligibility_policy.ts) · [`src/application/policies/bugbot_result_finding_state_projection_policy.ts`](../src/application/policies/bugbot_result_finding_state_projection_policy.ts) · [`src/application/policies/bugbot_telemetry_projection_policy.ts`](../src/application/policies/bugbot_telemetry_projection_policy.ts) · [`src/application/policies/bugbot_diff_partition_policy.ts`](../src/application/policies/bugbot_diff_partition_policy.ts) · [`src/application/policies/bugbot_conversation_packing_policy.ts`](../src/application/policies/bugbot_conversation_packing_policy.ts) · [`src/application/policies/bugbot_partition_completion_policy.ts`](../src/application/policies/bugbot_partition_completion_policy.ts) · [`src/application/policies/action_summary_policy.ts`](../src/application/policies/action_summary_policy.ts) · [`src/application/policies/copilot_evidence_policy.ts`](../src/application/policies/copilot_evidence_policy.ts) · [`src/application/ports/bugbot_git_ports.ts`](../src/application/ports/bugbot_git_ports.ts) · [`src/application/ports/bugbot_reconciliation_ports.ts`](../src/application/ports/bugbot_reconciliation_ports.ts) · [`src/application/ports/bugbot_scm_ports.ts`](../src/application/ports/bugbot_scm_ports.ts) · [`src/application/usecases/steps/commit/bugbot/schema.ts`](../src/application/usecases/steps/commit/bugbot/schema.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_review_operation_context.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_review_operation_context.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_context_request.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_context_request.ts) · [`src/application/usecases/steps/commit/bugbot/prepare_bugbot_findings_policy.ts`](../src/application/usecases/steps/commit/bugbot/prepare_bugbot_findings_policy.ts) · [`src/application/usecases/steps/commit/bugbot/analyze_bugbot_revision_use_case.ts`](../src/application/usecases/steps/commit/bugbot/analyze_bugbot_revision_use_case.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_partition_aggregation.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_partition_aggregation.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_review_context.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_review_context.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_review_telemetry.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_review_telemetry.ts) · [`src/application/usecases/steps/commit/bugbot/build_bugbot_prompt.ts`](../src/application/usecases/steps/commit/bugbot/build_bugbot_prompt.ts) · [`src/application/usecases/steps/commit/bugbot/load_bugbot_context_use_case.ts`](../src/application/usecases/steps/commit/bugbot/load_bugbot_context_use_case.ts) · [`src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts`](../src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts) · [`src/prompts/bugbot.ts`](../src/prompts/bugbot.ts) · [`src/application/usecases/steps/commit/bugbot/bugbot_previous_findings_context.ts`](../src/application/usecases/steps/commit/bugbot/bugbot_previous_findings_context.ts) · [`src/application/usecases/steps/commit/bugbot/publish_findings_use_case.ts`](../src/application/usecases/steps/commit/bugbot/publish_findings_use_case.ts) · [`src/application/usecases/steps/commit/workspace_mutation_guard.ts`](../src/application/usecases/steps/commit/workspace_mutation_guard.ts) · [`src/data/repository/issue/bugbot_issue_comment_query_repository.ts`](../src/data/repository/issue/bugbot_issue_comment_query_repository.ts) · [`src/infrastructure/bound_bugbot_git_mutation_adapter.ts`](../src/infrastructure/bound_bugbot_git_mutation_adapter.ts) · [`src/infrastructure/composition/bugbot_scm_port_factory.ts`](../src/infrastructure/composition/bugbot_scm_port_factory.ts) · [`src/infrastructure/composition/bugbot_composition_root.ts`](../src/infrastructure/composition/bugbot_composition_root.ts) · [`scripts/coverage-budgets.json`](../scripts/coverage-budgets.json) · [`scripts/validate-coverage-budgets.cjs`](../scripts/validate-coverage-budgets.cjs) · [`src/application/usecases/comment_automation_action_workflow.ts`](../src/application/usecases/comment_automation_action_workflow.ts) · [`src/data/repository/pull_request/pull_request_lifecycle_repository.ts`](../src/data/repository/pull_request/pull_request_lifecycle_repository.ts) · [`src/application/usecases/comment_automation_command_workflow.ts`](../src/application/usecases/comment_automation_command_workflow.ts) · [`src/domain/copilot_command.ts`](../src/domain/copilot_command.ts) · [`src/application/usecases/comment_automation_contracts.ts`](../src/application/usecases/comment_automation_contracts.ts) · [`src/application/usecases/issue_comment_use_case.ts`](../src/application/usecases/issue_comment_use_case.ts) · [`src/application/usecases/pull_request_review_comment_use_case.ts`](../src/application/usecases/pull_request_review_comment_use_case.ts) · [`src/infrastructure/composition/main_run_route_composition_root.ts`](../src/infrastructure/composition/main_run_route_composition_root.ts) · [`src/infrastructure/github/ports/github_pull_request_provider_ports.ts`](../src/infrastructure/github/ports/github_pull_request_provider_ports.ts) · [`src/application/usecases/steps/commit/bugbot/dismiss_bugbot_findings_use_case.ts`](../src/application/usecases/steps/commit/bugbot/dismiss_bugbot_findings_use_case.ts) · [`src/application/policies/semantic_result_publication_policy.ts`](../src/application/policies/semantic_result_publication_policy.ts) · [`src/application/policies/publication_message_catalog.ts`](../src/application/policies/publication_message_catalog.ts) · [`src/application/usecases/steps/commit/bugbot/detect_bugbot_fix_intent_workflow.ts`](../src/application/usecases/steps/commit/bugbot/detect_bugbot_fix_intent_workflow.ts) · [`src/application/usecases/comment_automation_use_case.ts`](../src/application/usecases/comment_automation_use_case.ts) · [`src/infrastructure/filesystem/workspace_bugbot_rules_repository.ts`](../src/infrastructure/filesystem/workspace_bugbot_rules_repository.ts) · [`src/application/usecases/steps/commit/git_branch_checkout.ts`](../src/application/usecases/steps/commit/git_branch_checkout.ts) · [`src/application/usecases/steps/commit/bugbot/commit_and_push_preflight.ts`](../src/application/usecases/steps/commit/bugbot/commit_and_push_preflight.ts) · [`src/application/usecases/steps/commit/bugbot/commit_and_push_workflow.ts`](../src/application/usecases/steps/commit/bugbot/commit_and_push_workflow.ts) · [`quality/bugbot/corpus.v1.json`](../quality/bugbot/corpus.v1.json) · [`quality/bugbot/reference-predictions.v1.json`](../quality/bugbot/reference-predictions.v1.json) · [`src/tooling/bugbot_benchmark_runner.ts`](../src/tooling/bugbot_benchmark_runner.ts) · [`quality/bugbot/compose-720-observations.v1.json`](../quality/bugbot/compose-720-observations.v1.json) · [`quality/bugbot/evidence/issue-722.json`](../quality/bugbot/evidence/issue-722.json) · [`quality/bugbot/evidence/issue-736.json`](../quality/bugbot/evidence/issue-736.json) · [`quality/bugbot/evidence/issue-738.json`](../quality/bugbot/evidence/issue-738.json) · [`quality/bugbot/evidence/issue-739.json`](../quality/bugbot/evidence/issue-739.json) · [`quality/bugbot/evidence/issue-749.json`](../quality/bugbot/evidence/issue-749.json) · [`quality/bugbot/evidence/issue-770.json`](../quality/bugbot/evidence/issue-770.json) · [`src/application/policies/bugbot_python_literal_witness_policy.ts`](../src/application/policies/bugbot_python_literal_witness_policy.ts) · [`src/application/policies/bugbot_literal_verification_policy.ts`](../src/application/policies/bugbot_literal_verification_policy.ts) · [`src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts`](../src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts) · [`src/application/policies/agent_output_locale_policy.ts`](../src/application/policies/agent_output_locale_policy.ts) · [`src/domain/bugbot/framed_review.ts`](../src/domain/bugbot/framed_review.ts) · [`src/application/policies/bugbot_framed_identity_policy.ts`](../src/application/policies/bugbot_framed_identity_policy.ts) · [`src/application/policies/bugbot_framed_receipt_policy.ts`](../src/application/policies/bugbot_framed_receipt_policy.ts) · [`src/application/policies/bugbot_framed_snapshot_policy.ts`](../src/application/policies/bugbot_framed_snapshot_policy.ts) · [`src/application/policies/bugbot_framed_review_policy.ts`](../src/application/policies/bugbot_framed_review_policy.ts) · [`src/application/policies/bugbot_patch_binding_policy.ts`](../src/application/policies/bugbot_patch_binding_policy.ts) · [`src/application/policies/bugbot_review_diagnostic_labels.ts`](../src/application/policies/bugbot_review_diagnostic_labels.ts) · [`src/application/ports/bugbot_review_source_ports.ts`](../src/application/ports/bugbot_review_source_ports.ts) · [`src/application/ports/bugbot_telemetry_ports.ts`](../src/application/ports/bugbot_telemetry_ports.ts) · [`src/infrastructure/filesystem/bugbot_git_review_source_adapter.ts`](../src/infrastructure/filesystem/bugbot_git_review_source_adapter.ts) · [`src/application/usecases/steps/commit/bugbot/analyze_bugbot_frames.ts`](../src/application/usecases/steps/commit/bugbot/analyze_bugbot_frames.ts) · [`src/application/policies/bugbot_framed_prompt_policy.ts`](../src/application/policies/bugbot_framed_prompt_policy.ts) · [`quality/bugbot/evidence/issue-831.json`](../quality/bugbot/evidence/issue-831.json) · [`quality/bugbot/evidence/issue-832.json`](../quality/bugbot/evidence/issue-832.json) · [`quality/bugbot/evidence/issue-834.json`](../quality/bugbot/evidence/issue-834.json) · [`src/application/policies/bugbot_complete_conversation_policy.ts`](../src/application/policies/bugbot_complete_conversation_policy.ts) · [`src/prompts/fill.ts`](../src/prompts/fill.ts) · [`quality/bugbot/evidence/issue-843.json`](../quality/bugbot/evidence/issue-843.json) · [`src/prompts/bugbot_resource_authority.ts`](../src/prompts/bugbot_resource_authority.ts) · [`quality/bugbot/resource-authority-corpus.v1.json`](../quality/bugbot/resource-authority-corpus.v1.json) · [`quality/bugbot/evidence/issue-847.json`](../quality/bugbot/evidence/issue-847.json) · [`.gitattributes`](../.gitattributes) · [`src/prompts/bugbot_async_statement_evidence.ts`](../src/prompts/bugbot_async_statement_evidence.ts) · [`quality/bugbot/async-statement-corpus.v1.json`](../quality/bugbot/async-statement-corpus.v1.json) · [`quality/bugbot/evidence/issue-848.json`](../quality/bugbot/evidence/issue-848.json) · [`eslint.config.mjs`](../eslint.config.mjs) · [`src/prompts/bugbot_json_value_evidence.ts`](../src/prompts/bugbot_json_value_evidence.ts) · [`quality/bugbot/json-value-corpus.v1.json`](../quality/bugbot/json-value-corpus.v1.json) · [`quality/bugbot/evidence/issue-855.json`](../quality/bugbot/evidence/issue-855.json) · [`src/domain/bugbot/response_failure.ts`](../src/domain/bugbot/response_failure.ts) · [`src/data/repository/agent_findings_response_policy.ts`](../src/data/repository/agent_findings_response_policy.ts) · [`src/data/model/application_error.ts`](../src/data/model/application_error.ts) · [`src/application/policies/application_error_message_catalog.ts`](../src/application/policies/application_error_message_catalog.ts) · [`src/application/errors/bugbot_verification_response_failure.ts`](../src/application/errors/bugbot_verification_response_failure.ts) +- Tests: [`src/data/repository/__tests__/pull_request_changes_repository.test.ts`](../src/data/repository/__tests__/pull_request_changes_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/bugbot_review_lifecycle.e2e.test.ts`](../src/application/usecases/steps/commit/__tests__/bugbot_review_lifecycle.e2e.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_operation_context.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_operation_context.test.ts) · [`src/application/policies/__tests__/bugbot_partition_completion_policy.test.ts`](../src/application/policies/__tests__/bugbot_partition_completion_policy.test.ts) · [`src/application/policies/__tests__/bugbot_conversation_packing_policy.test.ts`](../src/application/policies/__tests__/bugbot_conversation_packing_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_revision_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_revision_use_case.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_aggregation.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_aggregation.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_context_request.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_context_request.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/load_bugbot_context_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/load_bugbot_context_use_case.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/schema.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/schema.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/prepare_bugbot_findings.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/prepare_bugbot_findings.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_context.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_review_context.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts) · [`src/domain/bugbot/__tests__/context.test.ts`](../src/domain/bugbot/__tests__/context.test.ts) · [`src/data/repository/issue/__tests__/bugbot_issue_comment_query_repository.test.ts`](../src/data/repository/issue/__tests__/bugbot_issue_comment_query_repository.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/publish_findings_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/publish_findings_use_case.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_autofix_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_autofix_use_case.test.ts) · [`src/application/ports/__tests__/bugbot_port_boundaries.test.ts`](../src/application/ports/__tests__/bugbot_port_boundaries.test.ts) · [`src/infrastructure/composition/__tests__/bugbot_scm_port_factory.test.ts`](../src/infrastructure/composition/__tests__/bugbot_scm_port_factory.test.ts) · [`src/__tests__/api.test.ts`](../src/__tests__/api.test.ts) · [`src/domain/bugbot/__tests__/finding_identity.test.ts`](../src/domain/bugbot/__tests__/finding_identity.test.ts) · [`src/application/policies/__tests__/bugbot_result_finding_state_projection_policy.test.ts`](../src/application/policies/__tests__/bugbot_result_finding_state_projection_policy.test.ts) · [`src/application/policies/__tests__/bugbot_telemetry_projection_policy.test.ts`](../src/application/policies/__tests__/bugbot_telemetry_projection_policy.test.ts) · [`src/application/policies/__tests__/action_summary_policy.test.ts`](../src/application/policies/__tests__/action_summary_policy.test.ts) · [`src/application/policies/__tests__/copilot_evidence_policy.test.ts`](../src/application/policies/__tests__/copilot_evidence_policy.test.ts) · [`src/actions/__tests__/github_action_completion.test.ts`](../src/actions/__tests__/github_action_completion.test.ts) · [`src/tooling/__tests__/validate_workflow_contract.test.ts`](../src/tooling/__tests__/validate_workflow_contract.test.ts) · [`src/application/usecases/__tests__/comment_automation_action_workflow.test.ts`](../src/application/usecases/__tests__/comment_automation_action_workflow.test.ts) · [`src/data/repository/__tests__/pull_request_lifecycle_repository.test.ts`](../src/data/repository/__tests__/pull_request_lifecycle_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/detect_potential_problems_use_case.test.ts`](../src/application/usecases/steps/commit/__tests__/detect_potential_problems_use_case.test.ts) · [`src/application/usecases/__tests__/comment_automation_use_case.test.ts`](../src/application/usecases/__tests__/comment_automation_use_case.test.ts) · [`src/domain/__tests__/copilot_command.test.ts`](../src/domain/__tests__/copilot_command.test.ts) · [`src/infrastructure/composition/__tests__/main_run_route_composition_root.test.ts`](../src/infrastructure/composition/__tests__/main_run_route_composition_root.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/dismiss_bugbot_findings_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/dismiss_bugbot_findings_use_case.test.ts) · [`src/application/policies/__tests__/semantic_result_publication_policy.test.ts`](../src/application/policies/__tests__/semantic_result_publication_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/detect_bugbot_fix_intent_use_case.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/detect_bugbot_fix_intent_use_case.test.ts) · [`src/infrastructure/filesystem/__tests__/workspace_bugbot_rules_repository.test.ts`](../src/infrastructure/filesystem/__tests__/workspace_bugbot_rules_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/git_branch_checkout.integration.test.ts`](../src/application/usecases/steps/commit/__tests__/git_branch_checkout.integration.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/workspace_changes.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/workspace_changes.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/commit_verification_workspace.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/commit_verification_workspace.test.ts) · [`src/application/usecases/__tests__/autofix_conversation_branch_authority.test.ts`](../src/application/usecases/__tests__/autofix_conversation_branch_authority.test.ts) · [`src/tooling/__tests__/bugbot_benchmark.test.ts`](../src/tooling/__tests__/bugbot_benchmark.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_call_path_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_call_path_oracles.ts) · [`src/tooling/__tests__/bugbot_benchmark_runner.test.ts`](../src/tooling/__tests__/bugbot_benchmark_runner.test.ts) · [`src/prompts/__tests__/bugbot.test.ts`](../src/prompts/__tests__/bugbot.test.ts) · [`src/prompts/__tests__/bugbot_framework_semantics.test.ts`](../src/prompts/__tests__/bugbot_framework_semantics.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_validation_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_validation_oracles.ts) · [`src/tooling/__tests__/fixtures/bugbot_validation_functions.ts`](../src/tooling/__tests__/fixtures/bugbot_validation_functions.ts) · [`src/tooling/__tests__/fixtures/bugbot_markdown_link_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_markdown_link_oracles.ts) · [`quality/bugbot/evidence/issue-772.json`](../quality/bugbot/evidence/issue-772.json) · [`src/tooling/__tests__/bugbot_request_transform_evidence.test.ts`](../src/tooling/__tests__/bugbot_request_transform_evidence.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_request_transform_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_request_transform_oracles.ts) · [`quality/bugbot/evidence/issue-784.json`](../quality/bugbot/evidence/issue-784.json) · [`src/tooling/__tests__/fixtures/bugbot_generated_coordinate_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_generated_coordinate_oracles.ts) · [`src/tooling/__tests__/bugbot_generated_coordinate_evidence.test.ts`](../src/tooling/__tests__/bugbot_generated_coordinate_evidence.test.ts) · [`src/application/policies/__tests__/bugbot_python_literal_witness_policy.test.ts`](../src/application/policies/__tests__/bugbot_python_literal_witness_policy.test.ts) · [`src/application/policies/__tests__/bugbot_literal_verification_policy.test.ts`](../src/application/policies/__tests__/bugbot_literal_verification_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/verify_generated_literal_findings.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/verify_generated_literal_findings.test.ts) · [`quality/bugbot/evidence/issue-796.json`](../quality/bugbot/evidence/issue-796.json) · [`src/tooling/__tests__/fixtures/bugbot_initial_session_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_initial_session_oracles.ts) · [`src/tooling/__tests__/bugbot_initial_session_evidence.test.ts`](../src/tooling/__tests__/bugbot_initial_session_evidence.test.ts) · [`quality/bugbot/evidence/issue-798.json`](../quality/bugbot/evidence/issue-798.json) · [`src/tooling/__tests__/bugbot_unittest_discovery.test.ts`](../src/tooling/__tests__/bugbot_unittest_discovery.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_unittest_discovery_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_unittest_discovery_oracles.ts) · [`quality/bugbot/evidence/issue-806.json`](../quality/bugbot/evidence/issue-806.json) · [`src/tooling/__tests__/fixtures/bugbot_unittest_discovery_probe.py`](../src/tooling/__tests__/fixtures/bugbot_unittest_discovery_probe.py) · [`src/tooling/__tests__/bugbot_kotlin_json.test.ts`](../src/tooling/__tests__/bugbot_kotlin_json.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_kotlin_json_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_kotlin_json_oracles.ts) · [`src/tooling/__tests__/fixtures/bugbot_kotlin_json_probe.kt`](../src/tooling/__tests__/fixtures/bugbot_kotlin_json_probe.kt) · [`quality/bugbot/evidence/issue-807.json`](../quality/bugbot/evidence/issue-807.json) · [`src/tooling/__tests__/bugbot_ktor_routing.test.ts`](../src/tooling/__tests__/bugbot_ktor_routing.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_ktor_routing_oracles.ts`](../src/tooling/__tests__/fixtures/bugbot_ktor_routing_oracles.ts) · [`quality/bugbot/evidence/issue-809.json`](../quality/bugbot/evidence/issue-809.json) · [`src/domain/bugbot/__tests__/framed_review.test.ts`](../src/domain/bugbot/__tests__/framed_review.test.ts) · [`src/application/policies/__tests__/bugbot_framed_review_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_review_policy.test.ts) · [`src/application/policies/__tests__/bugbot_framed_identity_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_identity_policy.test.ts) · [`src/application/policies/__tests__/bugbot_patch_binding_policy.test.ts`](../src/application/policies/__tests__/bugbot_patch_binding_policy.test.ts) · [`src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_frames.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/analyze_bugbot_frames.test.ts) · [`src/infrastructure/filesystem/__tests__/bugbot_git_review_source_adapter.test.ts`](../src/infrastructure/filesystem/__tests__/bugbot_git_review_source_adapter.test.ts) · [`src/data/repository/__tests__/bugbot_source_bound_identity_repository.test.ts`](../src/data/repository/__tests__/bugbot_source_bound_identity_repository.test.ts) · [`src/application/usecases/steps/commit/__tests__/bugbot_framed_complete_review.integration.test.ts`](../src/application/usecases/steps/commit/__tests__/bugbot_framed_complete_review.integration.test.ts) · [`src/application/policies/__tests__/bugbot_framed_snapshot_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_snapshot_policy.test.ts) · [`src/application/policies/__tests__/bugbot_framed_prompt_policy.test.ts`](../src/application/policies/__tests__/bugbot_framed_prompt_policy.test.ts) · [`src/tooling/__tests__/bugbot_python_exception_syntax.test.ts`](../src/tooling/__tests__/bugbot_python_exception_syntax.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_python_exception_parse_probe.py`](../src/tooling/__tests__/fixtures/bugbot_python_exception_parse_probe.py) · [`src/tooling/__tests__/fixtures/bugbot_python_314_catch_probe.py`](../src/tooling/__tests__/fixtures/bugbot_python_314_catch_probe.py) · [`src/tooling/__tests__/bugbot_recovery_contract.test.ts`](../src/tooling/__tests__/bugbot_recovery_contract.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_recovery_contract_probe.py`](../src/tooling/__tests__/fixtures/bugbot_recovery_contract_probe.py) · [`src/tooling/__tests__/bugbot_fixture_values.test.ts`](../src/tooling/__tests__/bugbot_fixture_values.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_fixture_values_probe.py`](../src/tooling/__tests__/fixtures/bugbot_fixture_values_probe.py) · [`src/tooling/__tests__/bugbot_fixture_identity.test.ts`](../src/tooling/__tests__/bugbot_fixture_identity.test.ts) · [`src/application/policies/__tests__/bugbot_complete_conversation_policy.test.ts`](../src/application/policies/__tests__/bugbot_complete_conversation_policy.test.ts) · [`src/prompts/__tests__/bugbot_complete_conversation.test.ts`](../src/prompts/__tests__/bugbot_complete_conversation.test.ts) · [`src/application/usecases/steps/commit/__tests__/bugbot_complete_conversation.integration.test.ts`](../src/application/usecases/steps/commit/__tests__/bugbot_complete_conversation.integration.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_long_conversation_fixture.ts`](../src/tooling/__tests__/fixtures/bugbot_long_conversation_fixture.ts) · [`src/tooling/__tests__/bugbot_resource_authority.test.ts`](../src/tooling/__tests__/bugbot_resource_authority.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_resource_boundary_probe.py`](../src/tooling/__tests__/fixtures/bugbot_resource_boundary_probe.py) · [`src/tooling/__tests__/bugbot_async_statements.test.ts`](../src/tooling/__tests__/bugbot_async_statements.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_async_statement_probe.mjs`](../src/tooling/__tests__/fixtures/bugbot_async_statement_probe.mjs) · [`src/tooling/__tests__/fixtures/bugbot_async_statement_runner.mjs`](../src/tooling/__tests__/fixtures/bugbot_async_statement_runner.mjs) · [`src/tooling/__tests__/bugbot_json_values.test.ts`](../src/tooling/__tests__/bugbot_json_values.test.ts) · [`src/tooling/__tests__/fixtures/bugbot_json_value_probe.py`](../src/tooling/__tests__/fixtures/bugbot_json_value_probe.py) · [`src/tooling/__tests__/fixtures/bugbot_json_value_runner.py`](../src/tooling/__tests__/fixtures/bugbot_json_value_runner.py) · [`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts`](../src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts) - User documentation: [`docs/bugbot/how-it-works.mdx`](../docs/bugbot/how-it-works.mdx) · [`docs/bugbot/detection.mdx`](../docs/bugbot/detection.mdx) · [`docs/bugbot/finding-publication.mdx`](../docs/bugbot/finding-publication.mdx) · [`docs/bugbot/autofix.mdx`](../docs/bugbot/autofix.mdx) · [`docs/bugbot/failure-scenarios.mdx`](../docs/bugbot/failure-scenarios.mdx) · [`docs/bugbot/quality-observability.mdx`](../docs/bugbot/quality-observability.mdx) · [`docs/bugbot/permissions.mdx`](../docs/bugbot/permissions.mdx) · [`docs/bugbot/programmatic-api.mdx`](../docs/bugbot/programmatic-api.mdx) · [`docs/bugbot/configuration.mdx`](../docs/bugbot/configuration.mdx) · [`docs/pull-requests/workflow-setup.mdx`](../docs/pull-requests/workflow-setup.mdx) · [`docs/issues/comment-commands.mdx`](../docs/issues/comment-commands.mdx) · [`docs/security-operations/operations/error-reference.mdx`](../docs/security-operations/operations/error-reference.mdx) ### `branch-synchronization` — Branch synchronization and conflict recovery @@ -269,7 +269,7 @@ debt or convert unknown historic intent into a design decision. ### `github-browser-extension` — Complete GitHub productivity extension and integrated Copilot setup - Owner: Copilot maintainers -- Last verified: 2026-10-31 +- Last verified: 2026-11-08 - Specifications: [`specs/github-browser-extension.md`](./github-browser-extension.md) · [`specs/github-browser-extension-action-integration.md`](./github-browser-extension-action-integration.md) · [`specs/github-browser-extension-platforms-and-delivery.md`](./github-browser-extension-platforms-and-delivery.md) · [`specs/github-browser-extension-functional-catalog.md`](./github-browser-extension-functional-catalog.md) · [`specs/github-browser-extension-control-center-and-setup.md`](./github-browser-extension-control-center-and-setup.md) · [`specs/github-browser-extension-foundation.md`](./github-browser-extension-foundation.md) · [`specs/github-browser-extension-runtime.md`](./github-browser-extension-runtime.md) · [`specs/github-browser-extension-control-center-h3.md`](./github-browser-extension-control-center-h3.md) · [`specs/github-browser-extension-onboarding-and-support.md`](./github-browser-extension-onboarding-and-support.md) · [`specs/github-browser-extension-local-journal.md`](./github-browser-extension-local-journal.md) · [`specs/github-browser-extension-collection-consent.md`](./github-browser-extension-collection-consent.md) · [`specs/github-browser-extension-session-preferences.md`](./github-browser-extension-session-preferences.md) · [`specs/github-browser-extension-credential-roles.md`](./github-browser-extension-credential-roles.md) · [`specs/github-browser-extension-center-lifetime.md`](./github-browser-extension-center-lifetime.md) - Workflows: [`.github/workflows/ci_check.yml`](../.github/workflows/ci_check.yml) · [`.github/workflows/setup_platform_smoke.yml`](../.github/workflows/setup_platform_smoke.yml) - Entrypoints: [`src/actions/github_action.ts`](../src/actions/github_action.ts) · [`extension/src/infrastructure/content_entry.ts`](../extension/src/infrastructure/content_entry.ts) · [`extension/src/infrastructure/background_entry.ts`](../extension/src/infrastructure/background_entry.ts) · [`extension/tooling/cli.mts`](../extension/tooling/cli.mts) · [`extension/src/infrastructure/runtime_entry.ts`](../extension/src/infrastructure/runtime_entry.ts) diff --git a/specs/bugbot-exhaustive-partitioned-analysis.md b/specs/bugbot-exhaustive-partitioned-analysis.md index 1436b64ff..6bb4e65da 100644 --- a/specs/bugbot-exhaustive-partitioned-analysis.md +++ b/specs/bugbot-exhaustive-partitioned-analysis.md @@ -3,7 +3,7 @@ - Status: Implemented - Date: 2026-09-20 - Catalog capability ID: `bugbot-analysis-and-autofix` -- Last verified: 2026-09-21 on `develop` +- Last verified: 2026-11-08 (#920 native diagnostic regression; full acceptance pending; baseline remains implemented) - Owners: Copilot and Bugbot maintainers - Scope: review every reviewable canonical pull-request diff fragment through bounded, attested partitions and publish one atomic aggregate result @@ -561,17 +561,17 @@ comments remain untouched. ## 14. Testing strategy and numeric budget -This SDD owns at least **67 distinct cases**. +This SDD owns at least **82 distinct cases** (67 baseline plus the 15 explicitly identified #920 cases below). | Area | Minimum distinct cases | Behaviors/risks covered | |---|---:|---| -| Domain/pure planning | 35 | empty/single/multi-file, newline/hard split, UTF-16 surrogate-safe hard boundaries and pre-ignore rejection of isolated high/low surrogates, collision-free untrusted-data framing with verbatim delimiter-like patch text, individual and cumulative raw input ceilings before normalization, NFKC-expanded sanitized aggregate ceiling before section rendering, exact prompt and 64/65 partition boundaries, omitted/null/empty patch assignments, malformed change/object/filename/status/count/patch rejection even on ignored paths, root/nested leading-`**/` ignore parity, canonical SHA-1/SHA-256 head acceptance plus hostile/invalid head rejection before interpolation, full SHA-256 ID format plus content/head sensitivity, stable IDs, order, no character loss, hostile status/count metadata envelope | -| State/application/idempotency/races | 11 | all-complete, one failure, wrong/duplicate ID, wrong SHA, resolution ownership, stale head, replay, empty canonical zero-work, partition-local recovery after agent failure or invalid attestation, bounded exhaustion without publication | -| Agent adapter/schema contracts | 6 | required attestation, assignment-bound singleton enums, hostile wrong-identity examples in an assigned diff, same-schema retry, locale, undefined/invalid result, aggregate bounds | +| Domain/pure planning | 37 | empty/single/multi-file, newline/hard split, UTF-16 surrogate-safe hard boundaries and pre-ignore rejection of isolated high/low surrogates, collision-free untrusted-data framing with verbatim delimiter-like patch text, individual and cumulative raw input ceilings before normalization, NFKC-expanded sanitized aggregate ceiling before section rendering, exact prompt and 64/65 partition boundaries, omitted/null/empty patch assignments, malformed change/object/filename/status/count/patch rejection even on ignored paths, root/nested leading-`**/` ignore parity, canonical SHA-1/SHA-256 head acceptance plus hostile/invalid head rejection before interpolation, full SHA-256 ID format plus content/head sensitivity, stable IDs, order, no character loss, hostile status/count metadata envelope | +| State/application/idempotency/races | 15 | all-complete, one failure, wrong/duplicate ID, wrong SHA, resolution ownership, stale head, replay, empty canonical zero-work, partition-local recovery after agent failure or invalid attestation, bounded exhaustion without publication | +| Agent adapter/schema contracts | 9 | required attestation, assignment-bound singleton enums, hostile wrong-identity examples in an assigned diff, same-schema retry, locale, undefined/invalid result, aggregate bounds | | Workflow/architecture/telemetry | 5 | concurrency two, ordered collection, no mutation before complete, positive and zero-partition plan metrics | -| UI/UX/localization/sanitization | 4 | pending, failed, complete, hostile content/control characters | -| Integration/security/compatibility | 6 | 44-file regression, oversized patch, provider partial, dry-run, legacy issue-only path, ignored-only canonical no-op | -| **Total** | **67** | No double counting | +| UI/UX/localization/sanitization | 5 | pending, failed, complete, hostile content/control characters | +| Integration/security/compatibility | 11 | 44-file regression, oversized patch, provider partial, dry-run, legacy issue-only path, ignored-only canonical no-op | +| **Total** | **82** | No double counting | Planner, attestation, and aggregate pure policies require 100% enumerated branch coverage. Changed analyzer/context modules require at least 95% lines/statements @@ -768,3 +768,140 @@ source inventory, two sequential frames, live target-ref fences and exact coverage receipts supersede the ordinary over-cap remediation for eligible workloads. Ordinary planning, conversation/history limits, resolution ownership, public configuration and approval controls retain their existing contracts. + + +## 21. Completed-response diagnostics — issue #920 + +### Evidence and bounded correction + +Domus PR29 at `fbb4cfd1d8160e63a6b4d62e4ac118fb2f946a0c` failed review check +128303665175 after three attempts for partition 1, four completed partitions +out of 26 and 175 assigned files. Correlation: +`2ef76976-eaab-42e1-8c00-126602416b25`. The retained generic `agent.failed` +diagnostic does not establish whether JSON, schema, process or another boundary +failed. A later unchanged-head review passed; neither that success nor #937's +progress-length evidence identifies the historical review failure. + +The new native RED regression proves a diagnostic gap: malformed completed +Bugbot output propagates as a generic parser Error after all three attempts. +This is a controlled reproduction of missing attribution, not a reconstruction +of the unavailable historical provider output. + +| Requirement | Contract | +|---|---| +| BQD-01 | Preserve a finite native completed-response reason through partition exhaustion, including JSON rejection and the existing typed schema reasons. | +| BQD-02 | Keep the same three identical sequential attempts, source assignment, schema, concurrency slot, verification, aggregate and publication fences. | +| BQD-03 | Retain no rejected prose, key, path, provider stderr or guessed historical cause; arbitrary errors and process/provider failures retain their existing classification. | +| BQD-04 | Publish the same closed reason/attempt count through localized Check/Summary/CLI/API error surfaces and document a bounded operator action. | + +```mermaid +flowchart LR + A[Native completed response] --> B[Strict JSON and original schema] + B -->|valid| C[Existing locale and attestation gates] + B -->|invalid| D[Content-free typed reason] + D --> E[Same partition allowance, at most three calls] + E -->|exhausted| F[Closed blocked diagnostic, no review publication] +``` + +Text equivalent: JSON/schema rejection has a host-created typed reason. It +spends only the original partition allowance and can report its final reason +without carrying any rejected content into a later query. Valid results still +pass every original independent gate. + +The native response adapter recognizes only `bugbot_findings` and `bugbot_literal_candidate_verification`. +Parsing failure becomes `json-invalid`. Existing typed validator failures map to +`schema-type`, `schema-enum`, `schema-string-short`, `schema-string-long`, +`schema-number-finite`, `schema-number-min`, `schema-number-max`, +`schema-array-short`, `schema-array-long`, `schema-required` or +`schema-additional`. Host candidate-proof rejection additionally uses `verification-invalid`, through a dedicated ApplicationError subtype that preserves its existing error code and message. Known capacity failures retain their original classification. The domain carrier stores only the reviewed reason, with a +fixed message and no parsed response or raw error cause. Other task schemas +retain their existing behavior. Unknown adapter faults are never relabeled as +completed-response evidence. + +Only a genuine `BugbotResponseFailure` or `BugbotVerificationResponseFailure` on the third partition attempt produces +`agent.failed` / `bugbot-partition-query-exhausted`, with exactly +`{reason, attempts:3}` and `retryable:false`. The closed registry validates exact +keys, the reason enum and the fixed attempt count. The diagnostic uses the +terminal operation correlation. It does not retry aggregate validation, provider +reads, source freshness or publication. A later valid attempt returns normally; +only the final failed attempt supplies the terminal reason. Existing provider, +process, locale and framed completeness failures retain their own identity and +retryability. Structural lookalikes grant no attribution or recovery authority. + +No public input, capacity, timeout, credential, mutation port or persistence is +added. Review remains atomic. Existing framed and literal-verification behavior +is preserved. No model request, extra retry, prompt modification, response repair +or new UI surface is introduced. + +### Public content and operator flow + +English example: “A completed Bugbot partition response remained invalid after +3 attempts; the review was not published. Inspect response reason +schema-string-long and the current run. Qualify the provider output contract +before a fresh complete review.” Spanish uses the same technical reason and +count; regional Spanish reuses the full Spanish catalog, other unsupported +locales use the complete English catalog. Existing error layouts supply labels, +links and the same terminal correlation. Narrow and assistive readers receive +plain text with no color-only meaning. + +The retained-state copy explicitly preserves prior findings and resolutions and +requires all source/complete-review gates. The action distinguishes completed +response validation from execution infrastructure. It does not instruct an +indefinite unchanged whole-review loop. The original #920 failure remains +historically unclassified; this correction instruments future native failures. + +### Numeric test budget and reciprocal traceability + +The fifteen new declarations are distinct cases, including parameterized inputs +counted only once. They add two pure, four application, three adapter, one +presentation and five integration cases to section 14's preserved baseline. + +| Case ID | Area | Requirements | Scenario | +|---|---|---|---| +| bugbot-partition-diagnostics-C01 | Adapter | BQD-01, BQD-02, BQD-03 | Native malformed output exhausts three identical calls with a closed diagnostic and no rejected prose. | +| bugbot-partition-diagnostics-C02 | Pure | BQD-01, BQD-03 | Every typed schema violation exposes only its finite reason, never the rejected key, value or path. | +| bugbot-partition-diagnostics-C03 | Adapter | BQD-01, BQD-02 | Empty and malformed completed native response text stays distinct from execution failure. | +| bugbot-partition-diagnostics-C04 | Application | BQD-02, BQD-03 | A usable later native response discards earlier failures without changing immutable requests. | +| bugbot-partition-diagnostics-C05 | Application | BQD-01, BQD-02 | Exhaustion reports only the final attempt reason and never allocates a fourth query. | +| bugbot-partition-diagnostics-C06 | Adapter | BQD-03 | Non-Bugbot response contracts retain their existing parsing and schema exceptions. | +| bugbot-partition-diagnostics-C07 | Integration | BQD-02, BQD-03 | Native execution and provider errors retain classification, retryability and bounded attempts. | +| bugbot-partition-diagnostics-C08 | Integration | BQD-02, BQD-03 | Locale and exact legacy attestation rejection remain independent host gates. | +| bugbot-partition-diagnostics-C09 | Pure | BQD-01, BQD-03 | Only the exact closed final diagnostic can enter the public registry. | +| bugbot-partition-diagnostics-C10 | Presentation | BQD-04 | English, regional Spanish and fallback surfaces preserve reason, attempts and correlation. | +| bugbot-partition-diagnostics-C11 | Application | BQD-02, BQD-03 | Non-receipt framed completeness failures still stop immediately without retry or relabeling. | +| bugbot-partition-diagnostics-C12 | Application | BQD-03 | Arbitrary errors and structural lookalikes never become completed-output diagnostics. | +| bugbot-partition-diagnostics-C13 | Integration | BQD-01, BQD-02, BQD-03 | Native verification parsing shares the three paired-attempt allowance and closed cause. | +| bugbot-partition-diagnostics-C14 | Integration | BQD-01, BQD-02, BQD-03 | Incomplete semantic candidate proof reports verification-invalid while complete adjudication remains accepted. | +| bugbot-partition-diagnostics-C15 | Integration | BQD-01, BQD-02, BQD-03 | Known verification capacity failures never acquire a completed-output diagnostic or extra verification query. | + +| Requirement | Cases | +|---|---| +| BQD-01 | C01, C02, C03, C05, C09, C13, C14, C15 | +| BQD-02 | C01, C03, C04, C05, C07, C08, C11, C13, C14, C15 | +| BQD-03 | C01, C02, C04, C06, C07, C08, C09, C11, C12, C13, C14, C15 | +| BQD-04 | C10 | + +### Ownership, rollout and acceptance + +New code: `src/domain/bugbot/response_failure.ts` and `src/application/errors/bugbot_verification_response_failure.ts`. The existing literal verification policy/workflow now expose their known semantic rejection through the subtype; their source identity, proof and capacity rules are unchanged. Changed native mapping: +`src/data/repository/agent_findings_response_policy.ts`. Application owner: +`src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts`. The +existing closed error registry and English/Spanish catalog own normalization and +presentation. The single new test module is +`src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts`. +Catalog, communication test budget and generated index must be synchronized. + +Operator documentation updates `docs/bugbot/failure-scenarios.mdx` and +`docs/security-operations/operations/error-reference.mdx`; the documented JSON +example executes through the real registry in C10. All previous tests remain +mandatory. New pure code requires 100% statements, branches, functions and +lines; official correct-base changed coverage must have no misses or partials. +Full root/extension, type/lint, docs/workflow/spec contracts, build/package smoke, +normal hooks and current-head remote review/CI remain independent gates. + +Acceptance requires the complete native regression and controls, an exact public +JSON round trip, localized retained-state/action assertions, no new model call, +no partial publication authority and no guessed attribution for historical #920. +Rollback removes the additive carrier/mapping/recovery variant and localized +copy together; it leaves old comments, findings, provider failures and source +assignments intact. No tag, release or deployment is authorized by this SDD. diff --git a/specs/catalog.json b/specs/catalog.json index 52105330b..28d148724 100644 --- a/specs/catalog.json +++ b/specs/catalog.json @@ -2241,9 +2241,9 @@ "id": "bugbot-analysis-and-autofix", "title": "Bugbot analysis, finding publication, and autofix", "status": "implemented", - "scope": "Select one canonical PR, exhaustively analyze bounded diff partitions with version-grounded dependency, policy-to-request transformation and source-bound assertion and generated-source coordinates with independent candidate verification, configuration-selected initial-session credential ownership, delegated test-path and external Action input-contract, host-aware self-repository references and Kotlin/Wasm lexical-binding and renderer-grounded Markdown path evidence, publish stable findings atomically, and apply authorized verified fixes with regression coverage for cwd/pattern-grounded indirect unittest discovery and source-bound module execution evidence, with active-instance Kotlin Json nullable-input policy grounding; verify complete large diffs through a source-bound closed framed profile with immutable local Git proof, live-base freshness and atomic global publication; ground Python exception syntax in declared interpreter versions and PEP 758 while preserving older-target and independent runtime defects; ground filesystem recovery findings in retention/no-overwrite, ownership and publication contracts while preserving required disposable cleanup and data-loss defects; independently adjudicate candidates for supplied Python source, retaining existing bounded source, identity and history controls; trace concrete helper defaults/overrides, database-file parent containment and stored query values before judging assertions, preserving exact fragment coordinates and genuine assertion failures; co-deliver complete long discussion to every source-bound partition within closed native prompt and invocation traffic limits, preserving provenance and truthful provider partial coverage; verify actual resource content, source binding, human authority and intended entry availability before reporting an authentication defect; ground asynchronous findings in complete statements, actual receiver/cycle/caller and reached lifecycle effects, preserving genuine unfinished updates and omitting disproved claims JSON boundary evidence follows producer/decoder/transform/reader values and Python identity-cast semantics; paired source-bound controls preserve actual serialization failures without consumer-specific suppression.", + "scope": "Select one canonical PR, exhaustively analyze bounded diff partitions with version-grounded dependency, policy-to-request transformation and source-bound assertion and generated-source coordinates with independent candidate verification, configuration-selected initial-session credential ownership, delegated test-path and external Action input-contract, host-aware self-repository references and Kotlin/Wasm lexical-binding and renderer-grounded Markdown path evidence, publish stable findings atomically, and apply authorized verified fixes with regression coverage for cwd/pattern-grounded indirect unittest discovery and source-bound module execution evidence, with active-instance Kotlin Json nullable-input policy grounding; verify complete large diffs through a source-bound closed framed profile with immutable local Git proof, live-base freshness and atomic global publication; ground Python exception syntax in declared interpreter versions and PEP 758 while preserving older-target and independent runtime defects; ground filesystem recovery findings in retention/no-overwrite, ownership and publication contracts while preserving required disposable cleanup and data-loss defects; independently adjudicate candidates for supplied Python source, retaining existing bounded source, identity and history controls; trace concrete helper defaults/overrides, database-file parent containment and stored query values before judging assertions, preserving exact fragment coordinates and genuine assertion failures; co-deliver complete long discussion to every source-bound partition within closed native prompt and invocation traffic limits, preserving provenance and truthful provider partial coverage; verify actual resource content, source binding, human authority and intended entry availability before reporting an authentication defect; ground asynchronous findings in complete statements, actual receiver/cycle/caller and reached lifecycle effects, preserving genuine unfinished updates and omitting disproved claims JSON boundary evidence follows producer/decoder/transform/reader values and Python identity-cast semantics; paired source-bound controls preserve actual serialization failures without consumer-specific suppression. Native completed JSON/schema and host candidate-proof failures retain content-free closed reasons through the original three-attempt partition bound; provider/process and historical unknown failures remain distinct.", "owner": "Copilot maintainers", - "lastVerified": "2026-11-05", + "lastVerified": "2026-11-08", "specs": [ "specs/bugbot-analysis-publication-and-autofix.md", "specs/bugbot-context-selection-and-budgeting.md", @@ -2366,7 +2366,12 @@ "eslint.config.mjs", "src/prompts/bugbot_json_value_evidence.ts", "quality/bugbot/json-value-corpus.v1.json", - "quality/bugbot/evidence/issue-855.json" + "quality/bugbot/evidence/issue-855.json", + "src/domain/bugbot/response_failure.ts", + "src/data/repository/agent_findings_response_policy.ts", + "src/data/model/application_error.ts", + "src/application/policies/application_error_message_catalog.ts", + "src/application/errors/bugbot_verification_response_failure.ts" ], "tests": [ "src/data/repository/__tests__/pull_request_changes_repository.test.ts", @@ -2471,7 +2476,8 @@ "src/tooling/__tests__/fixtures/bugbot_async_statement_runner.mjs", "src/tooling/__tests__/bugbot_json_values.test.ts", "src/tooling/__tests__/fixtures/bugbot_json_value_probe.py", - "src/tooling/__tests__/fixtures/bugbot_json_value_runner.py" + "src/tooling/__tests__/fixtures/bugbot_json_value_runner.py", + "src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts" ], "documentation": [ "docs/bugbot/how-it-works.mdx", @@ -3333,7 +3339,7 @@ "status": "proposed", "scope": "Complete proposed desktop product: 150 required functions, local center, Action integration, shared setup and 803 product cases. H1 establishes builds; H2 implements shared runtime/session/settings/GET services and exact native-browser harnesses. Full product/core acceptance and signed delivery remain separate gates.", "owner": "Copilot maintainers", - "lastVerified": "2026-10-31", + "lastVerified": "2026-11-08", "specs": [ "specs/github-browser-extension.md", "specs/github-browser-extension-action-integration.md", diff --git a/specs/github-browser-extension-runtime.md b/specs/github-browser-extension-runtime.md index 838e94ef6..9eb77db30 100644 --- a/specs/github-browser-extension-runtime.md +++ b/specs/github-browser-extension-runtime.md @@ -599,6 +599,16 @@ The Linux native ESR fixture compares the downloaded Firefox and geckodriver archives with pinned upstream SHA-256 values before extracting either archive. The trusted expected values come from Mozilla's release SHA256SUMS and the geckodriver GitHub release asset digest; a mismatch is a hard failure. +The 2026-11-08 qualification of #920 observed repeated HTTP 504 on the named +v0.37.1 download route (run 42469201584). The public release API asset +`483347579` returned the same archive, SHA-256 +`e815130ea95983e162ae91843b48d3a3ce991735635fce83a647afde21e09f7e`. +CI uses that immutable asset ID with an octet-stream accept header, 10-second +connection limit, 60-second transfer limit and the existing two retries. Both +archive hashes MUST still pass before either extraction. All existing native +browser cases, coverage, isolation and job limits remain mandatory; transport +qualification adds no product test case or acceptance exemption. + ### Native settings navigation contract (2026-10-26) diff --git a/src/application/errors/bugbot_verification_response_failure.ts b/src/application/errors/bugbot_verification_response_failure.ts new file mode 100644 index 000000000..bad0bbacb --- /dev/null +++ b/src/application/errors/bugbot_verification_response_failure.ts @@ -0,0 +1,9 @@ +import { ApplicationError } from './application_error'; + +/** Host-validated candidate proof rejection; distinct from agent execution and capacity failures. */ +export class BugbotVerificationResponseFailure extends ApplicationError { + readonly reason = 'verification-invalid' as const; + constructor(message: string) { + super('agent.failed', message); + } +} diff --git a/src/application/policies/__tests__/application_error_presentation_policy.test.ts b/src/application/policies/__tests__/application_error_presentation_policy.test.ts index a8341b696..e617888e8 100644 --- a/src/application/policies/__tests__/application_error_presentation_policy.test.ts +++ b/src/application/policies/__tests__/application_error_presentation_policy.test.ts @@ -47,6 +47,9 @@ const RECOVERY_CASES: readonly Readonly<{ { recovery: { id: 'progress-assessment-length-invalid', variables: { requirementId: 'R11', sourceLineId: 'L11', field: '$.requirements[0].remaining', maximum: 54, observed: 62 } }, english: 'Existing progress labels and published assessments were preserved. No partial percentage was published. Verification, review, coverage and approval remain independent gates.', spanish: 'Se conservaron las etiquetas de progreso y las evaluaciones publicadas. No se publicó ningún porcentaje parcial. Verificación, revisión, cobertura y aprobación siguen siendo controles independientes.' }, + { recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: 'schema-string-long', attempts: 3 } }, + english: 'Prior findings and resolutions were preserved. No partial review was published. Source freshness and complete-review gates remain required.', + spanish: 'Se conservaron los hallazgos y resoluciones anteriores. No se publicó una revisión parcial. Siguen siendo obligatorios los controles de fuente vigente y revisión completa.' }, { recovery: { id: 'bugbot-review-incomplete', variables: { profile: 'framed-v1', countKind: 'exact', resource: 'rawUtf16', observed: 8192001, limit: 8192000, unit: 'UTF-16 code units' } }, english: 'Existing findings and resolution state were retained. This run published no partial findings or clean review; a fresh run must validate the complete current source.', spanish: 'Se conservaron los findings y su estado de resolución. Este intento no publicó findings parciales ni una revisión limpia; un nuevo intento debe validar toda la fuente actual.' }, diff --git a/src/application/policies/application_error_message_catalog.ts b/src/application/policies/application_error_message_catalog.ts index 19fa6f188..9bd95f59b 100644 --- a/src/application/policies/application_error_message_catalog.ts +++ b/src/application/policies/application_error_message_catalog.ts @@ -284,6 +284,11 @@ const ENGLISH_RECOVERY_CONTENT: RecoveryContent = Object.freeze({ action: 'Inspect part {partitionId}, file {filePath}, unit {unitId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. The replacement must satisfy the unchanged schema. Do not remove files, truncate facts, relax acceptance or bypass verification.', retainedState: 'Existing progress labels and assessments were preserved. No partial percentage or passing verification was published; execution and optional check-publication failures remain separate.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'A completed Bugbot partition response remained invalid after {attempts} attempts; the review was not published.', + action: 'Inspect response reason {reason} and the current run. Qualify the provider output contract before a fresh complete review. This diagnostic describes completed response validation, not an execution infrastructure failure.', + retainedState: 'Prior findings and resolutions were preserved. No partial review was published. Source freshness and complete-review gates remain required.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'An acceptance field still exceeds its unchanged response limit after one complete replacement; progress was not published.', action: 'Inspect phase assessment, requirement {requirementId}, original source {sourceLineId}, field {field}: observed {observed} Unicode code points; maximum {maximum}. Start a fresh complete assessment when the provider can satisfy the unchanged schema. Preserve every requirement and citation; do not truncate facts, raise limits or bypass verification.', @@ -507,6 +512,11 @@ const SPANISH_RECOVERY_CONTENT: RecoveryContent = Object.freeze({ action: 'Inspecciona la parte {partitionId}, archivo {filePath}, unidad {unitId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. La sustitución debe cumplir el mismo esquema. No elimines archivos, recortes los hechos, relajes la aceptación ni eludas la verificación.', retainedState: 'Se conservaron las etiquetas y evaluaciones de progreso. No se publicó ningún porcentaje parcial ni verificación aprobada; los fallos de ejecución y de publicación del check opcional siguen siendo independientes.', }), + 'bugbot-partition-query-exhausted': Object.freeze({ + impact: 'La respuesta completada de una partición de Bugbot siguió siendo inválida tras {attempts} intentos; no se publicó la revisión.', + action: 'Inspecciona el motivo de respuesta {reason} y la ejecución actual. Valida el contrato de salida del proveedor antes de una revisión completa nueva. Este diagnóstico describe la validación de una respuesta completada, no un fallo de infraestructura de ejecución.', + retainedState: 'Se conservaron los hallazgos y resoluciones anteriores. No se publicó una revisión parcial. Siguen siendo obligatorios los controles de fuente vigente y revisión completa.', + }), 'progress-assessment-length-invalid': Object.freeze({ impact: 'Un campo de aceptación sigue superando su límite de respuesta tras una sustitución completa; no se publicó el progreso.', action: 'Inspecciona la fase assessment, requisito {requirementId}, fuente original {sourceLineId}, campo {field}: observado {observed} puntos de código Unicode; máximo {maximum}. Inicia una evaluación completa nueva cuando el proveedor pueda cumplir el mismo esquema. Conserva todos los requisitos y citas; no recortes hechos, aumentes límites ni eludas la verificación.', diff --git a/src/application/policies/bugbot_literal_verification_policy.ts b/src/application/policies/bugbot_literal_verification_policy.ts index a7dd885bf..85cbcb7f1 100644 --- a/src/application/policies/bugbot_literal_verification_policy.ts +++ b/src/application/policies/bugbot_literal_verification_policy.ts @@ -1,3 +1,4 @@ +import { BugbotVerificationResponseFailure } from '../errors/bugbot_verification_response_failure'; import type { BugbotFinding } from '../../domain/bugbot/finding'; import { createHash } from 'node:crypto'; import { ApplicationError } from '../errors/application_error'; @@ -83,5 +84,5 @@ function originalCandidates(candidates: readonly BugbotFinding[]): ReadonlyMap { const telemetry = new BugbotReviewTelemetry(operation()); const query = jest.fn(async (request: FindingsQueryRequest) => request.agentId === 'bugbot-literal-candidate-verification' ? { outputLocale: 'en-US', findings: [] } : { ...attestedResponse(request.prompt, 1), findings: [candidate] }); - await expect(analyzeBugbotRevision(operation(), context(plan.partitions), { agent: { query }, telemetry })).rejects.toThrow('verification'); + await expect(analyzeBugbotRevision(operation(), context(plan.partitions), { agent: { query }, telemetry })).rejects.toMatchObject({ code: 'agent.failed', retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: 'verification-invalid', attempts: 3 } } }); expect(telemetry.snapshot('failed')).toEqual(expect.objectContaining({ completedAnalysisPartitions: 0, failedAnalysisPartitionOrdinal: 1 })); expect(query).toHaveBeenCalledTimes(6); }); diff --git a/src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts b/src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts new file mode 100644 index 000000000..5c428bf49 --- /dev/null +++ b/src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts @@ -0,0 +1,175 @@ +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; +import { queryBugbotPartitionFindings } from '../query_bugbot_findings'; +import { FindingsAgentAdapter } from '../../../../../../data/repository/ai/findings_agent_adapter'; + +const expected = { partitionId: 'diff-owned', headSha: 'a'.repeat(40) }; +const configuration = { provider: 'codex' as const, model: 'fixture' }; + +it('bugbot-partition-diagnostics-C01: native malformed output exhausts three identical calls with a closed diagnostic and no rejected prose', async () => { + const execute = jest.fn(async () => 'PRIVATE_REJECTED_PROSE @all /copilot deploy'); + const adapter = new FindingsAgentAdapter({ cli: { execute } }); + let failure: unknown; + try { await queryBugbotPartitionFindings(adapter, configuration, 'complete pinned source', 'en-US', expected); } + catch (error) { failure = error; } + expect(failure).toMatchObject({ code: 'agent.failed', retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: 'json-invalid', attempts: 3 } } }); + expect(JSON.stringify(failure)).not.toContain('PRIVATE_'); + expect(execute).toHaveBeenCalledTimes(3); + expect(execute.mock.calls[1]).toEqual(execute.mock.calls[0]); + expect(execute.mock.calls[2]).toEqual(execute.mock.calls[0]); +}); + +import { BugbotResponseFailure, BUGBOT_RESPONSE_FAILURE_REASONS, isBugbotPartitionQueryDiagnostic } from '../../../../../../domain/bugbot/response_failure'; +import { interpretFindingsResponse } from '../../../../../../data/repository/agent_findings_response_policy'; +import { ApplicationError } from '../../../../../errors/application_error'; +import { buildApplicationErrorPresentation } from '../../../../../policies/application_error_presentation_policy'; +import { resolveStaticApplicationErrorCatalog } from '../../../../../policies/application_error_message_catalog'; +import { AgentCliError } from '../../../../../../data/repository/agent_cli_contracts'; +import { BugbotReviewCompletenessError } from '../../../../../../domain/bugbot/framed_review'; + +const valid = { outputLocale: 'en-US', partition_id: expected.partitionId, reviewed_head_sha: expected.headSha, findings: [], resolved_findings: [] }; +const run = (adapter: Parameters[0]) => queryBugbotPartitionFindings(adapter, configuration, 'complete pinned source', 'en-US', expected); +const typed = (text: string, schema: Record) => interpretFindingsResponse(text, { expectJson: true, schemaName: 'bugbot_findings', schema }); + +it('bugbot-partition-diagnostics-C02: every typed schema violation exposes only its finite reason, never the rejected key, value or path', () => { + const checks: [unknown, Record, string][] = [ + [42, { type: 'object' }, 'type'], ['bad', { type: 'string', enum: ['good'] }, 'enum'], + ['', { type: 'string', minLength: 1 }, 'string-short'], ['PRIVATE', { type: 'string', maxLength: 2 }, 'string-long'], + [-1, { type: 'number', minimum: 0 }, 'number-min'], [2, { type: 'number', maximum: 1 }, 'number-max'], + [[], { type: 'array', minItems: 1 }, 'array-short'], [[1, 2], { type: 'array', maxItems: 1 }, 'array-long'], + ]; + for (const [value, schema, reason] of checks) { + expect(() => typed(JSON.stringify({ PRIVATE_KEY: value }), { type: 'object', properties: { PRIVATE_KEY: schema }, required: ['PRIVATE_KEY'], additionalProperties: false })) + .toThrow(expect.objectContaining({ reason: `schema-${reason}` })); + } + expect(() => typed('{"n":1e309}', { properties: { n: { type: 'number' } } })).toThrow(expect.objectContaining({ reason: 'schema-number-finite' })); + expect(() => typed('{}', { required: ['PRIVATE_KEY'] })).toThrow(expect.objectContaining({ reason: 'schema-required' })); + let failure: unknown; + try { typed('{"PRIVATE_KEY":"PRIVATE_VALUE"}', { additionalProperties: false }); } catch (error) { failure = error; } + expect(failure).toMatchObject({ reason: 'schema-additional' }); + expect(JSON.stringify(failure)).not.toContain('PRIVATE'); +}); + +it('bugbot-partition-diagnostics-C03: empty and malformed completed native response text stays distinct from execution failure', async () => { + for (const text of ['', ' ', '[]', '{"broken":']) { + const execute = jest.fn(async () => text); + await expect(run(new FindingsAgentAdapter({ cli: { execute } }))).rejects.toMatchObject({ recovery: { variables: { reason: 'json-invalid', attempts: 3 } } }); + expect(execute).toHaveBeenCalledTimes(3); + } +}); + +it('bugbot-partition-diagnostics-C04: a usable later native response discards earlier failures without changing immutable requests', async () => { + const execute = jest.fn().mockResolvedValueOnce('PRIVATE_INVALID').mockResolvedValue(JSON.stringify(valid)); + await expect(run(new FindingsAgentAdapter({ cli: { execute } }))).resolves.toEqual(valid); + expect(execute).toHaveBeenCalledTimes(2); expect(execute.mock.calls[1]).toEqual(execute.mock.calls[0]); +}); + +it('bugbot-partition-diagnostics-C05: exhaustion reports only the final attempt reason and never allocates a fourth query', async () => { + const execute = jest.fn().mockResolvedValueOnce('PRIVATE_INVALID').mockResolvedValueOnce('{}') + .mockResolvedValue(JSON.stringify({ ...valid, reviewed_head_sha: 'foreign' })); + await expect(run(new FindingsAgentAdapter({ cli: { execute } }))).rejects.toMatchObject({ recovery: { variables: { reason: 'schema-enum', attempts: 3 } } }); + expect(execute).toHaveBeenCalledTimes(3); +}); + +it('bugbot-partition-diagnostics-C06: non-Bugbot response contracts retain their existing parsing and schema exceptions', () => { + expect(() => interpretFindingsResponse('', {})).toThrow('Empty response text'); + expect(() => interpretFindingsResponse('bad', { expectJson: true, schema: {} })).toThrow('single valid JSON object'); + expect(() => interpretFindingsResponse('{}', { expectJson: true, schema: { required: ['ordinary'] } })).toThrow('ordinary'); + expect(interpretFindingsResponse('ordinary', {})).toBe('ordinary'); +}); + +it('bugbot-partition-diagnostics-C07: native execution and provider errors retain classification, retryability and bounded attempts', async () => { + const execute = jest.fn(async () => { throw new AgentCliError('PRIVATE_PROCESS', 'process', false); }); + let failure: unknown; try { await run(new FindingsAgentAdapter({ cli: { execute } })); } catch (error) { failure = error; } + expect(failure).toMatchObject({ code: 'agent.failed', retryable: false }); expect(failure).toMatchObject({ recovery: undefined }); + expect(JSON.stringify(failure)).not.toContain('PRIVATE_PROCESS'); expect(execute).toHaveBeenCalledTimes(3); + const provider = new ApplicationError('provider.rate-limited', 'Safe provider state.'); + await expect(run({ query: jest.fn().mockRejectedValue(provider) })).rejects.toBe(provider); +}); + +it('bugbot-partition-diagnostics-C08: locale and exact legacy attestation rejection remain independent host gates', async () => { + const query = jest.fn().mockResolvedValue({ ...valid, outputLocale: 'es-ES' }); + await expect(run({ query })).rejects.toMatchObject({ code: 'locale.output-invalid' }); expect(query).toHaveBeenCalledTimes(3); + query.mockClear().mockResolvedValue({ ...valid, partition_id: 'foreign' }); + await expect(run({ query })).rejects.toThrow('invalid Bugbot partition attestation'); expect(query).toHaveBeenCalledTimes(3); +}); + +it('bugbot-partition-diagnostics-C09: only the exact closed final diagnostic can enter the public registry', () => { + for (const reason of BUGBOT_RESPONSE_FAILURE_REASONS) expect(isBugbotPartitionQueryDiagnostic({ reason, attempts: 3 })).toBe(true); + for (const value of [null, 42, [], {}, { reason: 'PRIVATE_REASON', attempts: 3 }, { reason: 'json-invalid', attempts: 4 }, + { reason: 'json-invalid', attempts: 3, private: 'PRIVATE_VALUE' }]) expect(isBugbotPartitionQueryDiagnostic(value)).toBe(false); + for (const variables of [{ reason: 'PRIVATE_REASON', attempts: 3 }, { reason: 'json-invalid', attempts: 2 }]) { + expect(() => new ApplicationError('agent.failed', 'Safe.', { recovery: { id: 'bugbot-partition-query-exhausted', variables } as any })).toThrow(TypeError); + } + expect(() => new BugbotResponseFailure('PRIVATE_REASON' as any)).toThrow(TypeError); +}); + +it('bugbot-partition-diagnostics-C10: English, regional Spanish and fallback surfaces preserve reason, attempts and correlation', () => { + const error = new ApplicationError('agent.failed', 'Safe.', { correlationId: '11111111-1111-4111-8111-111111111111', + recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: 'schema-string-long', attempts: 3 } } }); + for (const locale of ['en-US', 'es-MX', 'fr-FR']) { + const view = buildApplicationErrorPresentation(error, resolveStaticApplicationErrorCatalog(locale).message); + expect(view.action).toContain('schema-string-long'); expect(view.impact).toContain('3'); + expect(view.reference).toBe(error.correlationId); expect(view.retainedState).toBeTruthy(); + } + expect(error.toJSON()).toMatchObject({ recovery: { variables: { reason: 'schema-string-long', attempts: 3 } } }); + const docs = readFileSync(join(__dirname, '../../../../../../../docs/security-operations/operations/error-reference.mdx'), 'utf8'); + const example = JSON.parse(docs.split('{/* bugbot-partition-query-example */}')[1].match(/```json\r?\n([\s\S]*?)\r?\n```/u)![1]); + const documented = new ApplicationError(example.code, 'Safe.', { retryable: example.retryable, recovery: example.recovery }); + expect(documented.toJSON()).toMatchObject(example); +}); + +it('bugbot-partition-diagnostics-C11: non-receipt framed completeness failures still stop immediately without retry or relabeling', async () => { + const error = new BugbotReviewCompletenessError('responseBytes'); + const query = jest.fn().mockRejectedValue(error); + await expect(run({ query })).rejects.toBe(error); expect(query).toHaveBeenCalledTimes(1); +}); + +it('bugbot-partition-diagnostics-C12: arbitrary errors and structural lookalikes never become completed-output diagnostics', async () => { + const internal = new Error('PRIVATE_INTERNAL'); + const brokenHostSchema = { get type(): unknown { throw internal; } }; + expect(() => typed('{}', brokenHostSchema)).toThrow(internal); + for (const error of [new Error('PRIVATE_UNKNOWN'), { reason: 'schema-enum', name: 'BugbotResponseFailure' }]) { + const query = jest.fn().mockRejectedValue(error); + await expect(run({ query })).rejects.toBe(error); expect(query).toHaveBeenCalledTimes(3); + } +}); + + +const candidate = { id: 'candidate', title: 'Source contradiction', description: 'The candidate needs independent proof.', file: 'src/demo.ts', + line: 1, endLine: 1, severity: 'low', confidence: 0.5, category: 'correctness', evidence: 'Exact supplied source.', suggestion: null, + symbol: null, codeSnippet: 'value = 1', suggestedCode: null }; +function verificationScenario(mode: 'json' | 'incomplete' | 'valid') { + const execute = jest.fn(async (request: any) => { + const p = request.outputSchema.properties; + if (!p.verification_id) return JSON.stringify({ ...valid, findings: [candidate] }); + if (mode === 'json') return 'PRIVATE_VERIFICATION'; + return JSON.stringify({ outputLocale: 'en-US', verification_id: p.verification_id.enum[0], findings: [], rejected_ids: mode === 'valid' ? ['candidate'] : [] }); + }); + const adapter = new FindingsAgentAdapter({ cli: { execute } }); + const invoke = (source = 'Complete pinned source.') => queryBugbotPartitionFindings(adapter, configuration, source, 'en-US', expected, { enabled: true }); + return { execute, invoke }; +} + +it('bugbot-partition-diagnostics-C13: native verification parsing shares the three paired-attempt allowance and closed cause', async () => { + const f = verificationScenario('json'); + await expect(f.invoke()).rejects.toMatchObject({ retryable: false, recovery: { variables: { reason: 'json-invalid', attempts: 3 } } }); + expect(f.execute).toHaveBeenCalledTimes(6); + expect(f.execute.mock.calls[2]).toEqual(f.execute.mock.calls[0]); expect(f.execute.mock.calls[3]).toEqual(f.execute.mock.calls[1]); + expect(f.execute.mock.calls[4]).toEqual(f.execute.mock.calls[0]); expect(f.execute.mock.calls[5]).toEqual(f.execute.mock.calls[1]); +}); + +it('bugbot-partition-diagnostics-C14: incomplete semantic candidate proof reports verification-invalid while complete adjudication remains accepted', async () => { + const f = verificationScenario('incomplete'); + await expect(f.invoke()).rejects.toMatchObject({ retryable: false, recovery: { variables: { reason: 'verification-invalid', attempts: 3 } } }); + expect(f.execute).toHaveBeenCalledTimes(6); + const good = verificationScenario('valid'); await expect(good.invoke()).resolves.toMatchObject({ ...valid, findings: [] }); + expect(good.execute).toHaveBeenCalledTimes(2); +}); + +it('bugbot-partition-diagnostics-C15: known verification capacity failures never acquire a completed-output diagnostic or extra verification query', async () => { + const f = verificationScenario('valid'); let failure: unknown; + try { await f.invoke('x'.repeat(128001)); } catch (error) { failure = error; } + expect(failure).toBeInstanceOf(ApplicationError); expect(failure).toMatchObject({ code: 'agent.failed', recovery: undefined }); + expect((failure as Error).message).toContain('128000-byte prompt bound'); expect(f.execute).toHaveBeenCalledTimes(3); +}); diff --git a/src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts b/src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts index daa3845b0..7a5e1fcd8 100644 --- a/src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts +++ b/src/application/usecases/steps/commit/bugbot/__tests__/query_bugbot_findings.test.ts @@ -174,7 +174,7 @@ describe('generated literal verification at the native query boundary', () => { it('keeps the existing three-attempt partition bound including verification failures', async () => { const query = jest.fn().mockImplementation(request => request.agentId === 'bugbot-literal-candidate-verification' ? Promise.resolve({ outputLocale: 'en-US', findings: [] }) : Promise.resolve(detected)); - await expect(queryBugbotPartitionFindings({ query }, config, 'source', 'en-US', expected, enabled)).rejects.toThrow('verification'); + await expect(queryBugbotPartitionFindings({ query }, config, 'source', 'en-US', expected, enabled)).rejects.toMatchObject({ code: 'agent.failed', retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: 'verification-invalid', attempts: 3 } } }); expect(query).toHaveBeenCalledTimes(6); }); @@ -224,7 +224,7 @@ describe('native bounded verification batch execution', () => { return { outputLocale: 'en-US', verification_id: properties.verification_id.enum[0], findings: ids.includes('candidate-199') ? [] : ids.map(id => original.find(item => item.id === id)), rejected_ids: [] }; }); - await expect(queryBugbotPartitionFindings({ query }, config, 'source', 'en-US', expected, { enabled: true })).rejects.toThrow('verification'); + await expect(queryBugbotPartitionFindings({ query }, config, 'source', 'en-US', expected, { enabled: true })).rejects.toMatchObject({ code: 'agent.failed', retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: 'verification-invalid', attempts: 3 } } }); expect(query).toHaveBeenCalledTimes(33); }); }); diff --git a/src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts b/src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts index 3155b5dd8..08cc00780 100644 --- a/src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts +++ b/src/application/usecases/steps/commit/bugbot/query_bugbot_findings.ts @@ -1,3 +1,5 @@ +import { BugbotVerificationResponseFailure } from '../../../../errors/bugbot_verification_response_failure'; +import { BugbotResponseFailure } from '../../../../../domain/bugbot/response_failure'; import { BugbotReviewCompletenessError, type BugbotFramedAssignment } from '../../../../../domain/bugbot/framed_review'; import { matchesBugbotFramedReceipt } from '../../../../policies/bugbot_framed_receipt_policy'; import type { AgentConfiguration } from '../../../../../domain/agent'; @@ -96,6 +98,10 @@ export async function queryBugbotPartitionFindings( ? await verifyGeneratedLiteralFindings(repository, configuration, prompt, validation.payload, targetLocale, verification.observePrompt, verification.observeResponse) as Readonly> : validation.payload; } catch (error) { + if (attempt === MAX_PARTITION_QUERY_ATTEMPTS && (error instanceof BugbotResponseFailure || error instanceof BugbotVerificationResponseFailure)) { + throw new ApplicationError('agent.failed', 'The completed Bugbot partition responses failed completed-response validation after three attempts.', + { retryable: false, recovery: { id: 'bugbot-partition-query-exhausted', variables: { reason: error.reason, attempts: 3 } } }); + } if (attempt === MAX_PARTITION_QUERY_ATTEMPTS || (error instanceof BugbotReviewCompletenessError && error.facts.resource !== 'receipt')) throw error; logInfo(`Bugbot reviewer retrying one partition query (${attempt + 1}/${MAX_PARTITION_QUERY_ATTEMPTS}) after unusable agent output.`); } diff --git a/src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts b/src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts index 8d124f585..1369b69c7 100644 --- a/src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts +++ b/src/application/usecases/steps/commit/bugbot/verify_generated_literal_findings.ts @@ -1,3 +1,4 @@ +import { BugbotVerificationResponseFailure } from '../../../../errors/bugbot_verification_response_failure'; import type { AgentConfiguration } from '../../../../../domain/agent'; import type { FindingsQueryPort } from '../../../../ports/agent_findings_ports'; import type { BugbotFinding } from '../../../../../domain/bugbot/finding'; @@ -132,5 +133,5 @@ function record(value: unknown): Record { } function invalidOutput(): ApplicationError { - return new ApplicationError('agent.failed', 'Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); + return new BugbotVerificationResponseFailure( 'Generated-source candidate verification returned incomplete or invalid evidence. Recheck the exact source; no clean review was verified.'); } diff --git a/src/architecture/github_communication_test_budget.json b/src/architecture/github_communication_test_budget.json index ab7e37e38..c0046e216 100644 --- a/src/architecture/github_communication_test_budget.json +++ b/src/architecture/github_communication_test_budget.json @@ -7,7 +7,7 @@ "id": "semantic-github-publication", "spec": "specs/semantic-github-publication-and-notification.md", "requiredCases": 135, - "allocatedCases": 1117, + "allocatedCases": 1132, "files": [ { "path": "src/domain/__tests__/github_publication.test.ts", @@ -364,6 +364,10 @@ { "path": "src/data/repository/__tests__/progress_assessment_length_failure.test.ts", "qualifyingCases": 3 + }, + { + "path": "src/application/usecases/steps/commit/bugbot/__tests__/bugbot_partition_query_diagnostics.test.ts", + "qualifyingCases": 15 } ] }, diff --git a/src/data/model/application_error.ts b/src/data/model/application_error.ts index 26f64f56b..5c1c4353c 100644 --- a/src/data/model/application_error.ts +++ b/src/data/model/application_error.ts @@ -1,3 +1,4 @@ +import { isBugbotPartitionQueryDiagnostic, type BugbotPartitionQueryDiagnostic } from '../../domain/bugbot/response_failure'; import { isProgressBatchDiagnostic, type ProgressBatchDiagnostic } from '../../domain/progress_batch_diagnostic'; import { isBranchSyncPublicationDiagnostic, type BranchSyncPublicationDiagnostic } from '../../domain/branch_sync_publication'; import { isBugbotReviewBlockFacts, type BugbotReviewBlockFacts } from '../../domain/bugbot/framed_review'; @@ -100,6 +101,7 @@ export const APPLICATION_ERROR_RECOVERY_IDS = Object.freeze([ 'progress-result-contract-invalid', 'progress-partition-length-invalid', 'progress-assessment-length-invalid', + 'bugbot-partition-query-exhausted', 'progress-assessment-capacity-exceeded', 'progress-scope-clause-limit', 'progress-sdd-seed-unverified', @@ -130,6 +132,7 @@ interface ApplicationErrorRecoveryVariables extends Readonly>; readonly 'progress-batch-retained': ProgressBatchDiagnostic; @@ -472,6 +475,7 @@ const RECOVERY_VARIABLE_KEYS: Readonly; includeReasoning?: boolean; @@ -12,12 +16,28 @@ export function interpretFindingsResponse( parts: unknown, options: FindingsResponseOptions, ): string | Record { + const bugbotSchema = options.schemaName === 'bugbot_findings' || options.schemaName === 'bugbot_literal_candidate_verification'; const text = typeof parts === 'string' ? parts : extractTextFromParts(parts); - if (!text) throw new Error('Empty response text'); + if (!text) { + if (options.expectJson && options.schema && bugbotSchema) throw new BugbotResponseFailure('json-invalid'); + throw new Error('Empty response text'); + } if (!options.expectJson || !options.schema) return text; - const parsed = parseStrictJsonFromAgentText(text); - assertAgentResponseSchema(parsed, options.schema); + let parsed: Record; + try { parsed = parseStrictJsonFromAgentText(text); } + catch (error) { + if (bugbotSchema) throw new BugbotResponseFailure('json-invalid'); + throw error; + } + try { assertAgentResponseSchema(parsed, options.schema); } + catch (error) { + if (bugbotSchema) { + if (error instanceof AgentResponseLengthFailure) throw new BugbotResponseFailure('schema-string-long'); + if (error instanceof AgentResponseSchemaFailure) throw new BugbotResponseFailure(`schema-${error.reason}` as BugbotResponseFailureReason); + } + throw error; + } if (options.includeReasoning && typeof parts !== 'string') { const reasoning = extractReasoningFromParts(parts); if (reasoning) return { ...parsed, reasoning }; diff --git a/src/domain/bugbot/response_failure.ts b/src/domain/bugbot/response_failure.ts new file mode 100644 index 000000000..5b8168192 --- /dev/null +++ b/src/domain/bugbot/response_failure.ts @@ -0,0 +1,21 @@ +/** Content-free reasons for a completed Bugbot response, never process or provider guesses. */ +export const BUGBOT_RESPONSE_FAILURE_REASONS = Object.freeze(['json-invalid', 'schema-type', 'schema-enum', 'schema-string-short', + 'schema-string-long', 'schema-number-finite', 'schema-number-min', 'schema-number-max', 'schema-array-short', + 'schema-array-long', 'schema-required', 'schema-additional', 'verification-invalid'] as const); +export type BugbotResponseFailureReason = typeof BUGBOT_RESPONSE_FAILURE_REASONS[number]; +export type BugbotPartitionQueryDiagnostic = Readonly<{ + readonly reason: BugbotResponseFailureReason; + readonly attempts: 3; +}>; +export function isBugbotPartitionQueryDiagnostic(value: unknown): value is BugbotPartitionQueryDiagnostic { + if (!value || typeof value !== 'object' || Array.isArray(value)) return false; + const facts = value as Record; + return Object.keys(facts).sort().join(',') === 'attempts,reason' && facts.attempts === 3 + && BUGBOT_RESPONSE_FAILURE_REASONS.some(reason => reason === facts.reason); +} +export class BugbotResponseFailure extends Error { + constructor(readonly reason: BugbotResponseFailureReason) { + super('A completed Bugbot response did not satisfy its structured contract.'); + if (!BUGBOT_RESPONSE_FAILURE_REASONS.some(known => known === reason)) throw new TypeError('Bugbot response reason is invalid.'); + } +}