@mmerterden/multi-agent-pipeline 20.37.0 → 20.38.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/CHANGELOG.md +123 -49
- package/README.md +12 -10
- package/README.tr.md +12 -10
- package/docs/adr/0006-skills-core-external-split.md +5 -5
- package/docs/adr/0010-own-code-graph.md +6 -7
- package/docs/adr/0013-lsp-code-intelligence.md +6 -8
- package/docs/adr/0017-change-impact-from-the-graph.md +4 -5
- package/docs/adr/0018-cross-repo-links-not-a-global-graph.md +1 -1
- package/docs/adr/README.md +1 -1
- package/docs/ecosystem.md +53 -41
- package/docs/facts.json +15 -13
- package/docs/features.md +2 -2
- package/docs/recovery-guide.md +1 -1
- package/install/_dev-only-files.mjs +3 -0
- package/install/_platform-filter.mjs +1 -23
- package/install/catalog-history.json +1 -1
- package/install/claude.mjs +8 -1
- package/install/codex.mjs +0 -2
- package/install/copilot.mjs +0 -2
- package/install/templates/claude-hooks.json +47 -1
- package/manifest.json +455 -332
- package/package.json +5 -2
- package/pipeline/agents/security-auditor.md +58 -6
- package/pipeline/commands/multi-agent/build-optimize/SKILL.md +1 -2
- package/pipeline/commands/multi-agent/complaint-analysis/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/design-check/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/graph/SKILL.md +12 -3
- package/pipeline/commands/multi-agent/manual-test/SKILL.md +12 -7
- package/pipeline/commands/multi-agent/research/SKILL.md +2 -2
- package/pipeline/commands/multi-agent/search/SKILL.md +10 -1
- package/pipeline/commands/multi-agent/security-review/SKILL.md +4 -0
- package/pipeline/commands/multi-agent/setup/SKILL.md +1 -0
- package/pipeline/commands/multi-agent/stack/SKILL.md +8 -0
- package/pipeline/commands/multi-agent/store-ready/SKILL.md +1 -1
- package/pipeline/commands/sim-test.md +34 -1
- package/pipeline/lib/context-budget.mjs +103 -0
- package/pipeline/lib/credential-inventory.sh +2 -3
- package/pipeline/lib/identifier-scan.mjs +145 -0
- package/pipeline/lib/outbound-gate.mjs +28 -1
- package/pipeline/lib/unattended-profile-check.mjs +13 -4
- package/pipeline/multi-agent-refs/analysis/locked.md +1 -1
- package/pipeline/multi-agent-refs/analysis/redesign.md +17 -3
- package/pipeline/multi-agent-refs/analysis-template-corporate.md +8 -4
- package/pipeline/multi-agent-refs/analysis-template.md +7 -5
- package/pipeline/multi-agent-refs/audit-guide.md +20 -0
- package/pipeline/multi-agent-refs/complaint-analysis/phases.md +1 -0
- package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +1 -1
- package/pipeline/multi-agent-refs/features/code-graph.md +25 -0
- package/pipeline/multi-agent-refs/features/commit-multi-repo.md +63 -0
- package/pipeline/multi-agent-refs/features/design-conformance.md +20 -4
- package/pipeline/multi-agent-refs/features/dev-multi-repo.md +51 -0
- package/pipeline/multi-agent-refs/features/free-models.md +10 -3
- package/pipeline/multi-agent-refs/features/research.md +4 -3
- package/pipeline/multi-agent-refs/features/security-audit.md +25 -3
- package/pipeline/multi-agent-refs/features/test-gap.md +40 -0
- package/pipeline/multi-agent-refs/features/unattended-security.md +20 -0
- package/pipeline/multi-agent-refs/features/worktree-finalize.md +1 -1
- package/pipeline/multi-agent-refs/help/en.md +15 -9
- package/pipeline/multi-agent-refs/help/tr.md +15 -9
- package/pipeline/multi-agent-refs/knowledge.md +17 -0
- package/pipeline/multi-agent-refs/orchestrator/phase-3-user-test.md +12 -9
- package/pipeline/multi-agent-refs/outside-the-pipeline.md +9 -0
- package/pipeline/multi-agent-refs/phases/log-format.md +5 -0
- package/pipeline/multi-agent-refs/phases/operations.md +3 -5
- package/pipeline/multi-agent-refs/phases/phase-1-plan.md +4 -4
- package/pipeline/multi-agent-refs/phases/phase-2-dev.md +8 -47
- package/pipeline/multi-agent-refs/phases/phase-3-review.md +21 -65
- package/pipeline/multi-agent-refs/phases/phase-4-commit.md +9 -59
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +0 -31
- package/pipeline/multi-agent-refs/picker-contract.md +1 -1
- package/pipeline/multi-agent-refs/research/engine.md +2 -1
- package/pipeline/multi-agent-refs/rules.md +1 -1
- package/pipeline/multi-agent-refs/setup/free-models.md +10 -0
- package/pipeline/multi-agent-refs/store-ready/gate-3-policy.md +15 -0
- package/pipeline/multi-agent-refs/web-guide.md +2 -1
- package/pipeline/office/index.html +8 -9
- package/pipeline/office/toolkit.json +1 -1
- package/pipeline/rules/figma-pipeline.md +6 -3
- package/pipeline/rules/outside-the-pipeline.md +1 -1
- package/pipeline/schemas/learnings-ledger.schema.json +7 -2
- package/pipeline/schemas/prefs.schema.json +17 -4
- package/pipeline/schemas/reviewer-output.schema.json +113 -5
- package/pipeline/schemas/secret-patterns.json +49 -0
- package/pipeline/schemas/security-finding.schema.json +49 -5
- package/pipeline/scripts/_code-graph.mjs +3 -3
- package/pipeline/scripts/_graph-analysis.mjs +51 -0
- package/pipeline/scripts/_memory-policy.mjs +37 -7
- package/pipeline/scripts/_secret-scan.mjs +1 -1
- package/pipeline/scripts/_skill-practices.mjs +178 -0
- package/pipeline/scripts/_stack-routing.mjs +1 -0
- package/pipeline/scripts/autopilot-runner.mjs +8 -3
- package/pipeline/scripts/build-stack-plugins.mjs +8 -44
- package/pipeline/scripts/capture-resume.sh +19 -0
- package/pipeline/scripts/checkpoint-fold.sh +59 -0
- package/pipeline/scripts/file-context.mjs +306 -70
- package/pipeline/scripts/gate-ledger.mjs +1 -1
- package/pipeline/scripts/gen-skills-index.mjs +1 -1
- package/pipeline/scripts/graph-hint.mjs +197 -0
- package/pipeline/scripts/graph-hint.sh +20 -0
- package/pipeline/scripts/graph-query.mjs +306 -11
- package/pipeline/scripts/graph-report.mjs +29 -1
- package/pipeline/scripts/learnings-ledger.mjs +71 -15
- package/pipeline/scripts/note-agent-event.mjs +160 -0
- package/pipeline/scripts/note-agent-event.sh +19 -0
- package/pipeline/scripts/office-control.mjs +41 -15
- package/pipeline/scripts/offload-ref.sh +1 -1
- package/pipeline/scripts/parity-score.mjs +139 -0
- package/pipeline/scripts/pre-commit-check.sh +25 -4
- package/pipeline/scripts/pre-push-check.sh +3 -0
- package/pipeline/scripts/repo-recommend.mjs +321 -0
- package/pipeline/scripts/rework-rulings.mjs +5 -3
- package/pipeline/scripts/scan-agent-config.sh +1 -2
- package/pipeline/scripts/scope-check-gate.mjs +15 -2
- package/pipeline/scripts/security-evidence-gate.mjs +282 -0
- package/pipeline/scripts/unattended_policy.py +3 -2
- package/pipeline/scripts/user-test-handoff.sh +203 -0
- package/pipeline/scripts/validate-analysis-doc.mjs +17 -1
- package/pipeline/scripts/validate-planning.mjs +5 -3
- package/pipeline/scripts/validate-triage.mjs +2 -1
- package/pipeline/scripts/write-state.mjs +13 -4
- package/pipeline/skills/.skill-manifest.json +73 -69
- package/pipeline/skills/shared/README.md +41 -40
- package/pipeline/skills/shared/core/apple-archive-compliance/SKILL.md +6 -6
- package/pipeline/skills/shared/core/apple-archive-compliance/references/examples.md +1 -1
- package/pipeline/skills/shared/core/apple-archive-compliance/references/version-history.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/SKILL.md +1 -1
- package/pipeline/skills/shared/core/google-play-compliance/references/notes.md +1 -1
- package/pipeline/skills/shared/core/multi-agent/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-build-optimize/SKILL.md +0 -1
- package/pipeline/skills/shared/core/multi-agent-complaint-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-design-check/SKILL.md +5 -5
- package/pipeline/skills/shared/core/multi-agent-graph/SKILL.md +10 -0
- package/pipeline/skills/shared/core/multi-agent-manual-test/SKILL.md +12 -7
- package/pipeline/skills/shared/core/multi-agent-research/SKILL.md +2 -2
- package/pipeline/skills/shared/core/multi-agent-search/SKILL.md +9 -0
- package/pipeline/skills/shared/core/multi-agent-security-review/SKILL.md +3 -2
- package/pipeline/skills/shared/core/multi-agent-setup/SKILL.md +1 -0
- package/pipeline/skills/shared/core/multi-agent-stack/SKILL.md +8 -0
- package/pipeline/skills/shared/core/multi-agent-store-ready/SKILL.md +4 -3
- package/pipeline/skills/shared/core/multi-agent-test/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-accessibility/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dark-mode/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-dynamic-type/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-gen/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-test-screenshots/SKILL.md +1 -1
- package/pipeline/skills/shared/core/multi-agent-testflight-validation/SKILL.md +2 -2
- package/pipeline/skills/shared/external/accessibility-compliance-accessibility-audit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/agent-introspection-debugging/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/android-architecture/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-architecture/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-build-quality-gates/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-datastore/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-design-tokens-codegen/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-jetpack-compose-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/android-mvi-viewmodel/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/android-performance/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/android-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/android-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/api-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/api-security-best-practices/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/app-store-changelog/SKILL.md +65 -49
- package/pipeline/skills/shared/external/app-store-changelog/evals/evals.json +40 -0
- package/pipeline/skills/shared/external/app-store-changelog/references/release-notes-guidelines.md +64 -34
- package/pipeline/skills/shared/external/app-store-changelog/scripts/collect_release_changes.sh +21 -23
- package/pipeline/skills/shared/external/app-store-optimization/SKILL.md +4 -1
- package/pipeline/skills/shared/external/app-store-review/SKILL.md +6 -0
- package/pipeline/skills/shared/external/architecture/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/backlog/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ci-cd-pipelines/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/clean-code/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/compose-components/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-components/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/compose-navigation/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-navigation/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/compose-testing/SKILL.md +1 -1
- package/pipeline/skills/shared/external/compose-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/context-compression/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/core-data/SKILL.md +1 -1
- package/pipeline/skills/shared/external/council/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/css-modern/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/css-modern/references/code-examples.md +5 -0
- package/pipeline/skills/shared/external/database-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/database-patterns/references/orm-examples.md +5 -0
- package/pipeline/skills/shared/external/debugging-strategies/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/docker-expert/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/e2e-testing/SKILL.md +21 -21
- package/pipeline/skills/shared/external/e2e-testing/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/e2e-testing/references/document-fixtures.md +5 -5
- package/pipeline/skills/shared/external/evidence-github/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/evidence-registry/SKILL.md +1 -1
- package/pipeline/skills/shared/external/evidence-registry/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/fastapi-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/firebase/SKILL.md +132 -54
- package/pipeline/skills/shared/external/firebase/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/firebase/references/functions-and-products.md +51 -0
- package/pipeline/skills/shared/external/firebase/references/security-rules.md +59 -0
- package/pipeline/skills/shared/external/fix-review-verdicts/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/free-llm-apis/SKILL.md +70 -0
- package/pipeline/skills/shared/external/free-llm-apis/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/free-llm-apis/references/providers.md +33 -0
- package/pipeline/skills/shared/external/github-actions-templates/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/SKILL.md +1 -1
- package/pipeline/skills/shared/external/gradle-kotlin-dsl/evals/evals.json +58 -0
- package/pipeline/skills/shared/external/handle-request/SKILL.md +2 -2
- package/pipeline/skills/shared/external/handle-request/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-app-icons/SKILL.md +2 -2
- package/pipeline/skills/shared/external/hig-app-icons/references/icon-workflow.md +1 -1
- package/pipeline/skills/shared/external/hig-components-content/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-status/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-components-system/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/hig-inputs/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/hig-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/hig-platforms/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/hig-technologies/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/html-semantic/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/humanizer/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/ios-coding-standard/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/ios-debugger-agent/SKILL.md +91 -52
- package/pipeline/skills/shared/external/ios-debugger-agent/evals/evals.json +41 -0
- package/pipeline/skills/shared/external/ios-design-review/SKILL.md +12 -12
- package/pipeline/skills/shared/external/ios-design-review/references/appearance-matrix.md +16 -16
- package/pipeline/skills/shared/external/ios-design-review/references/checklist.md +1 -1
- package/pipeline/skills/shared/external/ios-iphone-duo/SKILL.md +0 -1
- package/pipeline/skills/shared/external/ios-module-structure/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/ios-security/SKILL.md +1 -1
- package/pipeline/skills/shared/external/ios-security/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/kotlin-coroutines-expert/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/localization-reuse-map/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/SKILL.md +170 -74
- package/pipeline/skills/shared/external/macos-menubar-tuist-app/evals/evals.json +52 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/SKILL.md +119 -77
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Package.swift +5 -5
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/MyApp.swift +24 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/build_icon.sh +46 -39
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/compile_and_run.sh +70 -49
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/launch.sh +24 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/make_appcast.sh +74 -59
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/package_app.sh +201 -170
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/setup_dev_signing.sh +50 -42
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/sign-and-notarize.sh +65 -35
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/version.env +2 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/packaging.md +49 -17
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/release.md +48 -23
- package/pipeline/skills/shared/external/macos-spm-app-packaging/references/scaffold.md +74 -44
- package/pipeline/skills/shared/external/monorepo-architect/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/nextjs-app-router/SKILL.md +14 -3
- package/pipeline/skills/shared/external/nextjs-app-router/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/nextjs-app-router/references/app-router-examples.md +3 -0
- package/pipeline/skills/shared/external/nodejs-backend-patterns/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/observability-engineer/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/passkit-wallet/SKILL.md +10 -0
- package/pipeline/skills/shared/external/photos-camera-media/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/play-store-review/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/python-patterns/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/react-best-practices/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/rest-api-design/evals/evals.json +46 -0
- package/pipeline/skills/shared/external/retrofit-networking/SKILL.md +1 -1
- package/pipeline/skills/shared/external/retrofit-networking/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/room-database/SKILL.md +1 -1
- package/pipeline/skills/shared/external/room-database/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/scenario-gap-analysis/SKILL.md +1 -1
- package/pipeline/skills/shared/external/scenario-gap-analysis/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/search-first/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/security-review/SKILL.md +14 -3
- package/pipeline/skills/shared/external/security-review/evals/evals.json +48 -0
- package/pipeline/skills/shared/external/security-review/references/agentic-systems.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/firebase-rules.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/graphql.md +82 -0
- package/pipeline/skills/shared/external/security-review/references/llm-prompt-injection.md +93 -0
- package/pipeline/skills/shared/external/security-review/references/oauth-oidc.md +100 -0
- package/pipeline/skills/shared/external/security-review/references/owasp-mobile-top10-2024.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/owasp-web-api-top10-2021.md +1 -1
- package/pipeline/skills/shared/external/security-review/references/supabase.md +73 -0
- package/pipeline/skills/shared/external/signal-community/SKILL.md +29 -10
- package/pipeline/skills/shared/external/signal-community/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/skill-creator/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/skill-creator/template.md +1 -3
- package/pipeline/skills/shared/external/spm-build-analysis/SKILL.md +80 -61
- package/pipeline/skills/shared/external/spm-build-analysis/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/spm-build-analysis/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/spm-build-analysis/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/spm-build-analysis/references/spm-analysis-checks.md +89 -87
- package/pipeline/skills/shared/external/spm-build-analysis/scripts/check_spm_pins.py +90 -85
- package/pipeline/skills/shared/external/swift-concurrency-expert/SKILL.md +78 -69
- package/pipeline/skills/shared/external/swift-concurrency-expert/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/approachable-concurrency.md +52 -48
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swift-6-2-concurrency.md +118 -184
- package/pipeline/skills/shared/external/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +68 -22
- package/pipeline/skills/shared/external/swift-concurrency-pro/SKILL.md +117 -94
- package/pipeline/skills/shared/external/swift-concurrency-pro/evals/evals.json +57 -0
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/actors.md +102 -97
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/async-streams.md +36 -37
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bridging.md +82 -34
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/bug-patterns.md +90 -52
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/cancellation.md +55 -55
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/diagnostics.md +66 -43
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/hotspots.md +39 -23
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/interop.md +66 -68
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/new-features.md +152 -131
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/structured.md +60 -57
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/testing.md +131 -118
- package/pipeline/skills/shared/external/swift-concurrency-pro/references/unstructured.md +37 -29
- package/pipeline/skills/shared/external/swift-formatstyle/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swift-testing-pro/SKILL.md +77 -58
- package/pipeline/skills/shared/external/swift-testing-pro/evals/evals.json +59 -0
- package/pipeline/skills/shared/external/swift-testing-pro/references/async-tests.md +139 -144
- package/pipeline/skills/shared/external/swift-testing-pro/references/core-rules.md +90 -28
- package/pipeline/skills/shared/external/swift-testing-pro/references/migrating-from-xctest.md +38 -21
- package/pipeline/skills/shared/external/swift-testing-pro/references/new-features.md +139 -156
- package/pipeline/skills/shared/external/swift-testing-pro/references/writing-better-tests.md +173 -147
- package/pipeline/skills/shared/external/swiftdata-pro/SKILL.md +75 -59
- package/pipeline/skills/shared/external/swiftdata-pro/evals/evals.json +50 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/cloudkit.md +34 -7
- package/pipeline/skills/shared/external/swiftdata-pro/references/indexing.md +20 -14
- package/pipeline/skills/shared/external/swiftdata-pro/references/inheritance.md +127 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/model-rules.md +141 -0
- package/pipeline/skills/shared/external/swiftdata-pro/references/predicates.md +37 -44
- package/pipeline/skills/shared/external/swiftlint/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/SKILL.md +89 -88
- package/pipeline/skills/shared/external/swiftui-expert-skill/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/accessibility-patterns.md +104 -122
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-advanced.md +73 -93
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-basics.md +144 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/animation-transitions.md +122 -133
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts-accessibility.md +141 -99
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/charts.md +273 -333
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/image-optimization.md +105 -128
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/latest-apis.md +199 -312
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/layout-best-practices.md +129 -169
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/liquid-glass.md +17 -30
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/list-patterns.md +198 -258
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-scenes.md +145 -218
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-views.md +150 -249
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/macos-window-styling.md +109 -208
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/performance-patterns.md +225 -271
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/scroll-patterns.md +117 -210
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/sheet-navigation-patterns.md +171 -237
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/state-management.md +196 -260
- package/pipeline/skills/shared/external/swiftui-expert-skill/references/view-structure.md +167 -230
- package/pipeline/skills/shared/external/swiftui-gestures/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-layout-components/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-navigation/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-navigation/references/navigationstack.md +1 -2
- package/pipeline/skills/shared/external/swiftui-patterns/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/swiftui-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/SKILL.md +71 -79
- package/pipeline/skills/shared/external/swiftui-performance-audit/evals/evals.json +55 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/audit-layout.md +50 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/capture-checklist.md +51 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/hangs.md +34 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/instruments-guide.md +68 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/smell-catalog.md +191 -0
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/update-model.md +69 -0
- package/pipeline/skills/shared/external/swiftui-pro/SKILL.md +65 -63
- package/pipeline/skills/shared/external/swiftui-pro/evals/evals.json +45 -0
- package/pipeline/skills/shared/external/swiftui-pro/references/accessibility.md +40 -13
- package/pipeline/skills/shared/external/swiftui-pro/references/api.md +74 -29
- package/pipeline/skills/shared/external/swiftui-pro/references/data.md +44 -24
- package/pipeline/skills/shared/external/swiftui-pro/references/design.md +45 -31
- package/pipeline/skills/shared/external/swiftui-pro/references/hygiene.md +17 -8
- package/pipeline/skills/shared/external/swiftui-pro/references/navigation.md +19 -9
- package/pipeline/skills/shared/external/swiftui-pro/references/performance.md +50 -34
- package/pipeline/skills/shared/external/swiftui-pro/references/swift.md +73 -45
- package/pipeline/skills/shared/external/swiftui-pro/references/views.md +48 -23
- package/pipeline/skills/shared/external/swiftui-ui-patterns/SKILL.md +89 -83
- package/pipeline/skills/shared/external/swiftui-ui-patterns/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/app-wiring.md +119 -114
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/async-state.md +76 -61
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/components-index.md +63 -46
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/controls.md +32 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/deeplinks.md +49 -38
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/focus.md +77 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/form.md +61 -44
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/grids.md +40 -42
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/input-toolbar.md +44 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/lightweight-clients.md +90 -64
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/list.md +48 -49
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/loading-placeholders.md +36 -25
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/macos-settings.md +30 -30
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/matched-transitions.md +49 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/media.md +49 -41
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/menu-bar.md +52 -48
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/navigationstack.md +119 -104
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/overlay.md +30 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/performance.md +33 -31
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/previews.md +27 -27
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scroll-reveal.md +79 -86
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/scrollview.md +47 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/searchable.md +55 -40
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/sheets.md +113 -84
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/split-views.md +37 -34
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/tabview.md +75 -75
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/theming.md +37 -32
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/title-menus.md +41 -51
- package/pipeline/skills/shared/external/swiftui-ui-patterns/references/top-bar.md +46 -30
- package/pipeline/skills/shared/external/swiftui-uikit-interop/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/SKILL.md +152 -121
- package/pipeline/skills/shared/external/swiftui-view-refactor/evals/evals.json +56 -0
- package/pipeline/skills/shared/external/swiftui-view-refactor/references/mv-patterns.md +107 -98
- package/pipeline/skills/shared/external/swiftui-webkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/tailwind-css/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/test-result-triage/SKILL.md +2 -2
- package/pipeline/skills/shared/external/test-result-triage/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/testing-backend/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/tipkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/typescript-patterns/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/valven-rules/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vision-framework/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/vue-composition/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/weatherkit/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/web-accessibility/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-performance/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/web-testing/SKILL.md +2 -2
- package/pipeline/skills/shared/external/web-testing/evals/evals.json +43 -0
- package/pipeline/skills/shared/external/web-testing/references/testing-examples.md +2 -2
- package/pipeline/skills/shared/external/widgetkit/evals/evals.json +44 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/SKILL.md +61 -55
- package/pipeline/skills/shared/external/xcode-build-benchmark/evals/evals.json +42 -0
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-benchmark/references/benchmarking-workflow.md +39 -47
- package/pipeline/skills/shared/external/xcode-build-benchmark/schemas/build-benchmark.schema.json +72 -154
- package/pipeline/skills/shared/external/xcode-build-benchmark/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-fixer/SKILL.md +145 -139
- package/pipeline/skills/shared/external/xcode-build-fixer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-fixer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-fixer/references/fix-patterns.md +188 -143
- package/pipeline/skills/shared/external/xcode-build-fixer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-fixer/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/SKILL.md +107 -98
- package/pipeline/skills/shared/external/xcode-build-orchestrator/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/benchmark-artifacts.md +69 -67
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/orchestration-report-template.md +81 -69
- package/pipeline/skills/shared/external/xcode-build-orchestrator/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/benchmark_builds.py +207 -245
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-build-orchestrator/scripts/generate_optimization_report.py +355 -480
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/SKILL.md +70 -69
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/code-compilation-checks.md +85 -73
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/skills/shared/external/xcode-compilation-analyzer/scripts/diagnose_compilation.py +155 -210
- package/pipeline/skills/shared/external/xcode-project-analyzer/SKILL.md +54 -52
- package/pipeline/skills/shared/external/xcode-project-analyzer/evals/evals.json +54 -0
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-optimization-sources.md +83 -133
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/build-settings-best-practices.md +81 -175
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/project-audit-checks.md +115 -83
- package/pipeline/skills/shared/external/xcode-project-analyzer/references/recommendation-format.md +41 -40
- package/pipeline/scripts/_notices.mjs +0 -171
- package/pipeline/skills/shared/external/NOTICE-avdlee-swiftui-agent-skill.md +0 -48
- package/pipeline/skills/shared/external/NOTICE-dimillian-skills.md +0 -63
- package/pipeline/skills/shared/external/NOTICE-paul-hudson-skills.md +0 -54
- package/pipeline/skills/shared/external/NOTICE-vibeship-spawner-skills.md +0 -203
- package/pipeline/skills/shared/external/NOTICE-xcode-build-skills.md +0 -60
- package/pipeline/skills/shared/external/ios-iphone-duo/NOTICE.md +0 -53
- package/pipeline/skills/shared/external/macos-spm-app-packaging/assets/templates/bootstrap/Sources/MyApp/main.swift +0 -11
- package/pipeline/skills/shared/external/swiftdata-pro/references/class-inheritance.md +0 -104
- package/pipeline/skills/shared/external/swiftdata-pro/references/core-rules.md +0 -20
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/code-smells.md +0 -158
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +0 -46
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +0 -29
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/profiling-intake.md +0 -44
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/report-template.md +0 -47
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +0 -33
- package/pipeline/skills/shared/external/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +0 -52
|
@@ -1,531 +1,406 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
|
+
"""Render .build-benchmark/optimization-plan.md from the collected artifacts.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
Inputs: a benchmark artifact (required), optionally a diagnostics artifact, a
|
|
5
|
+
recommendations JSON and an .xcodeproj to audit. Without a recommendations file,
|
|
6
|
+
failing build-setting checks become the recommendation list.
|
|
7
|
+
"""
|
|
4
8
|
|
|
5
9
|
import argparse
|
|
6
10
|
import json
|
|
7
11
|
import re
|
|
8
|
-
|
|
12
|
+
import shlex
|
|
9
13
|
from pathlib import Path
|
|
10
|
-
from typing import Any, Dict, List, Optional, Tuple
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def _parse_all_build_configs(pbxproj: str) -> Dict[str, Tuple[str, Dict[str, str]]]:
|
|
28
|
-
"""Return {config_id: (config_name, {key: value})} for every XCBuildConfiguration."""
|
|
29
|
-
configs: Dict[str, Tuple[str, Dict[str, str]]] = {}
|
|
30
|
-
for match in re.finditer(
|
|
31
|
-
r"([0-9A-F]{24})\s*/\*\s*(Debug|Release)\s*\*/\s*=\s*\{\s*"
|
|
32
|
-
r"isa\s*=\s*XCBuildConfiguration;\s*buildSettings\s*=\s*\{([^}]*)\}",
|
|
33
|
-
pbxproj,
|
|
34
|
-
re.DOTALL,
|
|
35
|
-
):
|
|
36
|
-
config_id = match.group(1)
|
|
37
|
-
config_name = match.group(2)
|
|
38
|
-
body = match.group(3)
|
|
39
|
-
settings: Dict[str, str] = {}
|
|
40
|
-
for s in _SETTING_RE.finditer(body):
|
|
41
|
-
val = s.group(2).strip().strip('"')
|
|
42
|
-
settings[s.group(1)] = val
|
|
43
|
-
configs[config_id] = (config_name, settings)
|
|
44
|
-
return configs
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
def _resolve_config_list(
|
|
48
|
-
pbxproj: str, all_configs: Dict[str, Tuple[str, Dict[str, str]]], kind: str
|
|
49
|
-
) -> Dict[str, Dict[str, Dict[str, str]]]:
|
|
50
|
-
"""Resolve configuration lists for a given kind (PBXProject or PBXNativeTarget)."""
|
|
51
|
-
results: Dict[str, Dict[str, Dict[str, str]]] = {}
|
|
52
|
-
for list_match in _CONFIG_LIST_RE.finditer(pbxproj):
|
|
53
|
-
if list_match.group("kind") != kind:
|
|
54
|
-
continue
|
|
55
|
-
entity_name = list_match.group("name")
|
|
56
|
-
list_id = list_match.group(1)
|
|
57
|
-
block_start = pbxproj.find(f"{list_id} /*", list_match.end())
|
|
58
|
-
if block_start == -1:
|
|
59
|
-
block_start = list_match.start()
|
|
60
|
-
block = pbxproj[block_start : block_start + 500]
|
|
61
|
-
configs: Dict[str, Dict[str, str]] = {}
|
|
62
|
-
for cid_match in _CONFIG_ID_RE.finditer(block):
|
|
63
|
-
cid = cid_match.group(1)
|
|
64
|
-
if cid in all_configs:
|
|
65
|
-
cname, settings = all_configs[cid]
|
|
66
|
-
configs[cname] = settings
|
|
67
|
-
if configs:
|
|
68
|
-
results[entity_name] = configs
|
|
69
|
-
return results
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
def _parse_project_level_configs(pbxproj: str) -> Dict[str, Dict[str, str]]:
|
|
73
|
-
"""Extract project-level Debug and Release build settings."""
|
|
74
|
-
all_configs = _parse_all_build_configs(pbxproj)
|
|
75
|
-
resolved = _resolve_config_list(pbxproj, all_configs, "PBXProject")
|
|
76
|
-
if resolved:
|
|
77
|
-
return next(iter(resolved.values()))
|
|
78
|
-
return {}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def _parse_target_configs(pbxproj: str) -> Dict[str, Dict[str, Dict[str, str]]]:
|
|
82
|
-
"""Extract per-target Debug and Release build settings."""
|
|
83
|
-
all_configs = _parse_all_build_configs(pbxproj)
|
|
84
|
-
return _resolve_config_list(pbxproj, all_configs, "PBXNativeTarget")
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
# ---------------------------------------------------------------------------
|
|
88
|
-
# Best-practices audit
|
|
89
|
-
# ---------------------------------------------------------------------------
|
|
90
|
-
|
|
91
|
-
_DEBUG_EXPECTATIONS: List[Tuple[str, str, str]] = [
|
|
92
|
-
("SWIFT_COMPILATION_MODE", "singlefile", "Single-file mode recompiles only changed files (Xcode UI: Incremental)"),
|
|
93
|
-
("SWIFT_OPTIMIZATION_LEVEL", "-Onone", "Optimization passes add compile time without debug benefit"),
|
|
94
|
-
("GCC_OPTIMIZATION_LEVEL", "0", "C/ObjC optimization adds compile time without debug benefit"),
|
|
95
|
-
("ONLY_ACTIVE_ARCH", "YES", "Building all architectures multiplies compile and link time"),
|
|
96
|
-
("DEBUG_INFORMATION_FORMAT", "dwarf", "dwarf-with-dsym generates a separate dSYM, adding overhead"),
|
|
97
|
-
("ENABLE_TESTABILITY", "YES", "Required for @testable import during development"),
|
|
98
|
-
("EAGER_LINKING", "YES", "Allows linker to start before all compilation finishes, reducing wall-clock time"),
|
|
99
|
-
]
|
|
100
|
-
|
|
101
|
-
_GENERAL_EXPECTATIONS: List[Tuple[str, str, str]] = [
|
|
102
|
-
("COMPILATION_CACHE_ENABLE_CACHING", "YES", "Caches compilation results so repeat builds of unchanged inputs are served from cache. Measured 5-14% faster clean builds across tested projects; benefit compounds during branch switching and pulling changes"),
|
|
15
|
+
OBJECT_HEADER = re.compile(r"(?P<id>[0-9A-Fa-f]{24})\s*(?:/\*(?P<note>.*?)\*/)?\s*=\s*\{")
|
|
16
|
+
ASSIGNMENT = re.compile(r'(?:"(?P<qkey>[^"]+)"|(?P<key>[A-Za-z_]\w*))\s*=\s*(?P<value>"(?:[^"\\]|\\.)*"|\([^)]*\)|[^;{}]+?)\s*;')
|
|
17
|
+
LIST_OWNER = re.compile(r'Build configuration list for (?P<kind>PBXProject|PBXNativeTarget) "(?P<name>[^"]+)"')
|
|
18
|
+
ID_REF = re.compile(r"[0-9A-Fa-f]{24}")
|
|
19
|
+
|
|
20
|
+
DEBUG_RULES = [
|
|
21
|
+
("SWIFT_COMPILATION_MODE", "singlefile", "Only edited files recompile in single-file mode (shown as Incremental in Xcode)"),
|
|
22
|
+
("SWIFT_OPTIMIZATION_LEVEL", "-Onone", "Optimizer passes cost compile time and give a debug build nothing"),
|
|
23
|
+
("GCC_OPTIMIZATION_LEVEL", "0", "C and Objective-C optimization costs compile time and gives a debug build nothing"),
|
|
24
|
+
("ONLY_ACTIVE_ARCH", "YES", "Every extra architecture repeats compiling and linking"),
|
|
25
|
+
("DEBUG_INFORMATION_FORMAT", "dwarf", "dwarf-with-dsym adds a separate dSYM step to every build"),
|
|
26
|
+
("ENABLE_TESTABILITY", "YES", "@testable import needs it while developing"),
|
|
27
|
+
("EAGER_LINKING", "YES", "Linking can begin before every compile task is done, which shortens wall-clock time"),
|
|
103
28
|
]
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
("SWIFT_COMPILATION_MODE", "wholemodule", "Whole-module optimization produces faster runtime code"),
|
|
107
|
-
("SWIFT_OPTIMIZATION_LEVEL", "-O", "Optimized binaries for production (-Osize also acceptable)"),
|
|
108
|
-
("GCC_OPTIMIZATION_LEVEL", "s", "Optimizes C/ObjC for size in release"),
|
|
109
|
-
("ONLY_ACTIVE_ARCH", "NO", "Release builds must include all architectures for distribution"),
|
|
110
|
-
("DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", "dSYM bundles are needed for crash symbolication"),
|
|
111
|
-
("ENABLE_TESTABILITY", "NO", "Removes internal-symbol export overhead from release builds"),
|
|
29
|
+
GENERAL_RULES = [
|
|
30
|
+
("COMPILATION_CACHE_ENABLE_CACHING", "YES", "Unchanged inputs are served from the compilation cache; clean builds measured 5-14% faster across tested projects, with more gained on branch switches and pulls"),
|
|
112
31
|
]
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"ONLY_ACTIVE_ARCH",
|
|
118
|
-
"DEBUG_INFORMATION_FORMAT",
|
|
32
|
+
RELEASE_RULES = [
|
|
33
|
+
("SWIFT_COMPILATION_MODE", "wholemodule", "Whole-module optimization yields faster runtime code"),
|
|
34
|
+
("SWIFT_OPTIMIZATION_LEVEL", "-O", "Shipping binaries should be optimized (-Osize is accepted too)"),
|
|
35
|
+
("GCC_OPTIMIZATION_LEVEL", "s", "C and Objective-C are optimized for size in release"),
|
|
36
|
+
("ONLY_ACTIVE_ARCH", "NO", "Distribution needs every supported architecture"),
|
|
37
|
+
("DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym", "Crash symbolication needs the dSYM"),
|
|
38
|
+
("ENABLE_TESTABILITY", "NO", "Release builds should not export internal symbols"),
|
|
119
39
|
]
|
|
40
|
+
DRIFT_KEYS = ["SWIFT_COMPILATION_MODE", "SWIFT_OPTIMIZATION_LEVEL", "ONLY_ACTIVE_ARCH", "DEBUG_INFORMATION_FORMAT"]
|
|
41
|
+
HOTSPOT_ROWS = 30
|
|
42
|
+
PARALLEL_NOTE = (
|
|
43
|
+
"> **Note:** Each row sums task time over every core. Xcode overlaps tasks, "
|
|
44
|
+
"so the rows usually add up to more than the wall-clock medians above, and a "
|
|
45
|
+
"big row is a workload signal, not proof that it holds up the build.\n"
|
|
46
|
+
)
|
|
120
47
|
|
|
121
48
|
|
|
122
|
-
|
|
123
|
-
project
|
|
124
|
-
|
|
125
|
-
|
|
49
|
+
class PbxIndex:
|
|
50
|
+
"""Just enough of a project.pbxproj object graph to resolve build settings."""
|
|
51
|
+
|
|
52
|
+
def __init__(self, text: str):
|
|
53
|
+
self.objects = {}
|
|
54
|
+
for header in OBJECT_HEADER.finditer(text):
|
|
55
|
+
body = self._block(text, header.end() - 1)
|
|
56
|
+
self.objects[header.group("id")] = (header.group("note") or "").strip(), body
|
|
57
|
+
self.text = text
|
|
58
|
+
|
|
59
|
+
@staticmethod
|
|
60
|
+
def _block(text: str, start: int) -> str:
|
|
61
|
+
depth = 0
|
|
62
|
+
for pos in range(start, len(text)):
|
|
63
|
+
ch = text[pos]
|
|
64
|
+
if ch == "{":
|
|
65
|
+
depth += 1
|
|
66
|
+
elif ch == "}":
|
|
67
|
+
depth -= 1
|
|
68
|
+
if depth == 0:
|
|
69
|
+
return text[start + 1 : pos]
|
|
70
|
+
return text[start + 1 :]
|
|
71
|
+
|
|
72
|
+
@staticmethod
|
|
73
|
+
def _assignments(body: str) -> dict:
|
|
74
|
+
out = {}
|
|
75
|
+
for m in ASSIGNMENT.finditer(body):
|
|
76
|
+
value = m.group("value").strip()
|
|
77
|
+
if value.startswith("("):
|
|
78
|
+
value = " ".join(part.strip().strip('"') for part in value[1:-1].split(",") if part.strip())
|
|
79
|
+
out[m.group("qkey") or m.group("key")] = value.strip('"')
|
|
80
|
+
return out
|
|
81
|
+
|
|
82
|
+
def settings_of(self, config_id: str):
|
|
83
|
+
entry = self.objects.get(config_id)
|
|
84
|
+
if not entry or "isa = XCBuildConfiguration" not in entry[1]:
|
|
85
|
+
return None
|
|
86
|
+
body = entry[1]
|
|
87
|
+
start = body.find("buildSettings")
|
|
88
|
+
settings = {}
|
|
89
|
+
if start != -1:
|
|
90
|
+
settings = self._assignments(self._block(body, body.index("{", start)))
|
|
91
|
+
outer = self._assignments(re.sub(r"buildSettings\s*=\s*\{.*?\};", "", body, flags=re.S))
|
|
92
|
+
return outer.get("name", entry[0]), settings
|
|
93
|
+
|
|
94
|
+
def owners(self, kind: str) -> dict:
|
|
95
|
+
resolved = {}
|
|
96
|
+
for list_id, (note, body) in self.objects.items():
|
|
97
|
+
owner = LIST_OWNER.search(note)
|
|
98
|
+
if not owner or owner.group("kind") != kind or "XCConfigurationList" not in body:
|
|
99
|
+
continue
|
|
100
|
+
refs = re.search(r"buildConfigurations\s*=\s*\((?P<ids>[^)]*)\)", body)
|
|
101
|
+
per_config = {}
|
|
102
|
+
for cid in ID_REF.findall(refs.group("ids") if refs else ""):
|
|
103
|
+
found = self.settings_of(cid)
|
|
104
|
+
if found:
|
|
105
|
+
per_config[found[0]] = found[1]
|
|
106
|
+
if per_config:
|
|
107
|
+
resolved[owner.group("name")] = per_config
|
|
108
|
+
return resolved
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def passes(actual, expected: str) -> bool:
|
|
112
|
+
if actual is None:
|
|
113
|
+
return expected == "singlefile"
|
|
114
|
+
actual = actual.strip('"')
|
|
115
|
+
if expected == "-O":
|
|
116
|
+
return actual in ("-O", "-Osize")
|
|
117
|
+
return actual == expected
|
|
126
118
|
|
|
127
119
|
|
|
128
|
-
def
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return False
|
|
133
|
-
if expected == "-O" and actual in ("-O", '"-O"', '"-Osize"', "-Osize"):
|
|
134
|
-
return True
|
|
135
|
-
return actual.strip('"') == expected
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def _merged_project_settings(
|
|
139
|
-
project_configs: Dict[str, Dict[str, str]],
|
|
140
|
-
) -> Dict[str, str]:
|
|
141
|
-
"""Return a flat dict of all settings across Debug and Release for general checks."""
|
|
142
|
-
merged: Dict[str, str] = {}
|
|
143
|
-
for config in project_configs.values():
|
|
144
|
-
merged.update(config)
|
|
120
|
+
def flatten(project: dict) -> dict:
|
|
121
|
+
merged = {}
|
|
122
|
+
for settings in project.values():
|
|
123
|
+
merged.update(settings)
|
|
145
124
|
return merged
|
|
146
125
|
|
|
147
126
|
|
|
148
|
-
def
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
)
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
for
|
|
172
|
-
target_settings = configs.get(config_name, {})
|
|
173
|
-
if key in target_settings:
|
|
174
|
-
proj_val = project_configs.get(config_name, {}).get(key, "(unset)")
|
|
175
|
-
tgt_val = target_settings[key]
|
|
176
|
-
if tgt_val != proj_val:
|
|
177
|
-
overrides.append(
|
|
178
|
-
f"{target_name} ({config_name}): `{tgt_val}` vs project `{proj_val}`"
|
|
179
|
-
)
|
|
180
|
-
if overrides:
|
|
181
|
-
lines.append(f"- [ ] `{key}` has target-level overrides:")
|
|
182
|
-
for o in overrides:
|
|
183
|
-
lines.append(f" - {o}")
|
|
127
|
+
def checklist(settings: dict, rules: list) -> list:
|
|
128
|
+
rows = []
|
|
129
|
+
for key, expected, _ in rules:
|
|
130
|
+
actual = settings.get(key)
|
|
131
|
+
mark = "[x]" if passes(actual, expected) else "[ ]"
|
|
132
|
+
rows.append(f"- {mark} `{key}`: `{actual or '(unset)'}` (recommended: `{expected}`)")
|
|
133
|
+
return rows
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def drift(project: dict, targets: dict) -> list:
|
|
137
|
+
rows = []
|
|
138
|
+
for key in DRIFT_KEYS:
|
|
139
|
+
diffs = []
|
|
140
|
+
for target, configs in targets.items():
|
|
141
|
+
for config in ("Debug", "Release"):
|
|
142
|
+
own = configs.get(config, {})
|
|
143
|
+
if key not in own:
|
|
144
|
+
continue
|
|
145
|
+
inherited = project.get(config, {}).get(key, "(unset)")
|
|
146
|
+
if own[key] != inherited:
|
|
147
|
+
diffs.append(f"{target} ({config}): `{own[key]}` vs project `{inherited}`")
|
|
148
|
+
if diffs:
|
|
149
|
+
rows.append(f"- [ ] `{key}` overridden per target:")
|
|
150
|
+
rows.extend(f" - {d}" for d in diffs)
|
|
184
151
|
else:
|
|
185
|
-
|
|
186
|
-
return
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
# ---------------------------------------------------------------------------
|
|
190
|
-
# Auto-generated recommendations from audit
|
|
191
|
-
# ---------------------------------------------------------------------------
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
def _auto_recommendations_from_audit(
|
|
195
|
-
project_configs: Dict[str, Dict[str, str]],
|
|
196
|
-
) -> Dict[str, Any]:
|
|
197
|
-
"""Generate basic recommendations from failing build settings audit checks."""
|
|
198
|
-
items: List[Dict[str, str]] = []
|
|
199
|
-
|
|
200
|
-
debug_settings = project_configs.get("Debug", {})
|
|
201
|
-
for key, expected, reason in _DEBUG_EXPECTATIONS:
|
|
202
|
-
if not _check(debug_settings.get(key), expected):
|
|
203
|
-
actual = debug_settings.get(key, "(unset)")
|
|
204
|
-
items.append({
|
|
205
|
-
"title": f"Set `{key}` to `{expected}` for Debug",
|
|
206
|
-
"category": "build-settings",
|
|
207
|
-
"observed_evidence": f"Current value: `{actual}`. {reason}.",
|
|
208
|
-
"estimated_impact": "Medium",
|
|
209
|
-
"confidence": "High",
|
|
210
|
-
"risk_level": "Low",
|
|
211
|
-
})
|
|
152
|
+
rows.append(f"- [x] `{key}` same value in every target")
|
|
153
|
+
return rows
|
|
212
154
|
|
|
213
|
-
merged = {}
|
|
214
|
-
for config in project_configs.values():
|
|
215
|
-
merged.update(config)
|
|
216
|
-
for key, expected, reason in _GENERAL_EXPECTATIONS:
|
|
217
|
-
if not _check(merged.get(key), expected):
|
|
218
|
-
actual = merged.get(key, "(unset)")
|
|
219
|
-
items.append({
|
|
220
|
-
"title": f"Enable `{key} = {expected}`",
|
|
221
|
-
"category": "build-settings",
|
|
222
|
-
"observed_evidence": f"Current value: `{actual}`. {reason}.",
|
|
223
|
-
"estimated_impact": "High",
|
|
224
|
-
"confidence": "High",
|
|
225
|
-
"risk_level": "Low",
|
|
226
|
-
})
|
|
227
|
-
|
|
228
|
-
release_settings = project_configs.get("Release", {})
|
|
229
|
-
for key, expected, reason in _RELEASE_EXPECTATIONS:
|
|
230
|
-
if not _check(release_settings.get(key), expected):
|
|
231
|
-
actual = release_settings.get(key, "(unset)")
|
|
232
|
-
items.append({
|
|
233
|
-
"title": f"Set `{key}` to `{expected}` for Release",
|
|
234
|
-
"category": "build-settings",
|
|
235
|
-
"observed_evidence": f"Current value: `{actual}`. {reason}.",
|
|
236
|
-
"estimated_impact": "Medium",
|
|
237
|
-
"confidence": "High",
|
|
238
|
-
"risk_level": "Low",
|
|
239
|
-
})
|
|
240
155
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
# ---------------------------------------------------------------------------
|
|
247
|
-
# Report generation
|
|
248
|
-
# ---------------------------------------------------------------------------
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
def _section_context(benchmark: Dict[str, Any]) -> str:
|
|
252
|
-
build = benchmark.get("build", {})
|
|
253
|
-
env = benchmark.get("environment", {})
|
|
254
|
-
lines = [
|
|
255
|
-
"## Project Context\n",
|
|
256
|
-
f"- **Project:** `{build.get('path', 'unknown')}`",
|
|
257
|
-
f"- **Scheme:** `{build.get('scheme', 'unknown')}`",
|
|
258
|
-
f"- **Configuration:** `{build.get('configuration', 'unknown')}`",
|
|
259
|
-
f"- **Destination:** `{build.get('destination', 'unknown')}`",
|
|
260
|
-
f"- **Xcode:** {env.get('xcode_version', 'unknown').replace(chr(10), ' ')}",
|
|
261
|
-
f"- **macOS:** {env.get('macos_version', 'unknown')}",
|
|
262
|
-
f"- **Date:** {benchmark.get('created_at', 'unknown')}",
|
|
263
|
-
f"- **Benchmark artifact:** `{benchmark.get('_artifact_path', 'unknown')}`",
|
|
156
|
+
def audit_recommendations(project: dict) -> list:
|
|
157
|
+
groups = [
|
|
158
|
+
(project.get("Debug", {}), DEBUG_RULES, "Set `{k}` to `{v}` for Debug", "Medium"),
|
|
159
|
+
(flatten(project), GENERAL_RULES, "Enable `{k} = {v}`", "High"),
|
|
160
|
+
(project.get("Release", {}), RELEASE_RULES, "Set `{k}` to `{v}` for Release", "Medium"),
|
|
264
161
|
]
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
162
|
+
items = []
|
|
163
|
+
for settings, rules, title, impact in groups:
|
|
164
|
+
for key, expected, why in rules:
|
|
165
|
+
if passes(settings.get(key), expected):
|
|
166
|
+
continue
|
|
167
|
+
items.append(
|
|
168
|
+
{
|
|
169
|
+
"title": title.format(k=key, v=expected),
|
|
170
|
+
"category": "build-settings",
|
|
171
|
+
"observed_evidence": f"Current value: `{settings.get(key, '(unset)')}`. {why}.",
|
|
172
|
+
"estimated_impact": impact,
|
|
173
|
+
"confidence": "High",
|
|
174
|
+
"risk_level": "Low",
|
|
175
|
+
}
|
|
176
|
+
)
|
|
177
|
+
return items
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
def context_section(bench: dict, artifact_path: str) -> str:
|
|
181
|
+
build = bench.get("build", {})
|
|
182
|
+
env = bench.get("environment", {})
|
|
183
|
+
xcode = str(env.get("xcode_version", "unknown")).replace("\n", " ")
|
|
184
|
+
facts = [
|
|
185
|
+
("Project", f"`{build.get('path') or 'unknown'}`"),
|
|
186
|
+
("Scheme", f"`{build.get('scheme') or 'unknown'}`"),
|
|
187
|
+
("Configuration", f"`{build.get('configuration') or 'unknown'}`"),
|
|
188
|
+
("Destination", f"`{build.get('destination') or 'scheme default'}`"),
|
|
189
|
+
("Xcode", xcode),
|
|
190
|
+
("macOS", env.get("macos_version") or "unknown"),
|
|
191
|
+
("Measured at", bench.get("created_at") or "unknown"),
|
|
192
|
+
("Benchmark artifact", f"`{artifact_path}`"),
|
|
193
|
+
]
|
|
194
|
+
return "\n".join(["## Project Context\n", "| Field | Value |", "|-------|-------|"] + [f"| {k} | {v} |" for k, v in facts])
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def incremental_label(bench: dict) -> str:
|
|
198
|
+
kinds = {run.get("build_type") for run in bench.get("runs", {}).get("incremental", [])}
|
|
199
|
+
return "Zero-Change" if kinds == {"zero-change"} else "Incremental"
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def baseline_section(bench: dict) -> str:
|
|
203
|
+
summary = bench.get("summary", {})
|
|
204
|
+
phases = ["clean"]
|
|
205
|
+
if summary.get("cached_clean", {}).get("count", 0) > 0:
|
|
206
|
+
phases.append("cached_clean")
|
|
207
|
+
phases.append("incremental")
|
|
208
|
+
names = dict(clean="Clean", cached_clean="Cached Clean")
|
|
209
|
+
names["incremental"] = incremental_label(bench)
|
|
210
|
+
|
|
211
|
+
out = ["## Baseline Benchmarks\n"]
|
|
212
|
+
out.append("| Metric | " + " | ".join(names[p] for p in phases) + " |")
|
|
213
|
+
out.append("|--------|" + "|".join("-" * (len(names[p]) + 2) for p in phases) + "|")
|
|
214
|
+
for label, field, fmt in (
|
|
215
|
+
("Median", "median_seconds", "{:.3f}s"),
|
|
216
|
+
("Min", "min_seconds", "{:.3f}s"),
|
|
217
|
+
("Max", "max_seconds", "{:.3f}s"),
|
|
218
|
+
("Runs", "count", "{}"),
|
|
219
|
+
):
|
|
220
|
+
cells = [fmt.format(summary.get(p, {}).get(field, 0)) for p in phases]
|
|
221
|
+
out.append(f"| {label} | " + " | ".join(cells) + " |")
|
|
222
|
+
if "cached_clean" in phases:
|
|
223
|
+
out.append(
|
|
224
|
+
"\n> **Cached Clean**: DerivedData wiped, compilation cache kept warm. That is "
|
|
225
|
+
"what a branch switch, a pull or Clean Build Folder leaves behind, because the "
|
|
226
|
+
"cache lives outside DerivedData.\n"
|
|
290
227
|
)
|
|
291
|
-
else:
|
|
292
|
-
lines = [
|
|
293
|
-
"## Baseline Benchmarks\n",
|
|
294
|
-
"| Metric | Clean | Incremental |",
|
|
295
|
-
"|--------|-------|-------------|",
|
|
296
|
-
f"| Median | {clean.get('median_seconds', 0):.3f}s | {incremental.get('median_seconds', 0):.3f}s |",
|
|
297
|
-
f"| Min | {clean.get('min_seconds', 0):.3f}s | {incremental.get('min_seconds', 0):.3f}s |",
|
|
298
|
-
f"| Max | {clean.get('max_seconds', 0):.3f}s | {incremental.get('max_seconds', 0):.3f}s |",
|
|
299
|
-
f"| Runs | {clean.get('count', 0)} | {incremental.get('count', 0)} |",
|
|
300
|
-
]
|
|
301
228
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
runs = benchmark.get("runs", {}).get(build_type, [])
|
|
306
|
-
all_cats: Dict[str, Dict] = {}
|
|
229
|
+
for phase in phases:
|
|
230
|
+
runs = bench.get("runs", {}).get(phase, [])
|
|
231
|
+
pooled = {}
|
|
307
232
|
for run in runs:
|
|
308
|
-
for
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
lines.append("\n### General (All Configurations)\n")
|
|
345
|
-
merged = _merged_project_settings(project_configs)
|
|
346
|
-
lines.extend(_audit_config(merged, _GENERAL_EXPECTATIONS, "General"))
|
|
347
|
-
|
|
348
|
-
lines.append("\n### Release Configuration\n")
|
|
349
|
-
lines.extend(_audit_config(project_configs.get("Release", {}), _RELEASE_EXPECTATIONS, "Release"))
|
|
350
|
-
|
|
351
|
-
lines.append("\n### Cross-Target Consistency\n")
|
|
352
|
-
lines.extend(_audit_consistency(project_configs, target_configs))
|
|
353
|
-
|
|
354
|
-
return "\n".join(lines)
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
def _section_diagnostics(diagnostics: Optional[Dict[str, Any]]) -> str:
|
|
358
|
-
if diagnostics is None:
|
|
359
|
-
return "## Compilation Diagnostics\n\nNo diagnostics artifact provided. Run `diagnose_compilation.py` to identify type-checking hotspots."
|
|
360
|
-
warnings = diagnostics.get("warnings", [])
|
|
361
|
-
summary = diagnostics.get("summary", {})
|
|
362
|
-
threshold = diagnostics.get("threshold_ms", 100)
|
|
363
|
-
lines = [
|
|
233
|
+
for row in run.get("timing_summary_categories") or []:
|
|
234
|
+
slot = pooled.setdefault(row["name"], [0.0, 0])
|
|
235
|
+
slot[0] += row["seconds"]
|
|
236
|
+
slot[1] += row.get("task_count", 0)
|
|
237
|
+
if not pooled:
|
|
238
|
+
continue
|
|
239
|
+
divisor = len(runs) or 1
|
|
240
|
+
out.append(f"\n### {names[phase]} Build Timing Summary\n")
|
|
241
|
+
out.append(PARALLEL_NOTE)
|
|
242
|
+
out.append("| Category | Tasks | Seconds |")
|
|
243
|
+
out.append("|----------|------:|--------:|")
|
|
244
|
+
for name, (secs, tasks) in sorted(pooled.items(), key=lambda kv: kv[1][0], reverse=True):
|
|
245
|
+
shown_tasks = tasks // divisor if tasks else ""
|
|
246
|
+
out.append(f"| {name} | {shown_tasks} | {secs / divisor:.3f}s |")
|
|
247
|
+
return "\n".join(out)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def settings_section(project: dict, targets: dict) -> str:
|
|
251
|
+
out = ["## Build Settings Audit\n", "### Debug Configuration\n"]
|
|
252
|
+
out += checklist(project.get("Debug", {}), DEBUG_RULES)
|
|
253
|
+
out += ["\n### General (All Configurations)\n"] + checklist(flatten(project), GENERAL_RULES)
|
|
254
|
+
out += ["\n### Release Configuration\n"] + checklist(project.get("Release", {}), RELEASE_RULES)
|
|
255
|
+
out += ["\n### Cross-Target Consistency\n"] + drift(project, targets)
|
|
256
|
+
return "\n".join(out)
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def diagnostics_section(diag) -> str:
|
|
260
|
+
if diag is None:
|
|
261
|
+
return (
|
|
262
|
+
"## Compilation Diagnostics\n\nSkipped: no diagnostics artifact was passed. "
|
|
263
|
+
"`diagnose_compilation.py` produces one."
|
|
264
|
+
)
|
|
265
|
+
found = diag.get("warnings", [])
|
|
266
|
+
s = diag.get("summary", {})
|
|
267
|
+
out = [
|
|
364
268
|
"## Compilation Diagnostics\n",
|
|
365
|
-
f"Threshold: {
|
|
366
|
-
f"
|
|
367
|
-
f"Function bodies: {summary.get('function_body_warnings', 0)} | "
|
|
368
|
-
f"Expressions: {summary.get('expression_warnings', 0)}\n",
|
|
269
|
+
f"Threshold: {diag.get('threshold_ms', 100)}ms | Total warnings: {s.get('total_warnings', 0)} | "
|
|
270
|
+
f"Function bodies: {s.get('function_body_warnings', 0)} | Expressions: {s.get('expression_warnings', 0)}\n",
|
|
369
271
|
]
|
|
370
|
-
if
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
272
|
+
if not found:
|
|
273
|
+
out.append("Nothing crossed the threshold.")
|
|
274
|
+
return "\n".join(out)
|
|
275
|
+
out += ["| Duration | Kind | File | Line | Name |", "|---------:|------|------|-----:|------|"]
|
|
276
|
+
for w in found[:HOTSPOT_ROWS]:
|
|
277
|
+
label = w.get("name") or "(expression)"
|
|
278
|
+
out.append("| %sms | %s | %s | %s | %s |" % (w["duration_ms"], w["kind"], Path(w["file"]).name, w["line"], label))
|
|
279
|
+
if len(found) > HOTSPOT_ROWS:
|
|
280
|
+
out.append(f"\n*... and {len(found) - HOTSPOT_ROWS} more warnings (see full artifact)*")
|
|
281
|
+
return "\n".join(out)
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
FIELD_LABELS = [
|
|
285
|
+
("wait_time_impact", "Wait-Time Impact"),
|
|
286
|
+
("actionability", "Actionability"),
|
|
287
|
+
("category", "Category"),
|
|
288
|
+
("observed_evidence", "Evidence"),
|
|
289
|
+
("estimated_impact", "Impact"),
|
|
290
|
+
("confidence", "Confidence"),
|
|
291
|
+
("risk_level", "Risk"),
|
|
292
|
+
("scope", "Scope"),
|
|
293
|
+
]
|
|
384
294
|
|
|
385
295
|
|
|
386
|
-
def
|
|
387
|
-
if
|
|
388
|
-
return "## Prioritized Recommendations\n\
|
|
389
|
-
items = recommendations.get("recommendations", [])
|
|
296
|
+
def recommendations_section(items) -> str:
|
|
297
|
+
if items is None:
|
|
298
|
+
return "## Prioritized Recommendations\n\nNone yet: no recommendations file and no failing settings check."
|
|
390
299
|
if not items:
|
|
391
|
-
return "## Prioritized Recommendations\n\
|
|
392
|
-
|
|
393
|
-
for
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
("actionability", "Actionability"),
|
|
399
|
-
("category", "Category"),
|
|
400
|
-
("observed_evidence", "Evidence"),
|
|
401
|
-
("estimated_impact", "Impact"),
|
|
402
|
-
("confidence", "Confidence"),
|
|
403
|
-
("risk_level", "Risk"),
|
|
404
|
-
("scope", "Scope"),
|
|
405
|
-
]:
|
|
406
|
-
val = item.get(field)
|
|
407
|
-
if val is None:
|
|
300
|
+
return "## Prioritized Recommendations\n\nThe recommendations file is empty."
|
|
301
|
+
out = ["## Prioritized Recommendations\n"]
|
|
302
|
+
for n, item in enumerate(items, 1):
|
|
303
|
+
out.append(f"### {n}. {item.get('title', 'Untitled')}\n")
|
|
304
|
+
for field, label in FIELD_LABELS:
|
|
305
|
+
value = item.get(field)
|
|
306
|
+
if value is None:
|
|
408
307
|
continue
|
|
409
|
-
if isinstance(
|
|
410
|
-
|
|
411
|
-
for entry in
|
|
412
|
-
lines.append(f"- {entry}")
|
|
308
|
+
if isinstance(value, list):
|
|
309
|
+
out.append(f"**{label}:**")
|
|
310
|
+
out.extend(f"- {entry}" for entry in value)
|
|
413
311
|
else:
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
return "\n".join(
|
|
312
|
+
out.append(f"**{label}:** {value}")
|
|
313
|
+
out.append("")
|
|
314
|
+
return "\n".join(out)
|
|
417
315
|
|
|
418
316
|
|
|
419
|
-
def
|
|
420
|
-
if recommendations is None:
|
|
421
|
-
return "## Approval Checklist\n\nNo recommendations to approve."
|
|
422
|
-
items = recommendations.get("recommendations", [])
|
|
317
|
+
def approval_section(items) -> str:
|
|
423
318
|
if not items:
|
|
424
|
-
return "## Approval Checklist\n\
|
|
425
|
-
|
|
426
|
-
for
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
"
|
|
443
|
-
"After implementing approved changes, re-benchmark with the same inputs:\n",
|
|
444
|
-
"```bash",
|
|
445
|
-
f"python3 scripts/benchmark_builds.py \\",
|
|
319
|
+
return "## Approval Checklist\n\nNothing awaits approval."
|
|
320
|
+
out = ["## Approval Checklist\n"]
|
|
321
|
+
for n, item in enumerate(items, 1):
|
|
322
|
+
wait = item.get("wait_time_impact")
|
|
323
|
+
impact = f"Wait-Time Impact: {wait}" if wait else f"Impact: {item.get('estimated_impact', '')}"
|
|
324
|
+
action = f" | Actionability: {item['actionability']}" if item.get("actionability") else ""
|
|
325
|
+
out.append(f"- [ ] **{n}. {item.get('title', 'Untitled')}** -- {impact}{action} | Risk: {item.get('risk_level', '')}")
|
|
326
|
+
return "\n".join(out)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def next_steps_section(bench: dict) -> str:
|
|
330
|
+
build = bench.get("build", {})
|
|
331
|
+
flag = "--workspace" if build.get("entrypoint") == "workspace" else "--project"
|
|
332
|
+
fallback = "App.xcworkspace" if flag == "--workspace" else "App.xcodeproj"
|
|
333
|
+
cmd = [
|
|
334
|
+
"python3 scripts/benchmark_builds.py \\",
|
|
335
|
+
f" {flag} {shlex.quote(build.get('path') or fallback)} \\",
|
|
336
|
+
f" --scheme {shlex.quote(build.get('scheme') or 'App')} \\",
|
|
337
|
+
f" --configuration {shlex.quote(build.get('configuration') or 'Debug')} \\",
|
|
446
338
|
]
|
|
447
|
-
if build.get("entrypoint") == "workspace":
|
|
448
|
-
lines.append(f" --workspace {build.get('path', 'App.xcworkspace')} \\")
|
|
449
|
-
else:
|
|
450
|
-
lines.append(f" --project {build.get('path', 'App.xcodeproj')} \\")
|
|
451
|
-
lines.extend([
|
|
452
|
-
f" --scheme {build.get('scheme', 'App')} \\",
|
|
453
|
-
f" --configuration {build.get('configuration', 'Debug')} \\",
|
|
454
|
-
])
|
|
455
339
|
if build.get("destination"):
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
return "\n".join(
|
|
340
|
+
cmd.append(f' --destination "{build["destination"]}" \\')
|
|
341
|
+
for note in bench.get("notes") or []:
|
|
342
|
+
if note.startswith("touch-file: "):
|
|
343
|
+
cmd.append(f" --touch-file {shlex.quote(note[len('touch-file: '):])} \\")
|
|
344
|
+
cmd.append(" --output-dir .build-benchmark")
|
|
345
|
+
return "\n".join(
|
|
346
|
+
["## Next Steps\n", "Once the approved items are in, rerun the benchmark with identical inputs:\n", "```bash"]
|
|
347
|
+
+ cmd
|
|
348
|
+
+ [
|
|
349
|
+
"```\n",
|
|
350
|
+
"Set the new wall-clock medians against this baseline and lead with one sentence per build type:",
|
|
351
|
+
'"[Clean/Incremental] build: X.Xs now, Y.Ys before (Z.Zs faster/slower)."',
|
|
352
|
+
]
|
|
353
|
+
)
|
|
462
354
|
|
|
463
355
|
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
356
|
+
def build_cli() -> argparse.ArgumentParser:
|
|
357
|
+
cli = argparse.ArgumentParser(description="Write the Markdown build optimization plan.")
|
|
358
|
+
cli.add_argument("--benchmark", required=True, help="benchmark JSON artifact")
|
|
359
|
+
cli.add_argument("--recommendations", help="recommendations JSON (recommendation-format shape)")
|
|
360
|
+
cli.add_argument("--diagnostics", help="diagnostics JSON from diagnose_compilation.py")
|
|
361
|
+
cli.add_argument("--project-path", help=".xcodeproj to audit for build settings")
|
|
362
|
+
cli.add_argument("--output", help="Markdown destination (default: stdout)")
|
|
363
|
+
return cli
|
|
467
364
|
|
|
468
365
|
|
|
469
|
-
def
|
|
470
|
-
|
|
471
|
-
parser.add_argument("--benchmark", required=True, help="Path to benchmark JSON artifact")
|
|
472
|
-
parser.add_argument("--recommendations", help="Path to recommendations JSON")
|
|
473
|
-
parser.add_argument("--diagnostics", help="Path to diagnostics JSON")
|
|
474
|
-
parser.add_argument("--project-path", help="Path to .xcodeproj for build settings audit")
|
|
475
|
-
parser.add_argument("--output", help="Output Markdown path (default: stdout)")
|
|
476
|
-
return parser.parse_args()
|
|
366
|
+
def load(path):
|
|
367
|
+
return json.loads(Path(path).read_text()) if path else None
|
|
477
368
|
|
|
478
369
|
|
|
479
370
|
def main() -> int:
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
recommendations = auto
|
|
506
|
-
|
|
507
|
-
sections = [
|
|
508
|
-
"# Xcode Build Optimization Plan\n",
|
|
509
|
-
_section_context(benchmark),
|
|
510
|
-
_section_baseline(benchmark),
|
|
371
|
+
opts = build_cli().parse_args()
|
|
372
|
+
bench = load(opts.benchmark)
|
|
373
|
+
diag = load(opts.diagnostics)
|
|
374
|
+
recs = load(opts.recommendations)
|
|
375
|
+
items = recs.get("recommendations", []) if recs is not None else None
|
|
376
|
+
|
|
377
|
+
project, targets = {}, {}
|
|
378
|
+
if opts.project_path:
|
|
379
|
+
pbx = Path(opts.project_path) / "project.pbxproj"
|
|
380
|
+
if pbx.exists():
|
|
381
|
+
index = PbxIndex(pbx.read_text())
|
|
382
|
+
project = next(iter(index.owners("PBXProject").values()), {})
|
|
383
|
+
targets = index.owners("PBXNativeTarget")
|
|
384
|
+
|
|
385
|
+
if items is None and project:
|
|
386
|
+
items = audit_recommendations(project) or None
|
|
387
|
+
|
|
388
|
+
parts = ["# Xcode Build Optimization Plan\n", context_section(bench, opts.benchmark), baseline_section(bench)]
|
|
389
|
+
if project:
|
|
390
|
+
parts.append(settings_section(project, targets))
|
|
391
|
+
parts += [
|
|
392
|
+
diagnostics_section(diag),
|
|
393
|
+
recommendations_section(items),
|
|
394
|
+
approval_section(items),
|
|
395
|
+
next_steps_section(bench),
|
|
511
396
|
]
|
|
397
|
+
report = "\n\n".join(parts) + "\n"
|
|
512
398
|
|
|
513
|
-
if
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
sections.append(_section_diagnostics(diagnostics))
|
|
517
|
-
sections.append(_section_recommendations(recommendations))
|
|
518
|
-
sections.append(_section_approval(recommendations))
|
|
519
|
-
sections.append(_section_next_steps(benchmark))
|
|
520
|
-
|
|
521
|
-
report = "\n\n".join(sections) + "\n"
|
|
522
|
-
|
|
523
|
-
if args.output:
|
|
524
|
-
Path(args.output).write_text(report)
|
|
525
|
-
print(f"Saved optimization report: {args.output}")
|
|
399
|
+
if opts.output:
|
|
400
|
+
Path(opts.output).write_text(report)
|
|
401
|
+
print(f"Saved optimization report: {opts.output}")
|
|
526
402
|
else:
|
|
527
403
|
print(report, end="")
|
|
528
|
-
|
|
529
404
|
return 0
|
|
530
405
|
|
|
531
406
|
|