feat(rustd): cargo workspace and afd_core domain primitives
Sections 1 and 2. The workspace roots at rustd/ as a virtual manifest with an explicit member list and every crate a sibling under crates/ — Microsoft's M-CRATES-FLAT-FOLDER, chosen by Indy over bun's src/<name> nesting on Aug 23, 2026; bun still supplies the mechanics (virtual root, workspace dependencies, the warnings-are-errors lint rationale). Toolchain pinned to 1.98.0, matching the mise-managed Rust so a shell and a container cannot resolve different compilers. afd_core holds three primitives, each a newtype whose invariant is checked once at the boundary: Uuid7 ports src/agentsfleetd/types/id_format.zig, which REJECTS uppercase rather than normalizing it — Postgres folds ::uuid to lowercase, so an uppercase spelling is the same row there and a different key in every text-keyed store. The uuid crate cannot express that (it parses case-insensitively), so identity is a validating newtype and the crate keeps one less dependency. Deserialization goes through String rather than a borrowed str on purpose: a JSON producer may escape any character, and an escaped-but-canonical identifier has to be accepted exactly as the Zig parser accepts it — rejecting it would be a behaviour difference dressed as an optimization. ErrorCode is a checked SUBSET of the Zig registry, never a second registry. Its grammar is validated during constant evaluation, so a malformed code is a build failure, and a test reads error_registry.zig and fails if a code here is absent or spelled differently there. WorkerCount carries both paths deliberately: clamping() for the assignment path, because that is what the Zig daemon does and what RegisterResponse echoes back, and new() for an operator surface that can be told it is wrong. Twenty-three tests, all through the public surface. Two proven to bite by seeding the defect they exist to catch: adding tokio to afd_wire fails test_core_dependency_freeze, and removing a member's lint inheritance fails test_workspace_lint_policy. Dimensions 1.1, 1.2, 2.1, 2.2 and 2.3 marked DONE. Dimension 1.2 is amended in the same commit: it specified asserting the lint set from cargo metadata, which does not expose lints under cargo 1.98 — the assertion reads the workspace manifest instead and additionally proves every member inherits the policy, which is the failure metadata could not have caught either. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
K
Kishore Kumar committed
cf80feca7a33208a886c8fb77b1a07634449d0ea
Parent: 67c3323