Skip to content

feat(document-records): add governed HR document evidence - #98

Open
seonghobae wants to merge 19 commits into
developfrom
feat/document-record-evidence
Open

feat(document-records): add governed HR document evidence#98
seonghobae wants to merge 19 commits into
developfrom
feat/document-record-evidence

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Buyer-visible gap

Protected develop@9e3e4847510e1e612b48474ba42b177b8ed824df assigns document_records ownership of document metadata, source evidence, and immutable artifact references, but has no executable value boundary that binds one HR document artifact to tenant/Person/Employment scope, source provenance, retention-policy evidence, classification, business receipt time, and system-recorded time without copying document content into governance evidence.

Implemented boundary

This PR adds a standalone orgmetra-document-record-evidence package. DocumentRecordEvidence binds tenant, Person, Employment, a pseudonymous uploader correlation, a closed reviewed document-category code, opaque artifact reference + SHA-256, source-provenance SHA-256, retention-policy reference/digest, caller-owned UTC received_at, and Orgmetra-generated document_record_reference + recorded_at.

Canonical evidence is fixed to restricted_hr, artifact_reference_only, and not_authorized_for_employment_decision. It intentionally excludes document bytes/title, free-form notes, credentials, compensation, ratings, and unrelated HR values. It does not authorize content read/export, retention/disposition, or employment action; those remain authoritative human-accountable Orgmetra boundaries with immutable audit/outbox evidence.

A process-local weak issuance registry stores the creation-time canonical evidence digest outside packet-writable slots. Each export validates the live fields, snapshots once, verifies that exact snapshot against the issuance digest, and emits only the verified snapshot. This is defense in depth, not a durable signature or substitute for authoritative persistence.

Write scope is Orgmetra only. Clearfolio, NewsDOM, and every other dedicated-writer CWL repository remain read-only; no cross-service application-table SQL is introduced.

Test-first repair evidence

  • Coverage RED: exact head 4ab738b4cfee3573e5900dcb158e4a9db8a6e79e, Document Record Evidence Quality run 32632895006 / job 97178251398: all 14 functional tests passed but owned production coverage was only 89%, so the exact 100% gate correctly failed. Realistic malformed trust-boundary regressions then covered the unexercised fail-closed branches.
  • Post-issuance integrity RED: d4edde31fe5e9ff01a415410dafd8eea8209ecbd, run 32633003531 / job 97178514416: existing tests passed but a new valid-value object.__setattr__ rewrite regression proved that an issued packet could emit a second canonical truth. Root repair fdd09b1e2a912151126671604886bd7f252c0073 moved the authoritative creation digest outside packet-writable slots and made export use one verified payload snapshot.
  • Dedicated-gate RED: 12a66a984bef02ed535260736ff4fd0b66a44eca, run 32633215912 / job 97179024301: 21 tests passed and the new governance regression alone failed because ADR 0098 was absent from the dedicated workflow path filter. Current head 9aeeb204acce429f85b028029c9531a5b05f37e1 adds the ADR path, so ADR-only contract changes cannot bypass the package gate.

Exact-current-head evidence

Current exact head: 9aeeb204acce429f85b028029c9531a5b05f37e1 against live base develop@9e3e4847510e1e612b48474ba42b177b8ed824df.

  • Document Record Evidence Quality 32633266715: terminal success; exact-head checkout; CPython 3.14.7; SHA-256-bound isolated wheel installation; 22 tests; owned production 119 statements / 22 branches, exactly 100% statement and branch coverage; clean checkout.
  • Foundation CI 32633266676: terminal success, including all PostgreSQL integrity-contract jobs.
  • Recovery Rehearsal Quality 32633266737: terminal success.
  • SAST Semgrep 32633266694: terminal success.
  • Security Scan 32633266778: terminal success.
  • Fresh PR review/thread read: no submitted review and no unresolved review thread.

Documentation / traceability

Adds package README/CHANGELOG, ADR 0098, active-PR traceability, and APA 7 primary-source doctoring based on W3C PROV-O and NIST Privacy Framework 1.0. Standards are design inputs only; no conformance or certification claim is made.

Merge gate

The PR is technically ready for independent review at this unchanged exact head. It must not merge without a qualifying independent non-author approval and enforceable repository protection. Orgmetra issue #89 continues to track the live develop protection defect; exact-head GREEN evidence is not a substitute for that policy.

Summary by CodeRabbit

새로운 기능

  • HR 문서 본문이나 민감한 값을 포함하지 않는 최소화된 문서 기록 증거 기능을 추가했습니다.
  • 아티팩트 참조, 무결성 해시, 출처 및 보존정책 정보를 안전하게 연결합니다.
  • 생성 시점의 식별자와 기록 시각을 제공하며, 이후 데이터 변조를 감지합니다.
  • 정규화된 JSON 및 SHA-256 다이제스트 조회를 지원합니다.

문서

  • 사용 범위, 제외 항목, 보존·감사 책임 및 추적성 기준을 문서화했습니다.

품질 개선

  • 패키지 빌드, 설치, 무결성 검증, 테스트와 100% 커버리지 검사를 자동화했습니다.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a046702-6121-4e2e-b736-1025ff57d931

📥 Commits

Reviewing files that changed from the base of the PR and between 9e3e484 and 9aeeb20.

📒 Files selected for processing (10)
  • .github/workflows/document-record-evidence-quality.yml
  • docs/adr/0098-governed-document-record-evidence.md
  • docs/doctoring/document-record-evidence-references.md
  • docs/traceability/document-record-evidence.md
  • packages/document-record-evidence/CHANGELOG.md
  • packages/document-record-evidence/README.md
  • packages/document-record-evidence/pyproject.toml
  • packages/document-record-evidence/src/orgmetra_document_record_evidence/__init__.py
  • packages/document-record-evidence/src/orgmetra_document_record_evidence/evidence.py
  • packages/document-record-evidence/tests/test_evidence.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

DocumentRecordEvidence 패키지를 추가했습니다. 최소화된 HR 문서 메타데이터와 무결성 digest를 검증합니다. 관련 ADR, 참조 문서, 추적성 문서 및 설치 휠 품질 검증 워크플로를 추가했습니다.

Changes

Document Record Evidence

Layer / File(s) Summary
증거 계약과 무결성 구현
packages/document-record-evidence/pyproject.toml, packages/document-record-evidence/src/..., packages/document-record-evidence/tests/test_evidence.py
DocumentRecordEvidencebuild_document_record_evidence를 공개했습니다. UUID, SHA-256, UTC 시각, 허용 분류를 검증하고 canonical payload digest로 변경을 감지합니다. 생성, 직렬화, 오류 조건 및 마스킹 동작을 테스트합니다.
거버넌스와 추적성 문서
docs/adr/0098-governed-document-record-evidence.md, docs/doctoring/document-record-evidence-references.md, docs/traceability/document-record-evidence.md, packages/document-record-evidence/README.md, packages/document-record-evidence/CHANGELOG.md
증거의 포함·제외 범위, provenance, 보존정책, 시간 구분, 권한·감사 책임 및 후속 persistence 경계를 문서화합니다.
설치 휠 품질 검증
.github/workflows/document-record-evidence-quality.yml
develop 대상 변경과 수동 실행을 처리합니다. 고정된 checkout과 Python 3.14.7 환경에서 wheel을 빌드하고, 해시 고정 설치, pip check, 테스트, 100% 커버리지 및 checkout 상태를 검증합니다.

Estimated code review effort: 4 (Complex) | ~45 minutes

Merge Risk: ⚪ Minimal · up to 9aeeb

The PR adds a constrained, evidence-only HR document boundary with successful exact-head validation and no actionable merge-blocking risk remaining beyond normal independent review and repository protection checks.

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant build_document_record_evidence
  participant DocumentRecordEvidence
  Caller->>build_document_record_evidence: 키워드 인자 전달
  build_document_record_evidence->>DocumentRecordEvidence: 객체 생성 및 입력 검증
  Caller->>DocumentRecordEvidence: canonical_json 호출
  DocumentRecordEvidence-->>Caller: 검증된 canonical JSON 반환
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 governed HR document evidence 패키지와 관련된 주요 변경을 간결하고 명확하게 설명합니다.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/document-record-evidence

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant