Compare commits
1 commit
main
...
chore/clea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01c114d052 |
4 changed files with 7 additions and 69 deletions
|
|
@ -408,7 +408,7 @@ def _extract_comment_bodies(json_str: str) -> list[str]:
|
||||||
def check_review(pr_number: int) -> PhaseResult:
|
def check_review(pr_number: int) -> PhaseResult:
|
||||||
"""Phase 5: REVIEW — APPROVE found in PR comments from code reviewer.
|
"""Phase 5: REVIEW — APPROVE found in PR comments from code reviewer.
|
||||||
|
|
||||||
Looks for '## Code Review Summary' heading (NOT '## Docs Review Summary')
|
Looks for '## Code Review Summary' heading
|
||||||
with '### Verdict: APPROVE'. Only the latest reviewer comment counts —
|
with '### Verdict: APPROVE'. Only the latest reviewer comment counts —
|
||||||
if reviewer changed from APPROVE to REQUEST_CHANGES, NOT_DONE.
|
if reviewer changed from APPROVE to REQUEST_CHANGES, NOT_DONE.
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -17,65 +17,3 @@ description: Use when you need to view or update the current project folder/file
|
||||||
1. Запусти указанную команду в терминале. Она выведет дерево каталогов и список файлов с их размерами прямо в stdout.
|
1. Запусти указанную команду в терминале. Она выведет дерево каталогов и список файлов с их размерами прямо в stdout.
|
||||||
2. Изучи полученную структуру воркспейсов, чтобы точно знать расположение файлов и пакетов.
|
2. Изучи полученную структуру воркспейсов, чтобы точно знать расположение файлов и пакетов.
|
||||||
3. Не сохраняй вывод в файлы на диск — читай его напрямую из вывода терминала.
|
3. Не сохраняй вывод в файлы на диск — читай его напрямую из вывода терминала.
|
||||||
|
|
||||||
## Handoff файлы (docs/handoff/)
|
|
||||||
|
|
||||||
Контекст передаётся между сессиями через handoff-файлы — один файл на PR.
|
|
||||||
|
|
||||||
### Структура
|
|
||||||
- `docs/handoff/pr-<N>-<slug>.md` — handoff для PR #N
|
|
||||||
|
|
||||||
### Шаблон
|
|
||||||
```markdown
|
|
||||||
---
|
|
||||||
pr: <N>
|
|
||||||
title: <PR title>
|
|
||||||
---
|
|
||||||
|
|
||||||
## Что сделано
|
|
||||||
<2-3 строки>
|
|
||||||
|
|
||||||
## Почему
|
|
||||||
<1-2 строки>
|
|
||||||
|
|
||||||
## Pending
|
|
||||||
<что осталось, или "—">
|
|
||||||
|
|
||||||
## Watch out
|
|
||||||
<gotchas, или "—">
|
|
||||||
```
|
|
||||||
|
|
||||||
## ADR файлы (docs/decisions/)
|
|
||||||
|
|
||||||
Архитектурные решения сохраняются в ADR (Architecture Decision Records).
|
|
||||||
|
|
||||||
### Структура
|
|
||||||
- `docs/decisions/<NN>-pr-<N>-<slug>.md` — один файл на решение
|
|
||||||
- Numbering: `001`, `002`, `003`, ... (zero-padded, sequential)
|
|
||||||
|
|
||||||
### Шаблон
|
|
||||||
```markdown
|
|
||||||
# ADR-<NN>: <title>
|
|
||||||
|
|
||||||
## Статус
|
|
||||||
Accepted (<YYYY-MM-DD>)
|
|
||||||
|
|
||||||
## Контекст
|
|
||||||
<почему нужно было решение>
|
|
||||||
|
|
||||||
## Решение
|
|
||||||
<что решили>
|
|
||||||
|
|
||||||
## Альтернативы
|
|
||||||
- <вариант>: <почему не подошёл>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Когда создавать ADR
|
|
||||||
- Новый паттерн или конвенция
|
|
||||||
- Архитектурное изменение (новый модуль, изменённые зависимости)
|
|
||||||
- Неочевидное решение (почему X, а не Y)
|
|
||||||
|
|
||||||
### Когда НЕ создавать ADR
|
|
||||||
- Bug fixes
|
|
||||||
- Refactoring without architectural change
|
|
||||||
- Documentation updates
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ function makeZodShim() {
|
||||||
boolean: chain,
|
boolean: chain,
|
||||||
array: chain,
|
array: chain,
|
||||||
object: chain,
|
object: chain,
|
||||||
// enum(values) — used by post-review.ts / post-docs-review.ts for
|
// enum(values) — used by post-review.ts for
|
||||||
// verdict validation. Like the other methods, the shim returns a
|
// verdict validation. Like the other methods, the shim returns a
|
||||||
// chainable builder without actually validating the value (validation
|
// chainable builder without actually validating the value (validation
|
||||||
// happens at the opencode zod layer, not inside execute()).
|
// happens at the opencode zod layer, not inside execute()).
|
||||||
|
|
@ -74,8 +74,8 @@ function stripTs(src) {
|
||||||
// 5) `args: z.ZodObject` -> the args are referenced inside execute as
|
// 5) `args: z.ZodObject` -> the args are referenced inside execute as
|
||||||
// `args.pr_number`; the schema itself is unused at runtime here.
|
// `args.pr_number`; the schema itself is unused at runtime here.
|
||||||
// 6) Strip `: type` annotations and `async execute(args)` stays.
|
// 6) Strip `: type` annotations and `async execute(args)` stays.
|
||||||
// 7) Strip `as const` assertions (TS-only, used by post-review.ts /
|
// 7) Strip `as const` assertions (TS-only, used by post-review.ts
|
||||||
// post-docs-review.ts for tuple literal types) -> plain array literal.
|
// for tuple literal types) -> plain array literal.
|
||||||
// 8) Strip `type <Name> = ...;` type alias declarations (TS-only) -> removed.
|
// 8) Strip `type <Name> = ...;` type alias declarations (TS-only) -> removed.
|
||||||
// 9) Strip relative imports (`import { X } from "./_shared"`) — the
|
// 9) Strip relative imports (`import { X } from "./_shared"`) — the
|
||||||
// referenced module is inlined by loadTool() via inlineShared(). The
|
// referenced module is inlined by loadTool() via inlineShared(). The
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"""Tests for .opencode/scripts/pipeline-status.py — pipeline oracle.
|
"""Tests for .opencode/scripts/pipeline-status.py — pipeline oracle.
|
||||||
|
|
||||||
All gh/git calls are mocked via monkeypatch on the module's ``run_cmd``
|
All gh/git calls are mocked via monkeypatch on the module's ``run_cmd``
|
||||||
helper. Filesystem checks (handoff, ADR, memory) use tmp_path.
|
helper. Filesystem checks (PR body headings, memory) use tmp_path.
|
||||||
|
|
||||||
``get_repo_full_name`` is cached via ``functools.cache`` and now called by
|
``get_repo_full_name`` is cached via ``functools.cache`` and now called by
|
||||||
every ``gh pr view``/``gh pr list``/``gh issue view`` site (``--repo`` flag,
|
every ``gh pr view``/``gh pr list``/``gh issue view`` site (``--repo`` flag,
|
||||||
|
|
@ -347,8 +347,8 @@ def test_check_review_not_done_error(monkeypatch):
|
||||||
assert result.status == ps.PhaseStatus.NOT_DONE
|
assert result.status == ps.PhaseStatus.NOT_DONE
|
||||||
|
|
||||||
|
|
||||||
def test_check_review_false_positive_docs_reviewer_comment(monkeypatch):
|
def test_check_review_false_positive_unrelated_summary_comment(monkeypatch):
|
||||||
"""docs-reviewer comment with '### Verdict: APPROVE' must NOT trigger check_review DONE."""
|
"""Unrelated review-summary comment must NOT trigger check_review DONE."""
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
ps,
|
ps,
|
||||||
"run_cmd",
|
"run_cmd",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue