Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/setup_platform_smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
68 changes: 66 additions & 2 deletions build/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.');
}


Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.`);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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.');
}


Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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']),
Expand Down Expand Up @@ -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))
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 3 additions & 1 deletion build/api/src/data/model/application_error.d.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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<Record<CopilotCommandValidationReason, Readonly<{
command: CopilotCommandName;
Expand Down Expand Up @@ -54,6 +55,7 @@ interface ApplicationErrorRecoveryVariables extends Readonly<Record<CopilotComma
readonly 'progress-result-contract-invalid': ProgressResponseDiagnosticFacts;
readonly 'progress-partition-length-invalid': ProgressPartitionLengthDiagnostic;
readonly 'progress-assessment-length-invalid': ProgressAssessmentLengthDiagnostic;
readonly 'bugbot-partition-query-exhausted': BugbotPartitionQueryDiagnostic;
readonly 'progress-assessment-capacity-exceeded': ProgressResponseDiagnosticFacts;
readonly 'progress-sdd-seed-unverified': Readonly<Record<string, never>>;
readonly 'progress-batch-retained': ProgressBatchDiagnostic;
Expand Down
12 changes: 12 additions & 0 deletions build/api/src/domain/bugbot/response_failure.d.ts
Original file line number Diff line number Diff line change
@@ -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);
}
Loading
Loading