Skip to content

fix(hooks): make transcript ingest wing configurable - #2070

Open
grtninja wants to merge 9 commits into
MemPalace:developfrom
grtninja:fix/2057-hook-transcript-wing
Open

fix(hooks): make transcript ingest wing configurable#2070
grtninja wants to merge 9 commits into
MemPalace:developfrom
grtninja:fix/2057-hook-transcript-wing

Conversation

@grtninja

Copy link
Copy Markdown
Contributor

Summary

Closes #2057.

Hook-driven transcript mining is currently hardcoded to --wing sessions, even though the diary checkpoint path already derives a stable project wing from the transcript JSONL cwd/path. This adds a backward-compatible routing policy:

{
  "hooks": {
    "transcript_wing": "sessions"
  }
}
  • sessions remains the default and preserves current behavior.
  • project derives the stable wing through the existing _wing_from_transcript_path() logic.
  • MEMPALACE_HOOK_TRANSCRIPT_WING overrides file config.
  • invalid values fail safe to sessions rather than silently relocating memories.

Implementation

  • Add MempalaceConfig.hook_transcript_wing with sessions|project validation.
  • Resolve the transcript wing once for both direct and daemon hook write routes.
  • Keep ambiguous project derivation on sessions rather than creating a surprise wing_sessions migration.
  • Include the selected wing in daemon mine dedupe keys so the same source can be intentionally routed to a different wing without sharing an in-flight slot.
  • Preserve the existing direct-spawn per-target guard, whose command hash already includes --wing.

Test-first verification

The repair branch was created from current upstream develop and used a temporary owner-controlled test-first workflow. The workflow:

  1. added the regression tests and observed the pre-fix failures;
  2. applied the minimal config/routing change;
  3. ran the focused transcript-wing tests;
  4. ran tests/test_hooks_cli.py and tests/test_hook_write_routing.py;
  5. ran Ruff, compileall, and git diff --check;
  6. removed its temporary repair script/workflow before committing.

The submitted branch contains only:

  • mempalace/config.py
  • mempalace/hooks_cli.py
  • tests/test_hooks_cli.py

Risk

Low and opt-in. Existing installations remain on the historical sessions wing unless they explicitly select project. No storage schema, existing drawer, or default hook behavior is changed.

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.

Hook transcript ingest: derive a stable per-project wing instead of hardcoded "sessions"

1 participant