Feature: ProjectService Coverage Boost
  Additional scenarios that exercise previously uncovered code paths
  in the project_service module (lines 29, 248-249, 270-271, 465-466,
  483-494).

  Background:
    Given the project service coverage module is imported

  Scenario: get_current_project returns None when Project constructor fails with name file present
    Given a temporary directory tree with .cleveragents and a project.name file
    And the database returns no project for the stored name
    And the Project constructor is patched to raise an exception
    When I call get_current_project from inside the temp directory
    Then get_current_project should return None

  Scenario: get_current_project returns None when Project constructor fails for legacy project
    Given a temporary directory tree with .cleveragents but no project.name file
    And the Project constructor is patched to raise an exception
    When I call get_current_project from inside the temp directory
    Then get_current_project should return None

  Scenario: get_project_filters raises NotFoundError when project not in database
    Given a ProjectService backed by an in-memory database
    And the database contains no project named "ghost-project"
    When I call get_project_filters with a project named "ghost-project"
    Then a NotFoundError should be raised with message "Project not found"

  Scenario: delete_project emits ENTITY_DELETED event via event bus
    Given a ProjectService backed by an in-memory database with an event bus
    And a project named "event-project" exists in the database
    When I call delete_project on "event-project"
    Then the event bus should have received an ENTITY_DELETED event for "event-project"

  Scenario: delete_project swallows event bus exception and logs warning
    Given a ProjectService backed by an in-memory database with a failing event bus
    And a project named "fail-event-project" exists in the database
    When I call delete_project on "fail-event-project"
    Then no exception should propagate from delete_project
    And a warning about audit_emit_failed should have been logged
