Skip to content

M1: the choudoufu probe accepts the estate.chdf.hcl sidecar (#386) #387

Description

@lex00

Child of #386, M1.

What does not work

src/choudoufu-member.ts's hasLiveBlock is the choudoufu member's probe (choudoufuSpec.probe, src/choudoufu-live.ts): a regex ^\s*live\s*\{ over the root's *.tf files. choudoufu's leading declaration is now the sidecar:

# estate.chdf.hcl
estate = "prod-networking"

record_store "ssm" {
  key_prefix = "tofu-records/prod-networking"
}

(choudoufu site/content/docs/use/reference.md, "Two places to write it, one dialect"; the live block inside terraform {} remains supported, both at once is an error.) Every tools/estate-gen cohort and every migrated terralith uses the sidecar. Rendered the s3 cohort and ran behold doctor on it: "no chant.config.ts here, and no estate members declared". memberKindOf returns undefined for it.

What to build

  • The probe accepts either form: estate.chdf.hcl present in the directory, or a root *.tf with a live { block. Rename to what it now means (isChoudoufuEstate or similar); update the call sites that import hasLiveBlock (src/choudoufu-live.ts, src/server.ts) and the expects text: "an estate.chdf.hcl sidecar or a live { estate = … } block in a root *.tf file".
  • The doctor line and AGENTS.md's "Adding a member kind" example (a regex over a root file) and the choudoufu member's own doc comments say sidecar first.
  • No -estate flag anywhere: choudoufu reads the sidecar itself, and -estate beside a declaration is refused (src/choudoufu-live.ts header).

Definition of done

  • src/project.test.ts (the probe and the object form) and src/choudoufu-member.test.ts cover: sidecar only, live block only, both absent, a .tf mentioning live { in a comment is NOT a false positive only if it already was not (keep the current regex behaviour, do not widen it).
  • behold doctor on a directory holding only estate.chdf.hcl and *.tf reports the choudoufu member, not "no chant.config.ts".
  • just check green.

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

    choudoufuthe choudoufu estate member lane (#366)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions