Repository navigation
feat(sync): add Team delta pull and proposal push client (engraphis sync --team) - #352
Coding-Dev-Tools wants to merge 9 commits into
Conversation
…ync --team) Implement SSRF- and redirect-safe Team delta sync client in engraphis/team_delta.py and wire --team / --propose / --propose-source / --status support into scripts/sync.py: - Paginated delta pull with persistent SQLite cursor and tombstone_since watermarks, client-side secret and poisoning defense-in-depth, and deterministic retire/unapprove/erase eviction. - Fail-closed proposal push refusing personal/unreadable workspaces, excluding session/user/quarantined and already-synced records, running per-item reject_secrets before HTTP, and chunking under server limits. - Origin-bound ENGRAPHIS_TEAM_TOKEN / ENGRAPHIS_TEAM_TOKEN_ORIGIN enforcement and argv secret refusal. - Refreshed SHA-256 bound offline benchmark evidence artifact and charts.
…pproval gating Pass list[str] target IDs to VectorIndex.delete on unapprove/erase tombstones, include retired local Team cache rows in erase/unapprove lookups, fail closed unless server items assert review_state=='approved' and prompt_eligible is True, check workspace shareability on pull, reuse single read-only SQLite handle in --status, and refresh offline benchmark evidence.
Codex Review Summary: ❌ FailedThis 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: 68bafddfb5
ℹ️ 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".
…er-item propose failures Prevent tombstone_since from advancing past failed local retire/purge attempts and stop marking HTTP 200 per-item rejected proposals as already tracked so retries succeed.
…ariants, and bounds Addresses both fresh PR#352 reviews: pinned HTTPS opener + retired host rejection + bearer validation, multi-page tombstone hold and crash-safe vector/SQLite purge, fail-closed sensitivity/scope/poisoning push filtering, write-before-retire updates, CLI exit codes, and refreshed offline evidence.
Doc-only pin update after refreshing offline-fixtures-team-delta-20261124.json.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
… and compact tests Matches MemoryEngine.secure_erase repair queueing and acknowledgement for separate VectorIndex backends (verified by new external-index test), fixes strict no-progress pagination guard, resolves all 3 pyright errors, validates bearer before opening SQLite in sync CLI, trims test boilerplate below the 1500-line core cap, and refreshes offline evidence.
Doc-only pin update after refreshing offline-fixtures-team-delta-20261124.json.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
2-Agent Review & Optimization Summary (
|
…origins Three High-severity defects in the Team delta client: * Workspace-wide items (repo=None) were rewritten to the caller's --repo, and that repo is hashed into team_content_hash. Alternating --repo api and --repo web syncs therefore rewrote a new copy and retired the other on every run. Keep item_repo as the server sent it; the existing guard already rejects a genuine repo mismatch. * _existing_team_memories indexed rows from every Team origin under the same team_memory_id, so a tombstone from one control plane could retire or securely erase rows cached from another. Filter by the local rows' team_origin. * _default_http_post did not catch http.client.HTTPException, so IncompleteRead, BadStatusLine, and RemoteDisconnected escaped as an unhandled traceback instead of a TeamDeltaError.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
`tests/test_benchmark_evidence.py` hashes every `.py` under `engraphis/` and `eval/`, so the team_delta changes invalidated the committed registry artifact and failed the whole Python matrix. Export a new immutable artifact and repoint the test constants, README prefix, BENCHMARKS.md name/sha, and the fixture-suite digest. The SVGs and PNGs were regenerated from the new artifact so their embedded provenance matches.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Implements Release 1 (
v1.8) Slice 2A: the local Team delta sync & proposal push client (engraphis sync --team), connecting local SQLite stores directly to Engraphis Team Cloud's/v1/team/workspaces/{workspace}/deltaand/v1/team/workspaces/{workspace}/proposeendpoints.Highlights
engraphis/team_delta.py):validate_cloud_base_urlandPinnedHTTPSHandlerwithProxyHandler({}),_NoRedirectHandler, bounded timeout, and 10 MiB response limit.ENGRAPHIS_TEAM_TOKEN+ENGRAPHIS_TEAM_TOKEN_ORIGIN), refusing--team-tokenon CLI argv and never hardcoding retired hostnames.pull_team_delta()with persistent SQLite cursor +tombstone_sincewatermarks (sync_state), fail-closedreview_state == "approved"+prompt_eligible is Truegating, client-sidereject_secrets+assess_untrusted_payloaddefense-in-depth,resolve_conflicts=False, and deterministic tombstone eviction (retirevsunapprove/erasehard-purge across active and previously-retired rows with list-typedVectorIndex.delete).push_team_proposals()refusingpersonal/unreadable workspaces, excludingsession/user/quarantined/secret/restricted and synced Team records (zero echo loops), running per-itemreject_secretsbefore HTTP, and chunking batches under server limits (50 items / 900 KB).scripts/sync.py): Adds--team [URL],--propose,--propose-source,--read-only/sync_read_only()enforcement, and read-only--statusTeam cursor reporting.docs/designs/v1.8-team-delta-sync-client.md) and refreshed SHA-256 bound offline benchmark evidence (offline-fixtures-team-delta-20261124.json) and charts.Verification (
68bafddf)pytest -o addopts= tests/test_team_delta_client.py tests/test_sync.py -q: 172 passed, 2 skippedpytest -o addopts= tests/test_benchmark_evidence.py tests/test_documentation_contracts.py tests/test_artifact_smoke.py -q: 60 passedruff check,pyright(0 errors), Python 3.9 AST (2/2 clean),media_gate.py(OKon both PNGs).