Skip to content

feat(app): add read-only learning promotion evaluation seam - #93

Merged
riquelmechile merged 1 commit into
mainfrom
feat/learning-app-seam
Aug 21, 2026
Merged

riquelmechile merged 1 commit into
mainfrom
feat/learning-app-seam

Conversation

@riquelmechile

Copy link
Copy Markdown
Owner

Linked issue

Closes #89

PR type

  • Bug fix (type:bug)
  • New feature (type:feature)
  • Documentation only (type:docs)
  • Code refactoring (type:refactor)
  • Maintenance / tooling (type:chore)
  • Breaking change (type:breaking-change)

Summary

  • Work unit 3 child W3C1 (auto-split, stacked-to-main on merged W3B2 test(business-domain): complete promotion authority fake coverage matrix #92, 396 ≤ 400 lines): the read-only app evaluation seam (task 2.1) + core tests (task 2.2 first half).
  • 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 → pure evaluatePromotion. Zero writes; empty tenant rejects before reads; policy failures stop BEFORE the event read; malformed input is typed unavailable; authority unavailability reaches needs-review via the evaluator, never promote.
  • Deviation (documented in apply-progress + Engram): design listed deps:{events,skills}; the seam adds authority + trusted{principalId,actorId} because authority is repository-resolved, not caller-supplied.
  • Strict TDD: RED (module missing) → GREEN 3/3 core (gold promote through the full seam; exactly one tenant-scoped read per repo + zero writes; policy-not-found stops before any event read); full gate pnpm check exit 0 — 1564 passed | 6 skipped, 0 new warnings.

Changes

File or area Change
packages/app/src/learning/evaluate.ts Read-only evaluation seam (new, 184)
packages/app/test/learning/evaluate.test.ts 3 core seam tests with recording doubles (new, 211)
openspec/changes/learning-promotion/tasks.md Task 2.1 checked

Verification

  • Focused checks pass: pnpm exec vitest run packages/app/test/learning/evaluate.test.ts → 3/3
  • The affected runtime scenario was exercised, or is not applicable (pure seam over in-memory fakes; no PG in this slice)
  • Full gate: pnpm check GREEN — 1564 passed | 6 skipped, 0 new warnings
  • Native RDD: lineage review-6ad031598d906097 (medium, reliability lens) approved with focused+full-gate evidence; pre-pr gate allow

Contributor checklist

  • The linked issue is open and has status:approved.
  • Exactly one PR type is selected and its matching type:* label is applied.
  • The branch name follows type/lowercase-description.
  • Tests and documentation are updated where behavior changed.
  • Commits use Conventional Commit format and contain no attribution trailers.
  • No secrets or unrelated changes are included.

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.
@riquelmechile riquelmechile added the type:feature Feature pull request label Aug 21, 2026
@riquelmechile
riquelmechile merged commit bff70c5 into main Aug 21, 2026
3 checks passed
@riquelmechile
riquelmechile deleted the feat/learning-app-seam branch August 21, 2026 23:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature Feature pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Wire promotion evaluation app seam, fakes, and atomic verify hook

1 participant