# kyitharko/aisig-proto architecture

> Architecture diagram of the GitHub repository kyitharko/aisig-proto, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kyitharko/aisig-proto
- Repository: https://github.com/kyitharko/aisig-proto

## Overview

aisig-proto is a synthetic research prototype for provider-verified authorization chains, session binding, freshness checks, and mediated tool decisions—not a production authorization service. The principal workflow is to submit raw signed-chain evidence for a three-valued authorization decision, bind a tester to a provider session, then mediate a synthetic tool request before recording any modeled effect. Separate asset-authority checks and experiment runners cover additional research questions. Links are limited to relationships stated in the README or shown by the sampled excerpts and SOURCE INDEX; unsampled wiring is not inferred.

Main entry points: [`src/verifier.rs`](https://github.com/kyitharko/aisig-proto/blob/main/src/verifier.rs) (Chain Verifier), [`src/asset_authority.rs`](https://github.com/kyitharko/aisig-proto/blob/main/src/asset_authority.rs) (Asset Authority), [`src/enforcement.rs`](https://github.com/kyitharko/aisig-proto/blob/main/src/enforcement.rs) (Tool Mediator), [`src/codec.rs`](https://github.com/kyitharko/aisig-proto/blob/main/src/codec.rs) (Strict Codec)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authorization["Chain Authorization"]
  node_verifier["Chain Verifier<br/>[verifier.rs]"]
  node_codec["Strict Codec<br/>[codec.rs]"]
  node_model["Typed Models<br/>[model.rs]"]
  node_crypto["Signature Crypto<br/>[crypto.rs]"]
  node_evidence[("Trust Evidence<br/>[evidence.rs]")]
  node_policy["Scope Policy<br/>[policy.rs]"]
  node_decision["Decision Outcomes<br/>[decision.rs]"]
  node_freshness["Status Freshness<br/>[freshness.rs]"]
end

subgraph group_mediation["Provider Mediation"]
  node_session["Session Proof<br/>[session.rs]"]
  node_mediator["Tool Mediator<br/>[enforcement.rs]"]
  node_effect_sink[("Synthetic Effects<br/>[enforcement.rs]")]
  node_demo_controller["Demo Controller<br/>[demo_controller.rs]"]
end

subgraph group_asset["Asset Authority"]
  node_asset_authority["Asset Authority<br/>[asset_authority.rs]"]
  node_asset_model["Asset Scope<br/>[asset.rs]"]
end

subgraph group_research["Research Experiments"]
  node_case_runner["Reviewed Cases<br/>[cases.rs]"]
  node_fixture["Scenario Fixture<br/>[fixture.rs]"]
  node_mutations["Case Mutations<br/>[mutations.rs]"]
  node_rq123["RQ1–RQ3 Cases<br/>[rq123_cases.rs]"]
  node_rq8_privacy["RQ8 Privacy<br/>[rq8_privacy.rs]"]
end

node_researcher(("Researcher / Caller"))
node_raw_bundle["Signed Bundle"]

node_researcher -->|"provides evidence"| node_raw_bundle
node_raw_bundle -->|"submits bytes"| node_verifier
node_verifier -->|"decodes bundle"| node_codec
node_verifier -->|"checks payloads"| node_model
node_verifier -->|"consults evidence"| node_evidence
node_verifier -->|"checks scope"| node_policy
node_verifier -->|"returns outcome"| node_decision
node_codec -->|"reports format errors"| node_decision
node_crypto -->|"signs canonical bytes"| node_codec
node_freshness -->|"supplies status oracle"| node_verifier
node_researcher -->|"proves possession"| node_session
node_session -->|"authorizes session"| node_mediator
node_mediator -->|"appends allowed effects"| node_effect_sink
node_mediator -->|"checks chain"| node_verifier
node_researcher -->|"submits asset chain"| node_asset_authority
node_asset_authority -->|"decodes signed records"| node_codec
node_asset_authority -->|"verifies signatures"| node_crypto
node_asset_authority -->|"checks asset declarations"| node_asset_model
node_fixture -->|"builds scenarios"| node_case_runner
node_mutations -->|"mutates scenarios"| node_fixture
node_case_runner -->|"evaluates chain cases"| node_verifier
node_rq123 -->|"evaluates asset cases"| node_asset_authority
node_rq8_privacy -->|"measures modeled mediation"| node_mediator
node_demo_controller -->|"routes demo requests"| node_mediator

click node_verifier "https://github.com/kyitharko/aisig-proto/blob/main/src/verifier.rs"
click node_codec "https://github.com/kyitharko/aisig-proto/blob/main/src/codec.rs"
click node_model "https://github.com/kyitharko/aisig-proto/blob/main/src/model.rs"
click node_crypto "https://github.com/kyitharko/aisig-proto/blob/main/src/crypto.rs"
click node_evidence "https://github.com/kyitharko/aisig-proto/blob/main/src/evidence.rs"
click node_policy "https://github.com/kyitharko/aisig-proto/blob/main/src/policy.rs"
click node_decision "https://github.com/kyitharko/aisig-proto/blob/main/src/decision.rs"
click node_freshness "https://github.com/kyitharko/aisig-proto/blob/main/src/freshness.rs"
click node_session "https://github.com/kyitharko/aisig-proto/blob/main/src/session.rs"
click node_mediator "https://github.com/kyitharko/aisig-proto/blob/main/src/enforcement.rs"
click node_effect_sink "https://github.com/kyitharko/aisig-proto/blob/main/src/enforcement.rs"
click node_asset_authority "https://github.com/kyitharko/aisig-proto/blob/main/src/asset_authority.rs"
click node_asset_model "https://github.com/kyitharko/aisig-proto/blob/main/src/asset.rs"
click node_case_runner "https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/cases.rs"
click node_fixture "https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/fixture.rs"
click node_mutations "https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/mutations.rs"
click node_rq123 "https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/rq123_cases.rs"
click node_rq8_privacy "https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/rq8_privacy.rs"
click node_demo_controller "https://github.com/kyitharko/aisig-proto/blob/main/src/bin/demo_controller.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_verifier,node_codec,node_model,node_crypto,node_evidence,node_policy,node_decision,node_freshness toneBlue
class node_session,node_mediator,node_effect_sink,node_demo_controller toneAmber
class node_asset_authority,node_asset_model toneMint
class node_case_runner,node_fixture,node_mutations,node_rq123,node_rq8_privacy toneRose
class node_researcher,node_raw_bundle toneIndigo
```

## Components

### Chain Authorization

- [Chain Verifier](https://github.com/kyitharko/aisig-proto/blob/main/src/verifier.rs): `src/verifier.rs`
- [Strict Codec](https://github.com/kyitharko/aisig-proto/blob/main/src/codec.rs): `src/codec.rs`
- [Typed Models](https://github.com/kyitharko/aisig-proto/blob/main/src/model.rs): `src/model.rs`
- [Signature Crypto](https://github.com/kyitharko/aisig-proto/blob/main/src/crypto.rs): `src/crypto.rs`
- [Trust Evidence](https://github.com/kyitharko/aisig-proto/blob/main/src/evidence.rs): `src/evidence.rs`
- [Scope Policy](https://github.com/kyitharko/aisig-proto/blob/main/src/policy.rs): `src/policy.rs`
- [Decision Outcomes](https://github.com/kyitharko/aisig-proto/blob/main/src/decision.rs): `src/decision.rs`
- [Status Freshness](https://github.com/kyitharko/aisig-proto/blob/main/src/freshness.rs): `src/freshness.rs`

### Provider Mediation

- [Session Proof](https://github.com/kyitharko/aisig-proto/blob/main/src/session.rs): `src/session.rs`
- [Tool Mediator](https://github.com/kyitharko/aisig-proto/blob/main/src/enforcement.rs): `src/enforcement.rs`
- [Synthetic Effects](https://github.com/kyitharko/aisig-proto/blob/main/src/enforcement.rs): `src/enforcement.rs`
- [Demo Controller](https://github.com/kyitharko/aisig-proto/blob/main/src/bin/demo_controller.rs): `src/bin/demo_controller.rs`

### Asset Authority

- [Asset Authority](https://github.com/kyitharko/aisig-proto/blob/main/src/asset_authority.rs): `src/asset_authority.rs`
- [Asset Scope](https://github.com/kyitharko/aisig-proto/blob/main/src/asset.rs): `src/asset.rs`

### Research Experiments

- [Reviewed Cases](https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/cases.rs): `src/experiment/cases.rs`
- [Scenario Fixture](https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/fixture.rs): `src/experiment/fixture.rs`
- [Case Mutations](https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/mutations.rs): `src/experiment/mutations.rs`
- [RQ1–RQ3 Cases](https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/rq123_cases.rs): `src/experiment/rq123_cases.rs`
- [RQ8 Privacy](https://github.com/kyitharko/aisig-proto/blob/main/src/experiment/rq8_privacy.rs): `src/experiment/rq8_privacy.rs`

### Other components

- **Researcher / Caller**
- **Signed Bundle**

## Connections

- Researcher / Caller → Signed Bundle: provides evidence (evidence: `README.md`)
- Signed Bundle → Chain Verifier: submits bytes (evidence: `src/verifier.rs`)
- Chain Verifier → Strict Codec: decodes bundle (evidence: `src/verifier.rs`)
- Chain Verifier → Typed Models: checks payloads (evidence: `src/verifier.rs`)
- Chain Verifier → Trust Evidence: consults evidence (evidence: `src/verifier.rs`)
- Chain Verifier → Scope Policy: checks scope (evidence: `src/verifier.rs`)
- Chain Verifier → Decision Outcomes: returns outcome (evidence: `src/verifier.rs`)
- Strict Codec → Decision Outcomes: reports format errors (evidence: `src/codec.rs`)
- Signature Crypto → Strict Codec: signs canonical bytes (evidence: `src/crypto.rs`)
- Status Freshness → Chain Verifier: supplies status oracle (evidence: `src/freshness.rs`)
- Researcher / Caller → Session Proof: proves possession (evidence: `README.md`)
- Session Proof → Tool Mediator: authorizes session (evidence: `src/enforcement.rs`)
- Tool Mediator → Synthetic Effects: appends allowed effects (evidence: `src/enforcement.rs`)
- Tool Mediator → Chain Verifier: checks chain (evidence: `src/enforcement.rs`)
- Researcher / Caller → Asset Authority: submits asset chain (evidence: `README.md`)
- Asset Authority → Strict Codec: decodes signed records (evidence: `src/asset_authority.rs`)
- Asset Authority → Signature Crypto: verifies signatures (evidence: `src/asset_authority.rs`)
- Asset Authority → Asset Scope: checks asset declarations (evidence: `src/asset_authority.rs`)
- Scenario Fixture → Reviewed Cases: builds scenarios (evidence: `src/experiment/fixture.rs`)
- Case Mutations → Scenario Fixture: mutates scenarios (evidence: `src/experiment/mutations.rs`)
- Reviewed Cases → Chain Verifier: evaluates chain cases (evidence: `src/experiment/cases.rs`)
- RQ1–RQ3 Cases → Asset Authority: evaluates asset cases (evidence: `src/experiment/rq123_cases.rs`)
- RQ8 Privacy → Tool Mediator: measures modeled mediation (evidence: `src/experiment/rq8_privacy.rs`)
- Demo Controller → Tool Mediator: routes demo requests (evidence: `README.md`)
