Repository navigation
Record tracking results in a dedicated Git repository - #1275
Merged
Merged
Conversation
The recorder's definition of a safe path segment moves verbatim to src/git so it stays single: hostile pathspecs are a git-level hazard, and other modules persisting through git need the exact same predicate. The recorder keeps its canMatchRecordFilePath policy wrapper on top.
Reads the declarations exactly as they were at a given commit of
their repository, listing { serviceId, termsType } pairs without
loading full Service objects.
Orchestrates a run from the storage perspective: a run-start commit with the skips known upfront, per-terms outcomes feeding counters and transitions, a run-completion commit, and additive finalization of a crashed run with its coverage and tracked counts derived from the per-terms commits. The run only becomes current once its run-start commit landed, and every commit of a run carries its runId as a Git trailer.
The engine-facing entry point: translates the tracking lifecycle and domain objects into recorder operations and owns the run policy, namely crash recovery gating with retry, declarations commit resolution, coverage of partial runs and categorisation of failure reasons. Emits warn events instead of logging. Creating it requires the collection id that identifies the collection in every persisted run. Failures of the audit trail never fail the tracking itself: a failed run-start commit disables tracking-results for the run, and a failed push only warns, since every record is already committed locally and the next successful finalize pushes all accumulated commits.
Errors were pushed from concurrent callbacks, so their order depended on completion timing; consumers treating the failure reasons as an ordered value would see spurious changes between identical runs.
The error listener ran its asynchronous cleanup on every emission: two fatal errors in close succession ran two concurrent cleanups, racing the recorder finalize pushes and process.exit. The sequence is memoised behind a promise, and its force-exit timer is cleared once the cleanup completes.
The async.queue error callback is fire-and-forget, so drain() could resolve while a failure was still being handled; the worker now awaits the handler.
The Archivist starts and completes a tracking-results run around its queue, records each outcome as it settles, and relays the module's warnings. A failure to complete the run routes to the fatal shutdown, and recording happens before the fatal emission since nothing may write to the repositories once the shutdown started. When the collection provides no id, tracking-results is disabled with a warning. Technical upgrades skip the lifecycle entirely.
Member
|
I made these changes after our pairing session with @Ndpnt:
|
clementbiron
force-pushed
the
tracking-results
branch
from
September 23, 2026 14:32
94150c7 to
483e0eb
Compare
clementbiron
approved these changes
Sep 23, 2026
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.
Implements the first part of RFC #1241: a
tracking-resultsGit repository recording, for each terms, its latest tracking status, and for each run, its lifecycle (start, per-terms outcomes, completion). Its history is tamper-evident, so it shows which terms were actually tracked, when, and why they failed.