Repository navigation
fix(doctor): guide users to publish kept docs mirror edits - #1862
Conversation
|
Local lint follow-up: the Oxlint stage passed; the Windows documentation-check stage reported stale generated references and did not find fenced workflow examples. I did not regenerate unrelated docs in this PR. The PR description records the focused test and real CLI dry-run results. |
|
No confident findings in the specified PR diff. The description documents sufficient testing: a representative Windows real-CLI run covers the unchanged mirror, kept edit, explicit push preview, and byte preservation. It explicitly identifies the verify-world limitation. Review was read-only; I did not run, build, or install anything from the PR. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving at c8a0f66.
What I checked
-
Red on main, green here. With main's
doctor-delivery.tsunder this head's test, the new case fails because the hint is missing. With the PR's version, all 68 tests indoctor-delivery.test.tspass. -
Real CLI on macOS, in a verify world built from this head. Claude, git team repo, workspace scope, one team doc
docs/guide.md:- after
teamai pull,teamai doctorreportsTeam docs deliveredpassing, with no hint; - after editing
.teamai/docs/guide.md, doctor fails, names the kept file anddocs/guide.md, and shows the new hint; teamai push --file .teamai/docs/guide.md --path docs/guide.md --dry-runprintsWould propose … as docs/guide.mdandDry run — no changes made;- the edited bytes are unchanged after doctor and the preview.
The world reported two leftovers. Both come from my fixture, not this PR: the clone I used to seed the team doc, and
.teamai/holding the member's edited file, which uninstall keeps on main too. - after
-
Read-only teams. The hint is skipped when
repo.kind === 'http', the same conditionassertNotReadOnlyuses to refusepush. So doctor never suggests a command that would refuse. Self mode keeps the hint, andpush --fileaccepts self mode (read in the code, not run). -
Scope. One message in doctor, nothing else. Pull, push and the mirror behave as before. Refs #1851, which stays open for the mirror question itself.
[P3 nit]
- The kept file's team path is already known here, so the hint could print the exact command for each kept file instead of placeholders, for example
teamai push --file "<that file>" --path "docs/guide.md". The member could then copy it as is. Optional. - On the kept-file line just before it, main's wording says the file is "not teamai's" and to "Rename or delete it". Next to the new hint, that reads as two different instructions for the same file. Not from this PR.
CI review. No findings, and it accepts the Windows real-CLI record. We agree, and the verify world above covers the run on macOS.
Merge risk. Low. One extra sentence in a doctor message, behind a check that only reads the file types.
`status` and `push` only scanned the team clone's checkout, which `pull` keeps clean, so an edit a member made in the docs mirror (`sharing.docs.localDir`) was invisible while `doctor` skipped those files as copies (Tencent#1851). Scan the mirror too, at team paths `docs/<rel>`, and only for docs the team already has: the user-scope mirror is machine-wide, so a file for a doc the team does not have stays where it is. A mirror file matching a version in the team history is a copy, not an edit, so a stale copy never proposes to overwrite the team's newer file. An edit in the checkout still wins for the same path. Since plain `push` now offers the edit, drop the `status` section and the `doctor` sentence from Tencent#1871/Tencent#1862 that said it does not: they would tell a member the opposite of what `push` does.
Summary
When doctor finds a kept edit to a delivered docs-mirror file, explain why a plain push does not find it and point to the explicit file proposal restored in #1855. Leave the mirror, pull behavior, and default push scan unchanged. Only offer the hint for regular files on both sides of a writable team source, not for blocking directories, symlinks, or read-only HTTP teams.
Test plan
npx tsc --noEmitnpm run buildnpx vitest run src/__tests__/doctor-delivery.test.ts -t "team docs"(18 passed). The new regression covers unchanged files, kept edits, a blocking directory, and preservation of the edited bytes.main(e6f1ec4).npm run verify:worldexits before creating a world on Windows (POSIX required). See the Windows CLI record below; this is not a verify-world run.Related issue
Refs #1851. This PR only improves diagnosis and does not add mirror scanning or two-way synchronization.
AI-assisted.
Windows real-CLI record
Built
dist/cli.jswith Node 24.18.0 and used a temporary home, project, and bare Git remote.teamai init <fixture-url> --provider git --agent codex --scope project --forceandteamai pullexited 0; pull synced one doc intoknowledge-base.teamai doctorexited 0 and did not show the hint before editingknowledge-base/guide.md.teamai doctorexited 1, named the kept file and team destination, and showed the explicit push hint.teamai push --file knowledge-base/guide.md --path docs/guide.md --dry-run(absolute local path in the run) exited 0 and printed “Would propose … as docs/guide.md” and “Dry run — no changes made.” The edited bytes were unchanged after both doctor and the preview. The temporary fixture was removed.