Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ in `.fullsend/scripts/` remain accessible.
retain `# fullsend-stage:` markers so dispatch can route events to the correct
agent workflow.

The dispatch chain uses 1 level of `workflow_call` nesting (limit is 4):
The dispatch chain uses 1 level of `workflow_call` nesting (limit is 10 as of
November 2025; was 4 previously):

```
shim ──workflow_call──> .fullsend/dispatch.yml
Expand Down
24 changes: 22 additions & 2 deletions docs/ADRs/0041-synchronous-workflow-call-event-dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,34 @@ convention. Do not add compile-time sync tooling as a substitute.
`workflow_dispatch` remains allowed for **non-event** entry points only (e.g.
`repo-maintenance.yml`, manual prioritize, admin/CLI triggers).

Prefer `dispatch.yml` → `reusable-*.yml@*` where possible to stay within four
`workflow_call` nesting levels.
Prefer `dispatch.yml` → `reusable-*.yml@*` where possible to conserve
`workflow_call` nesting levels (limit: 10 levels, 50 calls per run as of
November 2025).

After agent architecture is revised to support [ADR 0038](0038-universal-harness-access.md),
re-evaluate whether a discovery mechanism is needed.

## Consequences

- **Nesting arithmetic changes from ADR 0031.** Under ADR 0031's async model,
`workflow_dispatch` from dispatch to thin caller starts a new workflow run and
resets the `workflow_call` nesting counter (thin caller → reusable = 1 level).
Under this ADR's synchronous model, nesting accumulates across the full chain:

```
Level 1: shim ──workflow_call──> .fullsend/dispatch.yml
Level 2: dispatch.yml ──workflow_call──> .fullsend/code.yml (thin caller)
Level 3: code.yml ──workflow_call──> reusable-code.yml
──uses──> fullsend-ai/fullsend@v0 (composite action, not a level)
```

This consumes 3 of the 10 available nesting levels, leaving 7 for future
composition within reusable workflows (e.g., sub-stage delegation). Thin
callers remain valuable despite consuming a nesting level: they provide
explicit `secrets:` passthrough (least-privilege over `secrets: inherit`)
and `vars.*` → `inputs.*` mapping that makes the reusable workflow's
parameter contract visible and auditable
([ADR 0031](0031-reusable-workflows-for-action-installed-distribution.md)).
- PR/issue observers can use one Actions run to see agent completion without
hunting orphan `.fullsend` runs; mitigates [#504](https://github.com/fullsend-ai/fullsend/issues/504),
[#896](https://github.com/fullsend-ai/fullsend/issues/896), [#1048](https://github.com/fullsend-ai/fullsend/issues/1048),
Expand Down
1 change: 1 addition & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Infrastructure platform choice and configuration are specified in the adopting o
- Repo maintenance: a workflow in `.fullsend` (`.github/workflows/repo-maintenance.yml`) reconciles enrollment shims in target repos when `config.yaml` changes or on manual dispatch. The CLI's `EnrollmentLayer.Install()` dispatches this workflow via `workflow_dispatch` and monitors it for completion, then reports any enrollment PRs created in target repos.
- Installer scaffold: the `WorkflowsLayer` deploys content from an embedded scaffold (`internal/scaffold/`), keeping deployable files as real files under version control rather than Go string constants.
- Reusable workflows: agent workflows in `.fullsend` are thin callers (~40-70 lines) that delegate infrastructure logic to upstream reusable workflows (`fullsend-ai/fullsend/.github/workflows/reusable-*.yml`) via `workflow_call`. Infrastructure patches ship once upstream and propagate to all orgs without re-install ([ADR 0031](ADRs/0031-reusable-workflows-for-action-installed-distribution.md)).
- Event-driven stage dispatch: `dispatch.yml` invokes stage workflows via synchronous `workflow_call` instead of async `workflow_dispatch` + `gh workflow run`, so the dispatched run stays linked to the caller in the GitHub Actions UI ([ADR 0041](ADRs/0041-synchronous-workflow-call-event-dispatch.md)). This changes the nesting arithmetic from ADR 0031 — the full synchronous chain (shim → dispatch → thin caller → reusable) uses 3 of the 10 available `workflow_call` nesting levels (50 calls per run). Under ADR 0031's async model, `workflow_dispatch` reset the nesting counter; under ADR 0041's sync model, nesting accumulates. Thin callers remain valuable despite consuming a nesting level: they provide explicit `secrets:` passthrough (least-privilege over `secrets: inherit`) and `vars.*` → `inputs.*` mapping that makes the reusable workflow's parameter contract visible and auditable ([ADR 0031](ADRs/0031-reusable-workflows-for-action-installed-distribution.md)).

**Open questions:**

Expand Down
Loading