techniques
techniques
¶
Technique resolution for the baton dispatch pipeline.
Resolves which techniques are active for a given sheet phase, generates
technique manifests, and discovers technique skill documents for prompt
injection. This module bridges the technique declarations in JobConfig
(TechniqueConfig) to the prompt assembly pipeline in the baton adapter.
Skill-kind techniques are shorthand injections: declaring a technique by name causes its document to be discovered from known locations and injected into the musician's prompt as a skill-category item. This is the runtime equivalent of the compiler's TechniqueWirer.
Search order for technique documents
config.path— explicit path in the technique's config~/.marianne/techniques/{name}.md— user-level techniques.marianne/techniques/{name}.md— project-level techniques~/.marianne/techniques/{name}/SKILL.md— subdirectory form
Usage::
from marianne.daemon.baton.techniques import resolve_techniques_for_sheet
resolved = resolve_techniques_for_sheet(config.techniques, "work")
# resolved.manifest -> markdown text listing available techniques
# resolved.skill_docs -> dict of technique name to document content
# resolved.mcp_servers -> dict of MCP server names for config file generation
Classes¶
ResolvedTechniques
dataclass
¶
ResolvedTechniques(skills=list(), skill_docs=dict(), mcp_servers=dict(), protocols=list(), manifest='')
Resolved techniques for a specific phase.
Contains the filtered techniques, generated manifest text, discovered skill documents, and MCP server names.
Attributes:
| Name | Type | Description |
|---|---|---|
skills |
list[str]
|
Names of active skill techniques. |
skill_docs |
dict[str, str]
|
Mapping of technique name to document content. Discovered from known locations for skill-kind techniques. |
mcp_servers |
dict[str, str]
|
Mapping of technique name to MCP server name. |
protocols |
list[str]
|
Names of active protocol techniques. |
manifest |
str
|
Generated markdown text for prompt injection. |
Functions:¶
movement_phase_name
¶
Map the six lifecycle movements to phase names; extra movements do work.
filter_techniques_for_phase
¶
Filter techniques to those active in a given phase.
A technique matches if: - Its phases list contains the exact phase name, OR - Its phases list contains "all" (wildcard)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
techniques
|
dict[str, TechniqueConfig]
|
Full technique declarations from JobConfig. |
required |
phase
|
str
|
Current sheet phase name (e.g., "work", "recon"). |
required |
movement
|
int | None
|
Optional numeric alias for existing numbered declarations. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, TechniqueConfig]
|
Dict of technique name to TechniqueConfig for active techniques. |
Source code in src/marianne/daemon/baton/techniques.py
generate_technique_manifest
¶
Generate a technique manifest for prompt injection.
Produces human-readable markdown describing available techniques, organized by kind (MCP Tools, Protocols, Skills).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
techniques
|
dict[str, TechniqueConfig]
|
Filtered techniques for the current phase. |
required |
Returns:
| Type | Description |
|---|---|
str
|
Markdown text for injection as a SKILL-category item. |
Source code in src/marianne/daemon/baton/techniques.py
discover_technique_doc
¶
Discover and read a technique's skill document.
Searches known locations for a technique document matching the name. Returns the file content if found, None otherwise.
Search order
config["path"]— explicit path~/.marianne/techniques/{name}.md.marianne/techniques/{name}.md~/.marianne/techniques/{name}/SKILL.md
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Technique name (e.g., "strudel-patterns"). |
required |
config
|
dict[str, object]
|
The technique's config dict (may contain "path"). |
required |
Returns:
| Type | Description |
|---|---|
str | None
|
File content as string, or None if not found. |
Source code in src/marianne/daemon/baton/techniques.py
resolve_techniques_for_sheet
¶
Full resolution pipeline: filter + manifest + skill doc discovery.
For skill-kind techniques, discovers and reads technique documents
from known locations. The documents are returned in skill_docs
for injection into the musician's prompt as skill-category items.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
techniques
|
dict[str, TechniqueConfig]
|
All technique declarations from JobConfig. |
required |
phase
|
str
|
Current sheet phase. |
required |
movement
|
int | None
|
Optional numeric alias for legacy phase declarations. |
None
|
Returns:
| Type | Description |
|---|---|
ResolvedTechniques
|
ResolvedTechniques with filtered data, manifest, and skill docs. |
Source code in src/marianne/daemon/baton/techniques.py
generate_mcp_config_file
¶
Generate an MCP config JSON file from pool socket paths.
Produces a JSON file mapping server names to their Unix socket paths.
Only servers that are both declared in mcp_servers and currently
running in the pool are included.
The file is written atomically (write-to-temp + rename) to prevent partial reads by concurrent processes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mcp_servers
|
dict[str, dict[str, str]]
|
Mapping of technique name to server declaration.
Each value should have a |
required |
pool
|
McpPoolManager
|
The MCP pool manager to query for running state and socket paths. |
required |
workspace
|
Path
|
Directory where the config file is written. |
required |
Returns:
| Type | Description |
|---|---|
Path | None
|
Path to the generated config file, or None if no servers are |
Path | None
|
running. |