feat(domain): add team-department conformance evidence - #12
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 96eba1a09e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const personCompleteness: Completeness = | ||
| options.personAuthority === undefined || personMissing > 0 ? "PARTIAL" : "FULL"; |
There was a problem hiding this comment.
Include global-only users in authority completeness
When a supplied projection omits a user who appears only in globalMemberships, that user is never checked because authority coverage is evaluated only in the local-membership loop, so this marks the person axis FULL; a global-only dataset with authorityFromEntries([]) can therefore produce PASS. This also makes the explicit empty-set authority supplied for the global user in F-global-hovedstyret irrelevant. Require every observed global-only user to have an authority entry, even if its department set is empty, before claiming full person completeness.
Useful? React with 👍 / 👎.
| } | ||
| const authorized = options.personAuthority.departmentIdsByUser.get(membership.userId); | ||
| if (authorized === undefined) { | ||
| personMissing += 1; |
There was a problem hiding this comment.
Count missing authority users only once
When one user has multiple accepted local memberships but no authority entry, this increments personMissing once per edge. The resulting personComparison.missingUsers and Markdown label “Missing authority users” therefore report the number of memberships rather than distinct users—for example, two memberships for one missing user yield missingUsers: 2. Track missing user IDs in a set and report its size.
Useful? React with 👍 / 👎.
| @@ -0,0 +1,260 @@ | |||
| import { readFile } from "node:fs/promises"; | |||
| import { join } from "node:path"; | |||
There was a problem hiding this comment.
Code smell for idiomatic Effect. No direct runtime imports (node, bun, deno) environment capabilities should always go through the established Effect Platforms services
|
|
||
| export type RequiredFile = (typeof REQUIRED_FILES)[number]; | ||
|
|
||
| export type DatasetErrorCode = |
| file: RequiredFile, | ||
| decoder: (value: unknown) => DecodeResult<A>, | ||
| ): { readonly rows: ReadonlyArray<A>; readonly failures: ReadonlyArray<DecodeFailure> } => { | ||
| try { |
There was a problem hiding this comment.
Code smell Try Catch block. yield* Effect should be used instead for tracking Error dependencies
| }; | ||
|
|
||
| const readErrorCode = (error: unknown): string | undefined => { | ||
| if (typeof error !== "object" || error === null || !(("code" in error))) return undefined; |
There was a problem hiding this comment.
Code smell. Data shape validation should use Effect Schema
Design spec
design-specs/0004-team-department-conformance-evidence.mdJourney
A maintainer runs the bounded team/department domain proof and receives deterministic evidence for department tenancy, team identity, and accepted relation classifications.
Experience it
Evidence
packages/domain/**, and the derived root lock delta.What is real
The bounded
S-DEP-2-TEAMevidence is conforming. Person authority remains partial/informational; this PR does not claim fullS-DEP-1, temporal completeness, persistence, provider behavior, or production acceptance.