Skip to content

feat: seal api implementation (search + endpoints) - #1799

Draft
cka-y wants to merge 18 commits into
mainfrom
feat/seal_api_1789
Draft

feat: seal api implementation (search + endpoints)#1799
cka-y wants to merge 18 commits into
mainfrom
feat/seal_api_1789

Conversation

@cka-y

@cka-y cka-y commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Summary:

Summarize the changes in the pull request including how it relates to any issues (include the #number, or link them).

Expected behavior:

Explain and/or show screenshots for how you expect the pull request to work in your testing (in case other devices exhibit different behavior).

Testing tips:

Provide tips, procedures and sample files on how to test the feature.
Testers are invited to follow the tips AND to try anything they deem relevant outside the bounds of the testing tips.

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything
  • Add or update any needed documentation to the repo
  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification(https://www.conventionalcommits.org/en/v1.0.0/).
  • Linked all relevant issues
  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

@cka-y cka-y changed the title Feat/seal api 1789 feat: seal api implementation (search + endpoints) Aug 17, 2026
@cka-y

cka-y commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

Built on top of #1795 to match the new schema

Comment on lines +33 to +46
# How long a criterion may keep failing its own check before the failure is confirmed and
# the seal is withdrawn. None means the status flips on the first failing day.
#
# `official` and `stable` have no grace period: they are point-in-time state checks on data
# we already hold, not observations of a fetched artifact, so there is no transient failure
# to debounce.
GRACE_PERIODS: Final[Dict[SealCriterionName, Optional[timedelta]]] = {
SealCriterionName.OFFICIAL: None,
SealCriterionName.STABLE: None,
SealCriterionName.AVAILABLE: timedelta(days=14),
SealCriterionName.COMPLIANT: timedelta(days=30),
SealCriterionName.FRESH_COVERAGE: timedelta(days=7),
SealCriterionName.FRESH_CONTINUOUS: timedelta(days=7),
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cc: @emmambd for confirmation

@emmambd emmambd Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@cka-y Revision:

SealCriterionName.OFFICIAL: None,
SealCriterionName.STABLE: None,
SealCriterionName.AVAILABLE: timedelta(days=14),
SealCriterionName.COMPLIANT: timedelta(days=30),
SealCriterionName.FRESH_COVERAGE: timedelta(days=14),
SealCriterionName.FRESH_CONTINUOUS: None,

Comment on lines +48 to +63
# A criterion that recovers from a confirmed failure is put on probation: it must then go
# this long with no observed failure before it can contribute to the seal again. This is the
# "six clean months" rule - losing the seal is not undone by a single good day.
PROBATION_PERIOD: Final[timedelta] = timedelta(days=180)

# `official` and `stable` are exempt for the same reason they have no grace period. A feed
# that is marked official again is official again; there is no track record to rebuild.
PROBATION_PERIODS: Final[Dict[SealCriterionName, Optional[timedelta]]] = {
SealCriterionName.OFFICIAL: None,
SealCriterionName.STABLE: None,
SealCriterionName.AVAILABLE: PROBATION_PERIOD,
SealCriterionName.COMPLIANT: PROBATION_PERIOD,
SealCriterionName.FRESH_COVERAGE: PROBATION_PERIOD,
SealCriterionName.FRESH_CONTINUOUS: PROBATION_PERIOD,
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

cc: @emmambd for confirmation

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Stable is subject to the probation period (it takes 6 months to earn it). Not sure if that's treated as part of the criteria though in the code and therefore an additional probation period doesn't need to be added

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i was under the impression that it would be as part of the code for the criterion.
question to clarify: if is_producer_url_unstable flag flipped from true to false, do we need to wait 6 months before allowing the criterion to pass given that the feed is older than 6months?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Got it, in that case then no probation period.
Re: question: Nope! Assuming the feed has 6 months of history, the feed would automatically show up as Stable. The only reason it would flip is because of a gap in our manual review, not that the URL has changed, so there's no wait time.

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 Seal of Reliability to the gtfs_feeds endpoint Add Seal of Reliability to feeds search endpoint

3 participants