@smilintux/skcapstone 0.1.0

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 (50) hide show
  1. package/.cursorrules +33 -0
  2. package/.github/workflows/ci.yml +23 -0
  3. package/.github/workflows/publish.yml +52 -0
  4. package/AGENTS.md +74 -0
  5. package/CLAUDE.md +56 -0
  6. package/LICENSE +674 -0
  7. package/README.md +242 -0
  8. package/SKILL.md +36 -0
  9. package/bin/cli.js +18 -0
  10. package/docs/ARCHITECTURE.md +510 -0
  11. package/docs/SECURITY_DESIGN.md +315 -0
  12. package/docs/SOVEREIGN_SINGULARITY.md +371 -0
  13. package/docs/TOKEN_SYSTEM.md +201 -0
  14. package/index.d.ts +9 -0
  15. package/index.js +32 -0
  16. package/package.json +32 -0
  17. package/pyproject.toml +84 -0
  18. package/src/skcapstone/__init__.py +13 -0
  19. package/src/skcapstone/cli.py +1441 -0
  20. package/src/skcapstone/connectors/__init__.py +6 -0
  21. package/src/skcapstone/coordination.py +590 -0
  22. package/src/skcapstone/discovery.py +275 -0
  23. package/src/skcapstone/memory_engine.py +457 -0
  24. package/src/skcapstone/models.py +223 -0
  25. package/src/skcapstone/pillars/__init__.py +8 -0
  26. package/src/skcapstone/pillars/identity.py +91 -0
  27. package/src/skcapstone/pillars/memory.py +61 -0
  28. package/src/skcapstone/pillars/security.py +83 -0
  29. package/src/skcapstone/pillars/sync.py +486 -0
  30. package/src/skcapstone/pillars/trust.py +335 -0
  31. package/src/skcapstone/runtime.py +190 -0
  32. package/src/skcapstone/skills/__init__.py +1 -0
  33. package/src/skcapstone/skills/syncthing_setup.py +297 -0
  34. package/src/skcapstone/sync/__init__.py +14 -0
  35. package/src/skcapstone/sync/backends.py +330 -0
  36. package/src/skcapstone/sync/engine.py +301 -0
  37. package/src/skcapstone/sync/models.py +97 -0
  38. package/src/skcapstone/sync/vault.py +284 -0
  39. package/src/skcapstone/tokens.py +439 -0
  40. package/tests/__init__.py +0 -0
  41. package/tests/conftest.py +42 -0
  42. package/tests/test_coordination.py +299 -0
  43. package/tests/test_discovery.py +57 -0
  44. package/tests/test_memory_engine.py +391 -0
  45. package/tests/test_models.py +63 -0
  46. package/tests/test_pillars.py +87 -0
  47. package/tests/test_runtime.py +60 -0
  48. package/tests/test_sync.py +507 -0
  49. package/tests/test_syncthing_setup.py +76 -0
  50. package/tests/test_tokens.py +265 -0
package/.cursorrules ADDED
@@ -0,0 +1,33 @@
1
+ # SKCapstone — Cursor Agent Rules
2
+
3
+ ## Multi-Agent Coordination (REQUIRED)
4
+
5
+ At the START of every session, run: skcapstone coord briefing
6
+
7
+ This teaches you the full coordination protocol. It works in any terminal.
8
+
9
+ Quick commands:
10
+ skcapstone coord status # See what's available
11
+ skcapstone coord claim <id> --agent <you> # Claim work
12
+ skcapstone coord complete <id> --agent <you> # Mark done
13
+ skcapstone coord create --title "..." --by <you> # New task
14
+ skcapstone coord board # Regenerate BOARD.md
15
+
16
+ The coordination board lives at ~/.skcapstone/coordination/ and syncs
17
+ via Syncthing. Only write to YOUR OWN agent file. Tasks are immutable
18
+ after creation.
19
+
20
+ ## Skill Available
21
+
22
+ If the skcapstone-coordination skill is available in your skills list,
23
+ read it for the full detailed protocol. Otherwise, `skcapstone coord briefing`
24
+ gives you everything you need.
25
+
26
+ ## Code Conventions
27
+
28
+ - Python 3.11+, PEP 8, black formatting
29
+ - Type hints on all functions
30
+ - Pydantic for data validation
31
+ - Google-style docstrings
32
+ - Pytest tests in /tests mirroring src structure
33
+ - Max 500 lines per file — split into modules if approaching
@@ -0,0 +1,23 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - uses: actions/setup-python@v5
18
+ with:
19
+ python-version: ${{ matrix.python-version }}
20
+ - run: pip install -e ".[dev]"
21
+ - run: python -m pytest tests/ -v --tb=short
22
+ - run: pip install black ruff && black --check src/ tests/ && ruff check src/
23
+ if: matrix.python-version == '3.12'
@@ -0,0 +1,52 @@
1
+ name: Publish to PyPI and npm
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - uses: actions/setup-python@v5
20
+ with:
21
+ python-version: ${{ matrix.python-version }}
22
+ - run: pip install -e ".[dev]"
23
+ - run: python -m pytest tests/ -v
24
+
25
+ publish-pypi:
26
+ needs: test
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - uses: actions/checkout@v4
30
+ - uses: actions/setup-python@v5
31
+ with:
32
+ python-version: "3.12"
33
+ - run: pip install build twine
34
+ - run: python -m build
35
+ - run: twine upload dist/*
36
+ env:
37
+ TWINE_USERNAME: __token__
38
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
39
+
40
+ publish-npm:
41
+ needs: test
42
+ runs-on: ubuntu-latest
43
+ if: hashFiles('package.json') != ''
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ - uses: actions/setup-node@v4
47
+ with:
48
+ node-version: "20"
49
+ registry-url: "https://registry.npmjs.org"
50
+ - run: npm publish --access public
51
+ env:
52
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/AGENTS.md ADDED
@@ -0,0 +1,74 @@
1
+ # SKCapstone — Agent Onboarding (Universal)
2
+
3
+ This file provides instructions for ANY AI agent working on SKCapstone,
4
+ regardless of tool, IDE, or platform.
5
+
6
+ ## Step 1: Learn the Coordination Protocol
7
+
8
+ ```bash
9
+ skcapstone coord briefing
10
+ ```
11
+
12
+ This single command prints everything you need:
13
+ - The complete multi-agent coordination protocol
14
+ - JSON schemas for tasks and agent files
15
+ - CLI commands for all operations
16
+ - A live snapshot of current tasks and who's working on what
17
+
18
+ For machine-readable output:
19
+
20
+ ```bash
21
+ skcapstone coord briefing --format json
22
+ ```
23
+
24
+ ## Step 2: Check In
25
+
26
+ ```bash
27
+ skcapstone coord status
28
+ ```
29
+
30
+ See what tasks are open, what's claimed, and which agents are active.
31
+
32
+ ## Step 3: Claim Work
33
+
34
+ ```bash
35
+ skcapstone coord claim <task_id> --agent <your_name>
36
+ ```
37
+
38
+ ## Step 4: Do the Work
39
+
40
+ Follow the project conventions:
41
+ - Python 3.11+, PEP 8, type hints, black formatting
42
+ - Pydantic for data models
43
+ - Pytest tests (happy path + edge case + failure case)
44
+ - Google-style docstrings on every function
45
+ - Max 500 lines per file
46
+
47
+ ## Step 5: Complete
48
+
49
+ ```bash
50
+ skcapstone coord complete <task_id> --agent <your_name>
51
+ ```
52
+
53
+ ## Step 6: Create Discovered Work
54
+
55
+ ```bash
56
+ skcapstone coord create --title "What needs doing" --by <your_name>
57
+ ```
58
+
59
+ ## Directory Reference
60
+
61
+ | Path | Purpose |
62
+ |------|---------|
63
+ | `src/skcapstone/` | Core framework modules |
64
+ | `tests/` | Pytest test suite |
65
+ | `docs/` | Architecture and design docs |
66
+ | `~/.skcapstone/coordination/` | Syncthing-synced task board |
67
+ | `~/.skcapstone/coordination/tasks/` | Task JSON files (immutable) |
68
+ | `~/.skcapstone/coordination/agents/` | Agent status JSON files |
69
+
70
+ ## How Sync Works
71
+
72
+ The `~/.skcapstone/` directory is synchronized via Syncthing across all
73
+ devices in the mesh. No SSH, no APIs, no cloud services — just encrypted
74
+ peer-to-peer file sync. Create a task here, it appears everywhere.
package/CLAUDE.md ADDED
@@ -0,0 +1,56 @@
1
+ # SKCapstone — Agent Instructions (Claude Code)
2
+
3
+ You are working on **SKCapstone**, a sovereign agent framework built under
4
+ the Fiducia Communitatis PMA. This file ensures you integrate with the
5
+ multi-agent coordination system regardless of which tool you run in.
6
+
7
+ ## First Thing Every Session
8
+
9
+ Run this command to learn the full coordination protocol:
10
+
11
+ ```bash
12
+ skcapstone coord briefing
13
+ ```
14
+
15
+ This prints the complete protocol, JSON schemas, rules, and a live snapshot
16
+ of current tasks and agent assignments. It works in any terminal.
17
+
18
+ ## Quick Reference
19
+
20
+ ```bash
21
+ skcapstone coord status # See open tasks and agent states
22
+ skcapstone coord claim <id> --agent <you> # Claim a task
23
+ skcapstone coord complete <id> --agent <you> # Mark done
24
+ skcapstone coord create --title "..." --by <you> # Add new work
25
+ skcapstone coord board # Regenerate BOARD.md
26
+ skcapstone coord briefing --format json # Machine-readable protocol
27
+ ```
28
+
29
+ ## Key Rules
30
+
31
+ 1. **Read before you write** — check the board before starting work
32
+ 2. **Own your file** — only write to `~/.skcapstone/coordination/agents/<your_name>.json`
33
+ 3. **Tasks are immutable** — never edit a task file after creation
34
+ 4. **Claim before working** — prevents duplicate effort across agents
35
+ 5. **Create discovered work** — if you find something that needs doing, add a task
36
+
37
+ ## Project Structure
38
+
39
+ - `src/skcapstone/` — Core framework (models, CLI, coordination, memory, sync)
40
+ - `tests/` — Pytest tests mirroring src structure
41
+ - `docs/` — Architecture, security design, sovereign singularity spec
42
+ - `~/.skcapstone/coordination/` — Syncthing-synced task board (JSON files)
43
+
44
+ ## Code Style
45
+
46
+ - Python 3.11+, PEP 8, type hints everywhere
47
+ - Format with `black`, validate with `pydantic`
48
+ - Google-style docstrings on every function
49
+ - Tests: pytest, at least 3 per feature (happy path, edge case, failure)
50
+
51
+ ## Running Tests
52
+
53
+ ```bash
54
+ cd /home/cbrd21/Nextcloud/p/smilintux-org/skcapstone
55
+ python -m pytest tests/ -v
56
+ ```