Skip to content

feat(azure): property-level drift holds on floci-az — clean apply quiet, an out-of-band NSG rule surfaces (#1213) - #1588

Merged
lex00 merged 1 commit into
mainfrom
feat/1213-azure-property-drift
Aug 7, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/1213-azure-property-drift

Conversation

@lex00

@lex00 lex00 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closes #1213 (D·azure, epic #1200).

The acceptance run for the #1202 drift seam on Azure, against floci-az as the epic's harness. Running it flushed out four normalization gaps; each is fixed here with unit coverage, and the run itself is committed as test/azure-drift-e2e.sh (just azure-drift-e2e, on-demand, Docker only).

What the run proves

  1. A clean apply is quiet. No property drift from ARM's echo of a declared NSG rule (self-id, nested provisioningState, defaultSecurityRules), chant's own ownership tags, or declared [resourceId(...)] expressions.
  2. A hand-edited NSG rule surfaces, named. An out-of-band allow-ssh-from-anywhere rule reports path by path, addressed by its own rule name:
    PROPERTY DRIFT (declared vs live; baseline shown where one exists):
      - nsg (Microsoft.Network/networkSecurityGroups)
          securityRules[#allow-ssh].properties.destinationPortRange: <undeclared> → 22
          securityRules[#allow-ssh].properties.sourceAddressPrefix: <undeclared> → 0.0.0.0/0
          ...
    
  3. RG-delete-does-not-cascade (floci-az). Deleting the resource group out of band leaves orphans listable; azure observes per-resource, so the estate keeps reporting the same drift instead of a false "everything vanished".
  4. In-memory state (floci-az). An emulator restart wipes the estate; every resource reads entity-level MISSING and the property axis stays silent — absence is not property noise.

The fixes the run forced

  • unresolved hook on the deep-normalization seam (core, additive): a declared ARM bracket-expression string ("[resourceId(...)]") is an unevaluated reference the applier resolves at deploy time. It now collapses to UNRESOLVED — which the diff already skips — instead of diffing a formula against its evaluated value. Azure is the motivating lexicon: its references are plain JSON strings the pass cannot recognize as intrinsics.
  • Ownership tags are not drift — the azure edition of fix(aws): chant's own ownership marker is not drift (#1207) #1301. chant-stack/chant-env subtract where undeclared; the managed-by pair (chant-managed-by + legacy managed-by) only when carrying the chant value, so managed-by: terraform appearing out of band still surfaces.
  • ARM's nested-child envelope subtracts: element self-ids (securityRules[].id) where undeclared, and nested etags wherever ARM stamps them. A declared element id (a storage account's virtualNetworkRules[].id) keeps its counterpart and is still compared.
  • Child-resource identity and placement: a subnet declared vnet/subnet folds ARM's leaf name back to the declared spelling (the URL that answered 200 is the declared name), and a live location nobody declared is effective placement, not drift.

Also records the floci-az modeled storage-account provider gap (drops tags and unknown properties, flips supportsHttpsTrafficOnly) as test/floci-gaps.md entry 7 for the one-pass upstream filing — it is why the acceptance estate is the canonical example's VnetDefault networking rather than including a storage account.

Gates

  • just build, just lint, just test (11.7k tests), npm run build -w @intentius/chant-lexicon-azure — green
  • just azure-drift-e2e — PASS end to end on floci/floci-az:0.10.0

…et, an out-of-band NSG rule surfaces (#1213)

The D-azure acceptance run, and the four normalization gaps it flushed out:

- an unresolved hook joins the deep-normalization seam: a declared ARM
  bracket-expression string ([resourceId(...)]) collapses to UNRESOLVED
  instead of diffing a formula against its evaluated live value
- chant's own ownership tags (chant-stack/chant-env unconditionally,
  the managed-by pair gated on the "chant" value) are not drift —
  the azure edition of the #1301 correction
- ARM's self-id on nested child elements (securityRules[].id) and nested
  etags subtract; a declared element id keeps its counterpart and is
  still compared
- a child resource's leaf name folds back to the declared vnet/subnet
  spelling, and a live location nobody declared is placement, not drift

test/azure-drift-e2e.sh (just azure-drift-e2e) proves all four claims
against floci-az: a clean apply is quiet, a hand-edited NSG rule surfaces
path by path, the RG-delete-does-not-cascade orphan estate stays observed
per-resource, and an emulator restart (in-memory state) reads as
entity-level MISSING with the property axis silent. The floci-az modeled
storage-account provider does not persist what was PUT; recorded in
test/floci-gaps.md for the upstream filing pass.
@lex00
lex00 merged commit 65c1bde into main Aug 7, 2026
6 checks passed
@lex00
lex00 deleted the feat/1213-azure-property-drift branch August 7, 2026 23:16
@lex00 lex00 mentioned this pull request Aug 7, 2026
2 tasks
@lex00
lex00 restored the feat/1213-azure-property-drift branch August 21, 2026 18:01
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.

feat(azure): property-level drift

1 participant