Skip to content

feat: clarify config ownership boundaries and enable subagent dispatch by default (#188)#189

Open
skr19930617 wants to merge 1 commit into
mainfrom
clarify-config-ownership-boundaries-and-enable-subagent-dispatch-by-default
Open

feat: clarify config ownership boundaries and enable subagent dispatch by default (#188)#189
skr19930617 wants to merge 1 commit into
mainfrom
clarify-config-ownership-boundaries-and-enable-subagent-dispatch-by-default

Conversation

@skr19930617

Copy link
Copy Markdown
Owner

Summary

  • Establish .specflow/config.yaml (committed) as the canonical home for specflow shared workflow policy and .specflow/config.env (gitignored) for local runtime / operator preferences. Specflow settings stop living in openspec/config.yaml; legacy entries are detected and ignored with a one-time per-process deprecation warning naming the canonical destination.
  • Flip DEFAULT_DISPATCH_CONFIG.enabled from false to true ("enabled by default, explicit opt-out"). Eligibility guards (task-graph.json present, size_score > threshold) are unchanged. Operators set apply.subagent_dispatch.enabled: false in .specflow/config.yaml to opt out.
  • Add verifyLocalSubagentRuntime() plus LocalSubagentRuntimeError: default-engaged dispatch verifies the local subagent runtime (CLI executability via access(X_OK), valid agent identifiers in .specflow/config.env) BEFORE any worktree creation, advance() call, or subagent spawn — fails fast with an actionable error citing both fix paths.
  • Add a borderline shared→local override path with apply.subagent_dispatch.max_concurrency as the first concrete instance: env var SPECFLOW_APPLY_SUBAGENT_DISPATCH_MAX_CONCURRENCY overrides the yaml default per-operator. An invalid env override falls back to yaml, not the global default.
  • New .specflow/config.yaml starter template, registered in templateFileAliases / templateContracts. Both specflow-init (fresh) and specflow-init --update install the file. README and slash-command guides updated. New spec capability config-ownership-boundaries; modified bundle-subagent-execution, review-orchestration, review-autofix-progress-observability, slash-command-guides.

Issue

Closes #188

Test plan

  • npm run typecheck passes
  • npm run build passes
  • npm run lint — 0 errors (warnings only, all pre-existing patterns)
  • npm run validate:contracts passes
  • Full test suite green: 1015 / 1015 tests pass
  • On a fresh clone without .specflow/config.yaml, dispatch engages by default when a task-graph.json is present with at least one size_score > threshold bundle
  • On an existing repo with apply.subagent_dispatch.* still in openspec/config.yaml, the loader emits the deprecation warning naming .specflow/config.yaml as the canonical destination and the legacy value is ignored
  • The runtime-prereq check fails fast (with the documented two-path message) when the agent CLI is missing on PATH

Reviewer notes

The impl review ledger from this run shows has_open_high (1 high + 4 medium findings) — all five findings were addressed in code in the same round but a second review pass was skipped because the diff exceeded diff_warn_threshold. The full test suite is green after the fixes; see openspec/changes/archive/2026-04-28-clarify-config-ownership-boundaries-and-enable-subagent-dispatch-by-default/approval-summary.md for the per-finding fix mapping.

…h by default (#188)

Establish `.specflow/config.yaml` as the canonical home for specflow shared
workflow policy (committed) and `.specflow/config.env` for local runtime /
operator preferences (gitignored). Specflow settings SHALL NOT live in
`openspec/config.yaml` — that file is reserved for OpenSpec's own
configuration.

- Add `readSpecflowSharedConfig()` loader: reads canonical
  `.specflow/config.yaml`, probes the legacy `openspec/config.yaml`
  location for misplaced specflow keys and emits a one-time
  per-process deprecation warning naming the canonical destination.
  Legacy values are ignored — there is no silent backward-compatible
  read path.
- Flip `DEFAULT_DISPATCH_CONFIG.enabled` from `false` to `true`
  ("enabled by default, explicit opt-out"). Dispatcher eligibility
  guards (`task-graph.json` present, `size_score > threshold`) are
  unchanged. Operators who require pre-feature behavior set
  `apply.subagent_dispatch.enabled: false` in `.specflow/config.yaml`.
- Add `verifyLocalSubagentRuntime()` plus `LocalSubagentRuntimeError`:
  default-engaged dispatch verifies the operator's local subagent
  runtime (CLI executability via `access(X_OK)`, valid agent
  identifiers in `.specflow/config.env`) BEFORE any subagent spawn,
  worktree creation, or `advance()` call. On failure, the apply stops
  with an actionable error citing both fix paths (resolve local
  runtime, or set `apply.subagent_dispatch.enabled: false`).
- Add borderline shared→local override path with `max_concurrency` as
  the first concrete instance: yaml is the shared default, env var
  `SPECFLOW_APPLY_SUBAGENT_DISPATCH_MAX_CONCURRENCY` is the per-operator
  override. An invalid env override falls back to yaml, not the global
  default.
- New `.specflow/config.yaml` starter template, registered in
  `templateFileAliases` and `templateContracts`. Both `specflow-init`
  (fresh) and `specflow-init --update` install the file. README and
  slash-command guides updated.
- Spec deltas: NEW `config-ownership-boundaries`; MODIFIED
  `bundle-subagent-execution`, `review-orchestration`,
  `review-autofix-progress-observability`, `slash-command-guides`.
  `bundle-subagent-execution`'s opt-in requirement rewrites and a new
  fail-fast requirement covers the runtime-prereq scenario.
- Tests: added `specflow-config.test.ts`, `dispatch-runtime-check.test.ts`,
  and an orchestration-level test asserting that
  `runDispatchedWindow()` throws `LocalSubagentRuntimeError` BEFORE any
  mutation when the local runtime is invalid. Updated existing tests
  pinning the old default to use the new canonical file path. Full
  test suite (1015 tests) green.

Issue: #188
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.

Clarify config ownership boundaries and enable subagent dispatch by default

1 participant