feat(persona-registry): let handler agents into the cascade
Unblocks the P1s found on #320, at their source.
An agent driven by its onEvent entry has no interactive launch to configure. PersonaSpec already types harness, model, and systemPrompt as optional and already models onEvent/cloud — but the registry's standalone builder demanded all three and dropped the handler fields on the floor. The result: the agents/ directory added in #316 could not load the class of agent it was added for, and said so in a way that read as "your persona is malformed".
# before — a handler persona with harness/model/systemPrompt omitted
$ agentworkforce list
warning: [cwd:agents] digest: standalone persona "digest".harness is required for standalone personas
(no digest row)
# after
$ agentworkforce list
digest cwd:agents — — documentation
— is honest here: the agent has no harness, and now says so instead of being invisible.
Overlays keep the handler
onEvent and cloud survive parse and merge, so an overlay that only tweaks env no longer strips what makes its base deployable:
# personas/digest.json = {"id":"digest","env":{"TONE":"terse"}}
# agents/digest/persona.json = the real agent
$ agentworkforce show digest --json
onEvent = ./agent.ts | cloud = true | env = {TONE: terse}
That is the registry half of #320's second P1. The remaining half is deploy consuming the merged spec instead of a declaring path, which is the open API question on that PR.
What this deliberately does not do
harnessSettings stays required. PersonaSpec types it non-optional, and reasoning/timeoutSeconds have no defensible default to invent on a persona's behalf — inventing one would silently run a handler that calls ctx.harness.run() with settings nobody chose. Every shipped handler example (examples/weekly-digest, examples/review-agent) declares it. A handler persona that omits harnessSettings entirely still cannot load; making that work means deciding whether PersonaSpec.harnessSettings becomes optional, which is a published-type change in @agentworkforce/persona-kit that the cloud runtime also consumes. Flagging rather than deciding.
Integrations, triggers, and schedules are likewise still not modelled by the local override — deploy reads those from the file directly. Merge semantics for them are a separate design question.
Verification
Both original repros re-run against the built CLI. Four new tests cover the handler persona loading without interactive fields, a non-handler standalone still requiring harness, an overlay preserving the inherited handler entry, and onEvent rejected when it escapes the agent directory. local-personas suite passes (55). Lint and typecheck clean.
Semver: minor — the registry accepts a persona shape it previously rejected; no existing persona changes behavior.
🤖 Generated with Claude Code