test(harness): reorganize regression suites and preserve contract coverage

This commit is contained in:
2026-10-16 07:24:49 +00:00
parent b6f87db623
commit 33709ab873
108 changed files with 5869 additions and 5328 deletions
@@ -264,7 +264,7 @@ state deltas plus exact timestamps are not independent causal-event attestation.
Run focused tests with `terminal`:
```sh
python3 -B -m unittest harness.tests.impl.test_rework_readback harness.tests.impl.test_rework_readback_transport harness.tests.impl.test_rework_comment -v
python3 -B -m unittest harness.tests.impl.rework.test_rework_readback_provider harness.tests.impl.rework.test_rework_readback_cache harness.tests.impl.rework.test_rework_readback_bridge harness.tests.impl.rework.test_rework_readback_transport harness.tests.impl.rework.test_rework_comment -v
python3 -B harness/tests/run.py
```
@@ -325,7 +325,7 @@ def normalize_commit_files(rows):
```
<!-- commit-files-comparison-example:end -->
`harness/tests/impl/test_impl_architecture_docs.py`는 이 정본 block 자체를 추출·실행하여 순서 차이만 허용되는지, 실제 metadata/identity 변화·중복·malformed input을 거부하거나 비동등으로 판정하는지, 원본과 nested value가 불변인지 검증한다. 테스트에 comparator를 복제하지 않는다. 이 실행 회귀는 비교 예제의 local contract 검증이며 live provider capability, collection admission 또는 실제 전달 성공을 대신하지 않는다.
`harness/tests/impl/contracts/test_impl_architecture_comparator.py`는 이 정본 block 자체를 추출·실행하여 순서 차이만 허용되는지, 실제 metadata/identity 변화·중복·malformed input을 거부하거나 비동등으로 판정하는지, 원본과 nested value가 불변인지 검증한다. 테스트에 comparator를 복제하지 않는다. 이 실행 회귀는 비교 예제의 local contract 검증이며 live provider capability, collection admission 또는 실제 전달 성공을 대신하지 않는다.
### 7. 기존 PR branch 전달
@@ -136,7 +136,7 @@ python3 "$HARNESS_ROOT/harness/agents/review/skills/gitea-code-review/scripts/na
--plan "$RUN/plan.json" --baseline "$RUN/before.json"
python3 "$HARNESS_ROOT/harness/agents/review/skills/gitea-code-review/scripts/native_review.py" verify \
--plan "$RUN/plan.json" --before "$RUN/before.json" --after "$RUN/after.json" --exact "$RUN/exact.json"
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s harness/tests/review -p 'test_native_review.py' -v
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s harness/tests/review/native -t . -p 'test_*.py' -v
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s harness/tests/spec -v
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s harness/tests/impl -v
```
@@ -237,7 +237,7 @@ terminal(command="python3 harness/agents/spec/skills/gitea-implementation-spec-r
- 예시 provider-contract JSON: `{"version":{"version":"1.27.3"},"requested_reviewers_presentation_order":true}`. 기존 supersession/retouch/official 정책이 필요하면 각각 independently verified 값을 명시적으로 유지한다. 정본 계약 위치는 이 문서이며 기존 문서를 update-in-place한다; 회차별 artifact에서 별도 verifier나 snapshot normalization으로 우회하지 않는다.
- `check-unchanged --before <file> --after <file>`는 read-only replay의 exact snapshot 동일성을 확인한다. Helper 성공은 호출자가 실제 write를 하지 않았다는 증명이나 최종 리뷰 완료를 단독으로 의미하지 않는다.
- Helper는 credential을 발견하거나 자체 network client·외부 write를 제공하지 않고 acceptance 의미·evidence 유효성·verdict를 결정하지 않는다. Read-only collector가 호출하는 authenticated GET callback과 provider envelope 변환은 main의 기존 adapter 책임이다. 실제 secret 부재는 main이 별도로 확인하며 알려진 민감값은 Python API의 `sensitive_values`로 메모리 안에서만 전달한다. 입력 오류는 nonzero로 중단하고 입력 본문·credential을 error에 출력하지 않는다.
- 회귀 검증은 `terminal(command="PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s harness/tests/spec -p 'test_implementation_spec_review_support.py' -v")`로 실행한다. Schema/body/provider 처리 변경 시 같은 schema의 저장된 실제 wire artifact로 render·parse byte 일치와 publication·read-only replay도 검증한다. Helper 검증을 위해 새 외부 write를 하지 않으며 과거 artifact replay를 fresh authenticated readback으로 보고하지 않는다.
- 회귀 검증은 `terminal(command="PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s harness/tests/spec/support -t . -p 'test_*.py' -v")`로 실행한다. Schema/body/provider 처리 변경 시 같은 schema의 저장된 실제 wire artifact로 render·parse byte 일치와 publication·read-only replay도 검증한다. Helper 검증을 위해 새 외부 write를 하지 않으며 과거 artifact replay를 fresh authenticated readback으로 보고하지 않는다.
### Source Issue 자동 참조 projection
@@ -249,7 +249,7 @@ terminal(command="python3 harness/agents/spec/skills/gitea-implementation-spec-r
- Source Issue의 `updated_at`은 그 신규 reference event의 동일한 `created_at`/`updated_at`에 정확히 일치해야 하며 event는 review event보다 이전일 수 없다. 허용 timestamp는 Source Issue에만 적용한다. PR·PR Issue·historical review timestamp 규칙, Source Issue body·title·state·labels·assignees·milestone·normal comments와 기존 scope 보호를 완화하지 않는다. 초 단위 허용 오차나 timestamp 일괄 제외를 추가하지 않는다.
- 독립 before/after `pr_issue`는 exact target·author·open/unmerged 상태를 확인하고, verified PR review event 시각의 `updated_at`을 제외한 모든 field를 보존한다. 일반 댓글 수인 `pr_issue.comments`는 before/after 모두 boolean이 아닌 0 이상의 integer이며 정확히 같아야 한다. Native top-level `CommentTypeReview`는 일반 댓글 수를 증가시키지 않는다(`models/issues/comment.go`의 `updateCommentInfos`: `UpdateIssueNumComments`는 `CommentTypeComment`/제출된 `CommentTypeCode` 경로에만 적용). 별도 PullRequest record의 `pr.review_comments`는 검증한 신규 review 하나에 대해 정확히 1 증가해야 하며, 이 검증은 유지한다. 두 카운터를 혼동하거나 일반 댓글 증가·감소·누락·잘못된 타입을 projection으로 허용하지 않는다. Source timeline의 기존 event는 ID·순서·type·author·body·ref_comment와 나머지 field를 보존한다. 단, provider가 참조 대상의 현재 Issue record를 serialize하므로 기존 event의 `ref_issue`만 달라질 수 있다. 이 nested projection은 old/new 값 전체가 독립 before/after `pr_issue`와 각각 exact-match할 때만 허용한다. 다른 Issue 참조, 임의 field 변경, baseline 제거·순서 변경·추가 경쟁 event는 차단한다.
- `verify-publication`의 CLI 인자는 그대로이며 opt-in provider-contract와 위 9-field before/after snapshot을 전달한다. 성공 출력의 `source_issue_reference_ids`는 검증한 신규 Source event ID 하나다. Opt-in 없는 legacy snapshot은 기존 strict 규칙을 유지하고 확대 field를 자동 채택하지 않는다. Write 직전에는 확대 snapshot 전체를 `check-unchanged`로 baseline과 대조하고, 실패 후 추가 POST를 하지 않는다.
- 회귀 검증: `PYTHONDONTWRITEBYTECODE=1 python3 -m unittest harness.tests.spec.test_source_issue_reference_projection -v`. Collector → snapshot → CLI verifier의 로컬 검증과 saved-wire compatibility replay는 실제 새 게시 성공이 아니다. 과거 before evidence에 Source timeline 또는 독립 PR Issue가 없으면 재구성한 입력으로 과거 `partial`을 소급 PASS로 바꾸지 않는다.
- 회귀 검증: `PYTHONDONTWRITEBYTECODE=1 python3 -m unittest harness.tests.spec.projection.test_source_issue_reference -v`. Collector → snapshot → CLI verifier의 로컬 검증과 saved-wire compatibility replay는 실제 새 게시 성공이 아니다. 과거 before evidence에 Source timeline 또는 독립 PR Issue가 없으면 재구성한 입력으로 과거 `partial`을 소급 PASS로 바꾸지 않는다.
## 절차