hylo.codeagents.skills¶
Package: hylo-code-agents · Core contracts
skills ¶
Programs as sealed artifacts, and promoted programs as skills (RFC-0006 parts 5 and 6).
A program artifact is a directory with solve.py (defining solve(robot, **kw)), program.json (what it was made
for: task family, the instructions of its development cases, the session) and artifact.json (kind "program",
role "behaviour", content digest, provenance: development splits only). code.program runs it; a code candidate
points to it; once a campaign promotes it, it becomes a "program" skill in the skill library with its gate evidence
and digest, which code.llm retrieves by instruction similarity and calls as skills.<name>(robot, **kw).
write_program ¶
write_program(out_dir: str | Path, source: str, *, meta: Mapping[str, Any], provenance: Provenance, metrics: Mapping[str, Any] | None = None, name: str = '') -> ArtifactManifest
Validate and seal a program into out_dir (a new directory).
read_program ¶
(source, manifest, program.json) of a sealed program artifact; the digest is checked.
program_skill ¶
program_skill(artifact: str | Path, *, name: str | None = None, version: str = '1', description: str | None = None, family: str | None = None, preconditions: str = '', gate: Mapping[str, Any] | None = None) -> Skill
A (proposed) program skill for a sealed program artifact.
add_program_skill ¶
Record a program skill; it is verified only with a passed gate as evidence (else it stays proposed).
promote_from_campaign ¶
promote_from_campaign(campaign_dir: str | Path, library: Any, *, family: str | None = None) -> list[str]
Every promoted code candidate of a campaign (registry ledger) becomes a verified program skill.
demote ¶
A program skill whose re-validation failed is deprecated, like any demoted version.
load_program_skills ¶
load_program_skills(library: Any, instruction: str, define: Callable[[str, str], Callable[..., Any]], *, k: int = 3, min_score: float = 0.2) -> tuple[SimpleNamespace, str, list[dict[str, Any]]]
The verified program skills most similar to instruction, as callables skills.<name>(robot, **kw).
define(source, entry) compiles a program in the caller's sandbox (fresh namespace per skill). A skill whose
artifact no longer verifies or no longer validates is skipped and reported.