# Real GitLab provenance verification, round 4

**PASS at [12b3a0c5bd](https://github.com/pingdotgg/t3code/commit/12b3a0c5bdf9467e1f22ae1d8b86d4ba67032294).** Target only [#20241](https://github.com/pingdotgg/t3code/pull/20241). Exact tested HEAD: `12b3a0c5bdf9467e1f22ae1d8b86d4ba67032294`, clean branch `worktree-git-11/gitlab-project-resolution`. Local commit is unpublished; link may not resolve yet. Lower [b0b24bcd92](https://github.com/pingdotgg/t3code/commit/b0b24bcd9273c34a7ad08dfc916c4ee3e02bd943), pinned base [18f26cf179](https://github.com/pingdotgg/t3code/commit/18f26cf179503f2311b0006f3392cbcd812833ef). Original remote [aaa058153c](https://github.com/fixfon/t3code/commit/aaa058153c4fe03a36d6711fdc11715bb46ca90d) was supplied, not fetched or revalidated.

Read worktree AGENTS, prepare-pr skill, live-proof-r3 and scripts, tests-r4, implementation-r4, and both review-r3 reports. Used evidence guidance within this restricted test role. No tracked edits, checkout, commit, fetch, push, GitHub writes, publication, browser, dev server, live userdata, other worktrees, subagents, process kills, installs, fixture restart/reseed/recreation, or cleanup. The target was registered with this T3 thread as app-owned metadata. Prior 559 green tests are supplied evidence; they were not rerun here.

## Current-head composed integration

[Script](/tmp/worktree-git-11/20241-mcp-sync-live-r4.mjs), [JSON](/tmp/worktree-git-11/20241-mcp-sync-live-r4.json), [log](/tmp/worktree-git-11/20241-mcp-sync-live-r4.log).

**Nine passing cases, 147 real glab calls.** Actual MCP handlers/toolkit/access wrapper → PullRequestService → GitLab provider/CLI → VcsProcess/ProcessRunner → glab → existing GitLab. Actual Orchestrator, EventSink, EventStore, ProjectionStore, ProjectStore, command receipts, outbox, positions, migrated SQLite memory database, filesystem ReadCache, SQLite FilesViewed, SyncReactor, and initial WatchReactor sweeps. No mocked service detail or orchestrator and no hand-edited projection. Each scenario has its own database and project ID.

Both real projects have MR 1, with distinct titles:

- P1: API `team/subgroup/project`; MR `http://127.0.0.1:8924/gitlab/team/subgroup/project/-/merge_requests/1`; title **Fixture MR in team/subgroup/project**.
- P2: API `gitlab/team/subgroup/project`; MR `http://127.0.0.1:8924/gitlab/gitlab/team/subgroup/project/-/merge_requests/1`; title **Fixture MR in gitlab/team/subgroup/project**.

The five original SSH-P2 identity cases still pass: repository-only MCP link, repository-only unlinked watch, legacy agent link without marker, explicit P1 URL, and legacy manual P1 URL. The first three persist P2 title; the last two persist P1 title.

Four additional cases supply HTTP P1 identity `http://127.0.0.1:8924/gitlab/team/subgroup/project.git`, whose checkout selector collides with raw API P2. Before each link, an ordinary real service detail read returns P1 title/URL, also priming the same service cache.

1. **HTTP repository-only MCP link:** repository `gitlab/team/subgroup/project`, number 1, host inferred from checkout. Actual CLI resolves P2. MCP returns P2 MR URL; actual SQL compact link event and projection persist it as `url` and `repositoryWebUrl`. Actual Sync persists P2 title in a SQL event and projection.
2. **HTTP repository-only MCP watch on an unlinked thread:** the same P2 result and provenance persist. Actual Sync persists P2 title. Initial Watch sweep reads P2 and persists its head SHA, preserving P2 provenance and zero wakes.
3. **HTTP legacy agent without marker:** actual link command stores source `agent`, no `repositoryWebUrl`, and the historical synthesized P1-shaped display URL. Actual Sync reads P2 and persists P2 title. Enabling watch on that existing link makes zero host reads. Initial Watch reads P2 and persists P2 head SHA while retaining the legacy display URL and absent marker.
4. **HTTP existing explicit P1 link:** actual MCP link stores P1 URL/provenance. Repository-only watch returns that stored P1 URL and dispatches successfully with **zero host reads**. Actual Sync and initial Watch remain on P1; SQL projection retains P1 title, URL, provenance, and P1 head SHA.

Every case directly queries SQLite `payload_json`, compares the projection with actual ProjectionStore output, and checks the persisted Sync title event. The separate audit also verifies all four `server:pr-watch:` SQL events contain the expected title, head SHA, provenance, and zero wakes. No agent runs or forbidden-service calls. Completion uses ServerActivation Deferred, EventSink event milestone, Sync drain, and Watch sweep completion. Thirty-second timeout is only a failure guard; no sleeps or polling. Before/after real MR and notes snapshots match for each scenario.

## Provider, service, and old-code refresh

[Provider script](/tmp/worktree-git-11/20241-provider-live-proof-r4.mjs), [JSON](/tmp/worktree-git-11/20241-provider-live-proof-r4.json), [log](/tmp/worktree-git-11/20241-provider-live-proof-r4.log): **8 calls**, read-only. HTTP clone URLs resolve, read, and list only the correct project for P1 and P2.

[Service script](/tmp/worktree-git-11/20241-service-live-proof-r4.mjs), [JSON](/tmp/worktree-git-11/20241-service-live-proof-r4.json), [log](/tmp/worktree-git-11/20241-service-live-proof-r4.log): **49 calls**. SSH/API raw P2 and explicit browser P1/P2 references route correctly on the identical tuple. Permission reads and two unique comments hit the expected numeric project: note **28 in P1**, note **29 in P2**. Each write leaves the other project unchanged. Added HTTP-P1 service cases prove explicit null reads P2 while ordinary undefined inherits P1, for both summary and detail. Reconstructed services restore three SSH/URL summaries and both HTTP raw/default summaries from filesystem cache with **zero additional glab reads**, preserving destinations. An unavailable explicit URL fails both detail and comment with neither project changed; no fallback write occurs.

[Old-code JSON](/tmp/worktree-git-11/20241-mcp-baseline-live-r4.json), [log](/tmp/worktree-git-11/20241-mcp-baseline-live-r4.log): **11 calls**. Same integrated script with `--baseline` reads actual local [9ed78b2cfd](https://github.com/fixfon/t3code/commit/9ed78b2cfd6944e6d1eb0acf631a80b4701bdac9) MCP handlers and SyncReactor into scratch, rewriting imports only. With current remaining runtime/service/provider dependencies, old SSH repository-only flow commits wrong **P1 title** to SQLite; current flow commits **P2 title**. This is an old-module comparison, not a full old checkout. No archived HTTP service comparison was attempted; current-head HTTP cases above provide the requested fresh proof.

Total **215 real glab calls** across four successful runs. No failed live diagnostic runs this round. [Fixture delta](/tmp/worktree-git-11/20241-fixture-delta-r4.json) compares initial integration snapshot with final baseline snapshot: exactly two authorized notes, all previous notes unchanged, titles/states/URLs unchanged, timestamp changes recorded separately.

## Limits and environment

- ProjectService reads forward to actual ProjectStore and add supplied SSH P2 or HTTP P1 identity; RepositoryIdentityResolver returns it. No real git remote discovery or transport.
- MCP invocation supplies full client access. ThreadManagement reads forward to Orchestrator. No MCP HTTP transport, OAuth handshake, provider session, running agent, effect worker, comment-triggered wake, or scheduled sweep. Watch proves initial reads and persistence only.
- Settings supply defaults; source-control refinement is disabled; unrelated GitManager stream never emits. Unused checkpoint/handoff/session/switch/adapter/review-guide services fail if called.
- Separate databases do not prove simultaneous colliding tuple links across threads. No SQLite restart/replay, UI, desktop/mobile, other OS, remote/relay/tunnel, CI, or merge-readiness claim. FilesViewed is real, but viewed-mark mutations were not tested.
- Existing GitLab 18.4.6 CE fixture, glab 1.118.0 at `/tmp/worktree-git-11/bin/glab`. Child environments strip inherited GitLab host/token/API/debug overrides, set owned config directory, disable update checks, and put that binary first. No host override supplied.
- **Port alias caveat:** glab config has portless `127.0.0.1` alias routing to `8924` under `/gitlab`, alongside `127.0.0.1:8924`. URL parsing yields the portless host. Proof depends on that alias and does not establish universal support for unconfigured nonstandard ports.
- Container `4205462d8bbb8c3f89526ccd44beba6bb17357efeb944fac82b74ec542aec225` remains running/healthy, restart count zero, port 8924 bound to loopback. Private file/config remain mode 600, config directory 700. No credentials, auth headers, or config contents printed.
- Final disk check is about **769 MiB available** (earlier 924 MiB). No cause attributed. Artifacts are small; no installs or cleanup. HEAD/status remain unchanged and clean; `git diff --check` passes.

## Parent rerun

Run from `/home/ubuntu/wt/worktree-git-11`. Integrated script asserts exact head and clean unchanged tree and is read-only against GitLab:

```sh
export PATH="$HOME/.local/bin:$PATH"
node /tmp/worktree-git-11/20241-mcp-sync-live-r4.mjs > /tmp/worktree-git-11/20241-mcp-sync-live-r4.log 2>&1
```

Other read-only reruns:

```sh
export PATH="$HOME/.local/bin:$PATH"
node /tmp/worktree-git-11/20241-mcp-sync-live-r4.mjs --baseline > /tmp/worktree-git-11/20241-mcp-baseline-live-r4.log 2>&1
node /tmp/worktree-git-11/20241-provider-live-proof-r4.mjs > /tmp/worktree-git-11/20241-provider-live-proof-r4.log 2>&1
```

Optional service repeat adds two more unique notes; do not repeat merely to rerun integrated proof:

```sh
export PATH="$HOME/.local/bin:$PATH"
node /tmp/worktree-git-11/20241-service-live-proof-r4.mjs > /tmp/worktree-git-11/20241-service-live-proof-r4.log 2>&1
```

[Audit script](/tmp/worktree-git-11/20241-proof-audit-r4.py), [summary JSON](/tmp/worktree-git-11/20241-live-proof-r4.json), [audit log](/tmp/worktree-git-11/20241-live-proof-r4.log). Audit checks saved events/projections, two-comment interval delta, health/clean HEAD, and artifacts against actual private credential values without printing them. If reruns overwrite before/after snapshots, the recorded two-comment interval no longer applies; preserve these artifacts before rerunning. Helpers are under `/tmp/worktree-git-11-r4-live`, caches/reports under `/tmp/worktree-git-11`; nothing added to worktree.

Model/harness: GPT-6 Astra, high reasoning, Codex through T3 Code.
