feat(#138): Reorganise .devcontainer/ into autonomous/, scripts/, and a real VS Code devcontainer#139
Merged
LeeCampbell merged 5 commits intoHdrHistogram:mainfrom Mar 2, 2026
Conversation
6 tasks
LeeCampbell
approved these changes
Mar 2, 2026
Collaborator
LeeCampbell
left a comment
There was a problem hiding this comment.
Let's give it a go. Could also open the repo up to working nicely on codespaces?
WOuld make it nice when jumping between my PCs and MacBook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #138: Reorganise .devcontainer/ into autonomous/, scripts/, and a real VS Code devcontainer
Summary
The
.devcontainer/directory currently contains autonomous-agent Docker infrastructure (Dockerfile, agent-loop.sh, firewall scripts, prompt files) rather than a real VS Code / GitHub Codespaces devcontainer.This misuses the well-known devcontainer convention and was already flagged as confusing in CONTRIBUTING.md (line 54).
The directory also mixes two concerns: host-side orchestration entry points (
run.sh,fleet.sh) and Docker build internals (Dockerfile,entrypoint.sh,init-firewall.sh,prompts/).The goal is to split these cleanly and provide a genuine VS Code devcontainer for human contributors.
What Needs to Change and Why
Why
devcontainer.jsonis absent — VS Code and GitHub Codespaces users who open the repo get nothing useful.run.shandfleet.share host-side scripts that belong with the other orchestration scripts inscripts/.What
Create
./autonomous/— move all agent Docker build internals here:Dockerfileentrypoint.shagent-loop.shinit-firewall.sh.env.exampleprompts/(all five markdown prompt files)Move
run.shandfleet.sh→./scripts/— host-side entry points live alongsideplan.sh,execute-issue.sh,execute-milestone.sh.Update
run.shandfleet.sh— fix Docker build context and.envpaths:"$REPO_ROOT/autonomous/"(was"$SCRIPT_DIR/")-f "$REPO_ROOT/autonomous/Dockerfile".envsource/env-file:"$REPO_ROOT/autonomous/.env"(was"$SCRIPT_DIR/.env")REPO_ROOTfromSCRIPT_DIR(e.g.,REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"— but notecdis disallowed in agent contexts; use$(dirname "$SCRIPT_DIR")orrealpath "$SCRIPT_DIR/.."instead).Create
.devcontainer/devcontainer.json— a proper interactive devcontainer for human contributors:mcr.microsoft.com/devcontainers/dotnet:8.0dotnet restore && npm install -g @anthropic-ai/claude-codems-dotnettools.csdevkit), EditorConfig (editorconfig.editorconfig)Update
CONTRIBUTING.md— line 54 references.devcontainer/; update to referenceautonomous/and notescripts/run.sh/scripts/fleet.shas the entry points.Files Affected (Confirmed by Exploration)
Files to move (git mv)
.devcontainer/Dockerfileautonomous/Dockerfile.devcontainer/entrypoint.shautonomous/entrypoint.sh.devcontainer/agent-loop.shautonomous/agent-loop.sh.devcontainer/init-firewall.shautonomous/init-firewall.sh.devcontainer/.env.exampleautonomous/.env.example.devcontainer/prompts/autonomous/prompts/.devcontainer/run.shscripts/run.sh.devcontainer/fleet.shscripts/fleet.shFiles to create
.devcontainer/devcontainer.jsonFiles to edit
scripts/run.sh.envpath to use$REPO_ROOT/autonomous/scripts/fleet.sh.envpath to use$REPO_ROOT/autonomous/CONTRIBUTING.md.devcontainer/toautonomous/; mentionscripts/run.shandscripts/fleet.shFiles confirmed unchanged
autonomous/DockerfileCOPYpaths are build-context-relative — no changes needed.gitignoreautonomous/.envvia bare.envpattern on line 122.claude/settings.jsonBash(./scripts/*)Acceptance Criteria
.devcontainer/contains onlydevcontainer.json(no Dockerfile, no shell scripts, no prompts)./autonomous/contains:Dockerfile,entrypoint.sh,agent-loop.sh,init-firewall.sh,.env.example,prompts/./scripts/contains:run.sh,fleet.sh,plan.sh,execute-issue.sh,execute-milestone.shscripts/run.shbuilds Docker image with$REPO_ROOT/autonomous/as build context and reads.envfrom$REPO_ROOT/autonomous/.envscripts/fleet.shbuilds Docker image with$REPO_ROOT/autonomous/as build context and reads.envfrom$REPO_ROOT/autonomous/.env.devcontainer/devcontainer.jsonis valid JSON with base imagemcr.microsoft.com/devcontainers/dotnet:8.0, Node.js 20 feature, GitHub CLI feature, post-createdotnet restore && npm install -g @anthropic-ai/claude-code, C# Dev Kit and EditorConfig extensionsCONTRIBUTING.mdno longer references.devcontainer/for agent infrastructure; referencesautonomous/andscripts/run.sh/scripts/fleet.shautonomous/.env.exampleexists (moved from.devcontainer/.env.example)Test Strategy
There are no automated tests for shell scripts or Docker infrastructure in this repository (it uses xUnit for .NET code only).
Verification is manual / structural:
scripts/run.shandscripts/fleet.shand confirm all references to the build context, Dockerfile, and.envresolve toautonomous/relative to the repo root..devcontainer/devcontainer.jsonwithjq empty .devcontainer/devcontainer.json.autonomous/and no longer says.devcontainer/for agent infrastructure.dotnet buildstill passes — the .NET solution must not be broken by the reorganisation (it has no dependency on these files).No new xUnit tests are required — the changed artefacts are infrastructure files, not library code.
Risks and Open Questions
REPO_ROOTderivation in scriptsrun.shandfleet.shcurrently setSCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")". After moving toscripts/,SCRIPT_DIRwill be<repo>/scripts/. DerivingREPO_ROOTvia"$(dirname "$SCRIPT_DIR")"orrealpath "$SCRIPT_DIR/.."is fine in bash outside the agent context;cdis forbidden inside agent tool calls but these scripts run as host commands, not via the agent's Bash tool. UseREPO_ROOT="$(realpath "$SCRIPT_DIR/..")"for clarity.{{ISSUE_BODY}}{{ISSUE_BODY}}in the post-create command — this is a template rendering artefact. The intended command isdotnet restore && npm install -g @anthropic-ai/claude-code..env.examplemove.env.examplefile needs to be moved (not just copied) so contributors know the canonical location isautonomous/.env.example. Update any inline comments or docs that reference its old path.devcontainer.jsonusing the Microsoft base image is sufficient and simpler.Task breakdown
Task List — Issue #138: Reorganise .devcontainer/ into autonomous/, scripts/, and a real VS Code devcontainer
Current State (Confirmed by Exploration)
.devcontainer/contains:Dockerfile,entrypoint.sh,agent-loop.sh,init-firewall.sh,.env.example,run.sh,fleet.sh,prompts/(5 files) — nodevcontainer.jsonscripts/contains:plan.sh,execute-issue.sh,execute-milestone.sh— norun.shorfleet.shautonomous/directory does not exist.devcontainer/devcontainer.jsondoes not existCONTRIBUTING.mdline 54 says.devcontainer/is for agent automation onlyTasks
Phase 1 — Move agent infrastructure files to
autonomous/T1
git mv .devcontainer/Dockerfile autonomous/Dockerfile— Moves the agent Docker build file out of the misused devcontainer dir.
Verify:
git statusshowsrenamed: .devcontainer/Dockerfile -> autonomous/Dockerfile; file absent from.devcontainer/.T2
git mv .devcontainer/entrypoint.sh autonomous/entrypoint.sh— Moves the container entrypoint script.
Verify:
git statusshows rename; file absent from.devcontainer/.T3
git mv .devcontainer/agent-loop.sh autonomous/agent-loop.sh— Moves the agent state-machine loop.
Verify:
git statusshows rename; file absent from.devcontainer/.T4
git mv .devcontainer/init-firewall.sh autonomous/init-firewall.sh— Moves the firewall initialisation script.
Verify:
git statusshows rename; file absent from.devcontainer/.T5
git mv .devcontainer/.env.example autonomous/.env.example— Moves the environment variable template.
.gitignorealready coversautonomous/.envvia the bare.envpattern (line 122).Verify:
autonomous/.env.exampleexists;.devcontainer/.env.exampleabsent.T6
git mv .devcontainer/prompts autonomous/prompts— Moves the entire prompts directory (5 markdown files:
execute-tasks.md,pick-issue.md,apply-review.md,create-tasks.md,review-brief.md).Verify:
autonomous/prompts/contains all 5 files;.devcontainer/prompts/absent.Phase 2 — Move host-side entry points to
scripts/T7
git mv .devcontainer/run.sh scripts/run.sh— Moves the single-agent launch script alongside the other host-side orchestration scripts.
Verify:
scripts/run.shexists;.devcontainer/run.shabsent.T8
git mv .devcontainer/fleet.sh scripts/fleet.sh— Moves the multi-agent fleet orchestration script.
Verify:
scripts/fleet.shexists;.devcontainer/fleet.shabsent.Phase 3 — Update path references in moved scripts
T9 Update
scripts/run.sh— addREPO_ROOTderivation and fix all paths.After the existing
SCRIPT_DIRline, add:REPO_ROOT="$(realpath "$SCRIPT_DIR/..")"Then replace:
"$SCRIPT_DIR/.env"(source) →"$REPO_ROOT/autonomous/.env""$SCRIPT_DIR/Dockerfile"→"$REPO_ROOT/autonomous/Dockerfile""$SCRIPT_DIR/"(build context) →"$REPO_ROOT/autonomous/""$SCRIPT_DIR/.env"(env-file) →"$REPO_ROOT/autonomous/.env"Verify: Read
scripts/run.sh; confirm no remaining$SCRIPT_DIRreferences to.envorDockerfile; all four path occurrences use$REPO_ROOT/autonomous/.T10 Update
scripts/fleet.sh— addREPO_ROOTderivation and fix all paths.After the existing
SCRIPT_DIRline, add:REPO_ROOT="$(realpath "$SCRIPT_DIR/..")"Then replace:
"$SCRIPT_DIR/.env"(source) →"$REPO_ROOT/autonomous/.env""$SCRIPT_DIR/Dockerfile"→"$REPO_ROOT/autonomous/Dockerfile""$SCRIPT_DIR/"(build context) →"$REPO_ROOT/autonomous/""$SCRIPT_DIR/.env"(env-file) →"$REPO_ROOT/autonomous/.env"Verify: Read
scripts/fleet.sh; confirm no remaining$SCRIPT_DIRreferences to.envorDockerfile; all four path occurrences use$REPO_ROOT/autonomous/.Phase 4 — Create the real VS Code devcontainer
.devcontainer/devcontainer.jsonwith the following content:name:"HdrHistogram.NET"image:"mcr.microsoft.com/devcontainers/dotnet:8.0"features: Node.js 20 (ghcr.io/devcontainers/features/node:1withversion: "20") and GitHub CLI (ghcr.io/devcontainers/features/github-cli:1)postCreateCommand:"dotnet restore && npm install -g @anthropic-ai/claude-code"customizations.vscode.extensions:["ms-dotnettools.csdevkit", "editorconfig.editorconfig"]Verify:
jq empty .devcontainer/devcontainer.jsonexits 0 (valid JSON);jq '.image' .devcontainer/devcontainer.jsonoutputs"mcr.microsoft.com/devcontainers/dotnet:8.0".Phase 5 — Update CONTRIBUTING.md
CONTRIBUTING.mdaround line 54 — replace the paragraph that references.devcontainer/as agent-only infrastructure.New text should:
autonomous/contains the agent Docker infrastructurescripts/run.shandscripts/fleet.shas the host-side entry points.devcontainer/as agent-only (it is now a proper VS Code devcontainer)Verify: Read
CONTRIBUTING.md; confirm the word ".devcontainer/" does not appear in the context of agent infrastructure;autonomous/is mentioned;scripts/run.shandscripts/fleet.share named.Phase 6 — Verification
T13 Confirm
.devcontainer/contains onlydevcontainer.jsonand nothing else.Run:
ls .devcontainer/and confirm onlydevcontainer.jsonis listed.T14 Confirm
autonomous/contains all six expected items.Run:
ls autonomous/and confirmDockerfile,entrypoint.sh,agent-loop.sh,init-firewall.sh,.env.example,prompts/are present.T15 Confirm
scripts/contains all five expected scripts.Run:
ls scripts/and confirmrun.sh,fleet.sh,plan.sh,execute-issue.sh,execute-milestone.share present.T16 Validate
devcontainer.jsonis well-formed JSON.Run:
jq empty .devcontainer/devcontainer.json— must exit 0 with no output.T17 Verify
dotnet buildstill passes (the .NET solution has no dependency on infrastructure files).Run:
dotnet buildfrom repo root — must exit 0 with no errors.Acceptance Criteria Cross-Reference
.devcontainer/contains onlydevcontainer.json./autonomous/containsDockerfile,entrypoint.sh,agent-loop.sh,init-firewall.sh,.env.example,prompts/./scripts/containsrun.sh,fleet.sh,plan.sh,execute-issue.sh,execute-milestone.shscripts/run.shuses$REPO_ROOT/autonomous/for build context and.envscripts/fleet.shuses$REPO_ROOT/autonomous/for build context and.env.devcontainer/devcontainer.jsonis valid JSON with correct base image, features, post-create command, extensionsCONTRIBUTING.mdreferencesautonomous/andscripts/run.sh/scripts/fleet.sh; no.devcontainer/for agent infraautonomous/.env.exampleexistsCloses #138