Repository navigation
gate, web-inbox, guard, lease and wt come to public aisync (opt-in); 0.2.5 - #9
Conversation
…-in); 0.2.5 Ported from the private ai-sync through tools/public_port (3-way merge + privacy scan): - gate: push-time test gate, opt-in via gate_hook = true (pre-push hook runs check.sh --fast) - web-inbox: import web-Claude events from the web-inbox branch; web_inbox_secs = 0 is off - guard + lease: one Claude Code session per repo, opt-in via guard_hook = true; fails open - wt: a session's own worktree; wt land pushes to main only with --yes - landq: per-repo landing queue used by wt and gate - stale git lock fix (1b19ff2) kept; Atomic ingest and tigeridea stay private - privacy scan: author and committer names shown on the owner's commits are exempt by digest Agent: claude-code
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a2879c744a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ahead = _git(wt, "rev-list", "--count", f"origin/main..{br}").stdout.strip() | ||
| if ahead in ("", "0"): | ||
| note = _follow_origin(key) | ||
| _cleanup(key, wt, br, cfg) |
There was a problem hiding this comment.
Preserve the worktree when the ahead-count command fails
When origin has no fetched main branch—for example, a repository whose remote only has master—the ahead-count command fails with empty stdout. Treating that as zero commits calls _cleanup, removes the worktree, and deletes its branch even though its commits were never pushed. I reproduced land returning success while removing a worktree containing an unpushed commit. The deletion is forced (git branch -h describes -D as “delete branch (even if not merged)”). Check the command's return code and preserve the worktree on failure; only a successful count of 0 should trigger this cleanup.
Useful? React with 👍 / 👎.
|
|
||
| def apply() -> None: | ||
| write_git_hooks(dest) | ||
| write_git_hooks(dest, gate=cfg.gate_hook) |
There was a problem hiding this comment.
Re-plan the pre-push hook when gate_hook changes
For users whose Git hooks are already installed, plan_git returns None whenever all hook files exist and commit-msg matches; it never compares the installed pre-push body with the requested gate_hook setting. Consequently, enabling gate_hook = true and running aisync install-hooks --only git --yes reports that everything is installed but leaves the gate disabled. Disabling the setting likewise leaves an installed gate active. Include the expected pre-push contents in the stale-hook check so the new setting actually reaches this writer.
Useful? React with 👍 / 👎.
| if rb.returncode != 0: | ||
| _git(wt, "rebase", "--abort") | ||
| return False, f"与 main 冲突,未落地,worktree 保留在 {wt}:{(rb.stderr or rb.stdout).strip()[-200:]}" | ||
| ok = _git(key, "merge", "--ff-only", br).returncode == 0 |
There was a problem hiding this comment.
Re-run the test gate after rebasing a local landing
In a repository without origin, when local main has advanced since the worktree was created, _gate(wt) tests the old worktree commit before the rebase, but the rebased result is merged without another check. I reproduced two individually passing branches whose combined tree fails check.sh: land still returns success and cleans up the worktree. Run the gate again after the successful rebase and before this merge so the commit actually being landed is the one that passed.
Useful? React with 👍 / 👎.
Agent: claude-code
Ports five modules from the private ai-sync through the whitelist port (3-way merge + privacy scan).
gate_hook = trueweb-inboxbranch;web_inbox_secs = 0is offguard_hook = true; fails openwt landpushes to main only with--yesTests: 416 passed, 1 skipped (CI runs the same suite). History privacy scan: 0 hits.