feat(m0): complete scaffold, logging and signature checks (T0.2-T0.6)

Add os.Logger categories, OSSignposter wrapper and shortHash helper; enforce exact Debug/Release/install signatures; lint tests; update M0 docs and progress.
This commit is contained in:
schihei committed 2026-11-26 12:33:51 +01:00
1 parent 374085ec2f
commit 7ca5c710ec
17 files changed
+331 -9

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ Goal: an empty but correctly configured project that builds, tests and launches
| Task | Description | AC | Req |
|---|---|---|---|
| T0.1 | The kit ships `Packages/SprachmittlerKit/Package.swift` with placeholder sources, tests and synthetic fixtures. Verify it resolves and builds; replace placeholder enums as modules gain real types. | `swift build --package-path Packages/SprachmittlerKit` and `make test` succeed; fixture-loading test passes. | R048 |
| T0.2 | Complete the `App/` sources (stubs shipped): `SprachmittlerApp` with a `MenuBarExtra`, `Settings` scene and quit item; `Info.plist` (`LSUIElement`, `NSServices`, ATS local networking); non-sandboxed entitlements. | `make app` builds; the menu-bar icon appears and no Dock icon is shown; `codesign -d --entitlements -` shows exactly `app-sandbox = false`. | R021, R041, R049 |
| T0.2 | Complete the `App/` sources (stubs shipped): `SprachmittlerApp` with a `MenuBarExtra`, `Settings` scene and quit item; `Info.plist` (`LSUIElement`, `NSServices`, ATS local networking); non-sandboxed entitlements. | `make app` builds; the menu-bar icon appears and no Dock icon is shown; the entitlements file contains exactly `app-sandbox = false`. A Debug signature may additionally carry Xcode's injected `get-task-allow`; Release and the `make install` signature must not. `scripts/verify.sh` checks the Debug and Release signatures; `make install` checks the installed one. | R021, R041, R049 |
| T0.3 | Validate the shipped `project.yml` and `make generate`; set your own bundle ID prefix. | `xcodegen generate` produces a project that builds in Xcode and via `xcodebuild`. | R049 |
| T0.4 | Run the shipped `scripts/verify.sh`, `.swiftformat`, `.swiftlint.yml`; fix issues so the gate is green on the scaffold. Add `os.Logger` categories and an `OSSignposter` wrapper in `SprachmittlerCore`. | `make verify` runs end-to-end; logging helper used in a test. | R033, R050 |
| T0.5 | Run `make doctor`: OpenCode 2.x installed, `opencode.json` parses as native V2, agents/commands/skills discovered, `opencode debug config` shows the permission rules. | `make doctor` green; `/status` works in OpenCode. | R048 |
+12 -6
View File
@@ -5,12 +5,12 @@ The agent updates this file at the end of every task: check the box, add the ISO
Legend: `[ ]` open · `[~]` in progress · `[x]` done · `[!]` blocked (explain)
## M0 — Scaffold and tooling
- [ ] T0.1 Package.swift, module placeholders, fixtures load
- [ ] T0.2 App sources, Info.plist, menu-bar stub, entitlements
- [ ] T0.3 project.yml / XcodeGen
- [ ] T0.4 verify script, format/lint, logging + signposts
- [ ] T0.5 OpenCode 2.x doctor
- [ ] T0.6 Environment record and smoke run
- [x] T0.1 Package.swift, module placeholders, fixtures load — 2026-11-26
- [~] T0.2 App sources, Info.plist, menu-bar stub, entitlements — 2026-11-26 · signatures automated; visual menu-bar/Settings/Quit confirmation pending
- [x] T0.3 project.yml / XcodeGen — 2026-11-26
- [x] T0.4 verify script, format/lint, logging + signposts — 2026-11-26
- [~] T0.5 OpenCode 2.x doctor — 2026-11-26 · doctor green; `/status` needs an interactive TUI run
- [x] T0.6 Environment record and smoke run — 2026-11-26
## M1 — Ollama text client
- [ ] T1.1 Capture fixtures, resolve VERIFY items
@@ -94,3 +94,9 @@ Legend: `[ ]` open · `[~]` in progress · `[x]` done · `[!]` blocked (explain)
2026-11-26 · kit · Owner reference run recorded: 255 output tokens, 43.07 tok/s, 5.97 s warm, 177/178 prompt tokens cached.
2026-11-26 · kit · `make smoke` passed with 7B Q4_K_M: 34 output tokens in 2.89 s, 45.81 tok/s, cold load 2.05 s.
2026-11-26 · kit · `make fixtures` captured version, tags, ps, show, en→de, de→en, Markdown, truncated and missing-model fixtures. Digest `262ac792aeb5`.
2026-11-26 · T0.1 · Verified `swift build` and `make test`; the text and Ollama fixture-loading tests pass through `Bundle.module`. Placeholder enums stay until their modules gain real types.
2026-11-26 · T0.2 · Debug + Release builds and signatures pass via `scripts/check-signature.sh`; an install-style re-sign preserves only `app-sandbox=false` plus Hardened Runtime. The app launches as a `UIElement` (no Dock icon); visual menu-bar/Settings/Quit confirmation is still pending.
2026-11-26 · T0.3 · `xcodegen generate` and Debug/Release `xcodebuild` pass; the generated project stays git-ignored. Bundle prefix remains the provisional `de.schihei`.
2026-11-26 · T0.4 · Added the 9 `os.Logger` categories, 8 `OSSignposter` intervals and a 12-hex `shortHash`; contract tests pass. `verify.sh` now lints Tests and checks Debug + Release signatures; `make install` preserves entitlements and Hardened Runtime. Leaf logging seam for M1/M2 is documented; `shortHash` must be logged with `privacy: .private`.
2026-11-26 · T0.5 · `make doctor` green; native V2 config resolves; agents/commands/skills and the `/status` command file are present. `/status` itself still needs one interactive TUI run.
2026-11-26 · T0.6 · `make smoke` with 7B Q4_K_M: 35 output tokens, 0.86 s warm, 46.96 tok/s, URL preserved. Environment table was already filled.
+1
View File
@@ -26,6 +26,7 @@ These are hard requirements. The `swift-reviewer` agent checks every change agai
- App Sandbox: **disabled** (ADR-003), because Accessibility replacement requires it. Hardened Runtime: **enabled**.
- Entitlements are exactly `com.apple.security.app-sandbox = false`. No network entitlement is needed outside the sandbox.
- Xcode may inject `get-task-allow` into a Debug signature for the debugger. Release and the `make install` signature contain only `com.apple.security.app-sandbox = false`; `scripts/verify.sh` and `make install` check the signatures with `scripts/check-signature.sh`, and `scripts/privacy-check.sh` checks the entitlements file.
- No `com.apple.security.cs.allow-unsigned-executable-memory`, `disable-library-validation`, `allow-jit` or other hardened-runtime exceptions.
- ATS: `NSAllowsLocalNetworking = true` only. No `NSAllowsArbitraryLoads`.
- Info.plist: `LSUIElement = true`, `NSServices` for "Translate with Sprachmittler", no microphone/camera/screen/Input Monitoring/Apple Events usage descriptions.