feat(arch01): atomic platform install + authority kernel (Closes #822) #839
Merged
sysadmin
merged 1 commits from 2026-07-22 23:00:25 -05:00
feat/issue-822-atomic-install-authority-kernel into master
Labels
Clear labels
allocator
anti-stomp
architecture
bug
chore
codex
concurrency
contamination
control-plane
dashboard
database
design
documentation
enhancement
gitea
glitchtip
important
incident
incident-bridge
integration
jenkins
labels
leases
mcp
mcp-health
mcp-menu
multi-project
mutating
nice-to-have
observability
portability
preflight
protected-branch
queue
read-only
reconnect
recovery
refactor
release
reliability
resumable-review
reviewer
roadmap
safety
security
self-hosted
sentry
stale-runtime
status:blocked
status:in-progress
status:pr-open
status:ready
terminal-lock
testing
tracker
type:bug
type:feature
type:feature
type:guardrail
visibility
workflow
workflow-hardening
workflow-hardening
Controller-owned work allocator
Prevent concurrent LLM session stomping
Architecture / structural design
OpenAI Codex client / workflow session surface
Concurrent session safety
Workflow or session contamination incident
MCP control-plane coordination and allocation authority
MCP operational dashboard/queue view
Internal coordination storage (SQLite/Postgres)
Design / investigation, no implementation
Docs / runbooks
New feature or improvement
Gitea MCP workflow
GlitchTip integration
Operational or process incident requiring durable audit trail
Sentry-to-Gitea incident bridging
Integration testing
Jenkins integration
Label taxonomy management
Lease adopt/release/expire lifecycle
MCP server / tooling
MCP namespace and runtime health
MCP menu surface
Work spanning multiple monitoring projects or Gitea repos
Mutating action; requires gating
Observability, metrics, traces, error reporting
Cross-platform / portability
Shared preflight gates before mutation
Protected branch / stable-branch policy concern
Work queue visibility and allocation
Read-only, no mutation
MCP client reconnect/reload recovery path
Recovery paths for stale/foreign leases
Code refactor / restructure
Release / versioning
Reliability / failure handling
Persist and resume prepared review verdicts across sessions
Reviewer workflow tooling
Roadmap / umbrella issue
Safety rails and fail-closed mutation guards
Security / trust boundary
Self-hosted infrastructure integration
Sentry error monitoring integration
Stale backend daemon / runtime-vs-master parity failures
Issue is blocked
Issue is being worked on
Issue has an open pull request
Issue is ready for work
Terminal review lock (#332) path
Tests / test coverage
Issue tracker hygiene / meta
Bug or defect
Feature or enhancement
Feature or enhancement
Safety gate or guardrail
Workflow state visibility for LLMs/operators
Cross-tool workflow
LLM workflow coordination hardening
LLM workflow coordination hardening
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#839
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #822
ARCH-01 Foundation Slice A — the first implementation leaf of the #820/#821 program. SQLite-first. PostgreSQL parity is a separate issue (#827).
What this delivers
A new module,
arch01_platform.py, holding a disabled-by-default authority kernel over a single SQLite connection. Nothing in the running MCP server imports it; instantiatingPlatformKernelcreates an isolated database and never touches the operational control-plane store. It becomes a security boundary only once these readiness checks pass in a target environment.cp_actor_principal/kind,cp_operation_mode,cp_service_session,cp_context_epochscalar functions registered from Python onlycurrent_class_idNOT NULL FKBEGIN IMMEDIATEtransaction, immutableinstalledmarker written last and validated by a fail-closedBEFORE INSERTtriggerCHECK (active_count >= 1)audit_recordsrejects UPDATE/DELETEEnforcement classification (per #820 vocabulary)
[TRUSTED-SERVICE]— actor-context authenticity: SQL can read thecp_*functions but has no statement that can define or set them.[SCHEMA]— fail-closed aborts, the dominance / immutability / NOT-NULL-class / last-active-grant invariants, enforced by CHECK/FK/trigger.[RUNTIME-ADAPTER]— none in this slice.Acceptance criteria → tests (#822 §12/§13)
Every AC is exercised against a real SQLite database; the migration runs on a fresh DB in
setUp.test_install_cleantest_install_twicetest_install_stage_rollback,test_no_partial_after_rollbacktest_dominance_missing/extra/malformedtest_principal_no_classtest_noninstaller_null_issuer,test_installer_null_issuer_only_during_installtest_context_missing/stale/epoch_shift,test_bad_actor_kind_or_mode_rejectedtest_bootstrap_immutable_update/delete,test_grant_reactivation_rejectedtest_concurrent_installtest_concurrent_last_grant_revoke,test_revoke_final_grant_deniedtest_raw_write_bypasstest_audit_createdtest_audit_immutableScope
Two new files, nothing else touched:
arch01_platform.py(new, 892 lines)tests/test_arch01_platform.py(new, 572 lines)Test evidence
Run with
venv/bin/python -m pytestfrom the allocated worktree, base master53c2c92.pytest tests/test_arch01_platform.py— 25 passed, 21 subtests passed.The 11 failures are the documented pre-existing master baseline at
53c2c92— six intest_commit_payloads.py, two intest_issue_702_review_findings_f1_f6.py, and one each intest_mcp_server.py::TestPreflightVerification,test_post_merge_moot_lease.py, andtest_reconciler_supersession_close.py. None toucharch01. This branch adds no new failures; the 25-test delta is the new suite.Exclusions / deferred (#822 §5/§17)
No evidence stores, repository bindings, workspaces, PostgreSQL, or ARCH-02/04. Full grant succession → grant-succession issue; full principal merge body → principal-equivalence issue (this slice lands only the class root + NOT NULL FK). Subsystem stays disabled by default until readiness checks pass.
Canonical PR State
Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #839
issue: #822
reviewer_identity: sysadmin
profile: prgs-reviewer
session_id: 23985-cfd59524152e
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/review-pr-839
phase: claimed
candidate_head:
6449594fd7target_branch: master
target_branch_sha:
689c60fc7clast_activity: 2026-07-23T03:46:48Z
expires_at: 2026-07-23T03:56:48Z
blocker: none
Canonical PR State
STATE: reviewed-approved
WHO_IS_NEXT: merger
NEXT_ACTION: Merge PR #839 into master on explicit operator approval
NEXT_PROMPT:
WHAT_HAPPENED: prgs-reviewer (sysadmin) reviewed PR #839 at head
6449594fd7against issue #822 acceptance criteria 1-14 and approved via native MCP review mutation.WHY: Scope is exactly two new files (arch01_platform.py +892, tests/test_arch01_platform.py +572), disabled-by-default with no reference from the running server and no operational control-plane store touched. The focused suite re-ran green at the candidate head (25 passed, 21 subtests passed); AC 1-14 each map to a named test (fail-closed actor protocol, exact dominance-set validation, raw-write bypass, append-only audit immutability, last-active-grant floor under concurrency). No new full-suite failures beyond the documented
53c2c92baseline of 11.ISSUE: 822
HEAD_SHA:
6449594fd7REVIEW_STATUS: APPROVED
MERGE_READY: true
BLOCKERS: none
VALIDATION: pytest tests/test_arch01_platform.py at head
6449594-> 25 passed, 21 subtests passed. git diff --stat vs base53c2c92= 2 files, +1464, no other files touched. merge-base with current master689c60fc=53c2c92(new-files-only diff does not overlap the #811 advance); Gitea reports the PR mergeable. Parity at submit: mutation_safe=true, restart_required=false, daemon_start=local=live_remote=689c60fc.NATIVE_REVIEW_PROOF: native MCP review mutation by prgs-reviewer (sysadmin) over the production stdio mcp_server transport, pid 23985, token_fingerprint 1425e1ee6e08fdc2; gitea_submit_pr_review action=APPROVE bound to head
6449594fd7under reviewer lease session 23985-cfd59524152e.LAST_UPDATED_BY: prgs-reviewer (sysadmin)
repo: Scaled-Tech-Consulting/Gitea-Tools
pr: #839
issue: #822
reviewer_identity: sysadmin
profile: prgs-merger
session_id: 49016-122421d26c7b
worktree: /Users/jasonwalker/Development/Gitea-Tools/branches/issue-822-atomic-install-authority-kernel
phase: claimed
candidate_head:
6449594fd7target_branch: master
target_branch_sha: none
last_activity: 2026-07-23T03:59:28Z
expires_at: 2026-07-23T04:09:28Z
blocker: none
Stale #332 review-decision lock cleanup (#594)
Status: APPLIED
sysadminprgs-merger2026-07-23T04:00:28.406939+00:00approveon PR feat(arch01): atomic platform install + authority kernel (Closes #822) (#839)closed(merged=True)caaae9b6eef496c8f8ed451ac216250c62d495c61prgs-reviewerManual deletion of session-state files is not the workflow.
This path only clears a lock when the referenced PR is merged/closed.