Repository navigation
Gated MOD-API harvest (#415, Project 2 Phase 1+2) - #475
Merged
Merged
Conversation
…t 2) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ions Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ingest gate Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…resolve Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…e enqueue Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…efault) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…hin time_limit Final-review N1: discover() does all fetches before enqueue; at the 1s politeness floor a 500-candidate run exceeds harvest_peer's 900s time_limit and is killed before ingesting anything. 200 stays well under; default run (50) is ~1 min. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Project 2 — gated MOD-API harvest (Phase 1+2)
Harvest ontologies from one curated remote MOD-API catalogue, admit survivors through a cheap pre-enqueue gate, and enqueue each through the existing ingestion pipeline with catalogue provenance recorded. Builds on the Project-1 federation client (#472). Off by default; dry-run by default — nothing harvests until
HARVEST_ENABLED=true+ a configured peer, and a live enqueue needs an explicitdry_run=false.The gate — not the harvest — is the deliverable: the admission gate is deliberately more lenient than the pipeline's post-ingest quality gate (it admits absent/unmappable licenses), because
decide_publish_statusremains the real safety boundary and holds anything non-compliant/untitled asneeds_review. Harvested content is enqueued with nodeclared_licenseand no owner attribution, so nothing is laundered past that gate.What's here
source_cataloguecolumn onversions(migrationc7e3a91d5f20, additive) threadedIngestionRequest → run_ingestion → ingest_ontology.discovery/package:Candidate+DiscoverySourceinterface; admission gate (bad_iri/no_title/duplicate/license_noncompliant, reusingfind_ontology_by_canonical_iri+ the license gate); peer-politeness rate limiter + run budget; paginatingModApiHarvestSource(reuses the SSRF-guarded federation client via a new thinfetch_mod_json; resolves each artefact's distribution download URL, falls back to ingest-by-IRI); gatedrun_harvestrunner +HarvestReport.harvest_peerCelery task (opt-in, not scheduled) +POST /api/v1/admin/harvest(admin-only, dry-run default,limit1–200).Safety / review (whole-branch review verdict: SHIP, zero blocking)
url=/iri=) — goes through the SSRF-guarded transport. No bypass for a hostile peer.limit-derived (bounded request volume even against an adversarial peer); politeness floor between requests.harvest_peeris not inbeat_schedule.Tests
217 passing across the touched surface (discovery 37, ingestion 142, integration 20, federation client 18). Subagent-driven: fresh implementer + reviewer per task, plus an Opus whole-branch review.
Documented limitations (non-blocking, for a later freshness/robustness increment)
/search/metadatafallback and nohydra:nextpaging (a peer that capspage_sizebelow the request stops after page 1) — fails cleanly.Candidate.landing_url/source_catalogue_id/labelare carried for future report enrichment, not yet surfaced.Plan:
docs/superpowers/plans/2026-11-24-mod-api-harvest-increment.md. Deferred to later phases: GitHub OWL-scan source, freshness/re-harvest loop, full admin surface.🤖 Generated with Claude Code