M-L1-T3c: fetch-ai Zod schema rewrite for real Agentverse API (RED spec)#126
Merged
Conversation
PR #120 (T-3) authored ZodFetchAiAgent against IMAGINED API. PR #124 fixed wiring (httpClient injection); PR #125 fixed HTTP method (POST + body). Production smoke 2026-05-03 11:16 UTC: adapter ran (durationMs:109) but processed:0 — Zod validation rejects every real record because schema shape doesn't match real API. Live curl 2026-05-03 verified real response shape: - address prefix: agent1... (not fetch1...) - registration: created_at ISO string (not registeredAt Unix ms) - tags field: system_wide_tags (not tags) - online: status: "active"|"inactive" string (not isOnline boolean) - reputation: rating: 0..5 float (not reputationScore: 0..100) - profileUrl: NOT in response (must be derived from address) Total ~10K agents in API (offset cap = 9999, verified empirically). Changes: - packages/types/src/sources/fetch-ai.ts: rewrite ZodFetchAiAgent to mirror raw Agentverse response (snake_case, ISO strings, agent1 prefix, .passthrough() for forward-compat). Add 4 projection helpers: fetchAiProfileUrl(address) → URL fetchAiRatingToReputation(rating) → 0..100 | null (× 20, null if 0) fetchAiStatusToOnline(status) → bool ("active" only) fetchAiDisplayName(raw) → name||prefix||"agent <addr[6:14]>" - products/01-registry/tests/fetch-ai-adapter.test.ts: update validAgent fixture to real raw shape (28 fields). Un-skip toCanonical describe block + 5 new projection assertions (DID format, sourceUrl construction, name fallback chain, description truncation, parse_error on bad regex). Vitest output (RED): 4 fail, 10 pass — adapter still uses old field names (raw.tags, raw.endpoint, etc.). Fix is registry-dev scope: update inferCapability + toCanonical projection per slim spec in docs/sprints/M-L1-T3c-fetch-schema.md.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
7 Skipped Deployments
|
Phase 0 reviewer (round 1) REJECTED — 2 orphan test files referenced old
fetch-ai schema (would break baseline after registry-dev impl):
1. tests/registry-source-adapters.test.ts:164-202 — describe block
"M-L1 — Fetch.ai agent schema" still parsed old shape (fetch1 prefix,
registeredAt: number, tags, endpoint, profileUrl, isOnline,
reputationScore). Rewrote to "M-L1-T3c — Fetch.ai (Agentverse) raw API
schema" with raw-shape fixture matching real curl response.
2. products/01-registry/tests/stub-adapters.test.ts:150-188 — validFetchAi
fixture used old shape; "fetch-ai stub adapter" describe asserted
against stub. Replaced with thin "fetch-ai real adapter (smoke)" —
factory + zero-yield from empty mock httpClient. Comprehensive
coverage lives in fetch-ai-adapter.test.ts (M-L1-T3b/T3c).
3. packages/types/src/sources/fetch-ai.ts — widened AGENTVERSE_ADDRESS
regex from {38,58} to {50,64} body chars. Real production address
observed at 59 body chars (65 total) — original upper bound rejected
real records. Floor raised to 50 (regex was already too generous).
Updated docs/sprints/M-L1-T3c-fetch-schema.md::Готово когда — explicit
listing of all 3 test files + zero-failed baseline requirement.
Vitest now: 4 RED in fetch-ai-adapter.test.ts (toCanonical projection,
expected — registry-dev impl makes GREEN), 1438 GREEN baseline, 0 unrelated
failures. Ready for Phase 0 round 2.
Contributor
Author
Phase 0 SPEC RE-APPROVED (round 2, architect self-call)Round 1 reviewer rejected with 3 must-fix items (orphan old-schema fixtures in 2 test files + Готово-когда coverage gap). Architect commit Round 2 verdict: SPEC RE-APPROVED. Confirmed:
→ 🤖 Phase 0 reviewer (sub-agent self-call by architect, round 2/3) |
…Card Schema rewrite landed in @paxio/types (architect commit on this branch) changed ZodFetchAiAgent to mirror real Agentverse response shape. Adapter updated to project new raw fields: - system_wide_tags / protocols → capability inference - created_at ISO string → card.createdAt (no conversion) - fetchAiProfileUrl(address) → card.sourceUrl - fetchAiDisplayName(raw) → card.name with fallback chain 14/14 fetch-ai-adapter tests GREEN. Full baseline: 70 files, 1442 passed.
a3ka
pushed a commit
that referenced
this pull request
May 3, 2026
Phase N: 14/14 fetch-ai tests GREEN, baseline 1442/1442, scope clean per commit (registry-dev impl only fetch-ai.ts; architect updated own fixtures + schema + sprint doc). Standards walk PASS. No new tech debt. (architect-applied chore on behalf of reviewer 8d3c19c verdict from /tmp/paxio-rev-pr126 — narrow push permission per scope-guard.md.)
a3ka
pushed a commit
that referenced
this pull request
May 3, 2026
Production bug after PR #126: adapter passes object body to wiring's httpClient.fetch; wrapper passed it as-is to native fetch; Node coerces object via String() → "[object Object]" → Agentverse rejects → adapter silent processed:0. Fix: serialize body to JSON string when it is an object before native fetch. String/Buffer bodies pass through unchanged. 5/5 wiring tests GREEN.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR #120/T-3 authored
ZodFetchAiAgentagainst IMAGINED API. PR #124/T-3-wiring fixed httpClient injection. PR #125/T-3b fixed HTTP method (POST + body). Production smoke 2026-05-03 11:16 UTC: adapter ran (durationMs:109) butprocessed:0— Zod validation rejects every real record.Live curl 2026-05-03 confirmed real response shape:
addressprefix:agent1...(NOTfetch1...)created_atISO string (NOTregisteredAtUnix ms)system_wide_tags(NOTtags)status: "active"|"inactive"string (NOTisOnlineboolean)rating: 0..5float (NOTreputationScore: 0..100)profileUrl: NOT in response — derived from addressTotal ~10K agents in API (offset cap = 9999, verified empirically — far less than my earlier 2M estimate).
Changes (architect zone)
packages/types/src/sources/fetch-ai.ts: schema rewrite + 4 projection helpers (fetchAiProfileUrl,fetchAiRatingToReputation,fetchAiStatusToOnline,fetchAiDisplayName)products/01-registry/tests/fetch-ai-adapter.test.ts: validAgent fixture → real raw shape (28 fields), un-skip toCanonical block + 5 new projection assertionsdocs/sprints/M-L1-T3c-fetch-schema.md: milestone + slim spec for registry-devГотово когда
pnpm typecheckcleanpnpm exec vitest runbaseline GREENprocessed > 0, agent count rises by ~10KVitest output now (RED, expected)
```
Test Files 1 failed (1)
Tests 4 failed | 10 passed (14)
```
4 failures cover toCanonical projection — adapter still uses old field names (
raw.tags,raw.endpoint). Registry-dev impl per slim spec fixes.🤖 Generated with Claude Code