Skip to content

Remove the retention question from onboarding; pathway defaults (30d team / 120d local)#397

Merged
philcunliffe merged 1 commit into
masterfrom
onboarding-retention-pathway-defaults
Jul 25, 2026
Merged

Remove the retention question from onboarding; pathway defaults (30d team / 120d local)#397
philcunliffe merged 1 commit into
masterfrom
onboarding-retention-pathway-defaults

Conversation

@philcunliffe

@philcunliffe philcunliffe commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

What

Removes the "Cache retention (days)" question from interactive onboarding. The wizard's pathway fork now decides the retention default instead of asking:

  • Join a team (and a managed machine's scoped re-entry): 30 days - the org server holds the durable copy of forwarded history, so the local cache is a working window.
  • Local install: 120 days - nothing leaves the machine, so the local cache is the only copy of history.

hyp init --retention-days <n> is unchanged (flag default stays 30) and remains the explicit override, as does editing query.cache.retention in the written config.

How

  • wizard/index.js passes retentionDefault: LOCAL_INSTALL_RETENTION_DAYS (new, 120) to the pick phase only on the local pathway; team/scoped runs fall through to the pick phase's 30-day DEFAULT_RETENTION_DAYS.
  • wizard/pick.js no longer prompts: retentionDays = opts.retentionDefault ?? DEFAULT_RETENTION_DAYS.
  • walkthrough.js deletes the retention prompt factories (TUI text input + legacy readline) and the retentionPrompt/AsyncRetentionPrompt seams; the superseded programmatic walkthrough keeps the flat 30-day default without prompting.

Docs

  • Mints LLP 0137 (onboarding-retention-defaults.decision.md, Active) with the choice and rationale; @ref LLP 0137#pathway-defaults annotations at the three code sites.
  • Amends LLP 0011's walkthrough transcript and "Autodetect vs default" prose.

Tests

  • New: pick-phase retention default coverage (30 without override, 120 via retentionDefault, pre-baked picks win) and orchestrator threading assertions (local passes 120, team passes nothing).
  • Updated: dropped the injected retention prompts and scripted keystrokes for the removed question across 7 test files.
  • npm test (2639 pass), npm run typecheck clean; smokes walkthrough_picker_to_first_query and walkthrough_backfill_client_history green. walkthrough_to_first_query fails identically on unmodified master on this machine (missing capture row, unrelated).

🤖 Generated with Claude Code

…ad (LLP 0137)

Onboarding no longer asks "Cache retention (days)". The wizard's pathway
fork decides the default: 30 days on the team pathway (and a managed
machine's scoped re-entry), where the org server holds the durable copy;
120 days on a local-only install, where the local cache is the only copy
of history. The orchestrator threads the local default into the pick
phase as retentionDefault; hyp init --retention-days is unchanged (flag
default stays 30) as the explicit override.

The retention prompt factories (TUI text input + legacy readline) are
deleted, along with the retentionPrompt seams in the walkthrough and
wizard option types. The superseded programmatic walkthrough keeps the
flat 30-day default without prompting.

Docs: mints LLP 0137 (decision, Active) and amends LLP 0011's
walkthrough transcript and defaults prose.

Co-Authored-By: Claude Fable 5 <[email protected]>
@philcunliffe philcunliffe added the neutral:adopt Foreign PR adopted into neutral's reconcile scope label Jul 24, 2026
@philcunliffe

Copy link
Copy Markdown
Contributor Author

neutral review (adopted PR, full-heal authorized) - reviewed at head 36d3aa0

Verdict: CLEAN. No actionable findings. Held for the maintainer to merge (neutral does not ready/merge a contributor PR).

What the change does

Removes the free-text "Cache retention (days)" question from onboarding (LLP 0137, amends LLP 0011) and replaces the flat 30-day default with a pathway-scoped default: 30 days on team/scoped installs, 120 days on local-only installs.

Correctness - verified end to end

  • Pathway wiring is correct. runInitWizard (src/core/cli/wizard/index.js:135) passes retentionDefault: LOCAL_INSTALL_RETENTION_DAYS (120) only when pathway === 'local'; team and scoped omit the override and fall through to the pick phase's DEFAULT_RETENTION_DAYS (30). This matches LLP 0137's rule that scoped re-entry counts as the team side (30d).
  • Pick phase applies it correctly. runWizardPick (src/core/cli/wizard/pick.js:156) sets retentionDays = opts.retentionDefault ?? DEFAULT_RETENTION_DAYS, and the value flows into composePickerConfig -> query.cache.retention.default_days, so persisted config and daemon get a valid value on both pathways.
  • No stranded consumer of the removed answer. Grep confirms zero residual references to retentionPrompt / AsyncRetentionPrompt / the removed factories across src/, test/, hypaware-core/, bin/. Types (AsyncRetentionPrompt, retentionPrompt) and factories (tuiRetentionPromptFactory, legacyRetentionPromptFactory, defaultRetentionPromptFactory) are all removed cleanly. The text TUI import was dropped from walkthrough.js and is unused elsewhere; readline is still used by the surviving numbered-prompt factories.
  • Non-interactive override intact. hyp init --retention-days <n> still flows through flags.retentionDays -> picks.retentionDays (src/core/commands/init.js:278, flag default 30). When picks is set, pick phase reads picks.retentionDays, which takes precedence over retentionDefault - covered by the "pre-baked picks override retentionDefault" test.
  • Legacy runPickerWalkthrough (no pathway fork) keeps the flat 30-day default, as LLP 0137 documents.
  • Back-compat: existing installs are untouched (retention lives in editable config, query.cache.retention); no migration needed.

Tests - updated and adequate

New/updated coverage in test/core/cli/wizard/{index,pick}.test.js: local pathway -> retentionDefault === 120; team pathway -> undefined (30d default); interactive run takes 30 without a prompt; retentionDefault: 120 lands 120 in the composed+written config; pre-baked picks override retentionDefault. Walkthrough/TUI/backfill/detect/init-guard tests updated to drop the removed retentionPrompt seam and assert the retention question is no longer rendered.

Style / LLP

No semicolons, no U+2014 em dashes in the changed files. @import JSDoc types used. @ref LLP 0137#pathway-defaults annotations are honest and the pathway-defaults anchor exists in the new LLP 0137; cross-doc references (0011#autodetect-vs-default, 0013#retention-is-the-central-tradeoff, 0031#open-questions--deferred) resolve to real heading-slug anchors. LLP 0011 correctly amended and LLP 0137 added.

Checks run (worktree, node_modules linked from main)

  • Affected suites (wizard index/pick, walkthrough prompt/detect/tui-happy/backfill, init-guard): 59 tests, 59 pass, 0 fail.
  • npm run typecheck (tsc --noEmit): clean.
  • Known-unrelated test/core/leave-command.test.js failures not in scope.

No code changes were needed; nothing pushed to the branch.

@philcunliffe philcunliffe added the neutral:approved neutral reviewed this and holds it for a maintainer merge (own or adopted PR; LLP 0025/0030) label Jul 24, 2026
@philcunliffe
philcunliffe merged commit 781451b into master Jul 25, 2026
8 checks passed
@philcunliffe
philcunliffe deleted the onboarding-retention-pathway-defaults branch July 25, 2026 01:28
@philcunliffe philcunliffe added the neutral:adopted Adoption completion record: merged while carrying neutral:adopt (LLP 0031) label Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

neutral:adopt Foreign PR adopted into neutral's reconcile scope neutral:adopted Adoption completion record: merged while carrying neutral:adopt (LLP 0031) neutral:approved neutral reviewed this and holds it for a maintainer merge (own or adopted PR; LLP 0025/0030)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant