Skip to content

Patch Requests

Rodrigo Silveira edited this page Jul 19, 2026 · 1 revision

0. Introduction

ChatGPT does a poor job of keeping mental models when working on patches for errors. This is a process to improve its ability to provide error free patches.

1. Export the exact current branch, not a folder ZIP

From the project root:

cd /Users/rodrigosilveira/projects/EnterpriseRemoteSystems

git branch --show-current
git status --short
git rev-parse HEAD

git archive \
  --format=zip \
  --output=~/Downloads/ers-current-branch.zip \
  HEAD

Then upload:

~/Downloads/ers-current-branch.zip

This avoids stale folder ZIPs and guarantees the archive matches the exact committed branch state.

2. Tell me which patches have already been applied

For example:

Applied:

  • bite-27d-authorization-e2e-coverage.patch
  • bite-27d-enable-route-auth-in-deployed-test.patch
  • bite-27d-public-healthz-smoke-fix.patch

Failed/not applied:

  • bite-27d-healthz-public-fast-path-fix.patch

That prevents me from accidentally generating a patch against the wrong patch-stack state.

3. Paste this quick branch status

cd /Users/rodrigosilveira/projects/EnterpriseRemoteSystems

git branch --show-current
git status --short
git log --oneline -5

If git status --short is not empty, I need to know that before preparing a patch.

4. For apply failures, include the exact failure and current file snippets

This is especially useful:

grep -n "healthz\|RegisterHealth\|Use(" backend/internal/http/routes/*.go

or for a specific failed file:

sed -n '1,120p' backend/internal/http/routes/authorization.go
sed -n '1,120p' backend/internal/http/routes/routes.go
sed -n '1,120p' backend/internal/http/routes/health.go

5. What I will change on my side

For any future ERS patch after a failed patch, I should not guess. I will use this stricter process:

Confirm the intended branch.
Confirm the exact patch stack already applied.
Generate the patch only from the current uploaded git archive.
Avoid overlapping previous failed patch areas unless necessary.
Validate with git apply --check against the exact archive.
Tell you clearly whether the patch is:
a fresh patch against the branch baseline, or
an incremental patch after already-applied patches.

A good future request format would be:

Branch: 632-bite-27d-authorization-e2e-coverage
HEAD: <sha>
Applied patches: <list>
Failed patches: <list>
Current repo archive: attached git archive from HEAD
Error: <paste log>

That will keep us out of the hole we just hit.

Clone this wiki locally