feat: Opus 4.7 integration (v4.5.0)#14
Merged
Merged
Conversation
Sinapsis stays fully deterministic in the hot path and becomes richer and cheaper to run on top of Claude Opus 4.7. - Cache-stable instinct ordering: id.localeCompare tiebreaker after priority + occurrences makes the injected systemMessage prefix byte-stable across consecutive tool uses, which is the prerequisite for prompt-cache hits on Opus 4.7's cached system block. - PreCompact hook (core/_precompact-guard.sh): re-invokes the learner before Claude Code compacts the context in long sessions, so fresh observations are flushed to proposals before the transcript is rewritten. Fire-and-forget with an 8s cap. - Raised caps for the 1M context window: * TOKEN_BUDGET 1500 -> 4000 (chars injected per tool use) * top-N instincts per tool use 3 -> 6 (MAX_INSTINCTS_INJECTED) * observation window for session-learner 1000 -> 5000 lines - settings.template.json declares the new PreCompact hook (hooks 6 -> 7). install.sh copies and chmods _precompact-guard.sh. - RFC docs/rfc-v5-adaptive-thinking.md: design for an opt-in SINAPSIS_LLM_ANALYZE=1 path in /analyze-session that would call the Anthropic SDK with adaptive thinking. NOT implemented in this release - core stays deterministic until the approach is validated. - Operator note: Scout/Analyst blueprint in v5.0-alpha no longer uses Haiku; Sonnet 4.6 is the lowest tier the system proposes. New suite tests/test-v45-opus47.sh (11 tests, all GREEN) covers the deterministic ordering invariant (shuffled-index byte-identical output, alphabetical tiebreaker), end-to-end PreCompact wiring, and the new caps. All existing suites re-run clean: install-upgrade 21/21, dashboard 12/12, dream 25/25, gstack-separation 18/18, security 11/11, v433-hardening 14/14. Total 112 tests passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
id.localeComparetiebreaker after priority + occurrences makes the injectedsystemMessageprefix byte-stable across consecutive tool uses, unlocking prompt-cache hits on Opus 4.7's cached system block (~90% discount on the instinct payload once the cache warms).core/_precompact-guard.sh) — re-invokes the session-learner right before Claude Code compacts the context in long sessions, so fresh observations are flushed to proposals before the transcript is rewritten. Fire-and-forget with an 8 s cap; relies on the existing advisory lock inside_session-learner.sh.TOKEN_BUDGET1500→4000, top-N instincts per tool use 3→6, observation window 1000→5000 lines./analyze-session(docs/rfc-v5-adaptive-thinking.md) — design only, opt-in behindSINAPSIS_LLM_ANALYZE=1. Core stays fully deterministic until validated.tests/test-v45-opus47.sh) covering deterministic ordering, PreCompact wiring, and raised caps. All existing suites re-run clean: 112 tests passing.Test plan
bash tests/test-v45-opus47.sh— 11/11 PASSbash tests/test-v433-hardening.sh— 14/14 PASSbash tests/test-install-upgrade.sh— 21/21 PASSbash tests/test-dashboard.sh— 12/12 PASSbash tests/test-dream.sh— 25/25 PASSbash tests/test-gstack-separation.sh— 18/18 PASSbash tests/test-security.sh— 11/11 PASS🤖 Generated with Claude Code