Skip to content

feat: OVOS-CONTEXT-1 orchestrator gate + manifest-sourced require/exclude context#801

Merged
JarbasAl merged 4 commits into
feat/context-1-conformancefrom
feat/context-1-orchestrator-gate
Jul 2, 2026
Merged

feat: OVOS-CONTEXT-1 orchestrator gate + manifest-sourced require/exclude context#801
JarbasAl merged 4 commits into
feat/context-1-conformancefrom
feat/context-1-orchestrator-gate

Conversation

@JarbasAl

@JarbasAl JarbasAl commented Jul 2, 2026

Copy link
Copy Markdown
Member

Builds on #786 (CONTEXT-1 store) — must merge after #786, and requires the §10 IntentManifest (already on dev). The orchestrator drops a matched candidate whose requires_context is unmet / excludes_context is present, reading the declared gates from the passive INTENT-4 §10 manifest (never off the Match). _apply_context_slots (§7) is likewise manifest-sourced.

🤖 Generated with Claude Code

JarbasAl and others added 4 commits June 27, 2026 18:17
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
@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6b34fa1f-f200-46cf-b654-477b5d5d4290

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/context-1-orchestrator-gate

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added feature and removed feature labels Jul 2, 2026
@JarbasAl
JarbasAl changed the base branch from dev to feat/context-1-conformance July 2, 2026 20:13
@github-actions github-actions Bot added feature and removed feature labels Jul 2, 2026
@JarbasAl
JarbasAl marked this pull request as ready for review July 2, 2026 20:14
@JarbasAl
JarbasAl merged commit 346a8f7 into feat/context-1-conformance Jul 2, 2026
4 checks passed
@JarbasAl
JarbasAl deleted the feat/context-1-orchestrator-gate branch 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant