Repository navigation
Conversation
Signed-off-by: Project Manager <cprazwal@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
Bulk acceptance can retire a revision the operator never reviewed, and capture trust can survive a human edit. Please address the inline findings and the two open review threads. GitHub also reports a merge conflict with main, which already uses migration 120.
Signed-off-by: Project Manager <cprazwal@gmail.com>
The resolver audit determines the winner direction, and a bulk acceptance must not retire a peer whose content changed after review. Preserve the signed capture origin through full-row reads and unrelated namespace saves so later conflict review remains accurate. Signed-off-by: Project Manager <cprazwal@gmail.com>
Signed-off-by: PRAZPC <cprazwal@gmail.com>
Signed-off-by: PRAZPC <cprazwal@gmail.com>
zlareb1
left a comment
There was a problem hiding this comment.
The updated retirement checks the losing head at write time, and the capture claim, migration and dashboard visit changes address earlier findings. Bulk acceptance still fails to bind the winning revision to the retirement. GitHub confirms a conflict with main.
…conflict-management Signed-off-by: PRAZPC <cprazwal@gmail.com> # Conflicts: # docs/reference/operations.md # docs/reference/status.md # schemas/schema.sql # sdk/go/wire/models.gen.go # sdk/ruby/lib/clickhouse/loom/generated/ops.rb # sdk/rust/src/wire_models.rs # sdk/typescript/src/generated/ops.ts # tests/unit/test_schema_baseline.py
Signed-off-by: PRAZPC <cprazwal@gmail.com>
Signed-off-by: PRAZPC <cprazwal@gmail.com>
Signed-off-by: PRAZPC <cprazwal@gmail.com>
|
I merged main into this branch and pushed 979cb84. The branch includes the current base, and the local merge is clean. I regenerated the Go and Rust models; they include the bulk-accept models and the current skill operations. GitHub is still showing those two files as conflicted. Could you refresh the status or let me know what conflict it is seeing? |
zlareb1
left a comment
There was a problem hiding this comment.
Bulk acceptance now checks both reviewed heads at the write fence. The new SessionStart behavior also needs a distinct version in both shipped plugin manifests.
Signed-off-by: Project Manager <cprazwal@gmail.com>
Carry authenticated capture provenance through namespace snapshots, gate captured policy until all live instances understand it, and enforce both reviewed heads and active delete locks at the bulk retirement fence. Signed-off-by: Project Manager <cprazwal@gmail.com>
|
Fixed in 46a94ba. Bulk acceptance fences both reviewed heads at the write, and the ClickHouse replacement-race test covers a stale head. Both plugin manifests are now 1.2.188; the open manifest PR I checked is at 1.2.187. |
zlareb1
left a comment
There was a problem hiding this comment.
The rollout gate still admits an old resolver. The heartbeat reports the highest migration in the build, and main already has migration 128, so the < 125 check accepts a replica that cannot enforce captured-row provenance. Gate the policy on resolver support and cover mixed-build retirement. A locked loser also still returns “Conflict is no longer open” while both rows remain conflicted. Rollout finding · Locked-row finding
Use the instance heartbeat ID to distinguish resolvers that understand captured provenance during mixed-version deployments. Return a protected result when a lock blocks bulk retirement at the write fence. Signed-off-by: Project Manager <cprazwal@gmail.com>
An older resolver treats rows without a capture claim under its general policy. Return a retryable backend-unavailable response before writing a signed capture request until every live instance advertises resolver support. Signed-off-by: Project Manager <cprazwal@gmail.com>
|
Fixed in 8ae03d6 and 07ca202. Bulk acceptance reports a locked loser as protected when the write fence sees its lock. Captured writes pause with a retryable response until every live instance advertises resolver support, so an older resolver cannot see unmarked capture rows during rollout. Unit tests cover the legacy, supported and mixed cases, and ClickHouse tests verify that blocked writes leave no rows. |
zlareb1
left a comment
There was a problem hiding this comment.
The locked-pair result now distinguishes a protected loser from a stale conflict. The rollout gate still misses a path that writes captured rows. GitHub also reports a merge conflict with main.
Signed-off-by: Project Manager <cprazwal@gmail.com> # Conflicts: # docs/reference/operations.md # docs/reference/status.md # frontend/src/api.ts # frontend/src/api/conflicts.ts # frontend/src/views/admin/ReviewQueue.test.tsx # integrations/claude-code-plugin/.claude-plugin/plugin.json # integrations/codex-plugin/.codex-plugin/plugin.json # sdk/ruby/lib/clickhouse/loom/generated/ops.rb # sdk/rust/src/wire_models.rs # sdk/typescript/src/generated/ops.ts # tests/unit/test_lineage_and_snapshot_fidelity.py
Signed-off-by: Project Manager <cprazwal@gmail.com>
Signed-off-by: Project Manager <cprazwal@gmail.com>
zlareb1
left a comment
There was a problem hiding this comment.
The snapshot restore now checks resolver support before it writes captured rows. Capture tokens, inline retirement, and the worker still have paths that bypass the captured policy. GitHub reports a merge conflict with main.
| minted = delegated.mint( | ||
| sa_subject, | ||
| reads_as_creator=personal, | ||
| capture_origin=capture_origin or None, |
There was a problem hiding this comment.
P1 — The service account can mint a capture token while an older replica still accepts writes. That replica ignores the new claim, writes an unmarked row, and lets the older resolver act on it. Fence capture token use through the mixed-version window and cover a new token routed to an older replica. Rollback also needs a fence for already captured rows because the old resolver ignores the captured policy.
| captured_update = bool( | ||
| action in (cr.FLAG, cr.RETIRE) | ||
| and cr.captured_update_eligible( | ||
| policy=why.get("captured_conflict_policy", ""), |
There was a problem hiding this comment.
P1 — This uses policy read before the judge call. If an owner switches to manual_review while the call waits, the resolver can still retire a row under the old policy. The pair locks protect rows and leave namespace settings writable. Check the current policy and confidence floor under a fence that covers retirement, and test a setting change while the judge is in flight.
| Captured writes carry a server-stamped `capture_origin` from a verified service-account token; | ||
| request fields cannot set it. The supported origins are `claude-code` and `codex`. The | ||
| namespace's `captured_conflict_policy` defaults to `manual_review`, and its | ||
| `captured_conflict_confidence` defaults to 0.98. With `manual_review`, a captured update stays |
There was a problem hiding this comment.
P1 — The documented manual-review guarantee has an inline exception. Under newest_wins, check_on_commit can classify a templated update as refines, and the commit retires the peer before the resolver sees it. Cover the inline path with the captured policy and test a captured update against a templated peer.
| """An omitted settings field keeps the row read under account_change; an explicit | ||
| field value is the administrator's edit. Fresh rows use the field's default.""" | ||
| if field in input.model_fields_set: | ||
| return getattr(input, field) |
There was a problem hiding this comment.
P2 — The register input accepts explicit null for both captured settings. This passes null to non-nullable registry columns, so a valid request can fail during insert. Give explicit null a defined meaning or reject it in validation, and test the stored values after registration.
Signed-off-by: Project Manager <cprazwal@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
Reviewed by Cursor Bugbot for commit a5c3725. Configure here.
| if await conflicts_repo.has_live_captured_rows(input.org, input.namespace, ch=ch): | ||
| raise ValidationError( | ||
| "default_conflict_policy must remain manual_review while captured rows are live" | ||
| ) |
There was a problem hiding this comment.
Policy fence misses live credentials
High Severity
Changing default_conflict_policy is blocked only when a captured row is already visible. A capture credential is checked only at issue time and does not hold the namespace claim across later writes, so the policy can move off manual_review before the first captured row, or after the last one is tombstoned. Those later writes still stamp capture_origin. A rollback build never reads that field, and its newest_wins path can retire the new rows. The new templated-substitution guard does not cover that build.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit a5c3725. Configure here.
| 'pending_judgement', | ||
| toUnixTimestamp(e.conflict_checked_at) = 2, 'resolver_judged', | ||
| 'cosine_only' | ||
| ) AS judgement, |
There was a problem hiding this comment.
Backlog mislabels older resolver marks
Medium Severity
count_conflict_backlog treats only the owed and judged sentinels as resolver states. A conflicted row whose conflict_checked_at is a real timestamp, the stamp an older resolver left, falls through multiIf into cosine_only. Those rows are still on the unjudged recheck queue, so "Awaiting resolver judgement" undercounts them and "Cosine-only" includes rows a resolver already stamped.
Reviewed by Cursor Bugbot for commit a5c3725. Configure here.


<!-- Linked issues and pull requests. -->
Closes: #2077
Changelog category (leave one):
Changelog entry
Adds configurable, provenance-aware conflict management for automatically captured memories. Loom can automatically settle eligible resolver-approved updates, retain an auditable restoration path, and help users manage remaining conflicts through backlog statistics, bulk review, and SessionStart notifications.
Why
Coding-agent integrations automatically capture observations, extracted facts, and session summaries into Loom namespaces. As automatic capture becomes more frequent, similar or contradictory memories accumulate faster than namespace owners can review them.
The existing resolver handles sufficiently clear cases, but uncertain conflicts remain in the Review queue. This makes genuine disagreements harder to identify and leaves agents exposed to conflicting memories during retrieval.
This change extends the existing memory and conflict-resolution infrastructure to make automatically captured conflicts manageable without removing human oversight.
The implementation introduces trusted capture provenance so that automatic resolution is based on server-validated integration identity rather than caller-supplied metadata. Namespace owners can opt into automatic settlement of eligible resolver-approved updates for trusted captured memories, while genuine contradictions, uncertain judgements, mixed-source conflicts, and unknown-provenance memories remain subject to conservative review.
The change also improves visibility into the remaining backlog, provides bulk acceptance of current resolver suggestions, and notifies users when their namespace requires attention.
Scope and risk
The implementation touches the following areas:
Security and data-integrity safeguards:
updatejudgements and configured confidence thresholds.The implementation deliberately leaves the general retrieval architecture, namespace curation functionality, and unrelated MCP administration behaviour unchanged.
Potential risks: Credential lifecycle and provenance validation, concurrent memory updates during automatic settlement, ClickHouse mutation consistency, stale bulk-review suggestions, and restoration when newer memory revisions exist. These paths are covered by focused tests and the ClickHouse resolver integration suite.
Compatibility, rollout and rollback
Wire changes
conflicts.listwith conflict backlog statistics broken down by resolver state and provenance.The generated API schemas and SDK artifacts reflect the operation and model changes in this PR. Existing privileged conflict-resolution operations are not exposed through MCP.
Operator steps
125_captured_conflict_provenance.sqlusing the normal Loom migration procedure.Rollback
Disable the captured-memory automatic settlement policy before rolling back the application.
The migration is additive. Rolling back the application does not automatically remove the provenance columns, audit records, or retired-memory history created by the feature. Existing automatic settlements remain recorded and should be restored through Loom's existing Undo mechanism when appropriate.
Do not drop the migration's stored data as part of an application rollback.
Tests
Current revision
make typecheck: passed. The server mypy gate reported 0 errors; strict Python SDK typing passed on 75 source files.make schema-check: passed after replaying 102 migrations from an empty ClickHouse.schemas/schema.sqlmatches the applied schema.uv run --locked python scripts/ops/simulate_captured_conflicts.py: passed all checks for the seven-day light, steady and surge scenarios. No false automatic settlements or genuine contradictions were settled.The modeled review capacity was 2,000 pairs per sitting. All six scenarios stayed within that capacity.
Not completed
vitestwas not recognized in the configured shell. The full frontend suite and production build are not verified on this revision.Reproduction:
uv run --locked python scripts/ops/simulate_captured_conflicts.pyDetailed assumptions and results are documented in
docs/features/memory/captured-conflict-simulation.md.AI assistance in the code
None
AI-assisted (completion, or questions while writing it):: I drove the system design, provenance and conflict-resolution logic, code review, debugging, and end-to-end verification, while relying on AI to scaffold the core modules, handlers, test/simulation suites, and PR documentation.
AI-generated
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
schemas/schema.sql.main, and its generated schema passedmake schema-check.Note
High Risk
Changes credential issuance, memory conflict policy, and admin bulk resolution with automatic retirements—security-sensitive paths where stale suggestions or mixed-version rollouts could mis-settle conflicts if guards fail.
Overview
Introduces trusted provenance for plugin-captured memories via server-signed service-account credentials (
capture_originon writes), plus namespacecaptured_conflict_policy/ confidence settings so owners can keep captured conflicts in review by default or opt into automatic settlement of eligible resolverupdatejudgements.Adds
conflicts.bulk_accept(admin, audited) and extendsconflicts.list/mentor.briefwith row-based backlog splits (resolver state × captured vs caller vs unknown). Migration125_captured_conflict_provenance.sqladds the storage columns; rollout/rollback rules document fencing when live captured rows exist.The Review queue gains backlog summary, resolver-suggestion selection (hash + revision checks), and bulk accept; namespace settings and token minting expose capture credentials and policies without resending unchanged fields on unrelated saves. Claude Code gets a throttled SessionStart review notice; docs and a seven-day simulation script describe behavior and limits. SDK/plugin/schema artifacts are regenerated (427 ops).
Reviewed by Cursor Bugbot for commit a5c3725. Bugbot is set up for automated code reviews on this repo. Configure here.