{"modulePath":"github.com/memcode-ai/memcode","version":"v0.56.16","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package task\n\nPackage task is memcode's autonomous Task: a reusable, declarative, auditable unit of work the agent can execute with no human present.\n\nA Task is NOT inherently recurring. It is a runnable object first — \\`memcode task run \\\u003cname\u003e\\` is a first-class entry point, not a testing affordance — and a trigger is an optional attachment. That ordering is the whole point: cron is one way a Task becomes eligible, never what a Task is.\n\nThree objects stay deliberately separate:\n\n\tTask     what to do, how, with what authority   (YAML, hashable)\n\tTrigger  when it becomes eligible               (0..n, optional)\n\tRun      one immutable execution                (a DB row, package taskrun)\n\nEvery run records the Revision of the definition that produced it, so \"why did this task push that branch?\" stays answerable after the YAML has been edited five times. The autonomy package hashes delegation policies for the same reason and by the same method (see autonomy.CanonicalPolicy).\n\n## Constants\n\n```go\nconst (\n\tDefaultMaxCatchUp = 10\n\tHardMaxCatchUp    = 100\n)\n```\nDefaultMaxCatchUp bounds catch\\_up when a trigger does not say. HardMaxCatchUp bounds what a trigger may ASK for: a YAML value is a ceiling request, not an override, and nothing should be able to schedule a thousand-run stampede.\n\n```go\nconst ConcurrencyKeyProject = \"project\"\n```\nConcurrencyKeyProject is the default key: one mutating run per repo.\n\n```go\nconst DefaultBranchPattern = \"auto/{name}-{date}\"\n```\nDefaultBranchPattern names the branch an autonomous run pushes. {name} and {date} are substituted; the auto/ prefix makes provenance obvious in a branch list.\n\n```go\nconst DefaultTimeout = \"45m\"\n```\nDefaultTimeout bounds a run that does not set its own.\n\n```go\nconst DirName = \"tasks\"\n```\nDirName is the tasks subdirectory inside either root.\n\n```go\nconst ModelAuto = \"auto\"\n```\nModelAuto means the task expressed no model preference.\n\n```go\nconst Version = 1\n```\nVersion is the schema version every task file must declare. An explicit version on a user-editable file is what lets the format change later without guessing at the shape of what is on disk.\n\n## Variables\n\n```go\nvar ErrNotFound = errors.New(\"task not found\")\n```\nErrNotFound is returned by Get when no task carries that name.\n\n## Functions\n\n```go\nfunc GlobalDir() (string, error)\n```\nGlobalDir returns the per-machine task directory.\n\n```go\nfunc Marshal(t Task) ([]byte, error)\n```\nMarshal renders a task back to YAML, defaults applied. Used when memcode writes a task it proposed, so the file on disk is the complete definition rather than a sparse one whose behaviour shifts if a default ever changes.\n\n```go\nfunc ProjectDir(root string) string\n```\nProjectDir returns the repo-local task directory.\n\n```go\nfunc Save(root string, t Task, scope Scope) (string, error)\n```\nSave writes a task to the chosen scope's directory, creating it if needed. The write is atomic so a crash mid-save cannot leave the scheduler reading a truncated definition.\n\n```go\nfunc ValidLevel(l Level) bool\n```\nValidLevel reports whether l names a shipped tier.\n\n```go\nfunc ValidName(s string) bool\n```\nValidName reports whether s is a usable task name.\n\n## Types\n\n```go\ntype Autonomy struct {\n\tLevel  Level   `yaml:\"level,omitempty\" json:\"level,omitempty\"`\n\tGrants []Grant `yaml:\"grants,omitempty\" json:\"grants,omitempty\"`\n}\n```\nAutonomy is the task's authority CEILING. Level is a friendly preset that expands to concrete grants; Grants adds named capabilities on top. The policy engine only ever reasons about grants.\n\nA ceiling is not an override. Nothing written here can lift a task above memcode's hard floor — permissions.Decide still returns NeedPrompt for a catastrophic command in every mode, and an unknown grant is refused at parse time rather than interpreted generously.\n\n```go\ntype Capability struct {\n\t// DenyTools are tool names or toolset names the child must not have.\n\tDenyTools []string\n\t// DenyCommands are shell command patterns the child may not run, matched\n\t// against the AST (see permissions.DeniedBy) so wrappers cannot smuggle one.\n\tDenyCommands []string\n\t// ProtectProject means the run must not execute in the user's checkout.\n\t// The runner satisfies it with a throwaway worktree, which is what makes\n\t// \"read-only\" mean \"cannot change YOUR project\" rather than the impractical\n\t// \"performs no writes anywhere\" — builds and tests write caches and temp\n\t// files constantly, and forbidding that would forbid the work.\n\tProtectProject bool\n\t// Mutating reports whether this run may change project state at all. Drives\n\t// worktree retention and the concurrency lease.\n\tMutating bool\n}\n```\nCapability is the projection of a task's grants onto what its run receives.\n\n```go\ntype Concurrency struct {\n\tKey    string            `yaml:\"key,omitempty\" json:\"key,omitempty\"`\n\tPolicy ConcurrencyPolicy `yaml:\"policy,omitempty\" json:\"policy,omitempty\"`\n}\n```\nConcurrency serializes runs that share a key. Key \"project\" (the default) resolves to the task's project root, so every mutating task in a repo takes the same lock while read-only tasks run freely.\n\n```go\ntype ConcurrencyPolicy string\n```\nConcurrencyPolicy decides what happens when a task is due while an overlapping run is still going.\n\n```go\nconst (\n\t// ConcurrencyQueue waits for the in-flight run. The default: two tasks\n\t// rewriting the same repo at once is a merge conflict with extra steps.\n\tConcurrencyQueue ConcurrencyPolicy = \"queue\"\n\t// ConcurrencySkip drops this occurrence.\n\tConcurrencySkip ConcurrencyPolicy = \"skip\"\n)\n```\n\n```go\ntype Coordination string\n```\nCoordination is the publication semantics of a multi-project run.\n\n```go\nconst (\n\t// CoordIndependent publishes each project's work on its own merits. Right\n\t// when the projects merely share a chore (\"keep dependencies current\"):\n\t// repo B being stuck is no reason to withhold repo A's upgrade.\n\tCoordIndependent Coordination = \"independent\"\n\n\t// CoordCoordinated publishes all of it or none of it. Right when the\n\t// changes only make sense together, which is the whole reason the task is\n\t// cross-project rather than two tasks. A partial success is not a success;\n\t// it is a half-applied change to a system that was consistent before.\n\tCoordCoordinated Coordination = \"coordinated\"\n)\n```\n\n```go\ntype Delivery struct {\n\tDesktop Notify `yaml:\"desktop,omitempty\" json:\"desktop,omitempty\"`\n\t// Channel reuses the gateway's existing \"channel:conversation\" address when\n\t// the user has one paired. Empty means inbox only.\n\tChannel   string `yaml:\"channel,omitempty\" json:\"channel,omitempty\"`\n\tChannelOn Notify `yaml:\"channel_on,omitempty\" json:\"channel_on,omitempty\"`\n}\n```\nDelivery is where results go. The inbox is the durable ledger and is always on; everything else is notification layered over it.\n\n```go\ntype Execution struct {\n\t// Steps are the mechanical part of the job, worked out when the task was\n\t// SET UP rather than learned from it later. The design phase already runs\n\t// the work once to validate it, and that run is where it becomes obvious\n\t// which commands are deterministic — `go get -u ./...`, fetch, normalise,\n\t// build — and which needed someone to think.\n\t//\n\t// A run does the mechanical part directly and pays no model for it. If the\n\t// steps do everything the goal needed and nothing changed, the run is over\n\t// and no agent starts at all: the common Monday costs nothing.\n\t//\n\t// They are an OPTIMISATION and never the definition. A step that fails is\n\t// drift, not a verdict — the agent takes over and works out the current\n\t// state. Nothing here can make a run succeed; only verification does that.\n\tSteps []string `yaml:\"steps,omitempty\" json:\"steps,omitempty\"`\n\t// KnownGood records an approach that WORKED once, with the date it worked.\n\t// It is a hint and never the definition: a repository drifts, and a run\n\t// that treats last quarter's steps as authoritative will confidently do the\n\t// wrong thing. A run starts here and checks whether the assumptions still\n\t// hold before relying on any of it.\n\tKnownGood string `yaml:\"known_good,omitempty\" json:\"known_good,omitempty\"`\n}\n```\nExecution selects the work strategy. Procedure names an entry in the repo's procedure store; the concept is deliberately not \"shell script\", because a procedure may later be an HTTP call, a tool sequence or a Go helper.\n\n```go\ntype Git struct {\n\tWorktree    *bool  `yaml:\"worktree,omitempty\" json:\"worktree,omitempty\"`\n\tPullRequest PRMode `yaml:\"pull_request,omitempty\" json:\"pull_request,omitempty\"`\n\tBranch      string `yaml:\"branch,omitempty\" json:\"branch,omitempty\"`\n\t// Remote is where a branch is published. Default origin.\n\tRemote string `yaml:\"remote,omitempty\" json:\"remote,omitempty\"`\n}\n```\nGit controls how code changes leave an unattended run. Worktree isolation is the default because an autonomous run must never disturb the branch a human is sitting on.\n\n```go\ntype Grant string\n```\nGrant is one named capability an autonomous run may exercise.\n\n```go\nconst (\n\t// Read-only capabilities.\n\tGrantFilesystemRead      Grant = \"filesystem.read\"\n\tGrantProcessExecReadOnly Grant = \"process.execute_readonly\"\n\n\t// Local mutation.\n\tGrantFilesystemMutate Grant = \"filesystem.local_mutation\"\n\tGrantProcessExec      Grant = \"process.execute\"\n\n\t// Preparing a change for humans.\n\tGrantGitCreateBranch Grant = \"git.create_branch\"\n\tGrantGitCommit       Grant = \"git.commit\"\n\tGrantGitPushBranch   Grant = \"git.push_branch\"\n\tGrantGitHubOpenPR    Grant = \"github.open_pr\"\n)\n```\n\n```go\nfunc ExpandGrants(level Level, extra []Grant) ([]Grant, error)\n```\nExpandGrants resolves a task's authority to the concrete set the policy engine enforces: the level's preset plus any explicitly named additions, deduplicated and sorted. An unknown grant or level is an error — a typo must never silently widen or narrow authority.\n\n```go\nfunc KnownGrants() []Grant\n```\nKnownGrants lists every grant a task file may name, sorted.\n\n```go\ntype Level string\n```\nLevel is a preset bundle of grants.\n\n```go\nconst (\n\t// LevelReadOnly inspects, runs read-only commands, and reports. It changes\n\t// nothing anywhere, including in a worktree.\n\tLevelReadOnly Level = \"read_only\"\n\n\t// LevelBranch is the default. It may edit an isolated worktree, run\n\t// commands, commit, push a NEW branch, and open a pull request — the full\n\t// shape of \"prepare a change for review\" and nothing beyond it.\n\t//\n\t// Opening a PR belongs here rather than in some higher tier. It does mutate\n\t// remote state, but a PR is a review artifact: it is precisely the act of\n\t// asking a human to decide. The invariant this whole feature is built\n\t// around is that autonomous work may PREPARE a change, never make it\n\t// authoritative.\n\tLevelBranch Level = \"branch\"\n)\n```\n\n```go\nfunc Levels() []Level\n```\nLevels lists the valid levels, for error messages and shell completion.\n\n```go\ntype Limits struct {\n\tTimeout    string  `yaml:\"timeout,omitempty\" json:\"timeout,omitempty\"`\n\tMaxCostUSD float64 `yaml:\"max_cost_usd,omitempty\" json:\"max_cost_usd,omitempty\"`\n}\n```\nLimits bound a single run. An unattended task that can spin forever is a bill, not a feature.\n\n```go\ntype Missed string\n```\nMissed is the catch-up policy for a trigger the daemon slept through. This matters more than it looks on a laptop: without it, \"0 2 \\* \\* \\*\" silently means \"only if the machine happened to be awake at 2am\", and a weekly job can go months without running while appearing healthy.\n\n```go\nconst (\n\t// MissedRunOnce runs the task once on the next daemon start, then resumes\n\t// the normal cadence. The default, and the right answer for maintenance.\n\tMissedRunOnce Missed = \"run_once\"\n\t// MissedSkip forgets the occurrence entirely (the old schedule behaviour).\n\tMissedSkip Missed = \"skip\"\n\t// MissedCatchUp replays missed occurrences, up to Trigger.MaxCatchUp. Rarely\n\t// what anyone wants.\n\tMissedCatchUp Missed = \"catch_up\"\n)\n```\n\n```go\ntype Notify string\n```\nNotify says when an optional sink fires.\n\n```go\nconst (\n\tNotifyNever    Notify = \"never\"\n\tNotifyFailures Notify = \"failures\"\n\tNotifyChanges  Notify = \"changes\"\n\tNotifyAlways   Notify = \"always\"\n)\n```\n\n```go\ntype OnPush struct {\n\tBranch string `yaml:\"branch,omitempty\" json:\"branch,omitempty\"`\n}\n```\nOnPush and Webhook are reserved trigger kinds, rejected by Validate today.\n\n```go\ntype Ownership struct {\n\t// Projects are the checkouts this responsibility spans. Empty means the\n\t// task's own Project and nothing else, which is the common case.\n\tProjects []string `yaml:\"projects,omitempty\" json:\"projects,omitempty\"`\n\n\t// Coordination decides what happens when the work succeeds in some\n\t// projects and not others. This is a real product decision, not a detail:\n\t// \"PR opened in repo A\" while repo B could not be updated is a WORSE\n\t// outcome than doing nothing, if the two changes only make sense together.\n\tCoordination Coordination `yaml:\"coordination,omitempty\" json:\"coordination,omitempty\"`\n\n\t// Responsibility states what this task is responsible FOR, independently of\n\t// today's file layout. It is what a run judges its own share against when\n\t// the repository has moved under it.\n\t//\n\t// It is NOT a licence to go looking for more projects. The approved project\n\t// set is fixed at creation and changes only when the user changes the\n\t// automation. Drift is allowed WITHIN an approved boundary — paths, build\n\t// commands, package managers, moved code, refactors, whatever the run finds\n\t// there. Expanding the boundary is not drift; it is new authority, and\n\t// authority comes from a person.\n\t//\n\t// So if the responsibility grows into a repository nobody approved, the run\n\t// stops and says so. Discovery is not authorization, the same way a login\n\t// found in another tool's files is not consent to use it.\n\tResponsibility string `yaml:\"responsibility,omitempty\" json:\"responsibility,omitempty\"`\n}\n```\nOwnership answers \"whose responsibility is this?\", which is not the same question as \"where was the conversation happening?\".\n\nA task created while someone happened to be sitting in one checkout can easily belong to something larger. memcode itself is the example: the model catalog is one responsibility implemented in two repositories, and a task that updated only whichever one was open would be quietly wrong forever.\n\nSo a task names the projects its responsibility spans, and how their work relates. Project is still where the task is ANCHORED — the repo it was created against, and the one whose worktree a single-project run uses. Projects widens that to the full set when the responsibility is genuinely cross-cutting.\n\n```go\ntype PRMode string\n```\nPRMode decides whether a task that changed code opens a pull request.\n\n```go\nconst (\n\tPRNever PRMode = \"never\"\n\t// PRWhenChanges opens a pull request when the run produced a commit.\n\tPRWhenChanges PRMode = \"when_changes\"\n\t// PRAlways means always FOR A PRODUCED COMMIT — never \"manufacture an empty\n\t// one to satisfy the configuration\". A run with no diff opens nothing under\n\t// either setting; the difference between them is reserved for future\n\t// conditions on an actual change, not for inventing artifacts.\n\tPRAlways PRMode = \"always\"\n)\n```\n\n```go\ntype Runtime struct {\n\tStrategy string   `yaml:\"strategy,omitempty\" json:\"strategy,omitempty\"`\n\tAllowed  []string `yaml:\"allowed,omitempty\" json:\"allowed,omitempty\"`\n\tModel    string   `yaml:\"model,omitempty\" json:\"model,omitempty\"`\n\tFallback []string `yaml:\"fallback,omitempty\" json:\"fallback,omitempty\"`\n}\n```\nRuntime is where the task's inference runs. It is four separate decisions rather than one string, because \"use my Claude subscription\" quietly bundles availability, permission, capability and what-to-do-when-it-breaks, and those have different answers and different owners.\n\n\tStrategy  how to choose\n\tAllowed   the user's ordered preference — order is obeyed, not optimized\n\tModel     a pinned catalog model, or auto\n\tFallback  what may be tried when the RUNTIME fails (not when the task does)\n\nA runtime being present on the machine authorizes nothing. See internal/runtimes.\n\n```go\ntype Scope string\n```\nScope says where a definition was loaded from. Project scope wins over global on a name collision: a repo that ships its own task means it for that repo.\n\n```go\nconst (\n\tScopeProject Scope = \"project\"\n\tScopeGlobal  Scope = \"global\"\n)\n```\n\n```go\ntype Task struct {\n\tVersion      int         `yaml:\"version\" json:\"version\"`\n\tName         string      `yaml:\"name\" json:\"name\"`\n\tDescription  string      `yaml:\"description,omitempty\" json:\"description,omitempty\"`\n\tEnabled      *bool       `yaml:\"enabled,omitempty\" json:\"enabled,omitempty\"`\n\tProject      string      `yaml:\"project,omitempty\" json:\"project,omitempty\"`\n\tOwnership    Ownership   `yaml:\"ownership,omitempty\" json:\"ownership\"`\n\tTriggers     []Trigger   `yaml:\"triggers,omitempty\" json:\"triggers,omitempty\"`\n\tInstructions string      `yaml:\"instructions\" json:\"instructions\"`\n\tExecution    Execution   `yaml:\"execution,omitempty\" json:\"execution\"`\n\tRuntime      Runtime     `yaml:\"runtime,omitempty\" json:\"runtime\"`\n\tAutonomy     Autonomy    `yaml:\"autonomy,omitempty\" json:\"autonomy\"`\n\tGit          Git         `yaml:\"git,omitempty\" json:\"git\"`\n\tVerify       Verify      `yaml:\"verify,omitempty\" json:\"verify\"`\n\tDelivery     Delivery    `yaml:\"delivery,omitempty\" json:\"delivery\"`\n\tLimits       Limits      `yaml:\"limits,omitempty\" json:\"limits\"`\n\tConcurrency  Concurrency `yaml:\"concurrency,omitempty\" json:\"concurrency\"`\n\n\t// Resolved by the loader, never authored and never hashed.\n\tPath  string `yaml:\"-\" json:\"-\"`\n\tScope Scope  `yaml:\"-\" json:\"-\"`\n}\n```\nTask is one task definition, as authored in YAML plus the resolved facts the loader attaches. Zero-value fields are filled by ApplyDefaults before validation or hashing, so a sparse file and its fully-written equivalent produce the same Revision.\n\n```go\nfunc Get(root, name string, now time.Time) (Task, error)\n```\nGet resolves one task by name, honouring the same precedence as Load.\n\n```go\nfunc Load(root string, now time.Time) ([]Task, []error)\n```\nLoad returns every task visible from root, project scope shadowing global on a name collision, sorted by name. Malformed files are returned separately so a caller can surface them without losing the tasks that did load.\n\n```go\nfunc Parse(data []byte, path string, scope Scope, now time.Time) (Task, error)\n```\nParse decodes one task file. Decoding is STRICT — an unknown key is an error rather than a silently ignored line, because a typo'd \\`autonmy:\\` that parses cleanly would hand a task the default authority while its author believed otherwise.\n\n```go\nfunc (t *Task) ApplyDefaults()\n```\nApplyDefaults fills every unset field with its documented default. It runs before validation and before hashing, so a sparse file and the fully-written equivalent are the same task with the same Revision.\n\n```go\nfunc (t Task) Capability() (Capability, error)\n```\nProject returns the capability projection for a task.\n\n```go\nfunc (t Task) CrossProject() bool\n```\nCrossProject reports whether this responsibility spans more than one checkout.\n\n```go\nfunc (t Task) Grants() ([]Grant, error)\n```\nGrants resolves this task's effective authority.\n\n```go\nfunc (t Task) HasGrant(g Grant) bool\n```\nHasGrant reports whether the task's expanded authority includes g. A resolution error means \"no\": authority questions fail closed.\n\n```go\nfunc (t Task) IsEnabled() bool\n```\nIsEnabled reports whether the task may run. Absent means enabled — a file someone wrote is meant to work.\n\n```go\nfunc (t Task) Manual() bool\n```\nManual reports whether the task only ever runs by hand. A task with no triggers is manual — that is a normal, complete task, not an unfinished one.\n\n```go\nfunc (t Task) MayMutate() bool\n```\nMayMutate reports whether the task can change anything on disk.\n\n```go\nfunc (t Task) MayOpenPR() bool\n```\nMayOpenPR reports whether the task can push a branch AND open a pull request. Both are required: a PR with nothing pushed behind it is not a thing.\n\n```go\nfunc (t Task) ReadOnly() bool\n```\nReadOnly reports whether this task may change anything at all.\n\n```go\nfunc (t Task) ResolveProject(root string) (string, error)\n```\nResolveProject returns the absolute, symlink-resolved directory a task runs in: its own project field when set, else the root it was loaded from.\n\n```go\nfunc (t Task) Revision() (string, error)\n```\nRevision is the content hash of the normalized definition: sha256 over canonical JSON, sorted where order carries no meaning. Two files that differ only in key order or in omitted-but-defaulted fields hash identically; any semantic edit changes the hash.\n\nEvery run records this. It is what makes an execution auditable months later, after the YAML has moved on.\n\n```go\nfunc (t Task) Targets() []string\n```\nTargets is the set of checkouts a run must work through, anchor first.\n\nAlways non-empty for a valid task, so callers never special-case the single-project shape.\n\n```go\nfunc (t Task) TargetsFrom(anchor string) []string\n```\nTargetsFrom is Targets with the anchor supplied by the caller.\n\nA definition does not always carry its own project: a global task is anchored by the run, and a file authored without a \\`project:\\` key is anchored by where it was loaded from. The anchor is a property of the RUN in those cases, and pretending otherwise silently produces an empty target list — which for the lease means no lock at all.\n\n```go\nfunc (t Task) Timeout() time.Duration\n```\nTimeout resolves the run bound.\n\n```go\nfunc (t Task) UsesWorktree() bool\n```\nUsesWorktree reports whether runs get an isolated worktree. Absent means yes.\n\n```go\nfunc (t Task) Validate(now time.Time) error\n```\nValidate checks a task after ApplyDefaults. Every failure names the field and says what a working value looks like, because the reader is usually someone hand-editing YAML with no schema in front of them.\n\nnow is injectable so one-shot \"at\" triggers can be validated against a fixed clock in tests.\n\n```go\ntype Trigger struct {\n\tCron  string `yaml:\"cron,omitempty\" json:\"cron,omitempty\"`\n\tEvery string `yaml:\"every,omitempty\" json:\"every,omitempty\"`\n\tAt    string `yaml:\"at,omitempty\" json:\"at,omitempty\"`\n\t// TZ evaluates Cron in a named zone (\"America/Los_Angeles\"); empty = local.\n\tTZ string `yaml:\"tz,omitempty\" json:\"tz,omitempty\"`\n\t// Missed decides what happens when the daemon was not running at the moment\n\t// this trigger was due. Meaningless for Manual.\n\tMissed Missed `yaml:\"missed,omitempty\" json:\"missed,omitempty\"`\n\t// MaxCatchUp bounds how many missed occurrences catch_up will actually run.\n\t// Without a bound, a laptop returning after months with an hourly task would\n\t// enqueue thousands of historical runs at once. Ignored unless Missed is\n\t// catch_up; the excess is dropped newest-first-kept and surfaced on the run.\n\tMaxCatchUp int `yaml:\"max_catch_up,omitempty\" json:\"max_catch_up,omitempty\"`\n\t// Manual is an explicit \"this trigger only fires by hand\". A task with no\n\t// triggers at all is already manual-only; this exists so a file can say so.\n\tManual bool `yaml:\"manual,omitempty\" json:\"manual,omitempty\"`\n\n\t// Reserved kinds. Declared so an author who writes one gets a clear \"not\n\t// implemented yet\" instead of an unknown-field parse error, and so the\n\t// schema slot is taken.\n\tOnPush  *OnPush  `yaml:\"on_push,omitempty\" json:\"on_push,omitempty\"`\n\tWebhook *Webhook `yaml:\"webhook,omitempty\" json:\"webhook,omitempty\"`\n}\n```\nTrigger is one way a task becomes eligible to run. Exactly one kind may be set. The list is plural from day one so adding a second kind later is not a schema migration; only the time forms and manual are implemented today.\n\n```go\nfunc (tr Trigger) Validate(now time.Time) error\n```\nValidate checks one trigger. The time forms are delegated to the gateway's shared spec validation rather than reparsed here: one validator means a cadence that parses on this surface parses on the scheduler, and a second parser is exactly how the previous two schedulers drifted apart.\n\n```go\ntype Verify struct {\n\tCommands []string `yaml:\"commands,omitempty\" json:\"commands,omitempty\"`\n\n\t// Across are checks that run ONCE, after every project has done its share,\n\t// to test that the projects still agree with each other. Per-project checks\n\t// cannot answer that: each side can be internally perfect and the pair\n\t// still inconsistent, which on a cross-cutting change is precisely the\n\t// failure worth catching. They run in the anchor project's working copy\n\t// with MEMCODE_TASK_PROJECTS listing every project's working copy.\n\tAcross []string `yaml:\"across,omitempty\" json:\"across,omitempty\"`\n}\n```\nVerify is how a run proves it succeeded. Without it \"the agent stopped\" gets mistaken for \"the task worked\", which is how autonomous systems quietly rot.\n\n```go\ntype Webhook struct {\n\tSecret string `yaml:\"secret,omitempty\" json:\"secret,omitempty\"`\n}\n```\n\n","path":"github.com/memcode-ai/memcode/internal/task","name":"task","synopsis":"Package task is memcode's autonomous Task: a reusable, declarative, auditable unit of work the agent can execute with no human present.","isRedistributable":true}
