Repository navigation
feat: sync with cortext.cpp engine v5 (reference time, LI asset, text with media) - #2
Merged
Merged
Conversation
The engine removed the no-op procedural_enabled flag from the C ABI cortext_config struct; drop it from Config and nativeConfig so the purego struct layout matches. go test -short passes; a local New() smoke test with a Config passes against a libcortext.dylib built from the engine change.
A turn's text and photo under one source become one "mixed" memory whose content entries each carry their own mimetype (C API memory JSON content[].mimetype). Contexts are passed through as decoded JSON, so the binding exposes both fields; the README documents the memory content shape.
ProcessOptions.EvidenceBudgetBytes (zero = recalled memories whole) fills the native cortext_process_json_options struct's new evidence_budget_bytes field. The README documents the budget (text by its UTF-8 bytes, other payloads 480 bytes) and that query contexts lead with standing_memory, ahead of retrieved_memory. go test passes against a libcortext.dylib built from the engine change (CORTEXT_LIBRARY_PATH).
# Conflicts: # CHANGELOG.md # README.md
… asset ProcessOptions gains ReferenceTime and AsOf, mirrored into the has_reference_ms/as_of/reference_ms tail of cortext_process_json_options. Options the loaded native cannot read now return an error. MaterializeModel checksums and places AIST-87M-LI.gguf beside AIST when the manifest declares it, and New validates CORTEXT_LI_MODEL_PATH. Tests cover reference time with and without as_of, per-content timestamps, text with media, standing memory and LI asset resolution against the engine.
The 48-byte options struct made released natives, which keep only their exact struct size, clip it to the include_embedding prefix and drop retention. Offer each known layout newest first instead. Pre-v5 cortext_config still has procedural_enabled at the same size, so New rejects the shifted Config fields there rather than misrouting them, and the v5-only tests skip on such natives.
AssetsVersion and ModuleVersion are 2.0.0. The module path becomes github.com/augmem/cortext.go/v2 for the v2 major. CI and the release hook set CORTEXT_REQUIRE_ENGINE_V5=1 so the engine v5 tests fail instead of skipping, and the LI tests fall back to the downloaded release assets.
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.
Summary
Brings cortext.go up to date with augmem/cortext.cpp
main(f0b681e9: engine v5 #28, per-blob content timestamps #30, reference-time retrieval #31). The branch starts from the localengine-prunework (evidence budget,standing_memory, typed and mixed content,ProceduralEnabledremoval), mergesorigin/main(already contained, so no changes) and merges PR #1 (feat/text-media-payload).Requires the next engine release.
AssetsVersion/ModuleVersionstay at 1.2.4, and the CHANGELOG "Unreleased" section says so. With the pinned native, the v5 tests skip.Per API item
ProcessOptions.EvidenceBudgetBytes→evidence_budget_bytes, on everyProcess*call (from engine-prune).ProcessOptions.ReferenceTime time.TimeandAsOf boolmap tohas_reference_ms/as_of/reference_ms. The native struct is 48 bytes, and a test pins its layout.ReferenceTimemeans unset.AsOfwithoutReferenceTimeis an error, and so is a time before the epoch.ctx["standing_memory"]and documented. A new test checks that it holds the directive and not the fact.modality: "mixed", per-entrymimetype, and the memorymimetypetaken from its first signal. Documented, with an existing test.content[].timestamp(ms, 0 = unknown). A test checks it falls within the store window.text/*payloads count as text.ProcessOptions, so the budget and reference time apply.MaterializeModelchecksumsAIST-87M-LI.ggufand places it beside AIST whenever the manifest declares it. Older manifests that don't declare it are skipped.NewvalidatesCORTEXT_LI_MODEL_PATHand forwards it through the CRT on Windows.include_embeddingprefix and silently dropped retention.NewrejectsSequentialEdgesEnabled/SignalFilter*on a pre-v5 native, because there they would land one field off.Breaking
Config.ProceduralEnabledis removed (a change to the Ccortext_configlayout).Test plan
All runs used
CGO_ENABLED=0 go test ./... -count=1on macOS arm64 with Go 1.26.0.CORTEXT_LIBRARY_PATH=/Volumes/Build/cortext/bindings/shared/libcortext.dylibbuilt from f0b681e9,CORTEXT_ASSETS_DIR=/Volumes/Build/cortext/bindings/models,CORTEXT_LI_MODEL_PATH=…/AIST-87M-LI.gguf): 26 passed, 0 skipped, 0 failed (ok … 375s).ok … 466s).TestNewProcessEmbednow also asserts that the 1.2.4 native keeps the retention layout and rejects shifted Config fields.-short: ok.-count=5): ok.AsOfhiding, the older-native error, LI materialization and LI env validation all failed. They pass after the change.cortext.go, the legacy-layout test showedStructSize:12 … Retention:3(retention dropped), and the Config guard accepted shifted fields. Both pass now.Not verified: Windows and Linux (CI only), and 32-bit (the layout test skips there).
Supersedes #1.