Deepen architecture: data seam, project corpus, score evaluator, run-lifecycle#1
Merged
Merged
Conversation
…un-lifecycle Implements the four deepening opportunities from the architecture review. #2 Data seam (keystone): extract electron/schema.ts (pure DDL); add a swappable DbDriver behind db.ts — IPC in prod, an in-memory node:sqlite adapter running the real Query Registry in tests — so the 20 analysis services become a reachable test surface. Services unchanged. #4 Project Corpus: loadProjectCorpus unifies the load-and-count prelude; coverage, track, compare, coverage-2d and gap refactored onto it so their numbers reconcile by construction (proven by reconciliation.test). #1 Score evaluator: pure wedding-cake core + a Rule Evaluator Registry + evaluateScore returning a generic Evaluation Trace. Collapses the triplicated Wedding-Cake math + mode decision from Track, Compare and the Score page; Score renders the trace as the "Why this score" panel. #3 Run-lifecycle: useAnalysis hook (cancel-safe via run-id, auto-deps, progress), PolaritySelector (standardised on `both`), MLCaveatBanner (per-session dismiss). Adopted in Coverage and Gap; jsdom test infra added. 44 tests pass (was 12, all pure helpers); typecheck, lint and build clean. SQL stays in the electron bundle only. Adds CONTEXT.md and the plan doc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ages Migrates the remaining seven pages onto the Phase #3 modules so the run/error/empty/caveat scaffolding lives once: - useAnalysis: Read (concordance auto-run — fixes a real missing cancel guard), Track, Compare, Score, Audit, Map, Discover (both sub-tabs). Pages with rich progress objects (Audit, Discover synonyms) keep their own progress state while the hook owns running/error/result; success/ failure toasts preserved. - PolaritySelector: Read and Audit (migrating their `all` → `both`), Map (mode-dependent options). - MLCaveatBanner: Audit anomalies, Discover synonyms, and a new IA-specified semantic-similarity caveat on Map's two-axis matrix. 44 tests pass; typecheck, lint and build clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
electron-builder skips code signing on pull-request builds, leaving the
.app unsigned. The afterSign notarize hook then failed in @electron/
notarize's checkSignatures step ("Failed to display codesign info … code 1"),
breaking PR CI — surfaced by the repo's first-ever PR (releases ship via
signed tag builds, which are unaffected).
Guard the hook with a `codesign -dv` precheck: if the app isn't signed,
skip notarization instead of failing. PR builds still validate the full
compile + packaging across all three platforms.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…only) The macOS PR build attempted code signing (CSC_* secrets are available on same-repo PRs) and failed: electron-builder's pull-request signing path is inconsistent across the x64/arm64 pair, and notarization shouldn't run on every PR anyway. On pull_request events, blank the CSC_*/NOTARIZE_* env and set CSC_IDENTITY_AUTO_DISCOVERY=false so electron-builder builds an unsigned app; scripts/notarize.js then skips via its codesign precheck. Tag (v*) release builds are unchanged — they still sign, notarize and publish. PR CI now validates compile + packaging across macOS, Linux and Windows without touching signing secrets. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
macOS has hardenedRuntime enabled, so electron-builder forces an arm64 codesign even when signing is "skipped" — which fails on PR builds that have no usable signing identity. Rather than chase electron-builder's PR-signing internals, build macOS only on v* tag releases (where signing, notarization and publishing already work). PRs now validate Linux + Windows via a dynamic matrix. The JS build steps (typecheck, vite build) are identical across platforms, so PR signal is effectively unchanged; macOS packaging/signing is exercised at release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the four deepening opportunities from the architecture review, in dependency order. Goal: testability and AI-navigability — turn shallow/duplicated modules into deep ones.
What changed
#2 — Data seam (keystone)
electron/schema.ts(pure DDL + version);database.tskeeps the Electron lifecycle.DbDriverbehinddb.ts— IPC in prod, an in-memorynode:sqliteadapter running the real Query Registry in tests. The 20 analysis services are unchanged but now reachable from node tests.#4 — Project Corpus
loadProjectCorpus()unifies the load-and-count prelude;coverage,track,compare,coverage-2d,gaprefactored onto it so their numbers reconcile by construction.#1 — Score evaluator
_shared/wedding-cake.tscore + a Rule Evaluator Registry +evaluateScorereturning a generic Evaluation Trace. Collapses the triplicated Wedding-Cake math from Track, Compare and the Score page; Score renders the trace as the "Why this score" panel.#3 — Run-lifecycle
useAnalysishook (cancel-safe via run-id, auto-deps, progress),PolaritySelector(standardised onboth),MLCaveatBanner(per-session dismiss).Verification
typecheck,lint, andbuild:viteclean locally. SQL stays in the electron bundle only (threat model preserved).CONTEXT.md(domain + architecture vocabulary) and the implementation plan.🤖 Generated with Claude Code