Repository navigation
Conversation
|
|
SaulMoro
left a comment
There was a problem hiding this comment.
This was generated by AI during triage.
@Kiddo4993 Thanks for picking up #1537 so quickly. We ran its sequence with the built CLI, main against d446a37d. On main, the remote never gets architecture.md or lib.md, the clone is left dirty, and teamai push fails. Here the docs reach the remote, the clone is clean, and the next push works. A partial run publishes what it wrote and exits 1, and a later complete run publishes the rest. --output, --dry-run and --status behave as before. tsc, lint and the unit test pass. Two things block it:
-
[P1 blocking] No real-CLI record. This changes what the command does, so the first Code Review Rules item in
AGENTS.mdasks for one built-CLI run. The CI review asks for the same, and we agree. #1537's sequence is enough:teamai import --dir ./svcwith deep enrich failing, thenteamai codebase --deep-enrich --project svc, then the remote's docs andgit statusof the team clone. -
[P1 blocking] A publish that fails is reported as success, and the next
pushdrops the docs.codebase --deep-enrichdoesn't pull first, so if another member pushed to the teammainsince the last pull:- The command prints
⚠ [git] autoPush failed (non-blocking): To file:///…, thenDeep enrichment complete: project=svc, and exits 0. The docs are committed locally but not on the remote. - The member's next
teamai pushprintsTeam repo diverged from origin/main; realigning discards 1 local commit(s), andarchitecture.mdandlib.mdare gone from the clone.
A
mainthat refuses direct pushes gives the same exit 0, and the docs then ride along in whatever the member pushes next. On main, the same sequence at least keeps the docs in the working tree. The cause isautoPushTeamRepo(src/utils/git.ts), which turns push errors into a warning.import --dirhas the same flaw, and we've filed that separately. The smallest fix here: callpushRepoDirectly, which throws. On failure,log.errorthe cause and a next step ("runteamai pull, then rerun this command"), and exit 1. Publishing through a branch, asimport --from-repodoes, would avoid the moved-maincase, but it changes how a team reviews the result, so that one is a maintainer call. - The command prints
Non-blocking:
- [P3 nit]
lockTeamwikiwrites a lock file nothing has read since #1293, so the call doesn't serialize anything. The test's['lock','enrich','release']check pins call order through a mock, and one of its three cases passes on main too. - [P3 nit] Each rerun with nothing new adds a
[teamai] Deep enrich: <project>commit to the teammain, because_review/progress.jsongets a new timestamp.
|
Thanks for the thorough triage run! Changes:
|
|
@Kiddo4993 Thanks, the failed-publish fix works. We built
One thing is still open, and it's the only blocker:
Real-CLI record at 4ccd36aReal-CLI verification (built CLI at 4ccd36a,
|
@Kiddo4993 Thanks for this. #1560 has since merged ( Unless there is a case here that #1560 does not cover, I think this can be closed. If there is one, please rebase onto main and say which case it is, and I'll review it against #1560's version. |
@Kiddo4993 Closing this in favor of #1560, which merged as |
Fixes #1537.
Problem
In a team that keeps its knowledge in the team repo (so no
--output),teamai codebase --deep-enrich --project <name>wrote the docs into the local team clone and then stopped. It reported success, but nothing reached the remote. The clone was also left dirty, so the member's nextteamai pushfailed.Change
codebase --deep-enrichnow handles the team clone the same wayteamai import --dirdoes:lockTeamwiki) while it writes.autoPushTeamRepo([teamai] Deep enrich: <project>), the same push pathimport --diruses.--output, or on--dry-run, it does not publish. Those cases already worked.It publishes whatever was written even when enrichment is incomplete (exit code stays 1). This matches
import, which also publishes partial deep-enrich output, so the clone is never left dirty.To support this,
teamwikiDirForbecameteamwikiTargetForand now returns the wholeTeamwikiTargetso the handler knows about the team.--statusand the other callers still only readwikiRoot, so their behaviour is unchanged.Tests
Added
src/__tests__/codebase-deep-enrich-publish.test.ts, which covers three cases:--outputtarget: no push.--dry-run: no lock and no push.The existing
--outputdeep-enrich tests are unaffected, becauselockTeamwikidoes nothing when there is no team. I couldn't run the test suite in this environment.Fixes #1537
Happy to adjust anything or close it if it isn't a fit.