refactor: 2.0 parity — monorepo split, TUI sidebar, standalone CLI#6
refactor: 2.0 parity — monorepo split, TUI sidebar, standalone CLI#6iceteaSA wants to merge 36 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub. |
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
|
Thanks for putting this together. I reviewed the full diff and ran the Bun migration, package, E2E, OpenCode-loading, and storage paths locally. I don't think this is merge-ready yet. Blocking findings1. Account storage can be destructively overwritten
I reproduced this with a malformed existing account file: persisting one newly authenticated account replaced the malformed file with a one-account pool. This is the same failure class described in The storage API needs to distinguish at least 2. CI and release run the wrong test commandBoth workflows invoke raw
The repository's intended unit gate is the scoped
The raw command discovers E2E and support files without the intended setup. Among the failures, the fetch-guard test reached the live network instead of being blocked. Both workflows should call There is currently no authoritative GitHub Actions CI check attached to the PR; only Socket checks and the skipped Cubic review are visible. 3. The E2E suite has a cross-file cleanup race
The E2E files run in parallel and use that same prefix, so one file can delete another file's active test root. I reproduced this with the supported command:
Cleanup must be scoped to roots owned by the current test file/process. A process-global prefix sweep is also unsafe when two checkouts or CI jobs run concurrently. 4. The documented installation does not load the TUI pluginThe root and OpenCode READMEs say that adding the package only to That does not match current OpenCode behavior. OpenCode detects package targets from I verified this against OpenCode 1.18.3:
The supported installation instructions should use: opencode plugin @cortexkit/opencode-antigravity-authThe 5. The branch needs integration with the latest user-turn fixA trial merge against current
The PR also does not contain that runtime fix, which is required to prevent Additional findings
Checks that did pass
The core direction is reasonable, but the storage fail-open behavior, broken workflow command, E2E isolation race, and unsupported TUI installation contract are release blockers. |
…RIES ensureGitignore/ensureGitignoreSync appended a literal '.gitignore' line to <configDir>/.gitignore whenever missing. For users who track their config dir as a git repo with .gitignore committed, this produced endless working-tree drift (the entry is a no-op for a tracked file anyway — git never ignores tracked files). The four artifact entries (accounts, tmp, signature cache, logs) remain — those genuinely contain secrets/machine state. 22/22 storage tests + full suite 856 passed; dist rebuilt (untracked).
…urity, killswitch, lifecycle) Lock: stop renewal on ownership loss, idempotent terminal release, eviction marker TTL with PID/createdAt. TUI isolation: import-graph gate in build-tui.test.ts. E2E: unconditional loopback-only fetch deny guard with per-test install/restore. Security: redact project IDs and fingerprints in debug/dump output, enforce 0600 on existing TUI log files. Killswitch: model-aware evaluation, eligibleAccounts wired into selection, fallback recheck. Lifecycle: producers disposed before sidebar drain, consumers after. Tests: all locks released in afterEach, lifecycle disposed, sidebar release awaited.
…debug leak, killswitch, quota producer)
- refresh token is plaintext under 0600, not encrypted at rest by Google
- pi has no account pool/rotation/killswitch; only transport+transforms are shared
- killswitch.accounts is unset by default (emptyOperatorSettings omits it), not {}
Unescaped | inside `true|false` code spans split the table cell in GitHub's renderer, breaking the argument column for /antigravity-routing and /antigravity-killswitch.
a58c890 to
af65acf
Compare
|
All five blockers are fixed and pushed. The branch is rebased onto current 1. Storage fail-open → fixed in 2. CI test command → fixed in 3. E2E cleanup race → fixed in 4. Install docs → fixed in 5. Rebase → done. The final-user-turn guard survives at On the non-blocking items: Gate results on the pushed head: typecheck clean, |
|
Thanks for the update. I re-reviewed The update does fix several items from the first review:
I still found the following unresolved issues. Blocking findings1. The combined E2E suite still has the cleanup raceThe supported gate still fails on the updated head: The failures included:
All four files pass when run in separate Bun processes:
This isolates the failure to same-process cross-file cleanup. The 2. Storage still silently drops malformed account records
I reproduced this with a v4 file containing:
Calling That is still destructive normalization. If any persisted account record is invalid, the file should be classified as unreadable and the mutation should fail closed, preserving the original file and backup, rather than filtering the record out. 3. TUI OAuth callbacks still swallow persistence failures and report successBoth callback paths in
I directly exercised the code-method callback with Persistence failure must abort the OAuth callback and surface the unreadable-storage/backup details. It must not tell the user that an account was added when it was not saved. This also applies to non-corruption failures such as lock or I/O failure. 4. Manual TUI configuration uses the wrong keyBoth READMEs currently show: { "plugins": ["@cortexkit/opencode-antigravity-auth"] }I reran the current OpenCode installer against this package. It wrote both files with the singular key: { "plugin": ["file:///.../packages/opencode"] }The manual 5. The lint gate is still non-enforcingThe updated branch still reports: and exits successfully. Therefore Remaining documentation residue
Gates that pass
The branch is now rebased and Git reports it as mergeable, but I still recommend not merging until the E2E race and the two account-persistence correctness issues are fixed and the documented/gated contracts are accurate. |
What this is
Brings the plugin to structural and functional parity with the sibling OpenAI/Anthropic auth plugins. The monolithic
plugin.ts(~2,750 lines) is decomposed into a harness-agnostic core library and a thin OpenCode composition root, plus a Pi extension and a deterministic e2e workspace.Large diff (291 files, +58k/−28k), but the 30 commits are atomic and meant to be read in order — each builds and tests green on its own.
Structure
Four packages under
packages/:registerProviderto the core transport.Dependency direction is one-way:
opencodeandpidepend oncore;coredepends on nothing in the workspace.Notable changes
@opencode-ai/pluginv1.127.0.0.1only, per-boot 32-byte bearer token, pid-scoped port file.antigravity-authCLI — login/list/quota without the host./antigravity-accounts,-status,-quota,-routing,-killswitch,-dump.proper-lockfiledependency with a dependency-free renewable lock.gemini-prorequest checks only the pro quota group, not the max of pro+flash.Breaking changes
authorizeAntigravity/exchangeAntigravitynow import from@cortexkit/antigravity-auth-core, not the opencode package.@opencode-ai/pluginv1 host (>=1.17.13 <2).Verification
E2E runs against a mock server behind a loopback-only fetch guard — a non-loopback URL throws instead of reaching the network.
Docs
ARCHITECTURE.md,STRUCTURE.md, and both READMEs are rewritten against the final tree.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Brings the plugin to v2.0 parity by splitting into a harness‑agnostic core, an OpenCode plugin with a TUI sidebar, and a Pi extension, plus a standalone CLI. Moves the repo to Bun, adds a fenced file lock, atomic writes, fail‑closed account storage, a model‑aware killswitch, and a 15s active fetch‑header timeout for more reliable and secure operation.
New Features
packages/core,packages/opencode,packages/pi,packages/e2e-tests.0600log files.antigravity-authCLI (login, list, quota)..gitignoreself‑ignore drift.0600, Pi surface parity (no pool/rotation/killswitch), killswitch default (unset), and fixed table rendering in routing/killswitch docs.Migration
authorizeAntigravityandexchangeAntigravityfrom@cortexkit/antigravity-auth-core.@opencode-ai/pluginv1 (>=1.17.13 <2).bun install,bun run build,bun test.Written for commit af65acf. Summary will update on new commits.