Skip to content

Commit 2dbabf2

Browse files
committed
Initial commit
0 parents  commit 2dbabf2

29 files changed

Lines changed: 4824 additions & 0 deletions
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# DocOps Box — Agent Handoff Note
2+
3+
**Date:** 2026-04-07
4+
**From:** Chat agent (README overhaul session)
5+
**To:** Co-agent
6+
**Re:** README.adoc merge progress + named-volume architecture decision
7+
8+
---
9+
10+
## README Status
11+
12+
Active work: merging a detailed original 1845-line README into a modernized 770-line structure. User has accepted all changes so far and added the full `ruby-for-real` appendix with their own edits. File is now ~1200+ lines and growing.
13+
14+
**Completed sections** (all accepted by user):
15+
- Consolidated two quickstart guides (VS Code + CLI) into single `== Quick Start` with Option A / Option B
16+
- Prerequisites (all platforms: terminal, WSL2, Docker, VS Code)
17+
- Tooling Overview with definition lists
18+
- Codebase Overview
19+
- Configuration Reference
20+
- Volume Lifecycle
21+
- `docr` Command Reference
22+
- Troubleshooting
23+
- Extending DocOps Box
24+
- Development & Contribution
25+
- Appendices: Who Is This For, Background/ADR, Beyond Ruby DocOps, Installing Everything for Real (ruby-for-real)
26+
27+
**Still needs work before release** — user has not specified what's next; treat the file as a live draft.
28+
29+
**Key constraints:**
30+
- `docr` only — NO `docksh` or `docopsbox` CLI references anywhere
31+
- First-person voice throughout
32+
- LibreOffice only on `max`/`live` image
33+
- Regular users do NOT perform image builds — keep that in appendices/extending only
34+
- All sidebars use `ifdef::env-github` / `ifndef::env-github` conditional pattern
35+
- Single file (README.adoc) — no splitting
36+
37+
---
38+
39+
## Architecture Decision: Named Volumes for All Runtimes
40+
41+
**Decision reached:** Use named Docker volumes consistently for all three runtime dependency trees (Ruby, Node.js, Python). Do NOT use workspace bind-mounts for installed packages.
42+
43+
### Current state (inconsistent — needs fixing)
44+
45+
| Runtime | Installed deps | Download cache |
46+
|---------|---------------|----------------|
47+
| Ruby | Named vol per-project (`/usr/local/bundle`) ✅ | n/a |
48+
| Node.js | Workspace bind-mount (`node_modules`) ⚠️ | Named vol shared (`/npm-cache`) |
49+
| Python | **Lost on container restart**| Named vol shared (`/pip-cache`) |
50+
51+
### Target state
52+
53+
| Runtime | Named volume | Mount point | Scope |
54+
|---------|-------------|-------------|-------|
55+
| Ruby gems | `docops-{slug}-bundle` | `/usr/local/bundle` | Per-project |
56+
| Node modules | `docops-{slug}-node` | `/workspace/node_modules` | Per-project |
57+
| Python packages | `docops-{slug}-python` | `/usr/local/lib/pythonX.Y/site-packages` (or a venv path) | Per-project |
58+
| npm download cache | `docops-npm-cache` | `/npm-cache` | Shared |
59+
| pip download cache | `docops-pip-cache` | `/pip-cache` | Shared |
60+
| Shell history | `docops-shell-history` | `/commandhistory` | Shared |
61+
62+
### Rationale summary
63+
64+
- Container-built `node_modules` contains Linux binaries — useless natively on macOS/Windows regardless of where it lives; "workspace path = native access" is an illusion
65+
- Python `.venv` in workspace creates broken symlinks from host filesystem; beginners will commit it to Git
66+
- Named volumes give consistent behavior on macOS, Linux, WSL2 with no bind-mount overhead
67+
- The one weakness (orphan volume lifecycle) is a `docr` tooling gap, not a reason to reject the strategy
68+
69+
### Files that need updating
70+
71+
1. **`Dockerfile`** — add `ENV` for Python package path; create/chown the new volume mount points
72+
2. **`docopsbox.yml`** — add `docops-{slug}-node` and `docops-{slug}-python` named volumes; update `volumes:` block
73+
3. **`.devcontainer/devcontainer.json`** — update `postCreateCommand` to include `pip install -r requirements.txt` (guarded like the others)
74+
4. **`README.adoc`** — update Volume Lifecycle table (add Node and Python rows), update "What Just Happened?" bullet list, update `docr reset` docs to mention all three volumes
75+
5. **`docr` script**`docr reset` should destroy node and python volumes alongside bundle; `docr list`/`docr status` should show all three
76+
77+
### Open question for Python mount path
78+
79+
Using a fixed venv path (e.g., `/opt/venv`) set via `VIRTUAL_ENV` env var is cleaner than site-packages directly, and plays well with `pip install` without `--break-system-packages`. Confirm with user or research best practice for the base image in use.

.agent/team/handoff-restructure.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Handoff: File Restructure
2+
3+
**Date:** 2026-04-08
4+
5+
Two structural changes — README needs updating:
6+
7+
## `bin/docr` (was `docr` at root)
8+
9+
- `curl` install URL changed: `.../bin/docr` not `.../docr` (already fixed in README line 470)
10+
- Codebase Overview: mention script lives at `bin/docr`
11+
12+
## `templates/` (new directory)
13+
14+
Files moved there: `docopsbox.yml`, `.env`, `dockerfile-pre-build.sh`, `dockerfile-post-build.sh`, `package.json`, `requirements.txt`, `.devcontainer/devcontainer.json`
15+
16+
These are the project scaffold files users get via `docr init` (fetched from upstream). They are NOT active files in the repo itself.
17+
18+
README needs:
19+
- Codebase Overview: describe `templates/` as the user-project scaffold library
20+
- Extending section: hook scripts (`dockerfile-pre-build.sh`, `dockerfile-post-build.sh`) now live at `templates/` in the repo, but users copy/create them at their own project root
21+
- Any remaining file listings that imply these files live at the repo root
22+
23+
The `.devcontainer/` at the repo root is *gone* — it was only ever the template. If the repo needs its own dev container config in future, that's a separate concern.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# DocOps Box — Agent Handoff: Volumes Architecture Implemented
2+
3+
**Date:** 2026-04-07
4+
**From:** Tooling/script agent
5+
**To:** README/docs agent
6+
**Re:** Named-volume architecture decision is fully implemented
7+
8+
---
9+
10+
## What Was Done
11+
12+
All five files from the handoff plan are updated and shellcheck-clean.
13+
14+
### `Dockerfile`
15+
- `VIRTUAL_ENV=/opt/venv` added to `ENV` block
16+
- `PATH` updated: `/opt/venv/bin:/usr/local/bundle/bin:$PATH`
17+
- `python3-venv` added to the Python apt install block
18+
- `mkdir -p` now creates `/opt/venv` and `$WORKDIR/node_modules` as volume mount points
19+
- `chown -R` covers `/opt/venv` (mount points must pre-exist and be owned by run user)
20+
21+
### `entrypoint.sh`
22+
- Added `/opt/venv` to the recursive `chown` at startup
23+
- Added `chown` of `/workspace/node_modules` (named volume mount, not workspace bind)
24+
- Added lazy venv bootstrap: if `VIRTUAL_ENV` is set, `/opt/venv/bin/python` is absent,
25+
and `python3` exists → runs `python3 -m venv /opt/venv` as root then chowns it.
26+
Fires only on first container start after a fresh/reset volume; no-op thereafter.
27+
28+
### `docopsbox.yml`
29+
Two new per-project named volumes:
30+
- `docops-{slug}-node` → mounted at `/workspace/node_modules`
31+
- `docops-{slug}-python` → mounted at `/opt/venv`
32+
33+
Both are declared in the `volumes:` section with slug-interpolated names.
34+
Existing shared caches (`docops-npm-cache`, `docops-pip-cache`) are unchanged.
35+
36+
### `.devcontainer/devcontainer.json`
37+
- `postCreateCommand` now also runs `pip install -r requirements.txt` (guarded: only
38+
if `requirements.txt` exists)
39+
40+
### `docr` script
41+
- `cmd_reset`: `node_vol` and `python_vol` variables added; both are removed on plain
42+
`reset` and on `--full`. Help text updated accordingly.
43+
- `cmd_status`: now reports node and python volume state/size alongside bundle.
44+
- `cmd_list`: disposition labels improved — shared download caches labeled separately
45+
from per-project disposable volumes.
46+
- `cmd_help`: reset description updated to name gems/node/python.
47+
48+
---
49+
50+
## Final Volume Architecture (Implemented)
51+
52+
| Volume | Docker name | Mount point | Scope |
53+
|--------|-------------|-------------|-------|
54+
| Ruby gems | `docops-{slug}-bundle` | `/usr/local/bundle` | Per-project |
55+
| Node modules | `docops-{slug}-node` | `/workspace/node_modules` | Per-project |
56+
| Python venv | `docops-{slug}-python` | `/opt/venv` | Per-project |
57+
| npm download cache | `docops-npm-cache` | `/npm-cache` | Shared |
58+
| pip download cache | `docops-pip-cache` | `/pip-cache` | Shared |
59+
| Shell history | `docops-shell-history` | `/commandhistory` | Shared |
60+
61+
---
62+
63+
## README Updates Needed (Your Side)
64+
65+
The Volume Lifecycle section and related prose need to reflect:
66+
67+
1. **Volume table**: Add Node modules and Python venv rows (see table above)
68+
2. **"What Just Happened?" bullet list** (after `docr init`/`docr run`): mention that
69+
node_modules and the Python venv are now in named volumes, not in the workspace
70+
3. **`docr reset` docs**: say "dependency caches (gems, node modules, Python venv)"
71+
rather than just "gem cache"
72+
4. **Why named volumes for Node/Python** (a brief explainer, or a sidebar): Linux
73+
binaries in node_modules are useless on macOS/Windows host; Python venv uses
74+
symlinks that break on the host filesystem. Named volumes keep them inside Docker
75+
where they work correctly and persist across restarts.
76+
5. **`VIRTUAL_ENV` / Python**: users can `pip install` normally inside the container;
77+
no `--user` or `--break-system-packages` flags needed. The venv is at `/opt/venv`.
78+
79+
The `uninstall` subcommand was also added since the last handoff — you may want a
80+
one-liner in the command reference: removes installed binary and backup data dir.

.config/actionlint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# actionlint configuration for this project
2+
# References DocOps Lab base configuration
3+
4+
# Project-specific ignores (add as needed):
5+
ignore:
6+
# Example: Ignore specific workflow patterns
7+
# - 'workflow "deploy.yml"'
8+
# - '"ubuntu-20.04" is deprecated'
9+
10+
# Project-specific overrides:
11+
shellcheck:
12+
enable: true
13+
# shell-options: "-e SC2016" # Add project-specific ShellCheck exclusions

.config/docopslab-dev.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
source:
2+
repo: DocOps/lab
3+
ref: v1
4+
docs:
5+
- source: docs/agent/skills/*.md
6+
target: .agent/docs/skills/
7+
synced: true
8+
- source: docs/agent/topics/*.md
9+
target: .agent/docs/topics/
10+
synced: true
11+
- source: docs/agent/roles/*.md
12+
target: .agent/docs/roles/
13+
synced: true
14+
- source: docs/agent/missions/*.md
15+
target: .agent/docs/missions/
16+
synced: true
17+
18+
templates:
19+
manifest:
20+
- source: templates/AGENTS.markdown
21+
target: ./AGENTS.md
22+
- source: templates/gitignore
23+
target: .gitignore
24+
- source: templates/README.asciidoc
25+
target: README.adoc
26+
27+
tools:
28+
- tool: rubocop
29+
files:
30+
- source: rubocop/base.yml
31+
target: .config/.vendor/docopslab/rubocop.yml
32+
synced: true
33+
- source: rubocop/project.yml
34+
target: .config/rubocop.yml
35+
synced: false
36+
37+
- tool: vale
38+
files:
39+
- source: vale/base.ini
40+
target: .config/.vendor/docopslab/vale.ini
41+
synced: true
42+
- source: vale/project.ini
43+
target: .config/vale.local.ini
44+
synced: false
45+
46+
- tool: htmlproofer
47+
enabled: false # Disabled by default, enable per project
48+
files:
49+
- source: htmlproofer/base.yml
50+
target: .config/.vendor/docopslab/htmlproofer.yml
51+
synced: true
52+
- source: htmlproofer/project.yml
53+
target: .config/htmlproofer.yml
54+
synced: false
55+
paths:
56+
lint: docs/_site
57+
58+
- tool: shellcheck
59+
files:
60+
- source: shellcheck/base.shellcheckrc
61+
target: .config/shellcheckrc
62+
synced: true
63+
64+
- tool: actionlint
65+
files:
66+
- source: actionlint/base.yml
67+
target: .config/.vendor/docopslab/actionlint.yml
68+
synced: true
69+
- source: actionlint/project.yml
70+
target: .config/actionlint.yml
71+
synced: false
72+
73+
library:
74+
enabled: true
75+
source:
76+
repo: DocOps/lab
77+
ref: labdev-library

.config/shellcheckrc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# ShellCheck configuration for DocOps Lab projects
2+
# This file is synced from docopslab-dev gem
3+
4+
# Disable some overly strict rules for our use cases
5+
disable=SC2034 # Variable appears unused (common in sourced scripts)
6+
disable=SC2086 # Double quote to prevent globbing (sometimes we want globbing)
7+
disable=SC2181 # Check exit code directly with e.g. 'if mycmd;', not indirectly with $?
8+
9+
# Set default shell to bash (most of our scripts are bash)
10+
shell=bash
11+
12+
# Enable additional optional checks
13+
enable=quote-safe-variables
14+
enable=require-variable-braces

.config/vale.local.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# DocOps Lab Vale Configuration
2+
# Combined base and project configuration for consistent Vale linting
3+
4+
MinAlertLevel = warning
5+
StylesPath = .vendor/vale/styles

.dockerignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# DocOps Box — Docker build context exclusions
2+
# Keeps the build context fast and prevents development files from leaking into
3+
# the image. Files intentionally included in the build (Gemfile*, package.json,
4+
# requirements.txt, dockerfile-*.sh) are expected in the project root (the
5+
# build context) and are NOT listed here. The repo's own copies live under
6+
# templates/ but users place them at their project root before building.
7+
8+
# Repo-only directories — not needed in user image builds
9+
templates/
10+
bin/
11+
scripts/
12+
13+
# Version control
14+
.git/
15+
.gitignore
16+
17+
# Agent/session scratch directories
18+
.agent/
19+
.agents/
20+
21+
# Documentation source (not needed inside the image)
22+
*.adoc
23+
*.html
24+
LICENSE
25+
26+
# Development tooling configs
27+
.config/
28+
Rakefile
29+
30+
# Editor and IDE
31+
.vscode/
32+
.idea/
33+
34+
# OS artifacts
35+
.DS_Store
36+
37+
# Runtime artifacts
38+
_site/
39+
.jekyll-cache/
40+
tmp/
41+
*.log
42+
*.bak
43+
*~

0 commit comments

Comments
 (0)