Skip to content

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

@heskew

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions