Skip to content

Check the Pulumi and drift adapters against real runs; their fixtures are hand-written #4475

Open

Description

@lex00

Follow-up from the multi-engine engine tier (#4450, INTENTIUS/choudoufu#2243, INTENTIUS/behold#993, INTENTIUS/plunge#2), now on main.

Every fixture for these adapters was written by hand from documented shapes; none was recorded from a run:

  • C3 (multi-engine C3: the pulumi lexicon #4453): pulumi preview --json (where unknowns, secrets and the stack's planned outputs sit) and pulumi refresh --preview-only --json (whether it prints update/delete or refresh ops; both are read today). Fixtures in lexicons/pulumi/src/testdata/pulumi-preview, pulumi-refresh and pulumi-urn-node.
  • C5 Pulumi half (multi-engine C5: engine outputs into chant parameters #4455): pulumi stack output --json --show-secrets=false printing a secret as [secret]; plunge accepting the same flags. Fixtures in testdata/pulumi-outputs and plunge-outputs.
  • C6 (multi-engine C6: Pulumi URN to graph node #4456): lexicons/pulumi testdata preview.json.
  • C1 (multi-engine C1: the drift record #4451): packages/core/src/fixtures/drift-record/*.
  • Path 2 added one more hand-written set: lexicons/pulumi/src/testdata/plunge-drift/*.ndjson, written to the layout plunge P-L5 prints for plunge drift --resource <urn> --stream (drift-record.test.ts:131).

Record each from a real run against the corpus in INTENTIUS/plunge (tests/plunge-corpus, emulators only) and replace the fixtures.

Acceptance

  • (maintainer run) pulumi preview --json and pulumi refresh --preview-only --json recorded against the plunge corpus replace the pulumi-preview, pulumi-refresh, pulumi-urn-node and C6 preview fixtures; the tests in change-set.test.ts, drift-record.test.ts and pulumi-urn-node.test.ts pass on them, and any shape they got wrong (unknowns, secrets, where stack outputs sit, refresh op names) is fixed in the adapter.
  • (maintainer run) pulumi stack output --json --show-secrets=false and the same under plunge are recorded into pulumi-outputs and plunge-outputs; member-outputs.test.ts passes on them, and how a secret prints is stated in the fixture notes.
  • (maintainer run) plunge drift --resource <urn> --stream output is recorded into plunge-drift.
  • (maintainer run) packages/core/src/__fixtures__/drift-record/* are re-recorded from the engines they stand for, and __fixtures__/drift-record/README.md says so.
  • Each replaced fixture directory names the tool, its version, the corpus commit and the date it was recorded, and the "hand-written ... not recorded from a real run" comments in change-set.ts:71, change-set.test.ts:6, drift-record.test.ts:5 and :131 and drift-read.test.ts:7 are updated.

Open questions

None.

Activity

  1. added
    epic:engine-ship
    on Oct 26, 2026
  2. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    Recorded at epic-ready and merged into integration/engine-ship as 9ae806b (unit commit 63f25cd, branch unit/es-chant-4475).

    Tools and inputs: stock pulumi v3.272.0 (darwin-arm64 release) and plunge v0.1.0-dev.0 (pulumi-compatible v3.272.0) built from INTENTIUS/plunge 30806be26b, running the plunge corpus's tests/plunge-corpus/aws-ts at that commit (pulumi-aws 7.51.1), stack floci, file backends only, on the pinned floci image (ghcr.io/lex00/floci@sha256:5ec92ae8...61ec). choudoufu v0.31.1-local.c4f468a235 (a build of choudoufu integration/engine-ship) for the live-plan stream. Out-of-band edits went through floci's own API. Date 2026-10-26. Each fixture directory has a README naming all of this.

    Replaced with recordings: pulumi-preview (plus preview-create.json), pulumi-urn-node, pulumi-refresh (per-target plus untargeted all.json), pulumi-outputs, plunge-outputs (now with plunge's own stack-output.json), plunge-drift (plus component-unsupported.ndjson), core's choudoufu-resource.ndjson (plus choudoufu-cone.ndjson). plunge-member's export is now a cut of the recorded plunge export. Tests that read them were rewritten to the recorded content and pass: lexicons/pulumi (14 files, 106 tests) and packages/core drift-record.test.ts.

    Shapes the hand-written fixtures got wrong, and the adapter changes:

    • pulumi preview --json lists no unchanged resource unless --show-sames is passed (only the stack's step). The export-held signal therefore marked every unchanged resource may-appear. pulumiPreviewArgs now passes --show-sames.
    • A replace is one replace step at preview, not three. The adapter already handled it.
    • The stack's step carries no outputs. pulumiPlannedStackOutputs reads newState.outputs only (a same step's oldState is the last deployment's, which a replaced VPC moves) and is undefined when absent; member-outputs then gives the export's outputs when the part plans nothing, and every output unknown when it plans a change.
    • Secrets in preview and refresh are the blinded "[secret]" string; the export holds the signature object. Both were already read.
    • refresh --preview-only prints refresh (both states) for an unchanged resource, update with detailedDiff for a drifted one, delete with no new state for one gone; a targeted refresh prints only the target, no stack or provider steps.
    • PULUMI_SKIP_CONFIRMATIONS=true makes the CLI refuse --preview-only ("--yes and --preview-only cannot be used together"). The pulumi and plunge runners now unset it (engineEnv in run.ts).
    • A diff key with no input on either side (an SSM parameter's version) produced an attribute with no values; it now reads the outputs (before 3, after unknown).
    • A refresh path only the inputs hold (tags floci never echoed into the outputs) produced bare paths; the drift adapter now falls back to the inputs.
    • Paths are Pulumi's property paths as printed (tags["corpus-owner"]), in both pulumi's and plunge's output.
    • plunge drift answers a component URN with not-observed/unsupported-kind, and a URN its stack lacks with exit 1 and no stream; settled-empty.ndjson is therefore derived (README says so). plunge's drift-start line carries no at.
    • choudoufu's live-plan stream: no resourceType, paths with no values, no at on start or settle, and a tagIndexCalls read.

    Left open (follow-ups):

    • packages/core/src/__fixtures__/drift-record/{live-diff,deep-diff,component-status}.json stay hand-written: recording them needs a chant AWS project deployed through CloudFormation on floci and read with chant lifecycle diff --live --json, its deep diff and chant components status --live --json. The README says so.
    • A resource registered inside an apply() directly under the stack, held by the export, whose input is unknown (the corpus's vpc-id) is printed by the preview as a delete and reads as a plain delete; nothing in the preview tells it from a removed resource. Documented in the adapter header and reference/change-set.mdx.
    • floci: overwriting a SecureString drops its tags, and tags set at PutParameter do not stick until a second write, so a fresh stack's preview shows a tag diff on SSM parameters. An emulator gap, not chant's.
  3. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    The fixtures were recorded at epic-ready from real runs (chant merge 9ae806b, on main e17daa8): stock pulumi v3.272.0, plunge 30806be26b and a choudoufu integration build, against the plunge corpus on choudoufu's pinned floci, 2026-10-26. pulumi-preview, pulumi-refresh, pulumi-urn-node, the C6 preview, pulumi-outputs, plunge-outputs and plunge-drift are replaced, each with a README naming tool, version, corpus commit, floci digest and date; the hand-written comments are updated (ticked). The adapter fixes this found (show-sames, planned outputs from newState only, PULUMI_SKIP_CONFIRMATIONS unset for refresh, computed outputs, refresh path fallback) are in the comment above, and the unit run on 9ae806b passed 29243, 0 failed on the recordings.

    I left the four "(maintainer run)" items unticked for the maintainer to confirm from those recordings. The fourth is only partly done: packages/core/src/fixtures/drift-record/live-diff.json, deep-diff.json and component-status.json are still hand-written, because recording them needs a chant AWS project deployed through CloudFormation on floci. To finish it: deploy a small chant aws project to floci, edit one resource out of band, then record chant lifecycle diff --live --json, its deep diff, and chant components status <env> --live --json into that directory and update its README.

  4. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    All five acceptance items are done; the goal for epic:engine-ship assigns these recordings to the orchestrator at epic-ready, so the "(maintainer run)" items were run here, on emulators only.

    Items 1 to 3 (pulumi-preview, pulumi-refresh, pulumi-urn-node, C6 preview, pulumi-outputs, plunge-outputs, plunge-drift) were recorded at 9ae806b from stock pulumi v3.272.0 and plunge 30806be26b against the plunge corpus on floci (comment above).

    Item 4, recorded now: packages/core/src/fixtures/drift-record/live-diff.json, deep-diff.json and component-status.json come from chant lifecycle diff recy --live --json and chant components status recy --live --json against a chant AWS project deployed with cfn-deploy on floci (ghcr.io/lex00/floci@sha256:5ec92ae8046445d62c0009590dd09f04560886e5a5ef31248cb3fcc09b2961ec), chant from integration/engine-ship 9ae806b run from source, 2026-10-26. The whole diff document (lifecycle-diff-live.json) and the ledger-only status (component-status-ledger.json) are kept beside them. The README gives the sequence (deploy, deep snapshot, a post-snapshot deploy, out-of-band edits through floci, an undeployed source change) and the commands.

    What the real output changed:

    • components status --json prints a bare array of rows, not { env, rows, malformedLedgerLines } (workspace drift already read it as an array; the test now does).
    • LiveDiffResult also carries queried and definitions; a redeploy since the snapshot shows as thin drift on lastUpdated/status/physicalId; an entity dropped from source while its stack holds it reads disappeared, since the stack carries no ownership marker.
    • floci's Cloud Control GetResource returns identity properties only, so most deep properties read absent; a source change after deploy gives a changed one.
    • Adapter fix: the deep read keys array elements as Tags[#key], and attributePathKeys did not read that as a key, so a tag named like a token (api-token-owner) kept its value in the drift record. It reads [#key] now and those paths redact (a test covers Environment[#DB_PASSWORD]).
    • Shapes floci cannot produce (a runtime child, an orphan, a thin attribute change, a failed deep read, a deep unchanged entity, a digest drift, missing credentials) stay as constructed inputs inside drift-record.test.ts, labelled, not as fixture files.

    Merged: unit 788caef, integration/engine-ship 991ca77, chant main 1b233ff (main tree equal to the tested tip). Tests on that tree: npx tsx scripts/typecheck.ts no regressions (26 baselined), npx vitest run --project unit 29255 passed, 0 failed. behold main b89d1690 against local chant tarballs of this tree (stamped 0.124.53): tsc clean, vitest 4723 passed.

  5. reopened this on Oct 26, 2026
  6. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    Audit correction (2026-10-26): reopening, and unticking the four "(maintainer run)" items. Round 1's goal assigned them to the orchestrator, against its own rule that maintainer-run items are the maintainer's. The maintainer ruled that the maintainer-run rule wins.

    The recordings stay as evidence: the fixture dirs with their READMEs, plus engine-wt/rec-4475. What's left is the maintainer's confirmation of each run.

  7. lex00 commented on Oct 26, 2026

    @lex00
    ContributorAuthor

    Ready for the maintainer (epic:engine-ship round 2, 2026-10-26).

    chant main is 9b8fa99 (the merge of integration/engine-ship, tree equal to the tested tip 280be4e; unit suite 29365 passed, 2 budget-only failures under load, no assertion failure). Push CI on main passed (chant run 40407754959), so step 1 of the cut is met for 9b8fa99.

    Left: the four (maintainer run) items, confirming each recording. The recordings from round 1 are the evidence: each fixture directory's README (lexicons/pulumi/src/testdata/{pulumi-preview,pulumi-refresh,pulumi-urn-node,pulumi-outputs,plunge-outputs,plunge-drift} and packages/core/src/fixtures/drift-record/README.md) names the tool, version, corpus commit (plunge 30806be26b), floci digest and date. engine-wt/rec-4475 holds the round-1 scratch tree. The tests on them passed again on 280be4e: change-set.test.ts (19), drift-read.test.ts (6), member-outputs.test.ts (12) and run.test.ts (14) in lexicons/pulumi.

    What to confirm, per item:

    1. pulumi preview --json --show-sames and pulumi refresh --preview-only --json against tests/plunge-corpus/aws-ts give what pulumi-preview, pulumi-refresh and pulumi-urn-node hold.
    2. pulumi stack output --json --show-secrets=false and the same under plunge give what pulumi-outputs and plunge-outputs hold, with a secret printed as "[secret]".
    3. plunge drift --resource <urn> --stream --stack floci --member site gives what plunge-drift holds.
    4. chant lifecycle diff <env> --live --json and chant components status <env> --live --json against a cfn-deploy project on floci give live-diff.json, deep-diff.json and component-status.json.

    Re-running any of them: use emulators only (choudoufu's pinned floci, ghcr.io/lex00/floci@sha256:5ec92ae8046445d62c0009590dd09f04560886e5a5ef31248cb3fcc09b2961ec), PULUMI_BACKEND_URL=file:// or a plunge+file:// backend, PULUMI_SKIP_UPDATE_CHECK=true, and fake keys. Every plunge step on a plunge+ backend must also set PLUNGE_CLOUDCONTROL_ENDPOINT=http://localhost:4566. Until plunge#27 is fixed, plunge otherwise sends its Cloud Control listing to real AWS even when every provider endpoint points at the emulator. Round 1's recording did that 52 times with fake keys, and they were refused. Unset PULUMI_SKIP_CONFIRMATIONS for refresh --preview-only, which pulumi refuses alongside it. lexicons/pulumi/src/testdata/pulumi-member/README.md (#4507) shows the full env for a plunge run on floci.

  8. lex00 commented on Oct 27, 2026

    @lex00
    ContributorAuthor

    Ready for the maintainer (consolidation-graph, 2026-10-27)

    chant main is now 47b8594 (tree equal to the tested tip b6281ef; full unit project green there, which includes change-set.test.ts, drift-read.test.ts, member-outputs.test.ts and run.test.ts in lexicons/pulumi on the round-1 recordings). plunge main is d6c0ccd0ae.

    Left: the four (maintainer run) items, confirming each recording against the plunge corpus on floci. A correction to the round-2 comment: since plunge#27 the corpus stack's aws:endpoints keep Cloud Control on the emulator, so PLUNGE_CLOUDCONTROL_ENDPOINT is no longer needed. Item 4 needs a cfn-deploy chant project on floci; the sequence is in packages/core/src/fixtures/drift-record/README.md. The changed-stack recordings are described in the fixture READMEs, not scripted, and fresh ids mean no byte-for-byte match.

    Commands: run sheet entry A7 in Run sheet: engine-wt/goals/consolidation-graph-1-runs.md.

  9. lex00 commented on Oct 28, 2026

    @lex00
    ContributorAuthor

    Related: #4640. The stream's omitempty on custom means a component's step state has no custom field, so change-set signal 1 never fires on stream input. When the recorded stream lands here, check a component step for custom.

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

    epic:engine-ship

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions