Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/794.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The job page names the revision an adversarial review covered, beside the packet hash, and says so when an older record carries no revision instead of printing a hash that belongs to none. The repository review trend names its first-decision latency (one sample per work item, at its first review) instead of counting every review, and adds an override rate with its own denominator: merges that went past a recorded changes-requested decision, each naming the review job, the model and the tip it overturned. A review callback's reviewer words now reach the follow-up goal and the job page, bounded to one line; a review with no body produces exactly the goal it produced before.
27 changes: 24 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,11 @@ recorded". `scripts/restore-drill.mjs --status-file` is the writer.
the linked work item is `changes_requested` or the newest succeeded review job
for that PR has a score below `AUTO_MERGE_MIN_REVIEW_SCORE` (default 80). A
manual maintainer merge may override the review-score gate, and the override
is audited as `job.merge_review_override`. The agent prompt always forbids
is audited as `job.merge_review_override`. The row names the decision it
overturned — the review job, its score, the model that answered and the tip
that review covered — so a reader can tell which review a merge went past; a
decision that recorded no revision leaves that field unknown rather than
borrowing the merge tip. The agent prompt always forbids
merging. The switch is stored on the repository and included in the job
payload for reporting. A stale or downgraded role blocks the merge.
A merge also needs the newest `iterate` job for that pull request to have
Expand Down Expand Up @@ -1107,6 +1111,20 @@ fewer than `REVIEW_TREND_SMALL_SAMPLE` (5) reviews are shown with a
`Small sample n=<n>` badge rather than smoothed into a trend. What each cell
means is fixed in [ui.md](ui.md).

The identity of a decision travels with it. The `work_item.review_outcome` row
names the review job, the score, the model that answered and the tip that review
covered (`formatReviewOutcomeDetail`/`parseReviewOutcomeDetail`, in `src/db.ts`
beside the trend that reads them). A row written before those fields existed
still parses, with the newer fields unknown, and the page says `revision not
recorded` rather than printing a hash or an id that belongs to nothing. The
PR→first-decision median takes one sample per work item, at its first successful
review, so a PR reviewed four times is one first decision and not four; the
override rate is `overrides / recorded changes-requested decisions` in the same
window, its numerator being merges that named such a decision and went ahead.
A threshold-only block is derived at merge time and has no decision row: its
override is audited on the job page but has no denominator here, and the card
says so rather than folding it into a rate it cannot explain.

`GET /api/read/metrics` exposes the same read model as JSON for an external
control room: a normal user gets `personal`, a super admin gets the global sections.
The route is read-only and session-scoped.
Expand Down Expand Up @@ -1338,8 +1356,11 @@ named fields only — base sha, tip sha, the pull-request patches, the verifier
result at the tip and the repository policy — so the author's summary and its
claimed test output are not in the request at all; a caller that still holds them
cannot pass them through. Each automatic merge attempt records one
`job.adversarial` event with the model, the prompt hash and the evidence the
reviewer saw.
`job.adversarial` event with the model, the prompt hash, the base and tip sha and
the evidence the reviewer saw. The job page reads the tip back beside the hash,
so a verdict cannot be read against the wrong revision; a record written before
the reader carried the tip says `revision not recorded` instead of printing a
hash with no revision.

The answer must be one of two shapes: `Concrete risk: <path>:<line>` with a
failure mode and a repro, or `No concrete risk` with the checks it ran. A bare
Expand Down
10 changes: 9 additions & 1 deletion docs/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,17 @@ moves on with the next fix and is not a review outcome.
| Reviews | completed review jobs with a score, terminated inside the window | no such review |
| Average score | mean of those scores, one decimal | no scored review |
| Changes requested | `changes_requested outcomes / outcomes recorded`, `x% (a/b)` | no outcome recorded in the window |
| PR→review | median `review finished_at − work item created_at` for reviews linked to a PR | no linked PR review |
| PR→first decision | median `first review finished_at − work item created_at`, one sample per work item | no linked PR review |
| PR→merge | median `merged_at − created_at` for work items merged in the window | no merge |
| Model | the model each review ran, `label ×n` | no recorded model |
| Overrides | `overrides / recorded changes-requested decisions`, `x% (a/b)`, plus each override's review job, model and tip | no recorded blocking decision in the window |

An override is a merge that named a recorded `changes_requested` decision and
went ahead; the denominator is those decisions in the same window, so the number
cannot be read as a share of all reviews. A threshold-only block has no decision
row and is not in the rate. Each override names `<review job> · <model> · <tip>`,
and a field a row does not carry prints `not recorded` rather than an empty
placeholder.

Rules the card follows, because a reader cannot tell a confident zero from an
unknown one:
Expand Down
2 changes: 1 addition & 1 deletion mock/console.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h1>@HugoXK</h1>
<div class="row between">
<div>
<div class="eyebrow">需要你处理</div>
<h2>FlyBot 在等你回答 <span class="count" data-inbox-count>0</span></h2>
<h2>工作区在等你回答 <span class="count" data-inbox-count>0</span></h2>
<p class="muted">回答会直接发送给正在运行的团队,不需要进入仓库工作台。</p>
</div>
<a class="link" href="dashboard.html">查看仓库</a>
Expand Down
2 changes: 1 addition & 1 deletion mock/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h2>第一个任务已经开出 PR</h2>
<div class="row between">
<div>
<div class="eyebrow">需要你处理</div>
<h2>FlyBot 在等你回答 <span class="count" data-inbox-count>0</span></h2>
<h2>工作区在等你回答 <span class="count" data-inbox-count>0</span></h2>
<p class="muted">回答会直接发送给正在运行的团队,不需要进入仓库工作台。</p>
</div>

Expand Down
1 change: 1 addition & 0 deletions mock/job.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ <h2>结果</h2>




<p class="fine">—</p>
</div>
<div class="card">
Expand Down
22 changes: 11 additions & 11 deletions mock/repository-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<main class="wrap" id="main">
<div class="banner" data-mock-snapshot>静态快照 · 由 <code>npm run mock:snapshot</code> 从真实视图生成;表单和链接不会提交。Static snapshot generated from the real views; forms and links are inert.</div>

<section class="banner-stack" aria-live="polite" data-notification-stack><div class="banner" data-notification data-level="info"><span class="banner-text">这个部署没有启用每仓库 FlyBot 实例,任务由全局 mock/runner 处理。</span><button type="button" class="banner-dismiss" data-dismiss aria-label="关闭消息" title="关闭消息">×</button></div></section>
<section class="banner-stack" aria-live="polite" data-notification-stack><div class="banner" data-notification data-level="info"><span class="banner-text">这个部署没有启用每仓库工作区,任务由全局 mock/runner 处理。</span><button type="button" class="banner-dismiss" data-dismiss aria-label="关闭消息" title="关闭消息">×</button></div></section>
<div class="repo-page"><section class="card">
<div class="row between repo-head">
<div class="repo-head-main">
Expand All @@ -59,7 +59,7 @@ <h1>HugoXK/demo-app</h1>
<span class="repo-status"><span class="fine">发现间隔</span><b>每小时</b></span>
<span class="repo-status"><span class="fine">下次约</span><span data-next-run data-next-source="interval">自动工作已关闭</span></span>
<a class="repo-status" href="#">排期控制台</a>
<span class="repo-status"><span class="fine">FlyBot</span>未启用</span>
<span class="repo-status"><span class="fine">工作区</span>未启用</span>
<span class="repo-status"><span class="fine">GitHub 凭据</span><span class="badge good">正常</span></span>
<span class="badge">空闲</span>
</div>
Expand Down Expand Up @@ -93,7 +93,7 @@ <h2>分诊这个仓库</h2>
<div class="row between">
<div>
<div class="eyebrow">需要你处理</div>
<h2>FlyBot 在等你回答 <span class="count" data-inbox-count>0</span></h2>
<h2>工作区在等你回答 <span class="count" data-inbox-count>0</span></h2>
<p class="muted">回答会直接发送给正在运行的团队,不需要进入仓库工作台。</p>
</div>
<a class="link" href="dashboard.html">查看仓库</a>
Expand All @@ -109,7 +109,7 @@ <h2>和 Chief 沟通</h2>
<div class="row"><a class="link" href="#inbox">待回答的问题</a><a class="link" href="repository-demo.html#chief">刷新回复</a></div>
</div>
<div class="chief-thread" id="chief-thread"><p class="muted">还没有对话。给 Chief 发第一句。</p></div>
<p class="muted">FlyBot 实例就绪后可以和 Chief 沟通。</p>
<p class="muted">工作区就绪后可以和 Chief 沟通。</p>
</section><section class="card" id="repo-memory">
<h2>项目记忆</h2>
<p class="muted">这个仓库的版本化记忆:决策、约定和踩过的坑,按角色可见,每次读到的是确定的版本而不是摘要。</p>
Expand Down Expand Up @@ -150,8 +150,8 @@ <h2>给这个仓库打版本标签</h2>
<div class="row between"><div><div class="eyebrow">故障复盘</div><h2>未关闭的复盘</h2><p class="muted">每个失败、停滞或取消的任务有一条复盘;同一复发键只保留一个计数,并在第二次出现时升级一次。缺少证据时标记为未核实,不猜原因。</p></div><span class="fine">0 个未关闭</span></div>
<p class="muted">没有未关闭的复盘。</p>
</section><section class="card" id="review-trend">
<div class="row between"><div><div class="eyebrow">审核质量</div><h2>审核趋势</h2><p class="muted">只统计这个仓库已完成的审核。空窗口显示 —;少于 5 个审核标注为小样本;要求修改率的分母是记录了结果的审核,不是全部审核。</p></div></div>
<div class="table-scroll"><table><thead><tr><th>窗口</th><th>审核数</th><th>平均分</th><th>要求修改率</th><th>PR→审核</th><th>PR→合并</th><th>模型</th></tr></thead><tbody><tr data-trend-window="week"><th scope="row">7 天</th><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr data-trend-window="month"><th scope="row">30 天</th><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td></tr></tbody></table></div>
<div class="row between"><div><div class="eyebrow">审核质量</div><h2>审核趋势</h2><p class="muted">只统计这个仓库已完成的审核。空窗口显示 —;少于 5 个审核标注为小样本;要求修改率的分母是记录了结果的审核,不是全部审核。PR→首次决定每个工作项只取第一次审核;改判率的分母是窗口内记录了「要求修改」的决定,分子是这些决定之后仍然合并的次数。</p></div></div>
<div class="table-scroll"><table><thead><tr><th>窗口</th><th>审核数</th><th>平均分</th><th>要求修改率</th><th>PR→首次决定</th><th>PR→合并</th><th>模型</th><th>改判率</th></tr></thead><tbody><tr data-trend-window="week"><th scope="row">7 天</th><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td data-trend-override-rate="week">—</td></tr><tr data-trend-window="month"><th scope="row">30 天</th><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td data-trend-override-rate="month">—</td></tr></tbody></table></div>
<p class="fine"><small class="muted" data-trend-empty="week">最近 7 天没有审核,所以显示 —,不是 0。</small> <small class="muted" data-trend-empty="month">最近 30 天没有审核,所以显示 —,不是 0。</small></p>
</section><section class="card"><h2>待处理 PR</h2>
<p class="muted">合并前会重新检查 PR 状态、checks、commit status、reviews 和 branch protection。每个 PR 的合并在它自己的任务页『审查 → 合并』卡片里,只有那一个合并控件。</p>
Expand Down Expand Up @@ -215,9 +215,9 @@ <h2>工作项</h2>
</section></section><section class="repo-section" id="team" data-repo-section="team" aria-labelledby="repo-tab-team"><section class="card" data-instance-health>
<div class="row between">
<div>
<div class="eyebrow">每仓库 FlyBot</div>
<h2>FlyBot 状态</h2>
<p class="muted"><span class="badge busy">未启用</span> · 这个部署没有启用每仓库 FlyBot 实例。</p>
<div class="eyebrow">每仓库工作区</div>
<h2>工作区状态</h2>
<p class="muted"><span class="badge busy">未启用</span> · 这个部署没有启用每仓库工作区。</p>
<p class="fine">最近检查 未知</p>

</div>
Expand All @@ -227,7 +227,7 @@ <h2>FlyBot 状态</h2>
</section></section><section class="repo-section" id="settings" data-repo-section="settings" aria-labelledby="repo-tab-settings"> <section class="cols">
<div class="card" id="repo-settings">
<h2>迭代目标</h2>
<p class="muted" data-usage-line>已用仓库 2/10,FlyBot 实例 0/3</p>
<p class="muted" data-usage-line>已用仓库 2/10,工作区 0/3</p>
<form method="post" action="#" class="form" data-mock-inert onsubmit="return false;">
<input type="hidden" name="csrf" value="mock-csrf" />
<input type="hidden" name="expected_revision" value="1" /><input type="hidden" name="idempotency_key" value="cmd_mock" />
Expand Down Expand Up @@ -334,7 +334,7 @@ <h2>连接</h2>
</div>
</section></section><section class="repo-section" id="danger" data-repo-section="danger" aria-labelledby="repo-tab-danger"><section class="card">
<h2>危险操作</h2>
<p class="muted">这里的操作只影响 Fledge 连接,不会删除 GitHub 仓库。停止调度会保留实例和历史;停止 FlyBot 会停止容器;删除会移除连接、实例、任务和 token。</p>
<p class="muted">这里的操作只影响 Fledge 连接,不会删除 GitHub 仓库。停止调度会保留实例和历史;停止工作区会停止容器;删除会移除连接、实例、任务和 token。</p>

<div class="row">
<form method="post" action="#" data-mock-inert onsubmit="return false;"><input type="hidden" name="csrf" value="mock-csrf" /><button class="btn btn-ghost" type="submit">停止调度</button></form>
Expand Down
Loading
Loading