Skip to content

fix(catalog): allow adagents_authoritative as evidence= filter on /registry/authorizations - #4884

Merged
bokelley merged 1 commit into
mainfrom
bokelley/4841-snapshot-evidence-allowlist
May 20, 2026
Merged

fix(catalog): allow adagents_authoritative as evidence= filter on /registry/authorizations#4884
bokelley merged 1 commit into
mainfrom
bokelley/4841-snapshot-evidence-allowlist

Conversation

@bokelley

Copy link
Copy Markdown
Contributor

Summary

Hotfix follow-up to #4879. The new `adagents_authoritative` evidence value landed in `catalog_agent_authorizations` and backfilled ~6,800 cafemedia children, but the partner-sync endpoints rejected `?evidence=adagents_authoritative` with 400 because the validator's `VALID_EVIDENCE` allowlist was hardcoded to the pre-#4841 enum.

```
$ curl '.../api/registry/authorizations?agent_url=https://interchange.io&evidence=adagents_authoritative'
{"error":"Invalid evidence value: adagents_authoritative. Expected one of: adagents_json, agent_claim, community, override."}
```

Change

One-line addition to `server/src/db/authorization-snapshot-db.ts:42`:

```diff
-const VALID_EVIDENCE = new Set(['adagents_json', 'agent_claim', 'community', 'override']);
+const VALID_EVIDENCE = new Set(['adagents_json', 'agent_claim', 'community', 'override', 'adagents_authoritative']);
```

Not added to `DEFAULT_EVIDENCE` — the partner-sync default stays strict-bilateral `adagents_json` only. Consumers opt into the weaker evidence explicitly.

Verification after deploy

```bash
ADMIN_KEY=$(grep "^ADMIN_API_KEY=" .env.local | cut -d= -f2)
curl -sS 'https://agenticadvertising.org/api/registry/authorizations?agent_url=https://interchange.io&evidence=adagents_authoritative'
-H "Authorization: Bearer $ADMIN_KEY" | jq '{count, evidences: ([.rows[].evidence] | unique)}'

Expected: count ~6,800, evidences=["adagents_authoritative"]

```

Test plan

  • Typecheck passes
  • Reviewer: existing tests covering the allowlist should still pass (no test asserts the old hardcoded set; the new value is additive)

🤖 Generated with Claude Code

…4841 follow-up)

#4879 added the adagents_authoritative evidence value to
catalog_agent_authorizations and backfilled ~6,800 cafemedia children
into catalog, but the partner-sync endpoints rejected
?evidence=adagents_authoritative with 400 because the VALID_EVIDENCE
set in authorization-snapshot-db.ts was hardcoded to the pre-#4841
enum:

  $ curl '.../api/registry/authorizations?agent_url=...&evidence=adagents_authoritative'
  {"error":"Invalid evidence value: adagents_authoritative. Expected
  one of: adagents_json, agent_claim, community, override."}

Adds the new value to VALID_EVIDENCE. NOT added to DEFAULT_EVIDENCE —
the partner-sync default stays strict-bilateral adagents_json only;
consumers opt in to weaker evidence explicitly.

@aao-release-bot aao-release-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Real bug, surgical fix, right shape — adds the missing allowlist entry without weakening the partner-sync default.

Things I checked

  • server/src/db/authorization-snapshot-db.ts:47 adds adagents_authoritative to VALID_EVIDENCE only. DEFAULT_EVIDENCE at L48 stays ['adagents_json'] — strict-bilateral default preserved.
  • Migration 488_catalog_fanout_authoritative_evidence.sql:39 already permits adagents_authoritative on catalog_agent_authorizations.evidence, and publisher-db.ts:328 writes it. Without this PR the validator was the only thing rejecting a value the rest of the stack happily produces.
  • No other hardcoded evidence enum in server/src/ that this allowlist needs to stay in sync with — the other enums (discovery_method, source) are distinct dimensions.
  • EvidenceValidationError at L95 interpolates [...VALID_EVIDENCE] — the new value surfaces in the 400 message.
  • Empty-frontmatter changeset matches the established server-only-fix convention (cf. .changeset/3573-canonicalize-agent-url-registered-path.md); not a missing package bump.

Follow-ups (non-blocking — file as issues)

  • Add a positive parseEvidenceParam('adagents_authoritative') test next to the existing override test at server/tests/integration/registry-authorization-sync-endpoints.test.ts:170. Symmetric coverage and would have caught this drift before the partner-sync 400s.

Minor nits (non-blocking)

  1. Set order drift. The Set at L47 ends with adagents_authoritative while migration 488's CHECK at L39 orders it before override. Harmless — affects only the order in the EvidenceValidationError message — but matching migration order would read cleaner.

Self-merging your own one-liner with the typecheck box ticked and the manual-validation checkbox left to the reviewer is a notable choice for a hotfix, but the change is correct and the deploy-time curl is the validation that actually matters here.

LGTM.

@bokelley
bokelley merged commit 1d1668f into main May 20, 2026
15 checks passed
@bokelley
bokelley deleted the bokelley/4841-snapshot-evidence-allowlist branch May 20, 2026 19:18
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.

1 participant