Repository navigation
fix(push): offer a doc edited in the docs mirror - #1875
Conversation
|
No confident findings in the specified diff. The PR description provides sufficient testing: focused unit tests, type checking, lint, and a representative real-CLI world run confirming the mirror edit is pushed to Review was read-only; no PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Requesting changes at dcbf097. The scan itself works. The problem is that the branch starts from 17238b7, before #1862 and #1871 landed, and both of those tell members that plain push does not see mirror edits. Once this PR merges, that is no longer true.
[P1 blocking] After merging into main, status and doctor say the opposite of what push does
I merged this head into main (1bc2ce1) locally and ran the real CLI in a verify world. The setup was a git team repo with docs/team.md, then teamai pull, then a line appended to .teamai/docs/team.md:
$ teamai status
ℹ Local resources not yet pushed:
[docs] 1 new
ℹ Kept docs mirror edits (not scanned by plain push):
…/project/.teamai/docs/team.md (team path: docs/team.md)
To propose one edit, use `teamai push --file "<mirror-file>" --path "<team-path>"`.
$ teamai --dry-run push
1. [docs] team.md (modified)
from: …/project/.teamai/docs/team.md
$ teamai doctor
→ Kept …/.teamai/docs/team.md: … Plain `teamai push` does not scan this mirror. To propose a kept edit …
Status shows the same file twice, once as pending and once under a heading that says plain push does not scan it, and doctor says the same. Both come from main:
src/status.ts:244, the "Kept docs mirror edits (not scanned by plain push)" section from #1871;src/doctor-delivery.ts:2771, the "Plainteamai pushdoes not scan this mirror" sentence from #1862.
Once push offers the edit, the status section only repeats what "Local resources not yet pushed" already lists. The doctor sentence becomes false. Please rebase onto main and, in this PR:
- remove the status section;
- drop the doctor sentence. Doctor's "Kept …" note can stay as it is, or say that
teamai pushoffers the edit. - update the cases that pin the old text:
git-exclude-delivered-915.test.ts:1447/:1459anddoctor-delivery.test.ts:491.
Without this, the three commands disagree about the same file.
What I checked
- Red on main, green here. With 17238b7's
src/resources/docs.ts, 1 of the newdocs.test.tscases fails, and the other 5 already pass because they guard what must stay out. With this head, all 34 pass, including after the local merge into main. - Push offers the edit. On the merged build,
teamai --dry-run pushliststeam.md (modified)from the mirror, which matches your VERIFIED record. - Namespaces. Namespace docs live under
docs/<ns>/with no overlay, so a mirror path maps 1:1 todocs/<rel>, and inactive namespace directories are withdrawn from the mirror by pull. Copies of older versions are skipped throughisTeamaiCopy's history check.
Hidden scope
- A plain
teamai pushnow proposes edited mirror docs that it used to ignore (src/resources/docs.ts:742-785). That is what #1851 asks for, and the CHANGELOG lists it. I'm noting it because a member who kept local notes in a delivered doc will now see them proposed.
[P3 nit]
- Status counts the edit as
[docs] 1 newwhile push says(modified). You flagged it already; fine to leave. - In user scope, the mirror is shared by every team on the machine. Another team's file at the same
docs/<rel>as one of this team's docs would be offered as an edit. Unlikely, and thetrackedfilter already narrows it.
CI review. No findings. We disagree on one point: the conflict with #1862 and #1871 only shows up against current main, so it was missed by a review that read the diff alone.
Merge risk. Medium as it stands, because members would get contradictory guidance. Low once the two hints are reconciled: the scan runs only where push scans already run (status, push, remove).
`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.
dcbf097 to
f15b6db
Compare
|
Rebased onto
Re-verified on the merged base with a real CLI world ( and On the hidden scope you noted: agreed, a plain push now proposes edited mirror docs; the CHANGELOG calls that out and I left |
|
No confident findings in the specified diff under the base version’s Code Review Rules. The earlier pass reported no findings, so none require resolution. The PR description documents sufficient testing, including a representative real-CLI world run confirming the mirror edit reaches Review was read-only; no PR code was run, built, or installed. |
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
Approving at f15b6db. The [P1 blocking] from my last review is resolved.
What changed since dcbf097
- Rebased onto b04409d, which carries #1862 and #1871.
- Status. The "Kept docs mirror edits (not scanned by plain push)" section is removed from
src/status.ts, along with its imports. An edited mirror doc now shows once, under "Local resources not yet pushed". - Doctor.
src/doctor-delivery.ts:2771now says plain push offers the edit, and keeps the--filehint for proposing just one. It is still gated bycanPropose, so read-only HTTP teams don't get it. - Scan unchanged.
src/resources/docs.tsanddocs.test.tsare identical to the previous head.
What I checked
- Tests on this head:
docs.test.tsanddoctor-delivery.test.ts: 104 pass.git-exclude-delivered-915.test.tsthroughtest:e2e, with this head built: 55 pass.- Typecheck passes.
- The rewritten E2E case still guards the member's own files.
[docs] 1 newmeans onlyguide.mdcounts, somine.md,dir-doc.mdanddeep.mdare still excluded, and the edited bytes stay put. - Real CLI. I did not rerun it on this head, because the scan code is identical. Your world record on the merged base matches what I saw before the rebase: push offered
team.md (modified), and with this change status and doctor now agree with it.
Still open, unchanged
- [P3 nit] Status says
[docs] 1 newwhere push says(modified). - [P3 nit] In user scope, the shared mirror could hold another team's file at the same
docs/<rel>.
Both are optional.
CI review. No findings on this head. We agree.
Merge risk. Low. Push gains the mirror scan, and status and doctor now say the same thing about it.
Summary
teamai statusandteamai pushnow offer an edit a member made to a delivered doc in the docs mirror (sharing.docs.localDir), at the doc's team pathdocs/<rel>. Before, only an edit in the team clone's checkout was scanned — andpullkeeps that checkout clean, so the edit the member could actually make was invisible whileteamai doctorskipped the mirror file as a copy of a team version (for #1851).A mirror file that matches any version of that doc in the team's history is a copy, not an edit, so a stale copy never proposes to overwrite the team's newer file, and an edit in the checkout still wins for the same path (both name the same team file). Only docs the team already has are considered: the user-scope mirror is machine-wide and can hold other teams' docs, so a file for a doc the team does not have stays where it is.
Type of Change
Test Plan
npx vitest run src/__tests__/docs.test.ts— 34 tests pass, including 6 new ones for this scan: an edited delivered doc is offered asmodifiedatdocs/team.mdwithsourcePathin the mirror; the team's current version and an older delivered version are not offered; a mirror file for a doc the team does not have is not offered; a clone edit of the same path wins and the path appears once; a linked mirror root is not read; the scan leaves self mode alone.src/__tests__/push-env.test.ts,push-team-config.test.ts,push-all-resources-namespaces.test.ts— pass (the scan also runs for every push, including configs built without the schema defaults).npx tsc --noEmitclean;npm run lintpasses.gitlab-*,git-discovery,git-stalled-remote,workflow-pr-providers,model-switch) fail the same way onmainin this sandbox (23 failures, same tests: GitLab URL/token parsing, symlink teardown, stalled-ssh timing), so they are environmental, not from this change.docsand everypush-*suite pass.b04409d9, after fix(doctor): guide users to publish kept docs mirror edits #1862/fix(status): show kept docs mirror edits separately #1871) a real CLI world (20261115T032950-e270e5) shows the edit once:status→[docs] 1 new(no separate "kept mirror edits" section),--dry-run push→[docs] team.md (modified), anddoctorsays plain push offers the edit instead of saying it does not scan the mirror.teamai init --provider git, fake team repo atfile://…/team.git):20261115T012357-b7af55, built frommain: afterteamai pulldelivereddocs/team.mdintoknowledge-base/and I appended a line there,teamai statusended withLocal resources not yet pushed:/(none), andteamai --dry-run pushsaidℹ No new or modified resources to push.20261115T021503-4b0608, built from this branch: same setup and edit gives[docs] 1 newinstatusand1. [docs] team.md (modified) / from: …/project/knowledge-base/team.mdinpush.teamai pushthen printed✔ Pushed branch teamai/push/TeamAI-World/20261115-101515;git show <branch>:docs/team.mdon the team repo isTeam doc+Member line, so the mirror edit landed at the team path. (Creating a PR then fails withAutomatic pull/merge request creation is not supported for generic Git hosts— expected for--provider git.)Notes
statuskeeps its existing wording for pending items ([docs] 1 new), which counts items rather than naming each one's state;pushprints(modified). I left that alone.teamai doctoris untouched; itsdocscheck keeps treating a mirror file that matches a team version as a copy. Follow-up in [bug] Edits in the docs mirror (sharing.docs.localDir) are invisible to teamai push/status; the only pushable copy is teamai's disposable checkout #1851's comment if the maintainers want it to name an edit instead.report.artifacts… not relevant here.