Skip to content

feat(#8509)!: route GitLab webhook through trigger account - #8548

Merged
ggallen merged 2 commits into
mainfrom
agent/8509-webhook-trigger-account
Oct 19, 2026
Merged

ggallen merged 2 commits into
mainfrom
agent/8509-webhook-trigger-account

Conversation

@fullsend-ai-coder

@fullsend-ai-coder fullsend-ai-coder Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Route the managed GitLab webhook through the trigger-only account's published pipeline trigger while dispatch activation is recorded. Webhook pipelines then run as that account and dispatch through the child-pipeline route (source=pipeline). Without activation, the webhook uses the Poller-owned trigger on the api route. This closes #8509 and completes the webhook portion of #8438, building on #8482 and #8508.

Behavior and release note

New GitLab issues opened by an authorized actor now start one triage dispatch when the managed webhook fast path is active. The shared router restricts automatic issue-open triage to GitLab events; Jira issue-open events retain their prior behavior. Merge-request-open events still start review. The pushed-commit live issue produced one triage child pipeline and one triage result.

Implementation

  • Install and repair settle the trigger-account lifecycle before selecting the webhook route on reinstall, then recheck for a missing or stale webhook after lifecycle convergence. Successful rotation re-points the webhook in the same install after lifecycle convergence. A failed Poller role stage does not force account rotation; it still refreshes an existing webhook after ordinary account repair, which can replace the token.
  • The account token is accepted only from a ready published ledger generation with bound activation, a verified Developer-level owner, and a masked, protected, wildcard-scoped variable. A value copied from the Poller trigger variable or from a webhook naming another trigger is rejected before the Poller credential is retired.
  • Webhook safety reconciliation checks account-owned triggers independently of activation. Project-wide safety drift or an unreadable invariant removes the managed webhook and requests ownership-verified account containment. The account lifecycle removes the published variable and revokes the recorded trigger, retains cleanup obligations on failure, and blocks republishing until the same safety checks pass.
  • The poll, dispatcher, and agent job scripts unset FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN before identity pinning. fullsend run also excludes it from harness expansion and child-process environments.
  • Poller merge-grant provisioning, rollback, diagnostics, and protected-ref-pipeline status remain for the Poller api fallback, including GitLab Free projects where schedules stay installer-owned. Uninstall removes the webhook before account cleanup revokes the account trigger.
  • CLI, operator, infrastructure, and contributor documentation describe both routes, safety containment, and token isolation. Verified GitLab issue-open webhooks dispatch triage; merge-request-open review routing remains intact.

Breaking change

An existing trigger-account credential is revoked when project-wide webhook trigger safety invariants fail. Restore the reported protected-ref and CI restrictions, then rerun repos install. Older CLIs do not understand the account-owned webhook route or the token fingerprint added to the strict trigger-account ledger; use the first release or source commit containing #8509 (or newer) for install, status, rotation, and uninstall. There is no in-place downgrade path while an account written by this version remains installed: uninstall it with a compatible CLI before using an older installer. The ledger remains at version 1 so existing installations remain readable by this CLI; older strict decoders may report an unknown ledger field. This is the documented breaking compatibility boundary.

Verification

  • Full go test suites pass for internal/cli, internal/repos, internal/scaffold, and internal/gitlablifecycle.
  • go test -coverprofile passes for internal/dispatch and internal/poll after the issue-open fix; routeOpened has 100% statement coverage.
  • make lint passes on the complete staged, squashed PR diff.
  • Approximate coverage of the original new Go production statements is 87.7% (80% target). The added replacement-publication and retired-owner safety helpers have 80.0% and 83.3% function coverage; the affected packages pass at 92.4% (internal/repos) and 84.1% (internal/cli).
  • On the preceding pushed PR head 9d35b6f, a real newly opened issue started webhook dispatcher pipeline 18555469 (source=trigger). It completed successfully with 1 events, 1 dispatched, starting triage child pipeline 18555530 (source=pipeline). The triage child pipeline then completed successfully and posted its triage result on issue docs: add agent infrastructure problem document #5. A prior equivalent-tree test also dispatched triage but encountered a transient Tirith hook failure after launch.
  • Natural scheduled slash and event polls on the disposable project completed successfully (18555380, 18555385). Both schedules were owned by the trigger account.
  • A separate disposable project with a Maintainers-only protected branch exercised fallback activation: install left both schedules active and installer-owned (user 4927), while the Developer trigger account (user 36559) lacked merge access. Natural installer-owned slash-poll pipelines 18555799 and 18555871 started with source=schedule; both jobs were still in progress at the last check, so successful completion remains unchecked.

The implementation and review fixes are consolidated into a rebased, signed-off commit. The live webhook run used the preceding 9d35b6f tree; subsequent safety and rotation fixes passed the affected-package suites and focused regression tests. Missed issue-open webhook recovery in the scheduled poller is tracked by child issue #8553 under #8438; it is outside the immediate webhook route in this PR.

Closes #8509

@fullsend-ai-review

Copy link
Copy Markdown

🤖 Review · ⚠️ Cancelled · Ended 2:30 PM UTC

Commit: 107ece6 · View workflow run →

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:32 PM UTC · Completed 2:43 PM UTC

Commit: 107ece6 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $3.06

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Site preview

Preview: https://6af40b84-site.fullsend-ai.workers.dev

Commit: 8f15c9986edda49becb7605282d4885033f742f5

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Oct 18, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff size, active recent file churn, and breaking ledger format are mitigated by high test coverage, no CI or dependency modifications, bot authorship, and comprehensive acceptance criteria coverage.

Previous run

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff size, active recent file churn, and breaking ledger format are mitigated by high test coverage, no CI or dependency modifications, bot authorship, and comprehensive acceptance criteria coverage.

Previous run (2)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff size, breaking ledger change with no downgrade path, and high recent churn in touched GitLab webhook files are balanced by strong test ratio, bot authorship, no protected or CI file changes, and complete alignment with an active linked issue.

Previous run (3)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff size, breaking ledger change with no downgrade path, and high recent churn in touched GitLab webhook files are balanced by strong test ratio, bot authorship, no protected or CI file changes, and complete alignment with an active linked issue.

Previous run (4)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff and high recent churn in touched repository files are counterbalanced by a bot author, absence of protected or security-sensitive paths, complete alignment with linked issue #8509, and safe fallback to the Poller route when activation is unrecorded.

Previous run (5)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff and high recent churn in touched repository files are counterbalanced by a bot author, absence of protected or security-sensitive paths, complete alignment with linked issue #8509, and safe fallback to the Poller route when activation is unrecorded.

Previous run (6)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff and active git churn across GitLab webhook components are balanced by zero protected paths, no CI or dependency changes, bot authorship, and activation-gated rollback safety, resulting in moderate risk.

Previous run (7)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff and active git churn across GitLab webhook components are balanced by zero protected paths, no CI or dependency changes, bot authorship, and activation-gated rollback safety, resulting in moderate risk.

Previous run (8)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Large diff and active churn across modified GitLab lifecycle files are balanced by bot authorship, zero protected or security-sensitive path modifications, and strict alignment with linked issue acceptance criteria.

Previous run (9)

<!-- fullsend:risk-assessment -->
Risk Assessment: moderate (2/5)

Details

Moderate risk: the PR modifies existing webhook provisioning behavior across 14 files and touches active GitLab repo management areas with high historical churn, mitigated by an established bot author, comprehensive test coverage, no protected or CI workflow changes, and alignment with linked issue #8509.

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9kaXNwYXRjaC9yb3V0ZXIuZ28iLCJpZCI6ImZfZGYwMTI3M2U5OTYyOGUzMCIsImxpbmUiOjE5OCwiYWN0aW9uYWJsZSI6ZmFsc2V9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6InBhdHRlcm4taW5jb25zaXN0ZW5jeSIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfd2ViaG9va190cmlnZ2VyX2FjY291bnRfdGVzdC5nbyIsImlkIjoiZl84OTUxZjhkYjBlZTU2ZmM1IiwibGluZSI6ODQ0LCJhY3Rpb25hYmxlIjpmYWxzZX0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoibWlzc2luZy12ZXJzaW9uLWJ1bXAiLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl8xNTNhODk0MTk4NTBkOTE3IiwiYWN0aW9uYWJsZSI6ZmFsc2V9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImJhY2t3YXJkLWluY29tcGF0aWJsZSIsImZpbGUiOiJpbnRlcm5hbC9kaXNwYXRjaC9yb3V0ZXIuZ28iLCJpZCI6ImZfMDAwYmFlZTNjZDVkY2ExOCIsImFjdGlvbmFibGUiOmZhbHNlfV19 -->

Review

Findings

Low

  • [logic-error] internal/dispatch/router.go:198 — The new issue-open route sends GitLab work_item 'opened' events to triage. The agent job still applies the ADR 0054 Developer-access gate to the event actor: in run-agent-job.sh only retro and prioritize skip it, so an issue author below Developer (or a non-member) hits exit 0 and the pipeline looks successful while triage never runs. This matches the PR's wording ("authorized actor") and the routeOpened comment, and the PR did not change the gate, so it is a scope limitation rather than a defect. The router test uses a write-role actor and does not exercise the gap.
    Remediation: Decide whether automatic issue-open triage should apply to non-Developer reporters. If yes, exempt the read-only triage stage on issue-open events from the Developer gate and add a script-level test with a non-Developer author. If no, state in the docs and release note that only Developer+ issue authors get automatic triage.

  • [pattern-inconsistency] internal/repos/gitlab_webhook_trigger_account_test.go:844 — TestGitLabWebhookTriggerOwnerUnsafe covers four of the five sentinel errors that GitLabWebhookTriggerOwnerUnsafe accepts. It omits errGitLabAccountTriggerUnsafe (the first errors.Is branch, gitlab_webhook.go:2290), which no test references directly.
    Remediation: Add errGitLabAccountTriggerUnsafe to the sentinel slice.

  • [missing-version-bump] internal/repos/gitlab_trigger_account.go — The strict trigger-account ledger gains trigger_token_digest and publication_pending while the version stays 1. decodeGitLabTriggerAccountState uses DisallowUnknownFields and checks the version after decoding, so older CLIs fail with a generic unknown-field error; a version bump would not change that. The break is intentional and disclosed (title !, BREAKING CHANGE footer), but the PR body names only the token fingerprint, and currentLedgerFields (gitlab_trigger_dispatch_activation_test.go) lists trigger_token_digest but not publication_pending.
    Remediation: Add publication_pending to currentLedgerFields and the breaking-change note, and state that an older CLI cannot read, rotate or uninstall an account written by this version.

  • [backward-incompatible] internal/dispatch/router.go — The shared router now sends GitLab work_item 'opened' events to triage where it previously returned no stages, so GitLab installations with triage enabled start triaging newly opened issues after upgrading. The PR body's "Behavior and release note" section describes this, but its "Breaking change" section and the BREAKING CHANGE footer cover only credential revocation and the ledger.
    Remediation: Mention the GitLab issue-open triage behavior change in the BREAKING CHANGE footer and Breaking change section, or confirm it is intended as a non-breaking feature.


Labels: PR changes the shared dispatch router and updates GitLab docs.

Previous run

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJoaWdoIiwiY2F0ZWdvcnkiOiJmYWlsLW9wZW4iLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3dlYmhvb2suZ28iLCJpZCI6ImZfZGI1YmJkZTJhN2RlZTNiMyIsImxpbmUiOjg1NywiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiZWRnZS1jYXNlIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL2dpdGxhYl90cmlnZ2VyX2FjY291bnQuZ28iLCJpZCI6ImZfNjY2M2JjNGZhYWM0ZWVhMCIsImxpbmUiOjEwNjcsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImluY29ycmVjdC1kb2MiLCJmaWxlIjoiZG9jcy9ndWlkZXMvZ2V0dGluZy1zdGFydGVkL3JlcG8tbWFuYWdlbWVudC5tZCIsImlkIjoiZl9mYTk1ODdjNzRmMmNkNzVkIiwibGluZSI6NjQ4LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJwYXR0ZXJuLWluY29uc2lzdGVuY3kiLCJmaWxlIjoiaW50ZXJuYWwvY2xpL3JlcG9zX2dpdGxhYi5nbyIsImlkIjoiZl9lMjU0ZmU3NjZmYjljNGIzIiwibGluZSI6Mzk2LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJwYXR0ZXJuLWluY29uc2lzdGVuY3kiLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3dlYmhvb2tfdHJpZ2dlcl9hY2NvdW50LmdvIiwiaWQiOiJmXzA4ZTVhNjViZTM3OGYyNzYiLCJsaW5lIjoxOTQsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImRvYy1zdHlsZSIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfdHJpZ2dlcl9kaXNwYXRjaF9nYXRlLmdvIiwiaWQiOiJmX2I4M2E4YWViYWJmM2M2YzEiLCJsaW5lIjoxNDUsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImRvYy1zdHlsZSIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfd2ViaG9va190cmlnZ2VyX2FjY291bnQuZ28iLCJpZCI6ImZfNmE2NmQwMDRhNTI4OWYwZCIsImxpbmUiOjM5MiwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiZG9jLXN0eWxlIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL2dpdGxhYl93ZWJob29rLmdvIiwiaWQiOiJmXzRlNWYwZmVhZjlhNWZhMDQiLCJsaW5lIjoxNDEsImFjdGlvbmFibGUiOmZhbHNlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJpbmNvbXBsZXRlLWRvYyIsImZpbGUiOiJkb2NzL2FnZW50cy90cmlhZ2UubWQiLCJpZCI6ImZfZjA2OWM1OTBmMzc1NDcxMSIsImxpbmUiOjcsImFjdGlvbmFibGUiOmZhbHNlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJpbmNvbXBsZXRlLWRvYyIsImZpbGUiOiJkb2NzL2d1aWRlcy9pbmZyYXN0cnVjdHVyZS9pbmZyYXN0cnVjdHVyZS1yZWZlcmVuY2UubWQiLCJpZCI6ImZfNGJjODAyZDNjZDg3MjE5NyIsImxpbmUiOjM1OSwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiaW5jb21wbGV0ZS1kb2MiLCJmaWxlIjoiZG9jcy9jb250cmlidXRpbmcvZ2l0bGFiLXJvbGUtY3JlZGVudGlhbHMubWQiLCJpZCI6ImZfNWRjZjg3NjM4OTIyZTJlMSIsImxpbmUiOjE2MiwiYWN0aW9uYWJsZSI6dHJ1ZX1dfQ== -->

Review

Findings

High

  • [fail-open] internal/repos/gitlab_webhook.go:857 — Account containment is skipped on several paths where safety invariants cannot be read (trigger-inventory, account-route, published-credential and hook-inventory reads, and failClosedOnProjectLookup). The webhook and Poller triggers are removed but GitLabWebhookTriggerOwnerUnsafe stays false, so the CLI never contains the published account bearer while its safety is unverifiable.
    Remediation: Preserve the containment-required signal through every safety-check error return, propagate it from failClosedOnProjectLookup, and add tests for each read-failure path with a published account credential.

Medium

  • [edge-case] internal/repos/gitlab_trigger_account.go:1067 — The cleared-sink exception does not survive an interrupted retry: startFreshGeneration (line 914) clears PublicationPending, so a later containment with an empty sink revokes the retired trigger the webhook still uses before it is repointed.
    Remediation: Persist the cleared-sink provenance across generation changes until webhook cutover or explicit containment, and add a regression test for two consecutive failures.
  • [incorrect-doc] docs/guides/getting-started/repo-management.md:648 — The breaking-change note says older CLIs refuse install/uninstall only once the account owns the polling schedules, but the ledger digest breaks older decoders for install, status and uninstall regardless; lines 612-619 also omit that the webhook moves to the account trigger.
    Remediation: Widen the note and describe the webhook route.

Low

  • [pattern-inconsistency] internal/cli/repos_gitlab.go:396 — Deferred results are logged with StepDone instead of StepInfo (cf. setupGitLabWebhookFastPath, line 353).
    Remediation: Branch on res.Action == "deferred".
  • [pattern-inconsistency] internal/repos/gitlab_webhook_trigger_account.go:194 — Single-case expressionless switch where an if suffices.
    Remediation: Use if t.ID == acct.triggerID.
  • [doc-style] internal/repos/gitlab_trigger_dispatch_gate.go:145 — gitlabRetiredPublishedSafetyProblems has no doc comment.
    Remediation: Add one.
  • [doc-style] internal/repos/gitlab_webhook_trigger_account.go:392 — The GitLabWebhookTriggerRouteStale doc comment claims repos install calls it; its only production caller is the Poller-failure path.
    Remediation: Correct the comment.
  • [doc-style] internal/repos/gitlab_webhook.go:141 — Over-long triggerStored comment line.
    Remediation: Re-wrap to ~80 columns.
  • [incomplete-doc] docs/agents/triage.md:7 — Describes GitHub issues only; GitLab issue-open triage dispatch is not mentioned.
    Remediation: Optionally mention it.
  • [incomplete-doc] docs/guides/infrastructure/infrastructure-reference.md:359 — Ledger field list omits the new trigger-token digest.
    Remediation: Add it.
  • [incomplete-doc] docs/contributing/gitlab-role-credentials.md:162 — Ledger field list in the CI/CD variables table omits the trigger-token digest.
    Remediation: Add it.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (2)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJhcHByb3ZlIiwiZmluZGluZ3MiOlt7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJicmVha2luZy1zY2hlbWEiLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl82NTg3MTUzNTE4YTFhZDYxIiwibGluZSI6Mjg0LCJhY3Rpb25hYmxlIjpmYWxzZX0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYmFja3dhcmQtaW5jb21wYXRpYmxlIiwiZmlsZSI6ImludGVybmFsL2Rpc3BhdGNoL3JvdXRlci5nbyIsImlkIjoiZl9mYmI4NTA3NzgzMTZkNDAwIiwibGluZSI6MTk1LCJhY3Rpb25hYmxlIjpmYWxzZX1dfQ== -->

Review

Findings

Low

  • [breaking-schema] internal/repos/gitlab_trigger_account.go:284 — The ledger gains trigger_token_digest, but gitLabTriggerAccountStateVersion stays at 1. Older CLIs using DisallowUnknownFields fail with an opaque "unknown field" decode error rather than the explicit "unsupported version" message. The PR's BREAKING CHANGE note documents this; a version bump would only make the failure easier to diagnose.
    Remediation: Optionally bump the ledger version to 2 (decoder accepting and migrating v1); otherwise keep the upgrade note.
  • [backward-incompatible] internal/dispatch/router.go:195 — routeOpened now returns triage for work_item opened events when a triage harness is valid; previously it returned nothing. The router is shared by the scheduled poll path and the Jira poll step, so the change applies beyond the webhook fast path, while the release note describes only the webhook fast path.
    Remediation: Confirm triage-on-open is intended for every poll consumer and widen the release note, or gate it to the webhook route.
Previous run (3)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImVkZ2UtY2FzZSIsImZpbGUiOiJpbnRlcm5hbC9jbGkvcmVwb3NfZ2l0bGFiX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl9lNjczMmJjNjRlODEyZjJkIiwibGluZSI6MTI3LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJicmVha2luZy1jbGkiLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl81ZDhjODdiYThjNTFlYmI4IiwibGluZSI6MTAzOSwiYWN0aW9uYWJsZSI6dHJ1ZX1dfQ== -->

Review

Findings

Medium

  • [edge-case] internal/cli/repos_gitlab_trigger_account.go:127 — Retirement of a pending trigger-account generation requires the whole webhook fast path to be provisioned (GitLabWebhookNeedsProvisioning is true whenever there is no single compliant managed hook). A trigger account can exist while webhook provisioning is deferred (setupGitLabWebhookFastPath returns nil on a deferral), so rotation or replacing a pre-digest generation creates a ready replacement but then fails the install with "webhook route is not verified", retaining old accounts and credentials on every retry until webhook readiness is resolved.
    Remediation: Under the project lease, check whether any managed webhook still carries a retired generation's credential. Allow retirement when no managed webhook exists or all managed webhooks are verified not to use retired credentials; reserve the cutover error for an actual unresolved credential reference. Add an installer-level regression test for rotation/digest migration with webhook provisioning deferred and no managed webhook.

Low

  • [breaking-cli] internal/repos/gitlab_trigger_account.go:1039 — EnforceWebhookSafety is now true on both the install/rotate and early-containment paths, so project-wide trigger safety invariants apply to every existing trigger account, not only accounts on the activated webhook route. docs/cli/repos.md scopes the revocation with "On the trigger-account route", which understates this, and does not describe the resulting failure output or exit status of repos install/repos status.
    Remediation: In docs/cli/repos.md, state that safety-drift containment applies to any existing trigger account whether or not dispatch is activated, and document the failure output.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (4)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJoaWdoIiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9jbGkvcmVwb3NfZ2l0bGFiX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl82OWFlNDgyMzNlYjUxYTg0IiwibGluZSI6NjEsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJoaWdoIiwiY2F0ZWdvcnkiOiJwcml2aWxlZ2UtZXNjYWxhdGlvbiIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfdHJpZ2dlcl9hY2NvdW50LmdvIiwiaWQiOiJmXzY5NzE2M2U5NzgyM2ZjY2MiLCJsaW5lIjoxMDQ2LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfdHJpZ2dlcl9hY2NvdW50LmdvIiwiaWQiOiJmXzY4ZDc0NjEyOGE2MTE2YjIiLCJsaW5lIjoxNzE0LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJmYWlsLW9wZW4iLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3dlYmhvb2tfdHJpZ2dlcl9hY2NvdW50LmdvIiwiaWQiOiJmX2MyYzMzNDU5YzFhZGRkY2YiLCJsaW5lIjoxNjMsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6InNjb3BlLWNyZWVwIiwiZmlsZSI6ImludGVybmFsL2Rpc3BhdGNoL3JvdXRlci5nbyIsImlkIjoiZl9iZGU4MDU1NGE5OGU3ZDE3IiwibGluZSI6MTk0LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJicmVha2luZy1zY2hlbWEiLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl80NDQzMWMzOTVhNzRlNzYzIiwibGluZSI6MjMxLCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibWVkaXVtIiwiY2F0ZWdvcnkiOiJpbmNvcnJlY3QtZG9jIiwiZmlsZSI6ImRvY3MvY29udHJpYnV0aW5nL2dpdGxhYi1yb2xlLWNyZWRlbnRpYWxzLm1kIiwiaWQiOiJmX2U1YTc2ZWEwNzJiYjIzODMiLCJsaW5lIjo3NzksImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImluY29tcGxldGUtZG9jIiwiZmlsZSI6ImRvY3MvY2xpL3JlcG9zLm1kIiwiaWQiOiJmX2VhOTMyOTdiMGI3YjY1ZGMiLCJsaW5lIjoxMDkwLCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJpbmNvcnJlY3QtZG9jIiwiZmlsZSI6ImRvY3MvZ3VpZGVzL2dldHRpbmctc3RhcnRlZC9jb25maWd1cmluZy1naXRsYWIubWQiLCJpZCI6ImZfYjA2NDQyYWIzODgyZjA4MCIsImxpbmUiOjI3OSwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoiYXBpLXNoYXBlIiwiZmlsZSI6ImludGVybmFsL2NsaS9yZXBvcy5nbyIsImlkIjoiZl9lNWUyMDAzNDA0MThlYjk4IiwibGluZSI6MTMyNCwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6ImxvdyIsImNhdGVnb3J5IjoibmFtaW5nLWNvbnZlbnRpb24iLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3dlYmhvb2tfdHJpZ2dlcl9hY2NvdW50LmdvIiwiaWQiOiJmX2ZhZWRjYTJlZTYyOGZmZDMiLCJsaW5lIjoxODMsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6ImRvYy1zdHlsZSIsImZpbGUiOiJpbnRlcm5hbC9jbGkvcmVwb3NfZ2l0bGFiLmdvIiwiaWQiOiJmXzQxYTgyZjUwODQ3MjQ0ZGMiLCJsaW5lIjozODYsImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJsb3ciLCJjYXRlZ29yeSI6Im1pc2xlYWRpbmctbGFiZWwiLCJmaWxlIjpudWxsLCJpZCI6ImZfZGUxMTdlZTUzZjgxZjhiZSIsImFjdGlvbmFibGUiOmZhbHNlfV19 -->

Review

Findings

High

  • [logic-error] internal/cli/repos_gitlab_trigger_account.go:61 — Deferred retirement prevents the replacement account from passing dispatch activation. convergeGitLabDispatchRoute always calls maybeConvergeGitLabTriggerAccount with deferRetirement=true. Under DeferRetirement the lifecycle returns before retirePrevious and leaves a published replacement with a nonempty Retired list. DiagnoseGitLabTriggerAccount adds a drift reason for every Retired entry, and CheckGitLabTriggerDispatchGate requires GitLabTriggerStateReady with no retirement carve-out. After a rotation or legacy digest migration the gate therefore defers and activation is not recorded; refreshGitLabWebhookTriggerRoute then moves the webhook back to the Poller route instead of the new account token. If the Poller route is unavailable, finishGitLabTriggerAccountRetirement fails with 'webhook route is not verified' and retirement cannot finish; otherwise a second install is needed to restore account dispatch. The new tests exercise deferred retirement and webhook cutover separately and miss this interaction.
    Remediation: Let the activation gate verify a healthy current generation independently of intentionally deferred retirement obligations, while keeping ownership and safety checks for retired generations. Add an integrated rotation and digest-migration test that runs the real activation gate, webhook convergence, and retirement, including a project without an available Poller fallback.

  • [privilege-escalation] internal/repos/gitlab_trigger_account.go:1046 — Bearer containment checks only gitlabTriggerProjectSafetyProblem, which does not check ci_push_repository_for_job_token_allowed. That check exists only in the activation gate (gitlabTriggerDispatchJobTokenPushProblem). If job-token repository push becomes enabled, the gate withdraws activation but the published account trigger stays usable, and moving the webhook back to the Poller route does not invalidate copies of that bearer. A trigger token can name any ref, so a holder could run attacker-controlled CI as the trigger account and, with job-token push enabled, use that job's CI_JOB_TOKEN against the account's protected-branch access. This is the escalation the gate comment (gitlab_trigger_dispatch_gate.go) explicitly guards against.
    Remediation: Require job-token repository push to be verifiably disabled before publishing or retaining an account trigger bearer. An enabled, unsupported, or unreadable setting should remove the published variable and revoke current and retired account triggers, not just withdraw dispatch activation. Add coverage for drift after a successful publication.

Medium

  • [logic-error] internal/repos/gitlab_trigger_account.go:1714 — A replacement-token publication failure revokes the previous token that the still-active webhook uses. When PublishTriggerToken fails, removeRevokeAndSave(cctx, true) calls removeAndRevokePublished, which revokes the current generation and every retired generation with PublishStarted. During rotation the webhook has not been repointed and still embeds a retired generation's bearer, so even a transient failure creating the replacement CI/CD variable breaks the existing webhook before cutover, despite DeferRetirement. The interrupted-publication tests cover failure before publication and after the final ledger save, but not this publisher-error path.
    Remediation: When publishing a replacement fails, contain only the replacement's potentially exposed bearer and keep otherwise verified, healthy previous generations. Keep broader revocation for project-wide safety failures. Add a test for a publisher API failure while an existing webhook still uses the retired token.

  • [fail-open] internal/repos/gitlab_webhook_trigger_account.go:163 — An unreadable account-token protection record returns an ordinary error instead of requesting containment. resolveGitLabWebhookAccountToken returns an error when GetRepoSecretProtection fails; ensureGitLabWebhookAccountRoute then returns without removing the existing webhook and GitLabWebhookTriggerOwnerUnsafe does not recognize the error. Lifecycle containBySinkState also returns (false, err) without revoking when the same lookup fails. An existing bearer and webhook therefore stay usable while masking, protected status, variable type and wildcard scope cannot be established; known-unsafe attributes are contained but unreadable ones are not. Severity is medium because it requires an install-time API read failure, not attacker-controlled input.
    Remediation: Treat protection-read failures as requiring containment: remove the managed webhook, return a recognized unsafe-account error, and separately attempt sink removal and ownership-verified trigger revocation on detached cleanup contexts. Apply the same to lifecycle sink-verification failures and test an already-published account whose protection reads fail.

  • [scope-creep] internal/dispatch/router.go:194 — The PR changes HarnessRouter.routeOpened to dispatch 'triage' for opened work items, which were previously deliberately ignored (TestHarnessRouter_OpenedWorkItemIgnored and the 'issue open must not route' assertion in internal/poll/webhook_test.go). Linked issue GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509 covers moving GitLab webhook trigger-credential ownership to the trigger-only account and does not authorize new issue-open dispatch behaviour; the commit message acknowledges the bundling. Installs with triage enabled and the webhook fast path active will now start a triage pipeline for every new issue opened by a Developer+ actor (authorization is enforced downstream in run-agent-job.sh). The only release-note signal is one sentence in configuring-gitlab.md.
    Remediation: Split the work-item triage routing into a dedicated issue or PR, or obtain explicit authorization on GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509 and call it out in the PR description and release notes. Confirm triage handles the event without duplicate dispatch alongside label-triggered triage.

  • [breaking-schema] internal/repos/gitlab_trigger_account.go:231 — The FULLSEND_GITLAB_TRIGGER_ACCOUNT ledger gains a trigger_token_digest field (omitempty), but gitLabTriggerAccountStateVersion stays at 1 and the decoder uses DisallowUnknownFields (line 284). Released CLIs therefore fail to decode any ledger written with a digest (install, status, rotate, uninstall) with an unknown-field error rather than the designed 'unsupported version' error, so the version field no longer acts as the compatibility signal. Old CLIs still fail closed and the break is documented, so harm is mainly an unclear error.
    Remediation: Bump the ledger version so older CLIs fail with a clear 'unsupported version' error, or keep the digest out of the strictly decoded ledger. If the current approach is intentional, add a BREAKING CHANGE release note with a minimum CLI version and state whether a downgrade path exists.

  • [incorrect-doc] docs/contributing/gitlab-role-credentials.md:779 — Lines 778-780 say the webhook fast path uses no fourth identity and that 'the trigger-only service account described below is separate from that path and is not used by it'. This contradicts the core change and other updated passages in the same document, which say the managed webhook embeds the trigger-only account's published trigger token while dispatch activation is recorded.
    Remediation: Update lines 778-780 to say that while dispatch activation is recorded the managed webhook uses the trigger-only account's published trigger token, and falls back to the Poller-owned trigger on the api route when activation is not recorded.

  • [incomplete-doc] docs/cli/repos.md:1090 — The repos uninstall reference still says uninstall revokes the webhook's managed pipeline trigger token and deletes the wildcard-scoped FULLSEND_TRIGGER_TOKEN and FULLSEND_WEBHOOK_SECRET variables. The PR updated operations.md and repo-management.md to say that on the trigger-account route FULLSEND_TRIGGER_TOKEN was already deleted at install and the embedded trigger is revoked during trigger-account removal, but not this CLI reference page (AGENTS.md requires docs/cli to be kept in sync).
    Remediation: Update line 1090 of docs/cli/repos.md to match repo-management.md and operations.md.

Low

  • [incorrect-doc] docs/guides/getting-started/configuring-gitlab.md:279 — The new sentence ending at line 279 links to Project service accounts, which documents the Poller accounts; the trigger-only account is documented under '### Trigger-only service account' (#trigger-only-service-account).
    Remediation: Link to Trigger-only service account, or add it alongside the existing link.

  • [api-shape] internal/cli/repos.go:1324 — reconcileFailedGitLabWebhookSafety and reconcileGitLabWebhookSafety take both opts *reposInstallConfig and dryRun bool. The PR adds opts while keeping dryRun, so the two can diverge (TestReconcileGitLabWebhookSafety_UnsafeAccount passes dryRun:true with opts dryRun false).
    Remediation: Remove the redundant dryRun parameter and use opts.dryRun.

  • [naming-convention] internal/repos/gitlab_webhook_trigger_account.go:183 — Method (st gitlabWebhookState) gitlabAccountHookIndex repeats the gitlab prefix; sibling methods on the receiver (activeHookIndex, activeTriggerID, accountRouteProvisioned) omit it.
    Remediation: Rename to accountHookIndex.

  • [doc-style] internal/cli/repos_gitlab.go:386 — The doc comment on refreshGitLabWebhookAfterPollerFailure begins with 'A failed Poller stage skips...' instead of the function name, unlike Go doc convention and sibling functions.
    Remediation: Start the comment with the function name.

  • [misleading-label] N/A — The PR body states that the final implementation is committed locally as 323ad9519 and has not been pushed, and that the GitHub PR head still shows the previous implementation. This review evaluated only the pushed head (9d35b6f); the description may not match the reviewed code, and the live-acceptance checkbox required by GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509 as a pre-merge gate is unchecked.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (5)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImVkZ2UtY2FzZSIsImZpbGUiOiJpbnRlcm5hbC9jbGkvcmVwb3MuZ28iLCJpZCI6ImZfMWJiNjljZTU1MGQ1NTU2NyIsImxpbmUiOjExNzksImFjdGlvbmFibGUiOnRydWV9LHsic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6InNlY3JldC1leHBvc3VyZSIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfd2ViaG9va190cmlnZ2VyX2FjY291bnQuZ28iLCJpZCI6ImZfM2NiNWVmZDE4OTJjZjc2YSIsImxpbmUiOjEzOSwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiZmFpbC1vcGVuIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL2dpdGxhYl93ZWJob29rLmdvIiwiaWQiOiJmX2U4MjM5Nzg3YjNiMWMwM2UiLCJsaW5lIjoxMjA3LCJhY3Rpb25hYmxlIjp0cnVlfSx7InNldmVyaXR5IjoibG93IiwiY2F0ZWdvcnkiOiJsb2dpYy1lcnJvciIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfd2ViaG9va190cmlnZ2VyX2FjY291bnQuZ28iLCJpZCI6ImZfOTVjZGQ3OWI4OGU4M2ZjNSIsImxpbmUiOjEzOSwiYWN0aW9uYWJsZSI6dHJ1ZX1dfQ== -->

Review

Findings

Medium

  • [edge-case] internal/cli/repos.go:1179 — The Poller-failure callback (convergeTriggerAfterPollerFailure, used after role provisioning, role rotation and merge-grant rejection failures) calls maybeConvergeGitLabTriggerAccount with opts.rotateGitLabTriggerAccount and then continues, so convergeGitLabDispatchRoute and its webhook route refresh never run. With --rotate-gitlab-trigger-account, the lifecycle can replace the account trigger and revoke the previous token that the existing webhook now embeds. reconcileFailedGitLabWebhookSafety only revokes and never repairs the URL, so an unrelated failed role operation can leave a working webhook pointing at a revoked token until the next install. New with this PR.
    Remediation: Run the webhook route refresh after the lifecycle in the Poller-failure callback, or pass rotate=false on these failure paths so the account trigger cannot be replaced without the webhook handoff. Add a test combining a role-stage failure, account rotation and an existing account-owned webhook.

  • [secret-exposure] internal/repos/gitlab_webhook_trigger_account.go:139 — FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN is now the webhook bearer but lacks the runtime isolation of the credential it replaces: FULLSEND_TRIGGER_TOKEN and FULLSEND_WEBHOOK_SECRET are unset by the shipped job scripts and FULLSEND_TRIGGER_TOKEN is in oidcDenyKeys (internal/cli/run.go); the account token is neither unset nor denied, so protected-branch harness processes inherit it. Not a new exposure (the token was already published to those jobs, and the Poller trigger is retired), and the PR description defers the scaffold change, but the account route makes this the live webhook credential.
    Remediation: Add the token to oidcDenyKeys and unset it in the poll, dispatcher and agent job scripts, with regression tests for each boundary.

  • [fail-open] internal/repos/gitlab_webhook.go:1207 — When a project-level trigger-safety invariant fails (extra trigger-pipeline job, extra protected refs, variable override), gitlabTriggerSafetyCheck returns accountUnsafe=false early and the teardown revokes only triggers with the managed webhook description. The webhook is removed, but the account-owned trigger and published token stay live, so a holder can still start the now-unsafe protected pipeline through the trigger API. The dispatch gate is read-only and does not revoke either.
    Remediation: On a project-level safety failure while an account trigger is published, return a typed error as accountUnsafe does so repos install runs the ownership-verified account containment, or document why the gap is acceptable. Test an active account route after unrelated trigger jobs or extra protected refs appear.

Low

  • [logic-error] internal/repos/gitlab_webhook_trigger_account.go:139 — resolveGitLabWebhookAccountToken does not bind the published token value to the recorded account trigger. If the variable were set to the current FULLSEND_TRIGGER_TOKEN value, the webhook would keep the Poller bearer while naming the account trigger, verification would check the account trigger rather than the URL, the Poller triggers would be revoked, and later runs would not repair it. Needs a privileged write; availability impact only.
    Remediation: Reject an account-token value equal to the stored FULLSEND_TRIGGER_TOKEN or the token in the current webhook URL before retiring Poller credentials; add a regression test.

Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (6)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJoaWdoIiwiY2F0ZWdvcnkiOiJmYWlsLW9wZW4iLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3dlYmhvb2tfdHJpZ2dlcl9hY2NvdW50LmdvIiwiaWQiOiJmXzliMmZlNzgwYTVhM2I1NzciLCJsaW5lIjo3OSwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6ImhpZ2giLCJjYXRlZ29yeSI6InNlY3JldC1leHBvc3VyZSIsImZpbGUiOiJpbnRlcm5hbC9yZXBvcy9naXRsYWJfd2ViaG9vay5nbyIsImlkIjoiZl9hNGEzODYyYjkzZmVhM2M2IiwibGluZSI6ODMzLCJhY3Rpb25hYmxlIjp0cnVlfV19 -->

Review

Findings

High

  • [fail-open] internal/repos/gitlab_webhook_trigger_account.go:79 — A missing or malformed dispatch activation makes loadGitLabWebhookTriggerAccount return nil even when a managed webhook still carries the trigger account's token. dispatchActivationRecorded returns (false, nil) for these cases, so gitlabTriggerSafetyProblem leaves the account trigger out of the owner checks. The revocation-only ReconcileGitLabWebhookSafety can then pass and leave the webhook dispatching without verifying the owner's Developer ceiling.
    Remediation: Find account-owned live credentials without relying on dispatch activation (e.g. include the ledger's recorded TriggerTokenID and any trigger named by a managed webhook in the owner checks whenever the ledger is ready and published). Contain or remove any managed webhook whose named trigger is the account's while the activation is absent, malformed, or mismatched.

  • [secret-exposure] internal/repos/gitlab_webhook.go:833 — Account-trigger owner-check failures return a plain problem string, and the failure path revokes only triggers described as the webhook dispatcher. The account's trigger and FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN stay valid. Lifecycle containment runs only when GitLabWebhookTriggerOwnerUnsafe(err) matches (typed errors raised after publication). An elevated account owner or other failed safety invariants therefore leave the bearer usable through the trigger API. The commit message calls this a follow-up, but the exposure is introduced by this PR.
    Remediation: Connect account-route safety failures to ownership-verified lifecycle revocation of the published account trigger and token variable, including failures found before publication (e.g. return a typed error that GitLabWebhookTriggerOwnerUnsafe recognizes). Keep cleanup obligations on failure and stop the lifecycle from republishing the credential while the safety invariants are unmet.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (7)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJoaWdoIiwiY2F0ZWdvcnkiOiJmYWlsLW9wZW4iLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3dlYmhvb2tfdHJpZ2dlcl9hY2NvdW50LmdvIiwiaWQiOiJmXzBjMmNhZmRiOGVjMmM4MTQiLCJsaW5lIjo2NiwiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoibG9naWMtZXJyb3IiLCJmaWxlIjoiaW50ZXJuYWwvcmVwb3MvZ2l0bGFiX3dlYmhvb2suZ28iLCJpZCI6ImZfNzE3YWVlMzAyNDhhZTZjZCIsImxpbmUiOjI5NywiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5Ijoic2VjcmV0LWV4cG9zdXJlIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL2dpdGxhYl93ZWJob29rX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl8yOTAzMTNkOTMzOGQ3Mzc0IiwibGluZSI6MTg4LCJhY3Rpb25hYmxlIjp0cnVlfV19 -->

Review

Findings

High

  • [fail-open] internal/repos/gitlab_webhook_trigger_account.go:66 — A present but blank or malformed FULLSEND_GITLAB_TRIGGER_ACCOUNT ledger is treated as an absent account route (the decode error returns nil, nil). gitlabTriggerSafetyProblem includes the account trigger in its owner-ceiling check only when this loader returns a non-nil account, so revocation-only safety reconciliation can report success while an existing account-owned webhook stays live with an unchecked, potentially elevated owner. Ledger read errors are rejected, but decode errors silently bypass the control. Exploiting it needs a corrupted ledger variable and an elevated trigger owner together (insider/drift scenario).
    Remediation: Return a non-nil, safely formatted error when a present ledger cannot be decoded, so safety reconciliation removes the managed webhook instead of treating the account as absent. Add a regression test with an account-owned webhook, an elevated trigger owner, and a blank or malformed ledger.

Medium

  • [logic-error] internal/repos/gitlab_webhook.go:297 — triggerStored is set from ListRepoVariables, which also returns a variable that exists only in a named environment, while DeleteRepoSecret removes only the wildcard-scoped variable. If an environment-scoped FULLSEND_TRIGGER_TOKEN remains after account-route migration, accountRouteProvisioned never succeeds: every provisioning probe reports work and every reinstall reports deleting a variable it cannot remove, so convergence never settles.
    Remediation: Track presence of the wildcard-scoped trigger variable (e.g. via GetRepoSecretProtection) rather than the inventory value alone, leave environment-scoped variables untouched, and add a regression test for this case.

  • [secret-exposure] internal/repos/gitlab_webhook_trigger_account.go:188 — Every account-token resolution problem (unmasked, unprotected, file-typed, or environment-scoped FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN) defers and leaves the existing webhook in place. For an already-active account webhook, protection drift detected here keeps dispatching through a potentially exposed bearer; the legacy FULLSEND_TRIGGER_TOKEN path revokes an unsafe credential before deferring, while this path neither contains nor requests containment.
    Remediation: Distinguish unsafe or unverifiable credential protection from ordinary deferrals: remove the managed webhook and invoke ownership-verified account-token containment, or return a typed error that guarantees the caller performs containment. Test an already-active account webhook whose token protection becomes unsafe after lifecycle convergence.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (8)

Review

Findings

High

  • [role-escalation] internal/cli/repos_gitlab_trigger_account.go:167 — The post-lifecycle webhook refresh skips the containment that the initial webhook step applies. On a fresh install the webhook step runs first, then the lifecycle activates the account route and refreshGitLabWebhookTriggerRoute reaches ensureGitLabWebhookAccountRoute. If owner verification then reports the account above the ceiling or unverifiable, the webhook is torn down but the account's trigger and published FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN are deliberately left for the caller to contain. In convergeGitLabDispatchRoute the refresh error is only logged and joined; the GitLabWebhookTriggerOwnerUnsafe check and containGitLabTriggerAccountAfterWebhookFailure call exist only in the initial setup branch. The elevated or unverifiable account's bearer token stays live. The new containment tests cover only the initial setup branch.
    Remediation: Apply GitLabWebhookTriggerOwnerUnsafe handling to the refresh error as well: call containGitLabTriggerAccountAfterWebhookFailure on its detached, bounded context and join any containment failure with the original errors. Add a test where the account route is activated during the lifecycle and owner verification fails, or the context is cancelled, during the refresh that follows.

  • [error-handling] internal/cli/repos_gitlab_trigger_account.go:168 — Same code path as the role-escalation finding at line 167, viewed as an error-handling gap: owner-safety failures returned by the post-lifecycle webhook refresh are logged and joined but never routed to trigger-account containment, unlike the initial setup branch; later failed-repository webhook reconciliation does not contain the account either.
    Remediation: Route GitLabWebhookTriggerOwnerUnsafe errors from the refresh through the same detached, bounded containment as the initial branch, and add a refresh-path test.

Medium

  • [logic] internal/repos/gitlab_webhook_trigger_account.go:291 — A fresh install can activate the account route without ever provisioning its webhook. With no ledger, convergeGitLabDispatchRoute runs the Poller webhook step first, which can legitimately defer without creating a hook. The lifecycle can then succeed and record activation, but GitLabWebhookTriggerRouteStale returns false when no managed hook exists ('A project without a managed webhook is not stale'). The account-first path re-probes GitLabWebhookNeedsProvisioning; the fresh-install path does not. Install finishes without the account-owned webhook, and only a later reinstall creates it.
    Remediation: After the account lifecycle, re-check full webhook provisioning (GitLabWebhookNeedsProvisioning) when the earlier webhook stage left no hook, including on the fresh-install path. Add a test where the first webhook attempt defers, the lifecycle activates a usable account token, and the same install creates the account-owned webhook.

  • [fail-open] internal/repos/gitlab_webhook.go:825 — The account trigger was added to the safety inventory (gitlabTriggerSafetyProblem) but not to safety revocation. When a safety invariant fails or cannot be read, reconcileGitLabTriggerSafety calls revokeGitLabWebhookFastPath, whose teardown revokes only triggers described as GitLabWebhookTriggerDescription. The account trigger and its published FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN survive. For example, adding another protected ref removes the managed webhook but leaves the account bearer able to request pipelines directly on that ref. The credential pre-exists this PR (refactor(#8438): add CI_JOB_TOKEN child-pipeline agent dispatch route #8482 lifecycle), so the PR adds a missed revocation path rather than a new credential.
    Remediation: Connect failed or unverifiable webhook safety checks to ownership-verified revocation of the account trigger and removal of its published variable, preserving the ledger's cleanup obligations. Deleting the webhook or withdrawing activation does not invalidate the bearer token. Cover additional protected refs and failed safety reads after the account route is published.

  • [stale-doc] docs/cli/README.md:28 — The fullsend poll description (file not modified by this PR) still says 'The webhook fast path stays on the api route until GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509.' and describes --input-driver gitlab-webhook as using the poller-role credential. This PR implements GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509: once activation is recorded the webhook runs as the trigger account through the child-pipeline route.
    Remediation: Update docs/cli/README.md to say that once activation is recorded the webhook fast path dispatches through the child-pipeline route as the trigger account, and remove the outdated sentence.

  • [inconsistent-doc] docs/guides/infrastructure/infrastructure-reference.md:360 — Line 350 was updated in this PR to say FULLSEND_TRIGGER_TOKEN is deleted once the webhook uses the trigger-only account's token, but line 360 still says 'the webhook move that would consume it is tracked in GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509', contradicting line 350 and the PR.
    Remediation: Update line 360 to say that while dispatch activation is recorded, the managed webhook embeds FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN instead of FULLSEND_TRIGGER_TOKEN (GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509).

  • [inconsistent-doc] docs/contributing/gitlab-role-credentials.md:163 — The CI/CD variable table row for FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN still says 'the webhook move that would consume it is tracked in GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509', contradicting other passages of the same file updated in this PR that say the managed webhook now consumes the token.
    Remediation: Update line 163 to say the managed webhook embeds this token while dispatch activation is recorded (GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509).

  • [inconsistent-doc] docs/cli/repos.md:355 — The webhook fast-path prose in the 'GitLab role credentials' section describes only the Poller route: install provisions FULLSEND_TRIGGER_TOKEN and --rotate-gitlab-trigger-token mints a new token and updates the webhook. The flag table (line 325) and the trigger-only account section say that on the account route the webhook uses FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN and --rotate-gitlab-trigger-token rotates nothing.
    Remediation: Update line 355 to mention the account-route behaviour and --rotate-gitlab-trigger-account.

  • [inconsistent-doc] docs/guides/getting-started/configuring-gitlab.md:1484 — The verification checklist says that when the webhook fast path is enabled FULLSEND_TRIGGER_TOKEN and FULLSEND_WEBHOOK_SECRET are stored as masked, protected variables. On the account route FULLSEND_TRIGGER_TOKEN is deleted (as lines 706-713 of the same file now say), so operators may read its absence as a provisioning failure.
    Remediation: Update line 1484 to list FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN for the account route and to say FULLSEND_TRIGGER_TOKEN is present only on the Poller-owned route.

Low

  • [secret-exposure] internal/repos/gitlab_webhook.go:289 — The webhook probe registers only FULLSEND_TRIGGER_TOKEN and FULLSEND_WEBHOOK_SECRET with its redactor and st.known, although ListRepoVariables also returns FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN, which the webhook now embeds. A protection-lookup error that echoed the account token would be returned unredacted from this exported probe path (defense-in-depth).
    Remediation: Add FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN to the probe's redactor and st.known before any protection lookup, and audit the teardown and reconciliation redactors for the same omission.

  • [stale-doc] docs/guides/getting-started/repo-management.md:811 — The GitLab uninstall description says webhook teardown revokes its managed pipeline trigger token and deletes FULLSEND_TRIGGER_TOKEN. On the account route the trigger is revoked during trigger-account removal and FULLSEND_TRIGGER_TOKEN was already deleted at install; only the attribution of the step is imprecise.
    Remediation: Clarify the account-route teardown at line 811.

  • [inconsistent-doc] docs/guides/getting-started/operations.md:130 — Step 1 of GitLab teardown says the webhook's managed trigger token is revoked during webhook teardown and FULLSEND_TRIGGER_TOKEN is deleted. On the account route the trigger is revoked by the account-removal step and FULLSEND_TRIGGER_TOKEN was already deleted (see the variable table at line 80).
    Remediation: Update line 130 to reflect the account-route teardown.

  • [stale-doc] docs/guides/dev/cli-internals.md:72 — The comment for --rotate-gitlab-trigger-token ('Force-rotate the GitLab webhook fast-path trigger token') does not reflect the updated help text: on the account route this flag rotates nothing and --rotate-gitlab-trigger-account should be used.
    Remediation: Update the comment to point to --rotate-gitlab-trigger-account for the account route.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR
Previous run (9)

<!-- fullsend:review-findings-v2:eyJ2ZXJzaW9uIjoyLCJhY3Rpb24iOiJyZXF1ZXN0LWNoYW5nZXMiLCJmaW5kaW5ncyI6W3sic2V2ZXJpdHkiOiJtZWRpdW0iLCJjYXRlZ29yeSI6ImxvZ2ljLWVycm9yIiwiZmlsZSI6ImludGVybmFsL2NsaS9yZXBvcy5nbyIsImlkIjoiZl9jYzlmMTU2MGNhODU0MmIyIiwibGluZSI6MTI2MywiYWN0aW9uYWJsZSI6dHJ1ZX0seyJzZXZlcml0eSI6Im1lZGl1bSIsImNhdGVnb3J5IjoiZmFpbC1vcGVuIiwiZmlsZSI6ImludGVybmFsL3JlcG9zL2dpdGxhYl93ZWJob29rX3RyaWdnZXJfYWNjb3VudC5nbyIsImlkIjoiZl85MzgzN2ZjNTEzOWRjZjQzIiwibGluZSI6MjMwLCJhY3Rpb25hYmxlIjp0cnVlfV19 -->

Review

Findings

Medium

  • [logic-error] internal/cli/repos.go:1263 — On reinstall, the trigger-account activation comes back too late. The early containment pass (containGitLabTriggerAccount → repos.ContainGitLabTriggerAccount) always calls clearDispatchActive first, which deletes FULLSEND_GITLAB_DISPATCH_ACTIVATION. That happens before convergence computes NeedsGitLabWebhook and before the webhook step at line 1248 runs. As a result, loadGitLabWebhookTriggerAccount returns nil in both GitLabWebhookNeedsProvisioning and ensureGitLabWebhookFastPath, and a webhook that is already correctly owned by the account is judged against the Poller route. For managed Pollers, every install then creates and cuts over a new Poller generation, only for refreshGitLabWebhookTriggerRoute to revoke its trigger after maybeConvergeGitLabTriggerAccount (line 1263) re-records the activation. If Poller trigger provisioning defers instead, deferGitLabTriggerReplacement calls revokeGitLabWebhookFastPath, which deletes the account webhook. The later refresh cannot bring it back, because GitLabWebhookTriggerRouteStale returns false when no managed hook exists. The new tests set up the activation right before webhook convergence, so they never exercise the real install order.
    Remediation: Don't converge the webhook onto the Poller route while the activation is temporarily withdrawn. Settle and recheck the trigger-account lifecycle before choosing the webhook credential, keeping the Poller inventory ordering that's needed. Make sure the post-lifecycle convergence also creates a missing webhook when it should. Add install-level reinstall tests that include early containment, covering both a managed Poller and an unavailable or ineligible Poller fallback.

  • [fail-open] internal/repos/gitlab_webhook_trigger_account.go:230 — When owner verification fails after publication, the webhook is removed but the account's bearer token stays usable. verifyGitLabWebhookActiveToken checks the recorded trigger ID and its owner's effective access. On failure, the branch calls revokeGitLabWebhookFastPath → TeardownGitLabWebhookFastPathLocked, which only revokes triggers whose description is GitLabWebhookTriggerDescription. The account trigger uses its own generation-specific description, so if the account is raised to Maintainer, or its access can't be verified after publication, this branch leaves both the account trigger and FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN in place. The code comment says the lifecycle "contains it", but nothing in this path calls containment, and the webhook error at repos.go:1249-1257 hits continue, which skips maybeConvergeGitLabTriggerAccount in the same install run.
    Remediation: Before returning, run ownership-verified trigger-account containment on a detached, bounded context, or at least don't skip the trigger-account lifecycle stage after this error, so the account is demoted or its published token and trigger are revoked. Add tests for elevation after publication that check the account's access is contained, not just that the webhook is deleted.


Labels: GitLab webhook provisioning in Go with docs updates


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review fullsend-ai-review Bot added go Pull requests that update go code component/install CLI install and app setup labels Oct 18, 2026
@fullsend-ai-coder

fullsend-ai-coder Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 2:45 PM UTC · Completed 3:04 PM UTC

Commit: 107ece6 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.50

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (bot-triggered)

Addressed both findings with one commit. Reinstall now settles the trigger account before the webhook, with a recheck of webhook need afterwards. An owner-verification failure after publication now contains the trigger account instead of leaving its token usable. Tests were added for the new behavior. Related Go tests pass; unrelated internal/cli tests (fetch service sockets and an output-schema env var) fail in this sandbox, also without the change. pre-commit could not fetch hook repos, so applicable hooks were run directly.

Fixed (2):

  1. On reinstall the trigger-account activation is re-recorded too late: early containment withdraws it, so the webhook is judged against the Poller route and can be cut over or deleted before the lifecycle runs (internal/cli/repos.go): Added convergeGitLabDispatchRoute. When a trigger-account ledger already exists (reinstall), the trigger-account lifecycle now runs before the webhook step, so the webhook is converged against the settled activation. Whether the webhook needs work is rechecked after the lifecycle, so a missing webhook is created. A fresh install keeps the webhook-first order, so the Poller inventory ordering is unchanged. The post-lifecycle route refresh is kept. Tests cover both orders, the recheck creating a missing webhook, lifecycle failure not skipping the webhook, and an unreadable ledger falling back to the fresh-install order. Limitation: no install-level test drives early containment plus a managed Poller or an ineligible Poller through runReposInstall against the real lifecycle; the ordering is covered by unit tests of the extracted helper.
  2. When owner verification fails after publication, the webhook is removed but the account's trigger and published token stay usable, and the webhook error skipped the trigger-account stage (internal/repos/gitlab_webhook_trigger_account.go): Added the exported predicate GitLabWebhookTriggerOwnerUnsafe (elevated, below Developer, or unverifiable owner). On such a webhook failure, repos install now runs the existing ownership-verified trigger-account containment on a context detached from install cancellation, with a 2-minute bound. Containment restores Developer access or revokes the published token and trigger. A containment failure is joined onto the repo's error. Other webhook failures do not trigger containment, because it also withdraws the dispatch activation. Tests cover elevation after publication with a canceled install context, containment failure reporting, and a non-owner failure not containing. Updated the stale code comment that claimed the lifecycle already contained this case.

Tests: passed

CI inspections (5):

  1. test (passing, success): Passed on the reviewed head.
  2. codecov/patch (passing, success): Passed on the reviewed head.
  3. commit-lint (passing, success): Passed on the reviewed head.
  4. playback (passing, success): Passed on the reviewed head.
  5. behaviour (pending, in_progress): Still running when inspected; no result to classify. Check the result after the new commit is pushed.

Conflict update: skipped; strategy none; forge MERGEABLE; target main

Decision points
  • How to keep the activation consistent on reinstall without changing early containment (alternatives: Stop early containment from withdrawing the activation, Skip the webhook step until after the lifecycle, Run the lifecycle before the webhook only when a ledger exists; rationale: Early containment must keep withdrawing the activation so a later failing stage never leaves a stale record. Ordering the stages only when a ledger exists fixes reinstall, and a fresh install has nothing withdrawn, so it keeps the original Poller-first order.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

fullsend-ai-coder Bot added a commit that referenced this pull request Oct 18, 2026
…einstall

Early containment withdraws the dispatch activation on every install and
only the trigger-account lifecycle records it again, so on a reinstall the
webhook step judged an account-owned webhook against the Poller route. Run
the lifecycle before the webhook when a trigger-account ledger exists,
recheck whether the webhook needs work afterwards, and keep the existing
webhook-first order for a fresh install.

When the webhook step reports that the published trigger's owner is above
Developer, below it, or unverifiable, run the ownership-verified
trigger-account containment on a detached, bounded context instead of
skipping the lifecycle stage, so the account is demoted or its published
token and trigger are revoked.

Disclosure: pre-commit could not fetch hook repositories in the sandbox, so
the applicable hooks (whitespace, line endings, private keys, gofmt, secret
scan) were run directly. Unrelated tests in internal/cli that need local
sockets or an unset FULLSEND_OUTPUT_SCHEMA fail in this sandbox, also
without this change.

Addresses #8548

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fullsend-ai-review

fullsend-ai-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 3:06 PM UTC · Completed 3:25 PM UTC

Commit: 6b7689c · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $4.38

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-coder

fullsend-ai-coder Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 3:27 PM UTC · Completed 3:44 PM UTC

Commit: 6b7689c · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $1.22

fullsend-ai-coder Bot added a commit that referenced this pull request Oct 18, 2026
…x stale docs

Address review feedback on PR #8548:
- contain the trigger account when the post-lifecycle webhook refresh
  reports an owner-safety failure, as the initial webhook step does
- treat an active account route with no managed webhook as stale so a
  fresh install creates the account-owned webhook
- register the account token with the webhook probe and teardown redactors
- update stale docs about the webhook move (#8509) and account-route teardown

Not changed: revoking the account trigger on webhook safety failures needs
lifecycle-level changes and is left for a follow-up.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 2 (bot-triggered)

Addressed 12 of the 13 findings: refresh-path trigger-account containment (both High findings, with a test), active-route-without-webhook staleness (with tests), redaction of the account token, and the seven stale or inconsistent docs. Disagreed with the safety-revocation finding, which needs lifecycle-level changes and is better as a follow-up. Tests pass for internal/repos and the GitLab-related internal/cli tests. Some unrelated internal/cli tests fail in this sandbox (fetch service, output-schema env, gateway refresh timing). Pre-commit could not run (hook repositories unreachable) and golangci-lint is not installed, so gofmt, go vet and the tests were run directly.

Fixed (12):

  1. role-escalation: post-lifecycle webhook refresh skips trigger-account containment (internal/cli/repos_gitlab_trigger_account.go): The refresh error in convergeGitLabDispatchRoute now runs the same detached, bounded trigger-account containment as the initial webhook step when the error is an owner-safety failure, and joins any containment failure. Added a test where the account route is activated during the lifecycle and the owner is elevated during the refresh, with a canceled install context.
  2. error-handling: refresh owner-safety errors never routed to containment (internal/cli/repos_gitlab_trigger_account.go): Same root cause and fix as the role-escalation finding; the refresh-path test covers it, including that a containment failure is reported.
  3. logic: fresh install can activate the account route without provisioning its webhook (internal/repos/gitlab_webhook_trigger_account.go): GitLabWebhookTriggerRouteStale now reports stale when the account route is active and no managed webhook exists, so the post-lifecycle refresh creates the account-owned webhook. On the Poller route a missing webhook is still left to the webhook step. Added tests for the active and inactive cases and updated the read-failure test.
  4. stale-doc: docs/cli/README.md says the webhook fast path stays on the api route until GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509 (docs/cli/README.md): Removed the outdated sentence and described the webhook running as the trigger account through the child-pipeline route once activation is recorded.
  5. inconsistent-doc: infrastructure-reference.md still says the webhook move is tracked in GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant #8509 (docs/guides/infrastructure/infrastructure-reference.md): The account token row now says the managed webhook embeds it while dispatch activation is recorded.
  6. inconsistent-doc: gitlab-role-credentials.md variable table row for the account token (docs/contributing/gitlab-role-credentials.md): The row now says the managed webhook embeds this token while dispatch activation is recorded.
  7. inconsistent-doc: repos.md webhook fast-path prose describes only the Poller route (docs/cli/repos.md): Added the account-route behaviour: the webhook embeds the account token, FULLSEND_TRIGGER_TOKEN is retired, --rotate-gitlab-trigger-token rotates nothing, and --rotate-gitlab-trigger-account is used instead.
  8. inconsistent-doc: configuring-gitlab.md verification checklist lists FULLSEND_TRIGGER_TOKEN unconditionally (docs/guides/getting-started/configuring-gitlab.md): The checklist now lists the account token for the account route and says FULLSEND_TRIGGER_TOKEN is present only on the Poller-owned route.
  9. secret-exposure: webhook probe redactor omits the trigger account token (internal/repos/gitlab_webhook.go): Registered FULLSEND_GITLAB_TRIGGER_ACCOUNT_TOKEN with the probe redactor and st.known, and with the safety-credential and teardown redactors found by auditing the same pattern. Added a test that a protection-lookup error echoing the account token is redacted.
  10. stale-doc: repo-management.md uninstall description attributes trigger revocation to webhook teardown (docs/guides/getting-started/repo-management.md): Clarified that the webhook teardown revokes the Poller-owned trigger, and that on the account route the account removal revokes the account's trigger and FULLSEND_TRIGGER_TOKEN was already deleted at install.
  11. inconsistent-doc: operations.md teardown step 1 (docs/guides/getting-started/operations.md): Same clarification for the account-route teardown.
  12. stale-doc: cli-internals.md comment for --rotate-gitlab-trigger-token (docs/guides/dev/cli-internals.md): The comment now says the flag rotates the Poller-owned trigger, rotates nothing on the account route, and points to --rotate-gitlab-trigger-account.

Disagreed (1):

  1. fail-open: account trigger not covered by safety revocation: Not implemented in this PR. The webhook package has no handle on the trigger-account lifecycle (lease, API, ledger), so a forced revocation needs a new lifecycle entry point and wiring through several callers. It would also be undone on the next converge, because the lifecycle's own deferral does not check the safety invariants such as extra protected refs and could republish the token. That needs the lifecycle to enforce them as well. The credential and its exposure to these invariants pre-date this PR (refactor(#8438): add CI_JOB_TOKEN child-pipeline agent dispatch route #8482), and the PR already contains the elevated-owner case. Suggest a follow-up issue that makes the lifecycle and safety reconciliation share one invariant check and revoke the published trigger and variable through the ledger.

Tests: passed

CI inspections (10):

  1. test (passing, success): Project CI unit tests passed on the reviewed head.
  2. test-sandbox-darwin (passing, success)
  3. web (passing, success)
  4. gateway-doc-configs (passing, success)
  5. commit-lint (passing, success)
  6. build (passing, success)
  7. behaviour (passing, success)
  8. playback (passing, success)
  9. codecov/patch (passing, success)
  10. DCO (passing, success)

Conflict update: skipped; strategy none; forge MERGEABLE; target main@f5422b9ee2a935c6dc23d382c53a2733c436f020

Decision points
  • Whether to implement safety-driven revocation of the account trigger in this PR (alternatives: Add a forced-revocation lifecycle entry point and wire it into the webhook safety paths now, Leave it for a follow-up that gives the lifecycle and the safety reconciliation one shared invariant check; rationale: A one-sided revocation would be undone by the next lifecycle converge and could revoke on transient read errors mid-install. The credential pre-dates this PR.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:46 PM UTC · Completed 12:08 AM UTC

Commit: 51a30a5 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $6.07

fullsend-ai-review[bot]

This comment was marked as outdated.

fullsend-ai-review[bot]

This comment was marked as outdated.

@fullsend-ai-review
fullsend-ai-review Bot dismissed their stale review October 19, 2026 00:08

Superseded by updated review

@fullsend-ai-review fullsend-ai-review Bot removed the ready-for-merge All reviewers approved — ready to merge label Oct 19, 2026
@ggallen ggallen removed the fullsend-no-fix Skip bot-triggered fix agent runs label Oct 19, 2026
@ggallen

ggallen commented Oct 19, 2026

Copy link
Copy Markdown
Member

/fs-fix

@fullsend-ai-coder

fullsend-ai-coder Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 Finished Fix · ✅ Success · Started 12:28 AM UTC · Completed 12:46 AM UTC

Commit: 51a30a5 · View workflow run →

Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.89

- Keep the account-containment signal on every safety-check read failure
  (ledger, trigger inventory, route, hook inventory, project lookup), so a
  published account bearer is contained when its safety is unverifiable.
- Keep the retired trigger the webhook still uses when an empty sink follows
  a second interrupted retry that cleared PublicationPending.
- Correct breaking-change and ledger docs, and fix doc comments, a
  single-case switch and the deferred-result log level.

Pre-commit could not run (hook repositories unreachable: certificate
verification failed); gofmt, go vet, repos tests and docs link checks pass.
Four internal/cli TestStartFetchService tests fail without these changes too
(sandbox environment).

Addresses #8548

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fullsend-ai-coder

Copy link
Copy Markdown
Contributor Author

🔧 Fix agent — iteration 1 (human-triggered)

Addressed all 10 findings: the high-severity fail-open containment gap, the cleared-sink retry edge case, and the doc and style items. Added regression tests. gofmt, go vet, the repos, scaffold and gitlablifecycle tests and the docs link checks pass. Pre-commit could not run because hook repositories were unreachable (certificate error in the sandbox). Four internal/cli TestStartFetchService tests fail with or without these changes, in this sandbox only. Project CI checks on the previous head were all passing.

Fixed (10):

  1. Account containment skipped when safety invariants cannot be read (fail-open) (internal/repos/gitlab_webhook.go): A published or unreadable account ledger now counts as containment-required. gitlabTriggerOwnerSafety reads it first and keeps the signal through every later read failure (trigger list, account route, hook inventory). gitlabTriggerSafetyCheck uses the same helper, and failClosedOnProjectLookup now returns the recognized unsafe-account error. Added regression tests for each read-failure path and for a project with no published credential.
  2. Cleared-sink exception does not survive an interrupted retry (internal/repos/gitlab_trigger_account.go): An empty sink no longer revokes a retired trigger the webhook still uses while the current generation is unpublished and a retired generation still has a published trigger. This covers the case where startFreshGeneration cleared PublicationPending. This derives the state from existing ledger markers rather than adding a new ledger field. Added a two-consecutive-failure regression test, which fails without the fix.
  3. Breaking-change note and webhook route description incomplete in repo-management.md (docs/guides/getting-started/repo-management.md): The breaking-change note now says the ledger digest breaks older decoders for install, status and uninstall regardless of schedule ownership. The trigger-only account section now says the webhook moves to the account's published trigger token.
  4. Deferred results logged with StepDone (internal/cli/repos_gitlab.go): refreshGitLabWebhookAfterPollerFailure now logs details with StepInfo when the result action is deferred, matching setupGitLabWebhookFastPath.
  5. Single-case expressionless switch (internal/repos/gitlab_webhook_trigger_account.go): Replaced with an if on t.ID == acct.triggerID.
  6. gitlabRetiredPublishedSafetyProblems lacks a doc comment (internal/repos/gitlab_trigger_dispatch_gate.go): Added a doc comment.
  7. GitLabWebhookTriggerRouteStale doc comment names the wrong caller (internal/repos/gitlab_webhook_trigger_account.go): The comment now names its only production caller, the account-route repair after a failed Poller stage.
  8. Over-long triggerStored comment line (internal/repos/gitlab_webhook.go): Re-wrapped the comment. The review marked this one non-actionable, but the change is trivial.
  9. docs/agents/triage.md describes GitHub issues only (docs/agents/triage.md): Added one sentence that on GitLab, opening an issue also dispatches triage when the webhook fast path is active.
  10. Ledger field list omits the trigger token digest (docs/guides/infrastructure/infrastructure-reference.md): Added the SHA-256 trigger token digest to the ledger field list here and in docs/contributing/gitlab-role-credentials.md.

Tests: passed

CI inspections (1):

  1. project CI (test, build, behaviour, playback, gate, commit-lint, DCO, codecov/patch and others) (passing, success): All non-Fullsend checks on the PR head before this fix were successful.

Conflict update: skipped; strategy none; forge MERGEABLE; target main@89fcd8f7198f2f7f64cb992721327e7bc17a89ce

Decision points
  • How to persist the cleared-sink exception across generation changes (alternatives: Add a new ledger field carried across startFreshGeneration, Derive it from existing markers (current generation unpublished, a retired generation still published); rationale: A new ledger field would need validation and reset logic in many places. Deriving it from existing markers needs no schema change. Containment clears a generation's TriggerPublished marker once revocation succeeds, so the exception ends after explicit containment.)

Next steps:

  • /fs-review — request a re-review of the changes
  • /fs-fix <your instruction> — run another fix pass with specific guidance
  • Push commits directly — review re-runs automatically on push
    Updated by fullsend fix agent

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 12:48 AM UTC · Completed 1:06 AM UTC

Commit: 8f15c99 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $5.65

Comment thread internal/dispatch/router.go Resolved
@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge component/dispatch Workflow dispatch and triggers component/docs User-facing documentation labels Oct 19, 2026

@ggallen ggallen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved for merge. The remaining low-severity review points are tracked in #8555, blocked on #8509 / this PR merging.

@ggallen
ggallen added this pull request to the merge queue Oct 19, 2026
Merged via the queue into main with commit 6f70a3e Oct 19, 2026
184 checks passed
@ggallen
ggallen deleted the agent/8509-webhook-trigger-account branch October 19, 2026 01:38

This branch was successfully deployed

1 active and 1 inactive deployments
site-preview — 8f15c998 Deployed Oct 19, 2026 by github-actions[bot]
dev — 8f15c998 Deployed Oct 19, 2026 by fullsend-ai-coder[bot] via behaviour #17095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/dispatch Workflow dispatch and triggers component/docs User-facing documentation component/install CLI install and app setup go Pull requests that update go code needs-human Agent loop needs human intervention ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitLab: route the managed webhook through the trigger-only account and remove the per-user merge grant

1 participant