The hint channel — a remedy pack
The 1.0-native pattern for remedy copy: rules whose copy binds a host fact, and hint documents a host raises by code. It exists because the guard pipeline decides from typed facts at lifecycle moments, and some situations a host handles — a capped tool output, a truncated result, a phase gate, a redaction receipt — are observed by the host's own machinery, not by the guard pipeline. No fact exists for a rule to read, so neither enforce nor monitor fits: there is nothing to enforce. The channel for that copy is the hint (section 9, [OAR-HINT-1]).
| File | What it demonstrates |
|---|---|
rules.yaml | The rule half: a guard-pipeline rule whose copy binds host-tier facts. |
hints.yaml | The hint half: four copy publications keyed by the codes a host raises. |
host-facts.yaml | The host catalog convention this pack assumes (host-side, non-normative). |
fixtures/ | Replays against the reference implementation, including the zero-value and hint-does-not-perturb cases. |
The rule half: copy that binds a host fact#
rules.yaml carries one rule, RETRY_CAP_REFUSED. The host publishes its own retry accounting under its namespace — example.attempts, example.breaker_open, example.redaction_count — as host-tier facts ([[OAR-FACT-15]]). The rule names all three in requires_facts ([[OAR-COPY-5]]): the declaration is what makes the binding legal and reviewable, because a reader can see exactly which host observations the copy depends on before reading a word of it. The copy then interpolates an int ([[OAR-COPY-4]]) and branches on a bool ([[OAR-COPY-3]]).
This half is for situations the host can publish as a fact. When it can, a rule is the right vehicle: the condition is in the rule, the threshold is reviewable, and the decision is portable to any engine whose host provides the same facts.
The hint half: copy keyed by a code#
hints.yaml carries four hints for situations a host raises after or outside the guard pipeline. A hint is a copy publication, not a rule:
- it never evaluates — no
when, noeffect, no side-effects ([[OAR-HINT-1]]); - its
idis the code the host raises ([[OAR-HINT-2]]); - its copy is static — no bindings, because there is no occurrence to bind against ([
[OAR-HINT-3]]).
The host raises the code in its own envelope, at its own moment, from its own observation; the hint supplies the words. The guard pipeline never sees a hint: loading one changes no decision and no copy ([[OAR-HINT-6]], [[OAR-COPY-6]]) — fixtures/hints-do-not-perturb.json pins that the same occurrence evaluates identically with four hints loaded.
The host catalog convention (host-side, non-normative)#
host-facts.yaml is the catalog form the host keeps: one line per fact it publishes, name and type. It is not a rule document and the format does not read it — the format's only contact with the catalog is [[OAR-FACT-15]] (host facts live under a namespace the host owns) and the fixture input's host_facts member ([[OAR-CONF-13]]). A host documents its namespace however it likes; this file is the convention this pack assumes, kept beside the rules so a reviewer can check every requires_facts entry against it.
The fallback chain#
When the host raises a code, it renders, in order:
- A registered hint's copy. If a hint whose
idis the raised code is registered, the host renders that hint's copy — the words the pack's author wrote and reviewed. - Otherwise, the bare code. An unregistered code renders as the code itself ([
[OAR-HINT-4]]): the envelope stays truthful, and nothing pretends copy exists.
Or, otherwise, the host drops the channel: a host that registers no hints renders bare codes, and a host that raises nothing renders nothing. The channel is additive at every step — no host behaviour depends on a hint being present, and no rule's decision depends on a hint being loaded.
The copy-reads-correctly-when-empty invariant#
Copy that binds a fact must read correctly when the fact is at its zero value or absent:
- A binding at zero substitutes the zero value, not a gap ([
[OAR-COPY-7]], [[OAR-FACT-25]]):example.redaction_countat0renders "applied 0 redactions", never "applied redactions".fixtures/retry-cap-zero-binding.jsonpins it. - A declared fact absent from the occurrence reads as its zero value ([
[OAR-FACT-24]]), so a conditional on an unreported bool takes the else branch and the sentence still parses.fixtures/retry-cap-zero-conditional.jsonpins it. - A zero fact is a value, not an absence:
example.attemptsat0simply does not satisfy>= 3, and the rule does not fire.fixtures/retry-cap-below-threshold.jsonpins it.
What makes the pattern legal#
- [
[OAR-FACT-11]] — the fact tiers. The host publishes its own observations as host-tier facts under its namespace; the guard pipeline's facts stay in thecoretier and the standard profiles. The rule half stays inside the tiering. - [
[OAR-FACT-25]] — zero values are values. A host fact at zero is present, which is why the zero-value copy cases are well-defined rather than error paths. - [
[OAR-COPY-5]] — a fact named in copy must be reached throughrequires_facts. The declaration is what makes both halves reviewable: the rule's bindings and the catalog check against the same list.
Running the pack#
From packages/oar-ref (after npm run build):
node bin/lint-pack.mjs ../../examples/remedy-pack
Every fixture replays against the reference implementation: the rule fires with rendered copy, the zero-value cases render correctly, the hints load without perturbing the decision, and the malformed hints are rejected at load with the clause that forbids them ([[OAR-HINT-5]]).
The other worked examples: A portable rule pack.
hints.yaml#
# The hint half of the remedy pattern: copy the host raises for situations the
# guard pipeline has no fact for ([OAR-HINT-1]). A hint publishes copy keyed by
# the code the host raises ([OAR-HINT-2]); the copy is static — no bindings
# ([OAR-HINT-3]) — and the hint never evaluates ([OAR-HINT-1]). These four are
# situations a host raises after or outside the guard pipeline.
spec_version: "1.0"
id: TOOL_OUTPUT_SPILL_CAPPED
namespace: example.remedy
kind: hint
title: Tool output spill capped
severity: info
what: The tool's output was capped before it reached the model.
cause: The host caps retained tool output so one call cannot crowd out the conversation.
why: Uncapped output hides the part that matters and spends context on repetition.
fix: Ask for the specific slice you need instead of the whole result.
---
spec_version: "1.0"
id: TOOL_OUTPUT_TRUNCATED
namespace: example.remedy
kind: hint
title: Tool output truncated
severity: info
what: The tool's output was cut off partway through.
cause: The host truncates retained tool output at a size limit.
why: The tail of a long result is usually the least informative part.
fix: Ask for the tail explicitly, or narrow the call so the result fits.
---
spec_version: "1.0"
id: WORKFLOW_PHASE_EXIT_REQUIRED
namespace: example.remedy
kind: hint
title: Workflow phase exit required
severity: info
what: The current workflow phase must end before this action is available.
cause: The host sequences work in phases and gates actions by phase.
why: Acting across a phase boundary leaves the phase's own steps unfinished.
fix: Finish the phase's remaining steps, or ask the user to move the phase forward.
---
spec_version: "1.0"
id: SECRET_REDACTED_RECEIPT
namespace: example.remedy
kind: hint
title: Secret redacted
severity: info
what: A secret was redacted from content on its way out.
cause: The host redacts recognized secrets before content leaves the session.
why: The redaction is a receipt, not a failure — the content is safe to use.
fix: Continue with the redacted content; ask the user for the value by name if it is needed.
host-facts.yaml#
# The host-tier facts this pack assumes, in the catalog form the host keeps.
# This file is a host-side convention, not a rule document: the format's only
# contact with it is [OAR-FACT-15] (host facts are published under a namespace
# the host owns) and the fixture input's host_facts member ([OAR-CONF-13]).
# A host that does not publish these facts simply does not run the rules that
# name them — see README.md for the fallback chain.
example.attempts: int
example.breaker_open: bool
example.redaction_count: int
rules.yaml#
# The rule half of the remedy pattern: a guard-pipeline rule whose copy binds
# host-tier facts. The host publishes its own observations under its namespace
# ([OAR-FACT-15]); the rule names them in requires_facts ([OAR-COPY-5]) and
# interpolates them into copy ([OAR-COPY-2], [OAR-COPY-4]). The host catalog
# this pack assumes is documented in host-facts.yaml.
spec_version: "1.0"
id: RETRY_CAP_REFUSED
namespace: example.remedy
kind: policy
on: tool.pre_invoke
selector: {}
requires_facts:
- example.attempts
- example.breaker_open
- example.redaction_count
when: 'example.attempts >= 3'
effect: block
profile: host
title: Retry cap refused
what: "The call has been attempted {{ example.attempts }} times."
cause: "The host's retry accounting shows the same call replayed without a change of approach."
why: "Repeating a refused call spends the session's budget on the same refusal."
fix: "{% if example.breaker_open %}The host's circuit breaker is open; wait for it to reset before calling again.{% else %}Change the approach — inspect the environment or ask for the specific slice you need — before calling again.{% endif %}"
instead: "The host has applied {{ example.redaction_count }} redactions to earlier output; ask for the unredacted slice by name if you need it."