From 80059858ee44c92e8749c218972237fa1af688e0 Mon Sep 17 00:00:00 2001 From: Luca Giordano Date: Mon, 6 Jul 2026 17:09:30 +0200 Subject: [PATCH] Package dotnet Dockerfile recipe as examples/dotnet-project/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copy-pasteable recipe for running /afk & /hitl against a non-TypeScript (dotnet) target project: README + orchestrator.env template pointing SANDCASTLE_IMAGE at the dotnet inner image (sandcastle-dotnet:local, #106) and AGENTIC_REPO at the validation fixture repo (lsfera/dotnet-afk-proof). Structural first for examples/ — every prior example is a pure tier/model config recipe; this one also points at a non-default inner image and an external repo, so it's the first to actually set AGENTIC_REPO. One new row added to examples/README.md's table; no other entries touched. Implements issue #03 of .scratch/dotnet-afk-support/PRD.md (this workspace's local tracker). Co-Authored-By: Claude Sonnet 5 --- examples/README.md | 1 + examples/dotnet-project/README.md | 51 ++++++++++++++++++++++++ examples/dotnet-project/orchestrator.env | 19 +++++++++ 3 files changed, 71 insertions(+) create mode 100644 examples/dotnet-project/README.md create mode 100644 examples/dotnet-project/orchestrator.env diff --git a/examples/README.md b/examples/README.md index bbe119d..6aab1a0 100644 --- a/examples/README.md +++ b/examples/README.md @@ -12,6 +12,7 @@ per-example notes), then launch with `afk` / `hitl`. | Contributor / air-gapped / custom image | [`build-from-source/`](build-from-source/) | claude | built `:local` | builds images yourself | | Reproducible — lock versions | [`pinned-reproducible/`](pinned-reproducible/) | claude | pinned `:vX.Y.Z` | inner **and** outer image pinned | | Many issues in parallel | [`parallel-throughput/`](parallel-throughput/) | claude | prebuilt GHCR `:latest` | `AGENTIC_CONCURRENCY` > 1 | +| Non-TypeScript target project (dotnet) | [`dotnet-project/`](dotnet-project/) | claude | built `Dockerfile.dotnet` `:local` | targets an external repo via `AGENTIC_REPO` | ## Common to every example diff --git a/examples/dotnet-project/README.md b/examples/dotnet-project/README.md new file mode 100644 index 0000000..dc08f09 --- /dev/null +++ b/examples/dotnet-project/README.md @@ -0,0 +1,51 @@ +# dotnet: non-TypeScript target project + +Run `/afk`/`/hitl` against a dotnet (C#) target project instead of the +default JS/TS assumption — the first validated non-TypeScript recipe. See +[ADR-0024](../../docs/adr/0024-sandcastle-is-not-a-language-constraint.md) +and [ADR-0002's addendum](../../docs/adr/0002-lean-inner-image-per-project-extension.md) +for why this is purely a Dockerfile + config recipe, with no changes needed +to the orchestrator itself. + +This recipe is validated against a small, purpose-built fixture repo +([`lsfera/dotnet-afk-proof`](https://github.com/lsfera/dotnet-afk-proof), +private) rather than a real production dotnet codebase — copy the pattern +and point `AGENTIC_REPO` at your own project instead. + +## Setup + +1. Build the dotnet inner image from the `.sandcastle` context: + + ```bash + docker build -f .sandcastle/Dockerfile.dotnet -t sandcastle-dotnet:local .sandcastle + ``` + + To make the image **owned** (so the #40 orphan sweep won't let another + project reap its sandboxes), add `--build-arg AGENTIC_PROJECT=`. + +2. Copy the config and add your tokens: + + ```bash + cp examples/dotnet-project/orchestrator.env .sandcastle/orchestrator.env + # then edit .sandcastle/orchestrator.env → set GH_TOKEN, and AGENTIC_REPO + # if targeting your own dotnet project instead of the validation fixture + + printf 'CLAUDE_CODE_OAUTH_TOKEN=%s\n' "$(claude setup-token)" > .sandcastle/.env + ``` + +## Run + +```bash +afk # autonomous +hitl # reviewed +``` + +## Adapting this to another language + +The pattern generalizes: swap `Dockerfile.dotnet`'s base image +(`mcr.microsoft.com/dotnet/sdk:8.0`) for the lean official upstream image of +your language (e.g. `rust:1-slim`, `python:3.12-slim`), keep the same +git+curl install, non-root user rename, and native Claude Code CLI installer +(`curl -fsSL https://claude.ai/install.sh | bash` — no Node dependency), and +point `SANDCASTLE_IMAGE` at the result. No orchestrator code changes are +needed for any language — see ADR-0024. diff --git a/examples/dotnet-project/orchestrator.env b/examples/dotnet-project/orchestrator.env new file mode 100644 index 0000000..ab60b10 --- /dev/null +++ b/examples/dotnet-project/orchestrator.env @@ -0,0 +1,19 @@ +# Use case: run /afk & /hitl against a non-TypeScript (dotnet) target project. +# Validates the per-language Dockerfile recipe from ADR-0002's addendum / +# ADR-0024 — no orchestrator code changes, just a different inner image and +# target repo. Copy to .sandcastle/orchestrator.env and fill GH_TOKEN. + +# Orchestrator's gh token (issue list/label/comment, PR create). Host: `gh auth token`. +GH_TOKEN= + +# Build the dotnet inner image first (from the .sandcastle context): +# docker build -f .sandcastle/Dockerfile.dotnet -t sandcastle-dotnet:local .sandcastle +SANDCASTLE_IMAGE=sandcastle-dotnet:local + +# Target repo is NOT the one `gh` detects from the working directory here — +# this recipe validates against a small, purpose-built dotnet fixture repo, +# so AGENTIC_REPO is set explicitly rather than left to the default. +AGENTIC_REPO=lsfera/dotnet-afk-proof + +# Claude tier only for this recipe (no opencode/local variant yet) — this is +# already the default, so no AGENTIC_TIER override needed here.