Skip to content

feat(install): persist memory learning settings - #2638

Open
krzkraw wants to merge 1 commit into
headroomlabs-ai:mainfrom
krzkraw:krz/install-memory-parity
Open

feat(install): persist memory learning settings#2638
krzkraw wants to merge 1 commit into
headroomlabs-ai:mainfrom
krzkraw:krz/install-memory-parity

Conversation

@krzkraw

@krzkraw krzkraw commented Jul 28, 2026

Copy link
Copy Markdown

Description

Headroom already supports memory and traffic-learning controls at runtime, but persistent install manifests did not retain the learning toggle, storage mode, minimum evidence, or project-root override.

This PR persists those settings through the existing manifest, planner, state, and generated supervisor command. It also removes the duplicate legacy HEADROOM_MODE input.

This complements merged #2563 and overlaps #2346.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Performance improvement
  • Code refactoring (no functional changes)

Changes Made

  • Add persistent --learn/--no-learn, --memory-storage, --min-evidence, and --memory-project-root options.
  • Save and restore those values through DeploymentManifest.
  • Regenerate matching runtime arguments during apply and restart.
  • Leave optimization mode unset when the operator does not select one.
  • Show persisted memory and learning settings in install status.

Testing

  • Unit tests pass (pytest)
  • Linting passes (ruff check .)
  • Type checking passes (mypy headroom)
  • New tests added for new functionality
  • Manual testing performed

Test Output

176 passed, 2 skipped
All checks passed!
Success: no issues found in 509 source files

Real Behavior Proof

  • Environment: macOS; temporary install homes and manifests plus the combined local deployment.
  • Exact command / steps: Exercised learning on/off, all storage modes, custom evidence thresholds, project-root overrides, legacy manifests, restart regeneration, generated runtime arguments, and install status.
  • Observed result: Settings survived manifest round-trips and produced one consistent supervisor command; omitted values retained runtime defaults.
  • Not tested: Linux, Windows, VMs, or GitHub CI.

Runtime Rollout Safety

  • Rollout-managed feature(s): None.
  • Minimum rollout channel: N/A; this change uses stable/default behavior.
  • Stable/default behavior changed: Install profiles retain learning, memory-storage, minimum-evidence, and project-root settings across apply and restart.
  • Kill switch / disable path: Use --no-learn and omit --memory to disable both learning and persistent memory.
  • Unsafe override required: No.
  • Qualification impact: Installer manifest round-trips and generated runtime arguments for memory and learning settings.
  • Rollback path: Revert this PR and regenerate affected profiles before using an older Headroom version.

Review Readiness

  • I have performed a self-review
  • This PR is ready for human review

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • Documentation changes are not required for this installer parity change
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I did not edit CHANGELOG.md — it is generated by release-please from my Conventional Commit PR title (a CI guard enforces this)

Screenshots (if applicable)

Not applicable.

Additional Notes

Older manifests load with backward-compatible defaults. New manifests add four optional fields; older Headroom versions may require regenerating the profile before reuse.

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

PR governance

This PR follows the template and is marked ready for human review.

@github-actions github-actions Bot added the status: ready for review Pull request body is complete and the author marked it ready for human review label Jul 28, 2026
@krzkraw krzkraw changed the title feat(install): persist memory learning settings feat(install): persist memory and learning settings Jul 28, 2026
@github-actions github-actions Bot added status: needs author action Pull request body or readiness checklist still needs author updates and removed status: ready for review Pull request body is complete and the author marked it ready for human review labels Jul 28, 2026
@krzkraw krzkraw changed the title feat(install): persist memory and learning settings feat(install): persist memory learning settings Jul 28, 2026
@github-actions github-actions Bot added status: ready for review Pull request body is complete and the author marked it ready for human review and removed status: needs author action Pull request body or readiness checklist still needs author updates labels Jul 28, 2026

@JerrettDavis JerrettDavis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the install manifest/state/CLI plumbing for persisted memory learning options. The new fields round-trip through saved manifests, old manifests get safe defaults, and install no longer writes two competing mode authorities (proxy_mode plus HEADROOM_MODE). I also merged current main into the PR branch.

Local verification after the update: uv run --extra dev python -m pytest tests/test_install/test_memory_options.py tests/test_install/test_state.py tests/test_install/test_proxy_mode_default.py tests/test_cli/test_install_cli.py -q -> 48 passed.

@JerrettDavis JerrettDavis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed current head acd054ad after the main-branch refresh. The persisted learning/storage/evidence/project-root fields still round-trip through manifest state and runtime arguments, the single mode authority remains intact, and the integration preserves current main’s Docker host-memory-path and Podman fixes. Local validation: 49 focused installer/state tests passed; touched-file Ruff check/format, targeted mypy, and diff whitespace all pass. No blocking finding.

@krzkraw
krzkraw force-pushed the krz/install-memory-parity branch from acd054a to 11025db Compare August 17, 2026 23:53
@github-actions github-actions Bot added status: needs author action Pull request body or readiness checklist still needs author updates and removed status: ready for review Pull request body is complete and the author marked it ready for human review labels Aug 17, 2026
@github-actions github-actions Bot added status: ready for review Pull request body is complete and the author marked it ready for human review and removed status: needs author action Pull request body or readiness checklist still needs author updates labels Aug 19, 2026
@krzkraw
krzkraw force-pushed the krz/install-memory-parity branch from 11025db to ff04986 Compare August 20, 2026 17:45

@JerrettDavis JerrettDavis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-reviewed current head \ f04986c\ after the latest rebase. The feature patch still persists learning/storage/evidence/project-root settings through manifest state and runtime arguments, retains one mode authority, preserves explicit environment precedence, and includes backward-compatible manifest migration coverage. No new blocking issue found in the refreshed patch.

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

Labels

status: ready for review Pull request body is complete and the author marked it ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants