Skip to content

feat(plugin): devagentic-vertical-preamble — auto-load vertical context on session boot (#55, G1 of devagentic#203)#59

Merged
PowerCreek merged 1 commit into
mainfrom
issue-55-vertical-preamble
May 23, 2026
Merged

feat(plugin): devagentic-vertical-preamble — auto-load vertical context on session boot (#55, G1 of devagentic#203)#59
PowerCreek merged 1 commit into
mainfrom
issue-55-vertical-preamble

Conversation

@PowerCreek

Copy link
Copy Markdown

Closes #55. G1 of TechDevGroup/devagentic#203 (canonical fusion contract).

Depends on TechDevGroup/devagentic#205 (verticalContext GraphQL query). Merge that first.

Summary

  • New plugin plugins/devagentic-vertical-preamble/ with the same shape as the existing devagentic-canvas plugin.
  • pre_llm_call hook auto-loads the active hermes profile's vertical context — kind:vertical-spec + kind:grafted-context + kind:worker-guardrails docs — and injects them as ephemeral preamble on the first LLM call of the process.
  • Per-process gate: once a user_id is loaded (or returns empty), no re-injection or re-fetch. Vertical docs are session-stable; paying token cost per turn would be waste.

Why

Under NousResearch#203 §1.2, worker sessions must not read genesis/doc.jsonl directly or shell out to python api.py. This plugin is the hermes-native path that lands the vertical's manifest + grafted material + guardrails in the worker's context on session boot.

Plugin shape

  • __init__.py — entrypoint + module docstring
  • plugin.yaml — registers pre_llm_call hook
  • client.py — thin GraphQL client mirroring agent/devagentic_memory.py transport (same env vars, same X-User-Id resolution, same fail-soft contract)
  • preamble.py — the hook + renderer (caps: 2KB per graft, 8 grafts shown, 32KB total)
  • README.md — operator docs

Test plan

  • 12 new tests cover: no-user_id gate, default-profile gate, empty-rollup gate (with re-fetch suppression), populated rollup, load-once semantics, per-graft truncation, max-grafts rendering, fetch exception → None, resolve exception → None, env-override user_id, missing-profile path, empty-user_id client guard.
  • All 12 pass under hermes' pytest config (tests/plugins/devagentic-vertical-preamble/).
  • Plugin is additive — no changes to existing modules — so no regression risk to existing flows.

Notes

  • Failure semantics: any failure returns None; turn proceeds without preamble. Same contract as the canvas preamble.
  • Long-running daemon embeddings (e.g. gateway) would need session-keyed state instead of the per-process set. Noted in the plugin docstring as a follow-up if it ever applies; today every hermes CLI invocation is its own process.

…+ grafted-context + worker-guardrails on session boot (closes #55, G1 of devagentic#203)
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.

G1: hermes session preamble loader for vertical-spec / grafted-context / worker-guardrails (parent: devagentic#203)

1 participant