# uyo9/tps-single-starter architecture

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

- Interactive diagram: https://gitdiagram.com/uyo9/tps-single-starter
- Repository: https://github.com/uyo9/tps-single-starter

## Overview

TPS is a command-line toolkit and workspace for authoring competitive-programming problems: configure a problem, generate and validate tests, compile and run solutions against them, inspect verdicts, and export a contest package. The tree exposes separate commands for generation, compilation, invocation, stress testing, verification, and statement handling, plus internal helpers and CMS/DOMjudge exporters. The README is empty and most command implementations are unsampled, so the graph shows only wiring supported by the sampled source or clearly separated capabilities indicated by the tree; uncertain command-to-command links are omitted.

Main entry points: [`pro/scripts/gen.sh`](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/gen.sh) (Generate tests), [`pro/scripts/internal/invoke.py`](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/internal/invoke.py) (Invocation engine), [`pro/scripts/verify.py`](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/verify.py) (Verify problem), [`pro/scripts/exporters/CMS.py`](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/exporters/CMS.py) (CMS exporter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Problem authoring"]
  node_problem_config["Problem config<br/>[problem.json]"]
  node_subtask_config["Subtasks config<br/>[subtasks.json]"]
  node_generation_plan["Generation plan"]
  node_generator["Generator<br/>[gen.cpp]"]
  node_gen_command["Generate tests<br/>[gen.sh]"]
  node_data_parser["Plan parser<br/>[gen_data_parser.py]"]
  node_test_files["Generated tests"]
end

subgraph group_execution["Test and solution execution"]
  node_solution["Solutions"]
  node_compile_command["Compile solutions<br/>[compile.sh]"]
  node_invoke_command["Invoke solution<br/>[invoke.sh]"]
  node_invoke_engine["Invocation engine<br/>[invoke.py]"]
  node_test_runner["Test runner<br/>[invoke_test.sh]"]
  node_run_command["Run tests<br/>[run.sh]"]
  node_stress_command["Stress testing<br/>[stress.sh]"]
  node_run_state["Run logs"]
end

subgraph group_validation["Verification and validation"]
  node_validator["Input validator<br/>[validator.cpp]"]
  node_testlib["Testlib support<br/>[testlib.h]"]
  node_verify_command["Verify problem<br/>[verify.py]"]
  node_statement["Problem statement<br/>[index.md]"]
  node_statement_command["Statement handling<br/>[statement.sh]"]
end

subgraph group_export["Contest export"]
  node_cms_export["CMS exporter<br/>[CMS.py]"]
  node_domjudge_export["DOMjudge exporter<br/>[DOMjudge.py]"]
end

node_user(("Problem author"))
node_cms(("CMS"))
node_domjudge(("DOMjudge"))

node_user -->|"starts generation"| node_gen_command
node_gen_command -->|"parses plan"| node_data_parser
node_gen_command -->|"runs generator"| node_generator
node_generator -->|"uses support"| node_testlib
node_gen_command -->|"writes tests"| node_test_files
node_generation_plan -->|"read by"| node_data_parser
node_user -->|"starts compilation"| node_compile_command
node_compile_command -->|"compiles sources"| node_solution
node_user -->|"runs solution"| node_invoke_command
node_invoke_command -->|"dispatches"| node_invoke_engine
node_invoke_engine -->|"runs each test"| node_test_runner
node_test_runner -->|"reads tests"| node_test_files
node_invoke_engine -->|"selects solution"| node_solution
node_invoke_engine -->|"reads and writes"| node_run_state
node_user -->|"starts test run"| node_run_command
node_user -->|"starts stress test"| node_stress_command
node_user -->|"checks package"| node_verify_command
node_verify_command -->|"validates config"| node_problem_config
node_verify_command -->|"validates subtasks"| node_subtask_config
node_verify_command -->|"checks plan"| node_generation_plan
node_validator -->|"uses support"| node_testlib
node_user -->|"handles statement"| node_statement_command
node_statement_command -->|"uses statement"| node_statement
node_user -.->|"exports package"| node_cms_export
node_cms_export -.->|"reads problem data"| node_problem_config
node_cms_export -.->|"reads subtask data"| node_subtask_config
node_cms_export -.->|"creates package for"| node_cms
node_user -.->|"exports package"| node_domjudge_export
node_domjudge_export -.->|"reads problem data"| node_problem_config
node_domjudge_export -.->|"reads subtask data"| node_subtask_config
node_domjudge_export -.->|"creates package for"| node_domjudge

click node_problem_config "https://github.com/uyo9/tps-single-starter/blob/master/pro/problem.json"
click node_subtask_config "https://github.com/uyo9/tps-single-starter/blob/master/pro/subtasks.json"
click node_generation_plan "https://github.com/uyo9/tps-single-starter/blob/master/pro/gen/data"
click node_generator "https://github.com/uyo9/tps-single-starter/blob/master/pro/gen/gen.cpp"
click node_gen_command "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/gen.sh"
click node_data_parser "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/internal/gen_data_parser.py"
click node_test_files "https://github.com/uyo9/tps-single-starter/blob/master/pro/gen/data"
click node_solution "https://github.com/uyo9/tps-single-starter/tree/master/pro/solution"
click node_compile_command "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/compile.sh"
click node_invoke_command "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/invoke.sh"
click node_invoke_engine "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/internal/invoke.py"
click node_test_runner "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/internal/invoke_test.sh"
click node_run_command "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/run.sh"
click node_stress_command "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/stress.sh"
click node_run_state "https://github.com/uyo9/tps-single-starter/tree/master/pro/scripts/internal"
click node_validator "https://github.com/uyo9/tps-single-starter/blob/master/pro/validator/validator.cpp"
click node_testlib "https://github.com/uyo9/tps-single-starter/blob/master/pro/validator/testlib.h"
click node_verify_command "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/verify.py"
click node_statement "https://github.com/uyo9/tps-single-starter/blob/master/pro/statement/index.md"
click node_statement_command "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/statement.sh"
click node_cms_export "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/exporters/CMS.py"
click node_domjudge_export "https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/exporters/DOMjudge.py"

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_problem_config,node_subtask_config,node_generation_plan,node_generator,node_gen_command,node_data_parser,node_test_files toneBlue
class node_solution,node_compile_command,node_invoke_command,node_invoke_engine,node_test_runner,node_run_command,node_stress_command,node_run_state toneAmber
class node_validator,node_testlib,node_verify_command,node_statement,node_statement_command toneMint
class node_cms_export,node_domjudge_export toneRose
class node_user,node_cms,node_domjudge toneIndigo
```

## Components

### Problem authoring

- [Problem config](https://github.com/uyo9/tps-single-starter/blob/master/pro/problem.json): `pro/problem.json`
- [Subtasks config](https://github.com/uyo9/tps-single-starter/blob/master/pro/subtasks.json): `pro/subtasks.json`
- [Generation plan](https://github.com/uyo9/tps-single-starter/blob/master/pro/gen/data): `pro/gen/data`
- [Generator](https://github.com/uyo9/tps-single-starter/blob/master/pro/gen/gen.cpp): `pro/gen/gen.cpp`
- [Generate tests](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/gen.sh): `pro/scripts/gen.sh`
- [Plan parser](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/internal/gen_data_parser.py): `pro/scripts/internal/gen_data_parser.py`
- [Generated tests](https://github.com/uyo9/tps-single-starter/blob/master/pro/gen/data): `pro/gen/data`

### Test and solution execution

- [Solutions](https://github.com/uyo9/tps-single-starter/tree/master/pro/solution): `pro/solution`
- [Compile solutions](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/compile.sh): `pro/scripts/compile.sh`
- [Invoke solution](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/invoke.sh): `pro/scripts/invoke.sh`
- [Invocation engine](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/internal/invoke.py): `pro/scripts/internal/invoke.py`
- [Test runner](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/internal/invoke_test.sh): `pro/scripts/internal/invoke_test.sh`
- [Run tests](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/run.sh): `pro/scripts/run.sh`
- [Stress testing](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/stress.sh): `pro/scripts/stress.sh`
- [Run logs](https://github.com/uyo9/tps-single-starter/tree/master/pro/scripts/internal): `pro/scripts/internal`

### Verification and validation

- [Input validator](https://github.com/uyo9/tps-single-starter/blob/master/pro/validator/validator.cpp): `pro/validator/validator.cpp`
- [Testlib support](https://github.com/uyo9/tps-single-starter/blob/master/pro/validator/testlib.h): `pro/validator/testlib.h`
- [Verify problem](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/verify.py): `pro/scripts/verify.py`
- [Problem statement](https://github.com/uyo9/tps-single-starter/blob/master/pro/statement/index.md): `pro/statement/index.md`
- [Statement handling](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/statement.sh): `pro/scripts/statement.sh`

### Contest export

- [CMS exporter](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/exporters/CMS.py): `pro/scripts/exporters/CMS.py`
- [DOMjudge exporter](https://github.com/uyo9/tps-single-starter/blob/master/pro/scripts/exporters/DOMjudge.py): `pro/scripts/exporters/DOMjudge.py`

### Other components

- **Problem author**
- **CMS**
- **DOMjudge**

## Connections

- Problem author → Generate tests: starts generation
- Generate tests → Plan parser: parses plan
- Generate tests → Generator: runs generator
- Generator → Testlib support: uses support
- Generate tests → Generated tests: writes tests
- Generation plan → Plan parser: read by
- Problem author → Compile solutions: starts compilation
- Compile solutions → Solutions: compiles sources
- Problem author → Invoke solution: runs solution
- Invoke solution → Invocation engine: dispatches
- Invocation engine → Test runner: runs each test
- Test runner → Generated tests: reads tests
- Invocation engine → Solutions: selects solution
- Invocation engine → Run logs: reads and writes
- Problem author → Run tests: starts test run
- Problem author → Stress testing: starts stress test
- Problem author → Verify problem: checks package
- Verify problem → Problem config: validates config
- Verify problem → Subtasks config: validates subtasks
- Verify problem → Generation plan: checks plan
- Input validator → Testlib support: uses support
- Problem author → Statement handling: handles statement
- Statement handling → Problem statement: uses statement
- Problem author → CMS exporter: exports package
- CMS exporter → Problem config: reads problem data
- CMS exporter → Subtasks config: reads subtask data
- CMS exporter → CMS: creates package for
- Problem author → DOMjudge exporter: exports package
- DOMjudge exporter → Problem config: reads problem data
- DOMjudge exporter → Subtasks config: reads subtask data
- DOMjudge exporter → DOMjudge: creates package for
