From c7d6d6a2eb0db6d02376df8348707e5795a36999 Mon Sep 17 00:00:00 2001 From: Efra Espada Date: Thu, 19 Nov 2026 21:42:38 +0100 Subject: [PATCH] chore-977-prepare-and-verify-trusted-default-installation-of-the-serialized-bugbot-status-publisher: prepare pinned writer installation evidence (#977) --- docs/bugbot/failure-scenarios.mdx | 17 ++ package.json | 2 +- quality/bugbot/evidence/issue-977/README.md | 86 +++++++ .../issue-977/all-shadow-controls.log.gz | Bin 0 -> 4678 bytes .../issue-977/comment-write-refusal.log.gz | Bin 0 -> 299 bytes .../delayed-progress-after-terminal.log.gz | Bin 0 -> 115 bytes .../issue-977/denied-private-pr-read.log.gz | Bin 0 -> 297 bytes .../issue-977/identical-progress.log.gz | Bin 0 -> 115 bytes .../issue-977/independent-recheck.log.gz | Bin 0 -> 113 bytes .../installation-controls-attempt-1.log.gz | Bin 0 -> 542 bytes .../installation-controls-attempt-2.log.gz | Bin 0 -> 361 bytes .../evidence/issue-977/installation-state.cjs | 20 ++ .../issue-977/installation-state.test.cjs | 48 ++++ .../issue-977/legacy-card-progress.log.gz | Bin 0 -> 113 bytes .../issue-977/legacy-card-upgrade.log.gz | Bin 0 -> 113 bytes .../bugbot/evidence/issue-977/manifest.json | 35 +++ .../issue-977/missing-conversation.log.gz | Bin 0 -> 130 bytes .../evidence/issue-977/new-progress.log.gz | Bin 0 -> 113 bytes .../evidence/issue-977/observed-default.json | 32 +++ .../issue-977/packaged-attempt-1.log.gz | Bin 0 -> 20 bytes .../evidence/issue-977/packaged-canary.cjs | 223 ++++++++++++++++++ .../evidence/issue-977/packaged-results.json | 159 +++++++++++++ .../evidence/issue-977/proposed-workflow.yml | 47 ++++ .../issue-977/push-during-preflight.log.gz | Bin 0 -> 130 bytes .../issue-977/replaced-attempt.log.gz | Bin 0 -> 130 bytes .../issue-977/replacement-retry.log.gz | Bin 0 -> 113 bytes .../issue-977/terminal-publication.log.gz | Bin 0 -> 113 bytes .../verified-empty-conversation.log.gz | Bin 0 -> 113 bytes specs/CATALOG.md | 8 +- specs/bugbot-review-state-reconciliation.md | 29 +++ specs/catalog.json | 10 +- 31 files changed, 708 insertions(+), 8 deletions(-) create mode 100644 quality/bugbot/evidence/issue-977/README.md create mode 100644 quality/bugbot/evidence/issue-977/all-shadow-controls.log.gz create mode 100644 quality/bugbot/evidence/issue-977/comment-write-refusal.log.gz create mode 100644 quality/bugbot/evidence/issue-977/delayed-progress-after-terminal.log.gz create mode 100644 quality/bugbot/evidence/issue-977/denied-private-pr-read.log.gz create mode 100644 quality/bugbot/evidence/issue-977/identical-progress.log.gz create mode 100644 quality/bugbot/evidence/issue-977/independent-recheck.log.gz create mode 100644 quality/bugbot/evidence/issue-977/installation-controls-attempt-1.log.gz create mode 100644 quality/bugbot/evidence/issue-977/installation-controls-attempt-2.log.gz create mode 100644 quality/bugbot/evidence/issue-977/installation-state.cjs create mode 100644 quality/bugbot/evidence/issue-977/installation-state.test.cjs create mode 100644 quality/bugbot/evidence/issue-977/legacy-card-progress.log.gz create mode 100644 quality/bugbot/evidence/issue-977/legacy-card-upgrade.log.gz create mode 100644 quality/bugbot/evidence/issue-977/manifest.json create mode 100644 quality/bugbot/evidence/issue-977/missing-conversation.log.gz create mode 100644 quality/bugbot/evidence/issue-977/new-progress.log.gz create mode 100644 quality/bugbot/evidence/issue-977/observed-default.json create mode 100644 quality/bugbot/evidence/issue-977/packaged-attempt-1.log.gz create mode 100644 quality/bugbot/evidence/issue-977/packaged-canary.cjs create mode 100644 quality/bugbot/evidence/issue-977/packaged-results.json create mode 100644 quality/bugbot/evidence/issue-977/proposed-workflow.yml create mode 100644 quality/bugbot/evidence/issue-977/push-during-preflight.log.gz create mode 100644 quality/bugbot/evidence/issue-977/replaced-attempt.log.gz create mode 100644 quality/bugbot/evidence/issue-977/replacement-retry.log.gz create mode 100644 quality/bugbot/evidence/issue-977/terminal-publication.log.gz create mode 100644 quality/bugbot/evidence/issue-977/verified-empty-conversation.log.gz diff --git a/docs/bugbot/failure-scenarios.mdx b/docs/bugbot/failure-scenarios.mdx index cbe25394f..34890eb8c 100644 --- a/docs/bugbot/failure-scenarios.mdx +++ b/docs/bugbot/failure-scenarios.mdx @@ -193,3 +193,20 @@ confirmation. Correct the named provider/response cause and recheck from the current source; preserve identity and reconciliation checks. Completed writes remain in place and must not be repeated blindly. See the [structured error reference](/security-operations/operations/error-reference#conflict-eligibility-and-review-freshness). + + +### Review the default writer installation separately + +The #977 artifact records an authenticated default-branch baseline, exact source +Action/bundle/workflow hashes and a proposed workflow that invokes the reviewed +Action SHA. Copying a workflow with a local `./` action onto an older default can +execute older code. Review that source pin together with its destination SHA; +stop and prepare a new review if either changes. Keep the source runner route, +serialization, private read permissions and native source checks intact. + +A prepared artifact, an exact-byte fixture or a develop merge does not prove +installed readiness. Use the supported setup inspection/review/receipt route +coordinated with #814, with specific authorization, maintainer default merge and +a real canary only on an explicitly authorized test PR. Record the actual installed +SHA, run and comment result. No native canary or installation has occurred in +this proposal; production verification remains disabled. diff --git a/package.json b/package.json index 4c7247b20..b3c876e82 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage --json --outputFile=coverage/setup-acceptance-jest.json && node scripts/validate-coverage-budgets.cjs && node scripts/validate-setup-assistant-acceptance.cjs coverage/setup-acceptance-jest.json && pnpm run test:extension", - "test:bugbot-shadow-verification": "node --test quality/bugbot/evidence/issue-950/shadow-verification/verification.test.cjs quality/bugbot/evidence/issue-950/normal-flow-shadow/config.test.cjs quality/bugbot/evidence/issue-950/normal-flow-shadow/paths.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/launch-full-review.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/review-runtime.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/score-review.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/plan.test.cjs quality/bugbot/evidence/issue-950/status-card-publication/publisher.test.cjs", + "test:bugbot-shadow-verification": "node --test quality/bugbot/evidence/issue-977/installation-state.test.cjs quality/bugbot/evidence/issue-950/shadow-verification/verification.test.cjs quality/bugbot/evidence/issue-950/normal-flow-shadow/config.test.cjs quality/bugbot/evidence/issue-950/normal-flow-shadow/paths.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/launch-full-review.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/review-runtime.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/score-review.test.cjs quality/bugbot/evidence/issue-950/ev07-shadow/plan.test.cjs quality/bugbot/evidence/issue-950/status-card-publication/publisher.test.cjs", "eval:bugbot": "jest src/tooling/__tests__/bugbot_quality_eval.test.ts src/tooling/__tests__/bugbot_benchmark.test.ts src/tooling/__tests__/bugbot_request_transform_evidence.test.ts --runInBand", "typecheck": "tsc --noEmit && pnpm run typecheck:extension", "metrics:architecture": "node scripts/collect-architecture-metrics.cjs", diff --git a/quality/bugbot/evidence/issue-977/README.md b/quality/bugbot/evidence/issue-977/README.md new file mode 100644 index 000000000..5c1b9430f --- /dev/null +++ b/quality/bugbot/evidence/issue-977/README.md @@ -0,0 +1,86 @@ +# Reviewed installation proposal — #977 + +**Prepared only; not installed, authorized or natively verified.** The authenticated +destination is vypdev/copilot (891781467), master at +ace49e4a7ce0f6a007fef5d11479eb9b7a5846e3. A readable workflow-directory listing +at that exact SHA proves the writer filename absent (`observed-default.json`). +A 404 alone is not absence proof. No default file, Variable, Secret, protection, +runner policy, release, consumer template or production mode was changed. + +## Exact proposed artifact + +`proposed-workflow.yml` is the #976 source workflow with exactly one substitution: +`uses: ./` becomes `uses: vypdev/copilot@1b024481d9d86cb4d4b10eb7f8569f9c8e2f0981`. +Copying the local-action workflow onto the older default revision would load the +older executable. The explicit reviewed SHA avoids that dependency. Preserve the +existing self-hosted/codex/Linux route, default-ref admission, per repository/PR +serialized queue, operation correlation, native evidence revalidation, private-PR +read permissions, publication PAT and last verified comment behavior. No new +credential scope is requested. + +`manifest.json` binds the destination, before-state, exact Action manifest/bundle, +source workflow and proposed workflow hashes. Its SHA-256 is +3738d8b9c823739c745ad30e4bf438afdd7d8d3361f2abcd6e71430d0dad13b8. #976 / PR #989 is still unmerged; maintainer review/approval +of this source revision is pending. This is not a producer code attestation. +Do not install a different source or update a moved default from this receipt. + +Coordinate the installation with #814's shared inspection/review/diff/receipt and +drift fences. This proposal does not implement a parallel updater, provision +resources or create a setup branch. The maintainer must authorize the exact +manifest/source/target and use the existing supported reviewed installation PR +route. If that route cannot preserve this exact reviewed pin, stop for its +supported migration rather than substituting a floating tag or a blanket update. +A future installation needs its own prepared-commit receipt and fresh authenticated +destination read; a develop merge or this artifact alone cannot close #977. + +## Executed controls + +Nine deterministic artifact controls pass: authenticated absence, exact installed +bytes, foreign workflow, foreign repository, moved default SHA, renamed default, +inaccessible parent, contradictory listing and the real YAML's source pin / +admission / runner / queue / credentials. `exact-installed-bytes` is only a +synthetic byte comparison, not evidence that a workflow is enabled or installed. +The first test attempt failed before running because it used an uninstalled YAML +package; it now uses the project's existing js-yaml dependency. Both logs remain. + +The exact #976 Action bundle (SHA in manifest) also passes **14 packaged localhost +scenarios**, recorded in `packaged-results.json` and the per-scenario byte-exact +compressed logs. They cover progress update, duplicate no-write, independent +refresh, terminal update, delayed progress, replaced attempt, replacement retry, +push during preflight, denied private PR read, refused comment write, verified +empty conversation, missing conversation and legacy card progress/upgrade. +The copied historical canary was adapted only for the new operation correlation, +fixed source-bundle digest, new-empty-output requirement and denied private read; +the original #950 driver/history are unchanged. Fake comment PATCH/POST attempts, +including a refused write and an explicitly rejected GraphQL mutation audit, +are recorded as fake. Real GitHub writes and model calls are zero. + +| Required distinction | Actual evidence | +| --- | --- | +| Absent | Authenticated exact-default parent listing and classifier control | +| Exact installed | Synthetic exact-byte classifier; actual installation pending | +| Incompatible/foreign | Foreign source pin and repository controls | +| Stale source | Moved default / renamed default controls; packaged push-preflight | +| Denied private read | Actual packaged worker gets local fake 403, nonzero exit, zero writes, prior card retained | +| Duplicate/replaced wakeup | Actual packaged identical-progress no write; prior attempt refused; new attempt updates | + +Run the classifier with `node --test quality/bugbot/evidence/issue-977/installation-state.test.cjs`. +For the packaged audit, create a new empty directory and run +`node quality/bugbot/evidence/issue-977/packaged-canary.cjs /absolute/reviewed/build/github_action/index.js /absolute/new-empty-directory`. +The bundle digest must match the manifest before any case; never point it at an +unreviewed runtime and reinterpret its output as native installation evidence. + +## Remaining acceptance + +1. Maintainer review and integration of #976 at the exact approved revision. +2. Specific installation authorization for the exact manifest and fresh default. +3. Reviewed installation PR/default merge by the maintainer/Action, with its actual + prepared commit, matching receipt and resulting destination SHA. +4. An explicitly authorized test PR, then a genuinely run native dispatch/canary, + recorded run/job/result and current-source comment readback. No PR has been + chosen or mutated automatically; no native canary is claimed. +5. Read back the installed exact workflow/code and inspect native readiness. + +Production verification remains disabled. EV-07 and qualification remain separate. + +All 149 shadow controls pass, including the nine artifact cases; specification/catalog/documentation validators and Graphify pass. These local results do not change the pending installation/native acceptance. diff --git a/quality/bugbot/evidence/issue-977/all-shadow-controls.log.gz b/quality/bugbot/evidence/issue-977/all-shadow-controls.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..6b02ee4335d0b97c13cb605acc278c8eceb71920 GIT binary patch literal 4678 zcmV-M61nXkiwFP!00002|Fv7&jvU94edkvc{IYF;T~qf90T~uZ$|hjTUQzNcUe|yOFm|ExStIG~+l+`u47-NpznM8Uq9mg-BA#a1+KHQ4AtB%|K z+_u{R-<5YyrKF$U4s$m(C;3z=W2FZ9OiB7ye34AMou;epZD+ zT83HvkcjH0LDWq(sp0Ig+kKi$TKGXw=BcGJ$iK;I8olW#y}8?|xvRZnGlCR+r!~~> zn(3(KNsCKv(%^|f;$rLgigaZvhkk-0AYY|0J!@(EAs02L1XneKDN|edQC9OLcCFm@gHn5NOJYCD%ODA_Xchd~9J~QC!ott;t#?YRe-kud6zH9IHBTDPpSl zNtmyN?(cJhQpJ@{egrMht0*H;34i^EcOFzQQf}HwGKEt!13$^*RbDFmqbZrcYo_}- z|Ni47r>(N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F8g-eU7BTIJR#=XDR7;(};yaE)E|88jh@p70n*|Qa z9n$(8hj!$bMI5>%cinlYVQEG>JKSguoiS=@) zSr7gK9$l^2;^$Kvq=u}^9chxQe2QFfw2HPA+*i`2ug*|Qo@CI=ACR^BGfmK`Fg&Vh zy5^*F3SqT+H5u^iXv!=%q_w<JbDvKUWaJJ&9keh3J3&>FEpbVN&v| zapnPPz%P0nZux|w)Vyz27Z6Cl9zQgFzr31Mt;|1b(>wok0-Z9?Qol$_pt~3U598^U I2mLz$0CH*rl$H{Sp+f~-5euU)aUkkl5*%Nz z{r9+c0yfL<`SY`_t#~F=1%)7CPtPuw*kv&ZC8|<#6>EhDT3CzTn;z@Q+7K@?Fqx5~ z5HDV$ybdkwoy44gF64%(3K%=`OC2TV%+?Fe-VtCPoc{rxIAyhznKf`wzMg`7+vH!xEYn6Jd-6)k+7w0Te^ zDmVBW3C1)v)NA2ziB)3y1Wi!m6y~4uo7U^a`h|oYPzbuU!bnU|m@4sEA25^oifyOR x52{lms3|#ZY<3v#-ELzjY{@)4HjQc96`56w+x1h}HtS}y_yH9&w&be;0054@hCl!S literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/delayed-progress-after-terminal.log.gz b/quality/bugbot/evidence/issue-977/delayed-progress-after-terminal.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..6678d1e1563fd4b938047fc1cbae890cf0c28b95 GIT binary patch literal 115 zcmV-(0F3`1iwFP!00002{}s%^4Z|=90KmVeU;%dkq<*>yu}O-WfQ2FL_)Xp?9pa>u z>kJA8rGuZ%hU^wqDddu2GZ4d*3nKMi51JpuReq7q_3IMs<(1oF0e6!V8hMA2%P#Fo VOd++sNjL6~@&|PmQ=V}E006@nF_8cO literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/denied-private-pr-read.log.gz b/quality/bugbot/evidence/issue-977/denied-private-pr-read.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..b9b7cd759774fb1e5258944e0194a6f0f63913d0 GIT binary patch literal 297 zcmV+^0oMK>iwFP!00002|3#27Q^PO}h4=mnEsV}V8w&W2p+gV4ax9FBErYL#ZDgfs z|2=AQz^2oC`t&4gE1t+yK_N&u(6h@W_E}6qiK>)b#aiK!R@S2TX25#1HpH`xOlIOJ z#H*JmuVV*0Cow0WGr4iD0>++vqoc%}+1kTU(20fjFM=uaG4y!?m&e{i%A(a!deSJO zI@9+^Rmejw#CQcZH@Ca}m84Ej_7Bl4i&R}ASU99w$jJ27~&TUpdsgu&Ms{sH2*!zzU literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/identical-progress.log.gz b/quality/bugbot/evidence/issue-977/identical-progress.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..6678d1e1563fd4b938047fc1cbae890cf0c28b95 GIT binary patch literal 115 zcmV-(0F3`1iwFP!00002{}s%^4Z|=90KmVeU;%dkq<*>yu}O-WfQ2FL_)Xp?9pa>u z>kJA8rGuZ%hU^wqDddu2GZ4d*3nKMi51JpuReq7q_3IMs<(1oF0e6!V8hMA2%P#Fo VOd++sNjL6~@&|PmQ=V}E006@nF_8cO literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/independent-recheck.log.gz b/quality/bugbot/evidence/issue-977/independent-recheck.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..8cd77ebebc6ab362df83f636228b4656c6121f50 GIT binary patch literal 113 zcmV-%0FM73iwFP!00002{}s%^4Z|=90KmVeU;$?Uq<*>yF|Aau T)*%P4pSSV@&L~%LZvX%QGZQd% literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/installation-controls-attempt-1.log.gz b/quality/bugbot/evidence/issue-977/installation-controls-attempt-1.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..4ebbe9f24248712ae5994f6887434921d1b396a8 GIT binary patch literal 542 zcmV+(0^$81iwFP!00002|Fu)iZqq;zzVB1a&51<(hZ8#nacLU?Y7?oY;(#F9*ppt zIjS@mjuHZ3)=J(2D)quTp9ncqN~#o2s1VY?l8GGdi^18`f;;3AZz`q`w4vEHB?ItE z#dg%7XNuCxWXZTRgO#LwFpgvIrlOpgy|<`V3u!#uu^dH)9@DzQCW8qJ#W^)hih(r^ zx(2mztyU`ufEu`H6u5JRTJjxE7)L=1gr4ZoWn@471JbRc<>kMl1VNI9@ew7*C9Sw= zf!-7)pGbA`_UhcGGqLJ~7=>xz9}y3oH8Ag)S-+NYt2+UW#%U1tAC9UHcPW1!1?lhO zxkotfRv(UnG#Ec*SM7~-;2*`&uk!y=xkg^1(srYEIieK41l@irx+mW*@E+mPO}vOIc5=CU>ON;L}Rg@$45j*=wy6VkL$!_^P8p-u^@ g|Md=S7m!RD(T%5sn?%4wSBYgf4rL zUWb!(5(4TLR`xvf`5(`J`S}KRF`>1X*gMb`W8{wYH8dO(yWPlfPZ4lTdva+ik^$UC z31Fqxm1y!{)sLgtq1Ghz zttA*REIU?Oh6JSkE73ueB?1qsr_C6eB^;j(fB)1TQ}<)7;lK$a^y5k?AC9 z?F|7sBaIX(9OV@`7%hL!3f=%s&mu|0Ol=NB5Qq+BCbyy$Pt|MH6q{vnU%wzmOA*@n z9!H*hr{-Xg*_M2VY?rJ?r)l=+HI4@!hI^E}@ypeWVb=8CN671ZUDcbWC|>>m51rW_ HXafKM=@qJo literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/installation-state.cjs b/quality/bugbot/evidence/issue-977/installation-state.cjs new file mode 100644 index 000000000..484ff6470 --- /dev/null +++ b/quality/bugbot/evidence/issue-977/installation-state.cjs @@ -0,0 +1,20 @@ +'use strict'; + +// Read-only evidence classification for the reviewed installation proposal. +// It neither changes a target nor authorizes the existing setup installer. +const { createHash } = require('node:crypto'); +const hash = value => createHash('sha256').update(value).digest('hex'); + +function installationState(plan, observed) { + if (observed.repositoryId !== plan.destination.repositoryId + || observed.repository !== plan.destination.repository) return 'incompatible'; + if (observed.defaultBranch !== plan.destination.defaultBranch + || observed.head !== plan.destination.head) return 'stale-source'; + if (typeof observed.workflow === 'string') return hash(observed.workflow) === plan.proposedWorkflowSha256 + ? 'exact-installed-bytes' : 'incompatible'; + return observed.workflowParentReadable === true && Array.isArray(observed.workflowNames) + && observed.workflowNames.length < 1000 && observed.workflowNames.every(name => typeof name === 'string') + && !observed.workflowNames.includes(plan.path.split('/').at(-1)) ? 'absent' : 'unknown'; +} + +module.exports = { installationState }; diff --git a/quality/bugbot/evidence/issue-977/installation-state.test.cjs b/quality/bugbot/evidence/issue-977/installation-state.test.cjs new file mode 100644 index 000000000..98f44f0bf --- /dev/null +++ b/quality/bugbot/evidence/issue-977/installation-state.test.cjs @@ -0,0 +1,48 @@ +'use strict'; + +const assert = require('node:assert/strict'); +const { readFileSync } = require('node:fs'); +const { createHash } = require('node:crypto'); +const path = require('node:path'); +const { test } = require('node:test'); +const { load: parse } = require('js-yaml'); +const { installationState } = require('./installation-state.cjs'); +const plan = require('./manifest.json'); +const baseline = require('./observed-default.json'); +const workflow = readFileSync(path.join(__dirname, 'proposed-workflow.yml'), 'utf8'); + +for (const [name, observed, expected] of [ + ['authenticated absent', baseline, 'absent'], + ['exact installed bytes', { ...baseline, workflow }, 'exact-installed-bytes'], + ['foreign workflow', { ...baseline, workflow: workflow.replace(plan.source.commit, 'f'.repeat(40)) }, 'incompatible'], + ['foreign repository', { ...baseline, repositoryId: 1 }, 'incompatible'], + ['moved default head', { ...baseline, head: 'a'.repeat(40) }, 'stale-source'], + ['renamed default', { ...baseline, defaultBranch: 'other' }, 'stale-source'], + ['inaccessible parent', { ...baseline, workflowParentReadable: false }, 'unknown'], + ['contradictory listing', { ...baseline, workflowNames: ['copilot_bugbot_status_card.yml'] }, 'unknown'], +]) test('installation classification distinguishes ' + name, () => { + assert.equal(installationState(plan, observed), expected); + assert.equal(plan.installationAuthorized, false); + assert.equal(plan.installedDestinationSha, null); + assert.equal(plan.nativeCanary.status, 'not-run'); +}); + +test('the minimal proposed workflow pins reviewed code and preserves serialization, admission and narrow credentials', () => { + assert.equal(createHash('sha256').update(workflow).digest('hex'), plan.proposedWorkflowSha256); + const yaml = parse(workflow), job = yaml.jobs.publish; + assert.deepEqual(Object.keys(yaml.on), ['workflow_dispatch']); + assert.deepEqual(Object.keys(yaml.on.workflow_dispatch.inputs).sort(), ['operation', 'pull_number', 'work']); + assert.equal(job.if, "${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}"); + assert.deepEqual(job['runs-on'], ['self-hosted', 'codex', 'Linux']); + assert.equal(job.concurrency.group, 'copilot-bugbot-status-${{ github.repository_id }}-${{ inputs.pull_number }}'); + assert.equal(job.concurrency.queue, 'max'); + assert.equal(job.concurrency['cancel-in-progress'], false); + assert.deepEqual(job.permissions, { actions: 'read', checks: 'read', contents: 'read', issues: 'read', 'pull-requests': 'read' }); + const step = job.steps.find(step => step.name === 'Publish canonical comment'); + assert.equal(step.uses, 'vypdev/copilot@' + plan.source.commit); + assert.equal(step.with.token, '${{ secrets.PAT }}'); + assert.equal(step.env.COPILOT_EVIDENCE_TOKEN, '${{ github.token }}'); + assert.equal(step.env.COPILOT_BUGBOT_STATUS_CARD_WORKFLOW, 'write-v1'); + assert.equal(plan.productionVerification, 'disabled'); + assert.equal(plan.consumerTemplatesChanged, false); +}); diff --git a/quality/bugbot/evidence/issue-977/legacy-card-progress.log.gz b/quality/bugbot/evidence/issue-977/legacy-card-progress.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..8cd77ebebc6ab362df83f636228b4656c6121f50 GIT binary patch literal 113 zcmV-%0FM73iwFP!00002{}s%^4Z|=90KmVeU;$?Uq<*>yF|Aau T)*%P4pSSV@&L~%LZvX%QGZQd% literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/legacy-card-upgrade.log.gz b/quality/bugbot/evidence/issue-977/legacy-card-upgrade.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..8cd77ebebc6ab362df83f636228b4656c6121f50 GIT binary patch literal 113 zcmV-%0FM73iwFP!00002{}s%^4Z|=90KmVeU;$?Uq<*>yF|Aau T)*%P4pSSV@&L~%LZvX%QGZQd% literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/manifest.json b/quality/bugbot/evidence/issue-977/manifest.json new file mode 100644 index 000000000..67044d6ca --- /dev/null +++ b/quality/bugbot/evidence/issue-977/manifest.json @@ -0,0 +1,35 @@ +{ + "schemaVersion": 1, + "kind": "review-only-publisher-installation-proposal", + "destination": { + "repository": "vypdev/copilot", + "repositoryId": 891781467, + "defaultBranch": "master", + "head": "ace49e4a7ce0f6a007fef5d11479eb9b7a5846e3" + }, + "path": ".github/workflows/copilot_bugbot_status_card.yml", + "baseline": "absent with authenticated readable parent", + "source": { + "repository": "vypdev/copilot", + "commit": "1b024481d9d86cb4d4b10eb7f8569f9c8e2f0981", + "pullRequest": 989, + "merged": false, + "maintainerApproval": "pending", + "workflowSha256": "7a6b58ec81c41b49e8b4eed59b285f83da71251174fef2ee069138860fcc5b81", + "actionManifestSha256": "0875913058675d1a0e68117a8c98bb7508cf548f5775b645c5352bbd3bce127f", + "actionBundleSha256": "8bd2355979f551142848a0c9fdc3f5f8690fecb8a12da4910a0aad65e155e930" + }, + "proposedWorkflowSha256": "6329588dc571722aba3c97ce3be8d1f5e84bff2fbf7ecb4da39ad4f36c66da90", + "sourceChange": "replace local ./ invocation with exact reviewed Action SHA; preserve all other workflow bytes", + "consumerTemplatesChanged": false, + "productionVerification": "disabled", + "installationAuthorized": false, + "installedDestinationSha": null, + "nativeCanary": { + "status": "not-run", + "explicitlyAuthorizedPullRequest": null, + "runId": null + }, + "dependency": 976, + "coordination": 814 +} diff --git a/quality/bugbot/evidence/issue-977/missing-conversation.log.gz b/quality/bugbot/evidence/issue-977/missing-conversation.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..2def114b7af41c59714d4dc57dd940a327ccbf0f GIT binary patch literal 130 zcmV-|0Db=-iwFP!00002{}s&34Z<)C0ML7<@B(1~OI#R$9o)oFi#Cq@p@``T=O;Zx zr#BZ53WiPxU#kw;HA<(DDMLLF!;%+7YONgPFT{s@B8|&w5^R&$Obzj_P}7Wiz%8Gv k2K?)EsALUBuDjG3Ylo8@C}UHTFSpC`1B#)9y@~(;0NTej-~a#s literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/new-progress.log.gz b/quality/bugbot/evidence/issue-977/new-progress.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..8cd77ebebc6ab362df83f636228b4656c6121f50 GIT binary patch literal 113 zcmV-%0FM73iwFP!00002{}s%^4Z|=90KmVeU;$?Uq<*>yF|Aau T)*%P4pSSV@&L~%LZvX%QGZQd% literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/observed-default.json b/quality/bugbot/evidence/issue-977/observed-default.json new file mode 100644 index 000000000..31b628186 --- /dev/null +++ b/quality/bugbot/evidence/issue-977/observed-default.json @@ -0,0 +1,32 @@ +{ + "repository": "vypdev/copilot", + "repositoryId": 891781467, + "defaultBranch": "master", + "head": "ace49e4a7ce0f6a007fef5d11479eb9b7a5846e3", + "observedAt": "2026-11-19T20:33:51.219529+00:00", + "workflowParentReadable": true, + "workflowNames": [ + "agent-cli-provisioning.yml", + "ci_check.yml", + "copilot_branch_sync.yml", + "copilot_close_inactive_issues.yml", + "copilot_comment_runtime.yml", + "copilot_commit.yml", + "copilot_credential_health.yml", + "copilot_deployment_orchestration.yml", + "copilot_issue.yml", + "copilot_issue_comment.yml", + "copilot_pull_request.yml", + "copilot_pull_request_approval.yml", + "copilot_pull_request_comment.yml", + "copilot_pull_request_merge_queue.yml", + "copilot_pull_request_review_state.yml", + "copilot_runner_diagnostics.yml", + "hotfix_workflow.yml", + "release_workflow.yml", + "repowise.yml", + "setup_platform_smoke.yml" + ], + "workflowAbsent": true, + "evidence": "authenticated GitHub contents listing at exact default SHA; no installation mutation" +} diff --git a/quality/bugbot/evidence/issue-977/packaged-attempt-1.log.gz b/quality/bugbot/evidence/issue-977/packaged-attempt-1.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..86e43ea3218b5890302b754bbf8927f94e79f7ee GIT binary patch literal 20 Tcmb2|=3oE;rvJ=f8bkm97>oh8 literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/packaged-canary.cjs b/quality/bugbot/evidence/issue-977/packaged-canary.cjs new file mode 100644 index 000000000..fb97186fa --- /dev/null +++ b/quality/bugbot/evidence/issue-977/packaged-canary.cjs @@ -0,0 +1,223 @@ +'use strict'; +const assert = require('node:assert/strict'); +const { createHash } = require('node:crypto'); +const { createServer } = require('node:http'); +const { spawn } = require('node:child_process'); +const { readFileSync, writeFileSync, readdirSync } = require('node:fs'); +const { join, resolve } = require('node:path'); + +if (process.argv.length !== 4) throw new Error('Expected a packaged GitHub Action and an existing output directory.'); +const bundle = resolve(process.argv[2]); +const output = resolve(process.argv[3]); +assert.equal(readdirSync(output).length, 0, 'new empty output directory required'); +const manifest = require('./manifest.json'); +assert.equal(createHash('sha256').update(readFileSync(bundle)).digest('hex'), manifest.source.actionBundleSha256, 'reviewed source bundle differs'); +const project = '/repos/owner/project'; +const site = 'https://github.com/owner/project'; +const reviewPath = '.github/workflows/copilot_pull_request.yml'; +const cardPath = '.github/workflows/copilot_bugbot_status_card.yml'; +const source = { repositoryId: 19, pullNumber: 11, base: 'a'.repeat(40), baseRef: 'b'.repeat(40), + head: 'c'.repeat(40), policy: 'default' }; +const revision = sha => [ + '', + '', + '## Bugbot status', '', 'Verified source from controlled fixture.', +].join('\n'); +const previous = revision('d'.repeat(40)); +const current = revision(source.head); +const result = { realGitHubWriteAttempts: 0, modelCalls: 0, installed: false, nativeCanary: false, sourceCommit: manifest.source.commit, packageSha256: createHash('sha256').update(readFileSync(bundle)).digest('hex'), + evidence: 'packaged action with synthetic actions and comments on a loopback-only GitHub API', outcomes: [] }; +const canonical = { databaseId: 55, author: { login: 'fixture-bot', __typename: 'User' }, body: previous }; +let state; + +function makeState(overrides = {}) { + const pull = { number: 11, base: { sha: source.base, repo: { id: 19 } }, head: { sha: source.head, repo: { id: 19 } } }; + const run = { id: 23, run_attempt: 1, path: reviewPath, event: 'pull_request', status: 'in_progress', + created_at: '2026-11-18T06:00:00Z', repository: { id: 19 }, head_repository: { id: 19 }, pull_requests: [pull] }; + return { comment: { ...canonical }, sourceHead: source.head, run, sequence: 4, partitions: 18, operations: [], ...overrides }; +} + +function check(s) { + const externalId = ['bugbot', 11, source.base, source.head, 'default', 23, s.run.run_attempt].join(':'); + const observation = { stage: 'analyzing', headSha: source.head, baseSha: source.base, baseRefSha: source.baseRef, + pullNumber: 11, elapsedMs: 240000, observedAt: '2026-11-18T06:04:00.000Z', sequence: s.sequence, + partitions: { completed: s.partitions, total: 50 } }; + const marker = Buffer.from(JSON.stringify({ externalId, observation })).toString('base64url'); + return { total_count: 1, check_runs: [{ id: 38, name: 'Copilot / Review', head_sha: source.head, + external_id: externalId, details_url: site + '/runs/38', status: 'in_progress', app: { slug: 'github-actions' }, + output: { summary: '' } }] }; +} + +const server = createServer(async (request, response) => { + const path = decodeURIComponent(new URL(request.url, 'http://localhost').pathname); + const method = request.method; + let graphql; + if (method === 'POST' && path === '/graphql') { + const chunks = []; + for await (const chunk of request) chunks.push(chunk); + try { graphql = JSON.parse(Buffer.concat(chunks)); } catch { /* Invalid operations are denied and counted. */ } + } + const graphqlRead = typeof graphql?.query === 'string' && graphql.query.trim().startsWith('query ') + && !/\bmutation\b/u.test(graphql.query); + const write = !['GET', 'HEAD'].includes(method ?? '') && !graphqlRead; + const credential = request.headers.authorization?.split(' ')[1]; + state.operations.push({ method, path, write }); + response.setHeader('content-type', 'application/json'); + const reply = (data, status = 200) => { response.statusCode = status; response.end(JSON.stringify(data)); }; + if (path === '/user' && credential === 'fixture-writer') return reply({ login: 'fixture-bot' }); + if (method === 'GET' && credential !== 'fixture-reader') return reply({ message: 'Unsupported fixture credential' }, 403); + if (path === project) return reply({ id: 19, default_branch: 'master' }); + if (path === project + '/pulls/11') { + if (state.denyPrivateRead) return reply({ message: 'Fixture private PR read denied' }, 403); + const repo = { id: 19, owner: { login: 'owner' }, name: 'project' }; + const head = state.pushAfterConversation && state.conversationReads ? 'e'.repeat(40) : state.sourceHead; + return reply({ number: 11, state: 'open', draft: false, changed_files: 1, + head: { sha: head, ref: 'feature/reviewed', repo }, base: { sha: source.base, ref: 'develop', repo } }); + } + if (path === project + '/git/ref/heads/develop') return reply({ + ref: 'refs/heads/develop', object: { type: 'commit', sha: source.baseRef } }); + if (path === project + '/actions/runs/23') return reply(state.run); + if (path === project + '/actions/runs/24') return reply({ ...state.run, id: 24, run_attempt: 1, + event: 'issue_comment', path: '.github/workflows/copilot_issue_comment.yml' }); + if (path === project + '/actions/workflows/copilot_pull_request.yml/runs') { + return reply({ total_count: 1, workflow_runs: [state.run] }); + } + if (path === project + '/commits/' + source.head + '/check-runs') return reply(check(state)); + if (method === 'POST' && path === '/graphql') { + if (credential !== 'fixture-writer') return reply({ message: 'Unsupported fixture credential' }, 403); + const body = graphql; + if (!graphqlRead || body.variables?.issueNumber !== 11) return reply({ errors: [{ message: 'Unrecognized fixture query' }] }, 400); + state.conversationReads = (state.conversationReads ?? 0) + 1; + return reply({ data: { repository: { issueOrPullRequest: state.missingConversation ? null : { + comments: { nodes: state.comment ? [state.comment] : [], pageInfo: { hasPreviousPage: false, startCursor: null } }, + } } } }); + } + if (write) { + if (credential !== 'fixture-writer' || path !== project + '/issues/comments/55' && path !== project + '/issues/11/comments') { + return reply({ message: 'Unsupported fixture mutation' }, 405); + } + const data = []; + for await (const chunk of request) data.push(chunk); + const { body } = JSON.parse(Buffer.concat(data)); + if (state.refuseWrite) return reply({ message: 'Fixture write refused' }, 403); + state.comment = { ...canonical, body }; + return reply({ id: 55, body }); + } + return reply({ message: 'Unrecognized fixture endpoint' }, 404); +}); + +async function invoke(label, { kind = 'progress', runId = 23, attempt = 1, verifiedBody } = {}) { + const eventPath = join(output, label + '.event.json'); + const work = { version: 1, kind, source, runId, attempt, ...(verifiedBody === undefined ? {} : { verifiedBody }) }; + writeFileSync(eventPath, JSON.stringify({ inputs: { pull_number: '11', work: JSON.stringify(work), operation: (kind === 'progress' ? String(state.sequence) + ':' : '') + createHash('sha256').update(JSON.stringify(work)).digest('hex') }, repository: { id: 19 } })); + const api = 'http://127.0.0.1:' + server.address().port; + const env = { PATH: process.env.PATH, HOME: join(output, 'fixture-home'), + GITHUB_API_URL: api, GITHUB_GRAPHQL_URL: api + '/graphql', GITHUB_SERVER_URL: 'https://github.com', + GITHUB_REPOSITORY: 'owner/project', GITHUB_EVENT_NAME: 'workflow_dispatch', GITHUB_ACTOR: 'fixture-bot', + GITHUB_REF: 'refs/heads/master', GITHUB_WORKFLOW_REF: 'owner/project/' + cardPath + '@refs/heads/master', + GITHUB_EVENT_PATH: eventPath, GITHUB_RUN_ID: '888', GITHUB_RUN_ATTEMPT: '1', GITHUB_ACTIONS: 'true', + INPUT_TOKEN: 'fixture-writer', COPILOT_EVIDENCE_TOKEN: 'fixture-reader', COPILOT_BUGBOT_STATUS_CARD_WORKFLOW: 'write-v1', + 'INPUT_PULL-REQUESTS-LOCALE': 'en-US' }; + const firstOperation = state.operations.length; + const observed = await new Promise((done, reject) => { + const child = spawn(process.execPath, [bundle], { env, cwd: output, stdio: ['ignore', 'pipe', 'pipe'] }); + const data = []; + const timer = setTimeout(() => { child.kill(); reject(new Error(label + ' timed out')); }, 15000); + child.stdout.on('data', value => data.push(value)); + child.stderr.on('data', value => data.push(value)); + child.once('error', reject); + child.once('close', code => { clearTimeout(timer); done({ code, log: Buffer.concat(data).toString('utf8') }); }); + }); + const operations = state.operations.slice(firstOperation); + const writes = operations.filter(operation => operation.write); + writeFileSync(join(output, label + '.log'), observed.log); + result.outcomes.push({ label, exit: observed.code, reads: operations.length - writes.length, writes, + logResult: observed.log.includes('publication updated') ? 'updated' + : observed.log.includes('publication unchanged') ? 'unchanged' + : observed.log.includes('publication created') ? 'created' + : observed.log.includes('No current Bugbot status card') ? 'declined' : 'other' }); + return { ...observed, writes }; +} + +(async () => { + await new Promise(done => server.listen(0, '127.0.0.1', done)); + try { + state = makeState(); + let run = await invoke('new-progress'); + assert.equal(run.code, 0, run.log); + assert.deepEqual(run.writes.map(write => [write.method, write.path]), [['PATCH', project + '/issues/comments/55']]); + assert.match(state.comment.body, /18\/50 partitions validated/u); + assert.match(state.comment.body, /remaining partitions \(32\)/u); + assert(state.comment.body.endsWith(previous)); + run = await invoke('identical-progress'); + assert.equal(run.code, 0, run.log); + assert.equal(run.writes.length, 0); + run = await invoke('independent-recheck', { kind: 'state-refresh', runId: 24, verifiedBody: current }); + assert.equal(run.code, 0, run.log); + assert.equal(run.writes.length, 1); + assert.match(state.comment.body, /18\/50 partitions validated/u); + assert(state.comment.body.endsWith(current)); + run = await invoke('terminal-publication', { kind: 'analysis-result', verifiedBody: current }); + assert.equal(run.code, 0, run.log); + assert.equal(run.writes.length, 1); + assert(!state.comment.body.includes('partitions validated')); + assert(state.comment.body.startsWith(current)); + run = await invoke('delayed-progress-after-terminal'); + assert.equal(run.code, 0, run.log); + assert.equal(run.writes.length, 0); + state.run.run_attempt = 2; state.sequence = 1; state.partitions = 2; + run = await invoke('replaced-attempt'); + assert.equal(run.code, 1, run.log); + assert.equal(run.writes.length, 0); + run = await invoke('replacement-retry', { attempt: 2 }); + assert.equal(run.code, 0, run.log); + assert.equal(run.writes.length, 1); + assert.match(state.comment.body, /2\/50 partitions validated/u); + state = makeState({ pushAfterConversation: true }); + run = await invoke('push-during-preflight'); + assert.equal(run.code, 1, run.log); + assert.equal(run.writes.length, 0); + state = makeState({ denyPrivateRead: true }); + run = await invoke('denied-private-pr-read'); + assert.notEqual(run.code, 0, run.log); + assert.equal(run.writes.length, 0); + assert.equal(state.comment.body, previous); + state = makeState({ refuseWrite: true }); + run = await invoke('comment-write-refusal', { kind: 'analysis-result', verifiedBody: current }); + assert.equal(run.code, 1, run.log); + assert.equal(run.writes.length, 1); + assert.equal(state.comment.body, previous); + state = makeState({ comment: undefined }); + run = await invoke('verified-empty-conversation'); + assert.equal(run.code, 0, run.log); + assert.deepEqual(run.writes.map(write => [write.method, write.path]), [['POST', project + '/issues/11/comments']]); + assert.match(state.comment.body, /No verified review yet/u); + state = makeState({ missingConversation: true }); + run = await invoke('missing-conversation'); + result.missingConversationRejected = run.code !== 0 && run.writes.length === 0; + assert(result.missingConversationRejected, 'An unavailable conversation must not create a status card.'); + assert.equal(state.comment.body, previous); + const legacy = previous.split('\n').slice(1).join('\n'); + state = makeState({ comment: { ...canonical, body: legacy } }); + run = await invoke('legacy-card-progress'); + assert.equal(run.code, 0, run.log); + assert.deepEqual(run.writes.map(write => [write.method, write.path]), [['PATCH', project + '/issues/comments/55']]); + assert(state.comment.body.endsWith(legacy)); + run = await invoke('legacy-card-upgrade', { kind: 'analysis-result', verifiedBody: current }); + assert.equal(run.code, 0, run.log); + assert.deepEqual(run.writes.map(write => [write.method, write.path]), [['PATCH', project + '/issues/comments/55']]); + assert(state.comment.body.startsWith(current)); + const before = state.operations.length; + const response = await fetch(`http://127.0.0.1:${server.address().port}/graphql`, { + method: 'POST', headers: { authorization: 'token fixture-writer', 'content-type': 'application/json' }, + body: JSON.stringify({ query: 'mutation Audit { forbidden }' }), + }); + assert.equal(response.status, 400); + const attempts = state.operations.slice(before); + assert.deepEqual(attempts, [{ method: 'POST', path: '/graphql', write: true }]); + result.rejectedMutationAudited = true; + } finally { + writeFileSync(join(output, 'results.json'), JSON.stringify(result, null, 2) + '\n'); + await new Promise(done => server.close(done)); + } +})().catch(error => { console.error(error.message); process.exitCode = 1; }); diff --git a/quality/bugbot/evidence/issue-977/packaged-results.json b/quality/bugbot/evidence/issue-977/packaged-results.json new file mode 100644 index 000000000..9da3346f3 --- /dev/null +++ b/quality/bugbot/evidence/issue-977/packaged-results.json @@ -0,0 +1,159 @@ +{ + "realGitHubWriteAttempts": 0, + "modelCalls": 0, + "installed": false, + "nativeCanary": false, + "sourceCommit": "1b024481d9d86cb4d4b10eb7f8569f9c8e2f0981", + "packageSha256": "8bd2355979f551142848a0c9fdc3f5f8690fecb8a12da4910a0aad65e155e930", + "evidence": "packaged action with synthetic actions and comments on a loopback-only GitHub API", + "outcomes": [ + { + "label": "new-progress", + "exit": 0, + "reads": 21, + "writes": [ + { + "method": "PATCH", + "path": "/repos/owner/project/issues/comments/55", + "write": true + } + ], + "logResult": "updated" + }, + { + "label": "identical-progress", + "exit": 0, + "reads": 13, + "writes": [], + "logResult": "unchanged" + }, + { + "label": "independent-recheck", + "exit": 0, + "reads": 21, + "writes": [ + { + "method": "PATCH", + "path": "/repos/owner/project/issues/comments/55", + "write": true + } + ], + "logResult": "updated" + }, + { + "label": "terminal-publication", + "exit": 0, + "reads": 18, + "writes": [ + { + "method": "PATCH", + "path": "/repos/owner/project/issues/comments/55", + "write": true + } + ], + "logResult": "updated" + }, + { + "label": "delayed-progress-after-terminal", + "exit": 0, + "reads": 13, + "writes": [], + "logResult": "unchanged" + }, + { + "label": "replaced-attempt", + "exit": 1, + "reads": 6, + "writes": [], + "logResult": "declined" + }, + { + "label": "replacement-retry", + "exit": 0, + "reads": 21, + "writes": [ + { + "method": "PATCH", + "path": "/repos/owner/project/issues/comments/55", + "write": true + } + ], + "logResult": "updated" + }, + { + "label": "push-during-preflight", + "exit": 1, + "reads": 19, + "writes": [], + "logResult": "declined" + }, + { + "label": "denied-private-pr-read", + "exit": 1, + "reads": 3, + "writes": [], + "logResult": "other" + }, + { + "label": "comment-write-refusal", + "exit": 1, + "reads": 18, + "writes": [ + { + "method": "PATCH", + "path": "/repos/owner/project/issues/comments/55", + "write": true + } + ], + "logResult": "other" + }, + { + "label": "verified-empty-conversation", + "exit": 0, + "reads": 21, + "writes": [ + { + "method": "POST", + "path": "/repos/owner/project/issues/11/comments", + "write": true + } + ], + "logResult": "created" + }, + { + "label": "missing-conversation", + "exit": 1, + "reads": 13, + "writes": [], + "logResult": "declined" + }, + { + "label": "legacy-card-progress", + "exit": 0, + "reads": 21, + "writes": [ + { + "method": "PATCH", + "path": "/repos/owner/project/issues/comments/55", + "write": true + } + ], + "logResult": "updated" + }, + { + "label": "legacy-card-upgrade", + "exit": 0, + "reads": 18, + "writes": [ + { + "method": "PATCH", + "path": "/repos/owner/project/issues/comments/55", + "write": true + } + ], + "logResult": "updated" + } + ], + "missingConversationRejected": true, + "rejectedMutationAudited": true +} diff --git a/quality/bugbot/evidence/issue-977/proposed-workflow.yml b/quality/bugbot/evidence/issue-977/proposed-workflow.yml new file mode 100644 index 000000000..eb8de3ff4 --- /dev/null +++ b/quality/bugbot/evidence/issue-977/proposed-workflow.yml @@ -0,0 +1,47 @@ +name: Copilot - Bugbot Status Card +run-name: Bugbot status · PR ${{ inputs.pull_number }} · ${{ inputs.operation }} + +on: + workflow_dispatch: + inputs: + pull_number: + description: Pull request number + required: true + type: number + operation: + description: SHA-256 correlation of the versioned handoff; not publication authority + required: true + type: string + work: + description: Versioned publication handoff + required: true + type: string + +jobs: + publish: + name: Publish Bugbot status card + if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} + runs-on: [self-hosted, codex, Linux] + timeout-minutes: 5 + concurrency: + group: copilot-bugbot-status-${{ github.repository_id }}-${{ inputs.pull_number }} + queue: max + cancel-in-progress: false + permissions: + actions: read + checks: read + contents: read + issues: read + pull-requests: read + steps: + - uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Publish canonical comment + uses: vypdev/copilot@1b024481d9d86cb4d4b10eb7f8569f9c8e2f0981 + with: + token: ${{ secrets.PAT }} + pull-requests-locale: ${{ vars.PULL_REQUESTS_LOCALE || vars.REPOSITORY_LOCALE || 'en-US' }} + env: + COPILOT_BUGBOT_STATUS_CARD_WORKFLOW: 'write-v1' + COPILOT_EVIDENCE_TOKEN: ${{ github.token }} diff --git a/quality/bugbot/evidence/issue-977/push-during-preflight.log.gz b/quality/bugbot/evidence/issue-977/push-during-preflight.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..2def114b7af41c59714d4dc57dd940a327ccbf0f GIT binary patch literal 130 zcmV-|0Db=-iwFP!00002{}s&34Z<)C0ML7<@B(1~OI#R$9o)oFi#Cq@p@``T=O;Zx zr#BZ53WiPxU#kw;HA<(DDMLLF!;%+7YONgPFT{s@B8|&w5^R&$Obzj_P}7Wiz%8Gv k2K?)EsALUBuDjG3Ylo8@C}UHTFSpC`1B#)9y@~(;0NTej-~a#s literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/replaced-attempt.log.gz b/quality/bugbot/evidence/issue-977/replaced-attempt.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..2def114b7af41c59714d4dc57dd940a327ccbf0f GIT binary patch literal 130 zcmV-|0Db=-iwFP!00002{}s&34Z<)C0ML7<@B(1~OI#R$9o)oFi#Cq@p@``T=O;Zx zr#BZ53WiPxU#kw;HA<(DDMLLF!;%+7YONgPFT{s@B8|&w5^R&$Obzj_P}7Wiz%8Gv k2K?)EsALUBuDjG3Ylo8@C}UHTFSpC`1B#)9y@~(;0NTej-~a#s literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/replacement-retry.log.gz b/quality/bugbot/evidence/issue-977/replacement-retry.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..8cd77ebebc6ab362df83f636228b4656c6121f50 GIT binary patch literal 113 zcmV-%0FM73iwFP!00002{}s%^4Z|=90KmVeU;$?Uq<*>yF|Aau T)*%P4pSSV@&L~%LZvX%QGZQd% literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/terminal-publication.log.gz b/quality/bugbot/evidence/issue-977/terminal-publication.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..8cd77ebebc6ab362df83f636228b4656c6121f50 GIT binary patch literal 113 zcmV-%0FM73iwFP!00002{}s%^4Z|=90KmVeU;$?Uq<*>yF|Aau T)*%P4pSSV@&L~%LZvX%QGZQd% literal 0 HcmV?d00001 diff --git a/quality/bugbot/evidence/issue-977/verified-empty-conversation.log.gz b/quality/bugbot/evidence/issue-977/verified-empty-conversation.log.gz new file mode 100644 index 0000000000000000000000000000000000000000..5c8935ccab4daedd7d1689c831a0a22295b3f769 GIT binary patch literal 113 zcmb2|=3oE;rvIX6PV*iz;9z3c!HMvQm-lGk