Skip to content

design: a Terraform carve lens — chant carve advise as a scored overlay, TF as an estate member #230

Description

@lex00

Design issue — thinking this through now, while behold is aws/k8s only, so the UI shape is agreed before anyone needs it.

chant ships a full Terraform carve surface: carve advise (read-only peelability scoring over .tf/.tfstate: inbound/outbound boundary edges, tier map, 0-100 bands), carve emit (adopt into typed chant source at observe), carve bridge (patch the surviving TF), carve apply (graduate ownership). The advisor's whole output is a graph with scores — which is behold's native medium, and today it only exists as CLI text.

What a carve lens could be:

  1. The advisor as an overlay. Point behold at a Terraform dir (a new project flavor next to chant projects: .behold.json gains a terraform member or behold serve --tf <dir>), render the TF resource graph, color by band (carve-now green / boundary-work yellow / leave grey — deliberately rhyming with the drift palette), and draw the inbound/outbound boundary edges the score is made of. Clicking a resource shows the score arithmetic — the CLI already emits per-resource JSON (--json), so the server shells chant carve advise --json exactly like it shells chant graph.
  2. The strangler-fig picture over time. A mixed estate (part chant, part TF) is behold's sweet spot: the estate view gains a TF member whose carved-out pieces literally move from the TF boundary box into the chant project's box as they graduate. The estate compose already handles multi-project IRs; a TF member is one more IR producer.
  3. Delegated carve actions, later. carve emit/bridge as gated Ops (the same delegated-write contract as ApplyOp) — behold never writes TF itself. This half stays deferred until the advisor lens earns use; chant#197's own gate ("everything past the advisor is design exploration until a real user pulls it") applies to the UI too.

Why now: the advisor JSON is stable and read-only, the estate machinery (#188/#189) is fresh, and deciding "TF renders as an estate member with a band overlay" costs a design decision today versus a refactor later. Why not yet: no user has pulled it, chant#998's hardening epic is still open, and behold has no TF fixture. Recommendation: build nothing until the icons/render-coverage lanes land; revisit when a real mixed estate shows up.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions