Skip to content

Commit 9b8f5d6

Browse files
chore(copilot): refresh .github/copilot-instructions.md to match current state (#5554)
## Why Several factual claims in \`.github/copilot-instructions.md\` had drifted out of sync with the actual codebase, which means GitHub Copilot's PR Reviewer was making decisions on stale ground rules. ## What | Stale | Actual | Source of truth | |-------|--------|-----------------| | Cloud Run \`anyplot-backend\` | \`anyplot-api\` | \`api/cloudbuild.yaml\` substitution | | Cloud Run \`anyplot-frontend\` | \`anyplot-app\` | \`app/cloudbuild.yaml\` substitution | | Python 3.14+ | Python 3.13+ | \`pyproject.toml\` \`requires-python = \">=3.13\"\` | | Repair attempts ×3 | ×4 | \`impl-repair.yml\` run-name \"attempt 1, 2, 3, or 4\" | | Single threshold (≥90, fallback ≥50 after 3) | Cascade 90/80/70/60/50 over 4 attempts | \`impl-review.yml\` \`THRESHOLD = max(50, 90 - attempt * 10)\` | Plus per user direction: drop the \"No Co-authored-by in commit messages\" rule. Claude Code's default attribution footer is fine. PostgreSQL 18 is correct and unchanged (confirmed by user). ## Test plan - [x] \`git diff\` shows only the documentation updates listed above - [ ] After merge, Copilot reviewer references the cascade table (not the old single-threshold logic) on subsequent PRs 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 14bfd5f commit 9b8f5d6

1 file changed

Lines changed: 34 additions & 17 deletions

File tree

.github/copilot-instructions.md

Lines changed: 34 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ This file provides guidance to GitHub Copilot when working with code in this rep
44

55
## Important Rules
66

7-
- **No Co-authored-by in commit messages** - Never add `Co-authored-by:` lines to commit messages. Keep commit messages clean without AI attribution footers.
87
- **Always write in English** - All output text (code comments, commit messages, PR descriptions, issue comments, documentation) must be in English, even if the user writes in another language.
98

109
## Task Suitability
@@ -85,17 +84,22 @@ Everything for one plot type lives in a single directory:
8584

8685
```
8786
plots/{spec-id}/
88-
├── specification.md # Library-agnostic description
89-
├── specification.yaml # Tags, created, issue, suggested
90-
├── metadata/ # Per-library metadata
91-
│ ├── matplotlib.yaml
92-
│ └── ...
93-
└── implementations/ # Library implementations
94-
├── matplotlib.py
95-
├── seaborn.py
96-
└── ...
87+
├── specification.md # Library-agnostic description
88+
├── specification.yaml # Tags, created, issue, suggested
89+
├── metadata/
90+
│ └── python/ # Per-library metadata (one file per library)
91+
│ ├── matplotlib.yaml
92+
│ ├── seaborn.yaml
93+
│ └── ...
94+
└── implementations/
95+
└── python/ # Library implementations (one file per library)
96+
├── matplotlib.py
97+
├── seaborn.py
98+
└── ...
9799
```
98100

101+
The `python/` subdirectory is a deliberate forward-compatibility layer; non-Python implementation languages would live as siblings (e.g. `implementations/r/`) when introduced. All paths in code, prompts, and metadata refer to the language-prefixed form: `plots/{spec-id}/implementations/python/{library}.py` and `plots/{spec-id}/metadata/python/{library}.yaml`.
102+
99103
Example: `plots/scatter-basic/` contains everything for the basic scatter plot.
100104

101105
### Spec ID Naming Convention
@@ -137,19 +141,32 @@ Examples: `scatter-basic`, `scatter-color-mapped`, `bar-grouped-horizontal`, `he
137141
### PR Labels (set by workflows)
138142

139143
- **`approved`** - Human approved specification for merge
140-
- **`ai-approved`** - AI quality check passed (score >= 90, or >= 50 after 3 attempts)
141-
- **`ai-rejected`** - AI quality check failed (score < 90), triggers repair loop
144+
- **`ai-approved`** - AI quality check passed at the current cascading threshold (see below)
145+
- **`ai-rejected`** - AI quality check failed at the current threshold, triggers repair loop
142146
- **`quality:XX`** - Quality score (e.g., `quality:92`)
143147

148+
**Quality threshold cascade** (`.github/workflows/impl-review.yml`): the threshold drops by 10 each repair attempt to give partial credit for incremental improvement.
149+
150+
| Review # | Repair attempt | Threshold |
151+
|----------|----------------|-----------|
152+
| 1 (initial) | 0 | ≥ 90 |
153+
| 2 | 1 | ≥ 80 |
154+
| 3 | 2 | ≥ 70 |
155+
| 4 | 3 | ≥ 60 |
156+
| 5 | 4 | ≥ 50 |
157+
158+
If the score is still below 50 after 4 repair attempts, the PR is closed (`gh pr close`) and the workflow posts a comment with next-step options. Regeneration is **manual**, not automatic — re-apply the `generate:{library}` label on the spec issue to start a fresh attempt.
159+
144160
**Specification Lifecycle:**
145161
```
146162
[open] spec-request → approved → spec-ready [implementations can start]
147163
```
148164

149165
**Implementation PR Lifecycle:**
150166
```
151-
[open] → impl-review → ai-approved (≥90) → impl-merge → impl:{library}:done
152-
→ ai-rejected (<90) → impl-repair (×3) → ai-approved (≥50) or failed (<50)
167+
[open] → impl-review → ai-approved (≥ current threshold) → impl-merge → impl:{library}:done
168+
→ ai-rejected (< threshold) → impl-repair (×4) → cascade re-review
169+
→ after 4 failed repairs → close PR; manual regen via generate:{library} label
153170
```
154171

155172
## Code Standards
@@ -212,7 +229,7 @@ plt.savefig('plot.png', dpi=300, bbox_inches='tight')
212229

213230
## Tech Stack
214231

215-
- **Backend**: FastAPI, SQLAlchemy (async), PostgreSQL, Python 3.14+
232+
- **Backend**: FastAPI, SQLAlchemy (async), PostgreSQL, Python 3.13+
216233
- **Frontend**: React 19, TypeScript 6, Vite 8, MUI 9
217234
- **Package Manager**: uv (Python), yarn (Node.js)
218235
- **Linting**: Ruff (Python), ESLint (TypeScript)
@@ -223,8 +240,8 @@ The project runs on **Google Cloud Platform** (europe-west4 region):
223240

224241
| Service | Component | Purpose |
225242
|---------|--------------------|---------|
226-
| **Cloud Run** | `anyplot-backend` | FastAPI API (auto-scaling, serverless) |
227-
| **Cloud Run** | `anyplot-frontend` | React SPA served via nginx |
243+
| **Cloud Run** | `anyplot-api` | FastAPI API (auto-scaling, serverless) |
244+
| **Cloud Run** | `anyplot-app` | React SPA served via nginx |
228245
| **Cloud SQL** | PostgreSQL 18 | Database (Unix socket in production) |
229246
| **Cloud Storage** | `anyplot-images` | Preview images (GCS bucket) |
230247
| **Secret Manager** | `DATABASE_URL` | Secure credential storage |

0 commit comments

Comments
 (0)