chore: relicense to AGPL-3.0-or-later and add SPDX headers

Replaces LICENSE (GPLv3 -> AGPLv3) and prepends
`SPDX-License-Identifier: AGPL-3.0-or-later` to every source file
across decnet/, decnet_web/, tests/, scripts/, and tools/.

Rationale: closes the GPLv3 ASP loophole so any party operating a
modified DECNET as a network service must offer their modified
source. Personal copyright (Samuel Paschuan) + inbound=outbound
contributions make a future unilateral relicense infeasible.

- LICENSE: full AGPL-3.0 text (gnu.org/licenses/agpl-3.0.txt)
- COPYRIGHT: project copyright notice
- tools/add_spdx_headers.py: idempotent header injector
  (shebang- and PEP 263-aware)

Touches 1565 source files (.py, .ts, .tsx, .js, .jsx, .css, .sh).
No behavior change; comments only.
This commit is contained in:
2026-05-22 21:04:16 -04:00
parent ee10b55cfe
commit f2b3393669
1563 changed files with 1810 additions and 77 deletions

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Phase 6 — GET /api/v1/attackers/{uuid}/attribution.
Pins the contract: 401 unauth, 404 unknown attacker, 200 with empty

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""SSE events stream — GET /attackers/{uuid}/events (Phase 5).
Mirrors the topology events test pattern at

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import json
import pytest
from hypothesis import given, strategies as st, settings

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import json
import pytest
from hypothesis import given, strategies as st, settings

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest
import httpx
from hypothesis import given, settings, strategies as st

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""SSE events stream — GET /api/v1/campaigns/events.
Mirror of :mod:`tests.api.identities.test_events_stream`. Drives the

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""End-to-end coverage for /api/v1/canary/* via the live FastAPI app.
The planter's docker-exec call is patched so we don't need a real

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1 +1,2 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# viewer_token fixture is now in tests/api/conftest.py (shared across all API tests)

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest
from unittest.mock import patch

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest
from decnet.web.dependencies import repo

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import os
import json
import uuid as _uuid

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Read-only ``/credential-reuse`` API tests.
Mirrors ``tests/api/credentials/test_get_credentials.py`` for the

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest
import httpx
from hypothesis import given, settings, strategies as st

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""End-to-end coverage for /api/v1/deckies/files via the live FastAPI app.
The docker subprocess is stubbed; everything else (DB, repo, auth)

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""API coverage for /services/{name}/schema + per-decky config PUT/POST.
Engine layer is patched so the tests don't touch docker; auth + routing

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""End-to-end coverage for the live service add/remove endpoints.
Covers both scopes:

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""POST /deckies/deploy additive vs replace_fleet semantics.
Default behaviour (replace_fleet=False) appends the INI to the existing

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""POST /deckies/deploy auto-mode: master + swarm hosts → shard to workers."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest
import httpx
from hypothesis import given, settings, strategies as st

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET /deckies/lifecycle?ids=… — poll endpoint for the wizard."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Tests for the mutate decky API endpoint — now 202 fire-and-forget.

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Tests for the mutate interval API endpoint.
"""

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import asyncio
from unittest.mock import AsyncMock, MagicMock, patch

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""SSE events stream — GET /api/v1/identities/events.
Mirrors :mod:`tests.api.topology.test_events_stream` — the route is

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest
import httpx
from typing import Any, Optional

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Histogram bucketing tests using freezegun.

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET /api/v1/orchestrator/events/stats — failure-count badge endpoint (DEBT-042)."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""SSE events stream + list — /api/v1/orchestrator/events{,/stream}."""
from __future__ import annotations

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET/PUT /api/v1/realism/config — operator-tunable weights."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET/PUT /api/v1/realism/personas — global persona pool CRUD."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET /api/v1/realism/synthetic-files — paginated browser API."""
from __future__ import annotations

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
import pytest
import httpx
from ..conftest import _FUZZ_SETTINGS

View File

@@ -1 +1,2 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
# Stream test package

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Tests for the SSE stream endpoint (decnet/web/router/stream/api_stream_events.py).
"""

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Agent-enrollment bundle flow: POST → .sh → .tgz (one-shot, TTL, races)."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""POST /swarm/hosts/{uuid}/teardown — per-host and per-decky remote teardown."""
from __future__ import annotations

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Shared fixtures for /api/v1/swarm-updates tests.
The tests never talk to a real worker — ``UpdaterClient`` is monkeypatched

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET /api/v1/swarm-updates/hosts — per-host updater health fan-out."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""POST /api/v1/swarm-updates/push — happy paths, rollback, validation."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""POST /api/v1/swarm-updates/push-self — updater-only upgrade path."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""POST /api/v1/swarm-updates/rollback — single-host manual rollback."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Tests for the generic Exception handler at decnet/web/api.py.
Mitigation target: threat model F1/I — "Production error handler suppresses

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""RBAC matrix tests — verify role enforcement on every API endpoint."""
import pytest

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
RBAC contract test — every route is classified by server-side dependency
introspection and exercised with a viewer JWT.

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Direct async tests for the configured Repository implementation.
These exercise the DB layer without going through the HTTP stack.

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Schemathesis contract tests — full compliance, all checks enabled.

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Schemathesis contract tests for the worker-side agent API
(``decnet.agent.app``).

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Schemathesis contract tests for the swarm-controller API
(``decnet.web.swarm_api``).

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Schemathesis contract tests scoped to the TTP Tagging API surface.
E.3.17 of ``development/TTP_TAGGING.md``. The full ``test_schemathesis``

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Per-user SSE connection cap — F6/D mitigation."""
import pytest
from fastapi import HTTPException

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Phase 3 Step 4 — child CRUD: LAN / decky / edge."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""SSE events stream — GET /topologies/{id}/events (DEBT-030)."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Phase 3 Step 1 — parity between repo dict output and Pydantic DTOs.
These tests pin the contract that repo-hydrated dicts deserialize

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Phase 3 Step 5 — live mutation queue endpoints."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Per-topology persona endpoints — GET/PUT /topologies/{id}/personas."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Phase 3 Step 2 — read endpoints: list / get / status-events / catalog."""
from __future__ import annotations

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Phase 3 Step 3 — write endpoints: create / delete / deploy."""
from __future__ import annotations

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Tests for GET /api/v1/transcripts/{decky}/{sid}.

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Shared helpers for TTP API contract tests (E.2.8).
The base ``tests/api/conftest.py`` already provides ``client``,

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""E.2.8 — GET endpoint shape + auth contract for /api/v1/ttp/*.
The TTP router landed at E.1.9 (contract phase) returning typed

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""E.2.8 — Response-schema stability via golden fixtures.
The OpenAPI schema for each TTP endpoint is captured under

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET /api/v1/ttp/rules returns the live rule catalogue.
Pins the runtime fix that replaced the contract-phase ``return []``

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""E.2.8 — Admin-only mutation endpoints for /api/v1/ttp/rules/{id}/state.
The two mutation endpoints (POST / DELETE) carry the rule

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""GET /api/v1/ttp/tags/by-{scope}/{uuid}/{technique_id}.
Pins the operator inspector endpoint that surfaces the rule engine's

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""CRUD tests for /api/v1/webhooks — admin-gated subscription management."""
from __future__ import annotations

View File

@@ -0,0 +1 @@
# SPDX-License-Identifier: AGPL-3.0-or-later

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Tests for ``POST /api/v1/workers/{name}/start`` + ``start-all``.
Uses the shared ``client`` / ``auth_token`` / ``viewer_token`` fixtures

View File

@@ -1,3 +1,4 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Tests for the Workers panel API endpoints.
Covers ``GET /api/v1/workers`` (viewer-readable, always surfaces every