lucy / types
AGENTS.md46 starsChanged 3 months agoApache-2.0View on GitHub
Pure domain types for the Lucy package manager. This package has zero external dependencies by design — it imports only internal/fn for generic helpers. All other Lucy packages depend on types, never the reverse. All functions in this package must be deterministic and side-effect free: no logging, no filesystem access, no panics. Minecraft package identity is split across two authorities that both matter, but they do not share a universal naming system. Remote sources define human-facing, indexable names: Modrinth slugs,…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- install/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
All functions in this package must be deterministic and side-effect free: no logging, no filesystem access, no panics.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
types/
Pure domain types for the Lucy package manager. This package has zero external dependencies by design — it imports only internal/fn for generic helpers. All other Lucy packages depend on types, never the reverse.
All functions in this package must be deterministic and side-effect free: no logging, no filesystem access, no panics.
The Identity Problem
Minecraft package identity is split across two authorities that both matter, but they do not share a universal naming system.
Remote identity
Remote sources define human-facing, indexable names: Modrinth slugs, CurseForge project IDs/slugs, GitHub repos, future custom registries, maybe local directories. These names are useful for discovery, fetching, version resolution, dependency metadata, and sharing manifests. Remote identity is usually globally unique within its source.
Local identity
Local artifacts define loader-facing names: Fabric id, Forge/NeoForge modId, Bukkit/Paper plugin.yml name, Velocity/Sponge/MCDR IDs, etc. These are the names the runtime actually enforces. Local identity is the truth for a functioning server, but only within that server context; it is not globally unique and may not match the remote slug.
What this means for the type system
Lucy needs to reconcile two truths:
- Remote identity answers: "Where do I fetch this from, and what does the index call it?"
- Local identity answers: "What does the server actually load, conflict-check, and expose?"
Users interact with both without knowing which one they typed. A name from lucy status is probably local. A name from Modrinth, a README, or a manifest is probably remote. Sometimes they match; sometimes they do not. Private mods and custom sources make this worse.
The correct model is a mapping problem, not a mode problem:
- Remote/source-scoped refs are shareable, fetchable package identities.
- Local refs are observed runtime identities tied to a workspace/server.
- Bridges between them use the strongest evidence available: hash lookup first, metadata URL second, search/name heuristics last if allowed.
- Provenance/trust level is preserved so Lucy knows whether a mapping is verified or guessed.
- Explicit source syntax bypasses ambiguity; unscoped input is context-sensitive.
Without a working local→remote bridge, scoped syntax only gives users a way to be explicit, not a way for Lucy to understand what is already installed.
Package Reference Model
The reference types keep stable upstream identity separate from target ecosystem:
BarePackageName— just a name string (fabric-api)PackageRef— source + name (modrinth:fabric-api);SourceAutois unresolved request intentPackageRequest— package identity + target ecosystem + version selectorVersionedPackageRef— package identity + selected/observed ecosystem + version selector or fact
Ecosystem (formerly Platform / PlatformId) is an enum of definite
loaders (Fabric, Forge, NeoForge, MCDR, Bukkit, …) and EcoUnspecified for
request selection that must be derived from workspace context. It is not part
of PackageRef identity.
SourceId identifies the upstream provider. Resolved upstream package records
carry a concrete source; locally observed artifacts may use SourceUnknown.
Core Packages
Some packages represent a bootable server product (Minecraft, Fabric loader, Forge, Paper, hybrids, proxies). These are "core packages" — their installation means bootstrapping the server platform, not placing a jar in the mods directory. type_core_package.go defines the CorePackage enum and the alias catalog behind NormalizeCorePackage/IsCorePackage; install/bootstrap decides which cores are actually installable.
Version System
Lucy supports multiple versioning schemes because the Minecraft ecosystem uses them all:
BareVersion— raw version string, may be a special constant (any,stable,beta,none,unknown)ResolvableVersion— parsed, comparable version implementingCompare(v2) (int, bool)andScheme() VersionScheme- Supported schemes:
Semver,Maven,MinecraftSnapshot,MinecraftRelease - Cross-scheme comparison returns
(0, false)— incomparable, not equal
Dependencies
Dependency holds a version constraint expression in 2D DNF form: outer array is OR, inner is AND. Each sub-expression has a VersionOperator (eq, neq, gt, gte, lt, lte, plus weak variants ~ and ^ for semver) and a ResolvableVersion value. The Embedded field marks JarInJar dependencies that are satisfied without a separate file.
PackageDependencies wraps a []Dependency slice with an Authentic flag: true means the dependency list was read from the actual artifact (jar metadata), false means it came from an upstream API and may be inaccurate.
Gotchas
Dependency.Id.Versionis always empty — never read it. OnlyId.EcoandId.Nameidentify the dependency target; the constraint is inDependency.Constraint.EcoAnyis not a wildcard — it is ambiguous-but-single-valued and must reduce to a definite ecosystem during evaluation. Do not treat it as "matches everything."Package(intype_package.go) is a legacy composite struct. It bundles remote metadata, local install state, and dependencies into one type. It is being phased out in favor of lifecycle-specific types.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

