HKUDS/Vibe-Trading · error · ValueError

not-applicable criteria require acceptance notes

Error message

not-applicable criteria require acceptance notes

What it means

An audit row used result not_applicable_user_accepted but its notes field was empty or whitespace. Waiving a criterion requires a recorded user-acceptance rationale.

Source

Thrown at agent/src/goal/store.py:917

    def _validate_completion_audit(
        self,
        goal: GoalRecord,
        audit: list[AuditRow],
    ) -> None:
        criteria = self.list_criteria(goal.goal_id)
        rows_by_criterion = {row.criterion_id: row for row in audit}
        for criterion in criteria:
            if not criterion.required:
                continue
            row = rows_by_criterion.get(criterion.criterion_id)
            if row is None:
                raise ValueError(f"missing audit row for criterion {criterion.criterion_id}")
            if row.result not in _COMPLETION_RESULTS:
                raise ValueError(f"criterion {criterion.criterion_id} is not satisfied")
            if row.result in {"satisfied", "satisfied_with_caveat"} and not row.evidence_ids:
                raise ValueError("complete goals require verified evidence")
            if row.result == "not_applicable_user_accepted" and not row.notes.strip():
                raise ValueError("not-applicable criteria require acceptance notes")
            has_verified_evidence = False
            for evidence_id in row.evidence_ids:
                evidence = self._get_evidence(evidence_id)
                if evidence is None or evidence.goal_id != goal.goal_id:
                    raise ValueError(f"unknown evidence_id: {evidence_id}")
                if evidence.criterion_id != criterion.criterion_id:
                    raise ValueError(
                        f"evidence {evidence_id} does not match criterion {criterion.criterion_id}"
                    )
                if evidence.verification_status == "verified":
                    has_verified_evidence = True
            if row.result in {"satisfied", "satisfied_with_caveat"} and not has_verified_evidence:
                raise ValueError("complete goals require verified evidence")

    def _get_evidence(self, evidence_id: str) -> EvidenceRecord | None:
        row = self._conn.execute(
            "SELECT * FROM goal_evidence WHERE evidence_id = ?",
            (evidence_id,),

View on GitHub (pinned to 80ffdda44c)

Solutions

  1. Populate notes with the concrete reason the user accepted skipping the criterion
  2. If the criterion is actually satisfied, use satisfied with evidence ids instead
  3. Validate non-empty notes for N/A rows before calling update_status

Example fix

// before
AuditRow(criterion_id="c2", result="not_applicable_user_accepted", notes="", evidence_ids=[])
// after
AuditRow(criterion_id="c2", result="not_applicable_user_accepted", notes="User accepted: out of scope for this run", evidence_ids=[])
Defensive patterns

Strategy: validation

Validate before calling

for row in audit:
    if row.result == "not_applicable_user_accepted":
        assert row.notes and row.notes.strip(), f"{row.criterion_id} N/A without notes"

Type guard

def na_rows_have_notes(audit: list) -> bool:
    return all(r.notes.strip() for r in audit if r.result == "not_applicable_user_accepted")

Try / catch

except ValueError as e: if 'acceptance notes' in str(e): collect the user's rationale, set notes, retry

Prevention

When it happens

Trigger: update_status with AuditRow(result="not_applicable_user_accepted", notes="" or " ") for a required criterion.

Common situations: Programmatically marking criteria N/A without capturing the user's reason; notes field omitted by a dataclass default; LLM-generated audit forgetting notes.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28). Data as JSON: /api/errors/9726e927f1728999. Report an issue: GitHub.