# Controller report: GitHub seam

Base: `00d09aa7`, branch `github/seam`. Hub only; no GitHub client,
credentials, migrations, device API changes or wire fields. The controller
confirmed mechanical test substitutions are permitted and the protocol bump
belongs with the future GitHub wire step.

## Test preservation

Every existing test name and assertion is unchanged apart from these approved
mechanical substitutions. No test was deleted or renamed.

- `HubMergeRequest` -> `MergeRequest`; `HubMergeResult` -> `MergeResult`.
- Forge test-double `Remote` signatures add `Use` (or `thin.Use`).
- Two old direct Remote calls add `Push`, preserving their prior write use.
- The headless access wrapper forwards its new `use` argument.
- New Host/Propose fixture methods are in new seam fixture files.

Verification: read each old test from HEAD, apply only the substitutions
above, run pinned gofmt, and compare the entire file byte for byte with the
worktree. All 16 changed existing test files match. SHA-256 of each resulting
file follows, so review can distinguish mechanical changes from new tests.

| Existing test file | SHA-256 after mechanical substitution |
| --- | --- |
| `internal/headless/access_resume_test.go` | d0879525f43a2e6e66a8207207e8a80ca4ef91192fe8c5b4588c321eab3a71ba |
| `internal/headless/merge_test.go` | 50cb66bcbbc11dd1085e7a9136d17b05c55e606a447ef1bdddffa171003d791e |
| `internal/headless/projects_test.go` | 5f9234a1752fddb49a90c0a4f6b562e1aa08578aa36e8b326fb23faf1f9d3ea5 |
| `internal/runner/forge/merge_detail_test.go` | 04b72e20e638d873b49be3d6f739c11a205fb1b4226e66a8419a1a044c34ffbb |
| `internal/runner/forge/merge_test.go` | 0497d4e9d9b75e3c738e90707f94bab7e63dc6ad13d5ed68890d259d7a78cb86 |
| `internal/runner/forge/merge_unborn_test.go` | 506a3b45ee16eb56ff795663978edcdfeac6076d7029faaa750488a81921ca5a |
| `internal/runner/thin/access_review_test.go` | b275d965f9de779314a0eb0c5af24dd21ee96b31cdb3e8519a6ee85f7d806a42 |
| `internal/runner/thin/copy_test.go` | fb58e71251109937899279bfad1fbdf24d5af572fc7ea2c19564da640fa81110 |
| `internal/runner/thin/create_test.go` | c59d96f0ad8ff388ebac2f337483818111a17d793abfbb81377e267458700b25 |
| `internal/runner/thin/index_empty_test.go` | d7f96a51d5ebf2037c90e4bda8ddc8ba1d25e49a12733c2c037c1f4ee249c1d0 |
| `internal/runner/thin/judge_fetch_test.go` | a5a8fd366e67e1c22d7a22326da0cbbb02ad64e7223506c95428f419ed166d9d |
| `internal/runner/thin/mergedetail_test.go` | 901ddcea525906ee9b0200490346b5a8bdc0507cb07b5f1f15c4e8c95469864c |
| `internal/runner/thin/mergestep_test.go` | cc81279ce30d82f888b35e237a906b5865293e2adc1fe8ad1cf9f5aaf44dd860 |
| `internal/runner/thin/relay_test.go` | ce1356717bc69d748b852bf018ec7c017c54d0822769c192f7810d68a9d2fe4c |
| `internal/runner/thin/review_fixes_test.go` | 1affbe9ef6d9c91ad5669f3e51b03ea55b544c0a1f49e00ee975ba1a3c32c767 |
| `internal/runner/thin/sandbox_masks_test.go` | 6abbae1bdf5f7a82e61ad25e4af375be55c4ab68a0ce4e5b5228ed5d63a87b83 |

## New tests and test-first evidence

- `go test ./internal/wire/forgekey`: failed with undefined Parse/Hub/Equal
  before implementation; passed after adding the package.
- `go test ./internal/runner/thin -run 'TestForges|TestHubProposal|TestRemoteUsername'`:
  failed with undefined Use/Proposal/NewForges/MergeRequest before the seam;
  passed after implementation.
- `TestEngineeringProposesAfterPush` and `TestRelayProposesAfterPush` both
  failed with zero proposals before inserting Propose calls; passed afterward.
- `TestStartDefaultRequestsPushAuthority` failed with authority `[1]` (Read)
  before changing initialization to Push; passed afterward.

## Package changes

- `wire/forgekey`: closed host parsing, hub shorthand and normalization,
  host-aware display, GitHub spelling-preserving equality, shared hub-only
  admission and new-repository rules. Recognition grants no execution.
- `runner/thin`: explicit read/push use, host router with no fallback, optional
  hosted-CI/access forwarding, hub proposal branch link without network writes,
  proposal calls after direct and relayed pushes, hub-only production wiring.
  Read grants still cannot obtain push credentials.
- `runner/forge`: merge types renamed without field changes; shared hub key
  checks; explicit GitUsername in branch push authentication. Hub transport
  names, merge reasons, publication audit provider and old engine stay intact.
- `runner/workspace`: optional GitUsername, defaulting to historical `x`, used
  for clone authentication. Thin clone/fetch and forge push use the same default.
- `equipo/chat`, `equipo/setup`: shared parsing/display helpers, keeping hub-only
  admission. No database writes or user-visible behavior added.
- `headless`: interface-only fixture substitutions and new fixture methods.

## Copy

No app-owned UI/model strings added or changed. One internal diagnostic is
`forgekey.ErrKey`: `invalid repository key`. Reported to the controller.

## Probe

[Exact calls and sanitized answers](../specs/2026-11-22-equipo-github-connector-probe.md).
Actions on App push is confirmed. Full merge table and CARLOS egress remain open.

## Deliberate mutations

Each mutation ran `GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test <package> -run ^<test>$ -count=1`. Every result was a failing test, not a compilation failure. Each original was restored in a finally block. The clean targeted suite runs after these mutations.

| Guard broken | File | Killing regression | Result |
| --- | --- | --- | --- |
| closed-hosts | `internal/wire/forgekey/key.go` | `TestRejectInvalidKeys` | FAIL, guard restored |
| path-segments | `internal/wire/forgekey/key.go` | `TestRejectInvalidKeys` | FAIL, guard restored |
| github-case | `internal/wire/forgekey/key.go` | `TestEqualityKeepsForgeRules` | FAIL, guard restored |
| hub-case | `internal/wire/forgekey/key.go` | `TestEqualityKeepsForgeRules` | FAIL, guard restored |
| hub-admission | `internal/wire/forgekey/key.go` | `TestHubAdmissionAndCreation` | FAIL, guard restored |
| new-name-rule | `internal/wire/forgekey/key.go` | `TestHubAdmissionAndCreation` | FAIL, guard restored |
| registration-duplicate | `internal/runner/thin/forges.go` | `TestForgesRouteWithoutFallback` | FAIL, guard restored |
| registration-host | `internal/runner/thin/forges.go` | `TestForgesRouteWithoutFallback` | FAIL, guard restored |
| route-host | `internal/runner/thin/forges.go` | `TestForgesRouteWithoutFallback` | FAIL, guard restored |
| route-use | `internal/runner/thin/forges.go` | `TestForgesRouteWithoutFallback` | FAIL, guard restored |
| catalog-host | `internal/runner/thin/forges.go` | `TestForgesCatalogAndHubIdentity` | FAIL, guard restored |
| hub-proposal-host | `internal/runner/thin/forges.go` | `TestHubProposalIsOnlyALink` | FAIL, guard restored |
| hub-proposal-branch | `internal/runner/thin/forges.go` | `TestHubProposalIsOnlyALink` | FAIL, guard restored |
| hub-use | `internal/runner/thin/forge.go` | `TestFileForgeRejectsUnknownUseBeforeIO` | FAIL, guard restored |
| read-push-separation | `internal/runner/thin/forge.go` | `TestAccessReadGrantCannotWrite` | FAIL, guard restored |
| initial-push-authority | `internal/runner/thin/forge.go` | `TestStartDefaultRequestsPushAuthority` | FAIL, guard restored |
| engineering-proposal | `internal/runner/thin/engineer.go` | `TestEngineeringProposesAfterPush` | FAIL, guard restored |
| relay-proposal | `internal/runner/thin/relay.go` | `TestRelayProposesAfterPush` | FAIL, guard restored |
| explicit-username | `internal/runner/workspace/workspace.go` | `TestRemoteUsername` | FAIL, guard restored |
| default-username | `internal/runner/workspace/workspace.go` | `TestRemoteUsername` | FAIL, guard restored |
| branch-username | `internal/runner/forge/branch.go` | `TestBranchGitUsesRemoteUsername` | FAIL, restored |
| workspace-username | `internal/runner/workspace/workspace.go` | `TestWorkspaceFetchUsesRemoteUsername` | FAIL, restored |
| registration-nil | `internal/runner/thin/forges.go` | `TestForgesRouteWithoutFallback` | FAIL, restored |
| missing-forge | `internal/runner/thin/forges.go` | `TestForgesRouteWithoutFallback` | FAIL, restored |
| optional-hosted-ci | `internal/runner/thin/forges.go` | `TestForgesForwardOptionalHubServices` | FAIL, restored |
| optional-ci-status | `internal/runner/thin/forges.go` | `TestForgesForwardOptionalHubServices` | FAIL, restored |
| optional-access | `internal/runner/thin/forges.go` | `TestForgesForwardOptionalHubServices` | FAIL, restored |
| optional-poll | `internal/runner/thin/forges.go` | `TestForgesForwardOptionalHubServices` | FAIL, restored |

## Local verification

Pinned toolchain `GOTOOLCHAIN=go1.26.11`, `CGO_ENABLED=0`; pinned gofmt on PATH.
Tests use the repository's `-tags testbuild`. TMPDIR is its physical path on
macOS so fixture security checks do not reject the /var -> /private/var alias.
The first untagged broad run was diagnostic, not a pass; its hanging thin
fixture was stopped before the corrected run.

Passed: fmt-check, gitleaks (1117 commits, no leaks), budget, migration-check,
copy-release-check, lanes-check (18 lanes plus 5 browser lanes), spacing,
TestPersonAPI, TestPlan3Release, TestBudgetRecordsAreShort, and native fixtures
(11 API fixtures, 3586 markdown fixtures, 32000 differential cases).

Full equipo, chat and thintest suites passed (68.917s, 15.294s and 245.031s on this shared Mac).
The full runner package tree was run: forge passed (139.352s), workspace
passed (98.009s); several provider/setup packages fail macOS policy checks.
The thin package's long-running HTTP fixture was stopped with SIGQUIT after
214s, retaining its stack evidence. No platform guards or existing tests were
changed to make these pass. Linux CI is the full runner gate, as requested.

Budget changes are measured only: thin 28436 source / 22414 test lines;
headless 11349 test lines. The reasons name the router, authority seam,
proposal regressions and mechanical fixture additions. No time budget raised.

Twenty-eight deliberate mutations were killed by runtime test failures. Clean
focused regressions were rerun after restoration. Two username tests inspect
the actual git process environment in workspace fetch and branch push.

[All 15 mapped hub assumptions](2026-11-23-github-seam-assumptions.md) include
current file and line locations, the existing projects device star route,
and each unchanged hub transport, policy, prompt, audit and preview path.

The clean hub-focused run passed in 67.985s:

```sh
GOTOOLCHAIN=go1.26.11 CGO_ENABLED=0 go test -tags testbuild \
  ./internal/runner/thin \
  -run 'Test.*(Forge|Merge|Hosted|Access|Propos|RemoteUsername|StartDefault)' -count=1
```

This includes existing forge, merge, hosted CI and access assertions plus the
new routing/proposal regressions. The clean key and both git-username suites
also passed after every mutation was restored.

Linux headless compile also passed:
`GOOS=linux GOARCH=amd64 go test -tags testbuild -c ./internal/headless`
(with its output artifact kept in TMPDIR, outside the repository).

## First CI and correction

CI on `ab21a6e4` failed two of 29 shards; the other 27 passed, including
Linux runner, merge, hosted CI and access tests.

- Existing `TestProjectRejectsUnsafeBinding` caught `amadan.net/a` being
  interpreted as bare owner/name inside legacy CanonicalRepository. Added
  `TestCanonicalRepositoryRequiresFullHubKey`; it failed before the fix on
  both `amadan.net/a` and `https://amadan.net/a`. CanonicalRepository now
  requires the parsed spelling to equal its full host/path input, preserving
  the existing complete-hub-key requirement. Removing that condition again
  makes the new regression fail; restored and the new regression and existing
  unsafe-binding test both pass. This is the 29th killed runtime mutation.
- The new forgekey test package lacked Rastrillo's timing receipt. Added its
  standard `TestMain` calling `budget.Main(m)`. `rastrillo budget test
  ./internal/wire/forgekey` now passes and reports package timing.

No existing test assertions or names changed in this correction. The complete
setup and equipotest suites and release gates are rerun before committing it.

Correction verification: all release gates passed again. Full setup passed
in 8.251s. Full equipotest completed in 436.480s with only the two existing
macOS release-packaging failures (`TestRunnerReleaseContractPackaging` and
`TestReleasePinsAndProvenance`): their isolated PATH selects a Python whose
hashlib has no file_digest. The project binding tests passed. Those packaging
lanes passed on Linux in the first CI run; no unrelated packaging code changed.

## Fable review follow-up after 176d61cb

The fixes are new commits on github/seam. Earlier commits and all tests that
predate this branch retain their names and assertions. Changes to test code
in this follow-up are to seam tests introduced on this branch, new regression
files, and the explicitly approved copy-release inventory list.

### Findings and behavior

- P2-1: Parse rejects two-part keys beginning with either known host. Both
  amadan.net/a and github.com/a are rejected by key and no-fallback tests.
  Equal no longer equates them with a prefixed hub key; Normalize preserves
  the invalid input and parsing it still rejects it.
- P2-2: a real NewFileForge, wrapped in NewForges, talks to the fake hub for
  read and push credentials, merge, hosted CI/status, and access request/poll.
  The test asserts its host and the exact authenticated HTTP paths.
- P2-3: push redaction and Clones.Heads use Remote.Username(). The redaction
  regression uses x-access-token with a deliberately short fixture password
  so the generic long-token scrubber cannot hide a missing explicit scrub.
  It checks both raw and encoded values in PushDetail's resulting log tail.
- Push authority: both Engineering and relay tests assert exactly one Push
  credential request. Changing either call to Read fails its regression.
- Hub identity: fake forges now have different agents and create namespaces.
  Routing either hostless identity call to GitHub fails the test.
- Proposal failure: a successful push remains successful and is not retried.
  The existing Reason field carries only proposal_failed. The instance keeps
  the diagnostic for local and worker publication and the successful step
  detail renders the approved fragment. No raw forge error reaches a person.
  ProposalRef remains local and absent on error; there is no new wire field.
- Error identities: rejected Remote, Exists/Create, Merge, CIHosted and
  CIStatus keep their operation sentinel as well as ErrKey through errors.Is.
  Invalid Use and duplicate registration have separate ErrForgeUse and
  ErrForgeDuplicate identities. Neither is ErrKey.
- Branch links: chat.BranchURL and hub Propose share forgekey.HubBranchURL,
  preserving the literal branch slash in the existing hub URL spelling.
- Probe: recorded the controller-confirmed organisation manifest flow,
  with the external manifest_server.py's request/callback logic. The saved
  workflow report has only git's generic final stderr line, not the remote
  cause. Capturing the exact workflows-permission refusal remains open,
  alongside the complete merge table and CARLOS egress.

### Tests first

Focused tests ran with GOTOOLCHAIN=go1.26.11, CGO_ENABLED=0, testbuild and a
physical TMPDIR. Before fixes, regressions failed on malformed host inputs,
normalization and equality, router fallback, operation error identities,
escaped proposal URL, Heads' x username, and the non-default encoded header
remaining in PushDetail. Engineering requested Push three times after a
proposal error; relay returned Pushed:false / push_failed after one good
push. The rendering regression had no diagnostic text. After repairing the
chat test's missing RunnerRole fixture, its local path also demonstrated
that the instance discarded the diagnostic, before that path was fixed.

### Copy review

The controller supplied Luna's replacement on 2026-11-23, message
`e27ea4c2-0708-4c63-9507-febfb7d1d032`:

> "work.reason.proposal_failed": "the branch was pushed, but the review request could not be created", // COPY ACCEPTED BY DELEGATION (Luna, 2026-11-23)

The original proposed complete sentence did not fit the fragment grammar
of work.reason.*. Luna also replaced "proposal" with "review request".
The key was marked pending through copy-status.py, then recorded with the
controller-authorized Luna marker and a bounded acceptedForgeSeam list.
No accept command was run. Tests exercise reasonLine, "Stopped: %s", and
successful-step detail; each rendered sentence has one final period.
This is the only new app copy. ErrForgeUse and ErrForgeDuplicate are internal
configuration diagnostics, not person-facing API text.

### Review mutation checks

All 26 review mutations failed a runtime assertion, then were restored. No
compile failure counts as a kill. In particular, Fable's five surviving
mutations (production Host, both Push call sites, Agent and CreateIn) now die.
The swallowed-error mutation dies in both publication paths. These 26 checks
are additional to the 29 recorded in the earlier implementation.

Each command was `go test -tags testbuild ./<package> -run <test> -count=1`,
with the pinned environment above.

| # | Deliberate mutation | Package suffix | Killing test |
| --- | --- | --- | --- |
| 1 | reject truncated known host | `internal/wire/forgekey` | `TestRejectInvalidKeys|TestNormalizationAndEqualityAgree` |
| 2 | production host identity | `internal/runner/thin` | `TestRouterWithProductionFileForge` |
| 3 | push detail encoded username | `internal/runner/forge` | `TestPushDetailScrubsRemoteUsername` |
| 4 | push detail raw password | `internal/runner/forge` | `TestPushDetailScrubsRemoteUsername` |
| 5 | heads username | `internal/runner/thin` | `TestHeadsUsesRemoteUsername` |
| 6 | engineering push authority | `internal/runner/thin` | `TestEngineeringProposesAfterPush` |
| 7 | relay push authority | `internal/runner/thin` | `TestRelayProposesAfterPush` |
| 8 | hub agent identity | `internal/runner/thin` | `TestForgesCatalogAndHubIdentity` |
| 9 | hub create namespace identity | `internal/runner/thin` | `TestForgesCatalogAndHubIdentity` |
| 10 | engineering proposal diagnostic | `internal/runner/thin` | `TestEngineeringProposalFailureKeepsPush` |
| 11 | engineering successful push preserved | `internal/runner/thin` | `TestEngineeringProposalFailureKeepsPush` |
| 12 | relay proposal diagnostic | `internal/runner/thin` | `TestRelayProposalFailureKeepsPush` |
| 13 | relay successful push preserved | `internal/runner/thin` | `TestRelayProposalFailureKeepsPush` |
| 14 | remote sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 15 | exists sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 16 | create sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 17 | merge sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 18 | hosted CI sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 19 | CI status sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 20 | invalid use identity sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 21 | duplicate identity sentinel | `internal/runner/thin` | `TestRouterRefusalsKeepOperationIdentity` |
| 22 | branch link spelling | `internal/runner/thin` | `TestHubProposalIsOnlyALink` |
| 23 | local step diagnostic | `internal/equipo/chat` | `TestProposalFailureKeepsSuccessfulPublication` |
| 24 | worker step diagnostic | `internal/equipo/chat` | `TestProposalFailureKeepsSuccessfulPublication` |
| 25 | step diagnostic displayed | `internal/equipo` | `TestProposalFailureDetailAndPunctuation` |
| 26 | wire reason accepted | `internal/equipo/chat` | `TestProposalFailureKeepsSuccessfulPublication` |

### Review verification

Passed after restoration: fmt-check, gitleaks (1119 commits, no leaks), budget,
migration-check, copy-release-check, lanes-check, spacing, TestPersonAPI,
TestPlan3Release, TestBudgetRecordsAreShort and native fixtures (11 API,
3586 markdown and 32000 seeded differential cases).

Full suites passed: equipo 60.262s, chat 6.374s, thintest 208.968s, wire 0.367s,
forgekey 0.249s and wireschema 0.739s. The focused thin forge, merge, hosted CI,
access, proposal, router, username and initialization suite passed in 65.267s.
The full runner tree was run with a four-minute per-package bound. Forge
passed in 96.960s and workspace in 63.874s. As on the initial seam run, the
Mac cannot pass the Linux containment/provider and host-policy fixtures;
thin reached the four-minute timeout. These are not claimed as local passes.
No platform guards or existing tests were weakened. Linux CI is the full
runner gate.

The six size exemptions changed only to measured counts: equipo 22105 source,
wire 6830 source, plan3test 11899 test, thin 28446 source / 22619 test, and
chat 8382 test with its existing source cap. Reasons name the diagnostic and
regressions; no timing budget changed. Existing test files from main have no
new substitutions in this review beyond the approved copy inventory list.

### Shared Copy publication follow-up

The shared Engineer.publish path also serves Copy. Before final handoff, a
new regression demonstrated that the instance discarded proposal_failed on
a successful Copy report. Copy now preserves the same diagnostic after its
existing authorization and result validation, and its step detail shows the
same approved fragment. No additional strings or wire fields were added.
The successful Copy step remains done and pushed.

Three more deliberate mutations were killed and restored, bringing this
review's count to 29 runtime kills (58 including the earlier implementation):

| Deliberate mutation | Killing regression |
| --- | --- |
| Drop Copy's successful-publication diagnostic | `chat.TestCopyProposalFailureKeepsSuccessfulPublication` |
| Show Copy's diagnostic without a successful push | `equipo.TestCopyProposalFailureDetail` |
| Add a Copy detail entry without a proposal diagnostic | `equipo.TestCopyProposalFailureDetail` |

Both Copy regressions failed before the fix and passed after it. The full
app, chat and thintest suites and release gates are repeated for this change.
The runner code is unchanged from the preceding verified commit.

The historical secret scan on 18594290 mistook the prose Equal/Normalize in
this report for a credential. The sentence was rephrased and the exact
commit/file/rule/line fingerprint was excluded in .gitleaksignore, with a
reason. No credential was present, no broad rule was disabled and no history
was rewritten.

Follow-up verification passed: all release gates, PersonAPI/Plan3Release and
budget-record checks. Repeated full suites: equipo 51.715s, chat 7.774s,
thintest 219.940s. Final measured caps for the additional Copy path are equipo
22109 source and chat 33348 source / 8399 test. All other caps above stand.
The historical scan now passes over 1120 commits with no leaks. The first CI
on 18594290 failed its secret-scan shard on the prose false positive; the
narrow fingerprint correction is part of this follow-up commit.
