operations capa

operations-approval-workflow

DB-persisted reviewer-gated proposal state machine with one-pending-per-track invariant

DB-persisted reviewer-gated proposal state machine with one-pending-per-track invariant

Tieroperations
Roleunclassified (baselined)
Pathcrates/operations/approval-workflow
Edition2021
Targetsoperations_approval_workflow, pg_approval_workflow, pg_service_audit
Public items1 across 0 modules
Tests22

What it is for

# operations-approval-workflow

DB-persisted state machine for reviewer-gated proposals: proposed → {accepted, rejected, superseded}.

The invariant "at most one pending proposal per (tenant_id, entity_type, entity_id, workflow_kind)" is enforced by a partial unique index at the database, not by application-layer locks. Racing workers cannot both insert a pending proposal for the same track.

See docs/userstories/sprint-0.3-approval-workflow.md for the full Gate 1.5 consensus that shaped the v0.1 contract.

Capabilities

crate root

# operations-approval-workflow

Item
pub const APPROVAL_WORKFLOW_SCHEMA_VERSION: u32

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub const APPROVAL_WORKFLOW_SCHEMA_VERSION: u32Schema version this code expects

Re-exports. Exported here, defined elsewhere.

ExportDefined in
ApprovalErrorerrors::ApprovalError
ApprovalRepositoryrepository::ApprovalRepository
PostgresApprovalRepositorypostgres::PostgresApprovalRepository
{ApprovalProposal,ProposalState,ProposeInput,ReviewerDecision}models::{ApprovalProposal,ProposalState,ProposeInput,ReviewerDecision}
{actions,ApprovalService}service::{actions,ApprovalService}

Boundary

Reaches into foundation.

Shares tier operations with 40 other crates: operations-assessments, operations-block-imaging, operations-boot-media, operations-browser-agent-worker, operations-camera-discovery, operations-camera-liveview, operations-camera-registry, operations-compliance, … (40 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)operations
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/operations/approval-workflow
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_operations["operations"] --> n_foundation["foundation"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`foundation-audit-log`foundationnoalways
`foundation-basemodels`foundationnoalways

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
tokio^1fullnoalways
tracing^0.1noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio-test^0.4noalways

Build. None.

Depended on by. 1 workspace crate.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_approvals["application-approvals"] -->|uses| SELF
  SELF["operations-approval-workflow"]
  SELF -->|runtime| n_foundation_audit_log["foundation-audit-log"]
  SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
defaultpostgresyes
postgresyes
flowchart LR
  n_default["default"] --> n_postgres["postgres"]
  n_postgres["postgres"]

Targets

KindNameSource
liboperations_approval_workflow`src/lib.rs`
testpg_approval_workflow`tests/pg_approval_workflow.rs`
testpg_service_audit`tests/pg_service_audit.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimeyes
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesnone detected

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.

1 workspace crate depends on this one: application-approvals.

Verification

KindCount
Unit tests4
Integration tests18
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root100

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc11
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 1
    "No rustdoc detected" : 0

Metrics

MetricValue
Rust source files6
Source lines1041
Code lines789
Public API items1
Public modules0
Tests22
Examples0
Cargo features2
Direct runtime dependencies11
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "constant" : 1
pie showData
    title Rust source composition
    "Code" : 789
    "Blank or comment" : 252

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

Todas las operations · Manual