Skip to content

feat: add NetworkConsistencyChecker for managed publisher networks#539

Merged
bokelley merged 6 commits intomainfrom
bokelley/network-checker
Apr 15, 2026
Merged

feat: add NetworkConsistencyChecker for managed publisher networks#539
bokelley merged 6 commits intomainfrom
bokelley/network-checker

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

Summary

Closes #536

  • Adds NetworkConsistencyChecker class that validates managed publisher network deployments by detecting five failure modes: orphaned pointers, stale pointers, missing pointers, schema errors, and unreachable agent endpoints
  • Adds adcp check-network CLI command with --url, --domains, --json, --concurrency, and --timeout flags
  • Includes SSRF protection via validateAgentUrl(), response size limits (1MB), HTTP redirect blocking, error message sanitization, and concurrency capping

Test plan

  • 11 unit tests covering all 5 failure modes plus clean network, domains-only discovery, constructor validation, authoritative fetch failure, and stale pointer edge case
  • Full test suite passes (2958 tests, 0 failures)
  • npm run build compiles cleanly
  • adcp check-network --help displays usage
  • Code review and security review addressed

🤖 Generated with Claude Code

bokelley and others added 4 commits April 15, 2026 06:45
)

Validates adagents.json deployment health across managed domains by
detecting orphaned/stale/missing pointers, schema errors, and
unreachable agent endpoints. Includes SSRF protection, response size
limits, and a CLI command (adcp check-network).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use Buffer.byteLength instead of text.length for response size limit
- Add 8 new tests: redirect edge cases (self-referential, non-HTTPS,
  one-hop follow), constructor validation, domains-only fallback,
  subdomain extraction, 405 agent health, tightened assertions
- Organize tests into nested describe blocks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add checkedAt (ISO 8601) timestamp to NetworkCheckReport
- Add summary object with pre-computed counts (totalIssues, etc.)
- Check Content-Length header before reading response body to prevent OOM
- Add onProgress callback for long-running checks across many domains
- Wire progress into CLI (stderr output during check phases)
- CLI now uses report.summary instead of recomputing counts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace redirect: 'error' with redirect: 'manual' + validated one-hop
following in fetchJson and probeAgent. CDN 301 redirects (e.g. bare
domain to www) no longer cause false missing_pointer results.

Security: redirect targets are validated by validateAgentUrl() and must
use HTTPS. Missing Location headers produce explicit errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Comment thread test/lib/network-consistency-checker.test.js Fixed
CodeQL flagged urlStr.includes('www.example.com') as an incomplete URL
substring sanitization. Switched to exact equality check since this is
a test mock dispatching on known URLs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bokelley bokelley merged commit 8376f90 into main Apr 15, 2026
11 checks passed
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.

Add network consistency checker to @adcp/client

2 participants