Skip to content

Commit ec15dca

Browse files
authored
Merge pull request #8 from OneHillAI/spec-project-development-analytics
2 parents 42733cf + 39bd983 commit ec15dca

5 files changed

Lines changed: 402 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Spec: project development analytics on the dashboard
2+
3+
Builtin-format mirror of the OpenSpec change
4+
[`project-development-analytics`](../../openspec/changes/project-development-analytics/). The change's
5+
`proposal.md` and `specs/project-analytics/spec.md` carry the full requirements and scenarios; this file
6+
satisfies the repo's builtin spec gate and states the problem, requirements, and acceptance in brief.
7+
8+
## Problem
9+
10+
The governance dashboard shows the pipeline (PRs bucketed by stage) but not whether the project is getting
11+
healthier, what the work is about against the project's goal and invariants, or whether the agent review is
12+
actually keeping defects out. A project can merge steadily and still drift: all features and no tests, all
13+
code and no docs, velocity up and correctness down. There is no single view of where the project sits today
14+
and where it heads if the open work merges, and no quantifiable read on building bug-free software.
15+
16+
## Requirements
17+
18+
1. A two-state summary: submitted PRs as the to-be state, merged PRs as the current-state.
19+
2. A read of what the work is about (leading topics per state) against the declared project goal and
20+
invariants.
21+
3. A six-dimension radar balance map (0 centre to 5 point) overlaying current-state (merged) and to-be
22+
(merged plus on-track open PRs); a changes-requested PR is not projected as if it will merge unchanged.
23+
4. Six dimensions: Correctness, Verification, Documentation, Spec conformance, Governance integrity, Flow,
24+
each scored 0 to 5, with non-applicable PRs excluded from a dimension's denominator.
25+
5. Governance KPI ratios (spec-fit, review pass/fail, tests, docs, review categories, MUST-invariant
26+
conform/violate, core-change attempts, malicious), each as total, percentage, and failing count.
27+
6. The escaped-defect KPI framed as the review agent's false-negative rate, linked by an `Escaped-from: #N`
28+
trailer on a bug-lane PR or a bug-labelled issue, feeding Correctness.
29+
7. A temporal trend (per-window series) for the headline signals, and submitted-versus-merged throughput.
30+
8. Minimum-signal handling: below a metric's threshold the dashboard shows a short "still filling in" note,
31+
not a misleading value; an existing repo scores from its history; a metric reveals itself as signal
32+
accrues. "Not enough signal" wins over a maximum score at low counts.
33+
9. Provenance and privacy unchanged: only facts already on GitHub, private stays behind auth, `--public`
34+
stays the explicit opt-in.
35+
36+
Two producer changes this depends on: intake exposes the spec result (`spec_ok`) as its own signal so the
37+
spec-conformance metric is not read from the rolled-up intake verdict; and the review emits a
38+
machine-readable per-lens result so categories, malicious, and impact-core are queryable without scraping
39+
the rendered comment.
40+
41+
## Acceptance criteria
42+
43+
- Both states render, including an empty to-be state, without error.
44+
- Each dimension has a current-state and a to-be score in [0, 5] or a "not enough signal" state; Correctness
45+
does not read 5 on a project with too few green merges.
46+
- Every ratio and dimension is computed over an explicit, stated window whose denominator covers the whole
47+
window (paginated), never an unstated recent slice.
48+
- The escaped-defect count links from a bug PR or issue, feeds Correctness, and is presented as the review
49+
false-negative rate.
50+
- A below-threshold metric shows a note rather than a number, and `--public` adds no new disclosure.
51+
- A worked HTML example was produced as a design reference for the view.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
schema: spec-driven
2+
created: 2026-07-24
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
## Why
2+
3+
The governance dashboard shows the pipeline: pull requests bucketed by stage (awaiting review, in
4+
progress, changes requested, merged), by lane. That answers "what is moving through the gate right now."
5+
It does not answer the questions a project owner actually asks:
6+
7+
- **What is the work about?** Across everything submitted and everything merged, what are the changes
8+
mostly doing, and does that match the project's stated goal and its invariants?
9+
- **Is the project healthy and balanced, or lopsided?** A project can merge steadily and still drift:
10+
all features, no tests; all code, no docs; velocity up, correctness down. There is no single view of
11+
where the project sits today and where it is heading if the open work merges.
12+
- **Are we building bug-free software?** The point of the gate is fewer escaped defects. Nothing today
13+
counts the failures that matter most: a change that passed review green, passed its tests, and still
14+
turned out to carry a bug.
15+
16+
GitHub already holds every raw fact (each PR, each check, each merge). The dashboard's job is not to
17+
repeat GitHub; it is to **synthesise** those facts into a small number of quantifiable signals a human
18+
can read at a glance, and to make the trajectory visible: current-state (what has merged) versus the
19+
to-be state (what merges if the open PRs land).
20+
21+
## What Changes
22+
23+
Add a **project-analytics** section to the dashboard, above or beside the existing stage buckets. It is
24+
derived entirely from PR facts the dashboard already fetches, plus a small set of declared link
25+
conventions for the signals GitHub does not carry directly. Nothing here changes the gate; it is a
26+
read-only view.
27+
28+
1. **Two-state summary.** A count and short digest of every **submitted** PR (open = the *to-be* state)
29+
and every **merged** PR (the *current-state*), so the two are always read side by side.
30+
31+
2. **What the work is about.** The most common topics across submitted PRs and across merged PRs (by
32+
lane, declared scope, and changed-area), and a plain-language read of what those topics mean against
33+
the project's **invariants** and its **stated goal** (both declared in config).
34+
35+
3. **A balance map (radar / spider chart).** A star-shaped chart with **6 fixed dimensions**, each scored
36+
`0` at the centre to `5` at the point, drawn as **two overlaid polygons**: the current-state (from
37+
merged PRs) and the to-be state (from merged plus open PRs, projecting the open work as if merged). The
38+
shape shows at a glance whether the project is balanced across the principles of a healthy software
39+
project or spiking in one direction, the way an attribute chart does for sports equipment or a game
40+
character. The six dimensions and their scoring are defined in the spec.
41+
42+
4. **Governance KPI ratios.** Totals and percentages that quantify how the process is going: how many
43+
incoming PRs fit the spec/OpenSpec standard; how many pass review versus not (with the failing count
44+
called out); tests created and tests passing and doc updates from merged PRs and their trend; which
45+
review categories findings fall into; how many PRs conform to versus violate a MUST invariant; how many
46+
attempted to change the core business logic of the code; and how many were flagged malicious.
47+
48+
5. **Bug-free-software KPIs.** The headline performance numbers: submitted versus merged, and the
49+
**escaped-defect count** framed as the **review agent's false-negative rate** - a defect reported
50+
against a PR that had passed review green and passed its tests yet still shipped. Green-then-buggy means
51+
the review missed it, so for a project that runs the agent review this is the sharpest read of whether
52+
the agent fleet is actually catching bugs. It is the number the whole gate exists to drive down.
53+
54+
6. **A temporal trend.** The radar answers current-vs-to-be; alongside it, a per-window series (a small
55+
trend line) for the headline signals, so an owner sees whether escaped defects, throughput, and spec-fit
56+
are rising or falling, not only their latest value.
57+
58+
A worked HTML example of the whole view (radar, KPIs, escaped-defect hero, sparklines, and the
59+
still-filling-in note) was produced as a design reference for this change.
60+
61+
## What this depends on
62+
63+
Two of the KPIs cannot come from what the pipeline emits today, so this change carries the small producer
64+
changes they need:
65+
66+
- **Spec conformance is its own signal.** Intake rolls the spec check together with disclosure, DCO, and
67+
lane, and a chore lane is spec-exempt, so "passed intake" is not "spec-conformant." Intake must expose
68+
the spec result separately.
69+
- **The review emits a machine-readable per-lens result.** Review categories, malicious flags, and
70+
impact-core findings already exist inside the review, but only the rendered comment is queryable. A
71+
structured per-lens emission (a status per lens, or a parseable block) unlocks all three at once, instead
72+
of the dashboard scraping a comment. The MUST-invariant KPI stays "not enough signal" until a review
73+
emits an explicit invariant check; the spec marks it blocked on that producer rather than implying it is
74+
derivable.
75+
76+
## Impact
77+
78+
- Affected specs: new capability `project-analytics`.
79+
- Affected code (at build time, not in this change): `cli/dashboard.py` (a new analytics model + render
80+
section, plus extending `fetch` to read merged-PR statuses and files and to paginate the declared
81+
window), its HTML, and `cli/dashboard.test.sh`; `.github/asdd/intake-check.sh` (expose `spec_ok`
82+
separately); the review path (`post-review.sh` or a per-lens status) for the machine-readable emission.
83+
- New declared conventions (config + trailers) for the signals GitHub does not carry: the project goal and
84+
invariants, and the escaped-defect link (`Escaped-from: #N` on a bug-lane PR or a bug-labelled issue).
85+
Every KPI degrades to "not enough signal" rather than a wrong number when its input is absent, and each
86+
metric declares a minimum signal so a new project shows a note while an existing repo scores from history.
87+
- Privacy and provenance are unchanged from the dashboard's existing stance: every rendered fact is already
88+
visible on GitHub, private deployments stay behind auth, and `--public` remains the explicit opt-in for
89+
publication.

0 commit comments

Comments
 (0)