feat(events): implement Emitter + event types against #505 interface (TDD against bash byte-oracle if central; disclose if scattered) #528

Closed
opened 2026-07-25 21:03:45 +02:00 by bosun · 1 comment
Owner

Implement internal/events package satisfying the Go interface landed in #505.

Motivation

Phase 2 continues contract-driven TDD-per-phase per ADR-0009 §3.1. internal/events is one of two Phase 2 packages (sibling: #527 config). Interface (Emitter, event types) is Surveyor-approved in #505; implementation lands here.

Scope

  • internal/events/*.go — implementation satisfying #505 interface (Emitter.Emit + typed event structs)
  • Bash byte-oracle: existing bash event emission (verify: might be printf statements in orchestrators, or a dedicated lib/events.sh if it exists). If bash emission is scattered rather than centralized, note it in PR body — Go impl may become the new authoritative surface.
  • TDD approach (contract-driven per ADR-0009 §3.1):
    1. Test against interface first
    2. Oracle harness case using internal/harness (reuse Phase-1 vehicle)
    3. Implementation to green
  • Event taxonomy: names + payload shapes documented as C-adjacent (may earn a small contract doc under docs/architecture/contracts/ if the taxonomy is non-trivial; Engineer's judgment on whether to add or defer)

AC

  • internal/events implementation compiles + all #505 interface methods satisfied — verified in PR#531 4757790; never-abort #159 upheld (no sentinel, swallows nil/failing sink)
  • Unit tests green — verified in PR#531 gate run
  • Equivalence-harness cases against bash oracle green — events IS central (event_emit in 3.4K lib) so real byte-oracle. Surveyor REPRODUCED jq-byte-match claim across byte range + probed for undisclosed neighbors (b/f) which reproduction FALSIFIED, confirming boundary COMPLETE (not just accurate). Verdict-trailing byte-identity + ts-determinism seam verified (review 4557); mutation-verified teeth
  • Event taxonomy documented at docs/architecture/contracts/events.md per AC4 — verified in PR#531
  • go vet ./... + golangci-lint run clean — verified: gate own instrument fired, all clean
  • Depends on: #505 (interfaces), #503 (harness vehicle from Phase 1)
  • Sibling: #527 (config — parallelizable OR sequential Engineer continuation)
  • Refs ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 2 row, §5 (fail-loud + trivalent-verdict discipline)

Anchor

Filed 2026-07-25 by Bosun on operator continuation direction for Phase 2 dispatch.

Implement `internal/events` package satisfying the Go interface landed in #505. ## Motivation Phase 2 continues contract-driven TDD-per-phase per ADR-0009 §3.1. `internal/events` is one of two Phase 2 packages (sibling: [[#527 config]]). Interface (`Emitter`, event types) is Surveyor-approved in #505; implementation lands here. ## Scope - `internal/events/*.go` — implementation satisfying #505 interface (Emitter.Emit + typed event structs) - **Bash byte-oracle**: existing bash event emission (verify: might be `printf` statements in orchestrators, or a dedicated `lib/events.sh` if it exists). If bash emission is scattered rather than centralized, note it in PR body — Go impl may become the new authoritative surface. - **TDD approach** (contract-driven per ADR-0009 §3.1): 1. Test against interface first 2. Oracle harness case using `internal/harness` (reuse Phase-1 vehicle) 3. Implementation to green - **Event taxonomy**: names + payload shapes documented as C-adjacent (may earn a small contract doc under `docs/architecture/contracts/` if the taxonomy is non-trivial; Engineer's judgment on whether to add or defer) ## AC - [x] `internal/events` implementation compiles + all `#505` interface methods satisfied — verified in PR#531 4757790; never-abort #159 upheld (no sentinel, swallows nil/failing sink) - [x] Unit tests green — verified in PR#531 gate run - [x] Equivalence-harness cases against bash oracle green — events IS central (event_emit in 3.4K lib) so real byte-oracle. Surveyor REPRODUCED jq-byte-match claim across byte range + probed for undisclosed neighbors (b/f) which reproduction FALSIFIED, confirming boundary COMPLETE (not just accurate). Verdict-trailing byte-identity + ts-determinism seam verified (review 4557); mutation-verified teeth - [x] Event taxonomy documented at `docs/architecture/contracts/events.md` per AC4 — verified in PR#531 - [x] `go vet ./...` + `golangci-lint run` clean — verified: gate own instrument fired, all clean ## Related - Depends on: #505 (interfaces), #503 (harness vehicle from Phase 1) - Sibling: #527 (config — parallelizable OR sequential Engineer continuation) - Refs ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 2 row, §5 (fail-loud + trivalent-verdict discipline) ## Anchor Filed 2026-07-25 by Bosun on operator continuation direction for Phase 2 dispatch.
bosun closed this issue 2026-07-25 21:54:25 +02:00
Author
Owner

Closed by hand — PR#531 merged as 475779047964de3329a1c6ac7572759a8a651c03 on v2/next (fast-forward). All 5 ACs ticked with substrate anchors above.

Two commits landed:

  • C1 (docs): S1 + nit-a + nit-b fold from #527/#530 Surveyor review 4555 (frozen Config field-doc enum corrections, ErrNotFound comment, gate Skipf→Errorf). Consolidated into #528 (not separate follow-up PR) — cleaner shape, disjoint files from events (config/interface.go+config_test.go vs events/*).
  • C2 (events): internal/events port byte-faithful to event_emit, Emit → {ts,kind,...fields[,verdict]} single JSON line, SetEscapeHTML(false)==jq -c byte-match verified across domain, DEL/U+2028/9 boundary disclosed + Surveyor probed for undisclosed neighbors (\b/\f) which reproduction falsified (boundary COMPLETE not just accurate).

Substrate landed:

  • events emission wire-format authoritative (Go impl is new authoritative surface since bash event_emit is 3.4K lib)
  • Verdict-trailing-field byte-identity verified
  • Never-abort #159 upheld (no sentinel; swallows nil/failing sink; #159 contract-captured)
  • ts-format contract pinned in events.md (Phase-6 producers job for gen)
  • Event taxonomy documented at docs/architecture/contracts/events.md

No must-fix, no should-consider — cleanest Phase 2 PR per Surveyor 3917.

Cross-references:

  • ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 2 row, §5 (fail-loud + trivalent-verdict discipline)
  • Depends on: #505 (interfaces), #503 (harness vehicle from Phase 1)
  • Sibling: #527 (config — closed prior with substrate anchors)

Phase 2 core scope COMPLETE: 2/2 core trackers closed (#527 + #528). Follow-ups remain on milestone #74:

  • #529 (config.schema.json reconcile) — dispatchable Phase 2 hygiene continuation
  • #337 (broaden version-file basenames) — separate, coordinated bash+Go+schema change needed

Milestone #74 disposition: close alongside this tracker close (Phase 2 core done; #529 + #337 move off milestone as follow-ups per Engineer + Surveyor consensus in bus 63b6 + 3917).

**Closed by hand** — PR#531 merged as `475779047964de3329a1c6ac7572759a8a651c03` on v2/next (fast-forward). All 5 ACs ticked with substrate anchors above. **Two commits landed**: - **C1 (docs)**: S1 + nit-a + nit-b fold from #527/#530 Surveyor review 4555 (frozen Config field-doc enum corrections, ErrNotFound comment, gate Skipf→Errorf). Consolidated into #528 (not separate follow-up PR) — cleaner shape, disjoint files from events (config/interface.go+config_test.go vs events/*). - **C2 (events)**: `internal/events` port byte-faithful to `event_emit`, Emit → `{ts,kind,...fields[,verdict]}` single JSON line, `SetEscapeHTML(false)==jq -c` byte-match verified across domain, DEL/U+2028/9 boundary disclosed + Surveyor probed for undisclosed neighbors (`\b`/`\f`) which reproduction falsified (boundary COMPLETE not just accurate). **Substrate landed**: - events emission wire-format authoritative (Go impl is new authoritative surface since bash `event_emit` is 3.4K lib) - Verdict-trailing-field byte-identity verified - Never-abort #159 upheld (no sentinel; swallows nil/failing sink; #159 contract-captured) - ts-format contract pinned in `events.md` (Phase-6 producers job for gen) - Event taxonomy documented at `docs/architecture/contracts/events.md` **No must-fix, no should-consider** — cleanest Phase 2 PR per Surveyor 3917. **Cross-references**: - ADR-0009 §3.1 (contract-driven TDD), §3.3 phase 2 row, §5 (fail-loud + trivalent-verdict discipline) - Depends on: #505 (interfaces), #503 (harness vehicle from Phase 1) - Sibling: #527 (config — closed prior with substrate anchors) **Phase 2 core scope COMPLETE**: 2/2 core trackers closed (#527 + #528). Follow-ups remain on milestone #74: - #529 (config.schema.json reconcile) — dispatchable Phase 2 hygiene continuation - #337 (broaden version-file basenames) — separate, coordinated bash+Go+schema change needed Milestone #74 disposition: close alongside this tracker close (Phase 2 core done; #529 + #337 move off milestone as follow-ups per Engineer + Surveyor consensus in bus 63b6 + 3917).
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frankenbit/release-toolkit#528
No description provided.