Skip to content

test(resync): prove a resync record reaches DING as stream work - #366

Open
schickling-assistant wants to merge 1 commit into
mainfrom
schickling-assistant/2026-08-28-resync-ding-coverage
Open

test(resync): prove a resync record reaches DING as stream work#366
schickling-assistant wants to merge 1 commit into
mainfrom
schickling-assistant/2026-08-28-resync-ding-coverage

Conversation

@schickling-assistant

Copy link
Copy Markdown
Contributor

Why

tests/resync.rs:2-3 says, in its own module doc:

The DING wake past the inbox record is owned by the existing delivery suite; this proves the
resync-specific half against the real ingress.

That deferral does not land anywhere. The existing delivery suite proves the wake for a publicly
emitted
stream event —
tests/event_e2e.rs::event_emit_cli_returns_a_stable_json_receipt_and_ding_marks_the_record — and
that test differs from the resync case in the two ways that matter:

  • It reaches the inbox through the public emit admission path, not
    StreamAdmission::BuiltinResync.
  • It reads the inbox with message::list_inbox directly, not with ding::new_arrivals — the scan
    the live DING loop actually runs, and the one place a stream predicate would silently swallow a
    record.

So the sentence "resync records reach a live agent" was, until now, unproven at the seam. The
Bounded idempotent stream ingress invariant's "DING marks them as stream work" clause is proven
only for the public path.

What

One new integration target, tests/resync_ding.rs, that drives a real ResyncSupervisor over a
temp catalog, changes a goal carrier, and then asserts through DING's own arrival scan that the
resulting record is delivered and rendered as stream work.

How

The test mirrors run_ding's startup discipline — seed the seen set from the current unread set
first, so the post-change scan can only report the new arrival — and then asserts four things:

  • the record reaches new_arrivals at all (the filter-out case);
  • it carries stream: resync and an event id;
  • poke_text renders it [DING] » hetz.worker/resync: resource goal changed …, i.e. with the
    non-agent source marker rather than a relationship arrow;
  • a second scan does not report it again, so the wake is not duplicated.

tests/resync.rs's module doc is updated to point at the new file instead of deferring to a suite
that did not cover it.

The target is registered in st2WasmResolverCheck, the derivation that already gates live resync
integration. The test itself needs no wasm-resolver feature — it uses a native catalog-relative
binding — but that derivation is where the resync supervisor is demonstrably exercised in CI today,
so it is the placement with evidence behind it rather than a guess. Since test targets are
enumerated explicitly, registering it is what makes it run at all.

Rationale

Why a separate file rather than adding to tests/resync.rs. That file's stated scope is the
ingress half, and its module doc explicitly excludes the wake. A separate target keeps that boundary
honest and makes the new gate independently nameable.

The test is load-bearing, and I checked rather than assuming. Patching new_arrivals to filter
stream == "resync" out of its result — the exact regression this guards — makes it fail on the
arrival assertion (left: 0, right: 1). The patch was reverted; src/ is untouched by this branch.

No production behavior changes. This is coverage plus one comment correction and one flake test
registration.

Verification

cargo test --test resync_ding --test resync

4 tests pass locally (3 pre-existing in resync, 1 new). CI drives the same targets through
st2WasmResolverCheck.

Posted on behalf of @schickling
field value
agent_identity dev3.direct.claude.gvacdkt7
session dev3.gvacdkt7
agent_persona generalist
agent_supervisor unavailable
agent_tool Claude Code
agent_tool_version 2.1.237
agent_runtime Claude Code 2.1.237
tooling_profile dotfiles@cab57ad

`tests/resync.rs` deferred the DING wake to "the existing delivery suite",
but that suite only covers a publicly emitted stream event, which reaches
the inbox through a different admission path than `emit_builtin_resync`
and is read with `message::list_inbox` rather than the `new_arrivals`
scan the live loop actually uses. Nothing proved a resync record survives
that scan.

Add `tests/resync_ding.rs` covering the join against the real supervisor
ingress, and register the target in the derivation that already gates
live resync integration.

Verified the test is load-bearing: filtering resync out of `new_arrivals`
makes it fail on the arrival assertion.

agent-identity: dev3.direct.claude.gvacdkt7
agent-persona: generalist
agent-supervisor: unavailable
agent-tool: Claude Code
agent-tool-version: 2.1.237
agent-runtime: Claude Code 2.1.237
tooling-profile: dotfiles@cab57ad
@schickling-assistant

Copy link
Copy Markdown
Contributor Author

The check-aarch64-darwin failure on this PR is inherited from the base, not introduced here.
Tracked in #368.

main at 4c0c760 — the base of this branch — fails the identical test at the identical line with
the identical 515/1 split (run 33159684036, job 98810849678):

test run::tests::compile_invalid_seat_does_not_block_existing_live_resync_watch ... FAILED
thread '…' panicked at src/run.rs:4100:14:
correcting another declaration must not reseed and hide the live transition

Leaving it alone per #368 rather than folding an unrelated fix into this PR.

Posted on behalf of @schickling
field value
agent_identity dev3.direct.claude.gvacdkt7
session dev3.gvacdkt7
agent_persona generalist
agent_supervisor unavailable
agent_tool Claude Code
agent_tool_version 2.1.237
agent_runtime Claude Code 2.1.237
tooling_profile dotfiles@cab57ad

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-31T08:03:48.220490Z 387a4a6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 387a4a6417

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/resync_ding.rs
)
.is_empty()
);
std::thread::sleep(Duration::from_millis(300));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Synchronize the supervisor before mutating the carrier

ResyncSupervisor::refresh only queues Msg::WatchSet and returns without waiting for the worker to install it, so this fixed 300 ms delay is racy. On a loaded CI runner, the goal can be written before the worker processes the refresh; rebuild_carriers then treats the new contents as its initial baseline and emits nothing, causing the 15-second wait to fail. Use the acknowledged install_live path or another readiness handshake before writing the carrier.

Useful? React with 👍 / 👎.

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