Skip to content

Commit 5dc5ecb

Browse files
nos1dot618claude
andcommitted
feat: add pardarsh-core public decision graph infrastructure
Introduce pardarsh-core, the application-agnostic foundation for public records, with no knowledge of any application built on it. - Identifiers: origin-qualified record ids (pd:<origin>:<uuidv7>) and namespaced names for application vocabulary. - Record envelope: core kinds, actors with roles and withheld disclosure, separate recorded/published/effective/observed times, visibility, lifecycle, and typed, versioned extensions. - Provenance: source references with authority, derivation and sha256 content hashes. - Relations: controlled vocabulary with direction, target rules and certainty levels. - History: append-only attributable events, projection, diffs and timelines; corrections, retractions, supersession, annotations, and redaction that scrubs earlier events. - Repository with validation, idempotency keys and optimistic concurrency; memory and SQLite stores; graph queries and bounded traversal. - Viewer-based access filtering and self-verifying export/import bundles. - Tests (store matrix, access/interchange, conformance fixtures, boundary check) and a legislative-change example as a second consumer. - Docs: concepts, entities guide, data model, provenance, versioning, federation, and ADRs 0001-0007. - Tooling: GitHub Actions CI, cargo-deny policy, pre-commit hooks, pinned toolchain (MSRV 1.85), issue and PR templates, CONTRIBUTING, Code of Conduct, SECURITY and CHANGELOG. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
0 parents  commit 5dc5ecb

73 files changed

Lines changed: 8668 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto eol=lf
2+
*.sqlite binary

‎.github/CODEOWNERS‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Default owner for the repository.
2+
* @nos1dot618
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Bug report
2+
description: Report a reproducible problem in pardarsh-core.
3+
title: "bug: "
4+
labels: [bug]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
Thanks for reporting a problem. Please do not include personal data from real records.
10+
Security vulnerabilities belong in a private report (see SECURITY.md), not here.
11+
- type: textarea
12+
id: description
13+
attributes:
14+
label: Description
15+
description: What went wrong?
16+
validations:
17+
required: true
18+
- type: dropdown
19+
id: area
20+
attributes:
21+
label: Area
22+
options:
23+
- Identifiers / record model
24+
- Extensions / validation
25+
- Events / history / projection
26+
- Relations / graph
27+
- Provenance
28+
- Storage (memory or SQLite)
29+
- Access / visibility
30+
- Interchange (export / import bundles)
31+
- Documentation
32+
- Other
33+
validations:
34+
required: true
35+
- type: textarea
36+
id: reproduction
37+
attributes:
38+
label: Reproduction
39+
description: A minimal snippet, test or command that shows the problem.
40+
render: rust
41+
validations:
42+
required: true
43+
- type: textarea
44+
id: expected
45+
attributes:
46+
label: Expected behavior
47+
validations:
48+
required: true
49+
- type: textarea
50+
id: environment
51+
attributes:
52+
label: Environment
53+
description: pardarsh-core version or commit, `rustc --version`, OS, and enabled features (e.g. `sqlite`).
54+
render: text
55+
validations:
56+
required: true

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
blank_issues_enabled: true
2+
contact_links:
3+
- name: Security issue
4+
url: https://github.com/pardarsh/pardarsh-core/security/policy
5+
about: Please report security vulnerabilities according to SECURITY.md instead of opening a public issue.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Feature request
2+
description: Propose a change or addition to pardarsh-core.
3+
title: "feat: "
4+
labels: [enhancement]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
pardarsh-core is application-agnostic infrastructure. Application workflows, UI and policy
10+
belong in the applications built on it (see docs/adr/0001-repository-boundary.md).
11+
- type: textarea
12+
id: problem
13+
attributes:
14+
label: Problem
15+
description: What problem would this feature solve, and for which consumers of the crate?
16+
validations:
17+
required: true
18+
- type: textarea
19+
id: proposal
20+
attributes:
21+
label: Proposal
22+
validations:
23+
required: true
24+
- type: dropdown
25+
id: format_impact
26+
attributes:
27+
label: Shared format impact
28+
description: Does this change the serialized envelope, extensions, events or bundle format (see docs/versioning.md)?
29+
options:
30+
- "No format change"
31+
- "Additive (minor version bump)"
32+
- "Breaking (major version bump; needs an ADR)"
33+
- "Not sure"
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: alternatives
38+
attributes:
39+
label: Alternatives considered
40+
description: Including whether this could live in an application as a namespaced extension instead.

‎.github/dependabot.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: /
10+
schedule:
11+
interval: monthly
12+
open-pull-requests-limit: 5

‎.github/pull_request_template.md‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## Summary
2+
3+
<!-- What does this change do for users of the crate? -->
4+
5+
## Motivation
6+
7+
<!-- Why is this change needed? Link the issue if there is one. -->
8+
9+
## Changes
10+
11+
<!-- Briefly describe the implementation. -->
12+
13+
## Testing
14+
15+
- [ ] `cargo fmt --all -- --check`
16+
- [ ] `cargo clippy --all-targets --all-features -- -D warnings`
17+
- [ ] `cargo test --all-features`
18+
- [ ] `cargo deny check`
19+
- [ ] Repository behaviour is tested with `for_each_store!` (memory and SQLite)
20+
21+
## Format / schema impact
22+
23+
<!-- Changes to the serialized envelope, extensions, events or bundle format (docs/versioning.md). -->
24+
25+
- [ ] No change to the shared format
26+
- [ ] Additive change: minor version bumped, conformance fixtures added
27+
- [ ] Breaking change: major version bumped, ADR and migration notes added
28+
29+
## Checklist
30+
31+
- [ ] Nothing application-specific added to the core (docs/adr/0001-repository-boundary.md)
32+
- [ ] History is preserved; no new operation overwrites or deletes events
33+
- [ ] New input is validated and size-limited
34+
- [ ] Docs, ADRs and `CHANGELOG.md` updated where relevant
35+
36+
## Notes
37+
38+
<!-- Anything reviewers should pay particular attention to. -->

‎.github/workflows/ci.yml‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master, develop]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
CARGO_INCREMENTAL: 0
19+
RUSTFLAGS: -D warnings
20+
21+
jobs:
22+
fmt:
23+
name: rustfmt
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v5
27+
# rustup reads rust-toolchain.toml (channel and components) on first use.
28+
- run: rustup show active-toolchain
29+
- run: cargo fmt --all -- --check
30+
31+
clippy:
32+
name: clippy
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v5
36+
- uses: Swatinem/rust-cache@v2
37+
- run: cargo clippy --all-targets --all-features -- -D warnings
38+
- run: cargo clippy --lib --examples --no-default-features -- -D warnings
39+
40+
test:
41+
name: test (${{ matrix.os }})
42+
runs-on: ${{ matrix.os }}
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
os: [ubuntu-latest, windows-latest, macos-latest]
47+
steps:
48+
- uses: actions/checkout@v5
49+
- uses: Swatinem/rust-cache@v2
50+
- run: cargo test --all-features
51+
- run: cargo test --no-default-features --lib
52+
- run: cargo run --example legislative_change
53+
54+
msrv:
55+
name: MSRV (1.85)
56+
runs-on: ubuntu-latest
57+
env:
58+
# Overrides rust-toolchain.toml; must match `rust-version` in Cargo.toml.
59+
RUSTUP_TOOLCHAIN: 1.85.0
60+
steps:
61+
- uses: actions/checkout@v5
62+
- run: rustup toolchain install 1.85.0 --profile minimal
63+
- uses: Swatinem/rust-cache@v2
64+
- run: cargo test --all-features
65+
66+
docs:
67+
name: docs
68+
runs-on: ubuntu-latest
69+
env:
70+
RUSTDOCFLAGS: -D warnings
71+
steps:
72+
- uses: actions/checkout@v5
73+
- uses: Swatinem/rust-cache@v2
74+
- run: cargo doc --no-deps --all-features
75+
76+
deny:
77+
name: cargo-deny
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v5
81+
- uses: EmbarkStudios/cargo-deny-action@v2
82+
with:
83+
command: check
84+
arguments: --all-features
85+
86+
pre-commit:
87+
name: pre-commit (file hygiene)
88+
runs-on: ubuntu-latest
89+
steps:
90+
- uses: actions/checkout@v5
91+
- uses: actions/setup-python@v5
92+
with:
93+
python-version: "3.12"
94+
- run: pip install pre-commit
95+
# Cargo hooks already run in the jobs above.
96+
- run: pre-commit run --all-files --show-diff-on-failure
97+
env:
98+
SKIP: cargo-fmt,cargo-clippy,cargo-test,cargo-deny

‎.github/workflows/deny.yml‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Weekly re-check of the dependency policy, so new RustSec advisories are
2+
# caught even when nothing is pushed. CI runs the same check on every change.
3+
name: Dependency policy
4+
5+
on:
6+
schedule:
7+
- cron: "17 3 * * 1"
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
deny:
15+
name: cargo-deny
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v5
19+
- uses: EmbarkStudios/cargo-deny-action@v2
20+
with:
21+
command: check
22+
arguments: --all-features

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target/
2+
*.sqlite
3+
*.sqlite-*

0 commit comments

Comments
 (0)