feat(document-records): persist immutable HR document metadata - #107
Draft
seonghobae wants to merge 14 commits into
Draft
feat(document-records): persist immutable HR document metadata#107seonghobae wants to merge 14 commits into
seonghobae wants to merge 14 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
marked this pull request as ready for review
August 25, 2026 23:30
seonghobae
marked this pull request as draft
August 26, 2026 18:05
…nto HEAD # Conflicts: # manifest.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Buyer-visible gap
PR #98 defines a value-minimized
DocumentRecordEvidencepacket but intentionally leaves durable persistence to the authoritativedocument_recordsboundary. This stacked Orgmetra-only lane adds immutable, tenant-isolated PostgreSQL persistence for reviewed HR document metadata and artifact references without storing document content or other HR values.Ownership and persistence contract
document_recordsowns the newdocument_recordrelation. Person/Employment identities and audit/outbox handoffs are kept as bounded opaque contract references rather than direct foreign keys or queries intopeople_core,audit_provenance, orintegration_hubapplication tables. The relation stores reviewed category, artifact/source/retention digests, business receipt time, exact value-minimized canonicalDocumentRecordEvidenceJSON, its SHA-256, application correlation evidence, and fixedrestricted_hr/artifact_reference_only/not_authorized_for_employment_decisionstates. Document bytes/title, free-form HR text, compensation, ratings, credentials, and employment-decision output are absent.PostgreSQL owns durable
recorded_at; caller backdating and future receipt time fail closed. UPDATE/DELETE/TRUNCATE are rejected. ENABLE + FORCE RLS is exercised with aNOSUPERUSER NOBYPASSRLSreader. Missing tenant context returns no visible rows.Test-first repair sequence
fc422cf507053aa6eb010f9f0e623caef06dbddaande3eb7d80e04ca77a47165210291ba4a911af6b0aadded the PostgreSQL regression and dedicated exact-head workflow while deliberately omitting migration0021; run32696739767was later cancelled after the branch advanced and is not claimed as terminal RED evidence.f29459aceb5d4fdeb32c01fc5489ef28b0ff4c8fcorrected the ownership boundary before implementation: People and audit/outbox application tables remain opaque foreign-owner contracts rather than direct SQL dependencies.fa1cbd02299f6357b038291867ae368297583146with immutable metadata persistence, PostgreSQL-owned system time, fixed reviewed vocabularies, destructive-write resistance, and forced tenant RLS. ADR 0107, traceability, and primary-source doctoring were then added.evidence_digest_sha256could be supplied independently of the typed metadata, allowing metadata from one document to be correlated with another packet's digest. Regression59f2d8247c631da0f35fb8bf0a4b806c5ee8925bsupplies a different, internally valid canonical evidence payload with the predecessor digest and requires fail-closedcanonical evidence digestrejection.4a5f76f067fc505420f729a35f2b4c8e68fcc116stores the exact bounded canonical evidence JSON and validates its exact SHA-256, v1 key set/schema, typed-field equality, and evidence receipt/issuance chronology. Extension-resolution repair head5e521fd829de313a037f45ac28227c2ae5362d37additionally resolves the pgcrypto digest function through its extension schema.Exact-current-head evidence
Current exact head:
78e67a0493c6b25210b0fcc4a8a6efddf5d339c7.Fresh live base:
59b809bead617d9045357396df684991548bdc30.GitHub reports the PR open, draft, mergeable
MERGEABLE, merge stateCLEAN, review decisionNONE.All 1 latest named check run(s) are terminal success or skipped.
Current exact-head review state: 0 unresolved thread(s); APPROVED review records: none.
This evidence section was synchronized on 2026-08-29. Any predecessor-head claims or prior run IDs elsewhere in this PR body are historical and do not transfer to the current head. Keep this PR governed by the current exact-head checks, review threads, effective protection, and independent approval requirements.
Stack and merge governance
This PR is intentionally stacked on #98. #98 remains open, ready-for-review, mergeable, exact-head GREEN, and without a qualifying independent non-author approval. Process #98 dependency-first and keep #107 Draft while #98 is unmerged. After #98 integrates, retarget #107 to the then-current protected
develop, reconcile migration/document inventory ordering, refetch exact head/base/rules/reviews/threads, and rerun every applicable Foundation/SAST/Security/Recovery/document-record evidence/persistence gate on the resulting exact head without transferring predecessor evidence.No dedicated-writer dependency repository or cross-service application table is modified.