Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ› fix: make Acceptance file evidence identifiable and require descriptions in prompts (#19276)

Arvin Xu10375791fd27
diff --git a/apps/cli/src/commands/acceptanceRun.ts b/apps/cli/src/commands/acceptanceRun.ts
index 236405bfb68..049d297b1d7 100644
--- a/apps/cli/src/commands/acceptanceRun.ts
+++ b/apps/cli/src/commands/acceptanceRun.ts
@@ -18,6 +18,7 @@ import {
type Decision,
DECISIONS,
deriveReportVerdict,
+ evidenceDescriptionForFile,
evidenceTypeForFile,
genericContextFromResult,
inlineTextEvidenceForFile,
@@ -347,7 +348,7 @@ async function submitAction(options: SubmitOptions): Promise<void> {
{
capturedBy: options.by as any,
content: inlineContent,
- description: options.desc,
+ description: evidenceDescriptionForFile(options.desc, options.file),
fileId,
type: options.type as any,
},
@@ -420,7 +421,7 @@ async function evidenceUploadAction(options: EvidenceUploadOptions): Promise<voi
capturedBy: options.by as any,
checkResultId: options.check,
content: inlineContent,
- description: options.desc,
+ description: evidenceDescriptionForFile(options.desc, options.file),
fileId,
type: options.type as any,
});
@@ -777,7 +778,7 @@ async function ingestReportAction(reportDir: string, options: IngestReportOption
// The filename, not the case title β€” the title already heads the
// check card, so reusing it here just triples the same text.
content: inlineContent,
- description: evidenceInput.description ?? path.basename(abs),
+ description: evidenceDescriptionForFile(evidenceInput.description, abs),
fileId: file?.id,
metadata: evidenceInput.comparison ? { comparison: evidenceInput.comparison } : undefined,
type,
diff --git a/apps/cli/src/commands/verify.test.ts b/apps/cli/src/commands/verify.test.ts
index f52a3158b0b..36b83e480c3 100644
--- a/apps/cli/src/commands/verify.test.ts
+++ b/apps/cli/src/commands/verify.test.ts
@@ -25,6 +25,7 @@ import {
visualizationMetadata,
} from './verify';
import { registerAcceptanceCommands } from './verifyAcceptance';
+import { evidenceDescriptionForFile } from './verifyHelpers';
const { mockTrpcClient } = vi.hoisted(() => ({
mockTrpcClient: {
@@ -1418,3 +1419,22 @@ describe('formatAnnotationRegion', () => {
expect(formatAnnotationRegion({ rect: { x: 0.1 } })).toBeUndefined();
});
});
+
+describe('file evidence descriptions', () => {
+ it('preserves an explicit description', () => {
+ expect(evidenceDescriptionForFile('Goal final state', '/tmp/state.json')).toBe(
+ 'Goal final state',
+ );
+ });
+
+ it('retains the basename when a file is inlined without a description', () => {
+ expect(evidenceDescriptionForFile(undefined, '/tmp/goal-final-state.json')).toBe(
+ 'goal-final-state.json',
+ );
+ expect(evidenceDescriptionForFile(' ', '/tmp/events.json')).toBe('events.json');
+ });
+
+ it('does not invent a description for inline content', () => {
+ expect(evidenceDescriptionForFile(undefined)).toBeUndefined();
+ });
+});
diff --git a/apps/cli/src/commands/verifyHelpers.ts b/apps/cli/src/commands/verifyHelpers.ts
index 8b24464e313..5474ceb3cda 100644
--- a/apps/cli/src/commands/verifyHelpers.ts
+++ b/apps/cli/src/commands/verifyHelpers.ts
@@ -980,3 +980,11 @@ export function formatAnnotationRegion(
if (!position) return label;
return label ? `${label} @ ${position}` : position;
}
+
+/** Keep file identity when small text artifacts are stored inline. */
+export function evidenceDescriptionForFile(
+ description?: string,
+ file?: string,
+): string | undefined {
+ return description?.trim() || (file ? path.basename(file) : undefined);
+}
diff --git a/packages/builtin-skills/src/acceptance/SKILL.md b/packages/builtin-skills/src/acceptance/SKILL.md
index 77670315358..d1e07a35ec5 100644
--- a/packages/builtin-skills/src/acceptance/SKILL.md
+++ b/packages/builtin-skills/src/acceptance/SKILL.md
@@ -174,6 +174,12 @@ needed.
into `interaction-trace.jsonl`; optional, never hand-written β€”
[interaction-cost.md](references/interaction-cost.md).
+**Every file submission MUST include a non-empty, reviewer-facing description**
+(`--desc` for CLI submissions; `description` for tools and ingest entries).
+Identify what the file contains and what it demonstrates for this criterion.
+A filename, path, artifact id, or generic label such as "evidence" is not a
+sufficient description. This also applies when a text file is stored inline.
+
Shared rules for every artifact β€” media types, provenance, file vs inline,
safety β€” are in [evidence.md](references/evidence.md).
diff --git a/packages/builtin-skills/src/acceptance/references/evidence.md b/packages/builtin-skills/src/acceptance/references/evidence.md
index bdf6695324d..44cdc8b4cc7 100644
--- a/packages/builtin-skills/src/acceptance/references/evidence.md
+++ b/packages/builtin-skills/src/acceptance/references/evidence.md
@@ -64,8 +64,19 @@ join an explanation from an older round with fresh execution output.
- Use `--file` for binary artifacts and larger text/DOM/transcript files.
- Use `--content` for short text assertions. Pass exactly one of `--file` and
`--content`.
-- Keep the description factual: identify the action, observed state, and relevant
- target. Do not place the verdict in the description unless explicitly asked.
+- **Description is mandatory for every file artifact.** Always supply a non-empty
+ `--desc` when using `--file`, and a `description` when attaching a `fileId` or
+ adding a file to an ingest manifest. Small text files converted to inline
+ content still require it; do not rely on the filename fallback.
+- Write a concise, factual sentence identifying the file's contents and their
+ relevance to the criterion, including the action, observed state, or target
+ where useful. The reviewer should know why to open it without inspecting the
+ payload. A filename, path, id, "JSON", or "evidence" alone is insufficient.
+ Do not invent conclusions or place the verdict in the description unless
+ explicitly asked.
+- Example: `goal-final-state.json` β†’ "Goal final state after training: completion
+ status and the four final validation results." Describe each artifact
+ separately instead of repeating the criterion title for every file.
```bash
# File artifact captured by the selected surface.
diff --git a/packages/builtin-skills/src/acceptance/references/report.md b/packages/builtin-skills/src/acceptance/references/report.md
index 5a0d0b5db36..b1d5fbc8f09 100644
--- a/packages/builtin-skills/src/acceptance/references/report.md
+++ b/packages/builtin-skills/src/acceptance/references/report.md
@@ -156,6 +156,12 @@ supersedes? }`.
## result.json schema
+Every `cases[].evidence` file entry must use `{ "path": "...", "description": "..." }`.
+Describe the file's contents and relevance to the criterion, following the
+[shared description requirements](evidence.md#file-versus-inline-content).
+Do not copy the legacy bare-path form: ingestion accepts it for compatibility,
+but its filename fallback does not satisfy the description requirement.
+
```json
{
"cases": [
@@ -166,7 +172,12 @@ supersedes? }`.
"surface": "cli",
"status": "pass",
"observation": "root returned 3 nested children, depth 2",
- "evidence": ["assets/task-tree.txt"]
+ "evidence": [
+ {
+ "path": "assets/task-tree.txt",
+ "description": "Task tree command output showing the root and its 3 nested children at depth 2."
+ }
+ ]
},
{
"id": "2",
@@ -175,7 +186,12 @@ supersedes? }`.
"surface": "cli",
"status": "pass",
"observation": "average precision improved from 0.742 to 0.796",
- "evidence": ["assets/evaluation.json"],
+ "evidence": [
+ {
+ "path": "assets/evaluation.json",
+ "description": "Evaluation results comparing baseline and candidate average precision, including the observed change from 0.742 to 0.796."
+ }
+ ],
"datasets": [
{
"id": "model-metrics",
@@ -325,8 +341,10 @@ measured delta on each side:
```json
"evidence": [
{ "path": "assets/before.png",
+ "description": "Topic row before the change, showing the original 11px text size.",
"comparison": { "id": "topic-row", "role": "before", "layout": "horizontal", "label": "before: 11px" } },
{ "path": "assets/after.png",
+ "description": "The same topic row after the change, showing the updated 12px text size.",
"comparison": { "id": "topic-row", "role": "after", "layout": "horizontal", "label": "after: 12px" } }
]
```
diff --git a/packages/builtin-tool-acceptance-evidence/src/manifest.ts b/packages/builtin-tool-acceptance-evidence/src/manifest.ts
index e4a5b5f1b0c..ef3ecf4e3a3 100644
--- a/packages/builtin-tool-acceptance-evidence/src/manifest.ts
+++ b/packages/builtin-tool-acceptance-evidence/src/manifest.ts
@@ -28,7 +28,11 @@ export const AcceptanceEvidenceManifest: BuiltinToolManifest = {
items: {
properties: {
content: { description: 'Inline evidence content.', type: 'string' },
- description: { description: 'What this evidence demonstrates.', type: 'string' },
+ description: {
+ description:
+ 'Required for file artifacts, including file contents submitted inline. A non-empty, reviewer-facing sentence explaining what the artifact contains and what it demonstrates for this criterion. A filename, path, id, or generic label alone is insufficient.',
+ type: 'string',
+ },
documentId: {
description:
'An existing LobeHub document id from documents.id. Do not use an agent_documents.id binding id.',
diff --git a/packages/builtin-tool-acceptance-evidence/src/systemRole.ts b/packages/builtin-tool-acceptance-evidence/src/systemRole.ts
index 47dd4f23ba7..baa46cb6269 100644
--- a/packages/builtin-tool-acceptance-evidence/src/systemRole.ts
+++ b/packages/builtin-tool-acceptance-evidence/src/systemRole.ts
@@ -6,5 +6,6 @@ Call listCriteria to read the criteria of the current run, then submit evidence
- Use documentId only for an id from documents.id. Never pass an agent_documents.id binding id as documentId or fileId.
- If you only know an agent document binding id, call listDocuments and use the returned documentId field.
- Use fileId only for an id from files.id, such as an uploaded screenshot, video, or file artifact.
+- Every file artifact submitted with fileId MUST have a non-empty description: explain what the file contains and what it demonstrates for this criterion, so the reviewer knows why to open it. A filename, path, id, or generic label such as "JSON" or "evidence" is insufficient. Apply the same rule to file contents submitted inline. Base the description on the actual artifact; do not invent findings.
- Do not decide whether a criterion passes and do not invent evidence.
- If evidence is missing, state that plainly in a note for that criterion.`;
diff --git a/src/features/Acceptance/Report/MarkdownEvidence.tsx b/src/features/Acceptance/Report/MarkdownEvidence.tsx
index 0905df22380..234493d010a 100644
--- a/src/features/Acceptance/Report/MarkdownEvidence.tsx
+++ b/src/features/Acceptance/Report/MarkdownEvidence.tsx
@@ -172,7 +172,22 @@ const INLINE_RENDER_MAX_CHARS = 160;
* and blank lines are skipped β€” a document that opens with a code block should
* be labeled by its first code line, not by "```bash".
*/
-export const evidenceTitleFromMarkdown = (content: string): string => {
+export const evidenceTitleFromMarkdown = (
+ content: string,
+ description?: string | null,
+ fileName?: string | null,
+): string => {
+ const label = description?.trim() || fileName?.trim();
+ if (label) return label;
+ // Raw JSON has no prose heading; its first line is not a useful document title.
+ if (/^[{[]/.test(content.trim())) {
+ try {
+ JSON.parse(content);
+ return 'JSON';
+ } catch {
+ // Markdown links and non-JSON text still use their first meaningful line.
+ }
+ }
for (const raw of content.split('\n')) {
let line = raw.trim();
if (!line || line.startsWith('```') || /^-{3,}$/.test(line)) continue;
@@ -202,7 +217,9 @@ export const resolveMarkdownEvidenceFold = (content: string, authoredTitle?: str
const foldTitle = authoredTitle?.trim() || derivedTitle;
const trimmed = content.trim();
const inlineEligible = !trimmed.includes('\n') && trimmed.length <= INLINE_RENDER_MAX_CHARS;
- const fold = Boolean(foldTitle) && (Boolean(authoredTitle?.trim()) || !inlineEligible);
+ const fold =
+ Boolean(foldTitle) &&
+ (Boolean(authoredTitle?.trim()) || derivedTitle === 'JSON' || !inlineEligible);
return { fold, foldTitle };
};
diff --git a/src/features/Acceptance/Report/ReportViewer.tsx b/src/features/Acceptance/Report/ReportViewer.tsx
index 7461940da1c..2672aba7a70 100644
--- a/src/features/Acceptance/Report/ReportViewer.tsx
+++ b/src/features/Acceptance/Report/ReportViewer.tsx
@@ -841,7 +841,9 @@ const EvidenceItem = memo<{
// becomes the fold row's title, not a supplement line below it. The
// raw description, not the caption filter β€” with no fileName the label
// IS the description, and the filter would null it out.
- <CollapsibleMarkdownEvidence title={e.description ?? undefined}>
+ <CollapsibleMarkdownEvidence
+ title={e.description?.trim() || e.fileName?.trim() || undefined}
+ >
{e.content}
</CollapsibleMarkdownEvidence>
) : e.content ? (
diff --git a/src/features/Acceptance/Report/markdownEvidenceTitle.test.ts b/src/features/Acceptance/Report/markdownEvidenceTitle.test.ts
index 84af172dd6d..3fdc71c26b2 100644
--- a/src/features/Acceptance/Report/markdownEvidenceTitle.test.ts
+++ b/src/features/Acceptance/Report/markdownEvidenceTitle.test.ts
@@ -69,3 +69,33 @@ describe('resolveMarkdownEvidenceFold β€” authored alt as the fold title', () =>
expect(foldTitle).toBe('ηŽ―ε’ƒθ―΄ζ˜Ž');
});
});
+
+describe('evidence labels preserve artifact identity', () => {
+ it('uses the description instead of a JSON opening brace', () => {
+ expect(evidenceTitleFromMarkdown('{\n "status": "done"\n}', 'Goal final state')).toBe(
+ 'Goal final state',
+ );
+ });
+
+ it('keeps a file name when there is no meaningful description', () => {
+ expect(evidenceTitleFromMarkdown('{\n}', ' ', 'goal-final-state.json')).toBe(
+ 'goal-final-state.json',
+ );
+ });
+
+ it('preserves markdown links as prose titles', () => {
+ expect(evidenceTitleFromMarkdown('[Report](https://example.com)')).toBe('Report');
+ });
+
+ it('labels legacy JSON objects and arrays without exposing raw payloads as titles', () => {
+ expect(evidenceTitleFromMarkdown('{\n "status": "done"\n}')).toBe('JSON');
+ expect(evidenceTitleFromMarkdown('[{"id":"wk_123"}]')).toBe('JSON');
+ });
+});
+
+it('folds short JSON payloads behind a readable type label', () => {
+ expect(resolveMarkdownEvidenceFold('[{"id":"wk_123"}]')).toEqual({
+ fold: true,
+ foldTitle: 'JSON',
+ });
+});
diff --git a/src/features/Acceptance/Viewer/CheckList.tsx b/src/features/Acceptance/Viewer/CheckList.tsx
index 3bc2444fc23..9ffcbb6b4f8 100644
--- a/src/features/Acceptance/Viewer/CheckList.tsx
+++ b/src/features/Acceptance/Viewer/CheckList.tsx
@@ -650,7 +650,10 @@ const EvidenceList = memo<{
return (
// An authored alt/description becomes the fold row's title itself β€”
// the supplement below the row duplicated it one line later.
- <CollapsibleMarkdownEvidence key={item.id} title={description ?? undefined}>
+ <CollapsibleMarkdownEvidence
+ key={item.id}
+ title={item.description?.trim() || item.fileName?.trim() || undefined}
+ >
{item.content}
</CollapsibleMarkdownEvidence>
);