From 62c391a13243eceff88999c0570b67805f1678e8 Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Fri, 23 Oct 2026 00:52:19 +0300 Subject: [PATCH 1/7] docs(adr): define selective CEL acquisition and actor floor Record selective entity CEL acquisition and bounded actor-role reuse. Set a common verified triage floor for human event, entity-fact, and Fullsend-controlled model admission. Keep stronger harness checks in CEL and document versioned migration prerequisites. Signed-off-by: Barak Korren Assisted-by: Codex (GPT-6) --- docs/.vitepress/config.ts | 5 + ...thorization-on-all-agent-dispatch-paths.md | 6 + .../ADRs/0063-polling-based-work-discovery.md | 5 + .../0098-entity-first-harness-evaluation.md | 17 +- ...y-resolution-for-dispatch-authorization.md | 5 + ...actor-attributed-data-security-boundary.md | 5 + ...inistic-filtered-entity-context-staging.md | 6 + ...use-poll-and-entity-bound-run-processes.md | 7 + ...tity-cel-over-selectively-acquired-data.md | 167 ++++ ...use-verified-actor-roles-for-entity-cel.md | 125 +++ .../ADRs/0151-common-actor-admission-floor.md | 122 +++ docs/architecture.md | 100 ++- docs/normative/authorization/v1/README.md | 12 +- docs/normative/authorization/v2/README.md | 770 ++++++++++++++++++ .../entity-context-snapshot/v1/README.md | 5 + docs/problems/agent-architecture.md | 6 + docs/problems/agent-infrastructure.md | 2 +- docs/problems/operational-observability.md | 5 + docs/problems/security-threat-model.md | 10 + 19 files changed, 1346 insertions(+), 34 deletions(-) create mode 100644 docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md create mode 100644 docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md create mode 100644 docs/ADRs/0151-common-actor-admission-floor.md create mode 100644 docs/normative/authorization/v2/README.md diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 4bd064a9f0..69ae949b34 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -419,6 +419,11 @@ export default defineConfig({ collapsed: true, items: getMarkdownFiles("ADRs", "ADRs"), }, + { + text: "Normative Specifications", + collapsed: true, + items: getMarkdownFiles("normative", "normative"), + }, { text: "Design Documents", collapsed: true, diff --git a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md index 6864bd852b..ae2cdf1aa7 100644 --- a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md +++ b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md @@ -40,6 +40,12 @@ the preserved GitHub label handoff exception are decided in [ADR 0107](0107-bot- Fullsend-originated entity discovery without a prompting event. Event-backed dispatch remains subject to this ADR's actor authorization gate. +[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the human +permission threshold for target CEL-routed event admission: the platform floor +is a verified effective `triage`-or-higher role, while CEL expresses stronger +harness conditions. The workflow stage guards and current Go `write` gate +remain in effect until migration. + ## Context The dispatch routing logic (`dispatch.yml` / `reusable-dispatch.yml`) diff --git a/docs/ADRs/0063-polling-based-work-discovery.md b/docs/ADRs/0063-polling-based-work-discovery.md index 22f08559ba..9bdd43da27 100644 --- a/docs/ADRs/0063-polling-based-work-discovery.md +++ b/docs/ADRs/0063-polling-based-work-discovery.md @@ -38,6 +38,11 @@ resident or run within a deadline, and the reserved `--watch` option denotes the explicit resident poll lifecycle. The poll command, driver architecture, and per-repository scope remain current. +[ADR 0147](0147-evaluate-entity-cel-over-selectively-acquired-data.md) requires +durable retry or proven rediscovery for provisional entity-source handoffs. The +`lastCheck` advance-on-schedule rule below remains for legacy event +reconstruction. + ## Context Fullsend's primary dispatch path is **event-driven**: forge webhooks are normalized diff --git a/docs/ADRs/0098-entity-first-harness-evaluation.md b/docs/ADRs/0098-entity-first-harness-evaluation.md index 412707ca6c..5b1b5e0b45 100644 --- a/docs/ADRs/0098-entity-first-harness-evaluation.md +++ b/docs/ADRs/0098-entity-first-harness-evaluation.md @@ -40,7 +40,22 @@ On GitLab, the low-latency webhook candidate path and poller backstop are trusted, entity-bound `fullsend run` may recheck only its canonical entity with `event == null`. `fullsend poll` remains the broad candidate enumerator. Both eventless paths require eligible entity sources, trusted Fullsend invocation -provenance, current actor filtering, and the same harness CEL predicate. +provenance, actor filtering under the current authorization contract, and the +same harness CEL predicate. + +[ADR 0147](0147-evaluate-entity-cel-over-selectively-acquired-data.md) +partially supersedes the pre-CEL full-history enumeration, permission +resolution for every history actor, and audit-roster requirements below. +[ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md) separately permits +bounded role reuse across entity-CEL checks and partially supersedes the +permission-at-evaluation-time rule. Trusted-origin, event-actor, and +model-bound authorization remain required. + +[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes this +ADR's per-harness human threshold for decision-relevant entity facts. Target +entity-CEL admission uses a verified effective `triage`-or-higher platform +floor; actor provenance and fail-closed filtering remain required, and CEL may +require stronger conditions. ## Context diff --git a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md index 3af75f9049..8ddbb19343 100644 --- a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md +++ b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md @@ -19,6 +19,11 @@ Date: 2026-09-27 Accepted +[ADR 0151](0151-common-actor-admission-floor.md) updates the human permission +floor referenced here for target CEL and Fullsend-controlled model admission. +This ADR's bot grants and the forge-role meaning of human `role_verified` +remain unchanged. + Extends [ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md) and defines the bot behavior to be added to the existing v1 contracts. This ADR explicitly permits the deferred migration from legacy bot exceptions to diff --git a/docs/ADRs/0133-actor-attributed-data-security-boundary.md b/docs/ADRs/0133-actor-attributed-data-security-boundary.md index c45aa78797..316abc368d 100644 --- a/docs/ADRs/0133-actor-attributed-data-security-boundary.md +++ b/docs/ADRs/0133-actor-attributed-data-security-boundary.md @@ -19,6 +19,11 @@ Date: 2026-10-07 Accepted +[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the +selected-harness human threshold for Fullsend-controlled model-bound records +with a verified effective `triage`-or-higher floor. Current-revision actor +checks and filtering, delimitation, and redaction requirements remain. + ## Context [ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md) decides diff --git a/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md b/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md index 00c86ea48d..660e0b1098 100644 --- a/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md +++ b/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md @@ -19,6 +19,12 @@ Date: 2026-09-07 Accepted +[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the +human threshold inherited from ADR 0133 for Fullsend-controlled model-bound +snapshot records in the v2 target contract: admission uses a verified effective +`triage`-or-higher role. Snapshot v1 retains its historical threshold; +deterministic assembly, current-revision checks, and filtering remain required. + ## Context [Issue #6407](https://github.com/fullsend-ai/fullsend/issues/6407) identifies diff --git a/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md b/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md index be9a351f76..5941bbfdf0 100644 --- a/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md +++ b/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md @@ -29,6 +29,13 @@ Partially supersedes [ADR 0063](0063-polling-based-work-discovery.md): `fullsend poll` may remain resident instead of always exiting after one cycle. Its per-repository scope and driver architecture remain current. +[ADR 0147](0147-evaluate-entity-cel-over-selectively-acquired-data.md) +partially supersedes the complete-entity due-check and full-history audit +requirements below. [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md) +separately permits bounded role reuse for entity CEL in place of mandatory +per-check actor-role refresh. The lifecycle, due-check scheduling, current +entity resolution, and fresh model-bound authorization rules remain current. + ## Context [ADR 0098](0098-entity-first-harness-evaluation.md) makes the current entity, diff --git a/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md b/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md new file mode 100644 index 0000000000..afbf8407c6 --- /dev/null +++ b/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md @@ -0,0 +1,167 @@ +--- +title: "147. Evaluate entity CEL over selectively acquired data" +status: Accepted +relates_to: + - agent-architecture + - operational-observability +topics: + - authorization + - cel + - entities + - polling +--- + +# 147. Evaluate entity CEL over selectively acquired data + +Date: 2026-10-22 + +## Status + +Accepted + +Partially supersedes [ADR 0098](0098-entity-first-harness-evaluation.md)'s +pre-CEL enumeration and actor-permission resolution for every +action-indicating element, and its complete audit roster. The trusted-origin +gate and authorization of decision-relevant action facts remain. Also +partially supersedes [ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md)'s +complete-entity due checks and full-history audit roster. Its process +lifecycle and model-bound staging rules remain. This ADR does not change +actor-role freshness; [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md) +addresses that separately. +[ADR 0151](0151-common-actor-admission-floor.md) separately sets the common +human actor floor for CEL and model admission. + +## Context + +[ADR 0098](0098-entity-first-harness-evaluation.md) and +[ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md) require a complete +entity and current actor checks across all action-indicating history before an +entity-source harness evaluates CEL. The corresponding +[Authorization Contract v1](../normative/authorization/v1/README.md) also +requires an audit roster of every retained element and actor. A state-only or +short-circuiting predicate can often be decided without those unrelated API +reads or audit entries. A progressive check may inspect multiple pages; +repeating a role lookup for the same actor on each iteration compounds provider +load. The [observability problem](../problems/operational-observability.md#structured-traces) +already favors references to durable inputs over duplicating source data. +For Git-forge work, [ADR 0141](0141-deterministic-filtered-entity-context-staging.md) +separately assembles selected model inputs before the sandbox starts. +[ADR 0063](0063-polling-based-work-discovery.md)'s `lastCheck` rule advances +after scheduling a reconstructed-event run; a new entity-source candidate +handoff needs its own retry or rediscovery guarantee. + +Entity routing remains a target design: at +[`a2be1678`](https://github.com/fullsend-ai/fullsend/blob/a2be1678c5dbd9361a77f04de5ec260320e4fb9f/internal/harness/trigger.go#L12-L16), +the trigger CEL environment still declares only `event`. + +## Options + +### Fetch all history before CEL + +This makes missing history easy to detect but requires reads and audit records +for categories the predicate never uses. + +### Fetch decision-relevant data progressively + +This avoids unrelated reads, but requires explicit partial-data semantics and +proof that a result cannot change when more data is fetched. + +## Decision + +Adopt selective, progressive acquisition for entity-source CEL evaluation. +The platform retains a closed classification of action-indicating categories, +but fetches only fields and history that could affect the evaluated harness's +predicate. It derives a conservative acquisition plan from the compiled CEL +expression and may push sound filters into provider queries. Projections of +classified action-indicating elements inherit their source records' actor +dependencies. Provider aggregates affected by unauthorized records cannot +enter the authorized CEL view unchanged. +Whether a state field needs an actor check depends on how CEL uses it. An +actor-driven change that can make the check actionable requires its actor to +pass the platform actor floor. A harness may require a stronger role in CEL. +When `updated_at` advances on each forge update, elapsed +time can make a staleness check on that raw field actionable without checking +every historical updater; any update can defer it. A query plan must not hide a +potentially authorized match. + +The evaluator retains fetched entity data and verified actor roles while it +progressively enriches one check. An in-memory or trusted shared cache may +reuse entity data across checks only when its revision and coverage are +validated as current; an accepted event or wake invalidates affected entity +facts. Within one check, an iteration may reuse a verified role for an actor +it has already resolved while that verdict remains eligible under +[ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md)'s age bound; an +expired verdict must be refreshed before it contributes to a definitive +decision. Each iteration applies the common platform floor to actor-originated +facts that could make the predicate actionable and makes the verified effective +role available for stricter harness CEL conditions. Raw state used only for the +conservative deferral described above is not actor authority. ADR 0148 +separately permits reuse across checks. + +Partial entity data must distinguish not-yet-loaded data from absent or empty +data. A CEL result is definitive `true` or `false` only when every complete +entity consistent with acquired facts, proven source coverage, and the +applicable actor-authorization results yields that result. +Otherwise the platform records `UNKNOWN` and either fetches more relevant data +for re-evaluation or passes an unresolved candidate from `poll` to a bound +`run` for further reading. Exhausted budgets or unavailable, inconsistent, or +unverifiable evidence end as inconclusive, never as empty or false. `poll` may +stop on definitive false, subject to [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md)'s +cache-dependent recheck rule. Its definitive true selects a candidate for bound +`run`, which must recheck current evidence before launching a sandbox. A +handoff is provisional: scheduling or delivering the run does not resolve the +candidate. For any incomplete `poll` check or provisional handoff, discovery +retains a durable retry path or proves its source query will rediscover the +candidate after checkpoint advancement. A failed or inconclusive `run` leaves +the candidate retryable. A definitive false closes the current handoff only +after any cache-dependent recheck is scheduled under ADR 0148; completed +actionable work or safe deferral under ADR 0144 also closes it. `run` launches +a sandbox only after its own definitive true. Absence, negation, counts, and +universal conditions may still require complete coverage of relevant scopes. + +Before a classified action-indicating entity fact can influence CEL, Fullsend +verifies its source-revision actor. A human's verified effective role must meet +the common `triage` platform floor; a bot needs its exact registered role under +ADR 0107. The eligible actor's verified role is available to CEL for further +harness conditions. The existing verified label-added prompting event exception +grants authority only for that exact accepted transition and +its proven entity projection; independent history needs its own actor gate. +Unauthorized records are excluded. Unrelated history need not be fetched, +authorized, or listed in the audit. Each check records its verified initiator, +entity, repository, effective policy and harness revision, decision time, +dependency and query scopes, and +bounded evidence of source coverage and actor-check outcomes. Identifiable +witnesses for a positive decision retain actor provenance; collection-wide +decisions may bind counts, digests, and source references to the checked +coverage and authorization source instead of listing every record and actor. +Event-actor and model-bound gates remain separate; ADR 0151 sets their common +human floor. + +The breaking change to enumeration and audit guarantees is specified by +[Authorization Contract v2](../normative/authorization/v2/README.md), as +required by [ADR 0015](0015-normative-specifications-directory.md). +Entity-source CEL remains disabled until a versioned normalized-entity +contract defines partial data, coverage, and concurrency semantics. + +## Forge scope + +This applies to GitHub, GitLab, Forgejo, and Jira entity-source harnesses. +Each adapter must establish sound coverage and provider-backed actor roles +for the facts it supplies; unsupported provider queries or pagination leave +the decision unresolved. Existing event-only dispatch on every forge is +unchanged. + +## Consequences + +- State-only and short-circuiting predicates can avoid unrelated provider + reads, permission lookups, and audit volume. +- Negative and aggregate predicates can still require all relevant history; + provider limits may leave a check unresolved and prevent sandbox launch. +- Adapters and the normalized-entity contract must represent partial coverage + and source consistency, including raw state versus actor-filtered action + facts, before entity-source CEL can ship. +- Audit consumers must use bounded decision evidence; omitted actors' roles + cannot be reconstructed from that record without separate provider logs. +- An unauthorized forge update may defer a staleness check based on raw + `updated_at`; a harness needing last-authorized-update semantics must acquire + and authorize the relevant history. diff --git a/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md b/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md new file mode 100644 index 0000000000..be442fd43c --- /dev/null +++ b/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md @@ -0,0 +1,125 @@ +--- +title: "148. Reuse verified actor roles for entity CEL within a bounded lifetime" +status: Accepted +relates_to: + - agent-architecture + - agent-infrastructure +topics: + - authorization + - caching + - cel + - entities +--- + +# 148. Reuse verified actor roles for entity CEL within a bounded lifetime + +Date: 2026-10-22 + +## Status + +Accepted + +Partially supersedes [ADR 0098](0098-entity-first-harness-evaluation.md)'s +permission-at-evaluation-time rule and +[ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md)'s mandatory +actor-role refresh at every due check and prohibition on a cached +authorization result substituting for that refresh. This exception applies +only to entity-source CEL. Event admission and model-bound content admission +retain their separate fresh authorization rules. +[ADR 0151](0151-common-actor-admission-floor.md) sets their common human actor +floor without extending this cache to either gate. + +## Context + +[ADR 0147](0147-evaluate-entity-cel-over-selectively-acquired-data.md) lets an +entity CEL check load only the facts needed to decide its predicate, fetching +more when the partial result is `UNKNOWN`. Iterations within one check, later +due checks, and separate `poll` and bound `run` processes can encounter the +same actors. [ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md) +requires every due check to refresh actor authorization even when a recent, +provider-verified result is available. That multiplies provider calls as +entity polling becomes more frequent. + +Reusing a role result across checks reduces those calls but delays recognition +of a grant or revocation that the platform has not observed. The bounded +period and the gate to which it applies therefore belong in the authorization +contract, rather than being left as a cache implementation detail. + +## Options + +### Refresh every due check + +This notices provider-side permission changes on the next check but repeats +lookups for actors shared by related checks. + +### Reuse roles without expiry + +This saves lookups but can permanently preserve a revoked grant or stale denial. + +### Reuse roles for a bounded period + +This bounds permission-change latency while allowing related checks to share +provider results. + +## Decision + +For entity-source CEL only, Fullsend may reuse a completed provider-verified +human permission result or exact registered-bot-role result across progressive +iterations, separate checks and harnesses, and `poll` and bound `run` +processes. A trusted host-owned cache may be local or shared between +processes. Versioned platform policy must set an explicit maximum age of no +more than five minutes, measured absolutely from the authoritative lookup's +start; absent that policy, cross-check reuse is disabled. A deployment may +choose a shorter age, but a cache hit never renews expiry and a harness or +repository cannot widen it. Verified denials may be cached under the same +bound. Failed, incomplete, or unverifiable lookups are not cache entries and +cannot fall back to an older entry. +The cache stores the verified effective role or verified absence, not a +per-harness threshold result or CEL decision. + +Cache keys and invalidation must isolate the source provider and tenant, +target repository or project, immutable actor identity, effective permission +source and policy revision, and the selected source ref plus relevant OWNERS, +OWNERS_ALIASES, or bot-registration source revision. A known change to a grant, +OWNERS, OWNERS_ALIASES, bot registry, or policy invalidates affected entries. +Every check separately validates current entity facts, their +source-revision actor attribution, query coverage, the common `triage` platform +floor, and its harness CEL predicate. A wakeup invalidates affected entity +facts; it does not by itself turn an unexpired actor-role result into a fresh +one. +If cached authorization contributes to a false CEL result, discovery must +schedule a recheck or guarantee rediscovery after expiry or known invalidation +within a bounded reconciliation interval, even when the entity itself has not +changed. + +A bound `run` may use an unexpired shared result for its final CEL check and +sandbox admission, but it re-resolves the entity and reevaluates CEL before +each sandbox cycle rather than adopting `poll`'s verdict. If a deciding role +expires or is invalidated before admission, `run` must refresh it and +re-evaluate, or leave the candidate inconclusive without launching a sandbox. +The cache does not authorize a prompting event or model-bound content. The +[ADR 0133](0133-actor-attributed-data-security-boundary.md) gate retains its +fresh checks. The audit records the effective maximum age, lookup time +and age of role evidence used for a CEL decision, and whether it came from a +shared cache, using the bounded evidence format in +[Authorization Contract v2](../normative/authorization/v2/README.md). + +## Forge scope + +This applies to GitHub, GitLab, Forgejo, and Jira entity-source CEL. An +adapter can share a role result only if it can verify a stable actor identity, +role, and authorization scope and bind any available source revision; +otherwise the check must refresh authorization or remain inconclusive. +Existing event-only routing is unchanged on every source. + +## Consequences + +- Progressive checks and resident processes can share role results without + repeating provider calls for every CEL iteration or due check. +- An unobserved revocation can let a newly observed action select and launch a + sandbox until the cached grant expires; an unobserved grant can delay work + until expiry and the next bounded recheck. +- Event admission and model-bound content admission still perform fresh checks, + so each uses authorization evidence independent of the CEL cache. +- Cache implementations must enforce scoped keys, absolute expiry, + invalidation, and auditable evidence age even when processes share storage. diff --git a/docs/ADRs/0151-common-actor-admission-floor.md b/docs/ADRs/0151-common-actor-admission-floor.md new file mode 100644 index 0000000000..04a4fdbec8 --- /dev/null +++ b/docs/ADRs/0151-common-actor-admission-floor.md @@ -0,0 +1,122 @@ +--- +title: "151. Use a common human actor floor for CEL and model admission" +status: Accepted +relates_to: + - agent-architecture + - security-threat-model +topics: + - authorization + - cel + - data-security +--- + +# 151. Use a common human actor floor for CEL and model admission + +Date: 2026-10-23 + +## Status + +Accepted + +This decision partially supersedes the human permission thresholds in +[ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md), +[ADR 0098](0098-entity-first-harness-evaluation.md), +[ADR 0133](0133-actor-attributed-data-security-boundary.md), and +[ADR 0141](0141-deterministic-filtered-entity-context-staging.md) for the +target CEL and model-bound paths. Their other authorization, freshness, and +filtering requirements remain. + +## Context + +[ADR 0061](0061-harness-cel-dispatch.md) puts a platform authorization gate +before harness CEL. The existing GitHub workflow assigns `triage` or `write` +to its stage-guarded routes, with an ungated lifecycle retro-close route +([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L305-L420)). +An arbitrary CEL harness has no required stage name. The current Go gate uses +`write` for ordinary events +([`IsAuthorized` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/harnessdispatch/auth.go#L38-L68)) +before harness matching. An OWNERS upgrade used by that gate is not passed to +CEL +([`Dispatch` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/harnessdispatch/core.go#L48-L85)). + +[ADR 0098](0098-entity-first-harness-evaluation.md) and +[ADR 0133](0133-actor-attributed-data-security-boundary.md) carried a selected +harness's observation or mutation threshold into entity-fact and model-input +admission. That makes a harness category part of the platform security gate +even though CEL now expresses harness-specific selection. + +## Options + +Keep stage-derived thresholds, requiring a mapping for every CEL harness; use +`write` for every harness, excluding existing `triage` observation use; or set +one verified platform floor and let each harness express stricter selection in +CEL. + +## Decision + +For an ordinary human actor, Fullsend requires a verified effective normalized +role of **`triage` or higher** to admit a prompting event, an actor-originated +entity fact that could make CEL actionable, or an actor-attributed source +record into Fullsend-controlled model input. The floor is independent of the +selected harness, its configured agent identity, and its token capabilities. +The effective role comes from the source provider or a trusted configured +permission source such as OWNERS; Fullsend makes that verified effective role +available to CEL through a versioned input contract. A harness CEL predicate +may require `write` or narrower actor, target, or action conditions. It cannot +admit an actor or fact that fails the platform floor. +Raw state used only to conservatively defer eligibility under +[ADR 0147](0147-evaluate-entity-cel-over-selectively-acquired-data.md) is not +admitted as actor authority. + +A proven below-floor event is denied; a proven below-floor entity fact is +excluded from the authorized CEL view; and a proven below-floor model record is +redacted. Missing or unverifiable attribution or authority fails closed. A +potentially decision-changing entity fact with unresolved authority cannot +prove a false or empty CEL result. Event admission and each model-bound +checkpoint use fresh authority. Only +[ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md)'s bounded +entity-CEL cache may reuse a provider-verified role; it must never cache a +harness-specific authorization decision. Trusted Fullsend provenance permits +an eventless check but does not authorize the actor-originated facts it reads. + +[ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md)'s +provider-verified registered-bot roles and exact verified label-transition +grant remain separate from the human floor. The label grant covers only its +accepted transition and proven projection, not unrelated history or model +content. The existing ungated GitHub retro-close workflow remains a legacy +compatibility path; it supplies no general exception for CEL-routed harnesses. + +The common floor also applies when Fullsend controls snapshot assembly or a +later retrieval result for the model, under ADR 0133's filtering, delimitation, +and fresh exposure checks. A trigger's CEL result is not admission authority +for a separate model record. This decision does not extend the guarantee to +model-initiated direct source-system calls outside Fullsend's control. +[Entity-context-snapshot v1](../normative/entity-context-snapshot/v1/README.md) +retains its historical harness-derived threshold; the changed record-admission +meaning requires a v2 snapshot contract before migration. The +[Authorization Contract v2](../normative/authorization/v2/README.md) specifies +the common floor and its gate outcomes. + +## Forge scope + +The floor applies to GitHub, GitLab, and Jira through their verified normalized +role mappings. On Jira, Developer and Administrator satisfy `triage` because +its mapping has no separate triage level. Forgejo is a target, but its adapter +must establish a verified effective role before admitting a human actor; an +unsupported or unverifiable mapping fails closed. Source-specific bot and +label grants require their own provider evidence. + +## Consequences + +- Legacy stage guards and the current Go `write` gate remain in effect until + migration; lowering the Go gate requires CEL-visible effective roles and + verified stronger CEL predicates for first-party mutation harnesses. +- A `triage` actor can select a write-capable harness if its CEL predicate has + no stronger role condition; the harness keeps its separately configured + capabilities. +- A `triage`-authored record can become model guidance for a write-capable + harness even when the prompting actor's CEL predicate requires `write`; + per-record filtering and fixed agent capabilities remain required. +- The versioned event, entity, and snapshot contracts must carry verified + effective roles and the common floor before implementations claim this + target behavior. diff --git a/docs/architecture.md b/docs/architecture.md index 41f870fad4..035a8c666c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -422,15 +422,19 @@ The existing design principle is that [the repo is the coordinator](problems/age `conversation.Client` — not a separate always-on chat bot and not an extension of `forge.Client` ([ADR 0086](ADRs/0086-conversation-surface-for-agent-participation.md)). -- Event-backed dispatch authorization: event-triggered paths authorize the prompting - actor before dispatch. This includes schedule/manual dispatch represented as - a `NormalizedEvent`, whose actor is the configured service identity. GitHub - paths check the acting user's collaborator permission via the repository API - (`write` or above for mutation commands; `triage` or above for observation - stages); a repo that enables the `owners_file` authorization provider also - grants these roles to its Prow `OWNERS` approvers and reviewers. Non-GitHub - event paths map source-system roles to dispatch authorization roles (`read`, - `write`, `admin`) using source-native role resolution, with no cross-system +- Event-backed dispatch authorization: event-triggered paths authorize the + prompting actor before dispatch. This includes schedule/manual dispatch + represented as a `NormalizedEvent`, whose actor is the configured service + identity. The target CEL path requires a verified effective normalized role + of `triage` or higher for an ordinary human actor, independent of the + selected harness and its token capabilities. The effective role comes from + the source provider or a trusted configured permission source such as + `OWNERS`; harness CEL may require `write` or narrower actor, target, or action + conditions. Current GitHub bash guards still use `triage` for observation + stages and `write` for mutation stages, except for its ungated retro close + route; the Go dispatch path still requires `write` for ordinary events before + matching harnesses. Non-GitHub event paths map source-native roles to + normalized roles without cross-system identity verification. Bot actors are migrating to provider-backed exact role resolution: adapters classify actors from source-native metadata; recognized bots receive a canonical `actor.bot_role` such as `review`, and bot actors retain @@ -443,38 +447,67 @@ The existing design principle is that [the repo is the coordinator](problems/age time of ADR 0107, GitHub is the only production implementation. CEL may further restrict recognized bot roles but cannot authorize an unknown bot on non-label paths ([ADR 0107](ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md); - [Authorization Contract v1](normative/authorization/v1/); - [ADR 0054](ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md)). -- Data security boundary (target state): each source-system record is admitted - only when its actor attribution and current authorization meet the selected - harness threshold, regardless of whether it arrives through an event or a - proactive API read; unrecognized or unauthorized content is redacted. + [Authorization Contract v1](normative/authorization/v1/) for current dispatch; + [Authorization Contract v2](normative/authorization/v2/) for target CEL; + [ADR 0054](ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md); + [ADR 0151](ADRs/0151-common-actor-admission-floor.md)). +- Data security boundary (target state): each source-system record that + Fullsend controls is admitted to model input only after its exact current + revision's actor and current authorization are verified. An ordinary human + actor must have an effective normalized role of `triage` or higher regardless + of the selected harness; registered bots use a separate provider-backed + exact-role check. Authorization is refreshed at model-bound checkpoints, and + a prompting event's CEL result does not authorize separate records. + Unrecognized, unauthorized, or unattributed content is redacted. Host-side filtering removes hidden characters, redacts sensitive data, scans for prompt injection, and applies size limits before filtered, provenance-labelled content reaches the model. This ADR does not govern model-initiated direct source-system calls; future ADRs may encourage use of platform-originated checked data or add filtering for model-originated - retrievals ([ADR 0133](ADRs/0133-actor-attributed-data-security-boundary.md)). + retrievals ([ADR 0133](ADRs/0133-actor-attributed-data-security-boundary.md), + partially superseded by + [ADR 0151](ADRs/0151-common-actor-admission-floor.md)). - Fullsend-originated entity evaluation (target state): `fullsend poll` enumerates candidates, while a bound `fullsend run` may recheck only its canonical entity with `event == null`. Both require verified, non-user-assertable Fullsend invocation provenance and effective platform eligibility; the actor of an earlier event does not authorize an eventless - cycle. Before each candidate harness's CEL predicate, the platform - fail-closed enumerates a closed superset of action-indicating entity - elements, resolves each actor's current permission, and removes elements - below that harness's observation or mutation threshold. Later input-selection - and injection filtering are defense in depth for prompt construction. - Entity-first execution remains disabled until its versioned normalized-entity - contract exists. Every run uses the harness's configured identity + cycle. The platform classifies action-indicating categories, but acquires + only entity data that can affect each harness's CEL predicate. The target + CEL view admits actor-originated facts that could make the predicate + actionable only after verifying their actors' effective roles; an ordinary + human needs `triage` or higher, + while a harness may require stronger conditions in CEL. A below-floor fact + is excluded, and unresolved authority for a potentially decisive fact cannot + prove a false or empty result. Raw service-clock state used only to defer + eligibility may be evaluated without unrelated history. With an explicit + versioned platform age policy, a host-owned cache may share + provider-verified actor roles, but not harness-specific authorization + decisions, across checks and `poll` and bound `run` processes for no more + than five minutes from the authoritative lookup's start. Without that policy, + cross-check reuse is disabled. A cache-dependent false CEL result must be + rechecked after expiry or known invalidation within a bounded reconciliation + interval. Event admission and model-bound content checks retain separate + fresh gates. + Partial data yields a definitive result only with proven coverage; otherwise + `poll` or bound `run` fetches more relevant data or leaves the check + unresolved, without launching a sandbox. Later input selection and injection + filtering govern prompt construction. Entity-first execution remains + disabled until the versioned normalized-entity contract defines partial + data and coverage. Every run uses the harness's configured identity ([ADR 0098](ADRs/0098-entity-first-harness-evaluation.md), - [ADR 0144](ADRs/0144-reuse-poll-and-entity-bound-run-processes.md)). + [ADR 0144](ADRs/0144-reuse-poll-and-entity-bound-run-processes.md), + [ADR 0147](ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md), + [ADR 0148](ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md), + [ADR 0151](ADRs/0151-common-actor-admission-floor.md), + [Authorization Contract v2](normative/authorization/v2/)). **Open questions:** -- What normative entity-history, query-planning, and handled-state contract - can support entity-first harness evaluation without unbounded provider reads - ([ADR 0098](ADRs/0098-entity-first-harness-evaluation.md))? +- What field-level normalized-entity contract and provider query plans can + prove partial-history coverage and represent handled state? Selective + acquisition and its authorization rules are decided in + [ADR 0147](ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md). - Is GitHub's event system sufficient for forge-native duplicate protection, or do we need additional coordination beyond label/state conventions and agent idempotency? (Jira polling per ADR 0063 uses entity-property locks and runner @@ -538,10 +571,15 @@ Observability is a cross-cutting concern that touches every other component. Eac - Event-driven stage dispatch remains traceable end-to-end in the GitHub Actions UI by using synchronous `workflow_call` dispatch (see [ADR 0041](ADRs/0041-synchronous-workflow-call-event-dispatch.md)). - Scheduled entity-discovery runs are attributable to the verified Fullsend invocation identity, target repository, effective policy, harness revision, - and resolved entity; retained action-indicating elements preserve their actor - provenance. State-only predicates trace to the configured service identity - and versioned policy/harness configuration - ([ADR 0098](ADRs/0098-entity-first-harness-evaluation.md)). + and resolved entity. Their CEL checks record decision and coverage evidence; + identifiable positive witnesses retain actor provenance, while collection + results use bounded summaries rather than a full actor-history roster. + State-only predicates trace to the configured service identity and versioned + policy/harness configuration. When a shared actor-role result contributes to + CEL, the audit records its lookup time, age, and effective maximum age + ([ADR 0098](ADRs/0098-entity-first-harness-evaluation.md), + [ADR 0147](ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md), + [ADR 0148](ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md)). - Distributed tracing: framework-native OpenTelemetry instrumentation with zero-configuration baseline. Every run produces `run-telemetry.jsonl` locally; optional live OTLP export to any compatible backend. W3C trace context propagation links multi-agent pipelines into unified traces. OTEL GenAI semantic conventions enable LLM-aware backends ([ADR 0050](ADRs/0050-distributed-tracing-instrumentation.md)). - Eval measurements: the concept of scoring traces ([fail-open](glossary.md#fail-open)). [OTEL primary facts](glossary.md#otel-primary-facts) stay on the run trace (`run-telemetry.jsonl`); [OTEL derived products](glossary.md#otel-derived-products) are the scores (`eval-measurements.jsonl`) ([ADR 0087](ADRs/0087-eval-measurements-online-trace-scoring.md)). See [Eval Measurements](guides/infrastructure/eval-measurements.md). When `OTEL_EXPORTER_OTLP_*` is set, scores also export as `gen_ai.evaluation.result` span events on the same TraceID (same OTLP path as agent traces; fail-open). diff --git a/docs/normative/authorization/v1/README.md b/docs/normative/authorization/v1/README.md index a602c5718f..f6fb8c7d2a 100644 --- a/docs/normative/authorization/v1/README.md +++ b/docs/normative/authorization/v1/README.md @@ -2,7 +2,7 @@ Normative rules governing which actors may trigger agent dispatch. -This document is the single living contract for authorization policy. +This document records the v1 contract for authorization policy. The historical decision and rationale are recorded in [ADR 0054](../../../ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md). The [NormalizedEvent v1](../../normalized-event/v1/) specification defines the @@ -10,6 +10,16 @@ The [NormalizedEvent v1](../../normalized-event/v1/) specification defines the consumed by this contract. Bot identity and role resolution are specified by [ADR 0107](../../../ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md). +> **Version note:** [Authorization Contract v2](../v2/README.md), adopted by +> [ADR 0147](../../../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md), +> supersedes v1's future full-history entity-evaluation and audit requirements. +> [ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) +> permits bounded actor-role reuse for entity-source CEL in v2. +> [ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) sets a common +> human actor floor for target CEL and Fullsend-controlled model admission. +> Existing event-backed dispatch continues to use v1 until migrated; the v1 +> requirements below remain the record of this version's contract. + > **ADR 0107 target contract — partially implemented:** The bot identity > fields, resolver outcomes, and bot-specific fail-closed rows below describe > the target behavior. The building blocks exist: the `actor.bot_role` and diff --git a/docs/normative/authorization/v2/README.md b/docs/normative/authorization/v2/README.md new file mode 100644 index 0000000000..361b5e9bc6 --- /dev/null +++ b/docs/normative/authorization/v2/README.md @@ -0,0 +1,770 @@ +# Authorization Contract v2 + +Normative rules for event actors, entity CEL facts, and model-bound records. + +This version applies a verified `triage`-or-higher human floor to +ordinary event admission, actor-originated entity facts needed for actionable +CEL results, and Fullsend-controlled model-bound records. Harness CEL may +impose stronger role conditions. +[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) establishes this +common floor while preserving separate bot and verified-label grants and fresh +model-bound checkpoints. +This version also adopts selective entity acquisition and decision-focused +audit evidence for the future entity-first path under +[ADR 0147](../../../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md), +with bounded CEL actor-verdict reuse under +[ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md). +Existing dispatch continues to use [v1](../v1/README.md) until migrated. +The historical decision and rationale are recorded in +[ADR 0054](../../../ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md). +The [NormalizedEvent v1](../../normalized-event/v1/) specification defines the +`actor.role`, `actor.kind`, `actor.role_verified`, and `actor.bot_role` fields +consumed by this contract. Bot identity and role resolution are specified by +[ADR 0107](../../../ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md). + +> **ADR 0107 target contract — not yet implemented:** The bot identity fields, +> resolver outcomes, and bot-specific fail-closed rows below describe the +> behavior to be implemented by the adapters and dispatch path. Until that +> migration lands, existing compatibility behavior remains authoritative. + +## Role ordering + +Fullsend uses a forge-neutral role hierarchy. Roles are listed from most +to least privileged: + +``` +admin > maintain > write > triage > read > none > external +``` + +| Role | Meaning | +|------|---------| +| `admin` | Full repository control | +| `maintain` | Repository settings without destructive admin | +| `write` | Push, label, comment, merge | +| `triage` | Label and moderate without push access | +| `read` | Read-only collaborator | +| `none` | Authenticated user without explicit repository permission | +| `external` | Actor outside the repository or project (currently Jira-only; GitHub maps non-collaborators to `read` on public repositories or `none`; GitLab maps them to `none`) | + +### Forge-native permission mapping + +| Forge | Native level | Fullsend role | +|-------|-------------|---------------| +| **GitHub** | `admin` | `admin` | +| | `maintain` | `maintain` | +| | `write` | `write` | +| | `triage` | `triage` | +| | `read` | `read` | +| | _(no collaborator entry)_ | `none` | +| | _(fork/non-collaborator)_ | `read` (public repository) or `none` | +| **GitLab** | Owner | `admin` | +| | Maintainer | `maintain` | +| | Developer | `write` | +| | Reporter | `triage` | +| | Guest | `read` | +| **Jira** | Administrators | `admin` | +| | Developers | `write` | +| | _(other named role)_ | `read` | +| | _(no project membership)_ | `external` | + +On GitHub the mapping source is the collaborator permission API +(`GET /repos/{owner}/{repo}/collaborators/{username}/permission`), which +returns the user's **effective** role including inherited org grants +regardless of membership visibility. A built-in `role_name` is used as is. +Custom repository roles are an organization-level GitHub Enterprise Cloud +feature, so most repositories only ever return built-in names; Fullsend +does not interpret a custom role's name or its fine-grained permissions. +A custom repository role resolves to the strongest base role set to `true` +in `user.permissions` (`admin`, `maintain`, `push` → `write`, `triage`, +`pull` → `read`), or `none` if no flag is set. Only when +`user.permissions` is absent or null does the legacy `permission` field +(`admin`, `write`, `read`) apply; anything else is `none`. Legacy `read` +stays `read`, because it cannot distinguish Read from Triage. Fork authors +and non-collaborators are mapped to `read` (public repositories) or `none`, never `external`. +The `external` role is currently produced only by the Jira adapter for +actors without project membership. The common human floor denies `read`, +`none`, and `external` alike. The `author_association` field is +**not** used because it does not correctly reflect private org membership +(see [Excluded fields](#excluded-fields)). + +A GitHub repository that lists `owners_file` under `authorization` in +`.fullsend/config.yaml` consults its repo-root Prow `OWNERS` file before the +collaborator API: + +| OWNERS list | Role granted | +|-------------|--------------| +| `approvers` | at least `write` | +| `reviewers` | at least `triage` | +| _(not listed)_ | none; the collaborator API decides | + +OWNERS can only raise a role, never lower one. An entry that names an +`OWNERS_ALIASES` key stands for that alias's members. A login equal to any alias +key never matches, and nested aliases are not expanded. The files are read from the base branch for PR-scoped events and +from the default branch otherwise, so a PR cannot add its author. See the +[`authorization` field](../../../reference/config-reference.md#authorization). + +On Jira the mapping source is the project's role membership roster for the +configured `--jira-project`, resolved once per poll cycle for event-backed +dispatch. Entity-source CEL may reuse a completed +provider-verified actor verdict across poll cycles and bound `run` checks only +under the bounded cache rules below; event admission does not use that cache. +An actor is matched by Jira account ID. Role names are matched +case-insensitively against the names above; unrecognized role names fall +through to `read`. Actors with no membership in the configured project — +or whose issue belongs to a different project — are mapped to `external` +(fail-closed). See the +[Jira integration guide](../../../guides/user/jira-integration.md) for +details on the name-based matching limitation. + +### Bot identity fields + +The adapter/provider MUST classify the verified actor using authoritative +source-system metadata before authorization. This may include a provider actor +name when that forge gives it bot-specific semantics, such as GitHub's `[bot]` +logins; labels, review types, and arbitrary event-content strings are not bot +identity signals. For post-migration producers with `actor.kind: bot`, +`actor.role` MUST be `none`, and +`actor.role_verified` is true exactly when the provider completes the bot-role +lookup, including a successful no-match result; it is false when resolution +fails. For `actor.kind: human`, `actor.bot_role` MUST be absent or `null`, and +`actor.role` contains the forge permission role when `actor.role_verified` is +true. For non-label dispatch, only a non-null, provider-resolved +`actor.bot_role` can pass the bot gate. The human `triage` floor does not apply +to a recognized bot; platform authorization instead requires a valid +normalized event, an applicable source and target, and a transition supported +by the selected harness. CEL may further restrict routing but cannot create or +broaden bot identity authorization. + +For humans on ordinary non-label paths, `role_verified: false` makes +`actor.role` unusable as a forge-permission claim. It does not invalidate an +independently verified configured-source grant such as OWNERS for the same +verified actor and target. Fullsend denies the event if no verified source +establishes an effective role meeting the common floor. The versioned CEL +input MUST carry that effective role and its verification source without +reinterpreting v1 `actor.role_verified`. A missing `role_verified` on a trusted +pre-migration event is treated as legacy input and retains the current human +authorization behavior; new adapters MUST emit the field. Legacy status is +determined by the adapter implementation contract, not by guessing from this +field's absence. On the permanent label exception, `role_verified` is not an +authorization input: an accepted forge label mutation authorizes a human, and +a bot additionally requires positive provider bot classification. For bots, +omission means that bot-role lookup is not applicable, not that it failed. + +## Common human authorization floor + +For an ordinary human prompting event, Fullsend MUST resolve a fresh, verified +effective normalized role of at least `triage` before harness CEL runs. The +effective role comes from the source provider or a trusted configured +permission source such as OWNERS. The same floor applies independently to +actor-originated entity facts whose authority is needed to make CEL actionable +or prove an actionable absence or aggregate, using a live or eligible bounded +verdict under the rules below. Raw state used only for conservative deferral +follows the causal classification below and does not require authorizing every +historical updater. A Fullsend-controlled model-bound record has its own fresh +check against the floor at the required exposure checkpoints. +`read`, `none`, `external`, and unresolved human roles do not pass. Event +admission does not authorize another actor's fact or model-bound record. +Trusted Fullsend invocation provenance, rather than a human event actor, +authorizes eventless entity discovery; actor-originated facts that serve as +authority still pass their own floor. + +This floor does not depend on a legacy workflow stage, harness `role`, token +`privilege_levels`, or selected harness. The platform MUST expose to CEL the +same verified effective human role it used for admission, including any valid +configured OWNERS upgrade. Harness CEL MAY require `write` or a stronger role +and MAY add other restrictions, but it cannot admit an actor or fact rejected +by the platform floor. A false CEL predicate is a harness nonmatch, not a +platform authorization denial. + +### Current dispatch compatibility + +The existing GitHub bash dispatcher retains its route-specific human guards +and bot compatibility behavior, as recorded in +[Authorization v1](../v1/README.md). Those routes do not classify CEL +harnesses or set their role requirements. After provider-backed +`actor.bot_role` recognition, bots use the separate bot gate above. + +> **Current Go implementation:** `IsAuthorized()` in `harnessdispatch` still +> applies `write+` to ordinary events before `MatchHarnesses()`, including +> poll-based dispatch. This is current compatibility behavior, not the v2 +> common floor. Before lowering that gate, migration must make the +> OWNERS-adjusted effective role visible in a versioned CEL input and add +> intended stronger role conditions to first-party mutation harness +> predicates. Today the Go path applies an OWNERS upgrade to its platform +> check but passes the original event role to CEL. + +## Fail-closed behavior + +The ordinary human role gate is **fail-closed**: when the effective role cannot +be determined, that path is denied. The verified label-transition grant and +registered-bot gate below use their own provider evidence. + +The entity-evaluation rows below specify the future ADR 0098 path as revised by +[ADR 0147](../../../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md) +and [ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) +and do not describe behavior currently implemented by `fullsend dispatch` or +`fullsend poll`. + +The human role-lookup rows below apply to ordinary non-label paths. The +bot-specific rows are ADR 0107 target behavior; legacy events remain subject +to the compatibility rules until implementation migration is complete. + +| Condition | Outcome | +|-----------|---------| +| Collaborator API returns a custom `role_name` with no effective permission signal | Forge role maps to `none`; a separate verified OWNERS grant may satisfy the floor, otherwise deny | +| Collaborator API returns an error or times out | Forge role is unusable; a separate verified OWNERS grant may satisfy the floor, otherwise deny | +| Bot-role lookup returns no registered identity on a non-label path | `actor.role` remains `none`; `actor.role_verified` is true; `actor.bot_role` is absent; denied | +| Bot-role lookup fails or is unverifiable on a non-label path | `actor.role` remains `none`; `actor.role_verified` is false; `actor.bot_role` is absent; denied, with the failure retained in resolver/audit diagnostics | +| Collaborator API response is not valid JSON or does not match the expected shape | Forge role is unusable; a separate verified OWNERS grant may satisfy the floor, otherwise deny | +| `actor.role` is empty or missing | Event fails `NormalizedEvent` validation; never reaches dispatch | +| `actor.role_verified` is false for a human on an ordinary non-label path | Ignore `actor.role`; require a separate verified configured-source grant meeting the floor, otherwise deny | +| Legacy bot event has an `actor.role` other than `none` | Valid in the v1 compatibility schema; authorization follows current compatibility behavior during migration and is not an ADR 0107 bot-role authorization result | +| `actor.role_verified` is false but `actor.bot_role` is non-null for a bot | Event fails `NormalizedEvent` validation; never reaches dispatch | +| `actor.bot_role` is non-null for a human | Event fails `NormalizedEvent` validation; never reaches dispatch | +| Username is empty | Denied | +| `OWNERS` is missing or malformed, or `OWNERS_ALIASES` is present but malformed (`owners_file` enabled) | OWNERS check skipped; the collaborator API decides | +| Username contains characters outside `[A-Za-z0-9-]` (`owners_file` enabled) | OWNERS check skipped; the collaborator API decides | +| Fullsend invocation provenance for poll discovery or a bound run's eventless check is missing or unverifiable | That eventless evaluation is denied | +| Harness entity sources are missing or malformed | That harness is skipped for scheduled evaluation | +| Effective platform eligibility policy is missing, malformed, or unverifiable | Scheduled evaluations governed by that policy are denied | +| Effective platform eligibility policy uses a wildcard without explicit platform-level justification | Scheduled evaluations governed by that policy are denied | +| A required entity field or history scope is not yet loaded, or pagination/coverage is incomplete | Its value is unknown, never false or empty; read more or defer to bound `run`; no sandbox starts from an unresolved result | +| A poll candidate remains inconclusive, cannot be handed off, or its bound run fails before completion or safe deferral | Retain a durable retry path or prove source rediscovery after checkpoint advancement; no sandbox starts from an unresolved decision | +| A required entity source is unsupported, unavailable, fails, or cannot establish complete coverage within allowed bounds | Evaluation fails closed; no sandbox starts and the failure is not recorded as a false CEL result | +| A conservative dependency or provider query cannot be shown to include every authorized fact that could change a definitive CEL result | Expand the plan or leave the result unknown; if it cannot be resolved, evaluation fails closed | +| Current attribution or a live or eligible cached actor-role verdict for a fact requiring the actor gate is missing or unverifiable | The fact cannot be admitted as authority; if it could affect an actionable result, evaluation remains unknown or fails closed and cannot start a sandbox | +| A versioned platform policy with an explicit maximum age no greater than five minutes for cross-check CEL actor-verdict reuse is missing or unverifiable | Reuse is disabled; obtain a live authoritative role verdict or leave dependent CEL unknown, with no sandbox on unknown | +| A needed CEL actor-verdict cache entry is expired, invalidated, or scoped to another source, actor, repository, policy, or revision | Refresh from the authoritative actor-role source; if that cannot complete, the dependent result remains unknown and cannot start a sandbox | +| The actor of a fact requiring the gate is human and below the common `triage` floor, or is a bot with no recognized role | The fact is excluded from the authorized CEL view and cannot trigger execution | +| Versioned normalized-entity contract is missing or incomplete | Entity-first execution denied | + +## Exceptions + +Only the verified label-added transition below bypasses the ordinary human +`triage` floor in v2. Registered-bot roles use a separate gate. The legacy +compatibility paths described below do not create additional v2 grants or +authorize unrelated entity facts or model-bound records. + +### Label application + +**Current compatibility behavior:** GitHub authorizes an added-label event +without applying the ordinary `actor.role` threshold. This existing behavior +preserves bot-to-bot handoffs such as adding `ready-to-code` after triage +completes, including handoffs from provider bots that are not Fullsend- +registered. + +**ADR 0107 target behavior:** When +`transition.kind` is `label_changed` and `label.action` is `added`, GitHub +authorizes the event regardless of `actor.role` once the adapter has +established an accepted forge label mutation and authoritative actor-to- +transition provenance. This is a separate platform authorization grant, not an +application of the ordinary human floor. At the time of this ADR, GitHub +is the only implementation; another adapter MUST provide equivalent +forge-authoritative evidence before enabling the same grant, and absent or +unverifiable evidence denies the event. For a bot actor, the adapter MUST +positively classify it using provider-controlled metadata, but `actor.bot_role` +lookup is not required. The platform gate MUST NOT inspect the label name or +maintain an agent-role label allowlist; harness/CEL routing owns that mapping +and may further narrow the dispatch. + +### Bot-submitted reviews (GitHub) + +**Current compatibility behavior:** Until the resolver is implemented, +`fullsend dispatch` continues to authorize a GitHub `review_submitted` event +from a bot without requiring a collaborator permission or `actor.bot_role`. +This existing exception is not evidence that the bot identity was resolved. + +**ADR 0107 target behavior:** After the resolver is implemented, a GitHub +review event is authorized only when the provider classifies the actor as a +bot and resolves its exact registered `actor.bot_role`; `actor.role` remains +`none`. The downstream harness CEL trigger may further constrain which bot +role and review state are accepted. + +### Legacy lifecycle close (pull\_request\_target.closed) + +**Current bash compatibility behavior:** The GitHub bash dispatcher routes +`pull_request_target.closed` to retro without a separate collaborator-role +check, so any closer may trigger it. This is not a read-only capability: +retro's token can write issues and pull requests, and its post-script can +file issues, comment, and apply labels. The Go `IsAuthorized()` path has no +close-event exception and applies its current `write+` gate. + +The ungated bash route is not a general v2 grant for CEL-based dispatch or +entity facts. Under this contract, an ordinary human close-event actor must +meet the common `triage` floor unless a separate platform exception is +adopted. Harness CEL may add stricter conditions. The legacy `/fs-retro` +slash command retains its bash `write` guard. + +### Schedule and manual dispatch + +When `source.system` is `schedule` or `manual`, the actor is the configured +operator or service identity (for example, a GitHub App bot or workflow +`GITHUB_ACTOR`). Adapters MUST classify that identity from authoritative +provider metadata. Human identities use verified forge permissions and the +common human floor; bot identities use provider-backed `actor.bot_role` +resolution and retain `actor.role` as `none`. An unrecognized or unresolved +bot identity is denied. + +**Current compatibility behavior:** Until provider-backed bot-role resolution +is wired into the adapters and dispatch path, adapters set `actor.role` to the +service identity's effective repository permission (typically `write`), so +the standard permission gate applies. + +> **Target contract, not yet implemented:** Existing schedule/manual +> compatibility handling remains authoritative until provider-backed bot-role +> resolution is wired into the adapters and dispatch path. + +### Entity-source CEL evaluation + +This future path was adopted by +[ADR 0098](../../../ADRs/0098-entity-first-harness-evaluation.md), clarified by +[ADR 0144](../../../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md), +and revised for selective acquisition and audit by +[ADR 0147](../../../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md), +with bounded cross-check actor-verdict reuse under +[ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md). +[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) supplies the +common human floor. +It applies to an entity-source harness's CEL predicate whether a verified +prompting event is present or `event == null`; legacy event-only dispatch is +unchanged. The entity-source path is not yet implemented by `fullsend dispatch`, +`fullsend poll`, or bound `fullsend run`. Entity-first execution MUST NOT be +enabled until the versioned normalized-entity contract defines CEL-eligible and +prompt-eligible fields and their coverage states. That contract is a platform +allowlist; a harness may request fewer fields but cannot expand it. + +With a prompting event, the event-actor authorization gate above still runs +before harness CEL; neither discovery nor an entity-source query replaces it. +The event actor authorizes that event, not other actor-originated entity facts. +The verified GitHub label-added exception authorizes CEL to use that exact +accepted label transition without the ordinary human floor. It +does not authorize other label applications, the entity's current label state +without transition provenance, or other records from the same actor. +Current label state may use that grant only when the adapter proves it is the +projection of the same accepted transition, with no intervening replacement. +For an eventless check, the following Fullsend-origin and platform-eligibility +gate applies instead. + +`fullsend poll` may enumerate candidates without synthesizing a +`NormalizedEvent` or event actor. A bound `fullsend run` may instead recheck +only its canonical entity with `event == null`, including after consuming an +initial event. Both paths require eligible entity sources and effective +platform policy permitting eventless evaluation. They are authorized only when +the caller has trusted Fullsend-controlled invocation provenance: a verified, +non-user-assertable platform execution identity bound to the invocation and its +target, such as an attested workflow/job identity or installation credential. +Neither the actor of an earlier event nor an authenticated wake peer supplies +this authority. A CLI flag, request header, or other caller-supplied claim is +insufficient. A caller that cannot establish that provenance MUST be denied. +Wildcard eligibility (`*` or `all`) requires the same explicit platform-level +justification as any other wildcard allowlist in this contract. + +Each entity-source evaluation's audit record MUST identify its verified +initiator (the event actor for an event-bearing check, or the trusted Fullsend +invocation identity for an eventless check), target repository, effective +policy, harness revision, canonical entity, acquisition-plan identity, and +decision outcome, including `UNKNOWN`, deferred, or denied outcomes. It MUST +record which source scopes and bounded queries were needed, their coverage and +completeness evidence, and the current attribution, live or eligible cached +verified role, and platform-gate outcome for individual actor-originated +records used as decisive witnesses. Complete negative or aggregate claims +require bounded query and source-coverage evidence bound to the effective +authorization policy, permission source, and check time or equivalent +authorization epoch. +Summaries MAY use counts and digests of admitted, excluded, and unresolved actor +checks; they do not require +an audit roster of every record and actor examined to establish completeness. +When an actor verdict is reused for CEL, the audit MUST record bounded evidence +of its authoritative source, lookup start time or age measured from that start, +the completed verdict, the maximum age allowed by the effective platform +policy, effective authorization policy and source revision, and whether a live, +local-cached, or shared-cached verdict was used. This may be aggregated for +collection-wide checks rather than listing every actor. +If a cached actor verdict contributes to a false CEL result, the audit MUST +also identify the bounded recheck or rediscovery guarantee, or show that the +candidate remains retryable. +Unrelated history is not fetched or listed solely for audit. The audit does not +retain raw rejected content. An eventless child cycle attributes initiation to +the Fullsend identity, never to an earlier event actor or historical entity +actor. + +Authorization of an event actor or Fullsend invocation origin does not +authorize other entity content. For each evaluated harness, Fullsend derives a +conservative acquisition plan from its CEL predicate and the normalized-entity +contract. The platform retains a closed classification of action-indicating +categories; it need not fetch every category for every predicate. The plan +MUST cover every field, history range, or derived fact that could change the +predicate's result, including actor-originated issue or +change-proposal bodies, comments, reviews, and label applications or current +label state when used as action-indicating evidence. Counts, existence tests, +and other aggregates over actor-originated records have the same dependency. +The evaluator MAY defer planned reads and stop once partial evaluation yields +a definitive result. +A source field is actor-neutral for a particular CEL use only when an +actor-originated change cannot make the predicate newly actionable. For a +service-clock predicate, raw authoritative `updated_at` means time since any +forge update; it is not recomputed from actor-filtered history. Where the +provider guarantees that it only advances, `updated_at < moving_cutoff` can +become true as time passes. An update, including one by an unauthorized actor, +can defer that staleness run but cannot make it newly eligible. A harness that +needs time since the last authorized update must acquire and authorize the +relevant history. By contrast, `updated_at >= cutoff` can become true because +of an update and requires provenance and authorization for that causal +occurrence, or remains unknown. Raw `comments_count`, current labels, or +newest-comment metadata cannot enter the authorized CEL view if an unauthorized +record or change could affect the result. Fullsend MUST recompute such a fact +from admitted records, prove the relevant causal occurrence or platform +exception, or leave it unknown. Presenting an action signal as current state +never bypasses the actor gate. +A provider query MAY narrow reads only when it is proven to include every +authorized fact that could affect the result; otherwise Fullsend expands the +query or leaves the dependent result unknown. A provider aggregate may replace +individual reads only if it preserves the actor-filtered meaning under the +eligible CEL verdicts for the current check and proves the coverage needed for +that result. Unanalyzable dynamic access requires a conservative broader plan +or a fail-closed unresolved outcome. +Cached fields or history may satisfy a planned read only after their source +revision and query coverage are validated for the current check. Accepted +events and ordinary entity wakeups invalidate affected entity facts under +[ADR 0144](../../../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md). +They do not by themselves invalidate a separately scoped actor-verdict cache +entry; a trusted authorization change does. + +Fullsend distinguishes not requested or not loaded, partially loaded, +successfully empty, absent or inapplicable, unsupported, and failed data. +Unloaded or incomplete data MUST NOT masquerade as an empty collection or a +false condition. For every actor-originated fact whose authority is needed to +make CEL actionable or establish an actionable absence or aggregate under the +causal classification above, Fullsend MUST re-establish its current +source-revision actor and obtain an eligible verified authorization verdict +before admitting the fact into CEL: a human must meet the common +`triage` floor, using the effective role from all configured permission +sources. A bot needs a provider-backed exact registered role under +[ADR 0107](../../../ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md). +The verified effective role remains available to harness CEL, which may +require a stronger human role for a particular predicate. No harness stage +classification changes the platform floor. +Only the exact transition covered by the verified label-added event exception +may bypass the ordinary human floor or registered-bot-role check. It still +requires accepted transition provenance and positive provider bot +classification when the actor is a bot. The exception supplies authority for +that transition only, not for unrelated entity history. An unauthorized fact is +excluded from the authorized view. Missing or unverifiable attribution or +authorization of a fact needed to prove an actionable result remains +unresolved and cannot prove absence. Historical or inferred actor +relationships are insufficient; only the bounded provider-verified actor-role +cache defined below may replace a live actor-permission lookup. CEL may +further restrict the authorized view, but cannot create authority or replace +this platform gate. + +#### Bounded CEL actor-verdict cache + +This exception to a fresh actor-permission lookup for each entity check is +adopted by +[ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md). +For entity-source CEL only, Fullsend MAY reuse a completed, authoritative +human permission or exact registered bot-role verdict across entity checks and +harnesses, poll cycles, separate `poll` and bound `run` loops, and the bound +run's final CEL decision. The cached value MUST be the verified effective +role or verified absence, never a platform-floor boolean or harness-specific +CEL result. Every check reapplies the common floor and its harness CEL +conditions. Both positive and verified negative results +may be cached; errors, timeouts, unresolved lookups, caller claims, and +partially verified roles MUST NOT be cached. The key MUST bind the provider, +tenant, canonical repository or project, immutable actor ID, verified actor +kind, effective authorization policy and its revision or digest, and +permission source. When applicable, it also binds the selected ref and the +presence or absence and content or revision of both OWNERS and OWNERS_ALIASES, +or the bot-registry revision. A login or entity ID is not an actor cache key. +Where an authority does not expose a revision token, the authoritative +lookup's start time defines the +observed epoch; known changes to that source still invalidate its entries. + +Within-check memoization under +[ADR 0147](../../../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md) +avoids repeated lookups while the verdict remains eligible under an absolute +five-minute hard cap. Cross-check reuse is disabled until a versioned platform +policy defines and enforces an explicit maximum age no greater than five +minutes. The platform MAY choose a shorter age; repository or harness settings +MUST NOT widen the hard cap or the effective platform bound. Only a completed +verdict may enter the cache. Its absolute expiry is measured from the +authoritative lookup's start at the earlier of the hard cap and any shorter +platform bound. An entry expires at that fixed time even if it is read, handed +from `poll` to `run`, or retained by a shared host cache; no hit extends its +lifetime. An expired verdict must be refreshed before it can contribute to a +definitive CEL decision, including during one long progressive check. Known +role, membership, OWNERS, +OWNERS_ALIASES, bot-registry, or effective-policy changes MUST invalidate +affected entries without waiting for TTL expiry. An ordinary entity wakeup +invalidates affected entity facts, not an otherwise valid actor verdict, +unless it carries trusted evidence of an authorization change. Shared cache +readers MUST enforce expiry with a trusted clock or a conservative skew +allowance; uncertain age makes an entry unusable. An expired, invalidated, or +mismatched entry requires a new authoritative lookup. If that lookup cannot +complete, the dependent CEL result remains `UNKNOWN` or is denied +under the fail-closed rules above; the stale verdict is never used. A shared +host cache MUST remain inaccessible to the sandbox and agent. + +A false CEL result dependent on any cached actor verdict MUST cause a recheck +after that verdict expires or is invalidated, and no later than the first of +those events plus a bounded, platform-controlled discovery or reconciliation +interval, even when the entity has not changed. The recheck obtains a new +verdict and may be scheduled directly or guaranteed by source rediscovery. The +platform MUST define that interval and either retain a durable candidate +through checkpoint or watermark advancement or prove rediscovery after it. If +timely re-evaluation cannot be guaranteed, the cached verdict MUST NOT close +the candidate: Fullsend uses a +live verdict for a final false decision or keeps the candidate inconclusive +and durably retryable under a bounded retry schedule. A cached actor result +alone cannot permanently close the candidate. + +This deliberately accepts CEL actor-role evidence up to the platform +maximum age. A still-valid positive cache entry may admit a newly observed +actor-originated record after an unobserved revocation, and a negative entry +may exclude a newly promoted actor until expiry and the required bounded +recheck. A positive entry may likewise keep a negative +predicate false after an unobserved revocation. The bound run still checks the +current entity facts, source-revision actor, and coverage before its final CEL +decision; only the verified actor-role verdict may be reused within TTL. +The CEL cache MUST NOT satisfy event-actor admission or +[ADR 0133](../../../ADRs/0133-actor-attributed-data-security-boundary.md)'s +model-bound record admission and exposure checkpoints. Those gates continue to +resolve fresh authority under their separate rules. Fresh model-bound checks +may redact records or deny further execution, but they do not undo a sandbox +launch admitted using a positive CEL cache entry. The launch may already have +occurred after an unobserved revocation within the permitted age. + +Fullsend MAY evaluate the predicate over a partially materialized authorized +view. It may return a definitive `true` or `false` only when that result is the +same for every possible completion of still-unloaded inputs admitted under the +actor-verdict rules above and consistent with established source coverage. +This quantifier includes still-valid cached CEL verdicts within the bounded +platform age, even if actor permission changed without a known invalidation. +Coverage MUST account for pagination and concurrent source changes; a required +collection remains incomplete unless a stable view or sound reconciliation +establishes its relevant range. For example, an authorized witness may settle +an existence test as true; false or a negative condition requires complete +coverage of its relevant authorized search space. An `UNKNOWN` result requires +further relevant field or history reads and re-evaluation in `poll` or bound +`run`, or retention +as retryable inconclusive work. A provider failure, unsupported source, +unresolved authorization, or inability to prove completeness in a remaining +decision dependency within allowed bounds fails closed: it cannot be converted +to false, empty, or a sandbox run. + +`fullsend poll` MAY hand an unresolved candidate and its acquisition hints to +a bound `fullsend run` without claiming a CEL match. A definitive true result +in `poll` also selects only a candidate, not a sandbox launch. The bound run +MUST independently re-resolve current entity state and actor provenance, use a +live or eligible cached CEL actor verdict, and reach a definitive true result +before starting a sandbox. A definitive false result does not start one. Any +deciding verdict that expires or is invalidated before sandbox admission MUST +be refreshed and CEL re-evaluated; otherwise the decision remains inconclusive +and the sandbox does not start. Any handoff is provisional. Until the bound run +reports a definitive false decision with any cache-dependent recheck durably +arranged, completes actionable work, or safely defers it under +[ADR 0144](../../../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md), +discovery MUST retain a durable retry record or prove that its source query +will rediscover the candidate after advancing a checkpoint or watermark. +Scheduling a run, delivering a wakeup, or receiving a process-start receipt is +not completion. If the bound run fails or remains inconclusive, the candidate +MUST remain retryable and cannot be recorded as false, empty, or handled. + +Fullsend MUST omit or minimize unneeded untrusted fields where the normalized +entity contract permits. Further trust or injection filtering MAY run after CEL +routing and before the harness pre-script. Retained content remains untrusted +for dispatch and CEL evaluation throughout. +[ADR 0133](../../../ADRs/0133-actor-attributed-data-security-boundary.md) +defines the separate model-bound admission and filtering gate, as revised +for the human floor by +[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md): only filtered +content whose source record and actor pass the fresh gate below may be exposed +to the model under bounded harness scope. Any resulting agent run uses the +harness's configured identity and permissions. + +## Model-bound actor-attributed data admission + +The model-bound gate applies to every source-system record that Fullsend may +expose to a model, regardless of whether the record arrived in an event, was +found by polling or snapshotting, or was read through a proactive or +Fullsend-controlled API. Fullsend MUST establish the record's current actor +attribution through the source system and resolve that actor's current +authorization. A human MUST have a fresh, verified effective role of at least +`triage` at each required checkpoint. A bot MUST have fresh +provider-backed recognition of its exact registered `actor.bot_role` under +ADR 0107; its `actor.role: none` is not compared with the human floor. +Missing or unverifiable attribution, an unrecognized or unresolved bot +identity, and a human below the floor MUST redact the record; there is no +data-only fallback. The platform does not infer a stronger threshold from a +workflow stage or harness identity. Harness-specific conditions for selecting +the run belong in CEL; later model-bound record admission uses this floor and +ADR 0133 filtering. A label-event grant applies only to its exact verified +transition and does not admit unrelated content. + +Source-record attribution MAY come from a provider-verified event or be +resolved from the source system. Model-bound actor authorization MUST be +resolved from the current authoritative permission or registered-role source +under the effective policy after event or retrieval admission; it MAY be +co-fetched with a later record read or lazily resolved when first needed. A +resolved result MAY be cached only for the logical lifetime of the +containing event or entity structure and agent invocation, subject to the +fresh checkpoints below. Re-reading or re-fetching the data, +creating a new structure for retry or requeue, or terminating and re-invoking +the agent ends that lifetime and requires fresh resolution, even if the same +in-memory structure is reused. The cache lifetime is not extended by object +identity or by retaining the structure. + +Event-carried authorization evidence MAY support event admission and routing, +but MUST NOT satisfy model-bound checks. Event-triggered runs MUST resolve +record-actor authorization after event admission and before model admission, +again immediately before sandbox initialization, and again immediately before +first model exposure. If sandbox initialization and first exposure are +contiguous, one fresh check MAY serve both. Non-event retrieval paths MUST +perform the equivalent checks after retrieval admission. A +Fullsend-controlled capability invoked after sandbox initialization MUST +resolve authorization immediately before releasing each result to the model. +That release check is the mid-run equivalent of the sandbox checkpoints. + +A cache entry MUST NOT cross any checkpoint. Implementations MAY coalesce +contiguous checks and MAY batch or cache lookups for multiple records from the +same actor, provided the cache remains within this logical lifetime. Failure, +unavailability, or loss of authorization at any checkpoint MUST redact the +record and, if no authorized records remain, deny the run. Revocation after +first exposure cannot retract content already present in the model context, +but every later retrieval result requires its own release check. + +## Excluded fields + +The following fields are **not** authorization evidence and must not be +used for dispatch gating: + +| Field | Why excluded | +|-------|-------------| +| `author_association` | Does not reflect private org membership; an org admin with private membership gets `CONTRIBUTOR` instead of `MEMBER` ([github/gh-aw-mcpg#2862](https://github.com/github/gh-aw-mcpg/issues/2862)). Also reflects contribution history, not current authority. | +| Contribution history | Past contributions do not confer repository permissions. A former maintainer's contributions cannot substitute for a provider-verified role verdict; a valid CEL cache entry may still reflect a role from before revocation within its bounded age. | +| `actor.is_entity_author` | Being the author of an issue or PR does not grant repository permissions. This field supports routing decisions in CEL triggers, not authorization. | + +**Principle:** relationship and contribution-history fields are not +evidence of current authority. Event-backed authorization must be derived from +the source provider's verified permission model or a trusted configured +permission source at event time and meet the common human floor, not from +cached or inferred relationships. +Fullsend-originated eventless evaluation must instead be authorized from +trusted Fullsend-controlled invocation provenance for poll enumeration or +bound rechecks. Actor-originated entity facts needed for an actionable CEL +result are separately gated by current source-revision attribution and a live +or eligible bounded role verdict against the same floor. Deferral-only raw +state follows the causal classification above. +Model-bound records receive separate fresh checks. Historical actors and +relationship fields must not serve as authorization evidence. + +## Enforcement point + +The common human floor is a **platform-level gate** that CEL cannot override. +Event-backed dispatch checks the normalized event actor's fresh verified +effective role before routing, subject only to the specific bot and transition +grants above. Fullsend-originated eventless evaluation checks trusted +invocation provenance and platform eligibility before resolving the entity. An +entity-source predicate may then be evaluated progressively. An actor-originated +fact that could make CEL actionable, or whose actor-filtered coverage is needed +to prove an actionable absence or aggregate, passes its own floor check using +live or eligible bounded role evidence. Its current source-revision +attribution and coverage are checked separately. Deferral-only raw state +follows the causal classification above. Not-yet-loaded facts remain unknown +rather than being treated as unauthorized, absent, or empty. + +``` +Forge event + --> NormalizedEvent (adapter) + --> Event-actor floor or narrow grant <-- enforced here + --> Event-only CEL routing or entity-source resolution + --> Dependency-driven acquisition and actor gate where required + --> CEL true / false / UNKNOWN + --> Execution only on definitive true + +Fullsend poll discovery / bound run eventless recheck + --> Trusted-origin authorization gate <-- enforced here + --> Enumerate and resolve candidates (poll) / resolve canonical entity (run) + --> Evaluate each candidate harness (poll) or the bound harness (run): + --> Dependency-driven acquisition and actor gate where required + --> CEL true / false / UNKNOWN (event is null) + --> Unknown may continue in bound run after current entity re-resolution + --> Further trust/injection filtering and execution only on true +``` + +### CEL triggers: harness-specific conditions + +Harness `trigger` expressions select runs and may require stronger human roles +or narrower bot roles, labels, and entity states. Such harness-specific +conditions belong in CEL; they never weaken the platform floor or create a +bot or transition grant. A CEL nonmatch is not a platform denial. On the +event-backed path, an event that fails the platform gate never reaches CEL. + +The gate precedes harness selection: `IsAuthorized()` currently runs before +`MatchHarnesses()` in the dispatch core. On the Fullsend-originated eventless +path, the trusted-origin gate runs before poll enumeration or bound-entity +resolution and CEL evaluation. For each eligible entity-source harness, the +platform admits actor-originated facts needed for an actionable CEL result +only after current source-revision attribution and a live or eligible bounded +role verdict meeting the common floor. CEL receives that verified effective +role and may apply stronger conditions. The verified label-event grant +authorizes only +its exact transition, as described above. Eventless checks use +`event == null`. Legacy event-only harness routing does not acquire entity +history under this section. + +### Per-repo configurability + +The common floor and the narrow bot and transition grants are platform-level +security boundaries. Individual repositories cannot disable or lower them. +Per-repo harness registration and CEL triggers operate within those +boundaries: a repository may disable a harness or require stronger conditions, +but cannot make it available to an actor rejected by the platform. + +A repository can add permission sources through the `authorization` +field (today only `owners_file`). These sources may raise the verified +effective role used by the platform and visible to CEL; they do not change +the floor or bypass the gate. The current bash +`has_repo_permission` helper and Go `IsAuthorized` check retain their +compatibility behavior until migrated. + +## Versioning + +This is the v2 normative contract under +[ADR 0015](../../../ADRs/0015-normative-specifications-directory.md). +[ADR 0147](../../../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md) +supersedes v1's future full-history entity-evaluation and audit requirements; +[ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) +adds bounded cross-check reuse of provider-verified actor-role verdicts for +entity-source CEL only. +[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) sets the common +human floor and moves stronger harness-specific role conditions into CEL. +This changes v1's stage-specific human authorization rules when an +implementation migrates to v2, while preserving the separate fresh +model-bound release checkpoints. Migration also requires versioned event and +entity CEL inputs and an entity-context-snapshot v2 contract for the changed +model-record admission meaning. The +[v1 snapshot](../../entity-context-snapshot/v1/README.md) retains its +historical stage-derived rule until that migration. Authorization v1 remains +authoritative for existing dispatch during migration, including its bash +thresholds and Go `write+` behavior. +Breaking changes to v2 require `docs/normative/authorization/v3/`. + +**ADR 0107 migration exception:** The migration from legacy bot authorization +exceptions to provider-backed bot identity is also permitted within v2. It is a +policy tightening, not a new supported actor population: existing +compatibility behavior remains authoritative until an adapter implementation is +updated; once updated, registered bots use `actor.bot_role` and unregistered +non-label bots are denied. The adapter implementation itself is the migration +boundary; no per-event mode marker or separate deprecation window is required. +An updated adapter MUST enforce the target behavior and MUST NOT silently fall +back to legacy bot authorization when its resolver fails. The normalized-event +fields used to carry this distinction are additive, and the permanent +label-added exception is preserved. This exception does not alter the general +v3 rule for unrelated authorization changes. + +| Change | v2 impact | +|--------|-----------| +| **Breaking** (requires v3): remove a role from the hierarchy, change the common human floor, alter a target bot or transition grant, change fail-closed to fail-open, remove a fresh model-bound checkpoint, or weaken the actor and coverage gates beyond the bounded CEL cache adopted here | Dispatch implementations must migrate | +| **Adapter bot-identity migration** (allowed in v2): update an adapter to emit and enforce the ADR 0107 target representation | The adapter's existing compatibility behavior applies until that implementation update; afterward, registered bots use `actor.bot_role` and unregistered non-label bots are denied | +| **Non-breaking** (allowed in v2): add a role without changing the floor, add equivalent forge mappings, or clarify documentation | Existing dispatch behavior is preserved | diff --git a/docs/normative/entity-context-snapshot/v1/README.md b/docs/normative/entity-context-snapshot/v1/README.md index 3d94b786cf..9d24cd1ff6 100644 --- a/docs/normative/entity-context-snapshot/v1/README.md +++ b/docs/normative/entity-context-snapshot/v1/README.md @@ -6,6 +6,11 @@ under the actor-attributed data boundary in [ADR 0133](../../../ADRs/0133-actor- It is the contract between forge adapters, `fullsend run`, harness scripts, and agent runtimes. +> **Version note:** [ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) +> selects a common `triage` human floor for target Fullsend-controlled model +> admission. This v1 bundle retains its harness-derived threshold; snapshot +> producers need a v2 contract before applying the new floor. + Here, *entity-context-snapshot* means the staged data snapshot for a handled Git-forge entity. The qualified name distinguishes this data structure from the dispatch-layer routing category called *entity context* in diff --git a/docs/problems/agent-architecture.md b/docs/problems/agent-architecture.md index 644f278b79..f76c15b551 100644 --- a/docs/problems/agent-architecture.md +++ b/docs/problems/agent-architecture.md @@ -149,6 +149,12 @@ The repository's existing infrastructure provides all the coordination needed: harness predicates should be evaluated. Each predicate can inspect the resolved entity and an optional prompting event ([ADR 0098](../ADRs/0098-entity-first-harness-evaluation.md)). + [ADR 0147](../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md) + lets those checks acquire entity data progressively when the result is not + yet known. [ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) + permits bounded sharing of verified actor roles between those checks. + [ADR 0151](../ADRs/0151-common-actor-admission-floor.md) sets the common + human actor floor; harness-specific stronger roles remain CEL conditions. No agent orchestrates other agents. Each agent independently observes the state of the PR and acts according to its role: diff --git a/docs/problems/agent-infrastructure.md b/docs/problems/agent-infrastructure.md index d8d5f6d3ad..3623104260 100644 --- a/docs/problems/agent-infrastructure.md +++ b/docs/problems/agent-infrastructure.md @@ -71,7 +71,7 @@ Agents are often discussed as if they run on a developer workstation: fast local - **Workspace and context continuity** — Ephemeral jobs reset filesystem state between runs or stages. Carrying **in-progress repo state, partial edits, and task context** across those boundaries requires explicit design: shared volumes (for example PVCs in Kubernetes), artifact handoff between steps, branches or WIP commits, or external systems (issues, design docs). Without a deliberate handoff story, every run starts cold and context-window limits bite harder. -- **Compute held open for human latency** — A long-lived pod that **blocks on PR approval, architecture sign-off, or escalation** consumes cluster quota and cost while idle. That misaligns with typical “always-on service” defaults. Better fits include **event-driven** scheduling (wake on comment or approval), aggressive scale-to-zero, or separating **planning** from **execution** so capacity is not reserved across human response times; see [human-factors.md](human-factors.md) and [autonomy-spectrum.md](autonomy-spectrum.md). For shorter gaps between work cycles, [ADR 0144](../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md) bounds host-process reuse and releases idle CI capacity without keeping an agent sandbox alive. +- **Compute held open for human latency** — A long-lived pod that **blocks on PR approval, architecture sign-off, or escalation** consumes cluster quota and cost while idle. That misaligns with typical “always-on service” defaults. Better fits include **event-driven** scheduling (wake on comment or approval), aggressive scale-to-zero, or separating **planning** from **execution** so capacity is not reserved across human response times; see [human-factors.md](human-factors.md) and [autonomy-spectrum.md](autonomy-spectrum.md). For shorter gaps between work cycles, [ADR 0144](../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md) bounds host-process reuse and releases idle CI capacity without keeping an agent sandbox alive. Its repeated entity checks may share verified actor-role results only within [ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md)'s bounded lifetime. [Forge-sdlc/forge](../landscape.md#forge-sdlcforge) demonstrates one practical pause/resume pattern: LangGraph checkpoints workflow state, then later Jira or GitHub webhooks resume the graph while implementation work happens in ephemeral Podman containers. That separation is directionally useful for fullsend, even though Forge's sandbox is a productivity boundary rather than the stricter credential and egress isolation boundary fullsend needs. diff --git a/docs/problems/operational-observability.md b/docs/problems/operational-observability.md index 4b8e665d2c..af35ce83dd 100644 --- a/docs/problems/operational-observability.md +++ b/docs/problems/operational-observability.md @@ -93,6 +93,11 @@ Every agent invocation should produce a structured trace capturing the full life A key insight: much of an agent's input context is already stored durably in existing systems. The PR diff lives in GitHub. The codebase state is a git SHA. The issue description is on the issue tracker. Traces should reference these by pointer (repo + SHA, PR URL, issue URL) rather than duplicating them. The novel data that traces must capture is what those existing systems *don't* store: the LLM interactions themselves — the prompts assembled from that context, the completions returned, the tool calls made, and the reasoning that led to the decision. This distinction matters for storage cost, data sensitivity, and replay: to reconstruct an agent run, you combine the trace's LLM interaction log with the context retrievable from git and GitHub at the recorded references. +For entity-trigger decisions, [ADR 0147](../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md) +applies that principle to bounded actor-provenance and source-coverage evidence. +[ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) also requires +the audit to record the age of any shared actor-role result used for CEL. + Traces need to be correlatable. A PR review workflow involving five agents needs a session-level view that shows all five traces, their ordering, and how their outputs composed into the final decision. This is the LLM equivalent of distributed tracing in microservices — but with the additional challenge that each "span" contains non-deterministic reasoning, not just timing and status. ### Human feedback capture diff --git a/docs/problems/security-threat-model.md b/docs/problems/security-threat-model.md index 573a56826c..84fcc1fae9 100644 --- a/docs/problems/security-threat-model.md +++ b/docs/problems/security-threat-model.md @@ -133,6 +133,13 @@ Agents amplify authority. If a compromised account can trigger agent actions, th verified platform invocation and human-reviewed policy and harness revisions that authorized it (see [ADR 0098](../ADRs/0098-entity-first-harness-evaluation.md)) +- **Human input admission and harness scope** — the target common platform + floor admits verified `triage` actors, while a harness CEL predicate decides + whether it needs a stronger role. A triage actor could select a write-capable + harness without that guard, and triage-authored model input could guide one + even when its prompting actor needs `write`; the agent's configured + capabilities remain separate + ([ADR 0151](../ADRs/0151-common-actor-admission-floor.md)). - **No self-approval** — an agent that implements a change cannot also approve it. On GitHub this separation is real: the code and review stages run as distinct bot identities. On GitLab, the [GitLab role-credential contract](../contributing/gitlab-role-credentials.md)'s `approve_merge_request` capability check applies unconditionally: Analyst and Coder authenticate with distinct per-role credentials, and Coder is structurally denied the approve call because the capability check resolves from the role identity. Installs that have not yet provisioned role secrets fail closed rather than authenticating as the shared bot from [ADR 0067](../ADRs/0067-gitlab-cron-polling-event-dispatch.md). - **GitLab role-credential contract** — built-in Poller/Analyst/Coder and administrator-registered custom roles share one registry and credential-selection path ([gitlab-role-credentials.md](../contributing/gitlab-role-credentials.md)). Role registration is install-state only; repository and merge-request content cannot create or elevate roles. Runtime authentication failures do not fall back to the shared token. Provisioning of role credentials is additive (#7498). Job routing (#7499) selects the registered role credential unconditionally. There is no shared-token fallback for an unconfigured role (#7559, #7782). Rotation (#7500) replaces a due role PAT by creating a new token and distributing it to the existing CI variable while the previous PAT stays valid for in-flight jobs; a failed rotation does not drop the last known-good secret or silently broaden to the shared token. Neither `repos install` nor `repos uninstall` automatically removes a leftover shared `FULLSEND_FORGE_TOKEN` credential from a repository installed before the role-only rollout (#7931); an administrator must clean that up manually - **Rate limiting / anomaly detection** — unusual patterns of agent activity (sudden burst of cross-repo changes, changes to security-sensitive paths) trigger alerts @@ -144,6 +151,9 @@ Agents amplify authority. If a compromised account can trigger agent actions, th - How do we distinguish a compromised account from a legitimate team member making unusual but valid changes? - Should agent authority be tied to individual human identity, or to roles? + (The actor-admission floor uses verified roles under + [ADR 0151](../ADRs/0151-common-actor-admission-floor.md); that decision does + not grant agent capabilities or settle identity-specific policy.) - How do we handle the bootstrap problem — who sets up the initial agent configuration, and how is that secured? ## Threat 3: Agent drift From 529b74f9189d6fad3094a3b1e4b535d27f60133c Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Fri, 23 Oct 2026 02:14:02 +0300 Subject: [PATCH 2/7] docs(adr): define harness human admission minimums Apply a role-derived human minimum, configurable per trusted harness, to event, entity CEL, and model-bound record gates. Keep triage as the platform floor and label and bot grants separate. Signed-off-by: Barak Korren Assisted-by: Codex (GPT-6) --- ...thorization-on-all-agent-dispatch-paths.md | 9 +- docs/ADRs/0061-harness-cel-dispatch.md | 6 + .../0098-entity-first-harness-evaluation.md | 9 +- ...y-resolution-for-dispatch-authorization.md | 8 +- ...0112-overlays-may-set-any-harness-field.md | 5 + ...actor-attributed-data-security-boundary.md | 9 +- ...inistic-filtered-entity-context-staging.md | 7 +- ...use-poll-and-entity-bound-run-processes.md | 6 + ...tity-cel-over-selectively-acquired-data.md | 55 +- ...use-verified-actor-roles-for-entity-cel.md | 18 +- .../ADRs/0151-common-actor-admission-floor.md | 190 +++--- docs/architecture.md | 72 ++- docs/normative/authorization/v1/README.md | 6 +- docs/normative/authorization/v2/README.md | 553 +++++++++++------- .../entity-context-snapshot/v1/README.md | 8 +- docs/problems/agent-architecture.md | 5 +- docs/problems/agent-infrastructure.md | 2 + docs/problems/operational-observability.md | 3 + docs/problems/security-threat-model.md | 20 +- 19 files changed, 616 insertions(+), 375 deletions(-) diff --git a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md index ae2cdf1aa7..f28b78f3d9 100644 --- a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md +++ b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md @@ -41,10 +41,11 @@ Fullsend-originated entity discovery without a prompting event. Event-backed dispatch remains subject to this ADR's actor authorization gate. [ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the human -permission threshold for target CEL-routed event admission: the platform floor -is a verified effective `triage`-or-higher role, while CEL expresses stronger -harness conditions. The workflow stage guards and current Go `write` gate -remain in effect until migration. +permission threshold for target CEL-routed event admission. The platform keeps +a non-waivable `triage`-level floor, satisfied by a verified role or the narrow +verified label-transition grant, and enforces each selected harness's effective +`human_min_role` before CEL. The workflow stage guards and current Go `write` +gate remain in effect until migration. ## Context diff --git a/docs/ADRs/0061-harness-cel-dispatch.md b/docs/ADRs/0061-harness-cel-dispatch.md index f2560f4cd8..d18462adfe 100644 --- a/docs/ADRs/0061-harness-cel-dispatch.md +++ b/docs/ADRs/0061-harness-cel-dispatch.md @@ -26,6 +26,12 @@ Only the event-only CEL context is superseded by predicate but evaluates it against a resolved entity and optional event. The remaining decisions in this ADR remain accepted. +[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the +authorization-before-harness-enumeration ordering: the ordinary human `triage` +floor may run before loading harnesses, with a narrow verified label grant for +its exact transition. Each trusted harness's effective `human_min_role` is +then enforced before its CEL predicate. Authorization remains a platform gate. + ## Context Custom agents should be easy to author and portable across forges. Today, adding diff --git a/docs/ADRs/0098-entity-first-harness-evaluation.md b/docs/ADRs/0098-entity-first-harness-evaluation.md index 5b1b5e0b45..195697f0dd 100644 --- a/docs/ADRs/0098-entity-first-harness-evaluation.md +++ b/docs/ADRs/0098-entity-first-harness-evaluation.md @@ -51,11 +51,10 @@ bounded role reuse across entity-CEL checks and partially supersedes the permission-at-evaluation-time rule. Trusted-origin, event-actor, and model-bound authorization remain required. -[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes this -ADR's per-harness human threshold for decision-relevant entity facts. Target -entity-CEL admission uses a verified effective `triage`-or-higher platform -floor; actor provenance and fail-closed filtering remain required, and CEL may -require stronger conditions. +[ADR 0151](0151-common-actor-admission-floor.md) replaces the category-derived +human threshold for decision-relevant entity facts with the selected harness's +effective `human_min_role`, enforced by the platform above an immutable +`triage` floor. Actor provenance and fail-closed filtering remain required. ## Context diff --git a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md index 8ddbb19343..49a3eeebe0 100644 --- a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md +++ b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md @@ -19,10 +19,10 @@ Date: 2026-09-27 Accepted -[ADR 0151](0151-common-actor-admission-floor.md) updates the human permission -floor referenced here for target CEL and Fullsend-controlled model admission. -This ADR's bot grants and the forge-role meaning of human `role_verified` -remain unchanged. +[ADR 0151](0151-common-actor-admission-floor.md) requires a human labeler to +meet the selected harness's effective `human_min_role` for target CEL dispatch; +the accepted label mutation alone no longer bypasses a stronger human minimum. +This ADR's provider-classified bot label grant and registered-bot gate remain. Extends [ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md) and defines the bot behavior to be added to the existing v1 contracts. This ADR diff --git a/docs/ADRs/0112-overlays-may-set-any-harness-field.md b/docs/ADRs/0112-overlays-may-set-any-harness-field.md index 33c240e62d..e648e0ff23 100644 --- a/docs/ADRs/0112-overlays-may-set-any-harness-field.md +++ b/docs/ADRs/0112-overlays-may-set-any-harness-field.md @@ -21,6 +21,11 @@ Date: 2026-10-01 Accepted +[ADR 0151](0151-common-actor-admission-floor.md) adds `human_min_role` to the +top-level-only fields. It is resolved before authorization and cannot be set +by an overlay, even one guarded by trusted fields. The other overlay rules +remain current. + NormalizedEvent (adapter) - --> Event-actor floor or narrow grant <-- enforced here + --> Human triage floor/label grant or bot grant <-- enforced here + --> Resolve trusted harness and effective human minimum + --> Human role or exact label-grant gate <-- before this harness's CEL --> Event-only CEL routing or entity-source resolution - --> Dependency-driven acquisition and actor gate where required + --> Dependency-driven acquisition and per-harness actor gate --> CEL true / false / UNKNOWN - --> Execution only on definitive true + --> Model-record gate and execution only on definitive true Fullsend poll discovery / bound run eventless recheck --> Trusted-origin authorization gate <-- enforced here --> Enumerate and resolve candidates (poll) / resolve canonical entity (run) --> Evaluate each candidate harness (poll) or the bound harness (run): - --> Dependency-driven acquisition and actor gate where required + --> Resolve effective human minimum + --> Dependency-driven acquisition and per-harness actor gate --> CEL true / false / UNKNOWN (event is null) --> Unknown may continue in bound run after current entity re-resolution - --> Further trust/injection filtering and execution only on true + --> Model-record gate, filtering, and execution only on true ``` ### CEL triggers: harness-specific conditions Harness `trigger` expressions select runs and may require stronger human roles -or narrower bot roles, labels, and entity states. Such harness-specific -conditions belong in CEL; they never weaken the platform floor or create a -bot or transition grant. A CEL nonmatch is not a platform denial. On the -event-backed path, an event that fails the platform gate never reaches CEL. - -The gate precedes harness selection: `IsAuthorized()` currently runs before -`MatchHarnesses()` in the dispatch core. On the Fullsend-originated eventless -path, the trusted-origin gate runs before poll enumeration or bound-entity -resolution and CEL evaluation. For each eligible entity-source harness, the -platform admits actor-originated facts needed for an actionable CEL result -only after current source-revision attribution and a live or eligible bounded -role verdict meeting the common floor. CEL receives that verified effective -role and may apply stronger conditions. The verified label-event grant -authorizes only -its exact transition, as described above. Eventless checks use -`event == null`. Legacy event-only harness routing does not acquire entity -history under this section. +or narrower bot roles, labels, and entity states. Such CEL conditions may +further narrow a run but never weaken or replace the platform floor or the +selected harness's admission minimum, and they do not create a bot or +transition grant. A CEL nonmatch is not a platform denial. On the event-backed +path, an event that fails the role or exact label-grant gate never reaches +that harness's CEL. + +The current Go gate precedes harness loading: `IsAuthorized()` runs before +`MatchHarnesses()` in the dispatch core. In the target path, the platform MAY +reject a below-floor human event before loading harnesses unless the exact +verified label grant applies, but MUST resolve and enforce each candidate +harness's minimum before its CEL predicate. On the Fullsend-originated +eventless path, the trusted-origin gate runs before poll enumeration or +bound-entity resolution and CEL evaluation. For each eligible entity-source +harness, the platform admits actor-originated facts needed for +an actionable CEL result only after current source-revision attribution and a +live or eligible bounded role verdict meeting its effective minimum, or the +exact applicable human label grant for a `triage` minimum. CEL receives that +verified effective role when present and may apply further conditions. An +exact human label transition may instead carry separate `triage`-grant +provenance; CEL MUST NOT treat it as a verified role. The +verified bot label-event grant authorizes only its exact transition, as +described above. Eventless checks use `event == null`. Legacy event-only +harness routing does not acquire entity history under this section. ### Per-repo configurability -The common floor and the narrow bot and transition grants are platform-level -security boundaries. Individual repositories cannot disable or lower them. -Per-repo harness registration and CEL triggers operate within those -boundaries: a repository may disable a harness or require stronger conditions, -but cannot make it available to an actor rejected by the platform. +The `triage` floor and the narrow human-label and bot grants are +platform-level security boundaries. Individual repositories cannot disable or +lower them. A trusted harness author MAY set top-level `human_min_role` to +`triage`, `write`, `maintain`, or `admin`. This may lower a harness's `write` +default to `triage` or raise its minimum; the value applies to human event, +entity-fact, and model-record admission alike. A repository may disable a +harness or use CEL to require additional conditions, but cannot make it +available to a human rejected by either admission gate. A CEL overlay or +source event cannot alter `human_min_role`. A repository can add permission sources through the `authorization` field (today only `owners_file`). These sources may raise the verified effective role used by the platform and visible to CEL; they do not change -the floor or bypass the gate. The current bash +either minimum or bypass the gate. The current bash `has_repo_permission` helper and Go `IsAuthorized` check retain their compatibility behavior until migrated. @@ -737,17 +875,36 @@ supersedes v1's future full-history entity-evaluation and audit requirements; [ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) adds bounded cross-check reuse of provider-verified actor-role verdicts for entity-source CEL only. -[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) sets the common -human floor and moves stronger harness-specific role conditions into CEL. -This changes v1's stage-specific human authorization rules when an -implementation migrates to v2, while preserving the separate fresh -model-bound release checkpoints. Migration also requires versioned event and -entity CEL inputs and an entity-context-snapshot v2 contract for the changed -model-record admission meaning. The -[v1 snapshot](../../entity-context-snapshot/v1/README.md) retains its -historical stage-derived rule until that migration. Authorization v1 remains -authoritative for existing dispatch during migration, including its bash -thresholds and Go `write+` behavior. +[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) sets the +immutable `triage` platform floor and the selected harness's effective +`human_min_role` for human event, entity-fact, and model-record admission. The +resolved harness `role` supplies the default map above; an explicit top-level +field may change it within the allowed range. CEL may further narrow +selection but does not replace the admission minimum. This replaces v1's +stage-specific human authorization rules when an implementation migrates to +v2, while preserving separate fresh model-bound release checkpoints. + +Migration MUST teach harness loading and `base` composition to recognize and +validate `human_min_role` with key-presence awareness before the value can +affect any v2 decision. An explicit empty or invalid value MUST NOT silently +inherit or default during scalar merge; a `forge` or event-dependent overlay +value MUST be rejected before resolution. A runner that cannot interpret a +configured value MUST reject that harness, including a stronger `maintain` or +`admin` value; it MUST NOT silently use the role default or current global +`write+` gate. Migration also requires versioned event and entity CEL inputs +that carry verified effective roles and distinguish exact label-grant +provenance. Existing authorization-sensitive CEL comparisons against an +unverified legacy role MUST be migrated before v2 routing. Migration also +requires per-harness event and entity actor gates and an +entity-context-snapshot v2 contract that can represent all four allowed +minimums and the changed record-admission rule. +[Entity-context-snapshot v1](../../entity-context-snapshot/v1/README.md) +retains its historical stage-derived `triage`/`write` rule until that +migration. +Authorization v1 remains authoritative for existing dispatch during +migration, including its bash thresholds and Go `write+` behavior. An +explicit per-harness minimum change under v2 is a harness-policy change bound +to that harness's reviewed revision, not a normative contract version change. Breaking changes to v2 require `docs/normative/authorization/v3/`. **ADR 0107 migration exception:** The migration from legacy bot authorization @@ -759,12 +916,14 @@ non-label bots are denied. The adapter implementation itself is the migration boundary; no per-event mode marker or separate deprecation window is required. An updated adapter MUST enforce the target behavior and MUST NOT silently fall back to legacy bot authorization when its resolver fails. The normalized-event -fields used to carry this distinction are additive, and the permanent -label-added exception is preserved. This exception does not alter the general -v3 rule for unrelated authorization changes. +fields used to carry this distinction are additive. The verified label-added +bot handoff grant remains; human label additions meet the selected harness's +minimum only when the v2 human gate is implemented. This bot migration +exception does not alter the general v3 rule for unrelated authorization +changes. | Change | v2 impact | |--------|-----------| -| **Breaking** (requires v3): remove a role from the hierarchy, change the common human floor, alter a target bot or transition grant, change fail-closed to fail-open, remove a fresh model-bound checkpoint, or weaken the actor and coverage gates beyond the bounded CEL cache adopted here | Dispatch implementations must migrate | +| **Breaking** (requires v3): remove a role from the hierarchy, change the platform `triage` floor, change the harness-role default map or allowed `human_min_role` values, stop applying the minimum to human label additions or any of the three admission paths, alter a target label or bot grant, change fail-closed to fail-open, remove a fresh model-bound checkpoint, or weaken the actor and coverage gates beyond the bounded CEL cache adopted here | Dispatch implementations must migrate | | **Adapter bot-identity migration** (allowed in v2): update an adapter to emit and enforce the ADR 0107 target representation | The adapter's existing compatibility behavior applies until that implementation update; afterward, registered bots use `actor.bot_role` and unregistered non-label bots are denied | -| **Non-breaking** (allowed in v2): add a role without changing the floor, add equivalent forge mappings, or clarify documentation | Existing dispatch behavior is preserved | +| **Non-breaking** (allowed in v2): add a role under the existing default map, change one reviewed harness's explicit minimum, add equivalent forge mappings, or clarify documentation | The platform floor and contract remain; a harness minimum change binds to its new revision | diff --git a/docs/normative/entity-context-snapshot/v1/README.md b/docs/normative/entity-context-snapshot/v1/README.md index 9d24cd1ff6..f9f45b7e2b 100644 --- a/docs/normative/entity-context-snapshot/v1/README.md +++ b/docs/normative/entity-context-snapshot/v1/README.md @@ -7,9 +7,11 @@ It is the contract between forge adapters, `fullsend run`, harness scripts, and agent runtimes. > **Version note:** [ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) -> selects a common `triage` human floor for target Fullsend-controlled model -> admission. This v1 bundle retains its harness-derived threshold; snapshot -> producers need a v2 contract before applying the new floor. +> keeps an immutable `triage` floor and uses the selected harness's effective +> `human_min_role` for target Fullsend-controlled model admission. This v1 +> bundle retains its observation/mutation-derived `triage` or `write` threshold; +> snapshot producers need a v2 contract before applying the configurable +> threshold or its expanded role values. Here, *entity-context-snapshot* means the staged data snapshot for a handled Git-forge entity. The qualified name distinguishes this data structure from diff --git a/docs/problems/agent-architecture.md b/docs/problems/agent-architecture.md index f76c15b551..1c9084d2b0 100644 --- a/docs/problems/agent-architecture.md +++ b/docs/problems/agent-architecture.md @@ -153,8 +153,9 @@ The repository's existing infrastructure provides all the coordination needed: lets those checks acquire entity data progressively when the result is not yet known. [ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) permits bounded sharing of verified actor roles between those checks. - [ADR 0151](../ADRs/0151-common-actor-admission-floor.md) sets the common - human actor floor; harness-specific stronger roles remain CEL conditions. + [ADR 0151](../ADRs/0151-common-actor-admission-floor.md) sets a platform + `triage` floor and a configurable `human_min_role` for each harness. The + platform applies that minimum before evaluating the harness's CEL predicate. No agent orchestrates other agents. Each agent independently observes the state of the PR and acts according to its role: diff --git a/docs/problems/agent-infrastructure.md b/docs/problems/agent-infrastructure.md index 3623104260..1ea8c5a147 100644 --- a/docs/problems/agent-infrastructure.md +++ b/docs/problems/agent-infrastructure.md @@ -72,6 +72,8 @@ Agents are often discussed as if they run on a developer workstation: fast local - **Workspace and context continuity** — Ephemeral jobs reset filesystem state between runs or stages. Carrying **in-progress repo state, partial edits, and task context** across those boundaries requires explicit design: shared volumes (for example PVCs in Kubernetes), artifact handoff between steps, branches or WIP commits, or external systems (issues, design docs). Without a deliberate handoff story, every run starts cold and context-window limits bite harder. - **Compute held open for human latency** — A long-lived pod that **blocks on PR approval, architecture sign-off, or escalation** consumes cluster quota and cost while idle. That misaligns with typical “always-on service” defaults. Better fits include **event-driven** scheduling (wake on comment or approval), aggressive scale-to-zero, or separating **planning** from **execution** so capacity is not reserved across human response times; see [human-factors.md](human-factors.md) and [autonomy-spectrum.md](autonomy-spectrum.md). For shorter gaps between work cycles, [ADR 0144](../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md) bounds host-process reuse and releases idle CI capacity without keeping an agent sandbox alive. Its repeated entity checks may share verified actor-role results only within [ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md)'s bounded lifetime. + Each harness reapplies its effective `human_min_role` to a reused role verdict + under [ADR 0151](../ADRs/0151-common-actor-admission-floor.md). [Forge-sdlc/forge](../landscape.md#forge-sdlcforge) demonstrates one practical pause/resume pattern: LangGraph checkpoints workflow state, then later Jira or GitHub webhooks resume the graph while implementation work happens in ephemeral Podman containers. That separation is directionally useful for fullsend, even though Forge's sandbox is a productivity boundary rather than the stricter credential and egress isolation boundary fullsend needs. diff --git a/docs/problems/operational-observability.md b/docs/problems/operational-observability.md index af35ce83dd..3828e42334 100644 --- a/docs/problems/operational-observability.md +++ b/docs/problems/operational-observability.md @@ -97,6 +97,9 @@ For entity-trigger decisions, [ADR 0147](../ADRs/0147-evaluate-entity-cel-over-s applies that principle to bounded actor-provenance and source-coverage evidence. [ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) also requires the audit to record the age of any shared actor-role result used for CEL. +The audit records the evaluated harness revision and its effective +`human_min_role`, since one verified actor role can pass one harness's gate and +fail another's under [ADR 0151](../ADRs/0151-common-actor-admission-floor.md). Traces need to be correlatable. A PR review workflow involving five agents needs a session-level view that shows all five traces, their ordering, and how their outputs composed into the final decision. This is the LLM equivalent of distributed tracing in microservices — but with the additional challenge that each "span" contains non-deterministic reasoning, not just timing and status. diff --git a/docs/problems/security-threat-model.md b/docs/problems/security-threat-model.md index 84fcc1fae9..cce8cc8e03 100644 --- a/docs/problems/security-threat-model.md +++ b/docs/problems/security-threat-model.md @@ -133,12 +133,18 @@ Agents amplify authority. If a compromised account can trigger agent actions, th verified platform invocation and human-reviewed policy and harness revisions that authorized it (see [ADR 0098](../ADRs/0098-entity-first-harness-evaluation.md)) -- **Human input admission and harness scope** — the target common platform - floor admits verified `triage` actors, while a harness CEL predicate decides - whether it needs a stronger role. A triage actor could select a write-capable - harness without that guard, and triage-authored model input could guide one - even when its prompting actor needs `write`; the agent's configured - capabilities remain separate +- **Human input admission and harness scope** — the target platform requires + verified `triage` authority for ordinary human event actors, + decision-relevant entity facts, and model-bound records, then enforces each + harness's `human_min_role`. An exact verified human-label transition has a + narrow `triage`-equivalent grant that does not create a verified actor role; + a stronger harness minimum still requires the labeler's verified role. The + minimum defaults to `triage` for the `triage` and `review` mint + roles and `write` for other roles; a trusted harness author may override it + within the platform floor. CEL may narrow admission further. Explicitly + lowering a write-capable harness's minimum to `triage` lets triage-authored + content guide that harness, so agent configuration review and fixed + capabilities remain security controls ([ADR 0151](../ADRs/0151-common-actor-admission-floor.md)). - **No self-approval** — an agent that implements a change cannot also approve it. On GitHub this separation is real: the code and review stages run as distinct bot identities. On GitLab, the [GitLab role-credential contract](../contributing/gitlab-role-credentials.md)'s `approve_merge_request` capability check applies unconditionally: Analyst and Coder authenticate with distinct per-role credentials, and Coder is structurally denied the approve call because the capability check resolves from the role identity. Installs that have not yet provisioned role secrets fail closed rather than authenticating as the shared bot from [ADR 0067](../ADRs/0067-gitlab-cron-polling-event-dispatch.md). - **GitLab role-credential contract** — built-in Poller/Analyst/Coder and administrator-registered custom roles share one registry and credential-selection path ([gitlab-role-credentials.md](../contributing/gitlab-role-credentials.md)). Role registration is install-state only; repository and merge-request content cannot create or elevate roles. Runtime authentication failures do not fall back to the shared token. Provisioning of role credentials is additive (#7498). Job routing (#7499) selects the registered role credential unconditionally. There is no shared-token fallback for an unconfigured role (#7559, #7782). Rotation (#7500) replaces a due role PAT by creating a new token and distributing it to the existing CI variable while the previous PAT stays valid for in-flight jobs; a failed rotation does not drop the last known-good secret or silently broaden to the shared token. Neither `repos install` nor `repos uninstall` automatically removes a leftover shared `FULLSEND_FORGE_TOKEN` credential from a repository installed before the role-only rollout (#7931); an administrator must clean that up manually @@ -151,7 +157,7 @@ Agents amplify authority. If a compromised account can trigger agent actions, th - How do we distinguish a compromised account from a legitimate team member making unusual but valid changes? - Should agent authority be tied to individual human identity, or to roles? - (The actor-admission floor uses verified roles under + (The actor-admission gate uses verified roles and each harness's minimum under [ADR 0151](../ADRs/0151-common-actor-admission-floor.md); that decision does not grant agent capabilities or settle identity-specific policy.) - How do we handle the bootstrap problem — who sets up the initial agent configuration, and how is that secured? From 8360dbcbb834b2fa2b92ce73932395c175601978 Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Fri, 23 Oct 2026 02:19:25 +0300 Subject: [PATCH 3/7] docs(adr): pin trusted harness admission policy Require actor-independent harness policy sources and verify the composed policy identity across dispatch and run before credentials or content are admitted. Signed-off-by: Barak Korren Assisted-by: Codex (GPT-6) --- .../ADRs/0151-common-actor-admission-floor.md | 17 +++++ docs/normative/authorization/v2/README.md | 72 ++++++++++++------- 2 files changed, 65 insertions(+), 24 deletions(-) diff --git a/docs/ADRs/0151-common-actor-admission-floor.md b/docs/ADRs/0151-common-actor-admission-floor.md index 43f9328081..0a5c4a7282 100644 --- a/docs/ADRs/0151-common-actor-admission-floor.md +++ b/docs/ADRs/0151-common-actor-admission-floor.md @@ -42,6 +42,13 @@ its other event routes have distinct guards, including an ungated retro-close route ([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L305-L420)). The current Go path instead applies one `write` gate before loading harnesses ([`Dispatch` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/harnessdispatch/core.go#L48-L85)). +The current GitHub dispatch and run jobs each check out the PR base commit for +PR events ([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L1519-L1532), +[`run checkout` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L1681-L1686)). +The matrix execution ref carries agent and role but no composed policy digest +([`ExecutionRef` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/harnessdispatch/ref.go#L3-L13)), +and `run` resolves the harness by name again +([`run.go` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/cli/run.go#L641-L674)). A common `triage`-only admission rule would allow `triage`-authored model records to guide a write-capable harness even if its trigger CEL required a @@ -74,6 +81,16 @@ The default is an authorization policy, not a deduction from mint token scopes or the harness's `privilege_levels`. The trusted composed harness revision and effective minimum stay fixed for one evaluation and run cycle; a changed policy requires a new cycle or abort, not a silent threshold change. +The registry and local harness and `base` files that set this policy must come +from one immutable trusted checkout revision selected independently of the +prompting actor and entity content. A change proposal uses its target/base +commit, never its proposed head; other paths must identify an equivalent +trusted canonical revision. Every remote harness or base layer must pass its +allowlist and content-hash checks, and its digest belongs in the composed +policy identity. Dispatch must bind that identity and effective minimum to its +run handoff. A run or later Fullsend-controlled retrieval that cannot verify +the same pin must stop and may restart authorization from the first gate +before using the content. Fullsend applies the same effective minimum separately to the ordinary human prompting event before that harness's CEL predicate; to each actor-originated diff --git a/docs/normative/authorization/v2/README.md b/docs/normative/authorization/v2/README.md index 03eec07e66..0f7871b4fe 100644 --- a/docs/normative/authorization/v2/README.md +++ b/docs/normative/authorization/v2/README.md @@ -196,6 +196,20 @@ stages. Neither token permissions nor workflow stage names infer a different human threshold. The default table is an authorization policy, not a claim about the capabilities of every harness using a role. +The agent registry and local child and `base` harness files that determine +`role` or `human_min_role` MUST come from one actor-independent, trusted +checkout pinned to an immutable revision. For a change-proposal event, that is +the provider-verified target/base commit, never the proposed head; for other +events, it is a trusted repository revision selected and pinned by the +platform. An actor-supplied ref, CEL input, proposed head checkout, or mutable +target working tree MUST NOT select or replace these policy files or their +revision. A remote registered harness or `base` layer MUST be selected through +that trusted registry and base chain, pass a trusted remote-resource allowlist, +and have its content verified against a declared hash before contributing +`role` or `human_min_role`. A hash or allowlist match alone does not authorize +an actor-supplied remote source. Configured actor-permission sources retain +their separate trusted-ref and freshness requirements below. + `human_min_role` constrains human actors and their records only. A provider-classified bot using the exact verified label handoff or a bot with an exact registered role uses its separate gate, even when the selected @@ -223,10 +237,19 @@ A harness evaluation and any sandbox it starts MUST use one trusted composed harness revision, resolved `role`, and effective `human_min_role`. Fullsend MUST pin that policy before the first harness-specific actor gate and retain it through event admission, entity CEL, snapshot and model-record checks, and -later Fullsend-controlled retrieval. If the harness policy changes mid-cycle, -Fullsend MUST either retain the original pin for the whole cycle or stop and -re-evaluate from the first gate under the new revision; it MUST NOT silently -mix minima. A new child cycle under +later Fullsend-controlled retrieval. Its policy identity MUST bind the trusted +checkout revision, registry and composed harness content digest, trusted +remote-resource allowlist revision or digest, verified remote-layer hashes, +resolved `role`, effective minimum, and its explicit-or-default source. When +dispatch, execution, or retrieval use separate processes, the handoff MUST +preserve this identity with integrity. The receiver MUST verify the pin +against its loaded policy before minting or using harness credentials and +before admitting content. Passing only an agent name or +credential role is insufficient. If the policy changes mid-cycle, Fullsend +MUST either retain the original verified pin for the whole cycle or stop and +re-evaluate from the first gate under a new trusted revision; it MUST NOT +silently mix minima. If the receiver cannot verify the handoff pin, it MUST +stop and MAY restart authorization from the first gate. A new child cycle under [ADR 0144](../../../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md) may resolve and record a new pin. @@ -244,11 +267,12 @@ authorization denial. For each selected harness, the event-admission audit MUST bind the verified actor identity, effective role and source or narrow label-grant evidence, the -harness revision and resolved `role`, the effective `human_min_role` and its -explicit-or-default source, and the gate outcome, including denial before -CEL. A bot decision records its registered role or verified label-transition -evidence instead of a human role. An early platform-floor denial records the -actor evidence and floor outcome. +policy identity above, and the gate outcome, including denial before CEL. A +cross-process handoff records the policy identity sent and verified, or the +reason verification failed and authorization restarted or stopped. A bot +decision records its registered role or verified label-transition evidence +instead of a human role. An early platform-floor denial records the actor +evidence and floor outcome. ### Current dispatch compatibility @@ -271,7 +295,9 @@ harnesses or set their role requirements. After provider-backed > under-enforce an intended `maintain` or `admin` minimum. A v2-conforming > runner MUST reject a configured `human_min_role` it cannot parse, validate, > or enforce rather than silently treat it as absent. The field cannot be -> deployed as effective policy while a selected runner still ignores it. +> deployed as effective policy while a selected runner still ignores it. The +> current execution matrix carries agent name and credential role, not the +> composed policy identity required for a v2 cross-process handoff. ## Fail-closed behavior @@ -462,14 +488,12 @@ justification as any other wildcard allowlist in this contract. Each entity-source evaluation's audit record MUST identify its verified initiator (the event actor for an event-bearing check, or the trusted Fullsend invocation identity for an eventless check), target repository, effective -policy, harness revision, resolved harness `role`, effective -`human_min_role`, whether that minimum came from an explicit field or the -default map, canonical entity, acquisition-plan identity, and decision -outcome, including `UNKNOWN`, deferred, or denied outcomes. It MUST record -which source scopes and bounded queries were needed, their coverage and -completeness evidence, and the current attribution, live or eligible cached -verified role or exact label-grant provenance, and harness-gate outcome for -individual actor-originated records used as decisive witnesses. Complete +policy and pinned policy identity, canonical entity, acquisition-plan identity, +and decision outcome, including `UNKNOWN`, deferred, or denied outcomes. The +audit MUST record needed source scopes and bounded queries, their coverage and +completeness evidence, current attribution, live or eligible cached verified +role or exact label-grant provenance, and harness-gate outcome for individual +actor-originated records used as decisive witnesses. Complete negative or aggregate claims require bounded query and source-coverage evidence bound to the effective minimum, authorization policy, permission or grant source, and check time or equivalent authorization epoch. @@ -712,9 +736,9 @@ human- or bot-authored, does not admit its source record to model input without this separate fresh gate and ADR 0133 filtering. The model-record admission evidence MUST bind each admitted or redacted -record's current-revision actor and gate result to the selected harness -revision, effective `human_min_role`, its explicit-or-default source, and the -fresh checkpoint. A CEL match or earlier event admission is not this evidence. +record's current-revision actor and gate result to the selected harness's +pinned policy identity and the fresh checkpoint. A CEL match or earlier event +admission is not this evidence. Source-record attribution MAY come from a provider-verified event or be resolved from the source system. Model-bound actor authorization MUST be @@ -895,9 +919,9 @@ configured value MUST reject that harness, including a stronger `maintain` or that carry verified effective roles and distinguish exact label-grant provenance. Existing authorization-sensitive CEL comparisons against an unverified legacy role MUST be migrated before v2 routing. Migration also -requires per-harness event and entity actor gates and an -entity-context-snapshot v2 contract that can represent all four allowed -minimums and the changed record-admission rule. +requires a verified policy-identity handoff, per-harness event and entity +actor gates, and an entity-context-snapshot v2 contract that can represent all +four allowed minimums and the changed record-admission rule. [Entity-context-snapshot v1](../../entity-context-snapshot/v1/README.md) retains its historical stage-derived `triage`/`write` rule until that migration. From 7b549b783bd8a0221581521246d00dee10b0aada Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Fri, 23 Oct 2026 02:46:34 +0300 Subject: [PATCH 4/7] docs(adr): allow guarded human minimum overlays Align ADR 0151 with the trusted-fact overlay rule in ADR 0112. Resolve and pin the effective minimum before actor and content admission. Signed-off-by: Barak Korren Assisted-by: Codex (GPT-6) --- ...0112-overlays-may-set-any-harness-field.md | 9 +- .../ADRs/0151-common-actor-admission-floor.md | 61 ++++++-- docs/architecture.md | 22 ++- docs/contributing/harness-fields.md | 4 + docs/normative/authorization/v2/README.md | 134 +++++++++++++----- docs/normative/normalized-event/v1/README.md | 7 + 6 files changed, 178 insertions(+), 59 deletions(-) diff --git a/docs/ADRs/0112-overlays-may-set-any-harness-field.md b/docs/ADRs/0112-overlays-may-set-any-harness-field.md index e648e0ff23..f5996da2bc 100644 --- a/docs/ADRs/0112-overlays-may-set-any-harness-field.md +++ b/docs/ADRs/0112-overlays-may-set-any-harness-field.md @@ -21,10 +21,11 @@ Date: 2026-10-01 Accepted -[ADR 0151](0151-common-actor-admission-floor.md) adds `human_min_role` to the -top-level-only fields. It is resolved before authorization and cannot be set -by an overlay, even one guarded by trusted fields. The other overlay rules -remain current. +[ADR 0151](0151-common-actor-admission-floor.md) treats `human_min_role` as a +guarded overlay field. Its ordered overlay outcome and effective value must be +resolved from verified pre-admission facts and pinned before the harness's +actor gate; the deprecated `forge:` block cannot set it. The other overlay +rules remain current. NormalizedEvent (adapter) --> Human triage floor/label grant or bot grant <-- enforced here - --> Resolve trusted harness and effective human minimum + --> Resolve trusted harness and verified event/target metadata + --> If needed, resolve structural entity-source metadata only + from the provider or platform discovery credential + --> Resolve guarded minimum overlays from that metadata --> Human role or exact label-grant gate <-- before this harness's CEL --> Event-only CEL routing or entity-source resolution --> Dependency-driven acquisition and per-harness actor gate @@ -836,7 +884,8 @@ Fullsend poll discovery / bound run eventless recheck --> Trusted-origin authorization gate <-- enforced here --> Enumerate and resolve candidates (poll) / resolve canonical entity (run) --> Evaluate each candidate harness (poll) or the bound harness (run): - --> Resolve effective human minimum + --> Resolve guarded overlays and effective human minimum + from verified pre-admission metadata --> Dependency-driven acquisition and per-harness actor gate --> CEL true / false / UNKNOWN (event is null) --> Unknown may continue in bound run after current entity re-resolution @@ -875,13 +924,14 @@ harness routing does not acquire entity history under this section. The `triage` floor and the narrow human-label and bot grants are platform-level security boundaries. Individual repositories cannot disable or -lower them. A trusted harness author MAY set top-level `human_min_role` to -`triage`, `write`, `maintain`, or `admin`. This may lower a harness's `write` -default to `triage` or raise its minimum; the value applies to human event, -entity-fact, and model-record admission alike. A repository may disable a -harness or use CEL to require additional conditions, but cannot make it -available to a human rejected by either admission gate. A CEL overlay or -source event cannot alter `human_min_role`. +lower them. A trusted harness author MAY set `human_min_role` at the top level +or in an ADR 0112 trusted-fact-guarded overlay to `triage`, `write`, +`maintain`, or `admin`. This may lower a harness's `write` default to `triage` +or raise its minimum; the selected value applies to human event, entity-fact, +and model-record admission alike. A repository may disable a harness or use +trigger CEL to require additional conditions, but cannot make it available to +a human rejected by either admission gate. A source event may select the field +only through the validated trusted facts above; it cannot supply policy text. A repository can add permission sources through the `authorization` field (today only `owners_file`). These sources may raise the verified @@ -903,25 +953,31 @@ entity-source CEL only. immutable `triage` platform floor and the selected harness's effective `human_min_role` for human event, entity-fact, and model-record admission. The resolved harness `role` supplies the default map above; an explicit top-level -field may change it within the allowed range. CEL may further narrow -selection but does not replace the admission minimum. This replaces v1's -stage-specific human authorization rules when an implementation migrates to +or trusted-fact-guarded overlay value may change it within the allowed range. +Trigger CEL may further narrow selection but does not replace the admission +minimum. This replaces v1's stage-specific human authorization rules when an +implementation migrates to v2, while preserving separate fresh model-bound release checkpoints. Migration MUST teach harness loading and `base` composition to recognize and -validate `human_min_role` with key-presence awareness before the value can -affect any v2 decision. An explicit empty or invalid value MUST NOT silently -inherit or default during scalar merge; a `forge` or event-dependent overlay -value MUST be rejected before resolution. A runner that cannot interpret a +validate `human_min_role` with key-presence awareness, including in overlay +entries, before the value can affect any v2 decision. The versioned CEL schema +MUST name and classify the verified effective-role path before a role-based +minimum overlay can run. An explicit empty or invalid value MUST NOT silently +inherit or default during scalar merge; a +`forge:` value or overlay with untrusted or admission-dependent guard inputs +MUST be rejected before resolution. A runner that cannot interpret a configured value MUST reject that harness, including a stronger `maintain` or `admin` value; it MUST NOT silently use the role default or current global `write+` gate. Migration also requires versioned event and entity CEL inputs that carry verified effective roles and distinguish exact label-grant provenance. Existing authorization-sensitive CEL comparisons against an unverified legacy role MUST be migrated before v2 routing. Migration also -requires a verified policy-identity handoff, per-harness event and entity -actor gates, and an entity-context-snapshot v2 contract that can represent all -four allowed minimums and the changed record-admission rule. +requires dispatch and run to use the same verified overlay guard context, a +verified policy-identity handoff with the ordered overlay outcome and minimum, +per-harness event and entity actor gates, and an entity-context-snapshot v2 +contract that can represent all four allowed minimums and the changed +record-admission rule. [Entity-context-snapshot v1](../../entity-context-snapshot/v1/README.md) retains its historical stage-derived `triage`/`write` rule until that migration. diff --git a/docs/normative/normalized-event/v1/README.md b/docs/normative/normalized-event/v1/README.md index 7c7b3a1053..33a0991dce 100644 --- a/docs/normative/normalized-event/v1/README.md +++ b/docs/normative/normalized-event/v1/README.md @@ -290,6 +290,13 @@ proposal is simply no match. `actor.role` says who triggered the event, not who wrote the change, so an overlay that loosens a guarded value on a change proposal should also require `!state.change_proposal.is_fork`. +For a guarded overlay selecting the authorization-v2 `human_min_role`, raw +`actor.role` is excluded even though it is listed as trusted here. A role +guard must use the [v2 verified effective-role input](../../authorization/v2/README.md#platform-floor-and-per-harness-human-minimum), +and a narrow label grant is not a role. A trusted-field dependency check also +does not establish which truth value is safe: a change author can make +`is_fork` true, while only a writer can make it false. + ## CEL trigger examples Harness `trigger` expressions are CEL booleans over `event`: From 65a6ef1ff778042fcf575fb70b3e56ea188e78ff Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Fri, 23 Oct 2026 03:23:43 +0300 Subject: [PATCH 5/7] docs(adr): align actor admission with v1 dispatch Acknowledge the v1 role defaults and the merged per-harness Go gate, while keeping configurable and cross-surface policy as the ADR 0151 target. Signed-off-by: Barak Korren Assisted-by: Codex (GPT-6) --- ...thorization-on-all-agent-dispatch-paths.md | 4 +- .../ADRs/0151-common-actor-admission-floor.md | 40 +++++++---- docs/architecture.md | 5 +- docs/normative/authorization/v2/README.md | 70 ++++++++++--------- 4 files changed, 69 insertions(+), 50 deletions(-) diff --git a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md index f28b78f3d9..141c00e447 100644 --- a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md +++ b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md @@ -44,8 +44,8 @@ dispatch remains subject to this ADR's actor authorization gate. permission threshold for target CEL-routed event admission. The platform keeps a non-waivable `triage`-level floor, satisfied by a verified role or the narrow verified label-transition grant, and enforces each selected harness's effective -`human_min_role` before CEL. The workflow stage guards and current Go `write` -gate remain in effect until migration. +`human_min_role` before CEL. The workflow stage guards and Go role-derived +default thresholds remain in effect until migration. ## Context diff --git a/docs/ADRs/0151-common-actor-admission-floor.md b/docs/ADRs/0151-common-actor-admission-floor.md index fca4b92963..6e2eb8dbd7 100644 --- a/docs/ADRs/0151-common-actor-admission-floor.md +++ b/docs/ADRs/0151-common-actor-admission-floor.md @@ -23,9 +23,10 @@ This decision partially supersedes the human permission thresholds in [ADR 0098](0098-entity-first-harness-evaluation.md), [ADR 0133](0133-actor-attributed-data-security-boundary.md), and [ADR 0141](0141-deterministic-filtered-entity-context-staging.md) for the -target CEL and model-bound paths. It also supersedes [ADR +target CEL and model-bound paths. It also refines [ADR 0061](0061-harness-cel-dispatch.md)'s authorization-before-harness- -enumeration ordering and narrows the human label-transition exception in +enumeration ordering for harness-specific thresholds and narrows the human +label-transition exception in [ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md) for a harness requiring more than `triage`. Their other provenance, bot, freshness, and filtering requirements remain. @@ -36,12 +37,23 @@ Their other provenance, bot, freshness, and filtering requirements remain. harness CEL. A harness's `role` selects its run identity: GitHub requests a mint token for it, while GitLab selects registered role credentials ([`run.go` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/cli/run.go#L903-L915)). -The existing GitHub workflow uses `triage` for human triage/review slash -commands and `write` for human code/fix/retro/prioritize slash commands; -its other event routes have distinct guards, including an ungated retro-close -route ([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L305-L420)). -The current Go path instead applies one `write` gate before loading -harnesses ([`Dispatch` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/harnessdispatch/core.go#L48-L85)). +[Authorization v1](../normative/authorization/v1/README.md#default-thresholds) +already sets `triage` for observation and `write` for mutation, including its +target entity-fact and model-record rules. The GitHub workflow applies those +thresholds to human slash commands; its other event routes have distinct +guards, including an ungated retro-close route +([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L305-L420)). +Since [#8727](https://github.com/fullsend-ai/fullsend/pull/8727), Go CEL +dispatch also applies an event-level `triage` floor for ordinary human events +and filters candidate harnesses by the v1 `role`-derived default before CEL: +`triage` and `review` +require `triage`; every other role requires `write` +([`auth.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harnessdispatch/auth.go#L78-L157), +[`core.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harnessdispatch/core.go#L68-L82)). +Its harness schema has no explicit human minimum +([`harness.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harness/harness.go#L364-L400)), +and its label-added exception bypasses the per-harness role threshold +([`auth.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harnessdispatch/auth.go#L53-L58)). The current GitHub dispatch and run jobs each check out the PR base commit for PR events ([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L1519-L1532), [`run checkout` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L1681-L1686)). @@ -178,12 +190,12 @@ Source-specific bot and label grants require their own provider evidence. ## Consequences -- The current Go `write` gate and bash routes remain compatibility behavior - until dispatch can load trusted harness policy, apply each minimum before - its CEL predicate, and expose verified effective roles or exact label-grant - provenance to CEL. The - `human_min_role` field is target-only until the loader validates and enforces - it. +- Current Go CEL dispatch enforces the v1 role-derived default for ordinary + human events, and bash routes retain their stage guards. Explicit or guarded + overlay `human_min_role` values, selected-minimum checks for human label + additions and actor-originated entity and model records, and the pinned + policy handoff remain target behavior. The field cannot become effective + policy until the loader validates and enforces it. - A harness author may deliberately set `human_min_role: triage` for a write-capable role; that permits `triage` actors and records to guide that harness without changing its minted capabilities. diff --git a/docs/architecture.md b/docs/architecture.md index de08f0f817..e9150c77a5 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -453,8 +453,9 @@ The existing design principle is that [the repo is the coordinator](problems/age provider or a trusted configured permission source such as `OWNERS`; harness CEL may narrow actor, target, or action conditions. Current GitHub bash guards still use `triage` for observation stages and `write` for mutation - stages, except for its ungated retro close route; the Go dispatch path still - requires `write` for ordinary events before matching harnesses. Non-GitHub + stages, except for its ungated retro close route. Go CEL dispatch now + applies the v1 role-derived default per harness before CEL for ordinary + human events; explicit or overlay minima remain target behavior. Non-GitHub event paths map source-native roles to normalized roles without cross-system identity verification. Bot actors are migrating to provider-backed exact role resolution: adapters classify actors from source-native metadata; recognized bots receive a diff --git a/docs/normative/authorization/v2/README.md b/docs/normative/authorization/v2/README.md index e9a6fcff76..05f768ac47 100644 --- a/docs/normative/authorization/v2/README.md +++ b/docs/normative/authorization/v2/README.md @@ -324,22 +324,25 @@ and bot compatibility behavior, as recorded in harnesses or set their role requirements. After provider-backed `actor.bot_role` recognition, bots use the separate bot gate above. -> **Current Go implementation:** `IsAuthorized()` in `harnessdispatch` still -> applies `write+` to ordinary events before `MatchHarnesses()`, including -> poll-based dispatch. This is current compatibility behavior, not the v2 -> per-harness gate. Migration must resolve each harness's minimum before its -> CEL predicate, apply that minimum to the event actor, and make the -> OWNERS-adjusted effective role visible in a versioned CEL input. Today the -> Go path applies an OWNERS upgrade to its platform check but passes the -> original event role to CEL. The current harness loader does not recognize -> `human_min_role` and can ignore an unknown YAML key. Adding the field to a -> harness today does not enforce it: the global `write+` check would especially -> under-enforce an intended `maintain` or `admin` minimum. A v2-conforming -> runner MUST reject a configured `human_min_role` it cannot parse, validate, -> or enforce rather than silently treat it as absent. The field cannot be -> deployed as effective policy while a selected runner still ignores it. The -> current execution matrix carries agent name and credential role, not the -> composed policy identity required for a v2 cross-process handoff. +> **Current Go implementation:** Since +> [#8727](https://github.com/fullsend-ai/fullsend/pull/8727), +> `fullsend dispatch` runs `IsEventAuthorized()` before harness enumeration, +> then `FilterAuthorizedHarnesses()` applies each candidate's `role`-derived +> `triage` or `write` default before `MatchHarnesses()`. Jira polling preloads +> candidates, then runs both authorization checks before CEL. This implements +> the v1 default for ordinary events. +> Migration must resolve any explicit or guarded-overlay minimum before that +> harness's CEL predicate and expose the same verified effective role to CEL. +> Today Go still lets human label-added events bypass the per-harness threshold; +> it applies an OWNERS upgrade to its gate but passes the original event role +> to CEL. The harness loader does not recognize `human_min_role` and can ignore +> an unknown YAML key. Adding the field today does not enforce it, including +> an intended `maintain` or `admin` minimum. A v2-conforming runner MUST reject +> a configured `human_min_role` it cannot parse, validate, or enforce rather +> than silently treat it as absent. The field cannot be deployed as effective +> policy while a selected runner still ignores it. The current execution +> matrix carries agent name and credential role, not the composed policy +> identity required for a v2 cross-process handoff. ## Fail-closed behavior @@ -449,8 +452,9 @@ role and review state are accepted. `pull_request_target.closed` to retro without a separate collaborator-role check, so any closer may trigger it. This is not a read-only capability: retro's token can write issues and pull requests, and its post-script can -file issues, comment, and apply labels. The Go `IsAuthorized()` path has no -close-event exception and applies its current `write+` gate. +file issues, comment, and apply labels. The Go CEL path has no close-event +exception and applies the selected harness's role-derived default; a `retro` +role requires `write`. The ungated bash route is not a general v2 grant for CEL-based dispatch or entity facts. Under this contract, a human close-event actor must meet the @@ -902,11 +906,12 @@ transition grant. A CEL nonmatch is not a platform denial. On the event-backed path, an event that fails the role or exact label-grant gate never reaches that harness's CEL. -The current Go gate precedes harness loading: `IsAuthorized()` runs before -`MatchHarnesses()` in the dispatch core. In the target path, the platform MAY -reject a below-floor human event before loading harnesses unless the exact -verified label grant applies, but MUST resolve and enforce each candidate -harness's minimum before its CEL predicate. On the Fullsend-originated +Current `fullsend dispatch` runs `IsEventAuthorized()` before harness loading +and `FilterAuthorizedHarnesses()` before `MatchHarnesses()`. Jira polling +preloads harnesses but applies both checks before CEL. In the target path, the +platform MAY reject a below-floor human event before loading harnesses unless +the exact verified label grant applies, but MUST resolve and enforce each +candidate harness's minimum before its CEL predicate. On the Fullsend-originated eventless path, the trusted-origin gate runs before poll enumeration or bound-entity resolution and CEL evaluation. For each eligible entity-source harness, the platform admits actor-originated facts needed for @@ -937,8 +942,8 @@ A repository can add permission sources through the `authorization` field (today only `owners_file`). These sources may raise the verified effective role used by the platform and visible to CEL; they do not change either minimum or bypass the gate. The current bash -`has_repo_permission` helper and Go `IsAuthorized` check retain their -compatibility behavior until migrated. +`has_repo_permission` helper and Go event and per-harness gates retain their +v1 compatibility behavior until migrated. ## Versioning @@ -955,9 +960,10 @@ immutable `triage` platform floor and the selected harness's effective resolved harness `role` supplies the default map above; an explicit top-level or trusted-fact-guarded overlay value may change it within the allowed range. Trigger CEL may further narrow selection but does not replace the admission -minimum. This replaces v1's stage-specific human authorization rules when an -implementation migrates to -v2, while preserving separate fresh model-bound release checkpoints. +minimum. V2 retains v1's role-derived defaults; a resolved explicit or +guarded-overlay value supersedes the fixed default for that harness across +event, entity-fact, and model-record admission. The separate fresh model-bound +release checkpoints remain. Migration MUST teach harness loading and `base` composition to recognize and validate `human_min_role` with key-presence awareness, including in overlay @@ -968,9 +974,9 @@ inherit or default during scalar merge; a `forge:` value or overlay with untrusted or admission-dependent guard inputs MUST be rejected before resolution. A runner that cannot interpret a configured value MUST reject that harness, including a stronger `maintain` or -`admin` value; it MUST NOT silently use the role default or current global -`write+` gate. Migration also requires versioned event and entity CEL inputs -that carry verified effective roles and distinguish exact label-grant +`admin` value; it MUST NOT silently use the v1 role-derived default. Migration +also requires versioned event and entity CEL inputs that carry verified +effective roles and distinguish exact label-grant provenance. Existing authorization-sensitive CEL comparisons against an unverified legacy role MUST be migrated before v2 routing. Migration also requires dispatch and run to use the same verified overlay guard context, a @@ -982,7 +988,7 @@ record-admission rule. retains its historical stage-derived `triage`/`write` rule until that migration. Authorization v1 remains authoritative for existing dispatch during -migration, including its bash thresholds and Go `write+` behavior. An +migration, including its bash thresholds and Go role-derived defaults. An explicit per-harness minimum change under v2 is a harness-policy change bound to that harness's reviewed revision, not a normative contract version change. Breaking changes to v2 require `docs/normative/authorization/v3/`. From 9fc06a2c6e0403511853634e78964e78b2fe359c Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Sun, 25 Oct 2026 09:15:14 +0200 Subject: [PATCH 6/7] docs(adr): clarify harness admission and run rechecks Signed-off-by: Barak Korren Assisted-by: Codex (gpt-6) --- .../0098-entity-first-harness-evaluation.md | 2 +- ...tity-cel-over-selectively-acquired-data.md | 23 +- ...use-verified-actor-roles-for-entity-cel.md | 8 +- .../ADRs/0151-common-actor-admission-floor.md | 76 +++++-- docs/normative/authorization/v2/README.md | 212 ++++++++++++------ 5 files changed, 213 insertions(+), 108 deletions(-) diff --git a/docs/ADRs/0098-entity-first-harness-evaluation.md b/docs/ADRs/0098-entity-first-harness-evaluation.md index 195697f0dd..c1fefcb579 100644 --- a/docs/ADRs/0098-entity-first-harness-evaluation.md +++ b/docs/ADRs/0098-entity-first-harness-evaluation.md @@ -51,7 +51,7 @@ bounded role reuse across entity-CEL checks and partially supersedes the permission-at-evaluation-time rule. Trusted-origin, event-actor, and model-bound authorization remain required. -[ADR 0151](0151-common-actor-admission-floor.md) replaces the category-derived +[ADR 0151](0151-common-actor-admission-floor.md) replaces the observation/mutation-derived human threshold for decision-relevant entity facts with the selected harness's effective `human_min_role`, enforced by the platform above an immutable `triage` floor. Actor provenance and fail-closed filtering remain required. diff --git a/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md b/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md index dd7925bb91..38f93c9d25 100644 --- a/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md +++ b/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md @@ -54,6 +54,12 @@ Entity routing remains a target design: at [`a2be1678`](https://github.com/fullsend-ai/fullsend/blob/a2be1678c5dbd9361a77f04de5ec260320e4fb9f/internal/harness/trigger.go#L12-L16), the trigger CEL environment still declares only `event`. +> **Planned:** Entity-source CEL is not implemented and remains disabled until +> the [normalized-entity contract tracked by issue #8420](https://github.com/fullsend-ai/fullsend/issues/8420), +> selective evaluator, and authorization gates are implemented. Legacy +> non-CEL, non-entity workflows continue under their existing authorization +> contract. + ## Options ### Fetch all history before CEL @@ -124,18 +130,11 @@ a sandbox only after its own definitive true. Absence, negation, counts, and universal conditions may still require complete coverage of relevant scopes. Before a classified action-indicating entity fact can influence CEL, Fullsend -verifies its source-revision actor. For an ordinary human fact, that actor's -verified effective role must meet the platform `triage` floor and the -evaluated harness's effective `human_min_role`. A verified human label -addition instead grants `triage`-equivalent authority only for its exact -accepted transition and proven entity projection; a higher harness minimum -also requires the labeler's verified effective role to meet it. This narrow -grant neither sets `actor.role` nor makes `actor.role_verified` true, and it -is not a cacheable actor-role verdict. A bot needs its exact registered role -under ADR 0107, except that a provider-verified bot label handoff separately -grants authority for its exact transition and projection. Independent history -needs its own actor gate. Verified effective roles, when present, remain -available to CEL for further harness conditions. +verifies its source-revision actor and applies the actor and fact gates defined +by [ADR 0151](0151-common-actor-admission-floor.md) and +[Authorization Contract v2](../normative/authorization/v2/README.md). +Independent history needs its own actor gate. Verified effective roles, when +present, remain available to CEL for further harness conditions. Unauthorized records are excluded. Unrelated history need not be fetched, authorized, or listed in the audit. Each check records its verified initiator, diff --git a/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md b/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md index 734cb333cc..b372c24c0f 100644 --- a/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md +++ b/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md @@ -86,10 +86,10 @@ source and policy revision, and the selected source ref plus relevant OWNERS, OWNERS_ALIASES, or bot-registration source revision. A known change to a grant, OWNERS, OWNERS_ALIASES, bot registry, or policy invalidates affected entries. Every check separately validates current entity facts, their -source-revision actor attribution, and query coverage. It applies the platform -`triage` floor and effective harness minimum through the applicable ordinary -human role or exact human-label-grant path, checks registered-bot requirements, -and evaluates its CEL predicate. A wakeup invalidates affected entity facts; +source-revision actor attribution, and query coverage. It applies the actor +and fact gates in [ADR 0151](0151-common-actor-admission-floor.md) and +[Authorization Contract v2](../normative/authorization/v2/README.md) to those +current facts, then evaluates its CEL predicate. A wakeup invalidates affected entity facts; it does not by itself turn an unexpired actor-role result into a fresh one. If cached authorization contributes to a false CEL result, discovery must schedule a recheck or guarantee rediscovery after expiry or known invalidation diff --git a/docs/ADRs/0151-common-actor-admission-floor.md b/docs/ADRs/0151-common-actor-admission-floor.md index 6e2eb8dbd7..69eb96aad8 100644 --- a/docs/ADRs/0151-common-actor-admission-floor.md +++ b/docs/ADRs/0151-common-actor-admission-floor.md @@ -23,13 +23,17 @@ This decision partially supersedes the human permission thresholds in [ADR 0098](0098-entity-first-harness-evaluation.md), [ADR 0133](0133-actor-attributed-data-security-boundary.md), and [ADR 0141](0141-deterministic-filtered-entity-context-staging.md) for the -target CEL and model-bound paths. It also refines [ADR -0061](0061-harness-cel-dispatch.md)'s authorization-before-harness- -enumeration ordering for harness-specific thresholds and narrows the human -label-transition exception in +target CEL/entity routes and their migrated model-bound paths. It also refines +[ADR 0061](0061-harness-cel-dispatch.md)'s +authorization-before-harness-enumeration ordering for harness-specific +thresholds and narrows the human label-transition exception in [ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md) for a harness requiring more than `triage`. Their other provenance, bot, freshness, and filtering requirements remain. +These changes apply to CEL/entity routes and their v2 model-bound admission +when migrated. Legacy non-CEL, non-entity workflow configurations remain under +Authorization v1 and their existing workflow guards until separately +migrated. ## Context @@ -112,32 +116,59 @@ versioned CEL schema must define the verified role path and provenance before role-based guards can be used. A known absent event or optional key is a nonmatch under ADR 0112; an evaluation error or required guard evidence that cannot be verified fails evaluation rather than silently selecting a fallback. +An overlay's value MUST preserve or lower the non-overlay baseline for its +layer. The baseline is that layer's explicit `human_min_role`, otherwise its +inherited resolved minimum, otherwise the role-derived default. To conditionally +require a stronger minimum, set that stronger baseline outside overlays and +allow a guarded overlay to lower it only when its trusted condition is +positively established. Trusted entity-source identity needed for a guard must be obtained from provider-verified structural metadata or a platform discovery credential, not from the still-unpinned harness run credential. Trusted-field validation alone does not prove that a guard's matching branch has the intended security meaning: for example, a change author may choose a fork, while only an author with write access can make `is_fork` false. A -conditional relaxation should positively prove the trusted condition for +conditional relaxation MUST positively prove the trusted condition for which the lower minimum is intended. The selected value gates other actors' entity facts and model records as well as the prompting actor. The default is an authorization policy, not a deduction from mint token scopes or the harness's `privilege_levels`. The trusted composed harness revision, ordered overlay outcome, trusted guard evidence, and effective minimum stay -fixed for one evaluation and run cycle; a changed policy or guard result -requires a new cycle or abort, not a silent threshold change. -The registry and local harness and `base` files that set this policy must come -from one immutable trusted checkout revision selected independently of the -prompting actor and entity content. A change proposal uses its target/base -commit, never its proposed head; other paths must identify an equivalent -trusted canonical revision. Every remote harness or base layer must pass its -allowlist and content-hash checks, and its digest belongs in the composed -policy identity. Dispatch must bind that identity, the ordered overlay -resolution and verified guard inputs, and the effective minimum to its run -handoff. A run or later Fullsend-controlled retrieval that cannot verify the -same pin must stop and may restart authorization from the first gate before -using the content. +fixed within one evaluation or run cycle; a changed policy or guard result +requires a new cycle or abort, not a silent threshold change. A dispatch or +poll result is only a candidate selection, not permission to launch. +The target-repository registry and local harness and `base` files that set +this policy come from one immutable trusted checkout revision selected +independently of the prompting actor and entity content. A change proposal +uses its target/base commit, never its proposed head; other paths must identify +an equivalent trusted canonical revision. A remote registered harness or +`base` layer has its own immutable source revision and declared content hash; +it does not share the target-repository revision. Built-in fallback harnesses +from `fullsend-ai/agents` currently resolve a release tag (or `main` for a +source build) to a commit SHA independently in each `run`, without verifying a +declared content hash. Legacy routes pin target config to the base commit and +resolve a fallback within their single `run`; current CEL dispatch and its +later `run` resolve independently. Current behavior is implemented in +[`reusable-dispatch.yml` at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/.github/workflows/reusable-dispatch.yml#L135-L148) +and [`run.go` at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/internal/cli/run.go#L7200-L7361). +Before a CEL/entity-bound run uses a selected candidate, `fullsend run` MUST +independently load the trusted target config and selected harness/base chain, +re-evaluate applicable `config.yaml` `when` flags and harness overlays from +current verified inputs, rerun harness trigger CEL, and recheck authorization +and launch eligibility against the freshly re-fetched canonical entity under +ADR 0144. It MUST do +this before assembling ADR 0141 model context or starting the sandbox. A +candidate that is now disabled, no longer matches, or fails any current gate +MUST stop before context exposure or launch. A config or harness revision +change between dispatch/poll and `run` is handled by this fresh evaluation; +the revisions do not have to match across processes. The run MUST record the +trusted revisions and effective policy it actually verified, then use that +same resolved policy through its own context-staging and launch checks. If a +policy input changes during that run, it MUST stop or restart all gates under +the newly loaded policy rather than mix decisions. This recheck applies to the +CEL/entity and v2 paths only; it does not extend the new policy to legacy +non-CEL, non-entity workflows. Fullsend applies the same effective minimum separately to the ordinary human prompting event before that harness's CEL predicate; to each actor-originated @@ -193,9 +224,10 @@ Source-specific bot and label grants require their own provider evidence. - Current Go CEL dispatch enforces the v1 role-derived default for ordinary human events, and bash routes retain their stage guards. Explicit or guarded overlay `human_min_role` values, selected-minimum checks for human label - additions and actor-originated entity and model records, and the pinned - policy handoff remain target behavior. The field cannot become effective - policy until the loader validates and enforces it. + additions and actor-originated entity and model records, and run-time policy + reload and launch rechecks remain target behavior. The + field cannot become effective policy until the loader validates and enforces + it. - A harness author may deliberately set `human_min_role: triage` for a write-capable role; that permits `triage` actors and records to guide that harness without changing its minted capabilities. @@ -203,6 +235,6 @@ Source-specific bot and label grants require their own provider evidence. selected harness's minimum; verified actor roles may be reused, but pass decisions and filtered views cannot be reused across different minima. - [Entity-context-snapshot v1](../normative/entity-context-snapshot/v1/README.md) - retains its category-derived `triage`/`write` threshold. Snapshot admission + retains its observation/mutation-derived `triage`/`write` threshold. Snapshot admission with a differing override or a higher role requires a versioned contract before migration. diff --git a/docs/normative/authorization/v2/README.md b/docs/normative/authorization/v2/README.md index 05f768ac47..75862a3507 100644 --- a/docs/normative/authorization/v2/README.md +++ b/docs/normative/authorization/v2/README.md @@ -2,6 +2,11 @@ Normative rules for event actors, entity CEL facts, and model-bound records. +This is the target contract for CEL/entity routes and their v2 model-bound +admission after migration. Legacy non-CEL, non-entity workflow configurations +remain governed by Authorization v1 and their existing workflow guards; these +new per-harness and entity rules do not apply to them. + This version keeps a `triage` platform floor for humans, including the narrow verified label-transition grant below, and applies the selected harness's effective `human_min_role` to prompting events, actor-originated facts needed @@ -196,8 +201,8 @@ harness-specific actor gate or trigger CEL. An overlay that sets this field MUST pass [ADR 0112](../../../ADRs/0112-overlays-may-set-any-harness-field.md)'s guarded-field dependency validation: its `when:` may read only the normalized event specification's trusted event or entity fields, platform-verified -`runtime.forge`, and `config` from the same pinned trusted revision as the -harness, plus the versioned verified effective-role input. That input is +`runtime.forge`, and `config` from the pinned trusted target-repository +revision, plus the versioned verified effective-role input. That input is trusted for this guard only when its identity, target, source, and role are independently verified. Guard inputs and their provenance MUST be available without using actor-filtered entity facts, model content, or a previous @@ -216,38 +221,51 @@ the capabilities of every harness using a role. ADR 0112's trusted-field check is a dependency check, not proof that the matching value is safe. For example, a change author can choose a fork, but -only a writer can make `is_fork` false. A harness that conditionally lowers a -stricter top-level minimum SHOULD have a `when:` that positively establishes -the trusted condition for which the lower minimum is intended. An unconditional -lower value belongs at the top level. The final selected minimum applies to -the prompting actor and to other actors' decision-relevant facts and -model-bound records for the entire evaluation cycle. +only a writer can make `is_fork` false. A layer's non-overlay +`human_min_role` is its overlay baseline: use the layer's explicit scalar when +present, otherwise the inherited value, otherwise the role-derived default. +A matching overlay MAY preserve or lower that baseline only; it MUST NOT raise +it. To conditionally require a stronger minimum, set that stronger value as +the non-overlay baseline and let matching overlays lower it only when their +trusted guard proves the relaxation is intended. A known-absent guard is a +nonmatch, so the baseline remains at least as restrictive as every overlay +value. The final selected minimum applies to the prompting actor and to other +actors' decision-relevant facts and model-bound records for the entire +evaluation cycle. A known absent event or optional key is a nonmatch under ADR 0112. If required verified guard metadata is unavailable, or the CEL evaluation has another error, Fullsend MUST fail the evaluation rather than treating the error as a nonmatch and using a possibly weaker default. All processes that make an -admission decision MUST use the same verified guard context and ordered -overlay result; dispatch cannot resolve the guard without an event and let run -resolve it again with one. If a guard needs `entity.source.system`, Fullsend -MUST obtain only that provider-verified structural metadata from the event or -candidate identity, or with a platform discovery credential independent of -the still-unpinned harness run credential. It MUST NOT acquire actor-originated -entity facts for this purpose. - -The agent registry and local child and `base` harness files that determine -`role` or `human_min_role` MUST come from one actor-independent, trusted -checkout pinned to an immutable revision. For a change-proposal event, that is -the provider-verified target/base commit, never the proposed head; for other -events, it is a trusted repository revision selected and pinned by the -platform. An actor-supplied ref, CEL input, proposed head checkout, or mutable -target working tree MUST NOT select or replace these policy files or their -revision. A remote registered harness or `base` layer MUST be selected through -that trusted registry and base chain, pass a trusted remote-resource allowlist, -and have its content verified against a declared hash before contributing -`role` or `human_min_role`. A hash or allowlist match alone does not authorize -an actor-supplied remote source. Configured actor-permission sources retain -their separate trusted-ref and freshness requirements below. +admission decision MUST resolve overlays from one verified context within +that decision. A later bound `run` is a new decision: it MUST reload trusted +config and harness sources and recompute the guard context and ordered overlay +result against its current canonical entity. It MUST NOT reuse a dispatch or +poll allow as authority. For an event-bound run, the integrity-bound verified +event remains the event input; current entity and policy inputs are resolved +again. If a guard needs `entity.source.system`, Fullsend MUST obtain only that +provider-verified structural metadata from the event or candidate identity, or +with a platform discovery credential independent of the still-unpinned +harness run credential. It MUST NOT acquire actor-originated entity facts for +this purpose. + +Policy inputs have separate trusted revision identities. The target-repository +checkout pins `.fullsend/config.yaml` and any `config` facts used by an overlay; +for a change-proposal event this is the provider-verified target/base commit, +never the proposed head. Local harness and `base` files in that checkout share +its revision. For other events, the platform selects and pins an equivalent +trusted target revision. An actor-supplied ref, CEL input, proposed head +checkout, or mutable target working tree MUST NOT select or replace these +policy files or their revision. + +A remote registered harness or `base` layer MUST be selected through that +trusted registry and base chain, pass a trusted remote-resource allowlist, and +have its content verified against a declared hash before contributing `role` +or `human_min_role`. Its source revision and content hash are separate inputs +to the composed policy identity; they do not share the target-repository +revision. A hash or allowlist match alone does not authorize an actor-supplied +remote source. Configured actor-permission sources retain their separate +trusted-ref and freshness requirements below. `human_min_role` constrains human actors and their records only. A provider-classified bot using the exact verified label handoff or a bot with @@ -272,26 +290,39 @@ invocation provenance, rather than a human event actor, authorizes eventless entity discovery; decision-relevant actor-originated facts still pass the selected harness's minimum. -A harness evaluation and any sandbox it starts MUST use one trusted composed +Each evaluation cycle and any sandbox it starts MUST use one trusted composed harness revision, resolved `role`, and effective `human_min_role`. Fullsend -MUST pin that policy before the first harness-specific actor gate and retain it -through event admission, entity CEL, snapshot and model-record checks, and -later Fullsend-controlled retrieval. Its policy identity MUST bind the trusted -checkout revision, registry and composed harness content digest, trusted -remote-resource allowlist revision or digest, verified remote-layer hashes, -resolved `role`, ordered overlay matches and overrides, verified guard inputs -and provenance, effective minimum, and its top-level, overlay, or default -source. When dispatch, execution, or retrieval use separate processes, the -handoff MUST preserve this identity with integrity. The receiver MUST verify the pin -against its loaded policy before minting or using harness credentials and -before admitting content. Passing only an agent name or -credential role is insufficient. If the policy changes mid-cycle, Fullsend -MUST either retain the original verified pin for the whole cycle or stop and -re-evaluate from the first gate under a new trusted revision; it MUST NOT +MUST pin that policy within the cycle and retain it through that cycle's actor, +entity, and model-record checks. Its policy identity MUST bind +the trusted checkout revision, registry and composed harness content digest, +trusted remote-resource allowlist revision or digest, verified remote-layer +hashes, resolved `role`, ordered overlay matches and overrides, verified guard +inputs and provenance, effective minimum, and its top-level, overlay, or +default source. + +For a separate bound `run`, the dispatch/poll handoff identifies the candidate +harness and event/entity binding; it is not an authorization decision. Before +model-context acquisition/staging or sandbox launch, `run` MUST independently +reload the trusted target config and selected harness/base chain, reevaluate +applicable `config.yaml` `when` flags and harness overlays against current +verified inputs, re-fetch the bound canonical entity, and recheck all current +authorization and launch conditions under +[ADR 0144](../../../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md). +This includes the prompting-event gate when an event is present, trusted +Fullsend-origin gate when it is absent, actor/fact admission, and trigger CEL. +The run MUST then pin the policy identity it actually verified and use that +same identity throughout its own context-staging, sandbox, and model-record +checks. +Dispatch and run policy identities do not have to match: a change between +them is handled by this fresh run-time evaluation, not by inheriting the +earlier allow. If current inputs cannot be loaded or verified, or the candidate +no longer meets the current gates, `run` MUST stop before context exposure or +launch. If policy changes during a single run cycle, Fullsend MUST stop or +re-evaluate from the first gate under the newly loaded policy; it MUST NOT silently mix minima or overlay outcomes. A changed guard result or an expired -guard claim requires the same stop or first-gate re-evaluation. If the receiver -cannot verify the handoff pin, it MUST stop and MAY restart authorization from -the first gate. A new child cycle under +guard claim requires the same stop or first-gate re-evaluation. The run's own +trusted source revisions and effective policy MUST be recorded for audit. A +new child cycle under [ADR 0144](../../../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md) may resolve and record a new pin. @@ -309,12 +340,14 @@ authorization denial. For each selected harness, the event-admission audit MUST bind the verified actor identity, effective role and source or narrow label-grant evidence, the -policy identity above, and the gate outcome, including denial before CEL. A -cross-process handoff records the policy identity sent and verified, or the -reason verification failed and authorization restarted or stopped. A bot -decision records its registered role or verified label-transition evidence -instead of a human role. An early platform-floor denial records the actor -evidence and floor outcome. +policy identity above, and the gate outcome, including denial before CEL. For +separate dispatch/poll and run processes, the audit records both the policy +used for candidate selection and the independently loaded run policy, plus the +run-time recheck outcome. A dispatch policy identity forwarded in the handoff +is correlation evidence only; it is not permission and need not match the run +policy. A bot decision records its registered role or verified +label-transition evidence instead of a human role. An early platform-floor +denial records the actor evidence and floor outcome. ### Current dispatch compatibility @@ -341,8 +374,30 @@ harnesses or set their role requirements. After provider-backed > a configured `human_min_role` it cannot parse, validate, or enforce rather > than silently treat it as absent. The field cannot be deployed as effective > policy while a selected runner still ignores it. The current execution -> matrix carries agent name and credential role, not the composed policy -> identity required for a v2 cross-process handoff. +> matrix carries an agent name and credential role; these are candidate-routing +> metadata, not an authorization result. V2 requires an integrity-bound +> candidate and event/entity handoff plus an independent run-time policy +> recheck. +> +> The legacy stage workflow pins the target repository's `.fullsend/config.yaml` +> to the PR base commit. `run` first uses a configured local or URL source; +> remote config sources require a declared SHA-256. A source-less built-in +> entry is only an override and falls back to `fullsend-ai/agents`. Each `run` +> resolves that fallback's release tag (or `main` for a source build) to a +> commit SHA and fetches from the SHA-pinned URL, but does not verify a declared +> content hash. The legacy route resolves its harness in one `run`; CEL dispatch +> and its later `run` currently resolve independently. A v2 CEL/entity `run` +> MUST reload the trusted config and harness, recompute config `when` flags, +> harness overlays, and trigger CEL, and recheck launch gates against the +> current entity. The dispatch/poll result is a candidate only; the policy +> actually loaded by `run` is pinned for that run's own checks through context +> staging and sandbox launch. A changed source between dispatch and run +> triggers a new evaluation rather than a same-revision requirement. Current +> behavior is visible in +> [`reusable-dispatch.yml` at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/.github/workflows/reusable-dispatch.yml#L135-L148), +> [`run.go` source selection at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/internal/cli/run.go#L7200-L7249), +> [`config.go` URL pin validation at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/internal/config/config.go#L601-L608), +> and [`run.go` fallback resolution at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/internal/cli/run.go#L7262-L7361). ## Fail-closed behavior @@ -374,9 +429,10 @@ to the compatibility rules until implementation migration is complete. | `actor.role_verified` is false for a human, including a verified label addition | Ignore `actor.role`; require a separate verified configured-source role meeting the selected harness minimum, or the exact human label grant for a `triage` minimum; otherwise deny | | Trusted harness `human_min_role` is invalid or the resolved harness role or revision is unverifiable | Deny that harness; do not silently use the default or evaluate its CEL predicate | | An overlay setting `human_min_role` reads an untrusted or admission-dependent field | Reject that harness configuration before resolution | +| An overlay value is above its layer's non-overlay baseline | Reject that harness configuration before resolution; overlays may only preserve or lower the baseline | | A `human_min_role` guard lacks required verified evidence or has a CEL evaluation error | Fail the evaluation; do not treat the overlay as a nonmatch or use a fallback minimum | -| Dispatch, run, or retrieval cannot verify the same ordered overlay outcome and guard context | Stop; optionally restart authorization from the first gate with a newly pinned policy | -| The selected harness policy changes within an evaluation or sandbox cycle | Retain the original pinned revision and minimum for the entire cycle, or stop and re-evaluate from the first gate under the new revision; never mix them | +| A bound CEL/entity `run` cannot reload the trusted config/harness or re-evaluate current config `when` flags, overlays, and launch gates | Stop before context acquisition/staging or sandbox launch; the dispatch/poll decision is only a candidate selection | +| The selected harness policy changes within one evaluation or run cycle | Retain that cycle's verified policy identity, or stop and re-evaluate from the first gate under the new revision; never mix them | | Human event actor meets the platform `triage` floor but not the selected harness minimum | Deny that harness before CEL; other harnesses are evaluated under their own minimums | | Legacy bot event has an `actor.role` other than `none` | Valid in the v1 compatibility schema; authorization follows current compatibility behavior during migration and is not an ADR 0107 bot-role authorization result | | `actor.role_verified` is false but `actor.bot_role` is non-null for a bot | Event fails `NormalizedEvent` validation; never reaches dispatch | @@ -500,6 +556,12 @@ enabled until the versioned normalized-entity contract defines CEL-eligible and prompt-eligible fields and their coverage states. That contract is a platform allowlist; a harness may request fewer fields but cannot expand it. +> **Planned:** Entity-source CEL is not implemented and remains disabled until +> the [normalized-entity contract tracked by issue #8420](https://github.com/fullsend-ai/fullsend/issues/8420) +> and the run-time authorization and launch checks described here are +> implemented. Legacy non-CEL, non-entity workflows remain on Authorization +> v1. + With a prompting event, the event-actor authorization gate for the selected harness still runs before its CEL predicate; neither discovery nor an entity-source query replaces it. The event actor authorizes that event, not @@ -931,8 +993,10 @@ The `triage` floor and the narrow human-label and bot grants are platform-level security boundaries. Individual repositories cannot disable or lower them. A trusted harness author MAY set `human_min_role` at the top level or in an ADR 0112 trusted-fact-guarded overlay to `triage`, `write`, -`maintain`, or `admin`. This may lower a harness's `write` default to `triage` -or raise its minimum; the selected value applies to human event, entity-fact, +`maintain`, or `admin`. The top-level or inherited non-overlay value is the +baseline; an overlay MAY preserve or lower it, never raise it. This lets a +trusted condition relax a stronger default while a missing condition safely +retains that default. The selected value applies to human event, entity-fact, and model-record admission alike. A repository may disable a harness or use trigger CEL to require additional conditions, but cannot make it available to a human rejected by either admission gate. A source event may select the field @@ -958,7 +1022,9 @@ entity-source CEL only. immutable `triage` platform floor and the selected harness's effective `human_min_role` for human event, entity-fact, and model-record admission. The resolved harness `role` supplies the default map above; an explicit top-level -or trusted-fact-guarded overlay value may change it within the allowed range. +or trusted-fact-guarded overlay value may change it within the allowed range, +subject to the rule that overlays may only preserve or lower their non-overlay +baseline. Trigger CEL may further narrow selection but does not replace the admission minimum. V2 retains v1's role-derived defaults; a resolved explicit or guarded-overlay value supersedes the fixed default for that harness across @@ -967,7 +1033,8 @@ release checkpoints remain. Migration MUST teach harness loading and `base` composition to recognize and validate `human_min_role` with key-presence awareness, including in overlay -entries, before the value can affect any v2 decision. The versioned CEL schema +entries, and reject an overlay value above its non-overlay baseline before the +value can affect any v2 decision. The versioned CEL schema MUST name and classify the verified effective-role path before a role-based minimum overlay can run. An explicit empty or invalid value MUST NOT silently inherit or default during scalar merge; a @@ -979,16 +1046,23 @@ also requires versioned event and entity CEL inputs that carry verified effective roles and distinguish exact label-grant provenance. Existing authorization-sensitive CEL comparisons against an unverified legacy role MUST be migrated before v2 routing. Migration also -requires dispatch and run to use the same verified overlay guard context, a -verified policy-identity handoff with the ordered overlay outcome and minimum, -per-harness event and entity actor gates, and an entity-context-snapshot v2 -contract that can represent all four allowed minimums and the changed -record-admission rule. +requires the handoff to integrity-bind the candidate harness and event/entity +locator, and requires `run` to reload the trusted target config and harness/base +sources, recompute config `when` flags, harness overlays, and trigger CEL, and +recheck current authorization and launch gates against the canonical entity +under ADR 0144 before ADR 0141 context staging or sandbox launch. The run +records and pins the policy identity it actually verifies through its own +context, actor, and model-record checks. +The dispatch/poll policy identity may differ; it is not permission and need not +be verified as the same revision at run. Migration also requires per-harness +event and entity actor gates and an entity-context-snapshot v2 contract that +can represent all four allowed minimums and the changed record-admission rule. [Entity-context-snapshot v1](../../entity-context-snapshot/v1/README.md) -retains its historical stage-derived `triage`/`write` rule until that +retains its historical observation/mutation-derived `triage`/`write` rule until that migration. -Authorization v1 remains authoritative for existing dispatch during -migration, including its bash thresholds and Go role-derived defaults. An +Authorization v1 remains authoritative for existing legacy non-CEL, +non-entity workflows during migration, including their bash thresholds and Go +role-derived defaults. An explicit per-harness minimum change under v2 is a harness-policy change bound to that harness's reviewed revision, not a normative contract version change. Breaking changes to v2 require `docs/normative/authorization/v3/`. From 7de832a07b2bdaf7e197b3205601a2749a4a1c35 Mon Sep 17 00:00:00 2001 From: Barak Korren Date: Wed, 28 Oct 2026 15:59:03 +0200 Subject: [PATCH 7/7] docs(adr): simplify CEL authorization decisions Signed-off-by: Barak Korren Assisted-by: Codex (gpt-6) --- ...thorization-on-all-agent-dispatch-paths.md | 2 +- docs/ADRs/0061-harness-cel-dispatch.md | 2 +- .../0098-entity-first-harness-evaluation.md | 2 +- ...y-resolution-for-dispatch-authorization.md | 2 +- ...0112-overlays-may-set-any-harness-field.md | 2 +- ...actor-attributed-data-security-boundary.md | 2 +- ...inistic-filtered-entity-context-staging.md | 2 +- ...use-poll-and-entity-bound-run-processes.md | 2 +- ...tity-cel-over-selectively-acquired-data.md | 147 +++-------- ...use-verified-actor-roles-for-entity-cel.md | 66 ++--- .../ADRs/0151-common-actor-admission-floor.md | 240 ------------------ docs/ADRs/0151-harness-human-role-minimums.md | 95 +++++++ docs/architecture.md | 8 +- docs/contributing/harness-fields.md | 2 +- docs/normative/authorization/v1/README.md | 2 +- docs/normative/authorization/v2/README.md | 13 +- .../entity-context-snapshot/v1/README.md | 2 +- docs/problems/agent-architecture.md | 2 +- docs/problems/agent-infrastructure.md | 2 +- docs/problems/operational-observability.md | 2 +- docs/problems/security-threat-model.md | 4 +- 21 files changed, 178 insertions(+), 423 deletions(-) delete mode 100644 docs/ADRs/0151-common-actor-admission-floor.md create mode 100644 docs/ADRs/0151-harness-human-role-minimums.md diff --git a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md index 141c00e447..d307f163e5 100644 --- a/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md +++ b/docs/ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md @@ -40,7 +40,7 @@ the preserved GitHub label handoff exception are decided in [ADR 0107](0107-bot- Fullsend-originated entity discovery without a prompting event. Event-backed dispatch remains subject to this ADR's actor authorization gate. -[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the human +[ADR 0151](0151-harness-human-role-minimums.md) partially supersedes the human permission threshold for target CEL-routed event admission. The platform keeps a non-waivable `triage`-level floor, satisfied by a verified role or the narrow verified label-transition grant, and enforces each selected harness's effective diff --git a/docs/ADRs/0061-harness-cel-dispatch.md b/docs/ADRs/0061-harness-cel-dispatch.md index d18462adfe..f3d0d56dae 100644 --- a/docs/ADRs/0061-harness-cel-dispatch.md +++ b/docs/ADRs/0061-harness-cel-dispatch.md @@ -26,7 +26,7 @@ Only the event-only CEL context is superseded by predicate but evaluates it against a resolved entity and optional event. The remaining decisions in this ADR remain accepted. -[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the +[ADR 0151](0151-harness-human-role-minimums.md) partially supersedes the authorization-before-harness-enumeration ordering: the ordinary human `triage` floor may run before loading harnesses, with a narrow verified label grant for its exact transition. Each trusted harness's effective `human_min_role` is diff --git a/docs/ADRs/0098-entity-first-harness-evaluation.md b/docs/ADRs/0098-entity-first-harness-evaluation.md index c1fefcb579..4650945607 100644 --- a/docs/ADRs/0098-entity-first-harness-evaluation.md +++ b/docs/ADRs/0098-entity-first-harness-evaluation.md @@ -51,7 +51,7 @@ bounded role reuse across entity-CEL checks and partially supersedes the permission-at-evaluation-time rule. Trusted-origin, event-actor, and model-bound authorization remain required. -[ADR 0151](0151-common-actor-admission-floor.md) replaces the observation/mutation-derived +[ADR 0151](0151-harness-human-role-minimums.md) replaces the observation/mutation-derived human threshold for decision-relevant entity facts with the selected harness's effective `human_min_role`, enforced by the platform above an immutable `triage` floor. Actor provenance and fail-closed filtering remain required. diff --git a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md index 49a3eeebe0..f011ca35d2 100644 --- a/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md +++ b/docs/ADRs/0107-bot-identity-resolution-for-dispatch-authorization.md @@ -19,7 +19,7 @@ Date: 2026-09-27 Accepted -[ADR 0151](0151-common-actor-admission-floor.md) requires a human labeler to +[ADR 0151](0151-harness-human-role-minimums.md) requires a human labeler to meet the selected harness's effective `human_min_role` for target CEL dispatch; the accepted label mutation alone no longer bypasses a stronger human minimum. This ADR's provider-classified bot label grant and registered-bot gate remain. diff --git a/docs/ADRs/0112-overlays-may-set-any-harness-field.md b/docs/ADRs/0112-overlays-may-set-any-harness-field.md index f5996da2bc..4a64f0b940 100644 --- a/docs/ADRs/0112-overlays-may-set-any-harness-field.md +++ b/docs/ADRs/0112-overlays-may-set-any-harness-field.md @@ -21,7 +21,7 @@ Date: 2026-10-01 Accepted -[ADR 0151](0151-common-actor-admission-floor.md) treats `human_min_role` as a +[ADR 0151](0151-harness-human-role-minimums.md) treats `human_min_role` as a guarded overlay field. Its ordered overlay outcome and effective value must be resolved from verified pre-admission facts and pinned before the harness's actor gate; the deprecated `forge:` block cannot set it. The other overlay diff --git a/docs/ADRs/0133-actor-attributed-data-security-boundary.md b/docs/ADRs/0133-actor-attributed-data-security-boundary.md index 7b7bf73f48..9ffbe5e61e 100644 --- a/docs/ADRs/0133-actor-attributed-data-security-boundary.md +++ b/docs/ADRs/0133-actor-attributed-data-security-boundary.md @@ -19,7 +19,7 @@ Date: 2026-10-07 Accepted -[ADR 0151](0151-common-actor-admission-floor.md) replaces the +[ADR 0151](0151-harness-human-role-minimums.md) replaces the observation/mutation-derived human threshold for Fullsend-controlled model-bound records with the selected harness's effective `human_min_role`, enforced above an immutable `triage` floor. Current-revision actor checks, diff --git a/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md b/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md index 58cebad252..d3296b19fb 100644 --- a/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md +++ b/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md @@ -19,7 +19,7 @@ Date: 2026-09-07 Accepted -[ADR 0151](0151-common-actor-admission-floor.md) partially supersedes the +[ADR 0151](0151-harness-human-role-minimums.md) partially supersedes the human threshold inherited from ADR 0133 for Fullsend-controlled model-bound snapshot records in the target contract: admission uses the selected harness's effective `human_min_role` above an immutable `triage` floor. Snapshot v1 diff --git a/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md b/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md index 17b5bbf068..16ec8b154e 100644 --- a/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md +++ b/docs/ADRs/0144-reuse-poll-and-entity-bound-run-processes.md @@ -36,7 +36,7 @@ separately permits bounded role reuse for entity CEL in place of mandatory per-check actor-role refresh. The lifecycle, due-check scheduling, current entity resolution, and fresh model-bound authorization rules remain current. -[ADR 0151](0151-common-actor-admission-floor.md) makes the selected harness's +[ADR 0151](0151-harness-human-role-minimums.md) makes the selected harness's effective `human_min_role` the platform-enforced threshold for each cycle's event actor (when present), decision-relevant entity facts, and Fullsend-controlled model records. Eventless checks still require trusted diff --git a/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md b/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md index 38f93c9d25..86d6c04bb7 100644 --- a/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md +++ b/docs/ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md @@ -20,45 +20,23 @@ Date: 2026-10-22 Accepted Partially supersedes [ADR 0098](0098-entity-first-harness-evaluation.md)'s -pre-CEL enumeration and actor-permission resolution for every -action-indicating element, and its complete audit roster. The trusted-origin -gate and authorization of decision-relevant action facts remain. Also -partially supersedes [ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md)'s -complete-entity due checks and full-history audit roster. Its process -lifecycle and model-bound staging rules remain. This ADR does not change -actor-role freshness; [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md) -addresses that separately. -[ADR 0151](0151-common-actor-admission-floor.md) separately sets the platform -human actor floor and each harness's human minimum for CEL and model admission. +pre-CEL enumeration, per-element permission refresh, and full audit roster. It +also replaces [ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md)'s +full-entity due checks and full-history audit roster. Their trusted-origin, +process-lifecycle, and model-bound staging rules remain. Actor-role reuse is +defined by [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md), and +actor admission by [ADR 0151](0151-harness-human-role-minimums.md). ## Context [ADR 0098](0098-entity-first-harness-evaluation.md) and -[ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md) require a complete -entity and current actor checks across all action-indicating history before an -entity-source harness evaluates CEL. The corresponding -[Authorization Contract v1](../normative/authorization/v1/README.md) also -requires an audit roster of every retained element and actor. A state-only or -short-circuiting predicate can often be decided without those unrelated API -reads or audit entries. A progressive check may inspect multiple pages; -repeating a role lookup for the same actor on each iteration compounds provider -load. The [observability problem](../problems/operational-observability.md#structured-traces) -already favors references to durable inputs over duplicating source data. -For Git-forge work, [ADR 0141](0141-deterministic-filtered-entity-context-staging.md) -separately assembles selected model inputs before the sandbox starts. -[ADR 0063](0063-polling-based-work-discovery.md)'s `lastCheck` rule advances -after scheduling a reconstructed-event run; a new entity-source candidate -handoff needs its own retry or rediscovery guarantee. - -Entity routing remains a target design: at -[`a2be1678`](https://github.com/fullsend-ai/fullsend/blob/a2be1678c5dbd9361a77f04de5ec260320e4fb9f/internal/harness/trigger.go#L12-L16), -the trigger CEL environment still declares only `event`. - -> **Planned:** Entity-source CEL is not implemented and remains disabled until -> the [normalized-entity contract tracked by issue #8420](https://github.com/fullsend-ai/fullsend/issues/8420), -> selective evaluator, and authorization gates are implemented. Legacy -> non-CEL, non-entity workflows continue under their existing authorization -> contract. +[ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md) require complete +entity history before entity-source CEL evaluation. That can cause unrelated +provider reads for state-only or short-circuiting predicates. Progressive +evaluation can also repeat role lookups for the same actor. Entity-source CEL +remains disabled pending the [normalized-entity contract tracked by issue +#8420](https://github.com/fullsend-ai/fullsend/issues/8420), which must define +partial-data and coverage semantics. Existing event-only routes are unchanged. ## Options @@ -74,84 +52,27 @@ proof that a result cannot change when more data is fetched. ## Decision -Adopt selective, progressive acquisition for entity-source CEL evaluation. -The platform retains a closed classification of action-indicating categories, -but fetches only fields and history that could affect the evaluated harness's -predicate. It derives a conservative acquisition plan from the compiled CEL -expression and may push sound filters into provider queries. Projections of -classified action-indicating elements inherit their source records' actor -dependencies. Provider aggregates affected by unauthorized records cannot -enter the authorized CEL view unchanged. -Whether a state field needs an actor check depends on how CEL uses it. An -ordinary human-driven change that can make the check actionable requires its -actor's verified effective role to meet the platform floor and the evaluated -harness's `human_min_role`. An exact verified label transition may instead use -the narrow grant described below. CEL may narrow selection further. -When `updated_at` advances on each forge update, elapsed -time can make a staleness check on that raw field actionable without checking -every historical updater; any update can defer it. A query plan must not hide a -potentially authorized match. - -The evaluator retains fetched entity data and verified actor roles while it -progressively enriches one check. An in-memory or trusted shared cache may -reuse entity data across checks only when its revision and coverage are -validated as current; an accepted event or wake invalidates affected entity -facts. Within one check, an iteration may reuse a verified role for an actor -it has already resolved while that verdict remains eligible under -[ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md)'s age bound; an -expired verdict must be refreshed before it contributes to a definitive -decision. Each iteration applies the platform floor and the evaluated harness's -effective `human_min_role` to ordinary human actor-originated facts that could -make the predicate actionable. Exact verified label transitions and registered -bots follow their separate admission paths below; verified effective roles, -when present, remain available to CEL. -Raw state used only for the conservative deferral described above is not actor -authority. ADR 0148 separately permits reuse across checks. - -Partial entity data must distinguish not-yet-loaded data from absent or empty -data. A CEL result is definitive `true` or `false` only when every complete -entity consistent with acquired facts, proven source coverage, and the -applicable actor-authorization results yields that result. -Otherwise the platform records `UNKNOWN` and either fetches more relevant data -for re-evaluation or passes an unresolved candidate from `poll` to a bound -`run` for further reading. Exhausted budgets or unavailable, inconsistent, or -unverifiable evidence end as inconclusive, never as empty or false. `poll` may -stop on definitive false, subject to [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md)'s -cache-dependent recheck rule. Its definitive true selects a candidate for bound -`run`, which must recheck current evidence before launching a sandbox. A -handoff is provisional: scheduling or delivering the run does not resolve the -candidate. For any incomplete `poll` check or provisional handoff, discovery -retains a durable retry path or proves its source query will rediscover the -candidate after checkpoint advancement. A failed or inconclusive `run` leaves -the candidate retryable. A definitive false closes the current handoff only -after any cache-dependent recheck is scheduled under ADR 0148; completed -actionable work or safe deferral under ADR 0144 also closes it. `run` launches -a sandbox only after its own definitive true. Absence, negation, counts, and -universal conditions may still require complete coverage of relevant scopes. - -Before a classified action-indicating entity fact can influence CEL, Fullsend -verifies its source-revision actor and applies the actor and fact gates defined -by [ADR 0151](0151-common-actor-admission-floor.md) and -[Authorization Contract v2](../normative/authorization/v2/README.md). -Independent history needs its own actor gate. Verified effective roles, when -present, remain available to CEL for further harness conditions. - -Unauthorized records are excluded. Unrelated history need not be fetched, -authorized, or listed in the audit. Each check records its verified initiator, -entity, repository, effective policy, harness revision and `human_min_role`, -decision time, dependency and query scopes, and bounded evidence of source -coverage and actor-check outcomes. Identifiable witnesses for a positive -decision retain actor provenance; collection-wide decisions may bind counts, -digests, and source references to the checked -coverage and authorization source instead of listing every record and actor. -Event-actor and model-bound gates remain separate; ADR 0151 applies the same -effective harness minimum to their ordinary human actors. - -The breaking change to enumeration and audit guarantees is specified by -[Authorization Contract v2](../normative/authorization/v2/README.md), as -required by [ADR 0015](0015-normative-specifications-directory.md). -Entity-source CEL remains disabled until a versioned normalized-entity -contract defines partial data, coverage, and concurrency semantics. +1. Keep the platform's action-indicating categories closed. Acquire only fields + and history that could affect the compiled predicate, using a conservative + plan and only sound provider filters. +2. Return `true` or `false` only when fetched facts and proven coverage establish + that result for every complete entity consistent with the evidence. Otherwise + return `UNKNOWN` and fetch more relevant data or leave the candidate + unresolved. Missing, unavailable, inconsistent, or exhausted evidence is + never treated as false or empty. +3. Fetch, authorize, and audit only decision-relevant facts. Unrelated history is + neither fetched nor listed, and provider aggregates affected by excluded + records cannot enter the authorized view unchanged. +4. Record bounded decision evidence—query scopes, coverage, and witness + provenance—as specified in [Authorization Contract v2](../normative/authorization/v2/README.md). + +[ADR 0151](0151-harness-human-role-minimums.md) defines actor admission and +human-minimum rules. [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md) +defines verified-role reuse. [ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md) +continues to define the bound-run lifecycle. Authorization Contract v2 +specifies the evaluation, audit, and incomplete-candidate retry rules under +[ADR 0015](0015-normative-specifications-directory.md); it does not change +legacy non-CEL, non-entity workflows. ## Forge scope diff --git a/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md b/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md index b372c24c0f..8c630de710 100644 --- a/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md +++ b/docs/ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md @@ -26,7 +26,7 @@ actor-role refresh at every due check and prohibition on a cached authorization result substituting for that refresh. This exception applies only to entity-source CEL. Event admission and model-bound content admission retain their separate fresh authorization rules. -[ADR 0151](0151-common-actor-admission-floor.md) sets the platform human floor +[ADR 0151](0151-harness-human-role-minimums.md) sets the platform human floor and effective harness minimum without extending this cache to either gate. ## Context @@ -63,50 +63,26 @@ provider results. ## Decision -For entity-source CEL only, Fullsend may reuse a completed provider-verified -human permission result or exact registered-bot-role result across progressive -iterations, separate checks and harnesses, and `poll` and bound `run` -processes. A trusted host-owned cache may be local or shared between -processes. Versioned platform policy must set an explicit maximum age of no -more than five minutes, measured absolutely from the authoritative lookup's -start; absent that policy, cross-check reuse is disabled. A deployment may -choose a shorter age, but a cache hit never renews expiry and a harness or -repository cannot widen it. Verified denials may be cached under the same -bound. Failed, incomplete, or unverifiable lookups are not cache entries and -cannot fall back to an older entry. -The cache stores the verified effective role or verified absence, not a -per-harness threshold result or CEL decision. Harnesses with different -`human_min_role` values may reuse the same role verdict but must each compare -it with their own effective minimum. An exact label-transition grant is not -an actor-role verdict and cannot be stored in this cache. - -Cache keys and invalidation must isolate the source provider and tenant, -target repository or project, immutable actor identity, effective permission -source and policy revision, and the selected source ref plus relevant OWNERS, -OWNERS_ALIASES, or bot-registration source revision. A known change to a grant, -OWNERS, OWNERS_ALIASES, bot registry, or policy invalidates affected entries. -Every check separately validates current entity facts, their -source-revision actor attribution, and query coverage. It applies the actor -and fact gates in [ADR 0151](0151-common-actor-admission-floor.md) and -[Authorization Contract v2](../normative/authorization/v2/README.md) to those -current facts, then evaluates its CEL predicate. A wakeup invalidates affected entity facts; -it does not by itself turn an unexpired actor-role result into a fresh one. -If cached authorization contributes to a false CEL result, discovery must -schedule a recheck or guarantee rediscovery after expiry or known invalidation -within a bounded reconciliation interval, even when the entity itself has not -changed. - -A bound `run` may use an unexpired shared result for its final CEL check and -sandbox admission, but it re-resolves the entity and reevaluates CEL before -each sandbox cycle rather than adopting `poll`'s verdict. If a deciding role -expires or is invalidated before admission, `run` must refresh it and -re-evaluate, or leave the candidate inconclusive without launching a sandbox. -The cache does not authorize a prompting event or model-bound content. The -[ADR 0133](0133-actor-attributed-data-security-boundary.md) gate retains its -fresh checks. The audit records the effective maximum age, lookup time -and age of role evidence used for a CEL decision, and whether it came from a -shared cache, using the bounded evidence format in -[Authorization Contract v2](../normative/authorization/v2/README.md). +For entity-source CEL, Fullsend may reuse completed, provider-verified human +role results and exact registered-bot-role results across progressive checks, +harnesses, and `poll`/bound `run` processes. A trusted host-owned cache may be +local or shared. The initial maximum age is five minutes from lookup start. +This is an arbitrary starting cap, not a measured optimum. After entity polling +is in production, revisit the cap using observed authorization-freshness needs +and SCM API rate-limit pressure. A platform policy may choose a shorter age; +without that policy, cross-check reuse is disabled. Cache hits never renew +expiry. Completed positive and negative verdicts may be cached; failed, +incomplete, or unverifiable results may not. + +The cache stores a verified role or verified absence, not a harness threshold +result or CEL decision. Each harness applies its own `human_min_role`, and an +exact label-transition grant is never cached as a role. Cache identity and +invalidation isolate each verified permission source and its revision; the +exact key dimensions and audit evidence are specified by +[Authorization Contract v2](../normative/authorization/v2/README.md). Every +check still validates current entity facts, actor attribution, and coverage. +A bound `run` re-resolves the entity and evaluates its own CEL result before a +sandbox cycle. Event admission and model-bound content retain their fresh gates. ## Forge scope diff --git a/docs/ADRs/0151-common-actor-admission-floor.md b/docs/ADRs/0151-common-actor-admission-floor.md deleted file mode 100644 index 69eb96aad8..0000000000 --- a/docs/ADRs/0151-common-actor-admission-floor.md +++ /dev/null @@ -1,240 +0,0 @@ ---- -title: "151. Use harness human-role minimums for actor admission" -status: Accepted -relates_to: - - agent-architecture - - security-threat-model -topics: - - authorization - - cel - - data-security ---- - -# 151. Use harness human-role minimums for actor admission - -Date: 2026-10-23 - -## Status - -Accepted - -This decision partially supersedes the human permission thresholds in -[ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md), -[ADR 0098](0098-entity-first-harness-evaluation.md), -[ADR 0133](0133-actor-attributed-data-security-boundary.md), and -[ADR 0141](0141-deterministic-filtered-entity-context-staging.md) for the -target CEL/entity routes and their migrated model-bound paths. It also refines -[ADR 0061](0061-harness-cel-dispatch.md)'s -authorization-before-harness-enumeration ordering for harness-specific -thresholds and narrows the human label-transition exception in -[ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md) for a -harness requiring more than `triage`. -Their other provenance, bot, freshness, and filtering requirements remain. -These changes apply to CEL/entity routes and their v2 model-bound admission -when migrated. Legacy non-CEL, non-entity workflow configurations remain under -Authorization v1 and their existing workflow guards until separately -migrated. - -## Context - -[ADR 0061](0061-harness-cel-dispatch.md) puts platform authorization before -harness CEL. A harness's `role` selects its run identity: GitHub requests a -mint token for it, while GitLab selects registered role credentials -([`run.go` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/cli/run.go#L903-L915)). -[Authorization v1](../normative/authorization/v1/README.md#default-thresholds) -already sets `triage` for observation and `write` for mutation, including its -target entity-fact and model-record rules. The GitHub workflow applies those -thresholds to human slash commands; its other event routes have distinct -guards, including an ungated retro-close route -([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L305-L420)). -Since [#8727](https://github.com/fullsend-ai/fullsend/pull/8727), Go CEL -dispatch also applies an event-level `triage` floor for ordinary human events -and filters candidate harnesses by the v1 `role`-derived default before CEL: -`triage` and `review` -require `triage`; every other role requires `write` -([`auth.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harnessdispatch/auth.go#L78-L157), -[`core.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harnessdispatch/core.go#L68-L82)). -Its harness schema has no explicit human minimum -([`harness.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harness/harness.go#L364-L400)), -and its label-added exception bypasses the per-harness role threshold -([`auth.go` at `33dc5e1`](https://github.com/fullsend-ai/fullsend/blob/33dc5e1e27f2c732c49603ed93fb405fb728d160/internal/harnessdispatch/auth.go#L53-L58)). -The current GitHub dispatch and run jobs each check out the PR base commit for -PR events ([`reusable-dispatch.yml` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L1519-L1532), -[`run checkout` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/.github/workflows/reusable-dispatch.yml#L1681-L1686)). -The matrix execution ref carries agent and role but no composed policy digest -([`ExecutionRef` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/harnessdispatch/ref.go#L3-L13)), -and `run` resolves the harness by name again -([`run.go` at `fe68925b`](https://github.com/fullsend-ai/fullsend/blob/fe68925b53066c27ba0c0272e2e8eb1ce73ebe40/internal/cli/run.go#L641-L674)). - -A common `triage`-only admission rule would allow `triage`-authored model -records to guide a write-capable harness even if its trigger CEL required a -`write` prompting actor. A mint role can provide a compatibility default for -human authorization, but the minted token's permission set does not itself -define which human actors may prompt or supply data to the harness. -[ADR 0112](0112-overlays-may-set-any-harness-field.md) specifies that overlays -guarded by trusted facts may set security-relevant harness fields. Excluding -`human_min_role` would prevent the same reviewed harness from choosing a -minimum by source or other trusted metadata. The minimum must, -however, be selected before it controls actor and content admission. - -## Options - -Keep one `triage` threshold for every harness and rely on CEL for stricter -routing; derive a threshold from token permissions; or use an explicit default -mapping from mint role with a configurable, platform-enforced harness minimum. - -## Decision - -For ordinary human actors, Fullsend retains a non-waivable `triage`-level -authorization gate. The narrow verified label-transition grant below can -satisfy that gate only for the exact transition and its proven projection; -it does not establish a normalized human role. For each trusted harness, -Fullsend resolves `human_min_role` from an explicit top-level harness field -and any matching guarded overlays or, when no explicit value survives -resolution, from the harness's `role`: `triage` and `review` default to -`triage`; every other role, including custom roles, defaults to `write`. -An explicit value may be `triage`, `write`, `maintain`, or `admin`. It can -lower a `write` default to `triage` but cannot admit `read`, `none`, or -`external` actors. An invalid explicit value makes that harness ineligible; -it never falls back to the default. Validate explicit values in top-level, -base, and overlay entries, including overlays that do not match. Within each -base layer, matching overlays apply in order before that layer merges into the -child; an explicit child value overrides the inherited value, and the child's -matching overlays then apply in order. Resolve the final value before the -harness's actor gate or trigger CEL. A deprecated `forge:` block cannot set it. - -An overlay setting `human_min_role` is a guarded overlay under ADR 0112: -its `when:` may depend only on that decision's closed set of trusted facts or -the versioned verified effective-role input, verified from the provider or -the pinned trusted configuration before harness-specific admission. It cannot -depend on the trigger CEL, actor-filtered entity facts, model records, or any -value whose availability depends on the minimum being selected. A role -comparison must use the versioned verified effective-role input, never raw -`event.actor.role` or the narrow label grant. The raw role field is excluded -for this purpose even though normalized-event v1 lists it as trusted; the -versioned CEL schema must define the verified role path and provenance before -role-based guards can be used. A known absent event or optional key is a -nonmatch under ADR 0112; an evaluation error or required guard evidence that -cannot be verified fails evaluation rather than silently selecting a fallback. -An overlay's value MUST preserve or lower the non-overlay baseline for its -layer. The baseline is that layer's explicit `human_min_role`, otherwise its -inherited resolved minimum, otherwise the role-derived default. To conditionally -require a stronger minimum, set that stronger baseline outside overlays and -allow a guarded overlay to lower it only when its trusted condition is -positively established. -Trusted entity-source identity needed for a guard must be obtained from -provider-verified structural metadata or a platform discovery credential, -not from the still-unpinned harness run credential. -Trusted-field validation alone does not prove that a guard's matching branch -has the intended security meaning: for example, a change author may choose a -fork, while only an author with write access can make `is_fork` false. A -conditional relaxation MUST positively prove the trusted condition for -which the lower minimum is intended. The selected value gates other actors' -entity facts and model records as well as the prompting actor. - -The default is an authorization policy, not a deduction from mint token scopes -or the harness's `privilege_levels`. The trusted composed harness revision, -ordered overlay outcome, trusted guard evidence, and effective minimum stay -fixed within one evaluation or run cycle; a changed policy or guard result -requires a new cycle or abort, not a silent threshold change. A dispatch or -poll result is only a candidate selection, not permission to launch. -The target-repository registry and local harness and `base` files that set -this policy come from one immutable trusted checkout revision selected -independently of the prompting actor and entity content. A change proposal -uses its target/base commit, never its proposed head; other paths must identify -an equivalent trusted canonical revision. A remote registered harness or -`base` layer has its own immutable source revision and declared content hash; -it does not share the target-repository revision. Built-in fallback harnesses -from `fullsend-ai/agents` currently resolve a release tag (or `main` for a -source build) to a commit SHA independently in each `run`, without verifying a -declared content hash. Legacy routes pin target config to the base commit and -resolve a fallback within their single `run`; current CEL dispatch and its -later `run` resolve independently. Current behavior is implemented in -[`reusable-dispatch.yml` at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/.github/workflows/reusable-dispatch.yml#L135-L148) -and [`run.go` at `c0695aaa`](https://github.com/fullsend-ai/fullsend/blob/c0695aaa5aee66fe500c4fb904ed4924e0b400da/internal/cli/run.go#L7200-L7361). -Before a CEL/entity-bound run uses a selected candidate, `fullsend run` MUST -independently load the trusted target config and selected harness/base chain, -re-evaluate applicable `config.yaml` `when` flags and harness overlays from -current verified inputs, rerun harness trigger CEL, and recheck authorization -and launch eligibility against the freshly re-fetched canonical entity under -ADR 0144. It MUST do -this before assembling ADR 0141 model context or starting the sandbox. A -candidate that is now disabled, no longer matches, or fails any current gate -MUST stop before context exposure or launch. A config or harness revision -change between dispatch/poll and `run` is handled by this fresh evaluation; -the revisions do not have to match across processes. The run MUST record the -trusted revisions and effective policy it actually verified, then use that -same resolved policy through its own context-staging and launch checks. If a -policy input changes during that run, it MUST stop or restart all gates under -the newly loaded policy rather than mix decisions. This recheck applies to the -CEL/entity and v2 paths only; it does not extend the new policy to legacy -non-CEL, non-entity workflows. - -Fullsend applies the same effective minimum separately to the ordinary human -prompting event before that harness's CEL predicate; to each actor-originated -entity fact needed for an actionable CEL result, including aggregates and -absence claims; and to each Fullsend-controlled model-bound source record at -ADR 0133's fresh exposure checkpoints. The record check uses its own current -revision actor, never the event sender or discovery credential. A fact below -the selected harness's minimum is excluded from its authorized CEL view; an -unresolved decisive fact leaves the result unknown rather than proving false -or empty. An event or model record below the minimum is denied or redacted. -Trusted Fullsend provenance can authorize eventless discovery but does not -authorize actor-originated entity facts or model records. CEL may narrow -selection beyond the platform gate, never relax it. - -A verified human label addition supplies a narrow `triage`-equivalent grant -for that exact accepted transition and its proven projection. It neither -sets `actor.role` nor makes `actor.role_verified` true. If the selected -harness requires `write`, `maintain`, or `admin`, the human labeler must -also have a verified effective role meeting that minimum. The -provider-classified bot label handoff and registered-bot rules in ADR 0107 -remain separate from human -thresholds; neither label grant admits unrelated history or model content. -The `human_min_role` field does not constrain bots; harness CEL may narrow -their routing. -The ungated GitHub retro-close route remains legacy compatibility, not a -general CEL-path exception. - -Effective human roles come from the source provider or a trusted configured -permission source such as OWNERS. A failed forge-role lookup does not negate -an independently verified OWNERS grant for the same actor and target. -Fullsend exposes a verified effective role and its provenance to CEL when -present, and exposes an exact human label grant as separate provenance without -synthesizing a role. [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md) -may cache a bounded provider-verified entity-CEL role, but each harness -reapplies its own minimum; no harness-specific authorization decision or -filtered view is shared as a role verdict. Event and model-bound checks remain -fresh. The [Authorization Contract -v2](../normative/authorization/v2/README.md) specifies these gates and their -audit outcomes. - -## Forge scope - -The human minimum applies to GitHub, GitLab, and Jira through verified -normalized role mappings. On Jira, Developer and Administrator satisfy -`triage` because its mapping has no separate triage level. Forgejo is a -target, but its adapter must establish a verified effective role before -admitting a human actor through the role-based path; unsupported or -unverifiable mappings fail closed. -Source-specific bot and label grants require their own provider evidence. - -## Consequences - -- Current Go CEL dispatch enforces the v1 role-derived default for ordinary - human events, and bash routes retain their stage guards. Explicit or guarded - overlay `human_min_role` values, selected-minimum checks for human label - additions and actor-originated entity and model records, and run-time policy - reload and launch rechecks remain target behavior. The - field cannot become effective policy until the loader validates and enforces - it. -- A harness author may deliberately set `human_min_role: triage` for a - write-capable role; that permits `triage` actors and records to guide that - harness without changing its minted capabilities. -- Authorized entity views, aggregate evidence, and audits are bound to the - selected harness's minimum; verified actor roles may be reused, but pass - decisions and filtered views cannot be reused across different minima. -- [Entity-context-snapshot v1](../normative/entity-context-snapshot/v1/README.md) - retains its observation/mutation-derived `triage`/`write` threshold. Snapshot admission - with a differing override or a higher role requires a versioned contract - before migration. diff --git a/docs/ADRs/0151-harness-human-role-minimums.md b/docs/ADRs/0151-harness-human-role-minimums.md new file mode 100644 index 0000000000..4ff7b43f0e --- /dev/null +++ b/docs/ADRs/0151-harness-human-role-minimums.md @@ -0,0 +1,95 @@ +--- +title: "151. Use harness human-role minimums for actor admission" +status: Accepted +relates_to: + - agent-architecture + - security-threat-model +topics: + - authorization + - cel + - data-security +--- + +# 151. Use harness human-role minimums for actor admission + +Date: 2026-10-23 + +## Status + +Accepted + +This decision applies only to CEL/entity routes and migrated v2 model-bound +admission. Legacy non-CEL, non-entity workflows remain under Authorization v1 +and their existing workflow guards. + +| Earlier ADR | Effect of this decision | +| --- | --- | +| [ADR 0054](0054-require-authorization-on-all-agent-dispatch-paths.md) | Apply the harness minimum before CEL on migrated routes. | +| [ADR 0098](0098-entity-first-harness-evaluation.md) | Apply it to decisive actor-attributed entity facts. | +| [ADR 0133](0133-actor-attributed-data-security-boundary.md) and [ADR 0141](0141-deterministic-filtered-entity-context-staging.md) | Apply it at model-record admission and exposure gates. | +| [ADR 0061](0061-harness-cel-dispatch.md) | Resolve the minimum before the harness actor gate and CEL. | +| [ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md) | A human label grant meets `triage` only; bots remain separate. | + +## Context + +[ADR 0061](0061-harness-cel-dispatch.md) puts platform authorization before +harness CEL. [Authorization v1](../normative/authorization/v1/README.md) +sets different human thresholds for observation and mutation routes, while a +harness's `role` selects its run credentials. Credential scope does not decide +which people may trigger a harness or contribute actor-authored data to it. +A single `triage` threshold could let lower-privilege actors influence a +write-capable harness. A per-harness minimum addresses that gap; its trusted +value must be resolved before it gates admission. [ADR 0112](0112-overlays-may-set-any-harness-field.md) +allows trusted-fact-guarded overlays to set such fields. + +## Options + +Keep one `triage` threshold for every harness and rely on CEL for stricter +routing; derive a threshold from token permissions; or use an explicit default +mapping from mint role with a configurable, platform-enforced harness minimum. + +## Decision + +1. Fullsend enforces a non-waivable `triage` floor for ordinary human actors. + Bots use their separate registered-role and label-handoff rules. +2. Each harness has an effective `human_min_role`. It defaults to `triage` for + `role: triage` or `role: review`, and to `write` for every other role, + including custom roles. An explicit value may be `triage`, `write`, + `maintain`, or `admin`; an invalid value makes the harness ineligible. +3. Trusted top-level values and guarded overlays may set the minimum. An + overlay may preserve or lower its layer's non-overlay baseline, never raise + it. A missing optional guard keeps the baseline; unverifiable required + evidence or an evaluation error fails closed. CEL and deprecated `forge:` + blocks cannot set or relax the minimum. +4. The same effective minimum gates the human prompting event, decisive + actor-originated entity facts, and Fullsend-controlled model-bound records. + CEL may narrow admission further but cannot relax these gates. +5. A verified human label addition grants `triage` only for its exact accepted + transition and proven projection. It does not create a verified role; a + stronger harness minimum requires the labeler's verified effective role. + +[Authorization Contract v2](../normative/authorization/v2/README.md) defines +the policy sources, overlay-resolution and provenance rules, per-record gates, +auditing, and run-time rechecks. [ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md) +defines the bound-run lifecycle. These v2 rules do not extend to legacy +non-CEL, non-entity workflows. + +## Forge scope + +GitHub, GitLab, and Jira use their verified normalized-role mappings. Jira +Developer and Administrator satisfy `triage` because Jira has no separate +triage level. Forgejo must provide a verified effective role or deny the +role-based path. Bot and label grants require separate provider evidence. + +## Consequences + +- The `human_min_role` field is target behavior until the loader validates and + enforces it. Existing legacy routes keep their Authorization v1 guards. +- A harness author may deliberately set `human_min_role: triage` for a + write-capable role; that permits `triage` actors and records to guide that + harness without changing its minted capabilities. +- Each harness applies its own minimum to shared verified role evidence; + authorization decisions and filtered views are not shared across minima. +- [Entity-context-snapshot v1](../normative/entity-context-snapshot/v1/README.md) + retains its observation/mutation-derived `triage`/`write` threshold. A + different snapshot threshold requires a versioned contract. diff --git a/docs/architecture.md b/docs/architecture.md index e9150c77a5..a3ea04fd49 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -309,7 +309,7 @@ flowchart TB `human_min_role` is a guarded field whose overlay must resolve from verified pre-admission facts before the harness actor gate, with its selected value pinned through the run - ([ADR 0151](ADRs/0151-common-actor-admission-floor.md)). Per-task model + ([ADR 0151](ADRs/0151-harness-human-role-minimums.md)). Per-task model routing is overlays setting `model` and `effort`; when a routed model is not served, the runner retries once with the model and effort it would use without overlays, and `FULLSEND_FALLBACK_MODELS` applies as each runtime @@ -474,7 +474,7 @@ The existing design principle is that [the repo is the coordinator](problems/age [Authorization Contract v1](normative/authorization/v1/) for current dispatch; [Authorization Contract v2](normative/authorization/v2/) for target CEL; [ADR 0054](ADRs/0054-require-authorization-on-all-agent-dispatch-paths.md); - [ADR 0151](ADRs/0151-common-actor-admission-floor.md)). + [ADR 0151](ADRs/0151-harness-human-role-minimums.md)). - Data security boundary (target state): each source-system record that Fullsend controls is admitted to model input only after its exact current revision's actor and current authorization are verified. An ordinary human @@ -490,7 +490,7 @@ The existing design principle is that [the repo is the coordinator](problems/age platform-originated checked data or add filtering for model-originated retrievals ([ADR 0133](ADRs/0133-actor-attributed-data-security-boundary.md), partially superseded by - [ADR 0151](ADRs/0151-common-actor-admission-floor.md)). + [ADR 0151](ADRs/0151-harness-human-role-minimums.md)). - Fullsend-originated entity evaluation (target state): `fullsend poll` enumerates candidates, while a bound `fullsend run` may recheck only its canonical entity with `event == null`. Both require verified, @@ -526,7 +526,7 @@ The existing design principle is that [the repo is the coordinator](problems/age [ADR 0144](ADRs/0144-reuse-poll-and-entity-bound-run-processes.md), [ADR 0147](ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md), [ADR 0148](ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md), - [ADR 0151](ADRs/0151-common-actor-admission-floor.md), + [ADR 0151](ADRs/0151-harness-human-role-minimums.md), [Authorization Contract v2](normative/authorization/v2/)). **Open questions:** diff --git a/docs/contributing/harness-fields.md b/docs/contributing/harness-fields.md index 012692effc..2e6a84b935 100644 --- a/docs/contributing/harness-fields.md +++ b/docs/contributing/harness-fields.md @@ -16,7 +16,7 @@ > overlays set any field except `base`, `trigger`, `overlays`, `slug`, `role` > and `forge`, with guarded fields limited to trusted inputs. The tables below > change when it is implemented. -> [ADR 0151](../ADRs/0151-common-actor-admission-floor.md) adds the target +> [ADR 0151](../ADRs/0151-harness-human-role-minimums.md) adds the target > `human_min_role` field at the top level and in guarded overlays, with its > overlay selected before actor admission and pinned through the run. Legacy > `forge:` blocks cannot set it; the tables below remain current behavior. diff --git a/docs/normative/authorization/v1/README.md b/docs/normative/authorization/v1/README.md index 164e6212ab..c26fe63159 100644 --- a/docs/normative/authorization/v1/README.md +++ b/docs/normative/authorization/v1/README.md @@ -15,7 +15,7 @@ consumed by this contract. Bot identity and role resolution are specified by > supersedes v1's future full-history entity-evaluation and audit requirements. > [ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) > permits bounded actor-role reuse for entity-source CEL in v2. -> [ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) keeps an +> [ADR 0151](../../../ADRs/0151-harness-human-role-minimums.md) keeps an > immutable `triage` human floor and applies the selected harness's effective > `human_min_role` to target event, entity-fact, and model-record admission. > Human labelers must meet that minimum; bot label grants remain separate. diff --git a/docs/normative/authorization/v2/README.md b/docs/normative/authorization/v2/README.md index 75862a3507..6172fe9454 100644 --- a/docs/normative/authorization/v2/README.md +++ b/docs/normative/authorization/v2/README.md @@ -13,7 +13,7 @@ effective `human_min_role` to prompting events, actor-originated facts needed for actionable CEL results, and Fullsend-controlled model-bound records. Harness CEL may impose further conditions but cannot replace these admission gates. -[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) establishes the +[ADR 0151](../../../ADRs/0151-harness-human-role-minimums.md) establishes the floor and harness minimum while preserving separate bot grants and fresh model-bound checkpoints. This version also adopts selective entity acquisition and decision-focused @@ -546,7 +546,7 @@ and revised for selective acquisition and audit by [ADR 0147](../../../ADRs/0147-evaluate-entity-cel-over-selectively-acquired-data.md), with bounded cross-check actor-verdict reuse under [ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md). -[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) supplies the +[ADR 0151](../../../ADRs/0151-harness-human-role-minimums.md) supplies the platform floor and per-harness human minimum. It applies to an entity-source harness's CEL predicate whether a verified prompting event is present or `event == null`; legacy event-only dispatch is @@ -729,7 +729,10 @@ Within-check memoization under avoids repeated lookups while the verdict remains eligible under an absolute five-minute hard cap. Cross-check reuse is disabled until a versioned platform policy defines and enforces an explicit maximum age no greater than five -minutes. The platform MAY choose a shorter age; repository or harness settings +minutes. Five minutes is an arbitrary initial cap, not a measured optimum. +Once entity polling is in production, revisit the cap against observed +authorization-freshness needs and SCM API rate-limit pressure. The platform MAY +choose a shorter age; repository or harness settings MUST NOT widen the hard cap or the effective platform bound. Only a completed verdict may enter the cache. Its absolute expiry is measured from the authoritative lookup's start at the earlier of the hard cap and any shorter @@ -821,7 +824,7 @@ for dispatch and CEL evaluation throughout. [ADR 0133](../../../ADRs/0133-actor-attributed-data-security-boundary.md) defines the separate model-bound admission and filtering gate, as revised for the per-harness human minimum by -[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md): only filtered +[ADR 0151](../../../ADRs/0151-harness-human-role-minimums.md): only filtered content whose source record and actor pass the fresh gate below may be exposed to the model under bounded harness scope. Any resulting agent run uses the harness's configured identity and permissions. @@ -1018,7 +1021,7 @@ supersedes v1's future full-history entity-evaluation and audit requirements; [ADR 0148](../../../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) adds bounded cross-check reuse of provider-verified actor-role verdicts for entity-source CEL only. -[ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) sets the +[ADR 0151](../../../ADRs/0151-harness-human-role-minimums.md) sets the immutable `triage` platform floor and the selected harness's effective `human_min_role` for human event, entity-fact, and model-record admission. The resolved harness `role` supplies the default map above; an explicit top-level diff --git a/docs/normative/entity-context-snapshot/v1/README.md b/docs/normative/entity-context-snapshot/v1/README.md index f9f45b7e2b..efed1f2f7a 100644 --- a/docs/normative/entity-context-snapshot/v1/README.md +++ b/docs/normative/entity-context-snapshot/v1/README.md @@ -6,7 +6,7 @@ under the actor-attributed data boundary in [ADR 0133](../../../ADRs/0133-actor- It is the contract between forge adapters, `fullsend run`, harness scripts, and agent runtimes. -> **Version note:** [ADR 0151](../../../ADRs/0151-common-actor-admission-floor.md) +> **Version note:** [ADR 0151](../../../ADRs/0151-harness-human-role-minimums.md) > keeps an immutable `triage` floor and uses the selected harness's effective > `human_min_role` for target Fullsend-controlled model admission. This v1 > bundle retains its observation/mutation-derived `triage` or `write` threshold; diff --git a/docs/problems/agent-architecture.md b/docs/problems/agent-architecture.md index 1c9084d2b0..00ee714101 100644 --- a/docs/problems/agent-architecture.md +++ b/docs/problems/agent-architecture.md @@ -153,7 +153,7 @@ The repository's existing infrastructure provides all the coordination needed: lets those checks acquire entity data progressively when the result is not yet known. [ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md) permits bounded sharing of verified actor roles between those checks. - [ADR 0151](../ADRs/0151-common-actor-admission-floor.md) sets a platform + [ADR 0151](../ADRs/0151-harness-human-role-minimums.md) sets a platform `triage` floor and a configurable `human_min_role` for each harness. The platform applies that minimum before evaluating the harness's CEL predicate. diff --git a/docs/problems/agent-infrastructure.md b/docs/problems/agent-infrastructure.md index 1ea8c5a147..731bb5a68f 100644 --- a/docs/problems/agent-infrastructure.md +++ b/docs/problems/agent-infrastructure.md @@ -73,7 +73,7 @@ Agents are often discussed as if they run on a developer workstation: fast local - **Compute held open for human latency** — A long-lived pod that **blocks on PR approval, architecture sign-off, or escalation** consumes cluster quota and cost while idle. That misaligns with typical “always-on service” defaults. Better fits include **event-driven** scheduling (wake on comment or approval), aggressive scale-to-zero, or separating **planning** from **execution** so capacity is not reserved across human response times; see [human-factors.md](human-factors.md) and [autonomy-spectrum.md](autonomy-spectrum.md). For shorter gaps between work cycles, [ADR 0144](../ADRs/0144-reuse-poll-and-entity-bound-run-processes.md) bounds host-process reuse and releases idle CI capacity without keeping an agent sandbox alive. Its repeated entity checks may share verified actor-role results only within [ADR 0148](../ADRs/0148-reuse-verified-actor-roles-for-entity-cel.md)'s bounded lifetime. Each harness reapplies its effective `human_min_role` to a reused role verdict - under [ADR 0151](../ADRs/0151-common-actor-admission-floor.md). + under [ADR 0151](../ADRs/0151-harness-human-role-minimums.md). [Forge-sdlc/forge](../landscape.md#forge-sdlcforge) demonstrates one practical pause/resume pattern: LangGraph checkpoints workflow state, then later Jira or GitHub webhooks resume the graph while implementation work happens in ephemeral Podman containers. That separation is directionally useful for fullsend, even though Forge's sandbox is a productivity boundary rather than the stricter credential and egress isolation boundary fullsend needs. diff --git a/docs/problems/operational-observability.md b/docs/problems/operational-observability.md index 3828e42334..ba1c088888 100644 --- a/docs/problems/operational-observability.md +++ b/docs/problems/operational-observability.md @@ -99,7 +99,7 @@ applies that principle to bounded actor-provenance and source-coverage evidence. the audit to record the age of any shared actor-role result used for CEL. The audit records the evaluated harness revision and its effective `human_min_role`, since one verified actor role can pass one harness's gate and -fail another's under [ADR 0151](../ADRs/0151-common-actor-admission-floor.md). +fail another's under [ADR 0151](../ADRs/0151-harness-human-role-minimums.md). Traces need to be correlatable. A PR review workflow involving five agents needs a session-level view that shows all five traces, their ordering, and how their outputs composed into the final decision. This is the LLM equivalent of distributed tracing in microservices — but with the additional challenge that each "span" contains non-deterministic reasoning, not just timing and status. diff --git a/docs/problems/security-threat-model.md b/docs/problems/security-threat-model.md index cce8cc8e03..fa7546288a 100644 --- a/docs/problems/security-threat-model.md +++ b/docs/problems/security-threat-model.md @@ -145,7 +145,7 @@ Agents amplify authority. If a compromised account can trigger agent actions, th lowering a write-capable harness's minimum to `triage` lets triage-authored content guide that harness, so agent configuration review and fixed capabilities remain security controls - ([ADR 0151](../ADRs/0151-common-actor-admission-floor.md)). + ([ADR 0151](../ADRs/0151-harness-human-role-minimums.md)). - **No self-approval** — an agent that implements a change cannot also approve it. On GitHub this separation is real: the code and review stages run as distinct bot identities. On GitLab, the [GitLab role-credential contract](../contributing/gitlab-role-credentials.md)'s `approve_merge_request` capability check applies unconditionally: Analyst and Coder authenticate with distinct per-role credentials, and Coder is structurally denied the approve call because the capability check resolves from the role identity. Installs that have not yet provisioned role secrets fail closed rather than authenticating as the shared bot from [ADR 0067](../ADRs/0067-gitlab-cron-polling-event-dispatch.md). - **GitLab role-credential contract** — built-in Poller/Analyst/Coder and administrator-registered custom roles share one registry and credential-selection path ([gitlab-role-credentials.md](../contributing/gitlab-role-credentials.md)). Role registration is install-state only; repository and merge-request content cannot create or elevate roles. Runtime authentication failures do not fall back to the shared token. Provisioning of role credentials is additive (#7498). Job routing (#7499) selects the registered role credential unconditionally. There is no shared-token fallback for an unconfigured role (#7559, #7782). Rotation (#7500) replaces a due role PAT by creating a new token and distributing it to the existing CI variable while the previous PAT stays valid for in-flight jobs; a failed rotation does not drop the last known-good secret or silently broaden to the shared token. Neither `repos install` nor `repos uninstall` automatically removes a leftover shared `FULLSEND_FORGE_TOKEN` credential from a repository installed before the role-only rollout (#7931); an administrator must clean that up manually - **Rate limiting / anomaly detection** — unusual patterns of agent activity (sudden burst of cross-repo changes, changes to security-sensitive paths) trigger alerts @@ -158,7 +158,7 @@ Agents amplify authority. If a compromised account can trigger agent actions, th - How do we distinguish a compromised account from a legitimate team member making unusual but valid changes? - Should agent authority be tied to individual human identity, or to roles? (The actor-admission gate uses verified roles and each harness's minimum under - [ADR 0151](../ADRs/0151-common-actor-admission-floor.md); that decision does + [ADR 0151](../ADRs/0151-harness-human-role-minimums.md); that decision does not grant agent capabilities or settle identity-specific policy.) - How do we handle the bootstrap problem — who sets up the initial agent configuration, and how is that secured?