feat: configurable fragment separator mode - #14
Merged
Merged
Conversation
Add per-resource fragment splitting configuration: - fragment_mode field: 'auto' (heuristic + AI) or 'separated' (text separator) - fragment_separator field: the separator string (e.g. '~~~') Backend: - SplitFragmentsBySeparator() splits HTML by matching DOM elements - Fetcher dispatches to separator or auto mode based on resource config - DB migration adds both fields via addFieldIfMissing Frontend: - ResourceForm shows split mode dropdown when Fragment feed is checked - Separator text input shown when mode is 'separated' - Resource list badge shows separator value (e.g. 'Fragment (~~~)') Tests: 6 new test cases for separator splitting
Sync delta specs to main specs: - content-fetching: separator-based splitting, auto mode, no AI for separated - resource-management: fragment mode configuration, badge display Archive change to openspec/changes/archive/2026-03-04-configurable-fragment-separator/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add per-resource fragment splitting configuration so fragment feeds can use either:
~~~for aishepherd.nl/moments)Changes
Backend
SplitFragmentsBySeparator()ininternal/engine/fragment.go— walks DOM children, groups elements between separator-matching elementsinternal/engine/fetcher.go— routes to separator or auto mode based on resource configcmd/knowledgehub/collections.go— addsfragment_mode(select: auto/separated) andfragment_separator(text) fieldsinternal/testutil/testutil.go— includes new fieldsFrontend
ResourceForm.svelte— split mode dropdown + separator text input, shown when Fragment feed is checkedresources/+page.svelte— passes new props in edit flow, badge showsFragment (~~~)for separated modeOpenSpec
content-fetchingandresource-managementmain specsTesting
All existing tests pass. 6 new
SplitFragmentsBySeparatortests pass. Frontend builds cleanly.