# Issue and PR collaboration (https://powercontext.oceanbase.io/en/development/issue-pr-policy/)

PowerContext organizes maintenance around Knowledge base, Gateway, Core, Desktop and pc-mate. The
[module register](https://github.com/oceanbase/powercontext/blob/master/MAINTAINERS.md) records owners, backups and
boundaries. Roles and authority follow [governance](https://github.com/oceanbase/powercontext/blob/master/GOVERNANCE.md).
Merging [PR #2942](https://github.com/oceanbase/powercontext/pull/2942) into `master` approves this policy and the
module roster together. Subsequent personnel changes follow the governance process.

## Workflow diagrams [#workflow-diagrams]

### Issue lifecycle [#issue-lifecycle]

```mermaid
flowchart TD
    A[Create issue] --> B[Within 24 hours: one primary module label; name discussion contact in a comment]
    B --> C[Notify module owners; discuss problem, scope and acceptance criteria on GitHub]
    C --> D{Cross-module discussion or RFC needed?}
    D -->|Yes| E[Involve affected owners and record the decision through the applicable process]
    D -->|No| F{Sufficiently discussed and accepted?}
    E --> F
    F -->|Yes| G[Accepted / available: set Assignee after implementer agrees]
    F -->|More information or deferred| H[Record reason, resumption conditions and next check date]
    H --> C
    F -->|No| I[Explain the decision and close]
    G --> J[In progress: link PRs and update at least weekly]
    J --> K[Awaiting acceptance: check deliverables, tests and documentation]
    K --> L{Acceptance criteria met?}
    L -->|Yes| M[Link deliverables and acceptance evidence; close issue]
    L -->|No| J
```

The first substantive response target is 72 hours from issue creation; the response comes from
the lead owner or a recorded delegate on behalf of the module team. Remind missing responders at 48 hours; at 72 hours, mark the target
missed and have the OceanBase community fallback contacts take over that day. Escalate capacity gaps to the
review committee. Module changes do not reset the clock, and fallback does not erase a missed target.
See below for reminders and closure when awaiting author information; security issues use private reporting.

### PR lifecycle [#pr-lifecycle]

```mermaid
flowchart TD
    A[Create PR: link issue / RFC or explain a standalone small change] --> B[Within 24 hours: 1 to 3 module labels, primary contact and owner notification]
    B --> C{Ready?}
    C -->|No| D[Draft: develop the change; design feedback may be requested]
    D --> C
    C -->|Yes| E[Request review: owner reviews substantively within 72 hours or names reviewer and review date]
    E --> F[Owner consolidates feedback and decides on blocking reviews]
    F --> G{Blockers or disputes?}
    G -->|Changes needed| H[Author updates and requests review again]
    H --> E
    G -->|Unresolved dispute| I[Review committee coordinates; escalate to PMC when needed]
    I --> F
    G -->|No blockers| J{Authorized independent approval, required CI and integration checks satisfied?}
    J -->|No| K[Obtain approval or validation; substantive changes require re-review]
    K --> E
    J -->|Yes| L[Only a Maintainer with merge permission merges]
    L --> M[Return to issue acceptance; prepare release information and help with regressions]
```

Drafts do not start the formal review clock. Ready events and review requests after changes start the clock,
with the same 48-hour reminder and 72-hour fallback rules. Delegation includes a public review date that cannot
be repeatedly reset through postponement. Owners cannot approve their own PRs or waive valid defects, required
checks or branch protection. Merging a PR does not establish that every linked issue acceptance criterion is met.

## Ownership and participation [#ownership-and-participation]

All module owners are Active Committers with equal responsibilities and authority in requirements, technical decisions
and review. Name one owner to lead each issue or PR: discuss it with the author, coordinate affected modules, progress
review and follow through on delegated work. Other owners participate as needed. OceanBase community fallback contacts
separately coordinate coverage and response continuity, without additional technical decision authority.

Participation is voluntary. Owners may take leave, reduce scope or leave the role. Record a consenting delegate or a
handoff in the module register; no private explanation is required. Unplanned absence triggers fallback, not blame.
Repeated missed targets prompt a capacity discussion, narrower scope or recruitment, not individual rankings.

Until an appointment is filled, existing Maintainers name an acting contact on the issue. A vacancy does not remove the
team's response target. Maintainers identify a triage contact and alternate in a public tracking issue; no automated
assignment or reminder is assumed to exist. They can perform these steps manually.

## Module labels and notifications [#module-labels-and-notifications]

Use the following labels as the common routing, notification and reporting entry point for issues and PRs. The module
register remains authoritative for personnel; do not maintain a separate owner list in notification rules.

| Label | Primary module |
| --- | --- |
| `module:knowledge-base` | Knowledge base |
| `module:gateway` | Gateway |
| `module:core` | Core |
| `module:desktop` | Desktop |
| `module:pc-mate` | pc-mate |
| `module:other` | Other changes without an applicable module |

For PRs, use `module:core` only when files under `src/` change. Use `module:other` when no specific module label
applies; it does not create another owner team. Standalone shared infrastructure, website, governance and integration
changes outside `src/` use this fallback unless they belong to another module. Do not add `module:other` merely
because an otherwise classified PR also changes shared files. Existing path owners and Maintainers coordinate it.

Issues must have **exactly one** primary module label after triage. PRs use **one to three module labels, never more
than three**, based on the code, tests, documentation or contracts actually changed. Type, version, priority and status
labels do not count toward that module-label limit. The PR description or linked issue still identifies one primary
coordinator; multiple labels do not replace follow-up responsibility. Notify the owners of each affected module.
If more than three modules are involved, label the primary module and the two most affected collaborators; list the
remaining modules in the description and notify their owners. The primary owner coordinates the work without replacing
affected modules' review authority.

New issues and PRs may initially be unclassified. The triage contact adds or corrects the module label within 24 elapsed
hours of creation, including for Draft PRs. Authors do not need to resubmit an incorrectly classified item. A PR normally
includes its linked issue's module and adds collaborating module labels according to actual impact. A PR implementing
a subtask owned by another module may use that module instead;
explain the difference and retain the issue link. Changing a label does not reset any response or review clock. The
current follow-up contact remains responsible until the new contact explicitly accepts the handoff.

The three assignments serve different purposes:

- **Module label:** identifies the primary module for an issue, or one to three main affected modules and their owners for a PR.
- **Assignee:** for an issue, identifies a consenting implementer after sufficient discussion and acceptance; for a PR, identifies the follow-up contact.
- **Review request:** identifies the reviewer expected to assess a ready PR or a revised change.

Applying a label alone does not notify module owners. When setting or changing a module, the triage contact mentions
the owners of every affected module on GitHub, names the discussion contact in a comment or description, and states the requested action and
existing response deadline. Do not set an issue Assignee or assign implementation work before sufficient discussion.
A PR may have a follow-up assignee immediately.
For ready PRs, request review from the appropriate authorized reviewer as well. If an owner position is vacant or its
permissions are unavailable, use the acting contact or an authorized Maintainer and record the arrangement. Send a
Feishu reminder to the configured module channel or recipients when available; GitHub remains the decision record.

GitHub Actions or pc-mate may later read the module register and send these notifications on label changes, PR readiness
and review re-requests, and summarize overdue work by module. Handle repeated events without duplicate reminders and
honor recorded delegates. Keep Feishu user/channel IDs in operational configuration and credentials in secret storage,
not in the public roster. A successful notification is not a substantive owner response. The triage contact checks for
responses and follows up manually if notification fails or automation is unavailable. The OceanBase community fallback contacts
handle overdue work under the escalation rules below. This policy does not itself create labels or enable automation.

## Issue triage and response [#issue-triage-and-response]

Every issue has one primary module label, one named follow-up contact, a state and a next action. Related modules may be
listed in the description. Authors can select an unknown module; the triage contact assigns an initial module within
24 hours. Ownership disputes do not leave the issue unowned: the current contact continues until another accepts.

The team provides a substantive first response within **72 elapsed hours** of issue creation through the lead owner
or a recorded delegate. The lead invites other owners or affected modules when their judgment is needed and records
the conclusion publicly; every owner need not post a duplicate response. The clock runs through weekends and holidays;
plan delegation in advance. Moving an issue between modules does not reset its clock. These are response targets, not
promises to implement or resolve the request within three days.

A substantive response explains the understood problem, asks specific questions, gives a reasoned disposition, or names
an investigation step, responsible person and next update time. An automated acknowledgement alone does not count.

| Trigger | Action |
| --- | --- |
| 48 hours without the required response | Triage contact reminds the missing owner and OceanBase community fallback. |
| 72 hours without the required response | Mark the target missed; the OceanBase community fallback contacts take over follow-up that day and post the next action. Fallback does not erase the missed response. |
| Capacity is still unavailable | Refer to the review committee and publish the constraint and next update time. |
| Accepted work is actively progressing | Post an update at least weekly, including blockers or a changed plan. |

Security reports use the repository's private security reporting channel rather than public reproduction details.
Maintainers prioritize data loss and severe regressions and name a next update time; this policy does not establish a
24-hour on-call service.

## Discussion, acceptance and working groups [#discussion-acceptance-and-working-groups]

Use these states: Needs triage → Discussing → Accepted/Available → In progress → Awaiting acceptance → Closed.
Waiting for author, Deferred and Blocked are additional conditions with a reason and a resumption condition or next
check date. Labels or a Project may represent these states; keep the issue readable without that tooling.

Before setting an Assignee or assigning implementation work on any issue, the owner and author must sufficiently
discuss and agree on GitHub:

- Problem and user scenario.
- Included scope and observable acceptance criteria.
- Primary module, collaborators and follow-up contact.
- Next action, responsible person and expected update time.
- Open disagreements and whether an RFC is needed.

The owner records the conclusion on the issue, confirms the points above and implementation-relevant disagreements
are resolved and required cross-module discussions or RFCs are complete, then marks it Accepted/Available. Set an Assignee
only after the implementer agrees to take it on. Keep insufficiently discussed issues or those with unresolved key
disagreements in Discussing. Name a contact in a comment or description during triage and discussion, without assigning
the issue. Accepting a direction does not commit a release date; scheduling requires an implementer and capacity.
Small, clear fixes without a linked issue can record this information in the PR directly; existing issues still require
discussion before assignment. Larger goals use a tracking issue and a working group
convened by the primary owner. Participation is open and voluntary. Record tasks, dependencies and acceptance criteria;
hand completed work and remaining issues to the module team.

Public APIs, persisted formats, authorization/privacy, cross-module contracts, core architecture and removal of released
features require affected owners to discuss the proposal before implementation and follow the RFC process where
applicable. Silence is not agreement. The lead owner arranges qualified delegates or escalation if participants are
unavailable. Prototypes may explore unresolved options but do not establish accepted contracts.

Record decisions from meetings or chat in the issue, PR or RFC with rationale and next steps. Publish only shareable
information and public references. When closing an issue, link the result and acceptance evidence. Keep uncompleted work
open or link explicit follow-up issues. For information requested from an author, remind after 14 days and allow another
14 days before a reasoned closure; reopen when the information arrives. Do not automatically close confirmed defects,
accepted requests or PRs waiting on maintainers simply because they are inactive.

## PR review and decisions [#pr-review-and-decisions]

A PR links its issue/RFC or explains a small standalone change, names its module, and describes validation, documentation
and compatibility effects. Draft PRs are outside the formal review clock, but explicit requests for design feedback
still receive a response. For a ready PR or a re-requested review after changes, an owner responds within **72 elapsed
hours** with substantive review or a named reviewer and expected review time. Use the same reminder and fallback process
as issues, measured from the ready/re-request event. Delegation must include a review date; delayed dates are surfaced
in the weekly backlog review rather than repeatedly reset.

The owner consolidates feedback and leads module-level decisions. Follow
[REVIEW.md](https://github.com/oceanbase/powercontext/blob/master/REVIEW.md): distinguish demonstrated defects from
non-blocking design suggestions. Authors should receive one coherent set of required outcomes.

Only an owner of an affected module may submit or cancel a blocking review, including submitting `Request changes`,
dismissing it or updating a review after a fix to lift the block. Other participants may comment, provide evidence or
approve within their authorized scope, but may not submit or cancel blocking reviews. Ask the corresponding owner to
assess potential blockers and record the reason publicly. Configure these permissions according to approved roles;
this document does not establish that GitHub permission settings have been applied.

| Review situation | Owner action |
| --- | --- |
| Personal preference or unnecessary refactoring | Explain why it is non-blocking or not adopted. |
| Duplicate, addressed or no longer applicable feedback | Record the reason and resolve the thread. |
| Unsupported or inapplicable blocking review | The corresponding module owner records the reason publicly and cancels the blocking review with the required permissions. |
| Demonstrated correctness, security, data or compatibility defect | Fix it or change the contract through the applicable decision process; ownership alone cannot waive it. |

Retain the original discussion and rationale. Owner authority does not mean deleting disagreeing comments. A primary
owner cannot unilaterally waive another module's valid contract requirement. If the owner authored the PR, another
qualified, authorized reviewer must approve. Another uninvolved owner of a relevant module handles disputed blockers;
the committee coordinates disputes, but the corresponding owner still submits or cancels the blocking review. An owner
must not cancel a blocking review on their own PR.
Required checks and branch protection still apply. Material updates require renewed review of the affected changes.

At least one authorized, relevant Reviewer, Committer or Maintainer approves before merge. **Only a Maintainer with
explicit merge permission may merge**; Committer and Active Committer roles do not themselves grant merge authority. Required CI must pass on the current change, blocking findings must
be resolved, and integration with the current base must satisfy required checks. Missing or skipped required validation
is not a pass. Review the tested merge result when integration risk or repository rules require it.

Unresolved disputes go to the review committee for coordination. Overall direction and unresolved cross-module or
governance disputes go to the PMC. Participants may appeal to the PMC; uninvolved members handle the appeal.

## Tests, documentation and releases [#tests-documentation-and-releases]

The feature owner ensures implementation, necessary regression tests, documentation and examples are delivered together.
Tests and documentation follow functional ownership even when stored in shared directories. State whether validation used
real backends/hosts or simulations. Update both documentation locales when public behavior changes.

Before a release, owners report included changes, validation, compatibility/migration requirements, known issues and
recovery or rollback constraints to the release coordinator. Unfinished validation is explicitly recorded; the coordinator
and responsible Maintainer decide whether to defer the change or release. No response is not acceptance. Owners help
triage regressions after release. Release permissions remain separate from module ownership.

## Repository records and operation [#repository-records-and-operation]

`GOVERNANCE.md` owns roles and authority; `MAINTAINERS.md` owns the module roster and handoff arrangements; this policy owns daily
handling. Maintain corresponding code review paths in `.github/CODEOWNERS`. Appointment proposals record consent,
contribution and collaboration evidence, scope and permissions; PR count alone does not qualify a candidate.
Templates should collect module, scenario, acceptance criteria and validation. Automation may remind and summarize;
it cannot replace owner replies or technical decisions. pc-mate may assist when available, but this process works manually.

A Maintainer coordinates a weekly review of unassigned issues, missed responses, waiting PRs and cross-module blockers.
Use team-level response times, backlog age, fallback load and contributor feedback to adjust capacity, not to rank
volunteers. Start a 30-day trial only when a public tracking issue records the approved policy, staffed modules or acting
contacts, start/end dates and retrospective organizer. At the retrospective, publish findings and propose any rule changes
through the normal governance process. Subsequent personnel and permission changes are recorded through the governance process.
