Skip to content

feat: validate hook schema compatibility when shared across conventions #69

@rorybyrne

Description

@rorybyrne

Context

PR #66 code review identified that feature_tables hooks can be shared across conventions without schema-match validation. When two conventions register the same hook name, the feature table created for the first convention may have a schema incompatible with the second convention's hook output.

Current behavior

Hooks are shared across conventions by design — a single hook image can be referenced by multiple conventions. The feature_tables system creates one table per hook name (not per convention × hook). This works correctly when conventions use the same hook image with the same output schema.

Problem

There is no validation at convention registration time to ensure that when a second convention references an existing hook name, the feature schema matches the already-created table. If schemas differ, inserts will silently fail or produce incorrect data.

Proposed solution

When a convention is registered and references a hook name that already has a feature table:

  1. Compare the new hook's feature_schema columns against the existing table schema
  2. If incompatible (different column types, missing required columns), reject the convention registration with a clear error message
  3. If compatible (subset or identical), allow it

Not in scope

  • Renaming hooks per-convention (hooks are intentionally shared)
  • Schema migration for existing feature tables

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions