Repository navigation
feat(app): add read-only learning promotion evaluation seam - #93
Conversation
Work unit 3 child 4 (learning-promotion): domain-flow seam — activated tenant Skill to unique policy to ONE event read to aggregate/parse to trusted-authority resolution to pure evaluation, with typed unavailable results and fail-closed policy resolution before any read.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 414c0db2ab
ℹ️ 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".
| outcomes: aggregated.value.positiveObservations, | ||
| createdAt: input.at, | ||
| }); | ||
| if (!candidate.ok) return unavailable('no-matching-outcomes', candidate.reason); |
There was a problem hiding this comment.
Return a candidate result when no outcomes match
When the selected window contains zero matching outcomes—a normal state for a newly activated skill—createLearningCandidate rejects its empty outcomes array, and this branch reports the evaluation as unavailable. That bypasses evaluatePromotion, whose threshold semantics return remain-candidate with insufficient-positive-observations; callers therefore cannot distinguish ordinary insufficient evidence from a malformed/unavailable evaluation. Handle the empty aggregate as an evaluated remain-candidate result rather than no-matching-outcomes.
Useful? React with 👍 / 👎.
Linked issue
Closes #89
PR type
type:bug)type:feature)type:docs)type:refactor)type:chore)type:breaking-change)Summary
packages/app/src/learning/evaluate.ts: activated tenant Skill → unique applicable policy → ONE event-stream read → aggregate → parse explicit+authority evidence → repository authority resolution for the trusted actor/principal → pureevaluatePromotion. Zero writes; empty tenant rejects before reads; policy failures stop BEFORE the event read; malformed input is typedunavailable; authority unavailability reachesneeds-reviewvia the evaluator, neverpromote.deps:{events,skills}; the seam addsauthority+trusted{principalId,actorId}because authority is repository-resolved, not caller-supplied.pnpm checkexit 0 — 1564 passed | 6 skipped, 0 new warnings.Changes
packages/app/src/learning/evaluate.tspackages/app/test/learning/evaluate.test.tsopenspec/changes/learning-promotion/tasks.mdVerification
pnpm exec vitest run packages/app/test/learning/evaluate.test.ts→ 3/3pnpm checkGREEN — 1564 passed | 6 skipped, 0 new warningsreview-6ad031598d906097(medium, reliability lens) approved with focused+full-gate evidence; pre-pr gateallowContributor checklist
status:approved.type:*label is applied.type/lowercase-description.