lucy / operation
AGENTS.md58 starsChanged 8 days agoApache-2.0View on GitHub
operation orchestrates workspace lifecycle commands (Create, Initialize, Sync, Add, Downgrade, Remove, Upgrade, Deinitialize, RenameServer, SetJava).
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- artifact/AGENTS.mdAGENTS.md
- bootstrap/AGENTS.mdAGENTS.md
- catalog/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- document/AGENTS.mdAGENTS.md
- e2e/AGENTS.mdAGENTS.md
- install/AGENTS.mdAGENTS.md
- receipt/AGENTS.mdAGENTS.md
- resolve/AGENTS.mdAGENTS.md
- upstream/AGENTS.mdAGENTS.md
- workspace/AGENTS.mdAGENTS.md
The file
Files
Package operation
operation orchestrates workspace lifecycle commands (Create, Initialize, Sync, Add, Downgrade, Remove, Upgrade, Deinitialize, RenameServer, SetJava).
Responsibilities & Boundaries
- Coordinates multi-step workspace workflows across
install.Service, routingSource,serverregistry.Registry, and document models. - Prepares documents, evaluates server runtime environments, and coordinates upgrade Pareto frontiers without owning low-level file transactions.
Invariants & Behavior
- Explicit Dependency Injection:
Servicenever accesses global singletons. Dependencies (install.Service,Source,serverregistry.Registry,log.Logger) must be passed explicitly intoNewService. - Workspace Locking & Recovery: Mutating operations serialize through the workspace writer lock (
workspacewrite.Lockon.lucy/writer.lock) and run journal recovery (filetrack.RecoverLocked) before applying mutations. Read-heavy workflows (e.g.PlanUpgradepreflight or target inspection) may inspect documents or paths prior to acquiring the lock. - Retention Leases & Registry: Candidate-resolving workflows (
Create,Initialize,PlanUpgrade,Downgrade) acquire an artifact store lease (artifactstore.AcquireOperation) to shield staged files from retention sweeps. Workspaces are recorded inserverregistry.Registryonly after their lock is visible; initialization registers after its manifest/lock/receipt transaction commits and before the operation lease closes, because the registry reads the manifest and the sweep must never trace a workspace whose documents were never published. - Document Pinning: Workflows capture manifest and lock fingerprints (
pinWorkspaceDocuments) before passing options toinstall.Service, rejecting concurrent external workspace edits. - Downgrade Selection:
Downgraderequires a current lock and freezes its server and MCDReforged runtime. Requested direct roots move to older package labels; each chosen build is its project's only candidate.--forceaccepts package conflicts, not runtime violations or overwrites. Locked and offline modes are rejected before workspace acquisition. Selection and resolution failures publish nothing; application retains normal transaction and post-commit provisioning semantics. - Phased Error Recovery: Distinct phase errors (
CreateResolveError,CreatePublishError,CreateRegistrationError,CreateInstallError) distinguish pre-publish aborts from post-publish installation failures where declared files remain intact for retry.
Targeted Tests
- Workspace initialization & selection:
go test ./operation -run TestInitializeWritesDeclarationForVanillaLayout - File tracking and runtime pins:
go test ./operation -run TestFileCommandsPreserveRuntimePinsAndReceipt - Server rename safety:
go test ./operation -run TestRenameServerChangesOnlyManifestName - Upgrade planning & Pareto selection:
go test ./operation -run 'Test(ParetoFrontierDropsDominatedOptions|SelectUpgradeOption|UpgradePlanHashIsOrderIndependent)'
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.

