-
Notifications
You must be signed in to change notification settings - Fork 6
Document technical upgrades process #205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| --- | ||
| title: "Technical upgrades" | ||
| weight: 5 | ||
| --- | ||
|
|
||
| # Technical upgrades | ||
|
|
||
| ## What is the technical upgrades process | ||
|
|
||
| The **technical upgrade** process creates new **versions** by re-extracting content from the **latest snapshots** when there are changes not in service terms content, but in the system that extracts them (declarations, filters, engine, or dependencies). | ||
|
|
||
| ## Why technical upgrades are important | ||
|
|
||
| Technical upgrades solve the critical problem of **distinguishing between actual content changes and extraction improvements**. | ||
|
|
||
| Without technical upgrades, improving a declaration would trigger false notifications. For example, if terms have sections A, B, and C but the declaration only extracted A and B, adding section C would make the next version appear to include new content, triggering a notification even though the service's terms never changed. | ||
|
|
||
| With technical upgrades, the system re-extracts from the current snapshot using the improved declaration and creates a new version, that includes section C, marked as a technical upgrade. Next regular tracking then compares against this upgraded version, so only actual content changes trigger notifications. | ||
|
|
||
| ## How technical upgrades work | ||
|
|
||
| For each tracked terms: | ||
|
|
||
| 1. Retrieve the latest snapshot for each source document of the terms | ||
| 2. Re-extract content using latest declarations and engine code | ||
| 3. Create a new version marked as a technical upgrade | ||
|
|
||
| ## Types of changes handled | ||
|
|
||
| 1. Declaration changes: updates to selectors, filters, or removal rules | ||
| 2. Engine changes: updates to the core extraction logic | ||
| 3. Dependency changes: updates to libraries affecting extraction (e.g., HTML-to-Markdown conversion) | ||
|
|
||
| ## Behavior for different scenarios | ||
|
|
||
| ### Selector or filter changes | ||
|
|
||
| **Example:** | ||
|
|
||
| ```json | ||
| // Before: missing section C | ||
| { | ||
| "Privacy Policy": { | ||
| "fetch": "https://example.com/privacy", | ||
| "select": ".section-a, .section-b" | ||
| } | ||
| } | ||
|
|
||
| // After: includes all relevant sections | ||
| { | ||
| "Privacy Policy": { | ||
| "fetch": "https://example.com/privacy", | ||
| "select": ".section-a, .section-b, .section-c" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **What happens:** | ||
|
|
||
| - Retrieves the latest snapshot | ||
| - Re-extracts content using updated selectors and/or filters | ||
| - Creates a new version marked as a technical upgrade | ||
|
|
||
| ### Adding new source documents to combined terms | ||
|
|
||
| **Example:** | ||
|
|
||
| ```json | ||
| // Before: 2 source documents | ||
| { | ||
| "Community Guidelines": { | ||
| "combine": [ | ||
| { "id": "main", "fetch": "https://example.com/community" }, | ||
| { "id": "hate-speech", "fetch": "https://example.com/community/hate-speech" } | ||
| ] | ||
| } | ||
| } | ||
|
|
||
| // After: 3 source documents | ||
| { | ||
| "Community Guidelines": { | ||
| "combine": [ | ||
| { "id": "main", "fetch": "https://example.com/community" }, | ||
| { "id": "hate-speech", "fetch": "https://example.com/community/hate-speech" }, | ||
| { "id": "violence", "fetch": "https://example.com/community/violence" } // NEW | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **What happens:** | ||
|
|
||
| - Fetches and records snapshots **only for new source documents** | ||
| - Retrieves latest snapshots for existing source documents | ||
| - Extracts all documents and creates one new combined version marked as a technical upgrade | ||
|
|
||
| ### Location changes | ||
|
|
||
| **What happens:** | ||
|
|
||
| Nothing, technical upgrades do not fetch from new locations. Location changes represent a genuine change in how the service publishes their terms and should be tracked as a regular content change. | ||
|
|
||
| ### Engine and dependency changes | ||
|
|
||
| When you upgrade the engine or dependencies, extraction logic may change even if declarations remain the same. | ||
|
|
||
| **Examples:** | ||
|
|
||
| - Engine improves HTML entity decoding so ` ` entities are converted to regular spaces instead of appearing literally in versions | ||
| - Library improves table support so complex tables preserve their structure as Markdown tables instead of being converted to plain text | ||
|
|
||
| **What happens:** | ||
|
|
||
| - Retrieves the latest snapshot for each terms | ||
| - Re-extracts using updated code | ||
| - Creates a new version marked as a technical upgrade if output differs | ||
|
|
||
| ## Technical upgrade markers | ||
|
|
||
| Versions created during technical upgrades are marked with: | ||
|
|
||
| - `isTechnicalUpgrade: true` in version metadata | ||
| - Commit message specify it by starting by `Apply technical or declaration upgrade on …` | ||
|
|
||
| ## Running technical upgrades | ||
|
|
||
| Technical upgrades run automatically with `npx ota track`. | ||
|
|
||
| To run them separately, see the [apply-technical-upgrades command]({{< relref "api/cli#applying-technical-upgrades" >}}). | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.