Skip to content

[cc] agentic conflict primitives v2 — ports, db_handles, git_locks, processes #78

@anipotts

Description

@anipotts

Source: deferred from v3 commit 6; current file-overlap detector is one primitive, real agentic conflicts span more

Problem

v3's file-overlap detector is `same path AND (same branch OR same worktree)`. Real agentic CC conflicts that aren't covered:

Conflict Primitive needed
Both running dev server on same port `ports` table tracking who has port N bound
Both running tests vs shared DB `db_handles` table tracking which session has which DB connection
Both rebasing/pushing same remote branch `git_locks` table; integration with `git rev-parse` checks
`.git/index.lock` ownership Filesystem lock-file watcher
Long-running shell processes `processes` table fed by hooks on Bash tool calls

Each one is its own primitive with its own discovery and reconciliation logic.

Priority order (based on observed value)

  1. ports — most common in dev workflows
  2. git_locks — high-impact (data loss risk)
  3. processes — broadest applicability
  4. db_handles — narrower
  5. .git/index.lock — rare but disruptive

Implementation sketch

  • New table per primitive in sessions.db
  • Detector hook fires on PostToolUse (for Bash/git ops) or via passive watcher (lsof for ports)
  • Digest renderer adds a "conflicts" section grouping all primitives
  • Auto-release on heartbeat-stale + detector-clear

Acceptance criteria

  • At least one new primitive shipped (recommend ports)
  • Conflict alert appears in cc.check digest
  • Auto-release on heartbeat-stale
  • Test coverage for primitive detection logic

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpluginsPlugin code or plugin guide

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions