-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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:
- Compare the new hook's
feature_schemacolumns against the existing table schema - If incompatible (different column types, missing required columns), reject the convention registration with a clear error message
- If compatible (subset or identical), allow it
Not in scope
- Renaming hooks per-convention (hooks are intentionally shared)
- Schema migration for existing feature tables