Skip to content
Open
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
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,33 @@ mode, the summary additionally reports pending candidates; a missing, corrupt,
or non-terminal validation is pending instead of disappearing from the totals.
Default-mode summary behavior is unchanged.

#### Interactive Report Index (`fm_agent/report.html`)

A single self-contained `report.html` is generated automatically at the end of
every full pipeline run (spec-only mode included), aggregating both the bug
validation results and the per-function logic verification results into one
browseable page. It is rendered purely from the run artifacts — no LLM calls,
no network, no extra dependencies — and is byte-deterministic: the same
artifacts always produce the same page.

Each row shows the report title, a status badge, the source file (linked back
to the original source), the function name, and a code location. The page
supports:

- **Search** across title, source file, function name, and code location
- **Filter** by status (`confirmed` / `not_confirmed` / `error` / `pending`,
or `MATCH` / `MISMATCH` / `ERROR` / `SKIPPED`) and by source file
- **Sort** by status, source file, function name, or code location
- **Expand / collapse** individual reports or all reports at once, plus a
reset button

The page is written to `fm_agent/report.html`; open it in a browser. It can
also be regenerated on demand from any existing run's artifacts with
`uv run python report.py <proj_dir>` (or pass an `fm_agent/` workspace or an
archived-workspace directory directly). The incremental pipeline
(`--incremental`) does not run the auto-generation hook — regenerate the page
manually with the same command.

## Important Notes

1. FM-Agent will create an `fm_agent/` directory under your codebase directory. Make sure there is no name conflict.
Expand Down
13 changes: 13 additions & 0 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,19 @@ FM-Agent 会在代码库目录下创建 `fm_agent/` 目录,主要输出内容

`fm_agent/bug_validation/` 目录下的 `summary.json` 文件汇总了所有 Bug 结果,包括报告的 Bug 总数、已确认 Bug 数、未确认 Bug 数。在 `--all-bugs` 模式下,汇总还会报告待验证候选;缺失、损坏或尚未进入终态的验证结果会显示为 `pending`,而不会从统计中消失。默认模式的汇总行为保持不变。

#### 交互式报告索引(`fm_agent/report.html`)

每次完整流水线运行结束后(包括仅生成规约的 `--only-spec` 模式),会自动生成一个自包含的 `report.html` 索引页,将 Bug 验证结果与逐函数逻辑验证结果汇总到同一页面。该页面完全由运行产物渲染而成——不调用 LLM、不联网、无额外依赖,且为字节级确定:相同的产物始终生成相同的页面。

每一行展示报告标题、状态徽章、源文件(可点击跳转到原始源码)、函数名与代码位置。页面支持:

- **搜索**:按标题、源文件、函数名、代码位置搜索
- **筛选**:按状态(`confirmed` / `not_confirmed` / `error` / `pending`,或 `MATCH` / `MISMATCH` / `ERROR` / `SKIPPED`)与源文件筛选
- **排序**:按状态、源文件、函数名或代码位置排序
- **展开/折叠**:单个报告与全部报告一键展开/折叠,以及重置按钮

页面写入 `fm_agent/report.html`,用浏览器打开即可浏览。也可随时基于任意已有运行的产物重新生成:`uv run python report.py <项目目录>`(也可直接传入 `fm_agent/` 工作目录或归档的工作区目录)。增量模式(`--incremental`)不会自动生成该页面,需手动运行上述命令。

#### 日志文件(`fm_agent/fm_agent.log`)

单一日志文件记录完整的流水线执行过程,包括文件提取进度、推理任务的提交与完成情况、网络错误与重试,以及最终的推理统计摘要。日志级别为 `INFO`,格式为 `%(asctime)s [%(levelname)s] %(message)s`。
Expand Down
10 changes: 10 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,16 @@ def run_pipeline(
confirmed = summary.get("total_confirmed", 0)
print(f"[Pipeline] Confirmed bugs: {confirmed}")

# Regenerate the static HTML report index from the completed artifacts.
# Runs in every completed mode (including --only-spec, which yields an
# empty-state page); a rendering problem must never fail the run.
try:
from report import generate_report
index_path = generate_report(work_dir)
print(f"[Pipeline] Report index written to {os.path.relpath(index_path, proj_dir)}")
except Exception as exc:
logging.warning("[Pipeline] report.html generation skipped: %s", exc)

if only_spec:
print("[Pipeline] Done (specs only; reasoning & bug validation skipped).")
else:
Expand Down
Loading