Skip to content

Post 0.1.0 - #4

Merged
5aranx merged 5 commits into
mainfrom
post-0.1.0
Nov 30, 2026
Merged

5aranx merged 5 commits into
mainfrom
post-0.1.0

Conversation

@5aranx

@5aranx 5aranx commented Nov 30, 2026

Copy link
Copy Markdown
Owner

No description provided.

Only SHADOWGATE_* keys are read from .env; unknown SHADOWGATE_* keys are
still rejected, and shadowgate server reports them and exits 2 instead of
raising a traceback.
- server/db.py: Transaction is the shared re-entrant lock and the unit
  of work. Nested calls join it; the outermost exit commits; any error
  (or a swallowed nested error) rolls everything back.
- Queue, run engine and store no longer commit mid-operation.
- /jobs, /agent/poll and /agent/result run as one transaction each, so a
  failed audit write or engine error leaves no stranded job and a retried
  result is recorded and advances the run (fixes the engine gap).
- Enrollment writes its audit entry before committing (fixes F2).
- AuditLog defers appends made inside a transaction and writes them just
  before the commit; they are dropped on rollback.
- tests/test_transactions.py: 9 failure-injection tests, all failing on
  the previous code.
- After every write, <log>.head records the entry count and last hash;
  verify() detects removed or rewritten newest entries, a missing
  anchor, and reports where the chain breaks.
- If the log changed behind the server's back, the next write keeps the
  old anchor as evidence and appends an audit_anchor_mismatch entry.
- Head hash, count and size are cached per file; appends no longer
  re-read the log.
- GET /audit?verify=true adds a verification object.
- 13 audit tests; 12 fail on the previous code.
- shadowgate tls init: private CA and server certificate (EC P-256) for
  the given hostnames plus localhost/127.0.0.1; keys created mode 600;
  never overwrites.
- shadowgate server --tls-cert/--tls-key (or SHADOWGATE_TLS_*): serves
  HTTPS; checks the files load together and the key is owner-only.
  A non-loopback bind without TLS is refused unless --allow-plaintext.
- agent enroll --ca-file pins the CA in the 0600 credential file; plain
  HTTP to non-loopback hosts is refused; the agent stops (exit 2) when
  the server certificate fails verification.
- tests/test_tls.py: 13 tests including an HTTPS end-to-end run with
  wrong-CA rejection.
- CI installs from the lock file and runs examples/demo.sh.
- examples/demo.sh: HTTPS server, three agents, a runbook run, audit
  verification and a tamper check, in a temporary directory.
- README: CI, release, license and Python badges; demo section.
- Tracker §14 records N1, T11, T12, T14, CI and demo.
@5aranx
5aranx merged commit 0c3ba78 into main Nov 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant