-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add bitemporal people domain kernel #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
seonghobae
wants to merge
46
commits into
feat/foundation-product-baseline
from
feat/bitemporal-people-core
Closed
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
09c9ca3
feat: add bitemporal people domain kernel
seonghobae cbd86b5
merge: refresh foundation baseline
seonghobae c7c7b61
test: separate durable person identity from effective names
seonghobae 99f40a0
fix: separate person anchor from effective name facts
seonghobae b3dce34
test: require organization and job domain records
seonghobae b98f307
feat: model bitemporal organization and job records
seonghobae f095b06
feat: export organization and job domain records
seonghobae 85ffc72
docs: describe organization and job domain coverage
seonghobae 5c3b341
docs: trace organization and job domain records
seonghobae 3d9b469
docs: record organization and job domain slice
seonghobae 32ef213
test: separate organization and job identity from versions
seonghobae d017128
fix: normalize organization and job version facts
seonghobae 4d38390
fix: export normalized organization and job versions
seonghobae e47e787
docs: explain normalized organization and job history
seonghobae 7b72ec1
docs: trace durable organization and job anchors
seonghobae c8180d0
docs: record normalized organization and job history
seonghobae c89e612
test: reproduce unsafe assignment numeric and error behavior
seonghobae 4b133ca
fix: fail closed on unsafe assignment allocations
seonghobae 86405c4
test: align allocation overlap assertion with safe error contract
seonghobae f1fe180
test: require installed-wheel quality evidence
seonghobae 9d9bfcb
build: pin wheel backend for artifact smoke
seonghobae 9d830e8
build: prove typed wheel installs outside source tree
seonghobae 2ce30f4
test: require explicit person-anchor lifecycle boundary
seonghobae 3eebded
docs: define person-anchor recorded lifecycle ownership
seonghobae 0f257b5
test(domain): require exact-head workflow evidence
seonghobae ab7720f
fix(ci): bind domain quality to exact pull request head
seonghobae 0179b8e
test: reject superseded foundation references
seonghobae d1f0268
test: cover stale protected-branch wording
seonghobae 87b3144
docs: point domain stack at canonical foundation
seonghobae 8e6d7c4
docs: describe protected default branch generically
seonghobae e747eab
chore: refresh domain stack integrity manifest
seonghobae e534a1e
fix: synchronize domain integrity manifest
seonghobae 1cfba68
test: specify bitemporal historical resolution
seonghobae aaf29b4
test: make temporal failure contracts explicit
seonghobae 0911dfd
feat: fail closed on ambiguous temporal facts
seonghobae bc6e295
feat: resolve bitemporal historical facts
seonghobae 60df35e
feat: export temporal historical resolver
seonghobae 1962a84
docs: explain bitemporal historical resolution
seonghobae 25dd682
docs: record historical query capability
seonghobae edfcee2
docs: trace historical resolution evidence
seonghobae 565854c
chore: refresh temporal resolution integrity manifest
seonghobae 42a1502
test: reject stale protected-main wording in stack
seonghobae 6b68189
docs: follow protected default branch truth
seonghobae c707ae0
chore: refresh stack governance manifest
seonghobae 08c96b7
fix: bound candidate relink errors
seonghobae cf557c9
fix: make bitemporal resolution identity-aware
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: Domain Quality | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: orgmetra-quality-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| domain-quality-matrix: | ||
| name: domain-quality (${{ matrix.python-version }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.11", "3.12", "3.13", "3.14"] | ||
| env: | ||
| PIP_DISABLE_PIP_VERSION_CHECK: "1" | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
| persist-credentials: false | ||
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install hash-locked quality dependency | ||
| run: >- | ||
| python -m pip install | ||
| --only-binary=:all: | ||
| --require-hashes | ||
| -r requirements/ci.txt | ||
| - name: Verify domain and repository contracts | ||
| run: ./scripts/run_domain_quality.sh | ||
|
|
||
| domain-quality: | ||
| name: domain-quality | ||
| needs: domain-quality-matrix | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Require every supported Python lane | ||
| run: | | ||
| echo "domain-quality-matrix result=${{ needs.domain-quality-matrix.result }}" | ||
| test "${{ needs.domain-quality-matrix.result }}" = "success" |
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # ADR 0004: Framework-independent domain kernel | ||
|
|
||
| ## Status | ||
|
|
||
| Proposed in active implementation PR. | ||
|
|
||
| ## Context | ||
|
|
||
| Core HRIS invariants must be reusable by standalone services, a modular monorepo, tests, migration workers, and future API adapters without importing a web framework or database driver. These invariants are non-mathematical and do not require the Rust psychometric compute policy. | ||
|
|
||
| ADR 0003 requires effective/business time and system-recorded time to remain independently reconstructable. A durable person identity is different from a mutable HR fact: the domain package exposes an identity-only `PersonRecord`, while creation and retirement knowledge time are persistence-owned lifecycle metadata. The authoritative persistence contract must therefore retain `recorded_from` and `recorded_to` for the person anchor even though those columns are not duplicated as mutable attributes on the in-memory identity value. Adapters that load or persist a person anchor must carry that lifecycle metadata in their repository envelope rather than silently dropping it. | ||
|
|
||
| ## Decision | ||
|
|
||
| Implement bitemporal people, employment, position, assignment, and candidate-worker invariants in the independently installable `orgmetra-domain` Python package. Keep persistence, authorization, transport, and external integrations outside the package. Include a PEP 561 marker and exact coverage/docstring gates. | ||
|
|
||
| Keep durable identity anchors intentionally small. `PersonRecord` contains only the opaque durable identity; persistence owns the recorded lifecycle of that identity. Mutable person names and other effective-dated facts use explicit version records with `BitemporalPeriod`. Repository adapters are responsible for preserving the anchor's system-recorded lifecycle alongside the identity, and repository-contract tests require both lifecycle columns to remain present in the authoritative schema. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Domain behavior is testable without infrastructure. | ||
| - Future services can embed the same invariant layer. | ||
| - Database constraints must mirror these rules transactionally. | ||
| - Person-anchor creation/retirement history remains reconstructable without turning the durable identity object into a mutable fact record. | ||
| - A repository adapter that omits the person anchor's `recorded_from` or `recorded_to` violates this ADR even if an identity-only `PersonRecord` can still be constructed. | ||
| - Psychometric and mathematical computation remains Rust-first and is not added to this package. | ||
|
|
||
| ## Acceptance evidence | ||
|
|
||
| - Behavioral RED/GREEN tests for every invariant. | ||
| - Repository-contract proof that the person persistence record retains `recorded_from` and `recorded_to` while the domain anchor remains identity-only. | ||
| - Exact 100% production statement and branch coverage. | ||
| - Python 3.11-3.14 CI. | ||
| - Installed-wheel smoke and `py.typed` presence verification before release. |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub mergeability is
CONFLICTING. This stacked tree still vendors the pre-tenant schema snapshot (display_nameonperson_record, no version tables) and hashes it. Live foundation already hastenant_record,person_name_record,organization_unit_version, andjob_profile_version.TRACEABILITY must name the live tables this kernel can actually implement. After rebase, rewrite the person-lifecycle contract test and the integrity manifest. Add a contract that domain types remain implementable against the live schema (
numeric(5,4), tenant FKs).Next action: rebase onto current #8 after it merges. Do not transfer predecessor checks or approvals.