Commit graph

297 commits

Author SHA1 Message Date
01312b89fe Keep single-device circuit names equal to their device row
A circuit with exactly one device row and no fed distribution board is
shown as that row, so its own name was hidden and could drift (e.g.
"Neuer Stromkreis" in the print view). Commands that create or leave
such a circuit, rename its row or unlink its downstream board now set
the circuit name to the row name and store the change as optional
circuitDisplayNames, so Undo restores an overwritten free name exactly.
Migration 0016 aligns existing data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:56:02 +01:00
58cec53713 Keep manual quantity in editor group-delete snapshots
The editor built the circuit-group subtree snapshot without
manualQuantity, while the server compares it with an exact capture that
includes the column. Deleting any group that contained a device row was
therefore rejected with "Circuit-group subtree changed before deletion."

The new integration test builds the snapshot from the real circuit-tree
read model, as the editor does, and deletes the group for a manual row
and for a row with a Revit quantity share.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:23:51 +01:00
7222398628 Typecheck tests against current types
tsx runs tests without type checking and tsconfig.json covers only src,
so 71 type errors had accumulated unnoticed. tsconfig.tests.json now
checks every test and helper, and npm run typecheck includes it.

Fixtures gain the fields the DTOs have grown since they were written
(manualQuantity, circuit apparent power/cos phi, downstream board loads,
section totals, building, cover and board info fields). Repository
lookups that return "row ?? null" now declare the null in their type,
which their callers already handle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 13:17:45 +01:00
a8cc7eca5e Tighten rejection tests to their expected errors
Every assert.throws now names the error it expects, so a broken fixture
or an unrelated failure can no longer satisfy a rejection test. Zod
rejections are matched by issue path and code via tests/support/zod-assertions.ts.

Restore snapshot coverage lost with the release baseline: invalid board
floor, room floor and circuit section references and a reserve state
that contradicts the device rows are rejected again under test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 12:27:46 +01:00
cc4eefcb86 Merge branch 'security-baseline'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 11:40:59 +01:00
Grovy311
9974948b54 fix(deps): npm audit fix 2026-10-28 (nur Lockfile)
Some checks failed
security-baseline / secrets (push) Has been cancelled
security-baseline / node (push) Has been cancelled
security-baseline / semgrep (push) Has been cancelled
security-baseline / trivy (push) Has been cancelled
npm audit --audit-level=high war im prepush nach dem Baseline-Rollout rot.
npm audit fix ohne --force, package.json unverändert. Geändert:
- body-parser 2.3.0->2.4.0
- iconv-lite 0.7.2->0.7.3
- zod 4.4.1->4.6.7

Moderat offen (Fix nur per --force bzw. Major): esbuild uuid

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 06:38:09 +01:00
Grovy311
e39de4ddf5 chore(security): Baseline-Update 2026-10-27 (mutation_check, Testvorlage)
Aus cj/security-baseline 3a23c7a übernommen:
- scripts/security/mutation_check.py: Syntax-/Importfehler aus einer Mutation zählen nicht
  mehr als getötet ([UNGÜLTIG]); getötet nur bei echtem Testfehler (pytest, unittest,
  node:test spec und TAP), TODO-/SKIP-Tests sind kein Beleg.
- Sicherheitstest-Vorlage: ungültige Eingaben müssen konfiguriert sein (Leerlauf-Sperre).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 23:19:42 +01:00
Grovy311
02637c1f32 chore(security): Baseline-Update 2026-10-27 (mutation_check, Testvorlage)
Aus cj/security-baseline a04c20b übernommen:
- scripts/security/mutation_check.py: Syntax-/Importfehler aus einer Mutation zählen nicht
  mehr als getötet ([UNGÜLTIG]); getötet nur bei echtem Testfehler (pytest, unittest,
  node:test spec und TAP), TODO-/SKIP-Tests sind kein Beleg.
- Sicherheitstest-Vorlage: ungültige Eingaben müssen konfiguriert sein (Leerlauf-Sperre).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 22:04:48 +01:00
Grovy311
0ee9e4dd38 docs(security): R6 behoben, LAN-Port 3090 geschlossen
Some checks failed
security-baseline / secrets (push) Has been cancelled
security-baseline / node (push) Has been cancelled
security-baseline / semgrep (push) Has been cancelled
security-baseline / trivy (push) Has been cancelled
Deploy auf cj-ki: Web-Container nur noch 127.0.0.1:3090, Caddy über das Docker-Netz,
COOKIE_SECURE=true geprüft.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 13:13:18 +02:00
Grovy311
e51752f3e1 docs(security): Design-Entscheidung D1 (Projekte teamweit geteilt) eintragen
Some checks are pending
security-baseline / secrets (push) Waiting to run
security-baseline / node (push) Waiting to run
security-baseline / semgrep (push) Waiting to run
security-baseline / trivy (push) Waiting to run
Julian hat am 17.10.2026 bestaetigt: die Software laeuft nur im eigenen
Team, alle Nutzer sehen alle Projekte. Bevor Externe Konten bekommen, wird
Besitz/Freigabe pro Projekt eingefuehrt. R3 (ASVS-light B1/B2) damit nicht
anwendbar; idorGap-Kommentar und AGENTS.md verweisen auf D1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:56:23 +02:00
Grovy311
1cf406d216 docs(security): Threat-Model anlegen, Entscheidung zu geteilten Projekten offen
Some checks are pending
security-baseline / secrets (push) Waiting to run
security-baseline / node (push) Waiting to run
security-baseline / semgrep (push) Waiting to run
security-baseline / trivy (push) Waiting to run
docs/THREATMODEL.md (threat-model-light): System, Assets, Angreifer,
Vertrauensgrenzen, Risiken R1-R14 mit Beleg. R3 (ASVS-light B1/B2) bleibt
offen, bis Julian E1 (Projekte teamweit geteilt) bestaetigt. idorGap-
Kommentar und AGENTS.md verweisen darauf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:40:43 +02:00
Grovy311
b0e8161918 fix(security): mutation_check ohne veralteten Bytecode, ruff-fest
Some checks are pending
security-baseline / secrets (push) Waiting to run
security-baseline / node (push) Waiting to run
security-baseline / semgrep (push) Waiting to run
security-baseline / trivy (push) Waiting to run
Stand cj/security-baseline: PYTHONDONTWRITEBYTECODE und Cache-Löschung nach jedem
Schreiben (gleich lange Mutationen liefen sonst mit altem .pyc), Testaufruf so
umbrochen, dass noqa/nosec bei 88 Zeichen auf der Aufrufzeile bleiben.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:34:13 +02:00
Grovy311
a20b6230db fix(security): mutation_check ohne veralteten Bytecode
Gleich lange Mutationen (z. B. extra="forbid" -> "ignore") liefen mit altem .pyc, weil
Python den Cache nur über mtime in Sekunden und Größe prüft. Jetzt PYTHONDONTWRITEBYTECODE
und Cache-Löschung nach jedem Schreiben (cj/security-baseline).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:31:47 +02:00
Grovy311
ee117958b3 fix(security): stamp.py schreibt kein __pycache__ mehr
Ohne passende .gitignore machte der Cache den Arbeitsbaum unsauber, kein
Prüfstempel war gültig.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 11:10:44 +02:00
Grovy311
e2cc00dccc chore(security): Baseline-Update Prüfstempel und release-checks
Makefile und scripts/security/stamp.py aus cj/security-baseline, leere
docs/RELEASE-AUSNAHMEN.md, AGENTS.md-Abschnitt zu Stempeln und Release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:46:29 +02:00
Grovy311
ad9ca4cae5 chore(baseline): make prepush/weekly, scanner fix for git worktrees
Some checks failed
security-baseline / secrets (push) Has been cancelled
security-baseline / node (push) Has been cancelled
security-baseline / semgrep (push) Has been cancelled
security-baseline / trivy (push) Has been cancelled
Update the Test & Security Baseline from cj/security-baseline (364d756):
- make prepush runs only the checks the diff needs (scripts/security/changed_scope.py)
- make weekly = check + trivy-fs, run by the weekly cron on cj-ki
- in git worktrees gitleaks scanned 0 commits and Semgrep ignored .gitignore (.next/); fixed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 07:28:10 +02:00
Grovy311
afd8019a7b Address security review notes
Some checks are pending
security-baseline / secrets (push) Waiting to run
security-baseline / node (push) Waiting to run
security-baseline / semgrep (push) Waiting to run
security-baseline / trivy (push) Waiting to run
- log only the error name for rejected 4xx requests (JSON.parse messages
  can quote the request body, e.g. a password)
- refuse LB_DATABASE_PATH in production; it is test-only
- fix two stale file references in the skill texts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:45:59 +02:00
Grovy311
a7a1595cbf Add test and security baseline
- make quick/check/mutation from cj/security-baseline (Makefile unchanged,
  settings in baseline.mk), pre-commit, gitleaks, Semgrep rules, ESLint
  security rules, Forgejo workflow
- tests/security: generic baseline tests plus app config and role tests
  against createApp() with an in-memory database
- extract createApp() from src/server/index.ts; LB_DATABASE_PATH for tests
- fix gaps found by the tests: reject unknown fields on project create,
  answer malformed JSON with 400 instead of 500, set nosniff on the API
- npm audit fix (next 16.4.1 and others, no high/critical left)
- clear ESLint errors, safeFileName without control-character regex
- per-project ownership stays an open, documented gap (idorGap -> TODO)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:40:33 +02:00
Grovy311
67476ea59b Add agent security skills for Codex and Claude Code
Same skills in .agents/skills (Codex) and .claude/skills (Claude Code):
codeguard, security-review, dependency-vetting, pre-release-gate,
authz-idor-audit, threat-model-light. Source: cj/claude-skills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 09:40:33 +02:00
431f9ff059 Normalize external model state comparisons 2026-09-30 21:19:16 +02:00
4ff01b2ccd Harden Linear XLSX end to end 2026-09-30 21:02:20 +02:00
2581beee3c Add Linear XLSX follow-up import 2026-09-30 20:40:40 +02:00
1a4c8cad8c Add Revit return workbook export 2026-09-30 15:15:17 +02:00
77d775fde1 Complete Revit object editor assignments 2026-09-30 14:35:14 +02:00
4489cd76f0 Allow saving default Revit settings 2026-09-30 13:51:43 +02:00
4ac32e103d Add virtualized Revit object planning 2026-09-30 10:03:36 +02:00
bfdd048269 Add Linear XLSX initial import 2026-09-30 09:50:58 +02:00
c633e78cd4 Add Revit XLSX settings page 2026-09-30 09:02:52 +02:00
1cfeb06ec7 Replace Revit CSV backend with Linear XLSX 2026-09-30 08:46:07 +02:00
52d3b1a270 Add Linear Excel transport 2026-09-30 07:42:16 +02:00
d4803a18d2 Document Linear Excel integration 2026-09-29 22:28:16 +02:00
ae318a51ac Audit Linear Excel integration 2026-09-29 21:57:40 +02:00
cf022b250f Format project device power values on project page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 22:46:32 +02:00
68d986ff80 Merge pull request 'User management with login, roles and a Config area' (#25) from feature/user-management into main 2026-09-28 22:43:14 +02:00
3670f02ccd Document authenticated deployment 2026-09-28 22:42:11 +02:00
847f4e9493 Harden user management integration 2026-09-28 22:42:03 +02:00
73579d1e79 Merge branch 'main' into feature/user-management 2026-09-28 22:32:48 +02:00
0a37783635 Improve feeder circuit creation workflow 2026-09-28 22:15:12 +02:00
9165b8238c Compact single-board feeder circuit rows 2026-09-28 22:14:39 +02:00
ade21fe386 Create feeder circuits while linking boards 2026-09-28 22:14:30 +02:00
Grovy311
728132e52a Warn at startup when no user exists and no bootstrap admin is configured
Also document that Sec-Fetch-Site is only sent over HTTPS, so plain-HTTP
LAN access relies on SameSite=Lax alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:47:30 +02:00
Grovy311
95bfba2f67 Merge origin/main into feature/user-management
Renumber the users migration to 0013_users so it follows the upstream
0012_good_gateway (logical board feeds); AGENTS.md deferred-work list keeps
both the new feed items and the auth items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:46:21 +02:00
Grovy311
5073d9342a Harden authentication and put filter toggle and fields in one row
Security: per-username login throttling, constant-time unknown-user check,
Sec-Fetch-Site CSRF guard for writes, session rotation on login and
password change, absolute session lifetime, sessions ended on reset and
deactivation, last-admin protection, input length caps, ASCII usernames,
clickjacking headers. Covered by tests/authentication.test.ts.

Filter panel: toggle, fields and count share one row to save space.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-28 21:30:30 +02:00
552362bad1 Merge Issue #3 logical distribution board feeds 2026-09-28 20:58:35 +02:00
b74b495fab Update print view and documentation for logical feeds 2026-09-28 20:57:58 +02:00
Grovy311
8d2948cdb1 Match sidebar bottom layout to the Wochenplanung reference (theme toggle + Abmelden in one row)
Square icon-only theme toggle sits next to the Abmelden button in a shared
row, collapsing to just the toggle when the sidebar is collapsed - same
arrangement as pm-app's Sidebar.tsx.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 20:32:26 +02:00
Grovy311
c56cfb30ad Add login-required user management (admin/user roles, Config->Benutzer)
No self-signup: admins create every account in Config -> Benutzer with a
typed start password; a forced password change gates first use. Session-
cookie auth protects all /api/* routes; /api/users additionally requires
the admin role. See docs/authentication.md.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-28 19:51:47 +02:00
042a050876 Show logical feeder loads in project and circuit views 2026-09-27 22:37:04 +02:00
dfeb0e3cb6 Add recursive distribution board load projection 2026-09-27 22:31:56 +02:00
855a04e655 Protect referenced feeder structures from deletion 2026-09-27 22:25:47 +02:00