You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refresh CLAUDE.md's stale architecture/config description (P5)
CLAUDE.md described a flat pre-restructuring layout (internal/app as
the run-core, top-level appletalk/router/port/service/pkg/config
directories, koanf+go-toml config parsing, [LToUdp]/[TashTalk]/
[Volumes.*] TOML sections) that predates the current five-ring
core/adapter/compose/client/cmd structure ARCHITECTURE.md already
documents accurately and keeps current -- contributors reading
CLAUDE.md first were getting conflicting guidance.
Replaced the stale "Core Data Flow"/"Key Packages" section with a
short accurate summary of each ring plus a strong pointer to
ARCHITECTURE.md as the authoritative source, rather than hand-
maintaining a second package table that would just go stale again.
Also fixed: the go test example path (./service/afp/... ->
./core/service/afp/...), the CNID-tracking claim (defaults to
in-memory, not SQLite -- sqlite is an opt-in build tag), the
config-parsing claim (koanf isn't even in go.mod anymore; go-toml/v2
only) and its TOML section names (checked against the real
server.toml.example: [[afpvolumes]], [[smbshares]], [MacIP], etc.,
not the stale [AFP]/[Volumes.*]/[LToUdp] spellings), and the
hardcoded Go version (now points at go.mod instead of duplicating a
number that will drift again). Also removed an accidental duplicated
"### AFP Architecture" heading from the edit.
Verified every cited path/file exists, and that the two example
commands (go build .../cmd/classicstack, go test .../core/service/afp/...)
actually work. Docs-only change; full repo build/vet/test swept clean
(one core/service/browser flake under full-suite load on the first
pass, gone on rerun -- confirmed pre-existing/unrelated, this commit
touches only CLAUDE.md).
This closes out P5's items worth doing now: the P0 csconnect
stale-comment note turned out already resolved by P0 itself, and the
runport.go/ntcreate.go TODOs are deliberately-deferred design
decisions the plan says to leave alone. The diagnostic-tool shared-
flags helper remains open (cosmetic-only, no bug) if wanted later.
Copy file name to clipboardExpand all lines: CLAUDE.md
+37-50Lines changed: 37 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ ClassicStack is a Go-based AppleTalk Phase 2 router and AFP file server. It also
8
8
It bridges legacy Apple networking protocols to modern environments, supporting EtherTalk (raw Ethernet), LToUDP (multicast UDP), TashTalk (serial), and virtual LocalTalk transports.
1.**Entry point** (`cmd/classicstack/`) is a thin `main()` that calls `internal/app`, which parses CLI flags and `server.toml`, constructs ports, wires them to the router, and starts services. Two sibling commands wrap the same run-core for background operation: `cmd/classicstack-svc` (Windows service) and `cmd/classicstackd` (Unix/macOS daemon).
56
-
2.**Router** (`router/`) receives DDP datagrams from all ports, maintains the `RoutingTable` and `ZoneInformationTable`, and dispatches to services by socket number or forwards to other ports.
4.**Services** (`service/`) plug into the router by registering socket numbers. Each implements `service.Service`.
59
-
60
-
### Key Packages
61
-
62
-
| Package | Role |
63
-
|---|---|
64
-
|`internal/app/`| The run-core (formerly `cmd/classicstack` package `main`): flag/TOML parsing, the `Supervisor`, every `wireXxx` hook, control-plane + web UI wiring. Exposes `Main(Version)` and `Run(ctx, args, Version)` so the interactive binary and the service/daemon wrappers all share one runtime. |
65
-
|`cmd/classicstack/`| Thin interactive entry point (`main()` → `app.Main`); holds the link-time `Build*` vars (`-ldflags -X main.Build...`). |
66
-
|`cmd/classicstack-svc/`| Windows service wrapper (SCM via `golang.org/x/sys/windows/svc`); `install`/`uninstall`/`start`/`stop`/`status`/`run`. Stub on non-Windows. |
67
-
|`cmd/classicstackd/`| Unix/macOS background daemon (self-daemonize via fork+`Setsid`, PID file); `start`/`stop`/`status`/`run`, plus macOS LaunchAgent `install`/`uninstall`. Stub on Windows. |
|`service/dsi/`| Data Stream Interface — AFP transport over TCP |
78
-
|`service/macip/`| IP-over-AppleTalk gateway with NAT and DHCP relay |
79
-
|`core/service/ncp/`| Novell NetWare Core Protocol file server (NetWare 3.x bindery emulation) over IPX + SAP advertising (`-tags ncp`); reuses the AFP/SMB storage + auth seams. See `spec/17-ncp.md`|
80
-
|`adapter/control/http/`| Management web UI (`-tags webui`): HTTPS adapter over `pkg/control` — JSON API, Finder over `/finder`, SSE stats stream, Vite SPA (`make spa`) |
81
-
|`pkg/control/`| Transport-agnostic management API (status, config stage/apply/save, service start/stop/restart, diagnostics); the single contract every UI front-end shares |
82
-
|`pkg/status/`| In-process service-status registry read by the dashboard |
dependency-ordered start/stop). Turns a `config.Model` into a running,
67
+
supervised stack. May import `core/` and `adapter/`.
68
+
-**`client/`** — the outbound mirror of the server: `client/afp`,
69
+
`client/smb`, `client/ncp`, `client/etherdfs` dial a remote server and
70
+
present it as an `fs.FileSystem` via `client/link`'s transport `Opener`.
71
+
-**`cmd/`** — thin entry points only. `cmd/classicstack/main.go` hands off
72
+
immediately to `cmd/internal/cli`, the shared run-core that parses flags/
73
+
`server.toml`, builds the `compose/runtime` stack, optionally serves the
74
+
web-admin control API (`-tags webui`), and runs until SIGINT/SIGTERM.
75
+
`cmd/classicstack-svc` (Windows service) and `cmd/classicstackd` (Unix/macOS
76
+
daemon) wrap the same run-core for background operation. `cmd/cs-tinygo` is
77
+
the embedded compile-smoke target (blank-imports the TinyGo-safe `core/`
78
+
subset); `cmd/csfs`/`cmd/csmount`/`cmd/csclient` are file-client CLIs over
79
+
the `client/` SDK; the rest (`cmd/csecho`, `cmd/csnbp`, …) are AppleTalk/IPX
80
+
diagnostic probes.
94
81
95
82
### AFP Architecture
96
83
97
84
AFP supports two transport stacks simultaneously:
98
85
-**Classic:** DDP → ATP → ASP → AFP
99
86
-**Modern:** TCP → DSI → AFP
100
87
101
-
AppleDouble metadata is stored either as `._filename` sidecars or in `.appledouble/` folders (Netatalk-compatible). CNID tracking uses SQLite(`modernc.org/sqlite`).
88
+
AppleDouble metadata is stored either as `._filename` sidecars or in `.appledouble/` folders (Netatalk-compatible). CNID tracking (`core/metastore`) defaults to an in-memory store; the `sqlite` build tag swaps in a SQLite-backed one (`modernc.org/sqlite`) instead.
102
89
103
90
### Configuration
104
91
105
-
Copy `server.toml.example` to `server.toml`. Format is TOML (parsed via `knadh/koanf` + `pelletier/go-toml`). Sections: `[LToUdp]`, `[TashTalk]`, `[EtherTalk]`, `[MacIP]`, `[AFP]`, `[Volumes.*]`, `[Logging]`. File extension→type/creator mappings live in `extmap.conf` (Netatalk-compatible format).
92
+
Copy `server.toml.example` to `server.toml`. Format is TOML (`pelletier/go-toml`), loaded into `core/config.Model` (see `core/config/config.go`). Section keys mirror the example file: singletons like `[identity]`, `[router]`, `[MacIP]`, `[http]`; repeated (named-instance) sections like `[[ethertalk]]`, `[[ltoudp]]`, `[[afpvolumes]]`, `[[smbshares]]`. File extension→type/creator mappings live in `extmap.conf` (Netatalk-compatible format). Full key-by-key reference: [`docs/config.md`](docs/config.md).
0 commit comments