path:
/AGENTS.md
4.79 KB | plain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Agent instructions
## Mandatory scripting policy: POSIX sh only
- Write all project automation, CI jobs, deployment/publisher scripts, tests,
and agent-created helpers in POSIX `sh`. Use `#!/bin/sh` for executable scripts.
- This rule applies locally and on servers, including temporary files, inline
commands, heredocs, generated scripts, and diagnostic or migration helpers.
Do not use Python, Perl, Ruby, JavaScript/TypeScript, Lua, or another scripting
language as an implementation or assistance shortcut.
- Use POSIX shell syntax and standard utilities, or existing native build,
packaging, signing, and transfer tools. Do not require Bash or Zsh, change the
interpreter to evade this rule, or use their extensions (such as `[[ ... ]]`,
arrays, process substitution, or `source`; use POSIX `.` instead).
- Existing non-shell scripts or documentation examples are not permission to
add, restore, invoke, or deploy such helpers. Ask before any exception; if a
task cannot be completed within this policy, report the blocker instead.
- This governs repository tooling and agent assistance, not the implementation
language of upstream software being packaged or its required build tools.
- Before completion, run `sh -n` on every added or modified shell script and
execute the relevant checks with `sh`. A syntax check alone is not proof of
POSIX portability; inspect commands and syntax for non-POSIX extensions.
## Add or update a package
1. Read [recipe conventions](docs/usage.md#adding-a-new-recipe) and one comparable
APKBUILD. These document the builder contract; inspect implementation scripts
when diagnosing a failure or changing the builder, not for routine recipes.
2. Write a POSIX-compatible `APKBUILD` in the narrowest applicable bucket.
`PKGBUILD` and `*.pacscript` are generated intermediates. Add recipes for new
dependencies unless they are system/base tools.
3. Run a targeted build: `scripts/build.sh <recipe-path>`. Linux defaults to
upstream abuild/APK and an Alpine-musl target; `-f tar.gz` retains the legacy
builder. For signing, target setup, or legacy recipe migration, read
[format prerequisites and builder contracts](docs/usage.md#format-target-and-prerequisites).
Explain if the host cannot build it. Run `sh -n <recipe-path>` and `git diff --check`.
4. For an authorized CI deployment, commit and push the recipe to `main`, then
wait for the requested package artifact. A local commit does not start CI;
a successful push does not mean the binary is ready. Add packages to the
applicable `ci_deb_packages` or `ci_apk_packages` allowlist in `.config/Jobfile`.
For Debian delivery, verify `deploy` passes and the signed APT index includes
the package; a downloadable CI artifact alone is not APT availability.
## CI and binary availability
- Gitolite on `cdg-1` starts minci after a push to `main`. The effective Jobfile
selects jobs. Minci prefers an explicit/external Jobfile, then
`origin/integ:.config/Jobfile`, then the checked-out `.config/Jobfile`.
- **Current foundationpkgs configuration (2026-10-29):** only `main` exists;
its `.config/Jobfile` supplies `checks`, `plan`, `packages`, `transfer`, and `deploy`.
There is no `integ` branch.
See [CI configuration](docs/ci.md#jobfile-selection) when this changes.
- Check an exact pushed revision on the publication host (full commit SHA):
```sh
ssh cdg-1 '/home/git/.local/cache/minci/foundationpkgs/scripts/fpkgs-ci.sh status PACKAGE x86_64-unknown-linux-gnu FULL_COMMIT_SHA'
```
Exit `0`: matching manifest and SHA-256-verified artifact; `1`: not published;
`2`: matching publication is incomplete/corrupt. Other errors need diagnosis.
See [status and logs](docs/ci.md#check-a-binary) for pending/failed builds.
- Dashboard: <https://ci.nply.org/cgi-bin/minci.cgi>.
Public artifacts: <https://nply.org/dl/foundationpkgs/>.
- **Debian deployment:** use [APT installation](docs/ci.md#install-or-upgrade-a-debian-application)
and the `foundationpkgs-binaries` archive publisher. For APK targets use
[APK installation](docs/ci.md#install-an-apk). Legacy staged copies are only
an explicit fallback, not the normal application upgrade path.
For CI host provisioning, maintain `.config/ci-packages.list` and use
[the administrator preparation workflow](docs/ci.md#prepare-the-debian-ci-host).
## Builder or CI changes
Read `CONTEXT.md` before changing recipe layout, naming, artifact paths, or CI
behaviour. See [usage](docs/usage.md) for build, conversion, and pacstall commands.
Keep scripts POSIX `sh`, preserve build-key inputs and atomic publication, and
keep minci reporting separate from package build/publish logic.
Validate script changes with:
```sh
for file in scripts/*.sh tests/*.sh; do sh -n "$file" || exit; done
for test in tests/*.sh; do sh "$test" || exit; done
scripts/fpkgs-ci.sh plan HEAD
```