Skip to content

[DJ Semantic Fingerprint 4] Bulk endpoint for viewing fingerprints + testing fixtures - #2490

Open
philipfweiss wants to merge 2 commits into
semantic-fingerprints-deployment-impact-apifrom
semantic-fingerprint-namespace-snapshots
Open

[DJ Semantic Fingerprint 4] Bulk endpoint for viewing fingerprints + testing fixtures#2490
philipfweiss wants to merge 2 commits into
semantic-fingerprints-deployment-impact-apifrom
semantic-fingerprint-namespace-snapshots

Conversation

@philipfweiss

@philipfweiss philipfweiss commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fingerprints currently surface only while previewing a deployment, so metadata-file consumers cannot bootstrap a complete file or reconcile committed state after a failed or out-of-band change. A namespace snapshot endpoint makes committed hashes available from the same server-owned evaluator.

Depends on #2483.

This PR:

  • adds GET /namespaces/{namespace}/semantic-fingerprints for a namespace and its descendants
  • returns each node's name, type, sorted owners, and current versioned fingerprint
  • represents uncomputable nodes and their dependents with the unknown sentinel
  • rejects unsupported fingerprint versions
  • adds a Git-backed lunch fixture that locks version 1 rows and checks impact predictions against post-deployment snapshots

The endpoint is additive and does not change existing namespace or deployment responses.

Lunch snapshot example

Changing the kitchen's grill table changes the burger and taco paths, including the taco-truck subnamespace. The independent milkshake path remains stable.

flowchart LR
    G["grill_orders<br/>source hash changes"]
    B["burger_orders"]
    BM["burger_count"]
    P["picnic_basket"]
    T["taco_truck.taco_orders"]
    TM["taco_truck.taco_count"]
    S["milkshake_orders<br/>unchanged"]
    SM["milkshake_count<br/>unchanged"]

    G --> B --> BM --> P
    G --> T --> TM
    S --> SM

    classDef changed fill:#fff1d6,stroke:#c2410c,color:#431407
    classDef stable fill:#ecfdf5,stroke:#059669,color:#064e3b
    class G,B,BM,P,T,TM changed
    class S,SM stable
Loading

A snapshot of lunch returns all eight sorted rows. The six changed fingerprints predicted by /deployments/impact match the committed snapshot after deployment, while both milkshake rows retain their prior hashes.


Verification:

  1. Built and started this branch in a fresh Docker slot:
printf '2\n' > .dev-port
./dev.sh up -d
curl http://localhost:8200/health/

Observed:

[{"name":"database","status":"ok"}]
  1. Logged in as dj, deployed fingerprint_food.kitchen and fingerprint_food.taco_truck, and configured the root and child namespaces as Git-backed. The kitchen contained the burger and milkshake paths shown above. The taco transform read from fingerprint_food.kitchen.grill_orders.
POST /basic/login/                                           -> 200
POST /deployments (fingerprint_food.kitchen)                 -> 200, success
POST /deployments (fingerprint_food.taco_truck)              -> 200, success
PATCH /namespaces/fingerprint_food/git                       -> 200
PATCH /namespaces/fingerprint_food.kitchen/git               -> 200
PATCH /namespaces/fingerprint_food.taco_truck/git            -> 200
GET /namespaces/fingerprint_food/semantic-fingerprints?version=1 -> 200

The response had namespace=fingerprint_food, version=1, and eight name-sorted nodes with sorted owners. One generated metadata row was:

source::fingerprint_food.kitchen.grill_orders::fa4e66f1924973b8cca8aeb59752e2fe90066bdfc45894d9a31cac5c7b0c4d2c
  1. Changed only the grill source table to grill_orders_v2, previewed impact, deployed it, and fetched the committed root snapshot again.
POST /deployments/impact                                     -> 200
POST /deployments                                            -> 200, success
GET /namespaces/fingerprint_food/semantic-fingerprints?version=1 -> 200

Observed:

{
  "changed": [
    "fingerprint_food.kitchen.burger_count",
    "fingerprint_food.kitchen.burger_orders",
    "fingerprint_food.kitchen.grill_orders",
    "fingerprint_food.kitchen.picnic_basket",
    "fingerprint_food.taco_truck.taco_count",
    "fingerprint_food.taco_truck.taco_orders"
  ],
  "impact_matches_committed_snapshot": true,
  "stable": [
    "fingerprint_food.kitchen.milkshake_orders",
    "fingerprint_food.kitchen.milkshake_count"
  ]
}
  1. Exercised version and access failures:
GET .../semantic-fingerprints?version=2 without a supported version -> 422
GET .../semantic-fingerprints?version=1 without login               -> 403

The version error body contained Unsupported semantic fingerprint version: 2.

  1. Deployed a valid fingerprint_food.mystery chain, then changed the persisted current SQL for mystery_meat to SELECT ( in Postgres to represent a legacy invalid node. The snapshot remained available and propagated the sentinel:
{
  "status": 200,
  "mystery_meat": "unknown",
  "customer": "unknown"
}

Semantic fingerprint stack

This is PR 4 of 4:

  1. #2482: Add semantic node fingerprints
  2. #2488: Evaluate fingerprints across deployment graphs
  3. #2483: Add semantic fingerprints to deployment impact
  4. #2490: Bulk endpoint for viewing fingerprints and testing fixtures (this PR)

@philipfweiss philipfweiss changed the title [DJ Semantic Fingerprint 4] Add namespace fingerprint snapshots [DJ Semantic Fingerprint 4] Bulk endpoint for viewing fingerprints + testing fixtures Sep 2, 2026
@philipfweiss
philipfweiss marked this pull request as ready for review September 2, 2026 00:34
@philipfweiss
philipfweiss force-pushed the semantic-fingerprints-deployment-impact-api branch from 1c628be to d914195 Compare September 2, 2026 01:53
@philipfweiss
philipfweiss force-pushed the semantic-fingerprint-namespace-snapshots branch from b2407e9 to 113b682 Compare September 2, 2026 01:53
@philipfweiss
philipfweiss force-pushed the semantic-fingerprints-deployment-impact-api branch from d914195 to 63bf44c Compare September 2, 2026 19:50
@philipfweiss
philipfweiss force-pushed the semantic-fingerprint-namespace-snapshots branch from 113b682 to 2fde045 Compare September 2, 2026 19:54
@philipfweiss
philipfweiss force-pushed the semantic-fingerprints-deployment-impact-api branch from 63bf44c to 638e8b5 Compare September 3, 2026 01:29
@philipfweiss
philipfweiss force-pushed the semantic-fingerprint-namespace-snapshots branch from 2fde045 to 3f838b2 Compare September 3, 2026 01:30
@philipfweiss
philipfweiss force-pushed the semantic-fingerprints-deployment-impact-api branch from 638e8b5 to 84419d8 Compare September 3, 2026 19:27
@philipfweiss
philipfweiss force-pushed the semantic-fingerprint-namespace-snapshots branch from 3f838b2 to 765254e Compare September 3, 2026 19:27
@philipfweiss
philipfweiss force-pushed the semantic-fingerprints-deployment-impact-api branch from 84419d8 to 1d4520e Compare September 3, 2026 21:34
@philipfweiss
philipfweiss force-pushed the semantic-fingerprint-namespace-snapshots branch from 765254e to 43afda8 Compare September 3, 2026 21:34
@philipfweiss
philipfweiss force-pushed the semantic-fingerprints-deployment-impact-api branch from 1d4520e to 52d4f75 Compare September 4, 2026 20:21
@philipfweiss
philipfweiss force-pushed the semantic-fingerprint-namespace-snapshots branch from 43afda8 to da51e15 Compare September 4, 2026 20:21
Philip Weiss added 2 commits September 4, 2026 14:19
Expose committed namespace-tree hashes so metadata files can bootstrap and reconcile outside deployment previews.
The namespace endpoint now evaluates one current graph and selects its requested rows from the memoized result.
@philipfweiss
philipfweiss force-pushed the semantic-fingerprint-namespace-snapshots branch from da51e15 to 72dff13 Compare September 4, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant