diff --git a/docs/test-reports.md b/docs/test-reports.md
index e269a485c..deebd6a24 100644
--- a/docs/test-reports.md
+++ b/docs/test-reports.md
@@ -1,5 +1,36 @@
# 测试报告契约
+## Optional summary table
+
+Any public repository can include an optional `table` in its `dashboard-summary.json`, uploaded inside an existing test-results artifact. The producer computes the values; the dashboard only displays the declared columns and rows as escaped text, in their original order. It does not interpret column keys or calculate scores, tokens, memory, or duration. This contract is independent of repository, workflow, and artifact prefix.
+
+```json
+{
+ "tests": 2,
+ "passed": 1,
+ "failed": 1,
+ "skipped": 0,
+ "flaky": 0,
+ "table": {
+ "title": "case execution",
+ "columns": [
+ {"key": "case", "label": "case"},
+ {"key": "result", "label": "result"}
+ ],
+ "rows": [
+ {"case": "example-a", "result": "passed"},
+ {"case": "example-b", "result": "n/a"}
+ ]
+ }
+}
+```
+
+Use one summary per artifact. `title`, column `key` / `label`, and every declared cell must be strings; keys must be nonempty and unique. Producers supply final display strings, including units, compact numbers, and `n/a`. Only declared cells are retained; extra metadata is ignored. A malformed optional table is omitted without invalidating otherwise valid counts. The nonnegative integer count fields keep their existing meaning: `passed + failed + skipped + flaky == tests`. Summaries without `table` retain their current counts-only behavior and do not gain per-case details. Producers must exclude prompts, model answers, traces, errors, and credentials before upload.
+
+The E2E page displays optional tables from test artifacts for the selected branch line, alongside existing reports. Publication preserves the table through collection, run history, and snapshot generation without recalculation.
+
+## Existing report formats
+
看板读取现有 CI 证据,不替源仓库执行测试,也不会将缺失证据当成成功。默认按 `release` 事件/版本工作流归为版本验证、`schedule`/daily/nightly 归为每日构建,其余为门禁;可在 `board-config.json` 配置名称正则。
Actions 产物名使用 `ut-results`、`st-results`、`e2e-results`、`real-e2e-results`(分片可追加后缀)。支持:
diff --git a/gsb/incremental_project.py b/gsb/incremental_project.py
index 06390a27a..280eecd5e 100644
--- a/gsb/incremental_project.py
+++ b/gsb/incremental_project.py
@@ -15,7 +15,7 @@
from .sync import stamp, date
-SUPPLEMENT_TESTS_VERSION = 6
+SUPPLEMENT_TESTS_VERSION = 7
COVERAGE_TIMEZONE = ZoneInfo("Asia/Shanghai")
COVERAGE_GATE_JOBS = ("Gate / UT", "Gate / ST", "Gate / Coverage")
@@ -158,6 +158,7 @@ def _executed(runs):
"status": "incomplete" if t.get("counts") is None else "failed" if t["counts"]["failed"] else "unstable" if t["counts"]["flaky"] or t["counts"]["skipped"] else "passed",
"run_id": r["id"], "sha": r["sha"], "attempt": r["attempt"], "branch": r["branch"], "created_at": r["updated_at"],
"url": t.get("url"), "scores": t.get("scores", []),
+ **({"table": t["table"]} if "table" in t else {}),
"totals": t.get("counts"), "duration_ms": None, "detail": {"files": [], "failures": [], "projects": [], "stats": {}}}
for r, t in latest_reports.values()]
diff --git a/gsb/project.py b/gsb/project.py
index f72e75665..fee4a3272 100644
--- a/gsb/project.py
+++ b/gsb/project.py
@@ -121,7 +121,7 @@ def run_details(gh, cfg, run, *, cache=None, parser_version=None):
continue
entry.update(status="available", counts={k: parsed[k] for k in ("tests", "passed", "failed", "skipped", "flaky")},
cases=parsed["cases"], format=parsed["format"])
- for key in ("commands", "packages"):
+ for key in ("commands", "packages", "table"):
if key in parsed:
entry[key] = parsed[key]
else:
diff --git a/gsb/public_sections.py b/gsb/public_sections.py
index 85f5e13a6..12e9ab6d1 100644
--- a/gsb/public_sections.py
+++ b/gsb/public_sections.py
@@ -208,6 +208,7 @@ def public_tests(ctx, runs, owns=None, coverage_eligible=None):
'run_id': run['id'], 'sha': run['sha'], 'attempt': run['attempt'], 'branch': run['branch'],
'created_at': run['updated_at'], 'url': report['url'], 'duration_ms': None, 'totals': counts,
'scores': report.get('scores', []),
+ **({'table': report['table']} if 'table' in report else {}),
'detail': {'files': [{'file': k, **v} for k, v in by_file.items()],
'failures': [{'file': c.get('file'), 'title': c['name'], 'status': c['status']} for c in report.get('cases', []) if c['status'] == 'failed'],
'stats': {'expected': (counts or {}).get('passed'), 'unexpected': (counts or {}).get('failed'), 'flaky': (counts or {}).get('flaky')},
diff --git a/gsb/reports.py b/gsb/reports.py
index 9d062487b..2d89759cd 100644
--- a/gsb/reports.py
+++ b/gsb/reports.py
@@ -252,6 +252,26 @@ def artifact_layer(name):
return "other"
+def summary_table(value):
+ """Project a producer-formatted table without interpreting its columns."""
+ if not isinstance(value, dict) or not isinstance(value.get("title"), str):
+ return None
+ columns, rows = value.get("columns"), value.get("rows")
+ if not isinstance(columns, list) or not columns or not isinstance(rows, list):
+ return None
+ if any(not isinstance(c, dict) or not isinstance(c.get("key"), str) or not c["key"]
+ or not isinstance(c.get("label"), str) for c in columns):
+ return None
+ keys = [c["key"] for c in columns]
+ if len(set(keys)) != len(keys):
+ return None
+ if any(not isinstance(row, dict) or any(not isinstance(row.get(key), str) for key in keys) for row in rows):
+ return None
+ # Ignore undeclared cells and metadata, just as we omit raw report payloads.
+ return {"title": value["title"], "columns": [{"key": c["key"], "label": c["label"]} for c in columns],
+ "rows": [{key: row[key] for key in keys} for row in rows]}
+
+
def parse_report_zip(blob):
"""Choose one report family per artifact, avoiding JSON/XML/log double counts."""
with zipfile.ZipFile(io.BytesIO(blob)) as archive:
@@ -299,6 +319,9 @@ def parse_report_zip(blob):
if counts["tests"] != sum(counts[k] for k in FIELDS):
raise ValueError("inconsistent counts")
result, family = {**counts, "cases": [], "format": "summary"}, "summary"
+ table = summary_table(doc.get("table"))
+ if table is not None:
+ result["table"] = table
elif name.endswith(".xml"):
result, family = junit(text), "junit"
elif name.endswith("run.log"):
@@ -329,7 +352,10 @@ def parse_report_zip(blob):
for family in ("summary", "playwright", "tagged", "junit", "log"):
if reports[family]:
counts = {k: sum(r.get(k, 0) for r in reports[family]) for k in ("tests", *FIELDS)}
- return {**counts, "format": family, "cases": [c for r in reports[family] for c in r["cases"]][:500], "coverage": coverage, "tagged": tagged, "scores": scores[:100], **({k: [v for r in reports[family] for v in r[k]] for k in ("commands", "packages")} if family == "log" else {})}
+ tables = [r["table"] for r in reports[family] if "table" in r]
+ return {**counts, "format": family, "cases": [c for r in reports[family] for c in r["cases"]][:500], "coverage": coverage, "tagged": tagged, "scores": scores[:100],
+ **({"table": tables[0]} if len(tables) == 1 else {}),
+ **({k: [v for r in reports[family] for v in r[k]] for k in ("commands", "packages")} if family == "log" else {})}
if coverage or tagged or scores:
return {"tests": None, "coverage": coverage, "tagged": tagged, "scores": scores[:100]}
return None
diff --git a/gsb/sync.py b/gsb/sync.py
index db5009ca9..7248fcfd9 100644
--- a/gsb/sync.py
+++ b/gsb/sync.py
@@ -16,7 +16,7 @@
# 2: tagged catalogs and harness summaries are read from results artifacts.
# 3: Real E2E metrics are reduced to public score summaries.
-PARSER_VERSION = 4
+PARSER_VERSION = 5
def stamp(value):
diff --git a/static/app.js b/static/app.js
index caccc0547..ec421a34f 100644
--- a/static/app.js
+++ b/static/app.js
@@ -1154,6 +1154,15 @@
}));
}
+ function summaryTables(executed) {
+ return executed.filter(report => report.table).map(report => {
+ const {title, columns, rows} = report.table;
+ // Cells already contain the producer's final display values. Keep both
+ // axes in declared order and render every cell as text.
+ return ` ${link(report.url, esc(report.artifact))} · ${date(report.created_at)} · ${esc(title)}
${esc(report.branch)}${columns.map(column => ` ${rows.map(row => `${esc(column.label)} `).join('')}${columns.map(column => ` `).join('')}${esc(row[column.key])} `).join('')}