Skip to content

feat(performance): add governed work-context evidence - #93

Draft
seonghobae wants to merge 18 commits into
developfrom
feat/performance-context-evidence
Draft

feat(performance): add governed work-context evidence#93
seonghobae wants to merge 18 commits into
developfrom
feat/performance-context-evidence

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Buyer-visible gap

develop@9e3e4847510e1e612b48474ba42b177b8ed824df has performance cycles and criterion observations but no governed evidence boundary for the work context in which criterion outcomes were observed. This Orgmetra-only lane adds value-minimized context provenance for later human-reviewed validation and workforce interpretation without changing ratings, criterion values, compensation, or employment decisions.

PerformanceContextEvidencePacket binds tenant, Employment, Job, performance cycle, a nonempty half-open business-time context window, sorted/unique Assignment and Organization memberships, reviewed SHA-256 provenance, distinct requester/reviewer, purpose/reason, evidence version, and system-recorded time. Canonical evidence excludes performance ratings, manager identity, raw HR values and free-form context values, and remains context_covariate_evidence_only, requires_human_review, not_authorized_for_performance_rating, and not_authorized_for_employment_decision.

Test-first integrity and review repair

The live-reference repair remains intact: RED 530bc5f19e436403748ca2f246893a0eeae16bdd proved an idempotent duplicate could erase a still-live conflict binding after GC; root repair 132ebf0edaba9b4939e86843a3ad01a4fbadbcb6 introduced one shared weak-referenceable binding per tenant-qualified reference/digest.

A later review wave identified additional valid repository/package-boundary issues on predecessor head bbb106aceeda3a3ac2ebf5caead9e174a9dbe21f:

  • 0163d9ab5064deaf0fae57e5d6928ff384def639 makes copied/restored off-lifecycle packets fail closed with the governed ValueError instead of leaking KeyError, adds the exact regression, and corrects the protected-develop traceability label.
  • Regression da9de6f98c099aa16ad651b9adf0ebd590507c15 requires a reviewed build-lock path and exact no-extra wheel install. 49041318ec8ffc2daad53400bf14cb96eb2c1b6b adds .github/requirements/performance-context-evidence-build.txt; dc254fb7257c7901be9ea2c1d9a6830637081c96 makes the workflow consume that reviewed hash lock, watches the lock path, and removes the misleading [test] extra.
  • Current head 951167e58a5a1f97254c290ae77354e5a0faeaee assigns each test a deterministic UUIDv4 packet reference derived from its node id while preserving same-reference behavior inside tests that intentionally verify conflict detection.

The one current unresolved Devin thread is informational: the weak registries are process-local defense-in-depth only; durable cross-process uniqueness belongs to authoritative persistence, as already documented.

Exact-current-head evidence

Current exact head: 951167e58a5a1f97254c290ae77354e5a0faeaee
Fresh live base: develop@9e3e4847510e1e612b48474ba42b177b8ed824df
GitHub reports open, Draft, and mergeable.

Fresh exact-head hosted workflows are terminal GREEN:

  • Performance Context Evidence Quality 32876393426 — success
  • Foundation CI 32876393333 — success
  • Recovery Rehearsal Quality 32876393398 — success
  • SAST Semgrep 32876393476 — success
  • Security Scan 32876393382 — success

Submitted reviews are COMMENTED/analysis only; there is no qualifying independent non-author APPROVE or CHANGES_REQUESTED. Review threads are resolved except the documented process-local-registry informational observation.

The live Draft lifecycle state is intentional for this loop: GitHub event history records ready_for_review on 2026-08-23 followed by convert_to_draft on 2026-08-25 under a separate same-repository lifecycle writer. Under SINGLE-WRITER, this loop records the exact-head GREEN evidence but does not race that lifecycle writer by toggling Draft/Ready again.

Scientific and ownership boundary

The packet preserves opportunity-to-perform, work-context, manager-context and multiple-membership provenance so later governed analysis can represent scientifically relevant multilevel, cross-classified, multiple-membership and temporal structure. It does not estimate a context effect, claim causality, adjust a worker rating, or duplicate Psychometrics Commons/fast-mlsirm/TEPP numerical kernels. Write scope is Orgmetra only.

Merge governance

Effective organization ruleset 18156473 — CWL Central required workflows is active on ~DEFAULT_BRANCH and requires PR integration, 2 approving reviews, stale-review dismissal, last-push approval, review-thread resolution, central required workflows, and deletion/non-fast-forward protection. Issue #89 tracks the narrower remaining commercial-control gaps: routine OrganizationAdmin bypass_mode=always / current_user_can_bypass=always, executable proof that every applicable Orgmetra-local gate is fail-closed required, and lifecycle-writer collisions where evidenced.

Do not merge until the live lifecycle owner advances the PR, two qualifying independent non-author approvals exist on the unchanged head, every applicable local/central gate is freshly terminal GREEN, and the effective ruleset is re-fetched. Do not self-approve, use routine administrator bypass, transfer predecessor evidence, weaken/simulate protection, or mutate a dedicated-writer dependency.

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

성과 맥락 증거 패킷 패키지를 추가했습니다. 패킷은 제한된 참조, 시간 범위, 출처 다이제스트와 인간 검토 상태를 보존합니다. 입력 검증, 런타임 무결성, 설치 휠 테스트와 100% 커버리지 품질 게이트를 구성했습니다.

Changes

성과 맥락 증거 패킷

Layer / File(s) Summary
패킷 계약과 검증 규칙
packages/performance-context-evidence/src/.../evidence.py, packages/performance-context-evidence/tests/test_evidence.py, packages/performance-context-evidence/tests/test_coverage_edges.py
PerformanceContextEvidencePacket의 필드와 고정 거버넌스 상태를 정의했습니다. UUID, 참조값, 날짜, 다이제스트, 시간대, 멤버십과 금지된 HR·평가 입력을 검증합니다.
패킷 발행과 무결성 바인딩
packages/performance-context-evidence/src/.../evidence.py, packages/performance-context-evidence/src/.../__init__.py, packages/performance-context-evidence/tests/test_evidence.py
공개 빌더와 패킷 메서드를 추가했습니다. 결정적 JSON과 SHA-256 다이제스트를 생성하고, 사후 변경과 활성 참조 충돌을 감지합니다.
문서화와 저장소 계약
docs/adr/0093-governed-performance-context-evidence.md, docs/doctoring/performance-context-evidence-references.md, docs/traceability/performance-context-evidence.md, packages/performance-context-evidence/README.md, packages/performance-context-evidence/CHANGELOG.md, packages/performance-context-evidence/tests/test_repository_contract.py
패킷의 데이터 최소화, 출처 보존, 인간 검토, 평가·고용 의사결정 제외 범위를 문서화했습니다. 관련 문서 경로와 README 필수 문구를 검증합니다.
빌드와 설치 휠 품질 게이트
packages/performance-context-evidence/pyproject.toml, .github/workflows/performance-context-evidence-quality.yml
패키지 빌드와 src 탐색, pytest 브랜치 커버리지를 구성했습니다. 고정 Python과 해시 검증 의존성을 사용하고, 설치 휠에서 테스트와 100% 커버리지를 실행합니다.

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

Merge Risk: 🔵 Low · up to bbb10

The PR adds governed work-context evidence without changing ratings or employment decisions. It is mergeable with explicit owner awareness for a bounded edge-case correctness issue affecting copied or deserialized evidence objects, plus minor documentation and workflow follow-up.

Sequence Diagram(s)

sequenceDiagram
  participant Caller as 호출자
  participant Builder as build_performance_context_evidence
  participant Packet as PerformanceContextEvidencePacket
  participant Quality as 품질 워크플로
  Caller->>Builder: 맥락과 출처 입력 전달
  Builder->>Packet: 검증된 패킷 생성
  Packet-->>Caller: 정규 JSON과 SHA-256 다이제스트 반환
  Quality->>Packet: 설치 휠에서 테스트와 커버리지 실행
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 제목은 성과 주기의 관리되는 업무 맥락 증거 경계를 추가하는 주요 변경을 정확하고 간결하게 설명합니다.
✨ 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/performance-context-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.

github-code-quality[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@opencode-agent Please review the current unchanged head against protected develop. Local exact-head verification: all owned package suites pass at 100% statement/branch coverage.

… exports

canonical_json now raises the governed ValueError when a packet was
restored without __post_init__ (copy/pickle path) instead of leaking
KeyError, and the traceability label names the protected branch
accurately. Regression simulates the slots-restored off-lifecycle
instance; suite stays at 100% statement+branch coverage (45 tests).
Addresses Devin and CodeRabbit findings on PR #93.

@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 1 new potential issue.

Open in Devin Review

Comment on lines +50 to +57
_REGISTRY_LOCK = RLock()
_CREATION_DIGESTS: WeakKeyDictionary[PerformanceContextEvidencePacket, str] = WeakKeyDictionary()
_PACKET_BINDINGS: WeakKeyDictionary[
PerformanceContextEvidencePacket, _LiveReferenceBinding
] = WeakKeyDictionary()
_LIVE_REFERENCES: WeakValueDictionary[
tuple[str, str], _LiveReferenceBinding
] = WeakValueDictionary()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📝 Info: Registry uniqueness is process-local only

_LIVE_REFERENCES/_CREATION_DIGESTS/_PACKET_BINDINGS are module-global weak maps, so conflict detection holds only within one process and depends on GC timing to release bindings. Durable cross-process uniqueness must come from authoritative persistence, as the ADR states.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@seonghobae
seonghobae marked this pull request as draft August 25, 2026 17:11
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