Summary
Scheduled tasks (akm tasks …) are bound exclusively to the primary stash
(config.stashDir). Registered source stashes (config.sources[]) are used
for search/curate, but their tasks/ directories are never scanned, and there is
no way to add/sync/run a task from a source stash. This makes it impossible to
version-control task definitions without either a fragile symlink or committing
secrets to git.
Current behavior (akm 0.8.14)
akm config exposes a primary stash plus additional read sources:
{
"stashDir": "/stash",
"sources": [
{ "path": "/host-stash", "name": "host-akm", "writable": true },
{ "path": "/work/agent-stash", "name": "agent-stash" }
]
}
akm tasks sync reconciles only ${stashDir}/tasks with the OS scheduler — it
accepts no --stash / --source / --all flag.
akm tasks add writes only to the primary stash — no stash/source target option.
akm tasks list lists "tasks in the stash" (the primary one).
- There is no
AKM_TASKS_DIR (or equivalent) override; tasks always resolve to
${AKM_STASH_DIR}/tasks.
A task defined in a source stash's tasks/ directory is therefore invisible to akm.
Why this matters
A common setup separates concerns between two stashes:
- Primary stash (
/stash) holds runtime state that must not be in git:
secrets/, env/ (e.g. env:user credentials), and the akm database/index
(.akm/).
- A git-tracked source stash (e.g.
agent-stash at /work/agent-stash) holds
the versioned skills / scripts / content.
Scheduled tasks are automation source that logically belongs in the versioned
repo — but because akm binds tasks to stashDir, they can't be versioned there.
The only options today are both bad:
- Symlink
${stashDir}/tasks → <repo>/tasks. Works, but fragile: a container
restart / re-seed can replace the symlink with a real directory and silently
diverge, or the sync loop can transiently see no tasks/ dir.
- Make the repo the
stashDir. This drags secrets/, env/, and the akm DB
into a git working tree (secret-leak risk) and couples the entire runtime stash
to the repo.
Neither satisfies the goal: keep secrets out of git, but version the task
definitions.
Recommended changes
- Scan tasks across all registered stashes (primary + sources) in
tasks list / sync / run / history, not just stashDir.
- Per-source opt-in for task execution (security-critical). A source's tasks
should only be scheduled if the source is explicitly trusted for execution —
e.g. a tasks: true flag on the source in config (or gate on the existing
writable: true). Do not auto-run tasks from every registered source by
default: a source stash defining a cron task is arbitrary code execution on
every host that registers it.
- Namespace tasks by stash to avoid id collisions and make provenance clear —
e.g. agent-stash:reddit-leads. Record the origin stash in the generated cron
block (# akm:task <stash>/<id> …) and route enable / disable / sync /
history to the correct stash's file.
akm tasks add --stash <name> to create a task in a chosen registered stash
(defaulting to the primary for back-compat).
- (Simpler alternative / complement) an
AKM_TASKS_DIR env var or
config.tasksDir override to point the task directory somewhere other than
${stashDir}/tasks. This lets an operator relocate tasks to a git-tracked path
without moving the rest of the stash.
Item (2) is the essential guardrail — opt-in per source keeps this from
becoming a mechanism for an untrusted/shared source stash to run code on every
host that registers it.
Environment
- akm 0.8.14 (also observed as
akm-cli@0.9.0-beta.58)
- OS cron scheduler backend, Linux container
- Config: one primary
stashDir + filesystem source stashes as shown above
Summary
Scheduled tasks (
akm tasks …) are bound exclusively to the primary stash(
config.stashDir). Registered source stashes (config.sources[]) are usedfor search/curate, but their
tasks/directories are never scanned, and there isno way to add/sync/run a task from a source stash. This makes it impossible to
version-control task definitions without either a fragile symlink or committing
secrets to git.
Current behavior (akm 0.8.14)
akm configexposes a primary stash plus additional read sources:{ "stashDir": "/stash", "sources": [ { "path": "/host-stash", "name": "host-akm", "writable": true }, { "path": "/work/agent-stash", "name": "agent-stash" } ] }akm tasks syncreconciles only${stashDir}/taskswith the OS scheduler — itaccepts no
--stash/--source/--allflag.akm tasks addwrites only to the primary stash — no stash/source target option.akm tasks listlists "tasks in the stash" (the primary one).AKM_TASKS_DIR(or equivalent) override; tasks always resolve to${AKM_STASH_DIR}/tasks.A task defined in a source stash's
tasks/directory is therefore invisible to akm.Why this matters
A common setup separates concerns between two stashes:
/stash) holds runtime state that must not be in git:secrets/,env/(e.g.env:usercredentials), and the akm database/index(
.akm/).agent-stashat/work/agent-stash) holdsthe versioned skills / scripts / content.
Scheduled tasks are automation source that logically belongs in the versioned
repo — but because akm binds tasks to
stashDir, they can't be versioned there.The only options today are both bad:
${stashDir}/tasks → <repo>/tasks. Works, but fragile: a containerrestart / re-seed can replace the symlink with a real directory and silently
diverge, or the sync loop can transiently see no
tasks/dir.stashDir. This dragssecrets/,env/, and the akm DBinto a git working tree (secret-leak risk) and couples the entire runtime stash
to the repo.
Neither satisfies the goal: keep secrets out of git, but version the task
definitions.
Recommended changes
tasks list/sync/run/history, not juststashDir.should only be scheduled if the source is explicitly trusted for execution —
e.g. a
tasks: trueflag on the source in config (or gate on the existingwritable: true). Do not auto-run tasks from every registered source bydefault: a source stash defining a cron task is arbitrary code execution on
every host that registers it.
e.g.
agent-stash:reddit-leads. Record the origin stash in the generated cronblock (
# akm:task <stash>/<id> …) and routeenable/disable/sync/historyto the correct stash's file.akm tasks add --stash <name>to create a task in a chosen registered stash(defaulting to the primary for back-compat).
AKM_TASKS_DIRenv var orconfig.tasksDiroverride to point the task directory somewhere other than${stashDir}/tasks. This lets an operator relocate tasks to a git-tracked pathwithout moving the rest of the stash.
Item (2) is the essential guardrail — opt-in per source keeps this from
becoming a mechanism for an untrusted/shared source stash to run code on every
host that registers it.
Environment
akm-cli@0.9.0-beta.58)stashDir+ filesystem source stashes as shown above