Skip to content

docs: encourage .pr/ HTML design doc + htmlpreview link for non-trivial PRs - #4371

Open
smolpaws wants to merge 1 commit into
OpenHands:mainfrom
smolpaws:docs/pr-design-doc-guideline
Open

docs: encourage .pr/ HTML design doc + htmlpreview link for non-trivial PRs#4371
smolpaws wants to merge 1 commit into
OpenHands:mainfrom
smolpaws:docs/pr-design-doc-guideline

Conversation

@smolpaws

@smolpaws smolpaws commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

HUMAN:

Docs-only change, the SDK counterpart to OpenHands/OpenHands#16316. Reviewed the rendered template and CONTRIBUTING section locally; htmlpreview link shape verified against the .pr/ convention already wired in this repo.

AGENT:

Why

Reviewers of a non-trivial SDK PR often reconstruct the design from the diff alone — slow, and it is exactly where the compatibility risks this repo cares about hide (Python API + agent-server REST/WebSocket surface). This adds a soft, optional guideline: commit a self-contained HTML design doc under the temporary .pr/ directory and link it via htmlpreview so reviewers see the code/API design and before/after at a glance. The .pr/ directory is already auto-removed on approval (.github/workflows/pr-artifacts.yml).

This is the counterpart to the OpenHands/OpenHands guideline PR, same process, so both repos read consistently.

Summary

  • PR template: add an optional ## Design Doc section with the htmlpreview link shape.
  • CONTRIBUTING.md: add a "Design doc for non-trivial PRs" section, emphasizing the interface before/after and the compatibility impact (additive / breaking / behind a flag) this repo reviews for.

Issue Number

N/A (docs; companion to OpenHands/OpenHands#16316)

How to Test

Docs only — nothing to run. Read .github/PULL_REQUEST_TEMPLATE.md (new ## Design Doc block) and CONTRIBUTING.md ("Design doc for non-trivial PRs"). The htmlpreview link shape is:

https://htmlpreview.github.io/?https://github.com/<your-fork>/<repo>/blob/<your-branch>/.pr/design.html

Companion PRs: OpenHands/OpenHands#16316 (same guideline) and OpenHands/extensions#451 (the pr-design-doc skill that generates the page).

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Soft-encouraged, not enforced. htmlpreview works only for public repos and self-contained pages.

Co-authored-by: smolpaws engel@enyst.org

…al PRs

Add a soft guideline mirroring OpenHands/OpenHands: for non-trivial PRs,
commit a self-contained HTML design doc under the temporary .pr/ directory
(auto-removed on approval) and link it in the PR description via htmlpreview
so reviewers see the code/API design and before/after at a glance.

- PR template: new optional 'Design Doc' section with the htmlpreview link shape.
- CONTRIBUTING.md: a 'Design doc for non-trivial PRs' section, emphasizing the
  before/after of the interface and the compatibility impact this repo cares about.

Co-authored-by: smolpaws <engel@enyst.org>
@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: a1241c3bc570541a843bed1a83b8e04e975e2d03
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/a1d0dc9f-bf8e-46ff-9e0a-d8498475cc27

This comment was posted by an AI agent (OpenHands).

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This review was created by an AI agent (OpenHands) on behalf of the repository maintainers.

Summary

Docs-only PR adding an optional, soft-encouraged guideline: commit a self-contained HTML design doc under the temporary .pr/ directory and link it via htmlpreview so reviewers can see the interface before/after and compatibility impact at a glance. The addition lands in both .github/PULL_REQUEST_TEMPLATE.md (a ## Design Doc section) and CONTRIBUTING.md (a "Design doc for non-trivial PRs" section).

The guideline is well-scoped: explicitly optional, correctly scoped to non-trivial PRs (public API / agent-loop / migration), and it points at the right compatibility lens (additive / breaking / behind a flag) this repo reviews for. The htmlpreview link shape is consistent between the two files, and the htmlpreview only works for public repos and self-contained pages caveat is stated in both places.

Findings

One material accuracy issue (detailed inline): the auto-removal guarantee is stated unconditionally, but .github/workflows/pr-artifacts.yml only auto-removes .pr/ for same-repository PRs (head.repo.full_name == github.repository). Fork PRs get no auto-cleanup, yet the link shape points contributors at <your-fork>. For a fork PR approved and merged without manual removal, .pr/ can land in main, so "it never lands in main" is not guaranteed there. The repo's own AGENTS.md already documents this fork caveat ("For fork PRs: You must manually remove .pr/ before the PR can be merged"); the new user-facing docs should align by noting fork PRs require manual removal.

Risk assessment

Low risk. No code, no tests, no config, no security surface. The only issue is a documentation accuracy gap that could mislead fork-based contributors into assuming .pr/ is always cleaned up. Recommend adding a one-line fork caveat; otherwise this is good to merge.

Correctness / security / tests

  • Correctness: No executable code; claims verified against .github/workflows/pr-artifacts.yml (auto-removal is same-repo only) and the existing .pr/ convention.
  • Security: No concerns — docs only, no code execution, no secrets, no external network calls introduced.
  • Tests: Appropriately none for a docs-only change.
  • Style: Markdown is consistent with the surrounding files; no lint concerns.

Comment thread CONTRIBUTING.md
state the compatibility impact (additive, breaking, or behind a flag).
2. Commit it under the temporary **`.pr/`** directory, e.g. `.pr/design.html`. This directory is
for PR-only artifacts and is **removed automatically when the PR is approved**
(`.github/workflows/pr-artifacts.yml`), so it never lands in `main`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The auto-removal is not unconditional. cleanup-on-approval in .github/workflows/pr-artifacts.yml is gated on github.event.pull_request.head.repo.full_name == github.repository, so only same-repository PRs get .pr/ removed on approval. Fork PRs (which the <your-fork> link shape explicitly targets) are not cleaned up automatically, so for those "it never lands in main" only holds if the author manually removes .pr/ before merge — otherwise it can be merged into main.

The repo's own AGENTS.md already notes this ("For fork PRs: You must manually remove .pr/ before the PR can be merged"). Consider adding a short caveat here and in the PR template, e.g. "(fork PRs require manual removal before merge; the auto-cleanup runs for same-repo PRs only)".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants