Skip to content

feat(addie): Continue certification prompt for in-progress learners - #3303

Merged
bokelley merged 1 commit into
mainfrom
bokelley/stage-2-cert-continuation
Apr 26, 2026
Merged

bokelley merged 1 commit into
mainfrom
bokelley/stage-2-cert-continuation

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

  • Stage 2 of Persona-driven suggested prompts for Addie (Slack + Home) #2299, Piia's flagship example: a learner mid-cert sees "Continue certification" at the top of Addie's home.
  • New `MemberContext.certification` block hydrated from `certification_attempts` (single `LIMIT 1` query that prefers in-progress).
  • New rule `cert.continue_in_progress` at priority 93 — above lapsed re-engagement (92), because a concrete unfinished thing beats generic "what's new" when both signals fire.
  • Decay-exempt + 45-day freshness guard: never auto-suppresses (re-engaging a stalled learner is the high-value case), but doesn't fire for genuinely abandoned (>45-day-old) attempts — the lapsed and low-login rules handle re-entry better than nudging about an old artifact.
  • Persona override: `persona.ladder_or_simple_starter` ("Start with the Academy") is gated off when the learner is mid-cert — "Continue certification" is the accurate prompt at that point.

Reviews applied

  • Code reviewer: replaced full-scan `getUserAttempts` with new `getLatestAttempt` (`LIMIT 1`), added `failed` status test, set `decay: false`.
  • Product expert: added freshness guard for stale attempts; bumped priority 82 → 93 above lapsed; added persona override.
  • Education expert: voice + dynamic-label feedback ("Continue A1" with track/module surfaced) deferred — needs `PromptRule` to support function labels, broader refactor; will file as follow-up.

Test plan

  • 61 unit tests pass (was 56 pre-review; +5 covering freshness, failed status, persona override, lapsed-vs-cert priority)
  • Pre-commit hooks pass after `npm install --safe-chain-skip-minimum-package-age` (deps were stale)
  • Manual scenario walkthrough — `Learner mid-certification` correctly produces Continue cert → Profile → WG → Test agent
  • Verify in staging: a real A1 learner sees the prompt; an abandoned 60-day-old attempt does not

Out of scope (follow-up)

Dynamic per-module label ("Continue A1" instead of "Continue certification") — needs `PromptRule.label` and `prompt` to accept functions of context. Will file as a small refactor issue.

🤖 Generated with Claude Code

Stage 2 of #2299. Piia's flagship example: a learner mid-cert gets
"Continue certification" at the top of Addie's home.

- MemberContext.certification (track_id, module_id, status,
  started_at, last_activity_at) hydrated in Slack and web flows.
- New getLatestAttempt query (LIMIT 1, prefers in-progress) replaces
  a full-scan call to getUserAttempts.
- New rule cert.continue_in_progress at priority 93 — above lapsed
  re-engagement (92) since a concrete unfinished thing beats generic
  "what's new" when both signals fire.
- Decay-exempt like persona prompts: re-engaging stalled learners is
  exactly the high-value case; don't auto-suppress.
- Freshness guard: only fires when started_at is within the last 45
  days. Past that, the learner has likely moved on and the lapsed /
  low-login rules handle re-entry better.
- Gates persona.ladder_or_simple_starter to skip when the learner is
  mid-cert — "Continue certification" is more accurate than "Start
  with the Academy" at that point.

Out of scope: dynamic per-module label like "Continue A1" — needs
PromptRule.label/prompt to accept a function, broader refactor.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@bokelley

Copy link
Copy Markdown
Contributor Author

Issue #3304 proposes extending PromptRule.label and prompt to accept string | ((ctx: PromptRuleContext) => string) and updating the cert + wg rules to use dynamic values — same surface as this PR; consider folding before merge or confirm follow-up.


Generated by Claude Code

@bokelley
bokelley merged commit 00cc962 into main Apr 26, 2026
14 checks passed
@bokelley
bokelley deleted the bokelley/stage-2-cert-continuation branch April 26, 2026 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant