Skip to content

Add validity to the document - #34

Merged
shruti0025 merged 11 commits into
mainfrom
feature/111-add-validity-to-document
Sep 25, 2026
Merged

shruti0025 merged 11 commits into
mainfrom
feature/111-add-validity-to-document

Conversation

@shruti0025

Copy link
Copy Markdown
Contributor

Add validity to the document

@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

The author of this PR, shruti0025, is not an activated member of this organization on Codecov.
Please activate this user on Codecov to display this PR comment.
Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.
Please don't hesitate to email us at support@codecov.io with any questions.

Comment thread pipeline/activities.py Outdated
Comment thread pipeline/db.py Outdated
Comment thread pipeline/catalog_builder.py Outdated
@shruti0025
shruti0025 force-pushed the feature/111-add-validity-to-document branch from 3645a8c to 394a92f Compare September 23, 2026 03:52
Comment thread pipeline/document_repository.py Outdated
Comment thread pipeline/api.py Outdated
Comment thread pipeline/api.py
Comment thread docs/ADR/0005-document-validity-filters-search.md
Comment thread ui/src/views/DocumentOpsView.jsx Outdated
* reviewer is confirming or moving a real period, not inventing one. Mirrors
* pipeline/document_validity.py - the server revalidates whatever is sent.
*/
function plusOneYearISODate(stamp) {

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.

Remove this before merging

The catalog announced to the Discovery Service carried no lifetime, so an
announcement stood indefinitely under updateMode: MERGE. The prod approver
now names the window at the approve-prod gate, where they already decide a
document is fit for PROD.

Validated and stored before anything is promoted, so a rejected window is a
400 that leaves the document parked at the gate.
A chunk, once ingested, answered searches forever — a rabi sowing advisory
is wrong advice in June. Every chunk now carries start_date/end_date in its
Qdrant payload, defaulted on upload to the upload day plus one year and
editable by the reviewer beside the document type.

Search returns only chunks whose period covers today. Chunks ingested before
validity existed carry neither date and stay searchable, so adding this does
not empty the live index. The clock is injected, so an operator can ask what
search would return on another day.
The announcement lifetime is no longer required. Document validity, added
separately, is the only validity the pipeline now tracks.

BREAKING CHANGE: POST /documents/{id}/approve-prod no longer accepts a body,
and network_valid_from/network_valid_to are gone from the document API.
Consumers reading those fields must drop them. The documents columns are
left in place, unread, rather than dropped from live databases.
db.upsert_document computed the default period itself, putting domain
knowledge in a layer that is meant to hold none. The upload endpoints now
compute it and pass it down; db.py stores the dates verbatim.

Also parses created_at with the date library instead of slicing its first
ten characters, so a timestamp in an unexpected shape reports "unreadable"
rather than whatever those characters happen to spell.
@shruti0025
shruti0025 force-pushed the feature/111-add-validity-to-document branch from 43b3b35 to d49db83 Compare September 25, 2026 12:25
@shruti0025
shruti0025 merged commit 01a5833 into main Sep 25, 2026
3 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.

2 participants