Skip to content

Entity execution scope and CLI v1 ​

This contract records two things. It names the first provider/kind scope for entity-source harnesses. It also defines how fullsend run and fullsend poll accept entity work without changing existing invocations. It implements the planning step of issue #9589 under ADR 0098 and ADR 0144.

Target contract, not implemented: No shipped command accepts the entity flags, the entity-sources poll driver, or the lifecycle flags below. Every existing invocation keeps its current behavior. Implementation follows in #9598, #9585, #9599, and #9588. User-facing CLI, configuration, and guide updates follow in #9600 after the behavior ships.

Baseline contracts ​

This contract uses these contracts and does not redefine them:

An entity-source harness is a harness whose effective definition declares entity_kinds, including the empty map {}. Every other harness is an event-only harness. Event-only harnesses keep their current behavior under every invocation in this contract.

First enabled scope ​

The first enabled scope is:

ProviderKindNative recordEnabled
githubwork_itemIssueYes
githubchange_proposalPull requestYes
githubconversationDiscussionNo: deferred
gitlabwork_itemIssueNo: deferred
gitlabchange_proposalMerge requestNo: deferred
jirawork_itemIssueNo: deferred

Any provider/kind pair outside Normalized entity v1, such as Forgejo pairs, is not eligible. Configuration validation rejects it as entity-source configuration v1 requires.

The enabled GitHub pairs apply only to a source that meets both conditions:

  • The source resolves to the native GitHub connection. That connection can be github.com or a GitHub Enterprise endpoint set through connections.github.base_url.
  • The source's repository scope is the target code repository, which is the repository whose configuration the run uses. This is the default scope of a source on the provider-default connection. An explicit repositories list that names another repository is outside the first scope.

The adapter MUST also verify that the deployed host supports the advanced search mode that entity-source configuration v1 requires, and MUST NOT fall back to legacy search semantics. A source with another repository scope, another GitHub connection, or a host without that search mode is outside the first scope.

Capability assessment ​

A provider/kind pair becomes eligible when it has all four capabilities:

  • Normalized entity: a mapping in Normalized entity v1.
  • Model-facing: a field gate in Entity-context-snapshot v2.
  • Source query: a source query language in entity-source configuration v1.
  • Adapter: a provider adapter that can resolve the current entity, prove source membership, and stage the snapshot.
PairNormalized entityModel-facingSource queryAdapter and execution path
GitHub issue, pull requestMappedCoveredBounded GitHub filter subset for both kinds, with GraphQL advanced search for combined discovery and selective acquisitionNo entity adapter yet. The existing GitHub forge.Client already reads issues, pull requests, comments, label events, reviews, and review threads. No fullsend poll driver uses GitHub, so entity discovery competes with no driver
GitHub DiscussionMappedCoveredNone. The GitHub subset guards only is:issue and is:prNo Discussion ingress or conversation client under ADR 0086
GitLab issue, merge requestMapped. Reviews, reactions, issue type, and close reason are unsupportedCoveredOnly the open, closed, and all presetsNo entity adapter. The --forge gitlab poller and the webhook fast path own dispatch through shared poll state (ADR 0125, ADR 0132). Cutover needs a plan for that state
Jira issueMapped. Complete label_applications needs full changelog coverageCoveredNative JQL within a project guardNo entity adapter. The jira-poll driver owns dispatch through checkpoints and lock properties. The source project is separate from the target code repository

Why GitHub issues and pull requests come first ​

GitHub is the only provider whose source query language covers both work_item and change_proposal and can narrow selection beyond lifecycle state. Its issues and pull requests share one repository scope, one authorization source, and one search mode. Entity-source configuration v1 defaults the source slot to work_item, and its example code harness targets change_proposal, so one adapter serves both slots. No existing poll driver owns GitHub dispatch, so entity discovery adds a new path and does not need to take over an existing one. Limiting the first scope to the target code repository avoids credential scopes and cross-repository routing that a first adapter does not need.

Contract coverage alone does not enable a pair. The first adapter and the Entity-context-snapshot v2 producer are part of #9598. Until they ship, the enabled pairs report the unsupported result below.

Why the other pairs are deferred ​

  • GitHub Discussions have no source query language, no runtime ingress, and no conversation client.
  • GitLab issues and merge requests support only lifecycle presets, so a source cannot select work by label. Several normalized collections are unsupported. Entity admission must also coordinate with the shared state of the existing GitLab poller and webhook fast path, so that only one path owns dispatch for each binding.
  • Jira issues need full changelog coverage to prove complete label applications. They need role resolution for eventless checks against the source project, which is separate from the target code repository. Entity admission must take over dispatch from the jira-poll driver for each migrated binding without losing its checkpoints.

Jira unassessed-tracker scenario ​

The unassessed-tracker scenario (S5) from closed issue #8421 is deferred from the first scope. In S5, automation files a Jira vulnerability ticket and no person changes it. The agent runs once and does not run again after its result is on the ticket.

S5 depends on the Jira capabilities that are deferred above. Its predicate reads the issue type and labels. It also reads handled-state evidence that the agent's own Jira account writes. The current jira-poll driver classifies changes made by its own account as bot events. An entity adapter must therefore admit that account's records as entity history before S5 can work. S5 also needs the same completeness guarantees as other state-only scenarios, because a missed ticket means a vulnerability that nobody assessed.

S5 is the first named follow-up for the Jira issue pair. Until that follow-up ships, each S5 ticket needs a person or a label added after creation.

Single definition in code ​

The enabled scope MUST be defined once in code. Configuration validation, fullsend run, fullsend poll, and dispatch MUST read that one definition. A test MUST check that the scope table above matches it. The first implementing issue, #9598, introduces the definition.

Result classes ​

Every entity check and every discovered candidate ends in exactly one of these classes. Commands MUST report the class and MUST NOT turn one class into another:

ClassMeaningSandboxRetry
unsupportedThe provider/kind pair, source scope, adapter, or flag combination is outside the enabled scopeNever startsOnly after a configuration or release change
deniedEvent authorization, invocation provenance, or platform policy rejects the checkNever startsOnly after the evidence changes
not_eligibleCurrent membership or the CEL predicate is proven falseNever startsOn the next event or discovery
unresolvedMembership, entity data, authorization evidence, or coverage is incomplete, or a read failedNever startsYes, through retry or rediscovery
selectedMembership and CEL are proven true and admission passesAt most one cycle per checkFollows ADR 0144

An unsupported result is never an empty discovery result or a false CEL result. Entity discovery v1 pass outcomes map onto these classes without change. A discovery plan the adapter cannot build is unsupported. An incomplete or failed pass is never reported as complete-empty, and work it did not cover stays unresolved. Absence from discovery results is never not_eligible. A command reports it before it reads entity data or creates a sandbox. Its diagnostic MUST name the provider, kind, source, and the reason, such as "provider/kind not enabled", "repository scope outside the target repository", or "adapter unavailable". A usage error for an incompatible flag combination is also reported before any read.

fullsend run ​

Binding inputs ​

A run is bound when it has exactly one binding input:

  • An event input: --event-file, or the _normalized_event that the dispatch payload carries today.
  • An explicit entity, in one of two forms:
    • --entity <id> takes a canonical Normalized entity v1 ID.
    • --entity-source <name> --entity-number <n> takes an effective source name, native, or the matching provider name, plus the entity number. The selector resolves as it does for fullsend issues --entity-source in entity-source configuration v1. A direct lookup does not run the source's discovery query. The query still decides source membership in the check below.

The harness's effective entity_kinds.source supplies the kind. An --entity ID with another kind is a usage error. A source whose scope contains several repositories needs an explicit repository. The first scope has only one repository per source, so v1 adds no repository flag.

The run resolves the binding to one canonical entity and reads its current state. A supplied ID establishes the binding only. It is not current state. Ambiguous or unresolvable bindings fail. They never fall back to an unbound run.

With an explicit entity, the first CEL check uses event == null. Eventless admission requires trusted invocation provenance and effective platform policy. A one-cycle run for a known entity needs no discovery pass and no discovery readiness evidence. It still rechecks current source membership before the sandbox starts. With an event input, the run first authorizes the event. It then binds the entity that the event identifies. The first check uses both entity and event.

Lifecycle flags ​

  • --lifecycle once|poll|timed selects the ADR 0144 lifecycle for a bound run. When omitted, the run uses the ADR 0144 automatic default: once outside CI, and timed in CI only when every timed condition holds.
  • --deadline <duration> sets the configured timed deadline, measured from command entry. It is valid only when the effective lifecycle is timed.
  • The idle period is platform configuration, not a flag.

fullsend run has no --watch flag. --watch belongs to fullsend poll.

Run matrix ​

InvocationHarnessResult
No binding inputAnyUnchanged unbound once run
No binding input, --lifecycle poll or timedAnyUsage error: a resident lifecycle requires a binding
Event inputEvent-onlyUnchanged event-only run
Event input, --lifecycle poll or timedEvent-onlyunsupported: resident event-only runs need a wake path outside v1
Event input for an enabled pairEntity-sourceEvent-bound check, then at most one cycle when the effective lifecycle is once (#9598, #9585)
Event input for a pair outside the scope, such as a Jira or GitLab eventEntity-sourceunsupported before any entity read
--entity or --entity-source for an enabled pairEntity-sourceDirect binding with event == null, then at most one cycle when the effective lifecycle is once (#9598)
--entity or --entity-source for a pair or scope outside the first scopeEntity-sourceunsupported before any entity read
--entity or --entity-sourceEvent-onlyUsage error: entity binding requires an entity-source harness
--entity or --entity-source together with --event-fileAnyUsage error: conflicting binding inputs
--entity or --entity-source while a dispatch payload carries a normalized eventAnyUsage error: conflicting binding inputs
--entity together with --entity-source, or --entity-source without --entity-number, or the reverseAnyUsage error
Bound run, effective lifecycle poll or timed, whether explicit or the automatic timed default in CIEntity-sourceResident checks on the bound entity only (#9599). Eventless checks need trusted provenance, policy, and fullsend poll coverage. Without coverage, an explicit choice fails closed and the automatic default stays once
--deadline with a lifecycle other than timedAnyUsage error

Existing flags such as --target-repo, --status-number, and the runtime overrides keep their current meaning. They never select or change the entity binding.

fullsend poll ​

Driver composition ​

Each fullsend poll invocation runs exactly one input driver, as it does today. Entity discovery is a new driver, --input-driver entity-sources. It enumerates the effective source bindings of enabled agents through the ADR 0149 coordinator, following Entity discovery v1. A source with discovery: false is not enumerated. It still admits event-backed candidates. It routes each selected candidate to the entity-bound fullsend run path. It does not fabricate a normalized event. Each dispatch descriptor carries the canonical entity ID and a reference to the trusted execution plan, with no event.

The existing drivers do not enumerate entity sources. The entity-sources driver does not read GitLab or Jira event streams. A scheduler that needs both runs two invocations. For each binding, only one of legacy event reconstruction and entity-driven admission owns dispatch at a time, as entity-source configuration v1 requires. The first scope has no GitHub poll driver, so no existing driver gives up dispatch in v1. GitHub events for an entity-source harness become event-backed candidates through #9585. The ADR 0106 key (harness, target repository, canonical entity) serializes runs that the event path and the discovery path both start. Handled state belongs in harness CEL or the pre-script, as ADR 0144 requires.

Each discovery pass emits the host-side pass report that Entity discovery v1 defines. An execution adapter MAY use that report as the discovery readiness evidence that entity-source configuration v1 requires before a resident eventless run. Reports carry canonical identities only, with no credentials or entity content.

For the GitHub target, entity-sources uses --output and --target-repo with the same meanings as the jira-poll GitHub target. #9588 defines the exact descriptor fields.

When an active source binding is outside the first scope, the driver reports that binding as unsupported and does not enumerate it. It still processes the bindings in scope. After the cycle it exits nonzero, so the scheduler shows the problem. A configuration with no active entity-source bindings is an empty cycle and exits zero.

--mode and lifecycle flags ​

--mode keeps one meaning: input discovery for the --forge gitlab poller, slash or events. The FULLSEND_POLL_MODE variable keeps the same meaning and scope. Lifecycle flags never change --mode, and --mode never selects a lifecycle.

  • --lifecycle once|poll|timed selects the ADR 0144 lifecycle. The default is once in every environment.
  • --watch is the ADR 0063 shorthand for --lifecycle poll. Combining it with --lifecycle once or --lifecycle timed is a usage error.
  • --deadline <duration> is valid only with timed.

Poll matrix ​

InvocationResult
--forge gitlab, with or without --mode slash or --mode eventsUnchanged
--forge gitlab --print-dispatch-routesUnchanged
--input-driver jira-poll, either --target-forgeUnchanged. --mode stays ignored, as today
--input-driver gitlab-webhookUnchanged
An existing driver with --lifecycle onceSame as omitting the flag
An existing driver with --watch, --lifecycle poll, or --lifecycle timedunsupported in v1. gitlab-webhook handles one payload per invocation and always runs once
--input-driver entity-sourcesOne discovery cycle over in-scope bindings (#9588)
--input-driver entity-sources with --watch, --lifecycle poll, or --lifecycle timedResident or timed discovery under ADR 0144 (#9588)
--input-driver entity-sources with --modeUsage error: --mode applies only to --forge gitlab
--input-driver entity-sources with --forgeUsage error
--input-driver entity-sources with --target-forge gitlab, --project, or --gitlab-urlunsupported: GitLab delivery of entity candidates is deferred
--input-driver entity-sources with an out-of-scope bindingunsupported for that binding, other bindings processed, nonzero exit
--watch with --lifecycle once or timedUsage error
--deadline with a lifecycle other than timedUsage error

Conformance cases ​

Implementations MUST cover at least these cases:

  1. Each enabled pair is accepted and its entity is evaluated. Each other pair in Normalized entity v1 gives unsupported without an entity read or a sandbox.
  2. An enabled pair whose source has another repository scope, another GitHub connection, or a host without advanced search gives unsupported.
  3. An unsupported result never appears as an empty discovery result or a false CEL result.
  4. Event-only harnesses behave the same under every existing fullsend run invocation, including --event-file and the dispatch-payload event.
  5. Every existing fullsend poll invocation behaves the same, including --mode, FULLSEND_POLL_MODE, and --print-dispatch-routes.
  6. Each cell of the run and poll matrices produces its listed result.
  7. A direct entity binding evaluates CEL with event == null. An event binding evaluates the first check with that event, after event authorization.
  8. The scope table in this document matches the single code definition.