Skip to content

Human Yield: Implement Presence Detection and Locking Mechanism #211

Description

@kingdonb

Summary

Implement a reliable presence detection mechanism to safely manage the presence.lock for background agents.

Business Value

Ensures Cooperative Rebase and Human Yield. If the human is actively working on the workstation or using the CLI, the background daemon must yield and NOT spawn ghost sessions that could cause git conflicts or system contention.

Requirements

  • Add a new command bin/mecris presence (or a background thread in the CLI).
  • Implement detection logic to determine if the human is "active":
    • Check for recent keyboard/mouse input (OS-specific APIs if necessary, or simply check if the user's terminal session is active).
    • Check if a mecris interactive CLI session is currently running.
  • Create a lock file mechanism (/tmp/mecris_presence.lock) that the daemon respects.
  • If the lock is present, the scheduler must abort any pending autonomous turns.

Deliverables

  • Presence detection logic in Python.
  • Integration with the MecrisScheduler to respect the lock.
  • Documentation on how the detection works across different OS environments (macOS/Linux).

Labels: enhancement, autonomous, goal-1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions