Skip to content

prompt request: warn on stored data model changes #225

@osolmaz

Description

@osolmaz

Motivation

ClawSweeper already has a related guard for config-surface additions in #171. Stored data model changes need the same kind of review visibility.

When a PR changes data stored in SQLite, Postgres, Durable Objects, vector stores, cache databases, migration files, or other persistent schemas, the change may be mechanically correct but still carry upgrade and compatibility risk. Examples include adding or removing columns, changing primary keys or uniqueness, changing serialized JSON shape, changing stored embedding/chunk identity, adding indexes that imply new query semantics, or changing migrations/doctor repair behavior.

These are product and operations decisions, not just code edits. ClawSweeper should make that risk explicit so maintainers can decide whether the migration and compatibility story is acceptable before automerge.

Request

Make ClawSweeper warn when a PR changes a stored data model for SQL or other persistent databases.

This should be both prompt-level and deterministic:

  • Prompt-level: update review instructions so stored data model changes are treated as compatibility/upgrade-sensitive and included in review risk analysis.
  • Deterministic guard: inspect PR files/patches for likely persistent schema changes and surface a data-model-change warning when detected.
  • Persist the result in durable report frontmatter, for example data_model_change: true and, if practical, data_model_surfaces: [...].
  • Include the warning in the public review comment when relevant, with enough detail for a maintainer to see what changed.
  • For automerge/repair-loop pass reports, prevent a silent normal pass when the change is material and lacks migration/upgrade proof.

Suggested OpenClaw surfaces to cover:

  • SQL schema strings and migrations, including CREATE TABLE, ALTER TABLE, DROP TABLE, CREATE INDEX, and ON CONFLICT behavior changes.
  • Database helper modules and schema installers.
  • Persistent cache schemas.
  • Durable Object or other hosted storage schemas.
  • Serialized JSON state written to disk or database rows.
  • Vector/embedding store schemas and metadata used to decide query compatibility.
  • Doctor/migration/repair code that changes or backfills persisted state.
  • Docs that add or change a documented persisted schema or migration contract.

Desired review behavior

ClawSweeper should not automatically treat every detected data model change as a defect. The expected behavior is a warning/risk marker that asks for explicit evidence:

  • What persisted shape changed?
  • Is this new, shipped, or unreleased data?
  • Does existing user data migrate automatically?
  • Is there a doctor/fix path when automatic migration is not safe?
  • Are old rows ignored, backfilled, deleted, or still queryable?
  • Does search/query behavior change because rows are now filtered differently?
  • Are tests covering both fresh databases and upgraded existing databases?

If the PR includes clear migration and regression proof, the warning can be informational. If the PR changes shipped user data without migration or compatibility proof, ClawSweeper should route it to maintainer review instead of a normal automerge pass.

Acceptance Criteria

  • A PR adding/removing/changing a SQL table column triggers a data-model-change warning.
  • A PR changing a stored JSON state shape triggers a data-model-change warning.
  • A PR changing vector/embedding row identity or query compatibility metadata triggers a data-model-change warning.
  • The durable report records data_model_change: true and identifies the likely surfaces.
  • Public review comments summarize the data model change without overstating it as a bug.
  • Automerge remains possible when the PR has adequate migration/upgrade proof and maintainer policy allows it.
  • A material shipped-data change without migration/upgrade proof routes to clawsweeper-verdict:needs-human or the equivalent human-review path.
  • Pure query-only refactors and non-semantic documentation wording changes do not trigger the warning.
  • Tests cover SQL schema additions, stored JSON shape changes, vector/embedding schema metadata changes, and a negative case.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🌊 off-meta tidepoolIssue quality rating does not apply to this item.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions