From 4d9c318e5cd3c1ed4b61a1e31b499bd065a2622b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=88=E7=BA=BE?= Date: Thu, 22 Oct 2026 17:19:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?docs:=20=E5=A2=9E=E5=8A=A0=20AGENTS.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..c68d248 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,39 @@ +# AGENTS.md + +C# source loader for the Hosihikari Framework. It compiles `.cs` files with Roslyn at load and runs +the result in a collectible assembly load context. + +## Repository map + +- `src/` — loader implementation and cache. +- `host/` — assertion host for compilation, caching, isolation, and unload. +- `test/` — fixture packages and private dependencies. +- `pack.ps1`, `pack.sh` — build the `hosihikari-csharp` lip package. +- `tooth.json` — lip package metadata. + +## Build and verify + +```bash +dotnet run --project host/Hosihikari.PluginLoader.CSharp.Host.csproj -c Release --nologo +pwsh ./pack.ps1 -Version 1.0.0 -OutputRoot artifacts +``` + +The host expects sibling `PluginManager`, `Plugin.Abstractions`, and +`Hosihikari.McMaster.NETCore.Plugins` checkouts. `pack.ps1` calls the core packer and needs the same +`PluginManager` checkout. + +## Invariants + +- The package is a plugin package named `hosihikari-csharp`; its manifest routes on + `extraInfo.loader: csharp` and entry `main.cs`. +- Compile-time references follow the runtime order: framework shared layer, package-local DLLs, + then trusted platform assemblies. +- Cache keys cover source text, package-local DLLs, Roslyn version, and runtime version. Keep the + checksum check in sync. +- A failed load releases its ALC; one package exposes exactly one `IPlugin` type. +- Public default branches are protected. Work on a branch, open a pull request, and squash merge. + +## Context + +- [Design record](https://github.com/HosihikariFramework/Design) — GLOSSARY and ADRs. +- [C# plugin guide](https://hf.srcz.one/authoring-csharp/). From bcda4c45e4bb3aca7ded571568db7ac44b87fd82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=88=E7=BA=BE?= Date: Thu, 22 Oct 2026 17:23:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?docs:=20=E4=BF=AE=E6=AD=A3=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=99=A8=E5=8C=85=E6=B8=85=E5=8D=95=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index c68d248..593e0a1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -24,7 +24,8 @@ The host expects sibling `PluginManager`, `Plugin.Abstractions`, and ## Invariants -- The package is a plugin package named `hosihikari-csharp`; its manifest routes on +- The loader package is named `hosihikari-csharp`; it routes on `extraInfo.loader: assembly` with + entry `Hosihikari.PluginLoader.CSharp.dll`. Source packages it handles use `extraInfo.loader: csharp` and entry `main.cs`. - Compile-time references follow the runtime order: framework shared layer, package-local DLLs, then trusted platform assemblies. From 34ad7e2ab446d394a03ba5e34a902669a40d4e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=88=E7=BA=BE?= Date: Thu, 22 Oct 2026 17:29:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?docs:=20=E5=8E=BB=E6=8E=89=E4=B8=8D?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E7=9A=84=20pack.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 593e0a1..0c551ef 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,7 +8,7 @@ the result in a collectible assembly load context. - `src/` — loader implementation and cache. - `host/` — assertion host for compilation, caching, isolation, and unload. - `test/` — fixture packages and private dependencies. -- `pack.ps1`, `pack.sh` — build the `hosihikari-csharp` lip package. +- `pack.ps1` — build the `hosihikari-csharp` lip package. - `tooth.json` — lip package metadata. ## Build and verify