matra 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 (97) hide show
  1. matra-0.1.0/.editorconfig +35 -0
  2. matra-0.1.0/.github/CODEOWNERS +64 -0
  3. matra-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +39 -0
  4. matra-0.1.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
  5. matra-0.1.0/.github/ISSUE_TEMPLATE/decision_record.md +44 -0
  6. matra-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +39 -0
  7. matra-0.1.0/.github/dependabot.yml +59 -0
  8. matra-0.1.0/.github/pull_request_template.md +41 -0
  9. matra-0.1.0/.github/workflows/ci.yml +183 -0
  10. matra-0.1.0/.github/workflows/claude-code-review.yml +47 -0
  11. matra-0.1.0/.github/workflows/claude.yml +50 -0
  12. matra-0.1.0/.github/workflows/codeql.yml +54 -0
  13. matra-0.1.0/.github/workflows/docs.yml +90 -0
  14. matra-0.1.0/.github/workflows/publish-pypi.yml +138 -0
  15. matra-0.1.0/.github/workflows/publish.yml +172 -0
  16. matra-0.1.0/.github/workflows/scorecard.yml +52 -0
  17. matra-0.1.0/.gitignore +67 -0
  18. matra-0.1.0/.mise.toml +8 -0
  19. matra-0.1.0/CHANGELOG.md +99 -0
  20. matra-0.1.0/CLAUDE.md +138 -0
  21. matra-0.1.0/CODE_OF_CONDUCT.md +58 -0
  22. matra-0.1.0/CONTRIBUTING.md +271 -0
  23. matra-0.1.0/Cargo.lock +1250 -0
  24. matra-0.1.0/Cargo.toml +74 -0
  25. matra-0.1.0/LICENSE +21 -0
  26. matra-0.1.0/PKG-INFO +143 -0
  27. matra-0.1.0/README.md +120 -0
  28. matra-0.1.0/ROADMAP.md +161 -0
  29. matra-0.1.0/SECURITY.md +74 -0
  30. matra-0.1.0/deny.toml +88 -0
  31. matra-0.1.0/docs/collaboration-model.md +93 -0
  32. matra-0.1.0/docs/decisions/0001-record-architectural-decisions.md +95 -0
  33. matra-0.1.0/docs/decisions/0002-pipeline-vocabulary.md +108 -0
  34. matra-0.1.0/docs/decisions/0003-workspace-with-rumi-nlp.md +120 -0
  35. matra-0.1.0/docs/decisions/0004-stay-single-crate.md +60 -0
  36. matra-0.1.0/docs/decisions/0005-supply-chain-hardening.md +156 -0
  37. matra-0.1.0/docs/decisions/0006-abstract-tier-vocabulary-lock.md +113 -0
  38. matra-0.1.0/docs/decisions/0007-one-pipeline.md +122 -0
  39. matra-0.1.0/docs/decisions/0008-structural-primitives-are-fields.md +173 -0
  40. matra-0.1.0/docs/decisions/0009-feats-lookup-accessor.md +114 -0
  41. matra-0.1.0/docs/decisions/README.md +62 -0
  42. matra-0.1.0/docs/decisions/template.md +57 -0
  43. matra-0.1.0/examples/basic.rs +60 -0
  44. matra-0.1.0/examples/corpus.rs +57 -0
  45. matra-0.1.0/examples/parse_once_use_many.rs +69 -0
  46. matra-0.1.0/justfile +155 -0
  47. matra-0.1.0/pyproject.toml +89 -0
  48. matra-0.1.0/python/matra/__init__.py +23 -0
  49. matra-0.1.0/python/matra/_core.pyi +104 -0
  50. matra-0.1.0/python/matra/cli.py +191 -0
  51. matra-0.1.0/python/matra/py.typed +0 -0
  52. matra-0.1.0/python/matra/types.py +213 -0
  53. matra-0.1.0/python/tests/test_conformance.py +112 -0
  54. matra-0.1.0/python/tests/test_size_cap.py +72 -0
  55. matra-0.1.0/rust-toolchain.toml +13 -0
  56. matra-0.1.0/scripts/changelog-release.sh +62 -0
  57. matra-0.1.0/scripts/check-boundaries.sh +54 -0
  58. matra-0.1.0/scripts/check-docsite-floor.sh +339 -0
  59. matra-0.1.0/scripts/fetch-model-hash.sh +33 -0
  60. matra-0.1.0/scripts/install-hooks.sh +25 -0
  61. matra-0.1.0/scripts/pre-commit-hook.sh +45 -0
  62. matra-0.1.0/spec/README.md +85 -0
  63. matra-0.1.0/spec/tests/dependency-tree.json +101 -0
  64. matra-0.1.0/spec/tests/evidentiality.json +320 -0
  65. matra-0.1.0/spec/tests/hearst.json +354 -0
  66. matra-0.1.0/spec/tests/modal-coordination.json +187 -0
  67. matra-0.1.0/spec/tests/modal.json +206 -0
  68. matra-0.1.0/spec/tests/multi-paragraph.json +169 -0
  69. matra-0.1.0/spec/tests/negation.json +115 -0
  70. matra-0.1.0/spec/tests/passive-voice.json +131 -0
  71. matra-0.1.0/src/bin/matra.rs +277 -0
  72. matra-0.1.0/src/decompose/markdown.rs +136 -0
  73. matra-0.1.0/src/decompose/mod.rs +104 -0
  74. matra-0.1.0/src/decompose/plain.rs +57 -0
  75. matra-0.1.0/src/domain.rs +2521 -0
  76. matra-0.1.0/src/extraction/mod.rs +12 -0
  77. matra-0.1.0/src/extraction/rake.rs +261 -0
  78. matra-0.1.0/src/extraction/textrank.rs +280 -0
  79. matra-0.1.0/src/extraction/tfidf.rs +241 -0
  80. matra-0.1.0/src/extraction/yake.rs +319 -0
  81. matra-0.1.0/src/hearst.rs +736 -0
  82. matra-0.1.0/src/lib.rs +951 -0
  83. matra-0.1.0/src/metrics/compression.rs +163 -0
  84. matra-0.1.0/src/metrics/document.rs +49 -0
  85. matra-0.1.0/src/metrics/lexical.rs +28 -0
  86. matra-0.1.0/src/metrics/mod.rs +194 -0
  87. matra-0.1.0/src/metrics/readability.rs +78 -0
  88. matra-0.1.0/src/nlp/mod.rs +21 -0
  89. matra-0.1.0/src/nlp/udpipe.rs +436 -0
  90. matra-0.1.0/src/source/directory.rs +145 -0
  91. matra-0.1.0/src/source/file.rs +159 -0
  92. matra-0.1.0/src/source/mod.rs +24 -0
  93. matra-0.1.0/src/stopwords.rs +47 -0
  94. matra-0.1.0/tests/cli.rs +209 -0
  95. matra-0.1.0/tests/conformance.rs +325 -0
  96. matra-0.1.0/tests/integration.rs +104 -0
  97. matra-0.1.0/uv.lock +436 -0
@@ -0,0 +1,35 @@
1
+ # EditorConfig — https://editorconfig.org
2
+ #
3
+ # Universal editor defaults so any editor that supports the spec gets
4
+ # the same charset, line endings, indentation, and trailing-whitespace
5
+ # discipline as the rest of the toolchain (rustfmt, mypy, ruff).
6
+
7
+ root = true
8
+
9
+ [*]
10
+ charset = utf-8
11
+ end_of_line = lf
12
+ insert_final_newline = true
13
+ trim_trailing_whitespace = true
14
+ indent_style = space
15
+ indent_size = 4
16
+
17
+ [*.{rs,toml}]
18
+ indent_size = 4
19
+
20
+ [*.{py,pyi}]
21
+ indent_size = 4
22
+
23
+ [*.{yml,yaml}]
24
+ indent_size = 2
25
+
26
+ [*.{md,markdown}]
27
+ # Trailing whitespace is significant in markdown (two-space hard breaks).
28
+ trim_trailing_whitespace = false
29
+ indent_size = 2
30
+
31
+ [Makefile]
32
+ indent_style = tab
33
+
34
+ [justfile]
35
+ indent_size = 4
@@ -0,0 +1,64 @@
1
+ # CODEOWNERS for matra — change-gate protection on the load-bearing surfaces.
2
+ #
3
+ # GitHub uses this file to automatically request review from the listed
4
+ # owner(s) when a PR touches a matching path. Today's role: ensure the
5
+ # maintainer reviews any change to the docsite structure, CI workflows,
6
+ # release scripts, ADRs, and the public manifest before merge. Future:
7
+ # when contributors join, the path list stays the same but the owners
8
+ # scale.
9
+ #
10
+ # Pattern syntax follows GitHub's CODEOWNERS spec.
11
+
12
+ # Public manifest and version pins — every change here ripples through
13
+ # crates.io, PyPI, and the supply chain.
14
+ /Cargo.toml @yzavyas
15
+ /Cargo.lock @yzavyas
16
+ /pyproject.toml @yzavyas
17
+
18
+ # Docsite structure — SUMMARY.md is the navigation tree; book.toml owns
19
+ # the build config; mermaid runtime is the bundled asset. Drift here is
20
+ # silent and high-impact.
21
+ /book/src/SUMMARY.md @yzavyas
22
+ /book/book.toml @yzavyas
23
+ /book/mermaid-init.js @yzavyas
24
+ /book/mermaid.min.js @yzavyas
25
+
26
+ # CI workflows — change to triggers, permissions, or pinned action SHAs
27
+ # affects every subsequent PR.
28
+ /.github/workflows/ @yzavyas
29
+
30
+ # Release machinery — irreversible operations live here. Per the
31
+ # durable per-publish approval rule (`memory/feedback_no_publish.md`),
32
+ # every change to publish.yml, changelog-release.sh, the release recipe
33
+ # in the justfile, or the supply-chain config gets explicit review.
34
+ /justfile @yzavyas
35
+ /scripts/changelog-release.sh @yzavyas
36
+ /scripts/check-boundaries.sh @yzavyas
37
+ /scripts/check-docsite-floor.sh @yzavyas
38
+ /scripts/install-hooks.sh @yzavyas
39
+ /scripts/pre-commit-hook.sh @yzavyas
40
+ /deny.toml @yzavyas
41
+
42
+ # Architectural decisions — ADRs are the durable record. Anything in
43
+ # docs/decisions/ should be reviewed for ADR-template compliance and
44
+ # for ADR-supersede chain integrity.
45
+ /docs/decisions/ @yzavyas
46
+
47
+ # Hex boundary critical files — any change to domain.rs, the port
48
+ # modules, or the composition root ripples through every adapter and
49
+ # every consumer. The boundary-check script catches violations
50
+ # mechanically; CODEOWNERS adds human review on top.
51
+ /src/domain.rs @yzavyas
52
+ /src/lib.rs @yzavyas
53
+ /src/source/mod.rs @yzavyas
54
+ /src/decompose/mod.rs @yzavyas
55
+ /src/nlp/mod.rs @yzavyas
56
+
57
+ # The constitution. CLAUDE.md is loaded as agent context; CONTRIBUTING.md
58
+ # is the human contributor's first stop; the collaboration model is the
59
+ # exemplar document. None should drift without review.
60
+ /CLAUDE.md @yzavyas
61
+ /CONTRIBUTING.md @yzavyas
62
+ /docs/collaboration-model.md @yzavyas
63
+ /README.md @yzavyas
64
+ /CHANGELOG.md @yzavyas
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Bug report
3
+ about: Something does not work the way the docs say it should
4
+ title: "bug: "
5
+ labels: ["type:bug", "status:triage"]
6
+ ---
7
+
8
+ ## What happened
9
+
10
+ <!-- The unexpected behavior, in one or two sentences. -->
11
+
12
+ ## What you expected
13
+
14
+ <!-- The behavior the docs / API surface implied. -->
15
+
16
+ ## Reproduction
17
+
18
+ <!-- Minimal code or input that demonstrates the bug. The shorter, the better. -->
19
+
20
+ ```rust
21
+ // or shell, or python — whatever reproduces it
22
+ ```
23
+
24
+ ## Environment
25
+
26
+ - matra version (or git SHA):
27
+ - Rust version (`rustc --version`):
28
+ - OS / arch:
29
+ - Features enabled (`udpipe`, `python`, etc.):
30
+
31
+ ## Logs / errors
32
+
33
+ <!-- Stack traces, panic output, or error messages. Trim to the relevant frames. -->
34
+
35
+ ## Have you checked
36
+
37
+ - [ ] The CHANGELOG.md for a known limitation or pending fix
38
+ - [ ] Existing issues with the `type:bug` label
39
+ - [ ] The relevant section of `.claude/arch/` for intended behavior
@@ -0,0 +1,8 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security report
4
+ url: https://github.com/mox-labs/matra/security/advisories/new
5
+ about: Report a vulnerability privately. Do not file a public issue.
6
+ - name: Discussion
7
+ url: https://github.com/mox-labs/matra/discussions
8
+ about: Open-ended questions, design ideas, RFCs, or share what you built.
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: Decision record
3
+ about: Surface an architectural decision that needs deliberation before code moves
4
+ title: "decision: "
5
+ labels: ["type:decision", "status:open"]
6
+ ---
7
+
8
+ ## Context
9
+
10
+ <!-- What is the situation that demands a decision? What forces are in tension? -->
11
+
12
+ ## Options under consideration
13
+
14
+ <!-- Two or more concrete options. Each gets a name and a short description. -->
15
+
16
+ ### Option A: ...
17
+
18
+ ### Option B: ...
19
+
20
+ ### Option C: ...
21
+
22
+ ## Tradeoffs
23
+
24
+ <!-- Per option: what does it buy, what does it cost, what does it foreclose? -->
25
+
26
+ | Option | Reversibility | Surface impact | Ops cost | Notes |
27
+ |--------|---------------|----------------|----------|-------|
28
+ | A | | | | |
29
+ | B | | | | |
30
+
31
+ ## What I'd do (and why)
32
+
33
+ <!-- The author's recommendation, with reasoning. Not the final answer; the
34
+ starting point for the deliberation. -->
35
+
36
+ ## What success looks like
37
+
38
+ <!-- How would we know the decision was right? What would a falsifying outcome
39
+ look like? -->
40
+
41
+ ## Outcome
42
+
43
+ <!-- Filled in when the decision is made, before this issue closes. Links to
44
+ the resulting PR(s) and the ADR file under docs/decisions/. -->
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: Feature request
3
+ about: Propose a new capability, an extension, or a behavior change
4
+ title: "feat: "
5
+ labels: ["type:feature", "status:triage"]
6
+ ---
7
+
8
+ ## What you want to do
9
+
10
+ <!-- The use case in one paragraph. Concrete: what input, what output. -->
11
+
12
+ ## Why matra should have it
13
+
14
+ <!-- Is this part of matra's substrate role, or does it belong in a downstream
15
+ consumer? See book/src/architecture/design.md for the boundary. -->
16
+
17
+ ## Proposed shape
18
+
19
+ <!-- API sketch, function signatures, types. Optional but helpful. -->
20
+
21
+ ```rust
22
+ // API sketch
23
+ ```
24
+
25
+ ## Alternatives you considered
26
+
27
+ <!-- Other ways to solve the same problem. Explain why they fall short. -->
28
+
29
+ ## Scope
30
+
31
+ - [ ] Pure addition (non-breaking)
32
+ - [ ] Modifies existing API (breaking)
33
+ - [ ] Requires a new feature flag
34
+ - [ ] Requires a new dependency
35
+
36
+ ## Have you checked
37
+
38
+ - [ ] The iteration plan under `book/src/plans/` to see if this is already planned
39
+ - [ ] Existing issues / discussions for prior art
@@ -0,0 +1,59 @@
1
+ version: 2
2
+
3
+ updates:
4
+ # Rust dependencies (Cargo.toml, Cargo.lock).
5
+ - package-ecosystem: cargo
6
+ directory: "/"
7
+ schedule:
8
+ interval: weekly
9
+ day: monday
10
+ open-pull-requests-limit: 5
11
+ labels:
12
+ - "area:deps"
13
+ - "type:chore"
14
+ groups:
15
+ # Group minor + patch updates into a single PR to reduce noise.
16
+ # Major version bumps still open their own PRs (reviewed individually).
17
+ cargo-minor-patch:
18
+ update-types:
19
+ - minor
20
+ - patch
21
+ commit-message:
22
+ prefix: "chore(deps)"
23
+ include: scope
24
+
25
+ # GitHub Actions workflows.
26
+ - package-ecosystem: github-actions
27
+ directory: "/"
28
+ schedule:
29
+ interval: weekly
30
+ day: monday
31
+ open-pull-requests-limit: 3
32
+ labels:
33
+ - "area:ci"
34
+ - "type:chore"
35
+ groups:
36
+ actions-minor-patch:
37
+ update-types:
38
+ - minor
39
+ - patch
40
+ commit-message:
41
+ prefix: "chore(ci)"
42
+
43
+ # Python dependencies in pyproject.toml.
44
+ - package-ecosystem: pip
45
+ directory: "/"
46
+ schedule:
47
+ interval: weekly
48
+ day: monday
49
+ open-pull-requests-limit: 3
50
+ labels:
51
+ - "area:python"
52
+ - "type:chore"
53
+ groups:
54
+ pip-minor-patch:
55
+ update-types:
56
+ - minor
57
+ - patch
58
+ commit-message:
59
+ prefix: "chore(deps)"
@@ -0,0 +1,41 @@
1
+ <!--
2
+ PR template for matra. Keep it tight; reviewers should see what changed
3
+ and why in under 60 seconds.
4
+ -->
5
+
6
+ ## Summary
7
+
8
+ <!-- One paragraph: what changed, what problem this solves. -->
9
+
10
+ ## Why
11
+
12
+ <!-- The mental model. The reason a future reader (or you in 6 months) needs.
13
+ Skip if the change is purely mechanical (rename, format, lint fix). -->
14
+
15
+ ## Test plan
16
+
17
+ <!-- Concrete: which gates were run, what new tests exist, what was manually
18
+ exercised. The acceptance criterion for this PR. -->
19
+
20
+ - [ ] `just check` (full local CI gate)
21
+ - [ ] New tests added for new behavior, regressions, or invariants
22
+ - [ ] CHANGELOG.md `[Unreleased]` updated
23
+ - [ ] If the change is architectural / breaking / security-relevant: a
24
+ Highlight paragraph added under `[Unreleased]`
25
+
26
+ ## Type of change
27
+
28
+ - [ ] Bug fix (non-breaking)
29
+ - [ ] Feature (non-breaking)
30
+ - [ ] Breaking change (API surface, behavior, error shape)
31
+ - [ ] Documentation only
32
+ - [ ] Tooling / CI / process
33
+
34
+ ## Linked issues
35
+
36
+ <!-- "Closes #N" / "Related to #N". -->
37
+
38
+ ## Notes for the reviewer
39
+
40
+ <!-- Anything specific the reviewer should look at: a tricky boundary
41
+ case, a tradeoff, a follow-up that is intentionally deferred. -->
@@ -0,0 +1,183 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, alpha]
6
+ pull_request:
7
+ branches: [main, alpha]
8
+
9
+ # Principle of least privilege at the workflow level. Individual jobs
10
+ # escalate only what they need via a per-job `permissions:` block.
11
+ permissions: read-all
12
+
13
+ env:
14
+ CARGO_TERM_COLOR: always
15
+ RUSTFLAGS: -Dwarnings
16
+
17
+ jobs:
18
+ rust:
19
+ name: Rust ${{ matrix.os }} / ${{ matrix.features }}
20
+ runs-on: ${{ matrix.os }}
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ os: [ubuntu-latest, macos-latest]
25
+ include:
26
+ - features: default
27
+ flags: ""
28
+ - features: no-default-features
29
+ flags: "--no-default-features"
30
+ steps:
31
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
32
+ with:
33
+ persist-credentials: false
34
+
35
+ - name: Install Rust toolchain
36
+ uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master (no tagged release; pinned to known-good commit)
37
+ with:
38
+ toolchain: stable
39
+ components: clippy, rustfmt
40
+
41
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
42
+
43
+ - name: cargo fmt --check
44
+ if: matrix.features == 'default' && matrix.os == 'ubuntu-latest'
45
+ run: cargo fmt --all -- --check
46
+
47
+ - name: cargo check
48
+ run: cargo check --all-targets ${{ matrix.flags }}
49
+
50
+ - name: cargo clippy
51
+ run: cargo clippy --all-targets ${{ matrix.flags }} -- -D warnings
52
+
53
+ - name: cargo test (lib + doc)
54
+ run: cargo test ${{ matrix.flags }}
55
+
56
+ msrv:
57
+ name: MSRV (Rust 1.85)
58
+ runs-on: ubuntu-latest
59
+ steps:
60
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
61
+ with:
62
+ persist-credentials: false
63
+ - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
64
+ with:
65
+ toolchain: "1.85"
66
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
67
+ - name: cargo check (MSRV, all features)
68
+ run: cargo check --all-targets --all-features
69
+ - name: cargo check (MSRV, no default features)
70
+ run: cargo check --all-targets --no-default-features
71
+
72
+ deny:
73
+ name: cargo-deny
74
+ runs-on: ubuntu-latest
75
+ steps:
76
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
77
+ with:
78
+ persist-credentials: false
79
+ - uses: EmbarkStudios/cargo-deny-action@3fd3802e88374d3fe9159b834c7714ec57d6c979 # v2
80
+ with:
81
+ command: check
82
+ arguments: --all-features
83
+
84
+ semver:
85
+ name: cargo-semver-checks
86
+ runs-on: ubuntu-latest
87
+ # PR-only — we don't gate main on this (the baseline is the published version).
88
+ # `continue-on-error: true` because matra has not yet been published to
89
+ # crates.io. The action errors with "matra not found in registry" until
90
+ # there is a published baseline to compare against. Once the first
91
+ # publish happens, drop continue-on-error so PRs that break semver fail.
92
+ if: github.event_name == 'pull_request'
93
+ continue-on-error: true
94
+ steps:
95
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
96
+ with:
97
+ persist-credentials: false
98
+ - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
99
+ with:
100
+ toolchain: stable
101
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
102
+ - uses: obi1kenobi/cargo-semver-checks-action@6b69fcf40e9b5fb17adeb57e4b6ecd020649a239 # v2.9
103
+ with:
104
+ feature-group: all-features
105
+
106
+ docs:
107
+ name: rustdoc
108
+ runs-on: ubuntu-latest
109
+ steps:
110
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
111
+ with:
112
+ persist-credentials: false
113
+ - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
114
+ with:
115
+ toolchain: stable
116
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
117
+ - name: cargo doc
118
+ env:
119
+ RUSTDOCFLAGS: -Dwarnings
120
+ run: cargo doc --no-deps --all-features
121
+
122
+ python:
123
+ name: Python wheel (${{ matrix.os }} / ${{ matrix.python-version }})
124
+ runs-on: ${{ matrix.os }}
125
+ strategy:
126
+ fail-fast: false
127
+ matrix:
128
+ os: [ubuntu-latest, macos-latest]
129
+ python-version: ["3.12"]
130
+ steps:
131
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
132
+ with:
133
+ persist-credentials: false
134
+ - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
135
+ with:
136
+ toolchain: stable
137
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
138
+ with:
139
+ python-version: ${{ matrix.python-version }}
140
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
141
+ - name: Install uv
142
+ run: python -m pip install --upgrade uv
143
+ - name: Install maturin
144
+ run: uv pip install --system maturin
145
+ - name: Build wheel
146
+ run: maturin build --release --out dist
147
+ - name: Install and import
148
+ shell: bash
149
+ run: |
150
+ uv pip install --system dist/matra-*.whl
151
+ python -c "from matra import Matra; print('ok')"
152
+
153
+ pytype:
154
+ name: Python type-check (mypy)
155
+ runs-on: ubuntu-latest
156
+ steps:
157
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
158
+ with:
159
+ persist-credentials: false
160
+ - uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
161
+ with:
162
+ toolchain: stable
163
+ - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
164
+ with:
165
+ python-version: "3.12"
166
+ - uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
167
+ - name: Create venv (maturin develop requires VIRTUAL_ENV)
168
+ run: python -m venv .venv
169
+ - name: Install maturin + mypy in venv
170
+ run: |
171
+ . .venv/bin/activate
172
+ python -m pip install --upgrade uv
173
+ # No --system: install into the activated venv, where the
174
+ # mypy step below runs. Newer uv treats --system literally.
175
+ uv pip install maturin "mypy>=1.10" click rich
176
+ - name: Build and install matra in venv (so the _core stub resolves)
177
+ run: |
178
+ . .venv/bin/activate
179
+ maturin develop --features "python,udpipe"
180
+ - name: mypy
181
+ run: |
182
+ . .venv/bin/activate
183
+ python -m mypy
@@ -0,0 +1,47 @@
1
+ name: Claude Code Review
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, ready_for_review, reopened]
6
+ # Optional: Only run on specific file changes
7
+ # paths:
8
+ # - "src/**/*.ts"
9
+ # - "src/**/*.tsx"
10
+ # - "src/**/*.js"
11
+ # - "src/**/*.jsx"
12
+
13
+ jobs:
14
+ claude-review:
15
+ # Optional: Filter by PR author
16
+ # if: |
17
+ # github.event.pull_request.user.login == 'external-contributor' ||
18
+ # github.event.pull_request.user.login == 'new-developer' ||
19
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
+
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: read
24
+ pull-requests: write
25
+ issues: read
26
+ id-token: write
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
31
+ with:
32
+ fetch-depth: 0
33
+ persist-credentials: false
34
+
35
+ - name: Run Claude Code Review
36
+ id: claude-review
37
+ uses: anthropics/claude-code-action@3f854a8fb5146b39d5cbf8b57f70d80810e1366f # v1
38
+ with:
39
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
40
+ # Project-specific review: the pr-review skill in this repo
41
+ # carries the gates (boundary rules, pipeline laws, substrate
42
+ # discipline, FFI criterion). The generic code-review plugin
43
+ # is deliberately not used.
44
+ prompt: 'Use the pr-review skill to review pull request #${{ github.event.pull_request.number }} in ${{ github.repository }}, and post the review as a PR comment per the skill output contract.'
45
+ claude_args: '--model claude-fable-5'
46
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
47
+
@@ -0,0 +1,50 @@
1
+ name: Claude Code
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ actions: read # Required for Claude to read CI results on PRs
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 1
32
+
33
+ - name: Run Claude Code
34
+ id: claude
35
+ uses: anthropics/claude-code-action@v1
36
+ with:
37
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
+
39
+ # This is an optional setting that allows Claude to read CI results on PRs
40
+ additional_permissions: |
41
+ actions: read
42
+
43
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44
+ # prompt: 'Update the pull request description to include a summary of changes.'
45
+
46
+ # Optional: Add claude_args to customize behavior and configuration
47
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
+ # or https://code.claude.com/docs/en/cli-reference for available options
49
+ # claude_args: '--allowed-tools Bash(gh pr *)'
50
+
@@ -0,0 +1,54 @@
1
+ name: CodeQL
2
+
3
+ # GitHub's static analysis for security issues. Custom workflow (vs. the
4
+ # "default setup" UI option) lets us pin the action to a SHA and integrate
5
+ # with Scorecard.
6
+ #
7
+ # IMPORTANT: before this workflow can run, the repo's CodeQL "default setup"
8
+ # must be disabled in Settings -> Code security -> Code scanning. Otherwise
9
+ # GitHub rejects the custom workflow with "default setup is already
10
+ # enabled". See docs/decisions/0005-supply-chain-hardening.md.
11
+
12
+ on:
13
+ push:
14
+ branches: [main, alpha]
15
+ pull_request:
16
+ branches: [main, alpha]
17
+ schedule:
18
+ - cron: "12 3 * * 2" # Tuesdays 03:12 UTC
19
+
20
+ permissions: read-all
21
+
22
+ jobs:
23
+ analyze:
24
+ name: Analyze (${{ matrix.language }})
25
+ runs-on: ubuntu-latest
26
+ permissions:
27
+ security-events: write
28
+ packages: read
29
+ contents: read
30
+
31
+ strategy:
32
+ fail-fast: false
33
+ matrix:
34
+ include:
35
+ - language: rust
36
+ build-mode: none
37
+ - language: python
38
+ build-mode: none
39
+
40
+ steps:
41
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
42
+ with:
43
+ persist-credentials: false
44
+
45
+ - name: Initialize CodeQL
46
+ uses: github/codeql-action/init@0d579ffd059c29b07949a3cce3983f0780820c98 # v4
47
+ with:
48
+ languages: ${{ matrix.language }}
49
+ build-mode: ${{ matrix.build-mode }}
50
+
51
+ - name: Analyze
52
+ uses: github/codeql-action/analyze@0d579ffd059c29b07949a3cce3983f0780820c98 # v4
53
+ with:
54
+ category: "/language:${{ matrix.language }}"