Repository navigation
Tools: the gh sign-in sets the person's Git identity where git has none (F19 addendum 2026-10-14) - #416
Conversation
|
CI note: |
agentrozjedemeai
left a comment
There was a problem hiding this comment.
Changes requested on 030bafe. The focused local suite passes (38/38), and CI is green, but two promised safety invariants are not enforced:
src/tools/git-identity.ts:136-157:proceed()checks the Team rule only once before the loop. If the Environment changes to Team after writinguser.namebut before writinguser.email, the second write still runs; the finalmayProceedblocks only after both writes. Please re-check the Team rule before EACH write and test the transition between the two fields. A deterministic runner probe producedstate: set, two writes, and only one Team check despite the rule becoming true after the first write.src/tools/git-identity.ts:113-156: the presence check and latergit config --globalwrite are separated by the GitHub API call. If the operator or another process fills a missing value during that interval, this step overwrites it. The same deterministic probe filleduser.emailwithchosen@example.comin that interval; the returned state wassetand the chosen value was replaced. This violates the explicit never-overwrite contract. Revalidate immediately before each write and make the read/write coordination fail closed where possible; cover the interleaving in a regression test.
Documentation also says no fields are written in any not-set case (docs/decisions.md F19 addendum point 5; docs/environment-tools.md), but a failure on the second write leaves the first field written and reports not-set/write-failed. The probe reproduced this. Either ensure an all-or-nothing outcome or document the actual partial-write behavior and recovery accurately.
The existing tests cover Team transition before the first write and existing configuration before the initial read; they do not exercise these interleavings. Windows and device sign-in remain unverified as disclosed.
A Remote Environment had no user.name or user.email, so the first commit that Lazurio does not make itself (a repository-db data publish, an agent's commit) failed with "Author identity unknown". Matěj decided on 2026-10-14 that the gh onboarding sets it. The curated gh session (Settings → Nástroje, the Environment's first run, lazurio tools login gh, and --ssh-key) now ends, after the SSH key step and whatever its outcome, by writing each field that neither git's global nor system configuration names with git config --global: the GitHub profile's name, else the login, and <id>+<login>@users.noreply.github.com from gh api user, exactly githubCommitIdentity. An existing value is never changed. A Team Environment never reaches the step (its gh sign-in is refused) and the session asks the Team rule again right before the write. The outcome is gitIdentity on the signed-in state (present, set, or not-set with git-missing, config-unreadable, viewer-unavailable, write-failed); the CLI prints it with the fix, the Launchpad says aloud when publishing would fail. The exit code still follows the SSH key. Lazurio's own per-commit fallback (identitySettings) stays for an Environment whose gh was signed in otherwise or before this change. Tests: tests/tools-git-identity.test.ts runs the login sessions with the system's git under a temporary home (missing, present, partial, system and included configuration, GitHub silent or another account, a refused write, the Team rule before the write, a Team Environment); the CLI's lines and the Launchpad's parsing and sentence. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… sign-in The decision log gets the addendum (Matěj's words, where, what, never overwrite, never on a Team Environment, failures, why the per-commit fallback stays, the alternatives and the tests). F9's addendum of the same day, which said a Remote Environment has no identity and nothing is ever configured, is marked as refined by it; content-sync.md and environment-tools.md say the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a partial write Review of #416. Three gaps in the gh sign-in's Git identity step: - The Team rule was asked once before the writes. It is now asked right before each field's write, so an Environment that becomes a Team one between user.name and user.email stops before the email. - gh api user runs between the presence check and the writes. Each field is now checked again (global, then system, includes followed) right before its own write: one set meanwhile is skipped, never replaced, and a check that cannot answer writes nothing more (fail closed). - A second write that failed after the first succeeded was reported as not-set. `set` now names exactly the fields written, with `incomplete` (`write-failed` or `config-unreadable`, and what git still lacks) when a later one was not; `not-set` means the step wrote nothing. The CLI says what was set and what not, and the Launchpad treats a partial write as not set for people and claims no name it did not write. Tests: regression tests for each (the Team rule turning true after user.name, a value filled while GitHub answers, a malformed configuration appearing meanwhile, the second write refused and completed by the next sign-in), and the parser and CLI lines for the new shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…partial writes Points 3 to 5 of the addendum and environment-tools.md now say that the Team rule and the field's presence are checked right before each write, that a field written before an Environment became a Team one stays, what `set` with `incomplete` and `not-set` mean exactly, and how to recover (a new sign-in adds only what is missing, or git config by hand). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
030bafe to
7643d9b
Compare
agentrozjedemeai
left a comment
There was a problem hiding this comment.
Approved on exact head 7643d9b. The three prior blockers are addressed: Team eligibility is rechecked before each field write; a fresh global/system lookup avoids replacing a field populated during the GitHub call and stops on unreadable config; a second-field failure reports the first write as set+incomplete, with CLI/UI and documentation reflecting recovery. I inspected the caller and consumers, ran 42 focused tests (0 failures) and check:static locally, and confirmed the exact-head CI rollup is green with no open review threads. Windows and real device sign-in are not locally qualified here.
…a partial write Review of #416. Three gaps in the gh sign-in's Git identity step: - The Team rule was asked once before the writes. It is now asked right before each field's write, so an Environment that becomes a Team one between user.name and user.email stops before the email. - gh api user runs between the presence check and the writes. Each field is now checked again (global, then system, includes followed) right before its own write: one set meanwhile is skipped, never replaced, and a check that cannot answer writes nothing more (fail closed). - A second write that failed after the first succeeded was reported as not-set. `set` now names exactly the fields written, with `incomplete` (`write-failed` or `config-unreadable`, and what git still lacks) when a later one was not; `not-set` means the step wrote nothing. The CLI says what was set and what not, and the Launchpad treats a partial write as not set for people and claims no name it did not write. Tests: regression tests for each (the Team rule turning true after user.name, a value filled while GitHub answers, a malformed configuration appearing meanwhile, the second write refused and completed by the next sign-in), and the parser and CLI lines for the new shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan: DEV-6664 (task task-2026-10-14-727), HumanAndMachine-ai Mission Control.
Status: ready for review
Why
On 2026-10-14 a person's assigned Remote Environment had no
user.name/user.email. Publishing data from a repository-db app (git commitinside its data checkout) failed after staging with "Author identity unknown". Laptops work because their owners configured an identity long ago.Until now the Platform deliberately wrote no Git configuration (F9's addendum of 2026-10-14, #377 / #412): Lazurio's own commits got the person's GitHub identity per commit (
git -c), and every other commit in the Environment had nothing. Matěj decided: "Git Identity by měl řešit Launchpad při nastavování GH … v rámci onboardingu, kdy lidem nastavujeme nástroj GH, aby mohli fungovat ve svém environmentu, by se měla nastavit i ta identita."Target state
After a person signs in gh through Lazurio, every commit in their Environment has an author, with no per-app workaround.
What changes
src/tools/login.ts, newsrc/tools/git-identity.ts). After the SSH key step, whatever its outcome, and before the session ends signed in, Lazurio checks each ofuser.nameanduser.email. A field that neither git's global nor system configuration names (includes followed) is written withgit config --global -- <key> <value>. The value is the person's GitHub identity fromgh api user, exactly asgithubCommitIdentitybuilds it: the profile's name, else the login, and<id>+<login>@users.noreply.github.com. This is the one path behind Settings → Nástroje, the Environment's first run (which leads there),lazurio tools login ghand--ssh-key.gh api userruns between the first check and the writes, each field is checked again (global, then system) right before its own write. A field set meanwhile is skipped; a check that cannot answer writes nothing more (fail closed).blockedbefore the next one. A field written before the Environment became a Team one stays, like an SSH key linked before.gitIdentity:present;set:fieldsnames exactly what was written (never empty). If a later field was not written,incomplete: { reason: write-failed | config-unreadable, missing }says so;not-set(this step wrote nothing) withgit-missing,config-unreadable,viewer-unavailable(GitHub silent, or it returned another account than the one gh confirmed) orwrite-failed.git config --globalby hand.activation.installation, also the "Set up with an agent" prompt) now includes the same identity rule and its proof.docs/decisions.md(decision, alternatives, tests, risks). F9's addendum point 4 is marked as refined.content-sync.md,environment-tools.mdand thecommit-identity.ts/module-create-run.tscomments match.What deliberately does not change
identitySettings(the per-commitgit -cfallback for Lazurio's own commits: Personalspace bootstrap, gbrain, module create) stays. It still covers Environments whose gh was signed in by hand or before this change, and those where the write failed. It never overrides git and writes nothing, so keeping it costs nothing. Removing it would bring backgit-identity-missingon exactly those Environments.Verification
bun run check(lint, typecheck, check:public, build:proof, smoke:proof, fullbun test) after the review fixes: 3542 pass, 0 fail (3550 tests across 252 files), exit 0. After the rebase onto64978cb(integrations only):check:staticexit 0 and the affected suites 151 pass, 0 fail; CI runs the full suite on the head.tests/tools-git-identity.test.tsruns the real login sessions (the consumer of the Launchpad server and the CLI). gh and ssh are fakes; git is the system's own, confined to a temporary home with its own system config. Cases covered:gh api user;[include]d file counts as present;write-failed, still signed in;blocked, nothing written;user.nameanduser.email; a value filled while GitHub answers (kept, reported as git's own); a malformed configuration appearing meanwhile (fail closed); the second write refused after the first (set+incomplete, completed by the next sign-in).tests/tools-curated-cli.test.ts: the CLI lines (not set, set, then silent once present).tests/tools-view.test.ts: strict parsing and the people-facing sentence.Risks and open points
git config --globalwithHOMEset to the operator's home is the same on Git for Windows, but this is untested on that platform.🤖 Generated with Claude Code