Skip to content

feat: enforce contribution intake policy - #91

Merged
wibus-wee merged 6 commits into
mainfrom
feat/pr-body-expiration-policy
Aug 27, 2026
Merged

feat: enforce contribution intake policy#91
wibus-wee merged 6 commits into
mainfrom
feat/pr-body-expiration-policy

Conversation

@wibus-wee

@wibus-wee wibus-wee commented Aug 27, 2026

Copy link
Copy Markdown
Member

Related issue

#92

Problem / pressure

External contributions need durable intake rules: maintainers must see why a change exists, what risks deserve review, whether prior design discussion is substantive, and whether a large diff arrived without coordination. An Agent must not create an Issue and immediately treat it as approval, malformed Issues need actionable warnings, and invalid PR bodies need a fair but finite correction window.

Summary

  • Remove Author type and Sharing consent from the PR template; require a complete public Context handoff for every external PR and reject N/A/redacted context.
  • Require a full Lody Issue URL in every external PR body, while stating that a URL is only a mechanical gate and not proof of approval.
  • Require Issue Forms and the PR Template to tell authoring Agents that a self-created Issue is not approval, explain the policy to the author-side user, and wait for explicit maintainer agreement before implementation or a PR.
  • Add required Bug and Feature confirmations that contributors will wait for maintainer agreement.
  • Warn non-owner, non-bot Issue authors when titles, required sections, or confirmations do not match the Issue Forms; clear the warning after a valid edit.
  • Mark invalid PR bodies, preserve their original invalid timestamp, clear the state when fixed, and close unresolved PRs after seven days.
  • Mark external PRs over 200 changed lines without an Issue URL as status:pr-too-large, but give them the same seven-day body correction window instead of closing immediately.
  • Re-close body-expired PRs when reopened without deleting contributor branches.
  • Keep forms/templates, pure checkers, GitHub state policies, path labels, and event orchestration in separate maintainable files.

Before / after

Before After
An Agent could create an empty Issue and immediately claim it as permission for a large PR. Issue creation is explicitly not approval; maintainers must agree first, malformed Issues are warned, and invalid or oversized-unreferenced PRs get one seven-day correction window.

Test plan

  • Deterministic complete Bug and Feature samples plus rejected title, empty-answer, unchecked-confirmation, and missing-agreement cases.
  • Issue policy simulations: MEMBER enforcement, OWNER/bot exemption, first warning, and valid cleanup.
  • Deterministic PR-body samples: complete body, missing Issue, old handoff heading, and N/A/redacted prefixes.
  • Deterministic size-policy simulations: 200/201-line boundary, Issue bypass, owner/member exemption, first warning, valid cleanup, and assertion that no PR close API is available or called.
  • Node syntax checks for all policy modules.
  • Actionlint v1.7.7 for all affected workflows.
  • Oxlint 1.61.0 with zero warnings or errors.
  • Prettier 3.8.2 and git diff --check.
  • pnpm check:public-boundary.
  • Read-only dry-run against all current open external PRs.

Context handoff

Instructions for reviewing agents

  • Review focus: Trace trusted-checkout boundaries, Issue/size warning cleanup, the single body-expiry timer, and the final latest-body guard before closure.
  • Decisions to challenge: Challenge the OWNER-only Issue exemption, mirrored Issue Form fields, mandatory prior maintainer agreement, 200-line threshold, full Issue URL requirement, and retroactive PR-body audit.
  • Plausible failures / evidence gaps: Form edits could drift from the checker, API failures could leave partial feedback, URL syntax cannot prove approval, and live event/schedule behavior remains post-merge evidence.

Authoring context

  • User goal / directives: Make Agents wait for explicit maintainer agreement instead of self-opening an Issue and immediately submitting a PR; require useful public context and give oversized PRs seven days rather than closing them immediately.
  • Constraints / non-goals: Do not classify PR author type, do not offer a context-sharing opt-out, never invent notice or approval, exempt only owners from Issue format, separate policies by responsibility, and do not machine-judge maintainer agreement.
  • Risk-bearing decisions: Put the wait-for-approval rule in Issue Forms, PR Template, and contributor guidance; mirror required Issue confirmations in a checker; apply the PR schema to all open external PRs; and make size warnings share the body timer rather than own closure state.
  • Destructive or irreversible behavior: Issue and size enforcement only label/comment; an invalid external PR closes after the shared seven-day deadline and cannot reopen, but contributor branches and commits are preserved.
  • Deliberately not done or tested: Repository rulesets were not changed, existing Issues are not batch-backfilled, approval and Agent-to-user notice are not machine-judged, and live event/scheduled behavior cannot execute before merge.
  • Unknowns / confidence: Schema, boundary, lint, formatting, workflow, and state simulations pass; first live label/comment reconciliation remains the main operational unknown.

@wibus-wee wibus-wee changed the title feat: expire unresolved PR body violations feat: enforce external pull request intake policy Aug 27, 2026
@wibus-wee wibus-wee changed the title feat: enforce external pull request intake policy feat: enforce contribution intake policy Aug 27, 2026
@wibus-wee wibus-wee linked an issue Aug 27, 2026 that may be closed by this pull request
4 tasks
@wibus-wee
wibus-wee merged commit 85818ae into main Aug 27, 2026
5 checks passed
@wibus-wee
wibus-wee deleted the feat/pr-body-expiration-policy branch August 27, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Enforce external pull request intake policy

1 participant