repositories / will

will

owned by bugabinga

dev: isolated dev genome with on-the-fly origin

ce12c7350fc55349a8969b40612e2b48c380f873

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

git-init seeds ./.dev/origin/will.git from the real checkout's commits,
clones ./.dev/work, copies node_modules once, and overlays uncommitted
files as dev-sync commits (skipped when will's tree is dirty). The
agent sees only ./.dev: it edits, commits, and pushes in its clone;
the real workspace is never mounted. Ready handshake via .ready marker.

Changed files (5)

+89 / −25 text lines

Diff layout

.gitignore

Modified

+1 / −0 text lines

66*.log
77.DS_Store
88.env
9.dev/
910.pi/agent/
1011models-store.json

compose.yaml

Modified

+37 / −21 text lines

1# Workstation development body: service + agent with source mounted.
2# Same body as scripts/dev-local.mjs but in containers (podman compose).
3# The fake telegram + fake session keep the dev loop offline; see .env.example.
1# Workstation development body: service + agent + fake telegram + dev genome.
2#
3# Genome flow (prod-parity, fully offline, your workspace never touched by will):
4# git-init 1. seeds ./.dev/origin.git (bare) from your checkout's commits
5# 2. clones it to ./.dev/work (the dev workspace, persists across boots)
6# 3. copies node_modules once (293M, only when missing)
7# 4. overlays your uncommitted files into ./.dev/work and commits them
8# as 'dev-sync' -- but only when the dev workspace is clean, so
9# will's uncommitted work is never clobbered
10# agent lives in ./.dev/work: edits, commits, pushes to ./.dev/origin.git
11# you inspect anytime: cd .dev/work && git log / git diff
412services:
513 service:
614 image: docker.io/library/node:26-slim
1927 WILL_STORAGE_STOP_PCT: 5
2028 volumes:
2129 - .:/workspace
22 - service-data:/srv/will-data
30 - ./.dev/service-data:/srv/will-data
2331 ports:
2432 - '3000:3000'
2533 - '127.0.0.1:33001:3001'
2634 # agent shares this netns; publish its readiness for host debugging
2735 - '127.0.0.1:33081:8081'
37 git-init:
38 build:
39 context: ./deploy/dev
40 dockerfile: agent.df
41 command: sh /scripts/git-init.sh
42 volumes:
43 - .:/workspace:ro
44 - ./.dev:/will-dev
45 - ./deploy/dev/git-init.sh:/scripts/git-init.sh:ro
2947 agent:
3048 build:
3149 context: ./deploy/dev
3250 dockerfile: agent.df
33 working_dir: /workspace
34 command: node --experimental-strip-types src/agent/main.ts
51 working_dir: /will-dev/work
3552 depends_on:
3653 - service
54 - git-init
3755 # Shares the service's network namespace (like the production pod):
3856 # the pod-local API is 127.0.0.1, the fake telegram resolves by name.
3957 network_mode: "service:service"
58 command: sh -c "until [ -f /will-dev/.ready ]; do sleep 0.5; done; exec node --experimental-strip-types /will-dev/work/src/agent/main.ts"
4059 environment:
4160 # real session whenever the key is present; WILL_SESSION_MODE=fake forces fake
4261 ZAI_API_KEY: ${ZAI_API_KEY:-}
43 WILL_AGENT_DIR: /srv/will-agent
44 # dev genome: the live bind-mounted checkout; will edits the code you run.
45 # No WILL_VCS_GIT_URL => commits stay local, nothing is pushed.
46 WILL_WORK_DIR: /workspace
47 WILL_RESOURCE_DIR: /workspace
48 GIT_AUTHOR_NAME: will
49 GIT_AUTHOR_EMAIL: will@bugabinga.net
50 GIT_COMMITTER_NAME: will
51 GIT_COMMITTER_EMAIL: will@bugabinga.net
62 WILL_AGENT_DIR: /will-dev/agent
63 # dev genome: will's own clone; commit+push loops run against the dev origin
64 WILL_WORK_DIR: /will-dev/work
65 WILL_RESOURCE_DIR: /will-dev/work
66 WILL_VCS_GIT_URL: /will-dev/origin/will.git
67 WILL_VCS_DEFAULT_BRANCH: trunk
5268 WILL_SERVICE_INTERNAL_URL: http://127.0.0.1:3001
5369 # dev only: bind all interfaces so the published debug port reaches it
5470 WILL_AGENT_READY_ADDR: 0.0.0.0:8081
5672 WILL_TELEGRAM_TOKEN: dev-token
5773 WILL_TELEGRAM_CHAT_ID: '-100'
5874 WILL_TELEGRAM_OLIVER_ID: '1'
75 GIT_AUTHOR_NAME: will
76 GIT_AUTHOR_EMAIL: will@bugabinga.net
77 GIT_COMMITTER_NAME: will
78 GIT_COMMITTER_EMAIL: will@bugabinga.net
5979 volumes:
60 - .:/workspace
61 - agent-data:/srv/will-agent
80 # the real workspace is deliberately NOT mounted here
81 - ./.dev:/will-dev
6383 fake-telegram:
6484 build:
6787 PORT: 38080
6888 ports:
6989 - '38080:38080'
71volumes:
72 service-data:
73 agent-data:

deploy/dev/agent.df

Modified

+1 / −1 text lines

11FROM docker.io/library/node:26-slim
2RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates && rm -rf /var/lib/apt/lists/*
2RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates rsync && rm -rf /var/lib/apt/lists/*

deploy/dev/git-init.sh

Added
new file mode 100755

+44 / −0 text lines

1#!/bin/sh
2# Dev genome bootstrap (compose git-init). Runs to completion at every up.
3set -eu
4
5# agent waits for this marker; stale markers from previous boots are cleared
6rm -f /will-dev/.ready
7
8ORIGIN=/will-dev/origin/will.git
9WORK=/will-dev/work
11# 1. origin: mirror the committed state of the real workspace
12if [ ! -d "$ORIGIN/objects" ]; then
13 git clone --bare --quiet /workspace "$ORIGIN"
14else
15 git -C "$ORIGIN" fetch --prune --quiet /workspace '+refs/heads/*:refs/heads/*'
16fi
18# 2. dev workspace: clone once, persists across boots
19if [ ! -d "$WORK/.git" ]; then
20 git clone --quiet "$ORIGIN" "$WORK"
21fi
23# 3. node_modules: one-time copy (293M)
24if [ ! -d "$WORK/node_modules" ]; then
25 echo 'dev: copying node_modules (one-time)'
26 cp -a /workspace/node_modules "$WORK/node_modules"
27fi
29# 4. overlay the dirty workspace state, committed as dev-sync.
30# Skipped when will left uncommitted work, so nothing is clobbered.
31if [ -z "$(git -C "$WORK" status --porcelain)" ]; then
32 rsync -a --delete \
33 --exclude .git --exclude node_modules --exclude .dev \
34 --exclude dist --exclude web/dist --exclude docs/dist --exclude coverage \
35 /workspace/ "$WORK/"
36 git -C "$WORK" add -A
37 git -C "$WORK" -c user.name=dev-sync -c user.email=dev-sync@local \
38 commit -m 'dev-sync: overlay workspace state at boot' --quiet || true
39else
40 echo 'dev: work tree dirty, skipping overlay sync'
41fi
43git -C "$WORK" log --oneline -2
44touch /will-dev/.ready

scripts/dev.mjs

Modified

+6 / −3 text lines

2727│ storage thresholds dev: warn 10% / stop 5% (host fs is ~84% full) │
2828│ model session: fake without a key; ZAI_API_KEY=... mise run dev │
2929│ makes will real (force fake: WILL_SESSION_MODE=fake) │
30│ genome: /workspace (your live checkout); commits local, no push │
30│ genome: will lives in ./.dev/work (clone of ./.dev/origin/will.git │
31│ seeded from your commits + dev-sync overlay of your dirty files).│
32│ will edits/commits/pushes ONLY there. Inspect: cd .dev/work │
33│ your real workspace is never mounted into the agent │
3134│ │
32│ state: named volumes will_service-data / will_agent-data │
33│ reset: podman compose down -v │
35│ state: ./.dev/{origin.git,work,agent,service-data} on your host │
36│ reset: rm -rf .dev && podman compose up -d │
3437│ logs: podman compose logs -f service | agent │
3538│ shell: podman compose exec agent bash │
3639│ podman compose exec service bash │