Skip to content

Declarative startup.json-driven af up with best-effort subsystem bootstrap#58

Merged
stempeck merged 1 commit into
mainfrom
issues/57
Jun 11, 2026
Merged

Declarative startup.json-driven af up with best-effort subsystem bootstrap#58
stempeck merged 1 commit into
mainfrom
issues/57

Conversation

@stempeck

Copy link
Copy Markdown
Owner

Summary

  • Add .agentfactory/startup.json config that drives bare af up: agent subset selection (null=all, []=none, list=subset), quality/fidelity gate application, start_dispatch auto-start, and watchdog_agents scoping — positional af up <names> bypasses all of it (C-4 backward compat)
  • Make worktree-creation failures best-effort (warn + skip + continue) instead of fatally aborting the entire af up
  • Tear down the dispatcher session on bare af down (symmetric with startup)
  • Centralize escalation target in escalation.go (escalationTarget const + escalationTargets()) replacing hardcoded "supervisor" strings in watchdog and compact_handoff
  • Fix git exclude pattern from .agentfactory/ (directory-form) to .agentfactory/* (contents-form) so committed .gitignore re-includes for agent definitions work
  • Add --agents flag to watchdog, extract launchDispatchSession() and startDispatch() lenient path, extract applyFidelityGate()/applyGate() for af-up reuse
  • Emit pre-flight warning when start set exceeds max_worktrees, and omission warning when a startup subset drops a known mail/notify/escalation sink
  • Scaffold startup.json in af install --init with opinionated defaults

Fixes #57

Test plan

  • TestLoadStartupConfig_* (7 cases): absent file defaults, bad gate value, full round-trip, empty agents slice, empty object, malformed JSON, scaffold loads
  • TestRunUp_NoStartupConfig_AllStart_BareWatchdog: no startup.json starts all agents with bare watchdog
  • TestRunUp_ConfiguredSubset_GateDispatchScope: subset + quality gate + dispatch + watchdog scope all apply
  • TestRunUp_PositionalArgsWin: af up <names> ignores startup.json
  • TestRunUp_EmptyAgents_LoudNotice: agents:[] starts zero agents with loud notice
  • TestRunUp_SubsetExceedsMaxWorktrees_Warns: pre-flight warning before start loop
  • TestRunUp_OmitsSupervisorEscalationTarget_Warns: omission warning driven by escalationTargets()
  • TestRunUp_FidelityOffFromSubdir_GuardChecksRoot: active-formula guard checks resolved root, not cwd
  • TestRunUp_FidelityOffNoActiveFormula_Applies: fidelity off applies when no formula active
  • TestRunUp_DispatchLaunchFailure_WarnsAndFailsExit: dispatch failure is best-effort (warn + allOK=false)
  • TestRunUp_WatchdogAgentsUnknownEntry_Warns: unknown watchdog_agents entry warns at af-up time
  • TestRunUp_WorktreeCapHit_SkipsAndContinues: worktree failure warn+skip+continue (not abort)
  • TestStartDispatch_* (8 cases): already-running benign, absent config skip, empty default skip, malformed JSON warns, invalid type warns, IO error warns, friendly skip pinned, valid config launches
  • TestDown_StopsDispatchSession / TestDown_NoDispatchSession_Silent / TestDown_SingleAgent_LeavesDispatch: dispatch teardown symmetry
  • TestApplyFidelityGate_* / TestApplyGate_* (7 cases): gate extraction and guard behavior
  • TestWatchdog_PollScopeFiltersAgents / TestBuildWatchdogScope: multi-agent scope filtering
  • TestEnsureGitExclude_DoesNotDefeatGitignoreReincludes: live git check-ignore verification
  • TestEscalationTargets_IncludesSupervisor: centralized escalation constant sanity

🤖 Generated with Claude Code

…, quality/fidelity gate application, dispatcher auto-start, and scoped watchdog; make worktree failures best-effort, tear down dispatcher on bare af down, centralize escalation target, and fix git exclude pattern for .gitignore re-include compatibility. Fixes #57.
@stempeck stempeck merged commit 9a27609 into main Jun 11, 2026
7 checks passed
@stempeck stempeck deleted the issues/57 branch June 11, 2026 03:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Declarative startup.json-driven af up with best-effort subsystem bootstrap

1 participant