Skip to main content
Mythos

Smart-Kickoff Context Gate is the resolver that runs at session launch: it reads the context a work item declares, verifies each declared source resolves and carries a parseable load contract, and emits a session manifest — refusing to launch on any malformed claim rather than loading it anyway.

The Gate is the first of 📝Smart-Kickoff's two fail-closed checkpoints. Its job is to answer one question before an agent reads anything: is the briefing readable? A work item that declares no context, declares it in a form the machine cannot parse, or points at a source that no longer exists produces a refusal with an exact message naming what to fix. A declared source that is too large to load whole and carries no launch slice is refused the same way. The output on success is a manifest, bucketed by the load contract, which is both the launch instruction and the audit trail. This document states the contract; the 📝Smart-Kickoff — Agent Buildbook guides an adopting agent in implementing it against its own stack, where the context store, the work-item format, and the shell will all differ from the worked example here.

Prerequisites

  • A context store addressable by id — any system that returns a document's body when asked for it by a stable identifier: a wiki, a knowledge base, a memo library, or a directory of markdown files.
  • A work-item format that can carry a declaration field — the roadmap, ticket, or task document must have one place where it names the context it depends on, in a form the resolver parses strictly.
  • A runtime credential path — if the store requires authentication, the resolver consumes the credential from the environment at run time and never places it in a command-line argument.

Interface

The declaration field

A work item declares its context in exactly one strictly formatted field. The grammar is deliberately narrow so that a human error is a parse error, not a silent omission.

  • Exactly one heading whose text is the declaration name (the worked example uses # Context). Zero headings and two headings are both refusals.
  • One reference per line, each a machine-parseable link to a source by id (the worked example uses - @[Title](/me/user/id)). Any other non-blank line is a refusal that echoes the offending line.
  • A soft cap on declared sources (three in the worked example) that warns rather than refuses, because exceeding it signals a misshapen domain rather than a broken item.

Launch slices

For each declared source the resolver decides what an agent reads now. A source that carries a recognizable launch shape — named sections such as a summary, a description, a when-to-load rule, current state, and its own load contract — yields those sections as the required_now slice. A small source with no such shape may pass as a legacy pointer, marked as such in the manifest. A large source with no launch shape is refused: it cannot produce a compact slice, so it does not get to be default context.

Exit classes

Exit codes are the machine contract between the resolver and whatever launches the session; they stay stable across versions.

  • 0 — resolved; manifest on stdout.
  • 2 POLICY — no declaration field. Fails closed.
  • 3 POLICY — declaration malformed, or a declared source has no load contract. Fails closed.
  • 4 POLICY — the work item itself was not found. Fails closed.
  • 5 INFRA — transient network or API failure. Fails open: the launcher warns loudly and proceeds without a manifest.
  • 6 POLICY — a declared source does not resolve (deleted, moved). Fails closed.
  • 7 CONFIG — no credential available or credential rejected. Fails closed.

The split between 5 and 7 is load-bearing. A network blip is transient and self-healing, so blocking a session on it is friction without safety. An absent credential is a permanent fault that will never resolve on its own, so failing open on it silently disarms the Gate — and a warning that scrolls past inside generated prompt text is not a mechanism.

Manifest

{
  "loadContractVersion": 1,
  "submittedMemo": "work-item-id",              // the item that initiated the session
  "submittedContentHash": "md5",                // proves which version was read
  "contexts": [{ "id": "...", "title": "...", "url": "..." }],
  "required_now": [{ "id": "...", "sections": ["TL;DR", "Load Contract"], "tokenEstimate": 740 }],
  "required_before_mutation": [{ "trigger": "git_mutation", "source": "..." }],
  "triggered_deterministic_lookup": [],
  "semantic_retrieval": [],                     // always empty at launch
  "deferred_runbook": [{ "trigger": "pr_open", "source": "..." }],
  "optional_reference": []
}

Code Examples

The worked example resolver accepts a local file in place of the store, which is how its test suite runs with no network and no credential. Given a work item saved as memo.md:

printf '# Context\n- @[Operating Context](/me/user/000ctx)\n' > memo.md
./resolve-context.sh user-000road --content-file memo.md | jq .

A missing declaration exits 2; a malformed line exits 3; both print the exact line to fix.

Error Handling

  • declares no # Context field (exit 2) — the work item never named its context. Add the declaration field with one reference per line and re-run; the Gate is working, not broken.
  • has a malformed # Context line (exit 3) — a line in the field is not a parseable reference. The message echoes the line. A {placeholder} line means a template was never filled in.
  • too large … and has no Load Contract shape (exit 3) — a declared source is too big to load whole and carries no launch sections. Give it a launch shape or split it; do not make the resolver load it anyway.
  • INFRA (exit 5) during live use — transient. The session proceeds with a warning and no manifest; re-run when the store is reachable to restore the audit trail.

Related

Contexts

Created with 💜 by One Inc | Copyright 2026