Skip to content

AI Issue: Guard filesystem-backed management operations against read-only mode #475

Description

@heskew

Follow-up from #450 (Read-only mode).

Problem

isReadOnlyMode() currently gates RocksDB writes plus analytics/audit writes, but management operations that mutate filesystem state outside the database are not guarded:

  • Component deploymentscomponents/operations.js (writes the components directory).
  • Config updatesconfig/configUtils.js (writes harperdb-config.yaml).
  • Roles/userssecurity/role.js, security/user.ts (system-level identity changes).

A read-only Harper instance can still accept these operations and partially mutate filesystem state, which is inconsistent with the "read-only" contract.

Proposed change

Add isReadOnlyMode() guards at each management entrypoint. Reject with a clear error (HTTP 405) before any filesystem write.

Benefit

Coherent read-only contract across the database and the surrounding application config/assets. Prevents partial state mutations on instances callers expect to be inert.


🤖 Identified by Gemini CLI during review of #450; relayed by Claude.

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

    Type

    Fields

    Priority

    P1

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions