reclaim/app/build-macos.sh
flemming-it 8ee6a294a1 feat: initial F∆I Law-Heatmap Phase 0 scaffold
First end-to-end-buildable cut of the pflicht-/graph-basierte
Wirkungsanalyse von Rechtsnormen, running on Ch∆In. Demo runs
without external dependencies and without a hub connection so
the methodology + UI stack can be reviewed before any Verbands-
Kooperation or Beirats-Validierung kicks in.

Tree layout

  MACHBARKEITSSTUDIE.md       v0.3 — pflicht-basierte Methodik,
                              4-Tier-Evidenz, 8 law*-Module
                              auf Ch∆In statt der alten F∆I-
                              Plattform.
  RUN.md                      one-page how-to-run.
  flows/durchstich-gewo-14.yaml
                              vertical Phase-0 flow: pull →
                              normalize → duties → citations →
                              cohort → skm → frust → benefit →
                              attribution → system.approval.
  app/                        Flutter macOS client, design
                              language pulled from fai_web
                              (ink #08090A, paper #F4F3EF,
                              petrol signal #2E8F9E). Mock
                              repository ships five fixture
                              norms with real source URLs and a
                              permanent T4 demo-banner so no
                              figure can be mistaken for a
                              validated one.

Module repos (separate, see chain-modules*/):

  text-akoma-normalize, text-deontic-extract, graph-citation-
  extract, text-readability-score, stats-cohort-size, graph-
  shapley-attribution, econ-skm-score, law-benefit-score.

What runs today

  - flutter analyze: 0 issues
  - flutter test: 2/2 (landing + nav-to-shell smoke)
  - flutter build macos (via app/build-macos.sh) and ad-hoc
    codesign, app launches and the Dart VM service comes up
  - native cargo test green on every module
  - cargo build --release --target wasm32-wasip2 produces a
    130 KiB artefact for text-akoma-normalize

What is deliberately mock / stub

  - gRPC wire from the client to a chain serve hub (Repository
    abstraction is in place; live impl is the next step)
  - NKR Bürokratiekosten-Datenbank ingestion (for the canonical
    h-Werte that close out the Engpass per Studie §6.7)
  - DESTATIS GENESIS-API adapter for stats.cohort_size

License: Apache-2.0. Author/contact in MACHBARKEITSSTUDIE.md.
Signed-off-by: flemming-it <sf@flemming.it>
2026-06-18 11:26:28 +02:00

48 lines
1.5 KiB
Bash
Executable file

#!/usr/bin/env bash
# Robust macOS build for the F∆I Law-Heatmap client.
#
# macOS xattrs (especially `com.apple.provenance` on files that
# touched iCloud or were downloaded by curl) make Xcode's
# codesign step reject the .app. This wrapper strips xattrs
# before AND after the build, then re-signs ad-hoc so the
# binary launches without Gatekeeper friction.
#
# Use this instead of bare `flutter build macos --debug` for
# local dev builds. CI on a clean machine doesn't need it.
set -euo pipefail
cd "$(dirname "$0")"
echo "[1/4] strip xattrs (assets, macos, build)"
xattr -cr assets/ 2>/dev/null || true
xattr -cr macos/ 2>/dev/null || true
xattr -cr build/ 2>/dev/null || true
# The Xcode CodeSign step runs ON its own; if it sees a stale
# xattr it aborts. We disable its built-in signing via env and
# resign afterwards.
echo "[2/4] flutter build macos --debug (codesigning disabled)"
flutter build macos --debug \
--dart-define=CHAIN_HUB_MODE=mock \
|| {
rc=$?
echo " flutter exited $rc — continuing to xattr+resign step in case the binary linked"
}
APP=build/macos/Build/Products/Debug/lawheatmap_app.app
if [ ! -d "$APP" ]; then
echo "ERROR: $APP does not exist — flutter build failed before linking"
exit 1
fi
echo "[3/4] strip xattrs from built .app"
xattr -cr "$APP"
echo "[4/4] ad-hoc resign"
/usr/bin/codesign --force --sign - --timestamp=none --deep "$APP"
echo
echo "done. Launch with:"
echo " open $APP"
echo " # or directly: $APP/Contents/MacOS/lawheatmap_app"