Author SHA1 Message Date
clawbot a268799e97 REPO_POLICIES: Web services
check / check (push) Waiting to run
Merges the WriteTimeout and IdleTimeout items, folds "Never trust
X-Forwarded-For unconditionally" into the sentence on trusted proxies,
and cuts "This list is non-exhaustive", which "without limitation" in
the rule already says; every hardening measure stays.

Model: opus-5-5
2026-11-16 23:51:53 +00:00
clawbot ca24c6b7ff REPO_POLICIES: Formatting
check / check (push) Canceled after 0s
Only a heading: the reorder put the formatter and .editorconfig rules
together, and neither repeats another rule, so no text is cut.

Model: opus-5-5
2026-11-16 23:51:06 +00:00
clawbot a13d1726b6 REPO_POLICIES: .golangci.yml
check / check (push) Canceled after 0s
Only a heading: the paragraph repeats nothing stated elsewhere, so its
words stay as on next.

Model: opus-5-5
2026-11-16 23:50:43 +00:00
clawbot 2bc68d1f1e REPO_POLICIES: .gitignore and .dockerignore
check / check (push) Canceled after 0s
Moves the warning not to copy .gitignore patterns into .dockerignore
next to the .dockerignore rule, splits the two long paragraphs into
lists, and cuts the history "since consuming repos receive the file
and not the tracker"; every pattern rule stays.

Model: opus-5-5
2026-11-16 23:50:06 +00:00
clawbot 64b8139d44 REPO_POLICIES: CI
check / check (push) Canceled after 0s
Splits the one long paragraph into the four workflow settings, what
script/cibuild does, and the separate-workflow rule; merges the two
descriptions of script/cibuild and drops the sentence that names it,
which Entrypoints states; every setting and its reason stays.

Model: opus-5-5
2026-11-16 23:49:10 +00:00
clawbot e80de25c48 REPO_POLICIES: Version
check / check (push) Canceled after 0s
Cuts the fetch-depth sentence, which the CI section states, and moves
the reason ARG VERSION sits in the stage that compiles next to the
sentence saying it has no default; every rule stays.

Model: opus-5-5
2026-11-16 23:48:15 +00:00
clawbot 57d993ca21 REPO_POLICIES: Python test phase
check / check (push) Canceled after 0s
Cuts the Python make test recipe, which repeats the command in
examples/python-test-phase.Dockerfile, and lists how such a target
behaves on a host; drops the no-node sentence, stated under node and
yarn, and the shared-timeout sentence, which the example's comment
states; trims two sentences; every rule stays.

Model: opus-5-5
2026-11-16 23:45:32 +00:00
clawbot e3f3160fad REPO_POLICIES: Canonical Go Dockerfile
check / check (push) Canceled after 0s
Cuts the Go make test recipe, which repeats the command in
examples/go.Dockerfile, and turns its notes into three key points;
drops key points stated elsewhere (the no-op copies and the last
stage under Dockerfile, when Docker installs again under Docker's
cache, the Python layer under the Python section) and "BuildKit runs
stages in parallel"; every rule stays.

Model: opus-5-5
2026-11-16 23:43:40 +00:00
clawbot c166d20195 REPO_POLICIES: Docker's cache
check / check (push) Canceled after 0s
Only a heading: the cache rule from next stays word for word, and
nothing here repeats another section.

Model: opus-5-5
2026-11-16 23:42:06 +00:00
clawbot 99c8e425da REPO_POLICIES: Dockerfile
check / check (push) Canceled after 0s
Cuts history ("Both have produced wrong verdicts"), an example given
for a stated reason (the Go image's toolchain), the tag sentence that
the version snippet's comment states, and the short cache list that
the Go section gives in full; takes in the rule to keep the stage that
ships last, which the Go section's commit removes; every rule stays.

Model: opus-5-5
2026-11-16 23:41:36 +00:00
clawbot e13195dd84 REPO_POLICIES: Pinned tools
check / check (push) Canceled after 0s
The POSIX sh rule joins the list of what the canonical form does, and
two sentences lose filler ("installing into a clean image", "which
then succeeds while no caller sees any change"); each step of the
canonical form and the go install rule stay.

Model: opus-5-5
2026-11-16 23:40:00 +00:00
clawbot 410b9b1621 REPO_POLICIES: node and yarn
check / check (push) Canceled after 0s
States once that a stage with no yarn.lock gets no node and no yarn,
which two paragraphs here said; puts the short lists of yarn settings
and of the files a yarn stage copies inline; joins the two sentences
on Alpine's and Debian's yarn; every setting, file and condition
stays.

Model: opus-5-5
2026-11-16 23:39:10 +00:00
clawbot 81cfb9be83 REPO_POLICIES: script/bootstrap
check / check (push) Canceled after 0s
Merges the two statements that a distribution tool is installed only
when missing into one bullet that also says where such tools come
from; the exact-version rule for other tools is the second bullet;
nothing else was there.

Model: opus-5-5
2026-11-16 23:37:51 +00:00
clawbot 2f9f3dd622 REPO_POLICIES: Tests and checks
check / check (push) Canceled after 0s
States once, under the rerun pattern, that a timed-out first run gets
no rerun and a hung package uses the backstop once, which three rules
each said; splits the timeout rule from the 60-second rule and trims
wording; names the examples that carry the command, and that a
Makefile writes each $ as $$, since the Go and Python recipes go in
their sections' commits; every limit stays.

Model: opus-5-5
2026-11-16 23:37:18 +00:00
clawbot 93de4f1758 REPO_POLICIES: Entrypoints
check / check (push) Canceled after 0s
One list now pairs each required target with its script, and one
lists the three scripts with no required target, absorbing the list
of extensions and the pre-commit hook rule; the README sentence goes,
since the README section requires the same; every target, script and
condition stays.

Model: opus-5-5
2026-11-16 23:36:08 +00:00
clawbot 45c0f997b7 REPO_POLICIES: Git and secrets
check / check (push) Canceled after 0s
Only a heading and a comma before "because" in the build-artifact
exception: the reorder already put these five rules together, and
none is cut.

Model: opus-5-5
2026-11-16 23:34:37 +00:00
clawbot 287ffdf43e REPO_POLICIES: Pin external references by hash
check / check (push) Canceled after 0s
Merges the list of what is pinned with each one's hash, the two
warnings with the untrusted sources, the version comment and the
double-check, and the distribution's tools with what is ruled out;
every item is kept.

Model: opus-5-5
2026-11-16 23:33:53 +00:00
clawbot 4cce747e00 REPO_POLICIES: order the rules by section, moving text only
check / check (push) Canceled after 0s
Moves whole bullets, and whole paragraphs inside them, into the order
of the sections that the next commits add. No line changes:
git show --color-moved shows every changed line as moved, and the
sorted lines of the file are identical before and after.

Paragraphs that later join another section sit under the nearest
bullet until that section's commit.

Model: opus-5-5
2026-11-16 23:31:48 +00:00
clawbot 48c7faf557 REPO_POLICIES: move the example Dockerfiles into examples/
check / check (push) Canceled after 0s
Each fenced dockerfile block moves byte for byte into its own file
under examples/, and one sentence links the file where the block
stood, as sneak ruled at
#159 (comment).
Phrases that pointed at a block by position now name the file, here
and in both checklists. README.md names the folder. No rule changes.

Model: opus-5-5
2026-11-16 23:24:36 +00:00
7 changed files with 670 additions and 743 deletions

No files matched your search

+2 -1
View File
@@ -159,7 +159,8 @@ share, and evolve prompts across projects.
The repository is a collection of Markdown files organized in the `prompts/`
subdirectory. Each file contains one or more related prompts or policy
documents. There is no build step or runtime component; the prompts are consumed
by copying them into other projects or referencing them directly.
by copying them into other projects or referencing them directly. `examples/`
holds the example `Dockerfile` files that `prompts/REPO_POLICIES.md` links to.
## See Also
@@ -0,0 +1,7 @@
FROM golangci/golangci-lint@sha256:... AS lint
RUN apt-get update \
&& apt-get install -y --no-install-recommends libvips-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
+77
View File
@@ -0,0 +1,77 @@
# The steps that install system packages and download Go's modules
# come before COPY . ., so a change to the code keeps their layers.
# The steps that compile mount Go's build cache, and golangci-lint run
# also mounts golangci-lint's; both survive from build to build.
# Lint phase
# golangci/golangci-lint:v2.x.x, YYYY-MM-DD
FROM golangci/golangci-lint@sha256:... AS lint
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/.cache/golangci-lint \
golangci-lint run --config .golangci.yml ./...
# Test phase. -race needs cgo and so a C compiler, which the Debian Go
# image ships and the alpine one does not. -count=1 because the mounted
# cache also holds test results, which go test would otherwise replay.
# A first run that timed out gets no rerun, because a rerun would only
# wait for the same hang.
# golang:1.x, YYYY-MM-DD
FROM golang@sha256:... AS test
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
status=0; \
output=$(go test -count=1 -timeout 90s -race -cover ./... 2>&1) || status=$?; \
printf '%s\n' "$output"; \
test "$status" -eq 0 && exit 0; \
case "$output" in \
*"panic: test timed out"*|*"*** Test killed"*) exit 1 ;; \
esac; \
echo "--- Rerunning with -v for details ---"; \
go test -count=1 -timeout 90s -race -v ./...; \
exit 1
# Build stage. Nothing is wanted from either phase above; the copies
# are what make BuildKit build them first, so nothing after them can
# run unless lint and test passed.
# golang:1.x-alpine, YYYY-MM-DD
FROM golang@sha256:... AS builder
# git comes from the base image's own distribution package index, which
# is trusted, so it needs no version and no hash.
RUN apk add --no-cache git
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY --from=lint /src/go.sum /dev/null
COPY --from=test /src/go.sum /dev/null
# A tar-stream context keeps the sender's file owners, which git refuses.
RUN git config --system --add safe.directory /src
COPY . .
# The VERSION build arg when one is given, otherwise
# `git describe --tags --always` on the .git in the build context. With
# .git present, a version that is still empty, dev or unknown fails the
# build: git is missing or could not read the checkout.
ARG VERSION
RUN --mount=type=cache,target=/root/.cache/go-build \
VERSION="${VERSION:-$(git describe --tags --always)}"; \
if [ -e .git ]; then \
case "$VERSION" in ""|dev|unknown) \
echo "version is '$VERSION' although .git is present" >&2; \
exit 1 ;; \
esac; \
fi; \
CGO_ENABLED=0 go build -trimpath \
-ldflags="-s -w -X main.Version=${VERSION}" \
-o /app ./cmd/app/
# Runtime stage, and the last one
FROM alpine@sha256:...
COPY --from=builder /app /usr/local/bin/app
ENTRYPOINT ["app"]
+23
View File
@@ -0,0 +1,23 @@
# Test phase. Both pytest runs share one 90-second timeout, so a hang
# uses it once and gets no rerun.
# debian:trixie-slim, YYYY-MM-DD
FROM debian@sha256:... AS test
# Python, pip and venv come from the distribution, which is trusted, so
# they need no version and no hash. make and git are base tools that
# script/bootstrap installs when they are missing. Installed here, they
# stay in their own layer when script/ changes.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates make git \
python3 python3-venv \
&& rm -rf /var/lib/apt/lists/*
# script/bootstrap installs pipenv in a virtual environment at
# $HOME/.pipenv, and the tests below run that pipenv.
ENV PATH=/root/.pipenv/bin:$PATH
WORKDIR /app
COPY script/ script/
COPY Pipfile Pipfile.lock ./
RUN script/bootstrap
COPY . .
RUN timeout 90 sh -c 'pipenv run pytest || { \
echo "--- Rerunning with -v for details ---"; \
pipenv run pytest -v; exit 1; }'
+4 -4
View File
@@ -59,8 +59,8 @@ with your task.
also mounts golangci-lint's
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
mounts anything else; both `go test` runs carry `-count=1`; a first run
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
`REPO_POLICIES.md`
that timed out gets no rerun, as in `examples/go.Dockerfile` in the
`prompts` repo
- [ ] Python: a `test` phase that installs its packages from `Pipfile.lock` does
it before `COPY . .`, with `COPY script/ script/`,
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
@@ -79,8 +79,8 @@ with your task.
a package with no wheel for the image stops the install. In that step it
installs no Python, because a step above it already did. `Pipfile` names no
`python_version`, because `--deploy` stops when the distribution's Python
differs from it. The tests run after `COPY . .`, as in the Python `test`
phase example in `REPO_POLICIES.md`
differs from it. The tests run after `COPY . .`, as in
`examples/python-test-phase.Dockerfile` in the `prompts` repo
- [ ] The gate phases invoke their tools directly, never through `make lint` or
`script/test` — those are themselves a `docker build` and would recurse
+4 -4
View File
@@ -125,8 +125,8 @@ Template files can be fetched from:
also mounts golangci-lint's
(`--mount=type=cache,target=/root/.cache/golangci-lint`), and no step
mounts anything else; both `go test` runs carry `-count=1`; a first run
that timed out gets no rerun, as in the canonical Go `Dockerfile` in
`REPO_POLICIES.md`
that timed out gets no rerun, as in `examples/go.Dockerfile` in the
`prompts` repo
- Python: a `test` phase that installs its packages from `Pipfile.lock` does
it before `COPY . .`, with `COPY script/ script/`,
`COPY Pipfile Pipfile.lock ./` and `RUN script/bootstrap`. When
@@ -146,8 +146,8 @@ Template files can be fetched from:
for the image stops the install. In that step it installs no Python,
because a step above it already did. `Pipfile` names no
`python_version`, because `--deploy` stops when the distribution's
Python differs from it. The tests run after `COPY . .`, as in the Python
`test` phase example in `REPO_POLICIES.md`
Python differs from it. The tests run after `COPY . .`, as in
`examples/python-test-phase.Dockerfile` in the `prompts` repo
- Server: the final stage builds and runs the application
- Non-server: the final stage brings up the dev environment
+553 -734
View File
File diff suppressed because it is too large. Load diff