Skip to content
Draft
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
109 changes: 109 additions & 0 deletions docs/ADRs/0167-use-tracker-first-dispatch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
title: "167. Use tracker-first dispatch for multiple targets"
status: Accepted
relates_to:
- multi-target-execution
- agent-architecture
- agent-infrastructure
topics:
- dispatch
- coordination
- authorization
---

# 167. Use tracker-first dispatch for multiple targets

Date: 2026-11-10

## Status

Accepted

## Context

[ADR 0061](0061-harness-cel-dispatch.md) dispatches eligible harnesses, while
[ADR 0063](0063-polling-based-work-discovery.md) integrates Jira work items.
[ADR 0106](0106-serialize-agent-runs-and-coalesce-subsequent-events.md)
serializes work for a harness and subject. A request spanning several source
branches needs independent target identities and complete accounting, but
that does not require a new multi-target execution interface in the runner.

[Multi-target execution](../problems/multi-target-execution.md) compares the
integration choices. Durable scheduling and publication recovery are tracked
separately in [#9253](https://github.com/fullsend-ai/fullsend/issues/9253).
This ADR aims to assess multiple authorized branches by reusing ordinary
single-target triage with visible work tracking for every branch.

## Options

A native Fullsend target-plan interface could enforce a reusable multi-target
contract, but requires broader platform implementation. A CI matrix launches
jobs without supplying target discovery, durable accounting or tracker
reconciliation. An adapter can instead create target-specific trackers first
and reuse existing single-target dispatch and triage, accepting additional
investigation tickets before applicability is known.

## Decision

Use tracker-first dispatch to assess each authorized source target through an
ordinary single-target Fullsend triage run.
Comment on lines +48 to +49

@ascerra ascerra Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I read "ordinary triage" as the stock agent, though in the experiment it is really a CVE assess harness registered as triage. Two things from testing:

  • Stock triage picked up a vulnerability tracker and tried to close it as not planned, so it has to be kept off these trackers.
  • Registering the assess harness as triage means the repo loses regular triage, which adopting teams will still want.

What worked was a separate agent that uses the triage role. Suggest "a single-target assessment harness that uses the triage role", here and at line 101.

I put that up as its own cve agent in a draft ADR, #9309, so it would help if this one didn't assume the triage name, let's discuss this some more.


A trusted workflow adapter resolves a bounded manifest of maintained targets
from reviewed domain mappings. It records the manifest revision, source and
policy identities, required targets and persistent dispatch/retry bounds in
the recovery journal. After current disclosure and target/action authorization
checks, it creates or reuses one investigation tracker per target. The initial
adapter uses Jira. Tracker identity combines the domain case and stable target
identity, such as repository, branch, component and product release; a new
source SHA identifies an attempt rather than a new ticket. Each ticket starts
with applicability unknown, not an affected verdict. A discovery assessment
is not a prerequisite for creating it.

The adapter populates the supported single-target intake from trusted mapping
and advisory data, then schedules triage through an authorized dispatch path.
A bot comment cannot impersonate a human command or bypass the harness actor
minimum. If no supported path can authorize triage, the tracker remains
visibly pending authorization. Each run verifies its actual origin, branch
Comment on lines +62 to +66

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find a path either. The Jira poller drops events from its own account, app accounts and automation-looking names (filterBotEvents in internal/jirapoll/poller.go), so a tracker the adapter creates never dispatches.

In my testing a person started every run, and the experiment's trigger also wants a person to comment. That seems fine for a first version.

Could the decision say so plainly: a person starts each run, and the adapter doesn't schedule yet?

and source revision against the selected intake; a release target must not
silently fall back to the default branch. The run owns its checkout, context,
Comment on lines +66 to +68

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with the rule, but nothing gives a run its branch today. The dispatch record has no ref (ExecutionRef in internal/harnessdispatch/ref.go), and Jira-sourced runs use "the pinned default branch".

So the pre-script has to fetch and check out the branch, as the experiment does and I did (code). That swapped out the run's own .fullsend directory and cost me a published verdict on v0.55.0, until I restored the checkout (code).

Could the ADR pick one: a ref on the dispatch (a core change), or the harness does it and must restore the checkout?

case artifacts and fresh assessment receipt. Distinct target trackers provide
separate subjects for existing concurrency controls; the adapter also enforces
case-wide bounds over scheduled and running attempts until their termination
is reconciled.

The adapter retains separate receipts for tracker publication, scheduling and
triage outcome, using the recovery work in #9253 for duplicate prevention,
ownership and ambiguous writes. Worker errors and uncertain or failed
assessments remain attached to the same investigation ticket for retry or
human action. They never become an affected finding or coding permission.
Ticket creation is a publication milestone, not successful assessment or case
completion. Every required target remains accounted for, including blocked,
unmapped, unscheduled or exhausted work; domain policy determines completion.

Changed mappings, source or policy invalidate dependent attempts and require
fresh source binding and triage. New required branches extend the manifest
and reopen accounting; existing target trackers are reused and consumed work
bounds do not silently reset. Domain mapping, Jira rendering and aggregate
accounting remain in the workflow adapter. This initial route introduces no
native Fullsend multi-target scheduler or plan/result API. Later platform
Comment on lines +86 to +88

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping the workflow generic is what we want, so I like this. Two things I'd add to the ADR:

  • What changes in fullsend or the agents repo. From testing: an assessment harness, a way to start a run on a tracker automation created, and a branch for the run.
  • Where the adapter lives and how a second team gets it. Is there a consumer besides CVE yet?

Also, I have nothing for getting from a tracker to its repo and branch. Is the experiment's release-mappings.yaml format the adapter's business, or something fullsend should define?

support remains an option if independently justified by other consumers.

## Forge scope

The initial tracker adapter uses Jira for GitHub, GitLab and Forgejo source
targets. Each enabled single-target execution path must verify source binding
and authorization for its forge; unsupported combinations stay blocked.
Distinct Jira tickets do not grant source-repository access. Other tracker
systems require an adapter with equivalent identity and recovery behavior.

## Consequences

- Existing single-target dispatch and triage remain the worker interface.
- Investigation tickets become visible before applicability is known,
including targets later found not affected.
- The workflow adapter owns branch discovery, case-wide bounds, accounting
and tracker reconciliation, with durable recovery still required.
- Branch tickets isolate existing per-subject concurrency, but their creation
cannot establish complete target coverage or successful triage.
- Coding, merge and issue closure retain their existing authorization gates;
tracker-first dispatch grants none of those actions.
7 changes: 7 additions & 0 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,13 @@ The existing design principle is that [the repo is the coordinator](problems/age
[ADR 0151](ADRs/0151-harness-human-role-minimums.md),
[Authorization Contract v2](normative/authorization/v2/)).

- Decided, not yet implemented: tracker-first dispatch creates or reuses one
investigation tracker per authorized source target before running ordinary
single-target triage. A workflow adapter owns discovery, durable recovery,
case-wide bounds and complete target accounting; the initial route adds no
native multi-target runner interface
([ADR 0167](ADRs/0167-use-tracker-first-dispatch.md)).

- Entity-source discovery (target state): `fullsend poll` combines admissible
harness queries into one logical candidate search per source scope and routes
possible matches locally. A bound `run` rechecks source-query membership
Expand Down
6 changes: 6 additions & 0 deletions docs/problems/agent-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ No agent orchestrates other agents. Each agent independently observes the state

The "coordination logic" is the repository's branch protection configuration — not an LLM making judgment calls about when to proceed.

A request that spans several source targets needs an explicit coverage and
isolation boundary; see [multi-target execution](multi-target-execution.md).
[ADR 0167](../ADRs/0167-use-tracker-first-dispatch.md) chooses one target
tracker before ordinary triage, preserving independent worker roles while an
adapter retains case-wide coordination.

This principle aligns with what Yegge's Gas City project calls "Zero Framework Cognition" (ZFC): the orchestration layer should handle mechanics only, while all judgment is deferred to the LLM via prompts. Gas City enforces this with a testable invariant — "does any line of Go contain a judgment call? If yes, it's a violation" — and extends it with the Bitter Lesson test: anything a smarter model would handle better from the prompt doesn't belong in the framework. (See [landscape.md](../landscape.md#gas-town--gas-city).) Fullsend's repo-as-coordinator model naturally satisfies ZFC: branch protection rules, CODEOWNERS, and status checks are deterministic infrastructure. The judgment happens in the review and implementation agents, mediated through GitHub's existing mechanisms. Note the architectural distinction: Gas City *does* have a controller process (reconciliation, health patrol), but enforces that it contain zero cognition. Fullsend's model goes further by eliminating the controller entirely and using the forge's native mechanisms instead.

[Forge-sdlc/forge](../landscape.md#forge-sdlcforge) is the useful contrast case. It uses an event-driven FastAPI/Redis/LangGraph worker and durable checkpoints to move work forward, which is operationally sensible, but it also centralizes workflow truth and treats Jira labels/comments as approval signals. Fullsend can borrow the event-driven resume mechanics without moving merge authority or intent authorization out of repository-visible controls.
Expand Down
7 changes: 7 additions & 0 deletions docs/problems/agent-infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ Agents are often discussed as if they run on a developer workstation: fast local

ACP may still be useful for **narrow experiments** where those constraints are acceptable; it does not, by itself, deliver the isolation depth, supply-chain posture, or “agent as first-class workload with the right capabilities” that we are trying to reach here.

Independent source targets also need isolated contexts and target-aware
scheduling keys. [Multi-target execution](multi-target-execution.md) explores
that boundary;
[ADR 0167](../ADRs/0167-use-tracker-first-dispatch.md) chooses target-specific
trackers and existing single-target triage; an adapter retains case-wide bounds
and recovery rather than requiring a native multi-target scheduler.

## Hybrid and incremental options

- **Thin orchestration layer** — We build a small layer that triggers agents, gathers results, and posts status checks; the actual compute is 3rd party or internal. This keeps coordination logic in our control while deferring platform choice.
Expand Down
86 changes: 86 additions & 0 deletions docs/problems/multi-target-execution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
title: Multi-target execution
---

# Multi-target execution

One request may require checking several repositories or maintained branches.
Launching several CI jobs does not define which targets are required, what
authorizes each action or whether every result has been collected.

The [repository coordination model](agent-architecture.md#interaction-model-the-repo-as-coordinator)
keeps authority in repository-visible controls. The
[infrastructure discussion](agent-infrastructure.md) considers where workers
execute. Multiple targets need independent source and evidence identities,
without making branch discovery an authorization decision.

## Failure cases

- Two branches share one subject identity and collide under its concurrency
key, causing one branch's work to cancel or coalesce another's.
- A result from one branch is accepted for another because both name the same
package or advisory.
- Several targets succeed while one never starts, yet the request is reported
complete.
- Discovery finds a branch that the originating actor cannot authorize.
- A mapping change adds a required target while old workers still run.
- A ticket is created before its acknowledgement is retained, and retrying
creates another ticket for the same branch.
- Creating all tickets is mistaken for successful assessment, or a failed
worker is described as an affected finding.

## Options and trade-offs

### Tracker-first dispatch

A trusted adapter creates or reuses one investigation ticket per authorized
source target, then invokes normal single-target triage. Existing workers and
per-subject concurrency remain reusable. Tickets become visible before an
applicability verdict, including targets later found not affected. The adapter
still owns complete discovery, case-wide bounds, recovery and aggregation.

### Adapter-led workers before tracker creation

An adapter can dispatch independent assessment workers and create tickets only
after collecting results. This reduces unnecessary investigation tickets, but
needs a pre-tracker source/result contract and still owns durable coordination.
An uncertain or failed worker needs an explicit investigation handoff.

### Fullsend-native multi-target execution

A host-admitted plan could give all consumers a reusable target, isolation and
collection contract. That requires a platform interface and conformance tests.
The value must justify its implementation rather than merely duplicating a
single consumer's adapter.

### Handwritten CI matrices

Matrices launch isolated jobs with familiar infrastructure. They do not supply
maintained-target mapping, cross-run recovery or complete coverage accounting.
They can implement execution underneath an adapter, rather than replace one.

## Decision and acceptance

[ADR 0167](../ADRs/0167-use-tracker-first-dispatch.md) chooses tracker-first
dispatch for the initial route. Durable recovery is a separate requirement
tracked in [#9253](https://github.com/fullsend-ai/fullsend/issues/9253).

Acceptance must demonstrate create/reuse before assessment, one branch per
tracker, authorized single-target triage with exact source binding, and
independent subjects for branches sharing one originating case. Inject lost
Jira acknowledgements, dispatch failure, uncertain results and worker loss.
Recovery must reuse the existing ticket and keep applicability unknown until
triage establishes a supported finding. Add a required branch during an old
attempt and verify accounting reopens without duplicating existing tickets or
resetting consumed work bounds. A ticket's existence cannot imply triage ran,
all targets were discovered or remediation completed.

## Open questions

- Which supported dispatch path can authorize adapter-scheduled triage while
preserving the configured actor minimum and target permissions?
- Which existing single-target intake fields and checkout controls need an
adapter for each source forge?
- How should adapters expose incomplete or conflicting discovery coverage?
- How should target trackers record superseded attempts and operator retries
without losing earlier evidence or repeating ambiguous publications?
Loading