-
Notifications
You must be signed in to change notification settings - Fork 2
docs: evaluate aggregator provider provenance #113
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 all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'nz-legislation-tool': patch | ||
| --- | ||
|
|
||
| Record source, provenance, licence, and attribution constraints for AustLII and NZLII as evaluation-only discovery candidates; runtime support and redistribution remain blocked. |
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,73 @@ | ||
| { | ||
| "version": "1.0.0", | ||
| "policy": { | ||
| "officialSourceFirst": true, | ||
| "runtimeEnabled": false, | ||
| "legalRecordsIncluded": false, | ||
| "submissionAllowed": false, | ||
| "attributionRequired": true, | ||
| "licenceReviewRequired": true | ||
| }, | ||
| "candidates": [ | ||
| { | ||
| "providerId": "austlii", | ||
| "name": "Australasian Legal Information Institute", | ||
| "jurisdictions": [ | ||
| "nz", | ||
| "au-commonwealth", | ||
| "au-act", | ||
| "au-nsw", | ||
| "au-nt", | ||
| "au-qld", | ||
| "au-sa", | ||
| "au-tas", | ||
| "au-vic", | ||
| "au-wa" | ||
| ], | ||
| "sourceUrls": [ | ||
| "https://www.austlii.edu.au/", | ||
| "https://www5.austlii.edu.au/austlii/help/legis.html", | ||
| "https://www5.austlii.edu.au/au/legis/cth/table/" | ||
| ], | ||
| "sourceRole": "cross-jurisdiction discovery and comparison index", | ||
| "provenanceStatus": "requires-record-level-source-attribution", | ||
| "licenceStatus": "review-required-before-redistribution", | ||
| "licenceEvidenceUrl": "https://www5.austlii.edu.au/au/legis/cth/table/", | ||
| "coverageCaveats": [ | ||
| "AustLII states that its legislation databases may lag amendments after the database update.", | ||
| "The Commonwealth legislation table identifies Commonwealth ownership and reserves rights outside permitted use.", | ||
| "Aggregator content must not be treated as an official consolidated source." | ||
| ], | ||
| "runtimeDecision": "evaluation-only", | ||
| "nextEvidence": [ | ||
| "obtain written redistribution terms for the intended integration", | ||
| "prove record-level links to the originating official register", | ||
| "define freshness and conflict handling against official sources" | ||
| ] | ||
| }, | ||
| { | ||
| "providerId": "nzlii", | ||
| "name": "New Zealand Legal Information Institute", | ||
| "jurisdictions": ["nz"], | ||
| "sourceUrls": [ | ||
| "https://www.nzlii.org/", | ||
| "https://austlii.community/foswiki/NZResources/NZLIIUserGuide/NZLIIUsagePolicy" | ||
| ], | ||
| "sourceRole": "New Zealand legal-information discovery index", | ||
| "provenanceStatus": "requires-record-level-source-attribution", | ||
| "licenceStatus": "review-required-before-redistribution", | ||
| "licenceEvidenceUrl": "https://austlii.community/foswiki/NZResources/NZLIIUserGuide/NZLIIUsagePolicy", | ||
| "coverageCaveats": [ | ||
| "The usage policy limits copying and reuse to permitted purposes and applicable copyright law.", | ||
| "Official New Zealand legislation remains the authority for current text and status." | ||
| ], | ||
| "runtimeDecision": "evaluation-only", | ||
| "nextEvidence": [ | ||
| "confirm intended automated access is permitted", | ||
| "prove record-level links to legislation.govt.nz", | ||
| "define freshness and missing-record reporting" | ||
| ] | ||
| } | ||
| ], | ||
| "fixturePolicy": "metadata-only evaluation fixture; no legal text, extracted records, or fabricated coverage claims" | ||
| } |
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,50 @@ | ||
| import { readFileSync } from 'node:fs'; | ||
| import { resolve } from 'node:path'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| const fixture = JSON.parse( | ||
| readFileSync( | ||
| resolve(process.cwd(), 'docs/maintainers/aggregator-provider-evaluation.json'), | ||
| 'utf8' | ||
| ) | ||
| ) as { | ||
| policy: Record<string, boolean>; | ||
| candidates: Array<{ | ||
| providerId: string; | ||
| sourceUrls: string[]; | ||
| provenanceStatus: string; | ||
| licenceStatus: string; | ||
| runtimeDecision: string; | ||
| nextEvidence: string[]; | ||
| }>; | ||
| fixturePolicy: string; | ||
| }; | ||
|
|
||
| describe('aggregator provider evaluation', () => { | ||
| it('keeps the evaluation fail-closed and metadata-only', () => { | ||
| expect(fixture.policy).toMatchObject({ | ||
| officialSourceFirst: true, | ||
| runtimeEnabled: false, | ||
| legalRecordsIncluded: false, | ||
| submissionAllowed: false, | ||
| attributionRequired: true, | ||
| licenceReviewRequired: true, | ||
| }); | ||
| expect(fixture.fixturePolicy).toContain('metadata-only'); | ||
| expect(fixture.fixturePolicy).toContain('no legal text'); | ||
| }); | ||
|
|
||
| it('requires HTTPS provenance, licence review, and explicit runtime gating', () => { | ||
| expect(fixture.candidates.length).toBeGreaterThanOrEqual(2); | ||
| for (const candidate of fixture.candidates) { | ||
| expect(candidate.sourceUrls.length).toBeGreaterThan(0); | ||
| for (const sourceUrl of candidate.sourceUrls) { | ||
| expect(new URL(sourceUrl).protocol).toBe('https:'); | ||
| } | ||
| expect(candidate.provenanceStatus).toContain('requires'); | ||
| expect(candidate.licenceStatus).toContain('review-required'); | ||
| expect(candidate.runtimeDecision).toBe('evaluation-only'); | ||
| expect(candidate.nextEvidence.length).toBeGreaterThan(0); | ||
| } | ||
| }); | ||
| }); | ||
Oops, something went wrong.
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.
🛑 Crash Risk: Wrap URL construction in try-catch to prevent cryptic test failures when encountering malformed URLs. Without error handling, the test crashes with an unhelpful error instead of clearly identifying which URL is invalid.