feat(ontology): deliver SessionStart ontology injection via /plugin install (#60)#67
Merged
Conversation
…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.
fc3bec1 to
9fe20d7
Compare
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.
Closes #60.
Summary
The ontology runtime injection did not reach a marketplace-only user: the repo-root
hooks/session-start.shis not shipped by/plugin install, and the compiler only emittedPreToolUse(neverSessionStart).ai-infraeven 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
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 switchOMA_DISABLE_ONTOLOGY=1.oma-compileto emit aSessionStartentry intohooks/hooks.jsonfrom the DSLhooks.session-startdeclaration, re-owned via an_omamarker (hand-authored entries preserved). A runs path that escapes the plugin root is now aCompileError.ai-infra+aidlcDSLhooks.session-startat the bundledhooks/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$refenum refactor, cannot be copied into a plugin without breaking cross-file$refs.Verification
tests/harness/test_session_start_emit.py: emit / escape-rejected / no-hooks / hand-authored-preserved (4/4)oma compile --checkclean; standalone harness 34/34; ai-infra round-trip clean.omao/ontologypresent🤖 Generated with Claude Code