ARCH-01 Foundation Slice A — Atomic platform installation and authority kernel #822
Closed
opened 2026-07-22 19:40:54 -05:00 by jcwalker3
·
0 comments
No Branch/Tag Specified
master
fix/issue-790-slice-a-heartbeat-policy
feat/issue-628-autonomous-handoffs-orchestration
feat/issue-634-readonly-system-health-api
feat/issue-638-webui-app-shell-phase1
fix/issue-840-cross-role-queue-allocation
feat/issue-822-atomic-install-authority-kernel
feat/issue-633-console-authz-audit-model
feat/issue-636-inventory-api
fix/issue-815-preflight-worktree-forwarding
feat/issue-812-publish-unpublished-commit
feat/issue-635-project-registry-api
feat/issue-798-worker-registry-schema
feat/issue-610-live-remote-parity
docs/issue-632-web-console-architecture
fix/issue-760-exact-owner-renewal
fix/issue-787-kill-segment-separators
chore/issue-681-preserve-review-session-wip
v1.1.0
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
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#822
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.
Candidate architecture requiring executable validation; not yet approved, production-ready, or certified.
Parents: #820, #821. First implementation leaf. SQLite-first. PostgreSQL parity is a separate issue.
1. Summary / objective
Implement the smallest executable ARCH-01 foundation: a connection-bound authenticated actor context, an immutable authority lattice, the principal-equivalence root, and a single-transaction platform installation that seeds the initial
platform.bootstrapgrant and an immutableinstalledmarker. Everything else (evidence, bindings, workspaces) is out of scope.2. Security/correctness problem
Without an authenticated caller bound to each mutation, any writer can assert another principal's authority. Without an atomic install with an immutable finalized marker, a partial/replayed install can seed a forged authority root. This slice establishes the trust root all later authority checks depend on.
3. Threat model / failure modes
Caller naming a foreign principal in an actor column; missing/stale/replaced connection context; raw-write bypass of triggers; two concurrent installs; revocation racing to zero active grants; post-install mutation of bootstrap artifacts; a principal with no equivalence class.
4. In-scope behavior
cp_actor_principal(),cp_actor_kind(),cp_operation_mode(),cp_service_session(),cp_context_epoch(). SQL may read but cannot set them.[TRUSTED-SERVICE]authenticity.cp_context_epoch(), read fields, re-read epoch, abort unless equal+non-null+bound to the active request/transaction; abort if any field absent/malformed/expired/unauthorized.[SCHEMA](fail-closed abort).operation_mode ∈ {normal,install,merge,internal_service}closed enum;actor_kind ∈ {operator,supervisor,service,installer}.principal_equivalence_classescreated before its initial principal;principals.current_class_idNOT NULL FK.[SCHEMA].authority_dominanceimmutable lattice, exact seeded tuple set:(platform.bootstrap,platform.bootstrap),(platform.bootstrap,project.admin),(platform.bootstrap,supervisor.root.establish),(supervisor.root,supervisor.register),(supervisor.root,supervisor.verify),(supervisor.root,supervisor.recover).[SCHEMA].authoritative_issuerswithUNIQUE(issuer_kind,issuer_id); installer bootstrap: insert installer principal with temporary NULL issuer (gated to install mode, installer only) → insert distinguished operator-key issuer → update installer to reference it.[SCHEMA]+[TRUSTED-SERVICE]mode gate.BEGIN IMMEDIATE; check no install marker; class → installer principal → issuer → installer update → dominance tuples →platform_bootstrap_seed→ initialplatform_bootstrap_grants(granted_by NULL, active)→platform_active_invariant(1,1)→install_state('installed')last.install_stateBEFORE INSERTtrigger validates each required dominance tuple individually (reject missing/additional/malformed), the seed↔installer link, exactly one active NULL-grantor grant for the installer, installer issuer non-NULL, no extra principal created under the exception.[SCHEMA].install_state,platform_bootstrap_seed, distinguished issuer identity, installer registration fields, initial-grant identity,authority_dominance. Reject UPDATE/DELETE.[SCHEMA].require_installedon every privileged table: abort when no marker and mode≠install.[SCHEMA].platform_active_invariantrow; revoke rejected if it would drop active_count below 1.[SCHEMA]+[TRUSTED-SERVICE]serialization viaBEGIN IMMEDIATE.audit_recordsappend-only (reject UPDATE/DELETE).[SCHEMA].5. Exclusions
No evidence stores/attestations, no repository bindings, no transports beyond what the distinguished issuer needs, no workspaces, no PostgreSQL, no ARCH-02/04, no principal merge operation body (only the class root + NOT NULL FK; full merge is a separate issue).
6. Schema/operation contracts
Tables:
principals,principal_equivalence_classes,authoritative_issuers,authority_dominance,platform_bootstrap_seed,platform_bootstrap_grants,platform_active_invariant,install_state,audit_records, plus connection actor functions. Operations:install_platform,grant_platform_bootstrap,revoke_platform_bootstrap,register_principal(class+principal atomic). (Full candidate DDL exists in the design baseline but is unexecuted and contains defects; implement the intended semantics and correct on execution.)7. SQLite behavior
BEGIN IMMEDIATEbefore the install-state check serializes concurrent installs; the loser rechecks and returnsALREADY_INSTALLED. Self-FK (registered_by = own id) resolves at statement end. Missing actor function ⇒no such function⇒ abort.8. PostgreSQL behavior
Out of scope here; tracked in the PostgreSQL service-boundary issue. Do not claim parity.
9. Concurrency / transaction requirements
One atomic install transaction; no durable
installingphase; no resume path — crash before commit leaves nothing. Grant succession serialized on the invariant row (full succession semantics deferred to its own issue; this slice implements only last-grant protection + basic grant/revoke).10. Structured results
INSTALLED,ALREADY_INSTALLED,INVALID_ACTOR_CONTEXT,INVALID_BOOTSTRAP_STATE,DOMINANCE_SET_MISMATCH,AUTHORIZATION_DENIED,CONCURRENT_INSTALLATION_LOST.11. Enforcement classification
Context authenticity
[TRUSTED-SERVICE]; fail-closed aborts, dominance/immutability/NOT-NULL-class/last-grant[SCHEMA]; no[RUNTIME-ADAPTER]in this slice.12. Acceptance criteria (numbered)
INSTALLED, marker present.ALREADY_INSTALLED, no mutation.DOMINANCE_SET_MISMATCH, no marker.INVALID_ACTOR_CONTEXT, fail closed.INSTALLED, oneCONCURRENT_INSTALLATION_LOST/ALREADY_INSTALLED.13. Named tests
t_install_clean(+),t_install_twice(−),t_install_stage_rollback(rollback, one per stage),t_dominance_missing/t_dominance_extra/t_dominance_malformed(−),t_no_partial_after_rollback(rollback),t_principal_no_class(−),t_nonobstaller_null_issuer(−),t_context_missing/t_context_stale/t_context_epoch_shift(−),t_bootstrap_immutable_{update,delete}(raw-bypass),t_concurrent_install(concurrency),t_concurrent_last_grant_revoke(concurrency/write-skew),t_raw_write_bypass(raw-bypass),t_audit_created(+),t_audit_immutable(raw-bypass).14. Required audit events / evidence
platform_installed,platform_grant_created,platform_grant_revoked,principal_registered. Migration must execute against a fresh SQLite DB; test run output is the durable evidence.15. Dependencies / parent
Parents #820, #821. No dependency on other leaves.
16. Definition of done
Migration executes on a fresh SQLite DB; ACs 1–14 pass including negative/rollback/raw-write/concurrency; no known silent authorization bypass; subsystem disabled by default until readiness checks pass; docs distinguish implemented vs planned; bounded PR against current authoritative base; author does not self-review/merge; every deferred contract has a linked follow-up.
17. Known limitations / deferred
Full grant succession (expiry/suspension/replacement) → grant-succession issue. Full merge semantics → principal-equivalence issue. Evidence, bindings, workspaces, PostgreSQL → their own issues. Candidate DDL is unexecuted and defect-bearing; execution is authoritative.