Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/config/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Renderer:
tests:
- changed-files:
- any-glob-to-any-file:
- tests/**
- Tests/**
- '**/*Tests.cs'

documentation:
Expand Down
17 changes: 17 additions & 0 deletions Docs/Development/Debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Debug

`debdev` commands are for development. Use `ws play` for normal playback.

```bash
./changetrace debdev player <file.gittrace>
./changetrace debdev render <file.gittrace>
./changetrace debdev window <file.gittrace>
```

| Command | Purpose |
| --- | --- |
| `debdev player <file>` | Debug the player. |
| `debdev render <file>` | Debug rendering. |
| `debdev window <file>` | Debug the OpenTK window. |

`TimelineLoader` in `src/Cli/Commands/Debug/TimelineLoaderDebug.cs` is a helper, not a CLI command.
52 changes: 52 additions & 0 deletions Docs/Development/Project-Structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Project Structure

## Main Paths

| Path | Role |
| --- | --- |
| `src/Cli` | Commands, handlers, prompts. |
| `src/Configuration` | DI and app startup. |
| `src/Core` | Domain model and timeline. |
| `src/CredentialTrace` | Auth, profiles, workspace storage. |
| `src/GIt` | Git reading and export. |
| `src/Graphics` | OpenTK, GPU, shaders. |
| `src/Player` | Timeline playback. |
| `src/Rendering` | Scene and render commands. |
| `Tools/` | Helper tools project. |
| `Benchmarks/` | Benchmarks project. |
| `Tests/` | Test project. |
| `Docs/` | Documentation. |

## CLI Pattern

```text
src/Cli/Commands/**/*
src/Cli/Handlers/**/*
```

Commands define syntax. Handlers do the work.

## Project Layout

Sibling projects live at the repository root:

```text
Tools/ChangeTrace.Tools.csproj
Benchmarks/ChangeTrace.Benchmarks.csproj
Tests/ChangeTrace.Tests.csproj
```

Keep test files directly under `Tests/` unless a larger test area needs its own folder.

## Workspace Timelines

```text
src/CredentialTrace/Interfaces/IWorkspaceTimelineStorage.cs
src/CredentialTrace/Services/WorkspaceTimelineStorage.cs
```

Layout:

```text
workspaces/{organization}/{workspace}/timelines/{repository}/
```
27 changes: 27 additions & 0 deletions Docs/Development/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Development

Docs for working on the codebase.

## Files

| File | Contents |
| --- | --- |
| [Setup](Setup.md) | Requirements and local run setup. |
| [Validation](Validation.md) | Build, tests, and quick checks. |
| [Project Structure](Project-Structure.md) | Where the main code lives. |
| [Debug](Debug.md) | `debdev` commands. |

## Minimum Before PR

```bash
dotnet build ChangeTrace.slnx
dotnet test Tests/ChangeTrace.Tests.csproj --no-build
```

The test project is top level sibling of `Tools/` and `Benchmarks/`.

Or:

```bash
task check
```
42 changes: 42 additions & 0 deletions Docs/Development/Setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Setup

## Requirements

| Tool | Why |
| --- | --- |
| .NET 10 SDK | Build, tests, CLI. |
| Git | Repositories and workflow. |
| Task | Optional command shortcuts. |
| Graphical session | OpenTK player and render windows. |

## Build

```bash
dotnet restore ChangeTrace.slnx
dotnet build ChangeTrace.slnx
```

Or:

```bash
task build
```

## Local CLI

Docs use:

```bash
./changetrace --help
```

In a dev build, this can point to the binary under `bin/Debug/net10.0/`.

## Local Data

```text
~/.changetrace/
workspaces/{organization}/{workspace}/timelines/{repository}/
```

Auth files are local to the user. Treat them as sensitive data.
54 changes: 54 additions & 0 deletions Docs/Development/Validation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Validation

## Standard

```bash
dotnet build ChangeTrace.slnx
dotnet test Tests/ChangeTrace.Tests.csproj --no-build
```

In restricted shells, `dotnet test` may need permission to create a local socket.

The test project lives at:

```text
Tests/ChangeTrace.Tests.csproj
```

## Task

```bash
task build
task check
```

Useful tasks:

| Task | Purpose |
| --- | --- |
| `task build` | Restore and build. |
| `task check` | Release build, tools, and asset validation. |
| `task benchmark` | Rendering benchmarks. |
| `task publish` | Publish a runtime. |

## Manual Checks

CLI:

```bash
./changetrace --help
./changetrace ws ls
```

Workspace/export:

```bash
./changetrace ws current
./changetrace ws tl
```

Player:

```bash
./changetrace ws play -w -s
```
17 changes: 17 additions & 0 deletions Docs/Guides/Cli/Auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auth

```bash
./changetrace auth login github
./changetrace auth list
./changetrace auth logout github
```

## Commands

| Command | Purpose |
| --- | --- |
| `auth login <provider>` | Log in to a provider. |
| `auth list` | List saved sessions. |
| `auth logout [provider]` | Remove saved login data. |

Sessions are local to the current user. Do not treat them as a keychain.
44 changes: 44 additions & 0 deletions Docs/Guides/Cli/Export.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Export

## `export`

```bash
./changetrace export <repository>
./changetrace export <repository> -o ./file.gittrace
```

Examples:

```bash
./changetrace export https://github.com/microsoft/msquic.git
./changetrace export ../local-repo
./changetrace export https://github.com/microsoft/WSL.git -o ./wsl.gittrace
```

Without `--output`, the file is stored in the active workspace:

```text
workspaces/{organization}/{workspace}/timelines/{repository}/{timestamp}-{ulid}.gittrace
```

Timeline metadata is stored next to it:

```text
*.gittrace.metadata.json
```

Key options:

| Option | Meaning |
| --- | --- |
| `-o, --output <path>` | Write to a specific file. |
| `-r, --token <token>` | GitHub token. |
| `-v, --verbose` | More logs. |

## `show`

```bash
./changetrace show <file.gittrace>
```

For workspace timelines, `ws play` is usually easier.
21 changes: 21 additions & 0 deletions Docs/Guides/Cli/Organizations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Organizations

`org` also has the full alias `organization`.

```bash
./changetrace org create microsoft -p github
./changetrace org list
./changetrace org remove microsoft
```

## Commands

| Command | Purpose |
| --- | --- |
| `org create <name> -p <provider>` | Create an organization. |
| `org list` | List organizations. |
| `org remove <name>` | Remove an organization. |

Provider can be `github`.

`org remove` deletes the organization profile. Use `-y` only when the target name is clear.
56 changes: 56 additions & 0 deletions Docs/Guides/Cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# ChangeTrace CLI

Examples use the local command `./changetrace`.

## Quick Start

```bash
./changetrace auth login github
./changetrace org create microsoft -p github
./changetrace ws create msquic --org microsoft
./changetrace ws use microsoft msquic
./changetrace export https://github.com/microsoft/msquic.git
./changetrace ws play
```

Interactive flow:

```bash
./changetrace ws use
./changetrace ws play -w -s
```

## Sections

| Section | File |
| --- | --- |
| Export and `.gittrace` | [Export](Export.md) |
| Workspaces | [Workspace](Workspace.md) |
| Organizations | [Organizations](Organizations.md) |
| Auth | [Auth](Auth.md) |
| Dev debug | [Debug](../../Development/Debug.md) |

## Commands

| Command | Alias |
| --- | --- |
| `export <repository>` | |
| `show <file>` | |
| `workspace create <name>` | `ws create` |
| `workspace list` | `ws list`, `ws ls` |
| `workspace use [org] [name]` | `ws use`, `ws switch`, `ws select` |
| `workspace current` | `ws current`, `ws status`, `ws ctx` |
| `workspace timelines` | `ws timelines`, `ws timeline`, `ws tl` |
| `workspace play` | `ws play` |
| `workspace remove <name>` | `ws remove` |
| `org create <name>` | `organization create` |
| `org list` | `organization list` |
| `org remove <name>` | `organization remove` |
| `auth login <provider>` | |
| `auth list` | |
| `auth logout [provider]` | |
| `debdev player <file>` | |
| `debdev render <file>` | |
| `debdev window <file>` | |

`export` without `--output` writes to the active workspace. Set it with `ws use`.
48 changes: 48 additions & 0 deletions Docs/Guides/Cli/Workspace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Workspace

`workspace` has the short alias `ws`.

```bash
./changetrace ws <command>
```

## Flow

```bash
./changetrace org create microsoft -p github
./changetrace ws create wsl --org microsoft
./changetrace ws use microsoft wsl
./changetrace export https://github.com/microsoft/WSL.git
./changetrace ws play
```

Interactive:

```bash
./changetrace ws use
./changetrace ws play -w -s
```

## Commands

| Command | Alias | Purpose |
| --- | --- | --- |
| `ws create <name> --org <org>` | | Create a workspace. |
| `ws list` | `ws ls` | List workspaces. |
| `ws use [org] [name]` | `ws switch`, `ws select` | Set the active workspace. |
| `ws current` | `ws status`, `ws ctx` | Show the active workspace. |
| `ws timelines` | `ws timeline`, `ws tl` | List stored timelines. |
| `ws play` | | Open a timeline in the player. |
| `ws remove <name> --org <org>` | | Remove a workspace profile. |

## Useful Options

| Command | Option | Meaning |
| --- | --- | --- |
| `ws list` | `--org <org>` | Filter by organization. |
| `ws play` | `-r, --repo <repo>` | Pick a repo, for example `msquic` or `microsoft/wsl`. |
| `ws play` | `-s, --select` | Select a timeline from a list. |
| `ws play` | `-w, --workspace` | Select a workspace before playing. |
| `ws remove` | `-y, --yes` | Skip confirmation. |

`ws play` needs a graphical session because it opens an OpenTK window.
Loading
Loading