Skip to content

[#347] 🤖 - Develop - #347

Open
efraespada wants to merge 18 commits into
masterfrom
develop
Open

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

Conversation

@efraespada

@efraespada efraespada commented Sep 5, 2026

Copy link
Copy Markdown
Member

📌 Summary

Expands Copilot’s workflow automation, CLI, setup wizard, lifecycle synchronization, comment assistance, credential diagnostics, and pull-request description management while improving configuration safety and documentation validation.


🎯 Related Issues / Tickets


🧩 Scope of Changes

  • Added:

    • Scheduled inactive-issue cleanup and credential-health workflows.
    • copilot doctor and copilot reconcile commands.
    • Organization-scoped Secrets and Variables configuration.
    • Configurable pull-request description ownership modes.
    • Expanded /copilot commands, welcome messages, and authorization checks.
    • Documentation and workflow contract validation.
  • Updated:

    • Lifecycle labels, waiting states, reviews, checks, workflow synchronization, and agent activity tracking.
    • Setup wizard, credential validation, configuration persistence, and resource provisioning.
    • CLI onboarding and upgrades to use pnpm.
    • Documentation, tests, CI validation, and generated bundles.
  • Removed:

    • Legacy setup/.env.
    • npm-based CLI upgrade implementation, replaced with pnpm.
  • Refactored:

    • Application boundaries, semantic ports, typed errors, and composition roots.
    • Configuration migration and persistence.
    • Setup planning, resource provisioning, and workflow reconciliation.

🛠️ Technical Details

  • Pull-request descriptions support replace, append, preserve, and disabled modes. Append mode preserves human-authored content and maintains a bounded Copilot-managed section. replace remains the default.
  • Lifecycle reconciliation incorporates reviews, check suites, workflow runs, waiting states, and agent activity, while validating evidence against the current pull-request head.
  • Inactive-issue cleanup runs every six hours, scans waiting issues, revalidates each candidate immediately before closing, and posts an explanation comment.
  • Setup separates the operator setup PAT from the workflow PAT, validates credentials and organization access, supports independent repository or organization storage policies, and preserves existing effective resources.
  • Comment automation distinguishes read-only analysis, planning, review, implementation, Bugbot fixes, and general requests. File-modifying operations require authorization and configured write permissions.
  • Persisted configuration migrates to schema version 2, removes transient results, preserves unknown fields, and safely retains future schema versions.
  • Documentation validation checks routes, links, YAML snippets, Action references, public inputs, and required terminology. Workflow validation checks queue gates, permissions, timeouts, runners, and workflow contracts.
  • 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 local workflow drift.
    • Pull-request description modes and /copilot description.
    • Read-only and file-modifying /copilot commands with authorized and unauthorized actors.
    • Scheduled inactive-issue cleanup with a test inactivity threshold.
    • Credential-health checks for selected configured providers.

🧪 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 defaults changing from copilot:state:* to state:*. Existing workflows using custom legacy inputs must migrate.
  • Setup no longer uses setup/.env; credentials must be supplied through the secure prompt or supported environment and CLI options.
  • CLI upgrade onboarding now uses pnpm.
  • Pull-request 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 and credential-health workflows through copilot setup or copy them from setup/workflows/. Inactive-issue cleanup is opt-in and uses the existing PAT Secret plus the optional INACTIVITY_THRESHOLD_HOURS Repository Variable. Generated bundles are included in the change.


🔒 Security Considerations

  • No security impact
  • 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 setup no longer includes a PAT placeholder file or persists setup credentials.


📈 Performance Impact

  • No performance impact
  • Improves performance
  • Potential performance regression (explain)

The scheduled cleanup uses paginated issue scans every six hours and revalidates candidates before mutation. CLI update checks use bounded network latency and a local cache. Existing event-driven paths retain their current behavior.


📝 Notes for Reviewers

Please review the lifecycle label migration, pull-request description ownership modes, organization resource permissions, comment authorization checks, stale-candidate revalidation in inactive-issue cleanup, and the generated build/ bundles.


✅ 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 pull-request 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

codecov-commenter commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #347      +/-   ##
==========================================
- Coverage   92.56%   88.08%   -4.48%     
==========================================
  Files         475      529      +54     
  Lines        8312    10671    +2359     
  Branches     1659     2451     +792     
==========================================
+ Hits         7694     9400    +1706     
- Misses        232      615     +383     
- Partials      386      656     +270     

see 166 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] 🤖 - Develop #347.

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

  7. The temporary issue reference [#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.


Resolved (configured agent confirmed fixed in latest analysis).

Made with ❤️ by vypdev/copilot

@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.


Resolved (configured agent confirmed fixed in latest analysis).

Made with ❤️ by vypdev/copilot

@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.


Resolved (configured agent confirmed fixed in latest analysis).

Made with ❤️ by vypdev/copilot

Comment thread setup/workflows/copilot_pull_request.yml Outdated
Comment thread src/application/usecases/comment_automation_command_workflow.ts Outdated
Comment thread src/application/policies/lifecycle_state_policy.ts
@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] 🤖 - Develop #347.

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

  5. The temporary issue reference [#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 commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. The base branch was temporarily updated to master.

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

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

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

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

  6. Potential problems detection completed. 1 new/current finding(s) from configured agent; 2 marked as resolved by configured agent; states: open=1, fixed=8.

  7. Lifecycle state synchronized to changes-requested.

  8. 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 synchronize
[DEBUG] PR isOpened true
[DEBUG] PR isMerged false
[DEBUG] PR isClosed false
[INFO] ✏️ Executing UpdateTitleUseCase.
[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

- Closes #347

---

## 🧩 Scope of Changes

- Added:
  - Scheduled inactive-issue cleanup and credential-health workflows.
  - `copilot doctor` and `copilot reconcile` commands.
  - Organization-scoped Secrets and Variables setup.
  - 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, authorization, and resource provisioning.
  - CLI onboarding and upgrade flow to use pnpm.
  - 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 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:

   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 repository validation:

   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:

   - `copilot setup --dry-run` with repository and organization resource options.
   - `copilot doctor`, confirming credential values are never exposed.
   - `copilot reconcile --json` against local workflow drift.
   - PR-description modes and `/copilot description`.
   - The scheduled inactive-issue workflow 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 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
- [x] No special deployment steps

Details:

Install the scheduled cleanup and credential-health workflows through `copilot setup` or copy them from `setup/workflows/`. Inactive issue cleanup is opt-in and uses the existing `PAT` Secret plus the optional `INACTIVITY_THRESHOLD_HOURS` Repository Variable. Generated bundles are included in the change.

---

## 🔒 Security Considerations

- [ ] No security impact
- [x] Input validation changes
- [x] Authentication / authorization changes
- [x] 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

- [x] 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
- [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 covering configurable lifecycle and PR policies, setup hardening, comment-driven assistance, organization resource support, inactive issue cleanup, and pnpm-based onboarding.

---

<!-- copilot-configuration-start
{
    "schemaVersion": 2,
    "branchType": "feature",
    "parentBranch": "master"
}
copilot-configuration-end -->

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

- Closes #347

---

## 🧩 Scope of Changes

- Added:
  - Scheduled inactive-issue cleanup and credential-health workflows.
  - `copilot doctor` and `copilot reconcile` commands.
  - Organization-scoped Secrets and Variables setup.
  - 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, authorization, and resource provisioning.
  - CLI onboarding and upgrade flow to use pnpm.
  - 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 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:

   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 repository validation:

   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:

   - `copilot setup --dry-run` with repository and organization resource options.
   - `copilot doctor`, confirming credential values are never exposed.
   - `copilot reconcile --json` against local workflow drift.
   - PR-description modes and `/copilot description`.
   - The scheduled inactive-issue workflow 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 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
- [x] No special deployment steps

Details:

Install the scheduled cleanup and credential-health workflows through `copilot setup` or copy them from `setup/workflows/`. Inactive issue cleanup is opt-in and uses the exi
[untrusted content truncated]

🚀 Happy coding!

Made with ❤️ by vypdev/copilot

@vypbot

vypbot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. Lifecycle state synchronized to blocked.

  2. Waiting state synchronized to awaiting-maintainer.

Errors Found

The configured agent returned no potential-problem analysis.

Check your project configuration, if everything is okay consider opening an issue.

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 false
[DEBUG] PR isMerged false
[DEBUG] PR isClosed false
[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=10544, issue description length=6529. Calling configured agent.
[DEBUG] UpdatePullRequestDescription: agent response received. Description length=6413.
[DEBUG] Updated PR #347 description with: # 📌 Summary

Expands Copilot’s workflow automation, setup wizard, CLI, lifecycle synchronization, comment assistance, credential diagnostics, and PR-description management while improving configuration safety and documentation validation.

---

## 🎯 Related Issues / Tickets

- Closes #347

---

## 🧩 Scope of Changes

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

- Updated:
  - Lifecycle labels, waiting states, reviews, checks, workflow synchronization, and agent activity tracking.
  - Setup wizard, configuration persistence, authorization, and resource provisioning.
  - CLI onboarding and upgrade flow to use pnpm.
  - 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 preserves human-authored content while maintaining a bounded Copilot-managed section.
- Lifecycle resolution incorporates reviews, check suites, workflow runs, waiting states, and agent activity, while validating evidence against the current pull-request head.
- 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 retains future schema versions safely.
- Application contracts, typed errors, semantic ports, and composition roots were tightened to preserve architecture boundaries.
- 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:

   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 repository validation:

   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:

   - `copilot setup --dry-run` with repository and organization resource options.
   - `copilot doctor`, confirming credential values are never exposed.
   - `copilot reconcile --json` against local workflow drift.
   - PR-description modes and `/copilot description`.
   - The scheduled inactive-issue workflow 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 changed from `copilot-state-*` to `state-*`, with defaults 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
- [x] No special deployment steps

Details:

Install the scheduled cleanup and credential-health workflows through `copilot setup` or copy them from `setup/workflows/`. Inactive issue cleanup is opt-in and uses the existing `PAT` Secret plus the optional `INACTIVITY_THRESHOLD_HOURS` Repository Variable. Generated bundles are included in the change.

---

## 🔒 Security Considerations

- [ ] No security impact
- [x] Input validation changes
- [x] Authentication / authorization changes
- [x] 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

- [x] No performance impact
- [ ] 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, stale-candidate revalidation in inactive-issue cleanup, and the generated `build/` bundles.

---

## ✅ 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 covering configurable lifecycle and PR policies, setup hardening, comment-driven assistance, organization resource support, inactive-issue cleanup, and pnpm-based onboarding.
[INFO] 🔍 Executing DetectPotentialProblemsUseCase.
[DEBUG] LoadBugbotContext: issue #347, branch develop, open PRs=1, existing findings=9, unresolved with body=1.
[INFO] Detecting potential problems via configured agent (agent computes changes and checks resolved)...
[ERROR] Error querying codex CLI findings: Agent CLI timed out after 900000ms.
[DEBUG] DetectPotentialProblems: No response from configured agent.
[INFO] Main run finished. Results: 2, total steps: 0.
[INFO] Removed Copilot agent activity label on target #347.
[INFO] Publishing result: 3 result(s), 2 step(s), 1 error(s).
[INFO] 📄 Executing PublishResultUseCase.

🚀 Happy coding!

Made with ❤️ by vypdev/copilot

@vypbot vypbot left a comment

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.

🤖 Bugbot review

Bugbot found 1 active potential problem(s) in this revision. 1 finding(s) are attached to changed lines in this review.

Findings

  • medium: Incremental PR reviews may lack the before/after commits — .github/workflows/copilot_pull_request.yml:16

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

Comment thread .github/workflows/copilot_pull_request.yml
@vypbot

vypbot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. Potential problems detection completed. 1 new/current finding(s) from configured agent; 1 marked as resolved by configured agent; states: open=1, fixed=9.

  2. Lifecycle state synchronized to changes-requested.

  3. 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 synchronize
[DEBUG] PR isOpened false
[DEBUG] PR isMerged false
[DEBUG] PR isClosed false
[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=10578, issue description length=6563. Calling configured agent.
[DEBUG] UpdatePullRequestDescription: agent response received. Description length=7058.
[DEBUG] Updated PR #347 description with: # 📌 Summary

Expands Copilot’s workflow automation, setup wizard, CLI, lifecycle synchronization, comment assistance, credential diagnostics, and pull-request description management while improving configuration safety and documentation validation.

---

## 🎯 Related Issues / Tickets

- Closes #347

---

## 🧩 Scope of Changes

- Added:
  - Scheduled inactive-issue cleanup and credential-health workflows.
  - `copilot doctor` and `copilot reconcile` commands.
  - Organization-scoped Secrets and Variables configuration.
  - Configurable pull-request description ownership modes.
  - Expanded `/copilot` commands, welcome messages, and authorization checks.
  - Documentation and workflow contract validation.

- Updated:
  - Lifecycle labels, waiting states, reviews, checks, workflow synchronization, and agent activity tracking.
  - Setup wizard, credential validation, configuration persistence, and resource provisioning.
  - CLI onboarding and upgrades to use pnpm.
  - Documentation, tests, CI validation, and generated bundles.

- Removed:
  - Legacy `setup/.env`.
  - npm-based CLI upgrade implementation, replaced with pnpm.

- Refactored:
  - Application boundaries, semantic ports, typed errors, and composition roots.
  - Configuration migration and persistence.
  - Setup planning, resource provisioning, and workflow reconciliation.

---

## 🛠️ Technical Details

- Pull-request descriptions support `replace`, `append`, `preserve`, and `disabled` modes. Append mode preserves human-authored content and maintains a bounded Copilot-managed section. `replace` remains the default.
- Lifecycle reconciliation incorporates reviews, check suites, workflow runs, waiting states, and agent activity, while validating evidence against the current pull-request head.
- Inactive-issue cleanup runs every six hours, scans waiting issues, revalidates each candidate immediately before closing, and posts an explanation comment.
- Setup separates the operator setup PAT from the workflow PAT, validates credentials and organization access, supports independent repository or organization storage policies, and preserves existing effective resources.
- Comment automation distinguishes read-only analysis, planning, review, implementation, Bugbot fixes, and general requests. File-modifying operations require authorization and configured write permissions.
- Persisted configuration migrates to schema version 2, removes transient results, preserves unknown fields, and safely retains future schema versions.
- Documentation validation checks routes, links, YAML snippets, Action references, public inputs, and required terminology. Workflow validation checks queue gates, permissions, timeouts, runners, and workflow contracts.
- 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:

   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 repository validation:

   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:

   - `copilot setup --dry-run` with repository and organization resource options.
   - `copilot doctor`, confirming credential values are never exposed.
   - `copilot reconcile --json` against local workflow drift.
   - Pull-request description modes and `/copilot description`.
   - Read-only and file-modifying `/copilot` commands with authorized and unauthorized actors.
   - Scheduled inactive-issue cleanup with a test inactivity threshold.
   - Credential-health checks for selected configured providers.

---

## 🧪 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 changed from `copilot-state-*` to `state-*`, with defaults changing from `copilot:state:*` to `state:*`. Existing workflows using custom legacy inputs must migrate.
- Setup no longer uses `setup/.env`; credentials must be supplied through the secure prompt or supported environment and CLI options.
- CLI upgrade onboarding now uses pnpm.
- Pull-request description `replace` remains the default behavior.

---

## 🚀 Deployment Notes

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

Details:

Install the scheduled cleanup and credential-health workflows through `copilot setup` or copy them from `setup/workflows/`. Inactive-issue cleanup is opt-in and uses the existing `PAT` Secret plus the optional `INACTIVITY_THRESHOLD_HOURS` Repository Variable. Generated bundles are included in the change.

---

## 🔒 Security Considerations

- [ ] No security impact
- [x] Input validation changes
- [x] Authentication / authorization changes
- [x] 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 setup no longer includes a PAT placeholder file or persists setup credentials.

---

## 📈 Performance Impact

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

The scheduled cleanup uses paginated issue scans every six hours and revalidates candidates before mutation. CLI update checks use bounded network latency and a local cache. Existing event-driven paths retain their current behavior.

---

## 📝 Notes for Reviewers

Please review the lifecycle label migration, pull-request description ownership modes, organization resource permissions, comment authorization checks, stale-candidate revalidation in inactive-issue cleanup, and the generated `build/` bundles.

---

## ✅ 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 covering configurable lifecycle and pull-request policies, setup hardening, comment-driven assistance, organization resource support, inactive-issue cleanup, and pnpm-based onboarding.
[INFO] 🔍 Executing DetectPotentialProblemsUseCase.
[DEBUG] LoadBugbotContext: issue #347, branch develop, open PRs=1, existing findings=9, unresolved with body=1.
[INFO] Detecting potential problems via configured agent (agent computes changes and checks resolved)...
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Resolved pull request review thread.
[INFO] Main run finished. Results: 2, total steps: 1.
[INFO] Removed Copilot agent activity label on target #347.
[INFO] Publishing result: 3 result(s), 3 step(s), 0 error(s).
[INFO] 📄 Executing PublishResultUseCase.

🚀 Happy coding!

Made with ❤️ by vypdev/copilot

@vypbot

vypbot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✨ Feature Actions

  1. Potential problems detection completed. 0 new/current finding(s) from configured agent; 1 marked as resolved by configured agent; states: fixed=10.

  2. Lifecycle state synchronized to ready.

  3. Waiting state synchronized to awaiting-maintainer.

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 false
[DEBUG] PR isMerged false
[DEBUG] PR isClosed false
[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=11223, issue description length=7208. Calling configured agent.
[DEBUG] UpdatePullRequestDescription: agent response received. Description length=7058.
[DEBUG] Updated PR #347 description with: # 📌 Summary

Expands Copilot’s workflow automation, CLI, setup wizard, lifecycle synchronization, comment assistance, credential diagnostics, and pull-request description management while improving configuration safety and documentation validation.

---

## 🎯 Related Issues / Tickets

- Closes #347

---

## 🧩 Scope of Changes

- Added:
  - Scheduled inactive-issue cleanup and credential-health workflows.
  - `copilot doctor` and `copilot reconcile` commands.
  - Organization-scoped Secrets and Variables configuration.
  - Configurable pull-request description ownership modes.
  - Expanded `/copilot` commands, welcome messages, and authorization checks.
  - Documentation and workflow contract validation.

- Updated:
  - Lifecycle labels, waiting states, reviews, checks, workflow synchronization, and agent activity tracking.
  - Setup wizard, credential validation, configuration persistence, and resource provisioning.
  - CLI onboarding and upgrades to use pnpm.
  - Documentation, tests, CI validation, and generated bundles.

- Removed:
  - Legacy `setup/.env`.
  - npm-based CLI upgrade implementation, replaced with pnpm.

- Refactored:
  - Application boundaries, semantic ports, typed errors, and composition roots.
  - Configuration migration and persistence.
  - Setup planning, resource provisioning, and workflow reconciliation.

---

## 🛠️ Technical Details

- Pull-request descriptions support `replace`, `append`, `preserve`, and `disabled` modes. Append mode preserves human-authored content and maintains a bounded Copilot-managed section. `replace` remains the default.
- Lifecycle reconciliation incorporates reviews, check suites, workflow runs, waiting states, and agent activity, while validating evidence against the current pull-request head.
- Inactive-issue cleanup runs every six hours, scans waiting issues, revalidates each candidate immediately before closing, and posts an explanation comment.
- Setup separates the operator setup PAT from the workflow PAT, validates credentials and organization access, supports independent repository or organization storage policies, and preserves existing effective resources.
- Comment automation distinguishes read-only analysis, planning, review, implementation, Bugbot fixes, and general requests. File-modifying operations require authorization and configured write permissions.
- Persisted configuration migrates to schema version 2, removes transient results, preserves unknown fields, and safely retains future schema versions.
- Documentation validation checks routes, links, YAML snippets, Action references, public inputs, and required terminology. Workflow validation checks queue gates, permissions, timeouts, runners, and workflow contracts.
- 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:

   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 repository validation:

   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:

   - `copilot setup --dry-run` with repository and organization resource options.
   - `copilot doctor`, confirming credential values are never exposed.
   - `copilot reconcile --json` against local workflow drift.
   - Pull-request description modes and `/copilot description`.
   - Read-only and file-modifying `/copilot` commands with authorized and unauthorized actors.
   - Scheduled inactive-issue cleanup with a test inactivity threshold.
   - Credential-health checks for selected configured providers.

---

## 🧪 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 changed from `copilot-state-*` to `state-*`, with defaults changing from `copilot:state:*` to `state:*`. Existing workflows using custom legacy inputs must migrate.
- Setup no longer uses `setup/.env`; credentials must be supplied through the secure prompt or supported environment and CLI options.
- CLI upgrade onboarding now uses pnpm.
- Pull-request description `replace` remains the default behavior.

---

## 🚀 Deployment Notes

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

Details:

Install the scheduled cleanup and credential-health workflows through `copilot setup` or copy them from `setup/workflows/`. Inactive-issue cleanup is opt-in and uses the existing `PAT` Secret plus the optional `INACTIVITY_THRESHOLD_HOURS` Repository Variable. Generated bundles are included in the change.

---

## 🔒 Security Considerations

- [ ] No security impact
- [x] Input validation changes
- [x] Authentication / authorization changes
- [x] 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 setup no longer includes a PAT placeholder file or persists setup credentials.

---

## 📈 Performance Impact

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

The scheduled cleanup uses paginated issue scans every six hours and revalidates candidates before mutation. CLI update checks use bounded network latency and a local cache. Existing event-driven paths retain their current behavior.

---

## 📝 Notes for Reviewers

Please review the lifecycle label migration, pull-request description ownership modes, organization resource permissions, comment authorization checks, stale-candidate revalidation in inactive-issue cleanup, and the generated `build/` bundles.

---

## ✅ 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 covering configurable lifecycle and pull-request policies, setup hardening, comment-driven assistance, organization resource support, inactive-issue cleanup, and pnpm-based onboarding.
[INFO] 🔍 Executing DetectPotentialProblemsUseCase.
[DEBUG] LoadBugbotContext: issue #347, branch develop, open PRs=1, existing findings=10, unresolved with body=1.
[INFO] Detecting potential problems via configured agent (agent computes changes and checks resolved)...
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Pull request review thread is already resolved.
[DEBUG] Resolved pull request review thread.
[INFO] Main run finished. Results: 2, total steps: 1.
[INFO] Removed Copilot agent activity label on target #347.
[INFO] Publishing result: 3 result(s), 3 step(s), 0 error(s).
[INFO] 📄 Executing PublishResultUseCase.

🚀 Happy coding!

Made with ❤️ by vypdev/copilot

@vypbot

vypbot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

🪄 Automatic Actions

  1. Lifecycle state synchronized to analyzing.

image

Debug log
[DEBUG] Setup done. Issue number: 347, isSingleAction: false, isIssue: true, isPullRequest: false, isPush: false
[INFO] Running IssueCommentUseCase for issue #347.
[INFO] IssueCommentUseCase started.
[INFO] 🌐 Executing CheckIssueCommentLanguageUseCase.
[DEBUG] CheckIssueCommentLanguageUseCase: language check status=done.
[INFO] Running bugbot fix intent detection (before Think).
[INFO] ▶️ Executing DetectBugbotFixIntentUseCase.
[DEBUG] Found head branch "develop" for issue #347 (PR #347).
[DEBUG] Found 1 open PR(s) for head branch "develop": 347
[DEBUG] LoadBugbotContext: issue #347, branch develop, open PRs=1, existing findings=10, unresolved with body=0.
[INFO] No unresolved bugbot findings for this issue/PR; skipping bugbot fix intent detection.
[INFO] Bugbot fix intent: no payload from intent detection.
[INFO] Skipping bugbot autofix (no fix request, no targets, or no context).
[INFO] Running ThinkUseCase (no file-modifying action ran).
[INFO] Think: processing comment (AI Q&A).
[INFO] Comment does not mention @​vypbot; skipping.
[INFO] Main run finished. Results: 2, total steps: 0.
[INFO] Publishing result: 3 result(s), 1 step(s), 0 error(s).
[INFO] 📄 Executing PublishResultUseCase.

🚀 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