Skip to content

[#347] 🤖 - 347 347 Develop - #347

Open
efraespada wants to merge 11 commits into
masterfrom
develop
Open

[#347] 🤖 - 347 347 Develop#347
efraespada wants to merge 11 commits into
masterfrom
develop

Conversation

@efraespada

@efraespada efraespada commented Sep 5, 2026

Copy link
Copy Markdown
Member

📌 Summary

Expands Copilot’s workflow and CLI capabilities with safer PR-description policies, comment-driven assistance, organization-scoped setup resources, credential diagnostics, lifecycle synchronization, and scheduled cleanup of inactive waiting issues.


🎯 Related Issues / Tickets

  • None identified.

🧩 Scope of Changes

  • Added:

    • Scheduled inactive-issue cleanup workflow.
    • copilot doctor and copilot reconcile commands.
    • Organization-scoped Secrets and Variables setup.
    • Credential health validation workflow.
    • Configurable PR-description ownership modes.
    • Expanded /copilot commands and lifecycle evidence handling.
    • Documentation and workflow contract validation.
  • Updated:

    • Lifecycle labels, waiting states, reviews, checks, and workflow synchronization.
    • Setup wizard, configuration persistence, and GitHub resource provisioning.
    • Actor authorization and CLI onboarding.
    • Documentation, tests, CI validation, and generated bundles.
  • Removed:

    • setup/.env.
    • npm-specific CLI upgrade adapter.
  • Refactored:

    • Application boundaries and domain/port contracts.
    • Configuration migration and persistence.
    • Setup composition and workflow reconciliation.

🛠️ Technical Details

  • PR descriptions support replace, append, preserve, and disabled modes. Append mode maintains a bounded Copilot-managed section while preserving human-authored content.
  • Lifecycle resolution now incorporates reviews, check suites, workflow runs, waiting states, and agent activity.
  • Inactive issue cleanup scans waiting issues, revalidates each candidate immediately before closing, and posts an explanation comment.
  • Setup supports independent repository or organization storage policies for Secrets and Variables, validates organization access and visibility, and preserves existing effective resources.
  • Comment automation distinguishes read-only analysis, planning, implementation, Bugbot fixes, and general requests, with authorization checks before file modifications.
  • Persisted configuration migrates to schema version 2, removes transient results, preserves unknown fields, and fails closed on persistence errors.
  • Generated GitHub Action and CLI bundles are updated alongside the TypeScript sources.

🔍 How to Test

  1. Install the pinned toolchain and run the quality gates:

    corepack pnpm@​10.12.4 install
    corepack pnpm@​10.12.4 run typecheck
    corepack pnpm@​10.12.4 run lint
    corepack pnpm@​10.12.4 run test:coverage
    corepack pnpm@​10.12.4 run build
  2. Run repository validation:

    corepack pnpm@​10.12.4 run validate:agent-docs
    corepack pnpm@​10.12.4 run validate:docs-page
    corepack pnpm@​10.12.4 run validate:documentation
    corepack pnpm@​10.12.4 run validate:workflows
    git diff --check
  3. Manually verify:

    • copilot setup --dry-run with repository and organization resource options.
    • copilot doctor, confirming credential values are never exposed.
    • copilot reconcile --json against workflow drift.
    • PR-description modes and /copilot description.
    • The scheduled inactive-issue workflow with a test inactivity threshold.

🧪 Test Coverage

  • Unit tests
  • Integration tests
  • End-to-end (E2E) tests
  • Manual testing only

Coverage includes lifecycle replay, inactivity closure, setup and credential workflows, organization authorization, configuration migration, comment routing, CLI commands, repository adapters, architecture boundaries, and workflow contracts.


📸 Screenshots / Recordings (UI changes only)

Not applicable — this PR does not change a graphical user interface.


⚠️ Breaking Changes

  • Lifecycle label inputs changed from copilot-state-* to state-*, with default labels changing from copilot:state:* to state:*. Existing workflows using custom legacy inputs must migrate.
  • Setup no longer uses setup/.env; credentials must be provided through the secure prompt or supported environment/CLI options.
  • CLI upgrade onboarding now uses pnpm.
  • PR-description replace remains the default behavior.

🚀 Deployment Notes

  • Requires database migration
  • Requires environment variable changes
  • Requires feature flag toggle
  • No special deployment steps

Details:

Install the scheduled cleanup workflow through copilot setup or copy it from setup/workflows/. It uses the existing PAT Secret and optional INACTIVITY_THRESHOLD_HOURS Repository Variable. Generated bundles are included in the change.


🔒 Security Considerations

  • Input validation changes
  • Authentication / authorization changes
  • Sensitive data handling changes

Setup validates scopes, visibility, credentials, and organization access. File-modifying comment requests require appropriate authorization. Credential health checks avoid exposing secret values, and the setup PAT placeholder file was removed.


📈 Performance Impact

  • No material performance impact on existing event-driven workflows
  • Improves performance
  • Potential performance regression (explain)

The scheduled cleanup uses paginated issue scans every six hours and revalidates candidates before mutation. Existing event-driven paths retain their current behavior.


📝 Notes for Reviewers

Please review the lifecycle label migration, PR-description ownership modes, organization-scoped resource permissions, authorization checks, and stale-candidate revalidation in inactive issue cleanup. The generated build/ bundles are intentionally updated with the source changes.


✅ Checklist

  • I have self-reviewed my code
  • Code follows project standards and conventions
  • Tests have been added or updated
  • Documentation has been updated (if applicable)
  • No new warnings or lint errors
  • Changes are backward compatible or breaking changes are documented

📚 Additional Context

This branch contains the accumulated develop-line changes covering configurable lifecycle and PR policies, setup hardening, comment-driven assistance, organization resource support, inactive issue cleanup, and pnpm-based onboarding.

@efraespada efraespada self-assigned this Sep 5, 2026
@docs-page

docs-page Bot commented Sep 5, 2026

Copy link
Copy Markdown

To preview the documentation for this pull request, visit the following URL:

docs.page/vypdev/copilot~347

Documentation is deployed and generated using docs.page

@vypbot vypbot changed the title Develop [#347] 🤖 - Develop Sep 5, 2026
@vypbot
vypbot self-requested a review September 5, 2026 20:42
@vypbot vypbot added this to vypdev Sep 5, 2026
@vypbot vypbot moved this to In Progress in vypdev Sep 5, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.46%. Comparing base (7a016cb) to head (7a0dd7f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
- Coverage   92.56%   88.46%   -4.11%     
==========================================
  Files         475      526      +51     
  Lines        8312    10243    +1931     
  Branches     1659     2272     +613     
==========================================
+ Hits         7694     9061    +1367     
- Misses        232      573     +341     
- Partials      386      609     +223     

see 130 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The pull request's title was updated from Develop to [#347] 🤖 - Develop.

  2. @​vypbot was requested to review the pull request.

  3. The pull request was linked to vypdev and moved to the column In Progress.

  4. The base branch was temporarily updated to master.

  5. The description was temporarily modified to include a reference to issue [#347] 🤖 - 347 347 Develop #347.

  6. The base branch was reverted to its original value: master.

  7. The temporary issue reference [#347] 🤖 - 347 347 Develop #347 was removed from the description.

  8. Issue has no size/progress labels to sync.

image

Debug log
[DEBUG] Setup done. Issue number: 347, isSingleAction: false, isIssue: false, isPullRequest: true, isPush: false
[INFO] Running PullRequestUseCase for PR #347.
[INFO] 🔀 Executing PullRequestUseCase.
[DEBUG] PR action assigned
[DEBUG] PR isOpened true
[DEBUG] PR isMerged false
[DEBUG] PR isClosed false
[INFO] ✏️ Executing UpdateTitleUseCase.
[DEBUG] Issue title updated to: [#347] 🤖 - Develop
[INFO] 👤 Executing AssignMemberToIssueUseCase.
[DEBUG] #347 needs 1 assignees.
[INFO] 👀 Executing AssignReviewersToIssueUseCase.
[DEBUG] #347 needs 1 reviewers.
[DEBUG] #347 needs 1 more reviewers.
[INFO] 🔗 Executing LinkPullRequestProjectUseCase.
[DEBUG] Linked PR_kwDONSeBW88AAAABCWloGw with id PVTI_lADOA8wRO84Ajh7Bzg5mepk to project PVT_kwDOA8wRO84Ajh7B
[DEBUG] Target field ID: PVTSSF_lADOA8wRO84Ajh7Bzgb4L2E
[DEBUG] Target option ID: 47fc9ee4
[INFO] 🔗 Executing LinkPullRequestIssueUseCase.
[DEBUG] Changed base branch to master
[DEBUG] Updated PR #347 description with: <!--
Thank you for opening a Pull Request 🚀
Please fill out this template as completely as possible.
Clear PRs = faster reviews = better software.
-->

# 📌 Summary
<!--
Briefly explain what this PR does and why it is needed.
Focus on the intent, not the implementation details.
-->

---

## 🎯 Related Issues / Tickets
<!--
Link any related issues, tickets, or discussions.
Use GitHub keywords to auto-close issues when merged.
-->
- Closes #
- Related to #

---

## 🧩 Scope of Changes
<!--
Describe the scope and nature of the changes at a high level.
-->
- Added:
- Updated:
- Removed:
- Refactored:

---

## 🛠️ Technical Details
<!--
Explain important technical decisions, trade-offs, or architecture changes.
Include anything that may not be obvious from reading the code.
-->

---

## 🔍 How to Test
<!--
Provide clear, step-by-step instructions to test this change.
Assume the reviewer is unfamiliar with the context.
-->
1.
2.
3.

---

## 🧪 Test Coverage
<!--
Indicate what types of tests were added or updated.
-->
- [ ] Unit tests
- [ ] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only (explain why)

---

## 📸 Screenshots / Recordings (UI changes only)
<!--
Include before/after screenshots or short videos if this PR affects the UI.
-->

---

## ⚠️ Breaking Changes
<!--
List any breaking changes and required migration steps.
If none, state "None".
-->
- None

---

## 🚀 Deployment Notes
<!--
Anything required or important during deployment:
- environment variables
- database migrations
- feature flags
- deployment order
-->
- [ ] Requires database migration
- [ ] Requires environment variable changes
- [ ] Requires feature flag toggle
- [ ] No special deployment steps

Details:

---

## 🔒 Security Considerations
<!--
Mention any security-related implications or validations.
-->
- [ ] No security impact
- [ ] Input validation changes
- [ ] Authentication / authorization changes
- [ ] Sensitive data handling changes

---

## 📈 Performance Impact
<!--
Describe any performance considerations, improvements, or regressions.
-->
- [ ] No performance impact
- [ ] Improves performance
- [ ] Potential performance regression (explain)

---

## 📝 Notes for Reviewers
<!--
Highlight areas that need special attention or context for reviewers.
-->

---

## ✅ Checklist
<!--
Confirm all items before requesting review.
-->
- [ ] I have self-reviewed my code
- [ ] Code follows project standards and conventions
- [ ] Tests have been added or updated
- [ ] Documentation has been updated (if applicable)
- [ ] No new warnings or lint errors
- [ ] Changes are backward compatible or breaking changes are documented

---

## 📚 Additional Context
<!--
Any extra information that may help reviewers understand this PR.
Links, references, or follow-up work.
-->


Resolves #347
[DEBUG] Changed base branch to master
[DEBUG] Updated PR #347 description with: <!--
Thank you for opening a Pull Request 🚀
Please fill out this template as completely as possible.
Clear PRs = faster reviews = better software.
-->

# 📌 Summary
<!--
Briefly explain what this PR does and why it is needed.
Focus on the intent, not the implementation details.
-->

---

## 🎯 Related Issues / Tickets
<!--
Link any related issues, tickets, or discussions.
Use GitHub keywords to auto-close issues when merged.
-->
- Closes #
- Related to #

---

## 🧩 Scope of Changes
<!--
Describe the scope and nature of the changes at a high level.
-->
- Added:
- Updated:
- Removed:
- Refactored:

---

## 🛠️ Technical Details
<!--
Explain important technical decisions, trade-offs, or architecture changes.
Include anything that may not be obvious from reading the code.
-->

---

## 🔍 How to Test
<!--
Provide clear, step-by-step instructions to test this change.
Assume the reviewer is unfamiliar with the context.
-->
1.
2.
3.

---

## 🧪 Test Coverage
<!--
Indicate what types of tests were added or updated.
-->
- [ ] Unit tests
- [ ] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only (explain why)

---

## 📸 Screenshots / Recordings (UI changes only)
<!--
Include before/after screenshots or short videos if this PR affects the UI.
-->

---

## ⚠️ Breaking Changes
<!--
List any breaking changes and required migration steps.
If none, state "None".
-->
- None

---

## 🚀 Deployment Notes
<!--
Anything required or important during deployment:
- environment variables
- database migrations
- feature flags
- deployment order
-->
- [ ] Requires database migration
- [ ] Requires environment variable changes
- [ ] Requires feature flag toggle
- [ ] No special deployment steps

Details:

---

## 🔒 Security Considerations
<!--
Mention any security-related implications or validations.
-->
- [ ] No security impact
- [ ] Input validation changes
- [ ] Authentication / authorization changes
- [ ] Sensitive data handling changes

---

## 📈 Performance Impact
<!--
Describe any performance considerations, improvements, or regressions.
-->
- [ ] No performance impact
- [ ] Improves performance
- [ ] Potential performance regression (explain)

---

## 📝 Notes for Reviewers
<!--
Highlight areas that need special attention or context for reviewers.
-->

---

## ✅ Checklist
<!--
Confirm all items before requesting review.
-->
- [ ] I have self-reviewed my code
- [ ] Code follows project standards and conventions
- [ ] Tests have been added or updated
- [ ] Documentation has been updated (if applicable)
- [ ] No new warnings or lint errors
- [ ] Changes are backward compatible or breaking changes are documented

---

## 📚 Additional Context
<!--
Any extra information that may help reviewers understand this PR.
Links, references, or follow-up work.
-->

[INFO] 🔄 Executing SyncSizeAndProgressLabelsFromIssueToPrUseCase.
[DEBUG] Issue #347 has no size or progress labels. Nothing to sync.
[INFO] 📏 Executing CheckPriorityPullRequestSizeUseCase.
[INFO] ✏️ Executing UpdatePullRequestDescriptionUseCase (AI PR description).
[DEBUG] PR description will be generated from workspace diff: base "master", head "develop" (configured agent will run git diff).
[DEBUG] UpdatePullRequestDescription: prompt length=6828, issue description length=2948. Calling configured agent.
[DEBUG] UpdatePullRequestDescription: agent response received. Description length=5317.
[DEBUG] Updated PR #347 description with: # 📌 Summary

Promotes the `develop` branch with expanded Copilot automation, safer application boundaries, richer repository setup, lifecycle maintenance, and synchronized documentation/build artifacts.

---

## 🎯 Related Issues / Tickets

- Closes #347

---

## 🧩 Scope of Changes

- Added:
  - Comment-driven Copilot help, analysis, planning, review, and authorized implementation commands.
  - Scheduled cleanup for inactive waiting issues.
  - Interactive setup wizard, doctor, reconcile, credential health checks, and repository/organization resource scoping.
  - Configuration and documentation contract validation.
  - Lifecycle replay and setup regression coverage.

- Updated:
  - Action inputs, lifecycle labels, workflow templates, authentication guidance, and setup documentation.
  - Authorization checks for file-modifying requests.
  - Configuration persistence, lifecycle synchronization, Bugbot flows, and PR description policies.
  - Compiled CLI and GitHub Action bundles.

- Removed:
  - Legacy `copilot-state-*` action input names in favor of `state-*` names.

- Refactored:
  - Application/domain/repository boundaries, typed application errors, setup policies, and configuration migration handling.

---

## 🛠️ Technical Details

- Comment automation now distinguishes deterministic read-only commands from file-changing requests, validates arguments, and requires appropriate actor authorization for mutations.
- Setup supports interactive, non-interactive, config-file, dry-run, repository-scoped, and organization-scoped configuration. Secrets and Variables are managed independently, with preservation of effective existing resources.
- Inactive issue cleanup only closes non-PR issues that are in a waiting state, have no active agent-processing label, and exceed the validated inactivity threshold.
- Durable configuration is migrated to schema version 2, removes transient execution results, preserves unknown keys, and avoids downgrading future schema versions.
- Lifecycle reconciliation consumes current server labels and external review/check evidence so workflow updates do not overwrite concurrent changes.
- Generated `build/` artifacts are refreshed from the updated TypeScript sources.

---

## 🔍 How to Test

1. Install dependencies with the pinned toolchain:
   `corepack pnpm@​10.12.4 install`
2. Run type checking, linting, unit/integration coverage, and the build:
   `corepack pnpm@​10.12.4 run typecheck`
   `corepack pnpm@​10.12.4 run lint`
   `corepack pnpm@​10.12.4 run test:coverage`
   `corepack pnpm@​10.12.4 run build`
3. Run documentation and workflow validation:
   `corepack pnpm@​10.12.4 run validate:agent-docs`
   `corepack pnpm@​10.12.4 run validate:docs-page`
   `corepack pnpm@​10.12.4 run validate:documentation`
   `corepack pnpm@​10.12.4 run validate:workflows`
4. In a disposable repository, run `copilot setup --dry-run` and verify that the proposed files, credentials, Variables, Secrets, and scopes are reported without applying changes.

---

## 🧪 Test Coverage

- [x] Unit tests
- [x] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only (explain why)

---

## 📸 Screenshots / Recordings (UI changes only)

Not applicable — this PR does not change a user interface.

---

## ⚠️ Breaking Changes

- Workflows overriding legacy `copilot-state-*` inputs must migrate to the corresponding `state-*` inputs.
- Existing durable configuration is migrated automatically; future-schema payloads are preserved without downgrade.

---

## 🚀 Deployment Notes

- [ ] Requires database migration
- [ ] Requires environment variable changes
- [ ] Requires feature flag toggle
- [x] No special deployment steps

Details: The scheduled inactive-issue workflow requires the existing `PAT` secret to operate. `INACTIVITY_THRESHOLD_HOURS` and agent configuration Variables remain optional and have defaults.

---

## 🔒 Security Considerations

- [ ] No security impact
- [x] Input validation changes
- [x] Authentication / authorization changes
- [x] Sensitive data handling changes

Comment content, agent output, diagnostics, and persisted configuration remain bounded and treated as untrusted data. Setup keeps setup credentials separate from workflow credentials and avoids writing secret values to configuration files or logs.

---

## 📈 Performance Impact

- [x] No performance impact
- [ ] Improves performance
- [ ] Potential performance regression (explain)

The scheduled cleanup uses bounded issue evaluation and does not affect normal event-driven processing unless enabled.

---

## 📝 Notes for Reviewers

Please pay particular attention to the setup credent
[untrusted content truncated]

🚀 Happy coding!

Made with ❤️ by vypdev/copilot

@vypbot vypbot changed the title [#347] 🤖 - Develop [#347] 🤖 - 347 Develop Sep 5, 2026
@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Pull-request workflow runs for every workflow completion

Severity: medium

Location: setup/workflows/copilot_pull_request.yml:10

The new workflow_run trigger has no workflows filter, so every workflow completion in the repository launches this Copilot workflow, including unrelated CI, credential-health, deployment, and potentially its own runs. This creates unnecessary queued executions and can repeatedly reconcile PR labels based on unrelated events.
Suggested fix:
Restrict workflow_run to explicitly supported workflow names, or move lifecycle reconciliation into a separate workflow with a precise event filter and self-trigger protection.

Written by vypdev/copilot for commit 7a0dd7f89925297c304769de0f2d892f70826172. This will update automatically on new commits.

@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Unrelated or stale workflow results can block a pull request

Severity: medium

Location: src/application/policies/lifecycle_state_policy.ts:79

readLifecycleExternalEvidence converts every check_suite and workflow_run completion into success or failure without checking the workflow name, check identity, or head SHA. A failed unrelated workflow, or a failed run for an older commit, can therefore mark the current PR as blocked; successful unrelated runs can also move it to reviewing.
Suggested fix:
Accept evidence only from configured validation workflows/checks and verify that the reported head SHA matches the current pull-request head before changing lifecycle state.

Written by vypdev/copilot for commit 7a0dd7f89925297c304769de0f2d892f70826172. This will update automatically on new commits.

@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The description command bypasses actor authorization

Severity: medium

Location: src/application/usecases/comment_automation_command_workflow.ts:19

/copilot description is dispatched directly to invokeExplicit without consulting the supplied ActorAuthorizationPort, unlike dismiss, fix, and implement operations. Any commenter who can trigger the issue-comment workflow can therefore cause the bot to rewrite the pull-request body; in replace mode this can overwrite the complete existing description.
Suggested fix:
Require the same maintainer authorization check before invoking the explicit description update, and return a skipped result when the actor is not authorized.

Written by vypdev/copilot for commit 7a0dd7f89925297c304769de0f2d892f70826172. This will update automatically on new commits.

types: [submitted, edited, dismissed]
check_suite:
types: [completed, rerequested]
workflow_run:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull-request workflow runs for every workflow completion

Severity: medium

Location: setup/workflows/copilot_pull_request.yml:10

The new workflow_run trigger has no workflows filter, so every workflow completion in the repository launches this Copilot workflow, including unrelated CI, credential-health, deployment, and potentially its own runs. This creates unnecessary queued executions and can repeatedly reconcile PR labels based on unrelated events.
Suggested fix:
Restrict workflow_run to explicitly supported workflow names, or move lifecycle reconciliation into a separate workflow with a precise event filter and self-trigger protection.

Written by vypdev/copilot for commit 7a0dd7f89925297c304769de0f2d892f70826172. This will update automatically on new commits.

if (command.name === 'dismiss') return runDismissCommand(param, options, command, actorAuthorizationPort);
if (['review', 'findings', 'recheck'].includes(command.name)) return runReviewCommand(param, options, command);
if (command.name === 'fix') return undefined;
if (command.name === 'description') return runDescriptionCommand(param, options);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description command bypasses actor authorization

Severity: medium

Location: src/application/usecases/comment_automation_command_workflow.ts:19

/copilot description is dispatched directly to invokeExplicit without consulting the supplied ActorAuthorizationPort, unlike dismiss, fix, and implement operations. Any commenter who can trigger the issue-comment workflow can therefore cause the bot to rewrite the pull-request body; in replace mode this can overwrite the complete existing description.
Suggested fix:
Require the same maintainer authorization check before invoking the explicit description update, and return a skipped result when the actor is not authorized.

Written by vypdev/copilot for commit 7a0dd7f89925297c304769de0f2d892f70826172. This will update automatically on new commits.

if (inputs.eventName === 'check_suite') {
return { checks: readChecksEvidence(inputs.check_suite?.status, inputs.check_suite?.conclusion) };
}
if (inputs.eventName === 'workflow_run') {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated or stale workflow results can block a pull request

Severity: medium

Location: src/application/policies/lifecycle_state_policy.ts:79

readLifecycleExternalEvidence converts every check_suite and workflow_run completion into success or failure without checking the workflow name, check identity, or head SHA. A failed unrelated workflow, or a failed run for an older commit, can therefore mark the current PR as blocked; successful unrelated runs can also move it to reviewing.
Suggested fix:
Accept evidence only from configured validation workflows/checks and verify that the reported head SHA matches the current pull-request head before changing lifecycle state.

Written by vypdev/copilot for commit 7a0dd7f89925297c304769de0f2d892f70826172. This will update automatically on new commits.

@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The pull request's title was updated from Develop to [#347] 🤖 - 347 Develop.

  2. The base branch was temporarily updated to master.

  3. The description was temporarily modified to include a reference to issue [#347] 🤖 - 347 347 Develop #347.

  4. The base branch was reverted to its original value: master.

  5. The temporary issue reference [#347] 🤖 - 347 347 Develop #347 was removed from the description.

  6. Issue has no size/progress labels to sync.

  7. Potential problems detection completed. 3 new/current finding(s) from configured agent; states: open=3.

  8. Lifecycle state synchronized to changes-requested.

  9. Waiting state synchronized to awaiting-issue-author.

image

Debug log
[DEBUG] Setup done. Issue number: 347, isSingleAction: false, isIssue: false, isPullRequest: true, isPush: false
[INFO] Added Copilot agent activity label on target #347.
[INFO] Running PullRequestUseCase for PR #347.
[INFO] 🔀 Executing PullRequestUseCase.
[DEBUG] PR action opened
[DEBUG] PR isOpened true
[DEBUG] PR isMerged false
[DEBUG] PR isClosed false
[INFO] ✏️ Executing UpdateTitleUseCase.
[DEBUG] Issue title updated to: [#347] 🤖 - 347  Develop
[INFO] 👤 Executing AssignMemberToIssueUseCase.
[DEBUG] #347 needs 1 assignees.
[INFO] 👀 Executing AssignReviewersToIssueUseCase.
[DEBUG] #347 needs 1 reviewers.
[INFO] 🔗 Executing LinkPullRequestProjectUseCase.
[DEBUG] Content PR_kwDONSeBW88AAAABCWloGw is already linked to project PVT_kwDOA8wRO84Ajh7B.
[DEBUG] LinkPullRequest: pull request already linked to project "vypdev" or link failed.
[INFO] 🔗 Executing LinkPullRequestIssueUseCase.
[DEBUG] Changed base branch to master
[DEBUG] Updated PR #347 description with: <!--
Thank you for opening a Pull Request 🚀
Please fill out this template as completely as possible.
Clear PRs = faster reviews = better software.
-->

# 📌 Summary
<!--
Briefly explain what this PR does and why it is needed.
Focus on the intent, not the implementation details.
-->

---

## 🎯 Related Issues / Tickets
<!--
Link any related issues, tickets, or discussions.
Use GitHub keywords to auto-close issues when merged.
-->
- Closes #
- Related to #

---

## 🧩 Scope of Changes
<!--
Describe the scope and nature of the changes at a high level.
-->
- Added:
- Updated:
- Removed:
- Refactored:

---

## 🛠️ Technical Details
<!--
Explain important technical decisions, trade-offs, or architecture changes.
Include anything that may not be obvious from reading the code.
-->

---

## 🔍 How to Test
<!--
Provide clear, step-by-step instructions to test this change.
Assume the reviewer is unfamiliar with the context.
-->
1.
2.
3.

---

## 🧪 Test Coverage
<!--
Indicate what types of tests were added or updated.
-->
- [ ] Unit tests
- [ ] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only (explain why)

---

## 📸 Screenshots / Recordings (UI changes only)
<!--
Include before/after screenshots or short videos if this PR affects the UI.
-->

---

## ⚠️ Breaking Changes
<!--
List any breaking changes and required migration steps.
If none, state "None".
-->
- None

---

## 🚀 Deployment Notes
<!--
Anything required or important during deployment:
- environment variables
- database migrations
- feature flags
- deployment order
-->
- [ ] Requires database migration
- [ ] Requires environment variable changes
- [ ] Requires feature flag toggle
- [ ] No special deployment steps

Details:

---

## 🔒 Security Considerations
<!--
Mention any security-related implications or validations.
-->
- [ ] No security impact
- [ ] Input validation changes
- [ ] Authentication / authorization changes
- [ ] Sensitive data handling changes

---

## 📈 Performance Impact
<!--
Describe any performance considerations, improvements, or regressions.
-->
- [ ] No performance impact
- [ ] Improves performance
- [ ] Potential performance regression (explain)

---

## 📝 Notes for Reviewers
<!--
Highlight areas that need special attention or context for reviewers.
-->

---

## ✅ Checklist
<!--
Confirm all items before requesting review.
-->
- [ ] I have self-reviewed my code
- [ ] Code follows project standards and conventions
- [ ] Tests have been added or updated
- [ ] Documentation has been updated (if applicable)
- [ ] No new warnings or lint errors
- [ ] Changes are backward compatible or breaking changes are documented

---

## 📚 Additional Context
<!--
Any extra information that may help reviewers understand this PR.
Links, references, or follow-up work.
-->


Resolves #347
[DEBUG] Changed base branch to master
[DEBUG] Updated PR #347 description with: <!--
Thank you for opening a Pull Request 🚀
Please fill out this template as completely as possible.
Clear PRs = faster reviews = better software.
-->

# 📌 Summary
<!--
Briefly explain what this PR does and why it is needed.
Focus on the intent, not the implementation details.
-->

---

## 🎯 Related Issues / Tickets
<!--
Link any related issues, tickets, or discussions.
Use GitHub keywords to auto-close issues when merged.
-->
- Closes #
- Related to #

---

## 🧩 Scope of Changes
<!--
Describe the scope and nature of the changes at a high level.
-->
- Added:
- Updated:
- Removed:
- Refactored:

---

## 🛠️ Technical Details
<!--
Explain important technical decisions, trade-offs, or architecture changes.
Include anything that may not be obvious from reading the code.
-->

---

## 🔍 How to Test
<!--
Provide clear, step-by-step instructions to test this change.
Assume the reviewer is unfamiliar with the context.
-->
1.
2.
3.

---

## 🧪 Test Coverage
<!--
Indicate what types of tests were added or updated.
-->
- [ ] Unit tests
- [ ] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only (explain why)

---

## 📸 Screenshots / Recordings (UI changes only)
<!--
Include before/after screenshots or short videos if this PR affects the UI.
-->

---

## ⚠️ Breaking Changes
<!--
List any breaking changes and required migration steps.
If none, state "None".
-->
- None

---

## 🚀 Deployment Notes
<!--
Anything required or important during deployment:
- environment variables
- database migrations
- feature flags
- deployment order
-->
- [ ] Requires database migration
- [ ] Requires environment variable changes
- [ ] Requires feature flag toggle
- [ ] No special deployment steps

Details:

---

## 🔒 Security Considerations
<!--
Mention any security-related implications or validations.
-->
- [ ] No security impact
- [ ] Input validation changes
- [ ] Authentication / authorization changes
- [ ] Sensitive data handling changes

---

## 📈 Performance Impact
<!--
Describe any performance considerations, improvements, or regressions.
-->
- [ ] No performance impact
- [ ] Improves performance
- [ ] Potential performance regression (explain)

---

## 📝 Notes for Reviewers
<!--
Highlight areas that need special attention or context for reviewers.
-->

---

## ✅ Checklist
<!--
Confirm all items before requesting review.
-->
- [ ] I have self-reviewed my code
- [ ] Code follows project standards and conventions
- [ ] Tests have been added or updated
- [ ] Documentation has been updated (if applicable)
- [ ] No new warnings or lint errors
- [ ] Changes are backward compatible or breaking changes are documented

---

## 📚 Additional Context
<!--
Any extra information that may help reviewers understand this PR.
Links, references, or follow-up work.
-->

[INFO] 🔄 Executing SyncSizeAndProgressLabelsFromIssueToPrUseCase.
[DEBUG] Issue #347 has no size or progress labels. Nothing to sync.
[INFO] 📏 Executing CheckPriorityPullRequestSizeUseCase.
[INFO] ✏️ Executing UpdatePullRequestDescriptionUseCase (AI PR description).
[DEBUG] PR description will be generated from workspace diff: base "master", head "develop" (configured agent will run git diff).
[DEBUG] UpdatePullRequestDescription: prompt length=6828, issue description length=2948. Calling configured agent.
[DEBUG] UpdatePullRequestDescription: agent response received. Description length=6703.
[DEBUG] Updated PR #347 description with: # 📌 Summary

Expands Copilot’s workflow and CLI capabilities with safer PR-description policies, comment-driven assistance, organization-scoped setup resources, credential diagnostics, lifecycle synchronization, and scheduled cleanup of inactive waiting issues.

---

## 🎯 Related Issues / Tickets

- No linked issue was provided in the issue context.

---

## 🧩 Scope of Changes

- Added:
  - Scheduled `close_inactive_issues_action` workflow.
  - `copilot doctor` and `copilot reconcile` CLI commands.
  - Organization-scoped Secrets and Variables setup support.
  - Credential health workflow and validation.
  - Configurable PR-description ownership modes.
  - Expanded `/copilot` commands and lifecycle evidence handling.
  - Documentation and workflow contract validation.

- Updated:
  - Lifecycle labels, waiting states, and PR review/check synchronization.
  - Setup wizard, configuration persistence, and GitHub resource provisioning.
  - Actor authorization for organization members and repository collaborators.
  - CLI onboarding and upgrade flow to use pnpm.
  - Documentation, setup workflows, CI validation, tests, and generated bundles.

- Removed:
  - The setup `.env` file containing a PAT placeholder.
  - The npm-specific CLI upgrade adapter.

- Refactored:
  - Application boundaries to use narrower domain and port contracts.
  - Configuration migration and persistence handling.
  - Setup composition and workflow reconciliation.

---

## 🛠️ Technical Details

- PR descriptions now support `replace`, `append`, `preserve`, and `disabled` modes. Append mode maintains a bounded Copilot-managed section while preserving human-authored content.
- Lifecycle state resolution incorporates pull request reviews, check suites, workflow runs, waiting states, and agent activity.
- Inactive issue cleanup scans waiting issues, re-reads each candidate immediately before mutation, closes only still-eligible issues, and posts an explanation comment.
- Setup separates Secret and Variable scopes, supports repository or organization storage, validates organization visibility, preserves existing resources, and reports remote access limitations.
- Comment automation distinguishes read-only analysis, planning, implementation, Bugbot fixes, and general requests, with authorization checks before file-modifying actions.
- Persisted configuration now migrates to schema version 2, removes transient results, preserves unknown fields, and fails closed on persistence errors.
- Source changes are accompanied by regenerated GitHub Action and CLI bundles.

---

## 🔍 How to Test

1. Install the pinned toolchain and run the project quality gates:

   bash
   corepack pnpm@​10.12.4 install
   corepack pnpm@​10.12.4 run typecheck
   corepack pnpm@​10.12.4 run lint
   corepack pnpm@​10.12.4 run test:coverage
   corepack pnpm@​10.12.4 run build
   

2. Run the repository validation commands:

   bash
   corepack pnpm@​10.12.4 run validate:agent-docs
   corepack pnpm@​10.12.4 run validate:docs-page
   corepack pnpm@​10.12.4 run validate:documentation
   corepack pnpm@​10.12.4 run validate:workflows
   git diff --check
   

3. Manually verify the new operational flows:
   - Run `copilot setup --dry-run` with repository and organization resource options.
   - Run `copilot doctor` and confirm credential results do not expose secret values.
   - Run `copilot reconcile --json` against a repository with setup-managed workflow drift.
   - Exercise PR description modes and `/copilot description`.
   - Dispatch `copilot_close_inactive_issues.yml` with a test inactivity threshold.

---

## 🧪 Test Coverage

- [x] Unit tests
- [x] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only

Coverage includes lifecycle replay, inactivity closure, setup and credential workflows, organization authorization, configuration migration, comment routing, CLI commands, repository adapters, architecture boundaries, and workflow contracts.

---

## 📸 Screenshots / Recordings (UI changes only)

Not applicable — this PR does not change a graphical user interface.

---

## ⚠️ Breaking Changes

- Lifecycle label inputs were renamed from `copilot-state-*` to `state-*`, and their default label names changed from `copilot:state:*` to `state:*`. Existing workflows using custom legacy input names must migrate.
- Setup no longer uses `setup/.env`; operators must provide credentials through the secure prompt or supported environment/CLI options.
- No breaking change to the default PR-description behavior; `replace` remains the default mode.

---

## 🚀 Deployment Notes

- [ ] Requires database migration
- [ ] Requires 
[untrusted content truncated]

🚀 Happy coding!

Made with ❤️ by vypdev/copilot

@vypbot vypbot changed the title [#347] 🤖 - 347 Develop [#347] 🤖 - 347 347 Develop Sep 5, 2026
@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Setup requires both runtime and model-provider credentials

Severity: medium

Location: src/application/policies/setup_configuration_plan.ts:81

The setup plan adds the agent runtime credential and the model-provider credential as independent mandatory requirements. However, authentication accepts either usable credential for providers such as Codex, and the setup collector aborts when any listed credential is missing. A valid setup with only one supported credential can therefore fail unnecessarily.
Suggested fix:
Represent alternative credentials as credential groups and require at least one usable credential, or align setup requirements with the provider authentication policy.

Written by vypdev/copilot for commit 5e99c194a17e7a282756e2aea2498baa2f85f8da. This will update automatically on new commits.

@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Setup requires credentials for disabled workflows

Severity: medium

Location: src/application/policies/setup_configuration_plan.ts:75

Credential requirements are generated for every configured agent task without checking which features are enabled. Consequently, disabling workflows with the setup feature selection does not prevent their agent credentials from being requested and validated, so setup can fail because of secrets needed only by unused reviewer, fixer, release, or other roles.
Suggested fix:
Derive required agent credentials from the enabled features and only include credentials for workflows that will be installed, while retaining any explicitly shared credentials required by enabled workflows.

Written by vypdev/copilot for commit 5e99c194a17e7a282756e2aea2498baa2f85f8da. This will update automatically on new commits.

@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Custom model providers cannot complete setup

Severity: medium

Location: src/infrastructure/setup_credential_validation_adapter.ts:86

For an unrecognized model provider, the setup plan generates a secret name such as <provider>_API_KEY, but the credential validation adapter has no endpoint for that provider and returns an unverifiable result. SetupCredentialsUseCase rejects every result that is not valid, so configurations using custom providers accepted elsewhere by the agent authentication policy cannot be provisioned through setup.
Suggested fix:
Allow explicitly configured custom or local providers to use an unverifiable credential path, or require a provider-specific validation endpoint before generating a credential requirement.

Written by vypdev/copilot for commit 5e99c194a17e7a282756e2aea2498baa2f85f8da. This will update automatically on new commits.

if (!requirements.has(name)) requirements.set(name, { name, kind, description, provider, model });
};
add('PAT', 'workflowPat', 'A separate GitHub token owned by the bot account. It is used by workflows at runtime.');
for (const task of SETUP_AGENT_TASKS) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup requires credentials for disabled workflows

Severity: medium

Location: src/application/policies/setup_configuration_plan.ts:75

Credential requirements are generated for every configured agent task without checking which features are enabled. Consequently, disabling workflows with the setup feature selection does not prevent their agent credentials from being requested and validated, so setup can fail because of secrets needed only by unused reviewer, fixer, release, or other roles.
Suggested fix:
Derive required agent credentials from the enabled features and only include credentials for workflows that will be installed, while retaining any explicitly shared credentials required by enabled workflows.

Written by vypdev/copilot for commit 5e99c194a17e7a282756e2aea2498baa2f85f8da. This will update automatically on new commits.

auth: 'bearer' | 'x-api-key' | 'query' | 'basic';
}

function endpointFor(requirement: SetupCredentialRequirement): CredentialEndpoint | undefined {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Custom model providers cannot complete setup

Severity: medium

Location: src/infrastructure/setup_credential_validation_adapter.ts:86

For an unrecognized model provider, the setup plan generates a secret name such as <provider>_API_KEY, but the credential validation adapter has no endpoint for that provider and returns an unverifiable result. SetupCredentialsUseCase rejects every result that is not valid, so configurations using custom providers accepted elsewhere by the agent authentication policy cannot be provisioned through setup.
Suggested fix:
Allow explicitly configured custom or local providers to use an unverifiable credential path, or require a provider-specific validation endpoint before generating a credential requirement.

Written by vypdev/copilot for commit 5e99c194a17e7a282756e2aea2498baa2f85f8da. This will update automatically on new commits.

add('CURSOR_API_KEY', 'apiKey', 'Cursor API key used by the Cursor agent runtime.', 'cursor', agent.model);
continue;
}
if (agent.provider === 'opencode') add('OPENCODE_API_KEY', 'apiKey', 'OpenCode API key used by the OpenCode agent runtime.', 'opencode', agent.model);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setup requires both runtime and model-provider credentials

Severity: medium

Location: src/application/policies/setup_configuration_plan.ts:81

The setup plan adds the agent runtime credential and the model-provider credential as independent mandatory requirements. However, authentication accepts either usable credential for providers such as Codex, and the setup collector aborts when any listed credential is missing. A valid setup with only one supported credential can therefore fail unnecessarily.
Suggested fix:
Represent alternative credentials as credential groups and require at least one usable credential, or align setup requirements with the provider authentication policy.

Written by vypdev/copilot for commit 5e99c194a17e7a282756e2aea2498baa2f85f8da. This will update automatically on new commits.

@vypbot

vypbot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The pull request's title was updated from [#347] 🤖 - 347 Develop to [#347] 🤖 - 347 347 Develop.

  2. The base branch was temporarily updated to master.

  3. The description was temporarily modified to include a reference to issue [#347] 🤖 - 347 347 Develop #347.

  4. The base branch was reverted to its original value: master.

  5. The temporary issue reference [#347] 🤖 - 347 347 Develop #347 was removed from the description.

  6. Issue has no size/progress labels to sync.

  7. Potential problems detection completed. 3 new/current finding(s) from configured agent; states: open=6.

image

Debug log
[DEBUG] Setup done. Issue number: 347, isSingleAction: false, isIssue: false, isPullRequest: true, isPush: false
[INFO] Added Copilot agent activity label on target #347.
[INFO] Running PullRequestUseCase for PR #347.
[INFO] 🔀 Executing PullRequestUseCase.
[DEBUG] PR action synchronize
[DEBUG] PR isOpened true
[DEBUG] PR isMerged false
[DEBUG] PR isClosed false
[INFO] ✏️ Executing UpdateTitleUseCase.
[DEBUG] Issue title updated to: [#347] 🤖 - 347  347 Develop
[INFO] 👤 Executing AssignMemberToIssueUseCase.
[DEBUG] #347 needs 1 assignees.
[INFO] 👀 Executing AssignReviewersToIssueUseCase.
[DEBUG] #347 needs 1 reviewers.
[INFO] 🔗 Executing LinkPullRequestProjectUseCase.
[DEBUG] Content PR_kwDONSeBW88AAAABCWloGw is already linked to project PVT_kwDOA8wRO84Ajh7B.
[DEBUG] LinkPullRequest: pull request already linked to project "vypdev" or link failed.
[INFO] 🔗 Executing LinkPullRequestIssueUseCase.
[DEBUG] Changed base branch to master
[DEBUG] Updated PR #347 description with: # 📌 Summary

Expands Copilot’s workflow and CLI capabilities with safer PR-description policies, comment-driven assistance, organization-scoped setup resources, credential diagnostics, lifecycle synchronization, and scheduled cleanup of inactive waiting issues.

---

## 🎯 Related Issues / Tickets

- No linked issue was provided in the issue context.

---

## 🧩 Scope of Changes

- Added:
  - Scheduled `close_inactive_issues_action` workflow.
  - `copilot doctor` and `copilot reconcile` CLI commands.
  - Organization-scoped Secrets and Variables setup support.
  - Credential health workflow and validation.
  - Configurable PR-description ownership modes.
  - Expanded `/copilot` commands and lifecycle evidence handling.
  - Documentation and workflow contract validation.

- Updated:
  - Lifecycle labels, waiting states, and PR review/check synchronization.
  - Setup wizard, configuration persistence, and GitHub resource provisioning.
  - Actor authorization for organization members and repository collaborators.
  - CLI onboarding and upgrade flow to use pnpm.
  - Documentation, setup workflows, CI validation, tests, and generated bundles.

- Removed:
  - The setup `.env` file containing a PAT placeholder.
  - The npm-specific CLI upgrade adapter.

- Refactored:
  - Application boundaries to use narrower domain and port contracts.
  - Configuration migration and persistence handling.
  - Setup composition and workflow reconciliation.

---

## 🛠️ Technical Details

- PR descriptions now support `replace`, `append`, `preserve`, and `disabled` modes. Append mode maintains a bounded Copilot-managed section while preserving human-authored content.
- Lifecycle state resolution incorporates pull request reviews, check suites, workflow runs, waiting states, and agent activity.
- Inactive issue cleanup scans waiting issues, re-reads each candidate immediately before mutation, closes only still-eligible issues, and posts an explanation comment.
- Setup separates Secret and Variable scopes, supports repository or organization storage, validates organization visibility, preserves existing resources, and reports remote access limitations.
- Comment automation distinguishes read-only analysis, planning, implementation, Bugbot fixes, and general requests, with authorization checks before file-modifying actions.
- Persisted configuration now migrates to schema version 2, removes transient results, preserves unknown fields, and fails closed on persistence errors.
- Source changes are accompanied by regenerated GitHub Action and CLI bundles.

---

## 🔍 How to Test

1. Install the pinned toolchain and run the project quality gates:

   bash
   corepack pnpm@​10.12.4 install
   corepack pnpm@​10.12.4 run typecheck
   corepack pnpm@​10.12.4 run lint
   corepack pnpm@​10.12.4 run test:coverage
   corepack pnpm@​10.12.4 run build
   

2. Run the repository validation commands:

   bash
   corepack pnpm@​10.12.4 run validate:agent-docs
   corepack pnpm@​10.12.4 run validate:docs-page
   corepack pnpm@​10.12.4 run validate:documentation
   corepack pnpm@​10.12.4 run validate:workflows
   git diff --check
   

3. Manually verify the new operational flows:
   - Run `copilot setup --dry-run` with repository and organization resource options.
   - Run `copilot doctor` and confirm credential results do not expose secret values.
   - Run `copilot reconcile --json` against a repository with setup-managed workflow drift.
   - Exercise PR description modes and `/copilot description`.
   - Dispatch `copilot_close_inactive_issues.yml` with a test inactivity threshold.

---

## 🧪 Test Coverage

- [x] Unit tests
- [x] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only

Coverage includes lifecycle replay, inactivity closure, setup and credential workflows, organization authorization, configuration migration, comment routing, CLI commands, repository adapters, architecture boundaries, and workflow contracts.

---

## 📸 Screenshots / Recordings (UI changes only)

Not applicable — this PR does not change a graphical user interface.

---

## ⚠️ Breaking Changes

- Lifecycle label inputs were renamed from `copilot-state-*` to `state-*`, and their default label names changed from `copilot:state:*` to `state:*`. Existing workflows using custom legacy input names must migrate.
- Setup no longer uses `setup/.env`; operators must provide credentials through the secure prompt or supported environment/CLI options.
- No breaking change to the default PR-description behavior; `replace` remains the default mode.

---

## 🚀 Deployment Notes

- [ ] Requires database migration
- [ ] Requires environment variable changes
- [ ] Requires feature flag toggle
- [x] No special deployment steps

Details:

The new scheduled workflow should be installed through `copilot setup` or copied from `setup/workflows/`. It uses the existing `PAT` Secret and optional `INACTIVITY_THRESHOLD_HOURS` Repository Variable. Generated bundles are included in the change.

---

## 🔒 Security Considerations

- [x] Input validation changes
- [x] Authentication / authorization changes
- [x] Sensitive data handling changes

Setup validates scopes, visibility, credential inputs, and organization access. File-modifying comment requests require organization membership or sufficient repository permissions. The setup `.env` PAT placeholder was removed, and credential health checks avoid exposing secret values.

---

## 📈 Performance Impact

- [x] No material performance impact on existing event-driven workflows
- [ ] Improves performance
- [ ] Potential performance regression (explain)

The scheduled cleanup performs paginated GitHub issue scans every six hours and revalidates candidates before mutation. Existing event-driven paths retain their current behavior.

---

## 📝 Notes for Reviewers

Please review the lifecycle label migration, PR-description ownership modes, organization-scoped resource permissions, and the stale-candidate revalidation in inactive issue cleanup. The generated `build/` bundles are intentionally updated alongside the TypeScript sources.

---

## ✅ Checklist

- [ ] I have self-reviewed my code
- [x] Code follows project standards and conventions
- [x] Tests have been added or updated
- [x] Documentation has been updated (if applicable)
- [ ] No new warnings or lint errors
- [x] Changes are backward compatible or breaking changes are documented

---

## 📚 Additional Context

This branch contains the accumulated develop-line changes from configurable lifecycle and PR policies through setup hardening, comment-driven assistance, organization resource support, inactive issue cleanup, and pnpm-based onboarding.

&lt;!-- copilot-configuration-start
{
    "branchType": "feature",
    "parentBranch": "master",
    "schemaVersion": 2
}
copilot-configuration-end --&gt;

Resolves #347
[DEBUG] Changed base branch to master
[DEBUG] Updated PR #347 description with: # 📌 Summary

Expands Copilot’s workflow and CLI capabilities with safer PR-description policies, comment-driven assistance, organization-scoped setup resources, credential diagnostics, lifecycle synchronization, and scheduled cleanup of inactive waiting issues.

---

## 🎯 Related Issues / Tickets

- No linked issue was provided in the issue context.

---

## 🧩 Scope of Changes

- Added:
  - Scheduled `close_inactive_issues_action` workflow.
  - `copilot doctor` and `copilot reconcile` CLI commands.
  - Organization-scoped Secrets and Variables setup support.
  - Credential health workflow and validation.
  - Configurable PR-description ownership modes.
  - Expanded `/copilot` commands and lifecycle evidence handling.
  - Documentation and workflow contract validation.

- Updated:
  - Lifecycle labels, waiting states, and PR review/check synchronization.
  - Setup wizard, configuration persistence, and GitHub resource provisioning.
  - Actor authorization for organization members and repository collaborators.
  - CLI onboarding and upgrade flow to use pnpm.
  - Documentation, setup workflows, CI validation, tests, and generated bundles.

- Removed:
  - The setup `.env` file containing a PAT placeholder.
  - The npm-specific CLI upgrade adapter.

- Refactored:
  - Application boundaries to use narrower domain and port contracts.
  - Configuration migration and persistence handling.
  - Setup composition and workflow reconciliation.

---

## 🛠️ Technical Details

- PR descriptions now support `replace`, `append`, `preserve`, and `disabled` modes. Append mode maintains a bounded Copilot-managed section while preserving human-authored content.
- Lifecycle state resolution incorporates pull request reviews, check suites, workflow runs, waiting states, and agent activity.
- Inactive issue cleanup scans waiting issues, re-reads each candidate immediately before mutation, closes only still-eligible issues, and posts an explanation comment.
- Setup separates Secret and Variable scopes, supports repository or organization storage, validates organization visibility, preserves existing resources, and reports remote access limitations.
- Comment automation distinguishes read-only analysis, planning, implementation, Bugbot fixes, and general requests, with authorization checks before file-modifying actions.
- Persisted configuration now migrates to schema version 2, removes transient results, preserves unknown fields, and fails closed on persistence errors.
- Source changes are accompanied by regenerated GitHub Action and CLI bundles.

---

## 🔍 How to Test

1. Install the pinned toolchain and run the project quality gates:

   bash
   corepack pnpm@​10.12.4 install
   corepack pnpm@​10.12.4 run typecheck
   corepack pnpm@​10.12.4 run lint
   corepack pnpm@​10.12.4 run test:coverage
   corepack pnpm@​10.12.4 run build
   

2. Run the repository validation commands:

   bash
   corepack pnpm@​10.12.4 run validate:agent-docs
   corepack pnpm@​10.12.4 run validate:docs-page
   corepack pnpm@​10.12.4 run validate:documentation
   corepack pnpm@​10.12.4 run validate:workflows
   git diff --check
   

3. Manually verify the new operational flows:
   - Run `copilot setup --dry-run` with repository and organization resource options.
   - Run `copilot doctor` and confirm credential results do not expose secret values.
   - Run `copilot reconcile --json` against a repository with setup-managed workflow drift.
   - Exercise PR description modes and `/copilot description`.
   - Dispatch `copilot_close_inactive_issues.yml` with a test inactivity threshold.

---

## 🧪 Test Coverage

- [x] Unit tests
- [x] Integration tests
- [ ] End-to-end (E2E) tests
- [ ] Manual testing only

Coverage includes lifecycle replay, inactivity closure, setup and credential workflows, organization authorization, configuration migration, comment routing, CLI commands, repository adapters, architecture boundaries, and workflow contracts.

---

## 📸 Screenshots / Recordings (UI changes only)

Not applicable — this PR does not chan
[untrusted content truncated]

🚀 Happy coding!

Made with ❤️ by vypdev/copilot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants