Forge agreements module — terms of service, privacy policies, GDPR consent tracking with version pinning. Wraps domain-agreements.
| Tier | application |
| Role | unclassified (baselined) |
| Path | crates/application/agreements |
| Edition | 2024 |
| Targets | application_agreements |
| Public items | 9 across 2 modules |
| Tests | 8 |
What it is for
application-agreements — agreement/consent tracking for the Forge framework.
Wraps domain-agreements. Supports ToS, privacy policies, and per-party consent records with version pinning (consent always references a specific agreement version, not the agreement generically). Foundation for GDPR + similar compliance regimes.
Migration vendoring (OQ2, sprint-3.53)
domain-agreements ships its own unvendored migrations/001_agreements.sql. Following application-parties' pattern (not application-legal-documents', which copies the file into a local migrations/ dir): the SQL is include_str!'d directly from the domain crate's own migrations directory, no physical copy.
Host mounting
Not mounted in examples/staff-host this sprint — see docs/userstories/sprint-3.53-forge-agreements.md's Technical plan: this module has no assigned mount order in COMPANY-V1-MODULE-SURVEY.md §5's steps 1-5. Built and verified standalone; host wiring is a follow-up sprint's call.
Capabilities
AgreementsModule
application-agreements — agreement/consent tracking for the Forge framework.
| Item |
|---|
pub struct AgreementsModule |
AgreementsModule :: fn new() -> Self |
AgreementsModule :: fn name(& self) -> & 'static str |
AgreementsModule :: fn version(& self) -> & 'static str |
AgreementsModule :: fn migrations(& self) -> Vec <MigrationSet> |
AgreementsModule :: async fn migrate_pending(& self, pool : & PgPool) -> std::result::Result <u32, MigrationError> |
AgreementsModule :: fn permission_codes(& self) -> Vec <String> |
api (other)
HTTP API routers for application-agreements.
| Item |
|---|
fn admin_router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>, |
api::agreements_admin (other)
Agreements admin REST router — sprint-3.53.
| Item |
|---|
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>, |
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
application_agreements
apiapi::agreements_admin
flowchart TD n_application_agreements["application_agreements"] n_application_agreements --> n_api["api"] n_api --> n_api__agreements_admin["agreements_admin"]
Public surface
`crate root`
| Item | What it is |
|---|---|
pub struct AgreementsModule | — |
AgreementsModule :: fn new() -> Self | — |
AgreementsModule :: fn name(& self) -> & 'static str | — |
AgreementsModule :: fn version(& self) -> & 'static str | — |
AgreementsModule :: fn migrations(& self) -> Vec <MigrationSet> | — |
AgreementsModule :: async fn migrate_pending(& self, pool : & PgPool) -> std::result::Result <u32, MigrationError> | — |
AgreementsModule :: fn permission_codes(& self) -> Vec <String> | — |
`api`
| Item | What it is |
|---|---|
fn admin_router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>, | Admin router composing all agreements admin sub-routers |
`api::agreements_admin`
| Item | What it is |
|---|---|
fn router <S>() -> Router <S> where S : Clone + Send + Sync + 'static, PgPool : FromRef <S>, | Agreements admin router |
No pub use re-exports: every item above is declared in this crate.
Boundary
Reaches into domain, platform.
Shares tier application with 120 other crates: application-ai, application-analytics, application-approvals, application-assessments, application-audit-log, application-auth, application-billing, application-browser-automation, … (120 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) | application |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/application/agreements |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_application["application"] --> n_domain["domain"] n_application["application"] --> n_platform["platform"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `application-auth` | application | no | always |
| `application-core` | application | no | always |
| `application-rbac` | application | no | always |
| `domain-agreements` | domain | no | always |
| `platform-dto` | platform | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
async-trait | ^0.1 | — | no | always |
axum | ^0.7 | multipart | no | always |
chrono | ^0.4 | serde | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json | no | always |
tower-sessions | ^0.13 | — | no | always |
tracing | ^0.1 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
tokio | ^1 | full | no | always |
tower | ^0.5 | — | no | always |
Build. None.
Depended on by. Nothing in this workspace.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR SELF["application-agreements"] SELF -->|runtime| n_application_auth["application-auth"] SELF -->|runtime| n_application_core["application-core"] SELF -->|runtime| n_application_rbac["application-rbac"] SELF -->|runtime| n_domain_agreements["domain-agreements"] SELF -->|runtime| n_platform_dto["platform-dto"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | application_agreements | `src/lib.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
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | none detected |
| database access | yes |
| network I/O | yes |
| unsafe code | none detected |
| environment variables | yes |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
| Variable | Read in |
|---|---|
CARGO_PKG_VERSION | src/lib.rs |
DATABASE_URL | src/lib.rs |
TEST_DATABASE_URL | src/lib.rs |
Related capabilities
No workspace crate depends on this one.
Verification
| Kind | Count |
|---|---|
| Unit tests | 8 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
crate root | 1 | 0 | 0 |
api | 1 | 0 | 0 |
api::agreements_admin | 1 | 0 | 0 |
What the tests establish, by name:
a_database_error_never_reaches_the_client—src/api/agreements_admin.rscaller_correctable_errors_still_name_the_problem—src/api/agreements_admin.rsevery_route_refuses_an_anonymous_session—src/api/agreements_admin.rsevery_specified_path_is_mounted—src/api/agreements_admin.rsnot_consent_owner_maps_to_forbidden—src/api/agreements_admin.rspending_without_party_id_is_a_client_error_not_the_permission_check—src/api/agreements_admin.rsmigrate_pending_applies_the_vendored_migration—src/lib.rsmodule_declares_perms_and_migration—src/lib.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 2 | 9 |
Public modules with a //! block | 2 | 2 |
pie showData
title Public items with rustdoc
"Documented" : 2
"No rustdoc detected" : 7
Metrics
| Metric | Value |
|---|---|
| Rust source files | 3 |
| Source lines | 742 |
| Code lines | 568 |
| Public API items | 9 |
| Public modules | 2 |
| Tests | 8 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 14 |
| Workspace reverse dependencies | 0 |
pie showData
title Public API by kind
"function" : 2
"method" : 6
"struct" : 1
pie showData
title Rust source composition
"Code" : 568
"Blank or comment" : 174
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.