Skip to content

refactor: name feature tables and /data segments after the Feature model, not the producing hook #214

Description

@rorybyrne

Summary

Feature tables — and therefore the public /data/{schema}/{feature} URL segments and features.<name>.<column> filter paths — are named after the producing hook, not the Feature model the hook emits. Switch to the Feature model's name: the feature is the dataset; the hook is merely its current producer, already recorded per-row via run_id → hook_run → hook_release provenance (#145).

Why

Design

  • FeatureTable derivation (domain/feature/model/feature.py, api_naming.feature_pg_table) keys on the Feature model name; hook name remains in hooks / hook_runs only.
  • Uniqueness rule: one Feature name per schema; two hooks may not both claim the same feature (deploy-time 422). This is the natural collision rule once the name is the dataset's.
  • Reserved-name checks (records, datasets) apply to Feature names (already enforced for hook names — move the check).
  • Touches: feature_tables catalog, dynamic DDL, manifest table_resources, /data/{schema}/{feature} routing, filter compilation (features.<name>.<col>), SKILL/reference rendering, template docs.
  • Migration: pre-1.0, breaking API change is acceptable; existing deployments need a table+catalog rename migration (ALTER TABLE ... RENAME). Coordinate with fix: feature-table reads are not row-scoped to the requesting schema #140 (row-scoping of shared feature tables) and fix: hook re-registration silently adopts an existing feature table, even with a mismatched column shape #141 (re-registration shape adoption) — if those land a per-schema table split, do the rename in the same migration rather than twice.

Acceptance

  • just test green; deploy of a hook returning list[Pocket] yields /data/{schema}/pocket[.csv] and features.pocket.score filter paths
  • Deploying two hooks claiming the same feature name on one schema → 422 naming the collision
  • README + generated docs show model-name examples that validate against the live manifest (closes the doc half of fix: feature-table naming documented wrong, and Example queries are never validated #203 in the correct direction)

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactorInternal restructuring, no behavior change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions