gunk-dev/the-valley

feedback.md

source8d7f770ab82amain's published tip history
7.5 KiB · Rendered
1# Observability & feedback
2
3The thing usually called "review" is one slice of a larger problem: how does the system give feedback to anyone or anything that needs it about the state of changes flowing through?
4
5This document reframes review as a special case of *observability + feedback*, and works out what changes when you stop privileging pre-merge human comments as a distinct mechanism.
6
7## What "review" actually bundles
8
9The PR-as-page model conflates several distinct things:
10
11| Concern | What it does | Failure mode today |
12| --- | --- | --- |
13| Coordination | A place humans converge to discuss a change | Discussion thread is locked to the PR; orphaned at merge |
14| Gating | Correctness checks must pass before merge | Slow, brittle, false negatives |
15| Record | Persistent trace of why a change happened | Lives inside one vendor's database |
16| Notification | Someone needs to look at this | Firehose; no useful prioritization |
17
18Once these are unbundled:
19
20- **Gating** is handled by [attestations](./verification.md), not human review.
21- **Record** is the event log itself.
22- **Coordination** still needs a focal point — but a derived one, not a stored object (see below).
23- **Notification** becomes a routing/priority problem, which is the new hard bottleneck.
24
25## Feedback as events about events
26
27Everything that today shows up in disparate UIs — build results, lint output, deploy state, runtime metrics, downstream-consumer complaints, security scans, trust-score updates, human comments, agent suggestions — has the same shape: an event referencing another event (or a change, which is itself an event).
28
29```
30commit C
31 ├── attestation A1 (pure check passed)
32 ├── attestation A2 (effectful check passed)
33 ├── derivation D produced from C
34 │ ├── deploy event "D deployed to staging"
35 │ │ ├── metric event "latency regression in /api/x"
36 │ │ └── user-reported event "feature Y broke"
37 │ └── trust event "attester P confirmed by re-verifier"
38 ├── comment event "this collides with refactor on branch B"
39 ├── agent suggestion event "consider extracting helper from L123"
40 └── approval event "looks good for staging deploy"
41```
42
43All the same substrate. Subscribers — humans, controllers, agents — consume whichever subset they care about.
44
45## What disappears
46
47- **The privileged "merge" moment.** Refs update because a controller decided to update them based on the events it saw. There's no special event called "merged"; there's a `ref-updated` event with prior attestations and approvals in its causal history. Pre-merge and post-merge feedback share the same machinery, and a regression observed three weeks later is mechanically indistinguishable from a pre-merge lint warning — only the latency differs.
48- **The PR object.** What people call "a PR" becomes a *view* over events scoped to a change (or a chain of changes). Views are derived, queryable, subscribable. They have no canonical storage of their own.
49- **The "review/no-review" binary.** Feedback accrues continuously. A change has *as much* review as the events that have accumulated against it — possibly zero, possibly a lot.
50
51## What appears
52
53### Threads (the coordination focal point)
54
55Humans still need a *place* to converge on a change. A thread is a named, persistent view over events scoped to a change or chain of changes. It is:
56
57- **Referenceable** — has a stable identifier, linkable, embeddable.
58- **Subscribable** — you can subscribe to new events on a thread.
59- **Closeable, but not deletable** — closure is itself an event; the thread's events remain.
60- **Multi-change** — a thread can scope to one commit, a chain, a feature, an incident, anything queryable.
61
62A thread is not stored separately from the log. It's a *query* with a name.
63
64### The priority/routing layer
65
66The hard new subsystem. Every event has potential audiences:
67
68- Humans, with finite attention spans and varying interest profiles.
69- Agents, that may want to react autonomously to specific patterns.
70- Controllers, that act on event types they're configured for.
71
72Routing must answer: for each event, who needs to know, how urgently? This is the part of GitHub's UX that fails most loudly today (notification firehose) and the part most worth getting right.
73
74Possible shapes — none decided:
75
76- Per-subscriber rule sets (CUE schemas declaring "I care about events matching X").
77- Learned priorities — a model observing what events a human actually opens vs ignores.
78- Hand-curated digests at varying cadences.
79- Escalation chains — an event with no acknowledgment after $T promotes itself.
80
81This subsystem deserves its own design document once the shape gets clearer.
82
83### Trust as a feedback signal
84
85The attestation trust controller from [verification](./verification.md) is itself a feedback subsystem: it consumes confirm/deny events from re-verifiers and emits trust-update events. Other controllers react to trust changes by tightening or loosening gating. Trust is feedback to the system about the system's own past decisions.
86
87## How this dissolves the agent-review question
88
89"How do humans review agent-authored code" was the wrong question. The right questions:
90
91- What filter and priority logic decides which agent-emitted events reach a human?
92- What's the human's verb when an event reaches them — comment, approve, reject, dispatch a follow-up agent, demote the attester's trust?
93- For agent-authored changes whose attestations are strong, why would a human be involved by default at all?
94
95The default flow for a well-attested agent change becomes: events flow, controllers react, no human attention required. Humans engage when something is *flagged for them* by the priority layer — high-impact change, low-trust attester, attestations conflicting with later signals, explicit subscription. Pre-merge human review becomes the exception, not the rule.
96
97## Honest tensions
98
99- **Attention is now the gatekeeper.** "Don't drown the human" replaces "don't merge bad code" as the system's hardest job. The priority layer is load-bearing in a way no piece of GitHub is today.
100- **Threads-as-queries are unusual UX.** Most people expect URLs that point to stored objects, not query results. The system must make this feel solid — stable IDs, snapshot semantics, predictable refresh.
101- **Late feedback has a half-life.** In principle a change accrues feedback forever. In practice attention has to age out. Probably: events stay, but views can mark themselves dormant after some criterion (deployed and stable for $T, no recent activity, explicit closure).
102- **Revert and roll-forward semantics.** When post-merge feedback says "this is bad," what should happen? Probably: emit a `regression-suspected` event, controllers decide (auto-rollback for high-confidence runtime signals, agent-dispatched fix for code-level issues, human escalation for ambiguous cases). The mechanism exists; the policies are still to be designed.
103
104## Open questions
105
106- **Priority layer architecture.** Per-subscriber, learned, both? Probably starts hand-configured and grows.
107- **Thread identity and naming.** UUID? Human-readable slug? Tied to a commit, a chain, a topic?
108- **When does a thread close?** Auto-close on deploy-stable? Explicit close events? Both?
109- **How does feedback reach the author when the author is an agent that has finished its run?** Probably: events spawn new agent runs scoped to acting on them. klaus-shaped.
110- **Cross-repo feedback.** A change in repo A breaks a consumer in repo B. The consumer's event needs to land somewhere visible to A's thread. Cross-repo routing is non-trivial; deferred.