WIP: feat/distributed-scaling-core #178

Draft
byteflavour wants to merge 9 commits from byteflavour/feat/distributed-scaling-core into main
byteflavour commented 2026-05-31 18:54:07 +00:00 (Migrated from codeberg.org)

Scaling Forgejo-MCP: Transitioning to a Distributed, Multi-User Architecture

This PR introduces a design blueprint (ADR) for hardening the Forgejo-MCP architecture
to support high-concurrency, multi-tenant environments. As the service moves from a
single-user CLI tool toward a distributed remote service (SSE/HTTP), we must address
fundamental bottlenecks in transport logic and observability.

## Scaling Forgejo-MCP: Transitioning to a Distributed, Multi-User Architecture This PR introduces a design blueprint (ADR) for hardening the Forgejo-MCP architecture to support high-concurrency, multi-tenant environments. As the service moves from a single-user CLI tool toward a distributed remote service (SSE/HTTP), we must address fundamental bottlenecks in transport logic and observability.
op1st-gitops commented 2026-05-31 18:54:11 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code is skipping this commit.
User byteflavour is not allowed to trigger CI via pull_request in this repo.

op1st Pipelines as Code is skipping this commit. User byteflavour is not allowed to trigger CI via pull_request in this repo.
op1st-gitops commented 2026-05-31 18:58:28 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code is skipping this commit.
User byteflavour is not allowed to trigger CI via pull_request in this repo.

op1st Pipelines as Code is skipping this commit. User byteflavour is not allowed to trigger CI via pull_request in this repo.
op1st-gitops commented 2026-05-31 19:30:33 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/code-scans-vhgqv is running.

Starting Pipelinerun code-scans-vhgqv in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines code-scans-vhgqv -f

op1st Pipelines as Code/code-scans-vhgqv is running. Starting Pipelinerun <b>[code-scans-vhgqv](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-vhgqv)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-vhgqv) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines code-scans-vhgqv -f</code>
op1st-gitops commented 2026-05-31 19:30:33 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/on-pull-request-n2nlq is running.

Starting Pipelinerun on-pull-request-n2nlq in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines on-pull-request-n2nlq -f

op1st Pipelines as Code/on-pull-request-n2nlq is running. Starting Pipelinerun <b>[on-pull-request-n2nlq](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-n2nlq)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-n2nlq) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines on-pull-request-n2nlq -f</code>
op1st-gitops commented 2026-05-31 19:30:59 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/code-scans-vhgqv has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 12 seconds

fetch-source

Succeeded 9 seconds

gitleaks-version

Succeeded 14 seconds

gitleaks

op1st Pipelines as Code/code-scans-vhgqv has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-vhgqv">code-scans-vhgqv</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>12 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-vhgqv/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>9 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-vhgqv/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>14 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-vhgqv/logs/gitleaks) </td></tr> </table>
op1st-gitops commented 2026-05-31 19:32:21 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/on-pull-request-n2nlq has failed.


Task Statuses:

StatusDurationName
Succeeded 11 seconds

fetch-source

Succeeded 1 minute

build-and-test

Failed 15 seconds

commit-title-check


Failure snippet:

task commit-title-check has the status "Failed":
feat(api): add /healthz endpoint
  fix: handle nil session token
  chore(release): 2.25.1
op1st Pipelines as Code/on-pull-request-n2nlq has <b>failed</b>. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-n2nlq">on-pull-request-n2nlq</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>11 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-n2nlq/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>1 minute</td><td> [build-and-test](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-n2nlq/logs/build-and-test) </td></tr> <tr> <td>Failed</td> <td>15 seconds</td><td> [commit-title-check](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-n2nlq/logs/commit-title-check) </td></tr> </table> <hr> <h4>Failure snippet:</h4> task <b>commit-title-check</b> has the status <b>"Failed"</b>: <pre>feat(api): add /healthz endpoint fix: handle nil session token chore(release): 2.25.1</pre>
byteflavour commented 2026-05-31 19:43:04 +00:00 (Migrated from codeberg.org)

Wait; am i confusing the agentic pipe? :D

My ADR isn't following any schema or respects folder's which may managed in the agentic pipe for now. U could say it's hand crafted ;) This document isn't finished ...

so i will initiate the openspec based on this ADR ... at least this was the plan. Maybe i have chosen the wrong place for this human authored ADR?

Wait; am i confusing the agentic pipe? :D My ADR isn't following any schema or respects folder's which may managed in the agentic pipe for now. U could say it's hand crafted ;) This document isn't finished ... so i will initiate the openspec based on this ADR ... at least this was the plan. Maybe i have chosen the wrong place for this human authored ADR?
op1st-gitops commented 2026-05-31 20:32:55 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/on-pull-request-pmhjw is running.

Starting Pipelinerun on-pull-request-pmhjw in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines on-pull-request-pmhjw -f

op1st Pipelines as Code/on-pull-request-pmhjw is running. Starting Pipelinerun <b>[on-pull-request-pmhjw](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-pmhjw)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-pmhjw) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines on-pull-request-pmhjw -f</code>
op1st-gitops commented 2026-05-31 20:32:55 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/code-scans-gdgdg is running.

Starting Pipelinerun code-scans-gdgdg in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines code-scans-gdgdg -f

op1st Pipelines as Code/code-scans-gdgdg is running. Starting Pipelinerun <b>[code-scans-gdgdg](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-gdgdg)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-gdgdg) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines code-scans-gdgdg -f</code>
op1st-gitops commented 2026-05-31 20:33:17 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/code-scans-gdgdg has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 11 seconds

fetch-source

Succeeded 7 seconds

gitleaks-version

Succeeded 9 seconds

gitleaks

op1st Pipelines as Code/code-scans-gdgdg has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-gdgdg">code-scans-gdgdg</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>11 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-gdgdg/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>7 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-gdgdg/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>9 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/code-scans-gdgdg/logs/gitleaks) </td></tr> </table>
goern commented 2026-05-31 20:34:24 +00:00 (Migrated from codeberg.org)

Hi @byteflavour — thanks for this, and sorry for the noise above (I deleted a comment that misread your ADR entirely).

Good instinct asking where this lives. Let's keep it as one consolidated ADR rather than splitting into five separate OpenSpec changes — the five sections are facets of a single architectural shift (singleton CLI → multi-tenant remote), so they belong together as one decision record. docs/design/ is the right home for the human-authored ADR; no need to force it through the OpenSpec folder schema at this stage. Once the ADR direction is agreed, individual sections can spin out into OpenSpec changes when they're ready to implement — the ADR is the parent, OpenSpec changes are the children.

On sequencing, my read on effort differs a little from a first glance: §1 (connection pool) is the cheapest win — it's essentially http.Transport tuning on the client singleton, low risk, immediate benefit. §2 (observability) is a solid mid-size piece. §3 (multi-layer auth) is the heaviest — OIDC-at-edge plus two-layer credential passing is security-sensitive and needs its own careful design pass, so I'd treat it as the long pole. §5 (statelessness) is largely already true for the stdio singleton and mostly matters once the SSE/HTTP transport is real.

So: finish fleshing out the single ADR here, we align on it, then carve implementation slices out of it. Thanks again — this is a valuable direction. 🎉

Hi @byteflavour — thanks for this, and sorry for the noise above (I deleted a comment that misread your ADR entirely). Good instinct asking where this lives. Let's keep it as **one consolidated ADR** rather than splitting into five separate OpenSpec changes — the five sections are facets of a single architectural shift (singleton CLI → multi-tenant remote), so they belong together as one decision record. `docs/design/` is the right home for the human-authored ADR; no need to force it through the OpenSpec folder schema at this stage. Once the ADR direction is agreed, individual sections can spin out into OpenSpec changes *when they're ready to implement* — the ADR is the parent, OpenSpec changes are the children. On sequencing, my read on effort differs a little from a first glance: **§1 (connection pool)** is the cheapest win — it's essentially `http.Transport` tuning on the client singleton, low risk, immediate benefit. **§2 (observability)** is a solid mid-size piece. **§3 (multi-layer auth)** is the heaviest — OIDC-at-edge plus two-layer credential passing is security-sensitive and needs its own careful design pass, so I'd treat it as the long pole. **§5 (statelessness)** is largely already true for the stdio singleton and mostly matters once the SSE/HTTP transport is real. So: finish fleshing out the single ADR here, we align on it, then carve implementation slices out of it. Thanks again — this is a valuable direction. 🎉
op1st-gitops commented 2026-05-31 20:34:38 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/on-pull-request-pmhjw has failed.


Task Statuses:

StatusDurationName
Succeeded 11 seconds

fetch-source

Succeeded 1 minute

build-and-test

Failed 11 seconds

commit-title-check


Failure snippet:

task commit-title-check has the status "Failed":
feat(api): add /healthz endpoint
  fix: handle nil session token
  chore(release): 2.25.1
op1st Pipelines as Code/on-pull-request-pmhjw has <b>failed</b>. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-pmhjw">on-pull-request-pmhjw</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>11 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-pmhjw/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>1 minute</td><td> [build-and-test](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-pmhjw/logs/build-and-test) </td></tr> <tr> <td>Failed</td> <td>11 seconds</td><td> [commit-title-check](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/on-pull-request-pmhjw/logs/commit-title-check) </td></tr> </table> <hr> <h4>Failure snippet:</h4> task <b>commit-title-check</b> has the status <b>"Failed"</b>: <pre>feat(api): add /healthz endpoint fix: handle nil session token chore(release): 2.25.1</pre>
op1st-gitops commented 2026-06-01 10:06:10 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-7jwx5 is running.

Starting Pipelinerun forgejo-mcp-code-scans-7jwx5 in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-7jwx5 -f

op1st Pipelines as Code/forgejo-mcp-code-scans-7jwx5 is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-7jwx5](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-7jwx5)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-7jwx5) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-7jwx5 -f</code>
op1st-gitops commented 2026-06-01 10:06:29 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-7jwx5 has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 10 seconds

fetch-source

Succeeded 8 seconds

gitleaks-version

Succeeded 8 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-7jwx5 has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-7jwx5">forgejo-mcp-code-scans-7jwx5</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>10 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-7jwx5/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>8 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-7jwx5/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>8 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-7jwx5/logs/gitleaks) </td></tr> </table>
op1st-gitops commented 2026-06-01 11:00:44 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-gz6n8 is running.

Starting Pipelinerun forgejo-mcp-code-scans-gz6n8 in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-gz6n8 -f

op1st Pipelines as Code/forgejo-mcp-code-scans-gz6n8 is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-gz6n8](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-gz6n8)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-gz6n8) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-gz6n8 -f</code>
op1st-gitops commented 2026-06-01 11:01:05 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-gz6n8 has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 12 seconds

fetch-source

Succeeded 8 seconds

gitleaks-version

Succeeded 9 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-gz6n8 has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-gz6n8">forgejo-mcp-code-scans-gz6n8</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>12 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-gz6n8/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>8 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-gz6n8/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>9 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-gz6n8/logs/gitleaks) </td></tr> </table>
op1st-gitops commented 2026-06-01 11:19:05 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-vhk6l is running.

Starting Pipelinerun forgejo-mcp-code-scans-vhk6l in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-vhk6l -f

op1st Pipelines as Code/forgejo-mcp-code-scans-vhk6l is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-vhk6l](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-vhk6l)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-vhk6l) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-vhk6l -f</code>
op1st-gitops commented 2026-06-01 11:19:25 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-vhk6l has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 10 seconds

fetch-source

Succeeded 7 seconds

gitleaks-version

Succeeded 8 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-vhk6l has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-vhk6l">forgejo-mcp-code-scans-vhk6l</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>10 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-vhk6l/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>7 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-vhk6l/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>8 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-vhk6l/logs/gitleaks) </td></tr> </table>
op1st-gitops commented 2026-06-01 11:28:25 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-kgzjx is running.

Starting Pipelinerun forgejo-mcp-code-scans-kgzjx in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-kgzjx -f

op1st Pipelines as Code/forgejo-mcp-code-scans-kgzjx is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-kgzjx](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-kgzjx)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-kgzjx) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-kgzjx -f</code>
op1st-gitops commented 2026-06-01 11:28:44 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-kgzjx has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 11 seconds

fetch-source

Succeeded 8 seconds

gitleaks-version

Succeeded 6 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-kgzjx has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-kgzjx">forgejo-mcp-code-scans-kgzjx</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>11 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-kgzjx/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>8 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-kgzjx/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>6 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-kgzjx/logs/gitleaks) </td></tr> </table>
byteflavour commented 2026-06-01 11:47:40 +00:00 (Migrated from codeberg.org)

This is a Living ADR. We are seeking architectural feedback before implementation begins.

Comment https://codeberg.org/goern/forgejo-mcp/pulls/178#issuecomment-16255829 must find it's way into the following issue.

When the PR is approved we will open an issue asking the community for review.

This is a Living ADR. We are seeking architectural feedback before implementation begins. Comment https://codeberg.org/goern/forgejo-mcp/pulls/178#issuecomment-16255829 must find it's way into the following issue. When the PR is approved we will open an issue asking the community for review.
goern commented 2026-06-01 16:31:36 +00:00 (Migrated from codeberg.org)

Thanks for this — the instinct to document scaling invariants before they become load-bearing is right, and it matches house precedent (docs/design/output-bounding.md declares an architectural rule ahead of its full retrofit). I ran an adversarial review grounded in the current code. The impulse is sound; several mechanism claims are inaccurate against the actual tree, and the ADR overlaps an open spec. Requesting changes + a split.

Factual corrections (verified against code):

  1. SSE/HTTP already ship (operation/operation.go:163-206), each already extracting a per-request token to context. The Context section's "as we move toward… via SSE/HTTP" understates current state — the transports exist; what's missing is the operational layer. Please reframe.

  2. §1 "Default Go HTTP clients limit concurrent persistent connections to 2 per host" is incorrect. DefaultTransport.MaxIdleConnsPerHost = 2 caps idle keep-alive connections; MaxConnsPerHost defaults to 0 (unlimited concurrent). The real effect is idle-pool starvation under bursty fan-out (surplus conns closed + re-dialed → handshake cost), not a concurrency ceiling. Please reword to the idle-pool framing.

  3. §1 won't pay off as written. Every authenticated request builds a fresh forgejo.NewClient (pkg/forgejo/forgejo.go:43) → fresh transport → fresh empty pool, discarded per call. Tuning MaxIdleConnsPerHost on a single-use transport is a no-op. The prerequisite — a shared/cached transport across requests — must be stated as step zero, or the optimization buys nothing.

Security — must harden or cut:

  1. §4 Discovery (X-Forgejo-URL) SSRF model is insufficient. IP-range blocklisting at resolve time is bypassable via DNS rebinding, HTTP redirects (the raw client sets no CheckRedirectpkg/forgejo/rawhttp.go:53), IPv4-mapped IPv6 (::ffff:169.254.169.254), and metadata endpoints. If Discovery stays, the control must resolve-then-pin the connected IP at DialContext (not validate the hostname), reject redirects to disallowed targets, and cover IPv6-mapped + cloud-metadata ranges. Pinned stays default; Discovery opt-in/off by default.

  2. §4 Discovery is also not buildable as a near-term item. The target URL is read from the process-global flag.URL everywhere (forgejo.go:43,91, rawhttp.go:70,88). Per-request token plumbing exists; per-request URL plumbing does not. That's a refactor on the scale of the auth work and isn't budgeted — please mark it future-scope.

Overlap with in-flight work:

  1. §3 Multi-Layer Auth overlaps the open, unarchived openspec/changes/stateless-http-auth/ (still has open blocker tasks). PAT-direct is already implemented (operation.go:112). Please cite that change and defer to it — or, if this supersedes it, say so explicitly. Carve gateway OAuth2/OIDC + XFF-trust into its own ADR; it carries its own threat model and shouldn't ride a scaling ADR.

Smaller fixes:

  1. §5 /readyz 503-on-saturation is backpressure/load-shedding, not scaling — and coupling it to readiness risks a k8s endpoint-removal cascade (saturated pods drop out → load shifts → cascade). Reword: 503 = backpressure; horizontal scaling is the orchestrator's job, optionally driven by the §2 telemetry.

  2. §6 statelessness vs. connection pool reads as a contradiction. Clarify that "stateless" = no cross-request session state; process-level resource caches (the pool) are permitted by Factor VI.

  3. §6 "Flags → Env → YAML" — current model is Flags → Env only (cmd/cmd.go:105-191); no YAML loader exists. Mark YAML aspirational or move to Open Questions.

Disposition: split into focused ADRs (transport/pooling · observability · SSRF/target-policy · health+config), each citing stateless-http-auth. Hold §1 and §4-Discovery until the false premise and SSRF model are reworked. The core thesis is worth keeping — it just needs precise mechanisms and the right altitude.

Thanks for this — the instinct to document scaling invariants *before* they become load-bearing is right, and it matches house precedent (`docs/design/output-bounding.md` declares an architectural rule ahead of its full retrofit). I ran an adversarial review grounded in the current code. The impulse is sound; several **mechanism claims are inaccurate against the actual tree**, and the ADR overlaps an open spec. Requesting changes + a split. **Factual corrections (verified against code):** 1. **SSE/HTTP already ship** (`operation/operation.go:163-206`), each already extracting a per-request token to context. The Context section's "as we move toward… via SSE/HTTP" understates current state — the transports exist; what's missing is the operational layer. Please reframe. 2. **§1 "Default Go HTTP clients limit concurrent persistent connections to 2 per host" is incorrect.** `DefaultTransport.MaxIdleConnsPerHost = 2` caps *idle keep-alive* connections; `MaxConnsPerHost` defaults to `0` (unlimited concurrent). The real effect is idle-pool starvation under bursty fan-out (surplus conns closed + re-dialed → handshake cost), not a concurrency ceiling. Please reword to the idle-pool framing. 3. **§1 won't pay off as written.** Every authenticated request builds a fresh `forgejo.NewClient` (`pkg/forgejo/forgejo.go:43`) → fresh transport → fresh empty pool, discarded per call. Tuning `MaxIdleConnsPerHost` on a single-use transport is a no-op. The prerequisite — a **shared/cached** transport across requests — must be stated as step zero, or the optimization buys nothing. **Security — must harden or cut:** 4. **§4 Discovery (`X-Forgejo-URL`) SSRF model is insufficient.** IP-range blocklisting at resolve time is bypassable via DNS rebinding, HTTP redirects (the raw client sets no `CheckRedirect` — `pkg/forgejo/rawhttp.go:53`), IPv4-mapped IPv6 (`::ffff:169.254.169.254`), and metadata endpoints. If Discovery stays, the control must **resolve-then-pin the connected IP at `DialContext`** (not validate the hostname), reject redirects to disallowed targets, and cover IPv6-mapped + cloud-metadata ranges. Pinned stays default; Discovery opt-in/off by default. 5. **§4 Discovery is also not buildable as a near-term item.** The target URL is read from the process-global `flag.URL` everywhere (`forgejo.go:43,91`, `rawhttp.go:70,88`). Per-request *token* plumbing exists; per-request *URL* plumbing does not. That's a refactor on the scale of the auth work and isn't budgeted — please mark it future-scope. **Overlap with in-flight work:** 6. **§3 Multi-Layer Auth overlaps the open, unarchived `openspec/changes/stateless-http-auth/`** (still has open blocker tasks). PAT-direct is already implemented (`operation.go:112`). Please cite that change and defer to it — or, if this supersedes it, say so explicitly. Carve gateway OAuth2/OIDC + XFF-trust into its own ADR; it carries its own threat model and shouldn't ride a scaling ADR. **Smaller fixes:** 7. **§5 `/readyz` 503-on-saturation** is backpressure/load-shedding, not scaling — and coupling it to readiness risks a k8s endpoint-removal cascade (saturated pods drop out → load shifts → cascade). Reword: 503 = backpressure; horizontal scaling is the orchestrator's job, optionally driven by the §2 telemetry. 8. **§6 statelessness vs. connection pool** reads as a contradiction. Clarify that "stateless" = no cross-request *session* state; process-level resource caches (the pool) are permitted by Factor VI. 9. **§6 "Flags → Env → YAML"** — current model is Flags → Env only (`cmd/cmd.go:105-191`); no YAML loader exists. Mark YAML aspirational or move to Open Questions. **Disposition:** split into focused ADRs (transport/pooling · observability · SSRF/target-policy · health+config), each citing `stateless-http-auth`. Hold §1 and §4-Discovery until the false premise and SSRF model are reworked. The core thesis is worth keeping — it just needs precise mechanisms and the right altitude.
goern commented 2026-06-01 16:33:26 +00:00 (Migrated from codeberg.org)

@byteflavour and maybe we should reframe this as a 'roadmap' as we show off the path forward rather than documenting actual architectural decisions. wdyt?

@byteflavour and maybe we should reframe this as a 'roadmap' as we show off the path forward rather than documenting actual architectural decisions. wdyt?
byteflavour commented 2026-06-01 17:21:49 +00:00 (Migrated from codeberg.org)

@goern wrote in https://codeberg.org/goern/forgejo-mcp/pulls/178#issuecomment-16302542:

@byteflavour and maybe we should reframe this as a 'roadmap' as we show off the path forward rather than documenting actual architectural decisions. wdyt?

Yes @goern, we can do this ... shall the reframing only be reflected in the wording or what are your thoughts? My next steps would be: Split the ADR, revise it, reframe it but keep it in the folder?!

@goern wrote in https://codeberg.org/goern/forgejo-mcp/pulls/178#issuecomment-16302542: > @byteflavour and maybe we should reframe this as a 'roadmap' as we show off the path forward rather than documenting actual architectural decisions. wdyt? Yes @goern, we can do this ... shall the reframing only be reflected in the wording or what are your thoughts? My next steps would be: Split the ADR, revise it, reframe it but keep it in the folder?!
byteflavour commented 2026-06-01 17:55:09 +00:00 (Migrated from codeberg.org)
@goern wrote in https://codeberg.org/goern/forgejo-mcp/pulls/178#issuecomment-16302506: > ... i am on it.
op1st-gitops commented 2026-06-02 08:18:17 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-2gflh is running.

Starting Pipelinerun forgejo-mcp-code-scans-2gflh in namespace op1st-pipelines

You can monitor the execution using the op1st Pipelines as Code PipelineRun viewer or through the command line by
using the tkn CLI with the following command:

tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-2gflh -f

op1st Pipelines as Code/forgejo-mcp-code-scans-2gflh is running. Starting Pipelinerun <b>[forgejo-mcp-code-scans-2gflh](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-2gflh)</b> in namespace <b>op1st-pipelines</b> You can monitor the execution using the [op1st Pipelines as Code](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-2gflh) PipelineRun viewer or through the command line by using the [tkn](https://tekton.dev/docs/cli/#installation) CLI with the following command: <code>tkn pr logs -n op1st-pipelines forgejo-mcp-code-scans-2gflh -f</code>
op1st-gitops commented 2026-06-02 08:18:43 +00:00 (Migrated from codeberg.org)

op1st Pipelines as Code/forgejo-mcp-code-scans-2gflh has successfully validated your commit.


Task Statuses:

StatusDurationName
Succeeded 15 seconds

fetch-source

Succeeded 7 seconds

gitleaks-version

Succeeded 11 seconds

gitleaks

op1st Pipelines as Code/forgejo-mcp-code-scans-2gflh has <b>successfully</b> validated your commit. <ul> <li><b>Namespace</b>: <a href="https://detailurl.setting.custom-console-url-namespace.is.not.configured">op1st-pipelines</a></li> <li><b>PipelineRun:</b> <a href="https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-2gflh">forgejo-mcp-code-scans-2gflh</a></li> </ul> <hr> <h4>Task Statuses:</h4> <table> <tr><th>Status</th><th>Duration</th><th>Name</th></tr> <tr> <td>Succeeded</td> <td>15 seconds</td><td> [fetch-source](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-2gflh/logs/fetch-source) </td></tr> <tr> <td>Succeeded</td> <td>7 seconds</td><td> [gitleaks-version](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-2gflh/logs/gitleaks-version) </td></tr> <tr> <td>Succeeded</td> <td>11 seconds</td><td> [gitleaks](https://console-openshift-console.apps.nostromo.erdgeschoss.b4mad.emea.operate-first.cloud/k8s/ns/op1st-pipelines/tekton.dev~v1~PipelineRun/forgejo-mcp-code-scans-2gflh/logs/gitleaks) </td></tr> </table>
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin byteflavour/feat/distributed-scaling-core:byteflavour/feat/distributed-scaling-core
git switch byteflavour/feat/distributed-scaling-core

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff byteflavour/feat/distributed-scaling-core
git switch byteflavour/feat/distributed-scaling-core
git rebase main
git switch main
git merge --ff-only byteflavour/feat/distributed-scaling-core
git switch byteflavour/feat/distributed-scaling-core
git rebase main
git switch main
git merge --no-ff byteflavour/feat/distributed-scaling-core
git switch main
git merge --squash byteflavour/feat/distributed-scaling-core
git switch main
git merge --ff-only byteflavour/feat/distributed-scaling-core
git switch main
git merge byteflavour/feat/distributed-scaling-core
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
agentic-forges/forgejo-mcp!178
No description provided.