observability: activity-ops-event-contract — the feed's ONE root — the ops-event type, its subject fence, and the deterministic merge #824

Closed
opened 2026-08-25 10:59:41 +00:00 by matou-build-agent · 2 comments

Parent

Feature spec: #796 — control-panel observability child spec: activity feed (P12) (DDR 0206).
Design ticket #763; slice-map fan-in #770; wayfinder map #7.
Slice activity-ops-event-contract of docs/slices/observability.yaml; covers spec #796 stories 45–48, 54–61 (contract half).

What to build

A tiny domain module, not a service. It holds the ops-event shape (a time, a source, a subject
carrying kind + display name, the owner's own words, an outcome token, whether the owner classified
it as a problem, an optional operation-log handle and the owner's own drill-in intent), the source
enumeration, and the deterministic newest-first merge with a stable tie-break on
(source, subject, owner's own record id) — so two reads over unchanged records produce
byte-identical row order. A chronology that reshuffles on refresh is unreadable, and a
non-deterministic order makes every component test worthless.

THE FENCE LIVES IN THE TYPE. A subject carries a kind — machine, service, dataset, release,
community — and there is no person kind, so a source cannot express a person-subject event.
The composition drops (and reports in the control plane's own log) any event whose subject kind it
cannot honour. This is DDR 0172's fence made mechanical rather than editorial: sign-ins, invites,
approvals, suspensions, removals and above all removal reasons stay in the ADR 0027 cross-cutting
logs, off-screen. No event carries operator attribution at all.

Rejected: an activity service, a bus, a subscriber, an append-only log — every one of them is
the event store ADR 0097 and DDR 0206 refuse, and every one would let the feed and its owners
disagree. This module has no store, no I/O, and no clock of its own beyond the window bound.

The one test to write first is the fence test — the cheapest possible red, and every later
slice inherits it.

Acceptance criteria

  • (story 57) Given any derived ops event, when it crosses the seam, then it carries a time, a source, a subject (kind + display name), the owner's own words, an outcome token, the owner's problem flag, an optional operation-log handle and the owner's own drill-in intent — and nothing else.
  • (story 48) Given the ops-event contract, then an event's subject is expressible only as a machine, service, dataset, release or the community itself, and a person-shaped subject is unrepresentable in the type.
  • (story 48) Given the composition, then it drops — and reports in the control plane's own logs — any event whose subject kind it cannot honour, asserted by a seam test that stands as the fence's regression guard.
  • (story 47) Given any event whose owning record carries an actor, then the contract carries no actor field — the who stays in the operation's own log (ADR 0027).
  • (decisions) Given two reads over unchanged records, then the merge produces byte-identical newest-first order, with a stable tie-break on (source, subject, owner's own record id).
  • (decisions) Given this module, then it has no store, no bus, no subscriber, no append-only log and no I/O — an activity service is explicitly rejected.
  • (story 7) Given the source enumeration, then it is exactly the five owning sources the surface renders as chips — the module mints no sixth.

Blocked by

  • bootstrap:skeleton (#23 — done, satisfied)

Task manifest

task: observability:activity-ops-event-contract
interface: 'a small shared domain module: the ops-event type (time, source, subject{kind, name}, the owner''s
  words, outcome token, problem flag, optional log handle, owner drill-in), the source enumeration, the
  subject-kind enumeration with **no person kind**, and a deterministic newest-first merge with a stable
  tie-break'
seam: 'a dedicated Go seam test over the contract and the merge — the **fence test** (the first red to
  write): a person-subject event is unrepresentable; an event with an unhonourable subject kind is dropped
  and reported; no derivation emits an actor field; and the merge over unchanged records is byte-identical
  across two runs'
acceptance:
- given: the ops-event type
  when: a source attempts to express a person subject
  then: it does not compile / is unrepresentable — there is no person kind
- given: an event whose subject kind the composition cannot honour
  when: the merge runs
  then: it is dropped and reported in the control plane's own logs
- given: two reads over unchanged records
  when: the merge runs on each
  then: the row order is byte-identical, with the stable tie-break applied
- given: any owning record that carries an actor
  when: an event is derived from it
  then: the event carries no actor field at all
depends_on:
- bootstrap:skeleton
out_of_scope:
- an event store, a bus, a subscriber, an append-only log or any `activity` service
- any owner's derivation (`monitor-recent-events` and its four siblings)
- the read-composition and route (`transport-activity-read`)
- feed-side retention or a retention knob — the horizon is each owner's retention, stated
- any person-subject history — that is the fence, not a v2 backlog item
needs_human_decision: []

Emitted by /to-tickets over docs/slices/observability.yaml in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.

## Parent Feature spec: **#796** — control-panel observability child spec: activity feed (P12) (DDR 0206). Design ticket #763; slice-map fan-in **#770**; wayfinder map #7. Slice `activity-ops-event-contract` of `docs/slices/observability.yaml`; covers spec #796 stories 45–48, 54–61 (contract half). ## What to build **A tiny domain module, not a service.** It holds the ops-event shape (a time, a source, a subject carrying kind + display name, the owner's own words, an outcome token, whether the owner classified it as a problem, an optional operation-log handle and the owner's own drill-in intent), the source enumeration, and the **deterministic newest-first merge** with a stable tie-break on (source, subject, owner's own record id) — so two reads over unchanged records produce **byte-identical row order**. A chronology that reshuffles on refresh is unreadable, and a non-deterministic order makes every component test worthless. **THE FENCE LIVES IN THE TYPE.** A subject carries a **kind** — machine, service, dataset, release, community — and **there is no person kind**, so a source *cannot express* a person-subject event. The composition drops (and reports in the control plane's own log) any event whose subject kind it cannot honour. This is DDR 0172's fence made mechanical rather than editorial: sign-ins, invites, approvals, suspensions, removals and above all removal *reasons* stay in the ADR 0027 cross-cutting logs, off-screen. **No event carries operator attribution at all.** **Rejected: an `activity` service, a bus, a subscriber, an append-only log** — every one of them is the event store ADR 0097 and DDR 0206 refuse, and every one would let the feed and its owners disagree. This module has no store, no I/O, and no clock of its own beyond the window bound. **The one test to write first is the fence test** — the cheapest possible red, and every later slice inherits it. ## Acceptance criteria - [ ] (story 57) Given any derived ops event, when it crosses the seam, then it carries a time, a source, a subject (kind + display name), the owner's own words, an outcome token, the owner's problem flag, an optional operation-log handle and the owner's own drill-in intent — and nothing else. - [ ] (story 48) Given the ops-event contract, then an event's subject is expressible **only** as a machine, service, dataset, release or the community itself, and a person-shaped subject is **unrepresentable in the type**. - [ ] (story 48) Given the composition, then it drops — and reports in the control plane's own logs — any event whose subject kind it cannot honour, asserted by a seam test that stands as the fence's regression guard. - [ ] (story 47) Given any event whose owning record carries an actor, then the contract carries **no actor field** — the *who* stays in the operation's own log (ADR 0027). - [ ] (decisions) Given two reads over unchanged records, then the merge produces **byte-identical** newest-first order, with a stable tie-break on (source, subject, owner's own record id). - [ ] (decisions) Given this module, then it has no store, no bus, no subscriber, no append-only log and no I/O — an `activity` service is explicitly rejected. - [ ] (story 7) Given the source enumeration, then it is exactly the five owning sources the surface renders as chips — the module mints no sixth. ## Blocked by - `bootstrap:skeleton` (#23 — done, satisfied) ## Task manifest ```yaml task: observability:activity-ops-event-contract interface: 'a small shared domain module: the ops-event type (time, source, subject{kind, name}, the owner''s words, outcome token, problem flag, optional log handle, owner drill-in), the source enumeration, the subject-kind enumeration with **no person kind**, and a deterministic newest-first merge with a stable tie-break' seam: 'a dedicated Go seam test over the contract and the merge — the **fence test** (the first red to write): a person-subject event is unrepresentable; an event with an unhonourable subject kind is dropped and reported; no derivation emits an actor field; and the merge over unchanged records is byte-identical across two runs' acceptance: - given: the ops-event type when: a source attempts to express a person subject then: it does not compile / is unrepresentable — there is no person kind - given: an event whose subject kind the composition cannot honour when: the merge runs then: it is dropped and reported in the control plane's own logs - given: two reads over unchanged records when: the merge runs on each then: the row order is byte-identical, with the stable tie-break applied - given: any owning record that carries an actor when: an event is derived from it then: the event carries no actor field at all depends_on: - bootstrap:skeleton out_of_scope: - an event store, a bus, a subscriber, an append-only log or any `activity` service - any owner's derivation (`monitor-recent-events` and its four siblings) - the read-composition and route (`transport-activity-read`) - feed-side retention or a retention knob — the horizon is each owner's retention, stated - any person-subject history — that is the fence, not a v2 backlog item needs_human_decision: [] ``` --- *Emitted by `/to-tickets` over `docs/slices/observability.yaml` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.*
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=10071
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10071 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #824 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 824,
  "status": "success",
  "commits": [
    "995b576"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/opsevent/opsevent.go",
    "internal/opsevent/opsevent_test.go"
  ],
  "tests": [
    {
      "command": "go build ./internal/...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/opsevent/",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/opsevent/",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run ./internal/opsevent/",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/opsevent/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 57 — an ops event carries a time, source, subject(kind+name), owner's words, outcome token, problem flag, optional log handle and drill-in intent, and nothing else (no actor)": "internal/opsevent/opsevent.go: OpsEvent{At,Source,Subject,Words,Outcome,Problem,LogRef,DrillIn,RecordID}; TestOpsEventCarriesNoActorField asserts no actor-shaped field and Subject has exactly kind+name; TestEventCarriesOwnerWordsOutcomeProblemLogAndDrillIn round-trips the full shape",
    "story 48 — subject expressible only as machine/service/dataset/release/community; a person-shaped subject is unrepresentable in the type": "Subject.kind is unexported, built only via Machine/Service/Dataset/Release/Community — no Person constructor; TestSubjectKindsAreExactlyFiveAndNoPerson asserts the five kinds and rejects any person/member/user reading",
    "story 48 — composition drops and reports (in the control plane's own logs) any event whose subject kind it cannot honour, asserted by a seam test": "Merge() drops the un-honourable (zero-value) subject kind and log.Warn-reports it; TestMergeDropsAndReportsUnhonourableSubjectKind asserts drop + the report in the buffer log (the fence's regression guard)",
    "story 47 — any event whose owning record carries an actor: the contract carries no actor field": "OpsEvent has no actor/operator/member/who field; TestOpsEventCarriesNoActorField enforces it by reflection over the field set",
    "decisions — two reads over unchanged records produce byte-identical newest-first order with a stable tie-break on (source, subject, owner's record id)": "Merge() uses a total order (time desc, then source/kind/name/recordID asc) via less(); TestMergeIsNewestFirstAndByteIdenticalAcrossRuns feeds the same records in different fan-out order and asserts byte-identical fingerprints and the expected row order",
    "decisions — no store, no bus, no subscriber, no append-only log, no I/O; an activity service is rejected": "internal/opsevent is a pure domain module: only sort/time/slog imports, no store or transport; package doc states the rejection explicitly",
    "story 7 — the source enumeration is exactly the five owning sources, no sixth": "Sources() returns exactly [monitoring, devices, updates, backups, rescue]; TestSourcesAreExactlyTheFiveOwners asserts equality"
  },
  "summary": "Added internal/opsevent — the activity feed's shared domain contract (ops-event type, five-source enum, type-level subject fence with no person kind, and a deterministic byte-identical newest-first merge that drops+reports un-honourable subject kinds).",
  "blockers": []
}
**close-report** for #824 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 824, "status": "success", "commits": [ "995b576" ], "changed_files": [ "STATUS.md", "internal/opsevent/opsevent.go", "internal/opsevent/opsevent_test.go" ], "tests": [ { "command": "go build ./internal/...", "exit_code": 0 }, { "command": "go vet ./internal/opsevent/", "exit_code": 0 }, { "command": "go test ./internal/opsevent/", "exit_code": 0 }, { "command": "golangci-lint run ./internal/opsevent/", "exit_code": 0 }, { "command": "gofmt -l internal/opsevent/", "exit_code": 0 } ], "criteria": { "story 57 — an ops event carries a time, source, subject(kind+name), owner's words, outcome token, problem flag, optional log handle and drill-in intent, and nothing else (no actor)": "internal/opsevent/opsevent.go: OpsEvent{At,Source,Subject,Words,Outcome,Problem,LogRef,DrillIn,RecordID}; TestOpsEventCarriesNoActorField asserts no actor-shaped field and Subject has exactly kind+name; TestEventCarriesOwnerWordsOutcomeProblemLogAndDrillIn round-trips the full shape", "story 48 — subject expressible only as machine/service/dataset/release/community; a person-shaped subject is unrepresentable in the type": "Subject.kind is unexported, built only via Machine/Service/Dataset/Release/Community — no Person constructor; TestSubjectKindsAreExactlyFiveAndNoPerson asserts the five kinds and rejects any person/member/user reading", "story 48 — composition drops and reports (in the control plane's own logs) any event whose subject kind it cannot honour, asserted by a seam test": "Merge() drops the un-honourable (zero-value) subject kind and log.Warn-reports it; TestMergeDropsAndReportsUnhonourableSubjectKind asserts drop + the report in the buffer log (the fence's regression guard)", "story 47 — any event whose owning record carries an actor: the contract carries no actor field": "OpsEvent has no actor/operator/member/who field; TestOpsEventCarriesNoActorField enforces it by reflection over the field set", "decisions — two reads over unchanged records produce byte-identical newest-first order with a stable tie-break on (source, subject, owner's record id)": "Merge() uses a total order (time desc, then source/kind/name/recordID asc) via less(); TestMergeIsNewestFirstAndByteIdenticalAcrossRuns feeds the same records in different fan-out order and asserts byte-identical fingerprints and the expected row order", "decisions — no store, no bus, no subscriber, no append-only log, no I/O; an activity service is rejected": "internal/opsevent is a pure domain module: only sort/time/slog imports, no store or transport; package doc states the rejection explicitly", "story 7 — the source enumeration is exactly the five owning sources, no sixth": "Sources() returns exactly [monitoring, devices, updates, backups, rescue]; TestSourcesAreExactlyTheFiveOwners asserts equality" }, "summary": "Added internal/opsevent — the activity feed's shared domain contract (ops-event type, five-source enum, type-level subject fence with no person kind, and a deterministic byte-identical newest-first merge that drops+reports un-honourable subject kinds).", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
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.

Reference
Matou/idss#824
No description provided.