Skip to content

Reset the Outpost project's Event Gateway side before every seed - #113

Merged
leggetter merged 2 commits into
mainfrom
reset-outpost-project-gateway
Nov 6, 2026
Merged

leggetter merged 2 commits into
mainfrom
reset-outpost-project-gateway

Conversation

@leggetter

Copy link
Copy Markdown
Collaborator

What this fixes

OUTPOST_API_KEY is an ordinary project API key, so it works on api.hookdeck.com and the Hookdeck CLI as well as the Outpost subdomain. Agents have used it to create Event Gateway resources inside the Outpost project, and FixedProjectSource never reset that side: it reset the gateway project, Outpost tenants, operator event destinations and managed config, and nothing else.

A source, two destinations, two connections and two issue triggers were left there on 24 and 25 August. In release matrix run 42044644850, outpost-005 on codex-gpt-5.4-mini-no-skills found the hookdeck -> hookdeck-acme connection, added a body $nin filter to it instead of changing the Outpost destination's topics, and attempts 2 and 3 of that cell started from the edit. codex-gpt-5.6-no-skills also found the connection in outpost-002.

All seven were deleted by hand on 6 November, after their full configurations were saved, so the project's gateway side is empty now. This change keeps it empty from now on.

What changed

  • FixedProjectSource deletes every Event Gateway resource in the project OUTPOST_API_KEY belongs to on every acquire(), for every scenario, not only Outpost ones, and again on release(). acquire() runs immediately before the seed, so a run that dies before release cannot leak into the next one, which in CI is a different job. Resources that existed before the run are deleted too.
  • So OUTPOST_API_KEY must belong to a dedicated Outpost project. README.md and .env.example now say so; both previously said the Outpost project was not reset and that Event Gateway scenarios do not touch it.
  • The baseline, OUTPOST_GATEWAY_PRISTINE, is declared empty rather than captured. An Outpost project is created without the gateway's default issue triggers (checked in the platform's project creation, not inferred from the API), and no Outpost seed creates gateway resources. A captured snapshot would not work in CI: every job is a fresh checkout, so it would be taken from whatever the last job left, and it would have recorded the August leftovers as pristine.
  • Guards: the reset is skipped when both keys are the same string. It is skipped with a warning when the Outpost key can see any resource id in the gateway project's snapshot, because that means both keys reach one project and an empty baseline would delete its default issue triggers.
  • A failed reset fails the acquire, the same as the gateway reset, because nothing has been paid for yet and a scenario started on a leftover scores as though it were valid. This applies to every cell: a gateway API error on the Outpost key now fails the acquire of Event Gateway scenarios as well. On release a failure is logged, not thrown.
  • Each deletion is logged as it happens, so a leftover is visible in the job log and a reset that fails partway still records what it removed.
  • AGENTS.md: the Outpost trap is retitled and describes the gateway side; "Reset is to pristine, not to empty" explains why this project's pristine state is empty. README.md no longer states a count of default issue triggers.

Verification

  • pnpm install, pnpm -r build, pnpm typecheck: pass
  • pnpm check: all suites pass; @hookdeck-evals/hookdeck 55/55, ten of them new
  • pnpm format:check (biome and prettier): pass
  • Five of the new tests fail with the acquire-time reset removed, and the partial-failure logging test fails against the first commit's log-at-the-end version

Not done, and not checked

  • Not run live against the real projects.
  • Disabled resources are not listed by either reset. HookdeckClient.list does not pass disabled=true. The OpenAPI definition supports that parameter only on connections, sources and destinations, and adding it would also make the gateway reset delete disabled resources missing from an existing local snapshot, so it is left for a separate change. The Outpost project has no disabled resources today.
  • Modifications to resources a baseline keeps are not reverted. The Outpost baseline keeps nothing.
  • Only the five kinds the gateway reset already covers are reset (connections, sources, destinations, transformations, issue triggers).

Closes #111

🤖 Generated with Claude Code

leggetter and others added 2 commits November 5, 2026 21:03
OUTPOST_API_KEY is an ordinary project API key, so it also works on
api.hookdeck.com and the CLI, and agents have created Event Gateway
resources in the Outpost project with it. FixedProjectSource reset the
gateway project, Outpost tenants, operator event destinations and
managed config, but nothing on the Outpost project's gateway side.

A source, two destinations, two connections and two issue triggers were
left there on 24 and 25 August. In run 42044644850 an outpost-005
attempt on codex-gpt-5.4-mini-no-skills found the `hookdeck ->
hookdeck-acme` connection, added a `$nin` body filter to it instead of
changing the Outpost destination's topics, and attempts 2 and 3 of the
same cell started from that edit.

FixedProjectSource now deletes every gateway resource in the Outpost
project on acquire, before the seed is applied, and again on release.
The baseline (OUTPOST_GATEWAY_PRISTINE) is declared empty rather than
captured:

- An Outpost project is created without the gateway's default issue
  triggers, and no Outpost seed creates gateway resources, so pristine
  there is empty.
- A captured snapshot would be taken from whatever the previous CI job
  left, because every job is a fresh checkout. It would have recorded
  the August leftovers as pristine and protected them.

The reset is skipped when both keys are the same string. It is also
skipped, with a warning, when the Outpost key can see any resource id
in the gateway project's snapshot, because that means both keys reach
one project and an empty baseline would delete its defaults. A failed
reset fails the acquire, matching the gateway reset; on release it
warns. Every deletion is logged, so a leftover shows up in the job log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit resets the Event Gateway side of the project
OUTPOST_API_KEY belongs to on every acquire, for every scenario, not
only Outpost ones, and deletes resources that existed before the run.
README.md and .env.example still said Outpost state was not reset and
that Event Gateway scenarios do not touch the Outpost project. Both now
say the key must belong to a dedicated Outpost project and that its
Event Gateway side is wiped on every run.

Deletions are now logged as each one happens. They were logged once
after the reset returned, so a reset that failed partway lost the
record of what it had already deleted.

AGENTS.md: the Outpost trap's heading contradicted its own paragraph
and now says tenants are only reset on release. The filter is
described as a body `$nin` filter, the long line is rewrapped, and the
paragraph says a gateway API error on the Outpost key now fails the
acquire of every cell. README.md no longer says a new project ships
with four default issue triggers. Platform project creation makes four,
but review found three on the gateway project today, so the count is
dropped rather than asserted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leggetter
leggetter merged commit a862658 into main Nov 6, 2026
1 check passed
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.

Agent-created Event Gateway resources in the Outpost project survive every reset

1 participant