diff --git a/.woodpecker/ci.yml b/.woodpecker/ci.yml index 5427677a..932172a1 100644 --- a/.woodpecker/ci.yml +++ b/.woodpecker/ci.yml @@ -91,6 +91,11 @@ steps: # and sandboxes a throwaway git repo, so it resolves no real credentials and # joins CI directly rather than the exclusions file. - bash packages/mosaic/framework/tools/git/test-issue-close-fail-closed.sh + # Hermetic regression for the git identity ladder (#1356): mock tea on PATH, + # sandboxed repo, no real credentials (3/3 green under an empty HOME). Pins + # fail-closed: a seat whose login is missing gets a named error, never a + # borrowed identity. Joins CI directly; its #1007 exclusion is burned down. + - bash packages/mosaic/framework/tools/git/test-gitea-login-resolution.sh # Hermetic behavioural regression for the PreToolUse wrapper guard: proves # it still blocks the three mistakes AND still lets reads, unwrapped # endpoints and ordinary commands through. Both directions are asserted — diff --git a/packages/mosaic/framework/tools/git/README.md b/packages/mosaic/framework/tools/git/README.md index caf14e01..cd6115d2 100644 --- a/packages/mosaic/framework/tools/git/README.md +++ b/packages/mosaic/framework/tools/git/README.md @@ -102,6 +102,36 @@ of their own — `MOSAIC_GIT_IDENTITY=` with a provisioned slot. There is de environment variable that restores the fallback; one would reintroduce exactly the substitution this removes. +### The tea path: login resolution (#1356) + +The wrappers that go through `tea` (`issue-list.sh`, `pr-list.sh`, `pr-view.sh`, +`lane-brief.sh`, and the tea half of `issue-close.sh`) cannot use a token directly: tea +0.14 only acts as a **login** already stored in `~/.config/tea/config.yml`. Those wrappers +therefore resolve a login name, not a token, and the resolution follows the same identity +as above: + +1. Resolve the identity (`MOSAIC_GIT_IDENTITY`, then `git config mosaic.gitIdentity`). +2. Derive the Gitea instance from the repo host (`git.mosaicstack.dev` → `mosaicstack`, + `git.uscllc.com` → `usc`), or from the owner when `--repo owner/name` is given. +3. The canonical login is `-`. If tea has it, that login acts. +4. If the identity is set but that login is missing, the wrapper **fails closed**: nonzero + exit, empty stdout, and a stderr line naming the login it wanted and the source of the + identity. When `tea` itself is not installed the message says so instead, since "no such + login" would send the reader to create a login they cannot create. +5. With **no identity set**, the old host-default behaviour is unchanged (first login + configured for that host, else the API fallback). + +Step 4 replaced a fallback that picked any login configured for the host, which meant a +seat with no login of its own silently acted as whichever seat had configured one. That +satisfied the author≠reviewer gate on paper while one actor held both names. + +**Provisioning the logins.** `tools/fleet/seat-logins.sh` projects each seat's token from +its secrets store into tea's config under the canonical name. tea's config is a derived +cache of the secrets store: regenerate it with the script, never hand-edit it. Run it with +`--seat ` for one seat (all seats when omitted), dry-run by default, `--apply` to write. A hand-made +alias holding a seat's token blocks its canonical name (tea refuses one token under two +names); `--adopt` renames it. + ### Enabling it for a clone The framework installer syncs `git-credential-mosaic` to diff --git a/packages/mosaic/framework/tools/quality/test-enumeration-exclusions.txt b/packages/mosaic/framework/tools/quality/test-enumeration-exclusions.txt index bbd1b34d..fa48e012 100644 --- a/packages/mosaic/framework/tools/quality/test-enumeration-exclusions.txt +++ b/packages/mosaic/framework/tools/quality/test-enumeration-exclusions.txt @@ -13,7 +13,6 @@ # --- tools/git: the #1007 five — non-hermetic, resolve real credentials --- packages/mosaic/framework/tools/git/test-pr-merge-gitea-empty-uid.sh | resolves real credentials (#1007 census); joins CI after the wrapper-half hermeticity fix (git -C scoping) packages/mosaic/framework/tools/git/test-issue-create-interactive-auth.sh | resolves real credentials (#1007 census); joins CI after the wrapper-half hermeticity fix -packages/mosaic/framework/tools/git/test-gitea-login-resolution.sh | resolves real credentials (#1007 census); joins CI after the wrapper-half hermeticity fix packages/mosaic/framework/tools/git/test-pr-metadata-gitea.sh | resolves real credentials (#1007 census, fourth entry via family-grep); joins CI after the wrapper-half hermeticity fix packages/mosaic/framework/tools/git/test-issue-comment-readback.sh | resolves real credentials (#1007 census, fifth entry); joins CI after the wrapper-half hermeticity fix