- Update all 7 phase docs with source/target location references (golang/ for Go source, dotnet/ for .NET version) - Rename NATS.Server to ZB.MOM.NatsNet.Server in phase 4-7 docs - Update solution layout to dotnet/src/ and dotnet/tests/ structure - Create CLAUDE.md with project summary and phase links - Update .gitignore: track porting.db, add standard .NET patterns - Add golang/nats-server as git submodule - Add reports/generate-report.sh and pre-commit hook - Add documentation_rules.md to version control
62 lines
2.6 KiB
Markdown
62 lines
2.6 KiB
Markdown
# CLAUDE.md
|
|
|
|
## Project Summary
|
|
|
|
This project is porting the NATS server from Go to .NET 10 C#. The Go source (~130K LOC across 109 non-test files, 85 test files) is at `golang/nats-server/`. The porting process is tracked via an SQLite database (`porting.db`) and managed by two tools: a Go AST analyzer and a .NET PortTracker CLI.
|
|
|
|
## Folder Layout
|
|
|
|
```
|
|
natsnet/
|
|
├── golang/nats-server/ # Go source (reference)
|
|
├── dotnet/ # .NET ported version
|
|
│ ├── src/
|
|
│ │ ├── ZB.MOM.NatsNet.Server/ # Main server library
|
|
│ │ └── ZB.MOM.NatsNet.Server.Host/ # Host/entry point
|
|
│ └── tests/
|
|
│ ├── ZB.MOM.NatsNet.Server.Tests/ # Unit tests
|
|
│ └── ZB.MOM.NatsNet.Server.IntegrationTests/ # Integration tests
|
|
├── tools/
|
|
│ ├── go-analyzer/ # Go AST analyzer (Phases 1-2)
|
|
│ └── NatsNet.PortTracker/ # .NET CLI tool (all phases)
|
|
├── docs/plans/phases/ # Phase instruction guides
|
|
├── reports/ # Generated porting reports
|
|
├── porting.db # SQLite tracking database
|
|
├── porting-schema.sql # Database schema
|
|
└── documentation_rules.md # Documentation conventions
|
|
```
|
|
|
|
## Tools
|
|
|
|
### Go AST Analyzer
|
|
|
|
```bash
|
|
CGO_ENABLED=1 go build -o go-analyzer . && ./go-analyzer --source golang/nats-server --db porting.db --schema porting-schema.sql
|
|
```
|
|
|
|
### .NET PortTracker CLI
|
|
|
|
```bash
|
|
dotnet run --project tools/NatsNet.PortTracker -- <command> --db porting.db
|
|
```
|
|
|
|
## Phase Instructions
|
|
|
|
- **Phase 1: Go Codebase Decomposition** - `docs/plans/phases/phase-1-decomposition.md`
|
|
- **Phase 2: Verification of Captured Items** - `docs/plans/phases/phase-2-verification.md`
|
|
- **Phase 3: Library Mapping** - `docs/plans/phases/phase-3-library-mapping.md`
|
|
- **Phase 4: .NET Solution Design** - `docs/plans/phases/phase-4-dotnet-design.md`
|
|
- **Phase 5: Mapping Verification** - `docs/plans/phases/phase-5-mapping-verification.md`
|
|
- **Phase 6: Initial Porting** - `docs/plans/phases/phase-6-porting.md`
|
|
- **Phase 7: Porting Verification** - `docs/plans/phases/phase-7-porting-verification.md`
|
|
|
|
## Naming Conventions
|
|
|
|
.NET projects use the `ZB.MOM.NatsNet.Server` prefix. Namespaces follow the `ZB.MOM.NatsNet.Server.[Module]` pattern.
|
|
|
|
## Reports
|
|
|
|
- `reports/current.md` always has the latest porting status.
|
|
- `reports/report_{commit_id}.md` snapshots are generated on each commit via pre-commit hook.
|
|
- Run `./reports/generate-report.sh` manually to regenerate.
|