theslopmachine 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MANUAL.md +21 -6
- package/README.md +55 -7
- package/RELEASE.md +15 -0
- package/assets/agents/developer.md +41 -1
- package/assets/agents/slopmachine-claude.md +100 -60
- package/assets/agents/slopmachine.md +40 -17
- package/assets/claude/agents/developer.md +42 -5
- package/assets/skills/clarification-gate/SKILL.md +25 -5
- package/assets/skills/claude-worker-management/SKILL.md +280 -57
- package/assets/skills/developer-session-lifecycle/SKILL.md +81 -37
- package/assets/skills/development-guidance/SKILL.md +21 -1
- package/assets/skills/evaluation-triage/SKILL.md +32 -23
- package/assets/skills/final-evaluation-orchestration/SKILL.md +86 -50
- package/assets/skills/hardening-gate/SKILL.md +17 -3
- package/assets/skills/integrated-verification/SKILL.md +3 -3
- package/assets/skills/planning-gate/SKILL.md +32 -3
- package/assets/skills/planning-guidance/SKILL.md +72 -13
- package/assets/skills/retrospective-analysis/SKILL.md +2 -2
- package/assets/skills/scaffold-guidance/SKILL.md +129 -124
- package/assets/skills/submission-packaging/SKILL.md +33 -27
- package/assets/skills/verification-gates/SKILL.md +44 -14
- package/assets/slopmachine/backend-evaluation-prompt.md +1 -1
- package/assets/slopmachine/frontend-evaluation-prompt.md +5 -5
- package/assets/slopmachine/scaffold-playbooks/android-kotlin-compose.md +81 -0
- package/assets/slopmachine/scaffold-playbooks/android-kotlin-views.md +191 -0
- package/assets/slopmachine/scaffold-playbooks/android-native-java.md +203 -0
- package/assets/slopmachine/scaffold-playbooks/angular-default.md +181 -0
- package/assets/slopmachine/scaffold-playbooks/backend-baseline.md +142 -0
- package/assets/slopmachine/scaffold-playbooks/backend-family-matrix.md +80 -0
- package/assets/slopmachine/scaffold-playbooks/database-module-matrix.md +80 -0
- package/assets/slopmachine/scaffold-playbooks/django-default.md +166 -0
- package/assets/slopmachine/scaffold-playbooks/docker-baseline.md +189 -0
- package/assets/slopmachine/scaffold-playbooks/docker-shared-contract.md +334 -0
- package/assets/slopmachine/scaffold-playbooks/electron-vite-default.md +124 -0
- package/assets/slopmachine/scaffold-playbooks/expo-react-native-default.md +73 -0
- package/assets/slopmachine/scaffold-playbooks/fastapi-default.md +134 -0
- package/assets/slopmachine/scaffold-playbooks/frontend-baseline.md +160 -0
- package/assets/slopmachine/scaffold-playbooks/frontend-family-matrix.md +134 -0
- package/assets/slopmachine/scaffold-playbooks/generic-unknown-tech-guide.md +136 -0
- package/assets/slopmachine/scaffold-playbooks/go-chi-default.md +160 -0
- package/assets/slopmachine/scaffold-playbooks/ios-linux-portable.md +93 -0
- package/assets/slopmachine/scaffold-playbooks/ios-native-objective-c.md +151 -0
- package/assets/slopmachine/scaffold-playbooks/ios-native-swift.md +188 -0
- package/assets/slopmachine/scaffold-playbooks/laravel-default.md +216 -0
- package/assets/slopmachine/scaffold-playbooks/livewire-default.md +265 -0
- package/assets/slopmachine/scaffold-playbooks/overlay-module-matrix.md +130 -0
- package/assets/slopmachine/scaffold-playbooks/platform-family-matrix.md +79 -0
- package/assets/slopmachine/scaffold-playbooks/selection-matrix.md +72 -0
- package/assets/slopmachine/scaffold-playbooks/spring-boot-default.md +182 -0
- package/assets/slopmachine/scaffold-playbooks/tauri-default.md +80 -0
- package/assets/slopmachine/scaffold-playbooks/vue-vite-default.md +162 -0
- package/assets/slopmachine/scaffold-playbooks/web-default.md +96 -0
- package/assets/slopmachine/templates/AGENTS.md +41 -3
- package/assets/slopmachine/templates/CLAUDE.md +111 -0
- package/assets/slopmachine/utils/claude_create_session.mjs +1 -0
- package/assets/slopmachine/utils/claude_live_channel.mjs +188 -0
- package/assets/slopmachine/utils/claude_live_common.mjs +406 -0
- package/assets/slopmachine/utils/claude_live_hook.py +47 -0
- package/assets/slopmachine/utils/claude_live_launch.mjs +181 -0
- package/assets/slopmachine/utils/claude_live_status.mjs +25 -0
- package/assets/slopmachine/utils/claude_live_stop.mjs +45 -0
- package/assets/slopmachine/utils/claude_live_turn.mjs +250 -0
- package/assets/slopmachine/utils/claude_resume_session.mjs +1 -0
- package/assets/slopmachine/utils/claude_wait_for_rate_limit_reset.mjs +23 -0
- package/assets/slopmachine/utils/claude_wait_for_rate_limit_reset.sh +5 -0
- package/assets/slopmachine/utils/claude_worker_common.mjs +224 -4
- package/assets/slopmachine/utils/cleanup_delivery_artifacts.py +4 -0
- package/assets/slopmachine/utils/export_ai_session.mjs +1 -1
- package/assets/slopmachine/utils/normalize_claude_session.py +153 -0
- package/assets/slopmachine/utils/package_claude_session.mjs +96 -0
- package/assets/slopmachine/utils/prepare_strict_audit_workspace.mjs +65 -0
- package/package.json +1 -1
- package/src/constants.js +42 -3
- package/src/init.js +173 -28
- package/src/install.js +75 -0
- package/src/send-data.js +56 -57
|
@@ -200,7 +200,7 @@ Hard Rules (must follow)
|
|
|
200
200
|
====================
|
|
201
201
|
Output Requirements
|
|
202
202
|
|
|
203
|
-
Produce the final audit in a concise but complete report and write the consolidated report to
|
|
203
|
+
Produce the final audit in a concise but complete report and write the consolidated report to `../.tmp/**.md`.
|
|
204
204
|
|
|
205
205
|
The final report must be organized by the six major acceptance sections in order, even if your scan order was different.
|
|
206
206
|
|
|
@@ -118,8 +118,8 @@ Based on static evidence only, determine whether the delivery is a credible, Pro
|
|
|
118
118
|
- marked Cannot Confirm with a clear boundary explanation
|
|
119
119
|
|
|
120
120
|
5) Exclude Temporary Output
|
|
121
|
-
- Exclude `./.tmp
|
|
122
|
-
- `./.tmp/` must not be used as evidence, search scope, reference, summary source, or factual basis.
|
|
121
|
+
- Exclude `./.tmp/`, `../.tmp/`, and all their subdirectories.
|
|
122
|
+
- `./.tmp/` and `../.tmp/` must not be used as evidence, search scope, reference, summary source, or factual basis.
|
|
123
123
|
|
|
124
124
|
[Pure Frontend-Specific Rules]
|
|
125
125
|
|
|
@@ -277,7 +277,7 @@ Your output must strictly follow this structure:
|
|
|
277
277
|
|
|
278
278
|
2. Scope and Verification Boundary
|
|
279
279
|
- what was reviewed
|
|
280
|
-
- which input sources were excluded, including `./.tmp/`
|
|
280
|
+
- which input sources were excluded, including `./.tmp/` and `../.tmp/`
|
|
281
281
|
- what was not executed
|
|
282
282
|
- what cannot be statically confirmed
|
|
283
283
|
- which conclusions require manual verification
|
|
@@ -388,10 +388,10 @@ Before finalizing the report, check each of the following:
|
|
|
388
388
|
3. Did you wrongly assign backend responsibility to the frontend?
|
|
389
389
|
4. Did you misclassify reasonable mock / local data / storage usage as a defect?
|
|
390
390
|
5. Did you state visual or interaction guesses as strong conclusions?
|
|
391
|
-
6. Does any conclusion directly or indirectly rely on `./.tmp/`?
|
|
391
|
+
6. Does any conclusion directly or indirectly rely on `./.tmp/` or `../.tmp/`?
|
|
392
392
|
7. Have all required Blocker / High dimensions been closed?
|
|
393
393
|
8. Have repeated findings been merged by root cause?
|
|
394
394
|
9. If unsupported observations were removed, would the final Verdict still hold?
|
|
395
395
|
|
|
396
|
-
If writing files is supported, save the final report to
|
|
396
|
+
If writing files is supported, save the final report to `../.tmp/`.
|
|
397
397
|
Otherwise, return the report directly in the conversation.
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Android Kotlin Compose Scaffold Playbook
|
|
2
|
+
|
|
3
|
+
Use this playbook when the prompt explicitly requires native Android with Kotlin + Compose.
|
|
4
|
+
|
|
5
|
+
## Current status
|
|
6
|
+
|
|
7
|
+
This family is now **experimentally verified** for a reasonable Linux Docker baseline.
|
|
8
|
+
|
|
9
|
+
Verified lab:
|
|
10
|
+
|
|
11
|
+
- `/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/android-kotlin-compose-baseline`
|
|
12
|
+
|
|
13
|
+
## What was achieved in the verified lab
|
|
14
|
+
|
|
15
|
+
The verified lab now demonstrates all of the following:
|
|
16
|
+
|
|
17
|
+
- native Kotlin Android project exists
|
|
18
|
+
- Compose is enabled in Gradle
|
|
19
|
+
- pinned Android toolchain Dockerfile exists
|
|
20
|
+
- `docker-compose.yml`, `run_tests.sh`, and artifact-serving scripts exist
|
|
21
|
+
- `artifacts/app-debug.apk` and checksum were produced in the lab tree
|
|
22
|
+
- JVM-side test files exist
|
|
23
|
+
- `docker compose up -d --wait` reached a stable healthy artifact-serving state
|
|
24
|
+
- `./run_tests.sh` passed with containerized lint plus `:app:testDebugUnitTest`
|
|
25
|
+
- the Compose build no longer fails on the broken theme/import issues found during investigation
|
|
26
|
+
|
|
27
|
+
## Safe default stack
|
|
28
|
+
|
|
29
|
+
- AGP `8.5.x`
|
|
30
|
+
- Gradle `8.7`
|
|
31
|
+
- Java `17`
|
|
32
|
+
- Kotlin `1.9.x`
|
|
33
|
+
- `compileSdk = 34`
|
|
34
|
+
- `targetSdk = 34`
|
|
35
|
+
- `minSdk = 29`
|
|
36
|
+
- Compose BOM pinned explicitly
|
|
37
|
+
- Material 3 default Compose surface
|
|
38
|
+
|
|
39
|
+
## Runtime contract
|
|
40
|
+
|
|
41
|
+
- required Docker command: `docker compose up --build`
|
|
42
|
+
- required broad test command: `./run_tests.sh`
|
|
43
|
+
- both are now real and working in the verified lab
|
|
44
|
+
- `./run_app.sh` may exist as a helper, but it does not replace the Docker baseline
|
|
45
|
+
|
|
46
|
+
## Intended Docker strategy
|
|
47
|
+
|
|
48
|
+
This family should follow the same proven Android pattern as the Java/Kotlin-Views baseline:
|
|
49
|
+
|
|
50
|
+
1. pre-bake the Android SDK/toolchain layers into the image
|
|
51
|
+
2. bind-mount the workspace for source changes
|
|
52
|
+
3. avoid default `clean` tasks
|
|
53
|
+
4. use one long-running artifact-serving/support container for the Compose healthy state
|
|
54
|
+
5. reuse that same running container for lint and JVM-side test commands via `docker compose exec`
|
|
55
|
+
|
|
56
|
+
## Honest Linux proof boundary
|
|
57
|
+
|
|
58
|
+
For the verified Linux baseline, Docker honestly proves only:
|
|
59
|
+
|
|
60
|
+
- Compose code compiles
|
|
61
|
+
- debug APK assembles
|
|
62
|
+
- lint passes
|
|
63
|
+
- JVM-side tests pass
|
|
64
|
+
- artifact-serving healthy state works
|
|
65
|
+
|
|
66
|
+
Linux should **not** claim emulator or device runtime proof.
|
|
67
|
+
|
|
68
|
+
## Verified rerun evidence
|
|
69
|
+
|
|
70
|
+
The final rerun established these concrete facts:
|
|
71
|
+
|
|
72
|
+
- direct `:app:assembleDebug --stacktrace` passed after fixing the broken app theme and missing `rememberSaveable` import
|
|
73
|
+
- `./run_tests.sh` passed with the container reaching `Healthy`
|
|
74
|
+
- containerized Gradle verification completed with `BUILD SUCCESSFUL in 1m 32s`
|
|
75
|
+
- the generated APK size was non-zero and published from the artifact server
|
|
76
|
+
|
|
77
|
+
## Guidance
|
|
78
|
+
|
|
79
|
+
- use this family only when the prompt explicitly requires Compose
|
|
80
|
+
- keep it non-default for open-ended Android work because the Java Views baseline is still the lighter generic default
|
|
81
|
+
- it is now safe to treat this family as experimentally verified rather than only partially prepared
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Android Kotlin Views Scaffold Playbook
|
|
2
|
+
|
|
3
|
+
Use this playbook when the prompt explicitly wants native Android with Kotlin and XML/Views rather than Compose.
|
|
4
|
+
|
|
5
|
+
This concrete playbook follows the shared Docker contract in `docker-shared-contract.md` and is grounded in the experimentally verified lab at `/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/android-baseline`.
|
|
6
|
+
|
|
7
|
+
## Goal
|
|
8
|
+
|
|
9
|
+
Create a simple Android Kotlin Views baseline that:
|
|
10
|
+
|
|
11
|
+
- is baseline-only, not feature-complete
|
|
12
|
+
- uses Kotlin plus Android Views, not Compose
|
|
13
|
+
- stays honest about Linux-first Docker verification boundaries
|
|
14
|
+
- keeps `docker compose up --build` as the required runtime/support contract
|
|
15
|
+
- keeps `./run_tests.sh` as the required broad containerized verification path
|
|
16
|
+
- requires no emulator
|
|
17
|
+
|
|
18
|
+
## Runtime contract
|
|
19
|
+
|
|
20
|
+
- required Docker command: `docker compose up --build`
|
|
21
|
+
- required broad test command: `./run_tests.sh`
|
|
22
|
+
- both commands must be real, containerized, and working
|
|
23
|
+
- `./run_app.sh` may exist as a host convenience helper, but it does not replace the required Docker contract
|
|
24
|
+
|
|
25
|
+
## Verified baseline notes
|
|
26
|
+
|
|
27
|
+
From a real lab verification on 2026-04-15:
|
|
28
|
+
|
|
29
|
+
- the verified lab is `/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/android-baseline`
|
|
30
|
+
- the lab uses Kotlin source plus XML Views and ViewBinding
|
|
31
|
+
- `docker compose up --build -d --wait android-baseline` reached a stable healthy state
|
|
32
|
+
- that healthy state is a loopback-only artifact server serving `artifacts/app-debug.apk` on the mapped host port reported by `docker compose port android-baseline 8080`
|
|
33
|
+
- `./run_tests.sh` reused the running Compose container with `docker compose exec` for `:app:lintDebug` and `:app:testDebugUnitTest`, then smoke-checked the served APK
|
|
34
|
+
- the containerized Gradle verification completed successfully without an emulator
|
|
35
|
+
- the truthful proof boundary is pinned toolchain + APK assembly + lint + JVM unit tests + artifact serving; it does **not** claim emulator boot, adb deployment, or on-device runtime proof
|
|
36
|
+
|
|
37
|
+
## Safe pinned defaults used in the verified lab
|
|
38
|
+
|
|
39
|
+
- Android Gradle Plugin: `8.5.2`
|
|
40
|
+
- Gradle wrapper: `8.7`
|
|
41
|
+
- Kotlin Android plugin: `1.9.24`
|
|
42
|
+
- Java: `17`
|
|
43
|
+
- `compileSdk = 34`
|
|
44
|
+
- `targetSdk = 34`
|
|
45
|
+
- `minSdk = 29`
|
|
46
|
+
- view system: XML layouts + Android Views + ViewBinding
|
|
47
|
+
|
|
48
|
+
## Safe default libraries
|
|
49
|
+
|
|
50
|
+
- AppCompat `1.7.0`
|
|
51
|
+
- Material `1.12.0`
|
|
52
|
+
- ConstraintLayout `2.1.4`
|
|
53
|
+
- Lifecycle Runtime `2.8.4`
|
|
54
|
+
- JUnit `4.13.2`
|
|
55
|
+
|
|
56
|
+
Add Room, security, networking, or media libraries only when the prompt actually needs them.
|
|
57
|
+
|
|
58
|
+
## Preferred repo shape
|
|
59
|
+
|
|
60
|
+
- `app/`
|
|
61
|
+
- `container-build-and-serve.sh`
|
|
62
|
+
- `container-gradle.sh`
|
|
63
|
+
- `docker-compose.yml`
|
|
64
|
+
- `Dockerfile`
|
|
65
|
+
- `run_tests.sh`
|
|
66
|
+
- `run_app.sh`
|
|
67
|
+
- `artifacts/` for the built APK and checksum
|
|
68
|
+
|
|
69
|
+
## Docker strategy that was experimentally verified
|
|
70
|
+
|
|
71
|
+
For Android-on-Linux Kotlin Views scaffolds, prefer a pinned toolchain image plus one long-running support container instead of pretending Docker proves native Android runtime.
|
|
72
|
+
|
|
73
|
+
Verified pattern:
|
|
74
|
+
|
|
75
|
+
1. build a pinned Android toolchain image from source in the repo
|
|
76
|
+
2. pre-bake Java 17, Android command-line tools, platform `android-34`, build-tools `34.0.0`, and a seeded Gradle wrapper/plugin cache into the image
|
|
77
|
+
3. bind-mount the workspace at runtime so source edits do not invalidate the heavy SDK layers
|
|
78
|
+
4. start one long-running container that runs `:app:assembleDebug`, copies the APK to `artifacts/`, writes a checksum, and serves that directory over HTTP
|
|
79
|
+
5. expose only one loopback-only host port with an automatic high host-port mapping: `127.0.0.1::8080`
|
|
80
|
+
6. declare health only after the APK exists and the in-container HTTP server returns the APK successfully
|
|
81
|
+
7. reuse that same running container in `./run_tests.sh` with `docker compose exec` so lint/test verification does not rebuild the entire toolchain path again
|
|
82
|
+
|
|
83
|
+
This strategy satisfied the shared contract because `docker compose up --build` reached a meaningful healthy state and reruns avoided repeated SDK bootstrap work.
|
|
84
|
+
|
|
85
|
+
## `./run_tests.sh`
|
|
86
|
+
|
|
87
|
+
`./run_tests.sh` should remain containerized and should prove the portable Android baseline without an emulator:
|
|
88
|
+
|
|
89
|
+
- start the Compose baseline with `docker compose up --build -d --wait`
|
|
90
|
+
- reuse the running container for Gradle verification with `docker compose exec`
|
|
91
|
+
- run at least `:app:lintDebug` and `:app:testDebugUnitTest`
|
|
92
|
+
- smoke-check the same APK artifact surface that `docker compose up --build` claims to provide
|
|
93
|
+
- tear the stack down after verification
|
|
94
|
+
|
|
95
|
+
## Minimal real test floor
|
|
96
|
+
|
|
97
|
+
At scaffold time, include at least:
|
|
98
|
+
|
|
99
|
+
- one real Kotlin helper/rule test
|
|
100
|
+
- one real state/helper test exercised by the Android entrypoint flow
|
|
101
|
+
- real `lint` proof
|
|
102
|
+
- real `assembleDebug` proof
|
|
103
|
+
|
|
104
|
+
Do not leave the baseline test path mostly `NO-SOURCE`.
|
|
105
|
+
|
|
106
|
+
## README floor
|
|
107
|
+
|
|
108
|
+
`README.md` in the scaffold must already state:
|
|
109
|
+
|
|
110
|
+
- that this is a baseline scaffold only
|
|
111
|
+
- Kotlin + Android Views scope
|
|
112
|
+
- required Docker command: `docker compose up --build`
|
|
113
|
+
- required broad test command: `./run_tests.sh`
|
|
114
|
+
- host helper command: `./run_app.sh` when present
|
|
115
|
+
- what healthy state means for the artifact-serving support surface
|
|
116
|
+
- what the Docker path does **not** prove on Linux
|
|
117
|
+
- no `.env` / no hidden secret bootstrap policy
|
|
118
|
+
- any known heavier first-run expectations
|
|
119
|
+
|
|
120
|
+
## Exact commands actually run in the verified lab
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
docker compose build --no-cache
|
|
124
|
+
docker compose up --build -d --wait android-baseline
|
|
125
|
+
docker compose ps
|
|
126
|
+
curl -fsS "http://$(docker compose port android-baseline 8080)/app-debug.apk" -o /tmp/android-kotlin-views-app-debug.apk
|
|
127
|
+
shasum -a 256 artifacts/app-debug.apk
|
|
128
|
+
docker compose down --remove-orphans
|
|
129
|
+
./run_tests.sh
|
|
130
|
+
python3 - <<'PY'
|
|
131
|
+
import signal
|
|
132
|
+
import subprocess
|
|
133
|
+
import time
|
|
134
|
+
from urllib.request import urlopen
|
|
135
|
+
|
|
136
|
+
cwd = "/Users/yohannesakd/code/eaglepoint/demonstration/scaffold-lab/android-baseline"
|
|
137
|
+
proc = subprocess.Popen(["docker", "compose", "up", "--build"], cwd=cwd)
|
|
138
|
+
error = None
|
|
139
|
+
try:
|
|
140
|
+
deadline = time.time() + 600
|
|
141
|
+
while time.time() < deadline:
|
|
142
|
+
try:
|
|
143
|
+
port = subprocess.check_output(["docker", "compose", "port", "android-baseline", "8080"], cwd=cwd, text=True).strip()
|
|
144
|
+
with urlopen(f"http://{port}/app-debug.apk", timeout=5) as response:
|
|
145
|
+
if response.status == 200:
|
|
146
|
+
print("Android Kotlin Views baseline reached artifact-serving healthy state during docker compose up --build")
|
|
147
|
+
break
|
|
148
|
+
except Exception as exc:
|
|
149
|
+
error = exc
|
|
150
|
+
time.sleep(5)
|
|
151
|
+
else:
|
|
152
|
+
raise RuntimeError(f"Android Kotlin Views baseline never became ready: {error}")
|
|
153
|
+
finally:
|
|
154
|
+
proc.send_signal(signal.SIGINT)
|
|
155
|
+
try:
|
|
156
|
+
proc.wait(timeout=30)
|
|
157
|
+
except subprocess.TimeoutExpired:
|
|
158
|
+
proc.kill()
|
|
159
|
+
proc.wait(timeout=30)
|
|
160
|
+
subprocess.run(["docker", "compose", "down", "--remove-orphans"], cwd=cwd, check=True)
|
|
161
|
+
PY
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Observed verification results in the verified lab
|
|
165
|
+
|
|
166
|
+
- `docker compose up --build -d --wait android-baseline`: passed and reported the service healthy
|
|
167
|
+
- `curl -fsS "http://$(docker compose port android-baseline 8080)/app-debug.apk"`: passed and downloaded a non-empty APK
|
|
168
|
+
- `./run_tests.sh`: passed after running containerized lint, JVM unit tests, and the APK smoke check
|
|
169
|
+
- foreground `docker compose up --build`: reached the documented artifact-serving state before controlled shutdown, so it converged honestly instead of hanging indefinitely with no proof
|
|
170
|
+
|
|
171
|
+
## Common pitfalls
|
|
172
|
+
|
|
173
|
+
- defaulting to Compose or emulator requirements when the prompt asks for Views-only baseline work
|
|
174
|
+
- requiring Robolectric or device runtime proof when the truthful Linux Docker baseline does not need it
|
|
175
|
+
- making `docker compose up --build` a one-shot build that exits without a stable healthy state
|
|
176
|
+
- rebuilding the Android SDK on ordinary reruns because the Dockerfile copies the whole source tree before caching the heavy toolchain layers
|
|
177
|
+
- sharing mutable Gradle cache state across multiple concurrent containers when one running container is enough
|
|
178
|
+
- publishing more host ports than the artifact-serving support surface actually needs
|
|
179
|
+
- checking in `.env` or any plaintext secrets even though this baseline does not need them
|
|
180
|
+
|
|
181
|
+
## Acceptance checklist
|
|
182
|
+
|
|
183
|
+
Scaffold is acceptable when:
|
|
184
|
+
|
|
185
|
+
- `docker compose up --build` works and reaches the documented healthy state
|
|
186
|
+
- `./run_tests.sh` works and stays containerized
|
|
187
|
+
- minimal real Kotlin tests exist
|
|
188
|
+
- the Docker path is honest about stopping at APK build/test/artifact proof on Linux
|
|
189
|
+
- README is honest and traceable
|
|
190
|
+
- no `.env` is required or committed
|
|
191
|
+
- the result is experimentally verified, not just theoretically described
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Android Native Java Scaffold Playbook
|
|
2
|
+
|
|
3
|
+
Use this playbook for native Android requests unless the prompt explicitly requires Kotlin, Compose, or a different Android stack.
|
|
4
|
+
|
|
5
|
+
## Goal
|
|
6
|
+
|
|
7
|
+
Create a fast, repeatable Android scaffold that is:
|
|
8
|
+
|
|
9
|
+
- native Android
|
|
10
|
+
- baseline-only, not feature-complete
|
|
11
|
+
- honest about offline/bootstrap/runtime constraints
|
|
12
|
+
- portable broad-testable on Linux with Docker
|
|
13
|
+
- safe by default on secrets and bootstrap data
|
|
14
|
+
|
|
15
|
+
## Runtime contract
|
|
16
|
+
|
|
17
|
+
- required Docker command: `docker compose up --build`
|
|
18
|
+
- required broad test command: `./run_tests.sh`
|
|
19
|
+
- both commands must be real and working
|
|
20
|
+
- `./run_app.sh` may exist as a helper for host-side convenience, but it does not replace the required Docker baseline
|
|
21
|
+
|
|
22
|
+
## Verified baseline notes
|
|
23
|
+
|
|
24
|
+
From a real lab verification on 2026-04-14:
|
|
25
|
+
|
|
26
|
+
- the current Android baseline does converge honestly in Docker without an emulator
|
|
27
|
+
- `docker compose up --build -d --wait` reached a stable healthy state
|
|
28
|
+
- the healthy state was a loopback-only artifact server serving the built APK from `artifacts/app-debug.apk`
|
|
29
|
+
- `./run_tests.sh` reused the running container with `docker compose exec` for `:app:lintDebug` and `:app:testDebugUnitTest`, then smoke-checked the served APK
|
|
30
|
+
- the observed containerized Gradle verification completed successfully with `BUILD SUCCESSFUL in 1m 42s`
|
|
31
|
+
- the current practical proof boundary is: pinned toolchain + APK assembly + lint + JVM unit tests + artifact serving; it does **not** claim emulator or device runtime proof
|
|
32
|
+
- the current Docker strategy is acceptable because the heavy Android SDK/toolchain layers are pre-baked and cached instead of being reinstalled on every rerun
|
|
33
|
+
|
|
34
|
+
## Safe default stack
|
|
35
|
+
|
|
36
|
+
- Android Gradle Plugin: `8.5.x`
|
|
37
|
+
- Gradle wrapper: `8.7`
|
|
38
|
+
- Java: `17`
|
|
39
|
+
- `compileSdk = 34`
|
|
40
|
+
- `targetSdk = 34`
|
|
41
|
+
- `minSdk = 29`
|
|
42
|
+
- Android Views by default unless the prompt explicitly requires Compose
|
|
43
|
+
|
|
44
|
+
## Safe default libraries
|
|
45
|
+
|
|
46
|
+
- AppCompat
|
|
47
|
+
- Material
|
|
48
|
+
- ConstraintLayout
|
|
49
|
+
- Lifecycle
|
|
50
|
+
- Room
|
|
51
|
+
- JUnit
|
|
52
|
+
|
|
53
|
+
Robolectric is **optional**, not mandatory. Use it only when the verified Linux/Docker baseline can run it without extra native-runtime breakage or flaky heavyweight downloads. If that is not true, fall back to JVM tests + lint + assemble and document the proof boundary honestly.
|
|
54
|
+
|
|
55
|
+
Add security/storage libraries only when the prompt or selected baseline actually needs them.
|
|
56
|
+
|
|
57
|
+
## Preferred repo shape
|
|
58
|
+
|
|
59
|
+
- `app/`
|
|
60
|
+
- `core/model/`
|
|
61
|
+
- `core/rules/`
|
|
62
|
+
- `core/data/`
|
|
63
|
+
- `feature/*/`
|
|
64
|
+
|
|
65
|
+
Only add deeper security/media/operator modules during scaffold when the requested technologies already make them necessary.
|
|
66
|
+
|
|
67
|
+
## Required scripts
|
|
68
|
+
|
|
69
|
+
- `./init_db.sh` when the app has database dependencies
|
|
70
|
+
- `docker compose up --build`
|
|
71
|
+
- `./run_tests.sh`
|
|
72
|
+
- `./run_app.sh` when useful for host-side convenience
|
|
73
|
+
|
|
74
|
+
## Bootstrap model
|
|
75
|
+
|
|
76
|
+
- use one bootstrap source of truth
|
|
77
|
+
- no committed plaintext bootstrap credentials
|
|
78
|
+
- no `.env` files
|
|
79
|
+
- if local bootstrap data is needed for dev/test, generate it only under ignored build output
|
|
80
|
+
- if packaged seed data is needed, package only non-sensitive assets
|
|
81
|
+
- app runtime must not contain duplicate hidden seed logic outside the chosen bootstrap path
|
|
82
|
+
|
|
83
|
+
## Room and schema rules
|
|
84
|
+
|
|
85
|
+
- enable `exportSchema = true` when Room is present
|
|
86
|
+
- write schemas to a real repo-visible path such as `app/schemas/`
|
|
87
|
+
- add a real schema verification task when Room is part of the baseline
|
|
88
|
+
- route runtime/test/bootstrap through `./init_db.sh` when database setup exists
|
|
89
|
+
|
|
90
|
+
## Docker runtime baseline
|
|
91
|
+
|
|
92
|
+
For Android-on-Linux scaffolds, prefer a **toolchain image + bind-mounted workspace + stable support surface** instead of pretending Docker proves full device runtime.
|
|
93
|
+
|
|
94
|
+
Recommended baseline shape from real verification:
|
|
95
|
+
|
|
96
|
+
1. build a pinned Android toolchain image once
|
|
97
|
+
2. pre-bake only the heavy reusable layers into that image:
|
|
98
|
+
- Java 17
|
|
99
|
+
- Android command-line tools
|
|
100
|
+
- pinned `compileSdk` platform package
|
|
101
|
+
- pinned build-tools package
|
|
102
|
+
- seeded Gradle wrapper/plugin cache when practical
|
|
103
|
+
3. bind-mount the project source at runtime so source edits do **not** force SDK reinstall layers to rebuild
|
|
104
|
+
4. run `:app:assembleDebug` without `clean`
|
|
105
|
+
5. copy the real APK to a repo-visible `artifacts/` path
|
|
106
|
+
6. keep the Compose stack alive with a lightweight long-running support service such as an artifact HTTP server
|
|
107
|
+
7. expose at most one loopback-only host port when that support surface is published
|
|
108
|
+
|
|
109
|
+
This gives `docker compose up --build` a stable healthy state that is both honest and observable.
|
|
110
|
+
|
|
111
|
+
With the verified lab shape, the Compose command should be treated as acceptable when it:
|
|
112
|
+
|
|
113
|
+
- reaches healthy artifact-serving state predictably
|
|
114
|
+
- avoids SDK reinstall on reruns
|
|
115
|
+
- avoids default `clean` builds
|
|
116
|
+
- keeps the expensive work in image/toolchain layers and one running container rather than bouncing across multiple heavyweight containers
|
|
117
|
+
|
|
118
|
+
Avoid the failed pattern of separate Compose build/test containers sharing one mutable Gradle cache volume by default. That strategy easily produces cache-lock contention and does not improve baseline honesty.
|
|
119
|
+
|
|
120
|
+
If `./run_app.sh` also exists, it should:
|
|
121
|
+
|
|
122
|
+
1. normalize `JAVA_HOME`
|
|
123
|
+
2. detect `ANDROID_HOME` when available
|
|
124
|
+
3. run `./init_db.sh` when relevant
|
|
125
|
+
4. build a debug APK or equivalent baseline artifact
|
|
126
|
+
5. print the artifact path and any non-sensitive local bootstrap output path when useful
|
|
127
|
+
|
|
128
|
+
## `./run_tests.sh`
|
|
129
|
+
|
|
130
|
+
`./run_tests.sh` should be containerized and cover the honest Android broad baseline without requiring an emulator:
|
|
131
|
+
|
|
132
|
+
- lint
|
|
133
|
+
- assemble
|
|
134
|
+
- JVM tests
|
|
135
|
+
- Robolectric tests only when the verified Docker baseline supports them reliably
|
|
136
|
+
- schema verification when Room is used
|
|
137
|
+
|
|
138
|
+
Recommended broad-path execution pattern:
|
|
139
|
+
|
|
140
|
+
1. start the baseline container with `docker compose up --build -d --wait`
|
|
141
|
+
2. reuse that same running container for Gradle verification (`docker compose exec`) so the already-built toolchain state and build outputs are reused
|
|
142
|
+
3. smoke-check the same artifact/support surface that `docker compose up --build` claims to provide
|
|
143
|
+
4. tear the stack down in the script after verification
|
|
144
|
+
|
|
145
|
+
This avoids avoidable second-pass rebuild loops while still proving both the build and the documented Docker contract.
|
|
146
|
+
|
|
147
|
+
## Minimal real test floor
|
|
148
|
+
|
|
149
|
+
At scaffold, include at least:
|
|
150
|
+
|
|
151
|
+
- one real rule/helper test
|
|
152
|
+
- one real Android-side unit or Robolectric test **when the verified Linux baseline supports it reliably**
|
|
153
|
+
- one real build/lint verification path
|
|
154
|
+
- schema verification when Room is used
|
|
155
|
+
|
|
156
|
+
If Android-side host-runtime tests are not stable on the truthful Linux baseline, replace that requirement with:
|
|
157
|
+
|
|
158
|
+
- at least two real scaffold JVM tests tied to shipped Android entrypoint logic
|
|
159
|
+
- real `lint` + `assemble` proof
|
|
160
|
+
- explicit README disclosure that Docker stops short of Robolectric/emulator proof on that baseline
|
|
161
|
+
|
|
162
|
+
Do not leave the broad path mostly `NO-SOURCE`.
|
|
163
|
+
|
|
164
|
+
## README floor
|
|
165
|
+
|
|
166
|
+
`README.md` must already state:
|
|
167
|
+
|
|
168
|
+
- scaffold status versus implemented product scope
|
|
169
|
+
- Android-only scope
|
|
170
|
+
- required Docker command: `docker compose up --build`
|
|
171
|
+
- broad test command: `./run_tests.sh`
|
|
172
|
+
- host-side helper command: `./run_app.sh` when present
|
|
173
|
+
- bootstrap/setup honesty
|
|
174
|
+
- main module map and entry-point traceability
|
|
175
|
+
- what stable healthy state means for the Docker support surface
|
|
176
|
+
- what the Docker path does **not** prove on Linux
|
|
177
|
+
|
|
178
|
+
## Common pitfalls
|
|
179
|
+
|
|
180
|
+
- hardcoded default passwords
|
|
181
|
+
- committed plaintext bootstrap credentials
|
|
182
|
+
- duplicate bootstrap paths in both script and app code
|
|
183
|
+
- unconditional amd64 forcing on arm hosts
|
|
184
|
+
- broad test path with almost no real tests
|
|
185
|
+
- fake emulator/runtime claims
|
|
186
|
+
- `docker compose up --build` that exits immediately after a one-shot build with no stable healthy support surface
|
|
187
|
+
- repeated Gradle or SDK downloads because the Dockerfile copies the entire source tree before caching heavy toolchain layers
|
|
188
|
+
- shared Gradle cache volumes across concurrent containers when a single running container would be enough
|
|
189
|
+
- default `clean` tasks in Docker commands
|
|
190
|
+
- insisting on Robolectric/native host-runtime coverage when it makes the Linux Docker baseline materially less reliable than honest JVM + lint + assemble proof
|
|
191
|
+
|
|
192
|
+
## Acceptance checklist
|
|
193
|
+
|
|
194
|
+
Scaffold is acceptable when:
|
|
195
|
+
|
|
196
|
+
- `docker compose up --build` succeeds
|
|
197
|
+
- `./run_tests.sh` succeeds
|
|
198
|
+
- bootstrap path is single-source and secret-safe
|
|
199
|
+
- schema export and verification are real when relevant
|
|
200
|
+
- README is honest and traceable
|
|
201
|
+
- minimal real scaffold tests exist
|
|
202
|
+
- no plaintext credentials or `.env` artifacts exist in the repo or package
|
|
203
|
+
- the Docker path reaches a stable healthy artifact-serving state in a reasonable amount of time and avoids obvious rebuild loops on reruns
|