ynf

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 1 Imported by: 0

README

ynf

Your named factory. The outer loop around agent runs: ynf watches tickets and pull requests, decides deterministically what the next turn should be, runs it in a container, proposes the change as a draft pull request, and follows it through CI and review. A human always merges.

ynf is the runtime layer of ynh's factory pattern, and works with ynh and ynm when they are installed, without needing either. A lane that runs an agent unsupervised (run.ynh.auto_approve) needs ynh 0.9.0 or later in its agent image.

brew install eyelock/tap/ynf
ynf --config config.yaml sweep --until-settled

Or from source: make build, then bin/ynf.

  • Run ynf locally
  • The design: architecture decisions and explanation
  • The sandbox: a disposable repository with planted problems and expected outcomes, and make e2e, the factory's acceptance test

Developing

make check    # gofmt, vet, golangci-lint, race tests, and an 80% per-package coverage gate
make e2e      # rebuild the sandbox and run ynf against it end to end

See CONTRIBUTING.md for the branch and pull request workflow. Report vulnerabilities as SECURITY.md describes. Everyone taking part follows the Code of Conduct.

Licence

MIT, copyright (c) 2026 David Collie.

Documentation

Overview

Package ynf holds what the whole module shares: the published JSON schemas, the telemetry registry and the version.

Index

Constants

This section is empty.

Variables

View Source
var ConfigSchema []byte

ConfigSchema is docs/schema/config.schema.json, the schema for ynf's own config.yaml.

View Source
var FactorySchema []byte

FactorySchema is docs/schema/factory.schema.json, the schema for a configuration repository's .agents/factory/factory.yaml.

View Source
var LanesSchema []byte

LanesSchema is docs/schema/lanes.schema.json, the schema for .agents/factory/lanes.yaml.

View Source
var TelemetryRegistry embed.FS

TelemetryRegistry is telemetry/registry, ynf's OpenTelemetry Weaver registry (ynr ADR-007): the names ynf emits under the ynf. prefix. `ynf telemetry registry --format json` prints it.

View Source
var Version = "dev"

Version is set at build time with -ldflags "-X github.com/eyelock/ynf.Version=...".

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
ynf command
Command ynf is your named factory: the outer loop around agent runs.
Command ynf is your named factory: the outer loop around agent runs.
internal
cli
Package cli is the ynf command line (ADR-011).
Package cli is the ynf command line (ADR-011).
config
Package config loads ynf's own config.yaml (ADR-009): found in the home factory folder by the same lookup as lanes, validated against the published schema, with defaults applied.
Package config loads ynf's own config.yaml (ADR-009): found in the home factory folder by the same lookup as lanes, validated against the published schema, with defaults applied.
decide
Package decide is ynf's decider (ADR-006): a pure function from (lane, item, facts, event) to (next item, actions).
Package decide is ynf's decider (ADR-006): a pure function from (lane, item, facts, event) to (next item, actions).
egress
Package egress is ynf's allow-list proxy (ADR-007).
Package egress is ynf's allow-list proxy (ADR-007).
engine
Package engine is ynf's outer loop (ADR-001): one idempotent step per event — correlate, claim, probe, decide, act, record, release — plus the sweep that turns searches and due timers into events.
Package engine is ynf's outer loop (ADR-001): one idempotent step per event — correlate, claim, probe, decide, act, record, release — plus the sweep that turns searches and due timers into events.
event
Package event is ynf's one event envelope (ADR-002): every adapter, push or pull, and ynf itself emits a CloudEvents 1.0 event with a type from ynf's closed vocabulary.
Package event is ynf's one event envelope (ADR-002): every adapter, push or pull, and ynf itself emits a CloudEvents 1.0 event with a type from ynf's closed vocabulary.
executor
Package executor runs a runner's command somewhere (ADR-007).
Package executor runs a runner's command somewhere (ADR-007).
facts
Package facts is the structured snapshot of the world a decision reads (ADR-003: probed fresh before every decision, never trusted from an event).
Package facts is the structured snapshot of the world a decision reads (ADR-003: probed fresh before every decision, never trusted from an event).
forge
Package forge is ynf's port to where code lives (ADR-003, ADR-007): pull requests, their checks and reviews, branches and files, and the writes only ynf makes.
Package forge is ynf's port to where code lives (ADR-003, ADR-007): pull requests, their checks and reviews, branches and files, and the writes only ynf makes.
gate
Package gate is the diff gate (ADR-007): before ynf pushes anything, the changed paths must be inside the lane's allowed paths and outside every protected path.
Package gate is the diff gate (ADR-007): before ynf pushes anything, the changed paths must be inside the lane's allowed paths and outside every protected path.
item
Package item is the work item: one document per unit of work (ADR-002), moved through the state machine by the decider (ADR-006).
Package item is the work item: one document per unit of work (ADR-002), moved through the state machine by the decider (ADR-006).
lease
Package lease gives one ynf instance an exclusive, fault-tolerant claim on a work item (ADR-005): a compare-and-swap on the item document that bumps an epoch, a heartbeat that renews it, and fencing so a holder that lost its lease without knowing cannot write.
Package lease gives one ynf instance an exclusive, fault-tolerant claim on a work item (ADR-005): a compare-and-swap on the item document that bumps an epoch, a heartbeat that renews it, and fencing so a holder that lost its lease without knowing cannot write.
memory
Package memory is ynf's memory port (ADR-008, ADR-012): ynm when it is installed, nothing when it is not.
Package memory is ynf's memory port (ADR-008, ADR-012): ynm when it is installed, nothing when it is not.
policy
Package policy loads lane policy (ADR-006): .agents/factory/lanes.yaml, validated against the published schema, with defaults applied, a hash per lane for the decision record, CEL guards over structured facts, and placeholders filled only from labels.
Package policy loads lane policy (ADR-006): .agents/factory/lanes.yaml, validated against the published schema, with defaults applied, a hash per lane for the decision record, CEL guards over structured facts, and placeholders filled only from labels.
runner
Package runner is ynf's runner port (ADR-012): what a lane's inner loop is.
Package runner is ynf's runner port (ADR-012): what a lane's inner loop is.
shadow
Package shadow is shadow mode's record and arithmetic (FR-26, ADR-011): what a shadow run pinned, what each attempt produced beside the human's patch, how a person graded the two blind, and the yield those grades give, with its confidence interval.
Package shadow is shadow mode's record and arithmetic (FR-26, ADR-011): what a shadow run pinned, what each attempt produced beside the human's patch, how a person graded the two blind, and the yield those grades give, with its confidence interval.
spool
Package spool is ynf's side of the spool layout in ynr ADR-003 and ADR-004: the root's three folders (factory/ for ynf's own writer, runs/<run id>/ one per run, manifests/<run id>.json one per run), the manifest, the quota on a run's folder, ynr serve for the length of a factory job, and what is swept into the run capture (ADR-007, ADR-009, ADR-010, ADR-011).
Package spool is ynf's side of the spool layout in ynr ADR-003 and ADR-004: the root's three folders (factory/ for ynf's own writer, runs/<run id>/ one per run, manifests/<run id>.json one per run), the manifest, the quota on a run's folder, ynr serve for the length of a factory job, and what is swept into the run capture (ADR-007, ADR-009, ADR-010, ADR-011).
store
Package store is ynf's state port (ADR-004): key/value documents with compare-and-swap, an append-only log per item, and timers.
Package store is ynf's state port (ADR-004): key/value documents with compare-and-swap, an append-only log per item, and timers.
store/s3store
Package s3store is the S3 store provider (ADR-004), for the hosted service and the CI-native host, where state must outlive any one process.
Package s3store is the S3 store provider (ADR-004), for the hosted service and the CI-native host, where state must outlive any one process.
store/sqlite
Package sqlite is the SQLite store provider (ADR-004), for the daemon host.
Package sqlite is the SQLite store provider (ADR-004), for the daemon host.
store/storetest
Package storetest is the conformance suite every store provider must pass (ADR-004), including concurrent compare-and-swap races.
Package storetest is the conformance suite every store provider must pass (ADR-004), including concurrent compare-and-swap races.
telemetry
Package telemetry is ynf's side of ynr's OpenTelemetry contract (ADR-011; ynr ADR-002, 003, 004 and 006).
Package telemetry is ynf's side of ynr's OpenTelemetry contract (ADR-011; ynr ADR-002, 003, 004 and 006).
telemetry/gen command
Command gen writes internal/telemetry/names.go from telemetry/registry, ynf's Weaver registry.
Command gen writes internal/telemetry/names.go from telemetry/registry, ynf's Weaver registry.
telemetry/registry
Package registry reads ynf's telemetry registry (telemetry/registry), an OpenTelemetry Weaver registry, and writes the Go constants generated from it.
Package registry reads ynf's telemetry registry (telemetry/registry), an OpenTelemetry Weaver registry, and writes the Go constants generated from it.
telemetry/spooltest
Package spooltest reads a spool folder back, for tests that prove what ynf wrote: the OTLP JSON lines of every file in it, parsed into spans, events, log records and metric points.
Package spooltest reads a spool folder back, for tests that prove what ynf wrote: the OTLP JSON lines of every file in it, parsed into spans, events, log records and metric points.
tracker
Package tracker is ynf's port to where work items live (ADR-003): GitHub Issues, JIRA and others.
Package tracker is ynf's port to where work items live (ADR-003): GitHub Issues, JIRA and others.
tracker/mcptracker
Package mcptracker is the mcp tracker provider (ADR-003): a tracker whose system has an MCP server, such as JIRA Cloud or Data Center, read and written by calling the server's tools directly.
Package mcptracker is the mcp tracker provider (ADR-003): a tracker whose system has an MCP server, such as JIRA Cloud or Data Center, read and written by calling the server's tools directly.
workspace
Package workspace is ynf's git: a mirror per repository, a checkout per step, and the commit and push that only ynf (never the agent) performs (ADR-007).
Package workspace is ynf's git: a mirror per repository, a checkout per step, and the commit and push that only ynf (never the agent) performs (ADR-007).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL