rashid 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. rashid-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +32 -0
  2. rashid-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  3. rashid-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +20 -0
  4. rashid-0.1.0/.github/dependabot.yml +31 -0
  5. rashid-0.1.0/.github/pull_request_template.md +14 -0
  6. rashid-0.1.0/.github/workflows/ci.yml +62 -0
  7. rashid-0.1.0/.github/workflows/dependabot-automerge.yml +31 -0
  8. rashid-0.1.0/.github/workflows/publish.yml +81 -0
  9. rashid-0.1.0/.github/workflows/security-audit.yml +124 -0
  10. rashid-0.1.0/.github/workflows/spec-sync.yml +96 -0
  11. rashid-0.1.0/.gitignore +11 -0
  12. rashid-0.1.0/.mutation-baseline +19 -0
  13. rashid-0.1.0/.pip-audit-ignores +9 -0
  14. rashid-0.1.0/.pre-commit-config.yaml +93 -0
  15. rashid-0.1.0/AGENTS.md +15 -0
  16. rashid-0.1.0/CHANGELOG.md +37 -0
  17. rashid-0.1.0/LICENSE +201 -0
  18. rashid-0.1.0/PKG-INFO +115 -0
  19. rashid-0.1.0/README.md +96 -0
  20. rashid-0.1.0/SECURITY.md +31 -0
  21. rashid-0.1.0/SPEC_REF +3 -0
  22. rashid-0.1.0/docs/contributing.md +87 -0
  23. rashid-0.1.0/docs/rules.md +48 -0
  24. rashid-0.1.0/pyproject.toml +201 -0
  25. rashid-0.1.0/scripts/mutation_score.py +321 -0
  26. rashid-0.1.0/scripts/pip_audit_ignores.py +72 -0
  27. rashid-0.1.0/scripts/vendor_spec_fixtures.py +167 -0
  28. rashid-0.1.0/src/rashid/__init__.py +32 -0
  29. rashid-0.1.0/src/rashid/_multihash.py +58 -0
  30. rashid-0.1.0/src/rashid/_spdx.py +740 -0
  31. rashid-0.1.0/src/rashid/catalog.py +202 -0
  32. rashid-0.1.0/src/rashid/cli.py +90 -0
  33. rashid-0.1.0/src/rashid/config.py +35 -0
  34. rashid-0.1.0/src/rashid/data/__init__.py +191 -0
  35. rashid-0.1.0/src/rashid/data/checks.py +1267 -0
  36. rashid-0.1.0/src/rashid/data/reader.py +170 -0
  37. rashid-0.1.0/src/rashid/live.py +399 -0
  38. rashid-0.1.0/src/rashid/model.py +100 -0
  39. rashid-0.1.0/src/rashid/rule.py +56 -0
  40. rashid-0.1.0/src/rashid/rules/__init__.py +114 -0
  41. rashid-0.1.0/src/rashid/rules/_common.py +42 -0
  42. rashid-0.1.0/src/rashid/rules/assets.py +183 -0
  43. rashid-0.1.0/src/rashid/rules/bbox.py +112 -0
  44. rashid-0.1.0/src/rashid/rules/collections.py +268 -0
  45. rashid-0.1.0/src/rashid/rules/conformance.py +141 -0
  46. rashid-0.1.0/src/rashid/rules/files.py +215 -0
  47. rashid-0.1.0/src/rashid/rules/item_mirror.py +143 -0
  48. rashid-0.1.0/src/rashid/rules/license.py +82 -0
  49. rashid-0.1.0/src/rashid/rules/links.py +198 -0
  50. rashid-0.1.0/src/rashid/rules/partitions.py +93 -0
  51. rashid-0.1.0/src/rashid/rules/provenance.py +172 -0
  52. rashid-0.1.0/src/rashid/rules/providers.py +102 -0
  53. rashid-0.1.0/src/rashid/rules/temporal.py +72 -0
  54. rashid-0.1.0/src/rashid/rules/titles.py +91 -0
  55. rashid-0.1.0/src/rashid/rules/viz.py +254 -0
  56. rashid-0.1.0/src/rashid/runner.py +256 -0
  57. rashid-0.1.0/src/rashid/schema.py +217 -0
  58. rashid-0.1.0/src/rashid/structural.py +135 -0
  59. rashid-0.1.0/tests/__init__.py +0 -0
  60. rashid-0.1.0/tests/conftest.py +295 -0
  61. rashid-0.1.0/tests/fixtures/profile-examples/catalog.json +42 -0
  62. rashid-0.1.0/tests/fixtures/profile-examples/vector-collection.json +140 -0
  63. rashid-0.1.0/tests/fixtures/profile-examples/vector-partitioned-collection.json +147 -0
  64. rashid-0.1.0/tests/fixtures/profile-examples/vector-partitioned-item.json +75 -0
  65. rashid-0.1.0/tests/fixtures/reference-catalog/AGENTS.md +5 -0
  66. rashid-0.1.0/tests/fixtures/reference-catalog/README.md +19 -0
  67. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/AGENTS.md +4 -0
  68. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/README.md +13 -0
  69. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/boston-open-space/AGENTS.md +7 -0
  70. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/boston-open-space/README.md +28 -0
  71. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/boston-open-space/collection.json +251 -0
  72. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/boston-open-space/styles/categorical.json +46 -0
  73. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/boston-open-space/styles/graduated.json +38 -0
  74. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/boston-open-space/styles/labeled.json +65 -0
  75. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/catalog.json +53 -0
  76. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/netherlands-provinces/AGENTS.md +7 -0
  77. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/netherlands-provinces/README.md +27 -0
  78. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/netherlands-provinces/collection.json +208 -0
  79. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/netherlands-provinces/styles/categorical.json +54 -0
  80. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/netherlands-provinces/styles/labeled.json +73 -0
  81. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/us-counties/AGENTS.md +7 -0
  82. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/us-counties/README.md +27 -0
  83. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/us-counties/collection.json +227 -0
  84. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/us-counties/styles/categorical.json +126 -0
  85. rashid-0.1.0/tests/fixtures/reference-catalog/boundaries/us-counties/styles/labeled.json +145 -0
  86. rashid-0.1.0/tests/fixtures/reference-catalog/catalog.json +60 -0
  87. rashid-0.1.0/tests/fixtures/reference-catalog/mirror/AGENTS.md +4 -0
  88. rashid-0.1.0/tests/fixtures/reference-catalog/mirror/README.md +11 -0
  89. rashid-0.1.0/tests/fixtures/reference-catalog/mirror/catalog.json +41 -0
  90. rashid-0.1.0/tests/fixtures/reference-catalog/mirror/san-francisco-addresses/AGENTS.md +7 -0
  91. rashid-0.1.0/tests/fixtures/reference-catalog/mirror/san-francisco-addresses/README.md +28 -0
  92. rashid-0.1.0/tests/fixtures/reference-catalog/mirror/san-francisco-addresses/collection.json +282 -0
  93. rashid-0.1.0/tests/fixtures/reference-catalog/mirror/san-francisco-addresses/styles/default.json +23 -0
  94. rashid-0.1.0/tests/fixtures/reference-catalog/raster/AGENTS.md +4 -0
  95. rashid-0.1.0/tests/fixtures/reference-catalog/raster/README.md +11 -0
  96. rashid-0.1.0/tests/fixtures/reference-catalog/raster/catalog.json +41 -0
  97. rashid-0.1.0/tests/fixtures/reference-catalog/raster/sample-cog/AGENTS.md +7 -0
  98. rashid-0.1.0/tests/fixtures/reference-catalog/raster/sample-cog/README.md +31 -0
  99. rashid-0.1.0/tests/fixtures/reference-catalog/raster/sample-cog/collection.json +154 -0
  100. rashid-0.1.0/tests/fixtures/reference-catalog/reference/AGENTS.md +4 -0
  101. rashid-0.1.0/tests/fixtures/reference-catalog/reference/README.md +12 -0
  102. rashid-0.1.0/tests/fixtures/reference-catalog/reference/catalog.json +47 -0
  103. rashid-0.1.0/tests/fixtures/reference-catalog/reference/natural-earth-countries/AGENTS.md +7 -0
  104. rashid-0.1.0/tests/fixtures/reference-catalog/reference/natural-earth-countries/README.md +27 -0
  105. rashid-0.1.0/tests/fixtures/reference-catalog/reference/natural-earth-countries/collection.json +811 -0
  106. rashid-0.1.0/tests/fixtures/reference-catalog/reference/natural-earth-populated-places/AGENTS.md +7 -0
  107. rashid-0.1.0/tests/fixtures/reference-catalog/reference/natural-earth-populated-places/README.md +27 -0
  108. rashid-0.1.0/tests/fixtures/reference-catalog/reference/natural-earth-populated-places/collection.json +687 -0
  109. rashid-0.1.0/tests/fixtures/reference-catalog/tabular/AGENTS.md +4 -0
  110. rashid-0.1.0/tests/fixtures/reference-catalog/tabular/README.md +11 -0
  111. rashid-0.1.0/tests/fixtures/reference-catalog/tabular/catalog.json +41 -0
  112. rashid-0.1.0/tests/fixtures/reference-catalog/tabular/eurostat-electricity-prices/AGENTS.md +8 -0
  113. rashid-0.1.0/tests/fixtures/reference-catalog/tabular/eurostat-electricity-prices/README.md +45 -0
  114. rashid-0.1.0/tests/fixtures/reference-catalog/tabular/eurostat-electricity-prices/collection.json +171 -0
  115. rashid-0.1.0/tests/fixtures/requirements.yaml +1079 -0
  116. rashid-0.1.0/tests/fixtures/schema/v0.1.0/schema.json +508 -0
  117. rashid-0.1.0/tests/integration/__init__.py +0 -0
  118. rashid-0.1.0/tests/integration/_data_assets.py +222 -0
  119. rashid-0.1.0/tests/integration/test_data_catalog.py +146 -0
  120. rashid-0.1.0/tests/integration/test_data_checks.py +468 -0
  121. rashid-0.1.0/tests/integration/test_data_item_mirror.py +171 -0
  122. rashid-0.1.0/tests/integration/test_data_remote.py +82 -0
  123. rashid-0.1.0/tests/integration/test_data_storage.py +509 -0
  124. rashid-0.1.0/tests/integration/test_live_remote.py +67 -0
  125. rashid-0.1.0/tests/integration/test_reference_catalog.py +65 -0
  126. rashid-0.1.0/tests/integration/test_runner_config.py +72 -0
  127. rashid-0.1.0/tests/integration/test_validate_clean.py +56 -0
  128. rashid-0.1.0/tests/integration/test_validate_kitchen_sink.py +91 -0
  129. rashid-0.1.0/tests/unit/__init__.py +0 -0
  130. rashid-0.1.0/tests/unit/test_catalog_graph.py +113 -0
  131. rashid-0.1.0/tests/unit/test_data.py +220 -0
  132. rashid-0.1.0/tests/unit/test_data_reader.py +182 -0
  133. rashid-0.1.0/tests/unit/test_live.py +417 -0
  134. rashid-0.1.0/tests/unit/test_model.py +68 -0
  135. rashid-0.1.0/tests/unit/test_multihash.py +49 -0
  136. rashid-0.1.0/tests/unit/test_rules_assets.py +150 -0
  137. rashid-0.1.0/tests/unit/test_rules_bbox.py +104 -0
  138. rashid-0.1.0/tests/unit/test_rules_collections.py +336 -0
  139. rashid-0.1.0/tests/unit/test_rules_conformance.py +131 -0
  140. rashid-0.1.0/tests/unit/test_rules_files.py +238 -0
  141. rashid-0.1.0/tests/unit/test_rules_item_mirror.py +158 -0
  142. rashid-0.1.0/tests/unit/test_rules_license.py +70 -0
  143. rashid-0.1.0/tests/unit/test_rules_links.py +233 -0
  144. rashid-0.1.0/tests/unit/test_rules_partitions.py +111 -0
  145. rashid-0.1.0/tests/unit/test_rules_provenance.py +136 -0
  146. rashid-0.1.0/tests/unit/test_rules_providers.py +83 -0
  147. rashid-0.1.0/tests/unit/test_rules_temporal.py +73 -0
  148. rashid-0.1.0/tests/unit/test_rules_titles.py +79 -0
  149. rashid-0.1.0/tests/unit/test_rules_viz.py +245 -0
  150. rashid-0.1.0/tests/unit/test_schema.py +276 -0
  151. rashid-0.1.0/tests/unit/test_schema_uri_invariant.py +59 -0
  152. rashid-0.1.0/tests/unit/test_spec_coverage.py +208 -0
  153. rashid-0.1.0/tests/unit/test_structural.py +181 -0
  154. rashid-0.1.0/uv.lock +3151 -0
  155. rashid-0.1.0/zizmor.yml +14 -0
@@ -0,0 +1,32 @@
1
+ name: Bug report
2
+ description: A validation result is wrong, or rashid crashes
3
+ labels: [bug]
4
+ body:
5
+ - type: textarea
6
+ id: what-happened
7
+ attributes:
8
+ label: What happened?
9
+ description: Include the command you ran and the output you got.
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: expected
14
+ attributes:
15
+ label: What did you expect?
16
+ validations:
17
+ required: true
18
+ - type: textarea
19
+ id: catalog
20
+ attributes:
21
+ label: Minimal catalog to reproduce
22
+ description: >-
23
+ The smallest catalog JSON (or snippet) that triggers the problem.
24
+ Strip anything private.
25
+ render: json
26
+ - type: input
27
+ id: version
28
+ attributes:
29
+ label: rashid version
30
+ description: Output of `rashid --version`
31
+ validations:
32
+ required: true
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: Security vulnerability
4
+ url: https://github.com/portolan-sdi/rashid/security/advisories/new
5
+ about: Report security issues privately via GitHub Security Advisories.
@@ -0,0 +1,20 @@
1
+ name: Feature request
2
+ description: Propose a new validation rule or capability
3
+ labels: [enhancement]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: What problem does this solve?
9
+ description: >-
10
+ For new rules: which Portolan spec requirement would it check, and
11
+ what does a violating catalog look like?
12
+ validations:
13
+ required: true
14
+ - type: textarea
15
+ id: proposal
16
+ attributes:
17
+ label: Proposed behavior
18
+ description: Expected findings, severity, and rule ID if applicable.
19
+ validations:
20
+ required: true
@@ -0,0 +1,31 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: github-actions
4
+ directory: /
5
+ schedule:
6
+ interval: weekly
7
+ labels: [dependencies, github-actions]
8
+ open-pull-requests-limit: 5
9
+ commit-message:
10
+ prefix: ci
11
+ cooldown:
12
+ default-days: 7
13
+
14
+ - package-ecosystem: uv
15
+ directory: /
16
+ schedule:
17
+ interval: weekly
18
+ labels: [dependencies, python]
19
+ open-pull-requests-limit: 10
20
+ commit-message:
21
+ prefix: build
22
+ include: scope
23
+ cooldown:
24
+ default-days: 7
25
+ groups:
26
+ development-dependencies:
27
+ dependency-type: development
28
+ update-types: [minor, patch]
29
+ production-dependencies:
30
+ dependency-type: production
31
+ update-types: [minor, patch]
@@ -0,0 +1,14 @@
1
+ # Description
2
+
3
+ <!-- What does this PR do, and why? -->
4
+
5
+ ## Changes
6
+
7
+ -
8
+
9
+ ## Checklist
10
+
11
+ - [ ] Tests cover the change (each new rule has valid + violating cases)
12
+ - [ ] `uv run pre-commit run --all-files` and `--hook-stage pre-push` pass
13
+ - [ ] README updated if rules or CLI behavior changed
14
+ - [ ] Commit messages follow conventional commits (enforced by commitizen)
@@ -0,0 +1,62 @@
1
+ # Thin caller — synced from portolan-sdi/portolan-ops (ci/python-package/).
2
+ # CI logic lives in ops' reusable-python-ci.yml; change it there.
3
+ #
4
+ # This file carries repo-specific inputs, so it is not managed by ops sync.
5
+ # The workflow it calls is, through the @v1 tag.
6
+ #
7
+ # Replaces tests.yml (lint, security, matrix) and nightly.yml (mutation).
8
+ # security-audit.yml stays: it files a tracking issue on pip-audit
9
+ # findings, which the shared security job does not do
10
+ # (portolan-sdi/portolan-ops#14).
11
+ name: CI
12
+
13
+ on:
14
+ push:
15
+ branches: [main]
16
+ pull_request:
17
+ branches: [main]
18
+ schedule:
19
+ # One nightly run replaces the separate test and mutation crons.
20
+ # Distinct minute so the fleet doesn't fire at once.
21
+ - cron: "19 2 * * *"
22
+ workflow_dispatch:
23
+
24
+ permissions:
25
+ contents: read
26
+
27
+ concurrency:
28
+ group: ${{ github.workflow }}-${{ github.ref }}
29
+ cancel-in-progress: true
30
+
31
+ jobs:
32
+ ci:
33
+ # v1 is a moving major tag. Compatible changes arrive when ops moves
34
+ # it; a breaking change ships as v2 and reaches this repo as a
35
+ # Dependabot PR.
36
+ uses: portolan-sdi/portolan-ops/.github/workflows/reusable-python-ci.yml@v1
37
+ permissions:
38
+ contents: read
39
+ # The reusable test job requests this for Codecov OIDC even when the
40
+ # upload is off, and a caller must grant what the called workflow
41
+ # requests.
42
+ id-token: write
43
+ with:
44
+ # rashid reads and writes files, and path handling is where Windows
45
+ # breaks. The shared default is ubuntu alone.
46
+ os: '["ubuntu", "macos", "windows"]'
47
+ # The data pass needs rasterio, pyproj, and the rest of the
48
+ # geospatial stack.
49
+ sync-args: "--extra data"
50
+ # Package path, not package name: coverage accepts either, and wily
51
+ # reads this as a directory to walk.
52
+ coverage-target: src/rashid
53
+ bandit-target: src/rashid
54
+ # rashid has no Codecov project. The upload step fails the run on
55
+ # error, so leaving this on would break every build. The 90%
56
+ # diff-cover gate still runs.
57
+ codecov: false
58
+ # Nightly sweep. Two measured runs took 15 and 16 minutes, both
59
+ # scoring 75.08% on 4650 testable mutants. 45 leaves room for the
60
+ # suite to grow without a timeout masquerading as a regression.
61
+ mutation: true
62
+ mutation-timeout: 45
@@ -0,0 +1,31 @@
1
+ name: Dependabot Auto-merge
2
+
3
+ on: pull_request
4
+
5
+ permissions:
6
+ contents: read
7
+
8
+ jobs:
9
+ automerge:
10
+ runs-on: ubuntu-latest
11
+ timeout-minutes: 5
12
+ # Gate on the PR *author*, not the actor — an attacker can act on a PR
13
+ # but cannot forge its author.
14
+ if: github.event.pull_request.user.login == 'dependabot[bot]'
15
+ permissions:
16
+ contents: write
17
+ pull-requests: write
18
+ steps:
19
+ - name: Fetch Dependabot metadata
20
+ id: metadata
21
+ uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
22
+ with:
23
+ github-token: ${{ secrets.GITHUB_TOKEN }}
24
+
25
+ - name: Enable auto-merge for patch/minor updates
26
+ # Majors are left for human review.
27
+ if: steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor'
28
+ env:
29
+ PR_URL: ${{ github.event.pull_request.html_url }}
30
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31
+ run: gh pr merge --auto --squash "$PR_URL"
@@ -0,0 +1,81 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ publish:
13
+ # Only run on commitizen bump commits (or manual recovery dispatch).
14
+ if: startsWith(github.event.head_commit.message, 'bump:') || github.event_name == 'workflow_dispatch'
15
+ runs-on: ubuntu-latest
16
+ timeout-minutes: 30
17
+ permissions:
18
+ contents: write # push tag, create release
19
+ id-token: write # PyPI trusted publishing (OIDC, no API token)
20
+ steps:
21
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ with:
23
+ persist-credentials: true
24
+ fetch-depth: 0
25
+
26
+ - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
27
+ with:
28
+ # Cache poisoning of a publish job is a supply-chain risk;
29
+ # build from a cold environment.
30
+ enable-cache: false
31
+
32
+ - name: Extract version
33
+ id: version
34
+ run: |
35
+ VERSION=$(grep '^version = ' pyproject.toml | head -1 | cut -d'"' -f2)
36
+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
37
+
38
+ - name: Check if release exists
39
+ id: check
40
+ env:
41
+ GH_TOKEN: ${{ github.token }}
42
+ VERSION: ${{ steps.version.outputs.version }}
43
+ run: |
44
+ if gh release view "v$VERSION" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
45
+ echo "exists=true" >> "$GITHUB_OUTPUT"
46
+ else
47
+ echo "exists=false" >> "$GITHUB_OUTPUT"
48
+ fi
49
+
50
+ - name: Create and push tag
51
+ if: steps.check.outputs.exists == 'false'
52
+ env:
53
+ VERSION: ${{ steps.version.outputs.version }}
54
+ run: |
55
+ git config user.name "github-actions[bot]"
56
+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57
+ if ! git rev-parse "v$VERSION" >/dev/null 2>&1; then
58
+ git tag "v$VERSION"
59
+ git push origin "v$VERSION"
60
+ fi
61
+
62
+ - name: Build distribution
63
+ if: steps.check.outputs.exists == 'false'
64
+ run: uv build
65
+
66
+ - name: Publish to PyPI
67
+ if: steps.check.outputs.exists == 'false'
68
+ uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
69
+ with:
70
+ print-hash: true
71
+
72
+ - name: Create GitHub release
73
+ if: steps.check.outputs.exists == 'false'
74
+ env:
75
+ GH_TOKEN: ${{ github.token }}
76
+ VERSION: ${{ steps.version.outputs.version }}
77
+ run: |
78
+ gh release create "v$VERSION" \
79
+ --repo "$GITHUB_REPOSITORY" \
80
+ --title "v$VERSION" \
81
+ --notes "See [CHANGELOG.md](https://github.com/$GITHUB_REPOSITORY/blob/main/CHANGELOG.md) for details."
@@ -0,0 +1,124 @@
1
+ # Daily security audit — notification layer, zero secrets required.
2
+ #
3
+ # Philosophy (same as portolan-cli): separate GATE (the tests.yml security
4
+ # job blocks PRs) from NOTIFICATION (this workflow manages a tracking issue).
5
+ # Fix PRs come from Dependabot (dependabot.yml + auto-merge), so no bot PAT
6
+ # is needed here.
7
+ name: Security Audit
8
+
9
+ on:
10
+ schedule:
11
+ - cron: '0 6 * * *'
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+
17
+ jobs:
18
+ audit:
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 15
21
+ permissions:
22
+ contents: read
23
+ issues: write
24
+ steps:
25
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26
+ with:
27
+ persist-credentials: false
28
+
29
+ - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
30
+ with:
31
+ enable-cache: true
32
+
33
+ - name: Install dependencies
34
+ run: |
35
+ uv python install 3.13
36
+ uv sync
37
+
38
+ - name: Run pip-audit
39
+ id: audit
40
+ run: |
41
+ IGNORE_ARGS=$(uv run python scripts/pip_audit_ignores.py)
42
+ # shellcheck disable=SC2086
43
+ if uv run pip-audit $IGNORE_ARGS --format json --output audit.json; then
44
+ echo "vulnerable=false" >> "$GITHUB_OUTPUT"
45
+ else
46
+ echo "vulnerable=true" >> "$GITHUB_OUTPUT"
47
+ fi
48
+
49
+ - name: Upload audit report
50
+ if: always()
51
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
52
+ with:
53
+ name: security-audit-report
54
+ path: audit.json
55
+ retention-days: 30
56
+ if-no-files-found: ignore
57
+
58
+ - name: Open or update tracking issue
59
+ if: steps.audit.outputs.vulnerable == 'true'
60
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
61
+ with:
62
+ script: |
63
+ const fs = require('fs');
64
+ const title = 'Security: dependency vulnerabilities detected';
65
+ let vulnList = '';
66
+ try {
67
+ const report = JSON.parse(fs.readFileSync('audit.json', 'utf8'));
68
+ for (const dep of report.dependencies || []) {
69
+ for (const vuln of dep.vulns || []) {
70
+ vulnList += `\n### ${dep.name} (${dep.version})\n`;
71
+ vulnList += `- **ID:** ${vuln.id}\n`;
72
+ vulnList += `- **Fix versions:** ${vuln.fix_versions?.join(', ') || 'none available'}\n`;
73
+ }
74
+ }
75
+ } catch (e) {
76
+ vulnList = '\n*Could not parse audit.json — see the workflow run artifact.*\n';
77
+ }
78
+ const body = [
79
+ 'Nightly pip-audit found vulnerabilities in the dependency tree.',
80
+ vulnList,
81
+ '### How to resolve',
82
+ '',
83
+ '1. Check whether Dependabot already opened an upgrade PR.',
84
+ '2. If not: `uv lock --upgrade-package <name>` and open a PR.',
85
+ '3. If no fix exists yet, add the ID to `.pip-audit-ignores`',
86
+ ' with an expiry date and reason.',
87
+ '',
88
+ `Run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`,
89
+ '',
90
+ '*Managed by security-audit.yml; auto-closes when the audit is clean.*',
91
+ ].join('\n');
92
+ const {data: issues} = await github.rest.issues.listForRepo({
93
+ ...context.repo, state: 'open', labels: 'security,automated',
94
+ });
95
+ const existing = issues.find(i => i.title === title);
96
+ if (existing) {
97
+ await github.rest.issues.update({
98
+ ...context.repo, issue_number: existing.number, body,
99
+ });
100
+ } else {
101
+ await github.rest.issues.create({
102
+ ...context.repo, title, body, labels: ['security', 'automated'],
103
+ });
104
+ }
105
+
106
+ - name: Close tracking issue when clean
107
+ if: steps.audit.outputs.vulnerable == 'false'
108
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
109
+ with:
110
+ script: |
111
+ const title = 'Security: dependency vulnerabilities detected';
112
+ const {data: issues} = await github.rest.issues.listForRepo({
113
+ ...context.repo, state: 'open', labels: 'security,automated',
114
+ });
115
+ for (const issue of issues.filter(i => i.title === title)) {
116
+ await github.rest.issues.createComment({
117
+ ...context.repo, issue_number: issue.number,
118
+ body: 'pip-audit is clean again; closing.',
119
+ });
120
+ await github.rest.issues.update({
121
+ ...context.repo, issue_number: issue.number,
122
+ state: 'closed', state_reason: 'completed',
123
+ });
124
+ }
@@ -0,0 +1,96 @@
1
+ name: Spec Sync
2
+
3
+ # Canary for spec drift. rashid is pinned to a portolan-spec commit (SPEC_REF) and
4
+ # its fixtures are vendored from it. This job re-vendors from spec `main` daily;
5
+ # if the reference catalog or any published schema changed, it opens (or updates)
6
+ # a pull request with the refreshed fixtures. That PR's own test run is the
7
+ # verdict: a pure-data change stays green and is mergeable, while a schema-URI or
8
+ # rule change trips the keystone guard (tests/unit/test_schema_uri_invariant.py)
9
+ # and lands as a red PR that forces a matching code fix in rashid.
10
+
11
+ on:
12
+ schedule:
13
+ - cron: '17 5 * * *'
14
+ workflow_dispatch:
15
+
16
+ permissions:
17
+ contents: write
18
+ pull-requests: write
19
+
20
+ concurrency:
21
+ group: spec-sync
22
+ cancel-in-progress: true
23
+
24
+ jobs:
25
+ sync:
26
+ runs-on: ubuntu-latest
27
+ timeout-minutes: 15
28
+ steps:
29
+ - name: Check out rashid
30
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+ with:
32
+ # The push below authenticates via `gh auth setup-git`, so the
33
+ # checkout's own credentials need not be persisted into .git/config.
34
+ persist-credentials: false
35
+
36
+ - name: Clone portolan-spec main
37
+ run: |
38
+ git clone --depth 1 \
39
+ https://github.com/portolan-sdi/portolan-spec.git \
40
+ "$RUNNER_TEMP/portolan-spec"
41
+
42
+ - uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
43
+ with:
44
+ enable-cache: true
45
+
46
+ - name: Re-vendor fixtures from spec main
47
+ run: |
48
+ uv run python scripts/vendor_spec_fixtures.py \
49
+ --spec "$RUNNER_TEMP/portolan-spec"
50
+
51
+ - name: Detect fixture drift
52
+ id: drift
53
+ run: |
54
+ if git diff --quiet -- tests/fixtures; then
55
+ echo "changed=false" >> "$GITHUB_OUTPUT"
56
+ echo "Fixtures already match spec main; nothing to sync."
57
+ else
58
+ echo "changed=true" >> "$GITHUB_OUTPUT"
59
+ echo "Spec main has drifted from the vendored fixtures:"
60
+ git --no-pager diff --stat -- tests/fixtures SPEC_REF
61
+ fi
62
+
63
+ - name: Open or update sync PR
64
+ if: steps.drift.outputs.changed == 'true'
65
+ env:
66
+ GH_TOKEN: ${{ github.token }}
67
+ run: |
68
+ BRANCH="chore/spec-sync"
69
+ REF="$(sed -n '3p' SPEC_REF)"
70
+ SHORT="${REF:0:12}"
71
+ gh auth setup-git
72
+ git config user.name "portolan-bot"
73
+ git config user.email "portolan@googlegroups.com"
74
+ git checkout -B "$BRANCH"
75
+ git add tests/fixtures SPEC_REF
76
+ git commit -m "chore: sync spec fixtures to ${SHORT}"
77
+ git push -f origin "$BRANCH"
78
+ cat > "$RUNNER_TEMP/pr-body.md" <<'BODY'
79
+ Automated re-vendor of the portolan-spec fixtures from `main` (`__SHORT__`),
80
+ via `scripts/vendor_spec_fixtures.py`.
81
+
82
+ The test run on this PR is the verdict:
83
+
84
+ - **Green** — a data-only change (new or edited catalog objects). Review and merge.
85
+ - **Red on `test_schema_uri_invariant`** — the spec changed its schema URI or shape.
86
+ rashid needs a matching code change (e.g. `SCHEMA_URI_PATTERN`, `DEFAULT_SCHEMA_URI`)
87
+ on this branch before it can merge.
88
+ BODY
89
+ sed -i "s/__SHORT__/${SHORT}/" "$RUNNER_TEMP/pr-body.md"
90
+ if gh pr view "$BRANCH" --json state --jq .state 2>/dev/null | grep -q OPEN; then
91
+ echo "Existing PR updated in place."
92
+ else
93
+ gh pr create --base main --head "$BRANCH" \
94
+ --title "chore: sync spec fixtures to ${SHORT}" \
95
+ --body-file "$RUNNER_TEMP/pr-body.md"
96
+ fi
@@ -0,0 +1,11 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ .venv/
4
+ .pytest_cache/
5
+ .mypy_cache/
6
+ .ruff_cache/
7
+ .coverage
8
+ .serena/
9
+ .code-review-graph/
10
+ mutants/
11
+ coverage.xml
@@ -0,0 +1,19 @@
1
+ # Minimum mutation kill rate (%), enforced by the mutation job in the
2
+ # shared Python CI workflow through scripts/mutation_score.py.
3
+ #
4
+ # Rate = (killed + timeout + suspicious) / testable, where testable
5
+ # excludes mutants no test covers. A timeout or a suspicious result still
6
+ # means the suite reacted, so both count as kills. Uncovered mutants are
7
+ # excluded rather than counted as failures, because coverage measures
8
+ # that gap already.
9
+ #
10
+ # Measured 2026-07-27 at 75.08%: 3491 killed of 4650 testable, with no
11
+ # uncovered mutants. Run 30280640824.
12
+ #
13
+ # The previous value of 65 came from a different formula, killed over
14
+ # killed plus survived, and the two numbers are not comparable.
15
+ #
16
+ # Ratchet UP as the suite improves. Lowering it requires a justification
17
+ # in the pull request that does so. First non-comment, non-blank line
18
+ # wins.
19
+ 72
@@ -0,0 +1,9 @@
1
+ # pip-audit ignore list — single source of truth, consumed by the tests.yml
2
+ # security job and the security-audit.yml workflow via:
3
+ # uv run pip-audit $(uv run python scripts/pip_audit_ignores.py)
4
+ #
5
+ # Format: VULN-ID EXPIRES(YYYY-MM-DD) REASON
6
+ # Entries past their expiry are dropped automatically: if the vulnerability is
7
+ # fixed upstream by then, the audit stays green; if not, it goes red and
8
+ # demands a conscious decision (extend the date with a reason, or pin/replace
9
+ # the dependency). Never leave an entry without an expiry rationale.
@@ -0,0 +1,93 @@
1
+ # Two-stage strategy:
2
+ # commit stage — fast, file-scoped checks (formatting, hygiene, spelling,
3
+ # workflow lint). Must stay sub-second-ish.
4
+ # pre-push stage — whole-project gates (types, dead code, complexity,
5
+ # dependency hygiene, import contracts). CI runs both
6
+ # stages via `pre-commit run --all-files [--hook-stage
7
+ # pre-push]`, so nothing here is skippable by accident.
8
+ repos:
9
+ - repo: https://github.com/commitizen-tools/commitizen
10
+ rev: v4.16.5
11
+ hooks:
12
+ - id: commitizen
13
+ stages: [commit-msg]
14
+
15
+ - repo: https://github.com/pre-commit/pre-commit-hooks
16
+ rev: v6.0.0
17
+ hooks:
18
+ - id: trailing-whitespace
19
+ - id: end-of-file-fixer
20
+ - id: check-yaml
21
+ - id: check-toml
22
+ - id: check-added-large-files
23
+ args: ['--maxkb=500']
24
+ - id: check-merge-conflict
25
+ - id: mixed-line-ending
26
+
27
+ - repo: https://github.com/astral-sh/ruff-pre-commit
28
+ rev: v0.16.0
29
+ hooks:
30
+ - id: ruff-check
31
+ args: [--fix]
32
+ - id: ruff-format
33
+
34
+ - repo: https://github.com/codespell-project/codespell
35
+ rev: v2.4.3
36
+ hooks:
37
+ - id: codespell
38
+ additional_dependencies: [tomli]
39
+
40
+ - repo: https://github.com/rhysd/actionlint
41
+ rev: v1.7.12
42
+ hooks:
43
+ - id: actionlint
44
+
45
+ - repo: https://github.com/zizmorcore/zizmor-pre-commit
46
+ rev: v1.28.0
47
+ hooks:
48
+ - id: zizmor
49
+ args: [--no-online-audits]
50
+
51
+ - repo: local
52
+ hooks:
53
+ - id: deptry
54
+ name: deptry (dependency hygiene)
55
+ entry: uv run deptry .
56
+ language: system
57
+ pass_filenames: false
58
+ stages: [pre-push]
59
+
60
+ - id: mypy
61
+ name: mypy (strict)
62
+ entry: uv run mypy
63
+ language: system
64
+ pass_filenames: false
65
+ stages: [pre-push]
66
+
67
+ - id: vulture
68
+ name: vulture (dead code)
69
+ entry: uv run vulture
70
+ language: system
71
+ pass_filenames: false
72
+ stages: [pre-push]
73
+
74
+ - id: xenon
75
+ name: xenon (complexity ceiling)
76
+ entry: uv run xenon --max-absolute=D --max-modules=C --max-average=B src/rashid tests
77
+ language: system
78
+ pass_filenames: false
79
+ stages: [pre-push]
80
+
81
+ - id: import-linter
82
+ name: import-linter (layer contracts)
83
+ entry: uv run lint-imports
84
+ language: system
85
+ pass_filenames: false
86
+ stages: [pre-push]
87
+
88
+ - id: fast-tests
89
+ name: fast tests (opt-in via ENABLE_PRE_PUSH_TESTS=1)
90
+ entry: bash -c 'if [ "${ENABLE_PRE_PUSH_TESTS:-0}" = "1" ]; then uv run pytest -n auto --tb=short; fi'
91
+ language: system
92
+ pass_filenames: false
93
+ stages: [pre-push]
rashid-0.1.0/AGENTS.md ADDED
@@ -0,0 +1,15 @@
1
+ <!-- ops-sync:begin — synced from portolan-sdi/portolan-ops. Edit there, not here. -->
2
+ # Org norms
3
+
4
+ Org-wide agent norms, voice, and prose rules live in
5
+ [portolan-sdi/portolan-ops](https://github.com/portolan-sdi/portolan-ops):
6
+
7
+ - [AGENTS.md](https://github.com/portolan-sdi/portolan-ops/blob/main/AGENTS.md) — canonical agent rules
8
+ - [VOICE.md](https://github.com/portolan-sdi/portolan-ops/blob/main/VOICE.md) — public-copy voice (mandatory)
9
+ - [STYLE.md](https://github.com/portolan-sdi/portolan-ops/blob/main/STYLE.md) — prose rubric (mandatory)
10
+ - [AI policy](https://github.com/portolan-sdi/portolan-ops/blob/main/policies/AI_POLICY.md) — human-in-the-loop rules
11
+ - [Docs norms](https://github.com/portolan-sdi/portolan-ops/blob/main/norms/docs.md) — mandatory before writing docs or READMEs: obstore is the exemplar, scaffold-docs-skill is the method
12
+
13
+ The [portolan-spec](https://github.com/portolan-sdi/portolan-spec) repo is the
14
+ ground truth for the Portolan standard. This repo implements it.
15
+ <!-- ops-sync:end -->