# phanlemanh/acceptance-gate-kit architecture

> Architecture diagram of the GitHub repository phanlemanh/acceptance-gate-kit, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phanlemanh/acceptance-gate-kit
- Repository: https://github.com/phanlemanh/acceptance-gate-kit

## Overview

Acceptance-Gate Kit turns feature requirements into acceptance criteria and machine-readable evals, then verifies an implementation and records evidence for human sign-off. The feature-loop workflow adds a clean-context gap probe before scope approval and runs machine, UI, judgment, and review checks during verification. Separate write-time enforcement protects contract transitions and evidence reports; reusable libraries support evidence evaluation and gap probing. The README also documents CI enforcement, but its cited pre-merge scripts are absent from this tree, so that runtime branch is not mapped. Several workflow details are documented rather than visible in sampled source.

Main entry points: [`feature-loop`](https://github.com/phanlemanh/acceptance-gate-kit/tree/main/feature-loop) (Feature loop), [`feature-loop/workflows/acceptance-verify.js`](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/feature-loop/workflows/acceptance-verify.js) (Acceptance verify), [`hooks/acceptance-evidence-gate.js`](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/hooks/acceptance-evidence-gate.js) (Write-time hook), [`_acceptance`](https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance) (Feature contract)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Feature workflow"]
  node_feature_loop["Feature loop"]
  node_gap_probe["Gap probe<br/>[gap-probe.cjs]"]
  node_implementation["Feature implementation"]
  node_verify["Acceptance verify"]
end

subgraph group_acceptance["Acceptance evidence"]
  node_contract["Feature contract"]
  node_evals["Acceptance evals"]
  node_evidence["Evidence report"]
  node_run_log["Run log"]
end

subgraph group_enforcement["Runtime enforcement"]
  node_write_hook["Write-time hook"]
  node_evidence_core["Evidence evaluator<br/>[evidence-core.cjs]"]
end

subgraph group_support["Acceptance support"]
  node_coverage_lint["Coverage lint"]
  node_gate_card["Scope gate card<br/>[gate-card.js]"]
  node_glossary["Context glossary"]
  node_design_scan["Design scan<br/>[design-scan.js]"]
end

node_team(("Feature team"))

node_team -->|"starts round"| node_feature_loop
node_feature_loop -->|"probes gaps"| node_gap_probe
node_feature_loop -->|"drafts scope"| node_contract
node_feature_loop -->|"generates evals"| node_evals
node_team -.->|"approves scope"| node_contract
node_implementation -->|"submits feature"| node_verify
node_evals -->|"supplies checks"| node_verify
node_verify -->|"writes results"| node_evidence
node_verify -->|"records runs"| node_run_log
node_team -.->|"signs off"| node_evidence
node_write_hook -->|"evaluates evidence"| node_evidence_core
node_write_hook -->|"guards writes"| node_evidence
node_write_hook -->|"guards transitions"| node_contract
node_coverage_lint -->|"reads terms"| node_glossary
node_gate_card -->|"reads terms"| node_glossary
node_design_scan -->|"reports findings"| node_team

click node_feature_loop "https://github.com/phanlemanh/acceptance-gate-kit/tree/main/feature-loop"
click node_gap_probe "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/lib/gap-probe.cjs"
click node_contract "https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance"
click node_evals "https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance"
click node_verify "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/feature-loop/workflows/acceptance-verify.js"
click node_evidence "https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance"
click node_run_log "https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance"
click node_write_hook "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/hooks/acceptance-evidence-gate.js"
click node_evidence_core "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/lib/evidence-core.cjs"
click node_coverage_lint "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/scripts/eval-coverage-lint.js"
click node_gate_card "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/scripts/gate-card.js"
click node_glossary "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/lib/context-glossary.js"
click node_design_scan "https://github.com/phanlemanh/acceptance-gate-kit/blob/main/scripts/design-scan.js"

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_feature_loop,node_gap_probe,node_implementation,node_verify toneBlue
class node_contract,node_evals,node_evidence,node_run_log toneAmber
class node_write_hook,node_evidence_core toneMint
class node_coverage_lint,node_gate_card,node_glossary,node_design_scan toneRose
class node_team toneIndigo
```

## Components

### Feature workflow

- [Feature loop](https://github.com/phanlemanh/acceptance-gate-kit/tree/main/feature-loop): `feature-loop`
- [Gap probe](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/lib/gap-probe.cjs): `lib/gap-probe.cjs`
- **Feature implementation**
- [Acceptance verify](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/feature-loop/workflows/acceptance-verify.js): `feature-loop/workflows/acceptance-verify.js`

### Acceptance evidence

- [Feature contract](https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance): `_acceptance`
- [Acceptance evals](https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance): `_acceptance`
- [Evidence report](https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance): `_acceptance`
- [Run log](https://github.com/phanlemanh/acceptance-gate-kit/tree/main/_acceptance): `_acceptance`

### Runtime enforcement

- [Write-time hook](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/hooks/acceptance-evidence-gate.js): `hooks/acceptance-evidence-gate.js`
- [Evidence evaluator](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/lib/evidence-core.cjs): `lib/evidence-core.cjs`

### Acceptance support

- [Coverage lint](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/scripts/eval-coverage-lint.js): `scripts/eval-coverage-lint.js`
- [Scope gate card](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/scripts/gate-card.js): `scripts/gate-card.js`
- [Context glossary](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/lib/context-glossary.js): `lib/context-glossary.js`
- [Design scan](https://github.com/phanlemanh/acceptance-gate-kit/blob/main/scripts/design-scan.js): `scripts/design-scan.js`

### Other components

- **Feature team**

## Connections

- Feature team → Feature loop: starts round
- Feature loop → Gap probe: probes gaps
- Feature loop → Feature contract: drafts scope
- Feature loop → Acceptance evals: generates evals
- Feature team → Feature contract: approves scope
- Feature implementation → Acceptance verify: submits feature
- Acceptance evals → Acceptance verify: supplies checks
- Acceptance verify → Evidence report: writes results
- Acceptance verify → Run log: records runs
- Feature team → Evidence report: signs off
- Write-time hook → Evidence evaluator: evaluates evidence
- Write-time hook → Evidence report: guards writes
- Write-time hook → Feature contract: guards transitions
- Coverage lint → Context glossary: reads terms
- Scope gate card → Context glossary: reads terms
- Design scan → Feature team: reports findings
