fix(hooks): make transcript ingest wing configurable - #2070
Conversation
fatkobra
left a comment
There was a problem hiding this comment.
Blocking: hooks.transcript_wing=project derives one wing from the triggering transcript and then mines path.parent using that single wing.
That assumption is valid for Claude Code’s per-project transcript directory, but not for Codex’s date-bucketed sessions/YYYY/MM/DD/ layout. One Codex date directory can contain rollout files from several projects.
A hook triggered by project A can therefore submit the whole date directory with project A’s wing, causing sibling transcripts from projects B or C to be filed or re-filed into A’s wing. The daemon route has the same problem because it also submits source=path.parent.
Please do one of the following:
- scope this directory-level policy to transcript layouts where the parent directory is project-specific;
- mine only the triggering transcript; or
- partition files by each transcript’s independently derived project wing before mining/submission.
Please add a regression with two Codex rollout files in the same date directory but with different cwd/project values, and verify that neither file is routed through the other file’s wing.
|
Current-head coordination packet — 2026-08-08T22:00:38Z
This is a public-safe coordination receipt only. No push, merge, publication, credential, runtime, model, GPU, auth, or protected-reasoning mutation was performed or authorized by this pass. |
|
Current-head coordination packet — 2026-08-09T04:01:16Z
This is a public-safe coordination receipt only. No push, merge, publication, credential, runtime, model, GPU, auth, or protected-reasoning mutation was performed or authorized by this pass. |
|
Current-head coordination packet — 2026-08-09T10:00:48Z
|
|
Current-head coordination packet — 2026-08-09T16:01:56Z
|
|
Current-head coordination packet — 2026-08-09T22:00:57Z
|
|
Current-head coordination packet — 2026-08-10T04:00:32Z
|
|
Current-head coordination packet — 2026-08-10T10:00:38Z
|
|
Current-head coordination packet — 2026-08-10 16:01:44Z
|
|
Current-head coordination packet — 2026-08-10 22:01:41Z
|
|
Current-head coordination packet — 2026-08-11 04:00:16Z
|
|
Current-head coordination packet — 2026-08-11 10:01:08Z
|
|
Current-head coordination packet — 2026-08-11 22:00:42Z
|
|
Current-head coordination packet — 2026-08-12 04:01:48Z
|
|
Independent confirmation from a small production fleet (2 nodes, shared pgvector Where our patch differs: we made the wing an arbitrary operator-named value One more data point in favor of getting this right at ingest rather than fixing it Also flagging: the Codex date-bucket sibling-project concern raised above is real |
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 JSONLcwd/path. This adds a backward-compatible routing policy:{ "hooks": { "transcript_wing": "sessions" } }sessionsremains the default and preserves current behavior.projectderives the stable wing through the existing_wing_from_transcript_path()logic.MEMPALACE_HOOK_TRANSCRIPT_WINGoverrides file config.sessionsrather than silently relocating memories.Implementation
MempalaceConfig.hook_transcript_wingwithsessions|projectvalidation.sessionsrather than creating a surprisewing_sessionsmigration.--wing.Test-first verification
The repair branch was created from current upstream
developand used a temporary owner-controlled test-first workflow. The workflow:tests/test_hooks_cli.pyandtests/test_hook_write_routing.py;compileall, andgit diff --check;The submitted branch contains only:
mempalace/config.pymempalace/hooks_cli.pytests/test_hooks_cli.pyRisk
Low and opt-in. Existing installations remain on the historical
sessionswing unless they explicitly selectproject. No storage schema, existing drawer, or default hook behavior is changed.