sm-feed 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.
- sm_feed-0.1.0/.github/CODEOWNERS +1 -0
- sm_feed-0.1.0/.github/workflows/ci.yml +26 -0
- sm_feed-0.1.0/.github/workflows/release.yml +48 -0
- sm_feed-0.1.0/.gitignore +57 -0
- sm_feed-0.1.0/CHANGELOG.md +33 -0
- sm_feed-0.1.0/GOVERNANCE.md +39 -0
- sm_feed-0.1.0/LICENSE +21 -0
- sm_feed-0.1.0/PKG-INFO +132 -0
- sm_feed-0.1.0/PUBLISHING.md +42 -0
- sm_feed-0.1.0/README.md +109 -0
- sm_feed-0.1.0/SECURITY.md +34 -0
- sm_feed-0.1.0/SPEC.md +143 -0
- sm_feed-0.1.0/THREATMODEL.md +73 -0
- sm_feed-0.1.0/WHITEPAPER.md +76 -0
- sm_feed-0.1.0/conformance/_vector_gen.py +100 -0
- sm_feed-0.1.0/conformance/vectors/01-verified-from-genesis.json +63 -0
- sm_feed-0.1.0/conformance/vectors/02-incremental-from-cursor.json +37 -0
- sm_feed-0.1.0/conformance/vectors/03-empty-feed.json +16 -0
- sm_feed-0.1.0/conformance/vectors/04-reject-dropped-entry.json +63 -0
- sm_feed-0.1.0/conformance/vectors/05-reject-tampered-payload.json +63 -0
- sm_feed-0.1.0/conformance/vectors/06-reject-wrong-anchor.json +37 -0
- sm_feed-0.1.0/conformance/vectors/07-reject-forged-head.json +63 -0
- sm_feed-0.1.0/examples/quick_start.py +41 -0
- sm_feed-0.1.0/pyproject.toml +55 -0
- sm_feed-0.1.0/schema/feed/0.1/entry.schema.json +22 -0
- sm_feed-0.1.0/schema/feed/0.1/head.schema.json +16 -0
- sm_feed-0.1.0/schema/feed/0.1/page.schema.json +15 -0
- sm_feed-0.1.0/sm_feed/__init__.py +71 -0
- sm_feed-0.1.0/sm_feed/checkpoint.py +115 -0
- sm_feed-0.1.0/sm_feed/entry.py +114 -0
- sm_feed-0.1.0/sm_feed/equivocation.py +106 -0
- sm_feed-0.1.0/sm_feed/feed.py +191 -0
- sm_feed-0.1.0/sm_feed/py.typed +0 -0
- sm_feed-0.1.0/tests/test_checkpoint.py +108 -0
- sm_feed-0.1.0/tests/test_conformance_vectors.py +31 -0
- sm_feed-0.1.0/tests/test_equivocation.py +96 -0
- sm_feed-0.1.0/tests/test_feed.py +146 -0
- sm_feed-0.1.0/tests/test_hardening.py +83 -0
- sm_feed-0.1.0/tests/test_rejections.py +170 -0
- sm_feed-0.1.0/tests/test_smoke.py +12 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
* @Sharathvc23
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.11", "3.12"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ matrix.python-version }}
|
|
19
|
+
- run: pip install -e ".[dev]"
|
|
20
|
+
- run: ruff check sm_feed tests conformance
|
|
21
|
+
- run: mypy sm_feed
|
|
22
|
+
- run: coverage run -m pytest && coverage report
|
|
23
|
+
- name: Vectors are reproducible
|
|
24
|
+
run: |
|
|
25
|
+
python conformance/_vector_gen.py
|
|
26
|
+
git diff --exit-code conformance/vectors/ || (echo "::error::vectors drifted — re-run conformance/_vector_gen.py and commit" && exit 1)
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Publish sm-feed to PyPI on a version tag, via PyPI Trusted Publishing (OIDC).
|
|
2
|
+
#
|
|
3
|
+
# No API token anywhere: PyPI is told (once, in its web UI) to trust THIS repo +
|
|
4
|
+
# THIS workflow file, and the `id-token: write` permission below lets the job
|
|
5
|
+
# mint a short-lived OIDC token PyPI accepts. See PUBLISHING.md for the one-time
|
|
6
|
+
# setup and the exact values to type into PyPI's "Add a publisher" form.
|
|
7
|
+
#
|
|
8
|
+
# Fires only when a tag like `v0.1.0` is pushed — never on normal commits.
|
|
9
|
+
name: release
|
|
10
|
+
|
|
11
|
+
on:
|
|
12
|
+
push:
|
|
13
|
+
tags:
|
|
14
|
+
- "v*"
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
publish:
|
|
21
|
+
name: Build + publish to PyPI
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
permissions:
|
|
24
|
+
# A job-level permissions block REPLACES the workflow-level one (it does not
|
|
25
|
+
# merge), so contents:read must be restated here or actions/checkout 404s on
|
|
26
|
+
# its own repo. Both lines are required.
|
|
27
|
+
contents: read # for actions/checkout
|
|
28
|
+
id-token: write # REQUIRED for Trusted Publishing — this is what replaces the token.
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
|
|
32
|
+
- uses: actions/setup-python@v5
|
|
33
|
+
with:
|
|
34
|
+
python-version: "3.12"
|
|
35
|
+
|
|
36
|
+
- name: Build sdist + wheel
|
|
37
|
+
run: |
|
|
38
|
+
python -m pip install --upgrade build
|
|
39
|
+
python -m build
|
|
40
|
+
|
|
41
|
+
- name: Check the built distributions
|
|
42
|
+
run: |
|
|
43
|
+
python -m pip install --upgrade twine
|
|
44
|
+
python -m twine check dist/*
|
|
45
|
+
|
|
46
|
+
- name: Publish to PyPI
|
|
47
|
+
# No `with: password:` — the action uses the OIDC token automatically.
|
|
48
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
sm_feed-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
build/
|
|
7
|
+
dist/
|
|
8
|
+
*.whl
|
|
9
|
+
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv/
|
|
12
|
+
.venv-*/
|
|
13
|
+
venv/
|
|
14
|
+
env/
|
|
15
|
+
|
|
16
|
+
# Test / type / lint caches and artifacts
|
|
17
|
+
.pytest_cache/
|
|
18
|
+
.mypy_cache/
|
|
19
|
+
.ruff_cache/
|
|
20
|
+
.tox/
|
|
21
|
+
.coverage
|
|
22
|
+
.coverage.*
|
|
23
|
+
htmlcov/
|
|
24
|
+
coverage.xml
|
|
25
|
+
|
|
26
|
+
# Editors / OS
|
|
27
|
+
.idea/
|
|
28
|
+
.vscode/
|
|
29
|
+
*.swp
|
|
30
|
+
*.swo
|
|
31
|
+
.DS_Store
|
|
32
|
+
Thumbs.db
|
|
33
|
+
|
|
34
|
+
# Secrets / local env
|
|
35
|
+
.env
|
|
36
|
+
.env.*
|
|
37
|
+
*.pem
|
|
38
|
+
|
|
39
|
+
# Dev / internal / audit artifacts — never commit these
|
|
40
|
+
scratch/
|
|
41
|
+
tmp/
|
|
42
|
+
notes/
|
|
43
|
+
NOTES.md
|
|
44
|
+
TODO.md
|
|
45
|
+
*.log
|
|
46
|
+
*.bak
|
|
47
|
+
*.orig
|
|
48
|
+
.claude/
|
|
49
|
+
internal/
|
|
50
|
+
audit/
|
|
51
|
+
AUDIT*.md
|
|
52
|
+
DISCUSSION*.md
|
|
53
|
+
|
|
54
|
+
# coverage data
|
|
55
|
+
.coverage
|
|
56
|
+
coverage.xml
|
|
57
|
+
htmlcov/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/) and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.0] — 2026-07-30
|
|
10
|
+
|
|
11
|
+
Initial working-draft release of the Verifiable Agent Feed.
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- `feed-entry/0.1` — signed, content-addressed, hash-chained entries with an
|
|
15
|
+
opaque typed payload.
|
|
16
|
+
- `feed-head/0.1` — a signed statement of the feed's current head.
|
|
17
|
+
- `feed-page/0.1` and `verify_page` — the pulled/pushed page and its
|
|
18
|
+
verification (authenticity, tamper-evidence, and completeness from a held
|
|
19
|
+
anchor to a signed head).
|
|
20
|
+
- **Compaction via state checkpoints** (`sm_feed/checkpoint.py`): `emit_checkpoint`
|
|
21
|
+
(publisher) writes an in-chain, signed `feed/state-checkpoint` entry committing
|
|
22
|
+
to the linear `chain_tip` + an opaque `state_digest`; `adopt_checkpoint`
|
|
23
|
+
(subscriber) validates a signed checkpoint as a late-join genesis and returns a
|
|
24
|
+
`CheckpointAnchor` to walk the chain forward from.
|
|
25
|
+
- **Fork detection (equivocation) via gossip** (`sm_feed/equivocation.py`):
|
|
26
|
+
`detect_equivocation` emits a non-repudiable `feed-equivocation/0.1` proof only
|
|
27
|
+
from two *validly signed* heads that conflict at the same `seq`;
|
|
28
|
+
`verify_equivocation_proof` re-checks a proof independently.
|
|
29
|
+
- Strict linear enforcement — no Merkle trees or `O(log n)` proofs (SPEC §8).
|
|
30
|
+
- Closed field sets on entry/head/page and fail-closed verifiers (never raise on
|
|
31
|
+
hostile input).
|
|
32
|
+
- `SPEC.md`, `WHITEPAPER.md`, `THREATMODEL.md`, `SECURITY.md`, JSON Schemas under
|
|
33
|
+
`schema/feed/0.1/`, and a reproducible conformance corpus.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Governance
|
|
2
|
+
|
|
3
|
+
## Scope
|
|
4
|
+
|
|
5
|
+
| In scope | Out of scope |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| The feed wire shape (entry, signed head, page) and its verification | Transport (HTTP, webhook), delivery/retry, subscription registration |
|
|
8
|
+
| Authenticity, tamper-evidence, completeness, head attestation | The meaning or validation of a payload (the consuming profile's job) |
|
|
9
|
+
| Reuse of sm-arp crypto (Ed25519 / JCS / did:key) | Key generation, custody, rotation, revocation; trust decisions about a `feed_id` |
|
|
10
|
+
| The conformance corpus | Fork detection, Merkle inclusion proofs (future work — `SPEC.md` §6) |
|
|
11
|
+
|
|
12
|
+
The primitive owns one thing — the *feed* — and says so. Anything outside the
|
|
13
|
+
table belongs to a companion package or the consumer's stack.
|
|
14
|
+
|
|
15
|
+
## Versioning
|
|
16
|
+
|
|
17
|
+
Semantic Versioning 2.0.0. The wire shape (`feed-entry/0.1` etc.) is frozen
|
|
18
|
+
within a major. A change to it requires an RFC-style PR to `SPEC.md` before code.
|
|
19
|
+
An additive optional field is a minor bump and ships always-present-nullable, not
|
|
20
|
+
as a sometimes-omitted key.
|
|
21
|
+
|
|
22
|
+
## Conformance
|
|
23
|
+
|
|
24
|
+
The suite under `tests/` and the vectors under `conformance/vectors/` are the
|
|
25
|
+
authoritative behavioural specification. A change in behaviour without a
|
|
26
|
+
corresponding test/vector change is a bug. Vectors are regenerated by
|
|
27
|
+
`conformance/_vector_gen.py`, never hand-edited.
|
|
28
|
+
|
|
29
|
+
## Contributions
|
|
30
|
+
|
|
31
|
+
- PRs must include tests and pass `ruff` + `mypy --strict` + `pytest`.
|
|
32
|
+
- No expansion of the wire surface without an accepted RFC-style `SPEC.md` PR.
|
|
33
|
+
- No domain-specific or deployment-specific content — this is a generic
|
|
34
|
+
primitive (see the neutrality checklist in the extraction playbook).
|
|
35
|
+
- Sign off with the Developer Certificate of Origin (DCO), not a CLA.
|
|
36
|
+
|
|
37
|
+
## Attribution
|
|
38
|
+
|
|
39
|
+
*Personal research contributions aligned with [Project NANDA](https://projectnanda.org) standards. [Stellarminds.ai](https://stellarminds.ai)*
|
sm_feed-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 StellarMinds (stellarminds.ai)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
sm_feed-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: sm-feed
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: The Verifiable Agent Feed — a signed, hash-chained, cursor-based append-only feed a subscriber can prove is complete and untampered.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Sharathvc23/sm-feed
|
|
6
|
+
Project-URL: Spec, https://github.com/Sharathvc23/sm-feed/blob/main/SPEC.md
|
|
7
|
+
Author-email: StellarMinds <hello@stellarminds.ai>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: ai-agents,did,federation,feed,nanda,transparency-log,verifiable
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Typing :: Typed
|
|
15
|
+
Requires-Python: >=3.11
|
|
16
|
+
Requires-Dist: sm-arp>=0.3.0
|
|
17
|
+
Provides-Extra: dev
|
|
18
|
+
Requires-Dist: coverage>=7.0; extra == 'dev'
|
|
19
|
+
Requires-Dist: mypy>=1.0; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
21
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# sm-feed
|
|
25
|
+
|
|
26
|
+
**The Verifiable Agent Feed — a signed, hash-chained, cursor-based append-only feed a subscriber can prove is complete and untampered.**
|
|
27
|
+
|
|
28
|
+
An agent that publishes an ongoing stream — claims, lifecycle events, aggregate
|
|
29
|
+
signals — is served today by an RSS feed or a bespoke webhook. Both ask the
|
|
30
|
+
subscriber to *trust the server* for completeness: a feed can silently drop or
|
|
31
|
+
reorder an item and no one can tell. `sm-feed` closes that gap. Every entry is
|
|
32
|
+
Ed25519-signed and hash-chained, so a subscriber that walks a contiguous run
|
|
33
|
+
verifies authenticity, integrity, **and completeness** in one pass. It owns the
|
|
34
|
+
*feed* — the wire shape and its verification — and nothing else: the transport,
|
|
35
|
+
the storage, and the meaning of the payload are the consumer's. The payload is
|
|
36
|
+
opaque (any JSON object with a `type`), so one format carries any agent's stream.
|
|
37
|
+
|
|
38
|
+
## What this package secures (v0.1)
|
|
39
|
+
|
|
40
|
+
- **Authenticity** — each entry is Ed25519-signed by the feed's issuer DID.
|
|
41
|
+
- **Tamper-evidence** — `entry_hash` content-addresses the entry; any edit to any
|
|
42
|
+
field breaks it and verification returns falsy (never raises on hostile input).
|
|
43
|
+
- **Completeness** — entries are hash-chained (`prev_hash`) with contiguous `seq`;
|
|
44
|
+
a dropped or reordered entry breaks the chain from the subscriber's anchor.
|
|
45
|
+
- **Head attestation** — a signed head (`{seq, entry_hash}`) lets a subscriber pin
|
|
46
|
+
"the feed as of here" and detect a later rewind.
|
|
47
|
+
- **Adversarially tested.** The conformance corpus includes a hostile vector per
|
|
48
|
+
failure path: dropped entry, tampered payload, wrong anchor, forged head.
|
|
49
|
+
|
|
50
|
+
## What this package does NOT (yet) do
|
|
51
|
+
|
|
52
|
+
- **Fork detection across subscribers** — a signed head proves "the issuer said
|
|
53
|
+
this is head", not that every subscriber saw the same history. Witness
|
|
54
|
+
co-signing / gossip (à la Certificate Transparency) is a later property; see
|
|
55
|
+
[`SPEC.md`](./SPEC.md) §6.
|
|
56
|
+
- **Merkle inclusion proofs** — completeness is by walking the chain; an
|
|
57
|
+
`O(log n)` proof for a single old entry is future work.
|
|
58
|
+
- **Push delivery, retry, and subscription registration** — the consumer's
|
|
59
|
+
responsibility; this primitive fixes only the payload and its verification.
|
|
60
|
+
- **A trusted clock or key custody** — `issued_at` is caller-asserted; key
|
|
61
|
+
generation/rotation/revocation is out of scope.
|
|
62
|
+
|
|
63
|
+
## Features
|
|
64
|
+
|
|
65
|
+
- One dependency (`sm-arp`, for the shared Ed25519 / JCS / did:key crypto).
|
|
66
|
+
- Pure, wall-clock-free core: the caller supplies timestamps.
|
|
67
|
+
- Pull (`GET …/feed?since=<cursor>`) and push (`POST` a page) deliver the same
|
|
68
|
+
object; `verify_page` checks both.
|
|
69
|
+
- Opaque typed payload — the same wire format serves claims, events, or deltas.
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
Not yet published to PyPI — install directly from the repository:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
pip install git+https://github.com/Sharathvc23/sm-feed.git
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Quick start
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
from sm_arp import Identity
|
|
83
|
+
from sm_feed import FeedLog, verify_page
|
|
84
|
+
|
|
85
|
+
issuer = Identity.generate()
|
|
86
|
+
log = FeedLog(issuer)
|
|
87
|
+
log.append({"type": "example/claim", "title": "First"}, issued_at="2026-01-01T00:00:00+00:00")
|
|
88
|
+
log.append({"type": "example/claim", "title": "Second"}, issued_at="2026-01-01T01:00:00+00:00")
|
|
89
|
+
|
|
90
|
+
# Serve on pull (GET /feed?since=<cursor>) or POST on push — same object.
|
|
91
|
+
page = log.page(cursor=None, generated_at="2026-01-01T02:00:00+00:00")
|
|
92
|
+
|
|
93
|
+
# Subscriber: verify authenticity + completeness, keep the new cursor anchor.
|
|
94
|
+
ok, reason, head = verify_page(page, expected_prev_hash=None)
|
|
95
|
+
assert ok, reason
|
|
96
|
+
# persist head["entry_hash"] as expected_prev_hash for the next pull
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
A runnable end-to-end example (publish → verify → detect a dropped entry) is in
|
|
100
|
+
[`examples/quick_start.py`](./examples/quick_start.py).
|
|
101
|
+
|
|
102
|
+
## Reference fixtures
|
|
103
|
+
|
|
104
|
+
The golden vectors under [`conformance/vectors/`](./conformance/vectors/) are
|
|
105
|
+
regenerated by `conformance/_vector_gen.py` from a fixed, non-secret fixture seed
|
|
106
|
+
(`"11"×32` — regenerable, never a real key) and replayed by
|
|
107
|
+
`tests/test_conformance_vectors.py`. They are the language-agnostic corpus a
|
|
108
|
+
second implementation replays to prove interoperability.
|
|
109
|
+
|
|
110
|
+
## Specification
|
|
111
|
+
|
|
112
|
+
- [`SPEC.md`](./SPEC.md) — normative wire shape and verification, working draft.
|
|
113
|
+
- [`WHITEPAPER.md`](./WHITEPAPER.md) — design rationale and axioms.
|
|
114
|
+
- [`THREATMODEL.md`](./THREATMODEL.md) — what it defends, and what it doesn't.
|
|
115
|
+
|
|
116
|
+
## Related packages
|
|
117
|
+
|
|
118
|
+
| Package | Role |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| [`sm-arp`](https://github.com/Sharathvc23/sm-arp) | Agency Receipt Protocol — the signed, hash-chained record primitive sm-feed reuses for crypto |
|
|
121
|
+
| [`sm-authority`](https://github.com/Sharathvc23/sm-authority) | Common Authority Evidence — establishes who controls a subject |
|
|
122
|
+
| [`sm-bridge`](https://github.com/Sharathvc23/sm-bridge) | AgentFacts / registry endpoints — a natural feed publisher and consumer |
|
|
123
|
+
|
|
124
|
+
## License
|
|
125
|
+
|
|
126
|
+
[MIT](./LICENSE)
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
*First published: 2026-07-30 | Last modified: 2026-07-30*
|
|
131
|
+
|
|
132
|
+
*Personal research contributions aligned with [Project NANDA](https://projectnanda.org) standards. [Stellarminds.ai](https://stellarminds.ai)*
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Publishing sm-feed to PyPI
|
|
2
|
+
|
|
3
|
+
`sm-feed` publishes via **PyPI Trusted Publishing** — no API tokens. You tell
|
|
4
|
+
PyPI once that this repo's `release.yml` workflow may publish; after that, pushing
|
|
5
|
+
a version tag builds and uploads automatically.
|
|
6
|
+
|
|
7
|
+
## One-time setup (≈5 minutes — this is the part only you can do)
|
|
8
|
+
|
|
9
|
+
1. Sign in to PyPI (the same account that publishes `sm-arp` / `sm-bridge`).
|
|
10
|
+
2. Go to **https://pypi.org/manage/account/publishing/** → "Add a pending
|
|
11
|
+
publisher" (use *pending*, because the `sm-feed` project doesn't exist on
|
|
12
|
+
PyPI yet — the first publish creates it).
|
|
13
|
+
3. Fill the form with **exactly** these values:
|
|
14
|
+
|
|
15
|
+
| Field | Value |
|
|
16
|
+
|-------|-------|
|
|
17
|
+
| PyPI Project Name | `sm-feed` |
|
|
18
|
+
| Owner | `Sharathvc23` |
|
|
19
|
+
| Repository name | `sm-feed` |
|
|
20
|
+
| **Workflow name** | `release.yml` ← just the filename |
|
|
21
|
+
| Environment name | *(leave blank)* |
|
|
22
|
+
|
|
23
|
+
That's it. No secret is created or stored anywhere.
|
|
24
|
+
|
|
25
|
+
## Releasing (every time, after setup)
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# bump `version` in pyproject.toml + update CHANGELOG, commit, then:
|
|
29
|
+
git tag v0.1.0
|
|
30
|
+
git push origin v0.1.0
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The `release` workflow builds the sdist + wheel, runs `twine check`, and uploads
|
|
34
|
+
to PyPI over OIDC. Watch it under the repo's **Actions** tab. Within a minute,
|
|
35
|
+
`pip install sm-feed` works for everyone.
|
|
36
|
+
|
|
37
|
+
## Notes
|
|
38
|
+
|
|
39
|
+
- The tag (`v0.1.0`) and `version` in `pyproject.toml` must match.
|
|
40
|
+
- Dry run anytime, no upload: `python -m build && python -m twine check dist/*`.
|
|
41
|
+
- The wheel ships only the `sm_feed/` package; the spec, vectors, and
|
|
42
|
+
examples are not part of the installable distribution.
|
sm_feed-0.1.0/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# sm-feed
|
|
2
|
+
|
|
3
|
+
**The Verifiable Agent Feed — a signed, hash-chained, cursor-based append-only feed a subscriber can prove is complete and untampered.**
|
|
4
|
+
|
|
5
|
+
An agent that publishes an ongoing stream — claims, lifecycle events, aggregate
|
|
6
|
+
signals — is served today by an RSS feed or a bespoke webhook. Both ask the
|
|
7
|
+
subscriber to *trust the server* for completeness: a feed can silently drop or
|
|
8
|
+
reorder an item and no one can tell. `sm-feed` closes that gap. Every entry is
|
|
9
|
+
Ed25519-signed and hash-chained, so a subscriber that walks a contiguous run
|
|
10
|
+
verifies authenticity, integrity, **and completeness** in one pass. It owns the
|
|
11
|
+
*feed* — the wire shape and its verification — and nothing else: the transport,
|
|
12
|
+
the storage, and the meaning of the payload are the consumer's. The payload is
|
|
13
|
+
opaque (any JSON object with a `type`), so one format carries any agent's stream.
|
|
14
|
+
|
|
15
|
+
## What this package secures (v0.1)
|
|
16
|
+
|
|
17
|
+
- **Authenticity** — each entry is Ed25519-signed by the feed's issuer DID.
|
|
18
|
+
- **Tamper-evidence** — `entry_hash` content-addresses the entry; any edit to any
|
|
19
|
+
field breaks it and verification returns falsy (never raises on hostile input).
|
|
20
|
+
- **Completeness** — entries are hash-chained (`prev_hash`) with contiguous `seq`;
|
|
21
|
+
a dropped or reordered entry breaks the chain from the subscriber's anchor.
|
|
22
|
+
- **Head attestation** — a signed head (`{seq, entry_hash}`) lets a subscriber pin
|
|
23
|
+
"the feed as of here" and detect a later rewind.
|
|
24
|
+
- **Adversarially tested.** The conformance corpus includes a hostile vector per
|
|
25
|
+
failure path: dropped entry, tampered payload, wrong anchor, forged head.
|
|
26
|
+
|
|
27
|
+
## What this package does NOT (yet) do
|
|
28
|
+
|
|
29
|
+
- **Fork detection across subscribers** — a signed head proves "the issuer said
|
|
30
|
+
this is head", not that every subscriber saw the same history. Witness
|
|
31
|
+
co-signing / gossip (à la Certificate Transparency) is a later property; see
|
|
32
|
+
[`SPEC.md`](./SPEC.md) §6.
|
|
33
|
+
- **Merkle inclusion proofs** — completeness is by walking the chain; an
|
|
34
|
+
`O(log n)` proof for a single old entry is future work.
|
|
35
|
+
- **Push delivery, retry, and subscription registration** — the consumer's
|
|
36
|
+
responsibility; this primitive fixes only the payload and its verification.
|
|
37
|
+
- **A trusted clock or key custody** — `issued_at` is caller-asserted; key
|
|
38
|
+
generation/rotation/revocation is out of scope.
|
|
39
|
+
|
|
40
|
+
## Features
|
|
41
|
+
|
|
42
|
+
- One dependency (`sm-arp`, for the shared Ed25519 / JCS / did:key crypto).
|
|
43
|
+
- Pure, wall-clock-free core: the caller supplies timestamps.
|
|
44
|
+
- Pull (`GET …/feed?since=<cursor>`) and push (`POST` a page) deliver the same
|
|
45
|
+
object; `verify_page` checks both.
|
|
46
|
+
- Opaque typed payload — the same wire format serves claims, events, or deltas.
|
|
47
|
+
|
|
48
|
+
## Installation
|
|
49
|
+
|
|
50
|
+
Not yet published to PyPI — install directly from the repository:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install git+https://github.com/Sharathvc23/sm-feed.git
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Quick start
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from sm_arp import Identity
|
|
60
|
+
from sm_feed import FeedLog, verify_page
|
|
61
|
+
|
|
62
|
+
issuer = Identity.generate()
|
|
63
|
+
log = FeedLog(issuer)
|
|
64
|
+
log.append({"type": "example/claim", "title": "First"}, issued_at="2026-01-01T00:00:00+00:00")
|
|
65
|
+
log.append({"type": "example/claim", "title": "Second"}, issued_at="2026-01-01T01:00:00+00:00")
|
|
66
|
+
|
|
67
|
+
# Serve on pull (GET /feed?since=<cursor>) or POST on push — same object.
|
|
68
|
+
page = log.page(cursor=None, generated_at="2026-01-01T02:00:00+00:00")
|
|
69
|
+
|
|
70
|
+
# Subscriber: verify authenticity + completeness, keep the new cursor anchor.
|
|
71
|
+
ok, reason, head = verify_page(page, expected_prev_hash=None)
|
|
72
|
+
assert ok, reason
|
|
73
|
+
# persist head["entry_hash"] as expected_prev_hash for the next pull
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
A runnable end-to-end example (publish → verify → detect a dropped entry) is in
|
|
77
|
+
[`examples/quick_start.py`](./examples/quick_start.py).
|
|
78
|
+
|
|
79
|
+
## Reference fixtures
|
|
80
|
+
|
|
81
|
+
The golden vectors under [`conformance/vectors/`](./conformance/vectors/) are
|
|
82
|
+
regenerated by `conformance/_vector_gen.py` from a fixed, non-secret fixture seed
|
|
83
|
+
(`"11"×32` — regenerable, never a real key) and replayed by
|
|
84
|
+
`tests/test_conformance_vectors.py`. They are the language-agnostic corpus a
|
|
85
|
+
second implementation replays to prove interoperability.
|
|
86
|
+
|
|
87
|
+
## Specification
|
|
88
|
+
|
|
89
|
+
- [`SPEC.md`](./SPEC.md) — normative wire shape and verification, working draft.
|
|
90
|
+
- [`WHITEPAPER.md`](./WHITEPAPER.md) — design rationale and axioms.
|
|
91
|
+
- [`THREATMODEL.md`](./THREATMODEL.md) — what it defends, and what it doesn't.
|
|
92
|
+
|
|
93
|
+
## Related packages
|
|
94
|
+
|
|
95
|
+
| Package | Role |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| [`sm-arp`](https://github.com/Sharathvc23/sm-arp) | Agency Receipt Protocol — the signed, hash-chained record primitive sm-feed reuses for crypto |
|
|
98
|
+
| [`sm-authority`](https://github.com/Sharathvc23/sm-authority) | Common Authority Evidence — establishes who controls a subject |
|
|
99
|
+
| [`sm-bridge`](https://github.com/Sharathvc23/sm-bridge) | AgentFacts / registry endpoints — a natural feed publisher and consumer |
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
[MIT](./LICENSE)
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
*First published: 2026-07-30 | Last modified: 2026-07-30*
|
|
108
|
+
|
|
109
|
+
*Personal research contributions aligned with [Project NANDA](https://projectnanda.org) standards. [Stellarminds.ai](https://stellarminds.ai)*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Please report security issues privately, **not** through public GitHub issues.
|
|
6
|
+
|
|
7
|
+
Email **hello@stellarminds.ai** with a description, reproduction steps, and the
|
|
8
|
+
affected version or commit. We aim to acknowledge within a few business days and
|
|
9
|
+
will coordinate a fix and disclosure timeline with you.
|
|
10
|
+
|
|
11
|
+
## Scope
|
|
12
|
+
|
|
13
|
+
`sm-feed` is a verifier: it is fail-closed by design — a malformed, mis-signed,
|
|
14
|
+
or incomplete feed is *invalid*, never treated as an implicit pass, and a verifier
|
|
15
|
+
never raises on hostile input. Reports that are especially valuable:
|
|
16
|
+
|
|
17
|
+
- a way to make `verify_page` / `verify_entry` accept an entry that was altered,
|
|
18
|
+
or whose signature does not verify under its `feed_id`;
|
|
19
|
+
- a way to omit or reorder an entry between two a subscriber holds without
|
|
20
|
+
`verify_page` reporting a chain break (a completeness break);
|
|
21
|
+
- a way to make `detect_equivocation` / `verify_equivocation_proof` accept a
|
|
22
|
+
fabricated "proof" that frames an issuer who did not actually equivocate;
|
|
23
|
+
- a way to make `adopt_checkpoint` accept a checkpoint whose committed state or
|
|
24
|
+
chain position does not match its signature;
|
|
25
|
+
- any input that causes a verifier to raise instead of returning a falsy verdict.
|
|
26
|
+
|
|
27
|
+
Boundaries stated in [`THREATMODEL.md`](./THREATMODEL.md) — payload truth,
|
|
28
|
+
timestamp truth, key custody, cross-subscriber fork detection without gossip — are
|
|
29
|
+
by design, not vulnerabilities.
|
|
30
|
+
|
|
31
|
+
## Supported versions
|
|
32
|
+
|
|
33
|
+
This is a pre-1.0 working draft; fixes land on the latest minor. Pin a version and
|
|
34
|
+
watch the changelog until the wire format is frozen at 1.0.
|