Skip to content

fix(finding): accept evidence_hint_id 0 and degrade to explicit traffic_refs - #444

Merged
BaaRai merged 1 commit into
BaaRai:mainfrom
m894-tech:fix/evidence-hint-id-degrade
Nov 21, 2026
Merged

BaaRai merged 1 commit into
BaaRai:mainfrom
m894-tech:fix/evidence-hint-id-degrade

Conversation

@snobyyou-cmyk

Copy link
Copy Markdown

report_finding advertises evidence_hint_id as optional, but two shapes that models actually emit reject the whole finding:

  1. the key present with value 0 — "absent" for an optional integer — returns evidence_hint_id must be a valid hint node ID (agent/tools.go, the pid(...) <= 0 guard);
  2. the id of a fact node instead of a hint node returns ... must be a hint node of this task (inherited hints cannot be bound directly) (agent/finding_workflow.go), even when the caller already passed complete traffic_refs.

Both throw away a finding that is otherwise fully provable and force the worker to re-probe or give up.

Reproduction (live, DVWA v1.10 in a lab container, agent_traffic_binding on)

Goal asked for a bound proof. The worker had the exact proof exchange id and the exact response quote, and was rejected 21 times in one task: 13x with evidence_hint_id: 0, 8x with a fact node id. Task #2 recorded 5 critical SQLi findings, all unverified, cause no proof traffic bound — every one of them had the traffic in hand.

Transcripts: data/transcripts/exp3-worker-i*.jsonl, e.g. i29 (hint=0), i32 (hint=31, a fact node).

Change

  • 0 means "no hint", not an error.
  • A hint id that does not resolve to a local hint node degrades to the explicit traffic_refs when those are present.
  • Only a call with neither a usable hint nor usable refs still fails.

Explicit refs already take precedence in findingRefsFromHint (they are appended first and normalized), so the degradation keeps exactly what the caller supplied.

Verification

Two regression tests in agent/finding_hint_degrade_test.go. On the unpatched tree they fail with the exact production strings:

zero hint id rejected: "evidence_hint_id must be a valid hint node ID; omit it when there is no handover hint"
fact-node hint discarded the finding: "evidence_hint_id=462 must be a hint node of this task (inherited hints cannot be bound directly)"

With the patch both pass, and go test ./agent/ is green.

End to end on the same lab: after the fix a fresh task's worker registered the UNION SQLi finding, bound the captured proof exchange via traffic_refs, copied a Surname: <hash> line from the bound body with get_finding_traffic, and called update_finding_report with poe_level 3; the server accepted verification_status=verified. That path is unreachable on the unpatched tree.

…ic_refs

report_finding rejected whole findings over the optional evidence_hint_id
field in two ways seen in a live DVWA run:

- the key was present but 0, an error, although the field is optional and
  models emit 0 for "absent" (21 rejections in one task);
- a fact node id was passed instead of a hint id, an error even when the
  caller supplied complete traffic_refs.

Both sink an otherwise provable finding. Now 0 means no hint, and a hint id
that does not resolve to a local hint node degrades to the explicit
traffic_refs. Only a call with no usable hint and no usable refs fails.

Verified end to end: after the fix a worker registered the DVWA UNION SQLi
finding, bound the captured proof exchange itself and quoted the response
body verbatim; the server accepted verification_status=verified (POE L3).
Tests fail on the unfixed tree with the exact production errors.
@BaaRai

BaaRai commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Merging. The 0 case and the fact-node degradation keep a complete finding instead of discarding it, and the proof gate still verifies whatever refs survive. One follow-up: a negative evidence_hint_id is now treated as absent because findingRefsFromHint takes any id <= 0 as no hint. A negative value is invalid, not absent; refuse it explicitly.

@BaaRai
BaaRai merged commit e2c98b6 into BaaRai:main Nov 21, 2026
6 checks passed
@BaaRai

BaaRai commented Nov 21, 2026

Copy link
Copy Markdown
Owner

Thanks @snobyyou-cmyk, merged as e2c98b6. The zero case and the fact-node degradation keep a finding that is otherwise provable, and the explicit refs still go through the same proof gate. The agent tests pass on main with PostgreSQL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants