Skip to content

feat(ontology): deliver SessionStart ontology injection via /plugin install (#60)#67

Merged
devfloor9 merged 1 commit into
aws-samples:mainfrom
devfloor9:fix/ontology-runtime-bundle
Jul 4, 2026
Merged

feat(ontology): deliver SessionStart ontology injection via /plugin install (#60)#67
devfloor9 merged 1 commit into
aws-samples:mainfrom
devfloor9:fix/ontology-runtime-bundle

Conversation

@devfloor9

Copy link
Copy Markdown
Member

Closes #60.

Summary

The ontology runtime injection did not reach a marketplace-only user: the repo-root hooks/session-start.sh is not shipped by /plugin install, and the compiler only emitted PreToolUse (never SessionStart). ai-infra even pointed its session-start hook at ../../hooks/session-start.sh — a path that escapes the plugin and does not exist in an installed copy.

Changes

  • Add plugins/{ai-infra,aidlc}/hooks/session-start-ontology.sh: a self-contained SessionStart hook that reads ONLY .omao/ontology/ (no repo-root dependency), so it works verbatim from an installed plugin copy. Kill switch OMA_DISABLE_ONTOLOGY=1.
  • Extend oma-compile to emit a SessionStart entry into hooks/hooks.json from the DSL hooks.session-start declaration, re-owned via an _oma marker (hand-authored entries preserved). A runs path that escapes the plugin root is now a CompileError.
  • Point ai-infra + aidlc DSL hooks.session-start at the bundled hooks/ path.

Scope decision (documented in architecture.md §1.3.1)

Ontology schemas (oma validate) and seed templates (oma setup) stay CLI-only — they are not read by an installed skill and, post the #63 $ref enum refactor, cannot be copied into a plugin without breaking cross-file $refs.

Verification

  • New tests/harness/test_session_start_emit.py: emit / escape-rejected / no-hooks / hand-authored-preserved (4/4)
  • oma compile --check clean; standalone harness 34/34; ai-infra round-trip clean
  • Bundled hook injects a Budget instance and degrades to empty context when no .omao/ontology present

🤖 Generated with Claude Code

…nstall (aws-samples#60)

The ontology runtime injection did not reach a marketplace-only user: the
repo-root hooks/session-start.sh is not shipped by /plugin install, and the
compiler only emitted PreToolUse (never SessionStart). ai-infra even pointed its
session-start hook at ../../hooks/session-start.sh — a path that escapes the
plugin and does not exist in an installed copy.

- Add plugins/{ai-infra,aidlc}/hooks/session-start-ontology.sh: a self-contained
  SessionStart hook that reads ONLY .omao/ontology/ (no repo-root dependency), so
  it works verbatim from an installed plugin copy. Kill switch OMA_DISABLE_ONTOLOGY=1.
- Extend oma-compile to emit a SessionStart entry into hooks/hooks.json from the
  DSL hooks.session-start declaration, re-owned via an _oma marker (hand-authored
  entries preserved). A runs path that escapes the plugin root is now a CompileError
  — closing the ../../ bug at compile time.
- Point ai-infra + aidlc DSL hooks.session-start at the bundled hooks/ path.
- Scope decision: ontology schemas (oma validate) and seed templates (oma setup)
  stay CLI-only — they are not read by an installed skill and, post the aws-samples#63 $ref
  enum refactor, cannot be copied into a plugin without breaking cross-file $refs.
  Documented in architecture.md §1.3.1.
- tests/harness/test_session_start_emit.py: emit / escape-rejected / no-hooks /
  hand-authored-preserved. Verified: oma compile --check clean; standalone harness
  34/34; ai-infra round-trip clean; bundled hook injects a Budget instance and
  degrades to empty context when no .omao/ontology present.
@devfloor9 devfloor9 force-pushed the fix/ontology-runtime-bundle branch from fc3bec1 to 9fe20d7 Compare July 4, 2026 12:25
@devfloor9 devfloor9 merged commit c32e169 into aws-samples:main Jul 4, 2026
7 checks passed
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.

Ontology runtime is not delivered by /plugin install (schemas + seed + session hook live outside plugins)

1 participant