feat: OVOS-CONTEXT-1 orchestrator gate + manifest-sourced require/exclude context#801
Merged
JarbasAl merged 4 commits intoJul 2, 2026
Merged
Conversation
Implement the core-resident half of OVOS-CONTEXT-1: the flat, decaying session.intent_context key/value store, alongside the legacy frame-based IntentContextManager. New module ovos_core.intent_services.intent_context provides: - §2 entry shape + liveness predicate (value/flag/null, turns/wallclock) - §3.1 scope resolution (private <skill_id>:<key> vs shared bare key) - §6/§6.1 gate_satisfied predicate (requires/excludes, post-decay) - §7 context_supplied_slots fill rule (utterance value wins) - IntentContextStore: §4 prune-then-decrement decay, §4.1 mid-dispatch exemption, §5.3 ovos.session.sync entry-by-entry merge (set+null-delete), §2 max-entry cap eviction Wire into IntentService (the orchestrator): - handle_session_sync merges ovos.session.sync intent_context payloads - handle_utterance adopts inbound snapshot, prunes pre-match, decrements post-match over the pre-match key set (so mid-dispatch syncs survive) - _emit_match_message applies §5.1 promotion + §7 slot fill and stamps the working map onto the emitted session (legacy Session drops the field) - intent_context exposed as a lazily-backed property for safe partial construction Engine-side §6/§6.1 gating *inside* matchers (adapt/padacioso) is out of scope and deferred; core exposes the shared gating vocabulary they consult. SESSION_SYNC is a literal here; its SpecMessage registration is a SESSION-2/spec-tools follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ONTEXT-1 §5.3) The session.intent_context map and the §5.3 ovos.session.sync entry-by-entry merge (set + null-delete) are now owned by the SessionManager singleton (bus-client #239): it carries intent_context as a first-class round-tripping Session field and applies the merge in SessionManager.handle_session_sync / merge_intent_context. The orchestrator no longer subscribes to ovos.session.sync and holds no parallel session_id-keyed store: - service.py: drop the SESSION_SYNC subscription, the handle_session_sync handler, the bus.remove on shutdown, the _intent_context store, the intent_context property/setter, and _stamp_intent_context. The §4 decay now operates on the session's own intent_context map (prune-then- decrement around the match round), written back via SessionManager.update so the singleton stays authoritative; §4.1 mid-dispatch sync keys are skipped from the decrement. §5.1 promotion merges via SessionManager.merge_intent_context; §7 slot fill reads sess.intent_context. - intent_context.py: IntentContextStore (the {session_id: map} store + its merge_sync) is gone. The decay/liveness/scope/gate/fill logic is kept as stateless module helpers (prune, decrement, enforce_cap + the existing pure predicates) that operate on a passed-in intent_context dict. - pyproject: floor-pin ovos_bus_client>=2.5.0a1 (the alpha carrying #239). - tests: §5.3 merge tests re-homed to bus-client #239; core keeps/expands the decay/liveness/scope/gate/fill tests plus a live check driving the REAL SessionManager merge and asserting core sees merged+decayed context. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…larations The orchestrator drops a matched candidate whose requires_context is unmet or whose excludes_context is present, re-checking the gate so a misbehaving matcher cannot dispatch a context-gated intent. The declared gates and slot names are read from the passive INTENT-4 §10 manifest (the single source of an intent's declaration) — never off the Match. - IntentManifest.get_context_requirements / get_slot_names: union an intent's requires_context / excludes_context / slot names across its registration definitions. - match loop: gate backstop via gate_satisfied against session.intent_context. - _apply_context_slots (§7): sources requires_context + slot_names from the manifest instead of the Match. Additive: an intent that declares no gates is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
# Conflicts: # ovos_core/intent_services/service.py # pyproject.toml # test/unittests/test_intent_context.py # test/unittests/test_intent_service_extended.py
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
JarbasAl
marked this pull request as ready for review
July 2, 2026 20:14
JarbasAl
added a commit
that referenced
this pull request
Jul 23, 2026
…lude context (#801) * feat: OVOS-CONTEXT-1 orchestrator-resident intent context Implement the core-resident half of OVOS-CONTEXT-1: the flat, decaying session.intent_context key/value store, alongside the legacy frame-based IntentContextManager. New module ovos_core.intent_services.intent_context provides: - §2 entry shape + liveness predicate (value/flag/null, turns/wallclock) - §3.1 scope resolution (private <skill_id>:<key> vs shared bare key) - §6/§6.1 gate_satisfied predicate (requires/excludes, post-decay) - §7 context_supplied_slots fill rule (utterance value wins) - IntentContextStore: §4 prune-then-decrement decay, §4.1 mid-dispatch exemption, §5.3 ovos.session.sync entry-by-entry merge (set+null-delete), §2 max-entry cap eviction Wire into IntentService (the orchestrator): - handle_session_sync merges ovos.session.sync intent_context payloads - handle_utterance adopts inbound snapshot, prunes pre-match, decrements post-match over the pre-match key set (so mid-dispatch syncs survive) - _emit_match_message applies §5.1 promotion + §7 slot fill and stamps the working map onto the emitted session (legacy Session drops the field) - intent_context exposed as a lazily-backed property for safe partial construction Engine-side §6/§6.1 gating *inside* matchers (adapt/padacioso) is out of scope and deferred; core exposes the shared gating vocabulary they consult. SESSION_SYNC is a literal here; its SpecMessage registration is a SESSION-2/spec-tools follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * refactor!: delegate ovos.session.sync merge to SessionManager (OVOS-CONTEXT-1 §5.3) The session.intent_context map and the §5.3 ovos.session.sync entry-by-entry merge (set + null-delete) are now owned by the SessionManager singleton (bus-client #239): it carries intent_context as a first-class round-tripping Session field and applies the merge in SessionManager.handle_session_sync / merge_intent_context. The orchestrator no longer subscribes to ovos.session.sync and holds no parallel session_id-keyed store: - service.py: drop the SESSION_SYNC subscription, the handle_session_sync handler, the bus.remove on shutdown, the _intent_context store, the intent_context property/setter, and _stamp_intent_context. The §4 decay now operates on the session's own intent_context map (prune-then- decrement around the match round), written back via SessionManager.update so the singleton stays authoritative; §4.1 mid-dispatch sync keys are skipped from the decrement. §5.1 promotion merges via SessionManager.merge_intent_context; §7 slot fill reads sess.intent_context. - intent_context.py: IntentContextStore (the {session_id: map} store + its merge_sync) is gone. The decay/liveness/scope/gate/fill logic is kept as stateless module helpers (prune, decrement, enforce_cap + the existing pure predicates) that operate on a passed-in intent_context dict. - pyproject: floor-pin ovos_bus_client>=2.5.0a1 (the alpha carrying #239). - tests: §5.3 merge tests re-homed to bus-client #239; core keeps/expands the decay/liveness/scope/gate/fill tests plus a live check driving the REAL SessionManager merge and asserting core sees merged+decayed context. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat: OVOS-CONTEXT-1 §6/§6.1 orchestrator gate + manifest-sourced declarations The orchestrator drops a matched candidate whose requires_context is unmet or whose excludes_context is present, re-checking the gate so a misbehaving matcher cannot dispatch a context-gated intent. The declared gates and slot names are read from the passive INTENT-4 §10 manifest (the single source of an intent's declaration) — never off the Match. - IntentManifest.get_context_requirements / get_slot_names: union an intent's requires_context / excludes_context / slot names across its registration definitions. - match loop: gate backstop via gate_satisfied against session.intent_context. - _apply_context_slots (§7): sources requires_context + slot_names from the manifest instead of the Match. Additive: an intent that declares no gates is unaffected. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <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.
Builds on #786 (CONTEXT-1 store) — must merge after #786, and requires the §10
IntentManifest(already on dev). The orchestrator drops a matched candidate whoserequires_contextis unmet /excludes_contextis present, reading the declared gates from the passive INTENT-4 §10 manifest (never off the Match)._apply_context_slots(§7) is likewise manifest-sourced.IntentManifest.get_context_requirements/get_slot_namesgate_satisfiedhelperIntentHandlerMatchmutation; engines enforce their own gates (adapt more license tests #56, padatious call device prepare after skill manager has started #80, padacioso Refactor/skill process status #67, nebulento Document usage #35, palavreado Unit Tests #30, m2v feat/PHAL #46)🤖 Generated with Claude Code