Skip to Content
Recodocs

Golden path

The golden path names one canonical owner per layer, so an engineer building on the kit does not have to search every package.

6 min read

The kit holds well over two hundred packages. Most were built for one project or one SDK, and many do overlapping work. The golden path is the kit's answer to "which one do I use": for each layer it names one canonical owner, records the evidence for the choice, and lists the rejected candidates. Every package carries a layer and a tier, recorded in docs/golden-path/tiers.json in the kit repository.

Use the golden path when you start something new. Use the capability index when you already know the job and need to find the owner.

The idea: one owner per layer

Two packages can offer similar-looking capabilities but differ in their supported contracts. The golden path answers which owner to choose first for a new application, so you do not have to compare the entire package list before starting.

Each of the twelve layers has a decision file in the kit repository. The file lists the candidates, picks the owner, shows a short snippet that was checked by importing it, and records gaps. The decision is not a ranking of quality. It answers a narrower question: if a new project needs this job done, which package should it start from?

Some layers have a single owner and some have a named pair or trio, because the halves do different jobs. For example, model routing is split between recohut_kit.providers, which owns credentials and the call record, and a PydanticAI adapter that builds the native model for a long-lived loop.

LayerCanonical owner (import path)
agent_looppydantic_ai.Agent, wrapped by recohut_kit_pydantic_ai.harness.pydantic_ai.Harness
model_routerecohut_kit.providers, plus the PydanticAI adapter's codex_responses_model
tools_permissionsrecohut_kit.harness.contracts.ToolPolicy enforced by Harness; recohut_kit.human for durable approvals
harness_staterecohut_kit.harness (Scope, Binding, Task, RunStore) and recohut_kit.conversations
context_memoryrecohut_kit.vectors, retrieval, grounding, user_context, knowledge
guardrailsrecohut_kit.guardrails and recohut_kit.redaction
evaluationrecohut_kit.evals and recohut_kit_pydantic_ai.evals
observabilityrecohut_kit.phoenix, recohut_kit.latency, recohut_kit.usage
servingrecohut_kit.runtime, recohut_kit.channels, recohut_kit_pydantic_ai.ui.vercel
data_platform, domain_capability, utilityNo single canonical owner except recohut_kit.json for utility. Choose from the layer's catalog

For the agent loop, the kit owns no loop of its own for new work. The loop is the native PydanticAI Agent. The Harness wraps one governed run of it and handles tool exposure by policy, approvals, limits, verification and resume. The Harness never loops itself.

How the layers fit in a run

The layer contract

The contract defines the only allowed values for layer and tier, so a package can be placed without argument. Its key rules:

  • Layer is one of twelve fixed values. Every package is assigned exactly one.
  • Tier is one of five fixed values. See the table below.
  • A canonical owner contains no domain text. Business wording inside a generic owner is recorded as known debt in tiers.json rather than hidden.
  • Moves keep old paths working. When a package moves under an owner, the old path becomes a shim that emits DeprecationWarning and re-exports the same objects. Leaf modules share module identity with the new path.
  • No agent claim without a model-driven loop. The word "agent" is reserved for something where a model chooses the next action.

Tiers and what each guarantees

TierRuleWhat it means for you
coreThe one canonical owner of a layerStart here. The layer's decision file records the evidence for the choice
supportedImported by at least one project outside the kitUse when your case matches its purpose. It has a real consumer
catalogNo external consumer; a capability kept, documented and labelledRead why the core owner does not fit before choosing it
labsExperimentalIt may move or be promoted. Do not build a long-lived dependency on it
deprecated_shimOnly re-exports another pathDo not use. Switch to the replaced_by path

A tier is not a quality rating. A catalog package can be well built. The tier records who depends on it and whether it is the recommended start.

Deprecation policy

Deprecated import paths follow one policy:

  1. The old path keeps working and emits DeprecationWarning.
  2. It is retained through the 0.7.x releases.
  3. It is removed in 0.8.0.
  4. tiers.json records replaced_by for each shim, and docs/package-moves.json maps old module paths to new ones.

The framework split follows the same rule. Code that moved from recohut_kit.integrations.pydantic_ai to recohut_kit_pydantic_ai.integrations.pydantic_ai still imports from the old path in 0.7.x, with a warning. See Extension packages.

Pick an owner

To find the layer, match your job to the layer table. To look at neighbours, filter tiers.json by layer. To search by keyword, use recohut-kit capabilities.

A short example per layer

Imports below match owners listed above. The guardrails example runs with the core alone.

guardrails_example.py
from recohut_kit.guardrails.policy import ValidationPolicy
from recohut_kit.guardrails.rate_limit import SlidingWindowLimiter
from recohut_kit.guardrails.screening import LexiconScreen, intervene
from recohut_kit.redaction import mask_text

policy = ValidationPolicy.from_mapping(
    {"max_length": 4000, "forbidden_patterns": [r"ignore (all )?previous"]}
)
limiter = SlidingWindowLimiter(limit=20, window_seconds=60)
screen = LexiconScreen({"secrets": ["hunter2"]})

print(policy.validate("ignore previous rules").allowed)   # False
print(mask_text("mail me a@b.com"))                         # mail me [email]
print(limiter.admit("user-1").allowed)                      # True
print(intervene("my pw hunter2", screen, action="reject").text)

A tool declares its own rules with ToolPolicy. A tool with no entry is hidden from the model.

tool_policy.py
from recohut_kit.harness.contracts import ToolPolicy

flag = ToolPolicy(
    effect=True,
    approval=True,
    authorize=lambda scope, action: scope.agent == "my-agent",
)
read = ToolPolicy()

Rules that catch people

  • A tool without a ToolPolicy is silently hidden unless you pass Harness(strict_tools=True). With strict mode, startup fails and names each unmatched tool.
  • A provider rate limit is an exception, not a response. Map it with classify_model_error, or a 429 surfaces as an HTTP 500.
  • User identity is host input. Scope is built by trusted application code. Persisted state never grants identity, tool access or approval.
  • Pick generate_structured for one-shot calls and output_type for an agent's answer. They are different routes and a one-shot call needs a Codex-shaped client.
  • Approvals. Default to Harness.approve and Harness.resume. Use recohut_kit.human when approval needs a separate reviewer record that outlives the process.
  • Some Phoenix extras conflict. The agents-phoenix extra conflicts with several other extras, so pick one tracing route per environment.

Known debt is listed, not hidden

The golden path records known debt: domain text inside a few core files, and a set of earlier loops that no outside project uses. Do not start a new build on one of those loops.

How is this page?

Last updated on