Skip to content
CommonLayer
Documentation menu
On this page

ADR-0033: Eligibility evaluations are re-derivable and scoped to the assignment's time

Status: Accepted (WP-13). Implemented in crates/commonlayer-maintenance/src/domain/eligibility/.

Context

Eligibility decides whether a maintainer is paid for a month. Such decisions must be explainable to the person concerned, reproducible later (for appeals and audits) and fair across hand-overs in the middle of a month.

Decision

  • evaluate(inputs, policy) is a pure function. The inputs, the thresholds and the rule set version (RULES_VERSION = 1) are stored verbatim with each evaluation, and verify_evaluation re-derives the stored result from them.
  • Rules are scoped to the time the assignment held the slot: deadlines, reports and tasks count only if they fell due while the assignment was active; end-of-period rules apply only to an assignment still active at the period end. A predecessor is not blamed for what happened after the hand-over, nor the successor for what happened before.
  • security_ack tasks do not count in tasks.required, because sla.acknowledgement already judges the same deadline.
  • An input that could not be loaded makes the evaluation under_review; finalization waits up to seven days past the review window for it, then finalizes as under_review, which settlement holds and never pays.
  • Hours and days in explanations are rounded up, so a limit is never understated.

Consequences

  • Every decision has a plain-language explanation and a public variant without private identifiers.
  • Overrides and appeal resolutions need a justification (at least 10 characters) and a person other than the subject; the computed state is kept next to the override.