Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Changelog

All notable changes to ShadowGate are recorded here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
[Semantic Versioning](https://semver.org/). The version is defined once, in
`src/shadowgate/version.py`.

## [0.1.0] - Unreleased

First pre-release. Suitable for loopback evaluation with several agents on one host;
not for networked use (no TLS). See README, Known limitations.

### Added
- Control server (FastAPI): agent enrollment with one-time tokens, a per-agent job queue
with exactly-once claim, job results, and a read-only dashboard at `/ui`.
- Runbooks: dependency graphs of actions, fan-out by agent tag, a per-run concurrency cap,
and compensating steps on failure.
- Hash-chained, append-only audit log with `GET /audit?verify=true`.
- Operator access control: viewer, operator and admin tokens (Bearer, or HTTP Basic on
`/ui`). The server refuses to start without tokens unless insecure development mode is
set explicitly.
- Agent identity: each enrolled agent receives its own secret (stored hashed) and can only
claim and complete its own jobs. Enrollment tokens can be bound to one agent id.
- Command line: `shadowgate server`, `shadowgate agent enroll` (token read from stdin,
credential saved with mode 600), `shadowgate agent run`, `shadowgate plugin list`.
- Builtin actions: `system_info`, `disk_health`, `file_fetch` (size only, never contents),
`service_status`.
- `run.sh` launcher and `run.sh --check` (ruff, strict mypy, pytest).
- MIT license.

### Fixed
- Concurrent requests no longer produce HTTP 500s, stranded jobs or spurious agent 401s,
and concurrent audit writes no longer fork the hash chain (single server process).
- The agent retries a transient 401 before stopping.
- The test suite no longer depends on the caller's environment or `.env`; `run.sh` no
longer overrides tokens configured in `.env`.

### Removed
- Unused SQLAlchemy models (`server/models.py`) and the unused `sqlalchemy`, `aiosqlite`,
`itsdangerous` and `python-multipart` dependencies.

[0.1.0]: https://github.com/5aranx/ShadowGate/commits/main
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ actions) against them, and review the results on an audit log and a read-only da
**Present in the code but not used at runtime yet:**
- mTLS certificate helpers (`crypto/mtls.py`).
- The ed25519 plugin-manifest gate for third-party plugins (`plugins/gate.py`).
- The SQLAlchemy models (`server/models.py`).

## Architecture

Expand All @@ -56,7 +55,7 @@ See [`docs/architecture.md`](docs/architecture.md) and

| Path | Contents |
|---|---|
| `src/shadowgate/server/` | app, store, queue, runs, orchestrator, audit (`models.py` is unused) |
| `src/shadowgate/server/` | app, store, queue, runs, orchestrator, audit |
| `src/shadowgate/agent/` | executor, polling client (`Poller`), credential file (`config.py`) |
| `src/shadowgate/plugins/` | `Action` protocol, registry, loader, gate, builtins |
| `src/shadowgate/crypto/` | ed25519 manifest signing; mTLS CA helpers (unused) |
Expand Down
22 changes: 19 additions & 3 deletions docs/tracker.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ S1–S8 and C1–C9 and probes P1–P11.
| T16 | Builtin action hardening | P2 | Med | Planned | none |
| T17 | Documentation truth sweep | P2 | Med | Planned | after T10, T13, T14 |
| T24 | Agent credential rotation / revocation (admin) | P2 | Med | Planned | M7 |
| T18 | Remove dead `models.py` and unused dependencies | P3 | Low | Planned | none |
| T18 | Remove dead `models.py` and unused dependencies | P3 | Low | **Done (§13)** | none |
| T19 | Structured logging with secret redaction | P3 | Med | Planned | M7 |
| T20 | Test infrastructure and reproducible CI | P3 | Med | Planned | none (conftest part pulled into M7) |
| T21 | Dashboard asset cleanup (HTMX, static) | P3 | Low | Planned | T3 |
Expand Down Expand Up @@ -1085,7 +1085,7 @@ The change-set items also pass: probes 18/18 (§7), suite, ruff, mypy, docs.
| B2 | Concurrent use is unreliable: stranded jobs and 500s (E1); valid agents get spurious 401, and the `Poller` stops (V1); the audit chain forks (E2) | Phase 4 §8 | **Resolved (§11)** for a single server process |
| B3 | The documented check `./run.sh --check` fails 6 tests (V2); `run.sh` overrides `.env` tokens (V3) | Phase 4 §8; clean-copy test run | **Resolved (§10)** |
| B4 | There is no runnable agent: the CLI subcommands are placeholders that exit 0 | Integration and test review | **Resolved (§12)** |
| B5 | Package metadata is stale: `pyproject` description claims mTLS and signed plugins; no CHANGELOG; the version is defined twice; unused dependencies | Documentation review D8–D10/D17; dependency review | Owner-approved metadata change (and T18) |
| B5 | Package metadata is stale: `pyproject` description claims mTLS and signed plugins; no CHANGELOG; the version is defined twice; unused dependencies | Documentation review D8–D10/D17; dependency review | **Resolved (§13)** |
| B6 | The process docs are untracked and contain local or internal references | Architecture review; coordinator | **Resolved (§10):** sanitized, to be committed |

### Not blocking, documented
Expand All @@ -1108,7 +1108,7 @@ All user-visible items are listed in the README's Known limitations.
| Scope | Assessment |
|---|---|
| Commit M7 to `main` as a reviewed milestone (not a release) | Reasonable once the owner decides B3 (or accepts it as documented) and B6. Security goals are verified, and CI-equivalent checks are green. |
| Tagged pre-release / public publication | **Not ready**: B1, B3, B5 |
| Tagged pre-release / public publication | Blockers B1–B6 resolved (§10–§13); tagging `v0.1.0` awaits the owner |
| Multi-agent or networked deployment | Loopback multi-agent use works (B2, B4 resolved, §11–§12). Networked: **not ready**, no TLS (T14). |

## 10. Blocker 3 fix, license and documentation cleanup (2026-11-30)
Expand Down Expand Up @@ -1237,6 +1237,21 @@ and strict mypy clean. The README commands were also run live.
- With the server down, `agent run` retries silently every interval; there is no logging.
- No service unit, credential rotation or revocation (not yet planned as a task).

## 13. B5: release metadata and T18 (2026-11-30)

**Scope (owner-approved):** B5, which includes T18. N1 was not changed.

| Item | Change |
|---|---|
| Stale description | `pyproject.toml` no longer claims mTLS or signed plugins; it describes what exists. |
| Version defined twice | `pyproject.toml` reads it from `src/shadowgate/version.py` (`dynamic = ["version"]`, `[tool.hatch.version]`). |
| No CHANGELOG | `CHANGELOG.md` (Keep a Changelog) with 0.1.0 marked Unreleased until tagged. |
| Unused code and dependencies (T18) | Removed `server/models.py` (unused, conflicting schema) and `sqlalchemy`, `aiosqlite`, `itsdangerous`, `python-multipart`. `uv lock` only removed those packages and `greenlet`; no other version changed. |

**Verification:** `./run.sh --check` passes, a clean frozen copy passes, and the built
wheel and sdist carry version 0.1.0, the new description, and no removed dependencies
(see the change log row).

## 6. Change log

| Date | Change |
Expand All @@ -1249,3 +1264,4 @@ and strict mypy clean. The README commands were also run live.
| 2026-11-30 | B3 fixed (test isolation, `run.sh` token precedence), 16 regression tests added (77 total), MIT LICENSE added, process docs sanitized; independent review clean (no Critical/High). N1 recorded (pre-existing `.env` strictness). Prepared for commit (§10). |
| 2026-11-30 | B2 fixed for one server process (§11): shared-connection lock (E1, V1), per-file audit append lock (E2), Poller retries transient 401. 8 tests added (85 total); the 4 concurrency tests fail on the unfixed tree. T11 transaction boundaries and T12 anchoring/O(1) remain open. |
| 2026-11-30 | T10 done (§12): `shadowgate server`, `agent enroll` (token via stdin, 0600 credential file), `agent run`, `plugin list`; `run.sh` uses the CLI. 25 tests incl. a real-process end-to-end test (110 total). B4 resolved. |
| 2026-11-30 | B5 resolved with T18 (§13): accurate `pyproject` description, single-source version, CHANGELOG, removed `models.py` and 4 unused dependencies. 110 passed (repo and clean frozen copy); wheel metadata checked. All release blockers B1–B6 resolved; tagging awaits the owner. |
11 changes: 5 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
[project]
name = "shadowgate"
version = "0.1.0"
description = "Authorized fleet agent management platform with mTLS identity, audited queue, and signed plugins"
dynamic = ["version"]
description = "Audited job queue and runbook orchestration for hosts you own: enrolled agents, role-based operator access, and a hash-chained audit log"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
authors = [{ name = "5aranx" }]
dependencies = [
"fastapi>=0.115",
"uvicorn[standard]>=0.32",
"sqlalchemy[asyncio]>=2.0",
"aiosqlite>=0.20",
"pydantic>=2.9",
"pydantic-settings>=2.6",
"cryptography>=43.0",
"httpx>=0.27",
"jinja2>=3.1",
"itsdangerous>=2.2",
"python-multipart>=0.0.12",
"pyyaml>=6.0",
]

Expand All @@ -32,6 +28,9 @@ dev = [
[project.scripts]
shadowgate = "shadowgate.cli.main:main"

[tool.hatch.version]
path = "src/shadowgate/version.py"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Expand Down
52 changes: 0 additions & 52 deletions src/shadowgate/server/models.py

This file was deleted.

Loading
Loading