infra: governance registry sync gate in CI (#330) #335

Merged
jihoson merged 2 commits from feature/issue-330-governance-ci-guard into feature/v3-session-policy-stream 2026-02-28 18:21:10 +09:00
Collaborator

Summary

  • Extend governance validator to check changed files and require registry update when policy docs change
  • Add diff-range aware invocation in CI workflow
  • Keep existing governance checks intact

Validation

  • python3 scripts/validate_governance_assets.py
## Summary - Extend governance validator to check changed files and require registry update when policy docs change - Add diff-range aware invocation in CI workflow - Keep existing governance checks intact ## Validation - python3 scripts/validate_governance_assets.py
agentson added 1 commit 2026-02-28 14:36:14 +09:00
infra: enforce governance registry sync checks in CI (#330)
Some checks failed
Gitea CI / test (pull_request) Waiting to run
Gitea CI / test (push) Has been cancelled
2e394cd17c
Author
Collaborator

Ticket Maturity Update (2026-02-28)

  • Implemented: done
  • Integrated: done
  • Observed: done (targeted test commands executed and passing)
  • Accepted: pending (reviewer + runtime verifier approval required)

Coverage Matrix:

Stage Status
Implemented PASS
Integrated PASS
Observed PASS
Accepted NOT_OBSERVED
## Ticket Maturity Update (2026-02-28) - Implemented: done - Integrated: done - Observed: done (targeted test commands executed and passing) - Accepted: pending (reviewer + runtime verifier approval required) Coverage Matrix: | Stage | Status | | --- | --- | | Implemented | PASS | | Integrated | PASS | | Observed | PASS | | Accepted | NOT_OBSERVED |
agentson reviewed 2026-02-28 16:15:10 +09:00
agentson left a comment
Author
Collaborator

Review: PR #335 — infra: governance registry sync gate in CI (#330)

플랜 일치: ⚠️ ACT-13 부분 일치

  • 정책 레지스트리 업데이트 강제: 구현됨
  • TASK-REQ 매핑 강제: 미구현 (Phase 3 분류로 허용 가능)

코드 품질: 양호

  • is_policy_file(): docs/ouroboros/*.md 중 레지스트리 제외 — 올바른 필터링
  • load_changed_files(): git diff range 지원 + 에러 핸들링
  • CI workflow: fetch-depth: 0 + PR/push 이벤트별 range 계산
  • 기존 must_contain() 체크와 공존

테스트: ⚠️ 없음

  • validate_governance_assets.py에 대한 단위 테스트 미추가
  • CI 파이프라인 특성상 허용 범위이나, is_policy_file()validate_registry_sync() 정도는 테스트 추가 권장

결론: LGTM with nit — 테스트 추가 권장하나 blocking 아님

## Review: PR #335 — infra: governance registry sync gate in CI (#330) ### 플랜 일치: ⚠️ ACT-13 부분 일치 - 정책 레지스트리 업데이트 강제: ✅ 구현됨 - TASK-REQ 매핑 강제: ❌ 미구현 (Phase 3 분류로 허용 가능) ### 코드 품질: ✅ 양호 - `is_policy_file()`: `docs/ouroboros/*.md` 중 레지스트리 제외 — 올바른 필터링 - `load_changed_files()`: git diff range 지원 + 에러 핸들링 - CI workflow: `fetch-depth: 0` + PR/push 이벤트별 range 계산 - 기존 `must_contain()` 체크와 공존 ### 테스트: ⚠️ 없음 - `validate_governance_assets.py`에 대한 단위 테스트 미추가 - CI 파이프라인 특성상 허용 범위이나, `is_policy_file()`과 `validate_registry_sync()` 정도는 테스트 추가 권장 ### 결론: **LGTM with nit** — 테스트 추가 권장하나 blocking 아님
agentson added 1 commit 2026-02-28 17:40:51 +09:00
test: add governance validator unit coverage (#330)
Some checks are pending
Gitea CI / test (push) Waiting to run
Gitea CI / test (pull_request) Waiting to run
2406a80782
Author
Collaborator

권장사항 반영했습니다.

추가 사항:

  • scripts/validate_governance_assets.py 단위 테스트 추가 (tests/test_validate_governance_assets.py)
  • 커버한 케이스:
    • policy 파일 판별
    • policy 변경 시 registry 동반 변경 강제
    • registry 포함 시 통과
    • explicit path 입력 처리
    • BASE...HEAD range 입력 시 git diff 경로 파싱

검증:

  • pytest -q tests/test_validate_governance_assets.py tests/test_db.py -k "validate_governance_assets or decision_logs_session_id_migration_backfills_unknown"
  • 결과: 5 passed
권장사항 반영했습니다. 추가 사항: - `scripts/validate_governance_assets.py` 단위 테스트 추가 (`tests/test_validate_governance_assets.py`) - 커버한 케이스: - policy 파일 판별 - policy 변경 시 registry 동반 변경 강제 - registry 포함 시 통과 - explicit path 입력 처리 - `BASE...HEAD` range 입력 시 git diff 경로 파싱 검증: - `pytest -q tests/test_validate_governance_assets.py tests/test_db.py -k "validate_governance_assets or decision_logs_session_id_migration_backfills_unknown"` - 결과: 5 passed
agentson reviewed 2026-02-28 17:42:30 +09:00
agentson left a comment
Author
Collaborator

Re-review: PR #335 — infra: governance registry sync gate in CI (#330)

이전 리뷰 지적사항 반영 확인

  1. 단위 테스트: 추가됨 — tests/test_validate_governance_assets.py 신규 작성
    • test_is_policy_file_detects_ouroboros_policy_docs: 정책 파일 식별 (ouroboros md만 해당, 레지스트리 자체 제외, 비md 제외)
    • test_validate_registry_sync_requires_registry_update_when_policy_changes: 정책 변경 시 레지스트리 누락 감지
    • test_validate_registry_sync_passes_when_registry_included: 레지스트리 포함 시 통과
    • test_load_changed_files_supports_explicit_paths: 경로 정규화 (./prefix 제거, 공백 trim)
    • test_load_changed_files_with_range_uses_git_diff: git range 처리 (monkeypatch로 subprocess mock)

코드 품질

  • importlib.util로 스크립트 동적 로딩 — 패키지 외부 스크립트 테스트에 적절한 방식
  • 구현 코드는 이전과 동일 — 테스트만 추가

결론: LGTM

## Re-review: PR #335 — infra: governance registry sync gate in CI (#330) ### 이전 리뷰 지적사항 반영 확인 1. **단위 테스트**: ✅ 추가됨 — `tests/test_validate_governance_assets.py` 신규 작성 - `test_is_policy_file_detects_ouroboros_policy_docs`: 정책 파일 식별 (ouroboros md만 해당, 레지스트리 자체 제외, 비md 제외) - `test_validate_registry_sync_requires_registry_update_when_policy_changes`: 정책 변경 시 레지스트리 누락 감지 - `test_validate_registry_sync_passes_when_registry_included`: 레지스트리 포함 시 통과 - `test_load_changed_files_supports_explicit_paths`: 경로 정규화 (./prefix 제거, 공백 trim) - `test_load_changed_files_with_range_uses_git_diff`: git range 처리 (monkeypatch로 subprocess mock) ### 코드 품질 - importlib.util로 스크립트 동적 로딩 — 패키지 외부 스크립트 테스트에 적절한 방식 - 구현 코드는 이전과 동일 — 테스트만 추가 ### 결론: **LGTM** ✅
jihoson merged commit 1b0d5568d3 into feature/v3-session-policy-stream 2026-02-28 18:21:10 +09:00
jihoson deleted branch feature/issue-330-governance-ci-guard 2026-02-28 18:21:10 +09:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jihoson/The-Ouroboros#335