Define distributed target lease and fencing semantics #93
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/starintel-server!93
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "agent/issue-29-target-lease-semantics"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Root cause
Issue #26 added a strong KV lease authentication boundary, but it intentionally stopped at the trust/security boundary. The repository still lacked one backend-neutral contract for canonical lock identity, the complete lease record, legal state transitions, idempotent operations, finite acquisition deadlines, commit-time fencing, race outcomes, stable HTTP results, audit events, and split-brain recovery.
Contract defined
The existing authentication-boundary document now links to this semantics contract, and the documentation index identifies both as design-only.
Compatibility impact
This PR changes no runtime behavior or public API. Existing allowed lease routes continue to return the documented 501 backend-unavailable stub. It constrains future #30–#33 implementations: adapters that cannot provide linearizable atomic operations, durable monotonic fencing counters, finite deadlines, typed results, and fenced authoritative commits are not conforming.
Tests executed
python -m unittest discover -s tests -p 'test_*.py' -v: 10/10 passed.nix run .#star-unit-tests: 105 discovered / 105 executed / 105 passed / 0 failed / 0 skipped.nix run .#star-integration-tests: 35 discovered / 35 executed / 35 passed / 0 failed / 0 skipped.python scripts/check-starintel-schema-lock.py: passed atff814ff63868286d68e21502122832802cd5e361.docker compose config --quiet: passed../scripts/stack-test.sh: passed authenticated/scoped denial, FTS, restart, document persistence, and credential persistence checks.git diff --check: passed.Files changed
docs/target-lease-semantics.org(new normative design)docs/http-auth-kv-lease-boundary.orgdocs/index.orgtests/test_operational_salvage_contract.pyRemaining risks
This is intentionally design-only. The backend-neutral protocol (#30), Valkey atomic implementation (#31), authenticated APIs and execution enforcement (#32), and expiry/recovery/race evidence (#33) remain unimplemented. The fencing guarantee depends on those implementations preserving the defined commit linearization point; a read-check followed by an unconditional write is explicitly non-conforming.
Fixes #29