[GH-ISSUE #4264] [Feature]: Expose chat branch lineage to capability agents #2307

Closed
opened 2026-10-21 05:47:10 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jul 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4264

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Capability agents can access chat records, but they cannot reliably determine whether a chat is a branch, identify its immediate parent, or locate the fork boundary. That prevents lineage-aware agent workflows and forces packages to depend on storage-specific metadata.

Proposed solution

Expose normalized branch metadata on CapabilityChatRecord, including the branch title, immediate parent chat ID, source fork message ID, and copied child message ID. Persist lineage for Engine-created branches, return null lineage fields for roots and branches without known relationships, and keep parent lineage unchanged when a parent is deleted.

Remove branch IDs from generic chat export, backup, and imported metadata because IDs are installation-specific. Bump the supported Capability API to 1.7, document the contract, and add regression coverage for the lineage and sanitization paths.

Alternatives considered

  • Have agents infer lineage from branch-group membership, display names, or exported messages; these do not identify the fork boundary reliably.
  • Expose raw storage metadata; this couples capability packages to Engine internals and makes malformed or legacy metadata part of the package contract.

Additional context

The implementation includes scripts/regressions/chat-branch-lineage.regression.ts and updates the chat branch and optional agent package documentation.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jul 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4264 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Capability agents can access chat records, but they cannot reliably determine whether a chat is a branch, identify its immediate parent, or locate the fork boundary. That prevents lineage-aware agent workflows and forces packages to depend on storage-specific metadata. ## Proposed solution Expose normalized branch metadata on `CapabilityChatRecord`, including the branch title, immediate parent chat ID, source fork message ID, and copied child message ID. Persist lineage for Engine-created branches, return null lineage fields for roots and branches without known relationships, and keep parent lineage unchanged when a parent is deleted. Remove branch IDs from generic chat export, backup, and imported metadata because IDs are installation-specific. Bump the supported Capability API to 1.7, document the contract, and add regression coverage for the lineage and sanitization paths. ## Alternatives considered - Have agents infer lineage from branch-group membership, display names, or exported messages; these do not identify the fork boundary reliably. - Expose raw storage metadata; this couples capability packages to Engine internals and makes malformed or legacy metadata part of the package contract. ## Additional context The implementation includes `scripts/regressions/chat-branch-lineage.regression.ts` and updates the chat branch and optional agent package documentation. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:47:11 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2307
No description provided.