ARCH-04 — Workspace configuration generations, immutable history, and current-evidence integrity #834
Open
opened 2026-07-22 19:49:27 -05:00 by jcwalker3
·
0 comments
No Branch/Tag Specified
master
fix/issue-844-exclude-epic-containers
fix/issue-842-conflict-fix-lease-lifecycle
feat/issue-646-policy-guardrail-visibility
fix/issue-843-cross-role-allocation-handoff
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#834
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, #832. Depends on: #833 (global identities).
1. Summary / objective
Implement workspace configuration generations with immutable history and a valid current-evidence integrity model:
status='verified'requires a same-binding, clean, current-generation, unexpired evidence row via a literal-free composite foreign key plus explicit predicates.2. Security/correctness problem
A stale clean scan must not remain "current" after the workspace's storage/path/node/volume/domain changes. The prior candidate used an invalid FK containing a literal
1; it must use real child columns, andverifiedmust require non-null evidence, clean flag, generation agreement, unexpired evidence, and live-object joins.3. Threat model / failure modes
Old clean evidence reselected after a change; NULL child columns satisfying a composite FK; direct generation edits; unverified binding retaining a stale current pointer; evidence expiry ignored.
4. In-scope behavior
[SCHEMA].workspace_config_history(per generation: storage_identity, registered_path, node_id/shared_volume_id, node/volume incarnation, exclusion_domain_id, exclusion_domain_generation). Direct generation edits prevented.[SCHEMA].current_config_generation, append history,status='fenced', clear current-evidence pointer + clean flag; defined pointer-clearing/fencing order and rollback.[SCHEMA]trigger.UNIQUE(workspace_binding_id, evidence_row_id, is_clean, workspace_config_generation)withis_cleana stored/generated column; current-evidence FK uses real child columns (current_verification_evidence_id,current_evidence_is_clean,current_config_generation) — never a literal.[SCHEMA].status='verified'requires: non-null evidence id,current_evidence_is_clean=1, non-null current generation matching, unexpired eligible evidence, and required live-object joins (node/volume/domain/supervisor status). CHECK enforces the first three; the live joins + expiry are use-time[SCHEMA]joins (+[RUNTIME-ADAPTER]physical reprobe from the probing child).5. Exclusions
No probe/record race protocol (→ probing child), no retirement fencing cascade (→ lifecycle child), no global identity registration (→ #833).
6. Schema/operation contracts
workspace_bindings,workspace_config_history,workspace_verification_evidence. Operations:register_workspace_binding,record_workspace_verification(supervisor.verify),bump_workspace_config,fence_binding.7. SQLite behavior
Composite FK with real child columns;
is_cleangenerated column;BEGIN IMMEDIATEfor bump; CHECK for verified predicates.8. PostgreSQL behavior
Same constraints; generated column;
FOR UPDATEon the binding row during bump; parity tested.9. Concurrency / transaction requirements
A verification concurrent with a config bump cannot leave a verified pointer at a superseded generation; bump fences and clears atomically.
10. Structured results
VERIFIED,FENCED,VERIFICATION_REQUIRES_CLEAN_CURRENT_EVIDENCE,GENERATION_MISMATCH,EVIDENCE_EXPIRED,STALE_POINTER_CLEARED.11. Enforcement classification
Composite FK (identity+cleanliness+generation), verified predicates, immutable history, bump-fencing
[SCHEMA]; expiry/live-object ineligibility partly[SCHEMA]join +[RUNTIME-ADAPTER]reprobe (probing child).12. Acceptance criteria
verifiedrequires non-null evidence id, clean flag, matching generation, unexpired evidence, live-object joins.13. Named tests
t_initial_generation(+),t_config_history_immutable(raw-bypass),t_bump_fences_and_clears(+),t_current_evidence_fk_clean(−),t_verified_predicates(−),t_unverified_clears_pointer(+),t_stale_generation_pointer(−),t_expired_evidence(−).14. Audit events / evidence
workspace_verified,workspace_config_bumped,workspace_fenced. Test output evidence.15. Dependencies / parent
Parents #820, #832; depends #833; consumes evidence subjects from #825.
16. Definition of done
Executable SQLite (+PG); ACs pass incl. raw-bypass; bounded PR; no self-review/merge.
17. Known limitations / deferred
External drift with no DB change + probe/record race → probing child. Retirement fencing → lifecycle child.