Skip to content

relay: enforce 43001 correlation on job lifecycle events - #17

Merged
NickFlach merged 3 commits into
mainfrom
fix/644-job-event-correlation
Aug 7, 2026
Merged

NickFlach merged 3 commits into
mainfrom
fix/644-job-event-correlation

Conversation

@NickFlach

Copy link
Copy Markdown
Collaborator

Kinds 43002–43006 were writable with no enforced link to the 43001 that opened the job — consumers guessed (the hive bridge falls back to 'first e tag, else job_id: null', rendering uncorrelated events in a dimmed unlinked group).

Structural validation at ingest, after scope resolution: lifecycle events must carry exactly one e tag referencing their request; zero and multiple get distinct rejection messages. 43001 references nothing — unchanged. Uses the existing count_e_tags helper (same shape as the NIP-09 deletion-target rule).

The optional referential half (the e tag must resolve to a stored 43001 in the same channel) stays open on the tracking issue — a DB lookup per job event deserves its own decision.

Suite: 824 passed / 11 failed — the same 11 environment-dependent failures as clean main; the new validation test passes.

Closes kannaka-labs/kannaka-memory#644

🤖 Generated with Claude Code

flaukowski and others added 2 commits August 7, 2026 01:23
Kinds 43002-43006 were writable (mapped to MessagesWrite) with no
enforced link to the 43001 request that opened the job — every consumer
had to guess (the hive bridge falls back to 'first e tag, else job_id:
null' and renders uncorrelated events in a dimmed unlinked group).

Structural validation at ingest, after scope resolution: lifecycle
events must carry EXACTLY one e tag referencing their request. Zero and
multiple get distinct rejection messages. 43001 opens a job and
references nothing - unchanged. Uses the existing count_e_tags helper
(same shape as the NIP-09 deletion-target rule).

The referential half (e tag must resolve to a stored 43001 in the same
channel) stays open on the issue - it costs a DB lookup per job event
and deserves its own decision.

buzz-relay suite: 824 passed / 11 failed - the same 11 environment-
dependent failures as clean main (media/admin sidecar tests); the new
validation test passes.

Closes flaukowski/kannaka-buzz#644

Co-Authored-By: Claude Fable 5 <[email protected]>
@NickFlach
NickFlach merged commit a819bc3 into main Aug 7, 2026
29 checks passed
@NickFlach
NickFlach deleted the fix/644-job-event-correlation branch August 9, 2026 18:08
NickFlach pushed a commit that referenced this pull request Oct 29, 2026
…t policy) into the upstream sync

Both August features ported onto upstream's restructured tree:
- block#645 no_bridge: ChannelRecord/row mapper/SELECT lists/ChannelUpdate and
  update_channel_on in store/channel.rs (upstream moved channel.rs there),
  the `no-bridge` tag from group_metadata_tags (the single kind:39000
  builder), the kind:9002 privileged key and its edit arm on upstream's
  `edit.columns` path; migration renumbered 0027 -> 0076 (upstream owns
  0027..0075; the embedded-migrator test asserts 76 now) with the SET LOCAL
  timeouts; the column in schema/tables/public/channels.sql.
- block#644 validate_job_event merged cleanly into ingest.rs.
- The stray crates/buzz-relay/.concat is gone.
cargo check, clippy -D warnings (buzz-db, buzz-relay, buzz-workflow,
buzz-kannaka, buzz-dev-mcp) and the migration tests pass locally.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
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.

[kannaka-buzz] Agent job lifecycle events (43002-43006) carry no enforced correlation to their 43001 request

2 participants