Skip to content

System-message framing, one-shot preambles, and name-based rule injection format #28

Closed

Description

@frap129

What to build

When the plugin injects rules, each injection event renders as a single <system-message> block: a short preamble inside the block (the rules are injected by a plugin and are to be followed silently, no need to acknowledge them to the user), followed by all rules being injected in that event. Each rule is introduced only by a short name — the rule's frontmatter name field when present, otherwise its file name without extension — with no path header anywhere in the injected text.

Durable rules are injected once, on their first match, as today. Ephemeral (transient) rules continue to be re-injected each turn they match, each time as their own system-message block with the preamble. Rules inside a block are explicitly delimited, since rule bodies may contain their own markdown headings.

Deduplication is keyed on the rule's identity (name/path), not its content: editing a rule file between launches of opencode must not cause re-injection when the same session is resumed, and compaction must not re-inject previously delivered rules.

Hook-triggered rule injections (durable and ephemeral) receive the same system-message framing and preamble treatment.

Docs (README, docs/rules.md, AGENTS.md) are updated in the same change to describe the new format and dedup scheme.

Acceptance criteria

  • Injected rule text contains no path header; each rule is introduced by its short name (frontmatter name, else file name minus extension).
  • Each injection event is wrapped in one <system-message> block, with the preamble appearing exactly once before the rules — not once per rule.
  • Durable rules inject only on first match; transient rules re-inject each matching turn, always as a framed block with the preamble.
  • Dedup keys are identity-based, not content-based: resuming a session after editing a rule file does not re-inject it, and compaction does not re-inject delivered rules.
  • Hook-content injections use the same framing and preamble.
  • aube run lint, aubx tsc --noEmit, and aube run test:run all pass.

Blocked by

  • None (can start immediately).

Activity

  1. added a commit that references this issue on Aug 28, 2026
    6a33a60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions