Repository navigation
feat(carve): carve emit — adopt a TF resource + report its boundary (#197) - #995
Merged
Merged
Conversation
…197) First strangler-fig emit step. `chant carve emit --from <tf-dir> --select <address> --env <env>` classifies the boundary a carve would cut, adopts the live resource into typed chant source via the existing cloud→code live-import path, and writes a boundary report. Lands the resource at the observe position: emitted, reversible, nothing patched or applied. - terraform/carve.ts: pure boundary analysis (carve set + folded sub-resources, inbound edges → data-source patch, outbound → deferred deploy-time input). - graph identity extraction + tier-map IDENTITY_ATTR: derive the physical name for the live-import selector from the HCL. - carve emit command: refuses types with no native mapping; live import is injected so tests run with no cloud calls. PR A of 3 for the boundary-bridging carve (#197). Next: carve bridge (patch the surviving Terraform) and apply graduation.
This was referenced Jul 22, 2026
lex00
added a commit
that referenced
this pull request
Jul 22, 2026
) Apply graduation, the dial-turn from observe to apply. `chant carve apply --from <tf-dir> --select <address> --env <env>` resolves the ownership marker that makes the carved resource chant-owned (reusing core ownershipEntries) and finalizes the ordered apply runbook. BYOL-honest: no cloud call. It computes the marker + plan; the apply is your lifecycle (native CLI / CI / ApplyOp), which stamps the marker the emitted source carries. --write saves the graduation doc. - terraform/graduate.ts: ownership marker + tags (chant:managed-by/stack/env, mirroring the AWS lexicon's tag channel) + reversible runbook. - carve apply command: dry-run plan by default; --write emits the doc. - docs: cli/carve-out.mdx documents the full emit → bridge → apply arc. - carve-arc.test.ts: end-to-end, one resource through all three steps. PR C of 3 — completes the boundary-bridging carve (#197). emit + bridge + apply now compose end to end (advisor #214 → emit #995 → bridge #996 → apply).
This was referenced Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First emit step of the strangler-fig carve (#197), building on the #214 advisor.
chant carve emit --from <tf-dir> --select <address> --env <env>classifies the boundary a carve would cut, adopts the live resource into typed chant source via the existing cloud→code live-import path, and writes a boundary report. Lands the resource at the observe position: emitted, reversible, nothing patched or applied.This is PR A of 3 for the full boundary-bridging carve. The boundary bridge (patching the surviving Terraform to data sources / deferred inputs) is the centerpiece and comes next in PR B; apply graduation is PR C.
What's here
terraform/carve.ts— pure boundary analysis: the carve set (selected node + folded sub-resources), inbound edges (→ data-source patch, required immediately) and outbound edges (→ deferred deploy-time input, at apply). Internal edges (a folded sub-resource pointing at its parent) are dropped.IDENTITY_ATTR— derive the resource's physical name from the HCL so the live-import selector targets the real cloud resource.carve emitcommand — refuses types with no native mapping (won't adopt what it can't map); the live-import call is injected, so all tests run with zero cloud calls.Notes
Verification
Part of #197.