Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

26.8 KB
Raw Blame
version: 1
capability:
  id: current_instance_permissions
  name: Current-instance Permissions policy and authority
  canonical_tests:
    - tests/scenarios/permissions/test_permissions_scenarios.py
    - tests/test_permissions.py
    - tests/test_member_management_parity.py
    - tests/scenarios/permissions/test_member_instance_operations.py
    - tests/scenarios/permissions/test_editor_reservation_and_fork.py
    - tests/scenarios/permissions/test_cli_invocation_authority.py
    - tests/scenarios/permissions/test_deferred_authority_provenance.py
    - tests/scenarios/permissions/test_effective_target_preflight.py
    - tests/test_ui_show_pages.py
status_legend:
  covered: scenario coverage exists
  partial: unit or contract coverage exists but the closed loop is incomplete
  manual: currently validated only by human regression
  gap: not covered yet
scenarios:
  - id: PERMISSIONS-001
    name: Trusted-local owner enters Permissions without Cloud OAuth
    status: covered
    kind: happy_path
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_001_002_existing_sessions_enter_without_management_oauth
    given: The local owner session and paired instance credential are current
    when: The owner opens the same-origin Permissions API
    then: The current-instance projection is returned without any management OAuth route
  - id: PERMISSIONS-002
    name: Remote OIDC owner enters Permissions without Cloud OAuth
    status: covered
    kind: happy_path
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_001_002_existing_sessions_enter_without_management_oauth
    given: A current remote OIDC owner session is established
    when: The owner opens Permissions
    then: The same current-instance projection is returned without a second login
  - id: PERMISSIONS-003
    name: Viewer reads policy but mutation fails before Backend contact
    status: covered
    kind: authorization
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_003_viewer_mutation_fails_before_backend_contact
    given: A remote Viewer has a current instance session
    when: The Viewer reads and then attempts to mutate authorized users
    then: Read succeeds and mutation is denied before the paired Backend client runs
  - id: PERMISSIONS-004
    name: Instance-managed policy writes advance authorization revision
    status: covered
    kind: mutation
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_004_instance_managed_write_advances_revision
    given: The current instance owns policy at revision zero
    when: The owner replaces current-instance authorized users
    then: The exact projection changes and authorization revision advances atomically
  - id: PERMISSIONS-005
    name: Cloud-managed policy remains readable and locally read-only
    status: covered
    kind: authorization
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_005_cloud_authority_is_readable_and_read_only
    given: Avibe Cloud owns the current-instance policy
    when: The owner reads and then attempts a paired write
    then: Read succeeds and Backend returns permission_authority_cloud for the write
  - id: PERMISSIONS-006
    name: Offline state serves exact-instance last-known policy
    status: covered
    kind: recovery
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_006_offline_uses_bound_cached_projection
    given: A live projection has been cached for the paired instance
    when: Backend connectivity is lost
    then: The same projection is returned as cached and offline with writes disabled by the UI contract
  - id: PERMISSIONS-007
    name: Project applying state converges after acknowledgement
    status: covered
    kind: convergence
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_007_project_write_applies_then_acknowledges
    given: A published Project is in sync
    when: The owner writes a newer restricted access revision and the instance acknowledges it
    then: The committed response is pending and the next projection converges to in_sync
  - id: PERMISSIONS-008
    name: Revision conflict returns current revision without changing policy
    status: covered
    kind: concurrency
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_008_conflict_is_stable_and_non_mutating
    given: The authoritative instance revision is newer than the browser draft
    when: The owner submits the stale revision
    then: The API returns permission_revision_conflict and current_revision without mutation
  - id: PERMISSIONS-009
    name: Browser cannot target another instance or cross a pairing change
    status: covered
    kind: authorization
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_009_targeting_and_stale_pairing_are_rejected_before_backend
    given: The browser loaded one paired current instance and may submit only a non-targeting match precondition
    when: A mutation injects another target or the local pairing changes before the write
    then: The local API rejects it before Backend contact and all live requests remain exact-instance bound
  - id: PERMISSIONS-010
    name: Old Organization and Show Page Cloud-management paths are absent
    status: covered
    kind: retirement
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_010_legacy_management_surfaces_are_absent
    given: Current-instance Permissions and local Show Page sharing are installed
    when: Registered routes and frontend sources are inventoried
    then: No Management OAuth proxy, embedded Organization route, or Show Page Workspace-access control remains
  - id: PERMISSIONS-011
    name: Resource ACL round-trips through exact-instance boundary
    status: covered
    kind: mutation
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_011_resource_acl_round_trip_and_conflict
    given: A paired Instance Owner has a canonical private agent Resource ACL
    when: The owner saves Selected groups and then submits a stale revision
    then: The canonical policy round-trips without a browser target field and the stale write changes nothing
  - id: PERMISSIONS-012
    name: Show Page Resource ACL kind is retired
    status: covered
    kind: retirement
    layer: scenario
    test: tests/scenarios/permissions/test_permissions_scenarios.py::test_permissions_012_show_page_resource_kind_is_retired
    given: A paired Instance Owner calls the retired show_page Resource ACL endpoint
    when: The local boundary validates the resource kind before any Backend contact
    then: Both read and write are rejected as invalid_resource_kind with no Backend request

  - id: PERMISSIONS-013
    name: Instance Member manages settings while preserving access administration
    status: covered
    kind: authorization
    layer: scenario
    test: tests/test_member_management_parity.py::test_member_channel_and_dm_preferences_preserve_access_state
    given: A signed Organization instance Member and existing bound users and channels
    when: The Member saves channel operation and DM preferences and attempts access mutations
    then: Ordinary writes persist while user creation, role changes and reactivation are refused without mutation

  - id: PERMISSIONS-014
    name: Member operates current-instance Agents Projects and sessions
    status: covered
    kind: authorization
    layer: scenario
    test: tests/scenarios/permissions/test_member_instance_operations.py::test_permissions_014_member_signed_agent_session_lifecycle
    given: A signed Member has a policy-less built-in Agent and restricted or standalone sessions
    when: The Member discovers selects mutates chats forks and opens Show
    then: Operations succeed with original ACL and ownership rows unchanged

  - id: PERMISSIONS-015
    name: Member cannot administer access or bypass execution preconditions
    status: covered
    kind: authorization
    layer: scenario
    test: tests/scenarios/permissions/test_member_instance_operations.py::test_permissions_015_access_administration_and_missing_resources
    given: Member operation scope is instance-wide
    when: The Member attempts access grants pairing onboarding or a disabled Agent
    then: Protected effects are denied and real resource checks remain

  - id: PERMISSIONS-016
    name: Management events reach Member through the real SSE stream
    status: covered
    kind: authorization
    layer: scenario
    test: tests/scenarios/permissions/test_member_instance_operations.py::test_permissions_016_real_sse_management_and_session_delivery
    given: The real broker has Member Owner Editor and Viewer subscribers
    when: Publisher-shaped management and session events are emitted
    then: Member and Owner receive operations, an Editor receives instance-scoped invalidations as bare signals their pages refetch from, lower roles stay scoped and unknown events remain Owner-only
    related_tests:
      - ui/src/lib/useVaultRequestRefresh.test.ts::stops polling once the bridge is healthy and refetches on the event alone
      - ui/src/components/workbench/VaultsPage.test.tsx::refetches pending requests from the signal alone
      - ui/src/components/workbench/HarnessPage.events.test.tsx::reloads the Harness view from the signal alone
      - ui/src/components/workbench/HarnessPage.definitionsStream.test.tsx::refetches the Harness view from the named signal alone
      - ui/src/components/workbench/HarnessPage.definitionsStream.test.tsx::keeps waking on runs.updated and stops when the page unmounts

  - id: PERMISSIONS-017
    name: Broader notification visibility preserves subject identity
    status: covered
    kind: authorization
    layer: scenario
    test: tests/scenarios/permissions/test_member_instance_operations.py::test_permissions_017_notifications_keep_recipient_identity
    given: Two signed users hold separate push subscriptions
    when: Member reads badges and delayed recipients are authorized
    then: Member sees instance records without rewriting or combining subscription keys

  - id: PERMISSIONS-018
    name: RemoteAccess pairing controls reflect true Owner identity
    status: covered
    kind: authorization
    layer: scenario
    test: ui/src/components/RemoteAccess.test.tsx::PERMISSIONS-018 keeps Member transport usable while pairing is disabled
    given: The existing component renders with actual Member or Owner capability providers
    when: Paired and unpaired users interact with pairing and transport controls
    then: Member cannot submit pairing but can operate transport while Owner pairing remains usable

  - id: PERMISSIONS-019
    name: Instance operational diagnostics admit Member and preserve query safety
    status: covered
    kind: authorization
    layer: scenario
    test: tests/test_skill_observability.py::test_manager_sql_access_including_cte
    given: Test-owned Skill statistics and raw observations exist
    when: All roles query statistics and managers use the diagnostics CLI
    then: Member and Owner can inspect and clear statistics while lower-role denial read-only SQL and raw-secret denial remain

  - id: PERMISSIONS-020
    name: Running an Agent is independent of managing its definition
    status: covered
    kind: authorization
    layer: scenario
    test: ui/src/components/workbench/AgentsPage.test.tsx::lets an editor launch a session from an Agent whose definition stays locked
    given: The Agents page renders under the capabilities the server projects for each role
    when: Each role opens the launcher and follows a Run through to the API call
    then: An Editor launches a session while its definition stays locked and a Viewer is offered no Run at all

  - id: PERMISSIONS-021
    name: Dock pinning follows page use rather than instance management
    status: covered
    kind: authorization
    layer: scenario
    test: ui/src/components/workbench/ShowPageShareControl.test.tsx::pins a page for a user who may use it but may not manage the instance
    given: A Show page is rendered for roles above and below the editor-tier pins route
    when: Each role pins and unpins the page from the share control
    then: An Editor pins and unpins with a persisted readback while roles that cannot reach the route are offered no control

  - id: PERMISSIONS-022
    name: Shared background-work banner preference stays member-tier on an editor surface
    status: covered
    kind: authorization
    layer: scenario
    test: ui/src/components/workbench/HarnessPage.banner.test.tsx::leaves the switch read-only for an editor and attempts no write
    given: The Harness page is an editor surface whose banner switch writes one shared instance preference
    when: An Editor toggles the switch and a Member is downgraded mid-render
    then: The switch reads as read-only below member and attempts no write instead of flipping and reverting

  - id: PERMISSIONS-023
    name: Reservation and fork preflight follow the caller's own authority
    status: covered
    kind: authorization
    layer: scenario
    # Every case named for this row.
    test:
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_editor_reserves_only_a_project_and_agent_it_may_use
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_reservation_requires_agent_selection_authority
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_unauthorized_callers_never_reserve
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_standalone_reservation_keeps_runtime_management_boundary
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_local_callers_keep_owner_reservation_semantics
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_fork_of_a_permitted_source_and_agent_succeeds
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_fork_inherited_agent_needs_selection_authority
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_fork_override_agent_needs_selection_authority
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_fork_checks_source_and_destination_independently
      - tests/scenarios/permissions/test_editor_reservation_and_fork.py::test_permissions_023_fork_preserves_existing_source_answers
    given: An Editor holds Project and Agent selection authority for only part of the instance
    when: The caller reserves a Session and forks an existing one with inherited or overridden Agents
    then: Source and destination are checked independently, unauthorized callers never reserve, and local callers keep Owner semantics

  - id: PERMISSIONS-024
    name: A deferred Vault request keeps the authority that created it
    status: covered
    kind: authorization
    layer: scenario
    # Every case named for this row.
    test:
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_a_vault_request_records_the_authority_that_made_it
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_a_caller_cannot_forge_the_recorded_authority
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_outward_request_views_hide_the_recorded_authority
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_auto_resume_runs_under_the_requesting_caller
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_a_local_requests_auto_resume_stays_local
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_a_request_cannot_name_a_session_its_caller_cannot_resume
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_a_reachable_target_still_records_the_request
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_024_a_request_that_names_no_session_is_unchanged
    given: A remote caller opens a Vault access request that is decided long after the call returns
    when: The request is read back, audited, and auto-resumed by the scheduled callback
    then: The row keeps the trusted snapshot for the resumed turn, every outward view and the audit trail hide it, and a local caller's row is byte-for-byte unchanged

  - id: PERMISSIONS-025
    name: Project email ACLs compare the principal the request actually carried
    status: covered
    kind: authorization
    layer: unit
    test: tests/test_resource_access_service.py::test_deferred_snapshot_carries_the_signed_email_and_ignores_supplied_metadata
    given: A deferred record carries a signed resource-user snapshot and a caller supplies its own
    when: The binding role is matched against Project email ACLs
    then: The normalized signed email decides the match, caller-supplied metadata is dropped, and an unstamped principal stays absent rather than inferred

  - id: PERMISSIONS-026
    name: An ordinary CLI command runs under the caller that invoked it
    status: covered
    kind: authorization
    layer: scenario
    # Every case named for this row.
    test:
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_every_cli_command_declares_a_role_floor
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_authority_comes_from_the_caller_env
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_declared_remote_caller_without_provenance_fails_closed
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_personal_pairing_admits_a_snapshot_without_organization_claims
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_unbound_background_editor_cannot_become_local_owner
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_snapshot_from_another_pairing_is_anonymous_remote
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_stale_snapshot_is_refused_and_writes_nothing
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_stale_snapshot_cannot_reach_a_command_that_forwards_it
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_each_namespace_admits_at_its_own_floor
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_refused_command_leaves_the_record_it_would_have_written
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_an_existing_resource_guard_now_sees_the_invocation_caller
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_an_explicit_context_still_outranks_the_invocation
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_authority_lasts_exactly_one_invocation
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_below_floor_command_is_refused_while_a_remote_owner_is_not
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_internal_activation_entry_points_stay_owner_work
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_guided_remote_setup_refuses_before_a_pairing_key_is_solicited
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_an_admitted_restart_hands_the_supervisor_no_caller
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_deferred_activation_runs_as_the_installation
      - tests/scenarios/permissions/test_cli_invocation_authority.py::test_permissions_026_a_runtime_owned_process_starts_without_the_caller
    given: The host injects a remote caller's signed snapshot into the Agent subprocess environment
    when: The real CLI entry point dispatches commands across every parser leaf and caller role
    then: Every command declares a role floor, below-floor commands are refused before any effect, unusable provenance fails closed as anonymous remote, and the authority lasts exactly one invocation

  - id: PERMISSIONS-027
    name: A dispatching Show event records the author who started the turn
    status: covered
    kind: authorization
    layer: scenario
    # Every case named for this row, and the share route's visitor case.
    test:
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_a_dispatching_show_event_records_its_author
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_a_non_dispatching_event_hides_the_author_from_the_transcript
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_the_cli_reserves_a_dispatching_event_under_its_own_caller
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_the_cli_reserves_nothing_for_an_event_that_starts_no_turn
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_an_admitted_reservation_is_still_admitted_at_execution
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_revoking_access_after_the_reservation_stops_the_turn
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_an_unreachable_session_is_refused_before_the_reservation
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_local_and_management_callers_keep_the_same_targets
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_the_cli_fails_the_command_when_its_reservation_is_refused
      - tests/scenarios/permissions/test_deferred_authority_provenance.py::test_permissions_027_an_offline_cli_dispatch_still_runs_as_its_caller
      - tests/test_ui_show_pages.py::test_public_show_page_dispatch_records_the_visitor_that_admitted_it
    given: A Show annotation or intent starts an Agent turn through a delivery reservation rather than the message that woke the daemon
    when: Remote and local authors append dispatching and non-dispatching events, including the CLI reservation replayed by the live UI post and a share visitor posting to /p
    then: The reserved delivery carries the author's snapshot for the resumed turn, the event echo and transcript stream hide it, the CLI caller's authority survives the replay, and the share route resolves its visitor once so admission, display author and recorded authority cannot describe different people
    related_tests:
      - tests/test_ui_show_pages.py::test_public_show_page_dispatch_fails_closed_without_a_resolved_visitor

  - id: PERMISSIONS-028
    name: Deferred work admits its effective target before the row is written
    status: covered
    kind: authorization
    layer: scenario
    # Every case named for this row.
    test:
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_the_open_project_binds_the_signed_editor
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_every_producer_refuses_an_unreachable_target
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_the_callers_own_session_is_an_effective_target
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_callback_is_admitted_before_the_run_is_reserved
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_forbidden_project_target_is_refused
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_an_unusable_agent_refuses_the_turn
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_permitted_editor_still_queues_the_turn
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_runtime_management_and_local_callers_are_unchanged
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_an_update_reauthorizes_its_effective_target
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_an_inherited_update_target_is_checked_too
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_permitted_destination_still_takes_the_work
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_per_run_work_with_no_scope_is_a_stream_of_standalone_sessions
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_replacement_target_is_the_one_that_is_admitted
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_replacement_cannot_land_where_the_caller_cannot_chat
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_per_run_work_admits_the_agent_every_fire_will_use
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_an_admitted_per_run_target_keeps_the_agent_it_resolved
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_bound_session_still_keeps_the_agents_authority
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_a_reserved_replacement_still_follows_the_session_it_makes
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_clearing_the_agent_on_per_run_work_resolves_one
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_the_callers_that_could_still_retarget_per_run_work
      - tests/scenarios/permissions/test_effective_target_preflight.py::test_permissions_028_saved_control_keeps_the_definitions_own_authority
    given: A signed caller names a Session it may not drive, by Session id or by defaulting to its own, or repoints a stored definition at a destination it may or may not use
    when: A Run, a callback route, and a Task or Watch definition are produced or retargeted through the real CLI
    then: Each producer refuses before writing, leaving Run definition Session and Scope counts and the stored row unchanged, an edit that replaces its Session is judged on the destination it chooses rather than the one it abandons, work that becomes per-run admits the Agent each future fire will select with its follow-the-Session marker read from the edit's final policy, and permitted Editors Member Owner and local callers keep the reach they had while saved automation control keeps the definition's own authority