Skip to content

✨ feat: add native document extraction seam#596

Open
vaayne wants to merge 2 commits into
mainfrom
xberg-document-extraction-plan
Open

✨ feat: add native document extraction seam#596
vaayne wants to merge 2 commits into
mainfrom
xberg-document-extraction-plan

Conversation

@vaayne

@vaayne vaayne commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What

Add an internal document extraction seam and route the read image text fallback through it instead of shelling out directly from the tool.

Also upgrade the project toolchain to Go 1.26.4 and add a build-tagged xberg extractor implementation behind xberg && cgo.

Why

Document parsing should become a Stella platform capability, not a user-visible kreuzberg extract instruction in channel messages or tool internals. The xberg Go package requires Go 1.26, so the toolchain upgrade is the first unblocker.

How

  • Added internal/document with extractor interface, result normalization, CLI compatibility fallback, and xberg build-tag implementation.
  • Updated internal/tools/read.go to depend on the extractor seam.
  • Replaced channel file hints with read tool guidance and an extraction-preview helper.
  • Bumped mise, Docker builder, and go.mod to Go 1.26.4.
  • Let Go 1.26 lint fixes inline existing pointer helper callsites.

Validation:

  • mise run format
  • mise run build
  • mise run test

Known follow-up: go test -tags xberg ./internal/document reaches linking but needs libxberg_ffi under xberg's .lib/<platform> path before native xberg can be enabled.

Refs

Refs #595

@vaayne vaayne force-pushed the xberg-document-extraction-plan branch from 4363592 to 5c0a9c9 Compare June 26, 2026 09:15
@github-actions

github-actions Bot commented Jun 26, 2026

Copy link
Copy Markdown

📊 Coverage Report

Total coverage: 48.8% (generated files excluded)

Lowest-covered entries (first 200)
github.com/CherryHQ/stella/api/client/helpers.go:103:        0.0%
github.com/CherryHQ/stella/api/client/helpers.go:113:        0.0%
github.com/CherryHQ/stella/api/client/helpers.go:17:         0.0%
github.com/CherryHQ/stella/api/client/helpers.go:27:         0.0%
github.com/CherryHQ/stella/api/client/helpers.go:35:         0.0%
github.com/CherryHQ/stella/api/client/helpers.go:58:         0.0%
github.com/CherryHQ/stella/api/client/helpers.go:70:         0.0%
github.com/CherryHQ/stella/api/client/helpers.go:89:         0.0%
github.com/CherryHQ/stella/cmd/stella/commands.go:9:         0.0%
github.com/CherryHQ/stella/cmd/stella/db.go:14:              0.0%
github.com/CherryHQ/stella/cmd/stella/db.go:24:              0.0%
github.com/CherryHQ/stella/cmd/stella/email.go:103:          0.0%
github.com/CherryHQ/stella/cmd/stella/email.go:815:          0.0%
github.com/CherryHQ/stella/cmd/stella/email.go:828:          0.0%
github.com/CherryHQ/stella/cmd/stella/email.go:82:           0.0%
github.com/CherryHQ/stella/cmd/stella/email.go:836:          0.0%
github.com/CherryHQ/stella/cmd/stella/email.go:844:          0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:145:           0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:184:           0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:222:           0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:22:            0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:258:           0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:292:           0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:332:           0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:48:            0.0%
github.com/CherryHQ/stella/cmd/stella/goal.go:99:            0.0%
github.com/CherryHQ/stella/cmd/stella/main.go:11:            0.0%
github.com/CherryHQ/stella/cmd/stella/mise.go:13:            0.0%
github.com/CherryHQ/stella/cmd/stella/mise.go:29:            0.0%
github.com/CherryHQ/stella/cmd/stella/oauth.go:102:          0.0%
github.com/CherryHQ/stella/cmd/stella/oauth.go:139:          0.0%
github.com/CherryHQ/stella/cmd/stella/oauth.go:14:           0.0%
github.com/CherryHQ/stella/cmd/stella/oauth.go:31:           0.0%
github.com/CherryHQ/stella/cmd/stella/oauth.go:68:           0.0%
github.com/CherryHQ/stella/cmd/stella/recally_articles.go:403: 0.0%
github.com/CherryHQ/stella/cmd/stella/version.go:11:         0.0%
github.com/CherryHQ/stella/cmd/stellad/commands.go:318:      0.0%
github.com/CherryHQ/stella/cmd/stellad/commands.go:334:      0.0%
github.com/CherryHQ/stella/cmd/stellad/commands.go:355:      0.0%
github.com/CherryHQ/stella/cmd/stellad/commands.go:388:      0.0%
github.com/CherryHQ/stella/cmd/stellad/commands.go:446:      0.0%
github.com/CherryHQ/stella/cmd/stellad/commands.go:89:       0.0%
github.com/CherryHQ/stella/cmd/stellad/debug_dump.go:30:     0.0%
github.com/CherryHQ/stella/cmd/stellad/debug_dump.go:35:     0.0%
github.com/CherryHQ/stella/cmd/stellad/debug_dump.go:58:     0.0%
github.com/CherryHQ/stella/cmd/stellad/debug_dump_signal_unix.go:12: 0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:135:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:362:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:373:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:377:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:384:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:392:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:399:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:410:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:418:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:439:       0.0%
github.com/CherryHQ/stella/cmd/stellad/gateway.go:64:        0.0%
github.com/CherryHQ/stella/cmd/stellad/main.go:11:           0.0%
github.com/CherryHQ/stella/cmd/stellad/models.go:12:         0.0%
github.com/CherryHQ/stella/cmd/stellad/models.go:37:         0.0%
github.com/CherryHQ/stella/cmd/stellad/models.go:41:         0.0%
github.com/CherryHQ/stella/cmd/stellad/models.go:50:         0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:107: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:120: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:141: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:164: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:18: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:190: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:195: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:203: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:225: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:26: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:81: 0.0%
github.com/CherryHQ/stella/cmd/stellad/plugin_services.go:94: 0.0%
github.com/CherryHQ/stella/cmd/stellad/postgres.go:118:      0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:101: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:115: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:119: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:123: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:127: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:131: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:142: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:149: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:153: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:161: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:185: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:198: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:215: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:236: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:245: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:272: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:292: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:374: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:393: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:404: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:414: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:422: 0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:56:  0.0%
github.com/CherryHQ/stella/cmd/stellad/service_linux.go:60:  0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_embedding.go:19: 0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_embedding.go:31: 0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_memory.go:20:   0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_memory.go:70:   0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_memory.go:86:   0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_plugins.go:129: 0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_plugins.go:30:  0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_plugins.go:69:  0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_plugins.go:93:  0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_pool.go:23:     0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_pool.go:31:     0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_pool.go:39:     0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_pool.go:84:     0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_reflect.go:27:  0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_reflect.go:45:  0.0%
github.com/CherryHQ/stella/cmd/stellad/setup_skills.go:26:   0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:181:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:221:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:233:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:238:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:338:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:575:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:598:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:608:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:615:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:692:       0.0%
github.com/CherryHQ/stella/cmd/stellad/version.go:768:       0.0%
github.com/CherryHQ/stella/internal/agent/agentctx/context.go:12: 0.0%
github.com/CherryHQ/stella/internal/agent/agentctx/context.go:20: 0.0%
github.com/CherryHQ/stella/internal/agent/agentctx/context.go:29: 0.0%
github.com/CherryHQ/stella/internal/agent/agentctx/context.go:37: 0.0%
github.com/CherryHQ/stella/internal/agent/agentctx/context.go:46: 0.0%
github.com/CherryHQ/stella/internal/agent/agentctx/context.go:66: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:100: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:104: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:108: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:142: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:156: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:165: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:187: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:204: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:214: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:249: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:270: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:305: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:320: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:348: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:371: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:397: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:404: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:414: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:437: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:44: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:461: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:480: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:48: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:501: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:527: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:52: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:539: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:553: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:56: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:580: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:598: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:60: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:615: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:630: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:647: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:68: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:72: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:76: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:80: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:84: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:88: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:92: 0.0%
github.com/CherryHQ/stella/internal/agent/pool_manager.go:96: 0.0%
github.com/CherryHQ/stella/internal/agent/prompt/prompt.go:288: 0.0%
github.com/CherryHQ/stella/internal/agent/runner_impl.go:303: 0.0%
github.com/CherryHQ/stella/internal/agent/runner_impl.go:313: 0.0%
github.com/CherryHQ/stella/internal/agent/runner_impl.go:434: 0.0%
github.com/CherryHQ/stella/internal/agent/runner_impl.go:442: 0.0%
github.com/CherryHQ/stella/internal/agent/runner_impl.go:449: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/chat.go:258: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/chat.go:436: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/chat.go:458: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/options.go:23: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/options.go:31: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/options.go:38: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/options.go:45: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/options.go:55: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runner_cache.go:200: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runner_cache.go:272: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:106: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:113: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:121: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:129: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:136: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:141: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:146: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:151: 0.0%
github.com/CherryHQ/stella/internal/agent/runtime/runtime.go:156: 0.0%

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.

1 participant