Skip to content

fix: a replayed configuration takes back the name it invented - #121

Merged
ShocOne merged 2 commits into
mainfrom
fix/a-replayed-configuration-takes-back-the-name-it-invented
Aug 26, 2026
Merged

fix: a replayed configuration takes back the name it invented#121
ShocOne merged 2 commits into
mainfrom
fix/a-replayed-configuration-takes-back-the-name-it-invented

Conversation

@ShocOne

@ShocOne ShocOne commented Aug 26, 2026

Copy link
Copy Markdown
Member

What this changes

A recorded create carries the values the API accepted, and for most properties that is exactly what a configuration wants. A name is the exception: an API that requires one to be unique accepted the document's example once and refuses it for good afterwards, so the value that proves the shape is the one value a configuration cannot reuse.

FromAcceptedRequestBody now puts back the invented name of every name-bearing entry a declared example displaced. The invented name carries NamePrefix, which is what WithRunSuffix needs to make it unique per run and what the audit's cleanup contract matches a live object by.

Only name-bearing entries are restored; every other property keeps the value the API took. A field whose document declares a format has no invented name to put back — scalarFor keeps none — so a URL, an email or a uuid is never rewritten.

Why it was needed

suffixedEntries suffixes only strings starting with NamePrefix (tfpfgen-test-). A replayed body carries either a document example or an audit token beginning tfpfgen-<runid>-, so the run suffix fired on none of the replayed fixtures — all four emitted the random_string block and referenced it nowhere. Every run replayed the same constant name and the API refused it.

Measured

Against the ThousandEyes pilot, benchmark sh tf_acceptance_tests.sh:

entity before after
credential Create failed (HTTP 400) at step 1 create succeeds; now fails at destroy with Delete failed (HTTP 406)
dashboard Create failed (HTTP 400) at step 1 create succeeds; now fails on two unmodelled server defaults (default_timespan, layout)
connectors_generic name was the document example name is now per-run unique
tag passing still passing, fixture unchanged (it carries no name-bearing field)

The suite total is unchanged at 1 passed — both entities got past the wall this fixes and stopped at different ones behind it. Those two are tracked separately.

Also in this PR

The recorded artifact is renamed for the request bodies it holds: audit/request_bodies/<entity>.request_bodies.json, with the type, constants and accessors to match, and the loader's map of components.requestBodies. ListBodies keeps its name — those are responses. Recorded in docs/glossary.md.

Two lint findings the branch carried are cleared: an unused parameter on reduceMaximal, and a negated conjunction in the program-order test.

Verification

make check (90.7% total, all packages above the per-package gate) and golangci-lint run (0 issues). The pilot tree regenerates and postcheck passes.

🤖 Generated with Claude Code

ShocOne and others added 2 commits August 26, 2026 14:10
A recorded create carries the values the API accepted, and for most
properties that is exactly what a configuration wants. A name is the
exception: an API that requires one to be unique accepted the document's
example once and refuses it for good afterwards, so the value that proves
the shape is the one value a configuration cannot reuse.

The invented name carries NamePrefix, which is what WithRunSuffix needs to
make it unique per run and what the audit's cleanup contract matches a live
object by. Without it a replayed fixture emitted the random_string block and
referenced it nowhere.

Only name-bearing entries are restored; every other property keeps the value
the API took. A field whose document declares a format has no invented name
to put back, so a URL, an email or a uuid is never rewritten.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The artifact records the create request bodies an API accepted, and calling
it "bodies" left it ambiguous with the response bodies a mock answers with
and the collection responses the inference reads. Names it for the half a
configuration has to reproduce.

Renames the type, its constants and its accessors, the committed path
audit/request_bodies/<entity>.request_bodies.json, and the loader's map of
components.requestBodies. ListBodies keeps its name: those are responses.

Also clears two lint findings the branch carried: an unused parameter on
reduceMaximal and a negated conjunction in the program-order test.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ShocOne
ShocOne merged commit 8930085 into main Aug 26, 2026
2 checks passed
@ShocOne
ShocOne deleted the fix/a-replayed-configuration-takes-back-the-name-it-invented branch August 26, 2026 13:21
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.

1 participant