Authoritative Gitea candidate-state schema, claims, and relationships #990
Open
opened 2026-07-31 10:16:24 -05:00 by jcwalker3
·
0 comments
No Branch/Tag Specified
master
fix/issue-987-native-mcp-bootstrap
feat/issue-985-project-scoped-launcher-identity
fix/issue-983-cross-repo-base-ref
feat/issue-980-stale-worker-retirement
fix/issue-975-client-identity-heartbeat
fix/issue-973-cross-repo-canonical-roots
fix/issue-970-safely-resolve-missing-worktrees
fix/issue-969-native-mcp-bootstrap
feat/issue-664-break-glass-restart
feat/issue-708-mcp-namespace-attachment
feat/issue-665-restart-audit
fix/issue-700-durable-walls
fix/issue-704-prevent-env-workspace-bindings
feat/issue-707-cross-project-boundaries
fix/issue-690-review-profile-switch-guard
fix/issue-953-bootstrap-lock-provenance
feat/issue-949-native-fleet-inventory
fix/issue-943-runtime-context-helpers
fix/issue-945-owning-pr-renewal-evidence
fix/issue-941-scope-guard-bootstrap-wiring
docs/issue-930-remote-mcp-coupling-inventory
fix/issue-892-author-bootstrap-deadlock
fix/issue-686-detect-reject-manual-mcp
fix/issue-672-mcp-config-drift
fix/issue-689-deterministic-mcp-namespace
feat/issue-666-concurrent-mcp-restart-tests
feat/issue-659-maintenance-drain-mode
feat/issue-648-notifications-console
fix/issue-670-direct-master-incident
feat/issue-644-console-recovery
feat/issue-650-providers-insights
feat/issue-669-scoped-component-recovery
docs/issue-668-mcp-ha-rolling-restart
feat/issue-667-console-restart-controls
feat/issue-645-linkage-console
feat/issue-643-request-preview-initiate
fix/issue-897-permission-stale-runtime-classification
feat/issue-641-runtime-session-view
feat/issue-663-restart-classes
feat/issue-661-drain-proof-hard-gate
fix/issue-854-semantic-container-exclusion
issue-640
fix/issue-682-starlette-httpx2
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
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
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
Something is not working
This issue or pull request already exists
New feature
Need some help
Something is wrong
More information is needed
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Scaled-Tech-Consulting/Gitea-Tools#990
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.
Parent umbrella: issue #989 — "MCP Control Plane: charter-compliant autonomous task selection (umbrella)". This reference is informative bootstrap evidence only and is not a machine-enforced dependency; this issue delivers the structured relationship operations that replace it.
Problem
A worker cannot perform the charter's comparison step, cannot route around in-progress work, and cannot escalate an ambiguity, because the required facts have no durable authoritative Gitea representation, active claims live only in the control-plane database, no sanctioned operation creates structured relationships, and issue-edit authority is indistinguishable from comment authority.
Charter connection
Responsibilities assigns authoritative claims to Gitea and priority-setting to the human maintainer. Project state model requirements makes active claims, priorities, hard dependencies, and blocked-pending-clarification mandatory structured, machine-discoverable Gitea state, and declares any inability to express them a defect to be fixed rather than worked around. Contention is normal requires active claims to be visible so workers route around in-progress work before attempting a claim. Dependencies keeps hard dependencies (a gate) distinct from priority (a comparison). Escalation requires a machine-discoverable marker.
Verified current gap
authoritative_source: control_plane_db.Consequence: Escalation is inoperable.
Scope
A. Field authority. Structured Gitea authority for priority, hard dependencies, clarification blocks, readiness, urgency, project impact, and active claims. Permitted sources, maintainer ownership, ordering for comparable values, conflict handling, invalid-state handling, and typed missing-state failures.
priority_unset; two labels give null plusmultiple_priority_labelslisting both; unknown value gives null plusunknown_priority_label. Never pick one, never default, never rank unlabelled work lasturgency_unset; conflicting returns all signals separately with scalar null plusconflicting_urgency_signalsno_impact_authority. Never synthesised from dependency counts, labels, or inferenceAny count derived from dependency edges is named
unblocks_countordependency_reachand is never presented as project impact.B. Label policy. Authoritative label policy documenting which labels affect priority, readiness, clarification state, or worker eligibility. Resolve the duplicate label IDs — the feature-type name resolves to IDs 103 and 130, and the workflow-hardening name to IDs 105 and 128; both are live and unarchived. Record which is canonical, whether the duplicate is archived or removed, and how existing issues carrying each ID are reconciled.
C. Claim authority. Durable active-claim publication in Gitea: existence, owner identity, task binding, validity window. A worker inspecting Gitea alone must see enough to route around active work. Database reservations taken before publication are strictly transient: timeout-bounded, non-authoritative, never returned to the caller as an acquired claim, never usable as a durable ownership record, and automatically rolled back or reconciled on failure or timeout. No successful worker claim, capability activation, or mutation authority exists before Gitea claim publication succeeds. No long-lived blocking condition may be invisible to a worker inspecting Gitea.
This is not a distributed transaction and must not be described as one. Deliver a documented consistency protocol with bounded failure states, idempotent recovery, and fail-closed mutation authority.
D. Reconciliation — fail closed, never resolving toward the more permissive side:
Neither store may delete a claim record on the strength of the other alone.
E. Structured relationships. Sanctioned native operations for creating, reading, verifying, and reconciling structured parent/child and hard-dependency relationships. Remove allocator-only authority for dependency edges. Backfill structured relationships for the umbrella, Children 1 through 5, #963, #964, and #916 where appropriate, replacing the bootstrap body references.
F. Distinct issue-edit permission. Define a permission for editing issue titles and bodies, separate from issue commenting. Stop treating comment permission as proof of title and body edit authority. Make the issue-edit operation resolve through the distinct permission. Keep commenting and editing independently grantable. Migrate affected profiles intentionally. Preserve typed denial when comment permission exists but edit permission does not. Document compatibility and rollout for the permission change.
Non-goals
Building the inspection surface (Child 2) or the claim operation (Child 3). Re-owning lease lifecycle mechanics — consume #952, #792, #793, #890. Weakening ownership, fencing, or fail-closed behaviour. Letting a caller assert its own priority, urgency, impact, ownership, or eligibility. Claiming a distributed transaction. Broadening any profile's permissions beyond the intentional edit-permission migration.
Functional requirements
Every field resolves from its named authority or returns an explicit typed state gap. The MCP never invents, combines, weights, or silently defaults any project fact. Hard dependency and readiness remain structurally distinct fields, never collapsed into one string.
Safety and authority boundaries
Gitea is the durable claim authority. The database enforces, caches, indexes, and fences but is never the sole durable authority. Priority is maintainer-owned. Fail-closed ownership enforcement is preserved throughout.
Acceptance criteria
Required tests and validation
Per-field authority resolution and state-gap honesty. Two-priority-label conflict. Unknown priority value. Conflicting urgency signals. Absent impact authority. A database-only provisional reservation cannot become an invisible active claim or a successful mutation grant — asserted directly. Timeout rollback. Partial-publication idempotent recovery. Each reconciliation condition. Relationship create, read, verify, reconcile, and backfill. Positive and negative capability tests for issue editing, including comment-without-edit denial. Expired-ownership discoverability reproducing the #952 evidence combination. Contract tests use deterministic fixtures with timestamps, identifiers, and ordering normalized.
Dependencies
Until this issue delivers sanctioned structured relationship operations, the references below are informative bootstrap evidence only. They must not be treated as machine-enforced hard dependencies and must be backfilled as structured relationships when the capability exists.
#890 single authoritative ownership record (hard). #952 single lease-eligibility model. #792 terminal retirement. #793 read-side generation fencing.
Maintainer inputs required before completion: priority ordering, permitted urgency sources, project-impact authority, reconciliation window, canonical-label resolution, and approval of the edit-permission migration.
Compatibility and rollout
Additive. New labels and markers extend the catalog. Claim-record migration is additive-then-cutover, never destructive; existing locks, leases, worktrees, and handoff ledgers are preserved. The edit-permission change is a deliberate migration with documented rollout, not an implicit broadening. Compatibility is proven by schema-compatibility and contract tests, not literal response comparison.
Rollback behavior
Reverting leaves existing enforcement intact and stops publication of new Gitea claim records. It never re-authorizes database-only active ownership as a supported state, never returns a transient reservation as a claim, and never restores comment permission as proof of edit authority.
Documentation requirements
A field-authority reference covering source, ordering, conflict rule, and state-gap code per field. A claim-authority document covering the publication protocol, every bounded failure state, and recovery semantics, explicitly stating this is not a distributed transaction. A label policy document. A relationship-operations reference. A permission-migration guide.
Completion evidence
The published ordering artifact, the marker definition and its documented semantics, the label policy and duplicate resolution, the relationship backfill result, the edit-permission test matrix, and the invisible-claim test results — all recorded on this issue.
Reusable existing issues, PRs, and primitives
#890, #952, #792, #793. Live primitives: dependency-edge listing, workflow-lease listing, label listing and setting, issue marking.
Fundamental-workflow stage supported
inspect -> choose — charter steps 3 and 4, plus Project state model requirements and Escalation.