Skip to content

fix(status): show kept docs mirror edits separately - #1871

Merged
SaulMoro merged 1 commit into
Tencent:mainfrom
XY-code1:fix/docs-mirror-status
Nov 14, 2026
Merged

SaulMoro merged 1 commit into
Tencent:mainfrom
XY-code1:fix/docs-mirror-status

Conversation

@XY-code1

@XY-code1 XY-code1 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Show kept regular-file edits at delivered docs mirror paths in a separate status section, with the local and team paths.
  • Point writable teams to the existing explicit-file push command. Leave plain push and pull behavior unchanged.

Refs #1851.

Verification

  • npm run build
  • npm run typecheck
  • git diff --check
  • Built real CLI on Windows: targeted git-exclude-delivered-915.test.ts case with isolated HOME, local Git team remote and workspace. Baseline did not show the section after the edit; fixed CLI shows the edited guide and its team path outside plain-push candidates, excludes unedited files, member-only files and a blocking directory, and leaves the edit unchanged.
  • The verify:world launcher reports that Windows is unsupported because it requires POSIX; the Git-backed E2E fixture above ran the built CLI instead.

@github-actions

Copy link
Copy Markdown

No confident findings in the specified PR diff.

The description documents a representative built real-CLI run with isolated HOME, a local Git team remote, and a workspace. It also explains why verify:world could not run on Windows; no missing-verification finding is warranted.

Review was read-only; nothing from the PR was run, built, or installed.

@SaulMoro SaulMoro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Approving at 8ec75e9.

What I checked

  • Red on main, green here. With main's src/status.ts built, the new E2E case fails: status shows no "Kept docs mirror edits" section after the edit. With this head built, all 9 docs-mirror cases in git-exclude-delivered-915.test.ts pass on macOS, the new one included. The real CLI runs in a git team repo with workspace scope, and checks four things:
    • the edited guide shows with its team path, outside the plain-push list;
    • unedited docs, the member's own files and a directory blocking a doc path don't show;
    • the edited bytes stay as they were.
  • Read-only teams. The push --file hint is skipped for repo.kind === 'http', the condition assertNotReadOnly refuses push on. The list itself still shows, which is right: it describes local state.
  • Failure stays contained. An error inspecting the mirror prints one warning and the rest of status still runs. A linked docs root is skipped, as pull and doctor skip it.
  • Scope. One new status section, refs #1851. Pull and push behave as before.

[P2 non-blocking]

  • The same rule now lives in two places. Which kept entries count as a proposable edit is decided twice. doctor-delivery.ts (from #1862) and this block both filter membersDocs to entries that are regular files on both sides, each with its own lstat pair. If one changes, doctor and status will disagree about the same file. A small exported helper next to membersDocs in src/resources/docs.ts, for example keptDocEdits(desired, dest, repoPath), could serve both. Fine as a follow-up.

[P3 nit]

  • Unlike doctor's hint, this one shows the --path placeholder as "<team-path>". The line above prints the team path itself, so the member can tell what goes there. Printing the exact command per file would still save a step.

CI review. No findings, and it accepts the Windows real-CLI record. We agree; the E2E run above covers macOS.

Merge risk. Low. Status gets a read-only section, and errors are contained.

@SaulMoro
SaulMoro merged commit 9ef0801 into Tencent:main Nov 14, 2026
20 checks passed
Walternater added a commit to Walternater/teamai-cli that referenced this pull request Nov 15, 2026
`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants