Repository navigation
Reliability sprint b - #50
Merged
Merged
Conversation
A decision was delivered only to a run waiting in the same process: with a second Core, or a decision written to the database, the run never woke and expired, and a decision landing just before the expiry left the database saying approved while the tool never ran. A waiting run now also re-reads its approval from the store, and after expiring it honours whatever the store holds. At startup, runs a previous process of the same kind (api: or telegram:) left queued, running or waiting fail as interrupted and their approvals expire. The API stops gracefully on Ctrl-C or SIGTERM.
The daily limits were checked before the work and counted after it, so requests arriving together (fetches waiting for their host slot, above all) all passed the same check. Admitted runs and fetches now hold a reservation counted against the limit until the store records them, and the check-then-reserve step is serialised. The monthly budget is also re-checked before every model call of a run, so one long run cannot overshoot it. The per-host pacing map drops expired entries instead of growing without bound.
- Analyses, discoveries and drafts started from the API, and every scheduled step, run as jobs: a failure is recorded with its error and shown on the site page (GET /api/jobs too) instead of 'started' forever; jobs with no result after two hours are reported as interrupted. - The hourly tick runs each step on its own, so a failing collection no longer skips maintenance or the briefing. Maintenance runs once a local day from 03:00 and the review once a week from Monday 04:00, based on their last successful run: a late or missed tick no longer skips them. - A briefing built but not delivered is sent again within its window (channels already sent are skipped). An address the mail library rejects no longer aborts the tick, recipients get the briefing in Bcc, and recipient addresses with control characters are refused. - A publication is marked 'sending' before anything leaves: two workers cannot both send it, and one cut short stays 'sending' until a person checks the CMS and marks it failed, instead of being sent twice.
Editor Mode had an EDITOR_GITHUB_TOKEN it never used, and the Core forwards only Accept and conditional headers, so source discovery ran on GitHub's unauthenticated rate limit. api.fetch.credentials lets the operator give the Core a header value (from an environment variable) for an exact host: added over https only, on the first request only, never after a redirect. Callers never hold the token. The unused Editor Mode setting is removed, and the README documents both it and the publishing secret variables.
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.
What changes
How it was tested