Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/project-statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,26 +484,26 @@ Profil 2 verwendet Git-getrackte Textdateien und sichtbare Git-Aktivitaet. Die W

| Kennzahl / Metric | Wert / Value |
|---|---:|
| Textbasis / Text base | 287564 lines |
| Textbasis / Text base | 287597 lines |
| Textdateien / Text files | 1694 |
| Beobachtbarer Zeitraum / Observable period | 2026-03-31..2026-07-19 |
| Aktivtage / Active days | 67 |
| Relevante Commits / Relevant commits | 450 |
| Zeilen je Aktivtag / Lines per active day | 4292.0 |
| Relevante Commits / Relevant commits | 453 |
| Zeilen je Aktivtag / Lines per active day | 4292.5 |
| Peak-Tag im Fenster / Peak day in window | 2026-07-08 / 40319 |
| Peak-Woche im Fenster / Peak week in window | 2026-07-05 / 121867 |
| Laengste Serie / Longest streak | 24 days |
| Speedup vs. 80 lines/day | 53.7x |
| Speedup vs. 100 lines/day | 42.9x |
| Methodik / Methodology | v2; source `bae64b8ede3b` |
| Methodik / Methodology | v2; source `c9eb10ac4bcb` |

### Artefaktmix / Artifact Mix

```text
Produktiv / Production [....................] 0.0% | 0
Tests [#...................] 2.3% | 6726
Dokumentation / Documentation [#################...] 83.5% | 240137
Skripte / Scripts [###.................] 13.0% | 37427
Skripte / Scripts [###.................] 13.0% | 37460
Konfiguration / Configuration [#...................] 0.9% | 2643
Daten und Medien / Data and media [....................] 0.0% | 0
Sonstiger Text / Other text [#...................] 0.2% | 631
Expand Down Expand Up @@ -635,7 +635,7 @@ Die Faktoren vergleichen sichtbare Lieferdichte mit den dokumentierten manuellen
Scale: 0..5000 lines/day
Experienced manual [#...................] 80
Thorsten solo [#...................] 100
Visible repository [#################...] 4292.0
Visible repository [#################...] 4292.5
```

Die gemeinsame Skala vergleicht Referenzen und sichtbare Lieferdichte. Sie schreibt die Git-Aktivitaet keiner Person oder KI pauschal zu.
Expand All @@ -661,6 +661,6 @@ DE: Das Fenster beginnt am 2025-07-27 und endet am 2026-07-19. Es enthaelt 67 ak
| 2026-04 | 72825 |
| 2026-05 | 2454 |
| 2026-06 | 49106 |
| 2026-07 | 195025 |
| 2026-07 | 195096 |

<!-- project-statistics-v2:end -->
25 changes: 21 additions & 4 deletions scripts/lib/resolve-home-baseline-source.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
#Requires -Version 7
Set-StrictMode -Version Latest

function Test-HBSourceRepository {
[CmdletBinding()]
param([Parameter(Mandatory)][string]$Path)

if (-not (Test-Path -LiteralPath (Join-Path $Path '.git')) -or
-not (Test-Path -LiteralPath (Join-Path $Path 'scripts/sync-home.ps1'))) {
return $false
}
$remote = & git -C $Path remote get-url origin 2>$null
if ($LASTEXITCODE -ne 0 -or [string]::IsNullOrWhiteSpace([string]$remote)) {
return $false
}
$prefix = & git -C $Path rev-parse --show-prefix 2>$null
$LASTEXITCODE -eq 0 -and
[string]::IsNullOrEmpty([string]$prefix)
}

function Resolve-HBSourceRepository {
[CmdletBinding()]
param(
Expand All @@ -12,9 +29,10 @@ function Resolve-HBSourceRepository {
if (Test-Path -LiteralPath $candidate -PathType Leaf) {
$candidate = Split-Path -Parent $candidate
}
$homeRoot = (Resolve-Path -LiteralPath $HOME).Path
while ($candidate) {
if ((Test-Path -LiteralPath (Join-Path $candidate '.git')) -and
(Test-Path -LiteralPath (Join-Path $candidate 'scripts/sync-home.ps1'))) {
if ([IO.Path]::GetFullPath($candidate) -ne $homeRoot -and
(Test-HBSourceRepository -Path $candidate)) {
return $candidate
}
$parent = Split-Path -Parent $candidate
Expand Down Expand Up @@ -44,8 +62,7 @@ function Resolve-HBSourceRepository {

foreach ($item in $candidates) {
$path = [IO.Path]::GetFullPath([Environment]::ExpandEnvironmentVariables($item.Path))
if ((Test-Path -LiteralPath (Join-Path $path '.git')) -and
(Test-Path -LiteralPath (Join-Path $path 'scripts/sync-home.ps1'))) {
if (Test-HBSourceRepository -Path $path) {
if ($item.Legacy) {
Write-Warning 'Legacy checkout ~/home-baseline-tmp is deprecated; migrate to ~/home-baseline-source.'
}
Expand Down
28 changes: 20 additions & 8 deletions scripts/lib/resolve-home-baseline-source.sh
Original file line number Diff line number Diff line change
@@ -1,41 +1,53 @@
#!/usr/bin/env bash

_is_hb_source_repository() {
local candidate="$1"
local remote root candidate_root
[ -e "$candidate/.git" ] && [ -f "$candidate/scripts/sync-home.sh" ] || return 1
remote="$(git -C "$candidate" remote get-url origin 2>/dev/null)" || return 1
[ -n "$remote" ] || return 1
root="$(git -C "$candidate" rev-parse --show-toplevel 2>/dev/null)" || return 1
candidate_root="$(cd -- "$candidate" && pwd -P)" || return 1
[ "$(cd -- "$root" && pwd -P)" = "$candidate_root" ]
}

resolve_hb_source_repository() {
local start_path="${1:-${BASH_SOURCE[0]}}"
local allow_legacy="${2:-0}"
local candidate state_path configured
local candidate state_path configured home_root

home_root="$(cd -- "$HOME" && pwd -P)"

candidate="$(cd -- "$(dirname -- "$start_path")" 2>/dev/null && pwd -P)" || return 2
while [ "$candidate" != "/" ]; do
if [ -e "$candidate/.git" ] && [ -f "$candidate/scripts/sync-home.sh" ]; then
if [ "$candidate" != "$home_root" ] && _is_hb_source_repository "$candidate"; then
printf '%s\n' "$candidate"
return 0
fi
candidate="$(dirname -- "$candidate")"
done

if [ -n "${HOME_BASELINE_SOURCE:-}" ] &&
[ -e "${HOME_BASELINE_SOURCE}/.git" ] &&
[ -f "${HOME_BASELINE_SOURCE}/scripts/sync-home.sh" ]; then
_is_hb_source_repository "$HOME_BASELINE_SOURCE"; then
(cd -- "$HOME_BASELINE_SOURCE" && pwd -P)
return 0
fi

state_path="${HOME}/.home-baseline/source-repository.json"
if [ -f "$state_path" ] && command -v jq >/dev/null 2>&1; then
configured="$(jq -er '.sourcePath | select(type == "string" and length > 0)' "$state_path" 2>/dev/null || true)"
if [ -n "$configured" ] && [ -e "$configured/.git" ] &&
[ -f "$configured/scripts/sync-home.sh" ]; then
if [ -n "$configured" ] && _is_hb_source_repository "$configured"; then
(cd -- "$configured" && pwd -P)
return 0
fi
fi

if [ -e "${HOME}/home-baseline-source/.git" ]; then
if _is_hb_source_repository "${HOME}/home-baseline-source"; then
(cd -- "${HOME}/home-baseline-source" && pwd -P)
return 0
fi
if [ "$allow_legacy" -eq 1 ] && [ -e "${HOME}/home-baseline-tmp/.git" ]; then
if [ "$allow_legacy" -eq 1 ] &&
_is_hb_source_repository "${HOME}/home-baseline-tmp"; then
printf '%s\n' 'WARN: ~/home-baseline-tmp is deprecated; migrate to ~/home-baseline-source.' >&2
(cd -- "${HOME}/home-baseline-tmp" && pwd -P)
return 0
Expand Down
2 changes: 1 addition & 1 deletion scripts/migrate-level0-source-checkout.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ try {
-OldValue $facts.Root -NewValue $targetPath
Set-HBTextReplacement -Path (Join-Path $HOME '.codex/rules/default.rules') `
-OldValue $facts.Root -NewValue $targetPath
Set-HBJsonProperty -Path (Join-Path $stateDirectory 'sync-state.json') `
Set-HBJsonProperty -Path (Join-Path $stateDirectory 'home-sync-state.json') `
-Name 'sourcePath' -Value $targetPath

if ($Json) { $preview | ConvertTo-Json -Compress } else {
Expand Down
4 changes: 4 additions & 0 deletions scripts/migrate-level0-source-checkout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CHECK_ONLY=0
DRY_RUN=0
FINALIZE=0
JSON=0
YES=0

usage() {
cat <<'USAGE'
Expand All @@ -19,6 +20,7 @@ Verwendung / Usage: migrate-level0-source-checkout.sh [OPTIONEN]
--check-only Vollstaendiger Preflight / complete preflight
--dry-run Migration anzeigen / preview migration
--finalize Alten Kompatibilitaetslink entfernen / remove legacy link
--yes Rueckfrage fuer Schreib-/Finalize-Lauf bestaetigen / confirm write/finalize
--json Maschinenlesbaren Status ausgeben / emit JSON status
--help, -h Hilfe anzeigen / show help
USAGE
Expand All @@ -31,6 +33,7 @@ while [ $# -gt 0 ]; do
--check-only) CHECK_ONLY=1 ;;
--dry-run) DRY_RUN=1 ;;
--finalize) FINALIZE=1 ;;
--yes) YES=1 ;;
--json) JSON=1 ;;
--help|-h) usage; exit 0 ;;
*) printf 'Unknown argument / Unbekanntes Argument: %s\n' "$1" >&2; exit 2 ;;
Expand All @@ -53,4 +56,5 @@ args=(-NoProfile -File "${SCRIPT_DIR}/migrate-level0-source-checkout.ps1" -Targe
[ "$DRY_RUN" -eq 1 ] && args+=(-WhatIf)
[ "$FINALIZE" -eq 1 ] && args+=(-Finalize)
[ "$JSON" -eq 1 ] && args+=(-Json)
[ "$YES" -eq 0 ] || args+=('-Confirm:$false')
exec pwsh "${args[@]}"
Loading